/* Cream theme ---------------------------------------------------------------- */
:root {
  --bg: #f5efe3;
  --surface: #fffcf6;
  --surface-2: #faf4e9;
  --surface-3: #f2e9d9;
  --border: #e9dcc6;
  --border-soft: #f1e8d8;
  --border-strong: #dccaab;
  --text: #2e2419;
  --text-2: #6f604c;
  --text-3: #a08e75;
  --primary: #b5733a;
  --primary-600: #9a5e2b;
  --primary-soft: #f5e5cf;
  --primary-ring: rgba(181, 115, 58, .22);
  --success: #4c8a5a;
  --success-soft: #e2efdd;
  --danger: #c0513c;
  --danger-soft: #f8e1da;
  --warning: #bf8a1e;
  --warning-soft: #f8edcc;
  --info: #4c7a95;
  --info-soft: #dfeaf1;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(92, 66, 32, .04), 0 8px 24px rgba(92, 66, 32, .06);
  --shadow-lg: 0 24px 60px rgba(66, 45, 18, .20);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --mono: "JetBrains Mono", "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  color: var(--text);
  background:
    radial-gradient(1100px 520px at 105% -8%, #fbe6c8 0%, rgba(251, 230, 200, 0) 62%),
    radial-gradient(900px 480px at -10% 110%, #efe0c6 0%, rgba(239, 224, 198, 0) 58%),
    var(--bg);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary-600); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; letter-spacing: -.01em; }
code, pre, .mono { font-family: var(--mono); }
::selection { background: #f0d3ad; }

/* Boot ------------------------------------------------------------------------ */
.boot { min-height: 100vh; display: grid; place-items: center; }
.spinner {
  width: 30px; height: 30px; border-radius: 50%;
  border: 3px solid var(--primary-soft); border-top-color: var(--primary);
  animation: spin .8s linear infinite;
}
.spinner.sm { width: 16px; height: 16px; border-width: 2px; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }
@keyframes slide { from { opacity: 0; transform: translateY(10px); } }

/* Layout ---------------------------------------------------------------------- */
.layout { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  display: flex; flex-direction: column;
  padding: 20px 14px 16px;
  background: rgba(255, 251, 244, .72);
  backdrop-filter: blur(10px);
  border-right: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 11px; padding: 4px 10px 18px; }
.brand-name { font-weight: 700; font-size: 15px; line-height: 1.25; }
.brand-sub { font-size: 11.5px; color: var(--text-3); }
.brand-mark {
  flex: none; width: 36px; height: 36px; border-radius: 11px;
  display: grid; place-items: center; color: #fff;
  background: linear-gradient(140deg, #d8a266 0%, #b5733a 55%, #9a5e2b 100%);
  box-shadow: 0 8px 18px rgba(154, 94, 43, .32), inset 0 1px 0 rgba(255, 255, 255, .25);
}
.nav-group + .nav-group { margin-top: 18px; }
.nav-title { font-size: 11px; font-weight: 600; letter-spacing: .1em; color: var(--text-3); padding: 0 12px 6px; }
.nav a {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 12px; margin: 2px 0; border-radius: 11px;
  color: var(--text-2); font-size: 14px; text-decoration: none;
  transition: background .15s, color .15s;
}
.nav a:hover { background: var(--surface-3); color: var(--text); }
.nav a.active {
  background: linear-gradient(180deg, #f8e8d2, #f3dfc3);
  color: var(--primary-600); font-weight: 600;
  box-shadow: inset 0 0 0 1px #ecd3b1;
}
.sidebar-foot { margin-top: auto; padding-top: 16px; }
.quota-mini {
  padding: 14px; border-radius: 14px;
  background: linear-gradient(160deg, #fbf1e2, #f4e3cb);
  border: 1px solid #ecd9bb;
}
.quota-mini .label { font-size: 12px; color: var(--text-2); }
.quota-mini .value { font-size: 20px; font-weight: 700; margin: 2px 0 8px; font-variant-numeric: tabular-nums; }

.main { padding: 26px 34px 48px; min-width: 0; }
.topbar { display: flex; align-items: center; gap: 14px; margin-bottom: 24px; }
.page-title { flex: 1; min-width: 0; }
.page-title h1 { font-size: 23px; font-weight: 700; }
.page-title p { margin: 3px 0 0; color: var(--text-2); font-size: 13px; }
.user-chip {
  display: flex; align-items: center; gap: 10px;
  padding: 5px 6px 5px 5px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow);
}
.avatar {
  width: 32px; height: 32px; border-radius: 50%; flex: none;
  display: grid; place-items: center; font-weight: 700; color: #fff;
  background: linear-gradient(140deg, #d59c5f, #a8672f);
}
.user-chip .who { line-height: 1.2; padding-right: 4px; }
.user-chip .who b { display: block; font-size: 13px; }
.user-chip .who span { font-size: 11.5px; color: var(--text-3); }
.mobile-only { display: none !important; }
.scrim { display: none; }

/* Cards ----------------------------------------------------------------------- */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  min-width: 0;
}
.card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 16px 20px; border-bottom: 1px solid var(--border-soft);
}
.card-head h3 { font-size: 15px; font-weight: 650; display: flex; align-items: center; gap: 8px; }
.card-head .sub { font-size: 12.5px; color: var(--text-3); font-weight: 400; }
.card-body { padding: 18px 20px; }
.card-body.flush { padding: 0; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.row.between { justify-content: space-between; }
.spacer { flex: 1; }
.grid-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 16px; }
.grid-2.even { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.section-gap { margin-top: 16px; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.small { font-size: 12.5px; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.ellipsis { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; vertical-align: bottom; }

/* Stats ----------------------------------------------------------------------- */
.stat { padding: 18px 20px 16px; position: relative; overflow: hidden; }
.stat::after {
  content: ""; position: absolute; right: -36px; top: -36px; width: 110px; height: 110px; border-radius: 50%;
  background: radial-gradient(circle, rgba(236, 206, 164, .35), rgba(236, 206, 164, 0) 70%);
}
.stat .label { display: flex; align-items: center; gap: 9px; color: var(--text-2); font-size: 13px; font-weight: 500; }
.stat .value { font-size: 29px; font-weight: 750; margin-top: 10px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.15; }
.stat .sub { color: var(--text-3); font-size: 12.5px; margin-top: 5px; }
.stat .progress { margin-top: 12px; }
.bubble {
  width: 30px; height: 30px; border-radius: 9px; flex: none;
  display: grid; place-items: center;
  background: var(--primary-soft); color: var(--primary-600);
}
.tone-success .bubble { background: var(--success-soft); color: var(--success); }
.tone-danger .bubble { background: var(--danger-soft); color: var(--danger); }
.tone-warning .bubble { background: var(--warning-soft); color: var(--warning); }
.tone-info .bubble { background: var(--info-soft); color: var(--info); }

.progress { height: 7px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.progress > span {
  display: block; height: 100%; border-radius: inherit;
  background: linear-gradient(90deg, #dcaa70, #b5733a);
  transition: width .4s ease;
}
.progress.warn > span { background: linear-gradient(90deg, #e3b865, #c9892a); }
.progress.danger > span { background: linear-gradient(90deg, #e08c74, #c0513c); }

/* Buttons --------------------------------------------------------------------- */
.btn {
  height: 36px; padding: 0 14px; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  font: inherit; font-size: 14px; font-weight: 500; cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, box-shadow .15s, filter .15s, transform .05s;
}
.btn:hover { background: var(--surface-2); border-color: #ccb48d; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--primary-ring); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn-primary {
  color: #fff; border-color: #9a5e2b;
  background: linear-gradient(180deg, #c3844a 0%, #a8672f 100%);
  box-shadow: 0 6px 14px rgba(168, 103, 47, .26), inset 0 1px 0 rgba(255, 255, 255, .22);
}
.btn-primary:hover { background: linear-gradient(180deg, #c98b50 0%, #ad6c33 100%); border-color: #8f5626; }
.btn-soft { background: var(--primary-soft); border-color: #ecd3b1; color: var(--primary-600); }
.btn-soft:hover { background: #f1dcbf; border-color: #e3c49a; }
.btn-danger { color: var(--danger); }
.btn-danger:hover { background: var(--danger-soft); border-color: #eab8aa; }
.btn-danger-solid { color: #fff; background: linear-gradient(180deg, #cc604a, #b0472f); border-color: #a2412b; }
.btn-danger-solid:hover { background: linear-gradient(180deg, #d26a54, #b54c34); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--surface-3); border-color: transparent; }
.btn-sm { height: 30px; padding: 0 10px; font-size: 13px; border-radius: 8px; gap: 5px; }
.btn-lg { height: 44px; font-size: 15px; border-radius: 12px; }
.btn-block { width: 100%; }
.btn-icon { width: 32px; padding: 0; }

/* Forms ----------------------------------------------------------------------- */
.input, .select, .textarea {
  width: 100%; height: 38px; padding: 0 12px;
  border-radius: 10px; border: 1px solid var(--border-strong);
  background: #fffdf9; color: var(--text);
  font: inherit; font-size: 14px; outline: none;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.textarea { height: auto; min-height: 90px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
.select {
  appearance: none; padding-right: 32px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239a8a72' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center;
}
.input:hover, .select:hover, .textarea:hover { border-color: #cdb58f; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-ring); background: #fff; }
.input::placeholder, .textarea::placeholder { color: #b9a88f; }
.input-sm { height: 32px; font-size: 13px; }
.input-icon { position: relative; }
.input-icon svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.input-icon .input { padding-left: 34px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label { font-size: 13px; font-weight: 550; color: var(--text-2); }
.hint { font-size: 12px; color: var(--text-3); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.form-grid .full { grid-column: 1 / -1; }
.form-error {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 12px; border-radius: 10px;
  background: var(--danger-soft); color: #a3402d; font-size: 13px;
}
.checks { display: flex; gap: 16px; flex-wrap: wrap; padding-top: 4px; }
.check { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; font-size: 14px; }
.check input { accent-color: var(--primary); width: 16px; height: 16px; }

.switch {
  position: relative; flex: none; width: 42px; height: 24px; border-radius: 999px;
  background: #dccbb0; border: none; cursor: pointer; transition: background .2s; padding: 0;
}
.switch::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(60, 40, 10, .3); transition: transform .2s;
}
.switch.on { background: var(--primary); }
.switch.on::after { transform: translateX(18px); }
.switch:disabled { opacity: .5; cursor: not-allowed; }
.switch-row {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 0; border-bottom: 1px dashed var(--border);
}
.switch-row:last-child { border-bottom: none; }
.switch-row b { display: block; font-size: 14px; font-weight: 600; }
.switch-row span { font-size: 12.5px; color: var(--text-3); }

.segmented { display: flex; padding: 4px; border-radius: 12px; background: var(--surface-3); gap: 4px; }
.segmented button {
  flex: 1; height: 34px; border: none; border-radius: 9px; background: transparent;
  font: inherit; font-size: 14px; font-weight: 550; color: var(--text-2); cursor: pointer; transition: .15s;
}
.segmented button.active { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(80, 55, 20, .12); }
.segmented button:disabled { opacity: .45; cursor: not-allowed; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.filters .input, .filters .select { width: auto; min-width: 140px; }

/* Tables ---------------------------------------------------------------------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
th {
  text-align: left; font-weight: 600; font-size: 12.5px; color: var(--text-2);
  background: var(--surface-2); padding: 10px 14px; white-space: nowrap;
  border-bottom: 1px solid var(--border);
}
td { padding: 12px 14px; border-bottom: 1px solid var(--border-soft); vertical-align: middle; }
tbody tr { transition: background .12s; }
tbody tr:hover td { background: #fdf7ec; }
tbody tr:last-child td { border-bottom: none; }
td.actions { white-space: nowrap; text-align: right; }
td .sub { display: block; font-size: 12px; color: var(--text-3); }
.empty { padding: 44px 20px; text-align: center; color: var(--text-3); }
.empty svg { color: #d6c3a3; margin-bottom: 8px; }

.pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; border-top: 1px solid var(--border-soft); flex-wrap: wrap; }
.pager .pages { display: flex; gap: 4px; align-items: center; }
.pager .page-no { min-width: 30px; }
.pager .page-no.active { background: var(--primary-soft); border-color: #e7c9a0; color: var(--primary-600); font-weight: 650; }

/* Badges ---------------------------------------------------------------------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 9px; border-radius: 999px; white-space: nowrap;
  font-size: 12px; font-weight: 600; line-height: 1.6;
  background: var(--surface-3); color: var(--text-2);
}
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.success { background: var(--success-soft); color: var(--success); }
.badge.danger { background: var(--danger-soft); color: var(--danger); }
.badge.warning { background: var(--warning-soft); color: #9c6f12; }
.badge.info { background: var(--info-soft); color: var(--info); }
.badge.primary { background: var(--primary-soft); color: var(--primary-600); }
.badge.pulse .dot { animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .3; } }
.chip { display: inline-block; padding: 1px 8px; border-radius: 6px; background: var(--surface-3); color: var(--text-2); font-size: 12px; margin: 1px 4px 1px 0; }
.kbd { font-family: var(--mono); font-size: 12.5px; padding: 2px 7px; border-radius: 6px; background: var(--surface-3); border: 1px solid var(--border); color: #6b4a26; }

/* Code ------------------------------------------------------------------------ */
.code-wrap { border-radius: 13px; overflow: hidden; background: #2d261e; box-shadow: 0 8px 22px rgba(45, 38, 30, .18); }
.code-bar { display: flex; align-items: center; justify-content: space-between; padding: 8px 10px 2px 14px; }
.code-bar .dots { display: flex; gap: 6px; }
.code-bar .dots i { width: 10px; height: 10px; border-radius: 50%; background: #d9786a; }
.code-bar .dots i:nth-child(2) { background: #e3b567; }
.code-bar .dots i:nth-child(3) { background: #8fbf7f; }
.copy-btn {
  height: 26px; padding: 0 9px; border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, .12); background: rgba(255, 255, 255, .06); color: #e8d6b8;
  font: inherit; font-size: 12px; cursor: pointer; display: inline-flex; align-items: center; gap: 5px;
}
.copy-btn:hover { background: rgba(255, 255, 255, .12); }
.code {
  margin: 0; color: #f2e5cd;
  padding: 8px 16px 14px;
  font-family: var(--mono); font-size: 12.8px; line-height: 1.65;
  overflow-x: auto; white-space: pre;
  scrollbar-color: #5c4d3c transparent; scrollbar-width: thin;
}
.code::-webkit-scrollbar { height: 8px; }
.code::-webkit-scrollbar-track { background: transparent; }
.code::-webkit-scrollbar-thumb { background: #5c4d3c; border-radius: 8px; }
.key-box {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; border-radius: 12px;
  background: #2d261e; color: #f6d9ad; font-family: var(--mono); font-size: 13.5px; word-break: break-all;
}
.key-box span { flex: 1; }

/* Callouts -------------------------------------------------------------------- */
.announce {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px 18px; margin-bottom: 16px; border-radius: 14px;
  background: linear-gradient(120deg, #fbeed9, #f6e2c4);
  border: 1px solid #ecd2ab; color: #6b4a22;
  white-space: pre-wrap;
}
.announce svg { flex: none; margin-top: 2px; color: var(--primary); }
.callout { padding: 12px 14px; border-radius: 12px; background: var(--warning-soft); color: #7b5a12; font-size: 13px; display: flex; gap: 8px; align-items: flex-start; }
.callout.info { background: var(--info-soft); color: #3d6178; }

/* Steps ----------------------------------------------------------------------- */
.steps { display: flex; flex-direction: column; gap: 14px; }
.step { display: flex; gap: 12px; }
.step-no {
  flex: none; width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center; font-size: 13px; font-weight: 700;
  background: var(--primary-soft); color: var(--primary-600);
}
.step b { display: block; font-size: 14px; margin-bottom: 2px; }
.step p { margin: 0; font-size: 13px; color: var(--text-2); }

/* Chart ----------------------------------------------------------------------- */
.chart { width: 100%; height: auto; display: block; }
.chart .grid { stroke: #efe4d1; stroke-dasharray: 3 4; }
.chart .axis { fill: var(--text-3); font-size: 11px; font-family: var(--font); }
.chart .bar-ok { fill: url(#gradOk); }
.chart .bar-fail { fill: #e9a996; }
.chart g.bar:hover rect { filter: brightness(1.06); }
.legend { display: flex; gap: 14px; font-size: 12.5px; color: var(--text-2); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

/* Solver cards ----------------------------------------------------------------- */
.solver-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; }
.solver { padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; }
.solver-head { display: flex; align-items: flex-start; gap: 12px; }
.solver-head .title { flex: 1; min-width: 0; }
.solver-head .title b { font-size: 15.5px; display: flex; align-items: center; gap: 8px; }
.solver-head .title .url { font-size: 12.5px; color: var(--text-3); font-family: var(--mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; background: #c9b89c; box-shadow: 0 0 0 3px rgba(201, 184, 156, .25); }
.status-dot.up { background: #5aa06a; box-shadow: 0 0 0 3px rgba(90, 160, 106, .2); }
.status-dot.down { background: #cf5a42; box-shadow: 0 0 0 3px rgba(207, 90, 66, .2); }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.metric { padding: 9px 10px; border-radius: 11px; background: var(--surface-2); border: 1px solid var(--border-soft); }
.metric .k { font-size: 11.5px; color: var(--text-3); }
.metric .v { font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
.load-row { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--text-2); }
.load-row .progress { flex: 1; }
.solver-error { font-size: 12px; color: var(--danger); background: var(--danger-soft); padding: 7px 10px; border-radius: 9px; word-break: break-word; }
.solver-actions { display: flex; gap: 6px; flex-wrap: wrap; border-top: 1px dashed var(--border); padding-top: 12px; }

/* Modal ----------------------------------------------------------------------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 50;
  display: grid; place-items: center; padding: 16px;
  background: rgba(46, 36, 25, .34); backdrop-filter: blur(3px);
  animation: fade .15s ease;
}
.modal {
  width: min(560px, 100%); max-height: calc(100vh - 32px);
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--surface); border: 1px solid var(--border); border-radius: 20px;
  box-shadow: var(--shadow-lg);
  animation: pop .2s cubic-bezier(.2, .9, .3, 1.15);
}
.modal.wide { width: min(760px, 100%); }
.modal-head { flex: none; display: flex; align-items: center; justify-content: space-between; padding: 18px 22px 12px; }
.modal-head h3 { font-size: 17px; }
.modal-body { flex: 1; min-height: 0; overflow-y: auto; padding: 6px 22px 18px; }
.modal-foot {
  flex: none; display: flex; justify-content: flex-end; gap: 10px;
  padding: 14px 22px 18px; border-top: 1px solid var(--border-soft); background: var(--surface-2);
}

/* Toasts ---------------------------------------------------------------------- */
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 70; display: flex; flex-direction: column; gap: 10px; align-items: flex-end; }
.toast {
  display: flex; align-items: center; gap: 9px; max-width: 380px;
  padding: 11px 15px; border-radius: 13px;
  background: #33291e; color: #fbf0de; font-size: 13.5px;
  box-shadow: var(--shadow-lg); animation: slide .2s ease;
}
.toast.success svg { color: #9fd3a6; }
.toast.error { background: #8e3625; }
.toast.error svg { color: #ffd2c5; }

/* Auth page ------------------------------------------------------------------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
.auth-hero {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 48px 56px; color: #3b2a16;
  background: linear-gradient(155deg, #f6e8d2 0%, #eed4ae 48%, #deb07a 100%);
}
.auth-hero .blob { position: absolute; border-radius: 50%; filter: blur(2px); }
.auth-hero .b1 { width: 420px; height: 420px; right: -120px; top: -120px; background: radial-gradient(circle at 30% 30%, rgba(255, 250, 240, .75), rgba(255, 250, 240, 0) 70%); }
.auth-hero .b2 { width: 360px; height: 360px; left: -110px; bottom: -130px; background: radial-gradient(circle at 60% 40%, rgba(181, 115, 58, .35), rgba(181, 115, 58, 0) 70%); }
.auth-hero .ring { position: absolute; right: 60px; bottom: 90px; width: 180px; height: 180px; border-radius: 50%; border: 1px solid rgba(120, 80, 30, .18); }
.auth-hero .ring.r2 { right: 20px; bottom: 50px; width: 260px; height: 260px; border-color: rgba(120, 80, 30, .1); }
.hero-brand { position: relative; display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: 17px; }
.hero-copy { position: relative; max-width: 520px; }
.hero-copy h1 { font-size: 40px; line-height: 1.18; font-weight: 800; letter-spacing: -.025em; }
.hero-copy h1 em { font-style: normal; background: linear-gradient(90deg, #a35f23, #7c4515); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-copy p { margin: 16px 0 26px; font-size: 15.5px; color: #6a4e2c; }
.hero-points { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.hero-points li {
  display: flex; align-items: center; gap: 12px; font-size: 14.5px;
  padding: 11px 14px; border-radius: 13px; width: fit-content;
  background: rgba(255, 251, 243, .55); border: 1px solid rgba(255, 255, 255, .6);
  backdrop-filter: blur(4px); box-shadow: 0 6px 18px rgba(120, 80, 30, .08);
}
.hero-points li svg { color: #9a5e2b; }
.hero-foot { position: relative; font-size: 12.5px; color: #7c5f3a; }
.auth-panel { display: grid; place-items: center; padding: 32px 20px; }
.auth-card { width: min(410px, 100%); }
.auth-card h2 { font-size: 26px; font-weight: 750; }
.auth-card > p { margin: 6px 0 22px; color: var(--text-2); }
.auth-card .segmented { margin-bottom: 20px; }
.auth-mobile-brand { display: none; }

/* Docs ------------------------------------------------------------------------ */
.doc h4 { font-size: 14.5px; margin: 20px 0 8px; display: flex; align-items: center; gap: 8px; }
.doc h4:first-child { margin-top: 0; }
.doc p { margin: 6px 0; color: var(--text-2); }
.method { font-family: var(--mono); font-size: 11.5px; font-weight: 700; padding: 2px 7px; border-radius: 6px; background: var(--success-soft); color: var(--success); }
.endpoint { font-family: var(--mono); font-size: 13.5px; }
.params td:first-child { font-family: var(--mono); color: #7a4c1f; white-space: nowrap; }

/* Misc ------------------------------------------------------------------------ */
.kv { display: grid; grid-template-columns: 120px 1fr; gap: 10px 14px; font-size: 13.5px; }
.kv dt { color: var(--text-3); }
.kv dd { margin: 0; font-weight: 550; word-break: break-all; }
.maintenance-bar { margin-bottom: 16px; }
.divider { height: 1px; background: var(--border-soft); margin: 4px 0; }
.list-codes { max-height: 300px; overflow: auto; }

/* Responsive ------------------------------------------------------------------ */
@media (max-width: 1100px) {
  .grid-2, .grid-2.even { grid-template-columns: minmax(0, 1fr); }
  .auth-hero { padding: 40px; }
  .hero-copy h1 { font-size: 32px; }
}
@media (max-width: 900px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; z-index: 45; width: 264px;
    background: var(--surface); transform: translateX(-102%); transition: transform .22s ease;
    box-shadow: var(--shadow-lg);
  }
  .sidebar.open { transform: none; }
  .scrim { display: block; position: fixed; inset: 0; z-index: 44; background: rgba(46, 36, 25, .3); }
  .mobile-only { display: inline-flex !important; }
  .main { padding: 16px 16px 40px; }
  .topbar { margin-bottom: 16px; }
  .page-title h1 { font-size: 19px; }
  .page-title p { display: none; }
  .user-chip .who { display: none; }
  .auth { grid-template-columns: minmax(0, 1fr); }
  .auth-hero { display: none; }
  .auth-mobile-brand { display: flex; align-items: center; gap: 10px; font-weight: 700; margin-bottom: 26px; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .grid-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .stat { padding: 14px 14px 13px; }
  .stat .value { font-size: 23px; margin-top: 8px; }
  .stat .sub { font-size: 11.5px; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .solver-grid { grid-template-columns: minmax(0, 1fr); }
  .filters .input, .filters .select { flex: 1; min-width: 120px; }
  .kv { grid-template-columns: 96px 1fr; }
}
