/* SmartShift OS – Liquid Glass. Tokens copied from the website's glass.css (copied, not linked: the two apps
   deploy separately). RTL, light/dark (auto, or forced with [data-theme]), iPhone safe areas. */

:root {
  --bg: #eef4fb;
  --bg-2: #f8fbff;
  --ink: #0a1a2f;
  --ink-2: #44566e;
  --ink-3: #52607a;
  --accent: #1259b0;
  --accent-ink: #ffffff;
  --accent-2: #4cc3f0;
  --accent-soft: rgba(18, 89, 176, 0.1);
  --ok: #0f9d6b;
  --warn: #b26a00;
  --danger: #d33a4a;
  --glass: rgba(255, 255, 255, 0.2);
  --glass-strong: rgba(255, 255, 255, 0.62);
  --glass-solid: rgba(255, 255, 255, 0.82);
  --edge-hi: rgba(10, 26, 47, 0.16);
  --rim-hi: rgba(255, 255, 255, 0.35);
  --edge-line: rgba(10, 26, 47, 0.15);
  --inset: inset 0 1px 1px 0 rgba(255, 255, 255, 0.4);
  --shadow: 0 25px 50px -12px rgba(16, 42, 84, 0.25);
  --shadow-sm: 0 10px 24px -10px rgba(16, 42, 84, 0.22);
  --blur: blur(24px) saturate(190%);
  --blob-1: #5aa9ff;
  --blob-2: #7fdcff;
  --blob-3: #a9b8ff;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Hebrew", "Heebo", Inter, system-ui, sans-serif;
  --fs-xs: 0.78rem;
  --fs-sm: 0.9rem;
  --fs-md: 1.05rem;
  --fs-lg: 1.3rem;
  --fs-xl: clamp(1.6rem, 1.2rem + 1.6vw, 2.3rem);
  --r: 28px;
  --r-md: 20px;
  --r-sm: 14px;
  --spring: cubic-bezier(0.16, 1, 0.3, 1);
  --t: 0.35s var(--spring);
  --tabbar-h: 64px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #070c12; --bg-2: #0c141e; --ink: #f5f7fa; --ink-2: #a7b3c2; --ink-3: #7b8796;
    --accent: #4aa8ff; --accent-ink: #0b1620; --accent-2: #6cc4ff; --accent-soft: rgba(74, 168, 255, 0.14);
    --ok: #3fd39b; --warn: #ffb84d; --danger: #ff6b7a;
    --glass: rgba(24, 32, 43, 0.6); --glass-strong: rgba(19, 26, 35, 0.72); --glass-solid: rgba(17, 24, 33, 0.92);
    --edge-hi: rgba(255, 255, 255, 0.18); --rim-hi: rgba(255, 255, 255, 0.18); --edge-line: rgba(255, 255, 255, 0.08);
    --inset: inset 0 1px 1px 0 rgba(255, 255, 255, 0.12);
    --shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6); --shadow-sm: 0 10px 24px -10px rgba(0, 0, 0, 0.5);
    --blob-1: #1b4f9c; --blob-2: #13597a; --blob-3: #2a3375;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #070c12; --bg-2: #0c141e; --ink: #f5f7fa; --ink-2: #a7b3c2; --ink-3: #7b8796;
  --accent: #4aa8ff; --accent-ink: #0b1620; --accent-2: #6cc4ff; --accent-soft: rgba(74, 168, 255, 0.14);
  --ok: #3fd39b; --warn: #ffb84d; --danger: #ff6b7a;
  --glass: rgba(24, 32, 43, 0.6); --glass-strong: rgba(19, 26, 35, 0.72); --glass-solid: rgba(17, 24, 33, 0.92);
  --edge-hi: rgba(255, 255, 255, 0.18); --rim-hi: rgba(255, 255, 255, 0.18); --edge-line: rgba(255, 255, 255, 0.08);
  --inset: inset 0 1px 1px 0 rgba(255, 255, 255, 0.12);
  --shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6); --shadow-sm: 0 10px 24px -10px rgba(0, 0, 0, 0.5);
  --blob-1: #1b4f9c; --blob-2: #13597a; --blob-3: #2a3375;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font);
  font-size: var(--fs-md);
  line-height: 1.5;
  color: var(--ink);
  background: linear-gradient(160deg, var(--bg-2), var(--bg));
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); }
h1, h2, h3 { margin: 0; line-height: 1.2; letter-spacing: -0.01em; }
h1 { font-size: var(--fs-xl); font-weight: 750; }
h2 { font-size: var(--fs-lg); font-weight: 700; }
h3 { font-size: var(--fs-md); font-weight: 650; }
p { margin: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--accent-2); outline-offset: 2px; }

