:root{
  --ink: #0E1A2B;
  --ink-2: #16273D;
  --paper: #F4F0E6;
  --gold: #D4A73C;
  --gold-dim: #8A7233;
  --teal: #3FA796;
  --red: #C1543C;
  --line: rgba(244,240,230,0.16);
  --muted: rgba(244,240,230,0.55);
  --surface: #16273D;
  --text: #F4F0E6;
  --font-mono: 'IBM Plex Mono', monospace;
  --font-sans: 'IBM Plex Sans', sans-serif;
}
*{box-sizing:border-box; margin:0; padding:0;}
body{
  background: var(--ink);
  color: var(--paper);
  font-family: 'IBM Plex Sans', sans-serif;
  min-height: 100vh;
  padding: 48px 20px 80px;
}
.wrap{ width: 100%; max-width: 760px; margin: 0 auto; box-sizing: border-box; }

.eyebrow{
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 14px;
}
h1{
  font-family: 'Fraunces', serif;
  font-weight: 500;
  font-size: clamp(32px, 5vw, 48px);
  line-height: 1.15;
  letter-spacing: -0.01em;
}
h2{
  font-family: 'Fraunces', serif;
  font-weight: 500;
  font-size: 22px;
  margin-top: 36px;
  margin-bottom: 12px;
}
p{ line-height: 1.85; margin-top: 14px; color: rgba(244,240,230,0.9); font-size: 15.5px; }
.lead{ margin-top: 20px; color: var(--muted); font-size: 16px; }
.sub{
  margin-top: 14px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.7;
  max-width: 600px;
}
.tool{
  margin-top: 32px;
}
.group{
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 24px;
  margin-bottom: 20px;
}
.group-title{
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--gold);
  margin-bottom: 18px;
}
.grid{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}
.field{
  display: flex;
  flex-direction: column;
}
label{
  font-size: 13px;
  color: rgba(244,240,230,0.85);
  margin-bottom: 8px;
  font-weight: 500;
}
label span.hint{
  font-size: 11px;
  color: var(--gold-dim);
  margin-left: 6px;
  font-family: 'IBM Plex Mono', monospace;
}
input[type=number], input[type=text], select{
  background: var(--ink);
  border: 1px solid var(--line);
  color: var(--paper);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 16px;
  width:100%;
  padding: 12px 14px;
  border-radius: 3px;
  outline: none;
  transition: border-color .15s;
}
input[type=number]:focus, input[type=text]:focus, select:focus{ border-color: var(--gold); }
select{ appearance:none; cursor:pointer; }
.unit{ font-size:11px; color:var(--muted); margin-top:6px; font-family:'IBM Plex Mono',monospace; }

