/* Layout from Claus' handoff; all visual primitives come from KEN tokens. */
* { box-sizing: border-box; }
body { margin: 0; background: var(--surface-app); }
button, input, textarea { font-family: var(--font-core); }
h1, h2, p { margin: 0; }
h1 { font-size: 32px; font-weight: 500; }
h2 { font-size: 19px; font-weight: 500; }
.preview-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; padding: 10px 24px; background: var(--surface-page); border-bottom: var(--border-hairline); }
.preview-bar .row { margin-left: auto; }
.technician-field { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.technician-field label { font-size: 13.5px; }
.technician-field input { width: 112px; }
.technician-field + .row { margin-left: 8px; }
.eyebrow { font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; font-weight: 500; color: var(--text-muted); }
.frame { width: 100%; margin: 0 auto; }
.frame.phone { max-width: 390px; margin: 24px auto; border: var(--border-hairline); }
main { padding: 28px 24px 56px; max-width: 1228px; margin: auto; }
.page-title { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.saved { font-size: 13.5px; color: var(--text-muted); display: flex; align-items: center; gap: 8px; }
.dot { display: inline-block; flex-shrink: 0; width: 8px; height: 8px; border-radius: var(--radius-pill); background: var(--status-ok-fg); }
.columns { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 24px; }
.input-card { flex: 1 1 440px; min-width: 0; padding: 24px; background: var(--surface-page); border: var(--border-hairline); }
.stack { display: flex; flex-direction: column; gap: 16px; }
.small-stack { display: flex; flex-direction: column; gap: 8px; }
.row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.muted { color: var(--ken-grey-600); font-size: 15px; line-height: 1.5; }
.help { color: var(--text-muted); font-size: 13.5px; line-height: 1.5; }
label { font-size: 15px; font-weight: 500; color: var(--text-heading); }
.examples, .feedback { border-top: var(--border-hairline); padding-top: 16px; }
.chip { min-height: 44px; padding: 8px 16px; background: var(--surface-page); border: var(--border-hairline); border-radius: var(--radius); color: var(--text-heading); font-size: 15px; font-weight: 500; cursor: pointer; }
.chip:hover { background: var(--surface-card-quiet); }
.chip.selected { background: var(--action-primary-bg); color: var(--action-primary-fg); border-color: var(--action-primary-bg); }
.chip:disabled { cursor: not-allowed; color: var(--text-disabled); }
aside { flex: 1 1 360px; min-width: 0; position: sticky; top: 24px; }
.result { background: var(--surface-page); border: var(--border-hairline); }
.result-header { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: var(--border-hairline); }
.result-header h2 { flex: 1; }
.result-body { padding: 20px; }
.invoice-placeholder { padding: 8px 10px; color: var(--text-muted); font-size: 15px; line-height: 1.5; }
.invoice-line { margin: 0; padding: 8px 10px; font-size: 16px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.invoice-line.new { border-left: 3px solid var(--status-ok-fg); background: var(--surface-card-quiet); color: var(--text-heading); }
.copy-area { padding: 0 20px 20px; }
.reminders { background: var(--surface-page); border: var(--border-hairline); }
.reminders ul { list-style: none; margin: 0; padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; }
.reminders li { display: flex; align-items: flex-start; gap: 12px; }
.reminders li > div { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.reminder-dot { flex: 0 0 auto; width: 6px; height: 6px; margin-top: 8px; border-radius: var(--radius-pill); background: var(--ken-blue-200); }
.reminder-label { color: var(--text-heading); font-size: 16px; font-weight: 500; line-height: 1.35; }
.reminder-note { padding: 14px 20px; border-top: var(--border-hairline); }
.copy-toast { position: fixed; z-index: 20; left: 24px; bottom: 24px; max-width: calc(100vw - 48px); display: flex; align-items: flex-start; gap: 12px; padding: 16px; background: var(--surface-page); border: var(--border-hairline); border-left: 3px solid var(--status-ok-fg); box-shadow: var(--shadow-overlay); }
.copy-toast > div { min-width: 0; }
.copy-toast > :first-child { flex-shrink: 0; color: var(--status-ok-fg); }
.questions { padding: 16px 20px; border: var(--border-hairline); background: var(--surface-app); }
.questions .dot { background: var(--status-warn-fg); }
.answer-row { display: flex; gap: 8px; }
.answer-row input { min-width: 0; }
.error-card { border: 1px solid var(--status-error-fg); border-left-width: 3px; padding: 20px; background: var(--surface-page); }
.error-text { color: var(--status-error-fg); font-size: 15px; }
.listening { display: flex; align-items: center; gap: 12px; padding: 16px; min-height: 64px; background: var(--surface-card-quiet); border: 1px solid var(--border-focus); color: var(--text-heading); }
.listening .dot { width: 12px; height: 12px; background: var(--status-error-fg); animation: pulse 1s infinite; }
.waiting { padding: 24px 10px; color: var(--text-heading); animation: pulse 1.5s infinite; }
.access { max-width: 1180px; margin: 16px auto 0; padding: 0 24px; }
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: min(100%, 440px); padding: 32px; background: var(--surface-page); border: var(--border-hairline); }
.login-card img { width: 132px; height: auto; }
.access-relogin { padding-top: 16px; border-top: var(--border-hairline); }
.access-logout-link { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 10px 16px; border: var(--border-hairline); color: var(--action-primary-bg); font-size: 15px; font-weight: 500; text-align: center; text-decoration: none; }
.access-logout-link:hover { background: var(--surface-card-quiet); }
.access-logout-link:focus-visible { outline: 2px solid var(--border-focus); outline-offset: 2px; }
.session-user { display: flex; align-items: center; gap: 12px; margin-left: auto; color: var(--text-muted); font-size: 13.5px; }
.session-user + .technician-field { margin-left: 0; }
.logout-error { flex-basis: 100%; text-align: right; }
.run-status { padding: 14px 16px; background: var(--surface-page); border: var(--border-hairline); }
.status-dot { width: 9px; height: 9px; border-radius: var(--radius-pill); background: var(--text-muted); }
.status-dot.active { background: var(--status-warn-fg); animation: pulse 1.5s infinite; }
.status-dot.done { background: var(--status-ok-fg); }
.status-dot.failed { background: var(--status-error-fg); }
.archive-list { display: flex; flex-direction: column; gap: 12px; }
.archive-item { display: flex; align-items: center; gap: 16px; min-width: 0; padding: 16px 20px; background: var(--surface-page); border: var(--border-hairline); }
.archive-case { flex: 1; min-width: 0; color: var(--text-heading); }
.archive-case > strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 16px; font-weight: 500; }
.archive-runs { display: flex; flex-wrap: wrap; gap: 8px; }
.archive-run { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; max-width: 100%; min-height: 38px; padding: 7px 10px; color: var(--text-heading); background: var(--surface-card-quiet); border: var(--border-hairline); border-radius: var(--radius); cursor: pointer; }
.archive-run > span { white-space: nowrap; }
.archive-run:hover { border-color: var(--border-focus); }
.archive-date { color: var(--text-muted); font-size: 13px; }
.archive-empty { padding: 28px; background: var(--surface-page); border: var(--border-hairline); }
.delete-confirm { max-width: 340px; padding-left: 16px; border-left: 2px solid var(--status-error-fg); font-size: 14px; }
.phone main { padding: 24px 16px; }
.phone .input-card { padding: 20px; }
.phone aside { position: static; }
.phone .reminders { display: none; }
.phone header { gap: 8px !important; padding: 0 12px !important; }
.phone header nav { display: none !important; }
.phone header > div:last-child { margin-left: auto; }
.phone header > div:last-child > span { padding-left: 0 !important; border: 0 !important; font-size: 12px !important; }
@media (max-width: 600px) {
  main { padding: 24px 16px; }
  .input-card { padding: 20px; }
  aside { position: static; }
  .reminders { display: none; }
  .preview-bar { padding: 10px 16px; }
  .session-user { order: 2; width: 100%; margin-left: 0; flex-wrap: wrap; }
  .archive-item { align-items: flex-start; flex-wrap: wrap; }
  .delete-confirm { width: 100%; max-width: none; }
  .technician-field { order: 2; margin-left: 0; }
  .technician-field + .row { margin-left: auto; }
  header { gap: 8px !important; padding: 0 12px !important; }
  header nav { display: none !important; }
  header > div:last-child { margin-left: auto; }
  header > div:last-child > span { padding-left: 0 !important; border: 0 !important; font-size: 12px !important; }
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .4; } }
@media (prefers-reduced-motion: reduce) { .listening .dot, .waiting, .status-dot.active { animation: none; } }
