:root {
  --bg: #f6f6f7;
  --panel: #fff;
  --ink: #0f0f10;
  --muted: #707076;
  --muted-2: #98989f;
  --line: #e6e6ea;
  --soft: #f1f1f3;
  --blue: #4d6fe8;
  --blue-soft: #e7ebfb;
  --blue-pale: #f2f4fd;
  --green: #61c78a;
  --sidebar: 252px;
  --radius: 10px;
  --mono: "SFMono-Regular", "Geist Mono", Consolas, monospace;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--ink); font-family: var(--sans); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }

.logo-mark {
  position: relative;
  width: 42px;
  height: 34px;
  overflow: hidden;
  border-radius: 6px;
  background: #070707;
  flex: 0 0 auto;
}
.logo-mark img {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 132%;
  height: auto;
  max-width: none;
  display: block;
  transform: translate(-50%, -50%);
}

.landing {
  min-height: 100vh;
  display: grid;
  place-items: start center;
  padding: 86px 28px 48px;
}
.landing-inner { width: min(886px, 100%); }
.landing-brand { display: flex; flex-direction: column; align-items: center; gap: 17px; margin-bottom: 44px; }
.landing-brand .logo-mark { transform: scale(1.38); }
.brand-line { display: flex; align-items: center; gap: 20px; margin-top: 16px; font-weight: 650; }
.beta { font-family: var(--mono); font-size: 11px; font-weight: 650; letter-spacing: .08em; }
.status-line { display: flex; align-items: center; justify-content: center; gap: 32px; margin-top: 29px; font: 600 11px/1 var(--mono); letter-spacing: .05em; color: var(--muted); }
.status-line span { display: inline-flex; align-items: center; gap: 8px; }
.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 2px rgba(97,199,138,.10); }

.promo {
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 48px;
  margin-bottom: 16px;
  padding: 12px 16px;
  background: var(--blue-soft);
  border-radius: var(--radius);
  color: var(--blue);
  font-size: 14px;
  font-weight: 530;
}
.promo-text { flex: 1; }
.promo button { border: 0; color: inherit; background: transparent; font-weight: 600; }
.promo .dismiss { width: 22px; height: 22px; padding: 0; font-size: 16px; }

.landing-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.landing-card {
  display: flex;
  flex-direction: column;
  min-height: 372px;
  padding: 25px 24px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
}
.landing-card h2 { margin: 0 0 10px; font-size: 17px; font-weight: 600; }
.landing-card > p { margin: 0 0 22px; line-height: 1.5; color: var(--muted); }
.feature-list { list-style: none; margin: 0; padding: 0; color: var(--muted); }
.feature-list li { padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; line-height: 1.35; }
.feature-list li:last-child { border-bottom: 0; }
.landing-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 24px; margin: 28px 0 18px; font-size: 14px; }
.text-btn { border: 0; background: transparent; font-weight: 600; }
.landing-note { max-width: 660px; margin: 0 auto; text-align: center; color: var(--muted-2); font-size: 12px; line-height: 1.55; }

