:root {
    color-scheme: light;
    --bg: #f3f7f6;
    --surface: #ffffff;
    --surface-raised: #fbfdfd;
    --surface-hover: #eaf3f0;
    --surface-muted: #f4f8f7;
    --surface-input: #ffffff;
    --surface-elevated: #fbfdfd;
    --primary: #0f766e;
    --primary-hover: #0b5f58;
    --primary-subtle: rgba(15, 118, 110, 0.1);
    --primary-border: rgba(15, 118, 110, 0.28);
    --primary-text: #0f766e;
    --danger: #dc2626;
    --danger-hover: #b91c1c;
    --danger-subtle: rgba(220, 38, 38, 0.08);
    --danger-subtle-hover: rgba(220, 38, 38, 0.14);
    --danger-border: rgba(220, 38, 38, 0.35);
    --danger-text: #b91c1c;
    --danger-focus-ring: rgba(220, 38, 38, 0.25);
    --success: #059669;
    --warning: #d97706;
    --text: #102a27;
    --text-secondary: #5d746f;
    --text-on-primary: #ffffff;
    --border: #d5e4e0;
    --radius: 8px;
    --radius-lg: 16px;
    --shadow: 0 1px 2px rgba(16, 42, 39, 0.06), 0 1px 3px rgba(16, 42, 39, 0.08);
    --shadow-lg: 0 8px 24px rgba(16, 42, 39, 0.08), 0 2px 6px rgba(16, 42, 39, 0.04);
    --shadow-inset: inset 0 1px 0 rgba(255, 255, 255, 0.85);
    --focus-ring: rgba(15, 118, 110, 0.22);
    --sidebar-width: 240px;
    --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --table-header-bg: #eaf3f0;
    --table-stripe-bg: rgba(234, 243, 240, 0.85);
    --row-hover-bg: #e7f5f1;
    --sticky-shadow: rgba(16, 42, 39, 0.08);
    --atmosphere-blue: rgba(15, 118, 110, 0.09);
    --atmosphere-indigo: rgba(14, 116, 144, 0.06);
    --grid-line: rgba(93, 116, 111, 0.1);
    --accent-gradient: linear-gradient(135deg, #0f766e 0%, #0e7490 45%, #059669 100%);
    --accent-gradient-soft: linear-gradient(90deg, rgba(15, 118, 110, 0.55), rgba(14, 116, 144, 0.4));
    --accent-glow: 0 4px 18px rgba(15, 118, 110, 0.18);
    --shine-line: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.9), transparent);
    /* Incomplete translation highlight */
    --trans-missing-bg: #fffbeb;
    --trans-missing-bg-hover: #fef3c7;
    --trans-missing-border: #fcd34d;
    --trans-missing-accent: #d97706;
    --trans-missing-placeholder: #92400e;
    /* Status badges */
    --badge-draft-bg: #f1f5f9;
    --badge-draft-fg: #64748b;
    --badge-active-bg: rgba(5, 150, 105, 0.12);
    --badge-active-fg: #047857;
    --badge-archived-bg: rgba(217, 119, 6, 0.12);
    --badge-archived-fg: #b45309;
    --badge-in-progress-bg: var(--primary-subtle);
    --badge-in-progress-fg: var(--primary-text);
    --badge-pending-bg: var(--badge-draft-bg);
    --badge-pending-fg: var(--badge-draft-fg);
    --badge-admin-bg: rgba(109, 40, 217, 0.1);
    --badge-admin-fg: #6d28d9;
    --badge-supervisor-bg: rgba(190, 24, 93, 0.1);
    --badge-supervisor-fg: #be185d;
    --badge-coach-bg: rgba(22, 163, 74, 0.1);
    --badge-coach-fg: #15803d;
    --badge-you-bg: var(--primary-subtle);
    --badge-you-fg: var(--primary-text);
    --badge-warn-bg: rgba(217, 119, 6, 0.12);
    --badge-warn-fg: #b45309;
    --badge-q-bg: var(--primary-subtle);
    --badge-q-fg: var(--primary-text);
    --badge-opt-bg: #f1f5f9;
    --badge-opt-fg: #475569;
    --badge-app-bg: rgba(22, 163, 74, 0.1);
    --badge-app-fg: #15803d;
    --badge-str-bg: rgba(109, 40, 217, 0.1);
    --badge-str-fg: #6d28d9;
    --badge-branch-bg: rgba(109, 40, 217, 0.1);
    --badge-branch-fg: #6d28d9;
    --lang-chip-fixed-bg: var(--primary-subtle);
    --lang-chip-fixed-border: var(--primary-border);
    --toast-success-bg: #ecfdf5;
    --toast-success-fg: #166534;
    --toast-success-border: #86efac;
    --toast-error-bg: #fef2f2;
    --toast-error-fg: #991b1b;
    --toast-error-border: #fca5a5;
    --toast-info-bg: #ddf4ef;
    --toast-info-fg: #0f766e;
    --toast-info-border: #99d5c9;
    --save-flash-bg: var(--primary-subtle);
    --progress-track: #e2e8f0;
}

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

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    min-height: 100vh;
}

hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 20px 0;
}

pre, code {
    font-family: ui-monospace, 'Cascadia Code', 'Source Code Pro', Menlo, Consolas, monospace;
}
pre {
    background: var(--surface-muted);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px;
    color: var(--text);
}
code {
    background: var(--surface-raised);
    padding: 1px 5px;
    border-radius: 4px;
    font-size: 0.9em;
}

/* Layout */
.layout {
    display: flex;
    min-height: 100vh;
    position: relative;
    isolation: isolate;
}

/* Ambient backdrop (logged-in app shell — matches login atmosphere) */
body.logged-in:not(.login-active) .layout::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
        radial-gradient(ellipse 85% 65% at 18% 22%, var(--atmosphere-blue), transparent 62%),
        radial-gradient(ellipse 60% 50% at 82% 78%, var(--atmosphere-indigo), transparent 58%),
        var(--bg);
}
body.logged-in:not(.login-active) .layout::after {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background-image:
        linear-gradient(var(--grid-line) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
    background-size: 56px 56px;
    mask-image: radial-gradient(ellipse 100% 90% at 55% 40%, #000 15%, transparent 72%);
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--surface);
    backdrop-filter: blur(14px);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    box-shadow: 2px 0 16px rgba(15, 23, 42, 0.06);
}
.sidebar-brand {
    position: relative;
    padding: 20px 20px 20px 24px;
    border-bottom: 1px solid var(--border);
    font-weight: 700;
    font-size: 1.05rem;
    line-height: 1.35;
    letter-spacing: -0.02em;
    color: var(--text);
    background: linear-gradient(180deg, rgba(15, 118, 110, 0.06) 0%, transparent 100%);
}
.sidebar-brand::before {
    content: '';
    position: absolute;
    left: 0;
    top: 18px;
    bottom: 18px;
    width: 3px;
    border-radius: 0 2px 2px 0;
    background: var(--accent-gradient);
    box-shadow: 0 0 8px rgba(15, 118, 110, 0.25);
}
.sidebar-brand small {
    display: block;
    font-weight: 600;
    font-size: .75rem;
    color: var(--primary-text);
}
.sidebar-nav {
    flex: 1;
    padding: 12px 0;
    list-style: none;
}
.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    margin: 0 8px;
    border-radius: 6px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: .9rem;
    transition: background .15s, color .15s, box-shadow .15s;
}
.sidebar-nav a:hover {
    background: var(--surface-hover);
    color: var(--text);
}
.sidebar-nav a.active {
    background: var(--primary-subtle);
    color: var(--primary-text);
    box-shadow: inset 3px 0 0 var(--primary);
    border-radius: 0 6px 6px 0;
    margin-left: 0;
    padding-left: 17px;
}
.sidebar-nav a svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    transition: color 0.15s, filter 0.15s;
}
.sidebar-nav a.active svg {
    color: var(--primary);
    filter: drop-shadow(0 0 4px rgba(15, 118, 110, 0.2));
}
.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border);
    font-size: .85rem;
    background: var(--surface-muted);
}
.sidebar-footer .user-info {
    color: var(--text-secondary);
    margin-bottom: 8px;
}

/* Main content */
.main-content {
    position: relative;
    z-index: 1;
    margin-left: var(--sidebar-width);
    flex: 1;
    padding: 28px 32px;
    min-width: 0;
}

