/* page-shell.css — shared design system for all FA Tools pages. Per-tool
 * --accent/--accent-rgb/--bg-grad stay in each page's inline <style>. Do not hand-edit shared
 * rules on pages.
 *
 * ORIGINALLY generated by scripts/extract-shared-css.js --emit, but DO NOT REGENERATE IT THAT WAY:
 * --emit recomputes the shared set from the pages' current inline styles, which no longer contain
 * it post-migration, so it would collapse this file to ~13 lines and strip every shared token from
 * the 17 pages that link it (2026-09-26 audit H3). The script now refuses to emit anything smaller
 * than this file. EDIT THIS FILE BY HAND, and remove the rule from the pages (or use --migrate,
 * which reads this file as the contract). */

.theme-light {
  --bg-body: #f8fafc;
  --bg-card: #ffffff;
  --bg-card-border: rgba(0,0,0,0.07);
  --bg-card-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 4px 16px rgba(0,0,0,0.03);
  --bg-tile: #f9fafb;
  --bg-tile-border: rgba(0,0,0,0.06);
  --bg-input: #f9fafb;
  --bg-input-border: rgba(0,0,0,0.1);
  --bg-toggle: rgba(0,0,0,0.04);
  --bg-toggle-btn: rgba(0,0,0,0.05);
  --text-heading: #0f172a;
  --text-body: #1e293b;
  --text-sub: #64748b;
  --text-muted: rgba(0,0,0,0.45);
  --text-faint: rgba(0,0,0,0.35);
  --table-th: rgba(0,0,0,0.45);
  --table-td: rgba(0,0,0,0.65);
  --table-td-first: #1e293b;
  --table-border-head: rgba(0,0,0,0.08);
  --table-border-row: rgba(0,0,0,0.04);
  --glow-1: 0.06;
  --glow-2: 0.04;
  --blue: #3B82F6;
  --blue-rgb: 59,130,246;
  --purple: #8B5CF6;
  --purple-rgb: 139,92,246;
  --green: #10B981;
  --green-rgb: 16,185,129;
  --red: #EF4444;
  --red-rgb: 239,68,68;
}

.theme-dark {
  --bg-body: #0f172a;
  --bg-card: rgba(255,255,255,0.04);
  --bg-card-border: rgba(255,255,255,0.08);
  --bg-card-shadow: none;
  --bg-tile: rgba(255,255,255,0.03);
  --bg-tile-border: rgba(255,255,255,0.06);
  --bg-input: rgba(255,255,255,0.04);
  --bg-input-border: rgba(255,255,255,0.1);
  --bg-toggle: rgba(255,255,255,0.06);
  --bg-toggle-btn: rgba(255,255,255,0.08);
  --text-heading: #f1f5f9;
  --text-body: #e2e8f0;
  --text-sub: #94a3b8;
  --text-muted: rgba(255,255,255,0.4);
  --text-faint: rgba(255,255,255,0.3);
  --table-th: rgba(255,255,255,0.4);
  --table-td: rgba(255,255,255,0.7);
  --table-td-first: #ffffff;
  --table-border-head: rgba(255,255,255,0.08);
  --table-border-row: rgba(255,255,255,0.04);
  --glow-1: 0.08;
  --glow-2: 0.06;
  --blue: #60A5FA;
  --blue-rgb: 96,165,250;
  --purple: #A78BFA;
  --purple-rgb: 167,139,250;
  --green: #34D399;
  --green-rgb: 52,211,153;
  --red: #F87171;
  --red-rgb: 248,113,113;
  --orange: #FBBF24;
  --orange-rgb: 251,191,36;
}

[v-cloak] { display: none !important; }

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
      font-family: 'DM Sans', sans-serif;
      min-height: 100vh;
      background: var(--bg-body);
      color: var(--text-body);
      transition: background 0.35s, color 0.35s;
    }

.mono { font-family: 'DM Mono', monospace !important; }

.app-bg {
      min-height: 100vh;
      background: var(--bg-grad);
      position: relative; overflow: hidden;
    }