.ticket{
  margin-top: 40px;
  display:flex;
  background: var(--paper);
  border-radius: 6px;
  overflow: visible;
  box-shadow: 0 20px 60px rgba(0,0,0,0.35);
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
.stub, .main{ padding: 28px 26px; box-sizing: border-box; }
.main{ flex: 1; color: var(--ink); position:relative; min-width: 0; max-width: 100%; width: 100%; overflow: visible; }
.stub{
  width: 200px;
  min-width: 160px;
  flex-shrink: 0;
  background: var(--ink);
  color: var(--paper);
  display:flex; flex-direction:column; justify-content:space-between;
  box-sizing: border-box;
}
.perf{
  width:0; position:relative;
}
.perf::before{
  content:"";
  position:absolute; top:0; bottom:0; left:-1px;
  border-left: 2px dashed rgba(14,26,43,0.25);
}
.verdict-label{ font-family:'IBM Plex Mono', monospace; font-size:11px; letter-spacing:0.12em; text-transform:uppercase; color: var(--gold); }
.verdict{
  font-family:'Fraunces', serif; font-weight:600; font-size:26px; margin-top:10px; line-height:1.2;
}
.verdict.good{ color: var(--teal); }
.verdict.bad{ color: var(--red); }
.stub .code{ font-family:'IBM Plex Mono', monospace; font-size:12px; opacity:.6; letter-spacing:0.08em; }

.compare{ display:flex; gap: 28px; margin-top:22px; }
.compare .item{ flex:1; }
.compare .k{ font-size:11px; text-transform:uppercase; letter-spacing:0.1em; color:#6B6656; font-family:'IBM Plex Mono',monospace; }
.compare .v{ font-family:'IBM Plex Mono', monospace; font-size:24px; margin-top:6px; font-weight:600; }
.compare .v.win{ color: #1D7A67; }
.note{ margin-top:16px; font-size:12.5px; color:#6B6656; line-height:1.6; }

.ref{
  margin-top: 36px;
  border-top: 1px solid var(--line);
  padding-top: 24px;
}
.ref h2{ font-family:'IBM Plex Mono', monospace; font-size:12px; text-transform:uppercase; letter-spacing:0.12em; color: var(--muted); margin-bottom:14px; }
table{ width:100%; border-collapse: collapse; font-size:13px; margin-top:16px; }
th, td{ text-align:left; padding: 9px 8px; border-bottom: 1px solid var(--line); }
th{ color: var(--muted); font-weight:500; font-size:12px; }
td{ font-family:'IBM Plex Mono', monospace; }
.disclaimer{ margin-top: 32px; font-size:12px; color: var(--muted); line-height:1.7; border-top:1px solid var(--line); padding-top:20px; }

.reads{ margin-top: 40px; border-top: 1px solid var(--line); padding-top: 24px; }
.reads h2{ font-family:'IBM Plex Mono', monospace; font-size:12px; text-transform:uppercase; letter-spacing:0.12em; color: var(--muted); margin-bottom:14px; }
.reads .item{ display:flex; justify-content:space-between; align-items:center; padding:16px 0; border-bottom:1px solid rgba(244,240,230,0.06); text-decoration:none; color:var(--paper); }
.reads .item:hover{ color:var(--gold); }
.reads .item .arrow{ font-family:'IBM Plex Mono',monospace; opacity:0.5; transition:transform .2s; }
.reads .item:hover .arrow{ transform:translateX(4px); opacity:1; color:var(--gold); }

.callout{ margin-top:28px; background:var(--ink-2); border-left:3px solid var(--gold); padding:18px 20px; border-radius:4px; font-size:14.5px; color:var(--muted); }
.callout.warn{ border-left-color: var(--red); }
.cta{ margin-top:40px; background:var(--ink-2); border:1px solid var(--line); border-radius:6px; padding:26px; text-align:center; }
.cta a.btn{ display:inline-block; margin-top:14px; background:var(--gold); color:var(--ink); padding:12px 28px; border-radius:4px; text-decoration:none; font-weight:600; font-family:'IBM Plex Mono',monospace; font-size:14px; }
.cta a.btn:hover{ opacity:0.9; }

nav.breadcrumb{ font-family: 'IBM Plex Mono', monospace; font-size: 11px; margin-bottom: 24px; color: var(--muted); }
nav.breadcrumb a{ color: var(--muted); text-decoration: none; border-bottom: 1px solid transparent; transition: border-color .2s; }
nav.breadcrumb a:hover{ border-color: var(--muted); }
nav.breadcrumb span.sep{ margin: 0 8px; opacity: 0.4; }

.site-nav{ display:flex; justify-content:space-between; align-items:center; flex-wrap:wrap; gap:12px; font-family:'IBM Plex Mono',monospace; font-size:12px; text-transform:uppercase; letter-spacing:0.05em; padding-bottom:16px; margin-bottom:48px; border-bottom:1px solid var(--line); }
.site-nav a{ color:var(--paper); text-decoration:none; margin-left: 12px; }
.site-nav a:hover{ color:var(--gold); }
.site-nav .brand{ color:var(--gold); margin-left:0; font-weight:600; letter-spacing:0.1em; }

@media (max-width: 760px){
  .ticket{ flex-direction: column; }
  .stub{ width: 100%; min-width: 0; flex-direction:row; align-items:center; }
  .compare{ flex-direction: column; gap: 14px; }
}
@media (max-width: 560px){
  .ticket .main {
    padding: 20px 14px;
  }
}
/* FAQ and Formula Styles */
.faq {
  display: grid;
  gap: 0.75rem;
}

.faq details {
  margin: 0;
  border: 1px solid #d7dee8;
  border-radius: 0.75rem;
  background: #f8fafc;
  color: #172033; /* ensure dark text on light background */
  overflow: hidden;
}

.faq summary {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 1rem 1.125rem;
  background: #f8fafc;
  color: #172238; /* enforce dark text over any container inherited color */
  font-weight: 600;
  line-height: 1.45;
  cursor: pointer;
  list-style: none; /* remove default arrow */
}
/* hide default arrow in webkit */
.faq summary::-webkit-details-marker {
  display: none;
}

/* Custom dark arrow that rotates */
.faq summary::before {
  content: "▶";
  font-size: 0.8em;
  color: #475569;
  transition: transform 0.2s ease-in-out;
}

.faq summary:hover {
  background: #eef3f8;
}

.faq summary:focus-visible {
  outline: 3px solid #3b82f6;
  outline-offset: -3px;
}

.faq details[open] summary {
  border-bottom: 1px solid #d7dee8;
  background: #eef3f8;
}
.faq details[open] summary::before {
  transform: rotate(90deg);
}

.faq details > :not(summary) {
  padding: 1rem 1.125rem;
  color: #273449;
  line-height: 1.7;
}

/* Force dark text for paragraph and list elements inside light FAQ cards to override global dark mode colors */
.faq details > :not(summary) p,
.faq details > :not(summary) ul,
.faq details > :not(summary) ol,
.faq details > :not(summary) div {
  color: #273449;
  line-height: 1.7;
}

.faq details > :not(summary) a {
  color: #1e3a8a; /* Accessible deep blue */
  text-decoration: underline;
}

.faq details > :not(summary) a:hover,
.faq details > :not(summary) a:focus-visible,
.faq details > :not(summary) a:visited {
  color: #172554;
}

.formula-box,
.prose blockquote.formula {
  margin-block: 1rem 1.5rem;
  padding: 1rem 1.125rem;
  border-left: 4px solid #60a5fa;
  border-radius: 0.5rem;
  background: #172438;
  color: #f8fafc;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: clamp(0.9rem, 1.5vw, 1rem);
  font-weight: 500;
  line-height: 1.7;
  overflow-wrap: anywhere;
  word-break: normal;
  white-space: normal;
}

.prose {
  max-width: 72ch;
}

.prose-wide {
  max-width: 84ch;
}

/* Headings spacing fixes */
h3 + .faq, h2 + .faq {
  margin-top: 1rem;
}
.formula-box + h3, .faq + h3 {
  margin-top: 2.5rem;
}

@media (max-width: 640px) {
  .faq summary {
    padding: 0.875rem 1rem;
    font-size: 0.975rem;
  }

  .faq details > :not(summary) {
    padding: 1rem 1rem;
  }
}

.btn-share {
  padding: 4px 12px;
  border-radius: 4px;
  border: 1px solid #0284c7;
  background: #e0f2fe;
  color: #0284c7;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.2s;
}
.btn-share:hover {
  background: #bae6fd;
}
.toast {
  display: none;
  position: fixed;
  top: 20px;
  right: 20px;
  background: #22c55e;
  color: white;
  padding: 10px 20px;
  border-radius: 4px;
  z-index: 1000;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

/* --- Phase 9.3 Component Classes & Accessibility --- */

/* Direct Answer Box for quick search intent resolution */
.direct-answer {
  margin-top: 24px;
  margin-bottom: 24px;
  padding: 18px 20px;
  background: #16273d;
  border-left: 4px solid var(--gold);
  border-radius: 4px;
  color: #f8fafc;
  font-size: 15.5px;
  line-height: 1.7;
}
.direct-answer strong {
  color: var(--gold);
}

/* Decision Framework Container */
.decision-framework {
  margin-top: 28px;
  margin-bottom: 28px;
  padding: 22px 24px;
  background: #16273d;
  border: 1px solid var(--line);
  border-radius: 6px;
}
.decision-framework h3 {
  margin-top: 0;
  margin-bottom: 12px;
  color: #ffffff;
  font-size: 18px;
}
.decision-framework ol {
  margin-top: 8px;
  padding-left: 20px;
  color: rgba(244, 240, 230, 0.95);
  line-height: 1.8;
}
.decision-framework li {
  margin-bottom: 10px;
}
.decision-framework li:last-child {
  margin-bottom: 0;
}

/* Popular Calculators Grid (Homepages) */
.popular-calculators {
  margin-bottom: 2rem;
  padding: 1.25rem;
  background: #16273d;
  border: 1px solid var(--line);
  border-radius: 0.75rem;
}
.popular-calculators h2 {
  margin-top: 0;
  font-size: 1.15rem;
  color: #ffffff;
}
.popular-calculators-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.75rem;
  margin-top: 0.75rem;
}

/* Calculator Link Cards */
.calculator-link-card {
  display: block;
  padding: 0.875rem 1rem;
  background: #0e1a2b;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  text-decoration: none;
  color: #ffffff;
  font-weight: 600;
  transition: border-color 0.2s, background 0.2s;
}
.calculator-link-card:hover {
  border-color: var(--gold);
  background: #16273d;
  opacity: 1;
}
.calculator-link-card span {
  display: block;
  font-size: 0.82rem;
  font-weight: normal;
  color: var(--muted);
  margin-top: 0.25rem;
}

/* Related Tools Section */
.related-tools {
  margin-top: 36px;
  padding: 20px;
  background: #16273d;
  border: 1px solid var(--line);
  border-radius: 6px;
}
.related-tools h3 {
  margin-top: 0;
  font-size: 1.1rem;
  color: #ffffff;
  margin-bottom: 12px;
}
.related-tools ul {
  margin-top: 6px;
  padding-left: 20px;
}
.related-tools li {
  margin-bottom: 6px;
}

/* Responsive Table Container */
.responsive-table-wrapper {
  overflow-x: auto;
  margin-block: 1.5rem;
  -webkit-overflow-scrolling: touch;
  border-radius: 6px;
  border: 1px solid var(--line);
}
.responsive-table {
  width: 100%;
  border-collapse: collapse;
  text-align: right;
  min-width: 520px;
  font-size: 0.95rem;
  background: #ffffff;
  color: #1e293b;
}
.responsive-table th {
  background: #f1f5f9;
  border-bottom: 2px solid #cbd5e1;
  color: #0f172a;
  padding: 12px 14px;
  font-weight: 600;
}
.responsive-table td {
  padding: 10px 14px;
  color: #334155;
  border-bottom: 1px solid #e2e8f0;
}
.responsive-table tr:nth-child(even) td {
  background: #fafafa;
}

/* Case Study Callout Box */
.case-card {
  margin-top: 20px;
  margin-bottom: 20px;
  padding: 18px 20px;
  background: #16273d;
  border: 1px solid var(--line);
  border-radius: 6px;
}
.case-card h4 {
  margin-top: 0;
  font-size: 16px;
  color: var(--gold);
}
.case-card p {
  margin-top: 8px;
  font-size: 14.5px;
}

/* Focus and Reduced Motion Accessibility */
:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* --- Phase 9.3.1 Help Component & Scenario Guide --- */
.btn-help-toggle {
  background: none;
  border: 1px solid var(--gold-dim);
  color: var(--gold);
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 12px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 4px;
  cursor: pointer;
  margin-left: 8px;
  transition: all 0.2s;
  vertical-align: middle;
}
.btn-help-toggle:hover, .btn-help-toggle:focus-visible {
  background: rgba(212, 167, 60, 0.15);
  border-color: var(--gold);
  color: #fff;
}
.btn-help-toggle[aria-expanded="true"] {
  background: var(--gold);
  color: var(--ink);
  font-weight: 600;
}

.help-scenario-guide {
  margin-top: 14px;
  margin-bottom: 18px;
  padding: 16px 18px;
  background: #0f1d30;
  border: 1px solid var(--line);
  border-left: 3px solid var(--gold);
  border-radius: 4px;
  font-size: 14px;
  color: #f8fafc;
}
.help-scenario-guide h4 {
  margin-top: 0;
  margin-bottom: 8px;
  color: var(--gold);
  font-size: 15px;
}
.help-scenario-guide .guide-step {
  margin-bottom: 12px;
}
.help-scenario-guide .guide-step:last-child {
  margin-bottom: 0;
}
.help-scenario-guide .guide-step strong {
  color: #ffffff;
}
.help-scenario-guide .guide-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.btn-link-action {
  display: inline-block;
  font-size: 12.5px;
  padding: 4px 10px;
  background: #1e293b;
  border: 1px solid #475569;
  border-radius: 4px;
  color: #93c5fd;
  text-decoration: none;
  transition: all 0.2s;
}
.btn-link-action:hover, .btn-link-action:focus-visible {
  background: #334155;
  border-color: #60a5fa;
  color: #ffffff;
  opacity: 1;
}

/* --- Trip Cost After Points Calculator Styles --- */
.budget-section {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 20px;
  margin-bottom: 24px;
}
.budget-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}
.budget-section-title {
  font-family: 'Fraunces', serif;
  font-size: 18px;
  font-weight: 500;
  color: var(--paper);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.expense-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
  gap: 16px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
.expense-grid .field,
.ticket .main .expense-grid .field {
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}
.toggle-switch-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: var(--gold);
  user-select: none;
}
.toggle-switch-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--gold);
  cursor: pointer;
}

/* Plan Comparison Grid */
.plan-comparison-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: 24px 0;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
.plan-comparison-grid > * {
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}
@media (max-width: 760px) {
  .plan-comparison-grid,
  .ticket .main .plan-comparison-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}
.plan-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 20px;
  position: relative;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}
