/* HelpMeBaby agent workspace, styled to the v2 UI template (helpmebaby-pkg/design/HelpMeBaby-UI-Template.html).
   Inter (SIL OFL 1.1, see fonts/LICENSE-Inter-OFL.txt) is served from this server, as the template bundles it. */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("fonts/inter-latin.woff2") format("woff2"); }
:root {
  --rail: #13202B; --rail-ink: #C9D4DD; --rail-muted: #9FB0BE; --rail-on: #22384A; --rail-av: #2E4E66;
  --ink: #1B2430; --ink-2: #33404F; --muted: #5B6676; --bg: #F6F7F9; --panel: #FFFFFF; --soft: #F9FAFB;
  --line: #E3E7EC; --line-2: #EEF1F4; --field: #D5DCE3; --link: #1F5470; --link-hi: #163E54; --sel: #EAF2F7;
  --primary: #1F5470; --primary-line: #C9D9E4; --send: #B04E0C;
  --ai-bg: #F5F2FC; --ai-line: #DDD3F3; --ai-ink: #4B2F86; --ai-av: #5B3E96; --ai-chip: #E6DDF7;
  --note-bg: #FFF8E6; --note-line: #F0DFAE; --note-ink: #6B4E00; --note-chip: #F7E7B9;
  --ok: #2B6338; --ok-bg: #E4F2E8; --err: #9B1C1C; --err-bg: #FDECEC;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 14px/1.45 Inter, system-ui, -apple-system, "Segoe UI", sans-serif; }
a { color: var(--link); } a:hover { color: var(--link-hi); }
code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 12px; }
.muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.empty { margin: 0; padding: 24px 16px; color: var(--muted); }

/* the shell: rail 230 | list 340 | ticket | details 300 (template .hd-shell) */
.shell { display: grid; grid-template-columns: 230px 340px minmax(0, 1fr) 300px; height: 100vh; }
.shell.admin { grid-template-columns: 230px minmax(0, 1fr); }
.shell > * { min-height: 0; }

/* rail */
.rail { background: var(--rail); color: var(--rail-ink); display: flex; flex-direction: column; gap: 24px; padding: 20px 12px;
  overflow: auto; }