.app-bg::before {
      content: ''; position: absolute; top: -200px; right: -200px;
      width: 600px; height: 600px;
      background: radial-gradient(circle, rgba(var(--accent-rgb), var(--glow-1)) 0%, transparent 70%);
      pointer-events: none;
    }

.app-bg::after {
      content: ''; position: absolute; bottom: -150px; left: -150px;
      width: 500px; height: 500px;
      background: radial-gradient(circle, rgba(var(--accent-rgb), var(--glow-2)) 0%, transparent 70%);
      pointer-events: none;
    }

.nav-breadcrumb {
      position: relative; z-index: 2;
      padding: 16px 24px 0; font-size: 13px; font-weight: 500;
      display: flex; align-items: center; gap: 6px;
    }

.nav-breadcrumb a { color: var(--text-sub); text-decoration: none; opacity: 0.7; display: flex; align-items: center; }

.nav-breadcrumb a:hover { opacity: 1; }

.nav-breadcrumb .sep { opacity: 0.3; color: var(--text-muted); }

.nav-breadcrumb .current { color: var(--text-heading); }

.top-bar {
      position: absolute; top: 16px; right: 16px; z-index: 10;
      display: flex; align-items: center; gap: 8px;
    }

.theme-toggle-btn {
      width: 40px; height: 40px; border-radius: 10px; border: none;
      cursor: pointer; display: flex; align-items: center; justify-content: center;
      font-size: 18px; transition: all 0.2s;
      color: var(--text-heading); background: var(--bg-toggle-btn);
    }

.theme-toggle-btn:hover { opacity: 0.8; }

.compareip-btn {
      cursor: pointer; text-decoration: none; display: flex; align-items: center; gap: 8px;
      background: var(--bg-metric); border: 1px solid var(--bg-card-border);
      border-radius: 20px; padding: 6px 14px 6px 10px;
      font-size: 13px; font-weight: 600; color: var(--text-sub);
      transition: background 0.3s, border-color 0.3s;
      white-space: nowrap;
    }

.compareip-btn:hover { opacity: 0.8; }

.export-btn {
      height: 40px; padding: 0 16px; gap: 6px;
      border-radius: 10px; border: 1px solid transparent;
      cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
      font-family: 'DM Sans', sans-serif; font-size: 13px; font-weight: 600;
      transition: all 0.2s;
      background: var(--accent); color: #fff;
    }

.export-btn:hover { filter: brightness(0.9); }

.theme-dark .export-btn {
      background: rgba(var(--accent-rgb), 0.15);
      color: var(--accent);
      border-color: rgba(var(--accent-rgb), 0.25);
    }

.theme-dark .export-btn:hover { background: rgba(var(--accent-rgb), 0.25); filter: none; }

.export-btn.excel-btn {
      background: transparent; color: var(--text-heading);
      border: 1px solid var(--bg-card-border);
    }

.export-btn.excel-btn:hover { background: var(--bg-toggle); }

.hero-header {
      text-align: center; padding: 48px 16px 24px;
      position: relative; z-index: 1;
    }

.hero-flag {
      display: inline-flex; align-items: center; gap: 8px;
      padding: 6px 16px; border-radius: 24px;
      border: 1px solid rgba(var(--accent-rgb), 0.2);
      background: rgba(var(--accent-rgb), 0.08);
      color: var(--accent);
      font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px;
      margin-bottom: 16px;
    }

.main-container {
      max-width: 960px; margin: 0 auto;
      padding: 0 16px 48px;
      position: relative; z-index: 1;
    }

.calc-card {
      background: var(--bg-card);
      border: 1px solid var(--bg-card-border);
      box-shadow: var(--bg-card-shadow);
      border-radius: 16px; padding: 32px; margin-bottom: 24px;
      transition: background 0.3s, border-color 0.3s, box-shadow 0.3s;
    }

.theme-dark .calc-card { backdrop-filter: blur(20px); }

.calc-card-header {
      display: flex; align-items: center; gap: 12px; margin-bottom: 24px;
    }

.calc-card-header h2 { font-size: 18px; font-weight: 600; color: var(--text-heading); }

.icon-box {
      width: 40px; height: 40px; border-radius: 10px;
      display: flex; align-items: center; justify-content: center;
    }

