/* ShipKit styles. System fonts only: nothing is loaded from font services. */
:root {
  --bg: #f7f8fb;
  --surface: #ffffff;
  --surface-2: #eef1f7;
  --text: #141a2b;
  --muted: #5a6478;
  --border: #dde2ec;
  --accent: #3b5bdb;
  --accent-strong: #2f4ac0;
  --accent-soft: #e7ecff;
  --on-accent: #ffffff;
  --good: #1f8a5b;
  --warn: #b26a00;
  --bad: #c0392b;
  --shadow: 0 1px 2px rgba(20, 26, 43, .06), 0 4px 16px rgba(20, 26, 43, .06);
  --radius: 12px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1320;
    --surface: #171c2c;
    --surface-2: #1f2538;
    --text: #e8ebf3;
    --muted: #9aa3b8;
    --border: #2b3248;
    --accent: #7c93ff;
    --accent-strong: #98aaff;
    --accent-soft: #232c4d;
    --on-accent: #0f1320;
    --good: #4cc38a;
    --warn: #f0b048;
    --bad: #ff7a6b;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 var(--font);
}
a { color: var(--accent); }
a:hover { color: var(--accent-strong); }
img, svg, canvas { max-width: 100%; }
h1, h2, h3 { line-height: 1.25; margin: 1.6em 0 .5em; }
h1 { font-size: clamp(1.8rem, 4vw, 2.5rem); margin-top: .4em; letter-spacing: -.01em; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.1rem; }
p { margin: 0 0 1em; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 46rem; }

/* Layout */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px; max-width: 1120px; margin: 0 auto;
}
.brand { margin: 0; font-weight: 800; font-size: 1.25rem; letter-spacing: -.02em; }
.brand a { color: var(--text); text-decoration: none; display: inline-flex; align-items: center; gap: 8px; }
.brand .wordmark span { color: var(--accent); }
.brand svg { width: 28px; height: 28px; }
.top-links { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.top-links a { text-decoration: none; font-weight: 600; font-size: .95rem; }
.top-links a:not(.btn) { color: var(--muted); }
.top-links a:not(.btn):hover { color: var(--text); }
@media (max-width: 640px) { .top-links .hide-sm { display: none; } }

.page { max-width: 1120px; margin: 0 auto; padding: 8px 16px 48px; }
.page.narrow { max-width: 760px; }
.prose { max-width: 760px; }

.site-footer {
  border-top: 1px solid var(--border); margin-top: 32px; padding: 24px 16px 40px;
  text-align: center;
}
.footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; margin-bottom: 8px; }
.footer-links a { color: var(--muted); text-decoration: none; font-size: .9rem; }
.footer-links a:hover { color: var(--text); }

/* Buttons and inputs */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  border-radius: 10px; padding: 8px 14px; font: 600 .95rem var(--font); cursor: pointer;
  text-decoration: none; min-height: 40px;
}
.btn:hover { border-color: var(--accent); color: var(--text); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); color: var(--on-accent); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { color: var(--bad); border-color: transparent; }
.btn-sm { min-height: 32px; padding: 4px 10px; font-size: .85rem; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }

input, select, textarea {
  font: inherit; color: var(--text); background: var(--surface);
  border: 1px solid var(--border); border-radius: 8px; padding: 7px 10px; width: 100%;
  min-height: 38px;
}
input:focus, select:focus, textarea:focus, .btn:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent);
}
[aria-invalid="true"] { border-color: var(--bad); }
label.field { display: grid; gap: 4px; font-weight: 600; font-size: .9rem; }
label.field small { font-weight: 400; color: var(--muted); }
.field-row { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }

/* Cards */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow);
}
.card + .card { margin-top: 16px; }
.card h2:first-child, .card h3:first-child { margin-top: 0; }

