/* ============================================================
   AdaptIQ — Adaptive Intelligent Tutoring System · style.css
   Dark theme + high-contrast light theme, fully responsive.
   Tokens drive both themes; every surface is a variable so the
   IEEE high-contrast mode stays legible in print and projection.
   ============================================================ */

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

:root {
    --bg-base:          #0d0f14;
    --bg-surface:       rgba(255,255,255,0.04);
    --bg-surface-hover: rgba(255,255,255,0.07);
    --border-subtle:    rgba(255,255,255,0.08);
    --border-bright:    rgba(255,255,255,0.16);
    --text-primary:     #e8eaed;
    --text-muted:       rgba(232,234,237,0.65);
    --accent-blue:      #8ab4f8;
    --accent-purple:    #c58af9;
    --accent-green:     #81c995;
    --accent-warn:      #fdd663;
    --accent-danger:    #ff8a80;
    --sidebar-bg:       #0a0c10;
    --input-bg:         rgba(255,255,255,0.05);
    --panel-bg:         #12151c;
    --bubble-bot-bg:    rgba(255,255,255,0.065);
    --bubble-bot-border:rgba(255,255,255,0.12);
    --bubble-user-bg:   rgba(138,180,248,0.14);
    --bubble-user-border:rgba(138,180,248,0.30);
    --track-bg:         rgba(255,255,255,0.10);
    --tag-bg:           rgba(138,180,248,0.10);
    --tag-border:       rgba(138,180,248,0.20);
    --chip-bg:          rgba(197,138,249,0.08);
    --chip-border:      rgba(197,138,249,0.22);
    --chip-hover-bg:    rgba(197,138,249,0.16);
    --chip-hover-border:rgba(197,138,249,0.40);
    --code-bg:          rgba(255,255,255,0.09);
    --scroll-thumb:     rgba(255,255,255,0.16);
    --on-accent:        #0d0f14;
    --card-shadow:      none;
    --panel-shadow:     0 24px 60px rgba(0,0,0,0.5);
    --overlay-bg:       rgba(6,8,12,0.62);
    --radius-card:      14px;
    --radius-sm:        10px;
    --radius-pill:      999px;
    --sidebar-w:        232px;
    --top-bar-h:        54px;
}

/* ════════════════════════════════════════
   HIGH-CONTRAST LIGHT THEME
   Applied by the theme toggle as <html class="light-theme">.
   Tuned for IEEE camera-ready figures and projector contrast:
   #1a1a1b text on white card surfaces with crisp, printable borders.
   ════════════════════════════════════════ */
html.light-theme {
    color-scheme: light;
    --bg-base:           #eef1f7;
    --bg-surface:        #ffffff;
    --bg-surface-hover:  #f2f5fa;
    --border-subtle:     #ccd4e0;
    --border-bright:     #9aa8bd;
    --text-primary:      #1a1a1b;
    --text-muted:        #4a5160;
    --accent-blue:       #1257b8;
    --accent-purple:     #6a2fb0;
    --accent-green:      #16653a;
    --accent-warn:       #8a5300;
    --accent-danger:     #b3261e;
    --sidebar-bg:        #ffffff;
    --input-bg:          #ffffff;
    --panel-bg:          #ffffff;
    --bubble-bot-bg:     #ffffff;
    --bubble-bot-border: #cfd7e3;
    --bubble-user-bg:    #dfe9fb;
    --bubble-user-border:#9fbde8;
    --track-bg:          #dde3ec;
    --tag-bg:            #e7eefb;
    --tag-border:        #b7cdf0;
    --chip-bg:           #f0e9fc;
    --chip-border:       #c9a9ef;
    --chip-hover-bg:     #e6d9f9;
    --chip-hover-border: #a97fe0;
    --code-bg:           #eef2f8;
    --scroll-thumb:      #aab5c6;
    --on-accent:         #ffffff;
    --card-shadow:       0 1px 2px rgba(16,24,40,0.07), 0 1px 3px rgba(16,24,40,0.06);
    --panel-shadow:      0 20px 50px rgba(16,24,40,0.22);
    --overlay-bg:        rgba(24,30,42,0.38);
}

