/* Karen: reminder emails on Invoices to chase (ar-email.js). Calm: one filled button, tiers as
   plain underlined text, a quiet preview beside the email on wide screens. */

/* "Email reminder" beside Call on a customer's card */
.achead .acts .link.acmail { min-height: 36px; padding: 0 8px; font-size: 14px; }
.achead .acts .link.acmail:hover { text-decoration: underline; }

/* Picking customers for several reminders */
.achead.picking { padding-left: 12px; }
.arpick { display: inline-grid; place-items: center; width: 32px; height: 32px; flex: none; cursor: pointer; }
.arpicklink { min-height: 40px; white-space: nowrap; }
.arbar { margin: 0 0 12px; }
.arpickbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 10px 12px 10px 16px; font-size: 14px; }
.arpickbar .arsp { flex: 1 1 0; min-width: 0; }

/* The email, open in a card or in the stepper */
.arx { display: flex; flex-direction: column; gap: 12px; min-width: 0; padding: 12px 16px 16px; border-top: 1px solid var(--divider); background: #F7FAF8; }
.arstepbody { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.arx .situation, .arstepbody .situation { max-width: 76ch; }
.artiers { display: flex; flex-wrap: wrap; gap: 4px 18px; border-bottom: 1px solid var(--divider); }
.artier { border: 0; background: transparent; padding: 8px 0 6px; min-height: 40px; font: 600 14px var(--font); color: var(--grey-ink); cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1px; }
.artier small { font-weight: 500; color: var(--muted); }
.artier:hover { color: var(--ink); }
.artier.on { color: var(--green-900); border-bottom-color: var(--green-700); }
.artier:focus-visible { outline: 2px solid var(--green-700); outline-offset: 2px; }

/* Preview: close to what the customer gets (inbox-send's branded layout) */
.arpvbox { margin-top: 6px; }
.arpvmail { border: 1px solid var(--line); border-radius: 10px; background: var(--surface); overflow: hidden; min-width: 0; }
.arpvbrand { padding: 14px 20px 12px; background: #F6F6F6; border-bottom: 3px solid #01A3B3; font-size: 18px; font-weight: 700; color: #323232; }
.arpvbody { padding: 16px 20px 18px; font-size: 14px; line-height: 1.55; color: #323232; overflow-wrap: break-word; }
.arpvbody h3 { margin: 0 0 12px; font-size: 19px; font-weight: 700; }
.arpvbody p { margin: 0 0 12px; }
.arpvbody p:last-child { margin-bottom: 0; }
.arpvmail.b-c2u .arpvbrand { background: #560F1C; color: #FFFFFF; border-bottom: 5px solid #FDB91C; }
.arpvmail.b-ed .arpvbrand { background: #FFFFFF; border-bottom-color: #EB6D20; color: #17153A; }
.arbrand { margin-top: 10px; }
.arpvt { width: 100%; border-collapse: collapse; margin: 4px 0 14px; font-size: 13px; border: 1px solid #C5C5C5; }
.arpvt th { background: #EAEAEA; text-align: left; padding: 6px 8px; font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; }
.arpvt td { padding: 7px 8px; border-top: 1px solid #DEDEDE; vertical-align: top; overflow-wrap: anywhere; }
.arpvt .r { text-align: right; white-space: nowrap; }
.arpvt td.red { color: #B42318; }
.arpvt tr.tot td { font-weight: 700; border-top: 2px solid #323232; }

/* Needs setup, sending countdown, buttons */
.arsetup { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; font-size: 14px; }
.arsecrets { display: inline-flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; font-size: 13px; }
.arsecrets code { font-size: 12px; background: var(--ground); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; }
.arbtns { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; }
.arbtns .btn { white-space: normal; text-align: left; overflow-wrap: anywhere; max-width: 100%; }
.arbtns .btn[aria-disabled="true"] { opacity: 0.55; }
.arbtns .link { min-height: 40px; }
.arpending { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 10px 14px; border-radius: 10px; background: var(--ink); color: #FFFFFF; font-size: 15px; }
.arpending .btn { background: transparent; color: #FFFFFF; border-color: rgba(255, 255, 255, 0.5); }
.arpending .btn:hover { background: rgba(255, 255, 255, 0.12); color: #FFFFFF; text-decoration: none; }
.arpending .link { color: #FFFFFF; text-decoration: underline; }

/* Several in a row */
.arstep { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.arstephead { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; font-size: 14px; }
.arstephead .iconbtn { margin-left: auto; }
.arstepname { margin: 0; font-size: 20px; font-weight: 800; overflow-wrap: anywhere; }

/* Accounts settings */
.arsettings .artiers { margin-top: 18px; }
.arsettings p.arsecrets { margin: 6px 0 0; }

@media (pointer: coarse), (max-width: 900px) {
  .artier, .arpick, .arbtns .link, .arpicklink, .achead .acts .link.acmail { min-height: 44px; }
  .arpick { width: 44px; height: 44px; }
}

/* Bulk review */
.arreview { display: flex; flex-direction: column; gap: 12px; margin: 0 0 20px; }
.arreview h2 { margin: 0; font-size: 18px; }
.arrevpv > summary { cursor: pointer; color: var(--muted); font-size: 14px; min-height: 40px; display: flex; align-items: center; }
.arbulk { margin: 0 0 16px; }
.arbulkdone { margin: 0 0 16px; }

/* Design pass: invoice numbers never wrap in the preview; the next chase is the shared date picks */
.arpvt td:first-child { white-space: nowrap; overflow-wrap: normal; }
.arnextpick { margin-top: 2px; }


/* The composer, laid out like a Gmail compose window: From / To / Subject lines, then the email
   as the customer sees it, written straight into. The customer pop-up widens while it's open. */
dialog.pop:has(.arc) { width: min(860px, calc(100% - 24px)); }
.arc { display: flex; flex-direction: column; min-width: 0; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); overflow: hidden; }
.arc-line { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 14px; border-bottom: 1px solid var(--divider); font-size: 14px; }
.arc-k { flex: none; width: 58px; color: var(--muted); font-size: 14px; font-weight: 500; }
.arc-v { flex: 1 1 auto; min-width: 0; color: var(--ink); overflow-wrap: anywhere; }
.arc-addr { color: var(--muted); }
.arc-in { flex: 1 1 auto; min-width: 0; min-height: 42px; border: 0; padding: 0; background: transparent; font: 400 14px var(--font); color: var(--ink); box-shadow: none; }
.arc-in:focus { outline: none; }
.arc-line:focus-within { box-shadow: inset 0 -2px 0 var(--green-700); }
.arc-brand { flex: none; max-width: 180px; }
.arc-note { margin: 0; padding: 8px 14px; font-size: 13px; color: var(--amber); background: var(--amber-bg); border-bottom: 1px solid var(--divider); }
.arc-mail { margin: 14px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; min-width: 0; }
.arc-mail.b-c2u .arpvbrand { background: #560F1C; color: #FFFFFF; border-bottom: 5px solid #FDB91C; }
.arc-mail.b-ed .arpvbrand { background: #FFFFFF; border-bottom-color: #EB6D20; color: #17153A; }
.arc-body { padding: 16px 20px 18px; font-size: 14px; line-height: 1.55; color: #323232; min-width: 0; }
.arc-body h3 { margin: 0 0 10px; font-size: 19px; font-weight: 700; }
.arc-txt { display: block; width: 100%; min-height: 0; resize: none; overflow: hidden; border: 1px solid transparent; border-radius: 6px; padding: 4px 6px; margin: 0 -7px 8px;
  background: transparent; font: 400 14px/1.55 var(--font); color: #323232; box-shadow: none; }
.arc-txt:hover { border-color: var(--line); }
.arc-txt:focus { outline: none; border-color: var(--green-700); background: #FFFFFF; }
.arc-tbl { overflow-x: auto; margin: 4px 0 12px; }
.arc-tbl .arpvt { margin: 0; }
.arc-tbl .arpvt td, .arc-tbl .arpvt th { white-space: nowrap; overflow-wrap: normal; }
.arc-fixed, .arc-sig { margin: 0 0 12px; }
.arc-sig { color: #5B5B5B; }
.arc-sig.none { color: var(--amber); }
.arc-att { margin: 0 14px 14px; font-size: 13px; color: var(--grey-ink); }
.arc-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; }
.arc-foot .btn[aria-disabled="true"] { opacity: 0.55; }
.arc-foot .link { min-height: 40px; }
.arc-next { display: flex; align-items: center; gap: 8px; }
.arc-next .arc-k { width: auto; }
.arc-sp { flex: 1 1 0; }
@media (max-width: 640px) { .arc-mail { margin: 10px; } .arc-body { padding: 12px 14px; } .arc-k { width: 52px; } }
/* Beat the form defaults: the To and Subject lines and the email text have no boxes of their own */
.arc input.arc-in, .arc input.arc-in:focus { border: 0; outline: none; padding: 0; width: auto; height: 42px; min-height: 42px; background: transparent; border-radius: 0; }
.arc textarea.arc-txt { padding: 4px 6px; resize: none; }
.arc textarea.arc-txt:focus { outline: none; }

/* The brand header with the real logo, like the emails Karen sends from n8n */
.arc-mail .arpvbrand { padding: 22px 24px 18px; }
.arc-mail.b-c2u .arpvbrand { padding: 10px 24px; }
.arc-logo { display: block; width: 220px; max-width: 100%; height: auto; }
.arc-mail.b-c2u .arc-logo { width: 300px; }
/* The sender's Gmail signature, as it will be sent */
.arc-sig.sig-body { user-select: none; }
.arc-sig.sig-body table { width: auto; font-size: inherit; }
.arc-sig.sig-body td, .arc-sig.sig-body th { padding: 0; border: 0; height: auto; background: none; font-size: inherit; white-space: normal; vertical-align: middle; }
.arc-sig.sig-body img { max-width: 100%; height: auto; }

/* The review: one row per customer with their email in a box (like Xero's Email invoices), a cross to take them out */
.arreview .msg.warn { color: var(--amber); }
.arvtbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.arvtbl th { height: auto; padding: 6px 8px; background: none; color: var(--muted); font-size: 12px; font-weight: 600; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
.arvtbl td { padding: 8px; border-top: 1px solid var(--divider); vertical-align: middle; }
.arvtbl tbody tr:first-child td { border-top: 0; }
.arvtbl .arv-n { width: 14%; color: var(--muted); white-space: nowrap; }
.arvtbl .arv-c { width: 30%; }
.arvtbl .arv-c .bdot { margin: 0 6px 1px 0; }
.arvtbl .arv-c b { font-weight: 600; overflow-wrap: anywhere; }
.arvtbl .arv-c small { display: block; margin-top: 2px; font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.arvtbl tr.skip .arv-c small { color: var(--amber); }
.arvtbl .arv-c small .link { min-height: 0; }
.arvtbl .arv-e { width: 34%; }
.arvtbl .arv-o { width: 12%; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.arvtbl th.arv-o { text-align: right; }
.arvtbl .arv-x { width: 44px; text-align: right; }
.arrevin { width: 100%; box-sizing: border-box; min-height: 36px; padding: 0 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); font: inherit; color: var(--ink); }
.arrevin:focus-visible { outline: 2px solid var(--green-700); outline-offset: 1px; }
.arrevin.need { border-color: var(--amber-bar); background: var(--amber-bg); }
.arrevin.bad { border-color: var(--red); background: var(--red-bg); }
.arrevx { display: inline-grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 4px; background: var(--divider); color: var(--muted); cursor: pointer; }
.arrevx svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.arrevx:hover, .arrevx:focus-visible { background: var(--line); color: var(--ink); }
@media (max-width: 720px) {
  .arvtbl thead { display: none; }
  .arvtbl, .arvtbl tbody { display: block; }
  .arvtbl tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 8px; padding: 10px 0; border-top: 1px solid var(--divider); }
  .arvtbl tbody tr:first-child { border-top: 0; }
  .arvtbl td { display: block; padding: 0; border: 0; }
  .arvtbl .arv-n, .arvtbl .arv-c, .arvtbl .arv-e, .arvtbl .arv-o, .arvtbl .arv-x { width: auto; }
  .arvtbl .arv-n { white-space: normal; }
  .arvtbl .arv-c { grid-column: 1; grid-row: 1; }
  .arvtbl .arv-x { grid-column: 2; grid-row: 1; }
  .arvtbl .arv-n { grid-column: 1; grid-row: 2; }
  .arvtbl .arv-o { grid-column: 2; grid-row: 2; }
  .arvtbl .arv-e { grid-column: 1 / -1; grid-row: 3; }
  .arrevin { min-height: 44px; }
  .arrevx { width: 36px; height: 36px; }
}
