/* Shared styling for Flesh and Blood pages */
html.fab-page {
  color-scheme: dark;
}

html.fab-page body {
  margin: 0;
  background: var(--bg);
  background-image: var(--bg-glow);
  background-attachment: fixed;
  color: var(--ink);
  font-family:
    "Segoe UI",
    system-ui,
    -apple-system,
    Roboto,
    Helvetica,
    Arial,
    "Apple Color Emoji",
    "Segoe UI Emoji";
  line-height: 1.45;
}

html.fab-page *,
html.fab-page *::before,
html.fab-page *::after {
  box-sizing: border-box;
}

html.fab-page a {
  color: var(--accent);
}

html.fab-page a:hover,
html.fab-page a:focus-visible {
  color: var(--accent-crimson);
}

html.fab-page
  :is(
    .btn,
    button,
    .global-nav .nav-link,
    .global-nav .nav-submenu a,
    .tool-cta
  ) {
  text-decoration: none;
}

html.fab-page :is(a, button, input, select, textarea, summary):focus-visible {
  outline: 2px solid var(--focus-outline-strong);
  outline-offset: 2px;
}

/* Shared global chrome across FAB pages */
html.fab-page :is(.site-header, .site-footer, body > header, body > footer) {
  background: linear-gradient(
    160deg,
    rgba(16, 7, 7, 0.95),
    rgba(10, 4, 4, 0.9)
  );
  border-block: 1px solid rgba(216, 161, 81, 0.22);
  box-shadow: 0 20px 48px rgba(8, 3, 3, 0.42);
}

html.fab-page .site-header .site-header-main {
  background:
    linear-gradient(162deg, rgba(24, 10, 10, 0.95), rgba(12, 5, 5, 0.92)),
    radial-gradient(
      circle at 78% -20%,
      rgba(180, 35, 40, 0.28),
      transparent 62%
    );
}

