/* HexToDecimal.online — Design System & Component Stylesheet */
:root {
  --bg-page: #F8FAFC;
  --bg-surface: #FFFFFF;
  --bg-subtle: #F1F5F9;
  --bg-code: #0F172A;
  --bg-code-soft: #F8FAFC;
  --ink-primary: #0F172A;
  --ink-secondary: #334155;
  --ink-muted: #64748B;
  --border-light: #E2E8F0;
  --border-strong: #CBD5E1;
  --accent-blue: #2563EB;
  --accent-blue-hover: #1D4ED8;
  --accent-blue-soft: #EFF6FF;
  --accent-cyan: #0891B2;
  --accent-cyan-soft: #ECFEFF;
  --accent-teal: #0D9488;
  --accent-teal-soft: #F0FDFA;
  --danger: #DC2626;
  --danger-soft: #FEF2F2;
  --warn: #B45309;
  --warn-soft: #FFFBEB;
  --success: #047857;
  --success-soft: #ECFDF5;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 2px 6px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.07);
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Space Grotesk', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --container-max: 1180px;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink-primary);
  background-color: var(--bg-page);
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent-blue);
  text-decoration: none;
}
a:hover { text-decoration: underline; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--ink-primary);
  line-height: 1.25;
  letter-spacing: -0.02em;
  margin-top: 0;
}

code, pre, .mono {
  font-family: var(--font-mono);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent-blue);
  color: #fff;
  padding: 10px 16px;
  z-index: 9999;
  font-weight: 600;
}
.skip-link:focus { left: 12px; top: 12px; border-radius: var(--radius-sm); }

.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 20px;
}

/* Header & Navigation */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-light);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 66px;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--ink-primary);
  text-decoration: none;
  flex-shrink: 0;
}
.brand:hover { text-decoration: none; }
.brand-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--ink-primary);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 0.92rem;
  font-weight: 700;
  border: 1.5px solid var(--accent-blue);
}
.brand-badge span { color: #38BDF8; }
.brand-domain { color: var(--accent-blue); font-weight: 600; }

.main-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 11px;
  border-radius: var(--radius-sm);
  color: var(--ink-secondary);
  font-size: 0.92rem;
  font-weight: 500;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease;
}
.nav-link:hover, .nav-link.active {
  background: var(--accent-blue-soft);
  color: var(--accent-blue);
  text-decoration: none;
}

.nav-dropdown {
  position: relative;
}
.nav-dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 245px;
  padding: 8px;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  z-index: 200;
}
.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown:focus-within .nav-dropdown-menu,
.nav-dropdown.open .nav-dropdown-menu {
  display: block;
}
.nav-dropdown-menu a {
  display: block;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  color: var(--ink-secondary);
  font-size: 0.9rem;
  font-weight: 500;
}
.nav-dropdown-menu a:hover {
  background: var(--bg-subtle);
  color: var(--accent-blue);
  text-decoration: none;
}

.mobile-menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  color: var(--ink-primary);
  cursor: pointer;
}

.mobile-drawer {
  display: none;
  border-top: 1px solid var(--border-light);
  background: var(--bg-surface);
  padding: 16px 20px 24px;
}
.mobile-drawer.open { display: block; }
.mobile-nav-group {
  margin-bottom: 14px;
}
.mobile-nav-title {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
  margin: 0 0 6px;
}
.mobile-nav-links {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}
.mobile-nav-links a {
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: var(--bg-page);
  color: var(--ink-secondary);
  font-size: 0.9rem;
  font-weight: 500;
}
.mobile-nav-links a:hover {
  background: var(--accent-blue-soft);
  color: var(--accent-blue);
  text-decoration: none;
}

/* Breadcrumbs */
.breadcrumbs {
  padding: 16px 0 4px;
  font-size: 0.88rem;
  color: var(--ink-muted);
}
.breadcrumbs ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0;
  margin: 0;
}
.breadcrumbs li::after {
  content: "/";
  margin-left: 6px;
  color: var(--border-strong);
}
.breadcrumbs li:last-child::after { content: ""; margin: 0; }
.breadcrumbs a { color: var(--ink-muted); }
.breadcrumbs a:hover { color: var(--accent-blue); }

/* Hero Section */
.hero {
  padding: 32px 0 24px;
}
.hero-home {
  padding: 34px 0 24px;
  background: linear-gradient(180deg, #FFFFFF 0%, #F8FAFC 100%);
  border-bottom: 1px solid var(--border-light);
}
.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--accent-blue-soft);
  color: var(--accent-blue);
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 12px;
}
.hero h1 {
  font-size: clamp(1.75rem, 3.2vw, 2.55rem);
  font-weight: 700;
  margin-bottom: 12px;
  max-width: 880px;
}
.hero-lead {
  font-size: 1.06rem;
  color: var(--ink-secondary);
  max-width: 780px;
  margin: 0 0 18px;
}