.plan-card.highlight {
  border-color: var(--gold);
  background: linear-gradient(180deg, rgba(212, 167, 60, 0.08) 0%, var(--surface) 100%);
}
.plan-card-title {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-bottom: 8px;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: normal;
}
.plan-card.highlight .plan-card-title {
  color: var(--gold);
  font-weight: 600;
}
.plan-card-desc {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: normal;
}
.plan-card-price {
  font-family: 'IBM Plex Mono', monospace;
  font-size: clamp(24px, 4vw, 32px);
  font-weight: 600;
  color: var(--paper);
  margin-bottom: 12px;
  min-width: 0;
  white-space: nowrap;
}
.plan-card.highlight .plan-card-price {
  color: #38bdf8;
}
.plan-metrics-list {
  list-style: none;
  padding: 0;
  margin: 16px 0 0 0;
  border-top: 1px solid var(--line);
  padding-top: 12px;
  font-size: 13.5px;
  color: var(--muted);
  min-width: 0;
  box-sizing: border-box;
}
.plan-metrics-list li {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
  min-width: 0;
}
.plan-metrics-list li strong {
  color: var(--paper);
  font-family: 'IBM Plex Mono', monospace;
}

/* --- Scoped Light Result Area Theme (.ticket .main & .trip-cost-ticket) --- */
.wrap.wrap-wide {
  max-width: 1060px;
}

