/* Shared look and feel for all tools. No external fonts, no CDN. */
:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --text: #1b2430;
  --muted: #5b6675;
  --line: #d9dee5;
  --accent: #1f5fd1;
  --accent-text: #ffffff;
  --accent-soft: #e7effc;
  --danger: #b3261e;
  --danger-soft: #fbeceb;
  --ok: #1b7a3d;
  --ok-soft: #e6f4ea;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(20,35,60,.06), 0 4px 14px rgba(20,35,60,.06);
  --hero-a: #1f5fd1;
  --hero-b: #5b8def;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12161c;
    --surface: #1b212a;
    --text: #e8ecf1;
    --muted: #9aa5b4;
    --line: #2f3844;
    --accent: #6ea0ff;
    --accent-text: #0b1220;
    --accent-soft: #1d2a40;
    --danger: #ff8a80;
    --danger-soft: #3a1f1d;
    --ok: #7ddc9a;
    --ok-soft: #173325;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 4px 14px rgba(0,0,0,.3);
    --hero-a: #25427f;
    --hero-b: #3a63b8;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", "Arial Hebrew", Arial, sans-serif;
  line-height: 1.5;
}
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.wrap { max-width: 720px; margin: 0 auto; padding: 16px 16px 48px; }
.wrap.wide { max-width: 960px; }
.site-nav { display: inline-block; margin: 4px 0 0; color: var(--accent); font-size: 0.9rem; text-decoration: none; }
.site-nav:hover { text-decoration: underline; }
header h1 { font-size: 1.75rem; line-height: 1.25; margin: 10px 0 6px; letter-spacing: -0.01em; }
header p { margin: 0 0 16px; color: var(--muted); }

section {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}
section > h2 { font-size: 1.15rem; margin: 0 0 12px; padding-inline-start: 10px; border-inline-start: 4px solid var(--accent); line-height: 1.3; }
fieldset { border: 0; margin: 0 0 8px; padding: 0; }
legend { font-weight: 600; padding: 0; margin-bottom: 8px; color: var(--muted); font-size: 0.9rem; }

.grid { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 560px) { .grid { grid-template-columns: 1fr 1fr; } }
.field label { display: block; font-weight: 600; margin-bottom: 4px; }
.field .hint { display: block; font-size: 0.82rem; color: var(--muted); margin-top: 2px; }
.input-row { display: flex; align-items: center; gap: 8px; }
.unit { color: var(--muted); min-width: 3em; }

input[type="number"], input[type="text"], input[type="tel"], input[type="email"],
input[type="url"], input[type="date"], select, textarea {
  width: 100%;
  min-height: 44px;
  padding: 8px 12px;
  font: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); outline: none; }
textarea { min-height: 96px; resize: vertical; }
input[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--danger); }
input[type="range"] { width: 100%; accent-color: var(--accent); }
input[type="checkbox"], input[type="radio"] { width: 20px; height: 20px; accent-color: var(--accent); }

.actions { display: flex; flex-wrap: wrap; gap: 8px; }
button, .btn {
  display: inline-block;
  min-height: 44px;
  padding: 8px 16px;
  font: inherit;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  color: var(--accent-text);
  background: var(--accent);
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  transition: filter .15s, transform .05s;
}
button:hover:not(:disabled), .btn:hover { filter: brightness(1.08); }
button:active:not(:disabled), .btn:active { transform: translateY(1px); }
button.secondary:hover:not(:disabled), .btn.secondary:hover { filter: none; background: var(--accent-soft); }
button.secondary, .btn.secondary { color: var(--text); background: transparent; border: 1px solid var(--line); }
button.danger { color: var(--danger); background: transparent; border: 1px solid var(--danger); }
button.small { min-height: 36px; padding: 4px 12px; font-size: 0.9rem; }
button:disabled { opacity: 0.5; cursor: not-allowed; }
.status { min-height: 1.5em; margin: 8px 0 0; color: var(--muted); font-size: 0.9rem; }

.errors {
  background: var(--danger-soft);
  color: var(--danger);
  border-radius: 10px;
  padding: 12px;
  margin: 0;
  list-style-position: inside;
}
.notice { background: var(--accent-soft); border-radius: 10px; padding: 12px; margin: 0 0 16px; }

.guide h3 { font-size: 1rem; margin: 16px 0 4px; }
.guide h3:first-of-type { margin-top: 0; }
.guide p { margin: 0; color: var(--muted); }

footer { color: var(--muted); font-size: 0.85rem; margin-top: 8px; padding-top: 16px; border-top: 1px solid var(--line); }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
footer ul { list-style: none; padding: 0; margin: 8px 0 0; display: flex; flex-wrap: wrap; gap: 12px; }
footer a { color: var(--accent); }

@media print {
  body { background: #fff; color: #000; }
  .no-print, .site-nav, .guide, footer ul { display: none !important; }
  section { border: 1px solid #999; break-inside: avoid; }
}
