/* Shared stylesheet for HeroYears tool pages. Palette and type match the rest of
   the site; the topnav + header rules ship inside each page's SITE:NAV block. */
:root {
  --bg: #f4f6f9;
  --card: #ffffff;
  --ink: #1c2430;
  --muted: #5b6678;
  --line: #e2e7ee;
  --accent: #2563eb;
  --accent-soft: #dbeafe;
  --accent-ink: #1d4ed8;
  --ok: #15803d;
  --ok-soft: #dcfce7;
  --warn: #b45309;
  --warn-soft: #fef3c7;
  --bad: #b91c1c;
  --bad-soft: #fee2e2;
  --radius: 12px;
  --mono: ui-monospace, "Cascadia Code", "SF Mono", Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.45;
}
a { color: var(--accent); }
header h1 { margin: 0 0 6px; font-size: 1.7rem; }
header p { margin: 0; max-width: 700px; font-size: 1rem; }
header .back { display: inline-block; margin-bottom: 14px; font-size: .86rem; text-decoration: none; }
header .back:hover { text-decoration: underline; }

main { max-width: 1180px; margin: 24px auto; padding: 0 20px 20px; }
.layout { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 20px; align-items: start; }
.layout.single { grid-template-columns: minmax(0, 1fr); }
.layout.even { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
@media (max-width: 880px) { .layout, .layout.even { grid-template-columns: minmax(0, 1fr); } }

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 24px;
}
.panel + .panel { margin-top: 20px; }
.panel h2 { margin: 0 0 14px; font-size: 1.05rem; font-weight: 650; }
.panel h3 { margin: 18px 0 8px; font-size: .92rem; font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }

