/* Light, minimal theme. Brand colors come from /brand.css (--accent, --bg). */
:root {
  --accent: #4f46e5;
  --accent-soft: #eef0fe;
  --bg: #f6f8fa;
  --panel: #ffffff;
  --ink: #0a2540;
  --ink-2: #425466;
  --muted: #697386;
  --line: #e3e8ee;
  --soft: #f6f8fa;
  --ok: #0e8a5f;
  --ok-soft: #e3f6ee;
  --warn: #b25e09;
  --warn-soft: #fdf1e2;
  --bad: #c0233b;
  --bad-soft: #fde8eb;
  --info: #2e6bd9;
  --info-soft: #e8f0fd;
  --radius: 10px;
  --shadow: 0 1px 1px rgba(0, 0, 0, 0.03), 0 2px 6px rgba(50, 50, 93, 0.06);
  --mono: ui-monospace, 'SFMono-Regular', Menlo, monospace;
  color-scheme: light;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 14px/1.5 Inter, ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif; -webkit-font-smoothing: antialiased; font-feature-settings: 'cv11', 'ss01'; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
h1 { font-size: 26px; letter-spacing: -0.02em; margin: 0 0 6px; font-weight: 650; }
h2 { font-size: 15px; margin: 0 0 12px; font-weight: 600; letter-spacing: -0.01em; }
h3 { font-size: 13px; margin: 0 0 8px; font-weight: 600; color: var(--ink-2); }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.mono { font-family: var(--mono); font-size: 12px; }
.lead { color: var(--ink-2); margin: 0 0 20px; max-width: 760px; }

/* top bar */
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; padding: 10px 22px; background: rgba(255, 255, 255, 0.92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 650; letter-spacing: -0.01em; color: var(--ink); white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand img { width: 26px; height: 26px; border-radius: 7px; object-fit: contain; }
.brand .mark { width: 26px; height: 26px; border-radius: 7px; background: var(--accent); display: inline-block; }
.top nav { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.top nav::-webkit-scrollbar { display: none; }
.top nav a { padding: 6px 8px; font-size: 13.5px; border-radius: 6px; color: var(--ink-2); white-space: nowrap; font-weight: 500; }
.top nav a:hover { background: var(--soft); text-decoration: none; color: var(--ink); }
.top nav a.on { color: var(--accent); background: var(--accent-soft); }
.top nav a .count { display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 4px; border-radius: 9px; background: var(--bad); color: #fff; font-size: 11px; text-align: center; }
.spacer { flex: 1; }
.lang { display: inline-flex; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; }
.lang button { border: 0; background: #fff; padding: 4px 9px; cursor: pointer; font-size: 12px; color: var(--muted); }
.lang button.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }

main { max-width: 1240px; margin: 0 auto; padding: 26px 22px 60px; }
.grid { display: grid; gap: 16px; }
.cols-2 { grid-template-columns: 1fr 1fr; }
.cols-3 { grid-template-columns: repeat(3, 1fr); }
.cols-4 { grid-template-columns: repeat(4, 1fr); }
.side { grid-template-columns: minmax(0, 1fr) 380px; }
.ops { grid-template-columns: 340px minmax(0, 1fr); }
@media (max-width: 960px) { .cols-2, .cols-3, .side, .ops { grid-template-columns: 1fr; } .cols-4 { grid-template-columns: 1fr 1fr; } }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; min-width: 0; }
.card.flat { box-shadow: none; }
.card .head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; }
.card .head h2 { margin: 0; }
.stat { padding: 14px 16px; }
.stat b { display: block; font-size: 24px; letter-spacing: -0.02em; font-weight: 650; }
.stat span { color: var(--muted); font-size: 12px; }
.empty { color: var(--muted); padding: 18px; text-align: center; font-size: 13px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 7px 13px; border-radius: 7px; border: 1px solid var(--line); background: #fff; cursor: pointer; font-weight: 550; font-size: 13px; color: var(--ink); box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04); white-space: nowrap; }
.btn:hover { border-color: #c9d1db; }
.btn:disabled { opacity: 0.55; cursor: default; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { filter: brightness(1.06); }
.btn.danger { color: var(--bad); }
.btn.sm { padding: 4px 9px; font-size: 12px; }
.btn.ghost { border-color: transparent; box-shadow: none; background: transparent; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.sep { height: 1px; background: var(--line); margin: 14px 0; }

label.f { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--ink-2); font-weight: 500; min-width: 0; }
input:not([type]), input[type='text'], input[type='email'], input[type='tel'], input[type='date'], input[type='time'], input[type='number'], input[type='password'], select, textarea {
  border: 1px solid var(--line); border-radius: 7px; padding: 7px 10px; background: #fff; min-width: 0; width: 100%; font-size: 13.5px; }
input:focus, select:focus, textarea:focus { outline: 2px solid color-mix(in srgb, var(--accent) 30%, transparent); border-color: var(--accent); }
textarea { resize: vertical; min-height: 70px; }
.form { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); align-items: end; }

.pill { display: inline-flex; align-items: center; gap: 5px; padding: 1px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 550; background: var(--soft); color: var(--ink-2); white-space: nowrap; border: 1px solid var(--line); }
.pill.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.pill.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.pill.bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.pill.info { background: var(--info-soft); color: var(--info); border-color: transparent; }
.pill.acc { background: var(--accent-soft); color: var(--accent); border-color: transparent; }

table.t { width: 100%; border-collapse: collapse; font-size: 13px; }
table.t th { text-align: left; font-weight: 550; color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.04em; padding: 8px 10px; border-bottom: 1px solid var(--line); }
table.t td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.t tr:last-child td { border-bottom: 0; }
table.t tr.click { cursor: pointer; }
table.t tr.click:hover td { background: var(--soft); }
.scroll { overflow-x: auto; }

/* calendar */
.cal { display: grid; font-size: 12px; border: 1px solid var(--line); border-radius: var(--radius); overflow: auto; background: #fff; }
.cal .c { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); min-height: 34px; padding: 4px 6px; position: relative; }
.cal .hd { background: var(--soft); font-weight: 600; color: var(--ink-2); position: sticky; top: 0; z-index: 2; text-align: center; }
.cal .hd.today { color: var(--accent); }
.cal .rn { background: #fff; font-weight: 550; position: sticky; left: 0; z-index: 1; white-space: nowrap; }
.cal .bar { position: absolute; top: 4px; bottom: 4px; border-radius: 5px; padding: 2px 6px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: #fff; background: var(--accent); cursor: pointer; z-index: 1; font-weight: 550; }
.cal .bar.pending { background: #e2a23b; }
.cal .bar.checked_in { background: #0e8a5f; }
.cal .bar.checked_out, .cal .bar.completed { background: #9aa5b1; }
.cal .bar.no_show { background: var(--bad); }
.slots { display: grid; gap: 6px; }
.slot { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; cursor: pointer; }
.slot:hover { border-color: #c9d1db; }
.slot time { font-weight: 650; font-variant-numeric: tabular-nums; min-width: 46px; }

/* conversations */
.conv-list { display: flex; flex-direction: column; gap: 4px; max-height: 72vh; overflow: auto; }
.conv { padding: 10px; border-radius: 8px; cursor: pointer; border: 1px solid transparent; }
.conv:hover { background: var(--soft); }
.conv.on { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 25%, transparent); }
.conv.alert { border-color: var(--bad); }
.conv-top { display: flex; justify-content: space-between; gap: 8px; align-items: center; margin-bottom: 3px; }
.transcript { display: flex; flex-direction: column; gap: 8px; max-height: 52vh; overflow: auto; padding: 4px; }
.bubble { max-width: 82%; padding: 8px 12px; border-radius: 12px; background: var(--soft); white-space: pre-wrap; word-wrap: break-word; }
.bubble small { display: block; font-size: 11px; color: var(--muted); margin-bottom: 2px; font-weight: 600; }
.bubble.me { align-self: flex-end; background: var(--accent); color: #fff; }
.bubble.me small { color: rgba(255, 255, 255, 0.8); }
.bubble.op { background: var(--warn-soft); }
.bubble.sys { align-self: center; background: transparent; color: var(--muted); font-size: 12px; }
.feed { display: flex; flex-direction: column; gap: 6px; }
.feed-item { display: flex; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font-size: 13px; }
.feed-item .ic { width: 22px; text-align: center; }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 4px 12px; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }

/* voice orb */
.orb-wrap { display: flex; justify-content: center; padding: 18px 0 8px; }
.orb { width: 96px; height: 96px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--accent) 55%, white), var(--accent)); box-shadow: 0 10px 30px color-mix(in srgb, var(--accent) 35%, transparent); transition: transform 0.2s; }
.orb.speaking { animation: pulse 0.9s ease-in-out infinite; }
.orb.listening { animation: breathe 2.4s ease-in-out infinite; }
.orb.idle { filter: grayscale(0.4); opacity: 0.8; }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.08); } }
@keyframes breathe { 0%, 100% { transform: scale(0.97); } 50% { transform: scale(1.02); } }
.call-state { text-align: center; color: var(--ink-2); font-weight: 550; }
.tabs { display: inline-flex; background: var(--soft); border: 1px solid var(--line); border-radius: 8px; padding: 2px; }
.tabs button { border: 0; background: transparent; padding: 5px 12px; border-radius: 6px; cursor: pointer; font-weight: 550; color: var(--muted); }
.tabs button.on { background: #fff; color: var(--ink); box-shadow: var(--shadow); }
.chat-form { display: flex; gap: 8px; margin-top: 10px; }

/* public site */
.hero { padding: 42px 0 18px; }
.hero h1 { font-size: 34px; }
.typecards { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.typecard { border: 1px solid var(--line); background: #fff; border-radius: var(--radius); padding: 14px; cursor: pointer; text-align: left; box-shadow: var(--shadow); }
.typecard.on { border-color: var(--accent); outline: 2px solid color-mix(in srgb, var(--accent) 25%, transparent); }
.typecard .ic { font-size: 22px; }
.typecard b { display: block; margin-top: 6px; }
.option { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.option + .option { margin-top: 6px; }
.option b { font-variant-numeric: tabular-nums; }
.faq details { border-bottom: 1px solid var(--line); padding: 10px 0; }
.faq summary { cursor: pointer; font-weight: 550; }
.notice { padding: 10px 12px; border-radius: 8px; background: var(--info-soft); color: var(--info); font-size: 13px; }
.notice.ok { background: var(--ok-soft); color: var(--ok); }
.notice.bad { background: var(--bad-soft); color: var(--bad); }
footer.site { border-top: 1px solid var(--line); padding: 22px; color: var(--muted); font-size: 12.5px; text-align: center; }
.toast { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 9px 16px; border-radius: 8px; z-index: 99; font-size: 13px; box-shadow: var(--shadow); }
dialog { border: 1px solid var(--line); border-radius: 12px; padding: 0; width: min(720px, 94vw); box-shadow: 0 20px 60px rgba(10, 37, 64, 0.25); }
dialog::backdrop { background: rgba(10, 37, 64, 0.35); }
dialog .dh { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); }
dialog .db { padding: 18px; max-height: 72vh; overflow: auto; }
.embed main { padding: 10px; }
