/* itinerarysheets.com — single stylesheet, no deps.
   Design language: "the sheet" — paper-like cards, spreadsheet-clean tables,
   deep travel green. Print CSS at the bottom is the product's PDF engine
   (STRATEGY Phase 4 reuse) — keep it boring and bulletproof. */

:root {
  --ink: #182430;
  --muted: #5b6b78;
  --faint: #64717e; /* AA on white and --soft — carries small hint/crumb text */
  --line: #e2e8ed;
  --soft: #f4f7f9;
  --tint: #eef6f2;       /* green-tinted band */
  --accent: #0e7a55;
  --accent-dark: #0a5c40;
  --accent-soft: #e3f2ec;
  --warn: #b4552d;
  --sheet-shadow: 0 1px 2px rgba(24, 36, 48, .06), 0 4px 14px rgba(24, 36, 48, .05);
  --radius: 10px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font: 16px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  color: var(--ink);
  margin: 0;
  background: #fff;
  -webkit-font-smoothing: antialiased;
}
main { max-width: 920px; margin: 0 auto; padding: 28px 20px 72px; }

h1 { font-size: clamp(1.7rem, 4vw, 2.3rem); line-height: 1.15; letter-spacing: -.02em; margin: .6em 0 .3em; }
h2 { font-size: 1.3rem; letter-spacing: -.01em; margin: 2em 0 .6em; }
.sub { color: var(--muted); font-size: 1.06em; max-width: 62ch; margin: 0 0 20px; }
.muted { color: var(--muted); font-size: .9em; }
a { color: var(--accent); }

/* ---------- header ---------- */
header.site {
  position: sticky; top: 0; z-index: 20;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
header.site .inner {
  max-width: 920px; margin: 0 auto; padding: 12px 20px;
  display: flex; align-items: center; gap: 20px;
}
header.site a { color: var(--ink); text-decoration: none; }
header.site .brand { font-weight: 800; font-size: 1.05em; letter-spacing: -.01em; display: flex; align-items: center; gap: 8px; }
header.site .brand .mark { font-size: 1.15em; }
header.site nav { margin-left: auto; display: flex; align-items: center; gap: 4px; }
header.site nav a {
  color: var(--muted); font-size: .95em; font-weight: 500;
  padding: 6px 12px; border-radius: 8px; white-space: nowrap;
}
header.site nav a:hover { color: var(--ink); background: var(--soft); }
header.site nav a.cta {
  color: #fff; background: var(--accent); font-weight: 600;
}
header.site nav a.cta:hover { background: var(--accent-dark); color: #fff; }

/* ---------- buttons ---------- */
button, .btn {
  padding: 10px 18px; font: inherit; font-weight: 600; font-size: .95em;
  color: #fff; background: var(--accent);
  border: 0; border-radius: 8px; cursor: pointer;
  text-decoration: none; display: inline-flex; align-items: center; gap: 7px;
  transition: background .12s, transform .06s, box-shadow .12s;
}
button:hover, .btn:hover { background: var(--accent-dark); }
button:active, .btn:active { transform: translateY(1px); }
button.ghost, .btn.ghost {
  background: #fff; color: var(--accent);
  border: 1.5px solid color-mix(in srgb, var(--accent) 45%, var(--line));
}
button.ghost:hover, .btn.ghost:hover { background: var(--accent-soft); border-color: var(--accent); }
button.quiet {
  background: transparent; color: var(--muted); font-weight: 500;
  padding: 8px 12px; border: 1px solid transparent;
}
button.quiet:hover { background: var(--soft); color: var(--ink); }
:is(button, .btn, input, a):focus-visible { outline: 2.5px solid var(--accent); outline-offset: 2px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 16px 0 8px; }

/* ---------- hero (home) ---------- */
.hero {
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
  gap: 36px; align-items: center; padding: 26px 0 8px;
}
.hero h1 { margin-top: 0; }
.trust { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 18px 0 0; padding: 0; list-style: none; color: var(--muted); font-size: .92em; }
.trust li::before { content: "✓ "; color: var(--accent); font-weight: 700; }
.mini-sheet {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--sheet-shadow); padding: 14px 16px 16px;
  transform: rotate(1.1deg);
}
.mini-sheet .ms-title { font-weight: 700; font-size: .9em; margin-bottom: 8px; display: flex; justify-content: space-between; align-items: baseline; }
.mini-sheet .ms-title span { color: var(--faint); font-weight: 500; font-size: .85em; }
.mini-sheet table { border-collapse: collapse; width: 100%; font-size: .78em; }
.mini-sheet th { background: var(--soft); text-align: left; font-weight: 600; }
.mini-sheet th, .mini-sheet td { border: 1px solid var(--line); padding: 4px 7px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 130px; }
@media (max-width: 720px) {
  .hero { grid-template-columns: 1fr; gap: 22px; }
  .mini-sheet { transform: none; }
}

/* ---------- how it works ---------- */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 10px 0 6px; padding: 0; list-style: none; counter-reset: step; }
.steps li { background: var(--soft); border-radius: var(--radius); padding: 14px 16px; font-size: .93em; color: var(--muted); }
.steps li strong { display: block; color: var(--ink); margin-bottom: 2px; }
.steps li::before {
  counter-increment: step; content: counter(step);
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--accent); color: #fff; font-weight: 700; font-size: .8em;
  margin-bottom: 8px;
}
@media (max-width: 640px) { .steps { grid-template-columns: 1fr; } }