/* soft colour blobs behind the glass */
.blobs { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.blobs span { position: absolute; width: 60vmax; height: 60vmax; border-radius: 50%; filter: blur(80px); opacity: 0.45; }
.blobs span:nth-child(1) { background: var(--blob-1); top: -25vmax; inset-inline-start: -20vmax; }
.blobs span:nth-child(2) { background: var(--blob-2); bottom: -30vmax; inset-inline-end: -25vmax; }
.blobs span:nth-child(3) { background: var(--blob-3); top: 30vh; inset-inline-start: 40vw; width: 35vmax; height: 35vmax; opacity: 0.3; }

main {
  max-width: 720px;
  margin: 0 auto;
  padding: calc(env(safe-area-inset-top) + 20px) 16px calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 28px);
}
main.auth { padding-bottom: calc(env(safe-area-inset-bottom) + 28px); }
.center { min-height: 70dvh; display: grid; place-items: center; }

.glass {
  background: var(--glass-strong);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  border: 1px solid var(--edge-hi);
  box-shadow: var(--shadow-sm), var(--inset);
  border-radius: var(--r);
}
.card { padding: 20px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.stack-lg { display: flex; flex-direction: column; gap: 20px; }
.row { display: flex; align-items: center; gap: 12px; }
.row.between { justify-content: space-between; }
.muted { color: var(--ink-2); }
.small { font-size: var(--fs-sm); }
.xs { font-size: var(--fs-xs); color: var(--ink-3); }

/* auth screens */
.auth-card { width: 100%; max-width: 420px; padding: 28px 22px; }
.brand { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.brand img { width: 48px; height: 48px; border-radius: 14px; background: #fff; box-shadow: var(--shadow-sm); }
.brand b { font-size: var(--fs-lg); }

label.field { display: flex; flex-direction: column; gap: 6px; font-size: var(--fs-sm); font-weight: 600; color: var(--ink-2); }
input[type="email"], input[type="password"], input[type="text"] {
  width: 100%;
  min-height: 50px;
  padding: 12px 16px;
  border-radius: var(--r-sm);
  border: 1px solid var(--edge-line);
  background: var(--glass-solid);
  font-size: 1.05rem;           /* ≥16px: iOS won't zoom on focus */
  color: var(--ink);
  transition: border-color var(--t), box-shadow var(--t);
}
input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
input.code { text-align: center; letter-spacing: 0.4em; font-variant-numeric: tabular-nums; font-size: 1.4rem; direction: ltr; }
input[dir="ltr"] { text-align: left; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 50px; padding: 12px 22px;
  border-radius: 999px; border: 1px solid transparent;
  font-weight: 650; cursor: pointer; text-decoration: none;
  transition: transform var(--t), background var(--t), opacity var(--t);
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.55; cursor: default; }
.btn-primary { background: var(--accent); color: var(--accent-ink); box-shadow: 0 10px 24px -10px var(--accent); }
.btn-glass { background: var(--glass-solid); border-color: var(--edge-hi); color: var(--ink); }
.btn-danger { background: transparent; border-color: var(--danger); color: var(--danger); }
.btn-small { min-height: 38px; padding: 6px 14px; font-size: var(--fs-sm); }
.btn-block { width: 100%; }
.linklike { background: none; border: none; padding: 6px 0; color: var(--accent); cursor: pointer; font-size: var(--fs-sm); text-decoration: underline; }

.error { color: var(--danger); font-size: var(--fs-sm); font-weight: 600; min-height: 1.2em; }
.notice { padding: 12px 14px; border-radius: var(--r-sm); background: var(--accent-soft); color: var(--ink); font-size: var(--fs-sm); }
.notice.warn { background: color-mix(in srgb, var(--warn) 14%, transparent); }

.secret {
  direction: ltr; font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 1rem;
  padding: 12px; border-radius: var(--r-sm); background: var(--glass-solid); border: 1px dashed var(--edge-line);
  word-break: break-all; text-align: center; user-select: all; -webkit-user-select: all;
}
.codes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; direction: ltr; }
.codes span { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 0.92rem; text-align: center;
  padding: 8px 4px; border-radius: 10px; background: var(--glass-solid); border: 1px solid var(--edge-line); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: var(--fs-sm); }
.check input { width: 22px; height: 22px; accent-color: var(--accent); flex: none; margin-top: 1px; }

/* home */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.page-head .hello { font-size: var(--fs-sm); color: var(--ink-2); }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.stat { padding: 16px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.stat .label { font-size: var(--fs-xs); color: var(--ink-3); font-weight: 600; }
.stat .value { font-size: var(--fs-md); font-weight: 700; overflow-wrap: anywhere; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; }
.dot.ok { background: var(--ok); } .dot.warn { background: var(--warn); } .dot.bad { background: var(--danger); }
.module { padding: 16px; display: flex; flex-direction: column; gap: 6px; opacity: 0.85; }
.module .ico { font-size: 1.5rem; line-height: 1; }
.badge { align-self: flex-start; font-size: var(--fs-xs); font-weight: 650; padding: 2px 10px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent); }

.switch { position: relative; width: 52px; height: 32px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--edge-line); transition: background var(--t); pointer-events: none; }
.switch span::after { content: ""; position: absolute; top: 3px; inset-inline-start: 3px; width: 26px; height: 26px; border-radius: 50%;
  background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25); transition: transform var(--t); }