/* Cards */
.card {
    position: relative;
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg), var(--shadow-inset);
    padding: 24px;
    transition: border-color 0.2s, box-shadow 0.2s;
}
body.logged-in .card::before {
    content: '';
    position: absolute;
    inset: 0 0 auto 0;
    height: 1px;
    background: var(--shine-line);
    pointer-events: none;
}
body.logged-in .card > h3 {
    margin: 0 0 14px;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(90deg, var(--text) 0%, var(--text-secondary) 120%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* Elevated panels & inputs (login visual language) */
body.logged-in :is(
    .question-item,
    .inline-form-card,
    .trans-lang-panel,
    .trans-top-bar,
    .trans-sheet,
    .lang-manager,
    .condition-editor,
    .scoring-profile-card,
    .scoring-profile-picker,
    .coach-client-group,
    .client-qn-panel,
    .table-wrapper,
    .trans-table-wrapper,
    .trans-list,
    .pending-option-item,
    .translations-panel,
    .coach-recent-panel,
    .client-detail-panel,
    .option-item
) {
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow), var(--shadow-inset);
}

body.logged-in .table-wrapper,
body.logged-in .trans-table-wrapper {
    border: 1px solid var(--border);
    background: var(--surface);
}

body.logged-in :is(
    .category-german-input,
    .coach-supervisor-select,
    .type-select,
    .trans-select,
    .lang-add-code,
    .lang-add-name,
    .trans-search-input,
    .followup-note-input,
    .condition-json-fallback,
    .scoring-profile-picker input,
    .scoring-profile-picker select,
    .value-score-pts,
    .translation-row input[type="text"],
    .trans-list-item .trans-cell-input
) {
    background: var(--surface-input);
    border-radius: var(--radius);
}

body.logged-in .btn-home {
    border-radius: var(--radius);
    background: var(--surface-input);
    box-shadow: var(--shadow);
}
body.logged-in .btn-home:hover {
    background: var(--surface-hover);
    border-color: var(--primary-border);
    box-shadow: var(--accent-glow);
}
body.logged-in .btn-home svg {
    transition: color 0.15s;
}
body.logged-in .btn-home:hover svg {
    color: var(--primary-text);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    font-size: .875rem;
    font-weight: 500;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface-input);
    color: var(--text);
    cursor: pointer;
    transition: background .15s, box-shadow .15s;
    text-decoration: none;
    line-height: 1.4;
}
.btn:hover:not(.btn-primary):not(.btn-danger) {
    background: var(--surface-hover);
    box-shadow: var(--shadow);
}
.btn-primary {
    background: var(--accent-gradient);
    color: var(--text-on-primary);
    border-color: rgba(15, 118, 110, 0.35);
    box-shadow: 0 1px 2px rgba(16, 42, 39, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}
.btn-primary:hover {
    background: linear-gradient(135deg, #0f766e 0%, #0b5f58 45%, #059669 100%);
    border-color: rgba(11, 95, 88, 0.45);
    box-shadow: var(--accent-glow), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}
.btn-danger {
    background: var(--danger-subtle);
    color: var(--danger-text);
    border-color: var(--danger-border);
}
.btn-danger:hover {
    background: var(--danger-subtle-hover);
    border-color: var(--danger);
    color: var(--danger-hover);
    box-shadow: 0 0 0 1px var(--danger-border);
}
.btn-danger:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--danger-focus-ring);
}
.btn-sm { padding: 4px 10px; font-size: .8rem; }
.btn-block { width: 100%; justify-content: center; }
.btn-icon {
    padding: 6px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
}
.btn-icon:hover:not(.btn-icon-danger) {
    background: var(--surface-hover);
    border-radius: 4px;
    color: var(--text);
}
.btn-icon-danger {
    color: var(--danger-text);
}
.btn-icon-danger:hover {
    background: var(--danger-subtle);
    color: var(--danger-hover);
    border-radius: 4px;
}

/* Forms */
.form-group {
    margin-bottom: 16px;
}
.form-group label {
    display: block;
    font-size: .85rem;
    font-weight: 500;
    margin-bottom: 4px;
    color: var(--text-secondary);
}
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: .9rem;
    font-family: var(--font);
    background: var(--surface-input);
    color: var(--text);
    transition: border-color .15s, box-shadow .15s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--focus-ring);
}
.form-row {
    display: flex;
    gap: 12px;
}
.form-row .form-group { flex: 1; }

/* Badges */
.badge {
    display: inline-block;
    padding: 2px 8px;
    font-size: .75rem;
    font-weight: 600;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: .03em;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}
.badge-draft      { background: var(--badge-draft-bg); color: var(--badge-draft-fg); }
.badge-active     { background: var(--badge-active-bg); color: var(--badge-active-fg); }
.badge-archived   { background: var(--badge-archived-bg); color: var(--badge-archived-fg); }

.retired-questions-panel summary {
    cursor: pointer;
    font-weight: 600;
    margin-bottom: 8px;
}
.retired-question-item {
    opacity: 0.85;
}
.retired-question-item .question-header {
    cursor: default;
}
.badge-completed  { background: var(--badge-active-bg); color: var(--badge-active-fg); }
.badge-in_progress { background: var(--badge-in-progress-bg); color: var(--badge-in-progress-fg); }
.badge-pending    { background: var(--badge-pending-bg); color: var(--badge-pending-fg); }
.badge-activity-app_sync   { background: var(--badge-coach-bg); color: var(--badge-coach-fg); }
.badge-activity-app_change { background: var(--badge-in-progress-bg); color: var(--badge-in-progress-fg); }
.badge-activity-web_change { background: var(--badge-supervisor-bg); color: var(--badge-supervisor-fg); }
.badge-activity-web_export { background: var(--badge-admin-bg); color: var(--badge-admin-fg); }
.badge-activity-api_error   { background: var(--badge-archived-bg); color: var(--badge-archived-fg); }
.security-settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 14px 20px;
    margin-bottom: 16px;
}
.security-settings-grid .form-group {
    margin-bottom: 0;
}
.revoke-confirm-input {
    width: 100%;
    max-width: 360px;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.9rem;
    font-family: var(--font-mono, ui-monospace, monospace);
}
.user-actions-cell {
    white-space: nowrap;
}
.user-actions-cell .btn + .btn {
    margin-left: 6px;
}
.activity-log-card .table-wrapper { max-height: 420px; overflow: auto; }
.activity-log-card .filter-bar label {
    margin: 0;
    line-height: 1.2;
}
.activity-log-detail {
    font-size: 0.8rem;
    max-width: 280px;
    word-break: break-word;
}
table.data-table.activity-log-table th,
table.data-table.activity-log-table td {
    vertical-align: top;
    line-height: 1.45;
}
table.data-table.activity-log-table .activity-log-col-time,
table.data-table.activity-log-table .activity-log-col-meta {
    white-space: nowrap;
}
table.data-table.activity-log-table .activity-log-col-kind {
    white-space: nowrap;
}
table.data-table.activity-log-table .activity-log-col-route code {
    display: inline-block;
    max-width: 12rem;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: top;
}
table.data-table.activity-log-table code {
    font-size: 0.8rem;
    line-height: 1.45;
    vertical-align: top;
}
table.data-table.activity-log-table .badge {
    vertical-align: top;
}
.activity-log-changes-cell {
    min-width: 220px;
    max-width: 420px;
}
.activity-log-subject,
.activity-log-actor {
    font-size: 0.85rem;
}
.activity-log-subject strong,
.activity-log-actor strong {
    color: var(--text);
}
.activity-log-role {
    font-weight: 400;
    color: var(--text-secondary);
    font-size: 0.78rem;
}
.activity-log-error {
    margin-top: 6px;
    font-size: 0.8rem;
    color: var(--danger);
    line-height: 1.35;
}
.activity-change-raw {
    font-size: 0.72rem;
    color: var(--text-secondary);
    margin-top: 2px;
    font-family: var(--font-mono, ui-monospace, monospace);
    word-break: break-all;
}
.activity-changes-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.78rem;
}
.activity-changes-table th {
    text-align: left;
    font-weight: 600;
    color: var(--text-secondary);
    padding: 3px 10px 3px 0;
    vertical-align: top;
    white-space: nowrap;
    line-height: 1.45;
}
.activity-changes-table td {
    padding: 3px 0;
    word-break: break-word;
    color: var(--text);
    vertical-align: top;
    line-height: 1.45;
}
.activity-changes-table tr + tr th,
.activity-changes-table tr + tr td {
    border-top: 1px solid var(--border);
    padding-top: 4px;
}

/* Page header */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
    flex-wrap: wrap;
    gap: 12px;
}
.page-header-start {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}
.page-header-titles {
    min-width: 0;
}
body.logged-in .page-header-titles {
    position: relative;
    padding-left: 14px;
}
body.logged-in .page-header-titles::before {
    content: '';
    position: absolute;
    left: 0;
    top: 3px;
    bottom: 3px;
    width: 3px;
    border-radius: 2px;
    background: var(--accent-gradient);
    box-shadow: 0 0 8px rgba(15, 118, 110, 0.2);
}
.page-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    letter-spacing: -0.02em;
}
.page-header .actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}
.btn-home {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    min-width: 40px;
    padding: 0;
    flex-shrink: 0;
}
.btn-home svg {
    width: 20px;
    height: 20px;
}

.user-actions-cell {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.mobile-logout-btn,
.mobile-change-password-btn {
    display: none;
    position: fixed;
    top: 12px;
    z-index: 150;
    box-shadow: var(--shadow);
}
.mobile-logout-btn {
    right: 12px;
}
.mobile-change-password-btn {
    right: 96px;
}
.coach-supervisor-select {
    max-width: 100%;
    min-width: 160px;
    font-size: 0.85rem;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface-input);
    color: var(--text);
}

/* Questionnaire dashboard root (not .q-grid — avoids grid layout on nested cards) */
.q-dashboard-root {
    display: block;
    width: 100%;
}

/* Questionnaire dashboard — category sections with horizontal card rows */
.q-dashboard-groups {
    display: flex;
    flex-direction: column;
    gap: 28px;
    width: 100%;
}

.q-category-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    min-width: 0;
}

.q-category-title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: -0.01em;
    padding-bottom: 4px;
    padding-left: 12px;
    border-bottom: 1px solid var(--border);
    position: relative;
}
.q-category-title::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.15em;
    width: 4px;
    height: 1em;
    border-radius: 2px;
    background: var(--accent-gradient-soft);
}

.q-category-title .category-title-input {
    font: inherit;
    color: inherit;
    letter-spacing: inherit;
    width: 100%;
    max-width: 480px;
}

.category-german-input {
    width: 100%;
    min-width: 140px;
    max-width: 320px;
    padding: 6px 10px;
    font-size: .9rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface);
    color: inherit;
}

.category-german-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-subtle);
}

.category-german-input:disabled {
    opacity: .6;
}

