/* TaxTiger — US vs UK take-home calculator.
   Visual language grounded in the1.amsterdam: off-white canvas, heavy black
   borders, bold grotesk headlines, vivid color-coded accents, generous space. */

:root {
  --ink: #111111;
  --canvas: #f4f1ea;
  --paper: #fbfaf6;
  --green: #00c46a;
  --pink: #ff5da2;
  --yellow: #ffd23f;
  --line: 2.5px solid var(--ink);
  --shadow: 6px 6px 0 var(--ink);
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: "Space Grotesk", system-ui, -apple-system, sans-serif;
  font-size: 17px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: 940px;
  margin: 0 auto;
  padding: 28px 20px 64px;
}

/* --- masthead --- */
.masthead { margin: 12px 0 28px; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  background: var(--ink);
  color: var(--canvas);
  padding: 6px 12px;
}
.eyebrow .mark { font-size: 1rem; line-height: 1; }

h1 {
  font-weight: 700;
  font-size: clamp(2.6rem, 11vw, 5rem);
  line-height: 0.95;
  letter-spacing: -0.03em;
  text-transform: uppercase;
  margin: 18px 0 14px;
}

.lede {
  font-size: clamp(1rem, 3.5vw, 1.3rem);
  max-width: 36ch;
  margin: 0;
  font-weight: 500;
}

/* --- input panel --- */
.panel {
  background: var(--paper);
  border: var(--line);
  box-shadow: var(--shadow);
  padding: 22px 20px;
  margin-bottom: 30px;
}

.field { margin-bottom: 18px; }
.field:last-child { margin-bottom: 0; }

label {
  display: block;
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 8px;
}
.hint {
  font-weight: 400;
  font-size: 0.78rem;
  color: #555;
  letter-spacing: 0;
}

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

select#baseCur {
  font-family: inherit;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--ink);
  background: var(--paper);
  border: var(--line);
  padding: 8px 10px;
  flex: 0 0 auto;
  cursor: pointer;
}

input[type="number"] {
  font-family: inherit;
  font-weight: 700;
  font-size: 1.4rem;
  color: var(--ink);
  background: var(--paper);
  border: var(--line);
  padding: 8px 14px;
  width: 100%;
  flex: 1 1 140px;
  min-width: 0;
}
input[type="number"]:focus,
select#baseCur:focus { outline: 3px solid var(--green); outline-offset: 1px; }

/* --- region picker: search + one dense inline wrap of flag-chips --- */
input#pickSearch {
  font-family: inherit; font-weight: 500; font-size: 0.95rem;
  color: var(--ink); background: var(--paper); border: 2px solid var(--ink);
  padding: 8px 12px; width: 100%; margin: 6px 0 2px;
}
input#pickSearch:focus { outline: 3px solid var(--green); outline-offset: 1px; }
.picker { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 8px; }
.chip.hidden { display: none; }
.chip {
  font-family: inherit; font-weight: 600; font-size: 0.88rem;
  border: 2px solid var(--ink); background: var(--paper); color: var(--ink);
  padding: 6px 12px; cursor: pointer; line-height: 1; min-height: 40px;
  display: inline-flex; align-items: center; gap: 6px;
}
.chip-flag { font-size: 1rem; line-height: 1; }
.chip.on { background: var(--ink); color: var(--canvas); }
.chip:disabled { opacity: 0.3; cursor: not-allowed; }
.chip:not(:disabled):hover { box-shadow: 3px 3px 0 var(--ink); }

/* --- comparison table --- */
.table-wrap { overflow-x: auto; margin-bottom: 30px; -webkit-overflow-scrolling: touch; }
table.cmp {
  border-collapse: collapse;
  width: 100%;
  min-width: 520px;
  background: var(--paper);
  border: var(--line);
  box-shadow: var(--shadow);
}
table.cmp th, table.cmp td {
  padding: 9px 11px;
  text-align: right;
  border-bottom: 1px solid #d8d3c4;
  white-space: nowrap;
}
table.cmp thead th {
  border-bottom: var(--line);
  vertical-align: top;
  text-align: right;
}
.th-flag { display: block; font-size: 1.5rem; }
.th-name { display: block; font-weight: 700; font-size: 1rem; margin-top: 2px; }
.th-year { display: block; font-size: 0.7rem; font-weight: 500; color: #666;
  text-transform: uppercase; letter-spacing: 0.04em; }
.th-badge { display: inline-block; margin-top: 6px; font-size: 0.66rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.05em; background: var(--green);
  color: var(--ink); padding: 2px 7px; }