.ticket.trip-cost-ticket {
  display: flex;
  flex-direction: column;
  background: var(--paper);
  border-radius: 6px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow: visible;
}

.ticket.trip-cost-ticket .ticket-header-row {
  display: flex;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  border-bottom: 2px dashed rgba(14, 26, 43, 0.25);
}

.ticket.trip-cost-ticket .main-summary {
  flex: 1;
  padding: 28px 26px;
  color: #0e1a2b;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.ticket.trip-cost-ticket .stub {
  width: 200px;
  min-width: 170px;
  flex-shrink: 0;
  background: var(--ink);
  color: var(--paper);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 28px 22px;
  box-sizing: border-box;
}

.ticket.trip-cost-ticket .ticket-full-width-section {
  padding: 24px 26px 28px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  color: #0e1a2b;
}

@media (max-width: 760px) {
  .ticket.trip-cost-ticket .ticket-header-row {
    flex-direction: column;
  }
  .ticket.trip-cost-ticket .stub {
    width: 100%;
    min-width: 0;
    flex-direction: row;
    align-items: center;
    border-bottom: 2px dashed rgba(14, 26, 43, 0.25);
    padding: 20px 16px;
  }
  .ticket.trip-cost-ticket .main-summary,
  .ticket.trip-cost-ticket .ticket-full-width-section {
    padding: 20px 14px;
  }
}