.trust-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin: 0 0 22px;
  padding: 0;
  list-style: none;
}
.trust-strip li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.86rem;
  font-weight: 500;
  color: var(--ink-secondary);
}
.trust-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-teal);
  flex-shrink: 0;
}

/* Calculator Shell & Cards */
.calc-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  padding: 24px;
  margin-bottom: 24px;
}

.calc-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 14px;
  margin-bottom: 20px;
}
.tab-btn {
  padding: 8px 15px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  background: var(--bg-page);
  color: var(--ink-secondary);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}
.tab-btn:hover { border-color: var(--accent-blue); color: var(--accent-blue); }
.tab-btn.active {
  background: var(--accent-blue);
  border-color: var(--accent-blue);
  color: #FFFFFF;
}

.tab-panel { display: none; }
.tab-panel.active { display: block; }

.field-label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink-primary);
  margin-bottom: 8px;
}
.field-hint {
  font-size: 0.82rem;
  font-weight: 400;
  color: var(--ink-muted);
}

.input-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: stretch;
}

.calc-input, .calc-textarea, .calc-select {
  width: 100%;
  font-family: var(--font-mono);
  font-size: 1.08rem;
  padding: 13px 15px;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  color: var(--ink-primary);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.calc-select {
  font-family: var(--font-sans);
  font-size: 0.95rem;
  padding: 11px 14px;
  cursor: pointer;
}
.calc-input:focus, .calc-textarea:focus, .calc-select:focus {
  outline: none;
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}
.calc-textarea {
  min-height: 132px;
  resize: vertical;
  line-height: 1.5;
  font-size: 0.98rem;
}

.input-grow { flex: 1 1 280px; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 11px 18px;
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 0.93rem;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover { text-decoration: none; }
.btn-primary {
  background: var(--accent-blue);
  color: #FFFFFF;
}
.btn-primary:hover { background: var(--accent-blue-hover); color: #FFFFFF; }
.btn-secondary {
  background: var(--bg-subtle);
  border-color: var(--border-strong);
  color: var(--ink-primary);
}
.btn-secondary:hover { background: #E2E8F0; }
.btn-outline {
  background: var(--bg-surface);
  border-color: var(--border-strong);
  color: var(--ink-secondary);
}
.btn-outline:hover { border-color: var(--accent-blue); color: var(--accent-blue); }
.btn-sm {
  padding: 6px 11px;
  font-size: 0.82rem;
  border-radius: var(--radius-sm);
}

.sample-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin-top: 12px;
}
.sample-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink-muted);
  margin-right: 2px;
}
.sample-chip {
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border-light);
  background: var(--bg-page);
  color: var(--ink-secondary);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.14s ease;
}
.sample-chip:hover {
  border-color: var(--accent-blue);
  background: var(--accent-blue-soft);
  color: var(--accent-blue);
}

.options-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 20px;
  align-items: center;
  margin-top: 14px;
  padding: 12px 14px;
  background: var(--bg-page);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  font-size: 0.88rem;
}
.option-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  color: var(--ink-secondary);
  font-weight: 500;
}
.option-toggle input[type="checkbox"],
.option-toggle input[type="radio"] {
  accent-color: var(--accent-blue);
  width: 16px;
  height: 16px;
}

/* Validation / Alert Banners */
.alert-box {
  display: none;
  margin-top: 14px;
  padding: 12px 15px;
  border-radius: var(--radius-md);
  font-size: 0.92rem;
  font-weight: 500;
}
.alert-box.show { display: block; }
.alert-error {
  background: var(--danger-soft);
  border: 1px solid #FECACA;
  color: var(--danger);
}
.alert-warn {
  background: var(--warn-soft);
  border: 1px solid #FDE68A;
  color: var(--warn);
}
.alert-info {
  background: var(--accent-cyan-soft);
  border: 1px solid #A5F3FC;
  color: #155E75;
}

/* Primary Result Showcase */
.result-primary-box {
  margin-top: 20px;
  padding: 20px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, #0F172A 0%, #1E293B 100%);
  color: #FFFFFF;
}
.result-primary-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.result-primary-label {
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #94A3B8;
}
.result-primary-value {
  font-family: var(--font-mono);
  font-size: clamp(1.35rem, 2.8vw, 2.05rem);
  font-weight: 700;
  color: #FFFFFF;
  word-break: break-all;
  line-height: 1.3;
}
.result-primary-sub {
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  color: #38BDF8;
  word-break: break-all;
}

.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
.btn-dark-ghost {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #F8FAFC;
}
.btn-dark-ghost:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #FFFFFF;
}

