/* ==========================================================================
   InquiryDQB design system — shared by the landing page, Teacher and Student.
   Tokens, base, components, overlays (sheets / dialogs / menus), toasts.
   ========================================================================== */
@import url('../fonts/fonts.css');

/* ---------- Tokens ---------- */
:root {
  --accent: #2563eb; --accent-600: #1d4ed8; --accent-700: #1e40af;
  --accent-50: rgba(37, 99, 235, 0.08); --accent-100: rgba(37, 99, 235, 0.15);
  --accent-solid: #2563eb; --accent-solid-600: #1d4ed8;        /* fills that carry white text (≥ 4.5:1) */
  --accent-ink: #1d4ed8;                                        /* accent-coloured text on tinted backgrounds */
  --on-accent: #ffffff;

  --bg: #f3f5f9;
  --surface: #ffffff;
  --surface-2: #f1f4f9;
  --surface-3: #e6ebf3;
  --border: rgba(15, 23, 42, 0.10);
  --border-strong: rgba(15, 23, 42, 0.20);

  --text: #0f172a; --text-2: #475569; --text-3: #566579;
  --danger: #b91c1c; --danger-solid: #b91c1c; --danger-50: rgba(185, 28, 28, 0.08); --danger-100: rgba(185, 28, 28, 0.16);
  --success: #166534; --success-50: rgba(21, 128, 61, 0.10);
  --warn: #92400e; --warn-50: rgba(217, 119, 6, 0.12);

  --radius-sm: 8px; --radius: 12px; --radius-lg: 16px; --radius-xl: 22px; --radius-full: 999px;
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.08), 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow: 0 4px 14px rgba(15, 23, 42, 0.08), 0 1px 3px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.14), 0 2px 8px rgba(15, 23, 42, 0.08);
  --shadow-sheet: 0 -8px 40px rgba(15, 23, 42, 0.22);
  --backdrop: rgba(8, 12, 24, 0.48);

  --font-ui: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-hand: 'Patrick Hand', 'Segoe Print', 'Comic Sans MS', cursive;

  --safe-t: env(safe-area-inset-top, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --kb: 0px;                       /* on-screen keyboard height (set by ui.js) */
  --nav-h: 60px; --topbar-h: 52px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  color-scheme: light;
}
/* Dark theme: follows the OS unless the user forces light/dark via [data-theme] */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --accent: #76a2f5; --accent-600: #5b8def; --accent-700: #4a7de0;
    --accent-solid: #3b6fd8; --accent-solid-600: #3566d0; --accent-ink: #8fb2ff;
    --accent-50: rgba(91, 141, 239, 0.14); --accent-100: rgba(91, 141, 239, 0.24);
    --bg: #0a101c; --surface: #111a2c; --surface-2: #19243a; --surface-3: #223049;
    --border: rgba(255, 255, 255, 0.09); --border-strong: rgba(255, 255, 255, 0.2);
    --text: #e9eef7; --text-2: #aab6ca; --text-3: #8d9bb3;
    --danger: #f87171; --danger-solid: #dc2626; --danger-50: rgba(248, 113, 113, 0.12); --danger-100: rgba(248, 113, 113, 0.22);
    --success: #4ade80; --success-50: rgba(74, 222, 128, 0.13);
    --warn: #fbbf24; --warn-50: rgba(251, 191, 36, 0.14);
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.5);
    --shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.6);
    --shadow-sheet: 0 -8px 40px rgba(0, 0, 0, 0.6);
    --backdrop: rgba(0, 0, 0, 0.62);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --accent: #76a2f5; --accent-600: #5b8def; --accent-700: #4a7de0;
    --accent-solid: #3b6fd8; --accent-solid-600: #3566d0; --accent-ink: #8fb2ff;
  --accent-50: rgba(91, 141, 239, 0.14); --accent-100: rgba(91, 141, 239, 0.24);
  --bg: #0a101c; --surface: #111a2c; --surface-2: #19243a; --surface-3: #223049;
  --border: rgba(255, 255, 255, 0.09); --border-strong: rgba(255, 255, 255, 0.2);
  --text: #e9eef7; --text-2: #aab6ca; --text-3: #8d9bb3;
  --danger: #f87171; --danger-solid: #dc2626; --danger-50: rgba(248, 113, 113, 0.12); --danger-100: rgba(248, 113, 113, 0.22);
  --success: #4ade80; --success-50: rgba(74, 222, 128, 0.13);
  --warn: #fbbf24; --warn-50: rgba(251, 191, 36, 0.14);
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.5);
  --shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.6);
  --shadow-sheet: 0 -8px 40px rgba(0, 0, 0, 0.6);
  --backdrop: rgba(0, 0, 0, 0.62);
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font-ui); font-size: 15px; line-height: 1.45;
  background: var(--bg); color: var(--text);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