/* Category rows: horizontal flow, wrap when the line is full */
.q-category-grid {
    display: flex;
    flex-flow: row wrap;
    align-items: stretch;
    align-content: flex-start;
    gap: 16px;
    width: 100%;
    min-width: 0;
    margin: 0;
}

.q-category-grid > .q-card {
    flex: 0 0 300px;
    width: 300px;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

/* Questionnaire card grid (legacy / other pages) */
.q-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

.q-card .drag-handle {
    margin-right: 6px;
    cursor: grab;
    color: var(--text-secondary);
}
.q-card {
    position: relative;
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow), var(--shadow-inset);
    transition: box-shadow .2s, transform .2s, border-color .2s;
    cursor: pointer;
}
.q-card::after {
    content: '';
    position: absolute;
    inset: 0 0 auto 0;
    height: 2px;
    background: var(--accent-gradient-soft);
    opacity: 0;
    transition: opacity 0.2s;
}
.q-card:hover {
    box-shadow: var(--shadow-lg), var(--accent-glow);
    border-color: color-mix(in srgb, var(--primary-border) 60%, var(--border));
    transform: translateY(-3px);
}
.q-card:hover::after {
    opacity: 1;
}
.q-card-header {
    display: flex;
    align-items: start;
    justify-content: space-between;
    margin-bottom: 12px;
}
.q-card-title {
    font-size: 1.05rem;
    font-weight: 600;
}
.q-card-meta {
    display: flex;
    gap: 16px;
    color: var(--text-secondary);
    font-size: .85rem;
}
.q-card-actions {
    display: flex;
    gap: 6px;
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

/* Tables — scroll inside wrapper so sticky headers stay visible */
.table-wrapper {
    overflow: auto;
    max-height: min(72vh, calc(100vh - 220px));
    -webkit-overflow-scrolling: touch;
}
table.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: .875rem;
}
table.data-table th,
table.data-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}
table.data-table th {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: .8rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    background: var(--table-header-bg);
    position: sticky;
    top: 0;
    z-index: 2;
    box-shadow: 0 1px 0 var(--border);
}
table.data-table tbody tr {
    transition: background 0.12s ease;
}
table.data-table tbody tr:nth-child(even) td {
    background: var(--table-stripe-bg);
}
table.data-table tbody tr:nth-child(even) td.sticky-col {
    background: color-mix(in srgb, var(--table-stripe-bg) 80%, var(--surface));
}
table.data-table tr:hover td {
    background: var(--row-hover-bg);
}
table.data-table tbody tr:hover td.sticky-col {
    background: color-mix(in srgb, var(--row-hover-bg) 85%, var(--surface));
}
table.data-table tbody tr:hover td:first-child:not(.sticky-col) {
    box-shadow: inset 3px 0 0 var(--primary);
}
table.data-table .sticky-col {
    position: sticky;
    left: 0;
    z-index: 1;
    background: var(--surface);
    box-shadow: 2px 0 4px var(--sticky-shadow);
}
table.data-table tr.client-group-row td {
    border-top: 2px solid color-mix(in srgb, var(--primary) 35%, var(--border));
}
table.data-table thead th.sticky-col {
    z-index: 5;
    top: 0;
    background: var(--table-header-bg);
}
th.sortable { cursor: pointer; user-select: none; }
th.sortable::after { content: ' \2195'; opacity: .4; }
th.sort-asc::after { content: ' \2191'; opacity: 1; }
th.sort-desc::after { content: ' \2193'; opacity: 1; }

/* Accordion / question list */
.question-list {
    list-style: none;
}
.question-item {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    margin-bottom: 8px;
    background: var(--surface);
    box-shadow: var(--shadow), var(--shadow-inset);
}
.question-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    cursor: pointer;
    user-select: none;
}
.question-header:hover { background: var(--row-hover-bg); }
.drag-handle {
    cursor: grab;
    color: var(--text-secondary);
    font-size: 1.1rem;
    line-height: 1;
}
.drag-handle:active { cursor: grabbing; }
.question-header .q-text {
    flex: 1;
    font-weight: 500;
}
.question-header .q-type {
    font-size: .8rem;
    color: var(--text-secondary);
    background: var(--surface-raised);
    padding: 2px 8px;
    border-radius: 4px;
}
.question-body {
    display: none;
    padding: 0 16px 16px 42px;
}
.question-item.open {
    border-color: color-mix(in srgb, var(--primary-border) 45%, var(--border));
    box-shadow: var(--shadow), 0 0 0 1px color-mix(in srgb, var(--primary-border) 30%, transparent);
}
.question-item.open .question-body {
    display: block;
}
.question-item.open .question-header {
    background: color-mix(in srgb, var(--primary-subtle) 40%, transparent);
}
.question-item.open .chevron {
    transform: rotate(90deg);
}
.chevron {
    transition: transform .2s;
    font-size: .8rem;
    color: var(--text-secondary);
}

/* Answer options inside a question */
.option-list {
    list-style: none;
    margin-top: 8px;
}
.option-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    margin-bottom: 4px;
    background: var(--surface-muted);
    font-size: .875rem;
}
.option-item .opt-text { flex: 1; }
.option-item .opt-points {
    font-weight: 600;
    color: var(--primary-text);
    font-size: .8rem;
    background: var(--primary-subtle);
    padding: 1px 6px;
    border-radius: 4px;
}

/* Translations panel */
.translations-panel {
    margin-top: 12px;
    padding: 12px;
    background: var(--surface-muted);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow), var(--shadow-inset);
}
.translations-panel h4 {
    font-size: .85rem;
    margin-bottom: 8px;
    color: var(--text-secondary);
}
.translation-row {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 6px;
}
.translation-row input[type="text"] {
    flex: 1;
    padding: 4px 8px;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: .85rem;
}
.translation-row .lang-code {
    font-weight: 600;
    font-size: .8rem;
    width: 30px;
    text-transform: uppercase;
    color: var(--text-secondary);
}

/* Inline edit */
.inline-edit {
    border: 1px solid transparent;
    background: transparent;
    padding: 2px 4px;
    font: inherit;
    border-radius: 4px;
    width: 100%;
    transition: border-color .15s;
}
.inline-edit:hover { border-color: var(--border); }
.inline-edit:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--surface);
    box-shadow: 0 0 0 3px var(--focus-ring);
}

/* Login */
body.login-active .main-content {
    margin-left: 0;
    padding: 0;
    min-height: 100vh;
}

.login-screen {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 48px 32px;
    overflow: hidden;
    isolation: isolate;
}

.login-screen__backdrop {
    position: absolute;
    inset: 0;
    z-index: 0;
    background:
        linear-gradient(135deg, rgba(221, 244, 239, 0.78) 0%, rgba(243, 247, 246, 0.96) 48%, rgba(231, 245, 241, 0.72) 100%),
        var(--bg);
}

.login-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(100, 116, 139, 0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(100, 116, 139, 0.08) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.85), transparent 92%);
}

.login-screen__content {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 980px;
}

.login-brand {
    margin-bottom: 26px;
}

.login-brand__title {
    font-size: 1.75rem;
    font-weight: 750;
    line-height: 1.25;
    letter-spacing: -0.02em;
    margin-bottom: 6px;
    color: var(--text);
}

.login-brand__subtitle {
    font-size: 0.875rem;
    color: var(--primary-text);
    font-weight: 600;
}

.login-card {
    position: relative;
    overflow: hidden;
    min-height: 360px;
    padding: 30px 32px 32px;
    border-color: rgba(207, 225, 221, 0.9);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 18px 50px rgba(16, 42, 39, 0.10), 0 2px 8px rgba(16, 42, 39, 0.06);
}
.login-card::before {
    content: '';
    position: absolute;
    inset: 0 0 auto 0;
    height: 2px;
    background: var(--accent-gradient);
    opacity: 0.75;
}

.login-card__heading {
    font-size: 1.25rem;
    font-weight: 750;
    margin-bottom: 6px;
}

.login-card__lead {
    font-size: 0.925rem;
    color: var(--text-secondary);
    margin-bottom: 26px;
}

.login-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    align-items: stretch;
}

.login-options .login-card {
    min-width: 0;
}

.login-options .login-card[hidden] {
    display: none;
}

.login-card--sso {
    display: flex;
    flex-direction: column;
}

.login-card--sso .login-sso {
    margin-top: 28px;
}

.login-sso__logo {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 96px;
    margin-bottom: 16px;
    padding: 0 8px;
}

.login-sso__logo img {
    display: block;
    max-width: 100%;
    max-height: 90px;
    object-fit: contain;
}

.login-sso__logo span {
    display: none;
    color: var(--text);
    font-size: 1rem;
    font-weight: 700;
    text-align: center;
}

.login-sso__logo--fallback span {
    display: block;
}

.login-form .form-group {
    margin-bottom: 18px;
}

.login-sso {
    margin-top: 0;
}

.login-sso__button {
    min-height: 50px;
    background: #ffffff;
    border-color: rgba(15, 118, 110, 0.34);
    color: var(--primary-text);
    font-weight: 600;
}

.login-sso__button:disabled {
    background: #f8fafc;
    border-color: rgba(148, 163, 184, 0.36);
    color: #64748b;
    cursor: default;
    box-shadow: none;
}

.login-form .btn-primary {
    min-height: 50px;
    margin-top: 4px;
    font-size: 0.95rem;
}

.login-alert {
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: var(--radius);
    font-size: 0.85rem;
    line-height: 1.45;
}
.login-alert--error {
    color: var(--danger-text);
    background: var(--danger-subtle);
    border: 1px solid var(--danger-border);
}

