/* Address labels + Christmas card list (src/labels.js, public/labels/*.js). Static on purpose. */
:root { --navy: #1f3a5f; --navy2: #142a47; --red: #b3261e; --ink: #111827; --paper: #f6f4ef; --line: #e3ded3; --muted: #6b7280; --ok: #166534; }
* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; background: var(--paper); color: #374151; min-height: 100vh; }
.container { max-width: 1040px; margin: 0 auto; padding: 24px 16px 48px; }
.narrow { max-width: 780px; margin-left: auto; margin-right: auto; }
.crumb { font-size: 13px; color: var(--muted); margin-bottom: 12px; }
.crumb a { color: var(--navy); text-decoration: none; }
.top { text-align: center; margin-bottom: 20px; }
.env { width: 92px; height: 60px; margin: 0 auto 12px; position: relative; border-radius: 6px; background: #fff; box-shadow: 0 2px 0 rgba(0,0,0,.08), 0 0 0 1px var(--line);
  background-image: repeating-linear-gradient(135deg, var(--red) 0 7px, #fff 7px 14px, var(--navy) 14px 21px, #fff 21px 28px); }
.env::before { content: ""; position: absolute; inset: 6px; background: #fff; border-radius: 3px; }
.env i { position: absolute; left: 22px; top: 22px; width: 48px; height: 22px; border-radius: 3px; border: 1.5px solid #c9ced6; background: #fff; }
.env i::before, .env i::after { content: ""; position: absolute; left: 6px; height: 2.5px; border-radius: 2px; background: var(--navy); }
.env i::before { top: 6px; width: 30px; } .env i::after { top: 12px; width: 22px; background: #9aa3ad; }
.env b { position: absolute; right: 10px; top: 10px; width: 14px; height: 17px; border: 1.5px dashed var(--red); border-radius: 2px; }
h1 { font-size: 32px; line-height: 1.15; font-weight: 800; color: var(--ink); letter-spacing: -0.015em; margin-bottom: 10px; }
.lede { font-size: 16.5px; line-height: 1.55; color: #4b5563; max-width: 38em; margin: 0 auto; }
.ticks { display: flex; flex-wrap: wrap; gap: 6px 16px; justify-content: center; margin-top: 12px; font-size: 14px; color: var(--ok); font-weight: 600; }
.ticks span::before { content: "✓ "; }
.panel { background: #fff; border-radius: 16px; padding: 22px 20px; box-shadow: 0 1px 3px rgba(0,0,0,.07), 0 0 0 1px rgba(31,58,95,.05); margin-bottom: 22px; }
.panel h2 { font-size: 22px; font-weight: 750; color: var(--ink); margin-bottom: 6px; letter-spacing: -0.01em; }
.panel h3 { font-size: 16.5px; font-weight: 700; color: var(--ink); margin: 18px 0 6px; }
.panel p { font-size: 15.5px; line-height: 1.65; margin-bottom: 12px; }
.panel ul, .panel ol { margin: 6px 0 14px 22px; }
.panel li { font-size: 15.5px; line-height: 1.6; margin-bottom: 4px; }
.panel a { color: var(--navy); }
.muted { color: var(--muted); font-size: 14px; }
code { background: #f3f4f6; padding: 1px 5px; border-radius: 4px; font-size: .92em; }

/* ---- the tool ---- */
.tool { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 22px; align-items: start; }
.step { font-size: 12.5px; font-weight: 800; color: var(--red); text-transform: uppercase; letter-spacing: .07em; margin: 2px 0 6px; }
.tool h2 { font-size: 19px; margin-bottom: 8px; }
textarea#lb-input { width: 100%; min-height: 230px; padding: 12px; border: 2px solid #e5e7eb; border-radius: 10px; font: 15px/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: #111; resize: vertical; background: #fdfdfb; }
.return textarea#lb-input { min-height: 110px; }
textarea#lb-input:focus, .tool select:focus, .tool input:focus { outline: none; border-color: var(--navy); }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 0; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; background: var(--navy); color: #fff; border: 0; border-radius: 10px; padding: 12px 18px; font-size: 15.5px; font-weight: 700; cursor: pointer; text-decoration: none; font-family: inherit; }
.btn:hover { background: var(--navy2); }
.btn:disabled { opacity: .45; cursor: default; }
.btn.red { background: var(--red); } .btn.red:hover { background: #8f1d17; }
.btn.ghost { background: #fff; color: var(--navy); border: 2px solid #d6dbe4; padding: 10px 15px; }
.btn.ghost:hover { border-color: var(--navy); }
.btn.small { padding: 7px 12px; font-size: 14px; border-radius: 8px; }
.file { position: relative; overflow: hidden; }
.file input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
#lb-summary { font-size: 14.5px; line-height: 1.5; color: #374151; margin: 8px 0 4px; }
#lb-summary b { color: var(--ink); }
.opts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; margin-top: 10px; }
.opts label, .opt-full { display: block; font-size: 13px; font-weight: 650; color: #374151; }
.opts select, .opts input[type=number], .opt-full select { display: block; width: 100%; margin-top: 4px; padding: 9px 10px; border: 2px solid #e5e7eb; border-radius: 9px; font-size: 15px; font-family: inherit; background: #fff; color: #111; }
.opt-full { margin-top: 10px; }
.tick { display: flex !important; align-items: center; gap: 8px; font-weight: 600 !important; font-size: 14.5px !important; padding-top: 6px; }
.tick input { width: 19px; height: 19px; accent-color: var(--navy); flex: none; }
#lb-designs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
#lb-designs .chip { display: inline-flex; align-items: center; gap: 4px; background: #fff; border: 2px solid #e5e7eb; border-radius: 10px; padding: 4px 9px 4px 5px; font: 600 13.5px/1 inherit; font-family: inherit; color: #374151; cursor: pointer; }
#lb-designs .chip svg { width: 26px; height: 26px; }
#lb-designs .chip[aria-pressed=true] { border-color: var(--navy); background: #eef2f8; color: var(--navy); }
.sheet { background: #e9e6df; border-radius: 14px; padding: 14px; position: sticky; top: 12px; }
.sheet svg { display: block; width: 100%; height: auto; background: #fff; box-shadow: 0 2px 10px rgba(0,0,0,.14); border-radius: 2px; }
.pager { display: flex; justify-content: space-between; align-items: center; margin: 10px 2px 2px; font-size: 14px; font-weight: 600; color: #374151; }
.pager button { background: #fff; border: 1.5px solid #d6dbe4; border-radius: 8px; padding: 5px 12px; font-size: 14px; cursor: pointer; font-family: inherit; }
.pager button:disabled { opacity: .4; cursor: default; }
.go { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.go .btn { flex: 1 1 auto; }
#lb-warn { list-style: none; margin: 10px 0 0 !important; padding: 10px 12px; background: #fff4f2; border: 1px solid #f3c2bd; border-radius: 10px; }
#lb-warn li { font-size: 14px !important; color: #7f1d1d; margin: 2px 0 !important; }
.adv { margin-top: 12px; border-top: 1px solid #eee; padding-top: 10px; }
.adv summary { cursor: pointer; font-weight: 700; color: var(--navy); font-size: 14.5px; }
.nudge { display: grid; grid-template-columns: auto 1fr auto auto; gap: 6px 8px; align-items: center; margin-top: 8px; font-size: 14px; }
.nudge input { width: 84px; padding: 6px 8px; border: 2px solid #e5e7eb; border-radius: 8px; font-size: 14.5px; font-family: inherit; }
.privacy { font-size: 13.5px; color: var(--ok); margin-top: 8px; font-weight: 600; }
.privacy::before { content: "🔒 "; }

/* ---- content ---- */
.spec { width: 100%; border-collapse: collapse; font-size: 15px; margin: 8px 0 14px; }
.spec th, .spec td { text-align: left; padding: 7px 10px; border-bottom: 1px solid #eee; vertical-align: top; }
.spec th { width: 44%; color: #4b5563; font-weight: 600; }
.spec td { color: var(--ink); font-variant-numeric: tabular-nums; }
.tgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 10px 0; }
.tcard { display: block; border: 2px solid #e5e7eb; border-radius: 12px; padding: 10px 12px; text-decoration: none; color: var(--ink); background: #fff; }
.tcard:hover { border-color: var(--navy); }
.tcard b { display: block; font-size: 16px; color: var(--navy); }
.tcard span { display: block; font-size: 13px; color: var(--muted); line-height: 1.4; margin-top: 2px; }
.tcard svg { display: block; width: 46px; height: 60px; margin-bottom: 6px; }
.also { font-size: 14px; color: #4b5563; line-height: 1.7; }
.steps-list li { margin-bottom: 8px !important; }
.foot { text-align: center; margin-top: 30px; font-size: 14px; line-height: 2; }
.foot a { color: var(--navy); margin: 0 7px; text-decoration: none; }

/* ---- card list ---- */
.cl-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; margin-bottom: 10px; }
#cl-year { font-weight: 800; color: var(--red); font-size: 13px; text-transform: uppercase; letter-spacing: .06em; }
#cl-counts { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 14px; color: #4b5563; margin: 6px 0 10px; }
#cl-counts b { color: var(--ink); }
#cl-counts .owe { color: var(--red); }
.filters { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 12px; }
.filters button { background: #fff; border: 1.5px solid #d6dbe4; border-radius: 999px; padding: 5px 12px; font-size: 13.5px; font-weight: 600; color: var(--navy); cursor: pointer; font-family: inherit; }
.filters button[aria-pressed=true] { background: var(--navy); color: #fff; border-color: var(--navy); }
#cl-rows { list-style: none; margin: 0 !important; }
.cl-row { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) 30px; grid-template-areas: "addr ticks del" "note note note"; gap: 6px 12px; padding: 12px 0; border-top: 1px solid #eee; margin: 0 !important; }
.cl-row.is-sent .cl-addr { background: #f3faf4; border-color: #cfe8d3; }
.cl-addr { grid-area: addr; width: 100%; padding: 8px 10px; border: 2px solid #e5e7eb; border-radius: 9px; font: 14.5px/1.4 inherit; font-family: inherit; resize: vertical; color: #111; }
.cl-ticks { grid-area: ticks; display: flex; flex-direction: column; gap: 4px; font-size: 14.5px; font-weight: 600; }
.cl-ticks label { display: flex; align-items: center; gap: 7px; cursor: pointer; }
.cl-ticks input { width: 18px; height: 18px; accent-color: var(--navy); }
.cl-last { font-size: 12.5px; color: var(--ok); font-weight: 700; }
.cl-note { grid-area: note; width: 100%; padding: 7px 10px; border: 1.5px solid #eee; border-radius: 8px; font-size: 14px; font-family: inherit; color: #374151; }
.cl-del { grid-area: del; background: none; border: 0; font-size: 24px; line-height: 1; color: #9ca3af; cursor: pointer; align-self: start; }
.cl-del:hover { color: var(--red); }
.cl-empty { color: var(--muted); font-size: 15px; padding: 16px 0; border-top: 1px solid #eee; }
#cl-paste { width: 100%; min-height: 120px; padding: 10px; border: 2px solid #e5e7eb; border-radius: 10px; font: 14px/1.45 ui-monospace, Menlo, monospace; }
#cl-print { display: none; }

@media (max-width: 820px) {
  .tool { grid-template-columns: 1fr; }
  .sheet { position: static; }
  .tgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 480px) {
  h1 { font-size: 27px; }
  .opts { grid-template-columns: 1fr; }
  .cl-row { grid-template-columns: minmax(0, 1fr) 30px; grid-template-areas: "addr del" "ticks ticks" "note note"; }
  .cl-ticks { flex-direction: row; flex-wrap: wrap; gap: 4px 14px; }
}
@media print {
  @page { size: letter; margin: 0.5in; }
  body { background: #fff; }
  body > .container > *:not(#cl-print) { display: none !important; }
  #cl-print { display: block !important; }
  #cl-print h2 { font-size: 16pt; margin-bottom: 8pt; color: #000; }
  #cl-print table { width: 100%; border-collapse: collapse; font-size: 10pt; color: #000; }
  #cl-print th, #cl-print td { border: 0.6pt solid #888; padding: 4pt 6pt; vertical-align: top; text-align: left; }
  #cl-print th:nth-child(n+2):nth-child(-n+4), #cl-print td:nth-child(n+2):nth-child(-n+4) { width: 0.7in; text-align: center; font-size: 13pt; }
  #cl-print td:first-child { width: 2.8in; }
  #cl-print tr.blank td { height: 0.62in; }
  #cl-print tr { break-inside: avoid; }
}
