/* =====================================================================
   RPM Counter - dark neon tachometer theme (mobile first)
   ===================================================================== */

:root {
    --bg: #070b14;
    --bg-2: #0a101d;
    --surface: #0e1524;
    --surface-2: #141d30;
    --line: rgba(148, 163, 184, 0.12);
    --line-2: rgba(148, 163, 184, 0.22);
    --text: #e8edf7;
    --muted: #94a3b8;
    --dim: #64748b;
    --orange: #ff6a2b;
    --orange-2: #ff9a3c;
    --cyan: #22d3ee;
    --green: #22c55e;
    --red: #ef4444;
    --radius: 16px;
    --radius-sm: 10px;
    --gutter: 16px;
    --max: 1180px;
    --topbar: 56px;
    --bottomnav: 64px;
    --font-num: 'Chakra Petch', 'Inter', system-ui, sans-serif;
    --font-display: 'Orbitron', 'Inter', system-ui, sans-serif;
    color-scheme: dark;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    font-size: 16px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    -webkit-tap-highlight-color: transparent;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(900px 500px at 85% -10%, rgba(255, 106, 43, 0.10), transparent 60%),
        radial-gradient(800px 500px at -10% 30%, rgba(34, 211, 238, 0.08), transparent 60%),
        var(--bg);
}

h1, h2, h3 {
    line-height: 1.2;
    margin: 0 0 0.5em;
    letter-spacing: -0.01em;
}

h1 {
    font-size: clamp(1.9rem, 6vw, 3.2rem);
    font-weight: 800;
}

h2 {
    font-size: clamp(1.15rem, 3.5vw, 1.5rem);
    font-weight: 700;
}

h3 {
    font-size: 1.05rem;
    font-weight: 700;
}

h1:focus {
    outline: none;
}

p {
    margin: 0 0 1em;
}

a {
    color: inherit;
}

img {
    max-width: 100%;
    height: auto;
}

code {
    font-family: ui-monospace, 'Cascadia Code', Menlo, monospace;
}

.muted {
    color: var(--muted);
}

.small {
    font-size: 0.85rem;
}

.center {
    text-align: center;
}

.lead {
    color: #cbd5e1;
    font-size: clamp(1rem, 2.6vw, 1.15rem);
    max-width: 680px;
}

.link {
    color: var(--cyan);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.92rem;
}

.link:hover {
    text-decoration: underline;
}

.grad {
    background: linear-gradient(90deg, var(--orange), var(--orange-2) 45%, var(--cyan));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* live dots ------------------------------------------------------------ */

.dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex: none;
}

.dot-live {
    background: var(--green);
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.6);
    animation: pulse 1.8s infinite;
}

.dot-mic {
    background: var(--orange);
    box-shadow: 0 0 0 0 rgba(255, 106, 43, 0.6);
    animation: pulse-o 1.8s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.55); }
    70% { box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); }
    100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

@keyframes pulse-o {
    0% { box-shadow: 0 0 0 0 rgba(255, 106, 43, 0.55); }
    70% { box-shadow: 0 0 0 8px rgba(255, 106, 43, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 106, 43, 0); }
}

/* buttons -------------------------------------------------------------- */

.btn-primary,
.btn-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 10px 20px;
    border-radius: 999px;
    font: inherit;
    font-weight: 700;
    font-size: 0.95rem;
    text-decoration: none;
    cursor: pointer;
    border: 0;
    transition: transform 0.15s, box-shadow 0.2s, background 0.2s;
}

.btn-primary {
    color: #fff;
    background: linear-gradient(135deg, var(--orange), #ff4d4d);
    box-shadow: 0 8px 24px -8px rgba(255, 106, 43, 0.7);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 30px -8px rgba(255, 106, 43, 0.85);
}

.btn-primary.big {
    font-size: 1.05rem;
    padding: 14px 28px;
}

.btn-ghost {
    color: var(--text);
    background: rgba(148, 163, 184, 0.08);
    border: 1px solid var(--line-2);
}

.btn-ghost:hover {
    background: rgba(148, 163, 184, 0.16);
}

/* shell ---------------------------------------------------------------- */

.shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    height: var(--topbar);
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0 var(--gutter);
    padding-top: env(safe-area-inset-top);
    background: rgba(7, 11, 20, 0.78);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    text-decoration: none;
    font-weight: 800;
    font-size: 1.1rem;
    letter-spacing: 0.01em;
}

.brand img {
    border-radius: 8px;
}

.brand b {
    color: var(--orange);
    font-weight: 800;
}

.brand.small {
    font-size: 1rem;
    margin-bottom: 8px;
}

.toplinks {
    display: none;
    gap: 4px;
    margin-left: 16px;
}

.toplinks a {
    text-decoration: none;
    color: var(--muted);
    font-weight: 600;
    font-size: 0.92rem;
    padding: 8px 12px;
    border-radius: 999px;
    transition: color 0.2s, background 0.2s;
}

.toplinks a:hover {
    color: var(--text);
}

.toplinks a.active {
    color: var(--text);
    background: rgba(148, 163, 184, 0.1);
}

