/* printsheet.io — base styles. Clean, light, print-first. */
:root {
  --bg: #f4f6f8;
  --panel: #ffffff;
  --ink: #1a2330;
  --muted: #5b6670;
  --accent: #2563eb;
  --accent-2: #0ea5e9;
  --border: #d7dee6;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(16,24,40,.08), 0 4px 16px rgba(16,24,40,.06);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---- Header / nav ---- */
.site-header {
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  padding: 14px 20px;
  display: flex; align-items: center; gap: 14px;
  position: sticky; top: 0; z-index: 20;
}
.site-header .brand { font-weight: 800; font-size: 1.2rem; letter-spacing: -.02em; }
.site-header .brand span { color: var(--accent); }
.site-header nav { margin-left: auto; display: flex; gap: 16px; flex-wrap: wrap; }
.site-header nav a { color: var(--ink); font-weight: 600; font-size: .95rem; }

/* ---- Layout ---- */
.container { max-width: 1100px; margin: 0 auto; padding: 24px 20px 60px; }
.tool-layout { display: grid; grid-template-columns: 320px 1fr; gap: 24px; align-items: start; }
@media (max-width: 820px) { .tool-layout { grid-template-columns: 1fr; } }

/* ---- Controls panel ---- */
.controls {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  position: sticky; top: 78px;
}
.controls h2 { margin: 0 0 12px; font-size: 1.05rem; }
.field { margin-bottom: 14px; }
.field label { display: block; font-weight: 600; font-size: .85rem; margin-bottom: 5px; }
.field input[type="number"], .field select, .field input[type="text"], .field input[type="color"] {
  width: 100%; padding: 8px 10px; border: 1px solid var(--border);
  border-radius: 7px; font-size: .95rem; background: #fff; color: var(--ink);
}
.field .row { display: flex; gap: 8px; }
.field .row > * { flex: 1; }
.field .hint { font-size: .78rem; color: var(--muted); margin-top: 4px; }
.field-inline { display: flex; align-items: center; gap: 8px; }
.field-inline input[type="checkbox"] { width: 16px; height: 16px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 16px; border: none; border-radius: 8px; cursor: pointer;
  font-size: .98rem; font-weight: 700; background: var(--accent); color: #fff;
  width: 100%;
}
.btn:hover { background: #1d4fd8; }
.btn.secondary { background: #eef2f7; color: var(--ink); border: 1px solid var(--border); }
.btn.secondary:hover { background: #e3e9f1; }
.btn-row { display: flex; gap: 8px; margin-top: 6px; }
.btn-row .btn { width: auto; flex: 1; }

/* ---- Preview ---- */
.preview-col { min-width: 0; }
.print-note {
  background: #fff7ed; border: 1px solid #fed7aa; color: #9a3412;
  border-radius: 8px; padding: 10px 14px; font-size: .88rem; margin: 0 0 20px;
}
.print-note strong { color: #7c2d12; }
.ps-preview-wrap {
  background: #e2e8f0; border-radius: var(--radius); padding: 24px;
  display: flex; justify-content: center; overflow: auto;
}
/* On screen, scale the mm-sized SVG down to fit the column width while keeping
   the true paper aspect ratio (the viewBox provides the intrinsic ratio). */
#preview { width: 100%; display: flex; justify-content: center; }
#preview .ps-sheet {
  width: 100%; height: auto; max-width: 640px;
  background: #fff; box-shadow: 0 2px 10px rgba(0,0,0,.15);
}

/* ---- Hub / cards ---- */
.hero { text-align: center; padding: 30px 0 18px; }
.hero h1 { font-size: 2rem; margin: 0 0 8px; letter-spacing: -.02em; }
.hero p { color: var(--muted); max-width: 640px; margin: 0 auto; }
.cat { margin: 34px 0 10px; font-size: 1.15rem; border-bottom: 2px solid var(--border); padding-bottom: 6px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.card {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; box-shadow: var(--shadow); transition: transform .08s ease, box-shadow .08s ease;
  display: block; color: var(--ink);
}
.card:hover { transform: translateY(-2px); text-decoration: none; box-shadow: 0 6px 20px rgba(16,24,40,.12); }
.card.soon { opacity: .55; pointer-events: none; }
.card .ic { font-size: 1.6rem; }
.card h3 { margin: 8px 0 4px; font-size: 1rem; }
.card p { margin: 0; font-size: .84rem; color: var(--muted); }
.badge-soon { font-size: .68rem; background: #eef2f7; color: var(--muted); border-radius: 20px; padding: 2px 8px; margin-left: 6px; }

/* ---- Ad slots (never printed) ---- */
/* Ad slot: reserves no space while dormant/unfilled; only takes height once
   AdSense actually fills it (data-ad-status="filled"). Keeps the layout tight
   before ads go live. */
.ad-slot { text-align: center; margin: 0; }
/* Collapse the slot entirely unless an ad actually fills it. */
.ad-slot:not(:has(.adsbygoogle[data-ad-status="filled"])) { margin: 0; padding: 0; min-height: 0; height: 0; overflow: hidden; }
.ad-slot:has(.adsbygoogle[data-ad-status="filled"]) { margin: 20px auto; min-height: 90px; }
.ad-slot .adsbygoogle:not([data-ad-status="filled"]) { display: none; }

/* ---- Footer ---- */
.site-footer { border-top: 1px solid var(--border); background: var(--panel); padding: 22px 20px; color: var(--muted); font-size: .88rem; }
.site-footer .container { padding: 0; display: flex; gap: 18px; flex-wrap: wrap; align-items: center; }
.site-footer a { color: var(--muted); }

/* ---- Print: hide everything but the sheet ---- */
@media print {
  .site-header, .site-footer, .controls, .print-note, .ad-slot, .no-print { display: none !important; }
  .container, .tool-layout, .preview-col, .ps-preview-wrap, #preview {
    display: block !important; margin: 0 !important; padding: 0 !important;
    max-width: none !important; width: auto !important; background: #fff !important;
    box-shadow: none !important; overflow: visible !important;
  }
  /* Print at real mm: do NOT scale the sheet to the column. */
  #preview .ps-sheet { max-width: none !important; box-shadow: none !important; }
}