.icon-box.accent { background: rgba(var(--accent-rgb), 0.12); color: var(--accent); }

.icon-box.green { background: rgba(var(--green-rgb), 0.12); color: var(--green); }

.input-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.result-tiles { display: grid; gap: 16px; margin-bottom: 24px; }

.result-tile {
      background: var(--bg-tile); border: 1px solid var(--bg-tile-border);
      padding: 20px; border-radius: 12px; text-align: center;
      transition: border-color 0.2s, background 0.2s;
    }

.result-tile:hover { border-color: rgba(var(--accent-rgb), 0.25); }

.bracket-table { width: 100%; border-collapse: separate; border-spacing: 0; }

.bracket-table thead th {
      font-size: 11px; text-transform: uppercase; letter-spacing: 0.8px;
      font-weight: 600; padding: 12px 16px; text-align: right;
      color: var(--table-th); border-bottom: 1px solid var(--table-border-head);
    }

.bracket-table thead th:first-child { text-align: left; }

.bracket-table tbody td {
      padding: 12px 16px; font-size: 14px; text-align: right;
      color: var(--table-td); border-bottom: 1px solid var(--table-border-row);
    }

.bracket-table tbody td:first-child { text-align: left; font-weight: 500; color: var(--table-td-first); }

.section-label {
      font-size: 13px; font-weight: 600; color: var(--text-muted);
      margin-bottom: 12px; text-transform: uppercase; letter-spacing: 0.05em;
    }

.v-field { border-radius: 12px !important; }

.v-label { font-family: 'DM Sans', sans-serif !important; font-size: 14px !important; font-weight: 500 !important; }

.v-input input { font-family: 'DM Mono', monospace !important; font-size: 16px !important; }

.v-input .v-field {
      background: var(--bg-input) !important;
      border: 1px solid var(--bg-input-border) !important;
    }

.v-input .v-field:hover { border-color: rgba(var(--accent-rgb), 0.3) !important; }

.v-input .v-field--focused { border-color: var(--accent) !important; }

.slider-label { font-size: 14px; color: var(--text-sub); }

.copyright { text-align: center; font-size: 11px; color: var(--text-faint); padding: 0 16px 24px; display: flex; align-items: center; justify-content: center; gap: 4px; }

.copyright-logo { height: 48px; width: auto; vertical-align: middle; }

.info-overlay {
      position: fixed; inset: 0; z-index: 200;
      background: rgba(0,0,0,0.5); display: flex; align-items: center; justify-content: center; padding: 24px;
    }

.info-modal {
      background: var(--bg-card); border: 1px solid var(--bg-card-border);
      border-radius: 20px; max-width: 720px; width: 100%; max-height: 85vh;
      overflow-y: auto; padding: 40px 36px; position: relative;
    }

.info-modal-label { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.12em; color: var(--accent); margin-bottom: 8px; }

.info-modal h2 { font-size: 26px; font-weight: 700; color: var(--text-heading); margin-bottom: 20px; }

.info-modal p { font-size: 14px; line-height: 1.75; color: var(--text-body); margin-bottom: 16px; }

.info-pillars { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: 28px; }

.info-pillar { text-align: center; }

