:root {
    --grain: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.08'/%3E%3C/svg%3E");
    --amber: #fbbf24;
    --amber-glow: rgba(251, 191, 36, 0.6);
    --amber-soft: rgba(251, 191, 36, 0.3);
    --engraved: #777;
    --glide: 2.4s;
    --lamp-glass: radial-gradient(circle at 36% 32%,
        rgba(255, 255, 255, 0.85) 0%, rgba(255, 255, 255, 0) 42%);
    --lamp-seat: inset 0 0 0 1px rgba(0, 0, 0, 0.55);
    --lamp-glass-off: radial-gradient(circle at 36% 32%,
        rgba(255, 255, 255, 0.55) 0%, rgba(255, 255, 255, 0) 38%);
    --lamp-body-off: radial-gradient(circle at 50% 50%,
        #14161a 0%, #0a0b0d 70%, rgba(0, 0, 0, 0.75) 100%);
    --signal: #d1d5db;
    --signal-core: #ffffff;
    --signal-near: rgba(209, 213, 219, 0.45);
    --mem: #cc1f28;
    --mem-core: #ffd7d9;
    --mem-near: rgba(204, 31, 40, 0.55);
}
.lamp {
    border-radius: 50%;
    flex-shrink: 0;
    background: var(--lamp-glass-off), var(--lamp-body-off);
    box-shadow: var(--lamp-seat);
}
.lamp.lit {
    background: var(--lamp-glass),
        radial-gradient(circle at 50% 50%,
            var(--lamp-core, var(--signal-core)) 0%,
            var(--thread, var(--signal)) 24%,
            var(--thread, var(--signal)) 56%,
            rgba(0, 0, 0, 0.55) 100%);
    box-shadow: var(--lamp-seat),
        0 0 5px 0 var(--thread-near, var(--signal-near));
}
.lamp-signal { width: 10px; height: 10px; }
.lamp-mementorium {
    width: 9px; height: 9px;
    --thread: var(--mem); --thread-near: var(--mem-near); --lamp-core: var(--mem-core);
}
.navbar {
    position: absolute;
    bottom: 0; left: 0;
    width: 100%;
    height: 48px;
    background-color: #111;
    background-image:
        radial-gradient(circle at 50% 0%, #2a2a2a 0%, #111 60%),
        var(--grain);
    border-top: 1px solid #333;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.8);
    z-index: 100;
}
.sync-grid {
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr) auto;
    align-items: center;
    gap: 6px;
    width: 100%;
    height: 100%;
    max-width: 480px;
    margin: 0 auto;
    padding: 0 10px;
}
.vfd-capsule {
    position: relative;
    height: 24px;
    width: 100%;
    min-width: 0;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #080808;
    border: 1px solid #1a1a1a;
    box-shadow:
        inset 0 3px 6px rgba(0, 0, 0, 1),
        inset 0 -1px 2px rgba(255, 255, 255, 0.05),
        0 1px 0 rgba(255, 255, 255, 0.05);
    overflow: hidden;
}
.vfd-capsule::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 3px 3px;
    pointer-events: none;
    z-index: 1;
}
.vfd-capsule::after {
    content: '';
    position: absolute;
    top: 1px; left: 4px; right: 4px;
    height: 40%;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.08) 0%, transparent 100%);
    border-radius: 9px 9px 4px 4px;
    pointer-events: none;
    z-index: 3;
}
.lcd-text {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11.5px;
    font-weight: 500;
    letter-spacing: 1px;
    white-space: nowrap;
    z-index: 2;
    color: var(--amber);
    text-shadow: 0 0 4px var(--amber-glow), 0 0 8px var(--amber-soft);
    opacity: 0.9;
}
.caliper-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 24px;
    min-width: 56px;
    padding: 0 10px;
    border-radius: 3px;
    cursor: pointer;
    background: linear-gradient(to bottom, #2e2e2e, #151515);
    border: 1px solid #000;
    border-top: 1px solid #444;
    box-shadow:
        0 3px 5px rgba(0, 0, 0, 0.6),
        0 1px 2px rgba(0, 0, 0, 0.8),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}