/* An element switched off with [hidden] must not keep a layout display value. */
[hidden] { display: none !important; }

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

body {
    font-family: 'Google Sans', 'Segoe UI', system-ui, sans-serif;
    font-size: 14px;
    line-height: 1.65;
    background: var(--bg-base);
    color: var(--text-primary);
    height: 100vh;
    overflow: hidden;
}

button, input, select, textarea { font-family: inherit; color: inherit; }
button { cursor: pointer; }

/* ── Scrollbars ── */
* { scrollbar-width: thin; scrollbar-color: var(--scroll-thumb) transparent; }
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-thumb { background: var(--scroll-thumb); border-radius: var(--radius-pill); }

/* ── Accessibility ── */
.sr-only {
    position: absolute; width: 1px; height: 1px;
    padding: 0; margin: -1px; overflow: hidden;
    clip: rect(0,0,0,0); border: 0;
}
:focus-visible { outline: 2px solid var(--accent-blue); outline-offset: 2px; }

/* ════════════════════════════════════════
   LAYOUT
   ════════════════════════════════════════ */
.app-container {
    display: flex;
    height: 100vh;
    width: 100%;
}

/* ── Sidebar ── */
.sidebar {
    width: var(--sidebar-w);
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    /* Scroll instead of cropping when the footer makes the column taller. */
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 30;
}

.sidebar-header {
    padding: 22px 18px 16px;
    border-bottom: 1px solid var(--border-subtle);
}

