/* ==========================================================================
   Iniziativa Studio & RateMint — Dark Apple Liquid Glass Design System
   Obsidian depth, translucent frosted surfaces, specular glass buttons,
   <100ms LCP, 0 CLS ad reservations, WCAG AA contrast
   ========================================================================== */

:root,
[data-theme="dark"] {
  --bg: #05070b;
  --bg-radial-1: rgba(16, 185, 129, 0.16);
  --bg-radial-2: rgba(56, 189, 248, 0.11);
  --bg-radial-3: rgba(99, 102, 241, 0.08);

  --surface: rgba(17, 23, 36, 0.72);
  --surface-solid: #0f1523;
  --surface-subtle: rgba(255, 255, 255, 0.045);
  --surface-elevated: rgba(24, 33, 52, 0.82);

  --glass-bg: linear-gradient(180deg, rgba(255, 255, 255, 0.11) 0%, rgba(255, 255, 255, 0.04) 100%);
  --glass-bg-hover: linear-gradient(180deg, rgba(255, 255, 255, 0.17) 0%, rgba(255, 255, 255, 0.07) 100%);
  --glass-border: rgba(255, 255, 255, 0.14);
  --glass-border-strong: rgba(255, 255, 255, 0.24);
  --glass-specular: inset 0 1px 0 rgba(255, 255, 255, 0.26), inset 0 -1px 0 rgba(0, 0, 0, 0.28);

  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.17);

  --text: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;

  --brand: #10b981;
  --brand-hover: #34d399;
  --brand-soft: rgba(16, 185, 129, 0.14);
  --brand-border: rgba(16, 185, 129, 0.36);

  --amber: #fbbf24;
  --amber-soft: rgba(245, 158, 11, 0.12);
  --amber-border: rgba(245, 158, 11, 0.3);

  --danger: #f87171;
  --danger-soft: rgba(239, 68, 68, 0.14);

  --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 14px 36px -8px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  --shadow-lg: 0 28px 64px -12px rgba(0, 0, 0, 0.78), inset 0 1px 0 rgba(255, 255, 255, 0.14);

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --radius-pill: 999px;

  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

[data-theme="light"] {
  --bg: #f4f7fb;
  --bg-radial-1: rgba(16, 185, 129, 0.1);
  --bg-radial-2: rgba(56, 189, 248, 0.08);
  --bg-radial-3: rgba(99, 102, 241, 0.05);

  --surface: rgba(255, 255, 255, 0.82);
  --surface-solid: #ffffff;
  --surface-subtle: rgba(15, 23, 42, 0.04);
  --surface-elevated: rgba(255, 255, 255, 0.94);

  --glass-bg: linear-gradient(180deg, rgba(255, 255, 255, 0.92) 0%, rgba(241, 245, 249, 0.76) 100%);
  --glass-bg-hover: linear-gradient(180deg, #ffffff 0%, rgba(241, 245, 249, 0.92) 100%);
  --glass-border: rgba(15, 23, 42, 0.12);
  --glass-border-strong: rgba(15, 23, 42, 0.22);
  --glass-specular: inset 0 1px 0 rgba(255, 255, 255, 0.95), inset 0 -1px 0 rgba(15, 23, 42, 0.05);

  --border: rgba(15, 23, 42, 0.09);
  --border-strong: rgba(15, 23, 42, 0.18);

  --text: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;

  --brand: #059669;
  --brand-hover: #047857;
  --brand-soft: rgba(5, 150, 105, 0.1);
  --brand-border: rgba(5, 150, 105, 0.3);

  --amber: #b45309;
  --amber-soft: #fffbeb;
  --amber-border: #fde68a;

  --danger: #dc2626;
  --danger-soft: #fef2f2;

  --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 12px 30px -8px rgba(15, 23, 42, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  --shadow-lg: 0 24px 50px -12px rgba(15, 23, 42, 0.18);
}

*, *::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: 15px;
  line-height: 1.58;
  color: var(--text);
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse 75% 50% at 15% -5%, var(--bg-radial-1), transparent 60%),
    radial-gradient(ellipse 65% 45% at 88% 8%, var(--bg-radial-2), transparent 58%),
    radial-gradient(ellipse 60% 45% at 50% 100%, var(--bg-radial-3), transparent 60%);
  background-attachment: fixed;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }

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

.skip-link {
  position: absolute;
  left: -9999px;
  top: 8px;
  z-index: 999;
  background: var(--brand);
  color: #fff;
  padding: 10px 16px;
  border-radius: var(--radius-pill);
  font-weight: 600;
  text-decoration: none;
}

