:root {
    --color-primary: #2563eb;
    --color-primary-dark: #1d4ed8;
    --color-ai: #7c3aed;
    --color-navy: #0f172a;
    --color-bg: #f8fafc;
    --color-surface: #ffffff;
    --color-border: #e2e8f0;
    --color-text: #0f172a;
    --color-muted: #64748b;
    --color-success: #16a34a;
    --color-warning: #d97706;
    --color-danger: #dc2626;
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 24px;
    --space-6: 32px;
    --radius-control: 8px;
    --radius-card: 12px;
    --radius-modal: 16px;
    --duration: 180ms;
    --header: 64px;
    --sidebar: 248px;
    --font: Inter, "Segoe UI", ui-sans-serif, system-ui, sans-serif;
    --blue: var(--color-primary);
    --blue-dark: var(--color-primary-dark);
    --navy: var(--color-navy);
    --navy-2: #1e293b;
    --canvas: var(--color-bg);
    --card: var(--color-surface);
    --ink: var(--color-text);
    --muted: var(--color-muted);
    --line: var(--color-border);
    --green: var(--color-success);
    --amber: var(--color-warning);
    --red: var(--color-danger);
    --radius: var(--radius-card);
    --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 8px 24px rgba(15, 23, 42, .04);
}
[data-theme="dark"] {
    --color-bg: #0b1220;
    --color-surface: #121a2b;
    --color-text: #e5e7eb;
    --color-muted: #94a3b8;
    --color-border: #243049;
    --color-primary: #3b82f6;
    --color-ai: #a78bfa;
    --shadow: none;
    --bs-body-bg: var(--color-bg);
    --bs-body-color: var(--color-text);
    --bs-card-bg: var(--color-surface);
    --bs-card-color: var(--color-text);
    --bs-border-color: var(--color-border);
    --bs-secondary-bg: #182236;
    --bs-tertiary-bg: #1e293b;
    --bs-emphasis-color: var(--color-text);
}
* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
    margin: 0;
    font-family: var(--font);
    color: var(--ink);
    background:
        radial-gradient(880px 280px at 100% -140px, rgba(47, 111, 237, .07), transparent 62%),
        var(--canvas);
    -webkit-font-smoothing: antialiased;
}
::selection { background: #dbe7ff; color: var(--ink); }
:focus-visible { outline: 3px solid #93c5fd; outline-offset: 2px; }
a { color: var(--blue); text-decoration: none; }


.btn-primary { background: var(--blue); border-color: var(--blue); }
.btn-primary:hover, .btn-primary:focus { background: var(--blue-dark); border-color: var(--blue-dark); }
.btn-outline-primary {
    color: var(--blue);
    border-color: #c9dafd;
    background: #fff;
}
.btn-outline-primary:hover { background: #f3f7ff; color: var(--blue-dark); border-color: #b9cffb; }
.form-control, .form-select {
    border-radius: var(--radius-control);
    border-color: var(--line);
    color: var(--ink);
}
.form-label { font-weight: 650; font-size: 14px; color: #334155; }
.card, .panel {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 14px 34px rgba(15, 23, 42, .05);
}
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
    width: var(--sidebar);
    background: linear-gradient(180deg, #1e293b 0%, var(--color-navy) 48%, #0b1220 100%);
    color: #dbe4f3;
    padding: 18px 14px 14px;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    flex-shrink: 0;
    z-index: 30;
    box-shadow: inset -1px 0 0 rgba(255, 255, 255, .06);
}
.sidebar > nav { display: flex; flex-direction: column; min-height: 0; flex: 1; overflow: auto; }
.sidebar nav.side-scroll { overflow: auto; flex: 1; padding-right: 2px; }
.login-hero .brand { color: var(--ink); padding-left: 0; }
.brand {
    display: flex;
    gap: 10px;
    align-items: center;
    color: white;
    font-weight: 800;
    letter-spacing: -.02em;
    padding: 6px 8px 18px;
    font-size: 18px;
}
.brand-mark {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    background: var(--blue);
    display: grid;
    place-items: center;
    color: white;
    flex-shrink: 0;
}
.side-link {
    display: flex;
    gap: 10px;
    align-items: center;
    color: #c5d0e2;
    border-radius: 12px;
    padding: 10px 12px;
    margin-bottom: 4px;
    font-weight: 600;
    font-size: 14px;
}
button.side-link { width: 100%; background: transparent; border: 0; text-align: left; cursor: pointer; }
.side-link svg { flex-shrink: 0; opacity: .9; }
.side-link.active, .side-link[aria-current="page"] {
    background: var(--blue);
    color: white;
    box-shadow: none;
}
.side-link:hover { color: white; background: rgba(255, 255, 255, .08); }
.side-link.active:hover, .side-link[aria-current="page"]:hover { background: var(--blue); }
.side-label {
    margin: 16px 12px 8px;
    color: #8ea0bb;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}
.side-footer {
    margin-top: auto;
    padding: 12px 4px 2px;
    border-top: 1px solid rgba(255, 255, 255, .08);
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex-shrink: 0;
}
.side-footer form { margin: 0; }
.user-chip { display: flex; gap: 10px; align-items: center; color: white; }
.user-chip small, .user-meta small { display: block; color: #93a4bf; font-size: 12px; font-weight: 500; }
.user-meta { min-width: 0; }
.user-meta strong, .user-meta span { display: block; }
.user-meta span { font-weight: 700; font-size: 14px; }
.user-meta span, .user-meta small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.signout-link {
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 36px;
    margin: 0;
    padding: 6px 10px;
    border-radius: 10px;
    color: #b7c5d8;
    font-size: 13px;
    font-weight: 600;
    background: none;
    border: 0;
    text-align: left;
}
.signout-link:hover { color: white; background: rgba(255, 255, 255, .06); }
.avatar, .avatar-sm {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    color: white;
    font-weight: 800;
    background: var(--blue);
    flex-shrink: 0;
}
.avatar-sm { width: 28px; height: 28px; border-radius: 9px; font-size: 11px; }
.side-search { margin: 0 8px 12px; display: flex; gap: 8px; flex-shrink: 0; }
.side-search input {
    width: 100%;
    min-width: 0;
    min-height: 44px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, .16);
    background: rgba(255, 255, 255, .08);
    color: white;
    padding: 0 12px;
    font-size: 16px;
}
.side-search input::placeholder { color: #94a3b8; }
.side-search button {
    min-height: 44px;
    min-width: 44px;
    border: 0;
    border-radius: 12px;
    background: var(--blue);
    color: white;
    font-weight: 700;
    font-size: 14px;
    padding: 0 12px;
}
.sidebar-scope { position: relative; margin: 0 4px 12px; }
.sidebar-scope .side-label { margin: 0 4px 8px; }
.scope-trigger, .scope-option {
    width: 100%;
    min-height: 44px;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 0;
    background: transparent;
    color: white;
    text-align: left;
    font-weight: 700;
    font-size: 14px;
}
.scope-trigger {
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, .14);
    background: rgba(255, 255, 255, .06);
    padding: 0 12px;
}
.scope-trigger svg { margin-left: auto; flex-shrink: 0; opacity: .8; }
.scope-trigger-text, .scope-option span:last-child {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.scope-mark {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    background: var(--blue);
    color: white;
    font-size: 11px;
    font-weight: 800;
}
.scope-panel {
    position: absolute;
    z-index: 40;
    left: 0;
    right: 0;
    top: calc(100% - 4px);
    padding: 8px;
    border-radius: 14px;
    background: #101a30;
    border: 1px solid rgba(255, 255, 255, .12);
    box-shadow: 0 16px 40px rgba(0, 0, 0, .28);
}
.scope-panel input {
    width: 100%;
    min-height: 44px;
    margin-bottom: 6px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, .14);
    background: rgba(255, 255, 255, .06);
    color: white;
    font-size: 16px;
    padding: 0 12px;
}
.scope-panel input::placeholder { color: #94a3b8; }
.scope-panel ul { list-style: none; margin: 0; padding: 0; max-height: 280px; overflow: auto; }
.scope-option { border-radius: 10px; padding: 0 8px; }
.scope-option:hover, .scope-option.is-active { background: rgba(255, 255, 255, .08); }
.scope-option.is-current { background: rgba(37, 99, 235, .28); }
.scope-group, .scope-empty {
    padding: 8px 8px 4px;
    color: #8ea0bb;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}
.scope-empty { letter-spacing: 0; text-transform: none; font-size: 13px; font-weight: 600; }
.tenant-switch {
    flex-shrink: 0;
    display: flex;
    gap: 10px;
    align-items: center;
    background: #152544;
    border-radius: 14px;
    padding: 10px;
    margin: 0 4px 12px;
    color: white;
}
.tenant-switch strong { display: block; font-size: 14px; }
.tenant-switch small { color: #93a4bf; }
.btn-new {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: calc(100% - 8px);
    margin: 0 4px 8px;
    background: #16315f;
    color: white;
    border: 1px solid #2a4a7a;
    border-radius: 12px;
    min-height: 44px;
    font-weight: 700;
}
.btn-new:hover { background: #1c3d72; color: white; }
.op-row {
    width: 100%;
    display: flex;
    gap: 10px;
    align-items: center;
    text-align: left;
    color: #d5e0f0;
    background: transparent;
    border: 0;
    border-radius: 12px;
    padding: 8px 10px;
    font-weight: 650;
}
.op-row.active, .op-row:hover { background: rgba(255, 255, 255, .06); color: white; }
.sidebar-backdrop { display: none; }
.nav-toggle {
    display: none;
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 25;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: white;
    color: var(--ink);
}
.main { flex: 1; min-width: 0; }
.topbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 22px 24px 0;
}
.admin-topbar {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    column-gap: 12px;
    row-gap: 8px;
    background: var(--card);
    border-bottom: 1px solid var(--line);
    margin: 0;
    padding: 10px 20px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, .06);
    position: sticky;
    top: 0;
    z-index: 30;
    flex-shrink: 0;
}
.admin-topbar .topbar-title {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    align-self: center;
    min-width: 0;
    flex: 0 1 auto;
    order: 1;
}
.admin-topbar h1 { font-size: clamp(22px, 2vw, 28px); font-weight: 800; letter-spacing: -.03em; line-height: 1.15; }
.admin-topbar .topbar-actions {
    display: flex;
    flex-direction: row;
    align-items: center;
    align-self: center;
    gap: 8px;
    margin-left: auto;
    flex: 0 0 auto;
    order: 3;
}
.admin-topbar .topbar-filters + .topbar-actions { margin-left: 8px; }
.admin-topbar .topbar-filters {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex: 0 1 auto;
    margin-left: auto;
    min-width: 0;
    order: 2;
}
.admin-topbar .topbar-filters .range-form { margin-left: 0; max-width: 100%; flex-wrap: nowrap; height: 44px; }
.admin-topbar .range-form input[type="date"] { width: 118px; min-width: 0; }
.admin-topbar .range-form select { width: 118px; max-width: 118px; min-width: 0; }
@media (min-width: 1400px) {
    .admin-topbar { flex-wrap: nowrap; align-items: center; }
}
.admin-topbar .range-form,
.admin-topbar .dropdown { display: flex; align-items: center; }

.admin-topbar .dropdown-menu { z-index: 30; }
.admin-topbar .icon-btn { width: 44px; height: 44px; min-height: 44px; border-radius: 12px; }
.topbar h1 { font-size: 28px; line-height: 1.15; font-weight: 800; margin: 0; letter-spacing: -.03em; }
.admin-topbar.topbar h1 { font-size: clamp(22px, 2vw, 28px); font-weight: 800; letter-spacing: -.03em; line-height: 1.15; }
.topbar p { margin: 4px 0 0; color: var(--muted); }
.admin-topbar.topbar p { margin: 2px 0 0; }
.topbar-tools { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.search { position: relative; width: min(280px, 36vw); }
.search svg { position: absolute; left: 14px; top: 12px; color: #94a3b8; }
.search input {
    width: 100%;
    height: 42px;
    min-height: 42px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: white;
    padding: 0 14px 0 40px;
}
.range-form, .icon-btn, .avatar-btn {
    min-height: 44px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: white;
    display: inline-flex;
    align-items: center;
}
.icon-btn, .avatar-btn { height: 44px; border-radius: 14px; }
.range-form {
    height: auto;
    flex-wrap: wrap;
    padding: 6px 8px;
    gap: 6px;
    color: #334155;
    font-weight: 700;
    font-size: 14px;
    max-width: 100%;
}
.range-form input[type="date"], .range-form select {
    border: 0;
    background: #f4f7fb;
    border-radius: 10px;
    font-weight: 650;
    color: var(--ink);
    min-height: 36px;
    font-size: 14px;
    padding: 0 8px;
    max-width: none;
}
.icon-btn, .avatar-btn {
    width: 44px;
    justify-content: center;
    color: #334155;
    position: relative;
    padding: 0;
}
.avatar-btn { border-radius: 14px; background: var(--blue); color: white; font-weight: 800; text-decoration: none; }
.bell-dot {
    position: absolute;
    top: 8px;
    right: 9px;
    width: 8px;
    height: 8px;
    border-radius: 99px;
    background: #f59e0b;
    box-shadow: 0 0 0 2px white;
}
.content { padding: 18px 24px 36px; }
.stat-grid, .dash-grid, .workspace-panels { display: grid; gap: 16px; }
.stat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 16px; }
.dash-grid { grid-template-columns: minmax(0, 1.7fr) minmax(280px, .9fr); align-items: start; }
.stat { padding: 16px 18px 14px; min-height: 132px; }
.stat-top, .card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.stat-ico {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    display: grid;
    place-items: center;
}
.stat-ico.blue { background: #e7f0ff; color: var(--color-primary); }
.stat-ico.cyan { background: #e5f7fb; color: #0891b2; }
.stat-ico.pink { background: #fde8f3; color: #e11d48; }
.stat-ico.green { background: #e7f8ee; color: #16a34a; }
.spark { width: 72px; height: 36px; }
.stat .label { display: block; margin-top: 12px; color: var(--muted); font-size: 13px; font-weight: 650; }
.stat b { display: block; font-size: 30px; letter-spacing: -.03em; line-height: 1.1; margin-top: 2px; }
.delta { color: var(--muted); font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; gap: 4px; }
.brand-logo { width: 100%; }
.delta.up { color: #15803d; }
.delta.down { color: #dc2626; }
.panel-card { padding: 8px 8px 4px; }
.card-head { padding: 18px 16px 8px; align-items: center; }
.card-head h2 { font-size: 16px; font-weight: 800; margin: 0; letter-spacing: -.02em; }
.view-all { font-size: 13px; font-weight: 700; }
.table { margin: 0; }
.table thead th {
    color: #94a3b8;
    font-size: 12px;
    font-weight: 700;
    border-bottom-color: var(--line);
    padding: 12px;
}
.table td { padding: 12px; vertical-align: middle; border-bottom-color: #f1f5f9; }
.tenant-link { font-weight: 700; }
.tenant-list { max-height: 540px; overflow: auto; padding: 4px; }
.tenant-row {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 12px;
    border-radius: 14px;
}
.tenant-row + .tenant-row { border-top: 1px solid #f1f5f9; }
.tenant-row .grow { min-width: 0; flex: 1; }
.tenant-row strong { display: block; }
.tenant-row small { color: var(--muted); }
.pill {
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}
.pill-green { background: #e8f8ef; color: #15803d; }
.pill-amber { background: #fff6dd; color: #b45309; }
.pill-red { background: #fee2e2; color: #b91c1c; }
.pill-blue { background: #e7f0ff; color: var(--color-primary-dark); }
.pill-slate { background: #eef2f7; color: #475569; }
.crumb { color: var(--muted); font-size: 13px; font-weight: 650; margin-bottom: 12px; }
.crumb a { color: #64748b; }
.crumb span { color: var(--ink); }
.identity {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    padding: 18px 20px;
    margin-bottom: 8px;
}
.identity-main { flex: 1; }
.identity-main { display: flex; gap: 14px; align-items: center; min-width: 0; }
.identity h1 { font-size: 26px; font-weight: 800; margin: 0 0 2px; letter-spacing: -.03em; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.identity p { margin: 0; color: var(--muted); }
.mark {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    color: white;
    font-weight: 800;
    font-size: 20px;
    flex-shrink: 0;
}
.tenant-tabs { display: flex; gap: 4px; padding: 4px; margin: 20px 0 12px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); overflow: auto; }
.tenant-tabs a {
    color: #64748b;
    font-weight: 700;
    padding: 10px 0 12px;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
}
.tenant-tabs a.is-active { color: var(--blue); border-bottom-color: var(--blue); }
.section-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; padding: 16px 16px 8px; }
.section-head h2 { margin: 0 0 4px; font-size: 18px; font-weight: 800; }
.section-head .btn { flex-shrink: 0; white-space: nowrap; align-self: center; }
.section-head p { margin: 0; color: var(--muted); max-width: 640px; }
.op-name { display: flex; gap: 12px; align-items: center; }
.op-name strong { display: block; }
.op-name small, .muted { color: var(--muted); }
.op-badge {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
}
.op-badge.sm { width: 32px; height: 32px; border-radius: 10px; }
.op-badge.event { background: #ffe8ee; color: #e11d48; }
.op-badge.tour { background: #e7f0ff; color: #2563eb; }
.op-badge.attraction { background: #f3e8ff; color: #7c3aed; }
.op-badge.transport { background: #fff1e6; color: #ea580c; }
.op-badge.article { background: #e6f7f4; color: #0f766e; }
.op-badge.establishment { background: #e7f8ee; color: #15803d; }
.doc-chip, .sheet-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 700;
    font-size: 13px;
}
.ver { background: #eef2f7; color: #475569; border-radius: 999px; padding: 1px 6px; font-size: 11px; }
.kebab { border: 0; background: transparent; width: 36px; height: 36px; border-radius: 10px; color: #64748b; }
.kebab:hover { background: #f1f5f9; }
.login-shell { min-height: 100vh; display: grid; grid-template-columns: 1.15fr .85fr; }
.login-hero { padding: 48px 6vw 32px; display: flex; flex-direction: column; }
.login-hero h1 { font-size: clamp(32px, 4vw, 46px); line-height: 1.12; font-weight: 800; letter-spacing: -.035em; margin: 8px 0 12px; max-width: 640px; }
.lede { color: #64748b; font-size: 18px; max-width: 420px; margin: 0; }
.hero-stage { position: relative; flex: 1; min-height: 340px; margin-top: 12px; }
.hero-art { width: min(560px, 100%); height: auto; display: block; }
.float-pill {
    position: absolute;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: white;
    border-radius: 999px;
    padding: 8px 14px 8px 8px;
    box-shadow: 0 10px 24px rgba(15, 23, 42, .08);
    font-weight: 800;
    color: #1e293b;
    z-index: 2;
}
.float-pill i {
    width: 28px;
    height: 28px;
    border-radius: 9px;
    display: grid;
    place-items: center;
}
.float-pill.events { top: 18%; left: 4%; }
.float-pill.tours { top: 8%; right: 8%; }
.float-pill.places { bottom: 18%; left: 8%; }
.float-pill.events i { background: #e7f0ff; color: var(--color-primary); }
.float-pill.tours i { background: #e7f8ee; color: #16a34a; }
.float-pill.places i { background: #fff6dd; color: #d97706; }
.trust-row { display: flex; flex-wrap: wrap; gap: 18px; color: #64748b; font-size: 13px; font-weight: 700; margin-top: auto; padding-top: 12px; }
.trust-row span { display: inline-flex; align-items: center; gap: 6px; }
.login-panel { min-height: 100vh; display: grid; place-items: center; padding: 32px 20px; }
.login-shell .login-panel { min-height: 100%; }
.login-card { width: min(440px, 100%); padding: 32px 28px 22px; border-radius: 24px; }
.login-card h2 { font-weight: 800; margin: 0; font-size: 28px; letter-spacing: -.03em; }
.login-card .sub { color: var(--muted); margin: 4px 0 18px; }
.password-field { position: relative; }
.password-field .form-control { padding-right: 46px; }
.eye {
    position: absolute;
    right: 6px;
    top: 6px;
    width: 36px;
    height: 36px;
    border: 0;
    background: transparent;
    color: #94a3b8;
    border-radius: 10px;
}
.login-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin: 12px 0 16px; font-size: 14px; }
.btn-signin { width: 100%; min-height: 48px; font-size: 16px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.or-line { display: flex; align-items: center; gap: 12px; color: #94a3b8; margin: 16px 0; font-size: 14px; }
.or-line::before, .or-line::after { content: ""; height: 1px; background: var(--line); flex: 1; }
.btn-google {
    width: 100%;
    min-height: 48px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: white;
    font-weight: 750;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.fine { color: #94a3b8; font-size: 12px; text-align: center; margin: 16px 0 0; }
.workspace-content { height: 100vh; display: flex; flex-direction: column; padding: 16px; gap: 12px; }
.workspace-panels { flex: 1; min-height: 0; grid-template-columns: minmax(0, 1fr) 332px; }
.chat-panel, .draft-panel {
    background: white;
    border: 1px solid var(--line);
    border-radius: 20px;
    box-shadow: var(--shadow);
    min-height: 0;
    display: flex;
    flex-direction: column;
}
.chat-head, .draft-head { padding: 16px 18px 12px; border-bottom: 1px solid var(--line); }
.chat-head { display: flex; gap: 12px; align-items: flex-start; }
.chat-head > div:not(.chat-actions) { flex: 1; min-width: 0; }
.chat-actions { margin-left: auto; display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; flex-shrink: 0; position: relative; z-index: 1; }
.chat-actions form { margin: 0; }
.chat-actions .text-tool { min-height: 44px; min-width: 44px; padding: 0 8px; }
.chat-head h1, .draft-head h2 { margin: 0; font-size: 16px; font-weight: 800; }
.chat-head p, .draft-kicker { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.draft-title { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.draft-meta { display: flex; justify-content: space-between; gap: 8px; margin-top: 10px; font-size: 13px; color: var(--muted); font-weight: 700; }
.draft-meta strong { color: var(--ink); }
.bar { height: 6px; background: #e8eef8; border-radius: 99px; margin-top: 8px; overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--blue); border-radius: inherit; }
.messages { flex: 1; overflow: auto; padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.msg { display: flex; gap: 10px; align-items: flex-end; max-width: 86%; }
.msg.user { margin-left: auto; flex-direction: row-reverse; }
.bubble { padding: 12px 14px; border-radius: 16px; line-height: 1.45; }
.bubble.assistant, .bubble.system { background: #f4f7fb; border-bottom-left-radius: 6px; }
.bubble.user { background: #e7f0ff; border-bottom-right-radius: 6px; }
.msg time { display: block; color: #94a3b8; font-size: 11px; margin-top: 4px; }
.msg.user time { text-align: right; }
.who { width: 34px; height: 34px; border-radius: 12px; display: grid; place-items: center; flex-shrink: 0; color: white; font-weight: 800; font-size: 12px; }
.who.bot { background: var(--blue); }
.who.me { background: #0f766e; }
.composer-wrap { padding: 12px 14px 14px; }
.composer {
    display: flex;
    gap: 8px;
    align-items: flex-end;
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 6px;
    background: white;
}
.composer textarea {
    flex: 1;
    border: 0;
    resize: none;
    min-height: 44px;
    max-height: 120px;
    padding: 10px 4px;
    box-shadow: none;
}
.composer textarea:focus { outline: none; }
.mic, .send-btn {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
}
.mic { border: 0; background: transparent; color: #64748b; }
.send-btn { border: 0; background: var(--blue); color: white; }
.wave {
    display: none;
    align-items: center;
    gap: 8px;
    color: var(--blue);
    font-size: 13px;
    font-weight: 700;
    padding: 0 8px 4px;
}
.is-listening .wave { display: flex; }
.wave i {
    width: 3px;
    height: 14px;
    border-radius: 99px;
    background: var(--blue);
    display: block;
    animation: pulse 1s ease-in-out infinite;
}
.wave i:nth-child(2) { height: 22px; animation-delay: .1s; }
.wave i:nth-child(3) { height: 10px; animation-delay: .2s; }
.wave i:nth-child(4) { height: 18px; animation-delay: .3s; }
.wave i:nth-child(5) { animation-delay: .15s; }
@keyframes pulse { 50% { transform: scaleY(.45); } }
.voice-row, .upload-audio { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 8px 4px 0; }
.voice-row p, .upload-audio { margin: 0; color: var(--muted); font-size: 13px; }
.text-tool { border: 0; background: transparent; color: var(--blue); font-weight: 700; font-size: 13px; min-height: 44px; padding: 0 10px; border-radius: 10px; }
.text-tool:hover { background: rgba(37, 99, 235, .08); }
.mic[aria-pressed="true"] { background: #fee2e2; color: #b91c1c; }
.send-btn:disabled { opacity: .6; }
.messages { scroll-padding-bottom: 12px; }
.bubble.assistant, .bubble.system { background: var(--color-bg); color: var(--ink); }
.composer, .composer textarea { background: var(--card); color: var(--ink); }
.history { padding: 0 18px 12px; }
.history a { display: flex; justify-content: space-between; gap: 8px; padding: 8px 0; border-top: 1px solid var(--line); font-weight: 700; color: var(--ink); }
.messages { scroll-behavior: smooth; }
.msg { animation: rise .28s ease both; }
.draft-list { flex: 1; overflow: auto; padding: 8px 18px 12px; }
.draft-field { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid #f1f5f9; }
.check {
    width: 22px;
    height: 22px;
    border-radius: 99px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    margin-top: 2px;
    background: #e8f8ef;
    color: #16a34a;
}
.check.wait { background: #f1f5f9; color: #94a3b8; }
.draft-field strong { display: block; font-size: 13px; }
.draft-input {
    border: 0;
    background: transparent;
    padding: 0;
    min-height: 0;
    width: 100%;
    color: #334155;
    font-weight: 650;
}
.draft-save { border: 0; background: transparent; color: var(--blue); font-size: 12px; font-weight: 800; padding: 0; }
.draft-foot { padding: 12px 16px 16px; }
.draft-foot .fine { text-align: left; }
.empty { text-align: center; padding: 36px 16px; color: var(--muted); }
.banner-test { background: #fff7ed; color: #9a3412; border: 1px solid #fdba74; border-radius: 12px; padding: 10px 12px; font-weight: 700; }
.mock-note { background: #eff6ff; color: #1e3a8a; border-radius: 12px; padding: 8px 12px; font-size: 13px; }
.field-row { display: flex; justify-content: space-between; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.alert { border: 0; border-radius: 12px; }
.alert-success { background: #ecfdf3; color: #166534; }
.alert-danger { background: #fef2f2; color: #991b1b; }
@media (max-width: 1100px) {
    .stat-grid { grid-template-columns: 1fr 1fr; }
    .dash-grid, .workspace-panels { grid-template-columns: 1fr; }
    .draft-panel { min-height: 320px; }
    .sidebar { position: fixed; transform: translateX(-105%); transition: transform .28s cubic-bezier(.2, .8, .2, 1); }
    .signout-link { min-height: 44px; }
    .sidebar.is-open { transform: none; z-index: 45; }
    .sidebar.is-open ~ .sidebar-backdrop { display: block; position: fixed; inset: 0; background: rgba(15, 23, 42, .4); z-index: 40; }
    .nav-toggle { display: inline-flex; align-items: center; justify-content: center; z-index: 50; }
    .workspace-content { height: auto; min-height: 100vh; }
    body.is-workspace { overflow: auto; }
}
@media (max-width: 720px) {
    .login-shell { grid-template-columns: 1fr; }
    .hero-stage { min-height: 240px; }
    .stat-grid { grid-template-columns: 1fr; }
    .content, .topbar { padding-left: 14px; padding-right: 14px; }
    .topbar { flex-direction: column; }
    .admin-topbar { flex-direction: row; align-items: center; }
    .identity { flex-direction: column; align-items: flex-start; }
    .section-head { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
    * { animation: none !important; transition: none !important; }
}

.side-link, .op-row, .btn, .tenant-row, .icon-btn, .sidebar-scope select, .dropdown-item, .tenant-tabs a {
    transition: background-color .16s ease, color .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.side-link.active:hover, .side-link[aria-current="page"]:hover { transform: none; }
.content { animation: none; }
@keyframes rise {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: none; }
}
.h3, .content > h1, .block-title {
    letter-spacing: -.02em;
    font-weight: 800;
}
.content > .h3, .content > h1.h3 {
    margin-top: 28px;
    margin-bottom: 12px;
}
.block-title { margin: 24px 0 8px; font-size: 16px; }
.page-card .card-head { padding: 16px 16px 8px; }
.stat:hover { box-shadow: 0 8px 22px rgba(15, 23, 42, .06); }
.tenant-row:hover { background: #f4f8ff; }
.card.d-block:hover { border-color: #c9dafd; }
.table { width: 100%; }
.table thead th { letter-spacing: .04em; text-transform: uppercase; font-size: 11px; }
.table tbody tr:hover td { background: #f7faff; }
.pagination { margin: 16px 0 0; }
.form-control:focus, .form-select:focus {
    border-color: #93c5fd;
    box-shadow: 0 0 0 4px rgba(47, 111, 237, .12);
}
.dropdown-menu { border: 1px solid var(--line); border-radius: 14px; padding: 6px; box-shadow: var(--shadow); }
.dropdown-item { border-radius: 8px; min-height: 44px; display: flex; align-items: center; }
.login-hero {
    background:
        radial-gradient(620px 380px at 18% 18%, rgba(47, 111, 237, .14), transparent 62%),
        linear-gradient(180deg, #f8fbff 0%, #eef3fb 100%);
}
.float-pill { animation: floaty 5.5s ease-in-out infinite; }
.float-pill.tours { animation-delay: .7s; }
.float-pill.places { animation-delay: 1.3s; }
@keyframes floaty { 50% { transform: translateY(-8px); } }
.mock-note {
    background: #f8fbff;
    color: #1e3a8a;
    border: 1px solid #dbe7fb;
    border-radius: 12px;
    padding: 8px 12px;
    font-size: 13px;
}
.chat-panel, .draft-panel { background: var(--card); }
.btn-primary { box-shadow: none; }
.btn-primary:hover { background: var(--blue-dark); }
@media (max-width: 1100px) {
    .admin-topbar, .topbar { padding-left: 64px; }
    .admin-topbar .btn { min-height: 44px; height: 44px; }
    .content, .workspace-content { padding-top: 64px; padding-left: 16px; padding-right: 16px; }
    body.has-admin-header .content,
    body.has-admin-header .workspace-content { padding-top: 16px; }
}
body.has-admin-header.is-workspace .main {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}
body.has-admin-header.is-workspace .workspace-content {
    height: auto;
    flex: 1;
    min-height: 0;
}
@media (prefers-reduced-motion: reduce) {
    .content, .float-pill, .stat, .btn { animation: none; transform: none; }
}
[data-theme="dark"] body { background: var(--canvas); }
[data-theme="dark"] .table tbody tr:hover td,
[data-theme="dark"] .tenant-row:hover { background: #182236; }
[data-theme="dark"] .login-hero { background: #0b1220; }
[data-theme="dark"] .mock-note { background: #15233d; color: #dbeafe; border-color: #243049; }

.sidebar { width: 272px; }
.brand { padding-bottom: 14px; border-bottom: 1px solid rgba(255, 255, 255, .08); margin-bottom: 14px; }
.sidebar-scope select {
    background: rgba(255, 255, 255, .06);
    border-color: rgba(255, 255, 255, .14);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04);
}
.admin-topbar {
    align-items: center;
    flex-wrap: wrap;
    gap: 12px 16px;
    padding: 14px 22px;
    backdrop-filter: blur(10px);
}
.admin-topbar .topbar-title { flex: 1 1 auto; min-width: 0; }
.admin-topbar .topbar-title h1,
.admin-topbar .topbar-title p { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-topbar h1 {
    font-size: clamp(22px, 2vw, 28px);
    font-weight: 800;
    letter-spacing: -.03em;
    line-height: 1.15;
}
.admin-topbar .topbar-tools { flex: 1 1 280px; row-gap: 8px; }
.range-form {
    height: auto;
    min-height: 44px;
    flex-wrap: wrap;
    border-radius: 14px;
    max-width: 100%;
    padding: 4px 10px;
}
.range-form input[type="date"], .range-form select { min-width: 0; }
.content { padding: 20px 24px 40px; }
@media (max-width: 1100px) {
    .content, .workspace-content { padding-top: 64px; }
    body.has-admin-header .content,
    body.has-admin-header .workspace-content { padding-top: 16px; }
}
.stat {
    position: relative;
    overflow: hidden;
}
.stat::before {
    content: "";
    position: absolute;
    left: 0;
    top: 14px;
    bottom: 14px;
    width: 3px;
    border-radius: 99px;
    background: var(--blue);
}
.stat b { font-variant-numeric: tabular-nums; }
.tenant-tabs {
    gap: 4px;
    padding: 4px;
    margin: 20px 0 12px;
    background: #eef3f9;
    border: 0;
    border-radius: 14px;
    box-shadow: none;
}
.tenant-tabs a {
    border-radius: 12px;
    padding: 10px 14px;
    border-bottom: 0;
}
.tenant-tabs a.is-active { background: #e8f0ff; border-bottom-color: transparent; }
.panel-card { margin-top: 8px; }
.section-head { padding: 20px 16px 8px; }
.section-head h2 { margin: 0 0 6px; }
.identity { padding: 20px 22px; margin-top: 4px; }
.table thead th { background: #f8fafc; }
.table td, .table th { vertical-align: middle; }
.bubble { box-shadow: 0 1px 0 rgba(15, 23, 42, .03); }
.composer { box-shadow: 0 8px 24px rgba(15, 23, 42, .05); }
.composer:focus-within { border-color: #93c5fd; box-shadow: 0 0 0 4px rgba(47, 111, 237, .12); }
.send-btn { transition: background-color .16s ease; }
.send-btn:hover { background: var(--blue-dark); }
[data-theme="dark"] .table thead th { background: #182236; }
[data-theme="dark"] .tenant-tabs a.is-active { background: #1e3a5f; }
.admin-topbar .topbar-actions { max-width: 100%; flex-wrap: nowrap; justify-content: flex-end; align-items: center; }
@media (max-width: 1100px) {
    .admin-topbar h1 { font-size: 22px; }
    .admin-topbar { padding-left: 64px; }
    .admin-topbar .topbar-title { flex: 1 1 0; min-width: 0; }
    .admin-topbar .topbar-actions { order: 2; flex: 0 0 auto; }
    .admin-topbar .topbar-filters { flex: 1 1 100%; margin-left: 0; order: 3; }
    .admin-topbar .topbar-filters + .topbar-actions { margin-left: auto; }
    .admin-topbar .range-form { width: auto; max-width: 100%; }
}
@media (max-width: 480px) {
    .admin-topbar .topbar-title,
    .admin-topbar .topbar-actions { flex: 1 1 100%; }
    .admin-topbar .topbar-actions { justify-content: flex-start; gap: 6px; }
    .admin-topbar .topbar-actions .btn { padding: 0 10px; }
}
.sidebar nav, .messages, .draft-list, .table-responsive { scrollbar-width: thin; scrollbar-color: rgba(148, 163, 184, .5) transparent; }
.admin-topbar { box-shadow: none; background: rgba(255, 255, 255, .92); backdrop-filter: blur(12px); }
.admin-topbar .btn-outline-secondary { background: #fff; border-color: var(--line); color: var(--ink); }
.admin-topbar .btn-outline-primary { background: #f4f7fb; border-color: transparent; color: var(--ink); }
.admin-topbar .range-form { background: #f4f7fb; border-color: transparent; }
.admin-topbar .range-form input[type="date"],
.admin-topbar .range-form select { background: transparent; }
.mock-note { margin: 0 0 12px; padding: 8px 12px; font-size: 13px; line-height: 1.4; }
.table thead th { color: #64748b; }
.op-row { min-height: 44px; border-radius: 12px; }
.kebab { width: 44px; height: 44px; }
[data-theme="dark"] .admin-topbar { background: rgba(18, 26, 43, .92); }
[data-theme="dark"] .tenant-tabs { background: #182236; }
[data-theme="dark"] .admin-topbar .btn-outline-secondary,
[data-theme="dark"] .admin-topbar .btn-outline-primary { background: #182236; color: var(--ink); border-color: var(--line); }

.brand-row { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.brand-row .brand { flex: 1; min-width: 0; padding-bottom: 14px; }
.brand-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-collapse {
    width: 36px;
    height: 36px;
    margin-bottom: 14px;
    border: 0;
    border-radius: 10px;
    background: rgba(255, 255, 255, .08);
    color: #dbe4f3;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.sidebar-collapse:hover { background: rgba(255, 255, 255, .16); color: white; }
html.sidebar-collapsed .sidebar { width: 84px; padding-left: 10px; padding-right: 10px; }
html.sidebar-collapsed .brand-name,
html.sidebar-collapsed .side-label,
html.sidebar-collapsed .user-meta,
html.sidebar-collapsed .sidebar-scope,
html.sidebar-collapsed .side-search,
html.sidebar-collapsed .tenant-switch div,
html.sidebar-collapsed .signout-link span { display: none; }
html.sidebar-collapsed .side-link,
html.sidebar-collapsed .op-row,
html.sidebar-collapsed .btn-new { justify-content: center; font-size: 0; gap: 0; }
html.sidebar-collapsed .side-link svg,
html.sidebar-collapsed .op-row svg,
html.sidebar-collapsed .btn-new svg { width: 20px; height: 20px; }
html.sidebar-collapsed .user-chip { justify-content: center; }
html.sidebar-collapsed .signout-link { justify-content: center; width: 44px; margin-inline: auto; }
html.sidebar-collapsed .sidebar-collapse svg { transform: scaleX(-1); }
html.sidebar-collapsed .brand { justify-content: center; padding-left: 0; padding-right: 0; }
.signout-link { display: inline-flex; align-items: center; gap: 8px; }
.crumbs { margin: 0 0 12px; }
.crumbs ol { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 0; padding: 0; color: var(--muted); font-size: 13px; font-weight: 650; }
.crumbs li:not(:last-child)::after { content: "/"; margin-left: 6px; color: #94a3b8; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--blue); }
.crumbs [aria-current="page"] { color: var(--ink); }
.table { width: 100%; border-collapse: separate; border-spacing: 0; }
.table thead th { font-size: 11px; letter-spacing: .04em; text-transform: uppercase; color: #64748b; background: #f8fafc; white-space: nowrap; }
.table td, .table th { vertical-align: middle; padding: 10px 12px; }
.table tbody tr { transition: background-color .16s ease; }
.alert { border-radius: 14px; }
.form-control, .form-select, .btn, .card, .side-link, .dropdown-item { transition: background-color .16s ease, border-color .16s ease, color .16s ease, box-shadow .16s ease; }
.messages { scroll-behavior: smooth; }
.typing { display: inline-flex; gap: 4px; align-items: center; min-width: 52px; min-height: 22px; }
.typing i { width: 6px; height: 6px; border-radius: 99px; background: #94a3b8; animation: blink 1s infinite; }
.typing i:nth-child(2) { animation-delay: .15s; }
.typing i:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 50% { opacity: .25; transform: translateY(1px); } }
.chat-panel.is-listening .mic { background: #fee2e2; color: #b91c1c; }
.mic.is-live, .chat-panel.is-listening .wave { color: var(--blue); }
.skeleton { background: linear-gradient(90deg, #eef2f7 25%, #f8fafc 37%, #eef2f7 63%); background-size: 400% 100%; animation: sheen 1.2s ease infinite; border-radius: 10px; color: transparent; }
@keyframes sheen { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }
[data-theme="dark"] .form-control,
[data-theme="dark"] .form-select,
[data-theme="dark"] .composer,
[data-theme="dark"] .composer textarea,
[data-theme="dark"] .chat-panel,
[data-theme="dark"] .draft-panel,
[data-theme="dark"] .bubble.assistant,
[data-theme="dark"] .bubble.system,
[data-theme="dark"] .table thead th,
[data-theme="dark"] .dropdown-menu,
[data-theme="dark"] .login-card,
[data-theme="dark"] .btn-google,
[data-theme="dark"] .alert { background: var(--card); color: var(--ink); border-color: var(--line); }
[data-theme="dark"] .bubble.user { background: #1e3a5f; color: var(--ink); }
[data-theme="dark"] .form-control,
[data-theme="dark"] .form-select,
[data-theme="dark"] .composer textarea { color: var(--ink); }
[data-theme="dark"] .table td,
[data-theme="dark"] .table th { border-color: var(--line); }
[data-theme="dark"] .alert-success { background: #052e16; color: #bbf7d0; }
[data-theme="dark"] .alert-danger { background: #450a0a; color: #fecaca; }
[data-theme="dark"] .alert-info,
[data-theme="dark"] .mock-note { background: #172554; color: #dbeafe; }
[data-theme="dark"] .skeleton { background: linear-gradient(90deg, #182236 25%, #243049 37%, #182236 63%); background-size: 400% 100%; }
@media (max-width: 1100px) {
    .sidebar-collapse { display: none; }
    html.sidebar-collapsed .sidebar { width: var(--sidebar); padding-left: 14px; padding-right: 14px; }
    html.sidebar-collapsed .brand-name,
    html.sidebar-collapsed .side-label,
    html.sidebar-collapsed .user-meta,
    html.sidebar-collapsed .sidebar-scope,
    html.sidebar-collapsed .side-search,
    html.sidebar-collapsed .signout-link span { display: revert; }
    html.sidebar-collapsed .side-link,
    html.sidebar-collapsed .op-row,
    html.sidebar-collapsed .btn-new { font-size: 14px; gap: 10px; justify-content: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
    .typing i, .skeleton, .content { animation: none; }
    .messages { scroll-behavior: auto; }
}
.card, .panel, .stat, .chat-panel, .draft-panel, .composer, .dropdown-menu {
    background-color: var(--card);
    color: var(--ink);
}
@media (max-width: 1399px) {
    .admin-topbar .topbar-title { flex: 1 1 0; min-width: 0; }
    .admin-topbar .topbar-actions { order: 2; flex: 0 0 auto; margin-left: auto; }
    .admin-topbar .topbar-filters { flex: 1 1 100%; margin-left: 0; order: 3; }
}
@media (min-width: 1400px) {
    .admin-topbar { flex-wrap: nowrap; align-items: center; }
}
.login-brand { color: var(--ink); padding-left: 0; }
.ui-field { margin-bottom: var(--space-3); }
.ui-hint { margin: var(--space-1) 0 0; color: var(--muted); font-size: 13px; }
.ui-card-body { padding: var(--space-4); }
.ui-card-head, .ui-card-foot { padding: var(--space-3) var(--space-4); }
.ui-card-head { border-bottom: 1px solid var(--line); font-weight: 700; }
.ui-card-foot { border-top: 1px solid var(--line); }
.ui-page-header { display: flex; justify-content: space-between; align-items: flex-end; gap: var(--space-3); margin: var(--space-5) 0 var(--space-3); }
.ui-page-header h1 { margin: 0; font-size: 1.25rem; letter-spacing: -.02em; }
.ui-page-header p { margin: var(--space-1) 0 0; color: var(--muted); }
.ui-page-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.ui-skeleton { display: grid; gap: var(--space-2); }
.ui-skeleton .skeleton { display: block; height: 14px; }
.admin-topbar { min-height: var(--header); }
.btn, .form-control, .form-select, .admin-topbar .btn, .nav-toggle { border-radius: var(--radius-control); }
.card, .panel, .login-card { border-radius: var(--radius-card); }
.modal-content { border-radius: var(--radius-modal); overflow: hidden; }
.composer { position: sticky; bottom: 0; }
.form-label, [data-theme="dark"] .form-label { color: var(--ink); }
[data-theme="dark"] .btn-outline-primary { background: transparent; color: var(--color-primary); }
[data-theme="dark"] .pill-blue { background: #1e3a5f; color: #bfdbfe; }
.skip-link {
    position: absolute;
    left: 12px;
    top: -48px;
    z-index: 80;
    background: var(--blue);
    color: white;
    padding: 8px 12px;
    border-radius: 10px;
    font-weight: 700;
}
.skip-link:focus { top: 12px; }
.playground-banner {
    background: #fff7ed;
    color: #9a3412;
    border: 1px solid #fdba74;
    border-radius: 12px;
    padding: 10px 12px;
    font-weight: 700;
    margin-bottom: 12px;
}
.playground-panels { min-height: min(72vh, 760px); }
.draft-json {
    flex: 1;
    margin: 0;
    padding: 16px 18px;
    overflow: auto;
    font-size: 13px;
    line-height: 1.5;
    color: var(--ink);
    background: transparent;
}
.composer:focus-within { border-color: #93c5fd; box-shadow: 0 0 0 4px rgba(37, 99, 235, .12); }
.table-responsive { -webkit-overflow-scrolling: touch; }
.nav-toggle {
    transition: background-color var(--duration) ease, transform var(--duration) ease;
}
.nav-toggle:hover { background: var(--card); }
[data-theme="dark"] .playground-banner { background: #431407; color: #fdba74; border-color: #9a3412; }
[data-theme="dark"] .chat-head,
[data-theme="dark"] .draft-head,
[data-theme="dark"] .history a,
[data-theme="dark"] .draft-field { border-color: var(--line); }
[data-theme="dark"] .draft-input { color: var(--ink); }
[data-theme="dark"] .bar { background: #243049; }
[data-theme="dark"] .float-pill { background: var(--card); color: var(--ink); }
@media (max-width: 767px) {
    .ui-page-header { flex-direction: column; align-items: stretch; }
    .admin-topbar { row-gap: 6px; padding-top: 8px; padding-bottom: 8px; }
    .playground-panels { min-height: 0; }
    .chat-actions { width: 100%; justify-content: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
.table-responsive { overflow-x: auto; max-width: 100%; }
@media (max-width: 480px) {
    .admin-topbar .topbar-actions {
        flex: 1 1 100%;
        flex-wrap: wrap;
        margin-left: 0;
        max-width: 100%;
        justify-content: flex-start;
    }
}
@media (max-width: 720px) {
    .login-shell, .login-hero, .login-panel { min-width: 0; max-width: 100%; }
    .login-hero { overflow-x: clip; }
    .login-brand { max-width: 100%; min-width: 0; }
    .login-hero h1 { overflow-wrap: anywhere; }
}
@media (max-width: 1100px) {
    .chat-panel { min-height: 68vh; }
    .chat-head { flex-wrap: wrap; }
    .upload-audio { align-items: stretch; }
    .upload-audio input[type="file"] { max-width: 100%; }
}
.table .text-end { font-variant-numeric: tabular-nums; }
.staff-table { width: 100%; }
.staff-table th,
.staff-table td { vertical-align: middle; }
.staff-table th:nth-child(1),
.staff-table td.staff-name { width: 100%; }
.staff-table th:nth-child(4),
.staff-table th:nth-child(6),
.staff-table th:nth-child(7),
.staff-table td:nth-child(4),
.staff-table td:nth-child(6),
.staff-table td:nth-child(7) { width: 1%; white-space: nowrap; }
.staff-clip {
    display: inline-block;
    max-width: 28ch;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: bottom;
}
.staff-actions { display: inline-flex; justify-content: flex-end; align-items: center; gap: 8px; }
.staff-action { min-height: 44px; }
.btn-icon {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 44px;
}
.staff-tabs { flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.staff-tabs::-webkit-scrollbar { display: none; }
.staff-tabs .nav-link { min-height: 44px; white-space: nowrap; }
.staff-tab-panels { padding-top: 16px; }
.staff-tenant { border: 0; margin: 0 0 8px; padding: 0; min-width: 0; }
.staff-tenant-title, .staff-ops label {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    margin: 0;
}
.staff-ops { display: grid; gap: 4px; padding-left: 28px; }
.staff-ops label { font-weight: 500; }
@media (max-width: 767px) {
    .d-flex .staff-action { width: 100%; }
}
.user-edit {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 8px;
    width: 100%;
    min-width: 920px;
}
.user-edit > div { flex: 1 1 0; min-width: 0; }
.user-edit .user-email { flex: 1.4 1 0; }
.user-edit .user-role { flex: 0 0 148px; }
.user-edit .user-status { flex: 0 0 132px; }
.user-edit .user-save { flex: 0 0 auto; }
.user-edit .form-control,
.user-edit .form-select,
.user-edit .btn { min-height: 44px; }
.user-edit .btn { white-space: nowrap; }

body.is-login {
    background:
        radial-gradient(720px 420px at 0% 0%, rgba(37, 99, 235, .16), transparent 58%),
        var(--canvas);
}
.login-shell { align-items: stretch; }
.login-hero {
    justify-content: center;
    gap: 0;
    padding: 48px 64px;
    background:
        radial-gradient(520px 320px at 12% 8%, rgba(37, 99, 235, .18), transparent 64%),
        linear-gradient(165deg, #f8fbff 0%, #eef3fb 100%);
}
.login-brand { width: fit-content; max-width: 100%; margin-bottom: 28px; padding: 0; font-size: 18px; }
.login-brand .brand-logo { width: 36px; height: 36px; object-fit: contain; border-radius: 10px; }
.login-kicker {
    margin: 0 0 10px;
    color: var(--blue);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}
.login-hero h1 { margin: 0 0 12px; max-width: 520px; overflow-wrap: break-word; }
.login-hero .lede { max-width: 440px; color: var(--muted); font-size: 17px; line-height: 1.5; }
.login-points { margin: 20px 0 0; padding: 0; list-style: none; display: grid; gap: 10px; max-width: 460px; }
.login-points li {
    position: relative;
    padding-left: 22px;
    color: var(--ink);
    font-size: 14px;
    line-height: 1.45;
}
.login-points li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 7px;
    width: 8px;
    height: 8px;
    border-radius: 99px;
    background: var(--blue);
}
.login-preview { margin-top: 28px; max-width: 420px; }
.login-preview-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: var(--shadow);
    padding: 16px;
}
.login-preview-card span { display: block; margin-bottom: 8px; color: var(--blue); font-size: 12px; font-weight: 700; }
.login-preview-card p { margin: 0; color: var(--ink); font-size: 14px; line-height: 1.45; }
.login-preview-reply {
    margin-top: 10px !important;
    padding: 10px 12px;
    border-radius: 12px;
    background: var(--color-bg);
    color: var(--muted) !important;
}
.login-hero .trust-row { margin-top: 28px; }
.login-panel { position: relative; padding: 32px 40px; }
.login-theme {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 44px;
    height: 44px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--card);
    color: var(--ink);
    display: grid;
    place-items: center;
}
.login-theme:hover { border-color: #93c5fd; }
.login-card {
    width: min(420px, 100%);
    padding: 28px 24px 20px;
    border-radius: 20px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 18px 40px rgba(15, 23, 42, .08);
}
.login-portal {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    margin: 0 0 12px;
    padding: 0 10px;
    border-radius: 999px;
    background: rgba(37, 99, 235, .1);
    color: var(--blue);
    font-size: 12px;
    font-weight: 700;
}
.login-card h2 { font-size: 26px; }
.login-card .sub { margin-bottom: 16px; }
.login-card .form-control {
    min-height: 48px;
    font-size: 16px;
    border-radius: 12px;
    background: var(--color-bg);
}
.login-card .eye {
    top: 50%;
    right: 4px;
    width: 44px;
    height: 44px;
    transform: translateY(-50%);
}
.login-row { min-height: 44px; }
.login-row .form-check { min-height: 44px; display: flex; align-items: center; gap: 8px; }
.login-row a { min-height: 44px; display: inline-flex; align-items: center; }
.btn-signin { border-radius: 12px; font-weight: 700; }
.btn-signin:hover { transform: translateY(-1px); }
.btn-signin[aria-busy="true"] { color: transparent; position: relative; }
.btn-signin[aria-busy="true"]::after {
    content: "";
    position: absolute;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, .45);
    border-top-color: #fff;
    border-radius: 50%;
    animation: login-spin .7s linear infinite;
}
@keyframes login-spin { to { transform: rotate(360deg); } }
.btn-google { border-radius: 12px; background: var(--card); color: var(--ink); }
.btn-google:hover { border-color: #93c5fd; background: var(--color-bg); }
.login-switch { margin: 8px 0 0; text-align: center; }
.login-switch a { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; font-weight: 700; }
[data-theme="dark"] .login-hero {
    background:
        radial-gradient(520px 320px at 12% 8%, rgba(59, 130, 246, .22), transparent 64%),
        #0b1220;
}
[data-theme="dark"] .login-preview-reply { background: #0b1220; }
[data-theme="dark"] .login-portal { background: #1e3a5f; color: #bfdbfe; }
@media (max-width: 1099px) {
    .login-shell { grid-template-columns: 1fr; }
    .login-hero { padding: 24px 20px 0; }
    .login-kicker, .login-points, .login-preview, .login-hero .trust-row { display: none; }
    .login-brand { margin-bottom: 12px; }
    .login-hero h1 { font-size: 30px; }
    .login-panel { padding: 68px 16px 28px; min-height: 0; }
    .login-card { width: min(440px, 100%); }
}
@media (max-width: 480px) {
    .login-card { padding: 22px 16px 16px; }
    .login-row { align-items: flex-start; flex-direction: column; gap: 0; }
}
body.is-admin-login {
    background: #eef3fb;
}
body.is-admin-login .login-hero {
    color: #f8fafc;
    background:
        radial-gradient(520px 280px at 18% 12%, rgba(59, 130, 246, .45), transparent 62%),
        linear-gradient(165deg, #172033 0%, #0b1220 100%);
}
body.is-admin-login .login-brand,
body.is-admin-login .login-hero h1 { color: #f8fafc; }
body.is-admin-login .login-brand { border-bottom: 0; }
body.is-admin-login .login-kicker { color: #93c5fd; }
body.is-admin-login .login-hero .lede,
body.is-admin-login .login-points li { color: #cbd5e1; }
body.is-admin-login .login-points li::before { background: #60a5fa; }
body.is-admin-login .login-preview-card {
    background: rgba(255, 255, 255, .08);
    border-color: rgba(255, 255, 255, .14);
    box-shadow: none;
}
body.is-admin-login .login-preview-card span { color: #93c5fd; }
body.is-admin-login .login-preview-card p { color: #f8fafc; }
body.is-admin-login .login-preview-reply { background: rgba(11, 18, 32, .45); color: #cbd5e1 !important; }
body.is-admin-login .trust-row { color: #94a3b8; }
body.is-admin-login .login-panel { background: #f4f7fb; }
body.is-admin-login .login-card {
    border: 0;
    box-shadow: 0 24px 60px rgba(15, 23, 42, .12);
}
body.is-admin-login .login-card .form-control {
    padding-left: 42px;
    background-repeat: no-repeat;
    background-position: 14px center;
    background-size: 16px;
}
body.is-admin-login #username {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='%2394a3b8' stroke-width='1.8' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='8' r='3'/%3E%3Cpath d='M5 19c1.2-3 3.4-4.5 7-4.5S17.8 16 19 19'/%3E%3C/svg%3E");
}
body.is-admin-login #password {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='%2394a3b8' stroke-width='1.8' viewBox='0 0 24 24'%3E%3Crect x='5' y='11' width='14' height='9' rx='2'/%3E%3Cpath d='M8 11V8a4 4 0 0 1 8 0v3'/%3E%3C/svg%3E");
}
body.is-admin-login .login-switch { border-top: 1px solid var(--line); margin-top: 16px; padding-top: 4px; }
[data-theme="dark"] body.is-admin-login { background: #0b1220; }
[data-theme="dark"] body.is-admin-login .login-panel { background: #0b1220; }
[data-theme="dark"] body.is-admin-login .login-card { border: 1px solid var(--line); }
.op-toolbar, .op-editor, .op-create { padding: 16px; }
.op-toolbar { display: flex; flex-direction: row; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.op-toolbar > div:first-child { min-width: 0; }
.op-kicker { margin: 0 0 4px; color: var(--muted); font-size: 13px; font-weight: 700; }
.op-toolbar .block-title { margin: 0 0 8px; }
.op-actions, .op-add { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.op-actions .btn, .op-add .btn, .op-item .btn { min-height: 44px; }
.op-tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--line); margin: -16px -16px 16px; }
.op-tabs::-webkit-scrollbar { display: none; }
.op-tabs .nav-link { min-height: 44px; white-space: nowrap; color: var(--muted); border: 0; border-bottom: 2px solid transparent; border-radius: 0; font-weight: 700; }
.op-tabs .nav-link.active { color: var(--blue); background: transparent; border-bottom-color: var(--blue); }
.op-count { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; margin-left: 4px; padding: 0 6px; border-radius: 999px; background: #e8eef8; color: var(--ink); font-size: 12px; }
.op-tabs .nav-link.active .op-count { background: #dbeafe; color: var(--blue); }
.op-help, .op-empty { margin: 0 0 16px; color: var(--muted); }
.op-field { display: grid; grid-template-columns: minmax(90px, 1fr) minmax(110px, 1.2fr) minmax(80px, .8fr) minmax(120px, 1.4fr) auto; gap: 8px; align-items: center; margin-bottom: 8px; }
.op-field-head { color: var(--muted); font-size: 12px; font-weight: 700; margin-bottom: 4px; }
.op-required { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; margin: 0; white-space: nowrap; }
.op-add .form-control, .op-add .form-select { flex: 1 1 180px; min-width: 0; min-height: 44px; font-size: 16px; }
.op-item { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.op-item p { margin: 2px 0 0; color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.op-connection { margin-top: 20px; padding-top: 8px; border-top: 1px solid var(--line); }
.op-connection .block-title { margin-top: 16px; }
[data-theme="dark"] .op-count { background: #1e293b; color: var(--ink); }
@media (max-width: 991px) {
    .op-field, .op-field-head { grid-template-columns: 1fr; }
    .op-field-head { display: none; }
    .op-item { align-items: stretch; flex-direction: column; }
}

/* Conversation studio: chat thread and live draft. */
.conversation-page {
    grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
    gap: 16px;
    min-height: 0;
}
.conversation-page .chat-panel,
.conversation-page .draft-panel {
    border: 1px solid var(--line);
    border-radius: 22px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 16px 40px rgba(15, 23, 42, .06);
    overflow: hidden;
    background: var(--card);
}
.conversation-page .chat-head,
.conversation-page .draft-head {
    padding: 14px 16px 12px;
    background: var(--card);
}
.conversation-page .conversation-identity { min-width: 0; }
.conversation-page .chat-head h1 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conversation-page .draft-field .flex-grow-1 { min-width: 0; }
.conversation-page .conversation-kicker {
    margin: 0 0 2px;
    color: var(--blue);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
}
.conversation-page .chat-head h1,
.conversation-page .draft-head h2 {
    margin: 0 0 2px;
    font-size: 18px;
    letter-spacing: -.03em;
    line-height: 1.2;
}
.conversation-page .chat-head p { margin: 0; font-size: 13px; }
.conversation-page .chat-actions {
    padding: 4px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #f8fafc;
    gap: 2px;
}
.conversation-page .chat-actions .text-tool {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 44px;
    padding: 0 10px;
    border-radius: 10px;
    color: #334155;
    font-weight: 700;
}
.conversation-page .chat-actions .text-tool-danger { color: #b91c1c; }
.conversation-page .chat-actions .text-tool:hover { background: white; }
.conversation-page .messages {
    gap: 16px;
    padding: 18px 16px 8px;
    background:
        radial-gradient(480px 200px at 0 0, rgba(37, 99, 235, .08), transparent 68%),
        #f4f7fb;
}
.conversation-page .msg { max-width: min(78%, 640px); gap: 10px; align-items: flex-end; }
.conversation-page .msg-body { min-width: 0; }
.conversation-page .msg-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 2px 4px;
    color: #94a3b8;
    font-size: 11px;
    font-weight: 700;
}
.conversation-page .msg.user .msg-meta { justify-content: flex-end; }
.conversation-page .msg-meta time { display: inline; margin: 0; font-size: 11px; font-weight: 650; color: #94a3b8; }
.conversation-page .who { width: 36px; height: 36px; border-radius: 50%; box-shadow: 0 6px 16px rgba(15, 23, 42, .12); }
.conversation-page .bubble {
    padding: 12px 14px;
    border-radius: 18px;
    line-height: 1.5;
    font-size: 15px;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
}
.conversation-page .bubble.assistant,
.conversation-page .bubble.system {
    background: white;
    color: var(--ink);
    border: 1px solid #e2e8f0;
    border-bottom-left-radius: 6px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}
.conversation-page .bubble.user {
    background: linear-gradient(180deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    border: 0;
    border-bottom-right-radius: 6px;
    box-shadow: 0 8px 18px rgba(37, 99, 235, .22);
}
.conversation-page .composer-wrap {
    padding: 8px 12px 12px;
    background: linear-gradient(180deg, rgba(244, 247, 251, 0), var(--card) 16px);
    border-top: 0;
}
.conversation-page .composer {
    align-items: flex-end;
    gap: 6px;
    padding: 6px;
    border-radius: 18px;
    border-color: #dbe3ef;
    background: white;
    box-shadow: 0 8px 24px rgba(15, 23, 42, .06);
}
.conversation-page .composer textarea {
    min-height: 44px;
    max-height: 140px;
    padding: 11px 6px;
    font-size: 16px;
    line-height: 1.4;
    background: transparent;
}
.conversation-page .mic,
.conversation-page .send-btn { width: 44px; height: 44px; border-radius: 14px; }
.conversation-page .mic { color: #475569; background: #f1f5f9; }
.conversation-page .mic:hover { background: #e2e8f0; color: var(--ink); }
.conversation-page .send-btn { background: var(--blue); box-shadow: 0 6px 14px rgba(37, 99, 235, .28); }
.conversation-page .mic[aria-pressed="true"],
.conversation-page .chat-panel.is-listening .mic {
    background: #dc2626;
    color: white;
    animation: mic-pulse 1.4s ease-out infinite;
}
@keyframes mic-pulse {
    70% { box-shadow: 0 0 0 10px rgba(220, 38, 38, 0); }
    100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0); }
}
.conversation-page .wave { padding: 8px 8px 0; }
.conversation-page .voice-row { justify-content: flex-end; padding: 2px 4px 0; }
.conversation-page .voice-row p { flex: 1; min-width: 0; }
.conversation-page .voice-row p:empty { display: none; }
.conversation-page .upload-audio,
.upload-audio[hidden] { display: none !important; }
.conversation-page .image-uploads { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.conversation-page .image-upload {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #f8fafc;
}
.conversation-page .image-upload-copy label { display: block; margin: 0 0 4px; font-size: 13px; font-weight: 700; color: var(--ink); }
.conversation-page .image-upload-copy p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.4; }
.conversation-page .image-upload-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.conversation-page .image-upload input[type="file"] { flex: 1 1 180px; min-width: 0; max-width: 100%; min-height: 44px; font-size: 16px; }
.conversation-page .image-upload .btn { min-height: 44px; }
.conversation-page .draft-image {
    display: block;
    width: 100%;
    max-height: 160px;
    margin-top: 8px;
    object-fit: cover;
    aspect-ratio: 16 / 9;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: #e8eef8;
}
[data-theme="dark"] .conversation-page .image-upload { background: #0e1626; }
[data-theme="dark"] .conversation-page .draft-image { background: #1e293b; }
.conversation-page .draft-title { align-items: flex-start; }
.conversation-page .draft-progress-row { display: flex; align-items: center; gap: 12px; margin-top: 14px; }
.conversation-page .draft-progress-copy { flex: 1; min-width: 0; }
.conversation-page .draft-progress-copy strong { display: block; font-size: 14px; }
.conversation-page .draft-progress-copy span { display: block; margin: 2px 0 8px; color: var(--muted); font-size: 12px; font-weight: 650; }
.conversation-page .draft-ring {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    background: conic-gradient(var(--blue) calc(var(--progress) * 1%), #e8eef8 0);
}
.conversation-page .draft-ring strong {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--card);
    color: var(--ink);
    font-size: 12px;
    font-weight: 800;
}
.conversation-page .bar { height: 8px; margin-top: 0; background: #e8eef8; }
.conversation-page .bar span { background: linear-gradient(90deg, #60a5fa, var(--blue)); }
.conversation-page .draft-list { display: flex; flex-direction: column; gap: 8px; padding: 12px; }
.conversation-page .draft-field {
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 10px 12px;
    background: #f8fafc;
}
.conversation-page .draft-field.is-ready { background: #f6fdf8; border-color: #bbf7d0; }
.conversation-page .draft-field strong { font-size: 12px; letter-spacing: .01em; color: #64748b; text-transform: uppercase; }
.conversation-page .draft-value { margin-top: 2px; color: var(--ink); font-weight: 700; overflow-wrap: anywhere; }
.conversation-page .draft-foot { border-top: 1px solid var(--line); background: var(--card); }
.conversation-page .draft-foot .btn-primary { min-height: 48px; border-radius: 12px; font-weight: 700; }
.conversation-page .draft-review {
    margin-bottom: 10px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #f8fafc;
}
.record-match {
    margin: 0 0 8px;
    padding: 12px;
    border: 1px solid #bfdbfe;
    border-radius: 14px;
    background: #eff6ff;
}
.record-match-kicker {
    margin: 0 0 4px;
    color: #1d4ed8;
    font-size: 12px;
    font-weight: 750;
    letter-spacing: .04em;
    text-transform: uppercase;
}
.record-match h3 { margin: 0 0 4px; font-size: 16px; }
.record-match > p { margin: 0 0 10px; color: var(--muted); font-size: 14px; }
.record-match-item {
    margin-bottom: 8px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--card);
}
.record-match-item strong, .record-match-item span { display: block; overflow-wrap: anywhere; }
.record-match-item span { margin: 2px 0 8px; color: var(--muted); font-size: 13px; }
.record-match .btn { min-height: 44px; }
.record-match > form { margin-top: 4px; }
[data-theme="dark"] .conversation-page .chat-actions { background: #0e1626; }
[data-theme="dark"] .conversation-page .chat-actions .text-tool { color: var(--ink); }
[data-theme="dark"] .conversation-page .chat-actions .text-tool:hover { background: #182236; }
[data-theme="dark"] .conversation-page .chat-actions .text-tool-danger { color: #fca5a5; }
[data-theme="dark"] .conversation-page .messages {
    background:
        radial-gradient(480px 200px at 0 0, rgba(59, 130, 246, .16), transparent 68%),
        #0e1626;
}
[data-theme="dark"] .conversation-page .bubble.assistant,
[data-theme="dark"] .conversation-page .bubble.system {
    background: #182236;
    border-color: var(--line);
    color: var(--ink);
}
[data-theme="dark"] .conversation-page .bubble.user {
    background: linear-gradient(180deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
}
[data-theme="dark"] .conversation-page .composer { background: #121a2b; border-color: var(--line); }
[data-theme="dark"] .conversation-page .mic { background: #1e293b; color: #cbd5e1; }
[data-theme="dark"] .conversation-page .draft-field,
[data-theme="dark"] .conversation-page .draft-review { background: #0e1626; }
[data-theme="dark"] .record-match { background: #172554; border-color: #1d4ed8; }
[data-theme="dark"] .record-match-kicker { color: #93c5fd; }
[data-theme="dark"] .record-match-item { background: #0e1626; }
[data-theme="dark"] .conversation-page .draft-field.is-ready { background: #052e16; border-color: #166534; }
[data-theme="dark"] .conversation-page .draft-ring { background: conic-gradient(var(--blue) calc(var(--progress) * 1%), #243049 0); }
[data-theme="dark"] .conversation-page .bar { background: #243049; }
@media (max-width: 1100px) {
    .conversation-page { grid-template-columns: 1fr; }
    .conversation-page .chat-panel { min-height: 72vh; }
    .conversation-page .msg { max-width: 92%; }
}
@media (max-width: 720px) {
    .conversation-page .chat-head { align-items: stretch; }
    .conversation-page .chat-actions { width: 100%; justify-content: stretch; }
    .conversation-page .chat-actions form { flex: 1; }
    .conversation-page .chat-actions .text-tool { width: 100%; }
    .conversation-page .draft-ring { width: 48px; height: 48px; }
    .conversation-page .draft-ring strong { width: 36px; height: 36px; font-size: 11px; }
}
@media (prefers-reduced-motion: reduce) {
    .conversation-page .mic[aria-pressed="true"],
    .conversation-page .chat-panel.is-listening .mic { animation: none; }
}