html.fab-page .site-header .global-nav .nav-link,
html.fab-page .site-header .site-nav-toggle {
  color: var(--fab-parchment, #f8e7c0);
  border: 1px solid transparent;
  transition:
    color 0.25s ease,
    border-color 0.25s ease,
    background-color 0.25s ease,
    box-shadow 0.25s ease;
  border-color: rgba(180, 35, 40, 0.72);
  background: linear-gradient(
    135deg,
    rgba(125, 17, 19, 0.38),
    rgba(58, 4, 6, 0.32)
  );
  box-shadow:
    inset 0 0 0 1px rgba(216, 161, 81, 0.22),
    0 10px 20px rgba(8, 3, 3, 0.34);
}

html.fab-page .site-header .global-nav .nav-link:hover,
html.fab-page .site-header .global-nav .nav-link:focus-visible,
html.fab-page .site-header .site-nav-toggle:hover,
html.fab-page .site-header .site-nav-toggle:focus-visible,
html.fab-page .site-header.nav-open .site-nav-toggle {
  border-color: rgba(216, 161, 81, 0.82);
  background: linear-gradient(
    135deg,
    rgba(153, 23, 27, 0.48),
    rgba(74, 8, 10, 0.4)
  );
}

html.fab-page .site-header .global-nav .nav-submenu {
  background: rgba(24, 10, 10, 0.96);
  border: 1px solid rgba(216, 161, 81, 0.35);
  box-shadow: 0 18px 40px rgba(8, 3, 3, 0.45);
}

html.fab-page .site-header .global-nav .nav-submenu a {
  color: var(--fab-parchment, #f8e7c0);
}

html.fab-page .site-header .global-nav .nav-submenu a:hover,
html.fab-page .site-header .global-nav .nav-submenu a:focus-visible {
  border-color: rgba(216, 161, 81, 0.6);
}

@media (min-width: 721px) {
  html.fab-page .site-header .site-nav-toggle {
    display: none !important;
  }
}

/* ===== EV Calculator styling ===== */
html.fab-ev {
  --fab-crimson: #7d1113;
  --fab-crimson-light: #b42328;
  --fab-crimson-dark: #3a0406;
  --fab-umber: #2d1611;
  --fab-bronze: #d8a151;
  --fab-parchment: #f8e7c0;
  --bg: #060202;
  --bg-glow:
    radial-gradient(
      circle at 16% -18%,
      rgba(180, 35, 40, 0.32),
      transparent 64%
    ),
    radial-gradient(
      circle at 82% -20%,
      rgba(125, 17, 19, 0.32),
      transparent 60%
    ),
    radial-gradient(
      circle at 86% 12%,
      rgba(216, 161, 81, 0.28),
      transparent 60%
    ),
    linear-gradient(180deg, #080303 0%, #120705 52%, #050202 100%);
  --panel: #1a0d0b;
  --panel2: #241312;
  --panel3: rgba(51, 23, 18, 0.68);
  --ink: #f6ede3;
  --muted: #dfd0c5;
  --accent: var(--fab-bronze);
  --accent-soft: rgba(216, 161, 81, 0.18);
  --accent-crimson: var(--fab-crimson-light);
  --surface-border-muted: rgba(216, 161, 81, 0.38);
  --focus-outline-strong: rgba(216, 161, 81, 0.9);
  --radius-pill: 999px;
  --radius-control: 12px;
  --space-inline-control: 12px;
  --space-stack-control: 14px;
  --border: 1px solid var(--surface-border-muted);
  --border-crimson: 1px solid rgba(180, 35, 40, 0.56);
  --radius: 12px;
  --gap: 16px;
  --pad: 18px;
  --ctrl-h: 44px;
  --green-bg: rgba(31, 140, 92, 0.22);
  --green-bd: rgba(97, 214, 160, 0.5);
  --red-bg: rgba(196, 70, 86, 0.22);
  --red-bd: rgba(236, 110, 128, 0.5);
  --btn: linear-gradient(124deg, rgba(71, 18, 18, 0.95), rgba(41, 9, 9, 0.9));
  --btnH: linear-gradient(
    124deg,
    rgba(102, 24, 27, 0.98),
    rgba(54, 14, 16, 0.94)
  );
}

html.fab-ev h1 {
  margin: 6px 0;
  font-size: 1.64rem;
  letter-spacing: 1.2px;
  font-weight: 760;
  color: var(--fab-parchment);
  text-transform: uppercase;
  text-shadow: 0 0 28px rgba(216, 161, 81, 0.32);
}

html.fab-ev .sub {
  color: var(--muted);
  font-size: 0.97rem;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  align-items: center;
}

html.fab-ev .pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  border: var(--border-crimson);
  background: linear-gradient(
    130deg,
    rgba(48, 18, 14, 0.92),
    rgba(78, 24, 22, 0.74)
  );
  color: var(--fab-parchment);
  font-size: 0.78rem;
  margin-right: 6px;
  box-shadow: 0 6px 24px rgba(18, 6, 6, 0.55);
}

/* Calculator pages now omit the intro/meta pill chips for a cleaner header. */
html.fab-ev .pill {
  display: none;
}

html.fab-ev .notice {
  margin: 10px 0 0;
  padding: var(--space-sm, 12px) var(--space-stack-control);
  border-radius: var(--radius-control);
  font-size: 0.92rem;
  font-weight: 520;
  background: rgba(78, 18, 18, 0.48);
  border: 1px solid rgba(180, 35, 40, 0.55);
  color: #ffdede;
  box-shadow: 0 16px 36px rgba(16, 6, 6, 0.68);
}

html.fab-ev .notice.yellow {
  background: rgba(255, 214, 0, 0.16);
  color: #fff0a6;
  border: 1px solid var(--surface-border-muted);
}

html.fab-ev .wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 18px 16px 36px;
}

html.fab-ev .card {
  background:
    linear-gradient(162deg, rgba(42, 18, 16, 0.94), rgba(20, 7, 7, 0.9)),
    radial-gradient(
      circle at 78% -30%,
      rgba(180, 35, 40, 0.32),
      transparent 60%
    ),
    linear-gradient(208deg, rgba(125, 17, 19, 0.2), transparent 62%),
    repeating-linear-gradient(
      135deg,
      rgba(16, 6, 5, 0.62) 0,
      rgba(16, 6, 5, 0.62) 18px,
      rgba(46, 18, 14, 0.32) 18px,
      rgba(46, 18, 14, 0.32) 36px
    );
  background-blend-mode: screen, screen, lighten;
  border: var(--border);
  border-radius: 20px;
  padding: var(--pad);
  box-shadow: 0 24px 58px rgba(10, 3, 3, 0.68);
  position: relative;
  overflow: hidden;
}

html.fab-ev .card::before {
  content: "";
  position: absolute;
  inset: -160px 48% 42% -120px;
  background: radial-gradient(
    circle,
    rgba(216, 161, 81, 0.26),
    transparent 74%
  );
  transform: rotate(9deg);
  pointer-events: none;
}

html.fab-ev .card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border: var(--border-crimson);
  opacity: 0.34;
  pointer-events: none;
}

