/* Dazzle Live, dressed as dazzleagent.com (dazzle-website/site/assets/site.css): warm white or warm black, one
   system typeface, monochrome pill buttons, the logo's orange for small accents only. The tokens below are the site's
   own; keep them in step with it. */
:root {
  --bg: #fcfcfb;
  --surface: #ffffff;
  --panel: #f6f6f4;
  --ink: #3a3a3d;
  --ink-strong: #111113;
  --muted: #6e6e73;
  --faint: #a1a1a6;
  --line: #e7e7e4;
  --accent: #f15a24;
  --accent-hover: #d94a17;
  --accent-soft: #fdeee6;
  --tool-bg: #f2f2f0;
  --ok: #15803d;
  --warn: #b45309;
  --error: #dc2626;
  --code-bg: #f0f0ee;
  --shadow: 0 1px 2px rgba(17, 17, 19, .06), 0 30px 60px -30px rgba(17, 17, 19, .35);
  --scrim: rgba(17, 17, 19, .32);
  --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Code", "Cascadia Mono", Consolas, "SFMono-Regular", monospace;
  color-scheme: light;
}
/* Dark: chosen with the header switch, or no choice and the system is dark. */
:root[data-theme="dark"] {
  --bg: #0e0d0b;
  --surface: #161512;
  --panel: #1a1916;
  --ink: #d4d3cd;
  --ink-strong: #f5f4ef;
  --muted: #918f88;
  --faint: #64625c;
  --line: #27251f;
  --accent: #f36a35;
  --accent-hover: #f6844f;
  --accent-soft: #2e1a10;
  --tool-bg: #1f1e1a;
  --ok: #4ade80;
  --warn: #fbbf24;
  --error: #f87171;
  --code-bg: #1f1e1a;
  --shadow: 0 0 0 1px #27251f, 0 30px 60px -30px rgba(0, 0, 0, .8);
  --scrim: rgba(0, 0, 0, .55);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e0d0b;
    --surface: #161512;
    --panel: #1a1916;
    --ink: #d4d3cd;
    --ink-strong: #f5f4ef;
    --muted: #918f88;
    --faint: #64625c;
    --line: #27251f;
    --accent: #f36a35;
    --accent-hover: #f6844f;
    --accent-soft: #2e1a10;
    --tool-bg: #1f1e1a;
    --ok: #4ade80;
    --warn: #fbbf24;
    --error: #f87171;
    --code-bg: #1f1e1a;
    --shadow: 0 0 0 1px #27251f, 0 30px 60px -30px rgba(0, 0, 0, .8);
    --scrim: rgba(0, 0, 0, .55);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.55 var(--font); -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
h1, h2, h3 { font-family: var(--font-display); color: var(--ink-strong); font-weight: 600; letter-spacing: -.015em; line-height: 1.2; }
a { color: var(--ink-strong); }
a:hover { color: var(--accent); }
code { font-family: var(--mono); font-size: .88em; background: var(--code-bg); border-radius: 6px; padding: .1em .4em; color: var(--ink-strong); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.muted { color: var(--muted); font-size: 12.5px; }
.note { color: var(--muted); font-size: 12.5px; min-height: 1em; margin: 6px 0 0; }
.spacer { flex: 1; }
.log, .chat-list, .files, .panel, .table-wrap, .tool pre, textarea { scrollbar-width: thin; scrollbar-color: var(--faint) transparent; }

/* Buttons: the site's monochrome pills. Plain is primary (ink on the page colour), .ghost is outlined. */
button, .button {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font: 500 13.5px/1.2 var(--font); border: 1px solid var(--ink-strong); background: var(--ink-strong); color: var(--bg);
  border-radius: 999px; padding: 8px 16px; cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s, opacity .15s;
}
button:hover:not(:disabled), .button:hover { opacity: .85; }
button:disabled { opacity: .4; cursor: default; }
button.ghost, .button.ghost { background: transparent; color: var(--ink-strong); border-color: var(--line); }
button.ghost:hover:not(:disabled), .button.ghost:hover { opacity: 1; border-color: var(--faint); }
button.danger { background: transparent; color: var(--error); border-color: color-mix(in srgb, var(--error) 45%, var(--line)); }
button.danger:hover:not(:disabled) { opacity: 1; border-color: var(--error); }
button.small, .button.small { padding: 6px 13px; font-size: 12.5px; }
button.icon { width: 32px; height: 32px; padding: 0; font-size: 15px; }
button.wide { width: 100%; }
.danger-text, button.ghost.danger-text { color: var(--error); }

input, select, textarea {
  font: 400 13.5px/1.4 var(--font); color: var(--ink); background: var(--bg);
  border: 1px solid var(--line); border-radius: 10px; padding: 8px 11px;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input::placeholder, textarea::placeholder { color: var(--faint); }
input[type="checkbox"] { accent-color: var(--accent); width: 15px; height: 15px; margin: 0 6px 0 0; vertical-align: -2px; }

/* Signing in: one card in the middle of the page, as on the site's sign-in */
.login {
  width: min(420px, calc(100vw - 32px)); margin: 14vh auto 0; padding: 32px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow);
  display: grid; gap: 14px;
}
.login-head { display: flex; align-items: center; gap: 12px; }
.login-head .brand-mark { width: 32px; height: 32px; }
.login h1 { margin: 0; font-size: 1.75rem; letter-spacing: -.025em; }
.lede { margin: 0; color: var(--muted); font-size: 15px; }
.login-fields { display: grid; gap: 12px; }
.login-fields[hidden] { display: none; }
.field { display: grid; gap: 6px; font-size: 13px; font-weight: 600; color: var(--ink-strong); }
.field input { font-size: 15px; padding: 10px 12px; width: 100%; }
.login .note { margin: 0; color: var(--ink); font-size: 13px; }
.login .note:empty { display: none; }
.login button { padding: 11px 20px; font-size: 15px; }

/* The app: header, then chats | conversation | files */
.app { height: 100vh; display: grid; grid-template-rows: auto 1fr; }
.bar {
  display: flex; align-items: center; gap: 12px; height: 60px; padding: 0 20px;
  background: color-mix(in srgb, var(--bg) 82%, transparent); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 9px; color: var(--ink-strong); font: 600 16px/1 var(--font-display); letter-spacing: -.01em; }
.brand-mark { display: block; width: 24px; height: 24px; flex: none; }
.latency { font: 11.5px/1 var(--mono); color: var(--faint); margin-left: 6px; }
.me { font-size: 13px; color: var(--muted); }
.credit {
  font: 500 12px/1 var(--font); color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 6px 11px;
}
.credit[data-tone="warn"] { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 40%, var(--line)); background: color-mix(in srgb, var(--warn) 9%, transparent); }
.credit[data-tone="bad"] { color: var(--error); border-color: color-mix(in srgb, var(--error) 45%, var(--line)); background: color-mix(in srgb, var(--error) 10%, transparent); font-weight: 600; }
.people .used[data-tone="warn"] { color: var(--warn); }
.people .used[data-tone="bad"] { color: var(--error); font-weight: 600; }

.theme-btn { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--muted); padding: 0; }
.theme-btn:hover:not(:disabled) { opacity: 1; color: var(--ink-strong); border-color: var(--faint); }
.theme-btn svg { width: 16px; height: 16px; }
.theme-btn .moon { display: none; }
:root[data-theme="dark"] .theme-btn .sun { display: none; }
:root[data-theme="dark"] .theme-btn .moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-btn .sun { display: none; }
  :root:not([data-theme="light"]) .theme-btn .moon { display: block; }
}

