/* ============================================================
   DYSUN TOOLS PLATFORM — Design System
   Brand: #FDC500 yellow · #111111 black · #36393D anthracite
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ── Custom Properties ── */
:root {
  --c-yellow:       #FDC500;
  --c-yellow-hover: #E8B400;
  --c-yellow-dim:   rgba(253,197,0,0.12);
  --c-yellow-glow:  rgba(253,197,0,0.25);

  --c-black:     #0A0A0A;
  --c-bg:        #111111;
  --c-surface-1: #161616;
  --c-surface-2: #1E1E1E;
  --c-surface-3: #262626;
  --c-surface-4: #303030;
  --c-anthracite:#36393D;

  --c-border:        rgba(255,255,255,0.07);
  --c-border-strong: rgba(255,255,255,0.14);
  --c-border-yellow: rgba(253,197,0,0.35);

  --c-text:      #F0F0F0;
  --c-text-soft: #B0B0B0;
  --c-text-muted:#707070;
  --c-text-dim:  #444444;

  --c-success:     #22C55E;
  --c-success-dim: rgba(34,197,94,0.12);
  --c-danger:      #EF4444;
  --c-danger-dim:  rgba(239,68,68,0.12);
  --c-info:        #3B82F6;
  --c-info-dim:    rgba(59,130,246,0.12);
  --c-warning:     #F59E0B;
  --c-warning-dim: rgba(245,158,11,0.12);

  --font:      'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'Fira Code', 'Consolas', 'Monaco', monospace;

  --r-sm:   6px;
  --r:      10px;
  --r-lg:   16px;
  --r-xl:   22px;
  --r-full: 9999px;

  --shadow-sm: 0 1px 4px rgba(0,0,0,0.5);
  --shadow:    0 4px 20px rgba(0,0,0,0.5);
  --shadow-lg: 0 10px 40px rgba(0,0,0,0.6);
  --shadow-yellow: 0 4px 24px rgba(253,197,0,0.15);

  --nav-h:       60px;
  --content-max: 1280px;
  --t:           0.16s ease;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  background: var(--c-bg);
  color: var(--c-text);
  line-height: 1.6;
  font-size: 15px;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--c-yellow); text-decoration: none; transition: opacity var(--t); }
a:hover { opacity: 0.8; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--c-surface-1); }
::-webkit-scrollbar-thumb { background: var(--c-surface-4); border-radius: var(--r-full); }
::-webkit-scrollbar-thumb:hover { background: var(--c-anthracite); }

/* ────────────────────────────────────────────
   NAVIGATION
──────────────────────────────────────────── */
.topnav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  background: rgba(10,10,10,0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--c-border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 32px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}
.nav-logo-mark {
  width: 32px;
  height: 32px;
  background: var(--c-yellow);
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 16px;
  color: var(--c-black);
  letter-spacing: -0.5px;
}
.nav-logo-text {
  font-size: 15px;
  font-weight: 700;
  color: var(--c-text);
  line-height: 1;
}
.nav-logo-sub {
  font-size: 10px;
  font-weight: 400;
  color: var(--c-text-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
}
.nav-link {
  padding: 6px 14px;
  border-radius: var(--r-full);
  font-size: 13px;
  font-weight: 500;
  color: var(--c-text-muted);
  text-decoration: none;
  transition: all var(--t);
  border: 1px solid transparent;
  white-space: nowrap;
}
.nav-link:hover {
  color: var(--c-text);
  background: var(--c-surface-2);
  opacity: 1;
}
.nav-link.active {
  color: var(--c-yellow);
  background: var(--c-yellow-dim);
  border-color: var(--c-border-yellow);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

.nav-badge {
  font-size: 11px;
  font-weight: 600;
  color: var(--c-yellow);
  background: var(--c-yellow-dim);
  border: 1px solid var(--c-border-yellow);
  padding: 3px 10px;
  border-radius: var(--r-full);
  letter-spacing: 0.04em;
}

/* Breadcrumb */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--c-text-muted);
  padding: 12px 24px;
  border-bottom: 1px solid var(--c-border);
  background: var(--c-surface-1);
}
.breadcrumb a { color: var(--c-text-muted); }
.breadcrumb a:hover { color: var(--c-yellow); }
.breadcrumb-sep { color: var(--c-text-dim); }
.breadcrumb-current { color: var(--c-text-soft); font-weight: 500; }

/* ────────────────────────────────────────────
   PAGE LAYOUT
──────────────────────────────────────────── */
.page {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 32px 24px 64px;
}
.page-wide {
  max-width: 1500px;
  margin: 0 auto;
  padding: 32px 24px 64px;
}
.page-narrow {
  max-width: 720px;
  margin: 0 auto;
  padding: 32px 24px 64px;
}

