/* Xylorve System v2 — claro por defecto (vidrio sobre malla suave), modo oscuro opcional.
   Sistema: Calistoga (titulares) + Inter (texto) + JetBrains Mono (datos). */
:root {
  --bg: #f4f6fb;
  --bg-mesh-1: rgba(37, 99, 235, .14);
  --bg-mesh-2: rgba(124, 58, 237, .12);
  --bg-mesh-3: rgba(8, 145, 178, .10);
  --surface: rgba(255, 255, 255, .74);
  --surface-solid: #ffffff;
  --surface-2: #f1f4fa;
  --border: rgba(15, 23, 42, .08);
  --border-2: rgba(15, 23, 42, .14);
  --text: #0f172a;
  --muted: #475569;
  --dim: #64748b;
  --primary: #2563eb;
  --primary-ink: #ffffff;
  --violet: #7c3aed;
  --cyan: #0891b2;
  --ok: #059669; --ok-bg: rgba(5, 150, 105, .10);
  --warn: #b45309; --warn-bg: rgba(217, 119, 6, .12);
  --info: #0e7490; --info-bg: rgba(8, 145, 178, .10);
  --bad: #dc2626; --bad-bg: rgba(220, 38, 38, .10);
  --side: #0d0d2b; --side-text: #c7cbef; --side-dim: #7e84b5; --side-hover: rgba(255,255,255,.06); --side-on: rgba(255,255,255,.10);
  --grad: linear-gradient(120deg, #7c3aed, #2563eb 55%, #06b6d4);
  --shadow: 0 1px 2px rgba(15,23,42,.04), 0 8px 24px rgba(15,23,42,.06);
  --shadow-lg: 0 24px 60px rgba(15,23,42,.14);
  --r: 16px;
  --display: 'Calistoga', Georgia, serif;
  --font: 'Inter', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: light;
}
[data-theme="dark"] {
  --bg: #07071a;
  --bg-mesh-1: rgba(79, 124, 255, .18); --bg-mesh-2: rgba(139, 92, 246, .14); --bg-mesh-3: rgba(34, 211, 238, .08);
  --surface: rgba(19, 19, 52, .72); --surface-solid: #131334; --surface-2: #1a1a42;
  --border: rgba(160, 170, 255, .12); --border-2: rgba(160, 170, 255, .22);
  --text: #eef0ff; --muted: #b3b8de; --dim: #8a90bd;
  --primary: #5b8cff; --primary-ink: #0b0b20;
  --ok: #34d399; --ok-bg: rgba(52,211,153,.12); --warn: #fbbf24; --warn-bg: rgba(251,191,36,.12);
  --info: #22d3ee; --info-bg: rgba(34,211,238,.12); --bad: #f87171; --bad-bg: rgba(248,113,113,.12);
  --side: #050514;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background:
    radial-gradient(900px 520px at 85% -10%, var(--bg-mesh-1), transparent 60%),
    radial-gradient(700px 480px at 30% 110%, var(--bg-mesh-2), transparent 60%),
    radial-gradient(600px 420px at 110% 70%, var(--bg-mesh-3), transparent 60%), var(--bg);
  background-attachment: fixed;
  color: var(--text); font: 15px/1.55 var(--font); -webkit-font-smoothing: antialiased;
}
button, input, textarea, select { font: inherit; color: inherit; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 8px; }
svg { flex: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- Shell ---------- */
.shell { display: grid; grid-template-columns: 260px minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--side); color: var(--side-text); padding: 18px 14px; display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; }
.brand img { width: 38px; height: 38px; border-radius: 50%; }
.brand b { display: block; font-family: var(--display); font-weight: 400; font-size: 19px; color: #fff; line-height: 1.1; }
.brand span { font-family: var(--mono); font-size: 10.5px; letter-spacing: .2em; text-transform: uppercase; color: var(--side-dim); }
.switcher { width: 100%; display: flex; align-items: center; gap: 10px; padding: 10px; margin-bottom: 10px; border-radius: 12px; border: 1px solid rgba(255,255,255,.10); background: rgba(255,255,255,.04); color: #fff; cursor: pointer; text-align: left; }
.switcher small { display: block; color: var(--side-dim); font-size: 11.5px; }
.switcher select { appearance: none; background: transparent; border: 0; color: #fff; width: 100%; cursor: pointer; font-weight: 600; }
.switcher select option { color: #0f172a; }
.biz-dot { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; font-weight: 700; color: #fff; flex: none; font-size: 14px; }
.nav-label { margin: 14px 10px 4px; font-family: var(--mono); font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--side-dim); }
.nav-item { display: flex; align-items: center; gap: 11px; width: 100%; min-height: 40px; padding: 8px 10px; border: 0; border-radius: 10px; background: transparent; color: var(--side-text); cursor: pointer; text-align: left; transition: background .15s var(--ease), color .15s; }
.nav-item svg { width: 18px; height: 18px; opacity: .85; }
.nav-item:hover { background: var(--side-hover); color: #fff; }
.nav-item.on { background: var(--side-on); color: #fff; box-shadow: inset 2px 0 0 #6d8cff; }
.nav-item .count { margin-left: auto; font-size: 11px; padding: 1px 7px; border-radius: 999px; background: rgba(255,255,255,.10); }
.nav-item.heart { background: linear-gradient(120deg, rgba(124,58,237,.35), rgba(37,99,235,.35)); color: #fff; }
.nav-item.heart.on { box-shadow: inset 0 0 0 1px rgba(255,255,255,.25); }
.side-foot { margin-top: auto; padding: 12px 10px 4px; font-size: 12px; color: var(--side-dim); display: flex; align-items: center; gap: 8px; }
.pulse { width: 7px; height: 7px; border-radius: 50%; background: #34d399; box-shadow: 0 0 0 0 rgba(52,211,153,.6); animation: pulse 2.4s infinite; }
.pulse.off { background: #f87171; animation: none; }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px rgba(52,211,153,0); } 100% { box-shadow: 0 0 0 0 rgba(52,211,153,0); } }

.top { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 14px 32px; position: sticky; top: 0; z-index: 5; backdrop-filter: blur(14px); background: color-mix(in srgb, var(--bg) 70%, transparent); border-bottom: 1px solid var(--border); }
.top .crumb { margin-right: auto; color: var(--dim); font-size: 13px; }
.top .crumb b { color: var(--text); font-weight: 600; }
.seg { display: inline-flex; border: 1px solid var(--border-2); border-radius: 10px; overflow: hidden; background: var(--surface); }
.seg button { border: 0; background: transparent; padding: 6px 11px; cursor: pointer; font-size: 12.5px; font-weight: 600; color: var(--muted); min-height: 34px; }
.seg button.on { background: var(--text); color: var(--bg); }
.icon-btn { width: 36px; height: 36px; display: inline-grid; place-items: center; border-radius: 10px; border: 1px solid var(--border-2); background: var(--surface); cursor: pointer; color: var(--muted); }
.icon-btn:hover { color: var(--text); }
.icon-btn svg { width: 17px; height: 17px; }
.avatar-btn { display: flex; align-items: center; gap: 8px; border: 1px solid var(--border-2); background: var(--surface); border-radius: 999px; padding: 3px 12px 3px 3px; cursor: pointer; min-height: 36px; }
.avatar-btn i { width: 28px; height: 28px; border-radius: 50%; background: var(--grad); color: #fff; display: grid; place-items: center; font-style: normal; font-weight: 700; font-size: 12px; }

.main { padding: 28px 32px 80px; max-width: 1280px; width: 100%; }

/* ---------- Tipografía ---------- */
.eyebrow { font-family: var(--mono); font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--dim); }
h1, .display { font-family: var(--display); font-weight: 400; letter-spacing: -.01em; }
h1 { font-size: clamp(28px, 3.2vw, 40px); line-height: 1.08; margin: 6px 0 6px; text-wrap: balance; }
h2 { font-size: 16.5px; font-weight: 600; margin: 0; letter-spacing: -.005em; }
h3 { font-size: 15px; font-weight: 600; margin: 0; }
.sub { color: var(--muted); margin: 0; text-wrap: pretty; }
.small { font-size: 13px; }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 22px; flex-wrap: wrap; }

/* ---------- Superficies ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 20px; box-shadow: var(--shadow); backdrop-filter: blur(16px) saturate(1.2); -webkit-backdrop-filter: blur(16px) saturate(1.2); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.split { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); }
.click { cursor: pointer; transition: transform .2s var(--ease), box-shadow .2s var(--ease), border-color .2s; }
.click:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: var(--border-2); }

.kpi .num { font-family: var(--display); font-size: 34px; line-height: 1; }
.kpi .lbl { color: var(--muted); font-size: 13px; margin-top: 6px; }
.kpi .ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); color: var(--primary); margin-bottom: 12px; }
.kpi .ic svg { width: 17px; height: 17px; }

.chip { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.chip.ok { background: var(--ok-bg); color: var(--ok); }
.chip.warn { background: var(--warn-bg); color: var(--warn); }
.chip.info { background: var(--info-bg); color: var(--info); }
.chip.bad { background: var(--bad-bg); color: var(--bad); }
.chip::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.chip.plain::before { display: none; }

/* ---------- Botones ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 8px 16px; border-radius: 11px; border: 1px solid var(--border-2); background: var(--surface-solid); cursor: pointer; font-weight: 600; font-size: 14px; transition: transform .1s, filter .15s, box-shadow .15s; white-space: nowrap; }
.btn:hover { filter: brightness(.98); box-shadow: var(--shadow); }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--primary); color: #fff; border-color: transparent; }
.btn.grad { background: var(--grad); color: #fff; border-color: transparent; }
.btn.ghost { background: transparent; }
.btn.sm { min-height: 34px; padding: 5px 12px; font-size: 13px; }
.btn svg { width: 16px; height: 16px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.x-btn { background: none; border: 0; color: var(--dim); cursor: pointer; width: 32px; height: 32px; border-radius: 8px; display: inline-grid; place-items: center; }
.x-btn:hover { color: var(--bad); background: var(--bad-bg); }
.x-btn svg { width: 15px; height: 15px; }

/* ---------- Formularios ---------- */
.form { display: grid; gap: 14px; }
.form label, .field-l { display: grid; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
.form .hint { font-weight: 400; color: var(--dim); font-size: 12px; }
input, textarea, select { width: 100%; background: var(--surface-solid); border: 1px solid var(--border-2); border-radius: 11px; padding: 10px 12px; outline: none; min-height: 42px; transition: border-color .15s, box-shadow .15s; }
textarea { resize: vertical; }
input:focus, textarea:focus, select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 20%, transparent); }
.form .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.err { color: var(--bad); font-size: 13px; min-height: 18px; }

/* ---------- Claude (corazón) ---------- */
.heart-card { position: relative; overflow: hidden; padding: 26px; border: 0; color: #fff; background: radial-gradient(600px 300px at 100% 0%, rgba(6,182,212,.45), transparent 60%), linear-gradient(130deg, #1e1b4b, #312e81 45%, #1d4ed8); box-shadow: 0 30px 60px -20px rgba(37,99,235,.45); }
.heart-card .sub { color: rgba(255,255,255,.78); }
.heart-card .eyebrow { color: rgba(255,255,255,.6); }
.heart-card h1 { color: #fff; }
.heart-orb { position: absolute; right: -60px; top: -60px; width: 240px; height: 240px; border-radius: 50%; background: conic-gradient(from 200deg, #7c3aed, #2563eb, #06b6d4, #7c3aed); filter: blur(40px); opacity: .45; animation: spin 18s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.composer { position: relative; display: flex; gap: 10px; align-items: flex-end; margin-top: 18px; background: rgba(255,255,255,.96); border-radius: 14px; padding: 8px 8px 8px 14px; box-shadow: 0 10px 30px rgba(0,0,0,.18); }
.composer textarea { border: 0; box-shadow: none; background: transparent; color: #0f172a; min-height: 44px; max-height: 180px; padding: 10px 0; }
.composer textarea:focus { box-shadow: none; }
.suggest { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.suggest button { border: 1px solid rgba(255,255,255,.25); background: rgba(255,255,255,.08); color: #fff; border-radius: 999px; padding: 6px 12px; cursor: pointer; font-size: 13px; min-height: 34px; }
.suggest button:hover { background: rgba(255,255,255,.16); }

.chat { display: flex; flex-direction: column; gap: 14px; max-height: 58vh; overflow-y: auto; padding: 4px 4px 12px; scroll-behavior: smooth; }
.msg { display: flex; gap: 10px; align-items: flex-start; max-width: 860px; }
.msg.user { flex-direction: row-reverse; margin-left: auto; }
.msg .who { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: none; color: #fff; background: #d97757; }
.msg.user .who { background: var(--primary); }
.msg .bubble { background: var(--surface-solid); border: 1px solid var(--border); border-radius: 14px; padding: 11px 14px; white-space: normal; box-shadow: var(--shadow); }
.msg.user .bubble { background: var(--primary); color: #fff; border-color: transparent; }
.msg .bubble p { margin: 0 0 8px; } .msg .bubble p:last-child { margin: 0; }
.msg .bubble ul { margin: 4px 0 8px; padding-left: 20px; }
.msg .meta { font-size: 11.5px; color: var(--dim); margin-top: 4px; }
.chat-box { display: flex; gap: 10px; align-items: flex-end; border: 1px solid var(--border-2); background: var(--surface-solid); border-radius: 14px; padding: 8px; }
.chat-box textarea { border: 0; box-shadow: none; min-height: 44px; max-height: 200px; }
.chat-box select { width: auto; max-width: 220px; min-height: 40px; font-size: 13px; }
.typing { display: inline-flex; gap: 4px; } .typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--dim); animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .2s; } .typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 50% { opacity: .2; } }
.code { font-family: var(--mono); font-size: 12.5px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 12px; white-space: pre-wrap; word-break: break-all; }

/* ---------- Listas ---------- */
.rows > * { display: flex; align-items: center; gap: 12px; padding: 12px 2px; border-bottom: 1px solid var(--border); }
.rows > *:last-child { border-bottom: 0; }
.rows .date { font-family: var(--mono); font-size: 12px; color: var(--dim); width: 110px; flex: none; }
.dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.task input { width: 18px; height: 18px; min-height: 0; accent-color: var(--primary); flex: none; }
.task.done .t { color: var(--dim); text-decoration: line-through; }
.task .due { margin-left: auto; font-family: var(--mono); font-size: 12px; color: var(--dim); }

.fields .f { display: grid; grid-template-columns: 120px 1fr; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--border); }
.fields .f:last-child { border-bottom: 0; }
.fields dt { color: var(--dim); font-size: 13px; }
.fields dd { margin: 0; word-break: break-word; }

.channel { display: flex; gap: 12px; padding: 14px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface-solid); cursor: pointer; transition: border-color .15s, transform .15s; min-height: 92px; }
.channel:hover { border-color: var(--border-2); transform: translateY(-1px); }
.ch-ic { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; background: var(--surface-2); flex: none; }
.ch-ic svg { width: 20px; height: 20px; }
.ch-b { min-width: 0; flex: 1; }
.ch-t { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.ch-h { font-family: var(--mono); font-size: 12.5px; color: var(--muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-n { margin: 4px 0 0; font-size: 12.5px; color: var(--dim); }

.prompt pre { margin: 10px 0; white-space: pre-wrap; font: 12.5px/1.6 var(--mono); color: var(--muted); background: var(--surface-2); border-radius: 10px; padding: 12px; max-height: 220px; overflow: auto; }
.filters { display: flex; gap: 6px; flex-wrap: wrap; }
.filters button { border: 1px solid var(--border-2); background: var(--surface); border-radius: 999px; padding: 6px 13px; color: var(--muted); cursor: pointer; font-size: 13px; min-height: 34px; }
.filters button.on { background: var(--text); color: var(--bg); border-color: transparent; }

.insight .meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; color: var(--dim); font-size: 12px; font-family: var(--mono); margin-top: 10px; }
.metric { color: var(--info); font-weight: 600; }

/* Biblioteca */
.book { display: flex; flex-direction: column; gap: 10px; }
.cover { aspect-ratio: 3 / 4; border-radius: 12px; display: flex; flex-direction: column; justify-content: space-between; padding: 14px; color: #fff; position: relative; overflow: hidden; box-shadow: var(--shadow); }
.cover::after { content: ''; position: absolute; inset: 0 auto 0 0; width: 10px; background: rgba(0,0,0,.18); }
.cover b { font-family: var(--display); font-weight: 400; font-size: 19px; line-height: 1.15; text-wrap: balance; position: relative; z-index: 1; }
.cover small { font-family: var(--mono); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; opacity: .85; position: relative; z-index: 1; }
.dropzone { border: 1.5px dashed var(--border-2); border-radius: 14px; padding: 22px; text-align: center; color: var(--muted); background: var(--surface); cursor: pointer; transition: border-color .15s, background .15s; }
.dropzone svg { width: 26px; height: 26px; color: var(--primary); }
.dropzone.over, .dropzone:hover { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 6%, var(--surface)); }

/* Calendario */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal .dow { font-family: var(--mono); font-size: 10.5px; color: var(--dim); text-transform: uppercase; letter-spacing: .12em; padding: 4px 6px; }
.cal .day { min-height: 96px; border: 1px solid var(--border); border-radius: 11px; padding: 6px; background: var(--surface-solid); cursor: pointer; transition: border-color .15s; }
.cal .day:hover { border-color: var(--primary); }
.cal .day.out { opacity: .4; }
.cal .day.today { box-shadow: inset 0 0 0 2px var(--primary); }
.cal .n { font-size: 12px; color: var(--muted); font-weight: 600; }
.ev { display: block; font-size: 11.5px; padding: 3px 6px; border-radius: 6px; margin-top: 4px; background: var(--surface-2); border-left: 3px solid var(--c, var(--primary)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Tabla de subcuentas */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; color: var(--dim); font-weight: 600; padding: 10px; border-bottom: 1px solid var(--border-2); }
.table td { padding: 12px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table-wrap { overflow-x: auto; }

/* ---------- Pantallas de acceso ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
.auth-art { background: var(--side); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth-art .heart-orb { width: 520px; height: 520px; right: -160px; top: 20%; opacity: .55; filter: blur(70px); }
.auth-art h1 { font-size: clamp(34px, 4vw, 54px); color: #fff; position: relative; max-width: 560px; }
.auth-art p { color: #c7cbef; max-width: 520px; position: relative; font-size: 16px; }
.auth-art ul { list-style: none; padding: 0; margin: 26px 0 0; display: grid; gap: 12px; position: relative; }
.auth-art li { display: flex; gap: 10px; align-items: center; color: #e4e6ff; }
.auth-art li svg { width: 18px; height: 18px; color: #67e8f9; }
.auth-panel { display: grid; place-items: center; padding: 40px 24px; }
.auth-box { width: min(460px, 100%); }
.auth-tabs { display: flex; gap: 4px; padding: 4px; border-radius: 12px; background: var(--surface-2); margin: 18px 0 20px; }
.auth-tabs button { flex: 1; border: 0; background: transparent; padding: 9px; border-radius: 9px; cursor: pointer; font-weight: 600; color: var(--muted); min-height: 40px; }
.auth-tabs button.on { background: var(--surface-solid); color: var(--text); box-shadow: var(--shadow); }
.steps { display: flex; gap: 6px; margin-bottom: 18px; }
.steps i { flex: 1; height: 4px; border-radius: 4px; background: var(--border-2); }
.steps i.on { background: var(--primary); }
.plan { border: 2px solid var(--primary); border-radius: var(--r); padding: 22px; background: var(--surface-solid); }
.plan .price { font-family: var(--display); font-size: 44px; line-height: 1; }
.plan ul { padding: 0; list-style: none; display: grid; gap: 9px; margin: 16px 0 20px; }
.plan li { display: flex; gap: 9px; align-items: flex-start; }
.plan li svg { width: 18px; height: 18px; color: var(--ok); margin-top: 2px; }

.toast { position: fixed; bottom: 24px; left: 50%; translate: -50% 20px; opacity: 0; background: var(--text); color: var(--bg); padding: 11px 18px; border-radius: 12px; transition: opacity .2s var(--ease), translate .2s var(--ease); pointer-events: none; z-index: 50; font-weight: 500; box-shadow: var(--shadow-lg); }
.toast.show { opacity: 1; translate: -50% 0; }
dialog { background: var(--surface-solid); color: var(--text); border: 1px solid var(--border-2); border-radius: 18px; padding: 24px; width: min(540px, 94vw); box-shadow: var(--shadow-lg); }
dialog::backdrop { background: rgba(8, 10, 30, .45); backdrop-filter: blur(4px); }
dialog .actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }
.empty { color: var(--dim); font-size: 14px; padding: 14px 0; }
.menu { position: absolute; right: 32px; top: 58px; background: var(--surface-solid); border: 1px solid var(--border-2); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; min-width: 220px; z-index: 20; }
.menu button { width: 100%; text-align: left; border: 0; background: none; padding: 9px 12px; border-radius: 8px; cursor: pointer; min-height: 38px; }
.menu button:hover { background: var(--surface-2); }
.menu .who-m { padding: 9px 12px; font-size: 13px; color: var(--dim); border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.reveal { animation: up .35s var(--ease) both; }
@keyframes up { from { opacity: 0; transform: translateY(8px); } }

.mobile-bar { display: none; }
.legal { margin-top: 40px; padding-top: 14px; border-top: 1px solid var(--border); font-size: 12px; color: var(--dim); text-align: center; }
.legal a { color: var(--dim); }
.legal a:hover { color: var(--primary); }

@media (max-width: 1100px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split, .g3 { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { display: none; position: fixed; inset: 0 auto 0 0; width: 280px; z-index: 30; }
  .side.open { display: flex; box-shadow: var(--shadow-lg); }
  .mobile-bar { display: inline-grid; }
  .top { padding: 10px 16px; }
  .main { padding: 18px 16px 60px; }
  .g2 { grid-template-columns: 1fr; }
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .auth { grid-template-columns: 1fr; }
  .auth-art { padding: 28px 22px; }
  .auth-art ul { display: none; }
  .form .row2 { grid-template-columns: 1fr; }
  .cal .day { min-height: 58px; }
  .cal .ev { display: none; }
  .cal .day.has::after { content: ''; display: block; width: 6px; height: 6px; border-radius: 50%; background: var(--primary); margin-top: 6px; }
  .chat-box { flex-wrap: wrap; }
  .chat-box select { max-width: 100%; width: 100%; }
  .fields .f { grid-template-columns: 1fr; gap: 2px; }
  .menu { right: 16px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
