/* u105-ai-tower-ui — the AI Employee Control Tower (Practice → AI Employees).
   Cobalt Paper with the Update 95 card look: hairline cards, tabular numerals,
   cobalt for anything clickable, burnt orange ONLY to say "needs you", green and
   red for live / down. .ait-* only; nothing here restyles another view. */

/* page header, as look.css draws it on the six restyled screens */
#view-aitower { padding: 0 8px; }
#view-aitower > .topbar { position: static; background: transparent; border: 0; margin: 0 0 18px; padding: 28px 0 0; min-height: 0; height: auto; display: flex; flex-wrap: wrap; align-items: center; column-gap: 14px; row-gap: 6px; }
#view-aitower > .topbar::before { content: "Practice / AI Employees"; order: 0; flex: 1 1 100%; font-size: 11.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); }
#view-aitower > .topbar > * { order: 2; }
#view-aitower > .topbar > .ait-title { order: 1; display: flex; align-items: center; gap: 12px; min-width: 0; }
#view-aitower > .topbar h1 { font-family: var(--font-display, inherit); font-size: 32px; line-height: 1.1; font-weight: 700; letter-spacing: -0.03em; color: var(--text); margin: 0; }
#view-aitower > .topbar > .topbar-right { margin-left: auto; }
#view-aitower > .topbar > .counts { order: 3; flex: 1 1 100%; font-size: 13px; color: var(--ink-3); white-space: normal; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ait-back { height: 32px; width: 32px; padding: 0; display: inline-flex; align-items: center; justify-content: center; }
#aitPanel { display: flex; flex-direction: column; gap: 18px; max-width: 1240px; min-width: 0; padding-bottom: 40px; }
#aitPanel > * { min-width: 0; }
#aitTabBody, .ait-col { display: flex; flex-direction: column; gap: 14px; min-width: 0; }

/* the one number, visible everywhere */
.ait-one { display: flex; align-items: baseline; gap: 18px; flex-wrap: wrap; font-size: 14px; color: var(--text-2); }
.ait-one b { font-family: var(--font-display); font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.ait-one .ait-one-main b { color: var(--amber); }
.ait-one .ait-one-main.zero b { color: var(--green); }

/* tiles */
.ait-tiles { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.ait-tile { border: 1px solid var(--border); border-radius: 10px; background: var(--surface); padding: 16px 18px; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.ait-k { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-4); font-weight: 700; }
.ait-v { font-family: var(--font-display); font-size: 30px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.1; font-variant-numeric: tabular-nums; color: var(--text); }
.ait-note { font-size: 12.5px; color: var(--ink-3); }
.ait-tile.you { border-color: var(--amber); box-shadow: inset 4px 0 0 var(--amber); }
.ait-tile.you .ait-v { color: var(--amber); }
.ait-tile.you.zero { border-color: var(--border); box-shadow: none; }
.ait-tile.you.zero .ait-v { color: var(--green); }
.ait-tile.down .ait-v { color: var(--red); }
@media (max-width: 1100px) { .ait-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* employee cards */
.ait-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 440px), 1fr)); gap: 14px; }
.ait-card { border: 1px solid var(--border); border-radius: 10px; background: var(--surface); padding: 18px 20px; display: flex; flex-direction: column; gap: 12px; cursor: pointer; text-align: left; font: inherit; color: inherit; }
.ait-card:hover, .ait-card:focus-visible { border-color: var(--accent-line); outline: none; }
.ait-card-h { display: flex; align-items: center; gap: 12px; }
.ait-card-h .ait-avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-ink); display: inline-flex; align-items: center; justify-content: center; font-size: 20px; flex: 0 0 40px; }
.ait-card-h b { font-family: var(--font-display); font-size: 18px; letter-spacing: -0.02em; }
.ait-card-h .ait-sub { font-size: 12.5px; color: var(--ink-3); }
.ait-card-h > div { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ait-doing { font-size: 13.5px; color: var(--text); background: var(--bg); border-radius: 8px; padding: 9px 12px; }
.ait-doing small { display: block; color: var(--ink-3); font-size: 12px; margin-top: 2px; }
.ait-kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; font-size: 13.5px; }
.ait-kv > span:nth-child(odd) { color: var(--ink-3); }
.ait-kv > span:nth-child(even) { font-variant-numeric: tabular-nums; }
.ait-card-foot { font-size: 12.5px; color: var(--ink-3); display: flex; align-items: center; gap: 6px; }
.ait-more { font-size: 13px; color: var(--ink-3); }