.ticket .main,
.ticket.trip-cost-ticket .main-summary {
  color: #0e1a2b;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: visible;
  box-sizing: border-box;
}
.ticket .main > *,
.ticket.trip-cost-ticket .main-summary > * {
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}
.ticket .main .plan-comparison-grid,
.ticket .main .expense-grid,
.ticket.trip-cost-ticket .plan-comparison-grid,
.ticket.trip-cost-ticket .expense-grid {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
.ticket .main .plan-comparison-grid > *,
.ticket .main .expense-grid > *,
.ticket .main .field,
.ticket .main .plan-card,
.ticket.trip-cost-ticket .field,
.ticket.trip-cost-ticket .plan-card {
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}
.ticket .main .plan-card,
.ticket.trip-cost-ticket .plan-card {
  background: #ffffff;
  border-color: rgba(14, 26, 43, 0.18);
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: normal;
}
.ticket .main .plan-card.highlight,
.ticket.trip-cost-ticket .plan-card.highlight {
  background: #ffffff;
  border-color: #2563eb;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.08);
}
.ticket .main .plan-card-title,
.ticket .main .plan-card-desc,
.ticket .main .field label,
.ticket .main .unit,
.ticket .main .plan-metrics-list,
.ticket.trip-cost-ticket .plan-card-title,
.ticket.trip-cost-ticket .plan-card-desc,
.ticket.trip-cost-ticket .field label,
.ticket.trip-cost-ticket .unit,
.ticket.trip-cost-ticket .plan-metrics-list {
  color: #475569;
}
.ticket .main .plan-card.highlight .plan-card-title,
.ticket.trip-cost-ticket .plan-card.highlight .plan-card-title {
  color: #1d4ed8;
}
.ticket .main .plan-card-price,
.ticket .main .plan-metrics-list strong,
.ticket.trip-cost-ticket .plan-card-price,
.ticket.trip-cost-ticket .plan-metrics-list strong {
  color: #0e1a2b;
}
.ticket .main .plan-card-price,
.ticket.trip-cost-ticket .plan-card-price {
  white-space: nowrap;
  font-size: clamp(22px, 4vw, 30px);
}
.ticket .main .plan-card.highlight .plan-card-price,
.ticket.trip-cost-ticket .plan-card.highlight .plan-card-price {
  color: #1e40af;
}
.ticket .main h2,
.ticket .main h3,
.ticket.trip-cost-ticket h2,
.ticket.trip-cost-ticket h3 {
  color: #0e1a2b;
}
.ticket .main .expense-grid .field label,
.ticket .main .expense-grid .field .unit,
.ticket.trip-cost-ticket .expense-grid .field label,
.ticket.trip-cost-ticket .expense-grid .field .unit {
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
}
.ticket .main .expense-grid .field > div:not(.unit),
.ticket.trip-cost-ticket .expense-grid .field > div:not(.unit) {
  max-width: 100%;
  overflow-wrap: anywhere;
}

/* Responsive visibility for Waterfall Breakdown */
@media (min-width: 700px) {
  .waterfall-desktop-view {
    display: block !important;
  }
  .waterfall-mobile-view {
    display: none !important;
  }
}

@media (max-width: 699px) {
  .waterfall-desktop-view {
    display: none !important;
  }
  .waterfall-mobile-view {
    display: flex !important;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }
}

/* Responsive Table Wrapper & Waterfall Table in Ticket Result Area */
.responsive-table-wrapper {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-inline: contain;
  box-sizing: border-box;
  background: #ffffff;
  border: 1px solid rgba(14, 26, 43, 0.18);
  border-radius: 8px;
  margin: 16px 0;
}

.waterfall-table,
.ticket .main .waterfall-table,
.ticket-full-width-section .waterfall-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  background: #ffffff;
  color: #0e1a2b;
  font-size: 13.5px;
  box-sizing: border-box;
}

.waterfall-table thead th,
.ticket .main .waterfall-table thead th,
.ticket-full-width-section .waterfall-table thead th {
  padding: 12px 14px;
  background: #e7edf4;
  color: #0e1a2b;
  border-bottom: 2px solid #94a3b8;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
  vertical-align: middle;
  text-align: right;
  box-sizing: border-box;
}

.waterfall-table thead th:first-child {
  width: 28%;
  text-align: left;
}

.waterfall-table thead th:not(:first-child) {
  width: 18%;
}

.waterfall-table tbody td,
.waterfall-table tbody th {
  padding: 12px 14px;
  color: #0e1a2b;
  border-bottom: 1px solid rgba(14, 26, 43, 0.16);
  vertical-align: middle;
  text-align: right;
  font-family: 'IBM Plex Mono', monospace;
  box-sizing: border-box;
}