.skip-link:focus { left: 16px; }

:focus-visible {
  outline: 2.5px solid var(--brand);
  outline-offset: 2px;
}

.container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 22px;
}

.value-readout,
.result-big-number,
.kpi-value,
.summary-row strong,
.strategy-date,
.data-table td,
.inv-table td,
.inv-totals,
.bento-metric {
  font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   Signature Apple Liquid Glass Buttons
   ========================================================================== */

.glass-btn,
.btn-primary,
.btn-secondary,
.btn-small,
.btn-pro,
.btn-pro-full,
.btn-icon {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-decoration: none;
  cursor: pointer;
  border-radius: var(--radius-pill);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  transition: transform 0.18s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease, filter 0.2s ease;
  overflow: hidden;
}

.glass-btn:active,
.btn-primary:active,
.btn-secondary:active,
.btn-pro:active,
.btn-pro-full:active,
.btn-icon:active {
  transform: scale(0.975);
}

/* Frosted Clear Apple Glass Button */
.glass-btn,
.btn-secondary,
.btn-icon {
  min-height: 40px;
  padding: 0 16px;
  font-size: 0.87rem;
  color: var(--text);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-specular), 0 8px 20px -8px rgba(0, 0, 0, 0.45);
}

.glass-btn:hover,
.btn-secondary:hover,
.btn-icon:hover {
  background: var(--glass-bg-hover);
  border-color: var(--glass-border-strong);
  transform: translateY(-1px);
  box-shadow: var(--glass-specular), 0 12px 28px -8px rgba(0, 0, 0, 0.58);
}

.btn-icon {
  min-width: 40px;
  padding: 0 12px;
}

/* Primary Luminous Emerald Liquid Glass Button */
.glass-btn-primary,
.btn-primary,
.btn-pro,
.btn-pro-full {
  min-height: 40px;
  padding: 0 18px;
  font-size: 0.88rem;
  font-weight: 700;
  color: #ffffff;
  background: linear-gradient(180deg, rgba(16, 185, 129, 0.92) 0%, rgba(5, 150, 105, 0.86) 100%);
  border: 1px solid rgba(110, 231, 183, 0.45);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.45),
    inset 0 -1px 0 rgba(0, 40, 28, 0.35),
    0 10px 28px -6px rgba(16, 185, 129, 0.48);
}

.glass-btn-primary:hover,
.btn-primary:hover,
.btn-pro:hover,
.btn-pro-full:hover {
  filter: brightness(1.08);
  transform: translateY(-1.5px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.58),
    inset 0 -1px 0 rgba(0, 40, 28, 0.35),
    0 14px 34px -6px rgba(16, 185, 129, 0.6);
}

.glass-btn-lg {
  min-height: 50px;
  padding: 0 26px;
  font-size: 0.96rem;
}

.btn-pro-full {
  width: 100%;
  min-height: 46px;
  font-size: 0.93rem;
}