.switch input:checked + span { background: var(--danger); }
.switch input:checked + span::after { transform: translateX(-20px); }
.switch input:focus-visible + span { outline: 3px solid var(--accent-2); outline-offset: 2px; }

.list { list-style: none; margin: 0; padding: 0; }
.list li { padding: 14px 0; border-bottom: 1px solid var(--edge-line); display: flex; gap: 12px; align-items: center; justify-content: space-between; }
.list li:last-child { border-bottom: none; }
.list .meta { min-width: 0; }
.list .meta .xs { overflow-wrap: anywhere; }

.seg { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--glass-solid); border: 1px solid var(--edge-line); }
.seg button { border: none; background: none; padding: 6px 14px; border-radius: 999px; cursor: pointer; font-size: var(--fs-sm); font-weight: 600; color: var(--ink-2); }
.seg button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }

/* bottom tab bar */
.tabbar {
  position: fixed; z-index: 10;
  inset-inline: 12px; bottom: calc(env(safe-area-inset-bottom) + 10px);
  max-width: 480px; margin: 0 auto;
  height: var(--tabbar-h);
  display: flex; justify-content: space-around; align-items: center;
  border-radius: 999px;
  background: var(--glass-strong); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  border: 1px solid var(--edge-hi); box-shadow: var(--shadow), var(--inset);
}
.tabbar a {
  flex: 1; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: var(--ink-3); text-decoration: none; font-size: 0.72rem; font-weight: 650; border-radius: 999px;
}
.tabbar a svg { width: 24px; height: 24px; }
.tabbar a[aria-current="page"] { color: var(--accent); }

.toast {
  position: fixed; z-index: 20; left: 50%; transform: translateX(-50%);
  bottom: calc(env(safe-area-inset-bottom) + var(--tabbar-h) + 24px);
  max-width: calc(100% - 32px); padding: 12px 18px; border-radius: 999px;
  background: var(--ink); color: var(--bg); font-size: var(--fs-sm); font-weight: 600; box-shadow: var(--shadow);
}

.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--accent-soft); border-top-color: var(--accent);
  animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation-duration: 0.01ms !important; } }
@media (max-width: 360px) { .grid { grid-template-columns: 1fr; } }