.login-card__footnote {
    margin-top: 22px;
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.error-text { color: var(--danger); font-size: .85rem; margin-top: 8px; }

@media (max-width: 480px) {
    .login-screen {
        padding: 20px 16px;
        align-items: flex-start;
        padding-top: 48px;
    }

    .login-options {
        grid-template-columns: 1fr;
    }

    .login-card {
        min-height: 0;
        padding: 26px 22px;
    }

    .login-brand__title {
        font-size: 1.45rem;
    }

}

@media (prefers-reduced-motion: reduce) {
    .spinner {
        animation: none;
    }
    .q-card:hover,
    .home-kpi-link:hover,
    .home-link-card:hover {
        transform: none;
    }
}

/* Toast */
#toastContainer {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.toast {
    padding: 12px 16px 12px 14px;
    border-radius: var(--radius-lg);
    font-size: .875rem;
    font-weight: 500;
    line-height: 1.45;
    box-shadow: var(--shadow-lg), 0 8px 24px rgba(15, 23, 42, 0.1);
    opacity: 0;
    transform: translateX(40px);
    transition: opacity .3s, transform .3s;
    max-width: 360px;
    border: 1px solid var(--border);
    border-left-width: 4px;
    background: var(--surface-raised);
    color: var(--text);
}
.toast.show { opacity: 1; transform: translateX(0); }
.toast-success {
    background: var(--toast-success-bg);
    color: var(--toast-success-fg);
    border-color: var(--toast-success-border);
    border-left-color: var(--success);
}
.toast-error {
    background: var(--toast-error-bg);
    color: var(--toast-error-fg);
    border-color: var(--toast-error-border);
    border-left-color: var(--danger);
}
.toast-info {
    background: var(--toast-info-bg);
    color: var(--toast-info-fg);
    border-color: var(--toast-info-border);
    border-left-color: var(--primary);
}

/* Filter bar */
.filter-bar {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.filter-bar select,
.filter-bar input {
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: .85rem;
    background: var(--surface-input);
    color: var(--text);
}
.filter-bar input[type="search"],
.filter-bar input[type="text"].filter-search {
    min-width: 180px;
}
.pagination-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 12px;
    font-size: .85rem;
    color: var(--text-secondary);
}
.pagination-bar .btn {
    min-width: 2.5rem;
}
.data-toolbar-hint {
    font-size: .8rem;
    color: var(--text-secondary);
}
#qdb-table th.col-key {
    font-size: .75rem;
    font-weight: 500;
    text-transform: none;
    letter-spacing: 0;
    max-width: 140px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
#qdb-table thead tr:nth-child(1) th[data-id] {
    font-size: .7rem;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 56px 24px;
    color: var(--text-secondary);
    border: 1px dashed color-mix(in srgb, var(--border) 80%, var(--primary-border));
    border-radius: var(--radius-lg);
    background: color-mix(in srgb, var(--surface-muted) 70%, transparent);
}
.empty-state svg {
    margin-bottom: 16px;
    opacity: .5;
    color: var(--primary-text);
}
.empty-state h3 { margin-bottom: 8px; color: var(--text); }

/* Dragging */
.question-item.dragging {
    opacity: .5;
    border-style: dashed;
}
.option-item.dragging {
    opacity: .5;
    border-style: dashed;
}

/* Loading spinner */
.spinner {
    display: inline-block;
    width: 26px;
    height: 26px;
    border: 2px solid var(--border);
    border-top-color: var(--primary);
    border-right-color: #0e7490;
    border-radius: 50%;
    animation: spin .7s linear infinite;
    box-shadow: 0 0 10px rgba(15, 118, 110, 0.12);
}
#app > .spinner,
.main-content > .spinner,
[id$="Content"] > .spinner:only-child,
[id$="Root"] > .spinner:only-child {
    display: block;
    margin: 56px auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform .3s;
    }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; padding: 16px; }
    .q-grid { grid-template-columns: 1fr; }
    body.logged-in .mobile-logout-btn,
    body.logged-in .mobile-change-password-btn {
        display: inline-flex;
    }
    body.logged-in .page-header {
        padding-right: 200px;
    }
}

@media (max-width: 520px) {
    .q-category-grid > .q-card {
        flex: 1 1 100%;
        width: 100%;
    }
}

/* Role badges */
.badge-admin      { background: var(--badge-admin-bg); color: var(--badge-admin-fg); }
.badge-supervisor { background: var(--badge-supervisor-bg); color: var(--badge-supervisor-fg); }
.badge-coach      { background: var(--badge-coach-bg); color: var(--badge-coach-fg); }
.badge-you        { background: var(--badge-you-bg); color: var(--badge-you-fg); font-size: .7rem; }

/* Dashboard — category keys panel */
.category-keys-table code {
    font-size: .8rem;
}
table.data-table tbody tr.row-orphan-category td {
    background: color-mix(in srgb, var(--surface-hover) 60%, transparent);
}

/* Assignment page — panels fill remaining viewport; lists scroll inside */
.main-content:has(.assign-page) {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
}

.main-content:has(.assign-page) .page-header {
    flex-shrink: 0;
}

.main-content:has(.assign-page) #assignContent {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.assign-page {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    gap: 16px;
}

.assign-layout {
    display: grid;
    grid-template-columns: minmax(260px, min(32vw, 380px)) minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
    gap: 16px;
    align-items: stretch;
    flex: 1 1 auto;
    min-height: 0;
}

.assign-layout > .assign-coaches,
.assign-layout > .assign-clients-card {
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
    height: 100%;
    max-height: 100%;
    min-height: 0;
}

.assign-coaches .assign-panel-body {
    flex: 1 1 0;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
}

.assign-panel-header {
    flex-shrink: 0;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    background: var(--surface-muted);
}

.assign-panel-header h3 {
    margin: 0 0 10px;
    font-size: 1rem;
}

.assign-panel-header .filter-bar {
    margin-bottom: 0;
}

.assign-panel-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    padding: 6px 8px 10px;
}

.assign-clients-toolbar {
    flex-shrink: 0;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.assign-clients-toolbar-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.assign-clients-toolbar-top h3 {
    margin: 0;
    font-size: 1rem;
    line-height: 1.4;
}

.assign-clients-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.assign-clients-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.assign-clients-filters .filter-search {
    flex: 1 1 200px;
    min-width: 160px;
    max-width: 100%;
}

.assign-clients-filters select {
    flex: 0 1 auto;
    min-width: 140px;
    max-width: 100%;
}

.assign-table-panel {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.assign-table-panel .table-wrapper {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    overflow: auto;
    box-sizing: border-box;
}

.assign-panel-footer,
.assign-clients-footer {
    flex-shrink: 0;
    padding: 10px 16px;
    border-top: 1px solid var(--border);
    background: var(--surface);
}

.assign-panel-footer .pagination-bar,
.assign-clients-footer .pagination-bar {
    margin-top: 0;
}

.assign-clients-footer .pagination-bar + .selection-info {
    margin-top: 8px;
}

.assign-action-card {
    flex-shrink: 0;
    padding: 14px 16px;
}

.assign-action-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 10px;
}

.assign-action-row select {
    flex: 1 1 220px;
    min-width: 180px;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface);
    color: inherit;
}

.assign-action-card h4 {
    margin: 0;
    font-size: .95rem;
}

@media (max-width: 1100px) {
    .assign-layout {
        grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
    }
}

@media (max-width: 900px) {
    .assign-layout {
        grid-template-columns: 1fr;
        grid-template-rows: minmax(0, 38%) minmax(0, 1fr);
    }
}

/* Coach list */
.coach-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.coach-list-item {
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: background .15s, border-color .15s;
    display: flex;
    flex-direction: column;
    gap: 2px;
    border: 1px solid transparent;
    margin-bottom: 4px;
}

.coach-list-item:last-child {
    margin-bottom: 0;
}

.coach-list-item:hover {
    background: var(--surface-hover);
}

.coach-list-item.active {
    background: var(--primary-subtle);
    border-color: var(--primary);
}

.coach-list-empty {
    padding: 20px 12px;
    text-align: center;
    color: var(--text-secondary);
    font-size: .875rem;
}

.coach-name {
    font-weight: 600;
    font-size: .9rem;
    word-break: break-word;
}

.coach-supervisor {
    font-size: .8rem;
    color: var(--text-secondary);
    word-break: break-word;
}

.coach-client-count {
    font-size: .75rem;
    color: var(--primary);
    font-weight: 500;
    margin-top: 2px;
}

/* Selection info bar */
.selection-info {
    margin: 0;
    padding: 8px 12px;
    background: var(--primary-subtle);
    border: 1px solid var(--primary-border);
    border-radius: var(--radius);
    font-size: .875rem;
    color: var(--primary-text);
    box-shadow: 0 0 0 1px rgba(15, 118, 110, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

/* Tabs */
.tab-bar {
    display: flex;
    gap: 4px;
    padding: 4px;
    border-bottom: none;
    margin-bottom: 20px;
    background: var(--surface-muted);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-inset);
}
.tab-bar button {
    padding: 9px 18px;
    font-size: .9rem;
    font-weight: 500;
    background: transparent;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    color: var(--text-secondary);
    transition: color .15s, background .15s, box-shadow .15s;
}
.tab-bar button:hover {
    color: var(--text);
    background: var(--surface-hover);
}
.tab-bar button.active {
    color: var(--primary-text);
    background: var(--primary-subtle);
    box-shadow: inset 0 0 0 1px var(--primary-border), 0 1px 3px rgba(15, 118, 110, 0.08);
}

/* Metadata form in editor */
.meta-form {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px;
    margin-bottom: 24px;
}
@media (max-width: 600px) {
    .meta-form { grid-template-columns: 1fr; }
}

/* Inline form cards (add/edit question, add/edit option) */
.inline-form-card {
    background: var(--surface-muted);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: var(--shadow), var(--shadow-inset);
}
.inline-form-card h4 {
    font-size: .9rem;
    font-weight: 600;
    margin-bottom: 12px;
}
.inline-form-card .form-group { margin-bottom: 10px; }

/* Type select */
.type-select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: .9rem;
    font-family: var(--font);
    background: var(--surface-input);
    color: var(--text);
}
.type-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--focus-ring);
}