/* ────────────────────────────────────────────
   TYPOGRAPHY
──────────────────────────────────────────── */
.h1 { font-size: 32px; font-weight: 800; line-height: 1.2; letter-spacing: -0.5px; }
.h2 { font-size: 24px; font-weight: 700; line-height: 1.3; letter-spacing: -0.3px; }
.h3 { font-size: 18px; font-weight: 600; line-height: 1.4; }
.h4 { font-size: 15px; font-weight: 600; line-height: 1.4; }
.text-sm  { font-size: 13px; }
.text-xs  { font-size: 11px; letter-spacing: 0.02em; }
.text-muted  { color: var(--c-text-muted); }
.text-soft   { color: var(--c-text-soft); }
.text-yellow { color: var(--c-yellow); }
.text-success { color: var(--c-success); }
.text-danger  { color: var(--c-danger); }

.section-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--c-yellow);
  margin-bottom: 8px;
}

/* ────────────────────────────────────────────
   HERO / PAGE HEADER
──────────────────────────────────────────── */
.page-hero {
  padding: 48px 0 36px;
  border-bottom: 1px solid var(--c-border);
  margin-bottom: 36px;
}
.page-hero .section-label { margin-bottom: 12px; }
.page-hero h1 {
  font-size: 36px;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.6px;
  margin-bottom: 12px;
}
.page-hero h1 .accent { color: var(--c-yellow); }
.page-hero p {
  font-size: 16px;
  color: var(--c-text-soft);
  max-width: 600px;
  line-height: 1.7;
}

/* ────────────────────────────────────────────
   CARDS
──────────────────────────────────────────── */
.card {
  background: var(--c-surface-1);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: 24px;
  transition: border-color var(--t), box-shadow var(--t);
}
.card:hover { border-color: var(--c-border-strong); }
.card.yellow-glow:hover {
  border-color: var(--c-border-yellow);
  box-shadow: var(--shadow-yellow);
}
.card-sm  { padding: 16px; border-radius: var(--r); }
.card-lg  { padding: 32px; border-radius: var(--r-xl); }
.card-flat { background: var(--c-surface-2); border-color: var(--c-border); }

.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 12px;
}
.card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--c-text);
}
.card-subtitle {
  font-size: 13px;
  color: var(--c-text-muted);
  margin-top: 2px;
}

/* ────────────────────────────────────────────
   PORTAL CARDS (big clickable cards)
──────────────────────────────────────────── */
.portal-card {
  background: var(--c-surface-1);
  border: 1px solid var(--c-border);
  border-radius: var(--r-xl);
  padding: 36px 32px;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: all var(--t);
  position: relative;
  overflow: hidden;
}
.portal-card::after {
  content: '';
  position: absolute;
  bottom: 0; right: 0;
  width: 120px; height: 120px;
  background: radial-gradient(circle at 100% 100%, var(--c-yellow-glow), transparent 70%);
  pointer-events: none;
}
.portal-card:hover {
  border-color: var(--c-border-yellow);
  box-shadow: var(--shadow-yellow);
  transform: translateY(-2px);
  opacity: 1;
}
.portal-card-icon {
  width: 48px;
  height: 48px;
  background: var(--c-yellow-dim);
  border: 1px solid var(--c-border-yellow);
  border-radius: var(--r);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}
.portal-card-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--c-text);
}
.portal-card-desc {
  font-size: 14px;
  color: var(--c-text-muted);
  line-height: 1.6;
}
.portal-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--c-border);
  font-size: 12px;
  color: var(--c-text-dim);
}
.portal-card-arrow {
  margin-left: auto;
  color: var(--c-yellow);
  font-size: 18px;
}

/* ────────────────────────────────────────────
   TOOL CARDS (smaller tool links in a grid)
──────────────────────────────────────────── */
.tool-card {
  background: var(--c-surface-2);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: 20px;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: all var(--t);
}
.tool-card:hover {
  border-color: var(--c-border-yellow);
  background: var(--c-surface-3);
  transform: translateY(-1px);
  opacity: 1;
}
.tool-card-type {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--c-yellow);
}
.tool-card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--c-text);
  line-height: 1.3;
}
.tool-card-desc {
  font-size: 13px;
  color: var(--c-text-muted);
  line-height: 1.5;
}