/* ---------- phase 3: tasks ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.row.wrap { flex-wrap: wrap; }
.full { width: 100%; }
.col { flex-direction: column; align-items: stretch !important; gap: 4px !important; }
.pre { white-space: pre-line; }
.plain { color: inherit; text-decoration: none; }
.strike { text-decoration: line-through; color: var(--ink-3); }
.plainlist { list-style: none; margin: 0; padding: 0; }
h2.inline { display: inline; }
.linkcard { color: inherit; text-decoration: none; }
.empty { text-align: center; padding: 18px 0; }

select, textarea {
  width: 100%; min-height: 46px; padding: 10px 14px; border-radius: var(--r-sm);
  border: 1px solid var(--edge-line); background: var(--glass-solid); color: var(--ink); font-size: 1rem;
}
textarea { resize: vertical; line-height: 1.5; }
select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
input[type="date"], input[type="time"] {
  width: 100%; min-height: 46px; padding: 10px 14px; border-radius: var(--r-sm);
  border: 1px solid var(--edge-line); background: var(--glass-solid); color: var(--ink); font-size: 1rem;
}
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.filebtn { position: relative; overflow: hidden; align-self: flex-start; }
.filebtn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

.quick { padding: 10px; border-radius: var(--r-md); display: flex; flex-direction: column; gap: 8px; }
.quick input { min-height: 46px; flex: 1; min-width: 0; }
.small-chips:empty { display: none; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px; font-size: var(--fs-sm);
  background: var(--accent-soft); color: var(--accent); font-weight: 600; text-decoration: none; }
.pill b { color: var(--ink); }
.pill-bad { background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 6px; margin: 0 -16px; padding-inline: 16px;
  scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 999px;
  background: var(--glass-solid); border: 1px solid var(--edge-line); color: var(--ink-2); font-size: var(--fs-sm);
  font-weight: 650; text-decoration: none; min-height: 38px; }
.chip b { font-size: var(--fs-xs); background: var(--accent-soft); color: var(--accent); padding: 0 7px; border-radius: 999px; }
.chip[aria-selected="true"] { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.chip[aria-selected="true"] b { background: rgba(255, 255, 255, 0.25); color: inherit; }
.chip-bad b { background: color-mix(in srgb, var(--danger) 18%, transparent); color: var(--danger); }

.tasks { list-style: none; margin: 0; padding: 0; }
.task { display: flex; align-items: flex-start; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--edge-line); }
.task:last-child { border-bottom: none; }
.tick { flex: none; width: 26px; height: 26px; margin-top: 1px; border-radius: 50%; border: 2px solid var(--ink-3);
  background: none; cursor: pointer; position: relative; padding: 0; }
.tick.on { background: var(--ok); border-color: var(--ok); }
.tick.on::after { content: ""; position: absolute; left: 7px; top: 3px; width: 6px; height: 11px; border: solid #fff;
  border-width: 0 2.5px 2.5px 0; transform: rotate(45deg); }
.tick::before { content: ""; position: absolute; inset: -10px; }           /* bigger touch target */
.task-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.task-title { font-weight: 600; overflow-wrap: anywhere; }
.task.done .task-title { text-decoration: line-through; color: var(--ink-3); }
.task-meta { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: var(--fs-xs); color: var(--ink-3); }
.late { color: var(--danger); font-weight: 650; }
.prio { font-weight: 700; }
.prio.p3 { color: var(--danger); }
.prio.p2 { color: var(--warn); }

ol.plan { margin: 0; padding-inline-start: 22px; display: flex; flex-direction: column; gap: 6px; }
details > summary { cursor: pointer; list-style: none; }
details > summary::-webkit-details-marker { display: none; }
details > summary::after { content: " ▾"; color: var(--ink-3); }
details[open] > summary { margin-bottom: 10px; }
.suggestion h3 { overflow-wrap: anywhere; }
@media (max-width: 380px) { .form-grid { grid-template-columns: 1fr; } }

/* ---------- phase 4: CRM ---------- */
input[type="search"], input[type="number"] {
  width: 100%; min-height: 46px; padding: 10px 14px; border-radius: var(--r-sm);
  border: 1px solid var(--edge-line); background: var(--glass-solid); color: var(--ink); font-size: 1rem;
}
.row > input[type="search"] { flex: 1; min-width: 0; }
.row > select { width: auto; flex: none; }
.form-grid .wide { grid-column: 1 / -1; }
.stat.plain { text-decoration: none; color: inherit; }
.value.bad, .bad { color: var(--danger); }
.value.good, .good { color: var(--ok); }
.value.warn, .warn { color: var(--warn); }
.badge-bad { background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); }
.badge-good { background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); }
.badge-warn { background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn); }
details.add > summary { font-weight: 650; color: var(--accent); }
details.add > summary::after { content: ""; }
.seg a { padding: 6px 14px; border-radius: 999px; font-size: var(--fs-sm); font-weight: 600; color: var(--ink-2); }
.seg a[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }

