@import url('https://fonts.googleapis.com/css2?family=Lora:wght@400;600&family=Inter:wght@400;500;600&display=swap');

/* ── Design tokens ───────────────────────────────────────────── */
:root {
    --color-primary:       #4a6741;   /* deep sage green */
    --color-primary-dark:  #3a5333;
    --color-accent:        #bf6040;   /* warm terracotta */
    --color-accent-dark:   #a84f30;
    --color-accent-soft:   #f7e6dd;   /* light terracotta tint — recording overlay (REC-045) */
    --color-bg:            #eeece8;   /* warm page background */
    --color-card-bg:       #f5f3ee;   /* card surface */
    --color-card-border:   #e0ddd7;
    --color-text:          #1e1e1e;
    --color-text-muted:    #6b7a6b;
    --color-focus-ring:    rgba(74, 103, 65, 0.3);

    /* Observation type colors — terracotta for Activities (with child),
       sage for Question Sets (on your own). Mirrored from design 025. */
    --color-activity:      #a84f30;
    --color-activity-bg:   #f7e9e2;
    --color-question:      #4a6741;
    --color-question-bg:   #e8f0e8;

    --font-heading: 'Lora', Georgia, serif;
    --font-body:    'Inter', system-ui, sans-serif;
}

/* ── Base ────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body {
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    color: var(--color-text);
    background-color: var(--color-bg);
    margin: 0;
    padding: 0;
}

/* ── Typography ──────────────────────────────────────────────── */
h1, h2, h3 {
    font-family: var(--font-heading);
    font-weight: 600;
    line-height: 1.2;
}

h1 { font-size: 2rem;   margin-bottom: 1rem; }
h2 { font-size: 1.5rem; margin-bottom: 0.75rem; }
h3 { font-size: 1.25rem; margin-bottom: 0.5rem; }

.label-caps {
    font-family: var(--font-body);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--color-text-muted);
}

.text-muted  { color: var(--color-text-muted); }
.text-center { text-align: center; }

/* ── Layout ──────────────────────────────────────────────────── */
.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* ── Navbar ──────────────────────────────────────────────────── */
.navbar {
    background-color: var(--color-primary);
    color: #fff;
    padding: 1rem 0;
    margin-bottom: 2rem;
}

.navbar .container {
    display: flex;
    align-items: center;
}

.navbar-brand {
    font-family: var(--font-heading);
    color: #fff;
    text-decoration: none;
    font-size: 1.25rem;
    font-weight: 600;
}

/* ── Cards ───────────────────────────────────────────────────── */
.card {
    background: var(--color-card-bg);
    border: 1px solid var(--color-card-border);
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin-bottom: 1rem;
}