.rail-brand { display: flex; align-items: center; gap: 10px; padding: 0 8px; text-decoration: none; }
.rail-brand img { flex: none; }
.rail-brand span { display: flex; flex-direction: column; gap: 2px; }
.rail-brand b { font-size: 15px; font-weight: 600; color: #FFFFFF; }
.rail-brand small { font-size: 12px; color: var(--rail-muted); }
.rg { display: flex; flex-direction: column; gap: 4px; }
.rg h2 { margin: 0 8px 6px; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  color: var(--rail-muted); }
.rv, .rl { display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 40px; padding: 0 10px;
  border-radius: 8px; color: var(--rail-ink); text-decoration: none; font-size: 14px; }
.rv:hover, .rl:hover { color: #FFFFFF; background: rgba(255,255,255,.05); }
.rv.on, .rl.on { background: var(--rail-on); color: #FFFFFF; font-weight: 500; }
.rv .count { font-size: 12px; color: var(--rail-muted); }
.rv.on .count { color: var(--rail-ink); }
.ai-state { display: flex; align-items: center; gap: 8px; margin: -2px 10px 4px; font-size: 12px; color: var(--rail-muted);
  text-decoration: none; }
.ai-state .dot { width: 8px; height: 8px; border-radius: 50%; background: #9FB0BE; flex: none; }
.ai-state[data-agent-status=shadow] .dot { background: #B9A6EA; }
.ai-state[data-agent-status=active] .dot { background: #6FCF97; }
.ai-state[data-agent-status=paused] .dot { background: #F28B82; }
.rail-me { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 12px 8px 0; border-top: 1px solid var(--rail-on); }
.rail-me .av { width: 32px; height: 32px; border-radius: 50%; background: var(--rail-av); color: #FFFFFF; display: flex;
  align-items: center; justify-content: center; font-size: 13px; font-weight: 600; flex: none; }
.rail-me .who { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.rail-me .who b { font-size: 14px; font-weight: 400; color: #FFFFFF; }
.rail-me .who small { font-size: 12px; color: var(--rail-muted); }
button.link { background: none; border: 0; padding: 0; color: var(--rail-muted); font: inherit; font-size: 12px; cursor: pointer; }
button.link:hover { color: #FFFFFF; }

/* pills */
.pill { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: var(--line-2); color: var(--ink-2); white-space: nowrap; }
.st-open { background: #E2EDF4; color: #1F5470; } .st-pending { background: #ECE6F7; color: #553A8F; }
.st-on_hold, .st-new { background: #FCEFD8; color: #7A4A00; } .st-solved { background: #E4F2E8; color: #2B6338; }
.st-closed { background: var(--line-2); color: var(--muted); }
.tier-ai { background: #EEE9FA; color: var(--ai-ink); } .tier-human { background: #E2EDF4; color: #1F5470; }
.tier-tier1 { background: var(--line-2); color: var(--ink-2); }
.ag-shadow { background: #EEE9FA; color: var(--ai-ink); } .ag-active { background: var(--ok-bg); color: var(--ok); }
.ag-paused { background: var(--err-bg); color: var(--err); } .ag-draft { background: var(--line-2); color: var(--ink-2); }
.tag { font-size: 11px; padding: 0 6px; border-radius: 999px; background: var(--line-2); color: var(--muted); }

/* list pane */
.list { background: var(--panel); border-right: 1px solid var(--line); display: flex; flex-direction: column; }
.list-head { padding: 20px 16px 12px; display: flex; flex-direction: column; gap: 12px; border-bottom: 1px solid var(--line); }
.lh { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.lh h1 { margin: 0; font-size: 16px; font-weight: 600; }
.lh span { font-size: 13px; color: var(--muted); }
.list-search { display: flex; gap: 8px; }
.list-search input { flex: 1; min-width: 0; }
.list-search select { width: 118px; }
input, select, textarea { min-height: 40px; padding: 0 12px; border: 1px solid var(--field); border-radius: 8px; font: inherit;
  font-size: 14px; color: var(--ink); background: #FFFFFF; }
input[type=search] { background: var(--soft); }
textarea { padding: 12px; line-height: 1.5; resize: vertical; width: 100%; }
.list-link { font-size: 13px; font-weight: 500; }
.rows { flex: 1; overflow: auto; display: flex; flex-direction: column; }
.row { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px; border-bottom: 1px solid var(--line-2);
  color: var(--ink); text-decoration: none; background: #FFFFFF; }
.row:hover { background: #F4F8FB; color: var(--ink); }
.row.cur { background: var(--sel); }
.r1 { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }
.r1 b { font-weight: 600; } .r1 span { font-size: 12px; color: var(--muted); white-space: nowrap; }
.r2 { font-size: 14px; font-weight: 500; line-height: 1.35; }
.row.cur .r2 { font-weight: 600; }
.r3 { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.r4 { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }

/* ticket pane */
.tmain { display: flex; flex-direction: column; min-width: 0; background: var(--bg); }
.empty-main { align-items: center; justify-content: center; }
.th { padding: 18px 24px 14px; background: var(--panel); border-bottom: 1px solid var(--line); display: flex; flex-wrap: wrap;
  align-items: flex-start; justify-content: space-between; gap: 12px; }
.th-l { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.th-title { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.th-title h2 { margin: 0; font-size: 18px; font-weight: 600; line-height: 1.3; }
.th-title .pill { padding: 2px 10px; }
.th p { margin: 0; font-size: 13px; }
.convo { flex: 1; overflow: auto; padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.msg { display: flex; gap: 12px; align-items: flex-start; }
.av { flex: none; width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600; background: #E2EDF4; color: #1F5470; }
.av.big { width: 40px; height: 40px; font-size: 14px; }
.av.sm { display: inline-flex; width: 24px; height: 24px; font-size: 10px; vertical-align: middle; }
.bubble { flex: 1; min-width: 0; background: #FFFFFF; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.mh { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 6px; font-size: 13px; }
.mh b { font-weight: 600; } .mh .muted { font-size: 12px; }
.chip { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; }
.msg .body { margin: 0; font-size: 14px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.src { margin: 8px 0 0; font-size: 12px; color: var(--muted); }
.m-agent .bubble { background: #F3F7FA; border-color: #D9E5EE; } .m-agent .av { background: #1F5470; color: #FFFFFF; }
.m-ai .bubble { background: var(--ai-bg); border-color: var(--ai-line); } .m-ai .av, .m-note .av { background: var(--ai-av); color: #FFFFFF; }
.m-ai .chip { background: var(--ai-chip); color: var(--ai-ink); }
.m-note .bubble { background: var(--note-bg); border-color: var(--note-line); } .m-note .chip { background: var(--note-chip); color: var(--note-ink); }
.m-note[data-kind=internal_note] .av { background: #1F5470; }
.m-tier1 .av { background: var(--line-2); color: var(--ink-2); } .m-tier1 .chip { background: var(--line-2); color: var(--ink-2); }
.handoff { border: 1px solid var(--ai-line); background: var(--ai-bg); border-radius: 10px; padding: 14px 16px; display: flex;
  flex-direction: column; gap: 6px; }
.handoff .h-t { font-size: 12px; font-weight: 600; color: var(--ai-ink); }
.handoff p { margin: 0; line-height: 1.55; }
.shadow-draft { border-style: dashed; }
.shadow-draft a { font-size: 13px; }
.working { margin: 0 0 0 44px; padding: 10px 14px; border: 1px dashed #CDBFEF; border-radius: 10px; background: #FBFAFE;
  font-size: 13px; color: var(--ai-ink); }
.approval { margin-left: 44px; border: 1px solid var(--note-line); background: var(--note-bg); border-radius: 10px; padding: 14px 16px;
  display: flex; flex-direction: column; gap: 10px; }
.approval p { margin: 0; } .ap-a { font-size: 15px; font-weight: 600; }
.ap-chip { align-self: flex-start; font-size: 11px; font-weight: 600; color: var(--note-ink); background: var(--note-chip);
  padding: 2px 8px; border-radius: 999px; }

/* composer */
.composer { border-top: 1px solid var(--line); background: #FFFFFF; padding: 16px 24px 20px; display: flex; flex-direction: column;
  gap: 12px; }
.composer:has(input[value=internal_note]:checked) { background: var(--note-bg); }
.modes { display: flex; gap: 6px; }
.mode input { position: absolute; opacity: 0; pointer-events: none; }
.mode span { display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px; border: 1px solid var(--primary-line);
  border-radius: 8px; background: #FFFFFF; color: var(--primary); font-size: 13px; font-weight: 500; cursor: pointer; }
.mode input:checked + span { background: var(--primary); border-color: var(--primary); color: #FFFFFF; }
.mode input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 2px; }
.c-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.c-foot .grow { flex: 1; }
.submit-as select { width: 148px; padding: 0 8px; color: var(--ink-2); }
.c-foot > .btn:not(.send) { padding: 0 12px; }
.for-note { display: none; }
.composer:has(input[value=internal_note]:checked) .for-note { display: inline; }
.composer:has(input[value=internal_note]:checked) .for-public { display: none; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 0 14px; border: 1px solid var(--field);
  border-radius: 8px; background: #FFFFFF; color: var(--ink); font: inherit; font-size: 14px; cursor: pointer; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.ai { border-color: var(--ai-line); background: var(--ai-bg); color: var(--ai-ink); }
.btn.outline { border-color: var(--primary-line); color: var(--primary); font-weight: 500; }
.btn.primary { border: 0; background: var(--primary); color: #FFFFFF; font-weight: 600; padding: 0 16px; }
.btn.send { border: 0; background: var(--send); color: #FFFFFF; font-weight: 600; padding: 0 18px; }
.btnrow { display: flex; flex-wrap: wrap; gap: 8px; }

/* details pane */
.tside { background: var(--panel); border-left: 1px solid var(--line); overflow: auto; padding: 20px; display: flex;
  flex-direction: column; gap: 20px; }
.req { display: flex; gap: 12px; align-items: center; }
.req div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.req b { font-size: 15px; font-weight: 600; } .req .muted { font-size: 13px; overflow: hidden; text-overflow: ellipsis; }
.card { display: flex; flex-direction: column; gap: 10px; padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--soft); }
.card h3, .fields h3, .history h3 { margin: 0; font-size: 13px; font-weight: 600; }
.ai-card { border-color: var(--ai-line); background: var(--ai-bg); }
.ai-card h3, .ai-card > a { color: var(--ai-ink); }
.ai-card > a { font-size: 13px; font-weight: 500; }
.kv { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; }
.kv span:first-child { color: var(--muted); } .kv span:last-child { text-align: right; }
.fields { display: flex; flex-direction: column; gap: 12px; }
.fd { display: flex; flex-direction: column; gap: 4px; }
.fd > span, .fd > label { font-size: 12px; color: var(--muted); }
.fd select { width: 100%; }
.ro { min-height: 40px; display: flex; align-items: center; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--soft); font-size: 14px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tagpill { padding: 4px 10px; border-radius: 999px; background: var(--line-2); font-size: 12px; color: var(--ink-2); }
.history { display: flex; flex-direction: column; gap: 8px; }
ol.events { list-style: none; margin: 0; padding: 0; }
.ev { display: flex; flex-direction: column; gap: 2px; padding: 8px 0; border-bottom: 1px solid var(--line-2); font-size: 13px; }
.ev-t { font-size: 11px; color: var(--muted); }

/* flashes */
.flash { padding: 10px 14px; border-radius: 10px; border: 1px solid #BFDCC8; background: var(--ok-bg); color: var(--ok); font-size: 13px; }
.flash.err { border-color: #F3C2C2; background: var(--err-bg); color: var(--err); }

/* admin pages */
.content { display: flex; flex-direction: column; min-width: 0; overflow: auto; }
.ch { padding: 20px 24px 16px; background: var(--panel); border-bottom: 1px solid var(--line); }
.ch h1 { margin: 0; font-size: 18px; font-weight: 600; }
.ch p { margin: 4px 0 0; font-size: 13px; }
.cb { padding: 24px; display: flex; flex-direction: column; gap: 14px; max-width: 1180px; }
.cb h2 { margin: 12px 0 0; font-size: 15px; font-weight: 600; }
table.grid { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--panel); border: 1px solid var(--line);
  border-radius: 10px; overflow: hidden; }
.grid th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line);
  background: var(--soft); }
.grid td { padding: 10px 12px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
.grid tr:last-child td { border-bottom: 0; }
.snippet { color: var(--muted); font-size: 12px; margin-top: 2px; }
.s-active, .s-ready, .s-completed, .s-ok, .s-approved, .s-healthy, .s-pass { background: var(--ok-bg); color: var(--ok); }
.s-queued, .s-pending, .s-draft, .s-syncing, .s-to-grade { background: #ECE6F7; color: #553A8F; }
.s-failed, .s-error, .s-blocked, .s-rejected, .s-offline, .s-retired, .s-fail { background: var(--err-bg); color: var(--err); }
.form { max-width: 640px; background: var(--panel); }
.form label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.form input, .form select { width: 100%; }
.form .btn { align-self: flex-start; }
.agent { max-width: 760px; }
.agent h3 { display: flex; align-items: center; gap: 8px; font-size: 15px; }
.statrow { display: flex; flex-wrap: wrap; gap: 12px; }
.statrow .card { background: var(--panel); min-width: 140px; gap: 4px; }
.empty-state h3 { font-size: 15px; }
.empty-state p { margin: 0; color: var(--muted); line-height: 1.55; }
.swatch { display: inline-block; width: 10px; height: 10px; border-radius: 3px; vertical-align: middle; }

/* sign-in and sign-up: the card after Seraverra's login card (logo row, heading, one line, labelled fields,
   Show password, one error box, a full-width button, the switch line) */
body.center { display: grid; place-items: center; min-height: 100vh; padding: 16px; }
.login { width: min(420px, 100%); background: var(--panel); gap: 14px; padding: 28px; }   /* the 404/500 card */
.login h1 { margin: 0; font-size: 18px; font-weight: 600; }
.login p { margin: 0; font-size: 13px; line-height: 1.5; }
.login-wrap { width: min(420px, 100%); }
.login-card { background: var(--panel); gap: 14px; padding: 32px 28px 24px; border-radius: 14px;
  box-shadow: 0 1px 2px rgba(19, 32, 43, .05), 0 8px 24px rgba(19, 32, 43, .06); }
.login-card .brandrow { display: flex; justify-content: center; margin-bottom: 4px; }
.login-card .brandrow img { width: 220px; max-width: 70%; height: auto; }
.login-card h1 { margin: 0; font-size: 22px; font-weight: 600; text-align: center; }
.login-card .sub { margin: -6px 0 6px; font-size: 14px; color: var(--muted); text-align: center; }
.login-card form { display: flex; flex-direction: column; gap: 6px; }
.login-card .field-label { margin-top: 8px; font-size: 13px; font-weight: 500; color: var(--ink-2); }
.login-card input[type=text], .login-card input[type=email], .login-card input[type=password] { width: 100%;
  min-height: 44px; }
.login-card .show-pw { display: flex; align-items: center; gap: 8px; margin-top: 6px; font-size: 13px; color: var(--ink-2);
  cursor: pointer; }
.login-card .show-pw input { min-height: 0; width: 16px; height: 16px; margin: 0; }
.login-card .auth-error { margin-top: 8px; padding: 10px 12px; border: 1px solid #F3C2C2; border-radius: 8px;
  background: var(--err-bg); color: var(--err); font-size: 13px; line-height: 1.45; }
.login-card .auth-error[hidden] { display: none; }
.login-card .btn.send { width: 100%; min-height: 44px; margin-top: 12px; font-size: 15px; }
.login-card .switch { margin: 6px 0 0; font-size: 13px; color: var(--muted); text-align: center; }
.login-card .text-link { font-weight: 500; }

/* the template's breakpoints */
@media (max-width: 1180px) {
  .shell { grid-template-columns: 210px 300px minmax(0, 1fr); }
  .tside { display: none; }
  .shell.admin { grid-template-columns: 210px minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .shell, .shell.admin { grid-template-columns: minmax(0, 1fr); height: auto; }
  .rail { gap: 12px; }
  .rg { flex-direction: row; flex-wrap: wrap; }
  .rg h2 { width: 100%; margin-bottom: 0; }
  .rv, .rl { min-height: 34px; background: rgba(255,255,255,.05); }
  .list { max-height: 420px; }
  .tmain { min-height: 680px; }
  .tside { display: flex; border-left: 0; border-top: 1px solid var(--line); }
  .cb { padding: 16px; }
  table.grid { display: block; overflow-x: auto; }
  .convo, .composer, .th { padding-left: 16px; padding-right: 16px; }
}

/* Draft with AI (use case 6): the AI's draft sits in the reply box, unsent, marked until the person sends it */
.ai-draft-note { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--ai-line);
  border-radius: 8px; background: var(--ai-bg); color: var(--ai-ink); font-size: 13px; line-height: 1.5; }
.ai-draft-note .chip { background: var(--ai-chip); color: var(--ai-ink); flex: none; }
.ai-draft-note a { color: var(--ai-ink); font-weight: 500; }
textarea.ai-drafted { border-color: var(--ai-line); background: #FCFBFF; box-shadow: inset 3px 0 0 var(--ai-av); }
.btn.ai.draft-btn:hover { background: #EEE9FA; }
/* Settings > Voice: the line's settings beside its phrases; stacked on a phone */
.voice-line { margin-bottom: 28px; }
.voice-grid { display: grid; grid-template-columns: minmax(260px, 320px) 1fr; gap: 20px; align-items: start; }
.voice-phrases { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.voice-phrases td { overflow-wrap: anywhere; }
@media (max-width: 760px) { .voice-grid { grid-template-columns: 1fr; } }
