:root {
  --bg: #0d0e10;
  --bg-1: #131518;
  --bg-2: #1a1d21;
  --bg-3: #22262b;
  --line: #23272c;
  --line-2: #30353b;
  --text: #e9ebee;
  --text-2: #c3c8cf;
  --muted: #8d949e;
  --dim: #646b75;
  --accent: #efc94c;
  --accent-2: #f6dc85;
  --accent-bg: rgba(239, 201, 76, 0.09);
  --accent-ink: #1b1600;

  --font: 'Commissioner', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', 'Noto Sans', 'Hiragino Sans', 'PingFang SC', 'Malgun Gothic', sans-serif;
  --radius: 6px;

  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 24px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; }
img { max-width: 100%; }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }

.skip { position: absolute; left: -9999px; top: 8px; z-index: 50; background: var(--accent); color: var(--accent-ink); padding: 8px 12px; border-radius: var(--radius); }
.skip:focus { left: 8px; }

.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .wrap { padding: 0 28px; } }

h1, h2, h3 { font-weight: 700; margin: 0; letter-spacing: -0.02em; text-wrap: balance; }
h1 { font-size: clamp(2rem, 4.6vw, 3.2rem); line-height: 1.08; font-weight: 750; letter-spacing: -0.03em; }
h2 { font-size: 1.35rem; line-height: 1.25; }
h3 { font-size: 1.08rem; line-height: 1.35; }

.num { font-variant-numeric: tabular-nums; }
.mt { margin-top: 40px !important; }
.mt-s { margin-top: 24px !important; }

/* ---------- header ---------- */

.site-header { border-bottom: 1px solid var(--line); background: var(--bg); }
.header-inner { display: flex; align-items: center; gap: 12px 28px; min-height: 64px; flex-wrap: wrap; padding-top: 10px; padding-bottom: 10px; }

.logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; flex: none; }
.logo-tile {
  position: relative; width: 30px; height: 30px; flex: none;
  background: var(--accent); color: var(--accent-ink); border-radius: 5px;
  display: grid; place-items: center;
}
.logo-n { position: absolute; top: 3px; left: 4px; font-size: 7px; font-weight: 700; line-height: 1; }
.logo-s { font-size: 18px; font-weight: 800; line-height: 1; margin-top: 4px; }
.logo-word { font-size: 1.22rem; font-weight: 750; letter-spacing: -0.03em; }
.logo-word span { color: var(--dim); font-weight: 600; }

.main-nav { display: flex; gap: 2px; order: 3; width: calc(100% + 20px); overflow-x: auto; margin: 0 -10px; scrollbar-width: none; }
.main-nav::-webkit-scrollbar { display: none; }
.main-nav a {
  text-decoration: none; color: var(--muted); white-space: nowrap;
  font-weight: 500; font-size: 0.94rem; padding: 6px 10px; border-radius: var(--radius);
}
.main-nav a:hover { color: var(--text); background: var(--bg-2); }
.main-nav a[aria-current] { color: var(--text); background: var(--bg-2); }

.lang-jump {
  margin-inline-start: auto; display: inline-flex; align-items: center; gap: 6px;
  color: var(--muted); text-decoration: none; font-size: 0.82rem; font-weight: 600;
  padding: 6px 10px; border: 1px solid var(--line-2); border-radius: var(--radius);
}
.lang-jump:hover { color: var(--text); border-color: var(--muted); }

@media (min-width: 860px) {
  .main-nav { order: 0; width: auto; margin: 0; }
}

/* ---------- breadcrumb ---------- */

.breadcrumb ol { list-style: none; margin: 0 0 18px; padding: 0; display: flex; flex-wrap: wrap; gap: 4px; font-size: 0.85rem; color: var(--dim); }
.breadcrumb li:not(:last-child)::after { content: '/'; margin-inline-start: 6px; color: var(--line-2); }
.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--text); }
.breadcrumb [aria-current] { color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 40ch; }

/* ---------- hero / heads ---------- */

.hero { padding-top: 56px; padding-bottom: 56px; }
.hero h1 { max-width: 18ch; }
.hero.narrow h1 { max-width: none; }
.tool-head { padding-top: 32px; padding-bottom: 28px; }
.lede { color: var(--muted); font-size: 1.1rem; max-width: 38em; margin: 14px 0 0; }
.section-lede { color: var(--muted); margin: 6px 0 18px; }
.text-link { color: var(--accent); text-decoration: none; font-weight: 600; font-size: 0.95rem; }
.text-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.err-code { color: var(--accent); font-weight: 700; margin: 0 0 8px; }