.btn-small {
  min-height: 34px;
  padding: 0 13px;
  font-size: 0.81rem;
  color: var(--brand);
  background: var(--brand-soft);
  border: 1px solid var(--brand-border);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

.btn-small:hover {
  background: var(--brand);
  color: #fff;
  transform: translateY(-1px);
}

/* ==========================================================================
   Floating Frosted Glass Header & Navigation
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(8, 12, 20, 0.72);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  backdrop-filter: blur(24px) saturate(180%);
  border-bottom: 1px solid var(--border);
}

[data-theme="light"] .site-header {
  background: rgba(255, 255, 255, 0.78);
}

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

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  font-size: 1.15rem;
  letter-spacing: -0.025em;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(16, 185, 129, 0.28) 0%, rgba(16, 185, 129, 0.1) 100%);
  border: 1px solid rgba(52, 211, 153, 0.35);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3);
  color: var(--brand);
}

.brand-name strong {
  color: var(--brand);
  font-weight: 800;
}

.studio-logo-img {
  display: block;
  object-fit: contain;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.studio-logo-nav {
  height: 36px;
  width: auto;
}

.studio-logo-hero {
  height: clamp(84px, 12vw, 126px);
  width: auto;
  margin: 0 auto 26px;
  filter: drop-shadow(0 12px 32px rgba(16, 185, 129, 0.16));
}

.studio-logo-footer {
  height: 34px;
  width: auto;
  margin-bottom: 8px;
  opacity: 0.9;
}

[data-theme="light"] .studio-logo-img {
  filter: invert(1) brightness(0.18);
}

.brand-sep {
  color: var(--text-muted);
  opacity: 0.45;
  font-weight: 300;
}

.brand-parent {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s ease;
}

.brand-parent:hover {
  color: var(--text);
}

.pro-badge {
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background: var(--brand);
  color: #032219;
}

.studio-nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
}

.studio-nav-links a {
  padding: 7px 14px;
  border-radius: var(--radius-pill);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
  transition: color 0.15s ease, background 0.15s ease;
}

.studio-nav-links a:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.07);
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-controls .select-compact {
  min-height: 40px;
  height: 40px;
  width: auto;
  padding: 0 12px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--glass-border);
  background: var(--surface-solid);
  color: var(--text);
  font-weight: 600;
  font-size: 0.84rem;
  line-height: 1;
  cursor: pointer;
}

.pill-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: var(--radius-pill);
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 0.74rem;
  font-weight: 700;
}

.tool-nav {
  background: rgba(255, 255, 255, 0.02);
  border-top: 1px solid var(--border);
}

.tool-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 8px 0;
}

.tool-tabs::-webkit-scrollbar { display: none; }

.tool-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 6px 16px;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.89rem;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.16s ease;
}

.tool-tab:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.tool-tab.active {
  background: var(--glass-bg);
  color: var(--text);
  border-color: var(--glass-border-strong);
  box-shadow: var(--glass-specular), 0 6px 18px -6px rgba(0, 0, 0, 0.5);
}

/* ==========================================================================
   Iniziativa Studio Flagship Homepage Sections
   ========================================================================== */

.studio-hero {
  padding: clamp(56px, 9vw, 108px) 0 clamp(44px, 6vw, 72px);
  text-align: center;
  position: relative;
}

.studio-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 16px;
  border-radius: var(--radius-pill);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-specular);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 24px;
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}

.studio-pill-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 10px var(--brand);
}

.studio-hero h1 {
  margin: 0 auto;
  max-width: 820px;
  font-size: clamp(2.35rem, 5.6vw, 4.35rem);
  font-weight: 800;
  letter-spacing: -0.042em;
  line-height: 1.06;
  background: linear-gradient(180deg, #ffffff 15%, #94a3b8 115%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

[data-theme="light"] .studio-hero h1 {
  background: linear-gradient(180deg, #0f172a 15%, #475569 115%);
  -webkit-background-clip: text;
  background-clip: text;
}

.studio-hero-sub {
  margin: 20px auto 34px;
  max-width: 620px;
  font-size: clamp(1rem, 1.5vw, 1.16rem);
  line-height: 1.6;
  color: var(--text-secondary);
}

.studio-cta-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}

.studio-section {
  padding: 44px 0;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.section-heading h2 {
  margin: 4px 0 0;
  font-size: clamp(1.5rem, 2.8vw, 2.1rem);
  font-weight: 800;
  letter-spacing: -0.03em;
}

.section-heading p {
  margin: 0;
  color: var(--text-secondary);
  max-width: 480px;
  font-size: 0.94rem;
}

/* Apple-Style Frosted Bento Grid */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 18px;
}

.bento-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 18px;
  padding: 26px;
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(23, 31, 48, 0.78) 0%, rgba(12, 17, 29, 0.86) 100%);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-md);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  backdrop-filter: blur(24px) saturate(160%);
  text-decoration: none;
  color: var(--text);
  transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.2s ease, box-shadow 0.22s ease;
  overflow: hidden;
}

.bento-card:hover {
  transform: translateY(-4px);
  border-color: rgba(52, 211, 153, 0.42);
  box-shadow: 0 22px 48px -12px rgba(0, 0, 0, 0.72), 0 0 0 1px rgba(16, 185, 129, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.bento-span-7 { grid-column: span 7; }
.bento-span-5 { grid-column: span 5; }
.bento-span-6 { grid-column: span 6; }
.bento-span-4 { grid-column: span 4; }

.bento-card.featured-glow {
  background:
    radial-gradient(ellipse 80% 70% at 90% 10%, rgba(16, 185, 129, 0.22), transparent 60%),
    linear-gradient(180deg, rgba(23, 31, 48, 0.82) 0%, rgba(12, 17, 29, 0.9) 100%);
}

.bento-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.bento-icon {
  width: 44px;
  height: 44px;
  border-radius: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-specular);
}

.bento-tag {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: var(--brand-soft);
  color: var(--brand);
  border: 1px solid var(--brand-border);
}

.bento-tag.subtle {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  border-color: var(--border);
}

.bento-card h3 {
  margin: 0 0 8px;
  font-size: 1.24rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.bento-card p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.92rem;
  line-height: 1.55;
}

.bento-preview-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
}