.btn {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font-weight: 550;
  box-shadow: 0 1px 1px rgba(0,0,0,.02);
}
.btn:hover { background: var(--soft); }
.btn.primary { border-color: transparent; background: var(--blue-soft); color: var(--blue); }
.btn.primary:hover { background: #dfe5fb; }
.btn.full { width: 100%; margin-top: auto; }
.btn:disabled { cursor: not-allowed; opacity: .45; }
.btn.small { min-height: 32px; padding: 0 12px; font-size: 13px; }

.shell { min-height: 100vh; display: grid; grid-template-columns: var(--sidebar) 1fr; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar); z-index: 15; display: flex; flex-direction: column; background: #fff; border-right: 1px solid var(--line); }
.sidebar-logo { height: 62px; display: flex; align-items: center; padding: 0 20px; }
.sidebar-logo .logo-mark { transform: scale(.58); transform-origin: left center; }
.sidebar-nav { padding: 0 8px 24px; overflow-y: auto; }
.nav-label { margin: 11px 12px 7px; color: #87878e; font-size: 10px; font-weight: 700; letter-spacing: .08em; }
.nav-label:not(:first-child) { margin-top: 28px; }
.nav-item { display: flex; align-items: center; width: 100%; min-height: 36px; margin: 2px 0; padding: 0 12px; border: 0; border-radius: 8px; background: transparent; text-align: left; font-size: 14px; font-weight: 500; }
.nav-item:hover, .nav-item.active { background: var(--soft); }
.nav-item.external::after { content: "↗"; margin-left: auto; color: var(--muted-2); font-size: 11px; }

.app-main { grid-column: 2; min-width: 0; }
.topbar { height: 55px; display: flex; align-items: center; justify-content: flex-end; padding: 0 18px; background: rgba(255,255,255,.78); border-bottom: 1px solid var(--line); backdrop-filter: blur(12px); position: sticky; top: 0; z-index: 12; }
.menu-btn { display: none; margin-right: auto; border: 0; background: transparent; font-size: 20px; }
.content { width: min(100%, 1020px); margin: 0 auto; padding: 24px 24px 64px; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin: 24px 0 22px; }
.page-head h1 { margin: 0 0 8px; font-size: 32px; line-height: 1.12; font-weight: 400; letter-spacing: -.025em; }
.page-head p { max-width: 780px; margin: 0; color: var(--muted); font-size: 15px; line-height: 1.5; }

.tabs { display: flex; gap: 24px; margin: -4px 0 16px; border-bottom: 1px solid var(--line); }
.tab { position: relative; min-height: 42px; border: 0; background: transparent; color: var(--muted); }
.tab.active { color: var(--blue); }
.tab.active::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--blue); }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 1px 2px rgba(0,0,0,.025); }
.panel-pad { padding: 20px; }
.panel-title { margin: 0 0 5px; font-size: 16px; font-weight: 600; }
.panel-sub { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.metric { padding: 18px; }
.metric-label { color: var(--muted); font-size: 12px; }
.metric-value { margin-top: 9px; font-size: 24px; font-weight: 500; letter-spacing: -.025em; }
.metric-note { margin-top: 5px; color: var(--muted-2); font-size: 11px; }

.chat-layout { display: grid; grid-template-columns: minmax(0, 1fr) 297px; gap: 16px; }
.chat-card { overflow: hidden; }
.chat-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; min-height: 64px; padding: 12px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.chat-toolbar strong { color: var(--ink); }
.selectish { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.selectish::after { content: "⌄"; color: var(--muted-2); }
.switch { width: 31px; height: 18px; border-radius: 20px; border: 0; background: #c9cad0; padding: 2px; }
.switch::after { content: ""; display: block; width: 14px; height: 14px; border-radius: 50%; background: white; box-shadow: 0 1px 2px rgba(0,0,0,.15); transition: transform .16s; }
.switch.on { background: var(--blue); }
.switch.on::after { transform: translateX(13px); }
.history-status { width: 100%; color: var(--muted-2); }
.conversation { min-height: 200px; padding: 26px 18px; text-align: center; }
.conversation-title { font-size: 14px; font-weight: 600; }
.suggestions { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-top: 16px; }
.suggestion { max-width: 90%; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; background: white; font-size: 13px; }
.suggestion:hover { background: var(--soft); }
.messages { display: flex; flex-direction: column; gap: 12px; text-align: left; }
.message { max-width: 88%; padding: 11px 13px; border-radius: 9px; font-size: 13px; line-height: 1.5; }
.message.user { align-self: flex-end; background: var(--blue-soft); }
.message.assistant { align-self: flex-start; background: var(--soft); }
.composer { padding: 12px; border-top: 1px solid var(--line); }
.composer textarea { width: 100%; min-height: 88px; padding: 14px; resize: vertical; border: 1px solid var(--line); border-radius: 8px; outline: none; background: #fafafa; }
.composer textarea:focus { border-color: #b9c3ef; box-shadow: 0 0 0 3px rgba(77,111,232,.08); }
.composer-foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 10px; color: var(--muted-2); font-size: 11px; }
.progress { padding: 18px 20px; }
.tag { display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: 999px; background: var(--blue-pale); color: var(--blue); font: 650 10px/1 var(--mono); letter-spacing: .04em; }
.progress-head { display: flex; justify-content: space-between; font-size: 11px; }
.step-list { margin: 18px 0 20px; }
.step { position: relative; min-height: 53px; padding-left: 30px; color: var(--muted); font-size: 13px; }
.step::before { content: ""; position: absolute; left: 0; top: 0; width: 16px; height: 16px; border-radius: 50%; border: 1px solid var(--line); background: #fff; }
.step:not(:last-child)::after { content: ""; position: absolute; left: 8px; top: 17px; bottom: 0; width: 1px; background: var(--line); }
.step.done::before { background: var(--green); border-color: var(--green); box-shadow: inset 0 0 0 4px white; }
.step small { display: block; margin-top: 3px; color: var(--muted-2); }
.facts { padding-top: 16px; border-top: 1px solid var(--line); display: grid; gap: 13px; }
.fact { display: flex; justify-content: space-between; gap: 18px; font-size: 12px; }
.fact span:first-child { color: var(--muted); }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th { padding: 12px 14px; color: var(--muted); text-align: left; font-weight: 500; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 13px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
.worker-name { font-weight: 600; }
.online { display: inline-flex; align-items: center; gap: 6px; color: #31865a; font: 650 10px/1 var(--mono); }
.online::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--green); }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); }

.section-gap { margin-top: 16px; }
.section-title { margin: 26px 0 12px; font-size: 14px; font-weight: 600; }
.steps-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 16px; }
.numbered { padding: 18px; }
.number { display: grid; place-items: center; width: 25px; height: 25px; margin-bottom: 25px; border-radius: 50%; background: var(--soft); font: 600 11px/1 var(--mono); }
.numbered h3 { margin: 0 0 8px; font-size: 14px; }
.numbered p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.code { position: relative; margin-top: 16px; padding: 18px; background: #111114; color: #ededf2; border-radius: 9px; font: 12px/1.7 var(--mono); overflow-x: auto; white-space: pre; }
.copy-code { position: absolute; top: 10px; right: 10px; border: 1px solid #33333a; border-radius: 6px; background: #1d1d21; color: #fff; padding: 6px 9px; font-size: 11px; }

.leader-list { padding: 0 20px; }
.leader { display: grid; grid-template-columns: 42px 1fr auto; align-items: center; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.leader:last-child { border-bottom: 0; }
.rank { color: var(--muted); font: 600 11px/1 var(--mono); }
.leader strong { display: block; font-size: 13px; }
.leader small { color: var(--muted); }
.leader-value { text-align: right; font-size: 13px; }
.leader-value small { display: block; }

.chart { min-height: 265px; padding: 18px 18px 12px; }
.chart-title { display: flex; justify-content: space-between; margin-bottom: 28px; font-size: 12px; }
.spark { width: 100%; height: 150px; }
.chart-labels { display: flex; justify-content: space-between; color: var(--muted-2); font: 10px/1 var(--mono); }
.model-bars { display: grid; gap: 13px; padding-top: 10px; }
.bar-row { display: grid; grid-template-columns: 75px 1fr 72px; gap: 10px; align-items: center; font-size: 11px; }
.bar-track { height: 7px; border-radius: 10px; overflow: hidden; background: var(--soft); }
.bar-fill { height: 100%; background: var(--blue); border-radius: inherit; }

.docs-layout { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 22px; }
.docs-nav { position: sticky; top: 80px; align-self: start; padding: 8px; }
.docs-nav button { width: 100%; min-height: 34px; padding: 0 10px; border: 0; border-radius: 7px; text-align: left; background: transparent; font-size: 12px; }
.docs-nav button:hover { background: var(--soft); }
.docs-section { scroll-margin-top: 74px; margin-bottom: 18px; padding: 22px; }
.docs-section h2 { margin: 0 0 6px; font-size: 19px; font-weight: 500; }
.docs-section h3 { margin: 18px 0 6px; font-size: 14px; }
.docs-section p, .docs-section li { color: var(--muted); font-size: 13px; line-height: 1.65; }
.docs-section ul { padding-left: 19px; }
.definition-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 14px; }
.definition { padding: 14px; background: var(--bg); border-radius: 8px; }
.definition strong { display: block; margin-bottom: 5px; font-size: 12px; }
.definition span { color: var(--muted); font-size: 12px; line-height: 1.45; }

.account-line { display: flex; justify-content: space-between; align-items: center; gap: 15px; padding: 15px 0; border-bottom: 1px solid var(--line); }
.account-line:last-child { border-bottom: 0; }
.field { display: grid; gap: 7px; }
.field label { color: var(--muted); font-size: 12px; }
.field input, .field select { min-height: 40px; padding: 0 11px; border: 1px solid var(--line); border-radius: 8px; background: #fff; outline: none; }
.modal-backdrop { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 20px; background: rgba(10,10,12,.32); backdrop-filter: blur(3px); }
.modal { width: min(420px, 100%); padding: 22px; background: #fff; border-radius: 12px; box-shadow: 0 22px 70px rgba(0,0,0,.18); }
.modal h2 { margin: 0 0 8px; font-size: 20px; }
.modal p { color: var(--muted); line-height: 1.5; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.mirror-note { margin-top: 16px; color: var(--muted-2); font-size: 11px; }
.toast { position: fixed; right: 20px; bottom: 20px; z-index: 70; padding: 11px 14px; background: #151518; color: #fff; border-radius: 8px; font-size: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.15); animation: toast-in .2s ease-out; }
@keyframes toast-in { from { opacity: 0; transform: translateY(7px); } }

@media (max-width: 1000px) {
  .sidebar { transform: translateX(-100%); transition: transform .2s ease; box-shadow: 20px 0 40px rgba(0,0,0,.08); }
  .shell.sidebar-open .sidebar { transform: translateX(0); }
  .shell { grid-template-columns: 1fr; }
  .app-main { grid-column: 1; }
  .menu-btn { display: block; }
  .chat-layout { grid-template-columns: 1fr; }
  .chat-layout > .progress { order: -1; }
}

@media (max-width: 720px) {
  .landing { padding: 42px 16px 32px; }
  .landing-brand { margin-bottom: 32px; }
  .landing-cards, .grid-2, .grid-3, .grid-4, .steps-grid, .definition-grid { grid-template-columns: 1fr; }
  .landing-card { min-height: 330px; }
  .promo { align-items: flex-start; }
  .content { padding: 16px 14px 48px; }
  .page-head { flex-direction: column; margin-top: 18px; }
  .page-head h1 { font-size: 28px; }
  .docs-layout { grid-template-columns: 1fr; }
  .docs-nav { position: static; display: flex; overflow-x: auto; }
  .docs-nav button { width: auto; white-space: nowrap; }
  .bar-row { grid-template-columns: 62px 1fr 55px; }
}
