:root {
    --bg: #0a0a0a;
    --primary: #00ff41;
    --dim: #007a1f;
    --amber: #ffaa00;
    --red: #ff4444;
    --cyan: #00ffff;
    --pink: #b56888; /* unused */
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg);
    color: var(--primary);
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    font-variant-ligatures: none;
    overflow-x: hidden;
    line-height: 1.5;
    padding: 30px 24px;
    max-width: 900px;
    margin: 0 auto;
}

/* Typography & Utility Classes */
h1, h2, h3 {
    font-weight: normal;
    margin-bottom: 10px;
}

a {
    color: var(--primary);
    text-decoration: none;
}

.text-dim { color: var(--dim); }
.text-amber { color: var(--amber); }
.text-red { color: var(--red); }
.text-cyan { color: var(--cyan); }
.text-primary { color: var(--primary); }

.bg-dim { background-color: #001a07; }
.bg-amber-dim { background-color: #332200; }
.bg-red-dim { background-color: #330000; }

/* Status Tags */
.tag-ok { color: var(--primary); }
.tag-warn { color: var(--amber); }
.tag-fail { color: var(--red); }
.tag-crit { color: var(--red); }
.tag-oor { color: var(--amber); }
.tag-old { color: var(--amber); }
.tag-done { color: var(--primary); }
.tag-asymmetric { color: var(--amber); }
.tag-slow { color: var(--amber); }

/* Site Title */
.site-title {
    color: var(--dim);
    font-size: 11px;
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-bottom: 18px;
    opacity: 0.85;
}

/* Navigation Tabs */
nav {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 40px;
    border-bottom: 1px dashed var(--dim);
    padding-bottom: 12px;
}

.nav-link {
    color: var(--dim);
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.nav-link:hover {
    color: var(--primary);
}

.nav-link.active {
    color: var(--primary);
    border-bottom: 2px solid var(--primary);
    padding-bottom: 2px;
}

/* Terminal Forms & Inputs */
input, select, textarea {
    background-color: transparent;
    color: var(--primary);
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    border: none;
    border-bottom: 1px solid var(--dim);
    outline: none;
    padding: 2px 5px;
}

input:focus, select:focus, textarea:focus {
    border-bottom: 1px solid var(--primary);
}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
input[type="number"] {
    -moz-appearance: textfield;
}

select {
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
}

/* Custom Checkboxes */
input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 0;
    height: 0;
    margin: 0;
    border: none;
    flex-shrink: 0;
}

label:has(input[type="checkbox"])::before {
    content: "[ ]";
    margin-right: 8px;
    color: var(--primary);
    cursor: pointer;
    flex-shrink: 0;
}

label:has(input[type="checkbox"]:checked)::before {
    content: "[X]";
}

/* Buttons */
button {
    background-color: transparent;
    color: var(--primary);
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    border: 1px solid var(--primary);
    padding: 5px 15px;
    cursor: pointer;
    text-transform: uppercase;
    white-space: nowrap;
    flex-shrink: 0;
    transition: background-color 0.2s, color 0.2s;
}

button:hover {
    background-color: var(--primary);
    color: var(--bg);
}

button:disabled {
    color: var(--dim);
    border-color: var(--dim);
    cursor: not-allowed;
    background-color: transparent;
}

/* Checklists & Content Blocks */
.section {
    margin-bottom: 35px;
}

/* Separator between consecutive checklist sections */
.section + .section {
    border-top: 1px dashed var(--dim);
    padding-top: 28px;
    margin-top: -5px;
}

.section-header {
    margin-bottom: 20px;
    letter-spacing: 1px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.checklist-item {
    margin-bottom: 18px;
    display: flex;
    flex-direction: column;
}

.checklist-row {
    display: flex;
    align-items: center;
}

.context-note {
    color: var(--dim);
    margin-left: 25px;
    margin-top: 5px;
    font-size: 11px;
    line-height: 1.4;
}

.context-note::before {
    content: "→ ";
}

/* ASCII Layout Containers */
.ascii-box {
    border: 1px solid var(--dim);
    padding: 20px;
    margin-bottom: 25px;
    position: relative;
}

.ascii-box::before, .ascii-box::after {
    content: "";
    position: absolute;
    left: -1px;
    width: calc(100% + 2px);
    height: 1px;
    background: transparent;
}

.ascii-divider {
    color: var(--dim);
    overflow: hidden;
    white-space: nowrap;
    margin: 15px 0;
}

/* Expandable Logs */
.log-row {
    cursor: pointer;
}

.log-row:hover {
    background-color: #001500;
}

.log-details {
    display: none;
    padding: 15px;
    border-left: 1px solid var(--dim);
    margin-left: 5px;
    margin-top: 10px;
    margin-bottom: 20px;
}

.log-details.open {
    display: block;
}

/* Hold to Log Button Special State */
#hold-to-log-btn {
    position: relative;
    overflow: hidden;
    width: 100%;
    max-width: 320px;
    padding: 12px;
    font-weight: bold;
    letter-spacing: 2px;
}

#hold-progress {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background-color: var(--dim);
    width: 0%;
    z-index: -1;
    transition: width 0.1s linear;
}

/* Form flash states */
.flash-red {
    background-color: var(--red) !important;
    color: var(--bg) !important;
    transition: background-color 0.2s;
}

/* Pre-formatted layout overrides */
pre {
    font-family: 'JetBrains Mono', monospace;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* Linearity worksheet cell rows */
.cell-data-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 6px;
}

.cell-label {
    font-weight: bold;
    min-width: 30px;
    white-space: nowrap;
}

.cell-field {
    white-space: nowrap;
}

/* ── Mobile ─────────────────────────────────────────── */
@media (max-width: 600px) {
    body {
        font-size: 13px;
        padding: 16px 14px;
    }

    .site-title {
        font-size: 9px;
        letter-spacing: 2px;
        margin-bottom: 12px;
    }

    nav {
        gap: 8px;
        margin-bottom: 24px;
    }

    .nav-link {
        font-size: 11px;
        letter-spacing: 0;
    }

    .ascii-box {
        padding: 14px;
    }

    /* Larger touch targets */
    button {
        min-height: 44px;
        padding: 10px 12px;
    }

    #hold-to-log-btn {
        max-width: 100%;
    }

    /* Rows with fixed-width spans — allow wrapping on mobile */
    .responsive-row {
        flex-wrap: wrap;
        gap: 6px;
        row-gap: 4px;
    }

    .responsive-row > span {
        width: auto !important;
        flex-shrink: 1;
    }

    /* Log table — horizontal scroll rather than wrapping */
    #log-container {
        overflow-x: auto;
    }
}