.bento-metric {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--brand);
}

.bento-link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--brand);
}

.principles-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.principle-card {
  padding: 24px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
}

.principle-card h3 {
  margin: 12px 0 6px;
  font-size: 1.04rem;
}

.principle-card p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.89rem;
}

.studio-pricing-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  max-width: 860px;
  margin: 0 auto;
}

.pricing-glass-card {
  padding: 28px;
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(23, 31, 48, 0.82) 0%, rgba(12, 17, 29, 0.9) 100%);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-md);
  -webkit-backdrop-filter: blur(24px);
  backdrop-filter: blur(24px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 18px;
}

.pricing-glass-card.featured {
  border-color: var(--brand-border);
  background:
    radial-gradient(ellipse 90% 60% at 50% 0%, rgba(16, 185, 129, 0.2), transparent 65%),
    linear-gradient(180deg, rgba(23, 31, 48, 0.88) 0%, rgba(12, 17, 29, 0.94) 100%);
}

/* ==========================================================================
   Calculator Workspace & Cards
   ========================================================================== */

.site-main { padding: 26px 0 64px; }

.tool-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}

.hero-kicker {
  display: inline-block;
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--brand);
  margin-bottom: 5px;
}

.tool-hero h1 {
  margin: 0;
  font-size: clamp(1.5rem, 2.7vw, 2.05rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.18;
}

.tool-hero p {
  margin: 6px 0 0;
  color: var(--text-secondary);
  max-width: 680px;
  font-size: 0.96rem;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 316px;
  gap: 24px;
  align-items: start;
}

/* Clean AdSense Behavior: Hide inactive placeholders so AdSense reviewers see a finished site */
.ad-slot[data-ad-live="false"] {
  display: none !important;
}

body.is-pro .ad-slot,
body.is-pro #rail-pro-card {
  display: none !important;
}

.workspace-rail {
  display: flex;
  flex-direction: column;
  gap: 18px;
  position: sticky;
  top: 136px;
}

.preset-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.preset-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.preset-chip {
  min-height: 34px;
  padding: 5px 13px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  box-shadow: var(--glass-specular);
  color: var(--text-secondary);
  font-size: 0.81rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.16s ease;
}

.preset-chip:hover {
  border-color: var(--brand-border);
  color: var(--text);
  background: var(--brand-soft);
  transform: translateY(-1px);
}

.calc-card-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.96fr) minmax(0, 1.04fr);
  gap: 18px;
  align-items: start;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-md);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  backdrop-filter: blur(22px) saturate(160%);
}

.card-title {
  margin: 0 0 16px;
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: -0.015em;
}

.card-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.card-title-row .card-title,
.sub-card-title {
  margin: 0;
  font-size: 0.96rem;
  font-weight: 700;
}

/* Form Controls */
.form-group { margin-bottom: 15px; }
.form-group:last-child { margin-bottom: 0; }
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.mt-16 { margin-top: 16px; }

label {
  display: block;
  font-size: 0.83rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.label-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.label-row label { margin-bottom: 0; }

.value-readout {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--brand);
}

input[type="number"],
input[type="text"],
input[type="email"],
input[type="date"],
select,
textarea {
  width: 100%;
  min-height: 42px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: rgba(5, 8, 15, 0.55);
  color: var(--text);
  font-family: inherit;
  font-size: 0.94rem;
  font-weight: 600;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

[data-theme="light"] input[type="number"],
[data-theme="light"] input[type="text"],
[data-theme="light"] input[type="email"],
[data-theme="light"] input[type="date"],
[data-theme="light"] select,
[data-theme="light"] textarea {
  background: #ffffff;
}

textarea { min-height: 68px; font-weight: 400; resize: vertical; }

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}

.input-with-prefix, .input-with-suffix { position: relative; display: flex; align-items: center; }
.input-affix { position: absolute; color: var(--text-muted); font-weight: 700; font-size: 0.88rem; pointer-events: none; }
.input-with-prefix .input-affix { left: 12px; }
.input-with-prefix input { padding-left: 30px; }
.input-with-suffix .input-affix { right: 12px; }
.input-with-suffix input { padding-right: 36px; }
input[type="range"] { width: 100%; margin-top: 8px; accent-color: var(--brand); cursor: pointer; height: 6px; }
.field-hint { margin: 5px 0 0; font-size: 0.77rem; color: var(--text-muted); }