.tool-grid { list-style: none; margin: 40px 0 0; padding: 0; display: grid; gap: 12px; }
@media (min-width: 760px) { .tool-grid { grid-template-columns: repeat(3, 1fr); } }
.tool-grid a {
  display: flex; flex-direction: column; height: 100%;
  padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-1);
  text-decoration: none; transition: border-color 0.15s, background 0.15s;
}
.tool-grid a:hover { border-color: var(--line-2); background: var(--bg-2); }
.tool-name { font-size: 1.12rem; font-weight: 700; letter-spacing: -0.01em; }
.tool-desc { color: var(--muted); font-size: 0.95rem; margin-top: 6px; flex: 1; }
.tool-open { margin-top: 16px; color: var(--accent); font-weight: 600; font-size: 0.9rem; }

/* ---------- layout blocks ---------- */

.home-grid { display: grid; gap: 48px; padding-bottom: 64px; border-top: 1px solid var(--line); padding-top: 48px; }
@media (min-width: 1000px) { .home-grid { grid-template-columns: minmax(0, 1fr) 330px; } }
.side h2 { margin-bottom: 14px; font-size: 1.1rem; }

.block { padding-top: 48px; padding-bottom: 64px; border-top: 1px solid var(--line); }
.block-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 20px; }

/* ---------- tables ---------- */

.table-scroll { overflow-x: auto; margin: 0 -16px; padding: 0 16px; }
@media (min-width: 720px) { .table-scroll { margin: 0; padding: 0; } }