/* ────────────────────────────────────────────
   STAT BLOCKS
──────────────────────────────────────────── */
.stat {
  background: var(--c-surface-2);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: 20px;
}
.stat-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--c-text-muted);
  margin-bottom: 6px;
}
.stat-value {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--c-text);
  line-height: 1;
}
.stat-value.yellow { color: var(--c-yellow); }
.stat-sub {
  font-size: 12px;
  color: var(--c-text-muted);
  margin-top: 4px;
}

/* ────────────────────────────────────────────
   BUTTONS
──────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--r);
  font-size: 14px;
  font-weight: 600;
  border: 1px solid transparent;
  transition: all var(--t);
  text-decoration: none;
  white-space: nowrap;
  user-select: none;
}
.btn:hover { opacity: 1; }
.btn-sm  { padding: 7px 14px; font-size: 13px; }
.btn-lg  { padding: 14px 28px; font-size: 16px; }
.btn-icon { padding: 8px; border-radius: var(--r-sm); }

.btn-primary {
  background: var(--c-yellow);
  color: var(--c-black);
  border-color: var(--c-yellow);
}
.btn-primary:hover {
  background: var(--c-yellow-hover);
  border-color: var(--c-yellow-hover);
  box-shadow: var(--shadow-yellow);
}

.btn-secondary {
  background: var(--c-surface-3);
  color: var(--c-text);
  border-color: var(--c-border-strong);
}
.btn-secondary:hover {
  background: var(--c-surface-4);
}

.btn-ghost {
  background: transparent;
  color: var(--c-text-soft);
  border-color: var(--c-border);
}
.btn-ghost:hover {
  background: var(--c-surface-2);
  color: var(--c-text);
}

.btn-danger {
  background: var(--c-danger-dim);
  color: var(--c-danger);
  border-color: rgba(239,68,68,0.25);
}
.btn-danger:hover {
  background: rgba(239,68,68,0.2);
}

/* ────────────────────────────────────────────
   BADGES
──────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: var(--r-full);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
}
.badge-yellow  { background: var(--c-yellow-dim); color: var(--c-yellow); border: 1px solid var(--c-border-yellow); }
.badge-success { background: var(--c-success-dim); color: var(--c-success); border: 1px solid rgba(34,197,94,0.25); }
.badge-danger  { background: var(--c-danger-dim); color: var(--c-danger); border: 1px solid rgba(239,68,68,0.25); }
.badge-info    { background: var(--c-info-dim); color: var(--c-info); border: 1px solid rgba(59,130,246,0.25); }
.badge-warning { background: var(--c-warning-dim); color: var(--c-warning); border: 1px solid rgba(245,158,11,0.25); }
.badge-ghost   { background: var(--c-surface-3); color: var(--c-text-muted); border: 1px solid var(--c-border); }
.badge-installer { background: rgba(59,130,246,0.1); color: #60A5FA; border: 1px solid rgba(59,130,246,0.25); }
.badge-internal  { background: rgba(168,85,247,0.1); color: #C084FC; border: 1px solid rgba(168,85,247,0.25); }

/* ────────────────────────────────────────────
   FORMS
──────────────────────────────────────────── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.form-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--c-text-soft);
}
.form-hint {
  font-size: 12px;
  color: var(--c-text-muted);
}
.form-input, .form-select, .form-textarea {
  background: var(--c-surface-2);
  border: 1px solid var(--c-border-strong);
  border-radius: var(--r);
  padding: 10px 14px;
  font-size: 14px;
  color: var(--c-text);
  transition: border-color var(--t);
  width: 100%;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--c-yellow);
  box-shadow: 0 0 0 3px var(--c-yellow-dim);
}
.form-input::placeholder { color: var(--c-text-dim); }
.form-select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23707070' d='M6 8L0 0h12z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px; }
.form-textarea { resize: vertical; min-height: 80px; }

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

/* Input with unit suffix */
.input-wrap { position: relative; }
.input-wrap .input-unit {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  color: var(--c-text-muted);
  pointer-events: none;
}
.input-wrap .form-input { padding-right: 44px; }

/* Option buttons (toggle) */
.option-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.option-btn {
  padding: 8px 16px;
  border-radius: var(--r);
  border: 1px solid var(--c-border-strong);
  background: var(--c-surface-2);
  color: var(--c-text-soft);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--t);
}
.option-btn:hover {
  border-color: var(--c-border-yellow);
  color: var(--c-text);
}
.option-btn.selected {
  background: var(--c-yellow-dim);
  border-color: var(--c-yellow);
  color: var(--c-yellow);
  font-weight: 600;
}