/* Checkbox label */
.checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: .875rem;
    cursor: pointer;
    user-select: none;
}
.checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
    cursor: pointer;
}

/* Modal dialog */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background:
        radial-gradient(ellipse 70% 50% at 50% 40%, rgba(15, 118, 110, 0.06), transparent 70%),
        color-mix(in srgb, var(--bg) 50%, rgba(15, 23, 42, 0.35));
    backdrop-filter: blur(4px);
}
.modal-overlay[hidden] {
    display: none;
}
body.modal-open {
    overflow: hidden;
}
.modal-dialog {
    width: 100%;
    max-width: 460px;
    max-height: calc(100vh - 32px);
    overflow: auto;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg), var(--shadow-inset);
    padding: 24px;
}
.modal-dialog h2 {
    margin: 0 0 6px;
    font-size: 1.15rem;
}
.modal-dialog .modal-subtitle {
    margin: 0 0 16px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.45;
}
.modal-dialog .modal-subtitle strong {
    color: var(--text);
}
.modal-dialog .modal-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 20px;
}
.password-mode-fieldset {
    border: none;
    margin: 0 0 16px;
    padding: 0;
}
.password-mode-fieldset > legend {
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 10px;
    padding: 0;
}
.password-mode-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.password-mode-option {
    display: block;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}
.password-mode-option:hover {
    background: var(--surface-hover);
}
.password-mode-option:has(input:checked) {
    border-color: var(--primary);
    background: color-mix(in srgb, var(--primary) 8%, var(--surface));
}
.password-mode-option input {
    margin: 0 10px 0 0;
    vertical-align: top;
    accent-color: var(--primary);
}
.password-mode-option-title {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 4px;
}
.password-mode-option-desc {
    display: block;
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.4;
    margin-left: 26px;
}
.modal-hint {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin: 0 0 14px;
    line-height: 1.45;
    padding: 10px 12px;
    background: var(--surface-muted);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.confirm-modal-message {
    margin: 0 0 16px;
    line-height: 1.5;
}
.confirm-modal-message p {
    margin: 0 0 10px;
}
.confirm-modal-message p:last-child {
    margin-bottom: 0;
}
.confirm-modal-choices {
    margin-bottom: 16px;
}
.confirm-modal--danger .confirm-modal-dialog {
    border-color: color-mix(in srgb, var(--danger-border) 40%, var(--border));
}

/* Options builder (inside add-question form) */
.options-builder {
    border-top: 1px solid var(--border);
    margin-top: 12px;
    padding-top: 12px;
}

/* Pending options list (before question is saved) */
.pending-options-list {
    list-style: none;
    margin-bottom: 6px;
}
.pending-option-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 10px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    margin-bottom: 4px;
    font-size: .875rem;
}
.pending-option-item .opt-text { flex: 1; }
.pending-options-empty {
    font-size: .8rem;
    color: var(--text-secondary);
    padding: 4px 0 6px;
    font-style: italic;
}

/* Branch indicator on answer options */
.opt-branch {
    font-size: .75rem;
    font-weight: 600;
    color: var(--badge-branch-fg);
    background: var(--badge-branch-bg);
    padding: 1px 6px;
    border-radius: 4px;
    white-space: nowrap;
}

/* Config section inside question forms */
.config-section {
    border-top: 1px solid var(--border);
    margin-top: 12px;
    padding-top: 12px;
}
.config-section .form-group textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-family: var(--font);
    resize: vertical;
}

/* Condition details toggle */
.condition-details summary {
    list-style: none;
}
.condition-details summary::-webkit-details-marker {
    display: none;
}
.condition-details summary::before {
    content: '\25B6 ';
    font-size: .7rem;
    transition: transform .2s;
    display: inline-block;
    margin-right: 4px;
}
.condition-details[open] summary::before {
    transform: rotate(90deg);
}

/* ── Translations page ── */
.trans-page { padding: 20px 24px; }
.trans-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 16px 24px;
    margin-bottom: 16px;
}
.trans-control {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
    min-width: 200px;
    max-width: 360px;
    font-size: .85rem;
    color: var(--text-secondary);
}
.trans-control span { font-weight: 500; }
.trans-select {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: .9rem;
    font-family: var(--font);
    background: var(--surface);
}
.trans-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--focus-ring);
}
.trans-type-select { width: auto; min-width: 140px; flex-shrink: 0; }
.trans-lang-panel {
    margin-bottom: 16px;
    padding: 12px 14px;
    background: var(--surface-muted);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}
.trans-lang-panel summary {
    cursor: pointer;
    font-weight: 600;
    font-size: .9rem;
    color: var(--text);
    user-select: none;
}
.trans-lang-panel[open] summary { margin-bottom: 12px; }
.trans-lang-panel .lang-chips { margin-bottom: 10px; }
.trans-hint { padding: 24px 0; text-align: center; font-size: .9rem; }
.text-muted { color: var(--text-secondary); }
.required-mark { color: var(--danger); font-weight: 600; }
.trans-sheet {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 420px);
    overflow: hidden;
}
.trans-sheet-body {
    overflow-y: auto;
    flex: 1 1 auto;
    min-height: 0;
}
.trans-sheet .trans-list-header {
    flex-shrink: 0;
    border: none;
    border-bottom: 1px solid var(--border);
    border-radius: 0;
    margin: 0;
}
.trans-list-header {
    display: grid;
    grid-template-columns: minmax(140px, 1.1fr) 1fr 1fr;
    gap: 12px;
    padding: 8px 14px;
    font-size: .75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--text-secondary);
    background: var(--table-header-bg);
}
.trans-list-header-sticky {
    position: sticky;
    top: 0;
    z-index: 2;
    box-shadow: 0 1px 0 var(--border);
}
.trans-top-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px 20px;
    margin-bottom: 12px;
    padding: 12px 14px;
    background: var(--surface-muted);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}
.trans-top-stats {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 20px;
    font-size: .88rem;
    color: var(--text-secondary);
}
.trans-top-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}
.trans-save-status {
    font-size: .82rem;
    color: var(--text-secondary);
}
.trans-save-status[data-state="saving"] { color: var(--primary); }
.trans-save-status[data-state="error"] { color: var(--danger); }
.trans-toolbar-field {
    min-width: 180px;
    max-width: 280px;
    margin: 0;
}
.trans-empty-hint { margin-top: 12px; }
.trans-qn-block {
    margin-bottom: 28px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}