.logo { display: flex; align-items: center; gap: 10px; }
.logo-icon { font-size: 22px; }
.logo-text {
    font-size: 18px;
    font-weight: 500;
    background: linear-gradient(90deg, var(--accent-blue), var(--accent-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-links {
    list-style: none;
    padding: 12px 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 9px 14px;
    font-size: 13.5px;
    text-align: left;
    color: var(--text-muted);
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.nav-item:hover { background: var(--bg-surface-hover); color: var(--text-primary); }
.nav-item.active {
    background: var(--bg-surface-hover);
    color: var(--accent-blue);
    border-color: var(--border-subtle);
}
.nav-icon  { font-size: 16px; }
.nav-label { font-size: 13.5px; }

/* ── Sidebar Progress Panel ── */
.sidebar-progress {
    margin: 12px 14px;
    padding: 14px;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-card);
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 0;
}
.progress-title {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.progress-track {
    height: 6px;
    background: var(--track-bg);
    border-radius: var(--radius-pill);
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    width: 0%;
    border-radius: var(--radius-pill);
    background: linear-gradient(90deg, var(--accent-blue), var(--accent-purple));
    transition: width 0.45s ease;
}
.progress-label { font-size: 11px; color: var(--text-muted); }
.profile-tags { display: flex; flex-direction: column; gap: 5px; margin-top: 4px; }
.profile-tag {
    font-size: 11px;
    padding: 3px 8px;
    border-radius: var(--radius-pill);
    background: var(--tag-bg);
    color: var(--accent-blue);
    border: 1px solid var(--tag-border);
    width: fit-content;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ── Sidebar footer: who this learner is + sync state ── */
.sidebar-footer {
    padding: 14px 16px;
    border-top: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.learner-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-card);
    min-width: 0;
    box-shadow: var(--card-shadow);
}
.avatar-initials {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    font-size: 14px;
    font-weight: 500;
    color: var(--on-accent);
    background: linear-gradient(140deg, var(--accent-blue), var(--accent-purple));
    border: 1px solid var(--border-bright);
}
.learner-meta {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1 1 auto;
    line-height: 1.35;
}
.learner-name {
    font-size: 12.5px;
    color: var(--text-primary);
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.learner-sub {
    font-size: 10.5px;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sync-status {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 11px;
    color: var(--text-muted);
    min-width: 0;
}
.sync-status span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sync-dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
    background: var(--scroll-thumb);
}
.sync-status[data-state="synced"]  .sync-dot { background: var(--accent-green); }
.sync-status[data-state="syncing"] .sync-dot { background: var(--accent-warn); animation: pulse-dot 1.2s infinite; }
.sync-status[data-state="error"]   .sync-dot { background: var(--accent-danger); }
.sync-status[data-state="local"]   .sync-dot { background: var(--accent-blue); }

/* Inline notices (Firestore not configured, request failed, …) */
.notice {
    font-size: 10.5px;
    line-height: 1.5;
    color: var(--accent-warn);
    overflow-wrap: anywhere;
}

/* ── Main Content ── */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    max-width: 860px;
    margin: 0 auto;
    width: 100%;
}

/* ── Top Bar ── */
.top-bar {
    height: var(--top-bar-h);
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 0 28px;
    flex-shrink: 0;
}
.top-bar-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.page-title { font-weight: 500; font-size: 14px; white-space: nowrap; }

.top-bar-actions { display: flex; align-items: center; gap: 10px; min-width: 0; }

/* Scoped to the top bar so it outranks .icon-btn's display, whatever the order. */
.top-bar .nav-toggle { display: none; }

/* Theme toggle + learner-context chip */
.icon-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 11px;
    font-size: 12.5px;
    font-weight: 500;
    line-height: 1;
    color: var(--text-primary);
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-pill);
    flex-shrink: 0;
    transition: background 0.15s, border-color 0.15s;
}
.icon-btn:hover { background: var(--bg-surface-hover); border-color: var(--border-bright); }
.icon-btn svg { width: 15px; height: 15px; display: block; flex-shrink: 0; }
.icon-btn .icon-label {
    max-width: 190px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Show the icon of the theme you would switch TO */
.icon-moon { display: none; }
html.light-theme .icon-sun  { display: none; }
html.light-theme .icon-moon { display: block; }

.status-indicator { display: flex; align-items: center; gap: 7px; min-width: 0; }
.status-text {
    font-size: 12px;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.status-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    background: var(--accent-green);
    animation: pulse-dot 2.5s infinite;
}
.status-dot.busy { background: var(--accent-warn); animation: none; }
@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* ════════════════════════════════════════
   CHAT
   ════════════════════════════════════════ */
.chat-container {
    flex: 1;
    padding: 24px 28px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 14px;
    scroll-behavior: smooth;
}

/* ── Messages ── */
.message {
    max-width: 80%;
    padding: 13px 17px;
    border-radius: var(--radius-card);
    line-height: 1.7;
    font-size: 14px;
    animation: fadeSlide 0.22s ease;
    box-shadow: var(--card-shadow);
    overflow-wrap: anywhere;
}
@keyframes fadeSlide {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.bot-message {
    align-self: flex-start;
    background: var(--bubble-bot-bg);
    border: 1px solid var(--bubble-bot-border);
    border-bottom-left-radius: 4px;
    color: var(--text-primary);
}
.bot-message:hover {
    background: var(--bg-surface-hover);
    border-color: var(--border-bright);
}

.user-message {
    align-self: flex-end;
    background: var(--bubble-user-bg);
    border: 1px solid var(--bubble-user-border);
    border-bottom-right-radius: 4px;
    color: var(--text-primary);
}

.message p { margin-bottom: 8px; }
.message p:last-child { margin-bottom: 0; }

/* Strong inside bot messages */
.bot-message strong { color: var(--accent-blue); font-weight: 500; }

/* Inline code — theme aware (was a hard-coded dark background) */
.msg-code {
    background: var(--code-bg);
    padding: 1px 5px;
    border-radius: 4px;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 12.5px;
}

/* ── Typing Indicator ── */
.typing-indicator {
    align-self: flex-start;
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 12px 16px;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-card);
    border-bottom-left-radius: 4px;
    animation: fadeSlide 0.18s ease;
}
.typing-dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--text-muted);
    animation: typing-bounce 1.2s infinite ease-in-out;
}
.typing-dot:nth-child(2) { animation-delay: 0.18s; }
.typing-dot:nth-child(3) { animation-delay: 0.36s; }
@keyframes typing-bounce {
    0%, 80%, 100% { transform: translateY(0); opacity: 0.5; }
    40%            { transform: translateY(-6px); opacity: 1; }
}

/* ════════════════════════════════════════
   QUICK REPLIES
   ════════════════════════════════════════ */
.quick-replies {
    padding: 0 28px 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    min-height: 0;
}
.quick-btn {
    padding: 6px 14px;
    font-size: 13px;
    background: var(--chip-bg);
    border: 1px solid var(--chip-border);
    border-radius: var(--radius-pill);
    color: var(--accent-purple);
    transition: background 0.15s, border-color 0.15s;
    white-space: nowrap;
}
.quick-btn:hover {
    background: var(--chip-hover-bg);
    border-color: var(--chip-hover-border);
}
.quick-btn:active { transform: scale(0.97); }

/* ════════════════════════════════════════
   INPUT AREA
   ════════════════════════════════════════ */
.chat-input-area {
    padding: 14px 28px 20px;
    border-top: 1px solid var(--border-subtle);
    background: var(--bg-base);
    flex-shrink: 0;
}

.input-wrapper { display: flex; gap: 10px; align-items: flex-end; }

textarea#user-input {
    flex: 1;
    background: var(--input-bg);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    padding: 10px 14px;
    font-size: 14px;
    line-height: 1.5;
    resize: none;
    max-height: 120px;
    overflow-y: auto;
    transition: border-color 0.15s;
}
textarea#user-input:focus { border-color: var(--accent-blue); outline: none; }
textarea#user-input::placeholder { color: var(--text-muted); }