html.fab-ev .card > * {
  position: relative;
  z-index: 1;
}

html.fab-ev .settings {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--gap);
}

html.fab-ev .section {
  background:
    linear-gradient(154deg, rgba(32, 14, 12, 0.94), rgba(26, 11, 10, 0.82)),
    radial-gradient(
      circle at 12% -16%,
      rgba(180, 35, 40, 0.26),
      transparent 62%
    ),
    linear-gradient(214deg, rgba(125, 17, 19, 0.18), transparent 68%);
  background-blend-mode: screen, screen;
  border: var(--border);
  border-radius: 16px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 14px 36px rgba(12, 4, 4, 0.6);
}

html.fab-ev .section h3 {
  margin: 0;
  font-size: 1.05rem;
  letter-spacing: 0.42px;
  text-transform: uppercase;
  color: var(--fab-parchment);
  text-shadow: 0 0 18px rgba(216, 161, 81, 0.28);
}

html.fab-ev .form-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

html.fab-ev label {
  font-weight: 600;
  letter-spacing: 0.2px;
}

html.fab-ev input[type="number"],
html.fab-ev select {
  height: var(--ctrl-h);
  padding: 0 12px;
  border-radius: var(--radius-control);
  border: var(--border);
  background: var(--panel3);
  color: var(--ink);
  font: inherit;
  box-sizing: border-box;
  box-shadow: inset 0 0 0 1px rgba(216, 161, 81, 0.16);
  transition:
    box-shadow 0.2s ease,
    border-color 0.2s ease;
}

html.fab-ev input[type="number"] {
  -moz-appearance: textfield;
}

html.fab-ev input[type="number"]::-webkit-inner-spin-button,
html.fab-ev input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

html.fab-ev input[type="number"]:focus,
html.fab-ev select:focus {
  outline: none;
  border-color: rgba(216, 161, 81, 0.68);
  box-shadow: 0 0 0 3px rgba(216, 161, 81, 0.32);
}

html.fab-ev button,
html.fab-ev .btn {
  padding: 0 18px;
  border: var(--border-crimson);
  background: var(--btn);
  color: var(--ink);
  font: inherit;
  cursor: pointer;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  letter-spacing: 0.22px;
  box-shadow: 0 14px 34px rgba(44, 10, 10, 0.58);
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    background 0.2s ease,
    border-color 0.2s ease;
}

html.fab-ev button:hover,
html.fab-ev .btn:hover {
  background: var(--btnH);
  border-color: rgba(216, 161, 81, 0.65);
  transform: translateY(-1px);
  box-shadow: 0 20px 46px rgba(54, 14, 14, 0.68);
}

html.fab-ev .input-stepper {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}

html.fab-ev .input-stepper input[type="number"] {
  flex: 1;
  min-width: 0;
}

html.fab-ev .input-stepper .stepper-btn {
  width: 44px;
  min-width: 44px;
  height: calc(var(--ctrl-h) - 6px);
  padding: 0;
  font-size: 1.3rem;
  font-weight: 640;
  line-height: 1;
  justify-content: center;
  gap: 0;
}

html.fab-ev .input-stepper .stepper-btn::after {
  display: none;
}

html.fab-ev .input-stepper .stepper-btn:focus-visible {
  transform: none;
  box-shadow: 0 0 0 2px rgba(216, 161, 81, 0.45);
  outline: none;
}

html.fab-ev .mini {
  font-size: 0.95rem;
}

html.fab-ev .summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap);
  margin-top: 18px;
}

html.fab-ev .summary.summary-single-table {
  grid-template-columns: 1fr;
}

html.fab-ev .calc-page .summary-grid .box {
  background: var(--panel3);
}

html.fab-ev .sim-chart {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 10px;
}

