/* Wagonsmith - one stylesheet, no framework, system fonts. Classes use the ws- prefix. */
:root {
  --ws-bg: #f7f8f6;
  --ws-surface: #ffffff;
  --ws-text: #1c2421;
  --ws-muted: #5a6661;
  --ws-line: #dde3df;
  --ws-accent: #1f5f4a;
  --ws-accent-dark: #174836;
  --ws-accent-soft: #e6f1ec;
  --ws-warn: #9a3412;
  --ws-radius: 10px;
  --ws-font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ws-bg: #111816;
    --ws-surface: #1a2320;
    --ws-text: #e8eeeb;
    --ws-muted: #9fb0a9;
    --ws-line: #2c3a36;
    --ws-accent: #5fc19c;
    --ws-accent-dark: #86d6b6;
    --ws-accent-soft: #1d2d28;
    --ws-warn: #fb923c;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--ws-bg); color: var(--ws-text); font: 1rem/1.65 var(--ws-font); }
a { color: var(--ws-accent); }
a:hover { color: var(--ws-accent-dark); }
img, svg { max-width: 100%; height: auto; }
.ws-wrap { width: 100%; max-width: 960px; margin: 0 auto; padding: 0 16px; }
.ws-skip { position: absolute; left: -9999px; top: 0; background: var(--ws-surface); padding: 8px 12px; z-index: 10; }
.ws-skip:focus { left: 8px; top: 8px; }

/* Header */
.ws-header { background: var(--ws-surface); border-bottom: 1px solid var(--ws-line); }
.ws-header-in { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 20px; padding-top: 10px; padding-bottom: 10px; }
.ws-brand { font-weight: 700; font-size: 1.25rem; color: var(--ws-text); text-decoration: none; letter-spacing: -0.01em; }
.ws-nav { display: flex; gap: 4px 16px; flex-wrap: wrap; font-size: 0.92rem; }
.ws-nav a { color: var(--ws-muted); text-decoration: none; padding: 4px 0; }
.ws-nav a:hover, .ws-nav a[aria-current] { color: var(--ws-accent); }

/* Layout */
.ws-main { padding-top: 16px; padding-bottom: 40px; }
.ws-bc ol { list-style: none; display: flex; flex-wrap: wrap; gap: 4px; margin: 0 0 8px; padding: 0; font-size: 0.85rem; color: var(--ws-muted); }
.ws-bc li + li::before { content: "/"; margin-right: 4px; }
.ws-bc a { color: var(--ws-muted); }
.ws-h1 { font-size: 1.75rem; line-height: 1.25; margin: 8px 0 12px; letter-spacing: -0.01em; }
.ws-lead { font-size: 1.1rem; color: var(--ws-muted); margin: 0 0 20px; }
.ws-prose h2 { font-size: 1.35rem; margin: 2rem 0 0.5rem; line-height: 1.3; }
.ws-prose h3 { font-size: 1.1rem; margin: 1.4rem 0 0.4rem; }
.ws-prose p, .ws-prose ul, .ws-prose ol { margin: 0 0 1rem; }
.ws-prose li { margin-bottom: 0.3rem; }
.ws-prose code, .ws-formula { background: var(--ws-accent-soft); padding: 2px 6px; border-radius: 4px; font-size: 0.95em; }
.ws-formula { display: block; padding: 10px 14px; margin: 0 0 12px; overflow-x: auto; }
.ws-note { border-left: 4px solid var(--ws-accent); background: var(--ws-accent-soft); padding: 10px 14px; border-radius: 0 var(--ws-radius) var(--ws-radius) 0; margin: 0 0 1rem; }
.ws-table { width: 100%; border-collapse: collapse; margin: 0 0 1rem; font-size: 0.95rem; }
.ws-table th, .ws-table td { border: 1px solid var(--ws-line); padding: 6px 10px; text-align: left; }
.ws-table th { background: var(--ws-accent-soft); }

/* Cards */
.ws-cards { list-style: none; margin: 0 0 1.5rem; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.ws-card a { display: flex; flex-direction: column; gap: 4px; height: 100%; padding: 14px 16px; background: var(--ws-surface); border: 1px solid var(--ws-line); border-radius: var(--ws-radius); text-decoration: none; color: var(--ws-text); }
.ws-card a:hover { border-color: var(--ws-accent); }
.ws-card-kind { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ws-accent); font-weight: 600; }
.ws-card-title { font-weight: 600; }
.ws-card-desc { font-size: 0.9rem; color: var(--ws-muted); }
.ws-group { margin: 0 0 2rem; }
.ws-group h2 { font-size: 1.3rem; margin: 0 0 4px; }
.ws-group p { margin: 0 0 10px; color: var(--ws-muted); }
.ws-empty { color: var(--ws-muted); font-style: italic; }
.ws-related { margin-top: 2.5rem; border-top: 1px solid var(--ws-line); padding-top: 1rem; }
.ws-related h2 { font-size: 1.2rem; }

/* FAQ */
.ws-faq h2 { margin-top: 2rem; }
.ws-faq-item { border: 1px solid var(--ws-line); border-radius: var(--ws-radius); background: var(--ws-surface); margin: 0 0 8px; padding: 0 14px; }
.ws-faq-item summary { cursor: pointer; font-weight: 600; padding: 12px 0; }
.ws-faq-item p { margin: 0 0 12px; }

/* Tool card */
.ws-tool { background: var(--ws-surface); border: 2px solid var(--ws-accent); border-radius: 14px; padding: 16px; margin: 0 0 1.5rem; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06); }
.ws-row { border: 1px solid var(--ws-line); border-radius: var(--ws-radius); padding: 12px; margin: 0 0 12px; background: var(--ws-bg); }
.ws-row-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; gap: 8px; }
.ws-row-title { font-weight: 600; }
.ws-fields { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 8px; }
.ws-field { display: flex; flex-direction: column; gap: 4px; font-size: 0.88rem; color: var(--ws-muted); }
.ws-field input, .ws-field select { font: inherit; font-size: 1rem; padding: 9px 10px; border: 1px solid var(--ws-line); border-radius: 8px; background: var(--ws-surface); color: var(--ws-text); width: 100%; min-height: 42px; }
.ws-field input:focus, .ws-field select:focus { outline: 2px solid var(--ws-accent); outline-offset: 1px; }
.ws-row-area { font-size: 0.9rem; color: var(--ws-muted); margin: 0; }
.ws-row-area output { font-weight: 600; color: var(--ws-text); }
.ws-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.ws-btn { font: inherit; font-weight: 600; padding: 10px 16px; border-radius: 8px; border: 1px solid var(--ws-accent); background: var(--ws-surface); color: var(--ws-accent); cursor: pointer; min-height: 42px; }
.ws-btn:hover { background: var(--ws-accent-soft); }
.ws-btn-primary { background: var(--ws-accent); color: #fff; }
.ws-btn-primary:hover { background: var(--ws-accent-dark); color: #fff; }
.ws-btn-small { padding: 4px 10px; min-height: 32px; font-size: 0.85rem; font-weight: 500; }
.ws-result { background: var(--ws-accent-soft); border-radius: var(--ws-radius); padding: 14px 16px; margin-top: 14px; }
.ws-result h2 { font-size: 1.05rem; margin: 0 0 8px; }
.ws-result dl { margin: 0; display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; }
.ws-result dt { color: var(--ws-muted); }
.ws-result dd { margin: 0; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.ws-big { font-size: 1.4rem; }
.ws-error { color: var(--ws-warn); font-size: 0.9rem; margin: 8px 0 0; min-height: 1.2em; }
[hidden] { display: none !important; }

/* Footer */
.ws-footer { border-top: 1px solid var(--ws-line); background: var(--ws-surface); padding: 20px 0 28px; font-size: 0.9rem; color: var(--ws-muted); }
.ws-footer-nav { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-bottom: 10px; }
.ws-footer-nav a { color: var(--ws-muted); }
.ws-footer-note { margin: 2px 0; }
.ws-ad { margin: 1.5rem 0; min-height: 90px; }

@media (min-width: 640px) {
  .ws-h1 { font-size: 2.1rem; }
  .ws-fields { grid-template-columns: repeat(4, 1fr); }
  .ws-tool { padding: 22px; }
}
