/* =========================================================================
   Internix theme — loaded after style.css.

   The rules of the look:
   · cool near-white ground, white surfaces, hairline borders — no shadows
     except on things that float (menus, dialogs, the selection bar)
   · 4px corners on controls, 8px on containers, full pills for status
   · Inter 14px for text at weights 400/500/600; Familjen Grotesk for
     headings, tight tracking
   · one blue for action, amber only as a highlight
   · 40px controls (32 small, 48 large) so everything lines up and is easy
     to hit on a phone
   ========================================================================= */

html { -webkit-text-size-adjust: 100%; }
body {
  font: 400 14px/1.55 var(--font-ui); background: var(--bg); color: var(--text);
  font-feature-settings: "cv11", "ss03"; text-rendering: optimizeLegibility;
}
::selection { background: color-mix(in srgb, var(--blue) 26%, transparent); }
h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 600; letter-spacing: -0.019em; color: var(--text); }
h1 { font-size: 28px; line-height: 1.15; }
a { color: var(--accent); }
a:hover { color: var(--accent-hover); }
a:focus-visible, button:focus-visible, summary:focus-visible, [tabindex]:focus-visible {
  outline: none; border-radius: var(--radius-sm);
  box-shadow: 0 0 0 1px #fff, 0 0 0 3px var(--accent);
}
code, pre, .log-output, .code-area, .modal-list, .oauth-steps code.copyable, .empty-hint code { font-family: var(--font-code); }
.cell-mono, .visible-count, .funnel-card__meta, .status-tab__count, .pagination-label, .word-count, .save-state {
  font-variant-numeric: tabular-nums;
}

/* ------------------------------------------------------------- top bar */
.appbar { position: sticky; top: 0; z-index: 50; background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(1.6) blur(10px); border-bottom: 1px solid var(--border); }
.appbar__inner { max-width: 1280px; margin: 0 auto; padding: 0 32px; height: 60px; display: flex; align-items: stretch; gap: 36px; }
.appbar__brand { display: flex; align-items: center; flex: none; }
.appbar__brand:hover { opacity: .8; }
.appbar__nav { display: flex; align-items: stretch; gap: 4px; flex: 1; min-width: 0; }
.appbar__link {
  position: relative; display: flex; align-items: center; gap: 8px; padding: 0 12px;
  color: var(--text-muted); font-size: 14px; font-weight: 500; text-decoration: none; white-space: nowrap;
}
.appbar__link svg { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round; }
.appbar__link::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 2px;
  background: var(--accent); border-radius: 2px 2px 0 0; transform: scaleX(0); transition: transform .16s ease; }
.appbar__link:hover { color: var(--text); text-decoration: none; }
.appbar__link.is-active { color: var(--text); }
.appbar__link.is-active svg { color: var(--accent); }
.appbar__link.is-active::after { transform: scaleX(1); }
.appbar__link:focus-visible { box-shadow: inset 0 0 0 2px var(--accent); border-radius: var(--radius-sm); }
.nav-badge { min-width: 18px; padding: 0 5px; border-radius: 999px; background: var(--amber); color: var(--navy);
  font: 600 11px/18px var(--font-ui); text-align: center; }

.usermenu { position: relative; align-self: center; flex: none; }
.usermenu__toggle {
  list-style: none; display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 8px 0 4px;
  border: 1px solid transparent; border-radius: 999px; background: none; cursor: pointer;
}
.usermenu__toggle::-webkit-details-marker { display: none; }
.usermenu__toggle:hover, .usermenu[open] .usermenu__toggle { background: var(--surface-2); border-color: var(--border); }
.avatar { width: 30px; height: 30px; flex: none; border-radius: 50%; display: grid; place-items: center;
  background: var(--navy); color: #fff; font: 600 13px var(--font-ui); }
.usermenu__name { font-size: 13.5px; font-weight: 500; color: var(--text-2); max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.usermenu__chev { width: 16px; height: 16px; flex: none; fill: none; stroke: var(--text-dim); stroke-width: 2;
  stroke-linecap: round; transition: transform .15s; }
.usermenu[open] .usermenu__chev { transform: rotate(180deg); }
.usermenu__panel {
  position: absolute; right: 0; top: calc(100% + 8px); width: 256px; padding: 6px; display: grid; gap: 1px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg);
}
.usermenu__who { display: grid; gap: 1px; padding: 8px 10px 10px; margin-bottom: 5px; border-bottom: 1px solid var(--border-soft); }
.usermenu__who strong { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.usermenu__who span { font-size: 12.5px; color: var(--text-muted); overflow-wrap: anywhere; }
.usermenu__panel form { margin: 0; }
.usermenu__panel a, .usermenu__panel button {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; border-radius: var(--radius-sm);
  background: none; color: var(--text-2); font: 500 13.5px var(--font-ui); text-align: left; cursor: pointer; text-decoration: none;
}
.usermenu__panel svg { width: 16px; height: 16px; flex: none; fill: none; stroke: var(--text-muted); stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round; }
.usermenu__panel a:hover, .usermenu__panel button:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }

.main { min-width: 0; }
.page { max-width: 1280px; margin: 0 auto; padding: 36px 32px 96px; }
.page--bare { max-width: none; padding: 0; }

/* Phones: the tabs move to the bottom, where the thumb is. */
.tabbar { display: none; }
@media (max-width: 760px) {
  .appbar__inner { height: 54px; padding: 0 16px; gap: 12px; justify-content: space-between; }
  .appbar__nav, .usermenu__name, .usermenu__chev { display: none; }
  .usermenu__toggle { padding: 0 4px; }
  .usermenu__panel { width: min(280px, calc(100vw - 32px)); }
  .page { padding: 22px 16px calc(96px + env(safe-area-inset-bottom)); }
  .tabbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; display: flex;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, .96); backdrop-filter: saturate(1.6) blur(10px); border-top: 1px solid var(--border);
  }
  .tabbar__link {
    position: relative; flex: 1; min-width: 0; display: grid; justify-items: center; gap: 3px; padding: 6px 4px 4px;
    border-radius: var(--radius); color: var(--text-muted); font-size: 11px; font-weight: 500; text-decoration: none;
  }
  .tabbar__link svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.7;
    stroke-linecap: round; stroke-linejoin: round; }
  .tabbar__link.is-active { color: var(--accent); background: var(--accent-soft); }
  .tabbar__link:hover { text-decoration: none; }
  .tabbar__link .nav-badge { position: absolute; top: 2px; left: calc(50% + 6px); }
}

/* --------------------------------------------------------- page header */
.topbar {
  display: flex; justify-content: space-between; align-items: flex-end; gap: 16px 24px; flex-wrap: wrap;
  margin: 0 0 24px; padding: 0; border: 0;
}
.topbar h1 { margin: 0 0 4px; }
.subtitle { color: var(--text-muted); font-size: 14.5px; }
.eyebrow { color: var(--accent); font: 600 12px var(--font-ui); letter-spacing: .02em; text-transform: none; }
.section-copy { color: var(--text-muted); font-size: 14px; }
.live-note, .setup-status, .run-label, .progress-heading { font-family: var(--font-ui); font-size: 13px; }
.live-note { height: 28px; padding: 0 10px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); }
.live-note--active { border-color: color-mix(in srgb, var(--accent) 35%, var(--border)); background: var(--accent-soft); }
.dot { box-shadow: none; }
.dot--pulse { box-shadow: none; }
.refresh-toggle { font-size: 13px; }
@media (max-width: 680px) {
  .topbar { display: flex; align-items: flex-start; margin-bottom: 18px; }
  .topbar-right { margin-top: 0; gap: 12px; }
  h1 { font-size: 24px; }
}

/* -------------------------------------------------------------- buttons */
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px;
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--text-2);
  font: 500 13.5px/1 var(--font-ui); white-space: nowrap; cursor: pointer; text-decoration: none;
  box-shadow: var(--shadow-sm); transition: background .14s, border-color .14s, color .14s, box-shadow .14s;
}
.button:hover { text-decoration: none; }
.button:focus-visible { box-shadow: 0 0 0 1px #fff, 0 0 0 3px var(--accent); }
.button--primary { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: none; }
.button--primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; }
.button--ghost { background: var(--surface); border-color: var(--border); color: var(--text-2); }
.button--ghost:hover { background: var(--surface-2); border-color: #C9CEDA; color: var(--text); }
.button--danger { background: var(--surface); border-color: var(--border); color: var(--st-failed); }
.button--danger:hover { background: #FFF5F4; border-color: #F2C4BF; }
.button--amber { background: var(--amber); border-color: var(--amber); color: var(--navy); box-shadow: none; }
.button--amber:hover { background: #EBA82F; border-color: #EBA82F; color: var(--navy); }
.button--light { background: #fff; border-color: #fff; color: var(--navy); }
.button--light:hover { background: var(--surface-2); color: var(--navy); }
.button--sm { height: 32px; padding: 0 12px; font-size: 13px; }
.button--lg { height: 48px; padding: 0 20px; font-size: 15px; }
.button--block { width: 100%; }
.button:disabled, .button:disabled:hover { opacity: .5; cursor: not-allowed; }
.button--primary:disabled:hover { background: var(--accent); }
.detail-link { font-weight: 500; }

/* --------------------------------------------------------------- forms */
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
select, textarea {
  background: var(--field); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text);
  font: 400 14px/1.4 var(--font-ui); padding: 0 12px; box-shadow: var(--shadow-sm);
  transition: border-color .14s, box-shadow .14s;
}
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), select { height: 40px; }
textarea { padding: 10px 12px; line-height: 1.55; }
input[type="file"] { font: 13px var(--font-ui); border-radius: var(--radius-sm); }
input::placeholder, textarea::placeholder { color: var(--text-dim); }
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):hover, select:hover, textarea:hover { border-color: #C9CEDA; }
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):focus,
select:focus, textarea:focus,
input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}
.form-group { gap: 6px; align-content: start; }
input[type="file"] { padding: 0; border: 0; background: none; box-shadow: none; color: var(--text-muted); max-width: 100%; }
input[type="file"]::file-selector-button {
  height: 40px; margin-right: 12px; padding: 0 14px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text-2); font: 500 13.5px var(--font-ui); cursor: pointer; box-shadow: var(--shadow-sm);
}
input[type="file"]::file-selector-button:hover { background: var(--surface-2); border-color: #C9CEDA; }
.form-group label, .pair__label, .email-editor label, .gmail-section > label { color: var(--text); font-size: 13px; font-weight: 500; }
.field-hint { color: var(--text-muted); font-size: 12.5px; }
input[type=checkbox], input[type=radio] { accent-color: var(--accent); }
.batch-limit-input { height: 40px; }
.danger-zone input:not([type="checkbox"]):not([type="radio"]):not([type="file"]) { height: 32px; }
.email-editor input, .email-editor textarea { border-radius: var(--radius-sm); font: 400 14px/1.6 var(--font-ui); }
.email-editor textarea { font-family: var(--font-ui); font-size: 14px; }
.search-box { height: 40px; border-radius: var(--radius-sm); font-size: 14px; }
/* 16px text in fields stops iOS from zooming the page on focus. */
@media (max-width: 760px) {
  input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), select, textarea,
  .email-editor input, .email-editor textarea { font-size: 16px; }
}