.rowhead {
  text-align: left; font-weight: 600; font-size: 0.85rem; color: #444;
  position: sticky; left: 0; background: var(--paper);
}
table.cmp tr.strong td, table.cmp tr.strong .rowhead { font-size: 1.05rem; font-weight: 700; color: var(--ink); }
table.cmp tr.strong { border-top: 2px solid var(--ink); }
table.cmp td.winner { background: rgba(0, 196, 106, 0.16); font-weight: 700; }
table.cmp thead th.winner { background: rgba(0, 196, 106, 0.16); }

.empty { padding: 24px; border: 2px dashed #bbb4a3; text-align: center; color: #666; }

/* --- breakdown cards --- */
.details {
  display: grid; grid-template-columns: 1fr; gap: 16px; margin-bottom: 30px;
}
.bcard { background: var(--paper); border: var(--line); box-shadow: var(--shadow); padding: 16px; position: relative; }
.bcard.winner::before {
  content: ""; position: absolute; top: -2.5px; left: -2.5px; right: -2.5px; height: 8px;
  background: var(--green);
}
.bcard-top { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.bcard-badge {
  margin-left: auto; align-self: flex-start;
  font-size: 0.62rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em;
  background: var(--green); color: var(--ink); padding: 3px 7px;
}

/* summary block: hidden on desktop (the table shows it), shown on mobile */
.bcard-summary { display: none; }
.bcard-bar { background: #e7e3d8; border: 2px solid var(--ink); height: 20px; margin-bottom: 14px; }
.bcard-bar-fill { height: 100%; background: var(--green); }
.bcard-stats { margin: 0 0 14px; }
.bcard-stats > div {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 8px 0; border-bottom: 1px dashed #c9c4b6; font-size: 0.95rem;
}
.bcard-stats dt { margin: 0; color: #555; }
.bcard-stats dd { margin: 0; font-weight: 600; text-align: right; }
.bcard-stats > div.strong dt, .bcard-stats > div.strong dd { font-weight: 700; font-size: 1.1rem; color: var(--ink); }
.bcard-top .flag { font-size: 1.7rem; }
.bcard-top h3 { margin: 0; font-size: 1.05rem; font-weight: 700; }
.bcard-net {
  display: flex; justify-content: space-between; align-items: baseline;
  border-top: var(--line); padding-top: 10px; margin-top: 4px;
}
.bcard-net b { font-size: 1.4rem; font-weight: 700; }
.bnote { margin: 10px 0 0; font-size: 0.74rem; color: #666; line-height: 1.45; }

/* --- FX panel --- */
.fx-panel { border: var(--line); background: var(--paper); padding: 14px 16px; margin-bottom: 28px; }
.fx-panel summary { font-weight: 600; cursor: pointer; }
.fx-panel .hint { display: block; margin: 10px 0; }
.fx-status {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 12px;
  font-size: 0.8rem; font-weight: 600;
}
.fx-src { display: inline-flex; align-items: center; gap: 6px; }
.fx-src::before { content: "●"; font-size: 0.7rem; }
.fx-src-live::before  { color: var(--green); }
.fx-src-cache::before { color: var(--yellow); }
.fx-src-default::before { color: #999; }
.fx-reset {
  font-family: inherit; font-weight: 600; font-size: 0.75rem;
  border: 2px solid var(--ink); background: var(--paper); color: var(--ink);
  padding: 4px 10px; cursor: pointer;
}
.fx-reset:hover { box-shadow: 2px 2px 0 var(--ink); }
.fx-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.fx-cell { display: flex; align-items: center; gap: 6px; font-size: 0.85rem; font-weight: 600; }
.fx-cell span:first-child { width: 34px; }
.fx-cell input { font-size: 0.9rem; font-weight: 600; padding: 8px 8px; flex: 1 1 auto; min-width: 0; min-height: 38px; }
.fx-cell input:disabled { opacity: 0.5; }
.fx-unit { font-size: 0.7rem; color: #777; }

/* --- result cards --- */
.results {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  margin-bottom: 30px;
}

.card {
  background: var(--paper);
  border: var(--line);
  box-shadow: var(--shadow);
  padding: 20px;
  position: relative;
}
.card::before {
  content: "";
  position: absolute;
  top: -2.5px; left: -2.5px; right: -2.5px;
  height: 10px;
}
.card[data-accent="green"]::before { background: var(--green); }
.card[data-accent="pink"]::before { background: var(--pink); }

.card-top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 8px 0 16px;
}
.flag { font-size: 2rem; line-height: 1; }
.card-top h2 {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.year {
  font-size: 0.78rem;
  font-weight: 500;
  color: #555;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.net {
  display: flex;
  flex-direction: column;
  border-top: var(--line);
  border-bottom: var(--line);
  padding: 14px 0;
  margin-bottom: 14px;
}
.net-label {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #555;
}
.net-value {
  font-size: clamp(2rem, 9vw, 2.8rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.05;
}

.lines { list-style: none; margin: 0 0 16px; padding: 0; }
.lines li {
  display: flex;
  justify-content: space-between;
  padding: 7px 0;
  border-bottom: 1px dashed #c9c4b6;
  font-size: 0.95rem;
}
.lines li span:last-child { font-weight: 600; }

.foot {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.85rem;
  color: #444;
}
.foot b { color: var(--ink); }

/* --- comparison --- */
.compare {
  background: var(--ink);
  color: var(--canvas);
  border: var(--line);
  box-shadow: var(--shadow);
  padding: 22px 20px;
  margin-bottom: 30px;
}
.compare h3 {
  margin: 0 0 18px;
  font-size: 1.05rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.bars { display: flex; flex-direction: column; gap: 14px; }
.bar-row { display: flex; flex-direction: column; gap: 6px; }
.bar-head {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  font-weight: 600;
}
.bar-track {
  background: #2c2c2c;
  height: 26px;
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  width: 0;
  transition: width 0.4s ease;
}
.bar-fill.green { background: var(--green); }
.bar-fill.pink { background: var(--pink); }
.compare-note {
  margin: 16px 0 0;
  font-size: 0.82rem;
  color: #b9b4a6;
}

/* --- disclaimer --- */
.disclaimer {
  font-size: 0.82rem;
  line-height: 1.55;
  color: #444;
  border-left: 4px solid var(--yellow);
  padding: 4px 0 4px 14px;
}
.disclaimer b { color: var(--ink); }

/* --- supporting content + FAQ (Phase 2 / SEO) --- */
.content { margin-top: 8px; border-top: var(--line); padding-top: 8px; }
.content section { margin-top: 30px; }
.content h2 {
  font-size: clamp(1.4rem, 5vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.05;
  margin: 0 0 12px;
}
.content p { margin: 0 0 14px; max-width: 70ch; }
.content ul { margin: 0; padding-left: 0; list-style: none; max-width: 70ch; }
.content ul li {
  position: relative;
  padding: 10px 0 10px 26px;
  border-bottom: 1px dashed #c9c4b6;
}
.content ul li::before {
  content: "●";
  position: absolute;
  left: 0; top: 10px;
  font-size: 0.9rem;
}
.content a { color: var(--ink); text-decoration: underline; text-decoration-thickness: 2px; }

.faq .qa {
  border: var(--line);
  background: var(--paper);
  padding: 16px 18px;
  margin-bottom: 14px;
}
.faq h3 { margin: 0 0 8px; font-size: 1.1rem; font-weight: 700; }
.faq .qa p { margin: 0; font-size: 0.95rem; }

/* --- generated landing pages: breadcrumb, facts table, hub, related --- */
.crumb { font-size: 0.82rem; font-weight: 600; color: #555; margin: 4px 0 18px; }
.crumb a { color: var(--ink); text-decoration: none; }
.crumb a:hover { text-decoration: underline; }
.crumb span { color: #888; }

table.facts {
  border-collapse: collapse; width: 100%; max-width: 540px;
  background: var(--paper); border: var(--line); box-shadow: var(--shadow);
}
table.facts th, table.facts td {
  padding: 11px 14px; text-align: right; border-bottom: 1px solid #d8d3c4; white-space: nowrap;
}
table.facts thead th { border-bottom: var(--line); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; }
table.facts th:first-child, table.facts td:first-child { text-align: left; }
table.facts tbody tr:last-child td { border-bottom: none; }

.related ul, .hub-list { list-style: none; margin: 0; padding: 0; }
.related li { padding: 9px 0; border-bottom: 1px dashed #c9c4b6; }
.related a, .hub-list a { color: var(--ink); font-weight: 600; text-decoration: none; }
.related a:hover, .hub-list a:hover { text-decoration: underline; }
.hub-list {
  display: grid; grid-template-columns: 1fr; gap: 2px;
}
.hub-list li { border-bottom: 1px dashed #c9c4b6; }
.hub-list a { display: flex; align-items: center; gap: 8px; padding: 11px 4px; min-height: 44px; }
.hub-flag { font-size: 1.2rem; }
@media (min-width: 560px) { .hub-list { grid-template-columns: 1fr 1fr; gap: 0 24px; } }
@media (min-width: 900px) { .hub-list { grid-template-columns: 1fr 1fr 1fr; } }

/* --- mobile: swap the wide table for stacked summary cards (no side-scroll) --- */
@media (max-width: 699px) {
  .table-wrap { display: none; }
  .bcard-summary { display: block; }
}

/* --- desktop: breakdown cards in a grid --- */
@media (min-width: 700px) {
  .details { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 1000px) {
  .details { grid-template-columns: 1fr 1fr 1fr; }
}