.trans-qn-block:last-child { border-bottom: none; margin-bottom: 0; }
.trans-qn-hidden { display: none !important; }
.trans-qn-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text);
    margin: 0 0 14px;
}
.trans-group {
    margin-bottom: 18px;
}
.trans-group-hidden { display: none !important; }
.trans-group-title {
    font-size: .8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--text-secondary);
    margin: 0 0 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border);
}
.trans-groups-flat { display: block; }
.trans-group-rows { display: block; }
.trans-scope-block .trans-group-details:first-child { border-top: none; }
.trans-group-details {
    border: none;
    border-top: 1px solid var(--border);
    border-radius: 0;
    margin: 0;
    background: transparent;
}
.trans-group-details.trans-group-hidden { display: none !important; }
.trans-group-summary {
    cursor: pointer;
    font-weight: 600;
    font-size: .8rem;
    padding: 10px 14px;
    list-style: none;
    user-select: none;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: .04em;
    background: var(--surface-muted);
}
.trans-group-summary::-webkit-details-marker { display: none; }
.trans-group-summary::before {
    content: '▸ ';
    color: var(--text-secondary);
}
.trans-group-details[open] > .trans-group-summary::before {
    content: '▾ ';
}
.trans-qn-section {
    border: none;
    border-top: 1px solid var(--border);
    border-radius: 0;
    margin: 0;
    background: transparent;
}
.trans-qn-section.trans-qn-hidden { display: none !important; }
.trans-qn-section:first-child { border-top: none; }
.trans-qn-summary {
    cursor: pointer;
    font-weight: 600;
    font-size: .92rem;
    padding: 12px 14px;
    list-style: none;
    user-select: none;
    color: var(--text);
    background: var(--surface-muted);
}
.trans-qn-summary::-webkit-details-marker { display: none; }
.trans-qn-summary::before {
    content: '▸ ';
    color: var(--text-secondary);
}
.trans-qn-section[open] > .trans-qn-summary::before {
    content: '▾ ';
}
.trans-sheet-body-stack .trans-group-summary {
    font-size: .78rem;
    padding: 8px 14px 8px 22px;
    background: transparent;
}
.trans-list {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}
.trans-list-item {
    display: grid;
    grid-template-columns: minmax(140px, 1.1fr) 1fr 1fr;
    gap: 12px;
    align-items: center;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
}
.trans-key-labels {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.trans-key-primary {
    font-size: .88rem;
    font-weight: 500;
    color: var(--text);
    line-height: 1.35;
    overflow: hidden;
    text-overflow: ellipsis;
}
.trans-key-secondary {
    font-size: .72rem;
    font-family: var(--font-mono, ui-monospace, monospace);
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.trans-sheet-body > .trans-scope-block .trans-group-details:last-child .trans-list-item:last-child,
.trans-sheet-body > .trans-groups-flat .trans-group-details:last-child .trans-list-item:last-child {
    border-bottom: none;
}
.trans-list-item:nth-child(even) {
    background: var(--table-stripe-bg);
}
.trans-list-item:hover { background: var(--row-hover-bg); }
.trans-list-item-missing {
    background: var(--trans-missing-bg);
    box-shadow: inset 3px 0 0 var(--trans-missing-accent);
}
.trans-list-item-missing:hover { background: var(--trans-missing-bg-hover); }
.trans-list-key {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    min-width: 0;
}
.trans-key-text {
    font-family: monospace;
    font-size: .8rem;
    line-height: 1.35;
    color: var(--text-secondary);
    word-break: break-word;
}
.trans-list-source {
    min-width: 0;
}
.trans-source-text {
    display: block;
    font-size: .9rem;
    line-height: 1.4;
    color: var(--text);
    word-break: break-word;
}
.lang-chip-fixed {
    background: var(--lang-chip-fixed-bg);
    border-color: var(--lang-chip-fixed-border);
}
.trans-list-item .trans-cell-input {
    border: 1px solid var(--border);
    background: var(--surface);
    border-radius: 6px;
    padding: 8px 10px;
}
.trans-input-missing {
    border-color: var(--trans-missing-border) !important;
    background: var(--surface) !important;
    box-shadow: inset 0 0 0 1px rgba(217, 119, 6, 0.18);
}
.trans-input-missing::placeholder {
    color: var(--trans-missing-placeholder);
    font-style: normal;
}

@media (max-width: 768px) {
    .trans-list-header,
    .trans-list-item {
        grid-template-columns: 1fr;
        gap: 6px;
    }
    .trans-list-header { display: none; }
    .trans-list-item .trans-list-key::before {
        content: 'Label';
        display: block;
        font-size: .7rem;
        font-weight: 600;
        text-transform: uppercase;
        color: var(--text-secondary);
        margin-bottom: 2px;
    }
    .trans-list-item .trans-list-source::before {
        content: 'German';
        display: block;
        font-size: .7rem;
        font-weight: 600;
        text-transform: uppercase;
        color: var(--text-secondary);
        margin-bottom: 2px;
    }
    .trans-list-item .trans-cell-input[data-field="translation"] {
        margin-top: 4px;
    }
}

/* ── Language manager ── */
.lang-manager {
    background: var(--surface-muted);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 14px 16px;
    margin-bottom: 20px;
}
.lang-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}
.lang-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 4px 10px 4px 12px;
    font-size: .85rem;
}
.lang-chip strong { color: var(--primary); }
.lang-chip-name { color: var(--text-secondary); }
.lang-chip-remove {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0 2px;
    line-height: 1;
}
.lang-chip-remove:hover { color: var(--danger); }
.lang-add-row {
    display: flex;
    gap: 8px;
    align-items: center;
}
.lang-add-code {
    width: 80px;
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: .85rem;
}
.lang-add-name {
    width: 160px;
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: .85rem;
}

/* ── Translations toolbar ── */
.trans-toolbar {
    display: flex;
    gap: 16px;
    align-items: center;
    margin-bottom: 14px;
    flex-wrap: wrap;
}
.trans-search-wrap { flex: 1; min-width: 200px; }
.trans-search-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: .9rem;
    font-family: var(--font);
}
.trans-search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--focus-ring);
}
.trans-filter-types {
    display: flex;
    gap: 12px;
    flex-shrink: 0;
}

/* ── Translations table ── */
.trans-table-wrapper {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}
.trans-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .875rem;
}
.trans-table th {
    position: sticky;
    top: 0;
    background: var(--table-header-bg);
    font-weight: 600;
    text-align: left;
    padding: 8px 10px;
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
    z-index: 1;
}
.trans-table td { padding: 2px 4px; }
.trans-table tbody tr { border-bottom: 1px solid var(--border); }
.trans-table tbody tr:nth-child(even) {
    background: var(--table-stripe-bg);
}
.trans-table tbody tr:hover { background: var(--row-hover-bg); }
.trans-row-hidden { display: none !important; }
#tabContent-translations .trans-list,
#tabContent-translations .trans-list-header {
    margin-top: 0;
}

.col-key { min-width: 180px; }
.col-type { width: 50px; text-align: center; }
.col-lang { min-width: 160px; }

.cell-key {
    font-family: monospace;
    font-size: .82rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 280px;
    padding: 6px 10px !important;
}
.cell-type { text-align: center; padding: 6px 4px !important; }

.trans-type-badge {
    display: inline-block;
    font-size: .7rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: .3px;
}
.badge-q   { background: var(--badge-q-bg); color: var(--badge-q-fg); }
.badge-opt { background: var(--badge-opt-bg); color: var(--badge-opt-fg); }
.badge-app { background: var(--badge-app-bg); color: var(--badge-app-fg); }
.badge-str { background: var(--badge-str-bg); color: var(--badge-str-fg); }

.cell-trans { position: relative; }
.cell-missing { background: var(--trans-missing-bg); }

.trans-cell-input {
    width: 100%;
    padding: 5px 8px;
    border: 1px solid transparent;
    border-radius: 4px;
    font-size: .85rem;
    font-family: var(--font);
    background: transparent;
    transition: border-color .15s, background .15s;
}
.trans-cell-input:hover {
    border-color: var(--border);
    background: var(--surface);
}
.trans-cell-input:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--surface);
    box-shadow: 0 0 0 2px var(--focus-ring);
}
.trans-cell-input::placeholder {
    color: var(--trans-missing-placeholder);
    font-style: normal;
    font-size: .8rem;
}
.trans-cell-input:not(.trans-input-missing)::placeholder {
    color: var(--text-secondary);
}
.trans-cell-input.save-flash {
    animation: saveFlash .4s ease;
}
@keyframes saveFlash {
    0%   { background: var(--save-flash-bg); }
    100% { background: var(--surface); }
}
.trans-list-item .trans-cell-input.save-flash {
    animation: saveFlash .4s ease;
}

/* ── Stats bar ── */
.trans-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
    font-size: .82rem;
    color: var(--text-secondary);
}
.trans-stats-progress {
    display: flex;
    align-items: center;
    gap: 8px;
}
.trans-progress-bar {
    width: 120px;
    height: 6px;
    background: var(--progress-track);
    border-radius: 3px;
    overflow: hidden;
}
.trans-progress-fill {
    display: block;
    height: 100%;
    background: var(--success);
    border-radius: 3px;
    transition: width .3s ease;
}

.field-hint {
    display: block;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 4px;
}
.field-hint code {
    font-size: 0.75rem;
}

.badge-warn {
    background: var(--badge-warn-bg);
    color: var(--badge-warn-fg);
}

.opt-key {
    font-size: 0.75rem;
    margin-right: 8px;
    color: var(--text-secondary);
}

/* Callouts */
.callout-warn {
    margin-bottom: 16px;
    padding: 12px;
    background: var(--badge-warn-bg);
    border-radius: 8px;
    color: var(--badge-warn-fg);
}
.callout-danger {
    margin-bottom: 12px;
    padding: 12px;
    background: var(--toast-error-bg);
    border-radius: 8px;
    color: var(--toast-error-fg);
}
.insights-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
}
.page-header-sub {
    margin: 6px 0 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: normal;
}
.home-kpi-link {
    text-decoration: none;
    color: inherit;
    position: relative;
    overflow: hidden;
    transition: border-color 0.2s, background 0.2s, transform 0.2s, box-shadow 0.2s;
}
.home-kpi-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--accent-gradient);
    opacity: 0.75;
}
.home-kpi-link:hover {
    border-color: var(--primary-border);
    background: var(--surface-hover);
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg), var(--accent-glow);
}
.home-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}
.home-link-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
}
.home-link-card {
    display: block;
    position: relative;
    padding: 14px 36px 14px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface-muted);
    text-decoration: none;
    color: inherit;
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s, transform 0.2s;
    box-shadow: var(--shadow), var(--shadow-inset);
}
.home-link-card::after {
    content: '→';
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1rem;
    color: var(--primary-text);
    opacity: 0.35;
    transition: transform 0.2s, opacity 0.2s;
}
.home-link-card:hover {
    border-color: var(--primary-border);
    background: var(--surface-hover);
    box-shadow: var(--shadow-lg), 0 0 0 1px var(--primary-border);
    transform: translateX(2px);
}
.home-link-card:hover::after {
    opacity: 1;
    transform: translateY(-50%) translateX(3px);
}
.home-link-title {
    display: block;
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 4px;
}
.home-link-desc {
    display: block;
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.35;
}
.insights-kpi {
    padding: 20px;
    text-align: center;
}
.insights-kpi-value {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.03em;
    background: linear-gradient(160deg, var(--text) 20%, var(--primary-text) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.insights-kpi-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 6px;
}
.insights-charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
    margin-top: 20px;
}
.insights-chart-card h3 {
    margin: 0 0 4px;
    font-size: 1rem;
    letter-spacing: -0.01em;
}
body.logged-in .insights-chart-card.card {
    transition: border-color 0.2s, box-shadow 0.2s;
}
body.logged-in .insights-chart-card.card:hover {
    border-color: var(--primary-border);
    box-shadow: var(--shadow-lg), 0 0 16px rgba(15, 118, 110, 0.06);
}
.insights-chart-hint {
    margin: 0 0 14px;
    font-size: 0.82rem;
    color: var(--text-secondary);
}
.insights-vchart {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    height: 160px;
    padding: 8px 4px 0;
    border-bottom: 1px solid var(--border);
}
.insights-vchart-col {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
}
.insights-vchart-bar-wrap {
    flex: 1;
    width: 100%;
    max-width: 36px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}