.pipeline { display: flex; gap: 12px; overflow-x: auto; margin: 0 -16px; padding: 0 16px 8px; scroll-snap-type: x mandatory; }
.pipe-col { flex: none; width: min(78vw, 300px); scroll-snap-align: start; align-self: flex-start; }
.pipe-card { display: flex; flex-direction: column; gap: 4px; padding: 12px; border-radius: var(--r-sm);
  background: var(--glass-solid); border: 1px solid var(--edge-line); }
.pipe-card select { min-height: 38px; padding: 6px 10px; font-size: var(--fs-sm); }

.qrow { display: grid; grid-template-columns: minmax(0, 1fr) 70px 100px 40px; gap: 8px; align-items: center; }
.qrow input { min-height: 44px; padding: 8px 10px; }
.qhead { font-size: var(--fs-xs); color: var(--ink-3); font-weight: 650; }
.totals { display: flex; flex-direction: column; gap: 6px; padding-top: 10px; border-top: 1px solid var(--edge-line); }
.totals .total { font-size: var(--fs-lg); }

.table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.table th, .table td { padding: 8px 6px; border-bottom: 1px solid var(--edge-line); text-align: start; }
.table th { color: var(--ink-3); font-size: var(--fs-xs); font-weight: 650; }
.table td:not(:first-child), .table th:not(:first-child) { white-space: nowrap; }

