/* ── Subnet Calculator — tool page styles ──────────────────────────
   Builds on css/shared.css tokens. Same component family as the
   Network Tools pages (hero / card / chips / steps / faq). */

main { max-width: 860px; margin: 0 auto; padding: 20px; }

/* ── Tool hero (icon + title + subtitle) ───────────────────────── */
.tool-hero { max-width: 860px; margin: 0 auto; padding: 36px 20px 4px; }
.tool-hero .hero-head { display: flex; align-items: center; gap: 16px; }
.tool-hero .hero-icon {
  flex-shrink: 0; width: 56px; height: 56px; border-radius: 14px;
  background: #0f0e0d; display: flex; align-items: center; justify-content: center;
}
.tool-hero .hero-icon svg { width: 30px; height: 30px; stroke: var(--accent); }
.tool-hero h1 { font-size: clamp(1.7rem, 4.5vw, 2.3rem); font-weight: 800; letter-spacing: -.5px; line-height: 1.15; }
.tool-hero .subtitle { color: var(--muted); font-size: 1.02rem; margin-top: 12px; max-width: 680px; }

/* ── Tool card ─────────────────────────────────────────────────── */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 24px; margin-top: 24px; }

/* ── Mode toggle (segmented control) ───────────────────────────── */
.mode-toggle { display: inline-flex; gap: 4px; padding: 4px; background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 18px; }
.mode-btn {
  font-family: inherit; font-size: .85rem; font-weight: 700; color: var(--muted);
  background: transparent; border: none; border-radius: 6px; padding: 9px 16px; min-height: 38px;
  cursor: pointer; transition: background .15s, color .15s;
}
.mode-btn:hover { color: var(--text); }
.mode-btn.active { background: var(--surface); color: var(--accent-fg); box-shadow: var(--shadow); }

/* ── Try chips (sample inputs) ─────────────────────────────────── */
.try-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 16px; }
.try-row .try-label { font-size: .85rem; color: var(--muted); font-weight: 600; margin-right: 2px; }
.try-chip {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--mono); font-size: .82rem; font-weight: 600; color: var(--text);
  background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--radius);
  padding: 7px 13px; min-height: 36px; cursor: pointer;
  transition: border-color .15s, background .15s, transform .1s;
}
.try-chip:hover { border-color: var(--accent); background: var(--accent-bg); transform: translateY(-1px); }

/* ── Input row ─────────────────────────────────────────────────── */
.field-label { display: block; font-size: .82rem; font-weight: 700; color: var(--text); margin-bottom: 7px; }
.input-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.input-group { flex: 1 1 260px; min-width: 0; }
.net-input {
  width: 100%;
  font-family: var(--mono); font-size: 1rem; line-height: 1.5;
  padding: 13px 15px; border: 1.5px solid var(--border); border-radius: var(--radius);
  background: var(--surface); color: var(--text); outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.net-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(5,150,105,.14); }
.net-input::placeholder { color: var(--muted); }

.split-controls { display: none; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-top: 14px; }
.split-controls.show { display: flex; }
.split-controls .input-group { flex: 1 1 180px; }

.net-select {
  font-family: inherit; font-size: .95rem;
  padding: 13px 12px; border: 1.5px solid var(--border); border-radius: var(--radius);
  background: var(--surface); color: var(--text); outline: none; cursor: pointer;
  transition: border-color .15s; width: 100%;
}
.net-select:focus { border-color: var(--accent); }

/* ── Buttons ───────────────────────────────────────────────────── */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 16px; }
.toolbar .spacer { flex: 1 1 auto; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 11px 22px;
  font-family: inherit; font-size: .95rem; font-weight: 700;
  border: none; border-radius: var(--radius); cursor: pointer;
  background: var(--accent); color: #fff;
  transition: background .15s, transform .1s, opacity .15s, border-color .15s;
  white-space: nowrap;
}
.btn:hover { background: var(--accent-h); }
.btn:active { transform: scale(.98); }
.btn svg { width: 16px; height: 16px; }
.btn-ghost { background: var(--surface); color: var(--text); border: 1.5px solid var(--border); }
.btn-ghost:hover { background: var(--surface2); border-color: var(--muted); }

