/* Shared styles for the Flow 4-8 screens and the MozhiUI kit (mozhi-ui.js). Uses the app tokens from styles.css. */

body:not([data-layout="landing"]) {
  --c0: #8a2fa6; --c1: #2f8f86; --c2: #e0892b; --c3: #3d6fd8; --c4: #c2416b; --c5: #6b7a8f;
  --tone-good-bg: #e3f5ef; --tone-good: #0b5f4f;
  --tone-warn-bg: #fff1d6; --tone-warn: #7a4a00;
  --tone-bad-bg: #ffe9ec; --tone-bad: #9b1730;
  --tone-info-bg: #e9f0ff; --tone-info: #1c4aa3;
  --tone-live-bg: #f3e3fa; --tone-live: #6a1f83;
  --tone-muted-bg: rgba(94, 86, 104, .12); --tone-muted: #4f4757;
  --p1: #b3122f; --p2: #c25a00; --p3: #2f5fb8; --p4: #4f6170;
  --row-selected: rgba(119, 39, 143, .1);
}
html[data-theme="dark"] body:not([data-layout="landing"]) {
  --c0: #d58cf0; --c1: #5fd0c4; --c2: #f5b25b; --c3: #84a9ff; --c4: #f487ac; --c5: #a9b6c6;
  --tone-good-bg: rgba(48, 196, 160, .16); --tone-good: #8ee8cf;
  --tone-warn-bg: rgba(245, 165, 36, .18); --tone-warn: #ffd58a;
  --tone-bad-bg: rgba(255, 92, 122, .18); --tone-bad: #ffb0bf;
  --tone-info-bg: rgba(110, 150, 255, .18); --tone-info: #b9ccff;
  --tone-live-bg: rgba(214, 130, 245, .2); --tone-live: #f0c4ff;
  --tone-muted-bg: rgba(255, 255, 255, .1); --tone-muted: #d8cbe0;
  --p1: #ff8da2; --p2: #ffb266; --p3: #9dbbff; --p4: #c3cfdb;
  --row-selected: rgba(214, 130, 245, .14);
}

/* Page frame */
.mz-page { display: grid; align-content: start; gap: 18px; min-width: 0; }
.mz-page > * { min-width: 0; }
.mz-page .page-heading .row { flex-wrap: wrap; justify-content: flex-end; }
.mz-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 6px; font-size: .78rem; color: var(--muted); }
.mz-crumbs a { color: var(--link); font-weight: 650; text-decoration: none; }
.mz-crumbs .lucide { width: 14px; height: 14px; }
.mz-section { display: grid; gap: 14px; }
.mz-section > header { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; }
.mz-section > header h2 { margin: 0; font-size: 1.25rem; }
.mz-muted { color: var(--muted); }