/* ── Buttons ─────────────────────────────────────────────────── */
.btn {
    display: inline-block;
    font-family: var(--font-body);
    font-weight: 500;
    text-align: center;
    padding: 0.5rem 1rem;
    font-size: 1rem;
    border-radius: 0.375rem;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.btn-primary {
    background-color: var(--color-accent);
    border-color: var(--color-accent);
    color: #fff;
}
.btn-primary:hover {
    background-color: var(--color-accent-dark);
    border-color: var(--color-accent-dark);
}

.btn-secondary {
    background-color: var(--color-primary);
    border-color: var(--color-primary);
    color: #fff;
}
.btn-secondary:hover {
    background-color: var(--color-primary-dark);
    border-color: var(--color-primary-dark);
}

.btn-outline-primary {
    color: var(--color-primary);
    border-color: var(--color-primary);
    background: transparent;
}
.btn-outline-primary:hover {
    background-color: var(--color-primary);
    color: #fff;
}

.btn-ghost {
    background: transparent;
    border-color: transparent;
    color: var(--color-text-muted);
}
.btn-ghost:hover {
    background: var(--color-card-border);
    color: var(--color-text);
}

/* ── Forms ───────────────────────────────────────────────────── */
.form-group  { margin-bottom: 1rem; }
.form-label  { display: block; margin-bottom: 0.25rem; font-weight: 500; }

.form-control {
    display: block;
    width: 100%;
    padding: 0.5rem 0.75rem;
    font-size: 1rem;
    font-family: var(--font-body);
    border: 1px solid var(--color-card-border);
    border-radius: 0.375rem;
    background-color: #fff;
    color: var(--color-text);
}
.form-control:focus {
    outline: 0;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 0.2rem var(--color-focus-ring);
}

textarea.form-control { min-height: 120px; resize: vertical; }

/* ── Alerts ──────────────────────────────────────────────────── */
.alert {
    padding: 1rem;
    border-radius: 0.375rem;
    margin-bottom: 1rem;
}
.alert-danger  { background-color: #f8d7da; color: #842029; border: 1px solid #f5c2c7; }
.alert-success { background-color: #d4edda; color: #1a4731; border: 1px solid #c3e6cb; }
.alert-info    { background-color: #e8f0e8; color: var(--color-primary-dark); border: 1px solid #c5d9c5; }

/* ── Observation-type badges + dashboard groups (design 025) ── */
.type-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0.3rem 0.55rem;
    border-radius: 0.3rem;
}
.type-badge .type-icon {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}
.type-badge.type-activity {
    background: var(--color-activity-bg);
    color: var(--color-activity);
}
.type-badge.type-activity .type-icon { background: var(--color-activity); }
.type-badge.type-question {
    background: var(--color-question-bg);
    color: var(--color-primary-dark);
}
.type-badge.type-question .type-icon { background: var(--color-primary); }
.type-badge.type-teacher {
    background: #dde2ef;
    color: #34406a;
}
.type-badge.type-teacher .type-icon { background: #5e6d9e; }

.obs-group {
    margin-bottom: 2rem;
}
.obs-group-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0 0.9rem;
    border-bottom: 1px solid var(--color-card-border);
    margin-bottom: 1rem;
    flex-wrap: wrap;
}
.obs-group-header h2 {
    margin: 0;
    font-size: 1.2rem;
}
.obs-group-header .obs-group-count {
    margin-left: auto;
    font-size: 0.8rem;
    color: var(--color-text-muted);
    font-weight: 600;
}
.obs-group-empty {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    font-style: italic;
    padding: 0.5rem 0;
}

.card.is-activity { border-top: 3px solid var(--color-accent); }
.card.is-question { border-top: 3px solid var(--color-primary); }
.card.is-teacher { border-top: 3px solid #5e6d9e; }

/* ── Activity overview (design 025, REC-025-11) ──────────────── */
.activity-wrap {
    max-width: 720px;
    margin: 0 auto;
    padding: 0 1rem 4rem;
}
.activity-hero {
    background: #fff;
    border: 1px solid var(--color-card-border);
    border-top: 4px solid var(--color-accent);
    border-radius: 0.5rem;
    padding: 1.75rem 2rem;
    margin-bottom: 1.5rem;
}
.activity-hero h1 {
    margin: 0.75rem 0 0.5rem;
}
.activity-intro {
    color: var(--color-text);
    line-height: 1.6;
    margin-top: 0.5rem;
}
.activity-intro h2 { font-size: 1.1rem; margin-top: 1rem; }
.activity-intro ul, .activity-intro ol { padding-left: 1.25rem; }
.activity-intro li { margin-bottom: 0.35rem; }
.activity-intro p:last-child { margin-bottom: 0; }
.activity-case-note {
    margin-top: 1.25rem;
    padding: 0.85rem 1rem;
    background: #fbf3ee;
    border-left: 3px solid var(--color-accent);
    border-radius: 0 0.375rem 0.375rem 0;
    font-size: 0.95rem;
    line-height: 1.5;
}
.activity-case-note-label {
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--color-accent-dark);
    margin-bottom: 0.2rem;
}

.activity-steps {
    background: #fff;
    border: 1px solid var(--color-card-border);
    border-radius: 0.5rem;
    padding: 0;
    margin-bottom: 1.5rem;
    overflow: hidden;
}
.activity-steps-header {
    background: var(--color-card-bg);
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--color-card-border);
}
.activity-steps-header h2 {
    margin: 0 0 0.25rem;
    font-size: 1.1rem;
}
.activity-steps-list {
    list-style: none;
    padding: 0.5rem 0;
    margin: 0;
}
.activity-steps-list li {
    display: grid;
    grid-template-columns: 2.5rem 1fr;
    gap: 0.75rem;
    padding: 0.85rem 1.5rem;
    border-top: 1px solid #f0ece8;
    align-items: start;
}
.activity-steps-list li:first-child { border-top: none; }
.activity-step-num {
    justify-self: center;
    width: 1.9rem;
    height: 1.9rem;
    border-radius: 50%;
    background: var(--color-activity-bg);
    color: var(--color-accent-dark);
    font-weight: 700;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 0.1rem;
}
.activity-step-body {
    line-height: 1.5;
}
.activity-step-body > :first-child { margin-top: 0; }
.activity-step-body p:last-child { margin-bottom: 0; }

.review-question-block {
    background: #fff;
    border: 1px solid var(--color-card-border);
    border-radius: 0.5rem;
    padding: 1.1rem 1.25rem;
    margin-bottom: 1rem;
}
.review-question-prompt {
    font-family: var(--font-heading);
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 0.75rem;
}
.review-question-prompt p:last-child { margin-bottom: 0; }
.review-answer-list { margin-bottom: 0.5rem; }
.review-empty { margin: 0 0 0.5rem; font-size: 0.9rem; }
.review-answer-text { margin: 0; line-height: 1.5; }
.review-answer-transcription {
    font-size: 0.88rem;
    color: var(--color-text-muted);
    font-style: italic;
    margin: 0.25rem 0 0;
}
.review-edit-area {
    margin: 0.5rem 0;
    padding: 0.75rem;
    background: var(--color-card-bg);
    border-radius: 0.5rem;
}

.activity-videos-block {
    background: var(--color-card-bg);
    border: 1px solid var(--color-card-border);
    border-radius: 0.5rem;
    padding: 0.75rem 1rem 1rem;
    margin-bottom: 1.25rem;
}
.activity-videos-header {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--color-text-muted);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.activity-videos-count {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-accent-dark);
    background: var(--color-activity-bg);
    padding: 1px 8px;
    border-radius: 999px;
    letter-spacing: 0;
    text-transform: none;
}
.activity-video-list {
    list-style: none;
    padding: 0;
    margin: 0 0 0.75rem;
}
.activity-video-item {
    margin-bottom: 0.4rem;
}
.activity-video-item:last-child { margin-bottom: 0; }
.activity-video-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.8rem 0.9rem;
    background: #fff;
    border: 1px solid var(--color-card-border);
    border-radius: 0.4rem;
    text-decoration: none;
    color: inherit;
    transition: background-color 0.15s, border-color 0.15s;
}
.activity-video-row:hover,
.activity-video-row:focus {
    background: #f7f6f3;
    border-color: var(--color-accent);
    text-decoration: none;
}
.activity-video-label {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--color-text);
}
.activity-video-chevron {
    color: var(--color-text-muted);
    font-size: 1.2rem;
    line-height: 1;
}
.activity-video-view-link {
    margin-left: auto;
    color: var(--color-accent);
    font-size: 0.9rem;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.activity-video-row:hover .activity-video-view-link,
.activity-video-row:focus .activity-video-view-link {
    text-decoration: none;
}

/* Video detail screen (REC-025-32) */
.video-detail-card {
    background: #fff;
    border: 1px solid var(--color-card-border);
    border-radius: 0.5rem;
    padding: 1.1rem 1.2rem;
    margin-bottom: 1rem;
}
.video-detail-prompt-label {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-text-muted);
    margin-bottom: 0.5rem;
}
.video-detail-narrative {
    margin-bottom: 1rem;
}
.video-detail-text,
.video-detail-transcription {
    margin: 0;
    line-height: 1.55;
}
.video-detail-transcription {
    font-style: italic;
    color: var(--color-text-muted);
    font-size: 0.9rem;
}
.activity-video-remove-form {
    margin: 0 0 0 auto;
    flex-shrink: 0;
}
.btn-remove-video {
    background: none;
    border: none;
    color: var(--color-text-muted);
    font-size: 0.82rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
}
.btn-remove-video:hover {
    color: #c00;
    background: #fdecec;
}
.btn-add-another-video {
    width: 100%;
    padding: 0.7rem;
    font-size: 0.95rem;
}
.activity-add-another-status { margin-top: 0.5rem; font-size: 0.85rem; }
.activity-add-another-progress { margin-top: 0.25rem; font-size: 0.85rem; }