.content {
    flex: 1;
}

.bottomnav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 60;
    display: flex;
    height: calc(var(--bottomnav) + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    background: rgba(10, 16, 29, 0.92);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-top: 1px solid var(--line);
}

.bottomnav a {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    text-decoration: none;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--dim);
    transition: color 0.2s;
}

.bottomnav a.active {
    color: var(--text);
}

.bottomnav a.active .bn-ico {
    transform: translateY(-2px) scale(1.12);
    filter: drop-shadow(0 0 8px rgba(255, 106, 43, 0.6));
}

.bn-ico {
    font-size: 1.3rem;
    line-height: 1;
    transition: transform 0.2s;
}

.footer {
    border-top: 1px solid var(--line);
    background: var(--bg-2);
    padding: 32px var(--gutter) 20px;
    margin-bottom: calc(var(--bottomnav) + env(safe-area-inset-bottom));
}

.footer-inner {
    max-width: var(--max);
    margin: 0 auto;
    display: grid;
    gap: 20px;
}

.footer p {
    color: var(--muted);
    font-size: 0.9rem;
    max-width: 460px;
}

.footer-links {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 20px;
}

.footer-links a {
    color: #cbd5e1;
    text-decoration: none;
    font-size: 0.92rem;
}

.footer-links a:hover {
    color: var(--orange);
}

.footer-copy {
    max-width: var(--max);
    margin: 20px auto 0 !important;
    font-size: 0.8rem !important;
    color: var(--dim) !important;
}

/* page containers ------------------------------------------------------- */

.page {
    max-width: var(--max);
    margin: 0 auto;
    padding: 20px var(--gutter) 24px;
}

.page.narrow {
    max-width: 820px;
}

.page-head {
    margin: 12px 0 20px;
}

.section {
    margin-top: 44px;
}

.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.section-head h2 {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.card {
    background: linear-gradient(180deg, rgba(20, 29, 48, 0.75), rgba(14, 21, 36, 0.75));
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 18px;
    min-width: 0;
}

.grid-2 {
    display: grid;
    gap: 16px;
}

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

.hero {
    position: relative;
    overflow: hidden;
    border-bottom: 1px solid var(--line);
}

.hero-bg {
    position: absolute;
    inset: 0;
}

.hero-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 30% center;
    opacity: 0.38;
}

.hero-bg::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(7, 11, 20, 0.3) 0%, rgba(7, 11, 20, 0.85) 70%, var(--bg) 100%),
        linear-gradient(90deg, rgba(7, 11, 20, 0.9) 0%, rgba(7, 11, 20, 0.2) 70%);
}

.hero-inner {
    position: relative;
    max-width: var(--max);
    margin: 0 auto;
    padding: 28px var(--gutter) 24px;
}

.hero h1 {
    max-width: 760px;
}

/* counters --------------------------------------------------------------- */

.counters {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 18px;
}

.counter {
    background: rgba(14, 21, 36, 0.72);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: border-color 0.3s, box-shadow 0.3s;
}

.counter.is-hot {
    border-color: rgba(255, 106, 43, 0.45);
    box-shadow: 0 0 24px -6px rgba(255, 106, 43, 0.45);
}

.counter-label {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
}

.counter-value {
    font-family: var(--font-num);
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.1;
}

.anim-num {
    display: inline-block;
    font-variant-numeric: tabular-nums;
}

.anim-num.bump {
    animation: bump 0.9s ease-out;
}

@keyframes bump {
    0% { color: var(--orange-2); text-shadow: 0 0 18px rgba(255, 106, 43, 0.9); transform: scale(1.12); }
    100% { color: inherit; text-shadow: none; transform: scale(1); }
}

.counters.compact {
    max-width: 760px;
}

/* =====================================================================
   meter
   ===================================================================== */

.meter {
    display: grid;
    gap: 14px;
    margin-top: 4px;
    scroll-margin-top: calc(var(--topbar) + 8px);
}

.meter-setup {
    display: grid;
    gap: 12px;
}

.mode-row {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 2px 2px 6px;
    margin: 0 calc(var(--gutter) * -1);
    padding-left: var(--gutter);
    padding-right: var(--gutter);
    scrollbar-width: none;
    scroll-snap-type: x proximity;
}

.mode-row::-webkit-scrollbar {
    display: none;
}

.mode-row.small {
    margin: 0 0 12px;
    padding-left: 0;
    padding-right: 0;
}

.mode-chip {
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 42px;
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid var(--line-2);
    background: rgba(20, 29, 48, 0.7);
    color: #cbd5e1;
    font: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    scroll-snap-align: start;
    transition: all 0.2s;
}

.mode-chip:hover:not(:disabled) {
    border-color: rgba(255, 106, 43, 0.5);
}

.mode-chip.active {
    color: #fff;
    border-color: transparent;
    background: linear-gradient(135deg, rgba(255, 106, 43, 0.95), rgba(255, 77, 77, 0.95));
    box-shadow: 0 6px 20px -6px rgba(255, 106, 43, 0.7);
}