.send-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--accent-blue);
    color: var(--on-accent);
    border: none;
    border-radius: var(--radius-pill);
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    transition: opacity 0.15s, transform 0.12s;
    flex-shrink: 0;
    height: 42px;
}
.send-btn:hover:not(:disabled) { opacity: 0.88; transform: scale(1.02); }
.send-btn:active:not(:disabled) { transform: scale(0.97); }
.send-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.btn-icon { font-size: 13px; }
.btn-label { font-size: 14px; }

.input-footer {
    display: flex;
    justify-content: space-between;
    margin-top: 6px;
    font-size: 11px;
    color: var(--text-muted);
}
.input-hint, .char-count { font-size: 11px; color: var(--text-muted); }
.char-count.warn { color: var(--accent-warn); }

/* ════════════════════════════════════════
   PANELS (Learner context · Settings)
   ════════════════════════════════════════ */
.panel-overlay {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: var(--overlay-bg);
    backdrop-filter: blur(3px);
}

.panel {
    width: min(560px, 100%);
    max-height: min(86vh, 780px);
    display: flex;
    flex-direction: column;
    background: var(--panel-bg);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-card);
    box-shadow: var(--panel-shadow);
    overflow: hidden;
    animation: panelIn 0.18s ease;
}
@keyframes panelIn {
    from { opacity: 0; transform: translateY(10px) scale(0.99); }
    to   { opacity: 1; transform: none; }
}

.panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 20px 14px;
    border-bottom: 1px solid var(--border-subtle);
}
.panel-title { font-size: 15px; font-weight: 500; }
.panel-sub { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; }
.panel-close {
    width: 30px; height: 30px;
    display: grid;
    place-items: center;
    font-size: 13px;
    color: var(--text-muted);
    background: transparent;
    border: 1px solid var(--border-subtle);
    border-radius: 50%;
    flex-shrink: 0;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.panel-close:hover {
    color: var(--text-primary);
    border-color: var(--border-bright);
    background: var(--bg-surface-hover);
}

.panel-body {
    padding: 16px 20px 22px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 18px;
}
.panel-section { display: flex; flex-direction: column; gap: 9px; }
.panel-label {
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
}
.panel-hint { font-size: 11.5px; color: var(--text-muted); line-height: 1.55; }
.panel-note {
    font-size: 11.5px;
    color: var(--text-muted);
    border-top: 1px solid var(--border-subtle);
    padding-top: 12px;
    line-height: 1.55;
}
.panel-progress-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 10px;
    flex-wrap: wrap;
}
.panel-step { font-size: 12px; color: var(--text-primary); }

.panel-form { display: flex; flex-direction: column; gap: 13px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field-label { font-size: 11.5px; color: var(--text-muted); }
.field-input {
    width: 100%;
    background: var(--input-bg);
    color: var(--text-primary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 9px 12px;
    font-size: 13.5px;
    transition: border-color 0.15s;
}
.field-input:focus { border-color: var(--accent-blue); outline: none; }
.field-input::placeholder { color: var(--text-muted); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.panel-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* Used by the panel actions and by the chat's Send button alike */
.primary-btn {
    background: var(--accent-blue);
    color: var(--on-accent);
    border: none;
    border-radius: var(--radius-pill);
    padding: 9px 18px;
    font-size: 13px;
    font-weight: 500;
    transition: opacity 0.15s, transform 0.12s;
}
.primary-btn:hover { opacity: 0.88; }
.primary-btn:active { transform: scale(0.98); }
.ghost-btn {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-pill);
    padding: 8px 14px;
    font-size: 12.5px;
    transition: background 0.15s, border-color 0.15s;
}
.ghost-btn:hover { background: var(--bg-surface-hover); border-color: var(--border-bright); }
.ghost-btn:active { transform: scale(0.98); }
/* Armed state of the two-step destructive action */
.ghost-btn.armed {
    color: var(--accent-danger);
    border-color: var(--accent-danger);
    background: transparent;
}
.ghost-btn.armed:hover { background: transparent; border-color: var(--accent-danger); }
.panel-flash { font-size: 11.5px; color: var(--accent-green); overflow-wrap: anywhere; }

.context-preview {
    display: block;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 11.5px;
    line-height: 1.6;
    color: var(--accent-blue);
    background: var(--tag-bg);
    border: 1px solid var(--tag-border);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    overflow-wrap: anywhere;
}

.settings-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}
.settings-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.settings-text strong { font-size: 13px; font-weight: 500; }
.settings-sub { font-size: 11.5px; color: var(--text-muted); overflow-wrap: anywhere; }
.settings-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.code-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.code-row .field-input {
    flex: 1 1 190px;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 12.5px;
    letter-spacing: 0.02em;
}

/* Mobile navigation drawer backdrop */
.sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 25;
    background: var(--overlay-bg);
    border: 0;
}

/* ════════════════════════════════════════
   RESPONSIVE
   ════════════════════════════════════════ */
@media (max-width: 720px) {
    /* The sidebar becomes an off-canvas drawer so its navigation stays reachable. */
    .sidebar {
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        transform: translateX(-100%);
        transition: transform 0.22s ease;
        box-shadow: var(--panel-shadow);
    }
    .app-container.sidebar-open .sidebar { transform: translateX(0); }
    .top-bar .nav-toggle { display: inline-flex; }

    .chat-container { padding: 16px 14px; }
    .top-bar, .chat-input-area, .quick-replies { padding-left: 14px; padding-right: 14px; }
    .message { max-width: 92%; }
    .top-bar-actions { gap: 6px; }
    .icon-btn .icon-label { display: none; }
    .panel-overlay { padding: 10px; }
    .panel { max-height: calc(100vh - 20px); }
    .field-row { grid-template-columns: 1fr; }
}

/* ── Respect reduced-motion preferences ── */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
}