html.fab-ev .sim-chart-wrap {
  width: 100%;
  height: 220px;
  background: linear-gradient(
    150deg,
    rgba(45, 22, 17, 0.92),
    rgba(20, 9, 8, 0.9)
  );
  border: 1px solid rgba(216, 161, 81, 0.35);
  border-radius: 14px;
  padding: 10px;
  position: relative;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
}

html.fab-ev .sim-chart-wrap::before {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: var(--radius-control);
  border: 1px solid rgba(125, 17, 19, 0.4);
  pointer-events: none;
}

html.fab-ev .sim-chart-wrap canvas {
  width: 100%;
  height: 100%;
  display: block;
}

html.fab-ev .sim-chart-tooltip {
  position: absolute;
  pointer-events: none;
  background: rgba(18, 8, 6, 0.96);
  border: 1px solid rgba(216, 161, 81, 0.45);
  color: var(--fab-parchment);
  padding: 6px 10px;
  border-radius: 10px;
  font-size: 0.78rem;
  line-height: 1.25;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.4);
  opacity: 0;
  transform: translateY(6px);
  transition:
    opacity 0.15s ease,
    transform 0.15s ease;
}

html.fab-ev .sim-chart-tooltip[data-visible="true"] {
  opacity: 1;
  transform: translateY(0);
}

html.fab-ev table {
  width: 100%;
  border-collapse: collapse;
}

html.fab-ev .mini th,
html.fab-ev .mini td {
  border: 1px solid rgba(216, 161, 81, 0.35);
  padding: 10px var(--space-inline-control);
  text-align: right;
  background: linear-gradient(
    135deg,
    rgba(32, 12, 10, 0.55),
    rgba(82, 26, 24, 0.35)
  );
}

html.fab-ev .mini th:first-child,
html.fab-ev .mini td:first-child {
  text-align: left;
}

html.fab-ev .main-table thead th {
  text-align: left;
  border-bottom: 1px solid rgba(216, 161, 81, 0.42);
  padding: 12px;
  font-weight: 720;
  color: var(--fab-parchment);
  background: linear-gradient(
    122deg,
    rgba(32, 12, 10, 0.94),
    rgba(28, 10, 9, 0.86)
  );
  position: sticky;
  top: 0;
  z-index: 2;
  text-transform: uppercase;
  letter-spacing: 0.46px;
  box-shadow: 0 6px 22px rgba(12, 4, 4, 0.58);
}

html.fab-ev .main-table tbody td {
  padding: 12px;
  border-bottom: 1px solid rgba(216, 161, 81, 0.22);
  vertical-align: middle;
  background: linear-gradient(
    135deg,
    rgba(20, 8, 7, 0.6),
    rgba(72, 20, 20, 0.32)
  );
}

html.fab-ev .center {
  text-align: center;
  white-space: nowrap;
}

html.fab-ev .mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

html.fab-ev tr.ge {
  background: var(--green-bg);
  outline: 1px solid var(--green-bd);
}

html.fab-ev tr.lt {
  background: var(--red-bg);
  outline: 1px solid var(--red-bd);
}

html.fab-ev .table-tools {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

html.fab-ev .table-tools .spacer {
  flex: 1;
}

html.fab-ev .small {
  font-size: 0.9rem;
  color: #c8b8ab;
}

html.fab-ev .muted {
  color: #c8b8ab;
}

html.fab-ev footer {
  width: 100%;
  margin: 28px auto 0;
  padding: 0 16px 10px;
  display: inline;
}

html.fab-ev .status {
  margin-top: 8px;
}

html.fab-ev .status.loading::before {
  content: "";
  display: inline-block;
  width: 16px;
  height: 16px;
  margin-right: 8px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
  vertical-align: -3px;
}

html.fab-ev .overlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 2, 2, 0.9);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

html.fab-ev .overlay.active {
  display: flex;
}

html.fab-ev .overlay-box {
  text-align: center;
  background: linear-gradient(
    154deg,
    rgba(42, 18, 16, 0.95),
    rgba(24, 10, 9, 0.9)
  );
  border: 1px solid rgba(216, 161, 81, 0.35);
  border-radius: 18px;
  padding: 22px 24px;
  width: min(680px, 92vw);
  color: var(--ink);
  box-shadow: 0 26px 58px rgba(10, 3, 3, 0.7);
}

html.fab-ev .ov-title {
  font-weight: 720;
  margin: 0 0 6px;
  letter-spacing: 0.36px;
  color: var(--accent);
  text-transform: uppercase;
}