.waterfall-table tbody th[scope="row"] {
  text-align: left;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-weight: 600;
}

.waterfall-table tbody tr:nth-child(even) td,
.waterfall-table tbody tr:nth-child(even) th {
  background: #f8fafc;
}

.waterfall-table .col-deduction {
  color: #166534;
  font-weight: 600;
}

.waterfall-table .col-taxes {
  color: #b42318;
  font-weight: 600;
}

.waterfall-table .col-muted {
  color: #64748b;
  font-weight: 400;
}

.waterfall-table tfoot td,
.waterfall-table tfoot th,
.waterfall-row-total td,
.waterfall-row-total th {
  background: #dbeafe !important;
  color: #0e1a2b !important;
  font-weight: 700;
  border-top: 2px solid #2563eb !important;
  border-bottom: none;
}

.waterfall-table tfoot td.col-deduction,
.waterfall-row-total td.col-deduction {
  color: #166534 !important;
}

.waterfall-table tfoot td.col-taxes,
.waterfall-row-total td.col-taxes {
  color: #b42318 !important;
}

.waterfall-table tfoot td:last-child,
.waterfall-table tfoot td.col-final,
.waterfall-row-total td:last-child,
.waterfall-row-total td.col-final {
  color: #1e3a8a !important;
  font-size: 16px;
  font-weight: 700;
}

/* Mobile Vertical Cards Styles */
.waterfall-mobile-card-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.waterfall-mobile-card {
  background: #ffffff;
  border: 1px solid rgba(14, 26, 43, 0.16);
  border-radius: 8px;
  padding: 14px 16px;
  box-sizing: border-box;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.waterfall-mobile-card h3 {
  margin: 0 0 10px 0;
  font-size: 15px;
  font-weight: 700;
  color: #0e1a2b;
}

.waterfall-mobile-card dl {
  margin: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  width: 100%;
  box-sizing: border-box;
}

.waterfall-mobile-card dl > div {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 13.5px;
  padding: 4px 0;
  border-bottom: 1px dashed rgba(14, 26, 43, 0.08);
  width: 100%;
  box-sizing: border-box;
}

.waterfall-mobile-card dl > div:last-child {
  border-bottom: none;
}

.waterfall-mobile-card dt {
  color: #475569;
  font-weight: 500;
}

.waterfall-mobile-card dd {
  margin: 0;
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 600;
  color: #0e1a2b;
  text-align: right;
}

.waterfall-mobile-card dd.value-deduction {
  color: #166534;
}

.waterfall-mobile-card dd.value-fees {
  color: #b42318;
}

.waterfall-mobile-card dd.value-muted {
  color: #64748b;
  font-weight: 400;
}

.waterfall-mobile-card .final-value {
  margin-top: 4px;
  padding-top: 6px;
  border-top: 1px solid rgba(14, 26, 43, 0.14) !important;
  font-weight: 700;
}

.waterfall-mobile-card .final-value dt {
  color: #0e1a2b;
  font-weight: 700;
}

.waterfall-mobile-card .final-value dd {
  color: #1e3a8a;
  font-size: 15px;
  font-weight: 700;
}

/* Total Card (Highlighted) */
.waterfall-mobile-card-total-wrap {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  margin-top: 4px;
}

.waterfall-mobile-card-total {
  background: #dbeafe;
  border: 2px solid #2563eb;
  border-radius: 8px;
  padding: 16px;
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
}

.waterfall-mobile-card-total h3 {
  margin: 0 0 12px 0;
  font-size: 16px;
  font-weight: 800;
  color: #0e1a2b;
}

.waterfall-mobile-card-total dl {
  margin: 0;
  display: grid;
  gap: 8px;
  width: 100%;
  box-sizing: border-box;
}

.waterfall-mobile-card-total dl > div {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 14px;
  padding: 4px 0;
  border-bottom: 1px dashed rgba(37, 99, 235, 0.2);
  width: 100%;
  box-sizing: border-box;
}

.waterfall-mobile-card-total dl > div:last-child {
  border-bottom: none;
}

.waterfall-mobile-card-total dt {
  color: #1e3a8a;
  font-weight: 600;
}

.waterfall-mobile-card-total dd {
  margin: 0;
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 700;
  color: #0e1a2b;
}

.waterfall-mobile-card-total dd.value-deduction {
  color: #166534;
}

.waterfall-mobile-card-total dd.value-fees {
  color: #b42318;
}

.waterfall-mobile-card-total .final-value {
  margin-top: 6px;
  padding-top: 8px;
  border-top: 2px solid #2563eb !important;
}

.waterfall-mobile-card-total .final-value dt {
  color: #0e1a2b;
  font-size: 15px;
  font-weight: 800;
}

.waterfall-mobile-card-total .final-value dd {
  color: #1e3a8a;
  font-size: 18px;
  font-weight: 800;
}

/* Calculator Actions Toolbar */
.calculator-actions-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
  width: 100%;
  box-sizing: border-box;
}

