/* Free Reign — brand styling */
:root {
    --navy: #16263A;
    --gold: #D9A534;
    --deep-gold: #B8851F;
    --parchment: #F5F1E6;
    --slate: #9FB3C8;
    --serif: Georgia, "Times New Roman", serif;
    --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
        Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: var(--sans);
    color: var(--navy);
    background: var(--parchment);
    line-height: 1.6;
}

.wrap {
    max-width: 880px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

h1, h2, h3, .display { font-family: var(--serif); font-weight: 600; }

/* Header */
.site-header {
    background: var(--navy);
    border-bottom: 3px solid var(--gold);
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
}
.brand img { display: block; background: var(--parchment); padding: 4px 8px; border-radius: 6px; }
.nav { display: flex; align-items: center; gap: 1.25rem; }
.nav a, .link-btn {
    color: var(--parchment);
    text-decoration: none;
    font-size: 0.95rem;
    letter-spacing: 0.03em;
}
.nav a:hover, .link-btn:hover { color: var(--gold); }
.inline-form { display: inline; margin: 0; }
.link-btn {
    background: none; border: none; cursor: pointer;
    font-family: var(--sans); padding: 0;
}

/* Hero / navy sections */
.navy { background: var(--navy); color: var(--parchment); }
.hero { padding: 4.5rem 0; text-align: center; }
.hero.slim { padding: 3rem 0; }
.hero .kicker {
    color: var(--gold); letter-spacing: 0.25em; text-transform: uppercase;
    font-size: 0.8rem; margin: 0 0 0.5rem;
}
.hero .display { font-size: 3.5rem; margin: 0; color: var(--parchment); }
.hero.slim .display { font-size: 2.5rem; }
.strapline { color: var(--slate); font-size: 1.2rem; margin-top: 0.75rem; }

/* Parchment / blocks */
.parchment { background: var(--parchment); padding: 3rem 0; }
.block { position: relative; margin: 0 0 1.75rem; }
.block-heading h2 { color: var(--deep-gold); font-size: 1.9rem; margin: 0; }
.block-quote blockquote {
    border-left: 4px solid var(--gold);
    margin: 0; padding: 0.5rem 0 0.5rem 1.25rem;
    font-style: italic; font-family: var(--serif); font-size: 1.3rem;
    color: var(--navy);
}
.block-text { font-size: 1.1rem; }
.caption { font-size: 0.9rem; color: var(--slate); }

/* Cards */
.card {
    background: #fff;
    border: 1px solid #e4dcc6;
    border-top: 3px solid var(--gold);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 10px rgba(22, 38, 58, 0.06);
}
.card h2 { margin-top: 0; color: var(--deep-gold); }

/* Tracker */
.tracker-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
@media (max-width: 640px) { .tracker-grid { grid-template-columns: 1fr; } }
.counter-card { text-align: center; }
.counter {
    font-family: var(--serif); font-size: 4.5rem; font-weight: 600;
    color: var(--navy); margin: 0; line-height: 1;
}
.counter-label { text-transform: uppercase; letter-spacing: 0.2em; color: var(--deep-gold); }
.since { color: var(--slate); }
.current-tier { font-family: var(--serif); font-size: 1.5rem; color: var(--navy); }
.muted { color: var(--slate); }
.progress-bar {
    background: #e4dcc6; border-radius: 99px; height: 14px;
    overflow: hidden; margin: 0.75rem 0;
}
.progress-fill { background: var(--gold); height: 100%; }
.win { padding: 0.5rem 0; border-bottom: 1px solid #eee; }
.win-date { color: var(--deep-gold); font-weight: 600; margin-right: 0.75rem; }

/* Forms */
form label { display: block; margin-bottom: 0.9rem; font-size: 0.95rem; }
input, textarea, select {
    width: 100%; padding: 0.6rem 0.7rem; margin-top: 0.3rem;
    border: 1px solid #cbb98f; border-radius: 6px;
    font-family: var(--sans); font-size: 1rem;
}
.btn-gold {
    background: var(--gold); color: var(--navy);
    border: none; border-radius: 6px;
    padding: 0.65rem 1.4rem; font-weight: 600; cursor: pointer;
    font-size: 1rem;
}
.btn-gold:hover { background: var(--deep-gold); color: var(--parchment); }

/* Social sign-in — additive to the email+password form, matched to the
   navy/gold brand. A subtle "or" divider separates them from the form above. */
.social-login { margin-top: 1.5rem; }
.social-divider {
    text-align: center; color: var(--slate);
    font-size: 0.85rem; letter-spacing: 0.15em; text-transform: uppercase;
    display: flex; align-items: center; gap: 0.75rem; margin: 1rem 0;
}
.social-divider::before, .social-divider::after {
    content: ""; flex: 1; height: 1px; background: #e4dcc6;
}
.btn-social {
    display: block; width: 100%; box-sizing: border-box;
    text-align: center; text-decoration: none;
    padding: 0.65rem 1.4rem; margin-bottom: 0.75rem;
    border-radius: 6px; font-weight: 600; font-size: 1rem;
    border: 1px solid var(--navy);
}
.btn-social-google { background: var(--parchment); color: var(--navy); }
.btn-social-google:hover { background: var(--gold); color: var(--navy); }
.btn-social-apple { background: var(--navy); color: var(--parchment); border-color: var(--navy); }
.btn-social-apple:hover { background: var(--deep-gold); color: var(--parchment); border-color: var(--deep-gold); }

/* Flash messages */
.flash-wrap { margin-top: 1rem; }
.flash {
    padding: 0.75rem 1rem; border-radius: 6px; margin-bottom: 0.5rem;
    background: #e8f0e3; border: 1px solid #b7d3a8;
}

/* Inline editor */
.editor-hint {
    background: var(--navy); color: var(--gold);
    padding: 0.5rem 1rem; border-radius: 6px; display: inline-block;
}
.edit-affordance {
    position: absolute; top: -0.5rem; right: 0;
    background: var(--navy); color: var(--gold);
    border: none; border-radius: 4px;
    font-size: 0.7rem; padding: 0.15rem 0.5rem; cursor: pointer;
    opacity: 0; transition: opacity 0.15s;
}
.block:hover .edit-affordance { opacity: 1; }
.block-text.editing {
    outline: 2px dashed var(--gold); background: #fffdf5;
    padding: 0.5rem; border-radius: 4px;
}
.editor-actions { margin-top: 0.5rem; }
.editor-actions button {
    font-size: 0.8rem; padding: 0.2rem 0.7rem; margin-right: 0.4rem;
    border-radius: 4px; cursor: pointer; border: 1px solid var(--deep-gold);
}
.editor-actions .save { background: var(--gold); color: var(--navy); border: none; }
.editor-actions .improve { background: var(--navy); color: var(--gold); border: 1px solid var(--gold); }
.editor-actions .improve:hover { background: var(--gold); color: var(--navy); }

/* AI copy-assist suggestion box */
.ai-suggestion {
    margin-top: 0.75rem; padding: 0.75rem 1rem;
    background: var(--navy); color: var(--parchment);
    border-left: 4px solid var(--gold); border-radius: 6px;
}
.ai-suggestion-label {
    margin: 0 0 0.4rem; font-size: 0.75rem; letter-spacing: 0.1em;
    text-transform: uppercase; color: var(--gold);
}
.ai-suggestion-text { margin: 0 0 0.6rem; line-height: 1.5; }
.ai-suggestion-actions button,
.ai-suggestion > button {
    font-size: 0.8rem; padding: 0.2rem 0.7rem; margin-right: 0.4rem;
    border-radius: 4px; cursor: pointer; border: 1px solid var(--deep-gold);
}
.ai-suggestion .save { background: var(--gold); color: var(--navy); border: none; }
.ai-suggestion .cancel { background: transparent; color: var(--parchment); }

/* The Keep Coach chat widget */
.coach {
    max-width: 640px; margin: 0 auto;
    background: var(--navy); border-top: 3px solid var(--gold);
    border-radius: 8px; padding: 1.25rem;
    box-shadow: 0 6px 20px rgba(22, 38, 58, 0.15);
}
.coach-log {
    display: flex; flex-direction: column; gap: 0.6rem;
    min-height: 240px; max-height: 50vh; overflow-y: auto;
    padding: 0.5rem; margin-bottom: 1rem;
}
.coach-bubble {
    max-width: 80%; padding: 0.6rem 0.85rem;
    border-radius: 14px; line-height: 1.45;
    white-space: pre-wrap; word-wrap: break-word;
}
.coach-bubble-user {
    align-self: flex-end; background: var(--parchment); color: var(--navy);
    border-bottom-right-radius: 4px;
}
.coach-bubble-coach {
    align-self: flex-start; background: #1f3450; color: var(--parchment);
    border: 1px solid var(--gold); border-bottom-left-radius: 4px;
}
.coach-bubble-pending { opacity: 0.6; font-style: italic; }
.coach-form { display: flex; gap: 0.6rem; }
.coach-input {
    flex: 1; padding: 0.7rem 0.9rem; border-radius: 6px;
    border: 1px solid var(--slate); font: inherit; background: var(--parchment);
    color: var(--navy);
}
.coach-input:focus { outline: 2px solid var(--gold); border-color: var(--gold); }
.coach-note { margin: 0.85rem 0 0; font-size: 0.8rem; color: var(--slate); }

/* Footer */
.site-footer {
    background: var(--navy); color: var(--slate);
    padding: 2rem 0; text-align: center; margin-top: 2rem;
}
.site-footer .tagline { color: var(--gold); font-family: var(--serif); font-size: 1.1rem; margin: 0 0 0.5rem; }
.disclaimer { font-size: 0.8rem; margin: 0; }

.site-footer .credit { margin-top: 6px; font-size: 13px; opacity: 0.85; }
.site-footer .credit a { color: #D9A534; text-decoration: none; }
.site-footer .credit a:hover { text-decoration: underline; }

/* ===================================================================== */
/* Scope system                                                          */
/* Additive brand-consistent styling for the /scope page, the 🧪 wizard, */
/* the 🛟/💡 recorder widget, the report matrix and the shared           */
/* type/voice/AI note control.                                           */
/*                                                                       */
/* Author: Maré Greyling (Thevertex) <mare.greyling@gmail.com>            */
/* — https://castle-free.co.za                                           */
/* ===================================================================== */

.scope-wrap { padding-top: 1.5rem; padding-bottom: 3rem; max-width: 960px; }

/* Shared buttons */
.scope-btn {
    font: inherit; font-size: 0.85rem; cursor: pointer;
    border-radius: 6px; padding: 0.4rem 0.9rem;
    border: 1px solid var(--deep-gold); background: #fff; color: var(--navy);
    transition: background 0.15s, color 0.15s;
}
.scope-btn:hover { background: var(--parchment); }
.scope-btn-gold { background: var(--gold); color: var(--navy); border: none; font-weight: 600; }
.scope-btn-gold:hover { background: var(--deep-gold); color: var(--parchment); }
.scope-btn-ghost { background: transparent; }
.scope-btn-pass { background: #2f7d43; color: #fff; border: none; font-weight: 600; }
.scope-btn-pass:hover { background: #256336; }
.scope-btn-fail { background: #b23b3b; color: #fff; border: none; font-weight: 600; }
.scope-btn-fail:hover { background: #8f2f2f; }
.scope-btn:disabled { opacity: 0.5; cursor: default; }

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

.scope-page-header {
    display: flex; align-items: center; justify-content: space-between;
    flex-wrap: wrap; gap: 0.75rem; margin-bottom: 0.5rem;
}
.scope-page-header h1 { color: var(--deep-gold); margin: 0; }

/* Summary bar — an auto-fitting grid rather than a flex row, so the cards
   keep equal widths instead of hugging their digits and reading as one
   run-on string ("8Groups 21Tests"). */
.scope-summary {
    display: grid; gap: 0.75rem; margin: 1rem 0 1.5rem;
    grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
}
.scope-summary-cell {
    background: var(--navy); color: var(--parchment);
    border-top: 3px solid var(--gold); border-radius: 10px;
    padding: 0.85rem 0.9rem 0.75rem; text-align: center;
    display: flex; flex-direction: column; gap: 0.3rem;
}
.scope-summary-num {
    font-family: var(--serif); font-size: 2.1rem; font-weight: 600;
    color: var(--gold); line-height: 1; display: block;
}
.scope-summary-label {
    font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.14em;
    color: var(--slate); line-height: 1.3; display: block;
}

/* Legend + status badges */
.scope-legend {
    display: flex; align-items: center; flex-wrap: wrap; gap: 0.4rem;
    margin-bottom: 1.75rem; padding: 0.55rem 0.8rem;
    background: rgba(22, 38, 58, 0.035); border-radius: 8px;
}
.scope-legend strong {
    font-family: var(--sans); font-size: 0.65rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.14em; color: var(--slate);
    margin-right: 0.25rem;
}
.scope-badge {
    display: inline-block; font-size: 0.72rem; font-weight: 600;
    padding: 0.15rem 0.55rem; border-radius: 99px; white-space: nowrap;
    border: 1px solid transparent;
}
.scope-badge-complete { background: #e6f2e9; color: #2f7d43; border-color: #b7d3a8; }
.scope-badge-resurfaced { background: #fbeecb; color: var(--deep-gold); border-color: var(--gold); }
.scope-badge-pending { background: #eef1f5; color: #55708c; border-color: var(--slate); }
.scope-badge-todo { background: #eceef1; color: var(--slate); border-color: #d3dae2; }

/* Groups + tests */
.scope-group { margin-bottom: 2.25rem; }
.scope-group-title {
    font-size: 0.75rem; font-family: var(--sans); font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.16em;
    color: var(--slate); margin: 0 0 0.85rem;
    border-bottom: 1px solid #e4dcc6; padding-bottom: 0.4rem;
}
.scope-test {
    background: #fff; border: 1px solid #e4dcc6; border-left: 3px solid var(--gold);
    border-radius: 10px; padding: 1.1rem 1.25rem 1rem; margin-bottom: 1.1rem;
}
.scope-test-head {
    display: flex; align-items: flex-start; justify-content: space-between;
    gap: 0.75rem;
}
.scope-test-title {
    margin: 0; font-family: var(--serif); font-size: 1.22rem; font-weight: 600;
    color: var(--navy); line-height: 1.35;
}
.scope-test-head .scope-badge { flex: none; margin-top: 0.2rem; }
.scope-dev-tag {
    margin-left: 0.5rem; font-size: 0.6rem; font-weight: 700; letter-spacing: 0.1em;
    background: var(--navy); color: var(--gold); padding: 0.1rem 0.35rem; border-radius: 3px;
    vertical-align: middle;
}
.scope-steps { margin: 0.6rem 0; padding-left: 1.25rem; font-size: 0.92rem; }
.scope-steps li { margin-bottom: 0.2rem; }

/* Per-tester progress rollup — the tester's own number is the one thing they
   look for on landing, so it gets a headline size and a real bar. */
.scope-progress {
    background: #fff; border: 1px solid #e4dcc6;
    border-left: 3px solid var(--gold); border-radius: 10px;
    padding: 0.85rem 1rem 0.9rem; margin: 0 0 1rem;
}
.scope-progress-head {
    display: flex; align-items: baseline; justify-content: space-between;
    gap: 0.75rem;
}
.scope-progress-mine {
    font-family: var(--serif); font-size: 1.15rem; font-weight: 600;
    color: var(--navy);
}
.scope-progress-pct {
    font-family: var(--serif); font-size: 1.15rem; font-weight: 600;
    color: var(--deep-gold); flex: none;
}
.scope-progress-track {
    height: 8px; border-radius: 99px; background: #ece5d3;
    margin: 0.55rem 0 0; overflow: hidden;
}
.scope-progress-fill {
    height: 100%; background: var(--gold); border-radius: 99px;
    transition: width 0.4s ease;
}
.scope-progress-others {
    margin: 0.5rem 0 0; font-size: 0.78rem; color: var(--slate);
}
.scope-progress-others:empty { display: none; }

/* Delivered / To do board sections */
.scope-board { margin-bottom: 3rem; }
.scope-board + .scope-board { margin-top: 3.5rem; }
.scope-board-head {
    display: flex; align-items: center; justify-content: space-between;
    gap: 0.75rem; border-bottom: 3px solid var(--gold);
    padding-bottom: 0.5rem;
}
.scope-board-title {
    margin: 0; font-family: var(--serif); font-size: 2rem; font-weight: 600;
    color: var(--navy); line-height: 1.15;
}
.scope-board-todo .scope-board-head { border-bottom-color: #d3dae2; }
/* The count reads as a chip so the section header has a scannable anchor. */
.scope-board-count {
    flex: none; font-size: 0.68rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.12em; color: var(--navy); background: var(--gold);
    padding: 0.22rem 0.65rem; border-radius: 99px; white-space: nowrap;
}
.scope-board-todo .scope-board-count { background: #e4e9ef; color: #55708c; }
.scope-board-blurb { margin: 0.6rem 0 1.5rem; font-size: 0.88rem; }
.scope-board-todo .scope-test { border-left-color: var(--slate); }

/* Tickable step lines */
.scope-step-count {
    margin: 0.4rem 0 0.5rem; font-size: 0.68rem; text-transform: uppercase;
    letter-spacing: 0.12em; color: var(--slate);
}
.scope-steps-list, .scope-wizard-checklist { display: flex; flex-direction: column; }
.scope-step { border-top: 1px solid #f0ead9; }
.scope-step:first-child { border-top: none; }

/* A three-column row: tick, text, actions. The actions column is fixed to the
   right so the note/thread buttons never run into the end of the step text. */
.scope-step-row {
    display: flex; align-items: flex-start; gap: 0.7rem;
    padding: 0.5rem 0.15rem;
}
.scope-step-check {
    flex: none; width: 17px; height: 17px; margin: 0.18rem 0 0;
    accent-color: var(--deep-gold); cursor: pointer;
}
.scope-step-text {
    flex: 1 1 auto; min-width: 0; margin: 0;
    font-size: 0.93rem; line-height: 1.55; cursor: pointer;
    color: var(--navy);
}
/* A ticked line must read as done at a glance when scanning ~56 of them. */
.scope-step-check:checked + .scope-step-text {
    color: var(--slate); text-decoration: line-through;
    text-decoration-color: rgba(159, 179, 200, 0.7);
}
.scope-step-actions {
    flex: none; display: flex; align-items: center; gap: 0.4rem;
    margin-top: 0.05rem;
}
.scope-step-btn {
    flex: none; background: transparent; border: 1px solid #e4dcc6;
    border-radius: 99px; color: var(--slate); font: inherit; font-size: 0.68rem;
    line-height: 1.4; padding: 0.2rem 0.6rem; cursor: pointer; white-space: nowrap;
    transition: color 0.15s, border-color 0.15s, background 0.15s, opacity 0.15s;
}
.scope-step-btn:hover { background: var(--parchment); color: var(--deep-gold); border-color: var(--gold); }
.scope-step-btn:focus-visible { outline: 2px solid var(--deep-gold); outline-offset: 1px; }
/* Fade the controls back on pointer devices only: touch users get no hover,
   so there they stay fully visible and tappable. Focus always restores them. */
@media (hover: hover) and (pointer: fine) {
    .scope-step-actions { opacity: 0.35; }
    .scope-step:hover .scope-step-actions,
    .scope-step:focus-within .scope-step-actions { opacity: 1; }
}
.scope-step-note {
    margin: 0 0 0.5rem 1.9rem; font-size: 0.82rem; color: var(--deep-gold);
    white-space: pre-wrap; line-height: 1.5;
}
.scope-step-panel { margin: 0 0 0.6rem 1.9rem; }
.scope-step-thread { border-left: 2px solid #e4dcc6; padding-left: 0.7rem; }

/* Pass-if gets a gold accent so it never reads as one more step. */
.scope-passif {
    background: #fbf6e8; border-left: 3px solid var(--gold); border-radius: 6px;
    padding: 0.55rem 0.8rem; margin: 0.9rem 0 0.6rem; font-size: 0.88rem;
    line-height: 1.5; color: #5c4718;
}
.scope-passif-check {
    color: var(--deep-gold); font-weight: 700; text-transform: uppercase;
    font-size: 0.68rem; letter-spacing: 0.1em;
}
.scope-urls { display: flex; flex-wrap: wrap; gap: 0.35rem; margin: 0.6rem 0 0; }
.scope-url-chip {
    display: inline-block; max-width: 100%; overflow: hidden;
    text-overflow: ellipsis; white-space: nowrap;
    font-size: 0.72rem; color: var(--slate); text-decoration: none;
    background: #f4f6f8; border: 1px solid #e4e9ef; border-radius: 99px;
    padding: 0.15rem 0.6rem;
}
.scope-url-chip:hover { color: var(--deep-gold); border-color: var(--gold); background: var(--parchment); }
.scope-test-controls { margin-top: 0.9rem; }

/* Comment thread */
.scope-thread { margin-top: 0.85rem; border-top: 1px dashed #e4dcc6; padding-top: 0.75rem; }
.scope-comments { display: flex; flex-direction: column; gap: 0.5rem; margin-bottom: 0.75rem; }
.scope-comment { background: var(--parchment); border-radius: 6px; padding: 0.5rem 0.7rem; }
.scope-comment-meta { font-size: 0.72rem; color: var(--slate); margin-bottom: 0.15rem; }
.scope-comment-body { font-size: 0.92rem; white-space: pre-wrap; }
/* A saved voice note plays back inline under its comment; kept small so it
   never dominates the thread. */
.scope-comment-audio { display: block; margin-top: 0.35rem; max-width: 100%; height: 32px; }
.scope-composer { display: flex; flex-direction: column; gap: 0.5rem; align-items: flex-start; }
.scope-composer .scope-btn { align-self: flex-start; }

/* Project notes */
.scope-notes-card {
    background: var(--navy); color: var(--parchment);
    border-top: 3px solid var(--gold); border-radius: 8px;
    padding: 1.25rem; margin-top: 1.5rem;
}
.scope-notes-card h3 { margin: 0 0 0.75rem; color: var(--gold); font-family: var(--serif); }
.scope-notes-list { display: flex; flex-direction: column; gap: 0.5rem; margin-bottom: 1rem; }
.scope-note { background: #1f3450; border: 1px solid #2c4a68; border-radius: 6px; padding: 0.5rem 0.7rem; }
.scope-note-meta { font-size: 0.72rem; color: var(--slate); margin-bottom: 0.15rem; }
.scope-note-body { font-size: 0.92rem; white-space: pre-wrap; }

/* ---- Type / Voice / AI note control (ScopeVoiceNote) ---- */
.svn { width: 100%; }
.svn-modes { display: flex; gap: 0.35rem; margin-bottom: 0.35rem; }
.svn-mode {
    font: inherit; font-size: 0.75rem; cursor: pointer;
    border: 1px solid var(--slate); background: #fff; color: var(--navy);
    border-radius: 6px; padding: 0.2rem 0.6rem;
}
.svn-mode.is-active { background: var(--gold); color: var(--navy); border-color: var(--deep-gold); font-weight: 600; }
.svn-mode.is-recording { background: #b23b3b; color: #fff; border-color: #8f2f2f; }
.svn-text {
    width: 100%; border: 1px solid #cbb98f; border-radius: 6px;
    padding: 0.5rem 0.6rem; font: inherit; font-size: 0.9rem; resize: vertical;
}
.svn-status { font-size: 0.75rem; margin-top: 0.25rem; min-height: 1em; color: var(--slate); }
.svn-status-live { color: var(--deep-gold); }
.svn-status-ok { color: #2f7d43; }
.svn-status-warn { color: #b23b3b; }
/* On the navy notes card, lighten the control chrome. */
.scope-notes-card .svn-status { color: var(--slate); }

/* ---- Floating launchers (bottom-right stack) ---- */
.scope-launcher {
    position: fixed; right: 18px; bottom: 150px; z-index: 900;
    background: var(--navy); color: var(--gold); border: 1px solid var(--gold);
    border-radius: 99px; padding: 0.5rem 0.9rem; font: inherit; font-size: 0.85rem;
    cursor: pointer; box-shadow: 0 4px 14px rgba(22, 38, 58, 0.3);
}
.scope-launcher:hover { background: var(--gold); color: var(--navy); }
.scope-recorder-launcher {
    position: fixed; right: 18px; bottom: 18px; z-index: 900;
    display: flex; flex-direction: column; gap: 0.5rem;
}
.scope-fab {
    width: 48px; height: 48px; border-radius: 50%; font-size: 1.2rem; cursor: pointer;
    border: 1px solid var(--gold); background: var(--navy); color: var(--parchment);
    box-shadow: 0 4px 14px rgba(22, 38, 58, 0.3);
}
.scope-fab:hover { background: var(--gold); }

/* ---- Wizard modal ---- */
.scope-modal-open { overflow: hidden; }
.scope-wizard-overlay {
    position: fixed; inset: 0; z-index: 1000;
    background: rgba(22, 38, 58, 0.55);
    display: flex; align-items: center; justify-content: center; padding: 1rem;
}
.scope-wizard {
    background: var(--parchment); border-top: 4px solid var(--gold);
    border-radius: 10px; width: 100%; max-width: 560px; max-height: 88vh;
    display: flex; flex-direction: column; box-shadow: 0 10px 40px rgba(0,0,0,0.4);
}
.scope-wizard-head {
    display: flex; align-items: center; justify-content: space-between;
    background: var(--navy); color: var(--parchment);
    padding: 0.75rem 1rem; border-radius: 6px 6px 0 0;
}
.scope-wizard-title { font-family: var(--serif); color: var(--gold); font-size: 1.1rem; }
.scope-wizard-close {
    background: none; border: none; color: var(--parchment); font-size: 1.1rem; cursor: pointer;
}
.scope-wizard-close:hover { color: var(--gold); }
.scope-wizard-body { padding: 1rem 1.15rem 1.25rem; overflow-y: auto; }
.scope-wizard-toolbar { display: flex; justify-content: flex-end; margin-bottom: 0.5rem; }
.scope-wizard-progress { font-size: 0.78rem; color: var(--slate); margin: 0 0 0.6rem; text-transform: uppercase; letter-spacing: 0.08em; }
.scope-wizard-card { background: #fff; border: 1px solid #e4dcc6; border-radius: 8px; padding: 1rem; }
.scope-wizard-titlerow { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; }
.scope-wizard-testtitle { margin: 0; font-family: var(--serif); color: var(--navy); font-size: 1.2rem; }
.scope-wizard-steps { margin: 0.7rem 0; padding-left: 1.25rem; font-size: 0.92rem; }
.scope-wizard-steps li { margin-bottom: 0.3rem; }
.scope-wizard-saved { font-size: 0.8rem; color: var(--deep-gold); margin: 0.5rem 0; }
.scope-wizard-flash { font-size: 0.82rem; margin: 0.45rem 0 0; color: var(--slate); }
.scope-wizard-flash.is-ok { color: #2f7d43; font-weight: 600; }
.scope-wizard-flash.is-warn { color: #b23b3b; }
.scope-wizard-flash.is-live { color: var(--deep-gold); }
.scope-wizard-verdict { display: flex; gap: 0.5rem; margin: 0.85rem 0; flex-wrap: wrap; }
.scope-wizard-label { display: block; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--slate); margin: 0.6rem 0 0.25rem; }
.scope-wizard-note { width: 100%; border: 1px solid #cbb98f; border-radius: 6px; padding: 0.5rem 0.6rem; font: inherit; font-size: 0.9rem; resize: vertical; }
.scope-wizard-nav { display: flex; justify-content: space-between; margin-top: 0.85rem; }

/* ---- Recorder form ---- */
.scope-recorder-overlay {
    position: fixed; inset: 0; z-index: 1001;
    background: rgba(22, 38, 58, 0.55);
    display: flex; align-items: center; justify-content: center; padding: 1rem;
}
.scope-recorder-panel {
    background: var(--parchment); border-top: 4px solid var(--gold);
    border-radius: 10px; width: 100%; max-width: 460px; padding: 1rem 1.15rem 1.25rem;
    box-shadow: 0 10px 40px rgba(0,0,0,0.4);
}
.scope-recorder-head {
    display: flex; align-items: center; justify-content: space-between;
    font-family: var(--serif); color: var(--deep-gold); font-size: 1.1rem;
    margin-bottom: 0.75rem;
}
.scope-recorder-title, .scope-recorder-body {
    width: 100%; border: 1px solid #cbb98f; border-radius: 6px;
    padding: 0.5rem 0.6rem; font: inherit; font-size: 0.92rem; margin-bottom: 0.6rem;
}
.scope-recorder-body { resize: vertical; }
.scope-recorder-opts { display: flex; align-items: center; gap: 0.9rem; flex-wrap: wrap; margin-bottom: 0.6rem; }
.scope-recorder-check { display: inline-flex; align-items: center; gap: 0.3rem; font-size: 0.85rem; margin: 0; width: auto; }
.scope-recorder-check input { width: auto; margin: 0; }
.scope-fab.is-recording, .scope-btn.is-recording { background: #b23b3b; color: #fff; border-color: #8f2f2f; }
.scope-recorder-status { font-size: 0.8rem; min-height: 1.1em; margin-bottom: 0.6rem; color: var(--slate); }
.scope-recorder-status.live { color: var(--deep-gold); }
.scope-recorder-status.ok { color: #2f7d43; }
.scope-recorder-status.warn { color: #b23b3b; }
.scope-recorder-actions { display: flex; justify-content: flex-end; }

/* ---- Report matrix ---- */
.scope-matrix-scroll { overflow-x: auto; border: 1px solid #e4dcc6; border-radius: 8px; }
.scope-matrix { border-collapse: collapse; width: 100%; font-size: 0.85rem; background: #fff; }
.scope-matrix th, .scope-matrix td { border: 1px solid #e4dcc6; padding: 0.4rem 0.5rem; text-align: center; }
.scope-matrix-corner { background: var(--navy); color: var(--gold); text-align: left; position: sticky; left: 0; z-index: 2; }
.scope-matrix-tester { background: var(--navy); color: var(--parchment); font-weight: 600; white-space: nowrap; }
.scope-matrix-rowhead { text-align: left; background: var(--parchment); color: var(--navy); font-weight: 600; position: sticky; left: 0; }
.scope-matrix-grouprow td { background: #ece4cf; color: var(--deep-gold); text-align: left; font-weight: 700; letter-spacing: 0.04em; }
.scope-cell { font-weight: 700; }
.scope-cell-pass { background: #d8ecdd; color: #2f7d43; }
.scope-cell-fail { background: #f4d6d6; color: #b23b3b; }
.scope-cell-pending { background: #e7ebf0; color: #55708c; }
.scope-cell-untested { background: #fafafa; color: #bbb; }
.scope-cell-hasnote { cursor: help; text-decoration: underline dotted; }

@media (max-width: 640px) {
    .scope-launcher { bottom: 140px; }
    .scope-wizard-verdict { flex-direction: column; }
    .scope-board-title { font-size: 1.6rem; }
    .scope-test { padding: 0.9rem 0.9rem 0.85rem; }
    .scope-summary-num { font-size: 1.8rem; }
    /* Narrow screens: let the actions drop under the step text rather than
       crushing it to a two-word column. */
    .scope-step-row { flex-wrap: wrap; row-gap: 0.4rem; }
    .scope-step-actions { flex: 1 0 100%; margin-left: 1.9rem; }
    .scope-step-note, .scope-step-panel { margin-left: 0; }
}
