@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("/fonts/plus-jakarta-sans-latin-wght-normal.woff2") format("woff2");
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
}
:root {
  font-family: "Plus Jakarta Sans", "Segoe UI", system-ui, sans-serif;
  color: #172f2b;
  background: #f5f8f7;
  font-synthesis: none;
  --primary: #0f766e;
  --muted: #4c6660;
  --border: #d7e4df;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  min-height: 100vh;
  min-height: 100dvh;
  --card-width: 50mm;
  --card-height: 70mm;
  --marker-size: 35mm;
  --card-padding: 3.5mm;
  --card-gap: 1.5mm;
  --symbol-size: 6mm;
  --symbol-gap: .8mm;
  --card-font: 12px;
  --card-text: 11px;
  --card-footer: 9px;
}
body[data-card-size="large"] {
  --card-width: 70mm;
  --card-height: 100mm;
  --marker-size: 50mm;
  --card-padding: 5mm;
  --card-gap: 2mm;
  --symbol-size: 8mm;
  --symbol-gap: 1mm;
  --card-font: 14px;
  --card-text: 12px;
  --card-footer: 10px;
}
button, a { font: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid var(--primary); outline-offset: 3px; }
.cards-shell { width: 100%; max-width: 840px; margin-inline: auto; min-height: 100vh; min-height: 100dvh; padding-bottom: env(safe-area-inset-bottom, 0px); background: #fff; border-inline: 1px solid var(--border); }
.cards-page { padding: 20px 20px 32px; }
.cards-topbar { display: flex; min-height: 64px; align-items: center; justify-content: space-between; gap: 12px; padding: max(8px, env(safe-area-inset-top, 0px)) 20px 8px; border-bottom: 1px solid var(--border); }
.cards-back, .cards-wordmark { display: inline-flex; align-items: center; min-height: 44px; text-decoration: none; }
.cards-back { gap: 4px; color: var(--primary); font-size: 14px; font-weight: 700; }
.cards-back:hover { text-decoration: underline; }
.cards-wordmark { color: inherit; font-weight: 800; font-size: 20px; letter-spacing: -.05em; white-space: nowrap; }
.cards-wordmark span { color: var(--primary); margin-left: 3px; }
.cards-icon { display: inline-block; width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }
.print-intro { background: #e4f5ed; border: 1px solid #b6ded0; border-radius: 20px; overflow: hidden; padding: 22px 20px 18px; }
.cards-eyebrow { display: flex; align-items: center; gap: 7px; margin: 0; color: #125e52; font-size: 11px; font-weight: 750; letter-spacing: .07em; }
.cards-eyebrow .cards-icon { width: 18px; height: 18px; }
h1 { margin: 12px 0 9px; font-size: clamp(25px, 6.7vw, 31px); line-height: 1.2; letter-spacing: -.045em; }
h1 span { color: var(--primary); }
.cards-description { margin: 0; color: #385a50; font-size: 14px; line-height: 1.6; max-width: 580px; }
.cards-hero-meta { margin: 16px 0 0; }
.cards-count { display: inline-flex; align-items: center; min-height: 28px; color: #356255; padding: 4px 10px; font-size: 12px; font-weight: 650; background: #fff; border: 1px solid #bfdfd2; border-radius: 8px; white-space: nowrap; }
.print-button { flex: 0 0 auto; display: inline-flex; justify-content: center; align-items: center; gap: 8px; min-height: 46px; padding: 10px 16px; border: 1px solid transparent; border-radius: 12px; background: var(--primary); color: #fff; font-size: 13px; font-weight: 750; cursor: pointer; }
.print-button:hover:not(:disabled) { background: #0b5e58; }
.print-button:disabled { opacity: .45; cursor: default; background: #5c8a80; }
.print-settings { display: grid; gap: 10px; margin-top: 24px; }
.print-options { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: end; gap: 12px; }
.size-field { font-size: 13px; line-height: 1.4; font-weight: 750; color: #34534a; display: flex; flex-direction: column; gap: 8px; }
.size-field select { width: 100%; min-height: 48px; border: 1px solid #c4d9d0; border-radius: 13px; background: #fff; color: #172f2b; font: inherit; font-size: 13px; padding: 10px 12px; cursor: pointer; }
.size-info { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.print-note { display: flex; align-items: flex-start; gap: 9px; background: #f2f7f5; border: 1px solid #e0ebe6; border-radius: 10px; color: #34534a; padding: 10px 12px; }
.print-note > .cards-icon { width: 19px; height: 19px; margin-top: 1px; color: var(--primary); }
.print-note strong { font-size: 12px; line-height: 1.4; font-weight: 750; }
.print-note p { margin: 3px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }

.selection-toolbar { position: sticky; top: 0; z-index: 5; display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 9px; margin: 14px 0 0; padding: 12px 0; background: #fff; border-bottom: 1px solid var(--border); }
.selection-toolbar h2 { font-size: 20px; letter-spacing: -.03em; line-height: 1.3; margin: 0 0 3px; }
.selection-toolbar p { font-size: 12px; color: var(--muted); margin: 0; }
.selection-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.selection-button { min-height: 44px; white-space: nowrap; padding: 8px 11px; border: 1px solid #c8ddd3; border-radius: 12px; background: #fff; color: var(--primary); font-size: 12px; font-weight: 650; cursor: pointer; }
.selection-button:hover:not(:disabled) { background: #eaf7f0; }
.selection-button:disabled { opacity: .45; cursor: not-allowed; }
.print-empty { display: none; }
/* Physical print dimensions are independent of paper size and screen controls. */
.sheet { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, calc(var(--card-width) + 22px)), 1fr)); gap: 11px; margin: 15px auto 0; }
.card-item { display: grid; align-content: start; justify-items: center; gap: 8px; min-width: 0; padding: 10px; border: 1px solid #d7e5df; border-radius: 15px; background: #fff; break-inside: avoid; }
.card-choice { display: flex; align-items: center; gap: 8px; width: 100%; padding: 7px 9px; background: #f2f8f5; border: 1px solid #d8eae2; border-radius: 10px; color: #28564c; font-size: 12px; font-weight: 750; min-height: 44px; cursor: pointer; }
.card-choice input { appearance: auto; flex: 0 0 auto; width: 18px; height: 18px; margin: 0; accent-color: var(--primary); cursor: pointer; }
.card-item[data-selected="true"] { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
.card-item[data-selected="true"] .card-choice { background: #e5f6ee; border-color: #b6ded0; color: #0b5e58; }
.card { font: var(--card-font) system-ui, sans-serif; background: #fff; break-inside: avoid; width: var(--card-width); min-height: var(--card-height); border: 1px dashed #777; padding: var(--card-padding); display: flex; flex-direction: column; align-items: center; gap: var(--card-gap); }
.card > header { width: 100%; display: flex; gap: 1.5mm; align-items: center; font-size: var(--card-font); font-weight: 700; }
.card > header b { color: var(--primary); }
.card > header strong { margin-left: auto; }
.card > p { margin: 0; text-align: center; font-size: var(--card-text); font-weight: 600; line-height: 1.3; }
.icons { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--symbol-gap); width: 100%; }
.icons img { width: var(--symbol-size); height: var(--symbol-size); object-fit: contain; }
.marker { width: var(--marker-size); height: var(--marker-size); flex: 0 0 auto; display: block; object-fit: contain; margin: auto; image-rendering: auto; }
.card footer { font-size: var(--card-footer); line-height: 1.3; text-align: center; }

@media (min-width: 720px) {
  .cards-page, .cards-topbar { padding-inline: 30px; }
  .print-intro { padding: 28px; }
}
@media (max-width: 719px) {
  .cards-topbar { min-height: 57px; }
  .cards-page { padding-top: 16px; }
  .print-intro { padding-block: 17px; }
  .print-intro h1 { margin: 8px 0 6px; font-size: clamp(24px, 6.1vw, 29px); }
  .cards-hero-meta { margin-top: 12px; }
  .print-settings { margin-top: 20px; gap: 8px; }
}
@media (max-width: 620px) {
  .selection-toolbar { grid-template-columns: minmax(0,1fr) auto; grid-template-areas: "summary print" "actions actions"; }
  .selection-summary { grid-area: summary; }
  .selection-actions { grid-area: actions; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); justify-content: flex-start; }
  .selection-toolbar .print-button { grid-area: print; }
}
@media (max-width: 440px) {
  .print-button { width: 100%; padding: 10px 12px; font-size: 13px; }
  .print-options { grid-template-columns: 1fr; align-items: start; gap: 7px; }
  .print-note { padding: 8px 12px; }
  .selection-toolbar { gap: 8px; margin-top: 14px; }
  .sheet { margin-top: 14px; }
}
@media (max-width: 340px) {
  .cards-page, .cards-topbar { padding-inline: 14px; }
  .print-intro { padding: 15px 14px; }
  .print-intro h1 { font-size: 21px; }
}
@page { size: auto; margin: 8mm; }
@media print {
  :root, body { margin: 0; background: #fff; }
  .cards-shell { margin: 0; padding: 0; max-width: none; width: 100%; min-height: 0; border: 0; }
  .cards-page { margin: 0; padding: 0; max-width: none; width: 100%; }
  .controls { display: none !important; }
  .sheet { grid-template-columns: repeat(auto-fit, var(--card-width)); margin: 0 auto; gap: 4mm; justify-content: start; }
  .card-item, .card-item[data-selected="true"] { display: block; width: var(--card-width); padding: 0; border: 0; border-radius: 0; box-shadow: none; }
  .card-item:not([data-selected="true"]) { display: none !important; }
  body[data-selection-empty="true"] .print-empty { display: block; font: 12px system-ui, sans-serif; }
  .card { min-height: var(--card-height); height: auto; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