/* printable documents (quotes, purchase orders): Print → Save as PDF keeps Hebrew perfect */
body.print-mode .blobs, body.print-mode .tabbar { display: none !important; }
body.print-mode { background: #fff; color: #0a1a2f; }
body.print-mode main { padding-top: 16px; }
.doc { background: #fff; color: #0a1a2f; padding: 24px; border-radius: 12px; display: flex; flex-direction: column; gap: 14px; }
.doc-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; border-bottom: 2px solid #1259b0; padding-bottom: 12px; }
.doc-logo { width: 64px; height: 64px; }
.doc .table th, .doc .table td { border-color: #dde4ee; }
.doc .totals { border-color: #dde4ee; max-width: 320px; margin-inline-start: auto; width: 100%; }
@media print {
  .noprint, .tabbar, .toast, .blobs { display: none !important; }
  body, main { background: #fff !important; padding: 0 !important; max-width: none; }
  .doc { padding: 0; border-radius: 0; }
  @page { size: A4; margin: 16mm; }
}
@media (max-width: 420px) { .qrow { grid-template-columns: minmax(0, 1fr) 56px 84px 36px; gap: 6px; } }

/* ---------- phase 5: procurement ---------- */
.table tr.best td { font-weight: 700; color: var(--ok); }
.progress { height: 8px; border-radius: 999px; background: var(--edge-line); overflow: hidden; }
.progress > span { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 999px; transition: width var(--t); }
.doc[dir="ltr"] { text-align: left; }

/* ---------- phase 6: finance & charts (palette slots 1–2 from the validated reference palette) ---------- */
:root { --viz-1: #2a78d6; --viz-2: #eb6834; --viz-grid: rgba(10, 26, 47, 0.10); --viz-axis: #52607a; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --viz-1: #3987e5; --viz-2: #d95926; --viz-grid: rgba(255, 255, 255, 0.08); --viz-axis: #a7b3c2; } }
:root[data-theme="dark"] { --viz-1: #3987e5; --viz-2: #d95926; --viz-grid: rgba(255, 255, 255, 0.08); --viz-axis: #a7b3c2; }
.viz-fig { margin: 0; display: flex; flex-direction: column; gap: 8px; }
.viz-wrap { position: relative; }
.viz { width: 100%; height: auto; display: block; direction: ltr; }
.viz-grid { stroke: var(--viz-grid); stroke-width: 1; }
.viz-zero { stroke: var(--ink-3); stroke-width: 1; stroke-dasharray: 4 3; }
.viz-axis { fill: var(--viz-axis); font-size: 11px; font-family: var(--font); }
.viz-bar-1 { fill: var(--viz-1); }
.viz-bar-2 { fill: var(--viz-2); }
.viz-line-1 { fill: none; stroke: var(--viz-1); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.viz-cross { stroke: var(--ink-3); stroke-width: 1; }
.viz-marker { fill: var(--viz-1); stroke: var(--glass-solid); stroke-width: 2; }
.viz-hit { fill: transparent; cursor: default; outline: none; }
.viz-hit:focus-visible { fill: var(--accent-soft); }
.viz-s1-bg { background: var(--viz-1); }
.viz-s2-bg { background: var(--viz-2); }
.viz-legend { display: flex; gap: 16px; font-size: var(--fs-xs); color: var(--ink-2); }
.viz-legend > span { display: inline-flex; align-items: center; gap: 6px; }
.viz-tip { position: absolute; z-index: 2; min-width: 140px; padding: 8px 10px; border-radius: 10px; pointer-events: none;
  background: var(--glass-solid); border: 1px solid var(--edge-hi); box-shadow: var(--shadow-sm); font-size: var(--fs-xs); color: var(--ink); }
.col.end { align-items: flex-end !important; }
input[type="month"] { min-height: 46px; padding: 10px 14px; border-radius: var(--r-sm); border: 1px solid var(--edge-line);
  background: var(--glass-solid); color: var(--ink); font-size: 1rem; }

/* ---------- phase 7: SEO ---------- */
pre.outline { white-space: pre-wrap; font-family: var(--font); font-size: var(--fs-sm); background: var(--glass-solid);
  border: 1px solid var(--edge-line); border-radius: var(--r-sm); padding: 12px; max-height: 340px; overflow: auto; margin: 0; }

/* ---------- phase 8: media & content ---------- */
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.media-cell { display: flex; flex-direction: column; gap: 4px; padding: 6px; border-radius: var(--r-sm); background: var(--glass-strong);
  border: 1px solid var(--edge-hi); cursor: pointer; text-align: start; color: inherit; position: relative; }
.media-cell img, .video-tile { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; background: var(--glass-solid); }
.video-tile { display: grid; place-items: center; font-size: 2rem; }
.video-tile.big { aspect-ratio: 16 / 9; font-size: 1.2rem; }
.media-cell .badge { position: absolute; top: 10px; inset-inline-start: 10px; }
.media-strip { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.media-chip { position: relative; width: 84px; }
.media-chip img { width: 84px; height: 84px; object-fit: cover; border-radius: 10px; display: block; }
.media-chip button { position: absolute; top: 4px; inset-inline-end: 4px; min-height: 28px; padding: 2px 8px; background: var(--glass-solid); }
.asset-preview { width: 100%; max-height: 60vh; object-fit: contain; border-radius: var(--r-sm); background: var(--glass-solid); }
.snapshot { padding: 10px; border-radius: var(--r-sm); background: var(--glass-solid); border: 1px solid var(--edge-line); }
.snap-img { width: 72px; height: 72px; object-fit: cover; border-radius: 8px; }
input[type="datetime-local"] { min-height: 46px; padding: 10px 14px; border-radius: var(--r-sm); border: 1px solid var(--edge-line);
  background: var(--glass-solid); color: var(--ink); font-size: 1rem; }

/* ---------- phases 10–11: manager chat ---------- */
.chat { display: flex; flex-direction: column; gap: 14px; }
.chat-turn { display: flex; flex-direction: column; gap: 6px; }
.bubble { max-width: 88%; padding: 10px 14px; border-radius: 18px; font-size: var(--fs-sm); display: flex; flex-direction: column; gap: 8px; }
.me-bubble { align-self: flex-start; background: var(--accent); color: var(--accent-ink); border-end-start-radius: 6px; }
.bot-bubble { align-self: flex-end; background: var(--glass-strong); border: 1px solid var(--edge-hi); border-end-end-radius: 6px;
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); }
.bot-bubble.pending { opacity: 0.7; }