.main { display: grid; grid-template-columns: 260px minmax(0, 1fr) 280px; min-height: 0; }

/* Chats: the site dashboard's side menu */
.side { background: var(--surface); border-right: 1px solid var(--line); padding: 16px 12px; display: flex; flex-direction: column; gap: 6px; min-height: 0; }
.side-label { margin: 14px 8px 4px; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); }
.chat-list { list-style: none; margin: 0; padding: 0; overflow-y: auto; display: grid; gap: 2px; align-content: start; }
.chat-list li { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; cursor: pointer; font-size: 13.5px; color: var(--ink); }
.chat-list li:hover { background: var(--tool-bg); }
.chat-list li[aria-current="true"] { background: var(--accent-soft); color: var(--ink-strong); font-weight: 500; }
.chat-list .title { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); flex: none; }
.dot[data-state="idle"] { background: var(--ok); }
.dot[data-state="working"], .dot[data-state="queued"] { background: var(--accent); animation: flash .55s linear infinite alternate; }
@keyframes flash { to { opacity: .25; } }
@media (prefers-reduced-motion: reduce) { .dot { animation: none !important; } }

/* The conversation: one readable column in the middle, as in the site's app mock */
.chat { display: grid; grid-template-rows: auto 1fr auto; min-height: 0; min-width: 0; background: var(--bg); }
.chat-head { display: flex; align-items: center; gap: 12px; height: 56px; padding: 0 24px; border-bottom: 1px solid var(--line); min-width: 0; }
.chat-head h2 { margin: 0; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pill { font: 500 11.5px/1 var(--mono); border: 1px solid var(--line); border-radius: 999px; padding: 5px 10px; color: var(--muted); white-space: nowrap; }
.pill[data-state="none"] { display: none; }
.pill[data-state="idle"] { color: var(--ok); }
.pill[data-state="working"], .pill[data-state="queued"] { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); background: var(--accent-soft); }
.pill[data-state="offline"] { color: var(--error); }