table { border-collapse: collapse; width: 100%; }
th, td { text-align: start; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th:first-child, td:first-child { padding-inline-start: 0; }
th:last-child, td:last-child { padding-inline-end: 0; }
thead th { font-size: 0.78rem; font-weight: 600; color: var(--dim); border-bottom-color: var(--line-2); white-space: nowrap; }
th.num, td.num { text-align: end; font-variant-numeric: tabular-nums; }
tbody th { font-weight: 500; }

.raid-table { min-width: 560px; }
.raid-table tbody th { white-space: nowrap; }
.raid-table .hp { display: block; font-size: 0.78rem; font-weight: 400; color: var(--dim); margin-top: 1px; }
.raid-table td .q { display: block; font-weight: 650; font-size: 1rem; }
.raid-table td .s { display: block; font-size: 0.78rem; color: var(--dim); margin-top: 1px; }
.raid-table td.best { background: var(--accent-bg); }
.raid-table td.best .q { color: var(--accent); }
.raid-table td.best:last-child { padding-inline-end: 12px; }
.raid-table tr.group th { font-size: 0.8rem; font-weight: 600; color: var(--muted); padding-top: 22px; border-bottom-color: var(--line-2); }
.table-note { font-size: 0.85rem; color: var(--dim); margin: 12px 0 0; }

.plain-table td.num { font-size: 0.95rem; }
.recipes td { color: var(--text-2); }

/* ---------- countdown ---------- */

.countdown { border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; background: var(--bg-1); }
.cd-units { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.cd-units > div { display: flex; flex-direction: column; }
.cd-n { font-size: clamp(2.2rem, 9vw, 5.2rem); font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: -0.04em; }
.cd-l { font-size: 0.8rem; color: var(--dim); margin-top: 8px; }
.cd-when { margin: 24px 0 0; padding-top: 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.95rem; }
.cd-when time { color: var(--text); font-weight: 600; }
.cd-local { display: block; font-size: 0.9rem; }
.countdown.compact { padding: 18px; margin-bottom: 12px; }
.countdown.compact .cd-n { font-size: 1.9rem; }
.countdown.compact .cd-l { margin-top: 4px; font-size: 0.72rem; }
.countdown.compact .cd-when { margin-top: 14px; padding-top: 12px; font-size: 0.85rem; }
.wipe-main { padding-bottom: 56px; }
.wipes td { color: var(--muted); font-variant-numeric: tabular-nums; }
.wipes tbody tr:first-child th, .wipes tbody tr:first-child td { color: var(--accent); }

/* ---------- calculators ---------- */

.calc { display: grid; gap: 32px; padding-bottom: 64px; align-items: start; }
@media (min-width: 900px) { .calc { grid-template-columns: minmax(0, 1fr) 360px; gap: 48px; } }

fieldset { border: 0; margin: 0 0 32px; padding: 0; min-width: 0; }
legend { font-size: 0.85rem; font-weight: 650; color: var(--text-2); padding: 0; margin-bottom: 2px; }
.fs-note { margin: 0 0 4px; font-size: 0.85rem; color: var(--dim); }

.row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.row label { display: flex; flex-direction: column; cursor: pointer; }
.row-name { font-weight: 500; }
.row-sub { font-size: 0.78rem; color: var(--dim); }
.row.active .row-name { color: var(--accent); }

.stepper { display: inline-flex; border: 1px solid var(--line-2); border-radius: var(--radius); overflow: hidden; flex: none; }
.stepper button { width: 38px; height: 38px; border: 0; background: var(--bg-1); color: var(--muted); font: 400 1.15rem/1 var(--font); cursor: pointer; }
.stepper button:hover { background: var(--bg-2); color: var(--text); }
.stepper button:active { background: var(--bg-3); }
.stepper input {
  width: 52px; height: 38px; border: 0; border-inline: 1px solid var(--line-2);
  background: var(--bg); color: var(--text); text-align: center;
  font: 600 1rem var(--font); font-variant-numeric: tabular-nums; -moz-appearance: textfield; appearance: textfield;
}
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.stepper input:focus { outline: none; background: var(--bg-2); }

@media (min-width: 900px) { .summary { position: sticky; top: 20px; } }
.summary-inner { border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-1); padding: 20px; }
.label { font-size: 0.85rem; font-weight: 600; color: var(--muted); margin: 0; }
.total { margin: 4px 0 16px; display: flex; align-items: baseline; gap: 8px; }
.total span { font-size: 2.6rem; font-weight: 750; line-height: 1.1; font-variant-numeric: tabular-nums; color: var(--accent); letter-spacing: -0.03em; }
.total small { color: var(--dim); font-size: 0.9rem; }

.mix { list-style: none; padding: 0; margin: 0 0 20px; display: flex; flex-wrap: wrap; gap: 6px; }
.mix li { font-size: 0.9rem; font-weight: 500; padding: 4px 10px; background: var(--bg-2); border-radius: var(--radius); }
.mix li b { color: var(--accent); font-weight: 700; font-variant-numeric: tabular-nums; }
.mix li.empty, .methods .empty td { background: none; padding-inline-start: 0; color: var(--dim); font-weight: 400; border: 0; }

.methods th, .methods td { padding: 8px; font-size: 0.92rem; }
.methods thead th { font-size: 0.75rem; }
.methods tr.cheapest th, .methods tr.cheapest td { color: var(--accent); }

.steps { margin: 8px 0 0; padding-inline-start: 20px; color: var(--muted); font-size: 0.92rem; }
.steps li { padding: 3px 0; }
.steps li b { color: var(--text); font-weight: 500; }
.steps .qty { color: var(--text); font-variant-numeric: tabular-nums; }

.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.btn {
  display: inline-flex; align-items: center; height: 38px; padding: 0 14px;
  border: 1px solid var(--accent); border-radius: var(--radius);
  background: var(--accent); color: var(--accent-ink);
  font: 600 0.92rem var(--font); text-decoration: none; cursor: pointer;
}
.btn:hover { background: var(--accent-2); border-color: var(--accent-2); }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--line-2); }
.btn.ghost:hover { border-color: var(--muted); background: transparent; }

.mobile-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: flex; align-items: center; gap: 12px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: var(--bg-2); border-top: 1px solid var(--line-2);
  text-decoration: none; transform: translateY(100%); transition: transform 0.2s;
}
.mobile-bar.has-value:not(.hidden) { transform: none; }
.mb-label { font-size: 0.8rem; font-weight: 600; color: var(--muted); }
.mb-total { font-size: 0.85rem; color: var(--dim); }
.mb-total b { font-size: 1.1rem; color: var(--accent); font-weight: 700; font-variant-numeric: tabular-nums; }
.mb-go { margin-inline-start: auto; font-weight: 600; font-size: 0.9rem; }
@media (min-width: 900px) { .mobile-bar { display: none; } }

/* ---------- prose / faq ---------- */

.prose { padding-bottom: 72px; }
.prose > h2 { margin: 48px 0 16px; }
.prose > h2:first-child { margin-top: 0; }
.prose > p { color: var(--text-2); max-width: 44em; }
.more-link { margin-top: 20px; }