html.fab-ev .ov-sub {
  color: #c8b8ab;
  margin: 0 0 12px;
}

html.fab-ev .ov-spinner {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 4px solid rgba(216, 161, 81, 0.2);
  border-top-color: var(--accent);
  animation: spin 1s linear infinite;
  margin: 6px auto 12px;
}

html.fab-ev .ov-log {
  background: var(--panel2);
  border: 1px solid rgba(216, 161, 81, 0.32);
  border-radius: var(--radius-control);
  max-height: 260px;
  overflow: auto;
  padding: 10px var(--space-inline-control);
  font-family: ui-monospace, monospace;
  font-size: 0.88rem;
  white-space: pre-wrap;
  box-shadow: inset 0 0 18px rgba(12, 4, 4, 0.45);
}

html.fab-ev .ov-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}

html.fab-ev .error-tip {
  margin-top: 10px;
  background: rgba(100, 18, 24, 0.5);
  border: 1px solid rgba(236, 110, 128, 0.55);
  border-radius: 10px;
  padding: 9px 12px;
  color: #ffdada;
  display: none;
}

html.fab-ev .toolbar input[type="text"] {
  height: var(--ctrl-h);
  padding: 0 12px;
  border-radius: var(--radius-control);
  border: var(--border-crimson);
  background: linear-gradient(
    164deg,
    rgba(38, 16, 14, 0.78),
    rgba(72, 20, 20, 0.48)
  );
  color: var(--ink);
  font: inherit;
  width: 260px;
  box-shadow: inset 0 0 0 1px rgba(216, 161, 81, 0.18);
}

html.fab-ev .toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin: 12px 0 8px;
}

html.fab-ev .table-wrap {
  position: relative;
}

html.fab-ev .table-wrap .floating-tools {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  gap: 10px;
}

html.fab-ev .table-wrap .floating-tools .btn,
html.fab-ev .table-wrap .floating-tools button {
  height: 36px;
  padding: 0 12px;
}

html.fab-ev .table-wrap .floating-tools .btn,
html.fab-ev .table-wrap .floating-tools button {
  font-size: 0.85rem;
}

html.fab-ev .legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.9rem;
  color: var(--muted);
  margin-top: 8px;
}

html.fab-ev .legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

html.fab-ev .legend span::before {
  content: "";
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 3px;
  border: 1px solid var(--surface-border-muted);
}

html.fab-ev .legend span.ge::before {
  background: var(--green-bg);
  border-color: var(--green-bd);
}

html.fab-ev .legend span.lt::before {
  background: var(--red-bg);
  border-color: var(--red-bd);
}

html.fab-ev .alert {
  margin: 14px 0 0;
  padding: 12px;
  border-radius: var(--radius-control);
  border: 1px solid rgba(236, 110, 128, 0.55);
  background: rgba(100, 18, 24, 0.5);
  color: #ffdada;
  font-size: 0.92rem;
  box-shadow: 0 16px 34px rgba(18, 6, 6, 0.6);
}

html.fab-ev .alert strong {
  font-weight: 650;
}

html.fab-ev .status-log {
  margin-top: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85rem;
  background: rgba(30, 12, 12, 0.6);
  border: 1px solid rgba(216, 161, 81, 0.2);
  border-radius: 10px;
  padding: 10px var(--space-inline-control);
  box-shadow: inset 0 0 0 1px rgba(216, 161, 81, 0.12);
}

/* Loading overlay */
html.fab-ev .overlay {
  position: fixed;
  inset: 0;
}