.calculator-actions-toolbar .btn-action {
  min-height: 44px;
  padding: 10px 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  font-size: 13.5px;
  font-weight: 600;
  border-radius: 4px;
}

@media (max-width: 600px) {
  .calculator-actions-toolbar {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  .calculator-actions-toolbar .btn-action {
    width: 100%;
    padding: 10px 8px;
    font-size: 13px;
    white-space: normal;
    text-align: center;
  }
}

@media (max-width: 360px) {
  .calculator-actions-toolbar {
    grid-template-columns: 1fr;
  }
}

/* Tool Buttons Bar */
.budget-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 20px 0;
  align-items: center;
}
.btn-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 4px;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--paper);
  text-decoration: none;
}
.btn-action:hover, .btn-action:focus-visible {
  border-color: var(--gold);
  background: rgba(212, 167, 60, 0.1);
  color: #fff;
}
.btn-action-primary {
  background: var(--gold);
  color: var(--ink);
  font-weight: 600;
  border-color: var(--gold);
}
.btn-action-primary:hover, .btn-action-primary:focus-visible {
  background: #e5b340;
  color: var(--ink);
}

/* Status Badges */
.badge-status {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
}
.badge-success {
  background: rgba(74, 222, 128, 0.15);
  color: #166534;
  border: 1px solid rgba(22, 101, 52, 0.3);
}
.badge-warning {
  background: rgba(250, 204, 21, 0.15);
  color: #854d0e;
  border: 1px solid rgba(133, 77, 14, 0.3);
}
.badge-danger {
  background: rgba(248, 113, 113, 0.15);
  color: #b42318;
  border: 1px solid rgba(180, 35, 24, 0.3);
}
.badge-neutral {
  background: rgba(100, 116, 139, 0.15);
  color: #475569;
  border: 1px solid rgba(71, 85, 105, 0.3);
}

/* Print Stylesheet */
@media print {
  body {
    background: #ffffff !important;
    color: #000000 !important;
  }
  .site-nav, .site-footer, .breadcrumb, .currency-selector, .budget-toolbar, .btn-action, .btn-help-toggle, .calculator-actions-toolbar, .toast {
    display: none !important;
  }
  .wrap {
    max-width: 100% !important;
    padding: 0 !important;
  }
  .budget-section, .plan-card, .ticket {
    background: #ffffff !important;
    border: 1px solid #cccccc !important;
    color: #000000 !important;
    box-shadow: none !important;
  }
  .ticket .main .responsive-table-wrapper {
    overflow: visible !important;
    border: 1px solid #666666 !important;
  }
  .ticket .main .waterfall-table {
    min-width: 0 !important;
    width: 100% !important;
    color: #000000 !important;
    background: #ffffff !important;
  }
  .ticket .main .waterfall-table thead th {
    color: #000000 !important;
    background: #e5e7eb !important;
    border-bottom: 2px solid #000000 !important;
  }
  .ticket .main .waterfall-table tbody td {
    color: #000000 !important;
    border-bottom: 1px solid #999999 !important;
  }
  .ticket .main .waterfall-row-total td {
    color: #000000 !important;
    background: #eeeeee !important;
  }
  .plan-card-price, .waterfall-row-total td:last-child {
    color: #000000 !important;
  }
}



