/* AAA classification survey — Phase 1 styles.
   Visually compatible with the existing video-background chrome in style.css
   but self-contained (no dependency on table-generator.css). */

.aaa-container {
    max-width: 980px;
    margin: 0 auto;
    padding: 24px;
    position: relative;
    z-index: 1;
}

.aaa-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    color: #f5f5f5;
}

.aaa-back-link {
    color: #f5f5f5;
    text-decoration: none;
    font-size: 0.95rem;
}
.aaa-back-link:hover { text-decoration: underline; }

.aaa-lang-toggle {
    display: inline-flex;
    background: rgba(0,0,0,0.45);
    border-radius: 999px;
    padding: 4px;
}
.aaa-lang-btn {
    background: transparent;
    color: #f5f5f5;
    border: 0;
    padding: 6px 14px;
    border-radius: 999px;
    cursor: pointer;
    font-size: 0.9rem;
}
.aaa-lang-btn.active {
    background: #ffffff;
    color: #1a1a1a;
    font-weight: 600;
}

.aaa-header {
    background: rgba(255,255,255,0.92);
    border-radius: 14px;
    padding: 28px 32px;
    margin-bottom: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.18);
}
.aaa-eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #6b7280;
    font-size: 0.78rem;
    margin: 0 0 6px;
}
.aaa-header h1 {
    margin: 0 0 8px;
    font-size: 1.7rem;
    color: #1f2937;
}
.aaa-subtitle {
    color: #4b5563;
    margin: 0 0 12px;
    font-size: 1rem;
}
.aaa-intro {
    margin-top: 14px;
    color: #374151;
    font-size: 0.95rem;
}
.aaa-intro summary {
    cursor: pointer;
    font-weight: 600;
    color: #1f2937;
}
.aaa-intro p {
    margin: 10px 0;
    line-height: 1.55;
}

.aaa-typology {
    margin-top: 12px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 10px;
}
.aaa-typology-card {
    background: #f3f4f6;
    border-left: 4px solid #4f46e5;
    padding: 10px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
}
.aaa-typology-card strong { color: #1f2937; }
.aaa-typology-card span { color: #4b5563; }

.aaa-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
}

.aaa-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}
.aaa-tab-btn {
    background: rgba(255,255,255,0.85);
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 10px 10px 0 0;
    padding: 10px 16px;
    cursor: pointer;
    color: #374151;
    font-size: 0.95rem;
    font-weight: 500;
}
.aaa-tab-btn.active {
    background: #ffffff;
    color: #4f46e5;
    border-bottom-color: #ffffff;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.08);
}
.aaa-tab-btn .aaa-tab-progress {
    margin-left: 8px;
    font-size: 0.8rem;
    color: #6b7280;
}
.aaa-tab-btn.complete .aaa-tab-progress { color: #16a34a; font-weight: 600; }

.aaa-tab-panels {
    background: #ffffff;
    border-radius: 0 12px 12px 12px;
    padding: 24px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.18);
}
.aaa-tab-panel { display: none; }
.aaa-tab-panel.active { display: block; }

.aaa-activity-summary {
    background: #eef2ff;
    border-left: 4px solid #4f46e5;
    padding: 14px 18px;
    border-radius: 8px;
    margin-bottom: 20px;
    color: #1f2937;
}
.aaa-activity-summary h2 {
    margin: 0 0 6px;
    font-size: 1.2rem;
}
.aaa-activity-summary .aaa-summary-text {
    margin: 0 0 12px;
    font-size: 0.95rem;
}
.aaa-activity-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}
.aaa-activity-meta-block h3 {
    margin: 0 0 6px;
    font-size: 0.85rem;
    color: #4338ca;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.aaa-activity-meta-block ul {
    margin: 0;
    padding-left: 18px;
    font-size: 0.9rem;
    color: #374151;
}
.aaa-activity-meta-block li { margin-bottom: 4px; }