.log {
  --column: 780px;
  overflow-y: auto; display: flex; flex-direction: column; gap: 14px;
  padding: 28px max(24px, calc((100% - var(--column)) / 2)) 24px;
}
.empty { color: var(--muted); text-align: center; margin: 22vh 0 0; font-size: 15px; }

.msg { max-width: 100%; }
.msg .who { font-size: 11.5px; font-weight: 600; color: var(--faint); margin-bottom: 4px; letter-spacing: .01em; }
.msg .body { white-space: pre-wrap; overflow-wrap: anywhere; color: var(--ink); font-size: 14.5px; line-height: 1.6; }
.msg[data-kind="agent"] .who { color: var(--accent); }
.msg[data-kind="user"] { align-self: flex-end; max-width: 85%; text-align: right; }
.msg[data-kind="user"] .body {
  display: inline-block; text-align: left; background: var(--tool-bg); color: var(--ink-strong);
  border-radius: 14px 14px 4px 14px; padding: 9px 13px;
}

/* A tool call: small monospace line, the Dazzle bolt before it */
.tool { font: 12px/1.45 var(--mono); color: var(--muted); }
.tool summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 8px; padding: 2px 0; }
.tool summary::-webkit-details-marker { display: none; }
.tool summary::before {
  content: ""; flex: none; width: 8px; height: 12px; background: var(--faint);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='9 5 14 22'%3E%3Cpath d='M18.5 5 9 18h6l-1.5 9L23 14h-6l1.5-9Z'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='9 5 14 22'%3E%3Cpath d='M18.5 5 9 18h6l-1.5 9L23 14h-6l1.5-9Z'/%3E%3C/svg%3E") center / contain no-repeat;
}
.tool summary:hover { color: var(--ink-strong); }
.tool[data-ok="true"] summary::before { background: var(--accent); }
.tool[data-ok="false"] { color: var(--error); }
.tool[data-ok="false"] summary::before { background: var(--error); }
.tool pre {
  white-space: pre-wrap; overflow-wrap: anywhere; margin: 6px 0 2px 16px; max-height: 220px; overflow: auto;
  background: var(--code-bg); color: var(--ink); padding: 10px 12px; border-radius: 10px; font: 12px/1.5 var(--mono);
}