/* ── Status / error line ───────────────────────────────────────── */
.status-line { min-height: 22px; margin-top: 16px; font-size: .9rem; font-weight: 600; display: none; align-items: center; gap: 8px; }
.status-line.show { display: flex; }
.status-line.error { color: #b42318; }
.status-line.ok { color: var(--accent-fg); }

/* ── Results ───────────────────────────────────────────────────── */
.results { margin-top: 20px; display: none; }
.results.show { display: block; }
.result-kicker { font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-fg); background: var(--accent-bg); border-radius: 999px; padding: 3px 11px; display: inline-block; margin-bottom: 14px; }
.result-grid { display: grid; grid-template-columns: 1fr; gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
@media (min-width: 560px) { .result-grid { grid-template-columns: 1fr 1fr; } }
.result-cell { background: var(--surface); padding: 13px 16px; display: flex; flex-direction: column; gap: 3px; }
.result-cell .r-label { font-size: .74rem; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: var(--muted); }
.result-cell .r-value { font-family: var(--mono); font-size: .96rem; font-weight: 600; color: var(--text); word-break: break-all; }
.result-cell .r-value.wide { font-size: .8rem; }
.result-cell.span-2 { grid-column: 1 / -1; }

/* ── Split results table ───────────────────────────────────────── */
.split-meta { font-size: .88rem; color: var(--muted); margin: 4px 0 14px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
table.split-table { width: 100%; border-collapse: collapse; font-family: var(--mono); font-size: .84rem; }
.split-table th, .split-table td { padding: 10px 13px; text-align: left; white-space: nowrap; border-bottom: 1px solid var(--border); }
.split-table th { background: var(--surface2); font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: .76rem; letter-spacing: .03em; text-transform: uppercase; color: var(--muted); position: sticky; top: 0; }
.split-table tbody tr:last-child td { border-bottom: none; }
.split-table tbody tr:nth-child(even) td { background: var(--surface2); }
.split-note { font-size: .82rem; color: var(--muted); margin-top: 10px; }

/* ── Trust row ─────────────────────────────────────────────────── */
.trust-row { display: flex; flex-wrap: wrap; gap: 22px; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--border); }
.trust-item { display: inline-flex; align-items: center; gap: 7px; font-size: .88rem; font-weight: 600; color: var(--muted); }
.trust-item svg { width: 16px; height: 16px; stroke: var(--accent); flex-shrink: 0; }

/* ── Read-more content links ───────────────────────────────────── */
.learn-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.learn-row a { font-size: .88rem; font-weight: 600; color: var(--accent); background: var(--accent-bg); border-radius: 999px; padding: 7px 15px; text-decoration: none; transition: background .15s; }
.learn-row a:hover { background: #cdeede; text-decoration: none; }

/* ── Content sections (how-it-works / faq) ─────────────────────── */
.section { max-width: 860px; margin: 16px auto; padding: 24px 20px; }
.section > h2 { font-size: 1.5rem; font-weight: 800; margin-bottom: 8px; }
.section > .section-sub { color: var(--muted); margin-bottom: 20px; }
.steps { display: grid; gap: 14px; }
.step { display: flex; gap: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; box-shadow: var(--shadow); }
.step-num { flex-shrink: 0; width: 36px; height: 36px; border-radius: 50%; background: var(--accent-bg); color: var(--accent-fg); font-weight: 800; display: flex; align-items: center; justify-content: center; }
.step-body h3 { font-size: 1.05rem; font-weight: 700; margin-bottom: 4px; }
.step-body p { font-size: .92rem; color: var(--muted); line-height: 1.6; }
.step-body a { color: var(--accent); }

.faq details { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 10px; overflow: hidden; }
.faq summary { cursor: pointer; padding: 16px 18px; font-weight: 700; font-size: .98rem; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; float: right; color: var(--accent); font-weight: 700; }
.faq details[open] summary::after { content: '\2013'; }
.faq .faq-body { padding: 0 18px 16px; font-size: .92rem; color: var(--muted); line-height: 1.7; }
.faq .faq-body a { color: var(--accent); }
.faq .faq-body code { font-family: var(--mono); font-size: .85em; background: var(--surface2); border: 1px solid var(--border); border-radius: 5px; padding: 1px 6px; }

/* ── Toast ─────────────────────────────────────────────────────── */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--text); color: #fff; padding: 11px 20px; border-radius: var(--radius); font-size: .88rem; font-weight: 600; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 200; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 620px) {
  .tool-hero .hero-icon { width: 48px; height: 48px; }
  .toolbar .spacer { flex-basis: 100%; height: 0; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; } }