.info-pillar-num {
      width: 44px; height: 44px; border-radius: 50%; margin: 0 auto 10px;
      display: flex; align-items: center; justify-content: center;
      font-size: 14px; font-weight: 700; font-family: 'DM Mono', monospace;
      background: var(--bg-tile); color: var(--text-sub); border: 1px solid var(--bg-card-border, #e2e8f0);
    }

.info-pillar-text { font-size: 12px; font-weight: 600; color: var(--text-heading); line-height: 1.4; }

.info-close { position: absolute; top: 16px; right: 16px; cursor: pointer; background: none; border: none; font-size: 22px; color: var(--text-muted); }

.info-close:hover { color: var(--text-heading); }

.top-bar-icon { cursor: pointer; background: var(--bg-tile); border: 1px solid var(--bg-card-border, #e2e8f0); border-radius: 50%; width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; color: var(--text-sub); transition: all 0.2s; }

.top-bar-icon:hover { opacity: 0.8; }

.account-wrap { position: relative; }

.account-initial { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; background: rgba(var(--accent-rgb), 0.15); color: var(--accent); }

.account-menu { position: absolute; right: 0; top: 44px; min-width: 220px; background: var(--bg-card); border: 1px solid var(--bg-card-border, #e2e8f0); border-radius: 12px; box-shadow: 0 8px 24px rgba(0,0,0,0.12); padding: 8px; z-index: 50; }

.account-menu .account-email { padding: 8px 10px; font-size: 13px; color: var(--text-sub); border-bottom: 1px solid var(--bg-card-border, #e2e8f0); margin-bottom: 6px; word-break: break-all; }

.account-menu .account-item { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; background: transparent; border: 0; border-radius: 8px; padding: 9px 10px; font: inherit; font-size: 14px; color: var(--text-body); cursor: pointer; text-decoration: none; }

.account-menu .account-item:hover { background: var(--bg-tile); }

.notif-banner {
      position: fixed; top: 0; left: 0; right: 0; z-index: 300;
      display: flex; align-items: center; gap: 12px;
      padding: 14px 20px;
      background: var(--accent, #3b82f6);
      color: #fff; font-size: 14px;
      box-shadow: 0 4px 20px rgba(0,0,0,0.2);
      transform: translateY(-100%);
      transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    }

.notif-banner.visible { transform: translateY(0); }

.notif-banner-icon { font-size: 20px; flex-shrink: 0; }

.notif-banner-content { flex: 1; min-width: 0; }

.notif-banner-title { font-weight: 600; margin-bottom: 2px; }

.notif-banner-body { opacity: 0.9; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.notif-banner-img { width: 48px; height: 48px; border-radius: 8px; object-fit: cover; flex-shrink: 0; }

.notif-banner-close {
      background: none; border: none; color: #fff; font-size: 20px;
      cursor: pointer; opacity: 0.7; flex-shrink: 0; padding: 0 4px;
    }

.notif-banner-close:hover { opacity: 1; }

.grid-ad-wrapper {
      display: flex;
      gap: 24px;
      max-width: 1240px;
      margin: 0 auto;
      padding: 0 24px 80px;
    }

.grid-ad-wrapper > :first-child {
      flex: 1; min-width: 0;
    }

.ad-sidebar {
      width: 160px; flex-shrink: 0; align-self: stretch;
      display: flex; flex-direction: column; justify-content: flex-start;
      overflow: hidden; border-left: 1px solid var(--bg-card-border); padding-left: 16px;
    }

.ad-label {
      font-size: 9px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.12em;
      color: var(--text-muted); margin-bottom: 8px;
    }

@media (max-width: 1280px) {
      .ad-sidebar { display: none; }
      .grid-ad-wrapper { max-width: 1040px; }
    }

/* .app-bg clips its overflow (it keeps the background glow in), so anything wider than its column
   is cut off rather than scrollable: a toggle row loses its last buttons, a grid its right column.
   These hold at every width; e2e/responsive.spec.js checks every page at several. */
/* A wide table scrolls sideways inside its card. */
.table-scroll-x { overflow-x: auto; }
/* Year / mode toggles wrap instead of running off (CorporateTax's eight YAs at 960–1080px). */
.mode-toggle, .ya-toggle { flex-wrap: wrap; }

/* The absolute top bar is 550–750px wide: below ~1050px it covered the "← FA Tools" link and
   pushed the CompareIP pill off the left edge (every iPad width). Below 1080px it joins the flow
   under the breadcrumb, right-aligned; when it does not fit one row the pill goes to its own row. */
@media (max-width: 1080px) {
      .top-bar { position: static; flex-wrap: wrap; justify-content: flex-end; padding: 12px 16px 0; }
      .top-bar .compareip-btn { order: 1; margin-right: 0 !important; }
      .hero-header { padding-top: 24px; }
    }

/* Result tiles: at most two per row below 700px (CPF's four-tile row ran off at 601–614px, where
   the pages' own two-column rules had not yet started), and a figure like S$1,565,217 must fit a
   tile half a phone wide. Pages size tiles inline with selectors as specific as
   `.result-tiles.cols-4 .result-tile .value`, so the font size needs !important to apply. */
@media (max-width: 700px) {
      .app-bg .result-tiles.cols-3, .app-bg .result-tiles.cols-4, .app-bg .result-tiles.cols-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    }

/* Phone layout. */
@media (max-width: 600px) {
      /* Side padding: wrapper 12 + container 16 + card 20 left a result tile ~100px of room. The
         wrapper's 12px alone is the page gutter; .app-bg wins over the pages' own card padding. */
      .grid-ad-wrapper { padding-left: 12px; padding-right: 12px; }
      .main-container { padding-left: 0; padding-right: 0; }
      .app-bg .calc-card { padding: 20px 14px; }
      .top-bar { gap: 6px; padding: 10px 12px 0; }
      .hero-header { padding-top: 16px; }
      .app-bg .result-tile { padding: 14px 10px; }
      /* A grid track sized 1fr never shrinks below its content's width, so one long figure
         pushes the whole grid past the screen edge; min-width: 0 lets the track shrink. */
      .result-tiles > *, .result-grid > *, .input-row > *, .mode-layout > * { min-width: 0; }
      .app-bg .result-tile .label { letter-spacing: 0.02em; }
      .app-bg .result-tile .value { font-size: 16px !important; white-space: normal; } /* a range like "$1,630 – $1,780" wraps at its spaces */
    }

/* The narrowest phones (320px, the original iPhone SE): one tile per row. */
@media (max-width: 340px) {
      .app-bg .result-tiles, .app-bg .result-grid { grid-template-columns: minmax(0, 1fr) !important; }
    }

.contact-fab-wrapper {
      position: fixed; bottom: 28px; right: 28px; z-index: 150;
      display: flex; flex-direction: column-reverse; align-items: center; gap: 12px;
    }

.contact-fab {
      width: 56px; height: 56px; border-radius: 50%; border: none; cursor: pointer;
      background: var(--accent); color: #fff; font-size: 24px;
      display: flex; align-items: center; justify-content: center;
      box-shadow: 0 4px 16px rgba(0,0,0,0.18);
      transition: transform 0.25s, box-shadow 0.25s, background 0.25s;
    }

.contact-fab:hover { box-shadow: 0 6px 24px rgba(0,0,0,0.25); transform: scale(1.05); }

.contact-fab-menu {
      display: flex; flex-direction: column-reverse; align-items: center; gap: 10px;
      opacity: 0; pointer-events: none; transform: translateY(8px);
      transition: opacity 0.25s, transform 0.25s;
    }

.contact-fab-wrapper.open .contact-fab-menu {
      opacity: 1; pointer-events: auto; transform: translateY(0);
    }

.contact-fab-item {
      display: flex; align-items: center; gap: 10px; cursor: pointer;
      white-space: nowrap; flex-direction: row-reverse;
    }

.contact-fab-item-btn {
      width: 44px; height: 44px; border-radius: 50%; border: none; cursor: pointer;
      display: flex; align-items: center; justify-content: center; font-size: 20px;
      box-shadow: 0 2px 10px rgba(0,0,0,0.14); transition: transform 0.2s, box-shadow 0.2s;
    }

.contact-fab-item-btn:hover { transform: scale(1.1); box-shadow: 0 4px 16px rgba(0,0,0,0.2); }

.contact-fab-item-btn.wa { background: #25D366; color: #fff; }

.contact-fab-item-btn.email { background: var(--accent); color: #fff; }

.contact-fab-item-btn.cal { background: #7c3aed; color: #fff; }

.contact-fab-label {
      font-size: 12px; font-weight: 600; color: var(--text-heading);
      background: var(--bg-card); border: 1px solid var(--bg-card-border, rgba(0,0,0,0.1));
      border-radius: 6px; padding: 5px 10px;
      box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    }

.contact-fab-overlay {
      position: fixed; inset: 0; z-index: 149; background: transparent;
      display: none;
    }

.contact-fab-overlay.open { display: block; }

.hero-subtitle { font-size: 15px; font-weight: 400; color: var(--text-sub); }