.activity-record-cta {
    background: #fff;
    border: 1px solid var(--color-card-border);
    border-left: 4px solid var(--color-accent);
    border-radius: 0.5rem;
    padding: 1.5rem 1.75rem;
    margin-bottom: 1rem;
}

/* ── Focused upload panel (full attention while video uploads) ── */
.activity-wrap.upload-focus-mode > *:not(.activity-upload-focus) {
    display: none !important;
}
.activity-upload-focus {
    display: none;
    background: #fff;
    border: 1px solid var(--color-card-border);
    border-radius: 0.5rem;
    padding: 2rem 1.75rem 2.25rem;
    text-align: center;
    margin: 2rem auto;
    max-width: 32rem;
}
.activity-wrap.upload-focus-mode .activity-upload-focus {
    display: block;
}
.activity-upload-focus h2 {
    margin: 0 0 0.4rem;
    font-size: 1.2rem;
}
.activity-upload-focus .upload-focus-sub {
    color: var(--color-text-muted);
    margin: 0 0 1.5rem;
    font-size: 0.95rem;
    line-height: 1.4;
}
.activity-upload-focus .upload-focus-percent {
    font-size: 2.75rem;
    font-weight: 600;
    color: var(--color-primary-dark, #2a4a2a);
    line-height: 1;
    margin-bottom: 0.75rem;
    font-variant-numeric: tabular-nums;
}
.activity-upload-focus .upload-focus-bar {
    height: 14px;
    background: #ececec;
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}
.activity-upload-focus .upload-focus-bar-fill {
    height: 100%;
    width: 0%;
    background: var(--color-accent, #c75a3e);
    transition: width 0.2s ease;
}
.activity-upload-focus .upload-focus-state {
    color: var(--color-text-muted);
    font-size: 0.85rem;
    min-height: 1.2em;
    margin-bottom: 1.5rem;
}
.activity-upload-focus .upload-focus-controls {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
}
.activity-upload-focus .upload-focus-controls .btn {
    font-size: 1rem;
    padding: 0.7rem 1.6rem;
    min-width: 7rem;
}
.activity-upload-focus .upload-focus-error {
    color: #b03020;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    min-height: 1.2em;
}
.activity-record-cta h3 {
    margin: 0 0 0.4rem;
    font-size: 1.15rem;
}
.activity-record-cta p {
    color: var(--color-text-muted);
    margin: 0 0 1rem;
    line-height: 1.5;
}
.activity-record-cta .btn-lg {
    font-size: 1.05rem;
    padding: 0.7rem 1.5rem;
}
.activity-record-tips {
    color: var(--color-text-muted);
    margin: 0 0 1.25rem;
    padding-left: 1.25rem;
    line-height: 1.5;
}
.activity-record-tips li {
    margin-bottom: 0.5rem;
}
.activity-record-tips li:last-child {
    margin-bottom: 0;
}

.activity-uploaded {
    background: #e9f3e4;
    border: 1px solid #bcd4b0;
    border-radius: 0.5rem;
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
}
.activity-uploaded h3 {
    margin: 0 0 0.5rem;
    font-size: 1rem;
    color: var(--color-primary-dark);
}
.activity-post-header {
    background: #fff;
    border: 1px solid var(--color-card-border);
    border-top: 4px solid var(--color-accent);
    border-radius: 0.5rem;
    padding: 1.5rem 1.75rem;
    margin-bottom: 1rem;
}
.activity-post-header h1 {
    font-size: 1.5rem;
    margin-bottom: 0.35rem;
}

/* ── Upload success card (post-upload "How typical" screen, REC-025-28) ── */
.upload-success {
    background: #e8f0e8;
    border: 1px solid #c5d9c5;
    border-left: 3px solid var(--color-primary);
    border-radius: 0.4rem;
    padding: 0.75rem 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin-bottom: 1rem;
}
.upload-success-check {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--color-primary);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    line-height: 1;
    flex-shrink: 0;
}
.upload-success-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--color-primary-dark);
}
.upload-success-sub {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    margin-top: 0.1rem;
}