/* Home */
.hero { padding: 32px 0 16px; }
.hero h1 { font-size: clamp(2rem, 5vw, 3rem); max-width: 18ch; }
.badge {
  display: inline-block; background: var(--accent-soft); color: var(--accent-strong);
  font-weight: 700; font-size: .8rem; border-radius: 999px; padding: 3px 10px;
}
.tool-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); margin: 24px 0; }
.tool-card {
  display: flex; flex-direction: column; gap: 8px; text-decoration: none; color: var(--text);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow); transition: transform .15s, border-color .15s;
}
.tool-card:hover { transform: translateY(-2px); border-color: var(--accent); color: var(--text); }
.tool-card .icon { font-size: 1.6rem; line-height: 1; }
.tool-card h2 { margin: 0; font-size: 1.15rem; }
.tool-card p { margin: 0; color: var(--muted); font-size: .95rem; }
.tool-card .go { margin-top: auto; color: var(--accent); font-weight: 700; font-size: .9rem; }
.features { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.features h3 { margin: 0 0 4px; font-size: 1rem; }
.features p { margin: 0; color: var(--muted); font-size: .95rem; }

/* Tool pages */
.tool-head { margin-bottom: 16px; }
.tool-head p { margin: 0; }
.crumbs { font-size: .85rem; color: var(--muted); margin: 8px 0 0; }
.crumbs a { color: var(--muted); }
.mode-switch { display: inline-flex; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.mode-switch button {
  border: 0; background: var(--surface); color: var(--muted); padding: 8px 14px;
  font: 600 .9rem var(--font); cursor: pointer; min-height: 38px;
}
.mode-switch button[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }

.table-wrap { position: relative; overflow-x: auto; margin: 12px 0; border: 1px solid var(--border); border-radius: 10px; }
table.grid { border-collapse: collapse; width: 100%; min-width: 720px; background: var(--surface); }
table.grid th, table.grid td { padding: 8px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
table.grid th { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: var(--surface-2); white-space: nowrap; }
table.grid tr:last-child td { border-bottom: 0; }
table.grid input, table.grid select { min-height: 34px; padding: 5px 8px; }
table.grid select { min-width: 140px; }
table.grid input[data-k="name"] { min-width: 200px; }
table.grid td.num { font-variant-numeric: tabular-nums; font-weight: 700; white-space: nowrap; }
.rank {
  display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%;
  background: var(--surface-2); font-weight: 700; font-size: .8rem;
}
tr.top .rank { background: var(--accent); color: var(--on-accent); }
.bar { height: 6px; background: var(--surface-2); border-radius: 3px; overflow: hidden; margin-top: 4px; min-width: 60px; }
.bar i { display: block; height: 100%; background: var(--accent); border-radius: 3px; }

.stats { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); margin: 16px 0; }
.stat { background: var(--surface-2); border-radius: 10px; padding: 14px; }
.stat b { display: block; font-size: 1.6rem; font-variant-numeric: tabular-nums; line-height: 1.2; }
.stat span { color: var(--muted); font-size: .85rem; }
.stat.hero-stat { background: var(--accent); color: var(--on-accent); }
.stat.hero-stat span { color: inherit; opacity: .85; }

.big-number {
  font-size: clamp(2.5rem, 9vw, 4.5rem); font-weight: 800; font-variant-numeric: tabular-nums;
  letter-spacing: -.02em; line-height: 1.1; margin: 8px 0;
}
.timer { font-family: var(--mono); color: var(--muted); font-size: 1.1rem; }

/* Roadmap */
.roadmap-title { font-size: 1.3rem; font-weight: 700; border: 1px dashed transparent; }
.roadmap-title:hover { border-color: var(--border); }
.board { display: grid; gap: 16px; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 16px; }
@media (max-width: 820px) { .board { grid-template-columns: 1fr; } }
.lane { background: var(--surface-2); border-radius: var(--radius); padding: 12px; min-height: 180px; }
.lane h2 { margin: 0 0 2px; font-size: 1.05rem; display: flex; align-items: center; gap: 8px; }
.lane h2 .count { font-size: .8rem; color: var(--muted); font-weight: 600; }
.lane .hint { font-size: .8rem; color: var(--muted); margin: 0 0 10px; }
.lane-add { display: flex; gap: 6px; margin-top: 8px; }
.item {
  background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--accent);
  border-radius: 8px; padding: 8px 10px; margin-bottom: 8px; box-shadow: var(--shadow);
}
.item .item-title { font-weight: 600; outline: none; word-break: break-word; }
.item .item-title:focus { background: var(--accent-soft); border-radius: 4px; }
.item .item-meta { display: flex; justify-content: space-between; align-items: center; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.item select { width: auto; min-height: 28px; padding: 2px 6px; font-size: .8rem; }
.item .moves { display: flex; gap: 2px; }
.item .moves button {
  border: 0; background: transparent; color: var(--muted); cursor: pointer; width: 30px; height: 30px;
  border-radius: 6px; font-size: .95rem;
}
.item .moves button:hover { background: var(--surface-2); color: var(--text); }
.item .moves button.del:hover { color: var(--bad); }

/* Misc */
.ad-slot { margin: 24px 0; min-height: 90px; text-align: center; }
.ad-label { display: block; font-size: .7rem; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px);
  background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 10px;
  font-weight: 600; opacity: 0; transition: opacity .2s, transform .2s; pointer-events: none; z-index: 50;
  max-width: calc(100% - 32px);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.faq details { border-bottom: 1px solid var(--border); padding: 12px 0; }
.faq summary { font-weight: 600; cursor: pointer; }
.faq details p { margin: 8px 0 0; color: var(--muted); }
.formula {
  font-family: var(--mono); background: var(--surface-2); border-radius: 8px; padding: 10px 14px;
  display: inline-block; font-size: .95rem;
}
.contact-form { display: grid; gap: 14px; max-width: 640px; }
.form-status[data-type="ok"] { color: var(--good); }
.form-status[data-type="error"] { color: var(--bad); }
.hp { position: absolute; left: -9999px; }
.updated { color: var(--muted); font-size: .9rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
