
:root{
  /* Light theme (default) */
  --bg:#f6f7fb;
  --panel:#ffffff;
  --card:#ffffff;
  --muted:#4b5563;
  --text:#111827;
  --line:#e5e7eb;
  --good:#16a34a;
  --bad:#dc2626;
  --warn:#b45309;
  --chip:#f3f4f6;
  --chipHover:#e5e7eb;
  --accent:#0f766e;
  --border: var(--line);

  --bgGradient: radial-gradient(1200px 600px at 20% 0%, #ffffff 0%, #f2f5ff 60%);
  --topbarBg: rgba(255,255,255,0.78);
  --pillBg: rgba(255,255,255,0.82);
  --cardGradTop: rgba(255,255,255,0.98);
  --cardGradBottom: rgba(255,255,255,0.92);
  --inputBg: rgba(255,255,255,0.96);
  --btnBg: rgba(255,255,255,0.90);
  --btnBgHover: rgba(243,244,246,0.96);
  --assistantBg: rgba(255,255,255,0.72);
  --panelBg: rgba(255,255,255,0.78);
  --shadow: 0 12px 32px rgba(17,24,39,0.10);
  --quoteBg: rgba(249,250,251,0.96);
  --monoBg: rgba(15,23,42,0.06);
  --trackBg: rgba(15,23,42,0.06);
}

html[data-theme="dark"]{
  --bg:#0b0c10;
  --panel:#11131a;
  --card:#141824;
  --muted:#aab0c0;
  --text:#eef0f6;
  --line:#262b3b;
  --good:#33d17a;
  --bad:#ff5c5c;
  --warn:#ffd23f;
  --chip:#1b2030;
  --chipHover:#232a3f;
  --accent:#5eead4;
  --border: var(--line);

  --bgGradient: radial-gradient(1200px 600px at 20% 0%, #151a2b 0%, #0b0c10 60%);
  --topbarBg: rgba(10,11,16,0.70);
  --pillBg: rgba(20,24,36,0.75);
  --cardGradTop: rgba(20,24,36,0.95);
  --cardGradBottom: rgba(20,24,36,0.75);
  --inputBg: rgba(9,10,15,0.60);
  --btnBg: rgba(9,10,15,0.40);
  --btnBgHover: rgba(9,10,15,0.70);
  --assistantBg: rgba(17,19,26,0.55);
  --panelBg: rgba(9,10,15,0.35);
  --shadow: 0 12px 40px rgba(0,0,0,0.35);
  --quoteBg: rgba(15,18,32,0.45);
  --monoBg: rgba(167,139,250,0.12);
  --trackBg: rgba(255,255,255,0.10);
}
*{box-sizing:border-box}

/* Make sure the background gradient always fills the viewport */
html, body{ height:100%; }
html{
  background: var(--bgGradient);
  background-attachment: fixed;
}
body{
  margin:0;
  min-height:100vh;
  display:flex;
  flex-direction:column;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  background: transparent;
  color:var(--text);
}

#app{ flex:1; }
a{color:inherit}

/* Small but important polish */
button, input, select{ font: inherit; }
button, input, select{
  -webkit-tap-highlight-color: transparent;
}
button{
  transition: background-color .15s ease, border-color .15s ease, transform .05s ease;
}
button:active{ transform: translateY(1px); }
button:focus-visible, input:focus-visible, select:focus-visible{
  outline: 3px solid rgba(15,118,110,0.25);
  outline-offset: 2px;
}
html[data-theme="dark"] button:focus-visible,
html[data-theme="dark"] input:focus-visible,
html[data-theme="dark"] select:focus-visible{
  outline-color: rgba(94,234,212,0.25);
}

.topbar{
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:14px 18px;
  border-bottom:1px solid var(--line);
  background:var(--topbarBg);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 10px 26px rgba(17,24,39,0.06);
  position:sticky;
  top:0;
  z-index:10;
}
.brand-mark{display:flex; align-items:center; gap:10px}
.brand-text{display:flex; flex-direction:column}
.logo{width:26px; height:26px; flex:0 0 26px; filter: drop-shadow(0 6px 14px rgba(0,0,0,0.10));}
.logo-dark{display:none}
html[data-theme="dark"] .logo-light{display:none}
html[data-theme="dark"] .logo-dark{display:block}
.brand-title{font-weight:700; letter-spacing:0.2px}
.brand-subtitle{color:var(--muted); font-size:12px; margin-top:2px}
.topbar-right{display:flex; gap:10px; align-items:center}
.pill{
  border:1px solid var(--line);
  background:var(--pillBg);
  padding:8px 10px;
  border-radius:999px;
  font-size:13px;
  color:var(--muted);
}

/* Overlay (used for the short “finding rival clerk” animation) */
.overlay{
  position:fixed;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
  background: rgba(0,0,0,0.32);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index:1000;
}
.overlay-card{
  width:min(440px, calc(100% - 40px));
  border:1px solid var(--line);
  border-radius:16px;
  background: linear-gradient(180deg, var(--cardGradTop) 0%, var(--cardGradBottom) 100%);
  box-shadow: var(--shadow);
  padding:18px;
  display:flex;
  align-items:center;
  gap:14px;
}
.overlay-text{display:flex; flex-direction:column}
.overlay-title{font-weight:800; letter-spacing:0.1px}
.overlay-sub{color:var(--muted); font-size:13px; margin-top:2px}
.spinner{
  width:26px;
  height:26px;
  border-radius:50%;
  border:3px solid rgba(0,0,0,0.12);
  border-top-color: var(--accent);
  animation: spin 0.9s linear infinite;
}
html[data-theme="dark"] .spinner{ border-color: rgba(255,255,255,0.14); }
@keyframes spin{ to { transform: rotate(360deg); } }
.screen{
  max-width:1100px;
  margin:24px auto;
  padding:0 16px 32px;
}
.card{
  background: linear-gradient(180deg, var(--cardGradTop) 0%, var(--cardGradBottom) 100%);
  border:1px solid var(--line);
  border-radius:16px;
  padding:18px;
  box-shadow: var(--shadow);
}
h1{margin:0 0 10px 0; font-size:28px}
h2{margin:0 0 10px 0; font-size:18px}
p{color:var(--muted); line-height:1.45}
ul{color:var(--muted); line-height:1.55}
label{display:block; color:var(--muted); font-size:13px; margin:0 0 6px}
input, select{
  width:100%;
  padding:10px 12px;
  border-radius:10px;
  border:1px solid var(--line);
  background:var(--inputBg);
  color:var(--text);
}
.actions{display:flex; gap:10px; margin-top:14px; flex-wrap:wrap}
button{
  border:1px solid var(--line);
  background:var(--btnBg);
  color:var(--text);
  padding:10px 12px;
  border-radius:10px;
  cursor:pointer;
}
button:hover{background:var(--btnBgHover)}
button.primary{
  border-color:rgba(51,209,122,0.35);
  background:rgba(51,209,122,0.12);
}
button.primary:hover{background:rgba(51,209,122,0.18)}
button.danger{
  border-color:rgba(255,92,92,0.35);
  background:rgba(255,92,92,0.10);
}
button.danger:hover{background:rgba(255,92,92,0.16)}
button.ghost{background:transparent}
.grid2{display:grid; grid-template-columns: 1fr 1fr; gap:12px}
.grid3{display:grid; grid-template-columns: 1fr 1fr 1fr; gap:12px}
@media (max-width: 820px){
  .grid2,.grid3{grid-template-columns: 1fr}
}
.layout{display:grid; grid-template-columns: 2.3fr 1fr; gap:14px}
@media (max-width: 980px){
  .layout{grid-template-columns: 1fr}
}
.kicker{color:var(--muted); font-size:12px; text-transform:uppercase; letter-spacing:0.12em; margin-bottom:8px}
.field{margin:10px 0}
.label{color:var(--muted); font-size:12px; margin-bottom:6px}
.value{font-size:16px; line-height:1.4}
.mono{font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; font-size:14px}
.divider{height:1px; background:var(--line); margin:14px 0}
.assistant{padding:12px; border:1px solid var(--line); border-radius:12px; background:var(--assistantBg)}
.assistant-header{display:flex; justify-content:space-between; align-items:center; gap:10px}
.assistant-title{font-weight:700}
.flagline{display:flex; gap:10px; align-items:center; flex-wrap:wrap}
.flag{
  padding:6px 10px;
  border-radius:999px;
  font-weight:700;
  font-size:13px;
  border:1px solid var(--line);
}
.flag.good{border-color:rgba(51,209,122,0.35); background:rgba(51,209,122,0.12); color:var(--good)}
.flag.bad{border-color:rgba(255,92,92,0.35); background:rgba(255,92,92,0.10); color:var(--bad)}
.conf{color:var(--muted); font-size:13px}
.confbar{height:10px; border-radius:999px; border:1px solid var(--line); overflow:hidden; margin-top:10px; background: var(--trackBg); }
.confbar-fill{height:100%; background:rgba(255,210,63,0.65)}
.assist-actions{display:flex; gap:8px; margin-top:10px; flex-wrap:wrap}
.chip{
  background:var(--chip);
  border-color:rgba(255,255,255,0.05);
  padding:8px 10px;
  border-radius:999px;
  font-size:13px;
}
.chip:hover{background:var(--chipHover)}
.assist-panel{margin-top:10px; border:1px solid var(--line); border-radius:10px; padding:10px; background:var(--panelBg)}
.panel-title{color:var(--muted); font-size:12px; text-transform:uppercase; letter-spacing:0.12em; margin-bottom:6px}
.panel-body{color:var(--text); line-height:1.45}
.panel-body.quote{font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; font-size:13px; white-space:pre-wrap}
.decision{display:flex; gap:10px; flex-wrap:wrap}
.hint{margin-top:10px; color:var(--muted); font-size:13px}
.sidecol .card{margin-bottom:14px}
.rival-row{display:flex; justify-content:space-between; color:var(--muted); margin:8px 0}
.rival-gap{margin:10px 0; font-weight:700}
.rivalbar{position:relative; height:12px; border:1px solid var(--line); border-radius:999px; overflow:hidden; background:var(--panelBg)}
.rivalbar-you{position:absolute; left:0; top:0; bottom:0; background:rgba(51,209,122,0.55)}
.rivalbar-them{position:absolute; left:0; top:0; bottom:0; background:rgba(255,92,92,0.45)}
.small{font-size:13px; color:var(--muted); line-height:1.45}
.stat{border:1px solid var(--line); border-radius:12px; padding:12px; background:var(--panelBg)}
.stat-label{color:var(--muted); font-size:12px}
.stat-value{font-size:22px; font-weight:800; margin-top:4px}
.table{
  width:100%;
  border-collapse:collapse;
  font-size:14px;
}
.table th, .table td{
  border-bottom:1px solid var(--line);
  padding:10px 8px;
  text-align:left;
}
.badge{
  display:inline-block;
  padding:4px 8px;
  border-radius:999px;
  font-size:12px;
  border:1px solid var(--line);
  color:var(--muted);
}
.badge.good{border-color:rgba(51,209,122,0.35); background:rgba(51,209,122,0.10); color:var(--good)}
.badge.bad{border-color:rgba(255,92,92,0.35); background:rgba(255,92,92,0.08); color:var(--bad)}
.badge.warn{border-color:rgba(180,83,9,0.35); background:rgba(180,83,9,0.10); color:var(--warn)}

.callout{
  border:1px solid var(--line);
  border-radius:12px;
  padding:12px;
  background:var(--panelBg);
}
.callout.good{border-color:rgba(51,209,122,0.35)}
.callout.bad{border-color:rgba(255,92,92,0.35)}
.callout.warn{border-color:rgba(180,83,9,0.35)}
.callout-title{font-weight:800; margin:0 0 6px 0}
.callout p{margin:6px 0; color:var(--muted)}
.callout ul{margin:6px 0 0 18px; color:var(--muted)}
.callout li{margin:4px 0}
.replay{
  border:1px solid var(--line);
  border-radius:12px;
  padding:12px;
  margin:10px 0;
  background:var(--panelBg)
}
.fineprint{margin-top:10px; color:var(--muted)}

.panel-meta{color:var(--muted); font-size:12px; margin-bottom:8px}

.field .value.quote{padding:10px; border:1px solid var(--line); border-radius:12px; background:var(--quoteBg)}

.refs{margin-top:10px; padding-left:18px}
.refs li{margin:6px 0}
.refs a{color:var(--accent); text-decoration:none}
.refs a:hover{text-decoration:underline}

/* Theme toggle button: make it look like other pills */
button.pill{
  padding:8px 10px;
  border-radius:999px;
  background:var(--pillBg);
  color:var(--muted);
  border:1px solid var(--line);
}
button.pill:hover{ background: var(--btnBgHover); }
button.pill:focus{ outline: 2px solid rgba(167,139,250,0.35); outline-offset:2px; }
.pill-button{ cursor:pointer; }

/* Slightly nicer monospace badges */
code{
  background: var(--monoBg);
  padding: 1px 6px;
  border-radius: 8px;
  border: 1px solid rgba(167,139,250,0.20);
}


/* Site footer */
.site-footer{
  border-top: 1px solid var(--border);
  padding: 14px 18px 18px 18px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}