.aaa-operation {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 18px 20px;
    margin-bottom: 16px;
    background: #ffffff;
    transition: box-shadow 0.15s ease;
}
.aaa-operation.classified { border-color: #a7f3d0; box-shadow: 0 2px 10px rgba(16,185,129,0.12); }
.aaa-operation h3 {
    margin: 0 0 4px;
    font-size: 1.05rem;
    color: #111827;
}
.aaa-operation .aaa-op-desc {
    color: #4b5563;
    margin: 0 0 12px;
    font-size: 0.92rem;
    line-height: 1.5;
}
.aaa-operation .aaa-op-note {
    background: #fff7ed;
    border-left: 3px solid #fb923c;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 0.85rem;
    color: #9a3412;
    margin: 0 0 14px;
}
.aaa-question {
    margin-top: 12px;
}
.aaa-question-label {
    display: block;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 6px;
    font-size: 0.92rem;
}
.aaa-question-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.aaa-option {
    display: inline-flex;
    align-items: center;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 999px;
    padding: 6px 12px;
    cursor: pointer;
    font-size: 0.88rem;
    color: #374151;
    transition: background 0.1s ease, border-color 0.1s ease;
}
.aaa-option input { margin-right: 6px; }
.aaa-option.selected {
    background: #ede9fe;
    border-color: #7c3aed;
    color: #4c1d95;
    font-weight: 500;
}
.aaa-bearer-input {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.92rem;
    box-sizing: border-box;
}

.aaa-submit-bar {
    margin-top: 22px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255,255,255,0.94);
    padding: 14px 18px;
    border-radius: 12px;
}
.aaa-progress {
    color: #374151;
    font-size: 0.95rem;
}
.aaa-submit-btn {
    background: #4f46e5;
    color: #ffffff;
    border: 0;
    padding: 12px 22px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
}
.aaa-submit-btn:disabled {
    background: #c7d2fe;
    cursor: not-allowed;
}
.aaa-submit-btn:not(:disabled):hover { background: #4338ca; }

.aaa-result {
    background: rgba(255,255,255,0.96);
    padding: 28px 32px;
    border-radius: 14px;
    margin-top: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.18);
}
.aaa-result h2 {
    color: #15803d;
    margin: 0 0 8px;
}
.aaa-result-meta {
    color: #6b7280;
    font-size: 0.85rem;
    margin: 0 0 16px;
    font-family: monospace;
}
.aaa-result-table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0;
}
.aaa-result-table th,
.aaa-result-table td {
    border: 1px solid #e5e7eb;
    padding: 8px 10px;
    text-align: left;
    font-size: 0.9rem;
}
.aaa-result-table th { background: #f3f4f6; color: #374151; }
.aaa-result-row-diff { color: #4f46e5; font-weight: 600; }
.aaa-link { color: #4f46e5; margin-right: 12px; }

@media (max-width: 720px) {
    .aaa-activity-meta { grid-template-columns: 1fr; }
    .aaa-submit-bar { flex-direction: column; gap: 12px; align-items: stretch; }
}

/* ──────────────────────────────────────────────────────────────────
 * Pooling Form additions (v1.1)
 * Two-level numerical pool methodology (matches /survey.html style)
 * ────────────────────────────────────────────────────────────────── */

.aaa-toolbar-right {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.aaa-ref-toggle {
    display: inline-flex;
    align-items: center;
    background: rgba(0,0,0,0.45);
    border-radius: 999px;
    padding: 4px 6px 4px 12px;
    color: #f5f5f5;
    font-size: 0.85rem;
}
.aaa-ref-label { opacity: 0.7; margin-right: 6px; }
.aaa-ref-btn {
    background: transparent;
    color: #f5f5f5;
    border: 0;
    padding: 5px 10px;
    border-radius: 999px;
    cursor: pointer;
    font-size: 0.82rem;
}
.aaa-ref-btn.active {
    background: #ffffff;
    color: #1a1a1a;
    font-weight: 600;
}
.aaa-ref-toggle.aaa-ref-locked .aaa-ref-btn:not(.active) {
    opacity: 0.35;
    cursor: not-allowed;
}

/* Activity aggregate pills strip */
.aaa-activity-aggregates {
    margin-top: 14px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.aaa-agg-pill {
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 999px;
    padding: 6px 14px;
    font-size: 0.85rem;
    color: #374151;
}
.aaa-agg-pill .aaa-agg-key {
    color: #6b7280;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.aaa-agg-pill strong {
    color: #1f2937;
    font-size: 0.95rem;
}
.aaa-agg-pill .aaa-agg-status {
    margin-left: 4px;
    font-size: 0.85rem;
    color: #6b7280;
}
.aaa-agg-pill.valid {
    background: #ecfdf5;
    border-color: #6ee7b7;
}
.aaa-agg-pill.valid .aaa-agg-status { color: #047857; font-weight: 600; }
.aaa-agg-pill.invalid {
    background: #fef2f2;
    border-color: #fca5a5;
}
.aaa-agg-pill.invalid .aaa-agg-status { color: #b91c1c; font-weight: 600; }

/* Pooling grid */
.aaa-pool-grid-wrap {
    margin-top: 4px;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    overflow: hidden;
}
.aaa-pool-grid {
    width: 100%;
    border-collapse: collapse;
    background: #ffffff;
    table-layout: fixed;
}
.aaa-pool-grid thead th {
    background: #f9fafb;
    color: #4338ca;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 0.72rem;
    padding: 12px 12px;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
    font-weight: 700;
}
.aaa-pool-grid .aaa-col-op { width: 36%; }
.aaa-pool-grid .aaa-col-importance,
.aaa-pool-grid .aaa-col-human,
.aaa-pool-grid .aaa-col-ai { width: 14%; }
.aaa-pool-grid .aaa-col-ref { width: 22%; }

.aaa-pool-grid tbody td {
    padding: 10px 12px;
    border-top: 1px solid #f3f4f6;
    vertical-align: middle;
    font-size: 0.92rem;
}
.aaa-pool-grid tbody tr.aaa-op-row:hover { background: #fafafe; }
.aaa-pool-grid tbody tr.aaa-op-row.aaa-op-row-expanded { background: #f5f3ff; }
.aaa-pool-grid tbody tr.aaa-op-overrun .aaa-cell-importance input { background: #fee2e2; border-color: #fca5a5; }

.aaa-op-name {
    display: flex;
    align-items: center;
    gap: 8px;
}
.aaa-op-info-btn {
    background: transparent;
    border: 0;
    color: #6b7280;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    font-size: 0.95rem;
}
.aaa-op-info-btn:hover { color: #4f46e5; background: #ede9fe; }
.aaa-op-info-btn[aria-expanded="true"] { color: #4f46e5; }
.aaa-op-label { color: #111827; }

.aaa-cell-pct {
    position: relative;
}
.aaa-pct-input {
    width: 70px;
    padding: 6px 8px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.92rem;
    text-align: right;
    font-variant-numeric: tabular-nums;
}
.aaa-pct-input:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79,70,229,0.15);
}
.aaa-pct-input[readonly] {
    background: #f3f4f6;
    color: #4b5563;
    cursor: not-allowed;
}
.aaa-cell-hint {
    margin-left: 6px;
    font-size: 0.72rem;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.aaa-pct-readout {
    display: inline-block;
    min-width: 30px;
    padding: 4px 8px;
    background: #f3f4f6;
    border-radius: 4px;
    color: #4b5563;
    font-size: 0.9rem;
    font-variant-numeric: tabular-nums;
}

.aaa-cell-bar {
    margin-top: 6px;
    height: 4px;
    background: #f3f4f6;
    border-radius: 2px;
    overflow: hidden;
}
.aaa-cell-bar-fill {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, #4f46e5, #818cf8);
    transition: width 0.15s ease;
}

.aaa-cell-ref {
    color: #6b7280;
    font-size: 0.88rem;
}
.aaa-ref-pair {
    display: inline-flex;
    flex-direction: column;
    line-height: 1.2;
}
.aaa-ref-pair strong { color: #4338ca; font-size: 0.95rem; }
.aaa-ref-pair .aaa-ref-sub {
    font-size: 0.72rem;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* Reference column visibility (controlled by body class) */
body.aaa-ref-hidden .aaa-pool-grid .aaa-col-ref,
body.aaa-ref-hidden .aaa-pool-grid .aaa-cell-ref,
body.aaa-ref-hidden .aaa-agg-ref { display: none; }
body.aaa-ref-hidden .aaa-pool-grid .aaa-col-op { width: 44%; }
body.aaa-ref-hidden .aaa-pool-grid .aaa-col-importance,
body.aaa-ref-hidden .aaa-pool-grid .aaa-col-human,
body.aaa-ref-hidden .aaa-pool-grid .aaa-col-ai { width: 18%; }

/* Expandable detail row */
.aaa-op-detail td {
    background: #f9fafb;
    border-top: 0 !important;
    padding: 14px 18px 18px 42px;
}
.aaa-op-detail .aaa-op-desc {
    color: #374151;
    font-size: 0.92rem;
    line-height: 1.55;
    margin: 0 0 10px;
}
.aaa-op-detail .aaa-op-note {
    background: #fff7ed;
    border-left: 3px solid #fb923c;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 0.85rem;
    color: #9a3412;
    margin: 0 0 14px;
}
.aaa-op-followups-intro {
    color: #6b7280;
    font-size: 0.82rem;
    margin: 0 0 10px;
    font-style: italic;
}
.aaa-followup-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}
.aaa-followup-row > label {
    min-width: 180px;
    font-size: 0.85rem;
    color: #4b5563;
    font-weight: 500;
}
.aaa-pills {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 6px;
}
.aaa-pill {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 999px;
    padding: 5px 12px;
    cursor: pointer;
    font-size: 0.82rem;
    color: #374151;
    transition: all 0.1s ease;
}
.aaa-pill:hover { background: #f3f4f6; }
.aaa-pill.selected {
    background: #ede9fe;
    border-color: #7c3aed;
    color: #4c1d95;
    font-weight: 600;
}
.aaa-pill-clear {
    color: #9ca3af;
    border-style: dashed;
}
.aaa-bearer-input {
    flex: 1;
    min-width: 280px;
    padding: 7px 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.9rem;
}

/* Grand bar across activities */
.aaa-grand-bar {
    margin-top: 18px;
    padding: 14px 22px;
    background: linear-gradient(90deg, #312e81, #4338ca);
    color: #ffffff;
    border-radius: 12px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 22px;
    box-shadow: 0 4px 14px rgba(67,56,202,0.3);
}
.aaa-grand-label {
    font-size: 0.82rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    opacity: 0.85;
}
.aaa-grand-stat {
    display: inline-flex;
    align-items: baseline;
    gap: 8px;
}
.aaa-grand-stat .aaa-grand-key {
    font-size: 0.78rem;
    opacity: 0.75;
    letter-spacing: 0.04em;
}
.aaa-grand-stat strong {
    font-size: 1.15rem;
    font-variant-numeric: tabular-nums;
}
.aaa-grand-stat-progress strong { font-size: 0.95rem; opacity: 0.7; }
.aaa-grand-stat-progress strong.valid { color: #6ee7b7; opacity: 1; }

@media (max-width: 900px) {
    .aaa-pool-grid .aaa-col-op { width: auto; }
    .aaa-followup-row > label { min-width: 100%; }
    .aaa-op-detail td { padding-left: 16px; }
    .aaa-grand-bar { gap: 12px; padding: 12px 14px; }
}

/* ──────────────────────────────────────────────────────────────────
 * Row-click affordance for Level 2 modal
 * Grid row is the click target; Importance input is the only inline editable.
 * ────────────────────────────────────────────────────────────────── */

.aaa-pool-grid tbody tr.aaa-op-row {
    cursor: pointer;
}
.aaa-pool-grid tbody tr.aaa-op-row:focus-within { background: #f5f3ff; }

.aaa-op-followup-indicator {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: transparent;
    margin-left: 6px;
    transition: background 0.15s;
}
.aaa-op-row.aaa-has-followups .aaa-op-followup-indicator {
    background: #7c3aed;
}

.aaa-cell-importance input.aaa-pct-input {
    cursor: text;
}

.aaa-cell-human-trigger {
    cursor: pointer;
    user-select: none;
    position: relative;
}
.aaa-cell-human-trigger:hover .aaa-cell-cta { color: #4338ca; text-decoration: underline; }
.aaa-cell-human-trigger:focus { outline: 2px solid #c7d2fe; outline-offset: -2px; border-radius: 6px; }
.aaa-cell-human-readout {
    display: inline-block;
    min-width: 50px;
    font-weight: 600;
    color: #1f2937;
    font-variant-numeric: tabular-nums;
}
.aaa-cell-cta {
    font-weight: 500;
    color: #6b7280;
    font-size: 0.9rem;
    font-variant-numeric: normal;
}

/* ──────────────────────────────────────────────────────────────────
 * Level 2 modal (backdrop + panel)
 * ────────────────────────────────────────────────────────────────── */

.aaa-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 24px;
    animation: aaaFadeIn 0.15s ease;
}
.aaa-modal-backdrop[hidden] { display: none; }
body.aaa-modal-open { overflow: hidden; }

@keyframes aaaFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.aaa-modal {
    background: #ffffff;
    border-radius: 16px;
    max-width: 680px;
    width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    animation: aaaModalIn 0.18s cubic-bezier(0.2, 0.9, 0.3, 1);
    overflow: hidden;
}
@keyframes aaaModalIn {
    from { opacity: 0; transform: translateY(12px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.aaa-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid #e5e7eb;
    background: #fafafe;
    gap: 12px;
}
.aaa-modal-pos {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.aaa-modal-nav {
    background: transparent;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    width: 30px;
    height: 30px;
    cursor: pointer;
    color: #4b5563;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.aaa-modal-nav:hover:not(:disabled) { background: #ede9fe; color: #4f46e5; border-color: #c4b5fd; }
.aaa-modal-nav:disabled { opacity: 0.35; cursor: not-allowed; }
.aaa-modal-pos-label {
    font-size: 0.85rem;
    color: #4b5563;
    font-variant-numeric: tabular-nums;
    min-width: 56px;
    text-align: center;
}
.aaa-modal-activity {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #6b7280;
    flex: 1;
    text-align: center;
}
.aaa-modal-close {
    background: transparent;
    border: 0;
    color: #6b7280;
    cursor: pointer;
    font-size: 1.05rem;
    padding: 6px 10px;
    border-radius: 6px;
}
.aaa-modal-close:hover { background: #fee2e2; color: #b91c1c; }

.aaa-modal-body {
    padding: 22px 26px;
    overflow-y: auto;
    flex: 1;
}
.aaa-modal-body h2 {
    margin: 0 0 8px;
    font-size: 1.2rem;
    color: #1f2937;
}
.aaa-modal-desc {
    margin: 0 0 12px;
    color: #4b5563;
    font-size: 0.93rem;
    line-height: 1.55;
}
.aaa-modal-note {
    background: #fff7ed;
    border-left: 3px solid #fb923c;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 0.85rem;
    color: #9a3412;
    margin: 0 0 18px;
}

/* Slider block */
.aaa-level2-block {
    background: #f9fafb;
    border-radius: 10px;
    padding: 18px 20px;
    margin-top: 8px;
    margin-bottom: 18px;
    border: 1px solid #e5e7eb;
}
.aaa-level2-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}
.aaa-level2-label {
    font-weight: 600;
    color: #1f2937;
    font-size: 0.95rem;
}
.aaa-level2-hint {
    color: #9ca3af;
    font-size: 0.78rem;
}

.aaa-slider-wrap {
    margin-top: 6px;
}
.aaa-slider-axis {
    position: relative;
    height: 56px;
    padding: 14px 0 24px;
}
.aaa-slider-track {
    position: absolute;
    top: 24px;
    left: 0;
    right: 0;
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
}
.aaa-slider-fill {
    position: absolute;
    top: 24px;
    left: 0;
    height: 8px;
    background: linear-gradient(90deg, #6366f1, #818cf8);
    border-radius: 4px;
    pointer-events: none;
    transition: width 0.05s linear;
}
.aaa-slider-input {
    position: absolute;
    top: 14px;
    left: -2px;
    right: -2px;
    width: calc(100% + 4px);
    height: 28px;
    margin: 0;
    background: transparent;
    -webkit-appearance: none;
    appearance: none;
    z-index: 2;
}
.aaa-slider-input:focus { outline: none; }
.aaa-slider-input::-webkit-slider-runnable-track {
    height: 28px;
    background: transparent;
    border: 0;
}
.aaa-slider-input::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #4f46e5;
    border: 3px solid #ffffff;
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.4);
    cursor: grab;
    margin-top: 3px;
    transition: transform 0.1s;
}
.aaa-slider-input:focus::-webkit-slider-thumb { box-shadow: 0 0 0 6px rgba(79, 70, 229, 0.2), 0 2px 8px rgba(79, 70, 229, 0.4); }
.aaa-slider-input::-webkit-slider-thumb:active { cursor: grabbing; transform: scale(1.1); }
.aaa-slider-input::-moz-range-thumb {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #4f46e5;
    border: 3px solid #ffffff;
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.4);
    cursor: grab;
}

.aaa-slider-ref {
    position: absolute;
    top: 0;
    transform: translateX(-50%);
    text-align: center;
    pointer-events: none;
    color: #047857;
    font-size: 0.72rem;
    font-weight: 600;
}
.aaa-slider-ref-arrow {
    display: block;
    line-height: 1;
    color: #16a34a;
}
.aaa-slider-ref-label {
    display: block;
    font-size: 0.65rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.aaa-slider-ticks {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    color: #9ca3af;
    font-variant-numeric: tabular-nums;
}

.aaa-slider-readout {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    padding-top: 8px;
}
.aaa-readout-cell {
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 6px 12px;
}
.aaa-readout-cell strong {
    font-size: 1rem;
    color: #1f2937;
    font-variant-numeric: tabular-nums;
}
.aaa-readout-label {
    color: #6b7280;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.aaa-readout-unit { color: #9ca3af; font-size: 0.85rem; }
.aaa-readout-human .aaa-num-input {
    width: 64px;
    padding: 4px 8px;
    border: 1px solid #c7d2fe;
    border-radius: 5px;
    font-size: 0.95rem;
    text-align: right;
    background: #f5f3ff;
    color: #1f2937;
    font-variant-numeric: tabular-nums;
}
.aaa-readout-human .aaa-num-input:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79,70,229,0.15);
}
.aaa-readout-ai strong { color: #4338ca; }
.aaa-readout-ref strong { color: #047857; }
.aaa-readout-diff {
    margin-left: 4px;
    font-size: 0.8rem;
    color: #6b7280;
}
.aaa-readout-diff.match { color: #047857; }
.aaa-readout-diff.over { color: #b45309; }
.aaa-readout-diff.under { color: #1d4ed8; }

/* Follow-ups disclosure */
.aaa-modal-followups {
    margin-top: 14px;
    border-top: 1px solid #f3f4f6;
    padding-top: 14px;
}
.aaa-modal-followups summary {
    cursor: pointer;
    font-size: 0.88rem;
    color: #6b7280;
    padding: 4px 0;
    user-select: none;
}
.aaa-modal-followups summary:hover { color: #4f46e5; }
.aaa-modal-followups[open] summary { color: #4338ca; font-weight: 600; margin-bottom: 10px; }

.aaa-modal-footer {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 26px;
    border-top: 1px solid #e5e7eb;
    background: #fafafe;
}

/* Hide reference marker / readout / column based on body class
   (already declared earlier; modal-specific overrides below) */
body.aaa-ref-hidden .aaa-slider-ref,
body.aaa-ref-hidden .aaa-readout-ref { display: none !important; }

@media (max-width: 720px) {
    .aaa-modal-backdrop { padding: 0; align-items: stretch; }
    .aaa-modal {
        max-width: 100%;
        max-height: 100vh;
        border-radius: 0;
    }
    .aaa-modal-body { padding: 16px 18px; }
    .aaa-slider-readout { flex-direction: column; align-items: stretch; }
    .aaa-readout-cell { justify-content: space-between; }
}

/* ──────────────────────────────────────────────────────────────────
 * v1.2.0 sub-task pooling (form variant)
 * ────────────────────────────────────────────────────────────────── */

.aaa-method-note {
    margin-top: 12px;
    padding: 10px 14px;
    background: #eef2ff;
    border-left: 3px solid #6366f1;
    font-size: 0.92rem;
    color: #312e81;
    border-radius: 4px;
}

.aaa-activity-compact {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 10px;
    padding: 8px 12px;
    background: #fafafe;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
}
.aaa-activity-compact h2 {
    margin: 0;
    font-size: 1.05rem;
    color: #1f2937;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
}
.aaa-activity-compact .aaa-activity-aggregates {
    margin: 0;
    flex: 1;
    justify-content: flex-end;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.aaa-method-note strong { color: #1e1b4b; }

.aaa-pool-grid .aaa-col-status { width: 8%; }
.aaa-cell-status { text-align: center; }
.aaa-status-pill {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 9999px;
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1.4;
}
.aaa-status-empty { background: #f3f4f6; color: #6b7280; }
.aaa-status-partial { background: #fef3c7; color: #92400e; }
.aaa-status-ready { background: #d1fae5; color: #065f46; }

.aaa-op-meta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: 8px;
}
.aaa-op-anchor {
    display: inline-block;
    min-width: 18px;
    text-align: center;
    font-weight: 700;
    font-size: 0.95rem;
    color: #9ca3af;
}
.aaa-op-anchor.agree { color: #059669; }
.aaa-op-anchor.disagree { color: #b91c1c; }
.aaa-op-anchor.contested { color: #ca8a04; }

.aaa-modal-wide {
    max-width: 920px;
}

.aaa-subtask-list-block {
    margin-top: 12px;
    padding: 10px 12px;
    background: #fafafe;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
}
.aaa-subtask-list-header h3 {
    margin: 0 0 2px;
    font-size: 0.9rem;
    color: #1f2937;
}
.aaa-subtask-list-hint {
    margin: 0 0 8px;
    font-size: 0.78rem;
    color: #6b7280;
}
.aaa-subtask-list {
    display: flex;
    flex-direction: column;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    overflow: hidden;
    background: #fff;
}
.aaa-subtask-row {
    display: grid;
    grid-template-columns: 24px 1fr 56px 130px 32px 50px;
    gap: 6px;
    align-items: center;
    padding: 4px 8px;
    border-bottom: 1px solid #f3f4f6;
    font-size: 0.82rem;
    line-height: 1.3;
}
.aaa-subtask-row:last-child { border-bottom: none; }
.aaa-subtask-row:nth-child(odd):not(.aaa-subtask-header) { background: #fafafe; }
.aaa-subtask-row:hover:not(.aaa-subtask-header) { background: #f5f3ff; }
.aaa-subtask-header {
    background: #ede9fe !important;
    font-size: 0.7rem;
    font-weight: 700;
    color: #4338ca;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 4px 8px;
}
.aaa-subtask-header span { text-align: center; }
.aaa-subtask-header span:nth-child(2) { text-align: left; }

.aaa-subtask-num {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #ede9fe;
    color: #4338ca;
    font-size: 0.72rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.aaa-subtask-label {
    font-weight: 600;
    color: #1f2937;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: help;
    display: inline-flex;
    align-items: center;
    min-width: 0;
}
.aaa-subtask-label .aaa-help-btn {
    flex: none;
    width: 18px;
    height: 18px;
    margin-left: 4px;
    font-size: 0.78rem;
}
.aaa-subtask-w input[type="number"] {
    width: 100%;
    max-width: 52px;
    padding: 2px 4px;
    border: 1px solid #d1d5db;
    border-radius: 3px;
    font-variant-numeric: tabular-nums;
    font-size: 0.82rem;
}
.aaa-subtask-h {
    display: grid;
    grid-template-columns: 1fr 44px;
    gap: 4px;
    align-items: center;
}
.aaa-subtask-h input[type="range"] {
    width: 100%;
    height: 14px;
    accent-color: #6366f1;
}
.aaa-subtask-h input[type="number"] {
    width: 100%;
    padding: 2px 4px;
    border: 1px solid #d1d5db;
    border-radius: 3px;
    font-variant-numeric: tabular-nums;
    font-size: 0.82rem;
}
.aaa-subtask-ai {
    text-align: center;
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    color: #1f2937;
}
.aaa-subtask-ref {
    font-size: 0.7rem;
    color: #6366f1;
    text-align: right;
    font-variant-numeric: tabular-nums;
}
body.aaa-ref-hidden .aaa-subtask-ref,
body.aaa-ref-hidden .aaa-subtask-header span:last-child { visibility: hidden; }

.aaa-op-rollup {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed #e5e7eb;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.aaa-rollup-pill {
    display: inline-flex;
    flex-direction: column;
    padding: 4px 8px;
    background: #f1f5f9;
    border-radius: 6px;
    font-size: 0.78rem;
    min-width: 90px;
}
.aaa-rollup-key { color: #6b7280; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em; }
.aaa-rollup-pill strong { color: #1f2937; font-size: 1rem; font-variant-numeric: tabular-nums; }
.aaa-rollup-ref { background: #ede9fe; }
.aaa-rollup-ref strong { color: #4338ca; }

.aaa-op-judgments-block {
    margin-top: 12px;
    padding: 10px 12px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
}
.aaa-op-judgments-block h3 {
    margin: 0 0 8px;
    font-size: 0.9rem;
    color: #1f2937;
}
.aaa-judgment-row {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 6px;
    flex-wrap: wrap;
}
.aaa-judgment-row > label {
    flex: 1 1 200px;
    font-size: 0.82rem;
    color: #374151;
    font-weight: 500;
}
.aaa-judgment-row .aaa-pills,
.aaa-judgment-row .aaa-bearer-input { flex: 2 1 260px; }

.aaa-agg-ref strong { color: #6366f1; }

.aaa-lang-select {
    margin-left: 10px;
    padding: 4px 8px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #fff;
    font-size: 0.9rem;
    color: #374151;
}

@media (max-width: 720px) {
    .aaa-subtask-row { grid-template-columns: 20px 1fr 50px 90px 28px; font-size: 0.78rem; }
    .aaa-subtask-row .aaa-subtask-ref { display: none; }
    .aaa-subtask-header span:last-child { display: none; }
    .aaa-judgment-row > label { flex-basis: 100%; }
}

