/*
 * Palette matches ~/tools/style.css exactly (same site, same "Tools"
 * section this page is linked from) rather than inventing a separate
 * look for one sub-page.
 */
:root {
    --bg: #0a0d0f;
    --panel: #12181b;
    --panel-line: #1f2b2e;
    --signal: #ffb400;
    --cyan: #59d6c4;
    --paper: #eae6da;
    --muted: #66767a;

    --font-mono: 'JetBrains Mono', 'DejaVu Sans Mono', 'Liberation Mono', 'Cascadia Code', ui-monospace, monospace;
    --font-sans: -apple-system, 'Segoe UI', 'Noto Sans', Roboto, Helvetica, Arial, sans-serif;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
}

body {
    background: radial-gradient(ellipse at 50% -10%, #16201f 0%, var(--bg) 55%);
    color: var(--paper);
    font-family: var(--font-sans);
    min-height: 100vh;
    padding: 32px 20px 60px;
    display: flex;
    justify-content: center;
}

.wrap {
    width: 100%;
    max-width: 640px;
}

header {
    margin-bottom: 32px;
}

.eyebrow {
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--cyan);
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.eyebrow::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--cyan);
    box-shadow: 0 0 8px var(--cyan);
}

h1 {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: clamp(28px, 6vw, 40px);
    letter-spacing: -0.01em;
    margin: 0 0 8px;
}

header p {
    color: var(--muted);
    font-size: 14px;
    line-height: 1.5;
    margin: 0;
}

.card {
    background: var(--panel);
    border: 1px solid var(--panel-line);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 18px;
}

.card h2 {
    font-family: var(--font-mono);
    font-size: 15px;
    font-weight: 600;
    margin: 0 0 16px;
    color: var(--paper);
}

/* ─── Headline metrics: one full-width row per metric, stacked ───── */
.metric-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 12px 0;
    border-bottom: 1px solid var(--panel-line);
}

.metric-row:last-of-type {
    border-bottom: none;
    margin-bottom: 20px;
}

.metric-label {
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.metric-value {
    font-family: var(--font-mono);
    font-size: 26px;
    font-weight: 700;
    color: var(--cyan);
    text-align: right;
}

.metric-unit {
    font-size: 13px;
    font-weight: 400;
    color: var(--muted);
    margin-left: 6px;
}

.metric-value .mbs {
    display: block;
    font-size: 12px;
    font-weight: 400;
    color: var(--muted);
    margin-top: 2px;
}

button {
    width: 100%;
    border: 0;
    border-radius: 10px;
    padding: 14px;
    font-family: var(--font-mono);
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.05em;
    cursor: pointer;
    color: #0a0d0f;
    background: linear-gradient(135deg, var(--cyan), var(--signal));
    transition: box-shadow 0.25s, opacity 0.25s;
}

button:hover:not(:disabled) {
    box-shadow: 0 0 20px rgba(89, 214, 196, 0.4);
}

button:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.status {
    margin-top: 16px;
    color: var(--muted);
    font-size: 13px;
    text-align: center;
}

.row {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    padding: 10px 0;
    border-bottom: 1px solid var(--panel-line);
    font-size: 13px;
}

.row:last-child {
    border-bottom: 0;
}

.row span:first-child {
    color: var(--muted);
}

.row span:last-child {
    text-align: right;
    word-break: break-all;
}

.compare .hint {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
    margin: 0 0 20px;
}

.save-row {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.save-row input {
    flex: 1;
    background: var(--bg);
    border: 1px solid var(--panel-line);
    border-radius: 10px;
    padding: 12px 14px;
    color: var(--paper);
    font-size: 13px;
}

.save-row input::placeholder {
    color: var(--muted);
}

.save-row button {
    width: auto;
    padding: 12px 24px;
    font-size: 13px;
    white-space: nowrap;
}

.card.compare {
    overflow-x: auto;
}

table.results {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

table.results th,
table.results td {
    padding: 10px 8px;
    text-align: left;
    border-bottom: 1px solid var(--panel-line);
    white-space: nowrap;
}

table.results th {
    font-family: var(--font-mono);
    color: var(--muted);
    font-weight: 600;
}

table.results tbody tr:last-child td {
    border-bottom: 0;
}

table.results .delete {
    width: auto;
    background: transparent;
    border: 0;
    color: var(--muted);
    font-size: 13px;
    padding: 2px 8px;
    border-radius: 6px;
}

table.results .delete:hover {
    color: var(--paper);
    background: var(--panel-line);
    box-shadow: none;
}

footer {
    margin-top: 32px;
    text-align: center;
}

footer a {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--muted);
    text-decoration: none;
}

footer a:hover {
    color: var(--cyan);
}

/* Fixed home-page shortcut -- same markup/classes as every other
   sub-page across the site (tools, morse, dl, account). */
.home-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 50;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--panel);
    border: 1px solid rgba(89, 214, 196, 0.4);
    border-radius: 50%;
    color: var(--cyan);
    text-decoration: none;
    transition: color .15s ease, border-color .15s ease, box-shadow .15s ease;
}

.home-btn:hover {
    color: var(--cyan);
    border-color: var(--cyan);
    box-shadow: 0 0 12px rgba(89, 214, 196, 0.35);
}

.home-btn svg {
    display: block;
}