.faq { border-top: 1px solid var(--line); max-width: 52em; }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { list-style: none; cursor: pointer; padding: 16px 36px 16px 0; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; position: absolute; inset-inline-end: 4px; top: 13px; font-size: 1.3rem; color: var(--dim); }
.faq details[open] summary::after { content: '−'; color: var(--accent); }
.faq h3 { font-size: 1.02rem; font-weight: 550; letter-spacing: 0; }
.faq summary:hover h3 { color: var(--accent); }
.faq p { margin: 0 0 18px; color: var(--text-2); max-width: 44em; }

/* ---------- guides ---------- */

.guides-wrap { padding-bottom: 72px; }
.guide-section { padding: 28px 0; border-top: 1px solid var(--line); }
.guide-section h2 { margin-bottom: 16px; }

.guide-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
@media (min-width: 760px) { .guide-list { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1080px) { .guide-list { grid-template-columns: repeat(3, 1fr); } }
.guide-list li { background: var(--bg); }
.guide-list a { display: flex; flex-direction: column; gap: 6px; height: 100%; padding: 18px 20px; text-decoration: none; transition: background 0.15s; }
.guide-list a:hover { background: var(--bg-1); }
.guide-list a:hover .g-title { color: var(--accent); }
.g-cat { font-size: 0.78rem; font-weight: 600; color: var(--dim); }
.g-lang { color: var(--muted); }
.g-title { font-size: 1.04rem; font-weight: 650; line-height: 1.35; letter-spacing: -0.01em; }
.g-desc { font-size: 0.9rem; color: var(--muted); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

.article-layout { display: grid; gap: 40px; padding-top: 32px; padding-bottom: 56px; }
@media (min-width: 1040px) { .article-layout { grid-template-columns: minmax(0, 720px) 260px; justify-content: space-between; } }

.article-head { padding-bottom: 24px; border-bottom: 1px solid var(--line); margin-bottom: 28px; }
.article-head h1 { font-size: clamp(1.9rem, 4vw, 2.7rem); }
.article-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 18px 0 0; font-size: 0.85rem; color: var(--dim); }
.article-meta a { color: var(--accent); text-decoration: none; font-weight: 600; }

.article-body { font-size: 1.04rem; line-height: 1.72; color: var(--text-2); }
.article-body > :first-child { margin-top: 0; }
.article-body p, .article-body ul, .article-body ol { margin: 0 0 1.1em; }
.article-body h2 { color: var(--text); font-size: 1.5rem; margin: 2.2em 0 0.6em; }
.article-body h3 { color: var(--text); font-size: 1.15rem; margin: 1.8em 0 0.5em; }
.article-body strong { color: var(--text); font-weight: 650; }
.article-body a { color: var(--accent); text-decoration: underline; text-decoration-color: rgba(239, 201, 76, 0.35); text-underline-offset: 3px; }
.article-body a:hover { text-decoration-color: var(--accent); }
.article-body li { margin: 0.3em 0; }
.article-body li::marker { color: var(--dim); }
.article-body .table-scroll { margin-bottom: 1.4em; }
.article-body table { font-size: 0.94rem; line-height: 1.5; }
.article-body thead th { color: var(--muted); }
.article-body td { color: var(--text-2); }
.article-body blockquote { margin: 1.4em 0; padding: 4px 0 4px 18px; border-inline-start: 3px solid var(--accent); color: var(--text); }
.article-body code { font-size: 0.9em; background: var(--bg-2); padding: 1px 5px; border-radius: 4px; }
.article-body hr { border: 0; border-top: 1px solid var(--line); margin: 2em 0; }
.article-body .sources-heading { font-size: 1rem; color: var(--muted); margin-top: 3em; padding-top: 1.4em; border-top: 1px solid var(--line); }
.article-body .sources-heading + ul { font-size: 0.88rem; color: var(--dim); }
.translated-note { font-size: 0.85rem; color: var(--dim); margin-top: 32px; }

.article-aside { display: flex; flex-direction: column; gap: 28px; }
@media (min-width: 1040px) { .article-aside { position: sticky; top: 20px; align-self: start; max-height: calc(100vh - 40px); overflow: auto; } }
.article-aside h2 { font-size: 0.85rem; font-weight: 650; color: var(--muted); margin-bottom: 10px; letter-spacing: 0; }
.toc ol, .aside-tools ul { list-style: none; margin: 0; padding: 0; border-inline-start: 1px solid var(--line); }
.toc a, .aside-tools a { display: block; padding: 5px 0; padding-inline-start: 14px; margin-inline-start: -1px; border-inline-start: 1px solid transparent; color: var(--muted); text-decoration: none; font-size: 0.9rem; line-height: 1.4; }
.toc a:hover, .aside-tools a:hover { color: var(--text); border-color: var(--muted); }
.toc a.active { color: var(--accent); border-color: var(--accent); }
@media (max-width: 1039px) { .toc { display: none; } }

.related h2 { margin-bottom: 20px; }

/* ---------- footer ---------- */

.site-footer { border-top: 1px solid var(--line); background: var(--bg-1); padding: 48px 0 32px; }
.footer-grid { display: grid; gap: 36px; }
@media (min-width: 720px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1000px) { .footer-grid { grid-template-columns: 1.4fr 1fr 1.3fr 1fr; } }
.footer-brand p { color: var(--muted); font-size: 0.92rem; max-width: 30em; margin: 14px 0 0; }
.site-footer h2 { font-size: 0.85rem; font-weight: 650; color: var(--text); margin-bottom: 12px; letter-spacing: 0; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer nav li { padding: 4px 0; }
.site-footer nav a { color: var(--muted); text-decoration: none; font-size: 0.9rem; }
.site-footer nav a:hover { color: var(--text); }
.site-footer nav a.more { color: var(--accent); }

.lang-picker { position: relative; }
.lang-picker summary {
  list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 12px; border: 1px solid var(--line-2); border-radius: var(--radius);
  color: var(--text); font-size: 0.92rem; font-weight: 500; background: var(--bg);
}
.lang-picker summary::-webkit-details-marker { display: none; }
.lang-picker summary::after { content: ''; width: 6px; height: 6px; border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted); transform: rotate(45deg) translateY(-2px); margin-inline-start: 6px; }
.lang-picker[open] summary::after { transform: rotate(-135deg) translateY(-1px); }
.lang-picker summary:hover { border-color: var(--muted); }
.lang-list {
  margin-top: 8px !important; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 8px;
  padding: 8px !important; border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--bg);
  max-width: 340px;
}
.lang-list a { display: block; padding: 6px 8px; border-radius: 4px; color: var(--muted); text-decoration: none; font-size: 0.88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lang-list a:hover { background: var(--bg-2); color: var(--text); }
.lang-list a[aria-current] { color: var(--accent); }
@media (min-width: 1000px) {
  .lang-list { position: absolute; bottom: calc(100% + 8px); inset-inline-end: 0; z-index: 20; width: 340px; box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45); }
}