/* Forms */
.field { margin-bottom: 14px; }
.field label, label.lbl { display: block; font-size: .86rem; font-weight: 600; margin-bottom: 5px; }
.field .hint, .hint { font-size: .78rem; color: var(--muted); margin-top: 4px; }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.row .field { margin-bottom: 0; }
.row + .row, .row + .field, .field + .row { margin-top: 14px; }
input[type=text], input[type=number], input[type=date], input[type=time], input[type=datetime-local],
input[type=search], input[type=url], input[type=email], input[type=color], select, textarea {
  width: 100%;
  font: inherit;
  font-size: .95rem;
  color: var(--ink);
  background: #fff;
  border: 1px solid #cbd3de;
  border-radius: 8px;
  padding: 9px 11px;
}
input[type=color] { padding: 3px; height: 42px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
textarea { min-height: 180px; resize: vertical; line-height: 1.5; }
textarea.mono, input.mono, .mono { font-family: var(--mono); font-size: .88rem; }
input[type=range] { width: 100%; accent-color: var(--accent); }
input[type=checkbox], input[type=radio] { accent-color: var(--accent); width: 16px; height: 16px; vertical-align: -3px; margin-right: 6px; }
.check { display: inline-flex; align-items: center; gap: 4px; font-size: .9rem; margin: 4px 16px 4px 0; }
.inline { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.inline > * { flex: 1 1 120px; }
.inline > .btn, .inline > button { flex: 0 0 auto; }
.unit { display: flex; }
.unit input { border-radius: 8px 0 0 8px; }
.unit select, .unit span.suffix { border-radius: 0 8px 8px 0; border: 1px solid #cbd3de; border-left: 0; background: #f8fafc; padding: 9px 11px; font-size: .9rem; color: var(--muted); width: auto; flex: 0 0 auto; }
.unit select { color: var(--ink); }

/* Buttons */
.btn, button.btn {
  display: inline-block;
  font: inherit;
  font-size: .9rem;
  font-weight: 600;
  color: #fff;
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 8px;
  padding: 9px 16px;
  cursor: pointer;
  text-decoration: none;
  line-height: 1.3;
}
.btn:hover { background: var(--accent-ink); }
.btn.secondary { background: #fff; color: var(--ink); border-color: #cbd3de; }
.btn.secondary:hover { border-color: var(--accent); color: var(--accent); }
.btn.small { font-size: .8rem; padding: 6px 11px; }
.btn.danger { background: var(--bad); border-color: var(--bad); }
.btn:disabled { opacity: .5; cursor: default; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0; }
.toolbar.right { justify-content: flex-end; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; flex-wrap: wrap; }
.tabs button { font: inherit; font-size: .88rem; font-weight: 600; color: var(--muted); background: none; border: 0; border-bottom: 2px solid transparent; padding: 8px 12px; cursor: pointer; margin-bottom: -1px; }
.tabs button.active { color: var(--accent); border-bottom-color: var(--accent); }
.seg { display: inline-flex; border: 1px solid #cbd3de; border-radius: 8px; overflow: hidden; }
.seg button { font: inherit; font-size: .84rem; font-weight: 600; background: #fff; color: var(--muted); border: 0; padding: 7px 12px; cursor: pointer; }
.seg button + button { border-left: 1px solid #cbd3de; }
.seg button.active { background: var(--accent-soft); color: var(--accent-ink); }

/* Results */
.result { background: var(--accent-soft); border-radius: 10px; padding: 18px 20px; margin-bottom: 16px; }
.result .label { font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--accent-ink); }
.result .big { font-size: 2.2rem; font-weight: 700; line-height: 1.15; margin: 4px 0 2px; font-variant-numeric: tabular-nums; word-break: break-word; }
.result .sub { font-size: .9rem; color: var(--ink); opacity: .8; }
.result.ok { background: var(--ok-soft); } .result.ok .label { color: var(--ok); }
.result.warn { background: var(--warn-soft); } .result.warn .label { color: var(--warn); }
.result.bad { background: var(--bad-soft); } .result.bad .label { color: var(--bad); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.stat .k { font-size: .76rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
.stat .v { font-size: 1.3rem; font-weight: 700; font-variant-numeric: tabular-nums; margin-top: 2px; word-break: break-word; }
.stat .v small { font-size: .8rem; font-weight: 500; color: var(--muted); }
.kv { width: 100%; border-collapse: collapse; font-size: .92rem; }
.kv td { padding: 8px 0; border-top: 1px solid var(--line); vertical-align: top; }
.kv td:last-child { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.kv tr:first-child td { border-top: 0; }
table.data { width: 100%; border-collapse: collapse; font-size: .88rem; }
table.data th, table.data td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.data tbody tr:hover { background: #f8fafc; }
.scroll { overflow-x: auto; }
pre.out, .out {
  background: #0f172a; color: #e2e8f0; border-radius: 10px; padding: 14px 16px;
  font-family: var(--mono); font-size: .86rem; line-height: 1.5; overflow: auto; white-space: pre-wrap; word-break: break-word; margin: 0;
  min-height: 60px;
}
.note { font-size: .84rem; color: var(--muted); margin: 10px 0 0; }
.msg { border-radius: 8px; padding: 10px 12px; font-size: .88rem; margin: 10px 0; }
.msg.ok { background: var(--ok-soft); color: var(--ok); }
.msg.warn { background: var(--warn-soft); color: var(--warn); }
.msg.bad { background: var(--bad-soft); color: var(--bad); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { font-size: .78rem; background: #eef2f7; border-radius: 999px; padding: 3px 10px; color: var(--ink); cursor: pointer; border: 1px solid transparent; }
.chip:hover { border-color: var(--accent); }
.chip.on { background: var(--accent-soft); color: var(--accent-ink); }
.bar { height: 10px; background: var(--line); border-radius: 999px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--accent); border-radius: 999px; transition: width .2s; }
.mark { background: #fde68a; border-radius: 3px; padding: 0 1px; }
.add { background: var(--ok-soft); color: var(--ok); }
.del { background: var(--bad-soft); color: var(--bad); text-decoration: line-through; }
.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.card { border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; }
.card h4 { margin: 0 0 4px; font-size: .95rem; }
.card p { margin: 0; font-size: .84rem; color: var(--muted); }
.copyable { position: relative; }
.copyable .copy { position: absolute; top: 8px; right: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.clock { font-variant-numeric: tabular-nums; font-family: var(--mono); }
.huge { font-size: clamp(2.4rem, 9vw, 5.5rem); font-weight: 700; line-height: 1.05; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.center { text-align: center; }
.muted { color: var(--muted); }
.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); background: #0f172a; color: #fff; padding: 9px 16px; border-radius: 999px; font-size: .86rem; opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 50; }
.toast.show { opacity: 1; }

footer { max-width: 1180px; margin: 0 auto; padding: 0 20px 30px; font-size: .78rem; color: var(--muted); }
footer a { color: var(--muted); }

@media print {
  .topnav, header .back, .toolbar, footer, .seo-content, .no-print { display: none !important; }
  body { background: #fff; }
  .panel { border: 0; padding: 0; }
}