/* ===== FAB Index styling ===== */
html.fab-index {
  --fab-crimson: #7d1113;
  --fab-crimson-light: #b42328;
  --fab-crimson-deep: #3a0406;
  --fab-umber: #2e1a14;
  --fab-bronze: #d8a151;
  --fab-parchment: #f8e7c0;
  --bg: #070203;
  --bg-glow:
    radial-gradient(
      circle at 15% -12%,
      rgba(180, 35, 40, 0.26),
      transparent 60%
    ),
    radial-gradient(
      circle at 82% -18%,
      rgba(125, 17, 19, 0.28),
      transparent 65%
    ),
    radial-gradient(
      circle at 82% 8%,
      rgba(216, 161, 81, 0.24),
      transparent 56%
    ),
    linear-gradient(180deg, #080304 0%, #120807 55%, #050203 100%);
  --panel: #151013;
  --panel2: #1f1616;
  --ink: #f6ede3;
  --muted: #dfd0c5;
  --accent: var(--fab-bronze);
  --accent-crimson: var(--fab-crimson-light);
  --accent-soft: rgba(216, 161, 81, 0.16);
  --surface-border-muted: rgba(216, 161, 81, 0.38);
  --focus-outline-strong: rgba(216, 161, 81, 0.9);
  --radius-pill: 999px;
  --radius-control: 12px;
  --space-inline-control: 12px;
  --space-stack-control: 14px;
  --border: 1px solid var(--surface-border-muted);
  --border-crimson: 1px solid rgba(180, 35, 40, 0.52);
  --radius: 18px;
  --gap: 22px;
  --pad: 26px;
  --shadow: 0 24px 55px rgba(9, 3, 3, 0.72);
}

html.fab-index body {
  font-family:
    "Segoe UI",
    system-ui,
    -apple-system,
    Roboto,
    Helvetica,
    Arial,
    sans-serif;
}

html.fab-index .heading {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

html.fab-index .page-intro {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 4px 6px;
}

html.fab-index h1 {
  margin: 0;
  font-size: 2rem;
  font-weight: 760;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--fab-parchment);
  text-shadow: 0 0 24px rgba(216, 161, 81, 0.28);
}

html.fab-index .set-navigator {
  gap: 14px;
}

html.fab-index .global-nav .nav-link {
  color: var(--fab-parchment);
  transition:
    color 0.25s ease,
    border-color 0.25s ease;
}

html.fab-index .global-nav .nav-link:hover,
html.fab-index .global-nav .nav-link:focus-visible {
  color: #fff5e0;
  border-color: rgba(216, 161, 81, 0.7);
}

html.fab-index .global-nav .nav-submenu {
  background: rgba(24, 10, 10, 0.96);
  border: 1px solid rgba(216, 161, 81, 0.35);
  box-shadow: 0 18px 40px rgba(8, 3, 3, 0.45);
}

html.fab-index .global-nav .nav-submenu a {
  color: var(--fab-parchment);
}

html.fab-index .global-nav .nav-submenu a:hover,
html.fab-index .global-nav .nav-submenu a:focus-visible {
  border-color: rgba(216, 161, 81, 0.6);
}

html.fab-index .card {
  background:
    linear-gradient(154deg, rgba(38, 18, 16, 0.95), rgba(21, 9, 9, 0.92)),
    radial-gradient(
      circle at 82% -20%,
      rgba(180, 35, 40, 0.28),
      transparent 64%
    ),
    linear-gradient(190deg, rgba(125, 17, 19, 0.22), transparent 62%),
    repeating-linear-gradient(
      135deg,
      rgba(16, 8, 7, 0.65) 0,
      rgba(16, 8, 7, 0.65) 18px,
      rgba(44, 18, 16, 0.32) 18px,
      rgba(44, 18, 16, 0.32) 36px
    );
  background-blend-mode: screen, screen, lighten;
  border: var(--border);
  border-radius: var(--radius);
  padding: var(--pad);
  display: flex;
  flex-direction: column;
  gap: 18px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

html.fab-index .card::before {
  content: "";
  position: absolute;
  inset: -130px 42% 34% -120px;
  background: radial-gradient(
    circle,
    rgba(216, 161, 81, 0.24),
    transparent 70%
  );
  transform: rotate(8deg);
  pointer-events: none;
}

html.fab-index .card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border: var(--border-crimson);
  opacity: 0.34;
  pointer-events: none;
}

html.fab-index .card > * {
  position: relative;
  z-index: 1;
}

html.fab-index .card h2 {
  margin: 0;
  font-size: 1.4rem;
  text-transform: uppercase;
  letter-spacing: 1.8px;
  color: var(--fab-parchment);
  text-shadow: 0 0 22px rgba(180, 35, 40, 0.36);
}

html.fab-index .card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.98rem;
  background: linear-gradient(120deg, rgba(61, 23, 19, 0.32), transparent 72%);
  padding: var(--space-sm, 12px) var(--space-stack-control);
  border-radius: var(--radius-control);
  border: 1px solid rgba(61, 23, 19, 0.4);
}

