/* Run4PB — shared styles */
/* Theme: follows system preference unless the user picks one with the
   nav toggle, which sets data-theme="light|dark" on <html> (see theme.js). */
:root {
  color-scheme: light;
  --bg: #f7f8fa;
  --surface: #ffffff;
  --text: #1a202c;
  --text-muted: #5a6472;
  --accent: #e04f2e;
  --accent-soft: #fdeee9;
  --border: #e2e6ea;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(16, 24, 40, 0.08);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #14171c;
    --surface: #1e232b;
    --text: #eef1f5;
    --text-muted: #9aa4b2;
    --accent: #ff6a45;
    --accent-soft: #33231e;
    --border: #2c333d;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #14171c;
  --surface: #1e232b;
  --text: #eef1f5;
  --text-muted: #9aa4b2;
  --accent: #ff6a45;
  --accent-soft: #33231e;
  --border: #2c333d;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.container { max-width: 720px; margin: 0 auto; padding: 0 1.25rem; }

header.site {
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
header.site .container {
  display: flex; align-items: center; justify-content: space-between;
}
.logo {
  font-weight: 800; font-size: 1.15rem; text-decoration: none; color: var(--text);
  letter-spacing: -0.02em;
}
.logo span { color: var(--accent); }
nav.site-nav a {
  color: var(--text-muted); text-decoration: none; font-size: 0.9rem; margin-left: 1rem;
}
nav.site-nav a:hover { color: var(--accent); }
button.theme-toggle {
  margin-left: 1rem;
  background: none; border: none; padding: 0;
  font-size: 1rem; line-height: 1; cursor: pointer;
  vertical-align: middle;
}
button.theme-toggle:hover { filter: brightness(1.15); }

main { padding: 2rem 0 3rem; }
main a { color: var(--accent); }

h1 { font-size: 1.7rem; letter-spacing: -0.02em; line-height: 1.25; margin: 0 0 0.5rem; }
.subtitle { color: var(--text-muted); margin: 0 0 1.75rem; font-size: 1.02rem; }

h2 { font-size: 1.25rem; margin: 2.25rem 0 0.75rem; letter-spacing: -0.01em; }
h3 { font-size: 1.05rem; margin: 1.5rem 0 0.5rem; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

/* Forms */
.field { margin-bottom: 1.1rem; }
.field label {
  display: block; font-weight: 600; font-size: 0.88rem; margin-bottom: 0.3rem;
}
.field .hint { font-weight: 400; color: var(--text-muted); font-size: 0.8rem; }
.field input[type="number"],
.field input[type="text"],
.field select {
  width: 100%;
  padding: 0.6rem 0.75rem;
  font-size: 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
}
.field input:focus, .field select:focus {
  outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent;
}
.field-row { display: flex; gap: 0.75rem; }
.field-row .field { flex: 1; }

.seg {
  display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden;
}
.seg button {
  padding: 0.45rem 0.9rem; border: none; background: var(--surface); color: var(--text-muted);
  font-size: 0.88rem; font-weight: 600; cursor: pointer;
}
.seg button.active { background: var(--accent); color: #fff; }

button.primary {
  width: 100%;
  padding: 0.8rem 1rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  background: var(--accent);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  margin-top: 0.25rem;
}
button.primary:hover { filter: brightness(1.07); }

/* Results */
.result {
  margin-top: 1.5rem;
  padding: 1.25rem 1.5rem;
  background: var(--accent-soft);
  border-radius: var(--radius);
  border: 1px solid var(--accent);
}
.result .big {
  font-size: 2rem; font-weight: 800; letter-spacing: -0.02em; line-height: 1.2;
}
.result .label { font-size: 0.85rem; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.result-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 0.75rem; }
.result-grid div .val { font-weight: 700; font-size: 1.15rem; }
.result-grid div .cap { font-size: 0.8rem; color: var(--text-muted); }
.warn {
  margin-top: 0.9rem; padding: 0.7rem 0.9rem; border-radius: 8px;
  background: rgba(224, 79, 46, 0.12); font-size: 0.9rem;
}

table.schedule {
  width: 100%; border-collapse: collapse; margin-top: 0.75rem; font-size: 0.95rem;
}
table.schedule th, table.schedule td {
  text-align: left; padding: 0.5rem 0.6rem; border-bottom: 1px solid var(--border);
}
table.schedule th { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); }
table.schedule tr.hl td { color: var(--accent); font-weight: 700; }

/* Content sections */
.prose { color: var(--text); }
.prose p { margin: 0.75rem 0; }
.prose ul { padding-left: 1.25rem; }
.prose .note { color: var(--text-muted); font-size: 0.9rem; }

details.faq {
  border-bottom: 1px solid var(--border); padding: 0.75rem 0;
}
details.faq summary { font-weight: 600; cursor: pointer; }
details.faq p { color: var(--text-muted); margin: 0.5rem 0 0.25rem; }

/* Tool cards (landing + tools pages) */
.tool-grid { display: grid; gap: 1rem; margin-top: 1.5rem; }
@media (min-width: 560px) { .tool-grid { grid-template-columns: 1fr 1fr; } }
.tool-card {
  display: block; color: var(--text);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.25rem; box-shadow: var(--shadow);
}
a.tool-card { text-decoration: none; transition: border-color 0.15s; }
a.tool-card:hover { border-color: var(--accent); }
.tool-card h3 { margin: 0 0 0.35rem; }
.tool-card p { margin: 0; color: var(--text-muted); font-size: 0.92rem; }
.tool-card .tag {
  display: inline-block; font-size: 0.72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.05em; color: var(--accent); margin-bottom: 0.5rem;
}
.tool-card.soon { border-style: dashed; box-shadow: none; }
.tool-card.soon .tag { color: var(--text-muted); }

footer.site {
  border-top: 1px solid var(--border);
  padding: 1.5rem 0 2.5rem;
  color: var(--text-muted);
  font-size: 0.85rem;
}
footer.site a { color: var(--text-muted); }

.crosslink {
  margin-top: 1.25rem; padding: 0.9rem 1.1rem; border-radius: var(--radius);
  background: var(--surface); border: 1px dashed var(--border); font-size: 0.92rem;
}

@media print {
  header.site, footer.site, form, .crosslink, .prose, button, h2.no-print { display: none !important; }
  body { background: #fff; color: #000; }
  .result { border: 1px solid #000; background: #fff; }
}