/* ------------------------------------------------------ flashes, notices */
.flash-stack { margin: 0 0 20px; }
.flash { border-radius: var(--radius-sm); padding: 11px 14px; font-size: 13.5px; font-weight: 500; border-width: 1px; }
.flash--success { background: #F1FBF3; border-color: #C5E9CE; color: #12602F; }
.flash--error { background: #FFF5F4; border-color: #F6CFCB; color: #A8322A; }
.flash--warning { background: #FFF8EB; border-color: #F3DDB0; color: #8A5A00; }
.notice { border-radius: var(--radius); font-size: 13.5px; }
.notice--warn { background: var(--amber-soft); border-color: #F3DDA6; color: var(--amber-ink); }
a.notice:hover { background: #FFEFC9; }
.error-box, .preview-dirty, .delivery-alert { border-radius: var(--radius-sm); }

/* --------------------------------------------------------------- cards */
.panel, .settings-card, .checklist, .run-section, .workspace-section, .table-section, .workspace-bar,
.settings-nav, .import-report, .favorites-bar {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: none;
}
.panel { padding: 22px 24px; }
.settings-card { padding: 26px 28px; }
.panel h2, .settings-card__head h2 { font-size: 18px; font-weight: 600; }
.panel h3 { font-family: var(--font-ui); font-size: 12.5px; font-weight: 600; color: var(--text-muted); letter-spacing: 0; }
.run-section { padding: 22px 24px; margin-bottom: 16px; background: var(--surface); border-color: var(--border); }
.run-section h2 { font-size: 18px; }
.cap-bar-track, .funnel-mini-track, .send-toast-bar { border: 0; background: var(--surface-3); }
.cap-bar-fill, .funnel-mini-fill { background: var(--accent); }
.log-output { border-radius: var(--radius-sm); background: var(--surface-2); font-size: 12px; }
@media (max-width: 760px) {
  .panel, .settings-card, .run-section, .checklist { padding: 18px 16px; }
  .run-form { flex-wrap: wrap; gap: 12px; }
  .run-form .button { flex: 1 1 auto; }
}

/* Getting started: a numbered path, each step a tile. */
.checklist { padding: 24px; margin-bottom: 24px; }
.checklist h2 { font-size: 20px; }
.checklist--partial { border-color: #F3DDA6; }
.checklist-items { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-top: 18px; counter-reset: none; }
.checklist-item { padding: 14px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); font-size: 13.5px;
  transition: border-color .14s; }
.checklist-item--todo:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.checklist-item a { font-weight: 600; color: var(--text); }
.checklist-item a:hover { color: var(--accent); }
.checklist-mark { width: 24px; height: 24px; border-radius: 50%; font: 600 12px var(--font-ui); flex: none; margin-top: 0; }
.checklist-item--done { background: var(--surface-2); }
.checklist-item--done .checklist-mark { background: var(--st-sent); color: #fff; }
.checklist-item--done a { color: var(--text-muted); }
.checklist-item--todo .checklist-mark { background: var(--accent-soft); color: var(--accent); border: 0; }
.checklist-note { font-size: 12.5px; color: var(--text-muted); margin-top: 3px; }

.workspace-bar { padding: 10px 16px; margin-bottom: 20px; font-size: 13px; }
.workspace-bar__fact strong { color: var(--text); font-weight: 500; }

/* ---------------------------------------------------------------- funnel
   One strip, five stages: reads as a pipeline rather than five loose cards. */
.funnel {
  gap: 1px; margin-bottom: 20px; background: var(--border); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
}
.funnel-card {
  display: grid; align-content: start; gap: 2px; padding: 16px 18px; border: 0; border-radius: 0;
  background: var(--surface); box-shadow: none; position: relative;
}
.funnel-card:hover { background: var(--surface-2); box-shadow: none; text-decoration: none; }
.funnel-card--active, .funnel-card--active:hover { background: color-mix(in srgb, var(--stage) 6%, #fff); box-shadow: inset 0 -2px 0 var(--stage); }
.funnel-card__label { order: -1; margin: 0; display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 500; color: var(--text-muted); }
.funnel-card__label::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--stage, var(--accent)); flex: none; }
.funnel-card__value { font: 600 30px/1.15 var(--font-head); letter-spacing: -.02em; color: var(--text); }
.funnel-card__meta { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.funnel-mini-track { margin-top: 6px; }
@media (max-width: 860px) {
  .funnel { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .funnel-card:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .funnel-card { padding: 13px 14px; }
  .funnel-card__value { font-size: 24px; }
}
@media (max-width: 420px) { .funnel { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ------------------------------------------------------------------ table */
.table-section { overflow: hidden; }
.status-tabs { padding: 0 16px; gap: 2px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none;
  border-bottom: 1px solid var(--border); background: var(--surface); }
.status-tabs::-webkit-scrollbar { display: none; }
.status-tab {
  flex: none; padding: 14px 10px 12px; border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: none;
  font-size: 13.5px; font-weight: 500; color: var(--text-muted);
}
.status-tab:hover { color: var(--text); background: none; border-color: transparent; border-bottom-color: var(--border); }
.status-tab--active, .status-tab--active:hover { color: var(--text); background: none; border-bottom-color: var(--accent); font-weight: 500; }
.status-tab--favorites.status-tab--active { color: var(--text); border-color: transparent; border-bottom-color: var(--star); }
.status-tab__count { margin-left: 4px; padding: 1px 6px; border-radius: 999px; background: var(--surface-3); color: var(--text-muted);
  font: 500 11.5px var(--font-ui); opacity: 1; }
.status-tabs--compact { padding: 0; border: 0; }
.status-tabs--compact .status-tab { padding: 6px 10px; border: 1px solid transparent; border-radius: 999px; font-size: 13px; }
.status-tabs--compact .status-tab--active { background: var(--surface-3); border-color: transparent; }
.table-controls { padding: 12px 16px; background: var(--surface); border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.visible-count { font-family: var(--font-ui); font-size: 12.5px; }
.app-table { background: var(--surface); }
/* The list's columns, all in percent so they always total the table (mixing
   px and % once clipped the actions). Six on a laptop; the match column
   leaves first when the window narrows. */
#app-table { min-width: 0; }
#app-table th:nth-child(1), #app-table td:nth-child(1) { width: 6%; padding-left: 16px; padding-right: 0; text-align: left; }
#app-table th:nth-child(2), #app-table td:nth-child(2) { width: 30%; }
#app-table th:nth-child(3), #app-table td:nth-child(3) { width: 14%; overflow: hidden; }
#app-table th:nth-child(4), #app-table td:nth-child(4) { width: 22%; }
#app-table th:nth-child(5), #app-table td:nth-child(5) { width: 12%; padding-left: 12px; padding-right: 8px; }
#app-table th:nth-child(6), #app-table td:nth-child(6) { width: 16%; padding-left: 8px; }
@media (max-width: 1140px) {
  #app-table .col-extras { display: none; }
  #app-table th:nth-child(1), #app-table td:nth-child(1) { width: 7%; }
  #app-table th:nth-child(2), #app-table td:nth-child(2) { width: 35%; }
  #app-table th:nth-child(4), #app-table td:nth-child(4) { width: 23%; }
  #app-table th:nth-child(5), #app-table td:nth-child(5) { width: 14%; }
  #app-table th:nth-child(6), #app-table td:nth-child(6) { width: 21%; }
}
.cell-select { display: table-cell; }
.cell-select .row-select-cb { margin-left: 8px; }
.app-table th {
  background: var(--surface-2); color: var(--text-muted); font: 500 12.5px var(--font-ui); letter-spacing: 0;
  text-transform: none; border-bottom: 1px solid var(--border); padding-top: 10px; padding-bottom: 10px;
}
.app-table td { border-bottom: 1px solid var(--border-soft); font-size: 13.5px; }
.app-table tr:hover td, .app-table tbody tr:hover td { background: var(--surface-2); }
.app-table tr.row--problem:hover > td { background: rgba(180, 35, 24, .09); }
.cell-mono { font-size: 13.5px; color: var(--text-2); }
.cell-company { font-weight: 500; color: var(--text); }
.empty-state { padding: 56px 24px; }
.empty-state p:first-child { font: 600 17px var(--font-head); color: var(--text); margin: 0 0 4px; }
.pagination { margin: 0; padding: 14px 16px; border-top: 1px solid var(--border-soft); font-size: 13px; }
.favorites-bar { margin: 12px 16px; background: #FFFBEF; border-color: #F3DDA6; border-radius: var(--radius-sm); }

/* Phones and small tablets: every company becomes a card — name and status,
   its address and place, the email's subject, then the actions. Compact, so
   three companies fit the first screen; nothing scrolls sideways. */
@media (max-width: 860px) {
  .table-scroll:has(#app-table) { overflow: visible; }
  #app-table { table-layout: auto; display: block; }
  #app-table thead { display: block; }
  #app-table thead tr { display: flex; align-items: center; gap: 10px; padding: 6px 16px; background: var(--surface-2); border-bottom: 1px solid var(--border); }
  #app-table thead th { display: none; padding: 0; border: 0; background: none; width: auto !important; }
  #app-table thead th:first-child { display: flex; align-items: center; gap: 10px; min-height: 28px; }
  #app-table thead th:first-child::after { content: "Select all"; font: 500 13px var(--font-ui); color: var(--text-muted); }
  #app-table tbody { display: block; }
  /* star and tick on the left · name, then the email's subject · status, then the action */
  #app-table tbody tr {
    display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 4px 8px; align-items: center;
    padding: 12px 12px 12px 6px; border-bottom: 1px solid var(--border-soft);
  }
  #app-table tbody tr:last-child { border-bottom: 0; }
  #app-table tbody td { display: block; width: auto !important; padding: 0 !important; border: 0; background: none !important; text-align: left; }
  #app-table tbody td.cell-select { grid-column: 1; grid-row: 1 / span 2; display: flex; flex-direction: column; align-items: center; align-self: start; }
  /* The name shares its line with the status; the grey line under it gets the card's full width. */
  #app-table tbody td.cell-company { grid-column: 2 / -1; grid-row: 1; }
  #app-table tbody td.cell-status { grid-column: 3; grid-row: 1; justify-self: end; align-self: start; z-index: 1;
    display: flex; flex-direction: row-reverse; align-items: center; gap: 6px; }
  #app-table .cell-company .company-link { max-width: calc(100% - 128px); }
  #app-table tr:has(.cell-status .chip) .company-link { max-width: calc(100% - 206px); }
  #app-table .cell-status .row-error { display: none; }      /* the reason is on the company's page; the red status says it here */
  #app-table tbody td.col-extras { display: none; }
  #app-table tbody td.cell-subject { grid-column: 2; grid-row: 2; }
  #app-table tbody td.row-actions { grid-column: 3; grid-row: 2; display: flex; align-items: center; gap: 8px; justify-self: end; }
  #app-table thead tr { padding-left: 13px; }
  td.row-actions > * + * { margin-left: 0; }
  #app-table .company-link { font-size: 15px; font-weight: 600; }
  /* The name opens the company, so the extra "View" link isn't needed here. */
  #app-table .row-actions .detail-link { display: none; }
  /* One piece of each grey line gives way; the rest stays readable. */
  #app-table .cell-subject .row-sub { display: none; }
  /* Thumbs, not cursors: the main action is 40 high, the rest at least 36 with room around. */
  #app-table .row-actions .button { min-height: 40px; padding-left: 16px; padding-right: 16px; }
  .fav-btn { font-size: 22px; min-width: 36px; min-height: 36px; padding: 2px; }
  .cell-select .row-select-cb { margin: 7px 0; }
  .table-controls .button { min-height: 40px; }
  .row-select-cb, #select-all-cb { width: 22px; height: 22px; }
  tr.row--problem > td:first-child { box-shadow: none; }
  #app-table tbody tr.row--problem { background: rgba(180, 35, 24, .05); box-shadow: inset 3px 0 0 var(--st-bounced); }
}

/* ------------------------------------------------------------ pills, chips */
.status-pill { border-radius: 999px; font-weight: 500; font-size: 12.5px; padding: 3px 10px 3px 8px;
  background: color-mix(in srgb, var(--pill) 9%, #fff); border: 1px solid color-mix(in srgb, var(--pill) 20%, #fff); }
.chip { border-radius: var(--radius-sm); font: 500 12px var(--font-ui); background: var(--surface-2); border-color: var(--border); color: var(--text-2); }
.chip--accent { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 22%, #fff); color: var(--accent); }
.lang-chip { border-radius: 3px; font: 600 10.5px/1 var(--font-ui); letter-spacing: .03em; }
.lang-chip--fr { color: var(--amber-ink); background: var(--amber-soft); border-color: #F3DDA6; }
.lang-switch { border-radius: var(--radius-sm); }
.lang-switch__option { font: 600 12.5px var(--font-ui); padding: 0 14px; height: 38px; }
.lang-switch__option--active, .lang-switch__option--active:hover { background: var(--navy); color: #fff; }
.pool-pill { font-weight: 500; }

/* ------------------------------------------------------- modal, toasts, bar */
.modal { border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 24px; }
.modal h3 { font-size: 19px; }
.modal-list { border-radius: var(--radius-sm); background: var(--surface-2); }
.modal-backdrop { background: rgba(15, 17, 38, .45); backdrop-filter: blur(2px); }
.batch-actions { background: none; }
.batch-actions-inner, .send-toast-inner {
  background: var(--navy); color: #fff; border: 0; border-radius: var(--radius); box-shadow: var(--shadow-lg);
  font: 500 13.5px var(--font-ui);
}
.batch-actions-inner .field-hint { color: rgba(255, 255, 255, .65); }
.batch-actions-inner .button--ghost { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .28); box-shadow: none; }
.batch-actions-inner .button--ghost:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.send-toast-bar { background: rgba(255, 255, 255, .18); }
.send-toast-fill { background: var(--amber); }
@media (max-width: 760px) {
  .batch-actions { bottom: calc(64px + env(safe-area-inset-bottom)); padding: 8px 0; }
  .batch-actions-inner { flex-wrap: wrap; justify-content: center; gap: 8px 10px; padding: 12px 14px; width: 100%; }
  .batch-actions-inner .button { flex: 1 1 auto; }
  .send-toast { bottom: calc(76px + env(safe-area-inset-bottom)); left: 16px; right: 16px; transform: none; }
  .send-toast-inner { min-width: 0; }
  .modal-actions { flex-direction: column-reverse; }
  .modal-actions .button { width: 100%; }
}

/* ------------------------------------------------------------ detail page */
.back-link { font-size: 13.5px; font-weight: 500; }
.detail-header { border-bottom: 1px solid var(--border); gap: 16px; flex-wrap: wrap; }
.detail-tabs { gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 18px; }
.detail-tab { padding: 10px 12px; border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: none;
  font: 500 13.5px var(--font-ui); margin-bottom: -1px; }
.detail-tab:hover { color: var(--text); }
.detail-tab--active { background: none; color: var(--text); border-bottom-color: var(--accent); font-weight: 500; }
.email-body, .email-preview { border-radius: var(--radius); }
.email-preview__headers { background: var(--surface-2); font-size: 13px; }
.email-preview__key { font-family: var(--font-ui); font-size: 12.5px; color: var(--text-muted); }
.email-preview__body { font-size: 14px; }
.attachment-chip { border-radius: var(--radius-sm); background: var(--surface-2); }
.timeline-stage { font: 600 11.5px var(--font-ui); text-transform: capitalize; }
.timeline-item::before { border-color: var(--surface); }
.fact-list { font-size: 13.5px; }
@media (max-width: 760px) {
  .detail-actions { width: 100%; }
  .detail-actions .button { flex: 1 1 auto; }
  .fact-list { grid-template-columns: 96px 1fr; }
  .editor-actions .button { flex: 1 1 auto; }
}

/* -------------------------------------------------------- settings layout */
.settings-nav { padding: 8px; top: 84px; }
.settings-nav__link { border-radius: var(--radius-sm); font-weight: 500; font-size: 13.5px; }
.settings-nav__link:hover { background: var(--surface-2); }
.settings-nav__mark, .settings-nav__mark--todo { box-shadow: none; }
.settings-card { scroll-margin-top: 84px; }
.settings-actions { border-radius: var(--radius); background: var(--surface); bottom: 12px; box-shadow: var(--shadow-lg); }
.method-card, .template-card, .choice, .item-card, .google-connected-card, .google-connect-card, .credential-box, .import-report, .timeline-earlier {
  border-radius: var(--radius);
}
.method-card--active, .template-card--active, .choice:has(input:checked) { background: var(--accent-soft); }
.template-card--active { box-shadow: none; border-color: var(--accent); }
.template-card strong { font-weight: 600; }
.profile-step__num { background: var(--navy); color: #fff; border-radius: 50%; font: 600 13px var(--font-ui); width: 28px; height: 28px; }
.profile-step__summary strong { font: 600 17px var(--font-head); letter-spacing: -.015em; }
.item-card { background: var(--surface-2); }
.pair__lang { font: 600 11px var(--font-ui); }
.google-connected-card { background: #F1FBF3; border-color: #C5E9CE; }
.google-connect-card { background: var(--surface-2); border-style: solid; border-color: var(--border); }
.button-google {
  height: 44px; padding: 0 18px; border-radius: var(--radius-sm); border-color: var(--border); color: var(--text);
  font: 500 14px var(--font-ui); box-shadow: var(--shadow-sm); justify-content: center;
}
.button-google:hover { background: var(--surface-2); border-color: #C9CEDA; box-shadow: var(--shadow-sm); color: var(--text); }
.segmented { border-radius: var(--radius-sm); background: var(--surface-3); border-color: transparent; }
.segmented__item { border-radius: 3px; font-weight: 500; }
.credential-box { background: var(--amber-soft); border: 1px solid #F3DDA6; }
.sticky-actions { bottom: 0; }
@media (max-width: 900px) {
  /* The section index becomes a row of chips you can swipe. */
  .settings-layout { gap: 16px; }
  .settings-nav { display: flex; gap: 6px; padding: 0; border: 0; background: none; overflow-x: auto; scrollbar-width: none;
    position: sticky; top: 54px; z-index: 20; margin: 0 -16px; padding: 8px 16px; background: var(--bg); }
  .settings-nav::-webkit-scrollbar { display: none; }
  .settings-nav__link { flex: none; height: 34px; padding: 0 12px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); }
  .settings-nav__note { display: none; }
  .settings-card { scroll-margin-top: 112px; }
  .settings-actions { bottom: calc(72px + env(safe-area-inset-bottom)); padding: 12px; }
  .sticky-actions { bottom: calc(64px + env(safe-area-inset-bottom)); }
  .file-row .button, .import-form .button { flex: 1 1 auto; }
}
@media (min-width: 761px) and (max-width: 900px) {
  .settings-actions, .sticky-actions { bottom: 0; }
  .settings-nav { top: 60px; }
}

/* ============================================================== sign-in
   Logo top-left, the way across top-right, one bordered card in the middle. */
.auth { position: relative; min-height: 100vh; display: flex; flex-direction: column; background: var(--surface-2); overflow: hidden; }
/* The logo's triangles, as a faint lattice fading up from the corners. */
.auth::before, .auth::after {
  content: ""; position: absolute; width: 620px; height: 620px; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48' viewBox='0 0 48 48'%3E%3Cpath d='M0 .5h48M.5 0v48M0 48 48 0' fill='none' stroke='%234A56E8' stroke-opacity='.16'/%3E%3C/svg%3E");
}
.auth::before { left: -140px; bottom: -220px; -webkit-mask-image: radial-gradient(closest-side, #000, transparent); mask-image: radial-gradient(closest-side, #000, transparent); }
.auth::after { right: -180px; top: -260px; -webkit-mask-image: radial-gradient(closest-side, #000, transparent); mask-image: radial-gradient(closest-side, #000, transparent); }
.auth > * { position: relative; z-index: 1; }
.auth__top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 28px 40px 0; }
.auth__switch { margin: 0; font-size: 14px; color: var(--text-muted); text-align: right; }
.auth__switch a { font-weight: 500; white-space: nowrap; }
.auth__main { flex: 1; width: min(576px, 100%); margin: 0 auto; padding: 36px 20px 64px; }
.auth__head { text-align: center; margin-bottom: 28px; }
.auth__head h1 { font-size: 28px; margin: 0 0 8px; }
.auth__head p { margin: 0; font-size: 16px; color: var(--text-muted); }
.auth-card { width: 100%; padding: 44px 48px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: none; }
.auth-card--center { width: min(480px, 100%); margin: 72px auto; padding: 40px; text-align: center; }
.auth-card h1 { font-size: 24px; margin: 6px 0 8px; }
.auth-card .flash-stack { margin: 0 0 18px; }
.auth-form { gap: 16px; margin-top: 0; }
.auth-form input:not([type="checkbox"]):not([type="radio"]):not([type="file"]) { height: 48px; font-size: 15px; }
.auth-form .button--block, .auth-card .button--block { height: 48px; font-size: 15px; }
.button-google--block { width: 100%; height: 52px; margin-top: 0; font-size: 15px; gap: 12px; }
.auth-note { margin: 10px 0 0; font-size: 12.5px; color: var(--text-muted); }
.auth-divider { margin: 22px 0; font: 600 11px var(--font-ui); letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); }
.auth-divider + .auth-form { margin-top: 0; }
.auth-legal { margin: 22px 0 0; font-size: 13px; color: var(--text-muted); }
.auth-foot { margin: 20px 0 0; font-size: 14px; }
.auth-trust { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 22px 0 0; padding: 0; }
.auth-trust li { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px 0 8px; border: 1px solid var(--border);
  border-radius: 999px; background: var(--surface); font-size: 12.5px; color: var(--text-2); }
.auth-trust li::before { content: ""; width: 14px; height: 14px; flex: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Ccircle cx='8' cy='8' r='7' fill='none' stroke='%236A7082' stroke-width='1.3'/%3E%3Cpath d='m5.2 8.2 1.9 1.9 3.7-4' fill='none' stroke='%236A7082' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/contain no-repeat; }
@media (max-width: 620px) {
  .auth__top { padding: 18px 16px 0; }
  .auth__switch span { display: none; }
  .auth__main { padding: 28px 16px 48px; }
  .auth__head h1 { font-size: 24px; }
  .auth__head p { font-size: 15px; }
  .auth-card { padding: 24px 20px; }
  .auth::after { display: none; }
}

/* ============================================================ admin misc */
.admin-tabs { display: flex; gap: 2px; margin: 0 0 24px; border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; }
.admin-tabs::-webkit-scrollbar { display: none; }
.admin-tabs a { flex: none; padding: 10px 12px; margin-bottom: -1px; border-bottom: 2px solid transparent; color: var(--text-muted);
  font-weight: 500; font-size: 14px; text-decoration: none; }
.admin-tabs a:hover { color: var(--text); }
.admin-tabs a.is-active { color: var(--text); border-bottom-color: var(--accent); }
.admin-grid { grid-template-columns: minmax(0, 1fr) 320px; }
.admin-grid > .panel:first-child { padding: 0; overflow: hidden; }
.admin-grid > .panel:first-child > .panel-heading-row { padding: 18px 20px 14px; align-items: center; flex-wrap: wrap; }
.admin-grid > .panel:first-child h2 { margin: 0; }
/* Few rows, so the accounts table sizes to its content and wraps instead of
   inheriting the tracker's fixed, truncating layout. */
.admin-table { table-layout: auto; min-width: 640px; }
.admin-table th, .admin-table td, .admin-table th:first-child, .admin-table td:first-child { text-align: left; width: auto; padding-left: 20px; padding-right: 12px; }
.admin-table .cell-mono { white-space: normal; overflow: visible; font-size: 13px; color: var(--text-muted); }
.admin-table td:first-child { min-width: 190px; overflow-wrap: anywhere; }
.admin-table .cell-company { white-space: normal; }
.action-menu__panel { border-radius: var(--radius); }
.action-menu__panel button { border-radius: var(--radius-sm); font: 500 13.5px var(--font-ui); }
.action-menu__panel button:hover { background: var(--surface-2); }
@media (max-width: 1000px) { .admin-grid { grid-template-columns: 1fr; } }
@media (max-width: 720px) { .audit-table { min-width: 720px; } }
.panel > .section-copy + form, .panel > .section-copy + .stack-form { margin-top: 16px; }
@media (max-width: 760px) { .attachment-chip { display: block; } }
#app-table th { white-space: nowrap; }

/* Companies with no CV match: the note above the table and the row chip. */
.cv-match-note { margin: 12px 16px 0; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface-2); font-size: 13.5px; color: var(--text-2); }
.cv-match-note strong { color: var(--text); font-weight: 600; }
.cv-match-note--quiet { display: flex; align-items: center; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap;
  padding: 9px 14px; background: var(--surface); color: var(--text-muted); }
.cv-match-note--quiet a { font-weight: 500; white-space: nowrap; }
.chip--muted { background: var(--surface); border-style: dashed; color: var(--text-muted); }

/* ---------------------------------------------------------- AI providers */
.ai-tip { display: flex; gap: 12px; align-items: flex-start; margin: 0 0 18px; padding: 14px 16px;
  border: 1px solid #F3DDA6; border-radius: var(--radius); background: var(--amber-soft); }
.ai-tip svg { width: 20px; height: 20px; flex: none; margin-top: 1px; fill: none; stroke: var(--amber-ink); stroke-width: 1.7;
  stroke-linecap: round; stroke-linejoin: round; }
.ai-tip p { margin: 0; font-size: 13.5px; line-height: 1.55; color: var(--text-2); }
.ai-tip strong { color: var(--text); }
.ai-summary { margin: 0 0 14px; font-size: 13.5px; color: var(--text-muted); }
.ai-summary strong { color: var(--text); }
.provider-list { display: grid; gap: 12px; }
.provider-card { padding: 16px 18px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.provider-card.is-connected { border-color: color-mix(in srgb, var(--st-sent) 35%, var(--border)); }
.provider-card__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.provider-card__title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.provider-card__title h3 { margin: 0; font-size: 16px; }
.provider-badge { padding: 2px 8px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface-2);
  font-size: 11.5px; font-weight: 500; color: var(--text-muted); }
.provider-badge--free { background: #F1FBF3; border-color: #C5E9CE; color: #12602F; }
.provider-state { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 500; color: var(--text-muted); white-space: nowrap; }
.dot--ok { background: var(--st-sent); }
.dot--bad { background: var(--st-failed); }
.provider-card__blurb { margin: 6px 0 0; font-size: 13.5px; color: var(--text-muted); }
.provider-connect { margin-top: 12px; }
.provider-steps { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0 0 12px; padding: 0; list-style: none; counter-reset: step; }
.provider-steps li { counter-increment: step; display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--text-2); }
.provider-steps li::before { content: counter(step); width: 20px; height: 20px; flex: none; display: grid; place-items: center;
  border-radius: 50%; background: var(--accent-soft); color: var(--accent); font: 600 11px var(--font-ui); }
.provider-connect__row { display: flex; gap: 8px; flex-wrap: wrap; }
.provider-connect__row input { flex: 1 1 220px; min-width: 0; }
.provider-models { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border-soft); }
.provider-models__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin-bottom: 10px; font-size: 13.5px; }
.model-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 6px; }
.model-option { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 8px 10px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); font-size: 13px; cursor: pointer; }
.model-option span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.model-option:has(input:checked) { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); background: var(--accent-soft); }
.model-tag { margin-left: auto; flex: none; font: 500 11px var(--font-ui); font-style: normal; color: var(--st-sent); }
.provider-models__foot { display: flex; gap: 16px; margin-top: 10px; }
.link-button { padding: 0; border: 0; background: none; color: var(--accent); font: 500 13px var(--font-ui); cursor: pointer; }
.link-button:hover { text-decoration: underline; }
.link-button--danger { color: var(--st-failed); }
[data-show-all] { margin-top: 8px; }
.provider-card [data-result]:empty { display: none; }
.provider-card [data-result] { margin: 10px 0 0; }
.provider-advanced { border: 1px dashed var(--border); border-radius: var(--radius); padding: 10px 14px; }
.provider-advanced > summary { cursor: pointer; font-size: 13.5px; font-weight: 500; color: var(--text-muted); }
.provider-advanced[open] > summary { margin-bottom: 10px; }
.ai-primary { display: grid; gap: 6px; max-width: 460px; margin-top: 18px; }
.ai-primary label { font-size: 13px; font-weight: 500; }
@media (max-width: 760px) {
  .provider-card { padding: 14px; }
  .provider-connect__row .button { flex: 1 1 auto; }
  .model-list { grid-template-columns: 1fr; }
}

/* ------------------------------------------------- email styles + switch */
.template-card__best { font-size: 12.5px; color: var(--text-2); }
.template-card__best b { font-weight: 600; }
.template-card__proof { font-size: 12px; color: var(--st-sent); }
.template-card__proof em { font-style: normal; color: var(--text-muted); }
.proven-rules { margin: 4px 0 18px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); }
.proven-rules > summary { cursor: pointer; font-weight: 500; font-size: 13.5px; }
.proven-rules ul { margin: 10px 0 6px; padding-left: 18px; display: grid; gap: 6px; font-size: 13.5px; color: var(--text-2); }
.proven-rules a, .style-evidence a { font-size: 12px; color: var(--text-muted); text-decoration: underline; text-underline-offset: 2px; }
.style-switch { display: grid; grid-template-columns: auto minmax(0, 320px); align-items: center; gap: 8px 12px; margin: 0 0 16px;
  padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); }
.style-switch label { font-size: 13px; font-weight: 500; }
.style-switch select { height: 36px; }
.style-note { grid-column: 1 / -1; font-size: 13px; color: var(--text-2); }
.style-note p { margin: 0 0 4px; }
.style-evidence { margin: 6px 0 0; padding-left: 18px; display: grid; gap: 4px; color: var(--st-sent); }
@media (max-width: 760px) { .style-switch { grid-template-columns: 1fr; } }


/* ------------------------------------------------- internship dates card */
.dates-card__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px 24px; flex-wrap: wrap; margin-bottom: 16px; }
.dates-card__head h2 { margin: 0 0 4px; font-size: 18px; }
.dates-card__now { padding: 6px 12px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 13px; white-space: nowrap; }
.dates-card__now strong { font-weight: 600; }
.dates-form { display: grid; grid-template-columns: 1fr 1.3fr 0.8fr auto; gap: 14px; align-items: end; }
.dates-form__actions { display: flex; align-items: center; gap: 14px; }
.dates-card__drafts { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; margin-top: 16px; padding: 12px 14px;
  border: 1px solid #F3DDA6; border-radius: var(--radius-sm); background: var(--amber-soft); font-size: 13.5px; color: var(--text-2); }
@media (max-width: 900px) { .dates-form { grid-template-columns: 1fr 1fr; } .dates-form__actions { grid-column: 1 / -1; justify-content: space-between; } }
@media (max-width: 560px) { .dates-form { grid-template-columns: 1fr; } }


/* ------------------------------------------------------ Microsoft + detect */
.button-microsoft { margin-top: 10px; }
.mail-detect { margin: 0 0 20px; padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); }
.mail-detect > label { display: block; margin-bottom: 8px; font-size: 13.5px; font-weight: 500; }
.mail-detect .input-row input { flex: 1 1 260px; }
.mail-detect__result { margin-top: 12px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface);
  font-size: 13.5px; display: grid; gap: 8px; }
.mail-detect__result strong { color: var(--text); }
.mail-detect__result .button-google { justify-self: start; }
#mail-form { display: block; }
#mail-form .method-picker { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); margin-bottom: 16px; }
#mail-form .method-panel { margin-bottom: 16px; }
#mail-form .form-actions { margin-top: 4px; }
.style-switch__hint { grid-column: 1 / -1; order: 3; margin-top: -2px; }
mark.style-changed { background: var(--amber-soft); box-shadow: inset 0 -2px 0 #F0CD7E; color: inherit; border-radius: 2px; }

/* ── Ntern logo: the supplied image ── */
.brand-logo { display: block; }

/* ── Admin: auto-accept switch ─────────────────────────────────────────── */
.auto-accept { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 0 0 16px; padding: 14px 18px;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.auto-accept strong { display: block; font-size: 14.5px; }
.switch { position: relative; flex: none; width: 46px; height: 26px; padding: 0; border: 0; border-radius: 999px; background: var(--surface-3);
  cursor: pointer; transition: background .2s; }
.switch span { position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .2); transition: transform .2s; }
.switch.is-on { background: var(--st-sent); }
.switch.is-on span { transform: translateX(20px); }
.switch:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ── Where a company comes from, and where it is ───────────────────────── */
.src-tag { display: inline-block; margin-left: 6px; padding: 1px 6px; border-radius: 4px; vertical-align: 1px;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text-muted);
  font: 600 10px/1.5 var(--font-ui); letter-spacing: .02em; white-space: nowrap; }
.src-tag--ntern { border-color: #D6D9FB; background: var(--accent-soft); color: var(--accent); }
.loc-tag { display: inline-flex; align-items: center; gap: 3px; margin: 2px 4px 0 0; font-size: 11.5px; color: var(--text-muted); white-space: nowrap; }
.loc-tag::before { content: ""; width: 9px; height: 9px; flex: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8 15s5-4.6 5-8.5A5 5 0 0 0 3 6.5C3 10.4 8 15 8 15z' fill='none' stroke='%236A7082' stroke-width='1.6'/%3E%3Ccircle cx='8' cy='6.5' r='1.8' fill='%236A7082'/%3E%3C/svg%3E") center/contain no-repeat; }
.run-sources { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin: 0 0 10px; padding: 0; border: 0; }
.run-sources legend { float: left; margin-right: 6px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.run-source { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; }
.run-source .src-tag { margin-left: 0; font-size: 11px; }

.source-list { list-style: none; margin: 8px 0 10px; padding: 0; border: 1px solid var(--border); border-radius: var(--radius); }
.source-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 10px 14px; border-top: 1px solid var(--border-soft); font-size: 13.5px; }
.source-list li:first-child { border-top: 0; }
.source-list .src-tag { margin-left: 0; font-size: 11px; }
.source-list .button { margin-left: auto; }
.source-name { display: grid; gap: 4px; font-size: 13px; font-weight: 500; }
.source-name input { max-width: 260px; }

.inline-form { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.src-tag--inline { margin-left: 0; }

/* ── Profile: the student's own template ───────────────────────────────── */
.own-start { display: grid; gap: 10px; }
.own-start textarea { width: 100%; font: 14px/1.55 var(--font-ui); }
.own-redo { margin: 0 0 8px; }
.own-editor { display: grid; gap: 14px; margin-top: 6px; }
.own-langs { justify-self: start; }
.own-langs .segmented__item { border: 0; background: none; font: inherit; }
.own-langs .segmented__item.segmented__item--active { background: var(--surface); }
.own-field { display: grid; gap: 5px; }
.own-field label { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.own-field textarea, .own-field input[type="text"] { width: 100%; font: 14px/1.5 var(--font-ui); }
.own-field--inline { display: flex; align-items: center; gap: 10px; }
.own-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.own-chip { padding: 2px 8px; border: 1px dashed #C9CEF8; border-radius: 999px; background: var(--accent-soft); color: var(--accent);
  font: 500 11.5px var(--font-ui); cursor: pointer; }
.own-chip:hover { border-style: solid; }
.own-sections { display: grid; gap: 10px; }
.own-section { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.own-section__head { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: start; padding: 12px 14px;
  border-bottom: 1px solid var(--border-soft); }
.own-section__head p { margin: 2px 0 0; }
.own-section__num { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--navy);
  color: #fff; font: 600 12px var(--font-ui); }
.own-section__tools { display: flex; gap: 4px; }
.own-section__body { display: grid; gap: 12px; padding: 12px 14px 14px; }
.icon-btn { display: grid; place-items: center; width: 30px; height: 30px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text-2); font-size: 14px; cursor: pointer; }
.icon-btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.icon-btn:disabled { opacity: .35; cursor: default; }
.icon-btn--danger:hover:not(:disabled) { border-color: var(--st-failed); color: var(--st-failed); }
.own-add select { max-width: 280px; }
.own-actions { flex-wrap: wrap; align-items: center; }
.own-use { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; }
.own-problems { margin: 10px 0 0; padding: 10px 14px 10px 30px; border: 1px solid #F6CFCB; border-radius: var(--radius-sm);
  background: #FFF5F4; color: #A8322A; font-size: 13.5px; }
.template-card--own { border-style: dashed; }
@media (max-width: 640px) {
  .own-section__head { grid-template-columns: auto 1fr; }
  .own-section__tools { grid-column: 1 / -1; justify-content: flex-end; }
}
/* The blanks show under the field being written in. */
.own-field:not(:focus-within) .own-chips { display: none; }
.own-field--inline select { width: auto; min-width: 160px; }
.col-extras .loc-tag { white-space: normal; }
.loc-tag--phone { display: none; }
@media (max-width: 720px) { #app-table .loc-tag--phone { display: flex; margin: 3px 0 0; } }

/* ── Admin → Users: "Manage" opens in place, inside the row. A floating
   menu inside the scrollable table was clipped and covered by other cells. */
.admin-table td.row-actions { white-space: normal; vertical-align: top; min-width: 150px; }
.admin-table .action-menu { display: block; }
.admin-table .action-menu > summary { display: inline-flex; }
.admin-table .action-menu__panel { position: static; width: 270px; max-width: 100%; margin-top: 8px; box-shadow: none; background: var(--surface-2); }
.admin-table .action-menu[open] > summary { background: var(--surface-3); }
.daily-limit-form { display: grid; gap: 6px; padding: 8px 10px; margin-bottom: 4px; border-bottom: 1px solid var(--border-soft); }
.daily-limit-form .inline-form { gap: 6px; flex-wrap: nowrap; }
.daily-limit-form button { width: auto !important; border: 1px solid var(--border) !important; background: var(--surface) !important; text-align: center !important; }

.cell-limit { white-space: nowrap; }
.limit-form { display: inline-flex; align-items: center; gap: 6px; }
.limit-form input { width: 74px; }
.cell-limit .field-hint { display: block; margin-top: 3px; }
.limit-form input { flex: none; width: 78px; min-width: 78px; height: 32px; padding: 4px 8px; font-size: 13.5px; }
.limit-form .button { flex: none; }
.admin-table .cell-limit { min-width: 150px; }
/* The accounts table gets the full width; "Add a user" sits under it. */
.admin-grid { grid-template-columns: 1fr; }
.admin-grid > .panel:first-child .table-scroll { overflow-x: auto; }
.limit-form { display: grid; grid-template-columns: 78px auto; align-items: center; gap: 6px; }
.admin-table .cell-limit { min-width: 160px; white-space: normal; }

.run-paused { display: grid; gap: 4px; margin-bottom: 14px; }

/* ── Target places, and the Profile page guide ─────────────────────────── */
.loc-tag--fit { color: var(--st-sent); font-weight: 600; }
.loc-tag--fit::before { filter: hue-rotate(260deg) saturate(3); }
.fit-badge { margin-left: 5px; padding: 1px 6px; border-radius: 999px; background: #E3F6E8; color: #12602F; font: 600 10px/1.5 var(--font-ui); white-space: nowrap; }
.run-targets { margin: 0 0 10px; }
.run-targets > span:first-of-type { font-weight: 600; }
.page-guide { position: sticky; top: 64px; z-index: 15; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 18px; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: var(--radius); background: rgba(255, 255, 255, .96); backdrop-filter: blur(8px); }
.page-guide__label { margin-right: 4px; font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--text-muted); }
.page-guide a { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px; font-size: 13px; font-weight: 500; color: var(--text-2); text-decoration: none; }
.page-guide a:hover { background: var(--accent-soft); color: var(--accent); text-decoration: none; }
.page-guide b { display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--surface-3); font-size: 11px; color: var(--text-2); }
.places-more { flex-basis: 100%; }
.places-more summary { list-style: none; cursor: pointer; }
.places-more .ob-chips { margin-top: 10px; }
html { scroll-padding-top: 130px; }
@media (max-width: 720px) { .page-guide { position: static; } .page-guide__label { flex-basis: 100%; } }

/* ── Company page: plain facts, proof on a click ───────────────────────── */
.about-lead { margin: 0 0 14px; font-size: 15.5px; line-height: 1.55; color: var(--text); }
.about-facts { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.about-facts li { display: grid; grid-template-columns: 110px 1fr; gap: 10px; align-items: baseline; font-size: 14px; overflow-wrap: anywhere; }
.about-facts li > span:first-child { font-size: 12.5px; color: var(--text-muted); }
.match-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.match__label { margin: 8px 0 4px; font-size: 12.5px; color: var(--text-muted); }
.match__quote { margin: 0 0 6px; padding: 9px 12px; border-left: 3px solid var(--accent); border-radius: 0 6px 6px 0;
  background: var(--surface-2); font-size: 14px; line-height: 1.55; color: var(--text-2); }
.match__quote mark { background: var(--amber-soft); color: inherit; padding: 0 2px; border-radius: 3px; box-shadow: inset 0 -1px 0 #F0CD7E; font-weight: 600; }
.match__more { margin-top: 4px; font-size: 13px; }
.match__more summary { cursor: pointer; color: var(--accent); font-weight: 500; }
.match__more p { margin: 6px 0 0; color: var(--text-2); line-height: 1.5; }
.match__more .chip { margin: 0 4px 4px 0; }
.match-sub { margin: 20px 0 8px; padding-top: 16px; border-top: 1px solid var(--border-soft); font: 600 14px var(--font-ui); color: var(--text); }
.timeline-facts { display: grid; grid-template-columns: 150px 1fr; gap: 5px 12px; margin: 8px 0 0; font-size: 13px; }
.timeline-facts dt { color: var(--text-muted); }
.timeline-facts dd { margin: 0; color: var(--text-2); overflow-wrap: anywhere; }
@media (max-width: 640px) { .about-facts li, .timeline-facts { grid-template-columns: 1fr; gap: 2px; } }
.about-facts .src-tag { justify-self: start; }

/* ── CV manager ────────────────────────────────────────────────────────── */
.cv-manager { margin-bottom: 22px; }
.cv-list { list-style: none; margin: 12px 0; padding: 0; display: grid; gap: 12px; }
.cv-card { padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.cv-card--default { border-color: #C9CEF8; }
.cv-card__main { display: flex; gap: 14px; align-items: center; }
.cv-card__text { flex: 1; min-width: 0; }
.cv-score { --tone: var(--st-sent); flex: none; display: grid; place-content: center; text-align: center; width: 62px; height: 62px; border-radius: 50%;
  border: 4px solid var(--tone); color: var(--text); line-height: 1; }
.cv-score b { font: 700 20px/1 var(--font-head); }
.cv-score small { font-size: 10px; color: var(--text-muted); }
.cv-score--ok { --tone: #4A56E8; } .cv-score--warn { --tone: #C2810C; } .cv-score--bad { --tone: var(--st-failed); }
.cv-name { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; }
.cv-name input[type="text"] { width: min(240px, 100%); height: 34px; padding: 4px 8px; font: 600 15px var(--font-ui); border-color: transparent; background: transparent; }
.cv-name input[type="text"]:hover, .cv-name input[type="text"]:focus { border-color: var(--border); background: #fff; }
.cv-card__meta { margin: 2px 0 0; font-size: 13px; color: var(--text-muted); overflow-wrap: anywhere; }
.cv-areas { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 12px 0 0; padding-top: 12px; border-top: 1px solid var(--border-soft); }
.cv-areas__label { font-size: 13px; font-weight: 600; color: var(--text-2); }
.cv-areas .ob-chips { margin: 0; }
.ob-chips--small .ob-chip span { height: 30px; padding: 0 12px; font-size: 13px; }
.cv-card__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.cv-card__actions form { margin: 0; }
.cv-replace label { cursor: pointer; }
.cv-card__report { margin-top: 12px; }
.cv-card__report > summary { cursor: pointer; font-size: 13.5px; font-weight: 500; color: var(--accent); }
.cv-card__report .ats { margin-top: 10px; }
.cv-add { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 14px 16px; border: 1px dashed #C9CEF8; border-radius: var(--radius); background: var(--accent-soft); }
.cv-add input[type="text"] { flex: 1 1 220px; min-width: 0; }
.cv-tag { display: inline-block; padding: 1px 6px; border-radius: 4px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text-2);
  font: 600 10px/1.5 var(--font-ui); white-space: nowrap; vertical-align: 1px; }
.chip--warn { background: var(--amber-soft); border-color: #F3DDA6; color: var(--amber-ink); }
.outdated-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; margin-bottom: 16px; }
.outdated-bar > div:first-child { display: grid; gap: 3px; flex: 1 1 320px; }
.outdated-bar__actions { display: flex; gap: 8px; flex-wrap: wrap; }
.cv-pick__row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.cv-pick__row select { flex: 1 1 240px; min-width: 0; }
@media (max-width: 640px) { .cv-card__main { align-items: flex-start; } .cv-add .button { width: 100%; } }
.outdated-bar[hidden] { display: none; }
.cv-name input[type="text"] { flex: 0 1 240px; width: 240px; max-width: 100%; }
.cv-tag { margin-left: 6px; }
.status-pill + div .chip--warn { margin-top: 4px; font-size: 11px; }
.cv-line { display: block; margin-top: 3px; font-size: 11.5px; color: var(--text-muted); white-space: normal; }
.dead-notice { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; }
.admin-tabs .tab-count { display: inline-block; min-width: 18px; margin-left: 4px; padding: 0 6px; border-radius: 999px; background: var(--accent); color: #fff; font: 600 11px/18px var(--font-ui); text-align: center; }
.report-list { display: grid; gap: 10px; }
.report-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); }
.report-row__main { min-width: 0; flex: 1 1 320px; overflow-wrap: anywhere; }
.report-row__main p { margin: 4px 0 0; }
.report-row__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.report-row__actions form { margin: 0; }
/* One column that may shrink to the screen: a wide control inside a card (a file picker, a long choice) no longer widens every card past a phone's edge. */
.settings-stack, .settings-main, .profile-steps, .stack-form, .form-group { grid-template-columns: minmax(0, 1fr); }
@media (max-width: 900px) { .settings-layout, .settings-grid { grid-template-columns: minmax(0, 1fr); } }
input[type="file"] { min-width: 0; }
.settings-card .inline-form > select, .settings-card .inline-form > input { min-width: 0; max-width: 100%; }
/* Removing CVs: one button per CV, or several ticked at once. */
.cv-card__select { flex: none; display: grid; place-items: center; width: 22px; cursor: pointer; }
.cv-card__select input { width: 18px; height: 18px; margin: 0; accent-color: var(--st-failed); cursor: pointer; }
.cv-card__remove { flex: none; align-self: flex-start; margin: 0 0 0 auto; }
.cv-remove-btn { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border: 1px solid #F3C4C4; border-radius: var(--radius-sm);
  background: var(--surface); color: var(--st-failed); font: 500 13px var(--font-ui); cursor: pointer; }
.cv-remove-btn:hover, .cv-remove-btn:focus-visible { background: #FDEDED; border-color: var(--st-failed); }
.cv-remove-btn svg { width: 15px; height: 15px; flex: none; }
.cv-card--picked { border-color: var(--st-failed); box-shadow: inset 0 0 0 1px var(--st-failed); }
.cv-bulk { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 12px 0 0; padding: 10px 14px;
  border: 1px solid #F3C4C4; border-radius: var(--radius); background: #FEF6F6; }
.cv-bulk[hidden] { display: none; }
.cv-bulk__count { font-weight: 500; }
.cv-bulk__remove { background: var(--st-failed); border-color: var(--st-failed); color: #fff; }
.cv-bulk__remove:hover { filter: brightness(.95); }
@media (max-width: 640px) {
  /* The name takes the row; Remove sits on its own line, still in words. */
  .cv-card__main { flex-wrap: wrap; }
  .cv-card__text { flex-basis: calc(100% - 140px); }
  .cv-card__remove { margin-top: 2px; }
}

/* ============================================================ Applications
   The page head, the Prepare bar, the row of stages and the two-line list.
   Written for a phone first; wider screens put things side by side.
   Spacing in steps of 4 (4, 8, 12, 16, 24); text at 12, 13, 14, 15. */
.page-head { margin: 0 0 16px; }
.page-head h1 { margin: 0 0 4px; }
.page-head__status { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: 0; font-size: 14px; color: var(--text-muted); }
.page-head__status .dot { flex: none; margin-right: 2px; }
.page-head__fact { overflow-wrap: anywhere; }
.page-head__fact::before { content: "·"; margin-right: 8px; color: var(--text-dim); }
.dot--ok { background: var(--st-sent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--st-sent) 16%, transparent); }
.dot--todo { background: var(--amber); box-shadow: 0 0 0 3px color-mix(in srgb, var(--amber) 24%, transparent); }

.workspace-details { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px 24px;
  margin: 0 0 16px; padding: 16px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.workspace-details[hidden] { display: none; }
.workspace-details div { min-width: 0; }
.workspace-details dt { font-size: 12px; color: var(--text-muted); }
.workspace-details dd { margin: 2px 0 0; font-size: 14px; font-weight: 500; overflow-wrap: anywhere; }
.workspace-details dd a { margin-left: 6px; font-size: 13px; font-weight: 400; }

/* The one main action of the page, its progress and its Stop. It stays in
   view while the list scrolls (on a phone, only while a run is working). */
.run-bar { position: relative; z-index: 30; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px;
  margin: 0 0 16px; padding: 12px 16px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); box-shadow: var(--shadow); }
.run-bar--running, .run-bar--paused { position: sticky; top: 62px; }
.run-bar--running { border-color: color-mix(in srgb, var(--accent) 42%, var(--border)); background: color-mix(in srgb, var(--accent-soft) 70%, #fff); }
.run-bar--paused { border-color: #F3DDA6; background: var(--amber-soft); }
.run-bar__status { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; flex: 1 1 280px; min-width: 0; }
.run-bar__status .dot { align-self: center; flex: none; margin-right: 2px; }
.run-bar__status strong { font: 600 15px/1.35 var(--font-head); letter-spacing: -.01em; color: var(--text); }
.run-bar__note { min-width: 0; font-size: 13px; color: var(--text-muted); overflow-wrap: anywhere; }
.run-bar__note:empty { display: none; }
.run-bar__track { flex: 1 1 140px; max-width: 240px; height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.run-bar__track[hidden] { display: none; }
.run-bar__fill { height: 100%; border-radius: 3px; background: var(--accent); transition: width .4s ease; }
.run-bar__actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.run-bar__actions .button[hidden] { display: none; }
@media (min-width: 761px) { .run-bar { position: sticky; top: 68px; } }
@media (max-width: 760px) {
  .run-bar { gap: 8px 12px; padding: 12px; }
  .run-bar__actions { flex: 1 1 100%; flex-wrap: wrap; margin-left: 0; }
  .run-bar__actions .button--primary, .run-bar__actions .button--danger { flex: 1 1 150px; min-height: 44px; }
  .run-bar__actions .menu > summary { min-height: 44px; }
  .run-bar__track { flex-basis: 100%; max-width: none; }
  /* With nothing running, the button says it all: the bar is one row. */
  .run-bar--idle .run-bar__status { display: none; }
  .page-head h1 { font-size: 24px; }
  .page-head { margin-bottom: 12px; }
  .stage { padding-top: 12px; padding-bottom: 10px; }
  .table-controls { padding: 10px 12px; gap: 8px; }
  .table-controls .visible-count { display: none; }
}

/* A small menu that opens under its button (the run's options). */
.menu { position: relative; }
.menu > summary { list-style: none; cursor: pointer; }
.menu > summary::-webkit-details-marker { display: none; }
.menu > summary::after { content: ""; width: 7px; height: 7px; margin-left: 8px; border-right: 1.6px solid currentColor;
  border-bottom: 1.6px solid currentColor; transform: translateY(-2px) rotate(45deg); opacity: .7; }
.menu[open] > summary { background: var(--surface-2); }
.menu__panel { position: absolute; right: 0; top: calc(100% + 6px); z-index: 40; width: min(320px, calc(100vw - 32px));
  display: grid; gap: 16px; padding: 16px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); box-shadow: var(--shadow-lg); }
.run-options__panel fieldset { margin: 0; padding: 0; border: 0; display: grid; gap: 8px; min-width: 0; }
.run-options__panel legend { padding: 0; margin-bottom: 4px; font-size: 12px; font-weight: 500; color: var(--text-muted); }
.run-options__panel .run-source { display: flex; align-items: center; gap: 8px; font-size: 14px; min-height: 28px; }
.run-options__panel .batch-limit-label { justify-content: space-between; font-size: 14px; color: var(--text); white-space: normal; }
.run-options__panel .refresh-toggle { font-size: 14px; color: var(--text); padding-top: 12px; border-top: 1px solid var(--border-soft); }
@media (max-width: 760px) {
  /* On a phone the menu spans the bar instead of hanging off its button. */
  .run-options { position: static; }
  .run-options .menu__panel { left: 0; right: 0; width: auto; top: calc(100% + 6px); }
  .run-options__panel .run-source, .run-options__panel .refresh-toggle { min-height: 44px; }
}

.activity-panel { margin: -8px 0 16px; padding: 12px 16px; max-height: 264px; overflow-y: auto;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.activity-panel[hidden] { display: none; }
.activity-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 13.5px; color: var(--text-2); }
.activity-list li { position: relative; padding-left: 14px; overflow-wrap: anywhere; }
.activity-list li::before { content: ""; position: absolute; left: 0; top: .6em; width: 5px; height: 5px; border-radius: 50%; background: var(--text-dim); }
.activity-empty { margin: 0; font-size: 13.5px; color: var(--text-muted); }

/* What needs attention: one quiet line of chips, never a stack of banners. */
.attention { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.attention:not(:has(> .attention__item:not([hidden]))) { display: none; }
.attention__item { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding: 8px 12px;
  border: 1px solid #F3DDA6; border-radius: var(--radius-sm); background: var(--amber-soft); color: var(--text);
  font-size: 13.5px; text-decoration: none; }
.attention__item[hidden] { display: none; }
.attention__item strong { font-weight: 600; }
.attention__item--danger { border-color: color-mix(in srgb, var(--st-bounced) 32%, #fff);
  background: color-mix(in srgb, var(--st-bounced) 7%, #fff); color: var(--st-bounced); }
.attention__item--danger:hover { text-decoration: none; background: color-mix(in srgb, var(--st-bounced) 11%, #fff); }

/* One row that both counts and filters. */
.stages { display: flex; gap: 2px; padding: 0 12px; overflow-x: auto; scrollbar-width: none;
  border-bottom: 1px solid var(--border); background: var(--surface); }
.stages::-webkit-scrollbar { display: none; }
.stage { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 14px 10px 12px; border-bottom: 2px solid transparent;
  font-size: 13.5px; font-weight: 500; color: var(--text-muted); text-decoration: none; white-space: nowrap; }
.stage[hidden] { display: none; }
.stage:hover { color: var(--text); border-bottom-color: var(--border); text-decoration: none; }
.stage--active, .stage--active:hover { color: var(--text); border-bottom-color: var(--accent); }
.stage--favorites.stage--active { border-bottom-color: var(--star); }
.stage__count { min-width: 20px; padding: 1px 6px; border-radius: 999px; background: var(--surface-3); color: var(--text);
  font: 600 12px/1.5 var(--font-ui); text-align: center; font-variant-numeric: tabular-nums; }
.stage__count[hidden] { display: none; }
.stage--ready .stage__count { background: var(--accent-soft); color: var(--accent); }
.stage--problems .stage__count { background: color-mix(in srgb, var(--st-failed) 10%, #fff); color: var(--st-bounced); }

.table-controls__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; margin-left: auto; }
.cap-meter { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.cap-meter__track { width: 48px; height: 4px; border-radius: 2px; background: var(--surface-3); overflow: hidden; }
.cap-meter__fill { display: block; height: 100%; background: var(--st-sent); }
@media (max-width: 760px) { .table-controls__meta { flex-basis: 100%; margin-left: 0; } }

.problems-note { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px;
  padding: 12px 16px; border-bottom: 1px solid var(--border-soft); background: var(--surface-2); font-size: 13.5px; color: var(--text-2); }
.problems-note__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }

/* Two lines per company. */
.company-link { color: var(--text); font-weight: 500; text-decoration: none; }
.company-link:hover { color: var(--accent); text-decoration: underline; }
.cell-company .company-link, .row-main { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-sub { display: flex; align-items: center; gap: 0; margin-top: 3px; overflow: hidden; white-space: nowrap;
  font-size: 12.5px; font-weight: 400; color: var(--text-muted); }
.row-sub > * { flex: none; }
.row-sub > * + *::before { content: "·"; margin: 0 6px; color: var(--text-dim); font-weight: 400; }
.row-sub .row-sub__email { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.row-sub .loc-tag, .row-sub .cv-line { display: inline-flex; margin: 0; font-size: inherit; white-space: nowrap; }
.row-sub .loc-tag::before { display: none; }
.row-sub .loc-tag + *::before, .row-sub > .loc-tag::before { content: "·"; display: inline; width: auto; height: auto; background: none; filter: none; }
.row-sub .src-tag { margin-left: 0; vertical-align: 0; }
.row-sub__match { display: none; color: var(--text-2); font-weight: 500; }
.row-sub__match--none { color: var(--text-muted); font-weight: 400; }
@media (max-width: 860px) {
  /* On a card: what it matches and where it is. The address gives way (it is
     on the company's page) unless it is all there is to say. */
  .row-sub .row-sub__match { display: inline; flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  .row-sub .row-sub__email:not(:only-child) { display: none; }
  .row-sub .row-sub__email:not(:only-child) + *::before { content: none; }
}
.row-sub .fit-badge { margin-left: 6px; }
.cell-status .status-pill { white-space: nowrap; }

/* A phone's first screen is for companies: what is said elsewhere gives way
   (the hidden-companies count is on its filter; today's limit is in the send
   dialog and the bar for several companies). */
@media (max-width: 860px) {
  .table-controls .cap-meter, .cv-match-note[data-no-match-note] { display: none; }
  #app-table thead { display: none; }                       /* "Select all" is in the bar that appears once a company is ticked */
  .table-controls__meta:not(:has(> :not(.cap-meter):not(.visible-count))) { display: none; }
}
@media (min-width: 861px) { #select-page-btn { display: none; } }
.action-menu__link { display: block; padding: 9px 10px; border-radius: var(--radius-sm); color: var(--text); font-size: 13.5px; text-decoration: none; }
.action-menu__link:hover { background: var(--surface-2); text-decoration: none; }

/* ── Company page ─────────────────────────────────────────────────────────
   Who they are next to the email, one main action, and a history that stays
   closed until it is asked for. */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.detail-header { align-items: flex-start; }
.detail-title { flex: 1 1 320px; min-width: 0; }
.detail-title__row { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; }
.detail-title__row h1 { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.detail-header .subtitle { margin: 6px 0 0; overflow-wrap: anywhere; }
.detail-header .subtitle > span + span::before { content: " · "; }
.detail-lead { display: none; }
@media (max-width: 800px) {
  /* One column: the company card is further down, so the header says who they
     are. The address is in the email's "To" line just below. */
  .subtitle--facts .detail-email { display: none; }
  .detail-header .subtitle--facts .detail-email + span::before { content: none; }
  .detail-lead { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden;
    margin: 6px 0 0; font-size: 14.5px; line-height: 1.5; color: var(--text-2); }
}
.fav-toggle--icon { display: inline-grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 50%;
  background: none; color: var(--text-dim); font-size: 22px; line-height: 1; cursor: pointer; }
.fav-toggle--icon:hover, .fav-toggle--icon.fav-toggle--on:hover { background: var(--surface-2); color: var(--star); }
.fav-toggle--icon.fav-toggle--on { color: var(--star); }
.detail-actions { position: relative; }
.more-actions__panel { gap: 2px; padding: 6px; }
.menu-item { display: grid; gap: 2px; width: 100%; padding: 10px 12px; border: 0; border-radius: var(--radius-sm); background: none;
  color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.menu-item:hover, .menu-item:focus-visible { background: var(--surface-2); }
.menu-item:disabled { opacity: .6; cursor: default; }
.menu-item b { font-size: 14px; font-weight: 600; }
.menu-item small { font-size: 12.5px; line-height: 1.45; color: var(--text-muted); }
.detail-header + #detail-action-result:empty { display: none; }
#detail-action-result { display: block; margin: -8px 0 16px; font-size: 13.5px; }
.error-box, .detail-header ~ .notice { margin-bottom: 16px; }

/* Style, language and CV of this one email: one line of small controls. */
.email-options { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 16px; margin: 0 0 10px; }
.email-option { display: grid; gap: 5px; flex: 0 0 auto; min-width: 0; }
.email-option--wide { flex: 1 1 200px; }
.email-option label, .email-option__label { font-size: 12.5px; font-weight: 500; color: var(--text-muted); }
.email-option select { width: 100%; min-width: 0; height: 38px; }
.email-option .lang-chip { justify-self: start; padding: 6px 8px; font-size: 12px; margin-bottom: 7px; }
.email-options__note { margin: 0 0 10px; }
.style-about { margin: 0 0 16px; font-size: 13px; }
.style-about > summary { width: fit-content; cursor: pointer; color: var(--accent); font-weight: 500; }
.style-about[open] > summary { margin-bottom: 8px; }
.style-about .style-note { margin-top: 6px; }

.about h2 { overflow-wrap: anywhere; }
.about-missing { margin: 0 0 14px; }
.about-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.about-facts .fit-badge { margin-left: 4px; }

.history { padding: 0; }
.history__summary { display: flex; align-items: baseline; justify-content: space-between; gap: 6px 16px; flex-wrap: wrap;
  padding: 16px 22px; cursor: pointer; list-style: none; border-radius: inherit; }
.history__summary::-webkit-details-marker { display: none; }
.history__summary:hover { background: var(--surface-2); }
.history__title { font: 600 15px var(--font-ui); color: var(--text); }
.history__title::after { content: ""; display: inline-block; width: 7px; height: 7px; margin-left: 10px; border-right: 1.6px solid currentColor;
  border-bottom: 1.6px solid currentColor; transform: translateY(-3px) rotate(45deg); opacity: .6; }
.history[open] .history__title::after { transform: translateY(1px) rotate(-135deg); }
.history__last { min-width: 0; font-size: 13px; color: var(--text-muted); }
.history[open] > .history__summary { border-bottom: 1px solid var(--border-soft); border-radius: 0; }
.history > .timeline, .history > .timeline-earlier { margin: 16px 22px; }
.history > .timeline { margin-bottom: 20px; margin-left: 27px; }
.history .timeline-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; gap: 2px 12px; padding-bottom: 14px; }
.history .timeline-item:last-child { padding-bottom: 0; }
.history .timeline-message { margin: 0; font-size: 14px; font-weight: 500; color: var(--text); }
.history .timeline-time { font: 400 12.5px var(--font-ui); color: var(--text-muted); white-space: nowrap; }
.timeline-note, .history .timeline-error { grid-column: 1 / -1; margin: 0; font-size: 13px; line-height: 1.5; color: var(--text-2); overflow-wrap: anywhere; }
.history .timeline-error { color: var(--st-failed); }
.timeline-item--failed::before { background: var(--st-failed); }
.history .timeline--earlier { padding: 10px 12px 12px 18px; margin-left: 6px; }
.tech-record__facts { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 6px 12px; margin: 16px 22px; font-size: 13px; }
.tech-record__facts dt { color: var(--text-muted); }
.tech-record__facts dd { margin: 0; overflow-wrap: anywhere; }
.tech-record__log { list-style: none; margin: 0 22px 20px; padding: 12px 0 0; border-top: 1px solid var(--border-soft); display: grid; gap: 8px;
  font: 400 12.5px/1.5 var(--font-mono); color: var(--text-2); overflow-wrap: anywhere; }
.tech-record__log span { color: var(--text-muted); }

@media (max-width: 760px) {
  .detail-header { margin-bottom: 16px; padding-bottom: 16px; }
  .detail-actions .button, .detail-actions .menu > summary { min-height: 44px; }
  .detail-actions .send-detail-btn { flex: 1 1 100%; order: -1; }
  .detail-actions .more-actions { position: static; flex: 1 1 auto; }
  .detail-actions .more-actions > summary { width: 100%; justify-content: center; }
  .detail-actions .more-actions__panel { left: 0; right: 0; width: auto; }
  .fav-toggle--icon { width: 44px; height: 44px; }
  .email-option select { height: 44px; font-size: 16px; }
  .email-option .lang-switch__option { height: 44px; }
  .history__summary { padding: 14px 16px; }
  .history > .timeline, .history > .timeline-earlier { margin: 14px 16px; }
  .history > .timeline { margin-left: 21px; }
  .tech-record__facts { grid-template-columns: 104px minmax(0, 1fr); margin: 14px 16px; }
  .tech-record__log { margin: 0 16px 16px; }
  .detail-nav .button, .detail-tab { min-height: 44px; }
  /* On a phone the email comes first; what can be changed about it follows. */
  .email-panel { display: flex; flex-direction: column; }
  .email-panel > .email-options, .email-panel > .email-options__note, .email-panel > .style-about { order: 3; }
  .email-panel > .email-options { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border-soft); }
  .email-panel > .style-about { margin-bottom: 0; }
}
/* Label beside its value at every width: the card stays short on a phone. */
@media (max-width: 640px) { .about-facts li { grid-template-columns: 104px minmax(0, 1fr); gap: 10px; } }

/* ── Settings: horizontal tabs ────────────────────────────────────────────
   One tab at a time, under a bar that stays in reach. Without scripts every
   section simply shows, one under the other. */
.settings-tabs { position: sticky; top: 60px; z-index: 20; display: flex; gap: 2px; margin: 0 0 12px; border-bottom: 1px solid var(--border);
  background: var(--bg); overflow-x: auto; scrollbar-width: none; }
.settings-tabs::-webkit-scrollbar { display: none; }
.settings-tab { flex: none; display: inline-flex; align-items: center; gap: 8px; min-height: 46px; padding: 0 14px; border-bottom: 2px solid transparent;
  margin-bottom: -1px; color: var(--text-muted); font: 500 14.5px var(--font-ui); white-space: nowrap; }
.settings-tab:hover { color: var(--text); text-decoration: none; }
.settings-tab.is-active { color: var(--text); border-bottom-color: var(--accent); font-weight: 600; }
.settings-note { margin: 0 0 18px; font-size: 12.5px; color: var(--text-muted); }
.settings-main[data-active="ai"] > [data-tab]:not([data-tab="ai"]),
.settings-main[data-active="files"] > [data-tab]:not([data-tab="files"]),
.settings-main[data-active="mail"] > [data-tab]:not([data-tab="mail"]),
.settings-main[data-active="sending"] > [data-tab]:not([data-tab="sending"]),
.settings-main[data-active="account"] > [data-tab]:not([data-tab="account"]) { display: none; }
.settings-card { scroll-margin-top: 120px; }
.settings-fold > summary { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; cursor: pointer; list-style: none; }
.settings-fold > summary::-webkit-details-marker { display: none; }
.settings-fold__title { font: 600 18px var(--font-head, var(--font-ui)); color: var(--text); }
.settings-fold__title::after { content: ""; display: inline-block; width: 7px; height: 7px; margin-left: 10px; border-right: 1.6px solid currentColor;
  border-bottom: 1.6px solid currentColor; transform: translateY(-3px) rotate(45deg); opacity: .6; }
.settings-fold[open] .settings-fold__title::after { transform: translateY(1px) rotate(-135deg); }
.settings-fold__hint { font-size: 13.5px; color: var(--text-muted); }
.settings-fold[open] > summary { margin-bottom: 14px; }
.provider-more { border: 1px dashed var(--border); border-radius: var(--radius); padding: 12px 14px; }
.provider-more > summary { cursor: pointer; font-size: 14px; font-weight: 500; color: var(--accent); }
.provider-more[open] > summary { margin-bottom: 12px; }
@media (max-width: 760px) {
  .settings-tabs { top: 54px; margin: 0 -16px 12px; padding: 0 8px; }
  .settings-tab { padding: 0 12px; }
  .settings-card { scroll-margin-top: 112px; }
}
/* The lists and CVs tab on the narrowest phones: nothing wider than the screen. */
.import-box, .cv-manager { grid-template-columns: minmax(0, 1fr); min-width: 0; }
.import-box > *, .cv-manager > * { min-width: 0; }
.import-form input[type="file"], .cv-add input[type="file"] { max-width: 100%; min-width: 0; }

/* ── Profile: the same tab bar as Settings ─────────────────────────────── */
.settings-main[data-active="says"] > [data-tab]:not([data-tab="says"]),
.settings-main[data-active="style"] > [data-tab]:not([data-tab="style"]),
.settings-main[data-active="cv"] > [data-tab]:not([data-tab="cv"]),
.settings-main[data-active="places"] > [data-tab]:not([data-tab="places"]) { display: none; }
/* What the emails say comes first; analysing the CV again is below it. */
.profile-steps > #editor { order: -1; }
.profile-steps > #dates { order: -1; }
/* Profile on phones: nothing wider than the screen. */
.own-start, .dates-form, .own-editor { grid-template-columns: minmax(0, 1fr); min-width: 0; }
@media (min-width: 561px) { .dates-form { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
@media (min-width: 901px) { .dates-form { grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr) minmax(0, .8fr) auto; } }
.own-template > *, .own-start > *, .dates-form > *, .own-editor > * { min-width: 0; max-width: 100%; }
.own-template textarea, .own-template input[type="text"], .dates-form select, .dates-form input { box-sizing: border-box; width: 100%; max-width: 100%; min-width: 0; }
.own-actions .own-use { flex: 1 1 100%; }
@media (max-width: 560px) {
  .settings-card .form-actions, .settings-card .dates-form__actions, .settings-card .editor-actions { flex-wrap: wrap; }
  .settings-card .button { max-width: 100%; height: auto; min-height: 40px; white-space: normal; }
}

/* ── Open positions ─────────────────────────────────────────────────────── */
.offers-mark { display: inline-block; margin-left: 8px; padding: 1px 7px; border-radius: 999px; background: var(--accent-soft); color: var(--accent);
  font: 600 11px/1.6 var(--font-ui); white-space: nowrap; vertical-align: middle; }
.offers-mark:hover { text-decoration: none; background: color-mix(in srgb, var(--accent) 16%, #fff); }
.positions h2 .chip { margin-left: 6px; vertical-align: middle; }
.position-list { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 0; }
.position { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 14px; padding: 12px 0;
  border-top: 1px solid var(--border-soft); }
.position:first-child { border-top: 0; padding-top: 2px; }
.position--chosen { background: var(--accent-soft); margin: 0 -10px; padding-left: 10px; padding-right: 10px; border-radius: var(--radius-sm); }
.position__text { display: grid; gap: 3px; min-width: 0; flex: 1 1 200px; }
.position__text strong { font-size: 14px; overflow-wrap: anywhere; }
.position__text .fit-badge { margin-left: 0; margin-right: 4px; }
.position__actions { display: flex; flex-wrap: wrap; gap: 6px; }
.positions__chosen { margin: 0 0 12px; font-size: 13.5px; }
.positions__more { margin: 6px 0 0; font-size: 13.5px; }
@media (max-width: 760px) { .position__actions .button { min-height: 40px; flex: 1 1 auto; } }

/* Profile: one part of the editor at a time. */
.settings-main[data-active="own"] > [data-tab]:not([data-tab="own"]) { display: none; }
.settings-main[data-active]:not([data-active="own"]) > [data-tab="own"] { display: none; }
/* Every bar in the product is the same: plain labels, the chosen one underlined in the accent colour. */
.editor-parts { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--border); }
.editor-parts::-webkit-scrollbar { display: none; }
.editor-part { flex: none; min-height: 42px; padding: 0 12px; border: 0; border-bottom: 2px solid transparent; border-radius: 0; margin-bottom: -1px; background: none;
  color: var(--text-muted); font: 500 14px var(--font-ui); white-space: nowrap; cursor: pointer; }
.editor-part:hover { color: var(--text); background: none; }
.editor-part.is-active { color: var(--text); border-bottom-color: var(--accent); background: none; }
.editor-part--check::after { content: ""; display: inline-block; width: 7px; height: 7px; margin-left: 8px; border-radius: 50%; background: var(--warn); vertical-align: middle; }
.profile-editor > .editor-section[hidden] { display: none; }
.profile-editor { gap: 18px; }
@media (max-width: 760px) { .editor-part { min-height: 44px; } }
/* Email styles on a phone: one row to swipe instead of a long column. */
@media (max-width: 760px) {
  .template-grid { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x proximity; margin: 0 -16px 18px; padding: 2px 16px 10px; scrollbar-width: none; }
  .template-grid::-webkit-scrollbar { display: none; }
  .template-grid > .template-card { flex: 0 0 78%; scroll-snap-align: start; align-content: start; }
}

/* The offers collector on the administrator's page. */
.collector { margin: 0 0 20px; padding: 16px 18px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); }
.collector__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin-bottom: 14px; }
.collector__state { display: inline-flex; align-items: center; gap: 8px; font: 600 15px var(--font-ui); }
.collector__numbers { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px 18px; margin: 0 0 12px; }
.collector__numbers dt { font-size: 12.5px; color: var(--text-muted); }
.collector__numbers dd { margin: 2px 0 0; font: 600 20px var(--font-ui); font-variant-numeric: tabular-nums; }

/* Hand-written wording: change a phrase everywhere. */
.phrase-form { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px 18px; align-items: start; }
.phrase-form .form-actions { grid-column: 1 / -1; }
.phrase-form input { width: 100%; box-sizing: border-box; }
@media (max-width: 640px) { .phrase-form { grid-template-columns: minmax(0, 1fr); } }
.profile-steps > #wording-phrase { order: -2; }

/* Advice shown with the built-in email styles. */
.style-advice { margin: 0 0 16px; padding: 14px 16px; border: 1px solid color-mix(in srgb, var(--accent) 25%, var(--border));
  border-left: 3px solid var(--accent); border-radius: var(--radius); background: var(--accent-soft); font-size: 14px; color: var(--text); }
.style-advice[hidden] { display: none; }
.style-advice__title { display: block; margin-bottom: 4px; font-weight: 600; }
.style-advice p { margin: 0 0 6px; color: var(--text-2); }
.style-advice ul { margin: 0; padding-left: 18px; display: grid; gap: 3px; color: var(--text-2); }

/* Admin: not-delivered addresses deleted automatically. */
.undelivered-stats { margin: 4px 0 12px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius); }
.undelivered-stats dl { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px 16px; margin: 8px 0; }
.undelivered-stats dt { font-size: 12px; color: var(--text-2); }
.undelivered-stats dd { margin: 0; font-size: 20px; font-weight: 600; }

/* An AI key that needs the student: said on every page until fixed. */
.key-notice { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin: 0 0 14px; padding: 12px 14px;
  border: 1px solid color-mix(in srgb, var(--warning, #d97706) 40%, var(--border)); border-left: 3px solid var(--warning, #d97706);
  border-radius: var(--radius); background: color-mix(in srgb, var(--warning, #d97706) 8%, var(--surface, transparent)); font-size: 14px; }
.key-notice strong { flex-basis: 100%; }
.key-notice span { flex: 1 1 280px; color: var(--text-2); }

/* Emails added to the student's plan, said once on every page. */
.credit-notice { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin: 0 0 14px; padding: 12px 14px;
  border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--border)); border-left: 3px solid var(--accent);
  border-radius: var(--radius); background: var(--accent-soft); font-size: 14px; }
.credit-notice strong { flex-basis: 100%; }
.credit-notice span { flex: 1 1 260px; color: var(--text-2); }
.credits-left { font-size: 13px; font-weight: 600; white-space: nowrap; }
.credits-left--low { color: #A8322A; }
.key-notice__actions { display: inline-flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.key-notice__actions form { margin: 0; }
.provider-card.is-paused { opacity: .75; }

/* Messages from the administrator, on every page until read. */
.admin-message { margin: 0 0 14px; padding: 12px 14px; border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--border));
  border-left: 3px solid var(--accent); border-radius: var(--radius); background: var(--accent-soft); font-size: 14px; }
.admin-message p { margin: 4px 0 10px; color: var(--text-2); white-space: pre-line; }
.admin-message__actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.admin-message__actions form { margin: 0; }
.notify-list { display: grid; gap: 6px; max-height: 280px; overflow: auto; padding: 8px; border: 1px solid var(--border);
  border-radius: var(--radius); }
.notify-list label { display: flex; gap: 8px; align-items: center; font-size: 14px; }
.notify-sent { display: grid; gap: 10px; }
.notify-sent article { padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius); }
.notify-sent p { margin: 4px 0; color: var(--text-2); white-space: pre-line; }