/* Range input */
input[type="range"] {
  -webkit-appearance: none;
  width: 100%;
  height: 4px;
  border-radius: 2px;
  background: var(--c-surface-4);
  outline: none;
  cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--c-yellow);
  border: 2px solid var(--c-black);
  cursor: pointer;
}

/* ────────────────────────────────────────────
   TABLES
──────────────────────────────────────────── */
.table-wrap { overflow-x: auto; border-radius: var(--r-lg); border: 1px solid var(--c-border); }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
thead th {
  background: var(--c-surface-2);
  padding: 10px 14px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--c-text-muted);
  border-bottom: 1px solid var(--c-border);
  white-space: nowrap;
}
tbody tr { border-bottom: 1px solid var(--c-border); }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--c-surface-2); }
tbody td {
  padding: 12px 14px;
  color: var(--c-text);
  vertical-align: top;
}
tfoot td {
  padding: 12px 14px;
  font-weight: 700;
  border-top: 1px solid var(--c-border-strong);
  background: var(--c-surface-2);
  color: var(--c-yellow);
}
.td-right { text-align: right; }
.td-mono  { font-family: var(--font-mono); font-size: 13px; }
.td-label { color: var(--c-text-soft); font-weight: 500; }

/* ────────────────────────────────────────────
   CALLOUT BOXES
──────────────────────────────────────────── */
.callout {
  padding: 14px 16px;
  border-radius: var(--r);
  border-left: 3px solid;
  font-size: 14px;
  line-height: 1.6;
}
.callout strong { font-weight: 600; display: block; margin-bottom: 4px; }
.callout-info    { background: var(--c-info-dim);    border-color: var(--c-info);    color: #93C5FD; }
.callout-warning { background: var(--c-warning-dim); border-color: var(--c-warning); color: #FCD34D; }
.callout-danger  { background: var(--c-danger-dim);  border-color: var(--c-danger);  color: #FCA5A5; }
.callout-success { background: var(--c-success-dim); border-color: var(--c-success); color: #86EFAC; }
.callout-yellow  { background: var(--c-yellow-dim);  border-color: var(--c-yellow);  color: var(--c-yellow); }

/* ────────────────────────────────────────────
   DIVIDERS & SPACING
──────────────────────────────────────────── */
.divider {
  border: none;
  border-top: 1px solid var(--c-border);
  margin: 24px 0;
}
.section-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--c-text-muted);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--c-border);
}

/* ────────────────────────────────────────────
   STEP WIZARD
──────────────────────────────────────────── */
.step-nav {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 32px;
}
.step-item {
  display: flex;
  align-items: center;
  flex: 1;
  gap: 0;
}
.step-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--c-border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--c-text-muted);
  background: var(--c-surface-2);
  flex-shrink: 0;
  transition: all var(--t);
  z-index: 1;
}
.step-dot.active {
  background: var(--c-yellow);
  border-color: var(--c-yellow);
  color: var(--c-black);
}
.step-dot.done {
  background: var(--c-success-dim);
  border-color: var(--c-success);
  color: var(--c-success);
}
.step-line {
  flex: 1;
  height: 2px;
  background: var(--c-border);
  margin: 0 -1px;
}
.step-line.done { background: var(--c-success); }

/* ────────────────────────────────────────────
   TAB NAVIGATION
──────────────────────────────────────────── */
.tabs {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--c-border);
  margin-bottom: 24px;
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab-btn {
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 500;
  color: var(--c-text-muted);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all var(--t);
  white-space: nowrap;
  margin-bottom: -1px;
}
.tab-btn:hover { color: var(--c-text); }
.tab-btn.active {
  color: var(--c-yellow);
  border-bottom-color: var(--c-yellow);
}
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ────────────────────────────────────────────
   MANUAL / DOCUMENTATION STYLES
──────────────────────────────────────────── */
.doc-section {
  margin-bottom: 32px;
}
.doc-h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--c-text);
  padding-bottom: 10px;
  border-bottom: 2px solid var(--c-yellow);
  margin-bottom: 16px;
}
.doc-h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--c-text-soft);
  margin: 20px 0 10px;
}
.doc-p {
  font-size: 14px;
  color: var(--c-text-soft);
  line-height: 1.75;
  margin-bottom: 12px;
}
.doc-ul {
  list-style: none;
  padding: 0;
  margin: 0 0 12px;
}
.doc-ul li {
  padding: 5px 0 5px 20px;
  font-size: 14px;
  color: var(--c-text-soft);
  line-height: 1.6;
  position: relative;
}
.doc-ul li::before {
  content: '▸';
  position: absolute;
  left: 0;
  color: var(--c-yellow);
  font-size: 10px;
  top: 8px;
}
.doc-ol {
  padding-left: 20px;
  margin: 0 0 12px;
}
.doc-ol li {
  padding: 4px 0;
  font-size: 14px;
  color: var(--c-text-soft);
  line-height: 1.6;
}
.doc-ol li::marker { color: var(--c-yellow); font-weight: 700; }