/* ── Badges ──────────────────────────────────────────────────── */
.badge {
    display: inline-block;
    padding: 0.25em 0.5em;
    font-size: 0.75em;
    font-weight: 600;
    border-radius: 0.25rem;
}
.badge-success   { background-color: var(--color-primary); color: #fff; }
.badge-secondary { background-color: var(--color-text-muted); color: #fff; }
.badge-warning   { background-color: #e8a838; color: #fff; }
.badge-info      { background-color: #5b8fa8; color: #fff; }

/* ── Progress bar ────────────────────────────────────────────── */
.progress-bar-container {
    background-color: var(--color-card-border);
    border-radius: 0.375rem;
    height: 0.5rem;
    margin-bottom: 0.5rem;
    overflow: hidden;
}
.progress-bar {
    background-color: var(--color-primary);
    height: 100%;
    transition: width 0.3s ease;
}

/* ── HTMX swap transition ────────────────────────────────────── */
@keyframes htmx-fade-in {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

#observation-body.is-transitioning {
    animation: htmx-fade-in 0.7s ease;
}

/* ── Mobile record buttons (video + audio) ─────────────────── */
.mobile-record-btn {
    display: none;
}

.btn-record-video {
    font-size: 1.1rem;
    padding: 0.875rem 2rem;
    width: 100%;
}

/* ── Voice widget Alpine helper ──────────────────────────────
   .v-hidden is toggled by Alpine ":class" on conditional elements
   in the voice-or-text widget. Using a class toggle avoids the
   x-show / inline display interaction we hit during the REC-029
   Alpine migration (effects called hide() but inline style was
   immediately cleared on HTMX-swapped fragments). */
.v-hidden { display: none !important; }

/* ── Voice/Write mode chooser (all viewports) ──────────────── */
.mobile-mode-chooser {
    display: block;
}

.mobile-back-to-chooser {
    display: block;
    margin-top: 0.5rem;
}

.mode-chooser-label {
    font-size: 1rem;
    color: var(--text-muted, #6c757d);
    margin-bottom: 0.75rem;
}

.mode-chooser-buttons {
    display: flex;
    gap: 1rem;
}

.btn-mode {
    flex: 1;
    padding: 1.25rem 1rem;
    font-size: 1.1rem;
    font-weight: 600;
    border: 2px solid var(--border-color, #dee2e6);
    border-radius: 0.5rem;
    background: var(--bg-surface, #fff);
    cursor: pointer;
    text-align: center;
    transition: border-color 0.15s, background 0.15s;
}

.btn-mode:active {
    background: var(--bg-hover, #f0f0f0);
}

.voice-instructions {
    padding: 1rem 0;
}

/* REC-043-10: voice-first idle UI (visible while state === 'idle'). */
.record-idle {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 0;
}

.btn-record-start {
    width: 100%;
    padding: 1.25rem 1rem;
    font-size: 1.15rem;
    font-weight: 600;
}

.btn-type-instead {
    background: none;
    border: none;
    color: var(--text-muted, #6c757d);
    text-decoration: underline;
    cursor: pointer;
    font-size: 0.95rem;
    padding: 0.25rem 0.5rem;
}

.voice-instructions-content {
    background: var(--bg-surface, #f8f9fa);
    border-radius: 0.5rem;
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
}

.voice-instructions-step {
    margin-bottom: 0.75rem;
    font-size: 1rem;
    line-height: 1.5;
}

.voice-instructions-step:last-child {
    margin-bottom: 0;
}

.voice-instructions-hint {
    font-size: 0.85rem;
    color: var(--text-muted, #6c757d);
    margin-bottom: 0.75rem;
}

.btn-attach-audio {
    width: 100%;
    padding: 1rem;
    font-size: 1.1rem;
}

/* Hide textarea by default (shown after "Write" is chosen) */
.upload-area-wrap {
    display: none;
}

/* Shown when Alpine sets mode === 'write' (adds .mobile-write-active) */
.upload-area-wrap.mobile-write-active {
    display: block;
}

@media (max-width: 480px) {
    .desktop-file-input {
        /* Hide the file input on mobile; the button triggers it instead */
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
    }

    .mobile-record-btn {
        display: block;
    }
}

/* ── Consent signing flow (REC-043-03) ──────────────────────── */
.consent-flow {
    max-width: 640px;
}

.consent-step-pill {
    display: inline-block;
    font-size: 0.85rem;
    color: var(--text-muted, #6c757d);
    background: var(--bg-surface, #f5f6f7);
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    margin: 0 0 1rem;
}

.consent-flow h1 {
    margin: 0 0 0.5rem;
}

.consent-lede {
    color: var(--text-muted, #475569);
    margin: 0 0 1.5rem;
    line-height: 1.5;
}

.consent-form {
    margin: 0;
}

.consent-field {
    margin-bottom: 1.25rem;
}

.consent-field label {
    display: block;
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 0.35rem;
    color: #1f2937;
}

.consent-field-hint {
    font-weight: 400;
    color: var(--text-muted, #6c757d);
    font-size: 0.9em;
}

.consent-field-label {
    display: block;
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 0.35rem;
    color: #1f2937;
}

.consent-field-static {
    margin: 0;
    padding: 0.6rem 0.75rem;
    font-size: 1rem;
    line-height: 1.4;
    color: #1f2937;
    background: #f3f4f6;
    border: 1px solid var(--border-color, #d1d5db);
    border-radius: 0.4rem;
}

.consent-field input[type="text"],
.consent-field textarea {
    display: block;
    width: 100%;
    padding: 0.6rem 0.75rem;
    font-size: 1rem;
    line-height: 1.4;
    border: 1px solid var(--border-color, #d1d5db);
    border-radius: 0.4rem;
    background: #fff;
    box-sizing: border-box;
    transition: border-color 0.1s, box-shadow 0.1s;
}

.consent-field input[type="text"]:focus,
.consent-field textarea:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18);
}

.consent-field .form-help {
    margin: 0.35rem 0 0;
    font-size: 0.85rem;
    color: var(--text-muted, #6c757d);
    line-height: 1.4;
}

.consent-field .form-error {
    margin: 0.35rem 0 0;
    color: #b91c1c;
    font-size: 0.85rem;
}

.consent-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color, #e5e7eb);
}

.consent-actions .btn-link {
    margin-right: auto;  /* pushes Cancel/Back to the left */
}

.consent-summary {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 0.4rem 1rem;
    margin: 0 0 1rem;
    padding: 0.85rem 1rem;
    background: var(--bg-surface, #f8fafc);
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 0.5rem;
    font-size: 0.95rem;
}

.consent-summary dt {
    font-weight: 600;
    color: #475569;
}

.consent-summary dd {
    margin: 0;
    color: #1f2937;
}

.consent-summary-aside {
    color: var(--text-muted, #6c757d);
    font-weight: 400;
}

.consent-text-block {
    background: #fff;
    border: 1px solid var(--border-color, #d1d5db);
    border-radius: 0.5rem;
    padding: 1rem 1.25rem;
    margin: 0 0 1.25rem;
}

.consent-text {
    margin: 0;
    font-family: ui-serif, Georgia, "Times New Roman", serif;
    font-size: 0.95rem;
    line-height: 1.55;
    color: #1f2937;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.consent-version {
    margin: 0.75rem 0 0;
    font-size: 0.8rem;
    color: var(--text-muted, #6c757d);
    font-style: italic;
}

.teacher-link-share {
    margin: 1rem 0 1.25rem;
    max-width: 36rem;
}

/* REC-043-21: Milestone 1 "coming soon" variant of the teacher card. */
.teacher-card-note {
    color: var(--text-muted, #6c757d);
    margin: 0.5rem 0 0.75rem;
}

.teacher-card-coming-soon {
    color: var(--text-muted, #6c757d);
    background: #f3f5fb;
    border-left: 3px solid #5e6d9e;
    padding: 0.6rem 0.85rem;
    border-radius: 0.25rem;
    margin: 0.75rem 0 1rem;
    font-size: 0.95rem;
}

/* REC-043-22: read-only overview of an assigned teacher request. */
.teacher-overview-header {
    margin-bottom: 1.25rem;
}

.teacher-overview-header .type-badge {
    margin-bottom: 0.4rem;
}

.teacher-overview-note,
.teacher-overview-block {
    background: #fff;
    border: 1px solid var(--border-color, #d1d5db);
    border-radius: 0.4rem;
    padding: 1rem 1.15rem;
    margin: 0 0 1rem;
}

.teacher-overview-note {
    border-left: 3px solid #5e6d9e;
}

.teacher-overview-questions-label {
    color: var(--text-muted, #6c757d);
    margin: 0.5rem 0 0.5rem;
}

.teacher-overview-questions {
    margin: 0 0 0 1.2rem;
    padding: 0;
}

.teacher-overview-questions li {
    margin-bottom: 0.5rem;
}

.teacher-overview-questions .question-helper {
    color: var(--text-muted, #6c757d);
    font-size: 0.9rem;
    margin-top: 0.15rem;
}

.teacher-overview-next ol {
    margin: 0 0 0 1.2rem;
    padding: 0;
}

.teacher-overview-next li {
    margin-bottom: 0.35rem;
}

.teacher-link-label {
    margin: 0 0 0.35rem;
    color: var(--text-muted, #6c757d);
    font-size: 0.9rem;
}

.teacher-link-box {
    display: flex;
    align-items: stretch;
    border: 1px solid var(--border-color, #d1d5db);
    border-radius: 0.4rem;
    background: #f9fafb;
    overflow: hidden;
    transition: border-color 0.15s, background 0.15s;
}

.teacher-link-box.is-copied {
    border-color: #10b981;
    background: #ecfdf5;
}

.teacher-link-url {
    flex: 1 1 auto;
    min-width: 0;
    padding: 0.55rem 0.75rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.9rem;
    color: #1f2937;
    word-break: break-all;
    overflow-wrap: anywhere;
    white-space: normal;
    user-select: all;
    line-height: 1.4;
}

.teacher-link-copy {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0 0.85rem;
    border: none;
    border-left: 1px solid var(--border-color, #d1d5db);
    background: #fff;
    color: #374151;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.teacher-link-copy:hover {
    background: #f3f4f6;
    color: #111827;
}

.teacher-link-copy:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: -2px;
}

.teacher-link-box.is-copied .teacher-link-copy {
    color: #047857;
    background: #ecfdf5;
}

.teacher-link-copy-icon {
    flex-shrink: 0;
}

.teacher-sample-message {
    margin-top: 1rem;
}

.sample-message-box {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border-color, #d1d5db);
    border-radius: 0.4rem;
    background: #f9fafb;
    overflow: hidden;
    transition: border-color 0.15s, background 0.15s;
}

.sample-message-box.is-copied {
    border-color: #10b981;
    background: #ecfdf5;
}

.sample-message-text {
    display: block;
    width: 100%;
    box-sizing: border-box;
    border: none;
    background: transparent;
    padding: 0.65rem 0.75rem;
    font-family: inherit;
    font-size: 0.95rem;
    color: #1f2937;
    line-height: 1.5;
    resize: vertical;
    min-height: 12em;
}

.sample-message-text:focus {
    outline: 2px solid #2563eb;
    outline-offset: -2px;
}

.sample-message-copy {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin: 0 0.5rem 0.5rem auto;
    padding: 0.4rem 0.85rem;
    border: 1px solid var(--border-color, #d1d5db);
    border-radius: 0.3rem;
    background: #fff;
    color: #374151;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.sample-message-copy:hover {
    background: #f3f4f6;
    color: #111827;
}

.sample-message-copy:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

.sample-message-box.is-copied .sample-message-copy {
    color: #047857;
    background: #ecfdf5;
}

.teacher-link-revoke {
    color: #9ca3af;
}

.teacher-link-revoke:hover {
    color: #b91c1c;
}

.muted-aside {
    color: var(--text-muted, #6c757d);
    font-size: 0.9em;
}

.muted-link {
    color: var(--text-muted, #6c757d);
    text-decoration: underline;
    text-decoration-color: rgba(108, 117, 125, 0.4);
}

.muted-link:hover {
    color: #1f2937;
    text-decoration-color: currentColor;
}

.teacher-preview-questions {
    margin: 1.5rem 0 1rem;
    padding: 1rem 1.25rem;
    background: #f9fafb;
    border: 1px solid var(--border-color, #d1d5db);
    border-radius: 0.5rem;
}

.teacher-preview-questions h2 {
    margin: 0 0 0.75rem;
    font-size: 1.05rem;
    color: #1f2937;
}

.teacher-preview-question-list {
    margin: 0;
    padding-left: 1.25rem;
}

.teacher-preview-question-list li + li {
    margin-top: 0.85rem;
}

.teacher-preview-prompt {
    margin: 0;
    color: #1f2937;
    font-weight: 500;
    line-height: 1.45;
}

.teacher-preview-helper {
    margin: 0.2rem 0 0;
    color: var(--text-muted, #6c757d);
    font-size: 0.9rem;
    line-height: 1.45;
}

/* ── Utilities ───────────────────────────────────────────────── */
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.d-flex              { display: flex; }
.gap-2               { gap: 0.5rem; }
.align-items-center  { align-items: center; }
.justify-content-between { justify-content: space-between; }
.w-100               { width: 100%; }

/* ── Submit panel (dashboard) ────────────────────────────────── */
.submit-panel {
    border-radius: 0.75rem;
    padding: 1.1rem 1.25rem 1.25rem;
    margin-top: 1.5rem;
}
.submit-panel-ready {
    background: linear-gradient(135deg, #fff 0%, #f7f2ec 100%);
    border: 1px solid var(--color-card-border);
    border-top: 3px solid var(--color-accent);
    box-shadow: 0 4px 18px rgba(191, 96, 64, 0.10);
}
.submit-panel-partial {
    background: #faf8f5;
    border: 1px dashed var(--color-card-border);
}
.submit-panel-kicker {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.4rem;
}
.submit-panel-ready .submit-panel-kicker    { color: var(--color-accent-dark); }
.submit-panel-partial .submit-panel-kicker  { color: var(--color-text-muted); }
.submit-panel-dot {
    width: 7px; height: 7px;
    background: var(--color-accent);
    border-radius: 50%;
}
.submit-panel-heading {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    margin: 0 0 0.3rem;
    line-height: 1.25;
}
.submit-panel-copy {
    font-size: 0.92rem;
    color: var(--color-text-muted);
    line-height: 1.5;
    margin: 0 0 0.9rem;
}
.submit-panel-progress {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.8rem;
    color: var(--color-text-muted);
    margin-bottom: 0.9rem;
}
.submit-panel-progress .progress-bar-container {
    flex: 1;
    margin: 0;
    height: 6px;
}
.progress-bar-accent { background-color: var(--color-accent); }

.btn-submit-ready {
    background: var(--color-accent);
    border-color: var(--color-accent);
    color: #fff;
    display: inline-block;
    width: 100%;
    font-weight: 600;
    padding: 0.8rem 1rem;
    font-size: 1rem;
    box-shadow: 0 2px 10px rgba(191, 96, 64, 0.25);
}
.btn-submit-ready:hover {
    background: var(--color-accent-dark);
    border-color: var(--color-accent-dark);
    color: #fff;
}
.btn-submit-partial {
    background: transparent;
    border: 1.5px solid var(--color-accent);
    color: var(--color-accent-dark);
    display: inline-block;
    width: 100%;
    font-weight: 600;
    padding: 0.7rem 1rem;
    font-size: 0.98rem;
}
.btn-submit-partial:hover {
    background: var(--color-accent);
    color: #fff;
}

/* ── Confirmation page ───────────────────────────────────────── */
.confirm-wrap {
    max-width: 620px;
    margin: 0 auto;
    padding: 0 0.25rem 3rem;
}
.confirm-hero {
    background: #fff;
    border: 1px solid var(--color-card-border);
    border-top: 4px solid var(--color-accent);
    border-radius: 0.625rem;
    padding: 1.35rem 1.5rem;
    margin-bottom: 1rem;
}
.confirm-hero-kicker {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--color-accent-dark);
    margin-bottom: 0.35rem;
}
.confirm-hero-title {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    margin: 0 0 0.5rem;
    line-height: 1.2;
}
.confirm-hero-copy {
    font-size: 0.98rem;
    color: var(--color-text-muted);
    line-height: 1.55;
    margin: 0;
}

.confirm-tallies {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
    margin-bottom: 1rem;
}
.tally {
    background: #fff;
    border: 1px solid var(--color-card-border);
    border-radius: 0.625rem;
    padding: 0.8rem 1rem;
}
.tally-n {
    font-family: var(--font-heading);
    font-size: 1.75rem;
    font-weight: 600;
    line-height: 1;
    color: var(--color-primary-dark);
}
.tally-activity .tally-n { color: var(--color-accent-dark); }
.tally-n .tally-of {
    font-size: 0.95rem;
    color: var(--color-text-muted);
    font-weight: 400;
}
.tally-label {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    font-weight: 600;
    margin-top: 0.35rem;
}
.tally-sub {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    margin-top: 0.1rem;
}

.summary-section { margin-bottom: 1rem; }
.summary-section-header {
    display: flex;
    align-items: center;
    padding: 0.25rem 0.1rem 0.55rem;
}
.summary-list {
    background: #fff;
    border: 1px solid var(--color-card-border);
    border-radius: 0.625rem;
    overflow: hidden;
}
.summary-row {
    display: grid;
    grid-template-columns: 24px 1fr auto;
    gap: 0.75rem;
    align-items: center;
    padding: 0.8rem 1rem;
    border-top: 1px solid #f0ece8;
    font-size: 0.96rem;
}
.summary-row:first-child { border-top: none; }
.summary-check {
    width: 22px; height: 22px;
    border-radius: 50%;
    background: var(--color-primary);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}
.summary-check.is-open {
    background: #fff;
    border: 1.5px solid var(--color-card-border);
    color: var(--color-text-muted);
}
.summary-title {
    font-weight: 500;
    color: var(--color-text);
    min-width: 0;
}
.summary-row.is-open .summary-title { color: var(--color-text-muted); }
.summary-status {
    font-size: 0.78rem;
    color: var(--color-text-muted);
    font-weight: 600;
}
.summary-row.is-open .summary-status { color: var(--color-accent-dark); }

.confirm-actions {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin-top: 1rem;
}
.btn-submit-big {
    padding: 0.9rem 1rem;
    font-size: 1.02rem;
}
.btn-back {
    background: transparent;
    border: 1px solid var(--color-card-border);
    color: var(--color-text-muted);
    padding: 0.7rem 1rem;
    font-size: 0.92rem;
    display: inline-block;
    width: 100%;
}
.btn-back:hover {
    background: #fff;
    color: var(--color-text);
}
.confirm-reassurance {
    font-size: 0.82rem;
    color: var(--color-text-muted);
    text-align: center;
    margin-top: 0.5rem;
}