.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--line); font-size: 0.82rem; color: var(--dim); }
.footer-bottom p { margin: 0; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); z-index: 30;
  background: var(--text); color: var(--bg); padding: 8px 14px; border-radius: var(--radius);
  font: 500 0.9rem var(--font); opacity: 0; transition: opacity 0.15s, transform 0.15s; pointer-events: none;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
thead th::first-letter { text-transform: uppercase; }

/* Visually hidden text: read by screen readers and crawlers, not shown. */
.vh { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.raid-table tbody th a { color: inherit; text-decoration: none; }
.raid-table tbody th a:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }

.freshness { font-size: 0.82rem; color: var(--dim); margin: 6px 0 0; }

/* ---------- target pages ---------- */

.target-grid { display: grid; gap: 48px; padding-bottom: 48px; }
@media (min-width: 1000px) { .target-grid { grid-template-columns: minmax(0, 1fr) 300px; } }
.target-grid h2 { margin-bottom: 14px; font-size: 1.1rem; }
.target-table { max-width: 640px; }
.target-table td.num { font-size: 1rem; font-weight: 600; }
.target-table tr.best-row th, .target-table tr.best-row td { color: var(--accent); }
.tag { display: inline-block; margin-inline-start: 8px; padding: 1px 8px; border-radius: 999px; background: var(--accent-bg); color: var(--accent); font-size: 0.75rem; font-weight: 600; vertical-align: 1px; }
.link-list { list-style: none; margin: 0; padding: 0; border-inline-start: 1px solid var(--line); }
.link-list a { display: block; padding: 5px 0; padding-inline-start: 14px; margin-inline-start: -1px; border-inline-start: 1px solid transparent; color: var(--muted); text-decoration: none; font-size: 0.92rem; }
.link-list a:hover { color: var(--text); border-color: var(--muted); }