/* ---------- template cards ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; margin-top: 18px; }
.card {
  position: relative; background: #fff;
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px;
  transition: box-shadow .15s, transform .15s, border-color .15s;
}
.card:hover { box-shadow: var(--sheet-shadow); transform: translateY(-2px); border-color: color-mix(in srgb, var(--accent) 30%, var(--line)); }
.card .icon {
  display: flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 9px;
  background: var(--tint); font-size: 1.25em; margin-bottom: 10px;
}
.card a { color: var(--ink); font-weight: 700; text-decoration: none; }
/* whole card clickable without nested-link hacks */
.card a::after { content: ""; position: absolute; inset: 0; }
.card a:hover { color: var(--accent); }
.card p { color: var(--muted); font-size: .9em; margin: .35em 0 0; }

/* ---------- itinerary table = "the sheet" ---------- */
.sheet {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--sheet-shadow);
  margin: 18px 0; overflow-x: auto;
}
table.itin { border-collapse: collapse; width: 100%; font-size: .95em; }
table.itin th {
  background: var(--soft); text-align: left; font-weight: 600; font-size: .88em;
  color: var(--muted); text-transform: uppercase; letter-spacing: .03em;
  white-space: nowrap;
}
table.itin th, table.itin td { border: 1px solid var(--line); padding: 8px 10px; min-width: 96px; }
table.itin th:first-child, table.itin td:first-child { border-left: 0; }
table.itin th:last-child, table.itin td:last-child { border-right: 0; }
table.itin thead tr th { border-top: 0; }
table.itin tbody tr:last-child td { border-bottom: 0; }
table.itin tbody tr:nth-child(even) td { background: #fafcfd; }
table.itin tbody tr:hover td { background: #f4faf7; }

/* ---------- breadcrumbs / related ---------- */
.crumbs { font-size: .88em; color: var(--faint); margin: 4px 0 0; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--accent); }
.related { margin-top: 40px; padding-top: 8px; border-top: 1px solid var(--line); }
.related h2 { margin-top: 1em; font-size: 1.1rem; }

/* ---------- builder ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 6px 0 10px; }
.toolbar input[type=text] {
  flex: 1 1 240px; font-size: 1.25em; font-weight: 700; letter-spacing: -.01em;
  border: 1px solid transparent; border-radius: 8px; padding: 8px 10px; color: var(--ink);
  background: transparent;
}
.toolbar input[type=text]:hover { border-color: var(--line); }
.toolbar input[type=text]:focus { border-color: var(--accent); outline: none; background: #fff; }
.toolbar input[type=date] {
  font: inherit; font-size: .92em; color: var(--muted);
  border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; background: #fff;
}
.saved { font-size: .85em; color: var(--faint); min-width: 64px; transition: opacity .3s, visibility .3s; opacity: 0; visibility: hidden; }
.saved.on { opacity: 1; visibility: visible; color: var(--accent); }
.hint { font-size: .85em; color: var(--faint); margin: 6px 0 0; }
kbd {
  font: .85em/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  background: var(--soft); border: 1px solid var(--line); border-bottom-width: 2px;
  border-radius: 4px; padding: 2px 5px;
}

td input, th input {
  border: none; width: 100%; font: inherit; padding: 5px 6px;
  background: transparent; border-radius: 4px; min-width: 84px;
}
th input { font-weight: 600; font-size: inherit; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
td input:focus, th input:focus { outline: 2px solid var(--accent); outline-offset: -1px; background: #fff; }
input[type=text] { font: inherit; }

/* row / column controls */
table.itin .ctl { border: 0; background: none !important; min-width: 0; width: 1%; padding: 2px 4px 2px 8px; white-space: nowrap; }
.rowctl {
  display: inline-flex; gap: 2px; opacity: 0; transition: opacity .12s;
}
tr:hover .rowctl, .rowctl:focus-within { opacity: 1; }
@media (hover: none) {
  .rowctl, th .colctl { opacity: .85; }
  .rowctl button, .colctl { padding: 9px 11px; font-size: 1.05em; }
  /* 16px inputs stop iOS Safari auto-zooming every cell tap */
  td input, th input, .toolbar input[type=date] { font-size: 16px; }
}
.rowctl button, .colctl {
  background: none; border: 0; color: var(--faint); cursor: pointer;
  padding: 3px 6px; border-radius: 6px; font-size: .95em; line-height: 1;
}
.rowctl button:hover, .colctl:hover { background: var(--soft); color: var(--ink); }
.rowctl button.del:hover { color: var(--warn); background: #fbeee7; }
th .colctl { opacity: 0; float: right; }
th:hover .colctl, th .colctl:focus-visible { opacity: 1; }

/* template picker */
.picker { margin: 14px 0 4px; }
.picker summary { cursor: pointer; color: var(--muted); font-size: .92em; font-weight: 500; }
.picker summary:hover { color: var(--accent); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.chips button {
  background: var(--soft); color: var(--ink); font-weight: 500; font-size: .88em;
  padding: 7px 13px; border-radius: 99px;
}
.chips button:hover { background: var(--accent-soft); color: var(--accent-dark); }

/* post-export panel — the strategy-mandated CPA slot lives here */
.post-export {
  margin: 18px 0; padding: 16px 18px;
  background: var(--tint); border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--line));
  border-radius: var(--radius); position: relative;
  font-size: .95em;
}
.post-export strong { color: var(--accent-dark); }
.post-export p { margin: .3em 0; }
.post-export .close {
  position: absolute; top: 8px; right: 8px;
  background: none; border: 0; color: var(--faint); cursor: pointer;
  font-size: 1.1em; padding: 4px 8px; border-radius: 6px;
}
.post-export .close:hover { background: rgba(0,0,0,.05); color: var(--ink); }
.post-export .cpa-slot:empty { display: none; }

/* ---------- footer ---------- */
footer.site-foot { margin-top: 56px; border-top: 1px solid var(--line); padding-top: 28px; font-size: .9em; }
.foot-grid { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 28px; }
.foot-grid h3 { font-size: .82em; text-transform: uppercase; letter-spacing: .05em; color: var(--faint); margin: 0 0 10px; }
.foot-grid ul { list-style: none; margin: 0; padding: 0; }
.foot-grid li { margin: 5px 0; }
.foot-grid a { color: var(--muted); text-decoration: none; }
.foot-grid a:hover { color: var(--accent); }
.foot-grid .blurb { color: var(--muted); margin: 8px 0 0; max-width: 34ch; }
footer.site-foot .fine { color: var(--faint); font-size: .9em; margin-top: 24px; padding-top: 14px; border-top: 1px solid var(--line); }
@media (max-width: 640px) { .foot-grid { grid-template-columns: 1fr; gap: 18px; } }

.print-only, .print-mirror { display: none; }

/* ---------- print = the PDF engine. Keep bulletproof. ---------- */
@media print {
  @page { margin: 1.4cm; }
  header.site, .actions, .toolbar, footer, .no-print, .crumbs, .related,
  .picker, .post-export, .hint, .rowctl, .colctl, .ctl, .steps, .trust,
  .mini-sheet, .sub { display: none !important; }
  main { padding: 0; max-width: none; }
  body { font-size: 12px; }
  .print-only { display: block; }
  /* builder prints its static mirror, not the input-based editable sheet */
  #builder.printing .sheet { display: none; }
  #builder.printing .sheet.print-mirror { display: block; }
  h1 { font-size: 18px; margin: 0 0 4px; }
  .print-head { margin: 0 0 10px; }
  .print-head .pt { font-size: 18px; font-weight: 800; }
  .print-head .pd { color: #555; font-size: 11px; }
  .sheet { border: 0; box-shadow: none; border-radius: 0; overflow: visible; margin: 0; }
  table.itin { font-size: inherit; }
  table.itin th, table.itin td { border: 1px solid #999 !important; background: #fff !important; min-width: 0; }
  table.itin th { background: #f0f0f0 !important; color: #000; }
  td input, th input { padding: 1px 2px; min-width: 0; }
  tr { break-inside: avoid; }
}