.insights-vchart-bar {
    width: 100%;
    min-height: 2px;
    border-radius: 4px 4px 0 0;
    background: linear-gradient(180deg, var(--primary-hover), var(--primary));
    transition: height 0.2s ease;
}
.insights-vchart-value {
    font-size: 0.7rem;
    color: var(--text-secondary);
    margin-top: 4px;
    line-height: 1;
}
.insights-vchart-label {
    font-size: 0.65rem;
    color: var(--text-secondary);
    margin-top: 2px;
    text-align: center;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.insights-hchart {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 16px;
}
.insights-hchart-row {
    display: grid;
    grid-template-columns: minmax(100px, 28%) 1fr minmax(40px, auto);
    gap: 10px;
    align-items: center;
    font-size: 0.85rem;
}
.insights-hchart-label {
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.insights-hchart-track {
    height: 22px;
    background: var(--surface-muted);
    border-radius: 4px;
    overflow: hidden;
}
.insights-hchart-fill {
    height: 100%;
    min-width: 2px;
    border-radius: 4px;
    background: linear-gradient(90deg, var(--primary), var(--primary-hover));
}
.insights-hchart-fill--warn {
    background: linear-gradient(90deg, #d97706, var(--warning));
}
.insights-hchart-fill--muted {
    background: var(--border);
}
.insights-hchart-num {
    text-align: right;
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
}
.followup-note-input {
    width: 100%;
    min-width: 180px;
    max-width: 320px;
    font-family: inherit;
    font-size: 0.85rem;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface);
    color: var(--text);
    resize: vertical;
}
.export-actions-cell {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}
.export-actions-cell .btn {
    margin: 0;
}
.coach-recent-panel {
    padding: 12px 8px 8px 32px;
    background: var(--surface-muted);
    border-radius: 8px;
    margin: 4px 0 8px;
}
.coach-recent-scroll {
    max-height: min(420px, 55vh);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.coach-recent-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 16px;
    margin-bottom: 10px;
    flex-shrink: 0;
}
.coach-recent-toolbar .filter-search {
    flex: 1;
    min-width: 180px;
    max-width: 320px;
}
.coach-client-groups {
    flex: 1;
    overflow-y: auto;
    padding-right: 4px;
    margin-bottom: 8px;
}
.coach-client-group {
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 8px;
    background: var(--surface);
    overflow: hidden;
}
.coach-client-toggle {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 10px;
    width: 100%;
    text-align: left;
    padding: 10px 12px !important;
    justify-content: flex-start;
}
.coach-client-meta {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: normal;
}
.coach-client-uploads {
    padding: 0 12px 12px 32px;
    border-top: 1px solid var(--border);
}
.coach-recent-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    flex-shrink: 0;
    padding-top: 4px;
    border-top: 1px solid var(--border);
}
.data-table-compact td,
.data-table-compact th {
    padding: 8px 10px;
    font-size: 0.85rem;
}
.btn-link {
    background: none;
    border: none;
    padding: 0 6px 0 0;
    color: var(--accent);
    cursor: pointer;
    min-width: auto;
}
.coach-detail-row td {
    border-top: none;
    padding-top: 0;
}
.clients-list-filters {
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.clients-archive-filter {
    flex: 0 0 auto;
    min-width: 120px;
}

.client-actions-cell {
    width: 1%;
    white-space: nowrap;
    vertical-align: middle;
}

.table-row-actions {
    display: inline-flex;
    align-items: stretch;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    background: var(--surface-muted);
}

.table-row-actions .btn {
    border: none;
    border-radius: 0;
    box-shadow: none;
    margin: 0;
    min-height: 30px;
}

.table-row-actions .btn:hover {
    box-shadow: none;
}

.table-row-actions .btn + .btn {
    border-left: 1px solid var(--border);
}

.table-row-actions .archive-client-btn,
.table-row-actions .restore-client-btn {
    background: var(--surface);
    color: var(--text-secondary);
}

.table-row-actions .archive-client-btn:hover,
.table-row-actions .restore-client-btn:hover {
    background: var(--surface-hover);
    color: var(--text);
}

.table-row-actions .delete-client-btn {
    padding-left: 12px;
    padding-right: 12px;
}

.followup-note-cell {
    min-width: 200px;
}

.followup-note-cell .followup-note-input {
    width: 100%;
    margin-bottom: 8px;
}

.followup-note-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    justify-content: space-between;
}

.followup-actions-cell {
    width: 1%;
    white-space: nowrap;
    vertical-align: middle;
}

.client-row-archived td {
    color: var(--text-secondary);
}

.client-archived-badge {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 7px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-secondary);
    background: var(--surface-raised);
    border: 1px solid var(--border);
    vertical-align: middle;
}

.client-detail-panel {
    padding: 12px 8px 8px 32px;
    background: var(--surface-muted);
    border-radius: 8px;
    margin: 4px 0 8px;
}
.client-detail-meta {
    margin: 0 0 12px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}
.client-qn-panel {
    padding: 10px 8px 10px 28px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-top: 8px;
}
.client-version-panel {
    padding: 8px 8px 8px 28px;
    margin-top: 8px;
    border-left: 3px solid var(--primary-border);
}
.client-detail-row td {
    border-top: none;
    padding-top: 0;
}
tr.answer-changed td {
    background: rgba(251, 191, 36, 0.1);
}
tr.answer-changed .answer-value-cell {
    font-weight: 600;
    color: var(--badge-warn-fg);
}
.client-qn-summary {
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin-left: 8px;
}

input:disabled,
select:disabled {
    background: var(--surface-muted);
    color: var(--text-secondary);
    cursor: not-allowed;
}

/* Questionnaire availability condition editor */
.condition-editor {
    padding: 16px;
    background: var(--surface-muted);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow), var(--shadow-inset);
}
.condition-mode-panel {
    margin-top: 12px;
}
.condition-requires-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 200px;
    overflow-y: auto;
    padding: 8px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
}
.condition-requires-item {
    margin: 0;
}
.condition-answer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}
.condition-answer-grid select,
.condition-editor .form-group > select {
    width: 100%;
}
.condition-anyof-rule {
    margin-bottom: 12px;
    padding: 12px;
}
.condition-json-fallback {
    width: 100%;
    font-family: ui-monospace, monospace;
    font-size: 0.85rem;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface);
    color: var(--text);
}
.condition-locked-message .meta-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
@media (max-width: 720px) {
    .condition-locked-message .meta-form {
        grid-template-columns: 1fr;
    }
}

/* Questionnaire preview tab (all-in-one) */
.qp-shell {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.qp-banner {
    padding: 10px 14px;
    background: var(--primary-subtle);
    border: 1px solid var(--primary-border);
    border-radius: var(--radius);
    font-size: .875rem;
    color: var(--primary-text);
}
.qp-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.qp-visible-count {
    font-size: .875rem;
    color: var(--text-secondary);
}
.qp-scroll {
    padding: 0;
    max-height: min(75vh, 900px);
    overflow-y: auto;
}
.qp-form {
    display: flex;
    flex-direction: column;
}
.qp-section {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}
.qp-section:last-child {
    border-bottom: none;
}
.qp-section[hidden] {
    display: none !important;
}
.qp-section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}
.qp-section-num {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--primary-subtle);
    color: var(--primary-text);
    font-size: .8rem;
    font-weight: 600;
    flex-shrink: 0;
}
.qp-section-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    font-size: .8rem;
    color: var(--text-secondary);
}
.qp-id {
    font-size: .8rem;
    padding: 2px 6px;
    background: var(--surface-muted);
    border-radius: 4px;
}
.qp-type {
    font-size: .8rem;
}
.qp-question-text {
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 14px;
    line-height: 1.45;
}
.qp-note {
    font-size: .875rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
    padding: 8px 12px;
    background: var(--surface-muted);
    border-radius: 6px;
}
.qp-note-after { margin-top: 12px; margin-bottom: 0; }
.qp-hint {
    font-size: .85rem;
    color: var(--text-secondary);
    margin-top: 8px;
}
.qp-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.qp-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    transition: border-color .15s, background .15s;
}
.qp-option:hover {
    border-color: var(--primary-border);
    background: var(--surface-muted);
}
.qp-option input { flex-shrink: 0; }
.qp-select {
    width: 100%;
    max-width: 320px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: .9rem;
    background: var(--surface);
    color: var(--text);
}
.qp-select-sm { max-width: 140px; }
.qp-date-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.qp-text-input {
    width: 100%;
    max-width: 480px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: .9rem;
    background: var(--surface);
    color: var(--text);
}
.qp-slider {
    display: flex;
    align-items: center;
    gap: 16px;
}
.qp-slider input[type=range] { flex: 1; max-width: 400px; }
.qp-slider-value {
    min-width: 3rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}
.qp-form-stack {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 360px;
}
.qp-form-stack label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: .875rem;
    font-weight: 500;
}
.qp-form-stack input {
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: .9rem;
    background: var(--surface);
    color: var(--text);
}
.qp-review-note {
    margin-bottom: 4px;
}
.qp-review-codes .qp-readonly-field {
    background: var(--bg, #f4f4f5);
    color: var(--text-secondary);
    cursor: default;
    border-style: dashed;
    user-select: all;
}
.qp-glass-table {
    overflow-x: auto;
    margin-top: 8px;
}
.qp-glass-table table {
    width: 100%;
    border-collapse: collapse;
    font-size: .85rem;
}
.qp-glass-table th,
.qp-glass-table td {
    border: 1px solid var(--border);
    padding: 8px 10px;
    text-align: center;
}
.qp-glass-table th:first-child,
.qp-glass-table td:first-child {
    text-align: left;
    font-weight: 500;
}
.qp-empty {
    padding: 40px 20px;
    text-align: center;
    color: var(--text-secondary);
}

/* Glass-scale symptom rows in editor */
.glass-symptoms-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.glass-symptom-row {
    padding: 10px 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
}
.glass-symptoms-empty {
    padding: 12px;
    color: var(--text-secondary);
    font-size: .85rem;
    font-style: italic;
}
.glass-score-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed var(--border);
}
.glass-score-cell label {
    display: block;
    font-size: .7rem;
    color: var(--text-secondary);
    margin-bottom: 2px;
}
.glass-score-cell input {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid var(--border);
    border-radius: 4px;
}
.value-score-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
    max-height: 200px;
    overflow-y: auto;
}
.value-score-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: .85rem;
}
.value-score-label {
    min-width: 2rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}