img, svg { display: block; }
h1, h2, h3, h4, p { margin: 0; }
a { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
:focus:not(:focus-visible) { outline: none; }
[hidden] { display: none !important; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.i { width: 20px; height: 20px; flex-shrink: 0; stroke-width: 1.85; }
.i.sm { width: 16px; height: 16px; } .i.lg { width: 24px; height: 24px; } .i.xl { width: 32px; height: 32px; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.muted { color: var(--text-3); } .text-2 { color: var(--text-2); }
.grow { flex: 1 1 auto; min-width: 0; }
.row { display: flex; align-items: center; gap: 8px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.center { text-align: center; }
.hide-mobile { display: initial; } .show-mobile { display: none !important; }
@media (max-width: 767px) { .hide-mobile { display: none !important; } .show-mobile { display: initial !important; } .show-mobile.flex { display: flex !important; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px; border-radius: var(--radius); border: 1px solid transparent;
  background: var(--surface-2); color: var(--text); font-weight: 600; font-size: 0.9375rem; line-height: 1.1;
  white-space: nowrap; user-select: none; -webkit-user-select: none; text-decoration: none;
  transition: background-color 0.15s, border-color 0.15s, transform 0.1s, box-shadow 0.15s, opacity 0.15s;
}
.btn:hover { background: var(--surface-3); }
.btn:active { transform: scale(0.98); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.45; pointer-events: none; }
.btn-primary { background: var(--accent-solid); color: var(--on-accent); box-shadow: 0 1px 2px rgba(37, 99, 235, 0.35); }
.btn-primary:hover { background: var(--accent-solid-600); }
.btn-secondary { background: var(--surface); border-color: var(--border-strong); }
.btn-secondary:hover { background: var(--surface-2); }
.btn-ghost { background: transparent; }
.btn-ghost:hover { background: var(--surface-2); }
.btn-soft { background: var(--accent-50); color: var(--accent); }
.btn-soft:hover { background: var(--accent-100); }
.btn-danger { background: var(--danger-solid); color: #fff; }
.btn-danger:hover { background: var(--danger-solid); filter: brightness(0.92); }
.btn-danger-soft { background: var(--danger-50); color: var(--danger); }
.btn-danger-soft:hover { background: var(--danger-100); }
.btn-block { width: 100%; }
.btn-sm { min-height: 36px; padding: 0 12px; font-size: 0.875rem; border-radius: var(--radius-sm); }
.btn-lg { min-height: 52px; padding: 0 24px; font-size: 1rem; border-radius: var(--radius-lg); }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  width: 40px; height: 40px; padding: 0; border: 1px solid transparent; border-radius: var(--radius);
  background: transparent; color: var(--text-2); position: relative;
  transition: background-color 0.15s, color 0.15s, transform 0.1s;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn:active { transform: scale(0.94); }
.icon-btn.active, .icon-btn[aria-pressed="true"] { background: var(--accent-solid); color: var(--on-accent); }
.icon-btn.soft { background: var(--surface-2); }
.icon-btn.sm { width: 32px; height: 32px; border-radius: var(--radius-sm); }
.icon-btn.lg { width: 48px; height: 48px; }
.icon-btn[disabled] { opacity: 0.4; pointer-events: none; }
.icon-btn .badge-dot { position: absolute; top: 5px; right: 5px; }

.badge {
  display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: var(--radius-full); background: var(--accent-solid); color: var(--on-accent); font-size: 0.6875rem; font-weight: 700;
}
.badge-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--danger); border: 2px solid var(--surface); }
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: var(--radius-full);
  background: var(--surface-2); color: var(--text-2); font-size: 0.8125rem; font-weight: 600; border: 1px solid transparent; white-space: nowrap;
}
button.chip:hover { background: var(--surface-3); }
.chip.active, .chip[aria-pressed="true"] { background: var(--accent-50); color: var(--accent-ink); border-color: var(--accent-100); }
.chip.success { background: var(--success-50); color: var(--success); }
.chip.warn { background: var(--warn-50); color: var(--warn); }
.chip.danger { background: var(--danger-50); color: var(--danger); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-3); flex-shrink: 0; }
.dot.ok { background: #22c55e; box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2); }
.dot.warn { background: #f59e0b; box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2); animation: pulse 1.4s ease-in-out infinite; }
.dot.bad { background: #ef4444; box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2); }
@keyframes pulse { 50% { opacity: 0.4; } }
.kbd { display: inline-block; min-width: 20px; padding: 1px 6px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--border); border-bottom-width: 2px; font-size: 0.6875rem; font-weight: 600; color: var(--text-2); text-align: center; font-family: var(--font-ui); }

/* ---------- Inputs ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .label { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-3); }
.field .hint { font-size: 0.8125rem; color: var(--text-3); }
.field .error { font-size: 0.8125rem; color: var(--danger); font-weight: 600; }
.input, .textarea, .select {
  width: 100%; min-height: 46px; padding: 10px 14px; border-radius: var(--radius); border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text); font-size: 1rem; transition: border-color 0.15s, box-shadow 0.15s;
  -webkit-user-select: text; user-select: text; appearance: none; -webkit-appearance: none;
}
.input::placeholder, .textarea::placeholder { color: var(--text-3); opacity: 0.85; }
.input:focus, .textarea:focus, .select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-100); }
.input.invalid, .textarea.invalid { border-color: var(--danger); box-shadow: 0 0 0 4px var(--danger-50); }
.textarea { resize: vertical; min-height: 96px; line-height: 1.45; }
.select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }
input[type="range"] { width: 100%; accent-color: var(--accent); height: 28px; margin: 0; background: transparent; }
.switch { position: relative; width: 46px; height: 28px; padding: 0; border-radius: var(--radius-full); border: none; background: var(--surface-3); transition: background-color 0.2s; flex-shrink: 0; }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: transform 0.2s var(--ease); }
.switch[aria-checked="true"] { background: var(--accent-solid); }
.switch[aria-checked="true"]::after { transform: translateX(18px); }

.seg { display: flex; padding: 3px; gap: 2px; background: var(--surface-2); border-radius: var(--radius); }
.seg > button { flex: 1; min-height: 38px; padding: 0 12px; border: none; border-radius: calc(var(--radius) - 3px); background: transparent; color: var(--text-2); font-weight: 600; font-size: 0.875rem; display: inline-flex; align-items: center; justify-content: center; gap: 6px; transition: background-color 0.15s, color 0.15s, box-shadow 0.15s; }
.seg > button:hover { color: var(--text); }
.seg > button[aria-pressed="true"], .seg > button.active, .seg > button[aria-selected="true"] { background: var(--surface); color: var(--accent); box-shadow: var(--shadow-sm); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); }
.tabs > button { position: relative; flex: 1; min-height: 44px; padding: 0 12px; border: none; background: transparent; color: var(--text-3); font-weight: 600; font-size: 0.875rem; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.tabs > button[aria-selected="true"] { color: var(--accent); }
.tabs > button[aria-selected="true"]::after { content: ''; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 2.5px; border-radius: 2px; background: var(--accent); }

/* ---------- Lists & cards ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-xs); }
.list { display: flex; flex-direction: column; }
.list-row { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 8px 4px; border-bottom: 1px solid var(--border); text-align: left; background: none; border-left: 0; border-right: 0; border-top: 0; width: 100%; color: var(--text); }
.list-row:last-child { border-bottom: none; }
button.list-row:hover { background: var(--surface-2); }
.list-row .ico { width: 40px; height: 40px; border-radius: 12px; background: var(--surface-2); display: flex; align-items: center; justify-content: center; color: var(--text-2); flex-shrink: 0; }
.list-row .t { font-weight: 600; } .list-row .s { font-size: 0.8125rem; color: var(--text-3); }
.section-label { font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3); padding: 14px 4px 6px; }
.empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 32px 20px; text-align: center; color: var(--text-3); }
.empty .em-ico { width: 56px; height: 56px; border-radius: 18px; background: var(--surface-2); display: flex; align-items: center; justify-content: center; color: var(--text-3); margin-bottom: 4px; }
.empty .em-t { font-weight: 700; color: var(--text); font-size: 1rem; }

/* ---------- Overlays: backdrop + sheet / dialog ---------- */
.ov { position: fixed; inset: 0; z-index: 5000; display: flex; align-items: flex-end; justify-content: center; }
.ov-backdrop { position: absolute; inset: 0; background: var(--backdrop); animation: fadeIn 0.2s ease-out both; -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.sheet {
  position: relative; width: 100%; max-width: 560px; max-height: calc(100dvh - var(--safe-t) - 16px - var(--kb)); margin-bottom: var(--kb);
  display: flex; flex-direction: column; background: var(--surface); color: var(--text);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0; box-shadow: var(--shadow-sheet);
  animation: sheetUp 0.28s var(--ease) both; overscroll-behavior: contain; will-change: transform;
}
.sheet.size-sm { max-width: 420px; } .sheet.size-lg { max-width: 760px; } .sheet.size-xl { max-width: 980px; }
.sheet.dragging { transition: none; animation: none; }
.sheet.closing { animation: sheetDown 0.2s ease-in both; }
.ov.closing .ov-backdrop { animation: fadeOut 0.2s ease-in both; }
.sheet-handle { flex-shrink: 0; height: 24px; display: flex; align-items: center; justify-content: center; touch-action: none; cursor: grab; }
.sheet-handle::before { content: ''; width: 40px; height: 4.5px; border-radius: 3px; background: var(--border-strong); }
.sheet-h { flex-shrink: 0; display: flex; align-items: center; gap: 8px; padding: 2px 8px 10px 20px; touch-action: none; }
.sheet-h h2 { flex: 1; font-size: 1.1875rem; font-weight: 700; letter-spacing: -0.01em; min-width: 0; }
.sheet-b { flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 4px 20px 20px; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; touch-action: pan-y; }
.sheet-f { flex-shrink: 0; display: flex; gap: 10px; padding: 12px 20px calc(14px + var(--safe-b)); border-top: 1px solid var(--border); background: var(--surface); }
.sheet-f .btn { flex: 1; }
.sheet-f.stacked { flex-direction: column; }
.sheet.flush .sheet-b { padding: 0; }
@media (min-width: 768px) {
  .ov { align-items: center; padding: 24px; }
  .sheet { border-radius: var(--radius-xl); max-height: min(86dvh, 820px); margin-bottom: 0; animation: popIn 0.22s var(--ease) both; box-shadow: var(--shadow-lg), 0 0 0 1px var(--border); }
  .sheet.closing { animation: popOut 0.16s ease-in both; }
  .sheet-handle { display: none; }
  .sheet-h { padding-top: 14px; touch-action: auto; }
  .sheet-f { padding-bottom: 14px; border-radius: 0 0 var(--radius-xl) var(--radius-xl); }
}
/* Dialog flavour: centred icon + text, stacked actions on mobile */
.dlg { text-align: center; padding: 8px 4px 0; }
.dlg .dlg-ico { width: 52px; height: 52px; border-radius: 18px; margin: 0 auto 12px; display: flex; align-items: center; justify-content: center; background: var(--accent-50); color: var(--accent); }
.dlg .dlg-ico.danger { background: var(--danger-50); color: var(--danger); }
.dlg .dlg-ico.warn { background: var(--warn-50); color: var(--warn); }
.dlg h3 { font-size: 1.1875rem; font-weight: 700; margin-bottom: 6px; letter-spacing: -0.01em; }
.dlg p { color: var(--text-2); white-space: pre-wrap; text-align: center; }
.dlg .field { margin-top: 14px; text-align: left; }
@media (max-width: 767px) { .sheet-f.dlg-actions { flex-direction: column-reverse; } }
@keyframes sheetUp { from { transform: translateY(100%); } to { transform: none; } }
@keyframes sheetDown { to { transform: translateY(105%); } }
@keyframes popIn { from { opacity: 0; transform: translateY(14px) scale(0.97); } to { opacity: 1; transform: none; } }
@keyframes popOut { to { opacity: 0; transform: scale(0.97); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeOut { to { opacity: 0; } }
@keyframes slideIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---------- Popover menu ---------- */
.menu {
  position: fixed; z-index: 5200; min-width: 220px; max-width: 320px; max-height: min(70dvh, 560px); overflow-y: auto; padding: 6px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  animation: popIn 0.14s var(--ease) both; transform-origin: top left;
}
.menu-item { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 40px; padding: 0 10px; border: none; border-radius: 10px; background: transparent; color: var(--text); font-size: 0.9375rem; font-weight: 500; text-align: left; }
.menu-item:hover, .menu-item:focus-visible { background: var(--surface-2); outline: none; }
.menu-item .i { color: var(--text-2); }
.menu-item .kbd { margin-left: auto; }
.menu-item .chk { margin-left: auto; color: var(--accent); }
.menu-item.danger { color: var(--danger); } .menu-item.danger .i { color: var(--danger); }
.menu-item[disabled] { opacity: 0.4; pointer-events: none; }
.menu-sep { height: 1px; background: var(--border); margin: 6px 4px; }
.menu-head { padding: 8px 10px 4px; font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3); }

/* ---------- Toasts ---------- */
#toasts { position: fixed; left: 0; right: 0; bottom: calc(var(--toast-bottom, 20px) + var(--safe-b)); z-index: 6000; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; padding: 0 16px; }
.toast {
  display: inline-flex; align-items: center; gap: 10px; max-width: min(520px, 100%); min-height: 44px; padding: 8px 16px; border-radius: var(--radius-full);
  background: #172033; color: #f4f7fc; font-size: 0.9rem; font-weight: 600; box-shadow: var(--shadow-lg); pointer-events: auto;
  animation: toastIn 0.28s var(--ease) both; border: 1px solid rgba(255, 255, 255, 0.08);
}
:root[data-theme="dark"] .toast { background: #e9eef7; color: #0f172a; border-color: transparent; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .toast { background: #e9eef7; color: #0f172a; border-color: transparent; } }
.toast.out { animation: toastOut 0.2s ease-in both; }
.toast .i { width: 18px; height: 18px; }
.toast.success .i { color: #4ade80; } .toast.error .i { color: #f87171; } .toast.warn .i { color: #fbbf24; }
:root[data-theme="dark"] .toast.success .i { color: #15803d; } :root[data-theme="dark"] .toast.error .i { color: #dc2626; } :root[data-theme="dark"] .toast.warn .i { color: #b45309; }
.toast .toast-action { margin-left: 4px; padding: 4px 10px; border: none; border-radius: var(--radius-full); background: rgba(255, 255, 255, 0.16); color: inherit; font-weight: 700; font-size: 0.8125rem; }
/* ---------- Colour swatches ---------- */
.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.swatch { width: 32px; height: 32px; border-radius: 50%; border: 3px solid var(--surface); box-shadow: 0 0 0 1px var(--border-strong); padding: 0; transition: transform 0.12s; }
.swatch:hover { transform: scale(1.1); }
.swatch[aria-pressed="true"] { box-shadow: 0 0 0 2.5px var(--accent); transform: scale(1.08); }

@keyframes toastIn { from { opacity: 0; transform: translateY(16px) scale(0.96); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(8px); } }

/* ---------- Tooltips (desktop hover only) ---------- */
@media (hover: hover) and (pointer: fine) {
  [data-tip] { position: relative; }
  [data-tip]::after {
    content: attr(data-tip); position: absolute; z-index: 400; padding: 5px 9px; border-radius: 8px; background: #172033; color: #f4f7fc;
    font-size: 0.75rem; font-weight: 600; white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity 0.12s 0s; box-shadow: var(--shadow);
  }
  [data-tip]:hover::after { opacity: 1; transition-delay: 0.45s; }
  [data-tip-pos="right"]::after { left: calc(100% + 10px); top: 50%; transform: translateY(-50%); }
  [data-tip-pos="top"]::after { bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%); }
  [data-tip-pos="bottom"]::after { top: calc(100% + 8px); left: 50%; transform: translateX(-50%); }
  [data-tip-pos="left"]::after { right: calc(100% + 10px); top: 50%; transform: translateY(-50%); }
}