/* Language Switcher */
.lang-switcher {
  margin-left: 20px;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.lang-switcher a.lang-link {
  margin-left: 0;
  text-decoration: none;
  font-weight: 500;
  color: #94a3b8; /* Slate 400 - high contrast inactive */
  padding: 4px 8px;
  border-radius: 4px;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}
.lang-switcher a.lang-link:hover, .lang-switcher a.lang-link:focus {
  color: var(--paper);
  background: rgba(244, 240, 230, 0.1);
  outline: none;
}
.lang-switcher a.lang-link[aria-current="page"] {
  color: var(--gold);
  font-weight: 600;
  border: 1px solid var(--gold);
  background: rgba(212, 167, 60, 0.1);
}

/* Phase 9.9: Hotel Points vs Cash Calculator Refactor Styles */
.hotel-examples-wrapper {
  margin-bottom: 24px;
}
.hotel-examples-label {
  font-size: 12px;
  font-family: var(--font-mono);
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 10px;
}
.hotel-examples-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.btn-hotel-example {
  background: rgba(212, 167, 60, 0.1);
  color: var(--paper);
  border: 1px solid rgba(212, 167, 60, 0.35);
  border-radius: 6px;
  padding: 8px 14px;
  min-height: 44px;
  font-size: 13px;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn-hotel-example:hover, .btn-hotel-example:focus {
  background: rgba(212, 167, 60, 0.22);
  border-color: var(--gold);
  outline: none;
}
.hotel-notice-banner {
  background: rgba(56, 189, 248, 0.08);
  border-left: 4px solid #38bdf8;
  border-radius: 4px;
  padding: 14px 16px;
  margin-bottom: 24px;
  font-size: 14px;
  line-height: 1.6;
  color: rgba(244, 240, 230, 0.95);
}
.hotel-notice-banner strong {
  color: #38bdf8;
}
.program-policy-card {
  background: rgba(22, 39, 61, 0.7);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 14px 16px;
  margin-top: 10px;
  font-size: 13px;
  line-height: 1.6;
}
.program-policy-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.policy-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-family: var(--font-mono);
  font-weight: 600;
  text-transform: uppercase;
}
.policy-badge.waived {
  background: rgba(63, 167, 150, 0.2);
  color: #4ade80;
  border: 1px solid rgba(74, 222, 128, 0.3);
}
.policy-badge.charged {
  background: rgba(193, 84, 60, 0.2);
  color: #f87171;
  border: 1px solid rgba(248, 113, 113, 0.3);
}
.policy-badge.varies {
  background: rgba(212, 167, 60, 0.2);
  color: #facc15;
  border: 1px solid rgba(250, 204, 21, 0.3);
}
.program-policy-text {
  color: rgba(244, 240, 230, 0.85);
  margin-bottom: 6px;
}
.program-source-link {
  color: var(--gold);
  text-decoration: underline;
  font-size: 12px;
  word-break: break-all;
}
.details-advanced {
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  margin: 24px 0;
  overflow: hidden;
}
.details-advanced summary {
  padding: 14px 18px;
  min-height: 44px;
  font-size: 14px;
  font-weight: 600;
  color: var(--gold);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  user-select: none;
  background: rgba(212, 167, 60, 0.04);
}
.details-advanced summary:hover, .details-advanced summary:focus {
  background: rgba(212, 167, 60, 0.08);
  outline: none;
}
.advanced-body {
  padding: 20px;
  border-top: 1px solid var(--line);
}
.hotel-tier2-breakdown {
  margin-top: 16px;
  padding: 16px;
  background: rgba(14, 26, 43, 0.6);
  border: 1px solid rgba(244, 240, 230, 0.1);
  border-radius: 6px;
  font-size: 13px;
  line-height: 1.7;
}
.hotel-breakdown-step {
  margin-bottom: 8px;
  color: rgba(244, 240, 230, 0.88);
}
.hotel-breakdown-step strong {
  color: var(--paper);
}
.hotel-table-container {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 24px 0;
  border: 1px solid var(--line);
  border-radius: 6px;
}
.hotel-comparison-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  min-width: 600px;
}
.hotel-comparison-table th, .hotel-comparison-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
.hotel-comparison-table th {
  background: var(--ink-2);
  color: var(--gold);
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.hotel-comparison-table tr:last-child td {
  border-bottom: none;
}
.hotel-comparison-table tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.02);
}
@media (max-width: 640px) {
  .btn-hotel-example {
    width: 100%;
    justify-content: flex-start;
  }
}

/* Callout Links Contrast & Accessibility (Phase 9.11.2) */
.callout a,
.callout a:visited {
  color: #7DD3FC;
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.15s ease;
}

.callout a:hover {
  color: #BAE6FD;
  text-decoration: underline;
}

.callout a:focus-visible {
  outline: 2px solid #F4F0E6;
  outline-offset: 2px;
  color: #FFFFFF;
}

/* Accessible Preset Buttons (Phase 9.11.2) */
.preset-buttons {
  margin-top: 10px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  width: 100%;
}

.btn-balance-preset,
.btn-amex-preset {
  min-height: 44px;
  min-width: 44px;
  padding: 8px 14px;
  font-size: 14px;
  line-height: 1.4;
  font-family: inherit;
  font-weight: 500;
  white-space: nowrap;
  background: var(--ink-2);
  color: var(--paper);
  border: 1px solid var(--line);
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
  box-sizing: border-box;
}

.btn-balance-preset:hover,
.btn-amex-preset:hover {
  background: rgba(244, 240, 230, 0.12);
  border-color: var(--gold);
}

.btn-balance-preset:active,
.btn-amex-preset:active {
  transform: translateY(1px);
}

.btn-balance-preset:focus-visible,
.btn-amex-preset:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.btn-balance-preset[aria-pressed="true"],
.btn-amex-preset[aria-pressed="true"] {
  background: var(--gold);
  color: var(--ink);
  border-color: var(--gold);
  font-weight: 700;
  box-shadow: 0 0 0 1px var(--gold);
}

/* Chase UR Comparison Table & Mobile Cards (Phase 9.11.2) */
.chase-cards-mobile {
  display: none;
}

@media (max-width: 640px) {
  .chase-table-desktop {
    display: none;
  }
  .chase-cards-mobile {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin: 20px 0;
  }
  .chase-card {
    background: var(--ink-2);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  }
  .chase-card-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--gold);
    margin-bottom: 8px;
    display: block;
  }
  .chase-card-row {
    margin-top: 8px;
    font-size: 0.9rem;
    line-height: 1.5;
  }
  .chase-card-label {
    font-weight: 600;
    color: var(--paper);
    display: block;
    margin-bottom: 2px;
  }
  .chase-card-value {
    color: rgba(244, 240, 230, 0.85);
  }
}

@media print {
  .chase-table-desktop {
    display: block !important;
  }
  .chase-cards-mobile {
    display: none !important;
  }
}