.mode-chip:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.mode-chip-emoji {
    font-size: 1.1rem;
}

.units-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.units-label {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
    min-width: 76px;
}

.stepper {
    display: inline-flex;
    align-items: center;
    background: var(--surface-2);
    border: 1px solid var(--line-2);
    border-radius: 999px;
    overflow: hidden;
}

.stepper button {
    width: 44px;
    height: 40px;
    border: 0;
    background: transparent;
    color: var(--text);
    font-size: 1.3rem;
    cursor: pointer;
}

.stepper button:disabled {
    color: var(--dim);
    cursor: not-allowed;
}

.stepper button:hover:not(:disabled) {
    background: rgba(255, 106, 43, 0.15);
}

.stepper-value {
    min-width: 36px;
    text-align: center;
    font-family: var(--font-num);
    font-weight: 700;
    font-size: 1.15rem;
}

.quick-picks {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.pick {
    min-width: 38px;
    height: 38px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: rgba(20, 29, 48, 0.6);
    color: var(--muted);
    font: inherit;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
}

.pick.active {
    color: var(--orange);
    border-color: rgba(255, 106, 43, 0.6);
    background: rgba(255, 106, 43, 0.1);
}

.pick:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* gauge ------------------------------------------------------------------ */

.gauge-wrap {
    position: relative;
    display: grid;
    justify-items: center;
    gap: 6px;
    padding: 10px 0 0;
}

.gauge {
    width: min(100%, 420px);
    height: auto;
    overflow: visible;
    filter: drop-shadow(0 20px 40px rgba(0, 0, 0, 0.5));
}

.gauge-track {
    fill: none;
    stroke: rgba(148, 163, 184, 0.12);
    stroke-width: 12;
    stroke-linecap: round;
}

.gauge-red {
    fill: none;
    stroke: rgba(239, 68, 68, 0.55);
    stroke-width: 12;
}

.gauge-arc {
    fill: none;
    stroke: url(#arcGrad);
    stroke-width: 12;
    stroke-linecap: round;
    stroke-dasharray: 0 200;
    opacity: 0;
}

.tick {
    stroke: rgba(203, 213, 225, 0.35);
    stroke-width: 1.5;
}

.tick.major {
    stroke: rgba(226, 232, 240, 0.85);
    stroke-width: 2.5;
}

.tick.red {
    stroke: var(--red);
}

.tick-label {
    fill: #cbd5e1;
    font-family: var(--font-num);
    font-size: 13px;
    font-weight: 700;
}

.tick-label.red {
    fill: #f87171;
}

.gauge-unit {
    fill: var(--dim);
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.08em;
}

.needle {
    stroke: var(--orange);
    stroke-width: 4;
    stroke-linecap: round;
}

.hub {
    fill: #1e293b;
    stroke: var(--orange);
    stroke-width: 3;
}

.readout {
    fill: #fff;
    font-family: var(--font-num);
    font-size: 38px;
    font-weight: 900;
    letter-spacing: 0.02em;
    font-variant-numeric: tabular-nums;
}

.meter[data-state="running"] .readout {
    filter: drop-shadow(0 0 10px rgba(255, 106, 43, 0.55));
}

.meter[data-state="running"][data-lost="1"] .readout {
    fill: #94a3b8;
    filter: none;
}

.readout-unit {
    fill: var(--orange);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.3em;
}

.readout-hz {
    fill: var(--muted);
    font-size: 11px;
    font-weight: 600;
}

.signal {
    width: min(100%, 420px);
    display: grid;
    gap: 8px;
}

.status {
    justify-self: center;
    font-size: 0.85rem;
    font-weight: 700;
    padding: 5px 14px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.1);
    color: var(--muted);
    transition: all 0.25s;
}

.status[data-state="locked"] {
    color: #052e16;
    background: var(--green);
    box-shadow: 0 0 18px -2px rgba(34, 197, 94, 0.7);
}

.status[data-state="weak"],
.status[data-state="search"] {
    color: #1f1302;
    background: #fbbf24;
}

.status[data-state="quiet"],
.status[data-state="error"] {
    color: #fff;
    background: rgba(239, 68, 68, 0.85);
}

.signal-bars {
    display: grid;
    gap: 6px;
}

.bar-row {
    display: grid;
    grid-template-columns: 54px 1fr;
    align-items: center;
    gap: 10px;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.bar {
    height: 8px;
    border-radius: 99px;
    background: rgba(148, 163, 184, 0.12);
    overflow: hidden;
}

.bar i {
    display: block;
    height: 100%;
    width: 0;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--cyan), #67e8f9);
    transition: width 0.12s linear;
}

.bar.lock i {
    background: linear-gradient(90deg, #f59e0b, var(--green));
}

/* start button ---------------------------------------------------------- */

.start-wrap {
    display: grid;
    justify-items: center;
    gap: 10px;
    margin-top: 4px;
}

.start-btn {
    position: relative;
    width: 148px;
    height: 148px;
    border-radius: 50%;
    border: 0;
    cursor: pointer;
    color: #fff;
    font: inherit;
    background: radial-gradient(circle at 35% 30%, #ff8a50, var(--orange) 45%, #d9381e 100%);
    box-shadow:
        0 0 0 6px rgba(255, 106, 43, 0.15),
        0 18px 40px -10px rgba(255, 106, 43, 0.75),
        inset 0 -6px 16px rgba(0, 0, 0, 0.25),
        inset 0 4px 10px rgba(255, 255, 255, 0.25);
    transition: transform 0.15s, box-shadow 0.3s, background 0.3s;
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
}

.start-btn:active:not(:disabled) {
    transform: scale(0.95);
}

.start-btn:disabled {
    opacity: 0.7;
    cursor: wait;
}

.start-ring {
    position: absolute;
    inset: -10px;
    border-radius: 50%;
    border: 2px solid rgba(255, 106, 43, 0.35);
    animation: ring 2.4s ease-out infinite;
    pointer-events: none;
}

@keyframes ring {
    0% { transform: scale(0.92); opacity: 1; }
    100% { transform: scale(1.22); opacity: 0; }
}

.start-btn.running {
    background: radial-gradient(circle at 35% 30%, #3f4a63, #1e293b 60%, #0f172a 100%);
    box-shadow:
        0 0 0 6px rgba(239, 68, 68, 0.25),
        0 0 40px -4px rgba(239, 68, 68, 0.6),
        inset 0 4px 10px rgba(255, 255, 255, 0.1);
}

.start-btn.running .start-ring {
    border-color: rgba(239, 68, 68, 0.6);
    animation-duration: 1.1s;
}

.start-label {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    font-family: var(--font-display);
    font-weight: 900;
    font-size: 1.35rem;
    letter-spacing: 0.08em;
}

.start-icon {
    font-size: 1.1rem;
    opacity: 0.9;
}

.start-btn.running .start-icon {
    color: #f87171;
}

.start-hint {
    margin: 0;
    max-width: 360px;
    text-align: center;
    font-size: 0.88rem;
    color: var(--muted);
}

.meter-alert {
    margin: 0;
}

/* live stats ------------------------------------------------------------ */

.live-stats {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 6px;
}

.live-stats div,
.result-grid div,
.mini-stats div {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 10px 4px;
    border-radius: 12px;
    background: rgba(20, 29, 48, 0.7);
    border: 1px solid var(--line);
    min-width: 0;
}

.live-stats span,
.result-grid span,
.mini-stats span {
    font-size: 0.66rem;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    white-space: nowrap;
}

.live-stats b,
.result-grid b,
.mini-stats b {
    font-family: var(--font-num);
    font-size: clamp(0.85rem, 3.4vw, 1.1rem);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.meter[data-state="running"] .live-stats b {
    color: #fff;
}

/* graphs ------------------------------------------------------------------ */

.graph-card {
    background: rgba(14, 21, 36, 0.8);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 12px 12px 8px;
}

.graph-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 6px;
}

.graph-head h3 {
    margin: 0;
    font-size: 0.95rem;
}

.graph-sub {
    font-size: 0.72rem;
    color: var(--dim);
}

.graph {
    display: block;
    width: 100%;
    height: 190px;
}

.spectrum {
    display: block;
    width: 100%;
    height: 120px;
}

/* result ------------------------------------------------------------------- */

.result {
    border-radius: var(--radius);
    padding: 16px;
    background: linear-gradient(160deg, rgba(20, 29, 48, 0.95), rgba(14, 21, 36, 0.95));
    border: 1px solid var(--line-2);
    animation: pop 0.45s cubic-bezier(0.2, 1.4, 0.4, 1);
}

.result.saved {
    border-color: rgba(34, 197, 94, 0.4);
    box-shadow: 0 0 40px -12px rgba(34, 197, 94, 0.45);
}

@keyframes pop {
    0% { transform: scale(0.94) translateY(10px); opacity: 0; }
    100% { transform: none; opacity: 1; }
}

.result-head {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 12px;
}

.result-emoji {
    font-size: 2rem;
}

.result-title {
    font-weight: 800;
    font-size: 1.15rem;
}

.result-sub {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--muted);
    font-size: 0.88rem;
}

.result-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
}

.result-facts {
    list-style: none;
    padding: 0;
    margin: 14px 0 0;
    display: grid;
    gap: 6px;
    font-size: 0.92rem;
    color: #cbd5e1;
}

.result-facts b {
    color: var(--orange-2);
}

.result-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 14px;
}

.result-actions.center {
    justify-content: center;
    margin: 24px 0;
}

/* advanced ----------------------------------------------------------------- */

.advanced {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(14, 21, 36, 0.6);
    padding: 0 16px;
}

.advanced summary {
    cursor: pointer;
    padding: 14px 0;
    font-weight: 700;
    font-size: 0.95rem;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.advanced summary::-webkit-details-marker {
    display: none;
}

.advanced summary::after {
    content: "⚙️";
}

.advanced[open] summary {
    border-bottom: 1px solid var(--line);
}

.adv-block {
    padding: 14px 0;
}

.adv-block + .adv-block {
    border-top: 1px solid var(--line);
}

.adv-title {
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.adv-fields {
    display: grid;
    gap: 10px;
    margin-top: 10px;
}

/* accounts & email --------------------------------------------------------- */

.signin-btn,
.account-btn {
    flex: none;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.85rem;
}

.signin-btn {
    padding: 6px 14px;
    border-radius: 999px;
    border: 1px solid var(--line-2);
    color: var(--text);
}

.signin-btn:hover {
    border-color: var(--orange);
}

.account-btn {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    color: #fff;
    background: linear-gradient(135deg, var(--orange), #ff4d4d);
}

/* right-align the account button in the top bar */
.topbar .signin-btn,
.topbar .account-btn {
    margin-left: auto;
}

.email-box {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
}

.email-ask {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    font-weight: 600;
}

.email-intro {
    font-size: 0.9rem;
    color: #cbd5e1;
}

.key-signup {
    display: grid;
    gap: 10px;
}

.key-row {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.key-row .key-email {
    flex: 1 1 220px;
    margin: 0 !important;
}

.key-form {
    display: grid;
    gap: 10px;
}

.key-label {
    font-size: 0.9rem;
    color: #cbd5e1;
}

.key-input {
    flex: 1 1 160px;
    min-height: 46px;
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px solid var(--line-2);
    background: var(--bg-2);
    color: var(--text);
    font-family: var(--font-num);
    font-size: 1.4rem;
    letter-spacing: 0.3em;
    text-align: center;
    min-width: 0;
}

.key-input:focus {
    outline: 2px solid var(--orange);
    outline-offset: 1px;
}

.check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 0.85rem;
    color: #cbd5e1;
    cursor: pointer;
}

.check input {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    accent-color: var(--orange);
    flex: none;
}

.check.big {
    font-size: 0.95rem;
    padding: 10px 0;
}

.form-error {
    margin: 0;
    color: #f87171;
    font-size: 0.88rem;
    font-weight: 600;
}

.form-ok {
    margin: 0;
    color: #4ade80;
    font-weight: 600;
}

.link-btn {
    justify-self: start;
    border: 0;
    background: none;
    padding: 0;
    color: var(--cyan);
    font: inherit;
    font-size: 0.85rem;
    cursor: pointer;
}

.nudge {
    margin-top: 16px;
    border-color: rgba(255, 106, 43, 0.3);
}

.nudge-head {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}

.nudge-head h2 {
    margin-bottom: 4px;
}

.nudge-emoji {
    font-size: 2rem;
    line-height: 1;
}

.danger summary {
    cursor: pointer;
    font-weight: 700;
    color: #f87171;
}

.danger-btn {
    color: #f87171 !important;
    border-color: rgba(239, 68, 68, 0.4) !important;
}

.mb-4 {
    margin-bottom: 16px;
}

.adv-fields.single {
    grid-template-columns: 1fr !important;
}

.history-notes {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-top: 4px;
    font-size: 0.8rem;
    color: #cbd5e1;
    white-space: pre-line;
}

.my-recent {
    margin-top: 0;
}

.notes-text {
    margin: 0;
    white-space: pre-line;
    color: #e2e8f0;
}

.small-btn {
    min-height: 34px;
    padding: 6px 14px;
    font-size: 0.85rem;
}

.adv-help {
    margin: 10px 0 0;
    font-size: 0.8rem;
    color: var(--muted);
}

.seg {
    display: inline-flex;
    background: var(--surface-2);
    border: 1px solid var(--line-2);
    border-radius: 999px;
    padding: 3px;
}

.seg button {
    border: 0;
    background: transparent;
    color: var(--muted);
    font: inherit;
    font-weight: 700;
    font-size: 0.85rem;
    padding: 7px 16px;
    border-radius: 999px;
    cursor: pointer;
    min-height: 36px;
}

.seg button.active {
    color: #fff;
    background: var(--orange);
}

.seg button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.seg.small button {
    padding: 4px 12px;
    min-height: 30px;
    font-size: 0.8rem;
}

/* steps / modes / faq ---------------------------------------------------------- */

.steps {
    display: grid;
    gap: 14px;
}

.step {
    display: grid;
    grid-template-columns: 110px 1fr;
    gap: 14px;
    align-items: center;
    background: rgba(14, 21, 36, 0.7);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 10px;
    overflow: hidden;
}

.step img {
    width: 110px;
    height: 110px;
    object-fit: cover;
    border-radius: 12px;
}

.step h3 {
    margin: 4px 0 4px;
}

.step p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--muted);
}

.step-num {
    display: inline-grid;
    place-items: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--orange), #ff4d4d);
    color: #fff;
    font-family: var(--font-num);
    font-weight: 900;
    font-size: 0.8rem;
}

.modes {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.mode-card {
    background: rgba(14, 21, 36, 0.75);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform 0.2s, border-color 0.2s;
}

.mode-card:hover {
    transform: translateY(-3px);
    border-color: rgba(255, 106, 43, 0.4);
}

.mode-card img {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
}

.mode-card-body {
    padding: 12px;
}

.mode-card h3 {
    font-size: 0.95rem;
}

.mode-card p {
    font-size: 0.82rem;
    color: var(--muted);
    margin-bottom: 6px;
}

.mode-card-ex {
    font-size: 0.75rem;
    color: var(--cyan);
}

.faq {
    display: grid;
    gap: 8px;
}

.faq details {
    background: rgba(14, 21, 36, 0.7);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 0 16px;
}

.faq summary {
    cursor: pointer;
    padding: 14px 0;
    font-weight: 700;
    list-style: none;
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.faq summary::-webkit-details-marker {
    display: none;
}

.faq summary::after {
    content: "+";
    color: var(--orange);
    font-size: 1.3rem;
    line-height: 1;
    transition: transform 0.2s;
}

.faq details[open] summary::after {
    transform: rotate(45deg);
}

.faq details p {
    color: #cbd5e1;
    font-size: 0.93rem;
}

.cta {
    margin: 48px 0 8px;
    text-align: center;
    padding: 32px 20px;
    border-radius: 20px;
    background:
        radial-gradient(500px 200px at 50% 0%, rgba(255, 106, 43, 0.25), transparent 70%),
        rgba(14, 21, 36, 0.8);
    border: 1px solid rgba(255, 106, 43, 0.25);
}

.cta p {
    color: var(--muted);
}

/* feed ------------------------------------------------------------------------ */

.feed {
    display: grid;
    gap: 6px;
}

.feed-item {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(20, 29, 48, 0.6);
    border: 1px solid var(--line);
    text-decoration: none;
    transition: background 0.2s, border-color 0.2s;
}

.feed-item:hover {
    background: rgba(30, 41, 59, 0.8);
}

.feed-item.is-new {
    animation: feed-in 0.6s cubic-bezier(0.2, 1.2, 0.4, 1), feed-glow 4s ease-out;
}

@keyframes feed-in {
    0% { transform: translateY(-14px) scale(0.97); opacity: 0; }
    100% { transform: none; opacity: 1; }
}

@keyframes feed-glow {
    0%, 30% { border-color: rgba(255, 106, 43, 0.8); box-shadow: 0 0 22px -4px rgba(255, 106, 43, 0.6); }
    100% { border-color: var(--line); box-shadow: none; }
}

.feed-emoji {
    font-size: 1.5rem;
    text-align: center;
}

.feed-main {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.feed-title,
.feed-meta {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.feed-title {
    font-size: 0.92rem;
}

.feed-units {
    color: var(--muted);
    font-size: 0.82rem;
}

.feed-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    color: var(--muted);
}

.feed-nick {
    color: var(--cyan);
}

.feed-rpm {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.feed-rpm-value {
    font-family: var(--font-num);
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--orange-2);
}

.feed-rpm-label {
    font-size: 0.66rem;
    color: var(--dim);
    white-space: nowrap;
}

.feed-empty {
    text-align: center;
    padding: 24px 0;
    color: var(--muted);
}

.feed-empty-emoji {
    font-size: 2rem;
}

.flag {
    width: 20px;
    height: 15px;
    border-radius: 2px;
    object-fit: cover;
    flex: none;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.flag-none {
    display: inline-grid;
    place-items: center;
    font-size: 0.8rem;
    box-shadow: none;
}

/* leaderboard ---------------------------------------------------------------- */

.leaderboard {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 6px;
}

.lb-row {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(20, 29, 48, 0.6);
    border: 1px solid var(--line);
    text-decoration: none;
}

.lb-row:hover {
    background: rgba(30, 41, 59, 0.8);
}

.lb-rank {
    font-size: 1.35rem;
    text-align: center;
    font-family: var(--font-num);
    font-weight: 700;
    color: var(--muted);
}

.lb-rank:not(.rank-1):not(.rank-2):not(.rank-3) {
    font-size: 0.9rem;
}

.lb-main {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.lb-title,
.lb-meta {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lb-title {
    font-weight: 700;
    font-size: 0.92rem;
}

.lb-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    color: var(--muted);
}

.lb-rpm {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    font-family: var(--font-num);
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--orange-2);
}

.lb-rpm small {
    font-family: 'Inter', sans-serif;
    font-size: 0.62rem;
    color: var(--dim);
    font-weight: 600;
}

/* rank list ------------------------------------------------------------------ */

.ranklist {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 8px;
}

.ranklist-row {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    font-size: 0.88rem;
}

.ranklist-label {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.ranklist-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ranklist-track {
    height: 8px;
    background: rgba(148, 163, 184, 0.1);
    border-radius: 99px;
    overflow: hidden;
}

.ranklist-bar {
    display: block;
    height: 100%;
    border-radius: 99px;
    background: linear-gradient(90deg, rgba(34, 211, 238, 0.6), var(--cyan));
    transition: width 0.8s cubic-bezier(0.2, 0.9, 0.3, 1);
}

.ranklist-count {
    font-family: var(--font-num);
    font-weight: 700;
    font-size: 0.85rem;
    min-width: 28px;
    text-align: right;
}

.ranklist-empty {
    color: var(--muted);
    font-size: 0.9rem;
    padding: 10px 0;
}

/* column chart ------------------------------------------------------------- */

.colchart {
    margin: 0;
}

.colchart-plot {
    position: relative;
    height: var(--h);
    margin-left: 34px;
}

.colchart-grid {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    pointer-events: none;
}

.colchart-grid span {
    position: relative;
    border-top: 1px dashed rgba(148, 163, 184, 0.14);
}

.colchart-grid span::before {
    content: attr(data-v);
    position: absolute;
    right: calc(100% + 6px);
    top: -8px;
    font-size: 0.68rem;
    color: var(--dim);
}

.colchart-bars {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: flex-end;
    gap: 2px;
}

.colchart-col {
    position: relative;
    flex: 1;
    height: 100%;
    display: flex;
    align-items: flex-end;
    outline: none;
}

.colchart-bar {
    width: 100%;
    min-height: 2px;
    border-radius: 4px 4px 0 0;
    background: linear-gradient(180deg, var(--cyan), rgba(34, 211, 238, 0.35));
    transition: height 0.8s cubic-bezier(0.2, 0.9, 0.3, 1), filter 0.2s;
}

.colchart-col.is-current .colchart-bar {
    background: linear-gradient(180deg, var(--orange-2), rgba(255, 106, 43, 0.45));
    box-shadow: 0 0 16px -2px rgba(255, 106, 43, 0.6);
}

.colchart-col:hover .colchart-bar,
.colchart-col:focus .colchart-bar {
    filter: brightness(1.35);
}

.colchart-tip {
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 6px;
    background: #1e293b;
    border: 1px solid var(--line-2);
    color: var(--text);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s;
    z-index: 5;
}

.colchart-col:hover .colchart-tip,
.colchart-col:focus .colchart-tip {
    opacity: 1;
}

.colchart-col:first-child .colchart-tip {
    left: 0;
    transform: none;
}

.colchart-col:last-child .colchart-tip {
    left: auto;
    right: 0;
    transform: none;
}

.colchart-labels {
    display: flex;
    gap: 2px;
    margin-left: 34px;
    margin-top: 6px;
}

.colchart-labels span {
    flex: 1;
    font-size: 0.64rem;
    color: var(--dim);
    white-space: nowrap;
    overflow: visible;
    text-align: center;
}

.colchart figcaption {
    margin-top: 8px;
    font-size: 0.75rem;
    color: var(--dim);
}

.mini-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    margin-top: 16px;
}

.mini-stats span {
    white-space: normal;
    text-align: center;
}

/* dashboard ---------------------------------------------------------------------- */

.dash {
    display: grid;
    gap: 14px;
    margin-top: 16px;
}

.dash .card h2 {
    font-size: 1.05rem;
}

/* trace ------------------------------------------------------------------------- */

.trace {
    position: relative;
    margin: 0;
}

.trace svg {
    display: block;
    width: 100%;
    height: 200px;
}

.trace-grid {
    stroke: rgba(148, 163, 184, 0.1);
    stroke-width: 1;
}

.trace-line {
    fill: none;
    stroke: var(--orange);
    stroke-width: 2.5;
    stroke-linejoin: round;
    filter: drop-shadow(0 0 6px rgba(255, 106, 43, 0.6));
}

.trace-axis {
    display: flex;
    justify-content: space-between;
    font-size: 0.72rem;
    color: var(--dim);
    margin-top: 4px;
}

/* session detail -------------------------------------------------------------- */

.back {
    display: inline-block;
    margin-bottom: 12px;
}

.session-head {
    display: flex;
    gap: 14px;
    align-items: flex-start;
}

.session-head h1 {
    font-size: clamp(1.5rem, 5vw, 2.2rem);
    margin-bottom: 4px;
}

.session-head p {
    margin: 0 0 4px;
}

.session-emoji {
    font-size: 2.6rem;
    line-height: 1;
}

.session-place {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
}

.big-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 14px 0;
}

.big-stat {
    display: flex;
    flex-direction: column;
    padding: 14px;
    border-radius: 14px;
    background: rgba(20, 29, 48, 0.7);
    border: 1px solid var(--line);
}

.big-stat span {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 700;
    color: var(--muted);
}

.big-stat b {
    font-family: var(--font-num);
    font-size: 1.7rem;
    line-height: 1.2;
}

.big-stat small {
    color: var(--dim);
    font-size: 0.7rem;
    font-weight: 700;
}

.big-stat.hero-stat {
    border-color: rgba(255, 106, 43, 0.4);
    background: linear-gradient(160deg, rgba(255, 106, 43, 0.16), rgba(20, 29, 48, 0.7));
}

.big-stat.hero-stat b {
    color: var(--orange-2);
}

.card + .card,
.page.narrow > .card {
    margin-top: 14px;
}

.details {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
    margin: 0;
}

.details div {
    display: flex;
    justify-content: space-between;
    padding: 9px 0;
    border-bottom: 1px solid var(--line);
    font-size: 0.92rem;
}

.details dt {
    color: var(--muted);
}

.details dd {
    margin: 0;
    font-weight: 600;
}

/* guide ---------------------------------------------------------------------- */

.guide-head {
    margin: 12px 0 24px;
}

.guide-steps {
    display: grid;
    gap: 18px;
}

.guide-step {
    display: grid;
    gap: 14px;
    background: rgba(14, 21, 36, 0.7);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 14px;
}

.guide-step img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 12px;
}

.guide-step h2 {
    margin-top: 8px;
}

.guide-step p {
    color: #cbd5e1;
}

.guide-section {
    margin-top: 18px;
}

.formula-grid {
    display: grid;
    gap: 10px;
    margin: 14px 0;
}

.formula {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px 14px;
    border-radius: 12px;
    background: rgba(7, 11, 20, 0.6);
    border: 1px solid var(--line);
}

.formula span {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--cyan);
}

.formula code {
    font-size: 1rem;
    color: var(--orange-2);
    font-weight: 700;
}

.formula small {
    color: var(--muted);
}

.mode-table {
    display: grid;
    gap: 12px;
}

.mode-table-row {
    display: grid;
    grid-template-columns: 64px 1fr;
    gap: 12px;
    align-items: start;
}

.mode-table-row img {
    width: 64px;
    height: 64px;
    border-radius: 10px;
    object-fit: cover;
}

.mode-table-row h3 {
    margin-bottom: 2px;
}

.mode-table-row p {
    margin-bottom: 2px;
    font-size: 0.9rem;
    color: #cbd5e1;
}

.tips {
    padding-left: 20px;
    margin: 0;
    display: grid;
    gap: 8px;
    color: #cbd5e1;
}

.big-404 {
    font-family: var(--font-num);
    font-size: 5rem;
    font-weight: 900;
    margin-top: 30px;
    background: linear-gradient(90deg, var(--orange), var(--cyan));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* MudBlazor tweaks ----------------------------------------------------------- */

.mud-input-outlined-border {
    border-radius: 12px !important;
}

.mud-snackbar {
    background: #1e293b !important;
    border: 1px solid rgba(255, 106, 43, 0.4) !important;
    color: var(--text) !important;
    font-weight: 600;
}

.mud-snackbar-location-bottom-center,
.mud-snackbar-location-bottom-right,
.mud-snackbar-location-bottom-left {
    bottom: calc(var(--bottomnav) + env(safe-area-inset-bottom) + 8px) !important;
}

/* =====================================================================
   larger screens
   ===================================================================== */

@media (min-width: 600px) {

    .counters {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .counters:not(.compact) {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .modes {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .formula-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .adv-fields {
        grid-template-columns: 1fr 1fr;
    }

    .big-stats {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .guide-step {
        grid-template-columns: 240px 1fr;
        align-items: center;
    }

    .footer-inner {
        grid-template-columns: 1.4fr 1fr;
    }
}

@media (min-width: 900px) {

    :root {
        --gutter: 24px;
    }

    .toplinks {
        display: flex;
    }

    .bottomnav {
        display: none;
    }

    .footer {
        margin-bottom: 0;
    }

    .mud-snackbar-location-bottom-center,
    .mud-snackbar-location-bottom-right,
    .mud-snackbar-location-bottom-left {
        bottom: 16px !important;
    }

    .hero-inner {
        padding: 56px var(--gutter) 40px;
    }

    .counters:not(.compact) {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }

    /* meter: gauge + controls left, data right */
    .meter {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        grid-template-areas:
            "setup setup"
            "gauge stats"
            "gauge graph"
            "gauge spec"
            "start adv"
            "result adv"
            "alert adv";
        align-content: start;
        column-gap: 24px;
        align-items: start;
    }

    .meter-setup { grid-area: setup; }
    .gauge-wrap { grid-area: gauge; }
    .start-wrap { grid-area: start; }
    .live-stats { grid-area: stats; }
    .meter > .graph-card:nth-of-type(1) { grid-area: graph; }
    .meter > .graph-card:nth-of-type(2) { grid-area: spec; }
    .result { grid-area: result; }
    .meter-alert { grid-area: alert; }
    .advanced { grid-area: adv; }

    .mode-row {
        margin: 0;
        padding-left: 2px;
        padding-right: 2px;
        flex-wrap: wrap;
    }

    .graph {
        height: 230px;
    }

    .spectrum {
        height: 140px;
    }

    .steps {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .step {
        grid-template-columns: 1fr;
        padding: 0;
        align-items: stretch;
    }

    .step img {
        width: 100%;
        height: auto;
        aspect-ratio: 1;
        border-radius: 0;
    }

    .step-body {
        padding: 4px 14px 16px;
    }

    .grid-2 {
        grid-template-columns: 1.2fr 1fr;
    }

    .modes {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }

    .dash {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dash .span-2 {
        grid-column: span 2;
    }
}

@media (prefers-reduced-motion: reduce) {

    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

/* Blazor plumbing ------------------------------------------------------------ */

#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    color: #111;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

.blazor-error-boundary {
    background: #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

.blazor-error-boundary::after {
    content: "An error has occurred.";
}