.value-score-pts {
    width: 4rem;
    padding: 4px 6px;
    border: 1px solid var(--border);
    border-radius: 4px;
}

.modal-dialog-wide {
    max-width: 640px;
}

/* Scoring profiles on questionnaire dashboard */
#scoringProfilesPanel {
    width: 100%;
    margin-top: 28px;
}
.scoring-profiles-section {
    margin-top: 0;
}
.scoring-profiles-card {
    padding: 24px;
}
.scoring-section-title {
    margin: 0 0 6px;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text);
}
.scoring-section-desc,
.scoring-empty-hint {
    margin: 0;
    font-size: .875rem;
    line-height: 1.5;
    color: var(--text-secondary);
}
.scoring-empty-hint {
    padding: 8px 0;
}
.scoring-profiles-list {
    margin-top: 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.scoring-profile-card {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px 18px;
    background: var(--surface-muted);
    color: var(--text);
    box-shadow: var(--shadow), var(--shadow-inset);
}
.scoring-profile-card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
}
.scoring-profile-card-main {
    min-width: 0;
    flex: 1;
}
.scoring-profile-name-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}
.scoring-profile-name-row strong {
    font-size: 1rem;
    color: var(--text);
}
.scoring-profile-desc {
    margin: 0 0 8px;
    font-size: .875rem;
    line-height: 1.45;
    color: var(--text-secondary);
}
.scoring-profile-bands {
    margin: 0;
    font-size: .85rem;
    color: var(--primary-text);
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}
.scoring-profile-member-count {
    margin: 12px 0 8px;
    font-size: .8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--text-secondary);
}
.scoring-profile-members {
    border-top: 1px solid var(--border);
    padding-top: 4px;
}
.scoring-profile-card-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}
.scoring-profile-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}
.scoring-modal-section-title {
    margin: 18px 0 0;
    font-size: .95rem;
    color: var(--text);
}
.scoring-profile-active-row {
    margin-bottom: 12px;
}
.checkbox-inline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: .9rem;
    color: var(--text);
    cursor: pointer;
}
.scoring-profile-picker {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 12px;
    background: var(--surface-muted);
    box-shadow: var(--shadow), var(--shadow-inset);
}
.scoring-profile-picker input,
.scoring-profile-picker select {
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: .875rem;
    font-family: var(--font);
    background: var(--surface);
    color: var(--text);
}
.scoring-profile-picker input:focus,
.scoring-profile-picker select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--focus-ring);
}
.scoring-profile-add-row {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
}
.scoring-profile-add-row select {
    flex: 1;
    min-width: 0;
}
.scoring-band-labels {
    margin: 4px 0 8px;
    min-height: 1.5rem;
}
.scoring-band-ranges-table {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 8px;
}
.scoring-band-range-row {
    display: grid;
    grid-template-columns: 100px 1fr 1fr;
    gap: 10px;
    align-items: center;
}
.scoring-band-range-row.scoring-band-range-header {
    font-size: .75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--text-secondary);
    padding-bottom: 4px;
    border-bottom: 1px solid var(--border);
}
.scoring-band-range-row input {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: .875rem;
    font-family: var(--font);
    background: var(--surface);
    color: var(--text);
}
.scoring-band-range-row input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--focus-ring);
}
.scoring-band-max-placeholder {
    color: var(--text-secondary);
    font-size: 1.1rem;
    padding: 8px 10px;
}
.scoring-band-strips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.scoring-profile-q-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    color: var(--text);
}
.scoring-profile-q-row:last-child { border-bottom: none; }
.scoring-profile-q-name {
    flex: 1;
    min-width: 120px;
    font-weight: 500;
    color: var(--text);
}
.scoring-profile-q-weight {
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
}
.scoring-profile-q-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: flex-end;
}
.sp-weight-wrap {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: .8rem;
    color: var(--text-secondary);
}
.sp-weight-wrap input {
    width: 72px;
}
.band-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: .75rem;
    font-weight: 600;
    letter-spacing: .02em;
}
.band-badge.band-green { background: #edf8f2; color: #1b5e20; border: 1px solid #b8dfc8; }
.band-badge.band-yellow { background: #fff6e7; color: #6a4a00; border: 1px solid #f5d08a; }
.band-badge.band-red { background: #fdeeee; color: #b71c1c; border: 1px solid #f5b4b8; }
.band-badge.band-none { background: #eef8f5; color: #4f5f5c; border: 1px solid #cfe1dd; }

/* Client list — scoring profiles */
.client-scoring-legend {
    margin: 0 0 14px;
    padding: 12px 14px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--surface-elevated);
}
.client-scoring-legend-title {
    margin: 0 0 6px;
}
.client-scoring-legend-body {
    margin: 0 0 10px;
    line-height: 1.45;
}
.client-scoring-legend-body .band-badge {
    margin: 0 2px;
    vertical-align: middle;
}
.client-scoring-legend-dl {
    display: grid;
    gap: 8px 16px;
    margin: 0;
    font-size: .8125rem;
}
@media (min-width: 640px) {
    .client-scoring-legend-dl {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}
.client-scoring-legend-dl dt {
    font-weight: 600;
    color: var(--text);
    margin: 0;
}
.client-scoring-legend-dl dd {
    margin: 2px 0 0;
    color: var(--text-secondary);
    line-height: 1.4;
}
.client-profile-scores {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
}
.client-profile-score-block {
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--surface-elevated);
    font-size: .8125rem;
    line-height: 1.35;
}
.client-profile-score-block.is-incomplete {
    opacity: 0.85;
}
.client-profile-score-block.has-coach-override {
    border-color: rgba(251, 191, 36, 0.45);
}
.client-profile-score-block-title {
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
}
.client-profile-score-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px 8px;
    margin-top: 4px;
}
.client-profile-score-row:first-of-type {
    margin-top: 0;
}
.client-profile-score-label {
    flex: 0 0 4.75rem;
    color: var(--text-secondary);
    font-size: .75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .03em;
}
.client-profile-score-total {
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
    font-size: .75rem;
}
.client-profile-score-total::before {
    content: "total ";
    opacity: 0.75;
}
.client-profile-override-hint {
    font-size: .7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #ca8a04;
}

/* Coach category picker (clients list) */
.coach-band-picker {
    position: relative;
    display: inline-flex;
    max-width: 100%;
}
.coach-band-trigger {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 6px 2px 4px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    color: inherit;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
    max-width: 100%;
}
.coach-band-trigger:hover {
    border-color: color-mix(in srgb, var(--primary) 45%, var(--border));
    background: var(--surface-hover);
}
.coach-band-picker.is-open .coach-band-trigger,
.coach-band-trigger:focus-visible {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 22%, transparent);
}
.coach-band-trigger-badge .band-badge {
    margin: 0;
}
.coach-band-trigger-caret {
    font-size: .65rem;
    color: var(--text-secondary);
    line-height: 1;
    flex-shrink: 0;
}
.coach-band-picker.is-saving .coach-band-trigger {
    opacity: 0.6;
    pointer-events: none;
}
.coach-band-menu {
    min-width: 11.5rem;
    padding: 10px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--surface);
    box-shadow: var(--shadow-lg);
}
.coach-band-menu-label {
    margin: 0 0 8px;
    font-size: .7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--text-secondary);
}
.coach-band-menu-options {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.coach-band-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    padding: 8px 10px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: inherit;
    cursor: pointer;
    text-align: left;
    transition: background 0.12s, border-color 0.12s;
}
.coach-band-option:hover {
    background: var(--surface-hover);
}
.coach-band-option.is-selected {
    border-color: color-mix(in srgb, var(--primary) 35%, var(--border));
    background: color-mix(in srgb, var(--primary) 8%, var(--surface));
}
.coach-band-option-agree {
    margin-top: 6px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
    border-radius: 0 0 8px 8px;
}
.coach-band-option-agree-label {
    font-size: .75rem;
    font-weight: 600;
    color: var(--text-secondary);
}
.coach-band-confirm-compare {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px 16px;
    margin: 8px 0 4px;
    padding: 16px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--surface-elevated);
}
.coach-band-confirm-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    min-width: 5.5rem;
}
.coach-band-confirm-label {
    font-size: .7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--text-secondary);
}
.coach-band-confirm-arrow {
    font-size: 1.25rem;
    color: var(--text-secondary);
    line-height: 1;
}
.client-profile-score-hint,
.client-profile-score-meta {
    margin: 6px 0 0;
    font-size: .75rem;
    color: var(--text-secondary);
    line-height: 1.4;
}
.client-scoring-profiles-detail {
    margin-bottom: 12px;
}
.scoring-profile-detail-card {
    margin-top: 8px;
}
.client-profile-dots-cell {
    min-width: 200px;
    max-width: 320px;
    vertical-align: top;
}
.client-profile-dots-empty {
    color: var(--text-secondary);
}
