:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  color: #18243a;
  background: #eaf0fa;
  --muted: #50617a;
  --accent: #204cbe;
  --accent-hover: #173d9f;
  --line: #dce4f1;
  --soft: #eff4fd;
  --surface: rgba(255, 255, 255, .94);
  --shadow: 0 12px 36px rgba(33, 57, 103, .07);
  --radius: 1.35rem;
}
* { box-sizing: border-box; }
html, body { overflow: hidden; overscroll-behavior: none; }
body {
  display: flow-root;
  min-height: 100vh;
  margin: 0;
  background: radial-gradient(ellipse at 6% 5%, #dce9ff, transparent 42%),
    radial-gradient(ellipse at 93% 5%, #e5dfff, transparent 45%), #eff3fa;
}
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button {
  min-height: 2.75rem;
  border: 1px solid transparent;
  border-radius: .75rem;
  padding: .54rem .9rem;
  background: var(--accent);
  color: white;
  font-weight: 650;
  cursor: pointer;
  transition: background .16s, color .16s, transform .16s, box-shadow .16s;
}
button:hover { background: var(--accent-hover); }
button:active:not(:disabled) { transform: scale(.97); }
button:disabled { opacity: .55; cursor: wait; }
:focus-visible { outline: 3px solid #416de0; outline-offset: 3px; }
[hidden] { display: none !important; }
.skip-link { position: fixed; z-index: 5; top: .5rem; left: .5rem; padding: .75rem; background: white; transform: translateY(-150%); }
.skip-link:focus { transform: translateY(0); }
.shell {
  display: grid;
  grid-template-columns: 14rem minmax(0, 1fr);
  width: min(1400px, calc(100% - 3rem));
  height: calc(100vh - 3rem);
  height: calc(100dvh - 3rem);
  margin: 1.5rem auto;
  border: 1px solid rgba(255,255,255,.88);
  border-radius: 1.75rem;
  background: rgba(250, 252, 255, .66);
  box-shadow: 0 24px 75px rgba(36, 55, 100, .13);
  overflow: hidden;
}
.sidebar {
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 1.5rem 1rem;
  border-radius: 1.75rem 0 0 1.75rem;
  border-right: 1px solid var(--line);
  background: rgba(232, 239, 252, .78);
  backdrop-filter: blur(18px);
  overflow-y: auto;
  overscroll-behavior-y: contain;
}
.brand { display: flex; gap: .75rem; align-items: center; padding: .2rem .3rem; }
.brand-mark {
  display: grid; place-items: center; width: 2.65rem; height: 2.65rem; flex: none;
  border-radius: .85rem; background: linear-gradient(145deg,#5278ea,#254bc4); color: #fff;
  box-shadow: 0 6px 13px rgba(42, 82, 203, .22); font-weight: 750; font-size: 1.32rem;
}
.brand strong { display: block; font-size: 1.18rem; }
.brand small, .connection { color: var(--muted); font-size: .78rem; }
.sidebar nav { display: grid; gap: .24rem; margin-top: 2rem; }
.sidebar nav a {
  display: flex; gap: .55rem; align-items: center; min-height: 2.85rem; padding: .35rem .55rem;
  border-radius: .75rem; color: #334565; text-decoration: none; font-size: .87rem; font-weight: 650;
  transition: background .16s, color .16s;
}
.sidebar nav a:hover, .sidebar nav a[aria-current] { background: #fff; color: var(--accent); }
.nav-icon {
  display: grid; place-items: center; flex: none; width: 1.75rem; height: 1.75rem;
  border-radius: .52rem; background: #e3eafb; color: #3f5f9c;
  transition: color .16s, background .16s;
}
.nav-icon svg { width: 1.05rem; height: 1.05rem; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.sidebar nav a:hover .nav-icon, .sidebar nav a[aria-current] .nav-icon { background: #dce7ff; color: var(--accent); }
.connection { display: flex; align-items: center; gap: .5rem; padding: .65rem .35rem 0; margin-top: auto; }
.connection span { width: .5rem; height: .5rem; border-radius: 50%; background: #66758e; }
.connection[data-ready] span { background: #177451; box-shadow: 0 0 0 4px #d9eee4; }
main {
  min-width: 0; min-height: 0; padding: clamp(1.15rem, 3.5vw, 3.1rem);
  overflow-y: auto; overscroll-behavior-y: contain; scroll-behavior: smooth;
  scrollbar-width: thin; scrollbar-color: #bac8de transparent;
}
h1 { margin: 0; font-size: clamp(1.95rem, 4vw, 2.9rem); line-height: 1.08; letter-spacing: -.055em; }
h2 { margin: 0; font-size: 1.14rem; letter-spacing: -.026em; }
.vito-console {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(14rem, .85fr); align-items: center;
  position: relative; isolation: isolate; overflow: hidden;
  margin: 0 0 1.2rem; padding: clamp(1.1rem, 3vw, 2.25rem);
  border: 1px solid #25364d; border-radius: var(--radius); color: #f8faff;
  background: radial-gradient(ellipse at 78% 48%, #292737 0, #131e34 45%, #101a2b 76%);
  box-shadow: 0 14px 34px #17274926;
}
.vito-console h1 { font-size: clamp(2.5rem, 5.5vw, 4.45rem); }
.console-copy { z-index: 1; min-width: 0; }
.console-status { display: flex; gap: .48rem; align-items: center; margin: 0 0 .65rem; color: #f3d491; font-size: .78rem; font-weight: 680; }
.console-status span:first-child { width: .5rem; height: .5rem; flex: none; border-radius: 50%; background: #ffc263; box-shadow: 0 0 10px #ffaa55ba; }
.vito-console[data-state='locked'] .console-status { color: #c5d0e5; }
.vito-console[data-state='locked'] .console-status span:first-child { background: #8494ae; box-shadow: none; }
.console-intro { margin: .6rem 0 0; line-height: 1.45; font-size: .91rem; color: #cdd9ee; }
.console-visual { position: relative; aspect-ratio: 1.08; min-width: 0; max-height: 22rem; }
.console-visual::before {
  content: ''; position: absolute; inset: 12% 9%; border-radius: 50%;
  background: radial-gradient(circle, #ffa64731 0, #e8902219 30%, transparent 70%);
}
#vito-core { position: absolute; inset: 0; height: 100%; width: 100%; }
.assistant-form { margin-top: 1.15rem; }
.assistant-form label { display: block; margin-bottom: .4rem; font-size: .8rem; font-weight: 650; color: #e0e8fa; }
.assistant-field { display: flex; gap: .35rem; padding: .28rem; border: 1px solid #43516a; border-radius: .8rem; background: #111b2b; }
.assistant-field:focus-within { border-color: #d7a65e; }
.assistant-field input { flex: 1; min-width: 0; border: none; background: transparent; color: #fff; padding: .5rem; font-size: .84rem; }
.assistant-field input::placeholder { color: #a3b1c8; }
.assistant-field input:focus-visible { outline-offset: -2px; }
.assistant-field button { min-width: 2.45rem; min-height: 2.45rem; padding: .1rem; background: #edb863; color: #1f2330; font-size: 1.15rem; }
.assistant-field button:hover { background: #ffd280; }
.assistant-suggestions { display: flex; flex-wrap: wrap; gap: .36rem; margin-top: .6rem; }
.assistant-suggestions button { min-height: 2rem; padding: .24rem .46rem; border-color: #46536a; background: #25324a; color: #e3ebfa; font-size: .71rem; }
.assistant-suggestions button:hover { background: #35445f; }
#assistant-response { margin: .56rem 0 0; color: #f5d49a; font-size: .82rem; line-height: 1.45; }
#assistant-response:empty { display: none; }
.assistant-chat { margin-top: .65rem; max-height: 12rem; overflow: auto; scrollbar-width: thin; scrollbar-color: #65728c transparent; }
.assistant-chat p { margin: 0 0 .45rem; padding: .52rem .62rem; border-radius: .55rem; background: #26344d; color: #eff4fd; font-size: .82rem; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.assistant-chat strong { display: block; color: #f1c981; font-size: .72rem; }
#case { color: var(--muted); line-height: 1.5; }
.panel { padding: clamp(1rem, 2.2vw, 1.45rem); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.access-panel { max-width: 36rem; }
.access-panel label { font-weight: 650; }
.access-panel #setup { margin-bottom: 1rem; }
.access-panel #setup p { color: var(--muted); margin: 0 0 .7rem; }
.access-panel #setup input { display: block; width: 100%; margin-top: .35rem; }
.logout { margin-top: .75rem; align-self: flex-start; font-size: .82rem; }
.controls, .heading { display: flex; flex-wrap: wrap; align-items: center; gap: .65rem; }
.controls { margin-top: .65rem; }
.heading { justify-content: space-between; min-height: 2.75rem; }
.secondary { color: #264778; background: var(--soft); border-color: var(--line); }
.secondary:hover { background: #e1eafa; }
.icon-button { width: 2.75rem; padding: 0; font-size: 1.3rem; }
input[type='password'], input[type='number'] { min-height: 2.75rem; padding: .5rem .7rem; border: 1px solid #bccce3; border-radius: .72rem; background: #fff; color: inherit; }
input[type='password'] { flex: 1 1 12rem; min-width: 0; }
#notice:empty { display: none; }
#notice { padding: .7rem .9rem; margin: 0 0 1rem; background: #e3edff; border-radius: .75rem; color: #254577; }
.access-panel:not([hidden]) + #notice { margin-top: .8rem; }
#workspace:not([hidden]), #quote:not([hidden]) { animation: reveal .26s ease-out both; }
@keyframes reveal { from { opacity: .25; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .85rem; margin: 0 0 1.15rem; }
.metrics div { padding: 1rem; }
.metrics dt { color: var(--muted); font-size: .84rem; }
.metrics dd { margin: .34rem 0 0; font-size: 1.85rem; line-height: 1; font-weight: 720; font-variant-numeric: tabular-nums; letter-spacing: -.055em; }
.workspace-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 1.15rem; align-items: start; }
.workspace-grid section { scroll-margin-top: 1rem; }
#case { margin: .8rem 0 1rem; font-size: .92rem; }
.steps { list-style: none; padding: 0; margin: 0 0 1.1rem; display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: .35rem; }
.steps li { min-width: 0; padding: .5rem .25rem; text-align: center; background: #f2f5fa; border-radius: .5rem; color: var(--muted); font-size: .72rem; }
.steps li[data-done] { background: #e4f2eb; color: #205a45; }
.steps li[aria-current] { background: #dce7ff; color: #234698; font-weight: 750; }
fieldset { min-width: 0; margin: 0 0 .8rem; border: 0; padding: 0; }
legend, .quote-inputs label { margin: 0 0 .4rem; padding: 0; font-size: .83rem; color: #354765; font-weight: 650; }
.segments { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .32rem; padding: .3rem; border-radius: .8rem; background: var(--soft); }
.segments label { position: relative; min-width: 0; }
.segments input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.segments span { display: block; min-height: 2.55rem; padding: .62rem .2rem; border: 1px solid transparent; border-radius: .57rem; text-align: center; color: #385178; font-size: .82rem; font-weight: 650; cursor: pointer; transition: color .16s, background .16s, box-shadow .16s; }
.segments label:hover span { background: #e2eaf8; }
.segments input:checked + span { background: white; color: var(--accent); border-color: #dbe4f7; box-shadow: 0 2px 5px #23365812; }
.segments input:focus-visible + span { outline: 3px solid #416de0; outline-offset: 2px; }
.quote-inputs { display: grid; grid-template-columns: 1fr 1fr auto; align-items: end; gap: .55rem; }
.quote-inputs label { margin: 0; }
.quote-inputs input { display: block; width: 100%; margin-top: .35rem; }
.quote-total { background: #edf3ff; border: 1px solid #dce6fa; color: #244778; border-radius: .72rem; padding: .72rem; font-size: .85rem; margin: .9rem 0 0; }
.actions { margin-top: .85rem; }
.actions button { font-size: .83rem; }
.filters { display: flex; flex-wrap: wrap; gap: .35rem; margin: .75rem 0 .65rem; }
.filters button { min-height: 2.45rem; padding: .35rem .57rem; color: var(--muted); background: transparent; font-size: .76rem; }
.filters button:hover { background: var(--soft); }
.filters button[aria-pressed='true'] { color: #21469e; background: #e2ebff; border-color: #d7e3ff; }
#jobs { list-style: none; margin: 0; padding: 0; }
#jobs li { border-top: 1px solid var(--line); padding: .83rem .15rem; overflow-wrap: anywhere; }
.job-heading { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .55rem; }
.job-heading strong { font-size: .9rem; }
.job-meta { color: var(--muted); font-size: .74rem; }
.job-badge { border-radius: 1rem; padding: .24rem .46rem; background: #ecf2ff; color: #32578c; font-size: .71rem; font-weight: 700; }
.job-badge[data-status='complete'] { background: #e1f1e8; color: #1d6447; }
.job-badge[data-status='blocked'] { background: #fbe7ea; color: #932f43; }
#jobs p { margin: .45rem 0 0; color: #3b4e6c; font-size: .86rem; line-height: 1.45; }
#jobs .controls { margin-top: .45rem; }
#jobs button { min-height: 2.35rem; font-size: .8rem; }
@media (max-width: 1080px) {
  .shell { width: calc(100% - 2rem); grid-template-columns: 12rem minmax(0, 1fr); }
  .workspace-grid { grid-template-columns: 1fr; }
}
@media (max-width: 670px) {
  .shell { width: calc(100% - 1rem); margin: .5rem auto; height: calc(100vh - 1rem); height: calc(100dvh - 1rem); grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); border-radius: 1.2rem; }
  .sidebar { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; padding: .72rem .85rem; border-radius: 1.2rem 1.2rem 0 0; border-right: 0; border-bottom: 1px solid var(--line); }
  .sidebar nav { display: flex; flex-wrap: wrap; grid-column: 1 / -1; order: 2; margin-top: .5rem; gap: .15rem; }
  .sidebar nav a { min-height: 2.5rem; gap: .25rem; padding: .3rem .45rem; font-size: .76rem; }
  .nav-icon { width: 1.4rem; height: 1.4rem; border-radius: .42rem; }
  .nav-icon svg { width: .91rem; height: .91rem; }
  .connection { grid-column: 1 / -1; order: 3; margin: 0; padding-top: .4rem; }
  .logout { grid-column: 2; align-self: center; min-height: 2.35rem; margin: 0; font-size: .74rem; }
  .metrics { grid-template-columns: repeat(2, minmax(0,1fr)); gap: .55rem; }
  .metrics div { padding: .8rem; }
  .workspace-grid { gap: .85rem; }
  .vito-console { grid-template-columns: minmax(0, 1fr); }
  .console-visual { grid-row: 1; width: min(100%, 13rem); justify-self: center; margin: -.45rem auto -.3rem; }
}
@media (max-width: 365px) {
  .quote-inputs { grid-template-columns: 1fr 1fr; }
  .quote-inputs button { grid-column: 1 / -1; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