/* Multi-Base Result Grid */
.result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 16px;
}
.result-tile {
  background: var(--bg-page);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
}
.result-tile-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.result-tile-label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-muted);
}
.result-tile-value {
  font-family: var(--font-mono);
  font-size: 1.02rem;
  font-weight: 600;
  color: var(--ink-primary);
  word-break: break-all;
}
.copy-mini {
  padding: 3px 8px;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 5px;
  border: 1px solid var(--border-light);
  background: var(--bg-surface);
  color: var(--ink-secondary);
  cursor: pointer;
}
.copy-mini:hover { border-color: var(--accent-blue); color: var(--accent-blue); }

.metrics-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.metric-pill {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  text-align: center;
}
.metric-pill .m-val {
  display: block;
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--accent-blue);
}
.metric-pill .m-lbl {
  font-size: 0.78rem;
  color: var(--ink-muted);
  font-weight: 500;
}

/* Step-by-Step Breakdown Panel */
.steps-panel {
  margin-top: 20px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  overflow: hidden;
}
.steps-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border-light);
}
.steps-header h3 {
  font-size: 1rem;
  margin: 0;
}
.steps-body {
  padding: 16px 18px;
}
.formula-line {
  font-family: var(--font-mono);
  font-size: 0.92rem;
  background: var(--bg-page);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  overflow-x: auto;
  margin: 0 0 14px;
  color: var(--ink-primary);
}

/* Nibble / Bit Visualizer Components */
.nibble-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 14px 0;
}
.nibble-card {
  min-width: 82px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  background: var(--bg-page);
  text-align: center;
}
.nibble-hex {
  font-family: var(--font-mono);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--accent-blue);
}
.nibble-arrow {
  font-size: 0.78rem;
  color: var(--ink-muted);
  margin: 2px 0;
}
.nibble-bin {
  font-family: var(--font-mono);
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--ink-primary);
  letter-spacing: 0.08em;
}
.nibble-dec {
  font-size: 0.75rem;
  color: var(--ink-muted);
  margin-top: 2px;
}

.byte-groups-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: 18px 0;
}
.byte-group {
  background: var(--bg-page);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 12px;
}
.byte-group-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ink-muted);
}
.byte-hex-badge {
  font-family: var(--font-mono);
  color: var(--accent-blue);
  background: var(--accent-blue-soft);
  padding: 2px 7px;
  border-radius: 4px;
}
.bits-row {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 5px;
}
.bit-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  padding: 7px 4px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border-strong);
  background: var(--bg-surface);
  color: var(--ink-muted);
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.12s ease;
}
.bit-btn:hover { border-color: var(--accent-blue); }
.bit-btn.is-on {
  background: var(--accent-blue);
  border-color: var(--accent-blue);
  color: #FFFFFF;
}
.bit-btn .bit-idx {
  font-size: 0.65rem;
  font-weight: 500;
  opacity: 0.75;
  margin-top: 2px;
}

/* Tables */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
}
table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}
table.data-table th,
table.data-table td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border-light);
}
table.data-table th {
  background: var(--bg-subtle);
  font-weight: 700;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-secondary);
}
table.data-table tbody tr:last-child td { border-bottom: none; }
table.data-table tbody tr:hover { background: #F8FAFC; }
tr.row-invalid { background: var(--danger-soft) !important; color: var(--danger); }

/* Sections & Cards */
.section {
  padding: 42px 0;
}
.section-alt {
  background: var(--bg-surface);
  border-top: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
}
.section-header {
  margin-bottom: 24px;
}
.section-header h2 {
  font-size: clamp(1.35rem, 2.3vw, 1.8rem);
  margin-bottom: 8px;
}
.section-header p {
  color: var(--ink-secondary);
  margin: 0;
  max-width: 720px;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}
.card-grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
  gap: 18px;
}
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-xs);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
  display: flex;
  flex-direction: column;
}
.card:hover {
  border-color: var(--accent-blue);
  box-shadow: var(--shadow-sm);
}
.card-tag {
  display: inline-block;
  align-self: flex-start;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--accent-blue-soft);
  color: var(--accent-blue);
  font-size: 0.75rem;
  font-weight: 700;
  margin-bottom: 10px;
}
.card-tag-teal {
  background: var(--accent-teal-soft);
  color: var(--accent-teal);
}
.card h3 {
  font-size: 1.08rem;
  margin-bottom: 8px;
}
.card h3 a { color: var(--ink-primary); }
.card h3 a:hover { color: var(--accent-blue); text-decoration: none; }
.card p {
  color: var(--ink-secondary);
  font-size: 0.93rem;
  margin: 0 0 14px;
  flex-grow: 1;
}
.card-cta {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--accent-blue);
}