.meta { font: 11.5px/1.4 var(--mono); color: var(--faint); }
.meta[data-ok="false"] { color: var(--error); }
.notice { font-size: 12.5px; color: var(--muted); text-align: center; padding: 2px 0; }
.notice[data-tone="error"] {
  color: var(--error); text-align: left; border-left: 3px solid var(--error);
  background: var(--surface); border-radius: 0 10px 10px 0; padding: 8px 14px;
}

.composer {
  display: flex; align-items: flex-end; gap: 8px; padding: 8px 8px 8px 14px;
  margin: 0 max(24px, calc((100% - 780px) / 2)) 20px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 1px 2px rgba(17, 17, 19, .04);
  transition: border-color .15s, box-shadow .15s;
}
.composer:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.composer textarea {
  flex: 1; resize: vertical; min-height: 44px; max-height: 40vh; border: 0; background: transparent; padding: 6px 0;
  font-size: 14.5px; box-shadow: none;
}
.composer textarea:focus { box-shadow: none; }
.actions { display: flex; gap: 6px; padding-bottom: 2px; }

/* Files */
.files { background: var(--surface); border-left: 1px solid var(--line); padding: 16px; overflow-y: auto; min-width: 0; }
.files-head { display: flex; align-items: center; gap: 8px; min-height: 32px; }
.files-head h2 { font: 400 11px/1 var(--font); text-transform: uppercase; letter-spacing: .06em; color: var(--faint); margin: 0; flex: 1; }
.file-list { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 2px; }
.file-list li { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 13px; padding: 6px 8px; border-radius: 8px; }
.file-list li:hover { background: var(--tool-bg); }
.file-list a { color: var(--ink-strong); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-list a:hover { color: var(--accent); }
.file-list span { color: var(--faint); font: 11px/1 var(--mono); white-space: nowrap; }

/* Admin: a card over a dimmed page */
.overlay { position: fixed; inset: 0; z-index: 20; background: var(--scrim); backdrop-filter: blur(3px); display: grid; place-items: center; }
.panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow);
  padding: 22px 26px 24px; width: min(1180px, 95vw); max-height: 88vh; overflow: auto;
}
.panel-head { display: flex; align-items: center; gap: 18px; margin-bottom: 16px; }
.panel-head h2 { margin: 0; font-size: 1.35rem; letter-spacing: -.02em; }
/* The site's segmented pill switch */
.tabs { display: inline-flex; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); }
.tab { background: transparent; color: var(--muted); border: 0; border-radius: 999px; padding: 7px 14px; font-size: 13px; font-weight: 600; }
.tab:hover:not(:disabled) { opacity: 1; color: var(--ink-strong); }
.tab[aria-selected="true"] { background: var(--ink-strong); color: var(--bg); }
.lead-note { margin: 0 0 14px; max-width: 900px; line-height: 1.55; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); margin-top: 4px; }
.accounts { width: 100%; border-collapse: collapse; font-size: 13px; }
.accounts > thead > tr > th, .accounts > tbody > tr > td { text-align: left; vertical-align: top; padding: 11px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.accounts > thead > tr > th { font-size: 12px; font-weight: 500; color: var(--faint); background: var(--panel); padding-top: 9px; padding-bottom: 9px; }
.accounts > tbody > tr:last-child > td { border-bottom: 0; }
.accounts > tbody > tr:not(.history) > td:first-child { color: var(--ink-strong); font-weight: 500; }
.accounts td[data-status] { font-weight: 500; }
.accounts td[data-status="limited"], .accounts td[data-status="signed out"] { color: var(--error); }
.accounts td[data-status="paused"], .accounts td[data-status="testing"] { color: var(--warn); }
.accounts td[data-status="allowed"] { color: var(--ok); }
.accounts .error { display: block; font-size: 11.5px; font-weight: 400; color: var(--error); white-space: normal; max-width: 240px; margin-top: 2px; }
.accounts .hint { display: block; font-size: 11.5px; font-weight: 400; color: var(--faint); margin-top: 1px; }
.accounts input[type="number"] { width: 60px; padding: 4px 6px; border-radius: 8px; font-size: 12.5px; }
.accounts .row-actions { display: flex; gap: 6px; justify-content: flex-end; }
.accounts .row-actions button { padding: 5px 12px; font-size: 12px; }

.people .access-tag { display: inline-block; margin-left: 8px; padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; vertical-align: 1px; }
.people .access-tag.paused { color: var(--warn); border: 1px solid var(--warn); }
.people .access-tag.blocked { color: var(--error); border: 1px solid var(--error); }
.people tr[data-access="blocked"] > td:not(:last-child) { opacity: .6; }
.people .row-actions { flex-wrap: wrap; }
.paused-note {
  margin: 0 max(24px, calc((100% - 780px) / 2)) 8px; padding: 10px 14px; border-radius: 12px;
  color: var(--warn); border: 1px solid var(--warn); background: var(--surface); font-size: 13.5px;
}
.composer textarea:disabled { cursor: not-allowed; }
.people .month { min-width: 200px; }
.people .month > .usd { display: block; margin: 1px 0 0; }
.people input.limit[type="number"] { width: 84px; }
.people .month .used { display: block; color: var(--ink-strong); font-weight: 500; }
.people .limit-row { display: flex; align-items: center; gap: 6px; margin-top: 6px; }
.people .limit-row .hint { display: inline; margin: 0; }
.people input.limit { width: 70px; padding: 4px 8px; border-radius: 8px; font-size: 12.5px; }
.people .limit-row button { padding: 5px 11px; font-size: 12px; }
.people .ticks { white-space: normal; min-width: 190px; }
.people .tick { display: flex; align-items: center; font-size: 12.5px; padding: 1px 0; cursor: pointer; }
.people tr.history > td { background: var(--panel); white-space: normal; padding: 12px 16px 14px; color: var(--muted); }
.days { border-collapse: separate; border-spacing: 0; font-size: 12px; width: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.days th, .days td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.days th { font-weight: 500; color: var(--faint); }
.days td { color: var(--ink); }
.days tr:last-child td { border-bottom: 0; }

/* Adding an account */
.add-account { margin-top: 22px; border-top: 1px solid var(--line); padding-top: 18px; }
.add-account h3 { margin: 0 0 12px; font-size: 1.05rem; }
.fields { display: grid; grid-template-columns: 1fr 1.4fr 150px; gap: 12px; }
.fields label { display: grid; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--ink-strong); }
.fields input, .fields select { width: 100%; }
.fields .wide { grid-column: 1 / -1; }
.way { margin-top: 12px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); }
.way summary { cursor: pointer; font-size: 13px; font-weight: 500; color: var(--ink-strong); }
.way .muted { margin: 4px 0 6px; line-height: 1.55; }
.way details[open] summary, .way[open] summary { margin-bottom: 8px; }
.login-steps { margin-top: 12px; }
.steps { margin: 0 0 10px; padding-left: 20px; font-size: 13px; color: var(--muted); }
.steps li { margin: 3px 0; }
.code-row { display: flex; gap: 8px; }
.code-row input { flex: 1; }
.token-field { display: grid; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--ink-strong); margin-top: 8px; }
.token-field input { width: 100%; }
#claude-login-note[data-tone="error"] { color: var(--error); }
.form-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; gap: 12px; }
.form-foot .note { margin: 0; }
.form-foot .note[data-tone="error"] { color: var(--error); }

@media (max-width: 1100px) {
  .main { grid-template-columns: 220px minmax(0, 1fr) 240px; }
}