.caliper-btn:hover { background: linear-gradient(to bottom, #363636, #1a1a1a); }
.caliper-btn:focus { outline: none; }
.caliper-btn:focus-visible { outline: none; box-shadow:
    0 3px 5px rgba(0, 0, 0, 0.6),
    0 1px 2px rgba(0, 0, 0, 0.8),
    inset 0 1px 0 rgba(255, 255, 255, 0.22); }
.caliper-btn-label {
    font-family: 'Barlow', sans-serif;
    font-size: 0.56rem;
    font-weight: 700;
    color: var(--engraved);
    letter-spacing: 1px;
    text-shadow: 0 -1px 1px rgba(0, 0, 0, 0.8);
}
.caliper-btn.lit .caliper-btn-label {
    color: #ffffff;
    text-shadow:
        0 0 4px rgba(255, 255, 255, 0.9),
        0 0 9px rgba(255, 255, 255, 0.5);
}
.caliper-btn.down {
    background: linear-gradient(to bottom, #111, #1a1a1a);
    box-shadow:
        inset 0 3px 6px rgba(0, 0, 0, 0.8),
        inset 0 1px 2px rgba(0, 0, 0, 0.9);
    border-top: 1px solid #0a0a0a;
    border-bottom: 1px solid #333;
    transform: translateY(2px);
}
.caliper-btn:active { transform: translateY(2px); }
.tw-overlay {
    position: absolute;
    bottom: calc(var(--navbar-h) + var(--crank-h)); left: 0;
    width: 100%;
    height: calc(100% - var(--navbar-h) - var(--crank-h));
    background: rgba(8, 10, 13, 0.62);
    backdrop-filter: blur(11px) saturate(0.7) brightness(0.72);
    -webkit-backdrop-filter: blur(11px) saturate(0.7) brightness(0.72);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    z-index: 95;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding-bottom: 48px;
    transform: translateY(0);
    transition: transform var(--glide) cubic-bezier(0.37, 0, 0.63, 1);
    transition-timing-function: linear(0.0000 0.0%, 0.0002 2.5%, 0.0018 5.0%, 0.0059 7.5%, 0.0132 10.0%, 0.0245 12.5%, 0.0402 15.0%, 0.0602 17.5%, 0.0846 20.0%, 0.1130 22.5%, 0.1446 25.0%, 0.1788 27.5%, 0.2142 30.0%, 0.2500 32.5%, 0.2857 35.0%, 0.3214 37.5%, 0.3571 40.0%, 0.3928 42.5%, 0.4285 45.0%, 0.4642 47.5%, 0.5000 50.0%, 0.5357 52.5%, 0.5714 55.0%, 0.6071 57.5%, 0.6428 60.0%, 0.6785 62.5%, 0.7142 65.0%, 0.7500 67.5%, 0.7857 70.0%, 0.8212 72.5%, 0.8553 75.0%, 0.8870 77.5%, 0.9153 80.0%, 0.9397 82.5%, 0.9598 85.0%, 0.9754 87.5%, 0.9868 90.0%, 0.9941 92.5%, 0.9982 95.0%, 0.9998 97.5%, 1.0000 100.0%);
    pointer-events: auto;
}
.mkiii.is-open .tw-overlay {
    transform: translateY(100%);
    pointer-events: none;
}
.gearbox-rail {
    position: absolute;
    bottom: 0; left: 0;
    width: 100%;
    height: 48px;
    background: #111;
    background-image:
        radial-gradient(circle at 50% 100%, #2a2a2a 0%, #111 60%),
        var(--grain);
    border-bottom: 2px solid #000;
    box-shadow: 0 -4px 10px rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 12px;
}
.wheel-housing {
    width: 260px; height: 260px;
    border-radius: 50%;
    background: transparent;
    box-shadow: inset 0 4px 12px rgba(0, 0, 0, 0.6), 0 1px 1px rgba(255, 255, 255, 0.08);
    display: flex; align-items: center; justify-content: center;
    position: relative;
    flex-shrink: 0;
}
.wheel {
    width: 240px; height: 240px;
    border-radius: 50%;
    background: transparent;
    box-shadow:
        0 8px 18px rgba(0, 0, 0, 0.4),
        inset 0 1px 2px rgba(255, 255, 255, 0.15),
        inset 0 -2px 6px rgba(0, 0, 0, 0.4);
    display: flex; align-items: center; justify-content: center;
    cursor: grab;
    touch-action: none;
    position: relative;
    overflow: hidden;
}
.wheel:active { cursor: grabbing; }
.wheel-texture {
    position: absolute;
    width: 100%; height: 100%;
    border-radius: 50%;
    background: repeating-conic-gradient(
        from 0deg,
        transparent 0deg,
        transparent 2deg,
        rgba(0, 0, 0, 0.15) 3deg,
        rgba(255, 255, 255, 0.05) 4deg
    );
    pointer-events: none;
}
.wheel-center {
    width: 60px; height: 60px;
    background: transparent;
    border-radius: 50%;
    box-shadow: inset 0 4px 8px rgba(0, 0, 0, 0.5), 0 1px 1px rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.04);
    z-index: 10;
    pointer-events: none;
}
.mkiii { --tw-rim: 18px; --tw-teeth: 3deg; }
.wheel-texture {
    background:
      repeating-conic-gradient(from 0deg,
        #141416 0deg, #2c2c30 calc(var(--tw-teeth) * .18), #5a5a60 calc(var(--tw-teeth) * .38), #74747a calc(var(--tw-teeth) * .50),
        #5a5a60 calc(var(--tw-teeth) * .62), #2c2c30 calc(var(--tw-teeth) * .82), #141416 var(--tw-teeth));
    -webkit-mask: radial-gradient(circle closest-side, transparent 0 calc(100% - var(--tw-rim)), #000 calc(100% - var(--tw-rim) + .5px), #000 calc(100% - 1px), transparent 100%);
            mask: radial-gradient(circle closest-side, transparent 0 calc(100% - var(--tw-rim)), #000 calc(100% - var(--tw-rim) + .5px), #000 calc(100% - 1px), transparent 100%);
    will-change: transform;
}
.wheel { box-shadow: none; }
.wheel::before {
    content: ''; position: absolute; inset: 0; border-radius: 50%; pointer-events: none; z-index: 3;
    background:
      conic-gradient(from -60deg, rgba(255,255,255,.42) 0deg, rgba(255,255,255,.10) 60deg, rgba(0,0,0,0) 110deg, rgba(0,0,0,.55) 175deg, rgba(0,0,0,.30) 240deg, rgba(255,255,255,0) 290deg, rgba(255,255,255,.42) 360deg),
      radial-gradient(circle closest-side, transparent 0 calc(100% - var(--tw-rim)), rgba(255,255,255,.30) calc(100% - var(--tw-rim) + 1px), transparent calc(100% - var(--tw-rim) + 4px), transparent calc(100% - 4px), rgba(0,0,0,.6) calc(100% - 1px), transparent 100%);
    -webkit-mask: radial-gradient(circle closest-side, transparent 0 calc(100% - var(--tw-rim)), #000 calc(100% - var(--tw-rim) + .5px), #000 calc(100% - 1px), transparent 100%);
            mask: radial-gradient(circle closest-side, transparent 0 calc(100% - var(--tw-rim)), #000 calc(100% - var(--tw-rim) + .5px), #000 calc(100% - 1px), transparent 100%);
}
.wheel-housing { box-shadow: 0 0 0 1px rgba(0,0,0,.35), 0 6px 18px rgba(0,0,0,.35); }
.wheel-housing::after {
    content: ''; position: absolute; inset: 0; border-radius: 50%; pointer-events: none; z-index: 4;
    background:
      radial-gradient(circle closest-side,
        transparent 0 calc(100% - 10px - var(--tw-rim) - 4px),
        rgba(0,0,0,.55) calc(100% - 10px - var(--tw-rim) - 3.5px), rgba(255,255,255,.26) calc(100% - 10px - var(--tw-rim) - 2.5px), rgba(0,0,0,.45) calc(100% - 10px - var(--tw-rim) - 1.5px),
        transparent calc(100% - 10px - var(--tw-rim) - 1px), transparent calc(100% - 10px + .5px),
        rgba(0,0,0,.70) calc(100% - 10px + 1px), rgba(0,0,0,.70) calc(100% - 10px + 2.5px), rgba(255,255,255,.14) calc(100% - 10px + 3px), transparent calc(100% - 10px + 4px),
        transparent 100%);
}
.wheel-center { background: transparent; border: 0; box-shadow: none; overflow: visible; position: relative; }
.wheel-center .lens-bezel { position: absolute; left: 50%; top: 50%; width: 62px; height: 62px; margin: -31px 0 0 -31px; border-radius: 50%; pointer-events: none;
    background: radial-gradient(circle at 35% 28%, #5e5e64 0%, #3a3a3f 40%, #232326 70%, #141416 100%);
    box-shadow: inset 0 1px 1px rgba(255,255,255,.28), inset 0 -2px 3px rgba(0,0,0,.9), 0 0 0 1px rgba(0,0,0,.6), 0 3px 8px rgba(0,0,0,.5);
    -webkit-mask: radial-gradient(circle closest-side, transparent 0 21.5px, #000 22.5px);
            mask: radial-gradient(circle closest-side, transparent 0 21.5px, #000 22.5px); }
.wheel-center .lens-glass { position: absolute; left: 50%; top: 50%; width: 44px; height: 44px; margin: -22px 0 0 -22px; border-radius: 50%; pointer-events: none; z-index: 11;
    box-shadow: inset 0 0 0 1px rgba(0,0,0,.55), inset 0 2px 3px rgba(0,0,0,.35);
    background: radial-gradient(circle at 32% 24%, rgba(255,255,255,.16) 0%, rgba(255,255,255,.05) 22%, rgba(255,255,255,0) 40%); }
.crank-rail {
    position: relative;
    height: 96px;
    flex-shrink: 0;
    background-color: #111;
    background-image:
        radial-gradient(circle at 50% 100%, #2a2a2a 0%, #111 60%),
        var(--grain);
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    border-bottom: 2px solid #000;
    box-shadow: 0 -4px 10px rgba(0, 0, 0, 0.5);
}
.crank-slot {
    position: absolute;
    top: 48px;
    margin-top: -3px;
    left: 34px; right: 34px;
    height: 6px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 3px;
    box-shadow: inset 0 0 2px rgba(0, 0, 0, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.05);
}
.crank-detent {
    position: absolute;
    top: 48px;
    left: 50%;
    width: 1px; height: 14px;
    margin: -7px 0 0 -0.5px;
    background: rgba(0, 0, 0, 0.6);
    box-shadow: 1px 0 0 rgba(255, 255, 255, 0.06);
}
.crank-handle {
    position: absolute;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    top: 28px;
    left: 50%;
    margin-left: -30px;
    width: 60px; height: 40px;
    border-radius: 4px;
    cursor: pointer;
    z-index: 35;
    background-color: #3a3a3a;
    background-image:
        repeating-linear-gradient(90deg,
            transparent 0 2px,
            rgba(0, 0, 0, 0.8) 3px 4px),
        linear-gradient(to bottom, #262626 0%, #4c4c4c 48%, #444 56%, #242424 100%);
    box-shadow:
        0 3px 5px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}
.mkiii {
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}
.blade {
    -webkit-user-select: text;
    -moz-user-select: text;
    user-select: text;
    -webkit-touch-callout: default;
}
.rail-card {
    display: inline-block;
    padding: 3px 14px;
    border-radius: 2px;
    background: linear-gradient(to bottom, #242424, #1b1b1b);
    border: 1px solid #0d0d0d;
    border-top-color: #3a3a3a;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.06),
        0 1px 2px rgba(0, 0, 0, 0.8);
    font-family: 'Space Mono', monospace;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.32rem;
    text-indent: 0.32rem;
    text-transform: uppercase;
    color: #9a9a9a;
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.9);
    white-space: nowrap;
    margin: 0;
}