/* Badges */
.mz-badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px 3px 7px; border-radius: 999px; font-size: .76rem; font-weight: 700; line-height: 1.35; white-space: nowrap; }
.mz-badge .lucide { width: 13px; height: 13px; flex: none; }
.mz-badge--good { background: var(--tone-good-bg); color: var(--tone-good); }
.mz-badge--warn { background: var(--tone-warn-bg); color: var(--tone-warn); }
.mz-badge--bad { background: var(--tone-bad-bg); color: var(--tone-bad); }
.mz-badge--info { background: var(--tone-info-bg); color: var(--tone-info); }
.mz-badge--live { background: var(--tone-live-bg); color: var(--tone-live); }
.mz-badge--live .lucide { animation: mz-pulse 1.6s ease-in-out infinite; }
.mz-badge--muted { background: var(--tone-muted-bg); color: var(--tone-muted); }
.mz-badge--p1 { background: var(--p1); color: #fff; }
.mz-badge--p2 { background: var(--tone-warn-bg); color: var(--p2); box-shadow: inset 0 0 0 1px currentColor; }
.mz-badge--p3 { background: var(--tone-info-bg); color: var(--p3); }
.mz-badge--p4 { background: var(--tone-muted-bg); color: var(--p4); }
html[data-theme="dark"] .mz-badge--p1 { color: #2a0610; }
.mz-access { display: inline-flex; align-items: center; gap: 5px; font-size: .8rem; font-weight: 600; color: var(--muted); }
.mz-access .lucide { width: 14px; height: 14px; }
@keyframes mz-pulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .mz-badge--live .lucide { animation: none; } }

/* Countdowns */
[data-due] { font-variant-numeric: tabular-nums; font-weight: 700; }
[data-due][data-tone="soon"] { color: var(--tone-warn); }
[data-due][data-tone="breached"] { color: var(--tone-bad); }
[data-due][data-tone="paused"] { color: var(--muted); }

/* Toolbars, tabs, segmented controls */
.mz-toolbar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.mz-toolbar .field { gap: 4px; font-size: .78rem; font-weight: 650; color: var(--muted); }
.mz-toolbar .field input, .mz-toolbar .field select { min-height: 40px; padding: 8px 12px; font-size: .9rem; }
.mz-toolbar__grow { flex: 1 1 220px; }
.mz-toolbar .select__button { min-height: 40px; border: 1px solid var(--field-border); background: var(--field-bg); border-radius: 10px; }
.mz-search { position: relative; }
.mz-search .lucide { position: absolute; left: 12px; bottom: 11px; width: 17px; height: 17px; color: var(--muted); pointer-events: none; }
.mz-search input { padding-left: 36px !important; }
.mz-tabs { display: flex; gap: 4px; width: fit-content; max-width: 100%; padding: 4px; overflow-x: auto; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); }
.mz-tabs a, .mz-tabs button { display: inline-flex; align-items: center; gap: 6px; padding: 8px 15px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font-weight: 650; font-size: .9rem; white-space: nowrap; text-decoration: none; cursor: pointer; }
.main-content .mz-tabs a:not(.btn) { color: var(--muted); }
.mz-tabs [aria-selected="true"], .mz-tabs [aria-current="page"], .main-content .mz-tabs a[aria-current="page"] { background: var(--brand-500); color: #fff; }
.mz-tabs .mz-count { padding: 0 7px; border-radius: 999px; background: rgba(119, 39, 143, .14); font-size: .74rem; }
.mz-tabs [aria-selected="true"] .mz-count, .mz-tabs [aria-current="page"] .mz-count { background: rgba(255, 255, 255, .25); }
.mz-seg { display: inline-flex; flex-wrap: wrap; gap: 4px; width: fit-content; padding: 4px; border-radius: 14px; background: var(--surface-2); }
.mz-seg label { position: relative; cursor: pointer; }
.mz-seg input { position: absolute; opacity: 0; pointer-events: none; }
.mz-seg span { display: block; padding: 7px 14px; border-radius: 10px; color: var(--muted); font-size: .86rem; font-weight: 650; }
.mz-seg input:checked + span { background: var(--brand-500); color: #fff; }
.mz-seg input:focus-visible + span { outline: 3px solid var(--info); outline-offset: 2px; }
.mz-choice { display: grid; gap: 10px; }
.mz-choice--row { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.mz-choice label { position: relative; display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; align-items: start; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 14px; background: var(--control-bg); cursor: pointer; }
.mz-choice label:has(input:checked) { border-color: var(--brand-500); background: var(--hover-bg); }
.mz-choice label:has(input:focus-visible) { outline: 3px solid var(--info); outline-offset: 2px; }
.mz-choice input { margin: 3px 0 0; accent-color: var(--brand-500); }
.mz-choice strong { display: flex; align-items: center; gap: 6px; font-size: .92rem; }
.mz-choice strong .lucide { width: 16px; height: 16px; color: var(--link); }
.mz-choice small { grid-column: 2; }

/* Forms */
.mz-form { display: grid; gap: 14px; }
.mz-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; }
.mz-form-grid .is-wide { grid-column: 1 / -1; }
.mz-form .field, .mz-dialog .field { gap: 6px; font-weight: 650; font-size: .88rem; }
.mz-form .field input, .mz-form .field select, .mz-form .field textarea,
.mz-dialog .field input, .mz-dialog .field select, .mz-dialog .field textarea { border-color: var(--field-border); background: var(--field-bg); color: var(--ink); font-weight: 400; }
.mz-dialog .field select option { background: var(--solid-bg); color: var(--ink); }
.field [aria-invalid="true"] { border-color: var(--danger) !important; box-shadow: 0 0 0 3px rgba(217, 45, 74, .15); }
.mz-help { font-size: .78rem; font-weight: 400; color: var(--muted); }
.mz-error { margin: 0; color: var(--tone-bad); font-size: .84rem; font-weight: 650; }
.mz-req::after { content: " *"; color: var(--tone-bad); }
.mz-check { display: flex; align-items: flex-start; gap: 9px; font-size: .9rem; font-weight: 500; cursor: pointer; }
.mz-check input { margin-top: 3px; accent-color: var(--brand-500); width: 16px; height: 16px; flex: none; }
.mz-switch { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; cursor: pointer; }
.mz-switch input { appearance: none; position: relative; width: 40px; height: 22px; margin: 0; border-radius: 99px; background: var(--tone-muted-bg); border: 1px solid var(--field-border); cursor: pointer; transition: background .15s; }
.mz-switch input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .15s; }
.mz-switch input:checked { background: var(--brand-500); border-color: var(--brand-500); }
.mz-switch input:checked::after { transform: translateX(18px); }
.mz-switch input:focus-visible { outline: 3px solid var(--info); outline-offset: 2px; }

/* Dialogs */
.mz-dialog { position: relative; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; width: min(620px, calc(100vw - 24px)); max-height: calc(100dvh - 32px); border: 1px solid var(--panel-border, var(--line)); border-radius: 24px; background: var(--panel-bg, #fff); color: var(--ink); box-shadow: 0 30px 80px rgba(20, 8, 26, .35); }
.mz-dialog--sm { width: min(460px, calc(100vw - 24px)); }
.mz-dialog--lg { width: min(900px, calc(100vw - 24px)); }
.mz-dialog--xl { width: min(1180px, calc(100vw - 24px)); }
.mz-dialog__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 22px 24px 14px; border-bottom: 1px solid var(--line); }
.mz-dialog__head h2 { margin: 0; font-size: 1.35rem; }
.mz-dialog__head .eyebrow { margin-bottom: 4px; }
.mz-dialog__body { display: grid; align-content: start; gap: 14px; min-height: 0; overflow: auto; padding: 18px 24px 22px; }
.mz-dialog__body p { margin: 0; }
.mz-dialog__foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 10px; padding: 14px 24px; border-top: 1px solid var(--line); }
.mz-dialog__foot .mz-foot-note { margin-right: auto; font-size: .82rem; color: var(--muted); }
.mz-dialog .btn:not(.btn--primary):not(.btn--danger) { border-color: var(--control-border); background: var(--control-bg); color: var(--ink); }
.mz-dialog .btn--primary { background: var(--brand-500); border-color: var(--brand-500); }
html[data-theme="dark"] .mz-dialog .btn--primary { border-color: #e5a5f5aa; background: #8b2da8d9; }
.mz-dialog .table-wrap { background: transparent; }
.mz-dialog .table th { background: var(--surface-2); }
.mz-confirm { color: var(--ink); }
.mz-confirm p { color: var(--ink); }
.mz-steps { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.mz-steps li { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; background: var(--surface-2); color: var(--muted); font-size: .8rem; font-weight: 650; }
.mz-steps li[aria-current="step"] { background: var(--brand-500); color: #fff; }
.mz-steps li.is-done { color: var(--tone-good); }
.mz-steps .lucide { width: 14px; height: 14px; }

/* Context menu */
.mz-menu { position: fixed; z-index: 120; display: grid; min-width: 210px; max-width: min(360px, calc(100vw - 16px)); max-height: min(70vh, 460px); overflow: auto; padding: 6px; border: 1px solid var(--panel-border, var(--line)); border-radius: 14px; background: var(--panel-bg, #fff); color: var(--ink); box-shadow: 0 18px 45px rgba(24, 11, 32, .25); }
.mz-menu button { display: grid; grid-template-columns: 18px 1fr auto; align-items: center; gap: 9px; padding: 9px 10px; border: 0; border-radius: 9px; background: transparent; color: var(--ink); font-size: .88rem; font-weight: 600; text-align: left; }
.mz-menu button:hover, .mz-menu button:focus-visible { background: var(--hover-bg); outline: none; }
.mz-menu button:disabled { opacity: .45; cursor: not-allowed; }
.mz-menu button.is-danger { color: var(--tone-bad); }
.mz-menu button .lucide { width: 16px; height: 16px; color: var(--muted); }
.mz-menu button.is-checked .lucide { color: var(--brand-500); }
.mz-menu small { color: var(--muted); font-weight: 500; font-size: .74rem; }
.mz-menu hr { width: 100%; margin: 4px 0; border: 0; border-top: 1px solid var(--line); }
.mz-menu__heading { margin: 4px 10px 6px; font-size: .7rem; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }

/* Stat tiles */
.mz-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.mz-stat { position: relative; display: grid; gap: 2px; padding: 14px 16px; border-radius: 16px; background: var(--glass-bg); box-shadow: var(--glass-shadow); }
.mz-stat__label { font-size: .76rem; font-weight: 700; color: var(--muted); }
.mz-stat__value { font-size: 1.6rem; font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; color: var(--ink); line-height: 1.15; }
.mz-stat__hint { font-size: .76rem; color: var(--muted); }
.mz-stat--good .mz-stat__value { color: var(--tone-good); }
.mz-stat--bad .mz-stat__value { color: var(--tone-bad); }

/* Key-value list */
.mz-kv { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; margin: 0; }
.mz-kv dt { color: var(--muted); font-size: .84rem; font-weight: 650; }
.mz-kv dd { margin: 0; color: var(--ink); font-size: .9rem; overflow-wrap: anywhere; }
.mz-kv--cols { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.mz-kv--cols > div { display: grid; gap: 2px; }

/* Tables */
.mz-table-wrap { position: relative; max-width: 100%; overflow: auto; border-radius: 16px; background: var(--glass-bg); box-shadow: var(--glass-shadow); }
.mz-table { width: 100%; border-collapse: separate; border-spacing: 0; color: var(--ink); font-size: .88rem; }
.mz-table th, .mz-table td { padding: 11px 13px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.mz-table thead th { position: sticky; top: 0; z-index: 2; background: var(--panel-bg, #fff); color: var(--muted); font-size: .74rem; font-weight: 750; letter-spacing: .02em; white-space: nowrap; }
.mz-table tbody tr:last-child td { border-bottom: 0; }
.mz-table tbody tr:hover td { background: var(--hover-bg); }
.mz-table tbody tr.is-selected td { background: var(--row-selected); }
.mz-table tbody tr[data-open] { cursor: pointer; }
.mz-table td.is-num, .mz-table th.is-num { text-align: right; font-variant-numeric: tabular-nums; }
.mz-table .mz-select-cell { width: 38px; padding-right: 0; }
.mz-table input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--brand-500); }
.mz-table .mz-row-actions { display: flex; gap: 4px; justify-content: flex-end; }
.mz-iconbtn { display: inline-grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 1px solid transparent; border-radius: 9px; background: transparent; color: var(--muted); }
.mz-iconbtn:hover { border-color: var(--control-border); background: var(--control-bg); color: var(--ink); }
.mz-iconbtn .lucide { width: 16px; height: 16px; }
.mz-iconbtn.is-danger:hover { color: var(--tone-bad); }
.mz-pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; font-size: .84rem; color: var(--muted); }
.mz-pager .row { gap: 6px; }
.mz-selection { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 14px; background: var(--hover-bg); font-weight: 650; }
.mz-selection strong { font-variant-numeric: tabular-nums; }
.mz-selection .row { margin-left: auto; gap: 8px; }

/* Empty, loading and error states */
.mz-empty { display: grid; justify-items: center; gap: 6px; padding: 32px 20px; border: 1px dashed var(--field-border); border-radius: 18px; text-align: center; color: var(--muted); }
.mz-empty > .lucide { width: 28px; height: 28px; color: var(--link); }
.mz-empty p { margin: 0; max-width: 46ch; }
.mz-empty strong { color: var(--ink); }
.mz-empty .btn { margin-top: 8px; }
.mz-empty--loading > .lucide { animation: mz-spin 1s linear infinite; }
.mz-empty--error > .lucide { color: var(--tone-bad); }
@keyframes mz-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .mz-empty--loading > .lucide { animation: none; } }

/* Notice */
.mz-notice { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: 14px; background: var(--tone-info-bg); color: var(--tone-info); font-size: .88rem; font-weight: 550; }
.mz-notice > .lucide { flex: none; width: 18px; height: 18px; margin-top: 1px; }
.mz-notice p { margin: 0; color: inherit !important; }
.mz-notice .btn { margin-left: auto; }
.mz-notice--warn { background: var(--tone-warn-bg); color: var(--tone-warn); }
.mz-notice--bad { background: var(--tone-bad-bg); color: var(--tone-bad); }
.mz-notice--good { background: var(--tone-good-bg); color: var(--tone-good); }
.mz-notice--demo { background: var(--tone-live-bg); color: var(--tone-live); }

/* Progress */
.mz-progress { position: relative; height: 8px; overflow: hidden; border-radius: 99px; background: rgba(119, 39, 143, .14); }
html[data-theme="dark"] .mz-progress { background: #ffffff1f; }
.mz-progress > span { position: absolute; inset: 0 auto 0 0; border-radius: inherit; background: linear-gradient(90deg, #8f2eaa, #c76be0); transition: width .4s ease; }
.mz-progress > span.is-nopick { background: var(--c2); }
.mz-progress > span.is-failed { background: var(--tone-bad); }
.mz-progress--multi { display: flex; }
.mz-progress--multi > span { position: static; border-radius: 0; }

/* Timeline */
.mz-timeline { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.mz-timeline li { position: relative; display: grid; grid-template-columns: 22px 1fr; gap: 10px; padding: 0 0 14px; }
.mz-timeline li::before { content: ""; position: absolute; left: 10px; top: 20px; bottom: 0; width: 2px; background: var(--line); }
.mz-timeline li:last-child::before { display: none; }
.mz-timeline .mz-timeline__dot { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--surface-2); color: var(--link); }
.mz-timeline .mz-timeline__dot .lucide { width: 12px; height: 12px; }
.mz-timeline p { margin: 0; color: var(--ink); font-size: .88rem; }
.mz-timeline small { display: block; margin-top: 1px; }

/* Avatars */
.mz-avatar { display: inline-grid; place-items: center; flex: none; width: 30px; height: 30px; overflow: hidden; border-radius: 50%; background: hsl(var(--h, 290) 55% 88%); color: hsl(var(--h, 290) 55% 26%); font-size: .72rem; font-weight: 800; }
html[data-theme="dark"] .mz-avatar { background: hsl(var(--h, 290) 40% 30%); color: hsl(var(--h, 290) 80% 90%); }
.mz-avatar img { width: 100%; height: 100%; object-fit: cover; }
.mz-avatar--sm { width: 26px; height: 26px; font-size: .66rem; }
.mz-avatar--lg { width: 72px; height: 72px; font-size: 1.4rem; }
.mz-who { display: inline-flex; align-items: center; gap: 8px; }
.profile-avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }

/* Profile menu: demo identity */
.profile-menu { width: 280px; }
.profile-menu__demo { display: grid; gap: 2px; margin: 0 0 6px; padding: 4px 0 8px; border-bottom: 1px solid var(--line); }
.profile-menu__demo .eyebrow { margin: 6px 8px 4px; }
.profile-menu__demo button { display: grid; grid-template-columns: 26px 1fr; align-items: center; gap: 9px; padding: 7px 8px; border: 0; border-radius: 9px; background: transparent; color: var(--ink); text-align: left; }
.profile-menu__demo button:hover { background: var(--hover-bg); }
.profile-menu__demo button[aria-checked="true"] { background: var(--hover-bg); box-shadow: inset 3px 0 0 var(--brand-500); }
.profile-menu__demo span { display: grid; min-width: 0; }
.profile-menu__demo strong { font-size: .86rem; }
.profile-menu__demo small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .74rem; color: var(--muted); }

/* Sidebar counts and bell */
.nav-count { margin-left: auto; min-width: 20px; padding: 1px 7px; border-radius: 99px; background: rgba(255, 255, 255, .22); color: #fff; font-size: .7rem; font-weight: 800; text-align: center; }
.sidebar.is-collapsed .nav-count { display: none; }
.mz-bell { position: relative; }
.mz-bell .lucide { width: 18px; height: 18px; }
.mz-bell__dot { position: absolute; top: 5px; right: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); box-shadow: 0 0 0 2px var(--panel-bg, #fff); }

/* Charts */
.mz-chart { position: relative; display: grid; gap: 10px; }
.mz-chart__svg { display: block; width: 100%; height: auto; overflow: visible; }
.mz-chart--round { grid-template-columns: minmax(160px, 260px) 1fr; align-items: center; }
.mz-chart__svg--round { max-width: 260px; }
.mz-chart__grid { stroke: var(--line); stroke-width: 1; }
.mz-chart__axis { fill: var(--muted); font-size: 11px; }
.mz-chart__label { fill: var(--ink); font-size: 12px; }
.mz-chart__value { fill: var(--muted); font-size: 11px; font-weight: 700; }
.mz-chart__total { fill: var(--ink); font-size: 22px; font-weight: 800; text-anchor: middle; }
.mz-chart__sub { fill: var(--muted); font-size: 11px; text-anchor: middle; }
.mz-chart [data-tip] { outline: none; transition: opacity .15s; }
.mz-chart [data-tip]:hover, .mz-chart [data-tip]:focus { opacity: .78; }
.mz-chart [data-tip]:focus { stroke: var(--ink); stroke-width: 2; }
.mz-c0 { fill: var(--c0); } .mz-c1 { fill: var(--c1); } .mz-c2 { fill: var(--c2); } .mz-c3 { fill: var(--c3); } .mz-c4 { fill: var(--c4); } .mz-c5 { fill: var(--c5); }
.mz-s0 { stroke: var(--c0); } .mz-s1 { stroke: var(--c1); } .mz-s2 { stroke: var(--c2); } .mz-s3 { stroke: var(--c3); } .mz-s4 { stroke: var(--c4); } .mz-s5 { stroke: var(--c5); }
.mz-line { fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.mz-area { opacity: .18; }
.mz-dot { stroke: var(--panel-bg, #fff); stroke-width: 2; }
.mz-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 0; padding: 0; list-style: none; font-size: .8rem; color: var(--ink); }
.mz-chart--round .mz-legend { display: grid; gap: 7px; }
.mz-legend li { display: flex; align-items: center; gap: 7px; }
.mz-legend b { margin-left: auto; padding-left: 8px; font-variant-numeric: tabular-nums; }
.mz-swatch { width: 11px; height: 11px; flex: none; border-radius: 3px; }
.mz-swatch.mz-c0 { background: var(--c0); } .mz-swatch.mz-c1 { background: var(--c1); } .mz-swatch.mz-c2 { background: var(--c2); } .mz-swatch.mz-c3 { background: var(--c3); } .mz-swatch.mz-c4 { background: var(--c4); } .mz-swatch.mz-c5 { background: var(--c5); }
.mz-tip { position: absolute; z-index: 5; transform: translate(-50%, calc(-100% - 8px)); padding: 5px 9px; border-radius: 8px; background: var(--ink); color: var(--page); font-size: .76rem; font-weight: 650; white-space: nowrap; pointer-events: none; }
.mz-chart--empty { place-items: center; min-height: 160px; border: 1px dashed var(--field-border); border-radius: 14px; color: var(--muted); }
.mz-chart--empty p { display: flex; align-items: center; gap: 8px; margin: 0; }
.mz-chart-card { display: grid; align-content: start; gap: 10px; }
.mz-chart-card header { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.mz-chart-card h3 { margin: 0; font-size: 1rem; }
.mz-chart-card .mz-chart-meta { font-size: .74rem; color: var(--muted); }

/* Call recording player and transcript */
.mz-player { display: grid; gap: 10px; }
.mz-player__bar { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; background: var(--surface-2); }
.mz-player__play { display: grid; place-items: center; flex: none; width: 40px; height: 40px; border: 0; border-radius: 50%; background: var(--brand-500); color: #fff; }
.mz-player__play .lucide { width: 18px; height: 18px; }
.mz-player__track { position: relative; flex: 1; height: 26px; border-radius: 8px; background: repeating-linear-gradient(90deg, rgba(119, 39, 143, .2) 0 2px, transparent 2px 5px); cursor: pointer; overflow: hidden; }
.mz-player__track > span { position: absolute; inset: 0 auto 0 0; width: 0; background: repeating-linear-gradient(90deg, var(--brand-500) 0 2px, transparent 2px 5px); }
.mz-player__track > i { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--c1); opacity: .5; }
.mz-player__track > i.is-agent { background: var(--c0); }
.mz-player__time { flex: none; font-size: .8rem; color: var(--muted); }
.mz-player__note { display: flex; align-items: center; gap: 6px; margin: 0; }
.mz-player__note .lucide { width: 14px; height: 14px; }
.mz-transcript { display: grid; gap: 6px; max-height: 340px; overflow: auto; margin: 0; padding: 2px; list-style: none; }
.mz-transcript button { display: grid; grid-template-columns: 56px 46px 1fr; gap: 8px; width: 100%; padding: 8px 10px; border: 1px solid transparent; border-radius: 12px; background: transparent; color: var(--ink); text-align: left; font-size: .88rem; }
.mz-transcript button:hover { background: var(--hover-bg); }
.mz-transcript .is-current button { border-color: var(--brand-200); background: var(--hover-bg); }
.mz-transcript__who { font-weight: 750; font-size: .76rem; color: var(--link); }
.is-caller .mz-transcript__who { color: var(--c1); }
.mz-transcript__t { font-size: .76rem; color: var(--muted); }

/* Report sheet (print-friendly) */
.mz-report { display: grid; gap: 18px; max-width: 980px; margin: 0 auto; padding: 32px; border-radius: 20px; background: var(--solid-bg, #fff); color: var(--ink); box-shadow: var(--solid-shadow); }
.mz-report__head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 16px; padding-bottom: 16px; border-bottom: 2px solid var(--brand-500); }
.mz-report__head h1 { margin: 0 0 4px; font-size: 1.9rem; }
.mz-report__mark { font-size: .76rem; color: var(--muted); text-align: right; }
.mz-report__mark img { display: block; height: 26px; margin-left: auto; padding: 4px 8px; border-radius: 6px; background: var(--brand-500); }
.mz-report h2 { margin: 6px 0 0; font-size: 1.15rem; }
.mz-report__summary { padding: 14px 16px; border-left: 4px solid var(--brand-500); border-radius: 0 12px 12px 0; background: var(--surface-2); }
.mz-report__summary p { margin: 0 0 8px; color: var(--ink); }
.mz-report__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.mz-report__foot { padding-top: 12px; border-top: 1px solid var(--line); font-size: .76rem; color: var(--muted); }
@media print {
  .sidebar, .topbar, .page-heading, .mz-noprint, .toast, .drawer-backdrop { display: none !important; }
  .app-shell, .shell-main, .main-content { display: block !important; padding: 0 !important; margin: 0 !important; background: #fff !important; }
  body { background: #fff !important; }
  .mz-report { box-shadow: none; padding: 0; max-width: none; color: #111; background: #fff; }
  .mz-report__grid { break-inside: avoid; }
  .mz-chart-card { break-inside: avoid; }
}

/* Two-column layouts */
.mz-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 380px); gap: 18px; align-items: start; }
.mz-split--even { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.mz-stack { display: grid; gap: 14px; align-content: start; min-width: 0; }

@media (max-width: 1100px) {
  .mz-split { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .mz-form-grid, .mz-split--even, .mz-report__grid { grid-template-columns: 1fr; }
  .mz-chart--round { grid-template-columns: 1fr; justify-items: center; }
  .mz-dialog__head, .mz-dialog__body, .mz-dialog__foot { padding-left: 16px; padding-right: 16px; }
  .mz-kv { grid-template-columns: 1fr; gap: 2px 0; }
  .mz-kv dd { margin-bottom: 8px; }
  .mz-transcript button { grid-template-columns: 1fr auto; }
  .mz-transcript__text { grid-column: 1 / -1; }
  .mz-report { padding: 18px; }
}

/* Phone top bar: the bell joined the actions, so the AI Agent label and search text compact first. */
@media (max-width: 560px) {
  .agent-assistant-trigger span { display: none; }
  .topbar-search span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .topbar-actions .icon-button { width: 36px; height: 36px; }
}