html.fab-index .tool-list,
html.fab-index .set-rows {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 6px 0 0;
  padding: 0;
}

html.fab-index .tool-controls,
html.fab-index .set-controls {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 12px;
  margin: 12px 0 8px;
}

html.fab-index .tool-control,
html.fab-index .set-control {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.86rem;
  color: var(--muted);
}

html.fab-index .tool-control input,
html.fab-index .tool-control select,
html.fab-index .set-control input,
html.fab-index .set-control select {
  background: rgba(18, 9, 8, 0.85);
  border: 1px solid rgba(216, 161, 81, 0.3);
  border-radius: var(--radius-control);
  color: var(--accent);
  padding: 10px var(--space-inline-control);
  font-size: 0.95rem;
  font-family: inherit;
}

html.fab-index .tool-control input:focus,
html.fab-index .tool-control select:focus,
html.fab-index .set-control input:focus,
html.fab-index .set-control select:focus {
  outline: 2px solid rgba(216, 161, 81, 0.55);
  outline-offset: 2px;
}

html.fab-index .tool-control input::placeholder,
html.fab-index .set-control input::placeholder {
  color: rgba(248, 231, 192, 0.55);
}

@media (max-width: 799px) {
  html.fab-ev .main-table,
  html.fab-ev .table-card {
    display: none;
  }
}

@media (max-width: 720px) {
  html.fab-index .tool-controls,
  html.fab-index .set-controls {
    grid-template-columns: 1fr;
  }
}

html.fab-index .set-row {
  display: grid;
  grid-template-columns: minmax(220px, 350px) 1fr;
  align-items: center;
  gap: 16px;
  padding: 14px 16px;
  background: linear-gradient(
    152deg,
    rgba(38, 18, 16, 0.92),
    rgba(20, 9, 9, 0.88)
  );
  border: 1px solid rgba(216, 161, 81, 0.32);
  border-radius: var(--radius-control);
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

html.fab-index .set-row:hover,
html.fab-index .set-row:focus-within {
  border-color: rgba(216, 161, 81, 0.78);
  box-shadow: 0 14px 28px rgba(9, 4, 4, 0.46);
}

html.fab-index .set-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  max-width: 350px;
}

html.fab-index .set-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

html.fab-index .set-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 650;
  color: var(--fab-parchment);
}

html.fab-index .set-date {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  letter-spacing: 0.02em;
}

html.fab-index .set-date time {
  color: var(--fab-parchment);
  font-weight: 600;
}

html.fab-index .set-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-start;
  align-items: center;
  flex: 1;
}

html.fab-index .set-tools .btn {
  padding-inline: 14px;
  color: #fff5e0;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: linear-gradient(
    135deg,
    rgba(122, 21, 24, 0.94),
    rgba(54, 10, 12, 0.94)
  );
  border: 1px solid rgba(216, 161, 81, 0.74);
  text-shadow: none;
}

html.fab-index .set-tools .btn:hover,
html.fab-index .set-tools .btn:focus-visible {
  color: #fffdf7;
  background: linear-gradient(
    135deg,
    rgba(153, 25, 30, 0.96),
    rgba(70, 12, 16, 0.96)
  );
  border-color: rgba(248, 231, 192, 0.92);
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 720px) {
  html.fab-index .set-row {
    grid-template-columns: 1fr;
    align-items: flex-start;
  }

  html.fab-index .set-tools {
    justify-content: flex-start;
  }
}

@media (prefers-contrast: more) {
  html.fab-page {
    --muted: #f0e3d9;
  }

  html.fab-page
    :is(.card, .section, .site-header, .site-footer, table th, table td) {
    border-color: rgba(248, 231, 192, 0.7) !important;
  }
}

@media (forced-colors: active) {
  html.fab-page * {
    forced-color-adjust: auto;
  }

  html.fab-page :is(a, button, input, select, textarea, summary):focus-visible {
    outline: 2px solid Highlight;
  }
}

@media (max-width: 1149px) {
  html.fab-ev .settings .section.monte-carlo-section {
    display: none;
  }

  html.fab-ev .summary {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  html.fab-ev .settings .section.monte-carlo-section {
    display: none;
  }

  html.fab-ev .summary {
    grid-template-columns: 1fr;
  }

  html.fab-ev .summary .box {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  html.fab-ev .summary .box table {
    min-width: 100%;
  }
}