pre, .code-block {
  background: #0D1117;
  border: 1px solid var(--c-border);
  border-radius: var(--r);
  padding: 16px;
  font-family: var(--font-mono);
  font-size: 13px;
  overflow-x: auto;
  color: #E6EDF3;
  margin: 12px 0;
}
code {
  font-family: var(--font-mono);
  font-size: 13px;
  background: var(--c-surface-3);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--c-yellow);
}

/* Doc sidebar TOC */
.doc-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 32px;
  align-items: start;
}
.doc-toc {
  position: sticky;
  top: calc(var(--nav-h) + 16px);
  background: var(--c-surface-1);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: 20px;
}
.doc-toc-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--c-text-muted);
  margin-bottom: 12px;
}
.doc-toc-link {
  display: block;
  padding: 5px 8px;
  font-size: 13px;
  color: var(--c-text-muted);
  border-radius: var(--r-sm);
  transition: all var(--t);
  text-decoration: none;
}
.doc-toc-link:hover {
  background: var(--c-surface-2);
  color: var(--c-text);
  opacity: 1;
}
.doc-toc-link.active {
  background: var(--c-yellow-dim);
  color: var(--c-yellow);
}

/* ────────────────────────────────────────────
   GRID UTILITIES
──────────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.grid-auto-sm { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }

.flex  { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-1 { gap: 4px; } .gap-2 { gap: 8px; } .gap-3 { gap: 12px; }
.gap-4 { gap: 16px; } .gap-6 { gap: 24px; }
.items-center { align-items: center; }
.ml-auto { margin-left: auto; }
.w-full { width: 100%; }

/* ────────────────────────────────────────────
   RESULT / OUTPUT BOXES
──────────────────────────────────────────── */
.result-panel {
  background: linear-gradient(135deg, var(--c-surface-2), var(--c-surface-1));
  border: 1px solid var(--c-border-yellow);
  border-radius: var(--r-xl);
  padding: 28px;
}
.result-big {
  font-size: 44px;
  font-weight: 800;
  color: var(--c-yellow);
  letter-spacing: -1px;
  line-height: 1;
}
.result-label {
  font-size: 13px;
  color: var(--c-text-muted);
  margin-bottom: 4px;
}

/* Totals breakdown */
.totals-list { display: flex; flex-direction: column; gap: 0; }
.totals-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px dashed var(--c-border);
  font-size: 14px;
  color: var(--c-text-soft);
}
.totals-row:last-child { border-bottom: none; }
.totals-row.total {
  font-size: 18px;
  font-weight: 700;
  color: var(--c-text);
  border-top: 1px solid var(--c-border-strong);
  border-bottom: none;
  padding-top: 14px;
}
.totals-row.total .totals-value { color: var(--c-yellow); }

/* ────────────────────────────────────────────
   FOOTER
──────────────────────────────────────────── */
.footer {
  border-top: 1px solid var(--c-border);
  padding: 24px;
  text-align: center;
  font-size: 12px;
  color: var(--c-text-muted);
  margin-top: 64px;
}
.footer a { color: var(--c-text-muted); }
.footer a:hover { color: var(--c-yellow); }

/* ────────────────────────────────────────────
   PRINT
──────────────────────────────────────────── */
@media print {
  .topnav, .breadcrumb, .no-print { display: none !important; }
  body { background: white; color: black; font-size: 12pt; }
  .card, .result-panel { border: 1px solid #ccc; background: white; box-shadow: none; }
  .c-yellow, .text-yellow { color: #000 !important; }
  .print-only { display: block !important; }
}
.print-only { display: none; }

/* ────────────────────────────────────────────
   RESPONSIVE
──────────────────────────────────────────── */
@media (max-width: 1024px) {
  .doc-layout { grid-template-columns: 1fr; }
  .doc-toc { display: none; }
}
@media (max-width: 768px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .topnav { padding: 0 16px; gap: 16px; }
  .nav-links { gap: 2px; }
  .nav-link { padding: 5px 10px; font-size: 12px; }
  .page, .page-wide, .page-narrow { padding: 24px 16px 48px; }
  .page-hero h1 { font-size: 26px; }
  .portal-card { padding: 24px 20px; }
}
@media (max-width: 480px) {
  .nav-links .nav-link:not(.active) { display: none; }
}