/* Worked Visual Example Box */
.worked-example {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 22px;
}
.place-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin: 16px 0;
}
.place-card {
  background: var(--bg-page);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 14px;
  text-align: center;
}
.place-digit {
  font-family: var(--font-mono);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--accent-blue);
}
.place-power {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--ink-muted);
  margin: 4px 0;
}
.place-calc {
  font-family: var(--font-mono);
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--ink-primary);
}

/* Content Prose (Guides & Blog Articles) */
.prose {
  max-width: 820px;
}
.prose h2 {
  font-size: 1.5rem;
  margin: 30px 0 12px;
}
.prose h3 {
  font-size: 1.18rem;
  margin: 22px 0 10px;
}
.prose p {
  color: var(--ink-secondary);
  margin: 0 0 16px;
}
.prose ul, .prose ol {
  color: var(--ink-secondary);
  padding-left: 22px;
  margin: 0 0 16px;
}
.prose li { margin-bottom: 7px; }
.prose pre {
  background: var(--bg-code);
  color: #E2E8F0;
  padding: 16px 18px;
  border-radius: var(--radius-md);
  overflow-x: auto;
  font-size: 0.9rem;
  line-height: 1.55;
}
.prose code {
  background: var(--bg-subtle);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.9em;
  color: var(--ink-primary);
}
.prose pre code {
  background: transparent;
  padding: 0;
  color: inherit;
}
.callout {
  padding: 16px 18px;
  border-left: 4px solid var(--accent-blue);
  background: var(--accent-blue-soft);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  margin: 20px 0;
  color: var(--ink-primary);
}

/* FAQ Accordion */
.faq-list {
  display: grid;
  gap: 10px;
}
.faq-item {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.faq-item summary {
  padding: 16px 18px;
  font-weight: 600;
  color: var(--ink-primary);
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  font-family: var(--font-mono);
  font-size: 1.2rem;
  color: var(--accent-blue);
  flex-shrink: 0;
}
.faq-item[open] summary::after { content: "−"; }
.faq-answer {
  padding: 0 18px 16px;
  color: var(--ink-secondary);
  font-size: 0.95rem;
}

/* Two-Column Tool / Article Layout */
.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 32px;
  align-items: start;
}
.sidebar-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 18px;
  margin-bottom: 18px;
}
.sidebar-card h3 {
  font-size: 0.98rem;
  margin-bottom: 12px;
}
.sidebar-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
}
.sidebar-list a {
  display: block;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  color: var(--ink-secondary);
  font-size: 0.9rem;
}
.sidebar-list a:hover {
  background: var(--accent-blue-soft);
  color: var(--accent-blue);
  text-decoration: none;
}

/* Footer */
.site-footer {
  background: #0F172A;
  color: #CBD5E1;
  padding: 48px 0 28px;
  margin-top: 48px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr repeat(4, 1fr);
  gap: 28px;
  margin-bottom: 36px;
}
.footer-brand {
  color: #FFFFFF;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  margin-bottom: 10px;
  display: inline-block;
}
.footer-desc {
  font-size: 0.9rem;
  color: #94A3B8;
  margin: 0 0 14px;
}
.footer-col h4 {
  color: #FFFFFF;
  font-size: 0.88rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 12px;
}
.footer-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
}
.footer-col a {
  color: #94A3B8;
  font-size: 0.9rem;
}
.footer-col a:hover { color: #FFFFFF; text-decoration: none; }
.footer-bottom {
  border-top: 1px solid #1E293B;
  padding-top: 20px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.85rem;
  color: #94A3B8;
}

/* Toast Notification */
.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  background: var(--ink-primary);
  color: #FFFFFF;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 600;
  box-shadow: var(--shadow-md);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
  z-index: 999;
}
.toast.show { opacity: 1; transform: translateY(0); }

/* Responsive Breakpoints */
@media (max-width: 980px) {
  .main-nav { display: none; }
  .mobile-menu-btn { display: inline-flex; }
  .content-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .calc-card { padding: 16px; }
  .footer-grid { grid-template-columns: 1fr; }
  .bits-row { gap: 3px; }
  .bit-btn { min-width: 28px; padding: 6px 2px; font-size: 0.88rem; }
  .mobile-nav-links { grid-template-columns: 1fr; }
}

/* Print Styles */
@media print {
  .site-header, .site-footer, .sample-bar, .result-actions, .copy-mini, .mobile-menu-btn, .sidebar-card { display: none !important; }
  body { background: #FFFFFF; color: #000000; }
  .calc-card { box-shadow: none; border: 1px solid #CCCCCC; }
  .result-primary-box { background: #F1F5F9; color: #000000; border: 1px solid #000000; }
  .result-primary-value, .result-primary-sub { color: #000000; }
}