/* the state light */
.ait-light { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: var(--r-pill); font-size: 12.5px; font-weight: 600; white-space: nowrap; background: var(--sunken); color: var(--ink-3); }
.ait-light::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.ait-light.green { background: var(--green-soft); color: var(--green); }
.ait-light.red { background: var(--red-soft); color: var(--red); }
.ait-light.amber { background: var(--amber-soft); color: var(--amber); }

/* cards and lists */
.ait-box { border: 1px solid var(--border); border-radius: 10px; background: var(--surface); overflow: hidden; }
.ait-box > h3 { margin: 0; padding: 12px 18px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 15px; }
.ait-box > h3 .ait-hint { font-family: var(--font-body); font-weight: 400; font-size: 12.5px; color: var(--ink-3); }
.ait-box-body { padding: 14px 18px; display: flex; flex-direction: column; gap: 10px; font-size: 13.5px; }
.ait-right { margin-left: auto; }
.ait-hint { font-family: var(--font-body); font-weight: 400; font-size: 12.5px; color: var(--ink-3); letter-spacing: 0; }
.ait-empty { padding: 22px 18px; color: var(--ink-3); font-size: 13.5px; }
.ait-empty b { color: var(--text); }
.ait-tabs { margin: -4px 0 0; flex-wrap: wrap; }
.ait-tabs button { display: inline-flex; align-items: center; gap: 6px; }
.ait-tabcount { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: var(--r-pill); background: var(--sunken); color: var(--ink-3); font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums; }
.ait-tabcount.attn { background: var(--amber-soft); color: var(--amber); }
.ait-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* Needs people */
.ait-person > h3 .ait-pname { font-family: var(--font-display); font-size: 16px; letter-spacing: -0.01em; }
.ait-client-h { padding: 8px 18px; background: var(--bg); border-bottom: 1px solid var(--border); font-size: 12.5px; font-weight: 600; color: var(--text-2); display: flex; gap: 8px; }
.ait-client-h span { color: var(--ink-3); font-weight: 400; }
.ait-items { list-style: none; margin: 0; padding: 0; }
.ait-item { display: flex; gap: 14px; padding: 12px 18px; border-bottom: 1px solid var(--border); cursor: pointer; align-items: flex-start; }
.ait-item:last-child { border-bottom: 0; }
.ait-item:hover, .ait-item:focus-visible { background: var(--bg); outline: none; }
.ait-item-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.ait-item-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ait-item-title { font-size: 14px; font-weight: 600; color: var(--text); overflow-wrap: anywhere; }
.ait-item-how { font-size: 12.5px; color: var(--ink-3); overflow-wrap: anywhere; }
.ait-item-who { font-size: 12.5px; color: var(--text-2); }
.ait-item-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: 0 0 auto; text-align: right; }
.ait-amt { font-family: var(--font-display); font-weight: 700; font-size: 15px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ait-amt.neg { color: var(--red); } .ait-amt.pos { color: var(--green); }
.ait-age { font-size: 12.5px; color: var(--ink-3); white-space: nowrap; font-variant-numeric: tabular-nums; }
.ait-age.old { color: var(--amber); font-weight: 600; }
.ait-id { font-family: var(--font-mono); font-size: 11.5px; background: var(--sunken); color: var(--text-2); padding: 1px 7px; border-radius: 4px; white-space: nowrap; }
.ait-chip { display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: var(--r-pill); font-size: 11.5px; font-weight: 600; background: var(--accent-soft); color: var(--accent-ink); white-space: nowrap; }
.ait-chip.muted { background: var(--sunken); color: var(--ink-3); }
.ait-chip.attn { background: var(--amber-soft); color: var(--amber); }
.ait-chip.ok { background: var(--green-soft); color: var(--green); }
.ait-chip.bad { background: var(--red-soft); color: var(--red); }
.ait-qr { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.ait-qr code { font-family: var(--font-mono); font-size: 12px; background: var(--accent-soft); color: var(--accent-ink); padding: 2px 8px; border-radius: 6px; white-space: nowrap; }
details.ait-fold > summary { cursor: pointer; list-style: none; padding: 12px 18px; font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
details.ait-fold > summary::-webkit-details-marker { display: none; }
details.ait-fold > summary .ti { transition: transform .15s var(--ease, ease); }
details.ait-fold[open] > summary .ti-chevron-right { transform: rotate(90deg); }
details.ait-fold[open] > summary { border-bottom: 1px solid var(--border); }
.ait-item.closed .ait-item-title { color: var(--ink-3); font-weight: 500; }

/* tables */
.ait-scroll { overflow-x: auto; }
table.ait-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.ait-table th { text-align: left; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-4); font-weight: 700; padding: 9px 14px; border-bottom: 1px solid var(--border); background: var(--bg); white-space: nowrap; }
.ait-table td { padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
.ait-table tr:last-child td { border-bottom: 0; }
.ait-table tr.ait-click { cursor: pointer; }
.ait-table tr.ait-click:hover td, .ait-table tr.ait-click:focus-visible td { background: var(--bg); outline: none; }
.ait-table tr.ait-open td { background: var(--accent-soft); }
.ait-table td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ait-table tr.ait-sub td { background: var(--bg); padding: 0; }
.ait-table tr.ait-sub .ait-items { border-top: 1px solid var(--border); }
.ait-stages { display: inline-flex; gap: 4px; }
.ait-stage { width: 22px; height: 22px; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; border: 1px solid var(--border-2); color: var(--ink-4); background: var(--surface); }
.ait-stage.partly { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent-ink); }
.ait-stage.done { background: var(--green-soft); border-color: transparent; color: var(--green); }
.ait-stage-key { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--ink-3); padding: 10px 18px; border-top: 1px solid var(--border); }
.ait-muted { color: var(--ink-3); }
.ait-mono { font-family: var(--font-mono); font-size: 12px; }
.ait-nowrap { white-space: nowrap; }

/* events */
.ait-events { list-style: none; margin: 0; padding: 0; }
.ait-events li { display: grid; grid-template-columns: 120px 220px 1fr; gap: 14px; padding: 9px 18px; border-bottom: 1px solid var(--border); font-size: 13px; }
.ait-events li:last-child { border-bottom: 0; }
.ait-events time { color: var(--ink-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ait-events .ait-ev-client { color: var(--text-2); overflow-wrap: anywhere; }
.ait-events .ait-ev-text { overflow-wrap: anywhere; }
@media (max-width: 860px) { .ait-events li { grid-template-columns: 1fr; gap: 2px; } }

/* health and assignments */
.ait-hgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px 22px; }
.ait-hgrid > div { display: flex; flex-direction: column; gap: 2px; font-size: 13.5px; min-width: 0; }
.ait-hgrid > div > span:first-child { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-4); font-weight: 700; }
.ait-hgrid > div > span:last-child { overflow-wrap: anywhere; }
.ait-state { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); }
.ait-state > .ti { font-size: 24px; color: var(--ink-3); }
.ait-state b { font-family: var(--font-display); font-size: 18px; letter-spacing: -0.02em; display: block; }
.ait-state span { font-size: 13px; color: var(--text-2); }
.ait-state.green { background: var(--green-soft); border-color: transparent; } .ait-state.green > .ti, .ait-state.green b { color: var(--green); }
.ait-state.red { background: var(--red-soft); border-color: transparent; } .ait-state.red > .ti, .ait-state.red b { color: var(--red); }
.ait-state.amber { background: var(--amber-soft); border-color: transparent; } .ait-state.amber > .ti, .ait-state.amber b { color: var(--amber); }
.ait-digest-text { white-space: pre-wrap; font-family: var(--font-mono); font-size: 12px; line-height: 1.5; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; max-height: 360px; overflow: auto; margin: 0; }
.ait-previews { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.ait-previews h4 { margin: 0 0 6px; font-size: 13.5px; }
.ait-msg { font-size: 13px; padding: 9px 12px; border-radius: 8px; }
.ait-msg.ok { background: var(--green-soft); color: var(--green); }
.ait-msg.bad { background: var(--red-soft); color: var(--red); }
.ait-msg.info { background: var(--accent-soft); color: var(--accent-ink); }

/* the item drawer */
.ait-scrim { position: fixed; inset: 0; background: rgba(17, 24, 39, .28); z-index: 900; }
.ait-drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 100vw); background: var(--surface); border-left: 1px solid var(--border); box-shadow: var(--shadow-pop); z-index: 901; display: flex; flex-direction: column; }
.ait-drawer-h { display: flex; align-items: flex-start; gap: 10px; padding: 18px 20px 14px; border-bottom: 1px solid var(--border); }
.ait-drawer-h > div { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.ait-drawer-h h2 { margin: 0; font-family: var(--font-display); font-size: 19px; line-height: 1.25; letter-spacing: -0.02em; overflow-wrap: anywhere; }
.ait-drawer-b { flex: 1; overflow-y: auto; padding: 16px 20px 28px; display: flex; flex-direction: column; gap: 16px; font-size: 13.5px; }
.ait-sect > .ait-k { margin-bottom: 6px; display: block; }
.ait-detail { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.55; }
.ait-how { border: 1px solid var(--accent-line); background: var(--accent-soft); border-radius: 8px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.ait-how p { margin: 0; color: var(--text); overflow-wrap: anywhere; }
.ait-how .ait-qr code { background: var(--surface); }
.ait-phase { font-size: 12.5px; color: var(--ink-3); border-top: 1px dashed var(--border-2); padding-top: 8px; }
.ait-timeline { list-style: none; margin: 0; padding: 0 0 0 14px; border-left: 2px solid var(--border); display: flex; flex-direction: column; gap: 10px; }
.ait-timeline li { position: relative; display: flex; flex-direction: column; gap: 1px; }
.ait-timeline li::before { content: ""; position: absolute; left: -20px; top: 5px; width: 10px; height: 10px; border-radius: 50%; background: var(--surface); border: 2px solid var(--border-2); }
.ait-timeline li.closed::before { border-color: var(--green); background: var(--green); }
.ait-timeline li.answered::before { border-color: var(--accent); background: var(--accent); }
.ait-timeline li.chased::before, .ait-timeline li.escalated::before { border-color: var(--amber); }
.ait-timeline time { font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }

/* the sidebar count: orange only when something waits on you */
.sidebar .nav-item .nav-pill.ait-navpill-attn, .nav-pill.nav-pill-muted.ait-navpill-attn { background: var(--amber-soft); color: var(--amber); font-weight: 600; }

@media (max-width: 860px) {
  #view-aitower > .topbar h1 { font-size: 26px; }
  .ait-cards { grid-template-columns: 1fr; }
  .ait-item { flex-direction: column; gap: 6px; }
  .ait-item-side { flex-direction: row; align-items: center; }
}

/* u107-alice-auto-ui — the Tower's buttons (Update 107): "Waiting on you", the month approval /
   fix batch / rule drawers, the plan and the stopped banner on a client row, the bar of buttons.
   .ait-act-* (and three small .ait-* helpers) only. Red is used for one thing here: stopped, or
   something that cannot be put back. */
.ait-act-waiting > h3 .ait-tabcount { margin-left: -2px; }
.ait-act-stoprow { box-shadow: inset 4px 0 0 var(--red); }
.ait-act-stale { margin: 0; }
.ait-act-over { color: var(--amber); } .ait-act-under { color: var(--green); }
.ait-code { font-family: var(--font-mono); font-size: 14px; font-weight: 700; letter-spacing: .04em; background: var(--accent-soft); color: var(--accent-ink); padding: 3px 10px; border-radius: 6px; white-space: nowrap; }
.ait-act-headline { font-size: 15px; color: var(--text); overflow-wrap: anywhere; }
.ait-act-headline b { font-family: var(--font-display); font-size: 17px; letter-spacing: -0.01em; }
.ait-act-coderow, .ait-act-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.ait-act-mail { border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.ait-act-mail > div { display: grid; grid-template-columns: 64px 1fr; gap: 10px; padding: 7px 12px; border-bottom: 1px solid var(--border); font-size: 13px; }
.ait-act-mail > div > span:first-child { color: var(--ink-3); }
.ait-act-mail > div > span:last-child { overflow-wrap: anywhere; min-width: 0; }
.ait-act-mail pre { margin: 0; padding: 12px; white-space: pre-wrap; overflow-wrap: anywhere; font-family: var(--font-body); font-size: 13.5px; line-height: 1.55; background: var(--bg); max-height: 320px; overflow-y: auto; }
.ait-act-files, .ait-act-list, .ait-act-lines { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.ait-act-files li { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 0; border-bottom: 1px solid var(--border); }
.ait-act-files li:last-child, .ait-act-list li:last-child { border-bottom: 0; }
.ait-act-files a, .ait-act-links a, .ait-act-list a, .ait-hgrid a { color: var(--accent-ink); font-weight: 600; text-decoration: none; }
.ait-act-files a:hover, .ait-act-links a:hover, .ait-act-list a:hover { text-decoration: underline; }
.ait-act-list li { padding: 6px 0; border-bottom: 1px solid var(--border); overflow-wrap: anywhere; font-size: 13px; }
.ait-act-num { font-variant-numeric: tabular-nums; white-space: nowrap; }
details.ait-act-sub { border-top: 1px solid var(--border); padding: 8px 0; }
details.ait-act-sub > summary { cursor: pointer; font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 8px; list-style: none; }
details.ait-act-sub > summary::-webkit-details-marker { display: none; }
details.ait-act-sub > summary::before { content: "›"; color: var(--ink-3); width: 10px; display: inline-block; transition: transform .15s; }
details.ait-act-sub[open] > summary::before { transform: rotate(90deg); }
details.ait-act-sub > .ait-act-list, details.ait-act-sub > .ait-muted { margin: 6px 0 0 18px; }
.ait-act-ev { margin: 8px 0; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.ait-act-rule { font-size: 15px; font-weight: 600; overflow-wrap: anywhere; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; margin-bottom: 4px; }

/* fix batch lines: one card per line, so nothing scrolls sideways on a phone */
.ait-act-line { border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; margin-bottom: 8px; display: flex; flex-direction: column; gap: 8px; }
.ait-act-line-h { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ait-act-line-h b { flex: 1; min-width: 120px; overflow-wrap: anywhere; }
.ait-act-line-b { display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.ait-act-line-b > div { display: grid; grid-template-columns: 72px 1fr; gap: 10px; }
.ait-act-line-b > div > span:first-child { color: var(--ink-3); }
.ait-act-line-b > div > span:last-child { overflow-wrap: anywhere; min-width: 0; }
.ait-act-links { display: flex; gap: 12px; flex-wrap: wrap; }

/* client rows */
.ait-act-plan { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.ait-act-stage { display: inline-flex; flex-direction: column; gap: 1px; padding: 4px 9px; border-radius: 8px; border: 1px solid var(--border-2); background: var(--surface); min-width: 62px; }
.ait-act-stage b { font-size: 11.5px; font-weight: 700; }
.ait-act-stage small { font-size: 11px; color: var(--ink-3); white-space: nowrap; }
.ait-act-stage.ok { background: var(--green-soft); border-color: transparent; } .ait-act-stage.ok b { color: var(--green); }
.ait-act-stage.attn { background: var(--amber-soft); border-color: transparent; } .ait-act-stage.attn b { color: var(--amber); }
.ait-act-stage.bad { background: var(--red-soft); border-color: transparent; } .ait-act-stage.bad b { color: var(--red); }
.ait-act-stage.muted b { color: var(--ink-3); }
.ait-act-slot { font-size: 12.5px; color: var(--ink-3); display: inline-flex; align-items: center; gap: 5px; }
.ait-act-stop { display: flex; gap: 10px; align-items: flex-start; background: var(--red-soft); color: var(--red); border-radius: 8px; padding: 10px 12px; margin-top: 8px; font-size: 13px; overflow-wrap: anywhere; white-space: normal; }
.ait-act-stop .ti { font-size: 18px; flex: 0 0 auto; }
.ait-act-stop span { color: var(--text); } .ait-act-stop b { color: var(--red); }
.ait-act-client { padding: 14px 18px; display: flex; flex-direction: column; gap: 12px; border-bottom: 1px solid var(--border); }
.ait-act-promo { display: flex; flex-direction: column; gap: 8px; }
.ait-act-promo .ait-scroll { border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.ait-table tr.ait-sub .ait-act-promo td, .ait-table tr.ait-sub .ait-act-promo th { padding: 9px 14px; background: var(--surface); }
.ait-table tr.ait-sub .ait-act-promo th { background: var(--bg); }

/* the bar of buttons: pinned to the bottom of the drawer, so Approve and Changes are always in reach */
.ait-act-foot { border-top: 1px solid var(--border); background: var(--surface); padding: 12px 20px calc(12px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; gap: 10px; box-shadow: 0 -6px 16px rgba(17, 24, 39, .06); }
.ait-act-foot[hidden] { display: none; }
.ait-act-foot.inline { border: 1px solid var(--border); border-radius: 8px; box-shadow: none; padding: 12px 14px; }
.ait-act-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ait-act-row .btn-primary, .ait-act-row .btn-ghost { margin-left: 0; min-height: 40px; }
.ait-act-form { display: flex; flex-direction: column; gap: 10px; }
.ait-act-form textarea, .ait-act-field input { width: 100%; box-sizing: border-box; border: 1px solid var(--border-2); border-radius: 8px; padding: 9px 11px; font: inherit; font-size: 14px; background: var(--surface); color: var(--text); }
.ait-act-form textarea:focus, .ait-act-field input:focus { outline: 2px solid var(--accent-line); border-color: var(--accent); }
.ait-act-field { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--ink-3); max-width: 260px; }
.ait-act-quick { display: flex; gap: 6px; flex-wrap: wrap; } .ait-act-quick .btn-small { margin-left: 0; }
.ait-act-confirm { display: flex; flex-direction: column; gap: 10px; }
.ait-act-confirm p { margin: 0; display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; font-size: 14px; font-weight: 600; }
.ait-act-confirm.second p { color: var(--red); }
.ait-danger.btn-primary { background: var(--red); border-color: var(--red); color: #fff; }
.ait-soon { opacity: .6; cursor: not-allowed; display: inline-flex; flex-direction: column; align-items: flex-start; height: auto; padding: 5px 12px; line-height: 1.2; }
.ait-soon small { font-size: 10.5px; font-weight: 400; color: var(--ink-3); }
.ait-act-sent { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13.5px; font-weight: 600; color: var(--accent-ink); }
.ait-act-sent small { font-weight: 400; color: var(--ink-3); font-size: 12.5px; }
.ait-act-sent.late { color: var(--amber); }
.ait-act-last { overflow-wrap: anywhere; }
.ait-act-what { display: block; font-size: 12px; opacity: .8; margin-top: 2px; }
@keyframes ait-spin { to { transform: rotate(360deg); } }
.ait-spin { animation: ait-spin 1s linear infinite; display: inline-block; }
@media (prefers-reduced-motion: reduce) { .ait-spin { animation: none; } }

/* 390 px: one column everywhere on the Tower */
@media (max-width: 520px) {
  .ait-tiles { grid-template-columns: 1fr; }
  .ait-hgrid { grid-template-columns: 1fr; }
  .ait-kv { grid-template-columns: 1fr; gap: 2px 0; } .ait-kv > span:nth-child(even) { margin-bottom: 6px; }
  .ait-box > h3 { padding: 12px 14px; } .ait-item { padding: 12px 14px; }
  .ait-drawer-h { padding: 14px 14px 12px; } .ait-drawer-b { padding: 14px 14px 24px; }
  .ait-act-foot { padding: 10px 14px calc(10px + env(safe-area-inset-bottom, 0px)); }
  .ait-act-row .btn-primary, .ait-act-row .btn-ghost { flex: 1 1 100%; justify-content: center; min-height: 44px; }
  .ait-act-mail > div, .ait-act-line-b > div { grid-template-columns: 1fr; gap: 0; }
  .ait-act-client { padding: 12px 14px; }
  /* a table becomes a list: each cell on its own line, with its heading in front */
  table.ait-stack thead { display: none; }
  table.ait-stack, table.ait-stack tbody, table.ait-stack tr, table.ait-stack td { display: block; width: 100%; box-sizing: border-box; }
  table.ait-stack tr { border-bottom: 1px solid var(--border); padding: 8px 0; }
  table.ait-stack tr.ait-sub { padding: 0; }
  table.ait-stack td { border: 0; padding: 3px 14px; text-align: left; white-space: normal; }
  table.ait-stack td.num { text-align: left; }
  table.ait-stack td[data-l]::before { content: attr(data-l) ": "; color: var(--ink-3); font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; font-weight: 700; margin-right: 6px; }
  table.ait-stack td[data-l="Client"]::before { content: ""; margin: 0; }
}