/* ---------- wipe extras ---------- */

.wipe-extras { display: grid; gap: 12px; padding-bottom: 56px; }
@media (min-width: 900px) { .wipe-extras { grid-template-columns: repeat(3, 1fr); } }
.extra { border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-1); padding: 20px; display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.extra h2 { font-size: 1.05rem; }
.extra p { margin: 0; color: var(--muted); font-size: 0.92rem; }
.extra .actions { margin-top: auto; }
.snippet {
  width: 100%; margin: 0; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--bg);
  color: var(--text-2); font: 0.8rem/1.5 ui-monospace, 'SF Mono', Menlo, Consolas, monospace; white-space: pre-wrap; word-break: break-all;
}

/* ---------- embed ---------- */

body.embed { background: var(--bg); padding: 10px; }
body.embed .countdown { margin: 0; }
.embed-by { display: block; margin-top: 6px; text-align: end; font-size: 0.75rem; color: var(--dim); text-decoration: none; }
.embed-by:hover { color: var(--accent); }

/* ---------- segmented choice and grid inputs ---------- */

.seg { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.seg label { cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: inline-flex; align-items: center; height: 36px; padding: 0 14px; border: 1px solid var(--line-2); border-radius: var(--radius); color: var(--muted); font-size: 0.92rem; font-weight: 500; transition: border-color 0.15s, color 0.15s; }
.seg label:hover span { color: var(--text); border-color: var(--muted); }
.seg input:checked + span { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); }
.seg input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

.grid-input { min-width: 460px; }
.grid-input th { font-weight: 500; vertical-align: middle; }
.grid-input td { padding: 6px 0 6px 8px; }
.grid-input input {
  width: 100%; min-width: 64px; height: 38px; border: 1px solid var(--line-2); border-radius: var(--radius);
  background: var(--bg); color: var(--text); text-align: center; font: 600 1rem var(--font); font-variant-numeric: tabular-nums;
  -moz-appearance: textfield; appearance: textfield;
}
.grid-input input::-webkit-outer-spin-button, .grid-input input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.grid-input input:focus { outline: none; border-color: var(--accent); }
.upkeep-out td.num { font-weight: 600; color: var(--accent); }

/* ---------- mobile fixes ---------- */

/* Grid items default to min-width: auto and grow to fit wide tables; keep them inside the viewport. */
.home-grid > *, .calc > *, .target-grid > *, .article-layout > *, .footer-grid > *, .inputs, .summary { min-width: 0; }

/* Taps on steppers and buttons should never trigger double-tap zoom. */
button, a, input, label, summary, .stepper { touch-action: manipulation; }

/* Safety net against stray horizontal scroll; clip (unlike hidden) keeps sticky positioning working. */
html, body { overflow-x: clip; }

.grid-input { min-width: 0; }
.grid-input th { font-size: 0.9rem; }
.grid-input input { min-width: 44px; }

@media (max-width: 520px) {
  .stepper button { width: 42px; height: 42px; }
  .stepper input { width: 56px; height: 42px; }
  .row { gap: 10px; }
  .row-name { font-size: 0.95rem; }
  .cd-units { gap: 4px; }
  .countdown { padding: 20px 16px; }
  .seg span { height: 38px; padding: 0 12px; }
  .lang-list { max-width: none; }
  .summary-inner { padding: 16px; }
  .total span { font-size: 2.2rem; }
}
/* Hidden helper text inside tables must stay inside the scroll box, not stretch the page. */
.table-scroll, .row label { position: relative; }

/* Upkeep grid fits the screen: fixed columns, wrapping headers. */
.grid-input { table-layout: fixed; width: 100%; }
.grid-input thead th { white-space: normal; line-height: 1.2; vertical-align: bottom; text-align: center; }
.grid-input thead th:first-child { width: 36%; }
.grid-input td { padding-inline-start: 6px; }
.grid-input input { min-width: 0; padding: 0 2px; }

@media (max-width: 859px) {
  /* All menu links visible: wrap instead of a hidden horizontal scroll. */
  .main-nav { flex-wrap: wrap; overflow: visible; gap: 2px 0; }
  .main-nav a { padding: 6px 9px; font-size: 0.9rem; }
}
@media (max-width: 520px) {
  .grid-input thead th { font-size: 0.7rem; }
  .grid-input th[scope="row"] { font-size: 0.85rem; }
}