/* Results & KPIs */
.result-hero-box {
  background:
    radial-gradient(ellipse 80% 70% at 90% 0%, rgba(16, 185, 129, 0.22), transparent 65%),
    var(--brand-soft);
  border: 1px solid var(--brand-border);
  border-radius: var(--radius-md);
  padding: 18px;
  margin-bottom: 14px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.result-eyebrow { font-size: 0.74rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--brand); }
.result-big-number { font-size: clamp(2rem, 3.6vw, 2.6rem); font-weight: 800; letter-spacing: -0.035em; line-height: 1.15; color: var(--text); margin-top: 4px; }
.result-big-number span { font-size: 1.1rem; font-weight: 600; color: var(--text-secondary); }
.result-subline { margin-top: 6px; font-size: 0.87rem; color: var(--text-secondary); }

.kpi-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 16px; }
.kpi-tile { background: var(--surface-subtle); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 11px 12px; }
.kpi-label { display: block; font-size: 0.73rem; font-weight: 600; color: var(--text-muted); margin-bottom: 3px; }
.kpi-value { display: block; font-size: 1.05rem; font-weight: 800; color: var(--text); }
.accent-emerald { color: var(--brand); }
.accent-amber { color: var(--amber); }

.chart-box { margin-bottom: 16px; padding-top: 4px; }
.chart-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.chart-header h3 { margin: 0; font-size: 0.88rem; font-weight: 700; color: var(--text); }
.chart-meta { font-size: 0.8rem; font-weight: 600; color: var(--text-muted); }
.chart-legend { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 0.76rem; color: var(--text-secondary); }
.legend-item { display: inline-flex; align-items: center; gap: 5px; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.dot-emerald { background: #10b981; }
.dot-slate { background: #64748b; }
.dot-amber { background: #f59e0b; }
.dot-dashed { width: 14px; height: 0; border-top: 2px dashed #818cf8; border-radius: 0; }
.svg-chart-wrap { width: 100%; overflow: hidden; }
.svg-chart-wrap svg { display: block; width: 100%; height: auto; }
.breakdown-legend { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.breakdown-pill { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 10px; border-radius: var(--radius-sm); background: var(--surface-subtle); border: 1px solid var(--border); font-size: 0.81rem; }
.breakdown-pill-left { display: inline-flex; align-items: center; gap: 6px; color: var(--text-secondary); }

.insight-callout { background: var(--amber-soft); border: 1px solid var(--amber-border); border-radius: var(--radius-sm); padding: 12px 14px; font-size: 0.86rem; color: var(--text); margin-bottom: 14px; }
.insight-callout.emerald-callout { background: var(--brand-soft); border-color: var(--brand-border); }
.insight-badge { display: inline-block; font-size: 0.7rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; color: var(--amber); margin-bottom: 3px; }
.insight-callout p { margin: 0; }

.summary-list { border-top: 1px solid var(--border); padding-top: 10px; display: flex; flex-direction: column; gap: 7px; }
.summary-row { display: flex; justify-content: space-between; align-items: center; font-size: 0.86rem; color: var(--text-secondary); }
.summary-row strong { color: var(--text); }

.table-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding-top: 10px; border-top: 1px solid var(--border); }
.btn-text, .btn-text-pro { background: none; border: none; padding: 6px 2px; font-weight: 700; font-size: 0.84rem; cursor: pointer; color: var(--brand); display: inline-flex; align-items: center; gap: 6px; }
.btn-text:hover, .btn-text-pro:hover { text-decoration: underline; }
.mini-tag { font-size: 0.65rem; font-weight: 800; padding: 2px 6px; border-radius: 5px; background: var(--brand); color: #032219; letter-spacing: 0.04em; }

.table-scroll { margin-top: 12px; max-height: 290px; overflow: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.data-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
.data-table th { position: sticky; top: 0; background: var(--surface-solid); color: var(--text-secondary); text-align: right; padding: 8px 10px; font-weight: 700; border-bottom: 1px solid var(--border); }
.data-table th:first-child, .data-table td:first-child { text-align: left; }
.data-table td { text-align: right; padding: 7px 10px; border-bottom: 1px solid var(--border); }

/* Debt Payoff */
.debt-list { display: flex; flex-direction: column; gap: 10px; }
.debt-row { background: var(--surface-subtle); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px; }
.debt-row-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.debt-row-top input { min-height: 36px; font-size: 0.88rem; }
.btn-remove { min-width: 34px; height: 34px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: rgba(255, 255, 255, 0.04); color: var(--danger); font-size: 1.1rem; line-height: 1; cursor: pointer; }
.btn-remove:hover { background: var(--danger-soft); border-color: var(--danger); }
.debt-row-fields { display: grid; grid-template-columns: 1.2fr 0.85fr 1fr; gap: 8px; }
.debt-row-fields label { font-size: 0.72rem; margin-bottom: 3px; }
.debt-row-fields input { min-height: 36px; font-size: 0.85rem; padding: 6px 8px; }

.strategy-compare-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.strategy-box { border: 1px solid var(--border); border-radius: var(--radius-md); padding: 14px; background: var(--surface-subtle); }
.strategy-box.winner { background: var(--brand-soft); border-color: var(--brand-border); }
.strategy-header { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-bottom: 6px; }
.strategy-name { font-weight: 800; font-size: 0.92rem; }
.strategy-pill { font-size: 0.68rem; font-weight: 700; padding: 2px 8px; border-radius: var(--radius-pill); background: var(--brand); color: #032219; }
.strategy-pill.neutral { background: rgba(255, 255, 255, 0.12); color: var(--text); }
.strategy-date { font-size: 1.35rem; font-weight: 800; letter-spacing: -0.02em; }
.strategy-meta { margin-top: 6px; display: flex; flex-direction: column; gap: 2px; font-size: 0.82rem; color: var(--text-secondary); }
.payoff-order-box { margin-bottom: 12px; }
.payoff-order-box h3 { margin: 0 0 8px; font-size: 0.86rem; font-weight: 700; }
.payoff-order-list { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 5px; font-size: 0.84rem; color: var(--text-secondary); }
.muted-note { font-size: 0.8rem; color: var(--text-muted); }

/* Invoice Generator */
.invoice-grid { display: grid; grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr); gap: 18px; align-items: start; }
.inv-items-editor { display: flex; flex-direction: column; gap: 8px; }
.inv-line-row { display: grid; grid-template-columns: minmax(0, 1.8fr) 68px 94px 36px; gap: 6px; align-items: center; }
.inv-line-row input { min-height: 36px; font-size: 0.85rem; padding: 6px 8px; }
.tax-vault-banner { background: var(--amber-soft); border: 1px solid var(--amber-border); border-radius: var(--radius-md); padding: 13px 16px; margin-bottom: 14px; font-size: 0.86rem; }
.tax-vault-label { font-size: 0.72rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; color: var(--amber); margin-bottom: 3px; }
.tax-vault-banner p { margin: 0; }
.invoice-paper { background: #ffffff; color: #0f172a; border: 1px solid rgba(255, 255, 255, 0.2); border-radius: var(--radius-md); padding: 28px; box-shadow: var(--shadow-lg); }
.inv-logo { max-height: 44px; max-width: 160px; object-fit: contain; margin-bottom: 8px; display: block; }
.inv-paper-header { display: flex; justify-content: space-between; gap: 16px; border-bottom: 2px solid #0f172a; padding-bottom: 16px; margin-bottom: 18px; }
.inv-paper-brand { font-size: 1.15rem; font-weight: 800; }
.inv-paper-title { font-size: 1.25rem; font-weight: 800; letter-spacing: 0.08em; color: #059669; text-align: right; }
.inv-paper-meta { text-align: right; font-size: 0.85rem; }
.inv-paper-muted { color: #64748b; font-size: 0.83rem; }
.inv-paper-billto { margin-bottom: 20px; }
.inv-paper-section-label { font-size: 0.7rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; color: #64748b; margin-bottom: 3px; }
.inv-paper-client { font-weight: 700; font-size: 0.98rem; }
.inv-table { width: 100%; border-collapse: collapse; font-size: 0.86rem; margin-bottom: 16px; }
.inv-table th { text-align: left; padding: 8px 6px; border-bottom: 1.5px solid #cbd5e1; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; color: #475569; }
.inv-table th.num, .inv-table td.num { text-align: right; }
.inv-table td { padding: 9px 6px; border-bottom: 1px solid #e2e8f0; }
.inv-totals { margin-left: auto; max-width: 260px; display: flex; flex-direction: column; gap: 6px; font-size: 0.88rem; }
.inv-total-row { display: flex; justify-content: space-between; }
.inv-grand-total { border-top: 2px solid #0f172a; padding-top: 8px; margin-top: 4px; font-size: 1.05rem; }
.inv-paper-footer { margin-top: 24px; padding-top: 14px; border-top: 1px solid #e2e8f0; font-size: 0.82rem; color: #475569; }
.inv-watermark { margin-top: 14px; font-size: 0.74rem; color: #94a3b8; text-align: center; }
.pro-feature-row input[type="file"] { font-size: 0.82rem; }

/* Ad Slots & Rail */
.ad-slot { border-radius: var(--radius-md); border: 1px solid var(--border); background: var(--surface-subtle); overflow: hidden; display: flex; align-items: center; justify-content: center; }
.ad-slot-leaderboard { margin-top: 20px; min-height: 100px; }
.ad-slot-rectangle { min-height: 256px; }

.partner-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.partner-kicker { font-size: 0.76rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-secondary); }
.partner-disclosure { font-size: 0.7rem; color: var(--text-muted); border-bottom: 1px dotted var(--text-muted); cursor: help; }
.partner-list { display: flex; flex-direction: column; gap: 10px; }
.partner-item { display: block; text-decoration: none; color: inherit; padding: 12px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface-subtle); transition: border-color 0.16s ease, transform 0.15s ease, background 0.16s ease; }
.partner-item:hover { border-color: var(--brand-border); background: rgba(255, 255, 255, 0.07); transform: translateY(-1.5px); }
.partner-item-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-bottom: 3px; }
.partner-name { font-weight: 700; font-size: 0.88rem; color: var(--text); }
.partner-tag { font-size: 0.68rem; font-weight: 700; color: var(--brand); background: var(--brand-soft); padding: 2px 7px; border-radius: var(--radius-pill); }
.partner-desc { margin: 0; font-size: 0.79rem; color: var(--text-secondary); line-height: 1.42; }

.pro-upsell-card {
  background:
    radial-gradient(ellipse 90% 60% at 50% 0%, rgba(16, 185, 129, 0.18), transparent 65%),
    var(--surface);
  border-color: var(--brand-border);
}

.pro-upsell-eyebrow { font-size: 0.72rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; color: var(--brand); margin-bottom: 4px; }
.pro-upsell-card h3 { margin: 0 0 10px; font-size: 1.08rem; }
.pro-feature-list { margin: 0 0 14px; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 7px; font-size: 0.84rem; color: var(--text-secondary); }
.pro-feature-list li::before { content: "✓"; color: var(--brand); font-weight: 800; margin-right: 8px; }

/* Editorial & FAQs */
.editorial-section {
  margin-top: 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-md);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
}

.editorial-section h2 { margin: 0 0 10px; font-size: 1.25rem; letter-spacing: -0.02em; }
.editorial-section h3 { margin: 22px 0 10px; font-size: 1.02rem; }
.editorial-section p, .editorial-section li { color: var(--text-secondary); }
.editorial-section p { margin: 0 0 12px; }
.editorial-section a { color: var(--brand); }
.formula-box { background: var(--surface-subtle); border-left: 3.5px solid var(--brand); padding: 12px 16px; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; font-family: var(--font-mono); font-size: 0.84rem; margin: 14px 0; overflow-x: auto; }
.faq-list { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.faq-item { border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-subtle); padding: 0 14px; }
.faq-item summary { padding: 12px 0; font-weight: 700; font-size: 0.92rem; cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; font-size: 1.15rem; color: var(--brand); font-weight: 700; }
.faq-item[open] summary::after { content: "−"; }
.faq-item p { padding-bottom: 12px; margin: 0; font-size: 0.88rem; }

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  background: rgba(8, 12, 20, 0.72);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  padding: 34px 0;
  margin-top: 40px;
}

[data-theme="light"] .site-footer {
  background: rgba(255, 255, 255, 0.82);
}

.footer-inner { display: flex; flex-direction: column; gap: 14px; }
.footer-brand { font-size: 1.1rem; margin-bottom: 4px; }
.footer-brand strong { color: var(--brand); }
.footer-note, .footer-disclaimer { margin: 0; font-size: 0.82rem; color: var(--text-muted); }
.footer-links { display: flex; gap: 18px; flex-wrap: wrap; }
.footer-links a { color: var(--text-secondary); text-decoration: none; font-size: 0.86rem; font-weight: 600; transition: color 0.15s ease; }
.footer-links a:hover { color: var(--brand); }

/* Modals & Toast */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(3, 5, 10, 0.72);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-dialog {
  position: relative;
  width: 100%;
  max-width: 460px;
  max-height: 90vh;
  overflow-y: auto;
  background: linear-gradient(180deg, rgba(22, 30, 46, 0.94) 0%, rgba(12, 17, 29, 0.97) 100%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 26px;
  box-shadow: var(--shadow-lg);
}

[data-theme="light"] .modal-dialog {
  background: #ffffff;
}

.modal-wide { max-width: 580px; }
.modal-close { position: absolute; top: 14px; right: 14px; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--glass-border); background: var(--glass-bg); color: var(--text); font-size: 1.3rem; line-height: 1; cursor: pointer; }
.modal-dialog h2 { margin: 0 0 6px; font-size: 1.35rem; }
.modal-subtitle { margin: 0 0 16px; font-size: 0.88rem; color: var(--text-secondary); }
.pro-compare-box { background: var(--surface-subtle); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 16px; margin-bottom: 16px; }
.pro-tiers-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.pro-tier-card { background: var(--surface-subtle); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 15px; display: flex; flex-direction: column; justify-content: space-between; gap: 10px; }
.pro-tier-card.featured { background: var(--brand-soft); border-color: var(--brand-border); }
.pro-tier-name { font-size: 0.76rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; color: var(--brand); }
.pro-tier-sub { font-size: 0.78rem; color: var(--text-secondary); margin: 2px 0 0; }
.pro-price-display { display: flex; align-items: baseline; gap: 8px; margin-bottom: 12px; }
.pro-price-big { font-size: 2rem; font-weight: 800; color: var(--brand); }
.pro-price-term { font-size: 0.84rem; color: var(--text-muted); }
.license-divider { text-align: center; margin: 14px 0 10px; font-size: 0.78rem; color: var(--text-muted); }
.license-form { display: flex; gap: 8px; }
.demo-key-hint { margin: 10px 0 0; font-size: 0.78rem; color: var(--text-muted); text-align: center; }
.demo-key-hint code { font-family: var(--font-mono); background: var(--surface-subtle); padding: 2px 6px; border-radius: 5px; color: var(--brand); font-weight: 700; }

.saved-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.saved-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface-subtle); }
.saved-item-title { font-weight: 700; font-size: 0.9rem; }
.saved-item-meta { font-size: 0.78rem; color: var(--text-muted); }
.saved-item-actions { display: flex; gap: 6px; }
.saved-footer-actions { display: flex; justify-content: space-between; gap: 10px; }

.toast {
  position: fixed;
  bottom: 22px;
  right: 22px;
  z-index: 200;
  background: linear-gradient(180deg, rgba(16, 185, 129, 0.95) 0%, rgba(5, 150, 105, 0.95) 100%);
  color: #032219;
  padding: 12px 18px;
  border-radius: var(--radius-pill);
  font-size: 0.88rem;
  font-weight: 700;
  box-shadow: var(--shadow-lg);
}

/* Responsive */
@media (max-width: 1080px) {
  .workspace-grid { grid-template-columns: 1fr; }
  .workspace-rail { position: static; display: grid; grid-template-columns: 1fr 1fr; }
}

@media (max-width: 900px) {
  .bento-span-7, .bento-span-5, .bento-span-6, .bento-span-4 { grid-column: span 12; }
  .principles-grid, .studio-pricing-grid { grid-template-columns: 1fr; }
  .studio-nav-links { display: none; }
}

@media (max-width: 820px) {
  .calc-card-grid, .invoice-grid { grid-template-columns: 1fr; }
  .workspace-rail { grid-template-columns: 1fr; }
  .btn-label-desktop { display: none; }
  .kpi-grid-3 { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  .form-row-2, .form-row-3, .strategy-compare-grid, .breakdown-legend, .pro-tiers-grid { grid-template-columns: 1fr; }
  .inv-line-row { grid-template-columns: 1fr 64px 84px 36px; }
  .header-inner { height: auto; padding: 12px 0; flex-wrap: wrap; }
}

@media print {
  body { background: #ffffff !important; color: #0f172a !important; }
  .site-header, .no-print, .workspace-rail, .editorial-section, .site-footer, .modal-backdrop, .toast { display: none !important; }
  .workspace-grid, .calc-card-grid, .invoice-grid { display: block !important; }
  .card { background: #ffffff !important; color: #0f172a !important; box-shadow: none !important; border: 1px solid #cbd5e1 !important; break-inside: avoid; margin-bottom: 16px; }
  .invoice-paper { border: none !important; box-shadow: none !important; padding: 0 !important; }
}
