/* The glow kit: the pieces every screen is built from (Look and Theme, phase 1). Colours come only from the variables in theme.css, so the kit follows the theme switch and
   the company's own colour, and nothing here types a colour of its own (tests/test_glow_kit.py proves it). Colour comes from lights on a near black page, never from pastel
   tinted tiles: the main colour lights buttons, the active menu item and highlights, and each supporting colour keeps one meaning (green paid, positive or live; red failed,
   negative or overdue; orange waiting or neutral; teal replies; pink opens).

   Glow is built from shadows, which cost paint time, so there is a budget: at most one frosted (blurred) layer on screen besides the top bar, no animated filters, motion only
   on transform and opacity, and glow only on tiles, chips, buttons, the active menu item and chart marks. Everything that moves stops when the person's device asks for
   reduced motion (the last block of this file). The names below are the interface the Settings Round and Calendar build on (docs/DECISIONS.md, Look and Theme). */

/* ---- the page ------------------------------------------------------------------------------------------------------------ */
body { background-image: var(--page-glow); background-repeat: no-repeat; }
body.app .topbar {
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
/* a browser that cannot blur (older Safari knows only the prefixed name) gets a solid bar, not a see through one with page text showing behind the buttons */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) { body.app .topbar { background: var(--bg); } }
.topbar .brand { color: var(--text-strong); }
h1.page-title { color: var(--text-strong); letter-spacing: -0.01em; }
.sec-title, .panel-head h2, h2.step-title { color: var(--text-strong); }
.lead, .loading { color: var(--text-muted); }

/* The theme switch in the top bar: a sun and a moon, two real buttons in a group (static/js/theme.js). */
.theme-switch { display: inline-flex; align-items: center; gap: 2px; padding: 2px; border: 1px solid var(--border-strong); border-radius: 999px; background: var(--card-raised); }
.app .theme-switch button.icon-button { padding: 6px 8px; border-radius: 999px; box-shadow: none; color: var(--text-muted); background: transparent; }
.app .theme-switch button.icon-button:hover { color: var(--text); background: transparent; }
.app .theme-switch button.icon-button[aria-pressed="true"] { background: var(--primary); color: var(--on-primary); box-shadow: var(--glow-button); }
@media (max-width: 760px) { .app .theme-switch button.icon-button { min-width: 36px; min-height: 36px; } }       /* a finger: as big as the Menu button beside them */

/* ---- cards: the page's own sections get the card look with no page edit ----------------------------------------------- */
.sec, .card, .p7-card, .adw-card, .notes-list article, .install-group, .onboard-group, .bp-card, .bp-pack, .portal-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
}
table.list { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-card); }
table.list th { background: var(--card-raised); color: var(--text-muted); }
table.list tr:hover td { background: rgba(var(--primary-rgb), 0.06); }
/* A heading over a column of numbers sits at the right edge with the numbers. The pages give their number cells the class num and leave the headings plain, so the column decides:
   a column whose every cell is a number gets a right aligned heading (twelve columns are enough for every list in the CRM). */
table.list:has(td.num:nth-child(1)):not(:has(td:nth-child(1):not(.num))) th:nth-child(1),
table.list:has(td.num:nth-child(2)):not(:has(td:nth-child(2):not(.num))) th:nth-child(2),
table.list:has(td.num:nth-child(3)):not(:has(td:nth-child(3):not(.num))) th:nth-child(3),
table.list:has(td.num:nth-child(4)):not(:has(td:nth-child(4):not(.num))) th:nth-child(4),
table.list:has(td.num:nth-child(5)):not(:has(td:nth-child(5):not(.num))) th:nth-child(5),
table.list:has(td.num:nth-child(6)):not(:has(td:nth-child(6):not(.num))) th:nth-child(6),
table.list:has(td.num:nth-child(7)):not(:has(td:nth-child(7):not(.num))) th:nth-child(7),
table.list:has(td.num:nth-child(8)):not(:has(td:nth-child(8):not(.num))) th:nth-child(8),
table.list:has(td.num:nth-child(9)):not(:has(td:nth-child(9):not(.num))) th:nth-child(9),
table.list:has(td.num:nth-child(10)):not(:has(td:nth-child(10):not(.num))) th:nth-child(10),
table.list:has(td.num:nth-child(11)):not(:has(td:nth-child(11):not(.num))) th:nth-child(11),
table.list:has(td.num:nth-child(12)):not(:has(td:nth-child(12):not(.num))) th:nth-child(12) { text-align: right; }
.lane, .row-card, .pair .side, .renewal-question { background: var(--card-raised); border-color: var(--border); }
.deal-card { background: var(--card); border-color: var(--border); }
dialog.confirm, dialog.panel { background: var(--card); border-color: var(--border-strong); box-shadow: var(--shadow-pop); }
.note { background: var(--card-raised); border-color: var(--border); color: var(--text-muted); }

/* ---- the menu look (the groups themselves are built in static/js/menu.js) ------------------------------------------------ */
.menu { background: var(--bg-alt); border-right: 1px solid var(--border); }
@media (max-width: 760px) { .menu { border-right: 0; } }                                  /* on a phone the menu is a block above the page (app.css), so no line down its right side */
.menu a { color: var(--text); }
.menu a:hover { background: rgba(var(--primary-rgb), 0.08); }
.menu a.current { background: var(--primary-tint); color: var(--link); box-shadow: var(--glow-active); position: relative; }
/* a group: a header button (icon chip, the group's name, an arrow) that opens its pages underneath; the open group's header takes a lighter tint */
.menu .menu-group { margin: 2px 0; }
.app button.menu-group-head { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 7px 8px; border-radius: 10px; color: var(--text-strong); font-weight: 700; }
.app button.menu-group-head:hover { background: rgba(var(--primary-rgb), 0.08); transform: none; box-shadow: none; }
.app button.menu-group-head[aria-expanded="true"] { background: var(--primary-tint); }
.menu-group-name { flex: 1; min-width: 0; }
.menu-arrow { width: 16px; height: 16px; flex: none; color: var(--text-muted); }
.menu-group-head[aria-expanded="true"] .menu-arrow { transform: rotate(90deg); }
.menu .menu-group-list { list-style: none; margin: 2px 0 6px; padding: 0 0 0 14px; }
.menu .menu-group-list[hidden] { display: none; }
.menu .menu-group-list li { display: flex; align-items: center; gap: 8px; }
.menu .menu-group-list li a { flex: 1; min-width: 0; padding: 8px 10px; font-size: 0.95rem; }
/* The desktop menu is 248 pixels, not the 220 of the old flat list: with its Coming tag beside it, Morning brief, National map and Ad builder wrapped onto two lines (the plan's mockup draws about 262).
   The tag is a little smaller too (.menu .menu-coming outranks .tag, which comes later in this file and made the old 0.7rem here dead). The phone keeps app.css: a block above the page. */
@media (min-width: 761px) { .menu { width: 248px; } }
.menu .menu-coming { flex: none; font-size: 0.64rem; padding: 1px 7px; }
/* a message under the top bar (a sign out that did not go through) takes its own line */
body.app .topbar { flex-wrap: wrap; }
.topbar .signout-error { flex-basis: 100%; margin: 4px 0 0; }

/* ---- buttons light up ---------------------------------------------------------------------------------------------------- */
button, .app a.button-link { box-shadow: var(--glow-button); transition: box-shadow 0.15s, transform 0.15s; }
/* :where() keeps the hover rule exactly as weak as the resting rule above, so every rule below that makes a button flat or places it (the eye's centring) wins in the hover state too */
button:where(:hover:not(:disabled)), .app a.button-link:where(:hover) { box-shadow: var(--glow-button-hover); transform: translateY(-1px); }
button:disabled { box-shadow: none; transform: none; }
/* the buttons that are not filled stay flat: a quiet button, an icon button, a dollar, a number link, a tab, a link button, the eye */
button.quiet, .app button.quiet, .app button.icon-button, .app button.dollar, button.numlink, button.link, .tabs button, .pill button, #crm-update-bar button.quiet,
.eye-field .eye, #crm-saved button, .app button.example, .app button.menu-group-head { background: transparent; box-shadow: none; }
button.quiet, .app button.quiet, .app button.icon-button, .app button.dollar, button.numlink, button.link, .tabs button, .pill button, #crm-update-bar button.quiet,
#crm-saved button, .app button.example, .app button.menu-group-head { transform: none; }       /* no lift either (the eye is left out: its transform is its centring) */
.app button.quiet { border: 1px solid var(--border-strong); }                         /* the quiet button is the outlined one (plan C2, Buttons) */
button.quiet:hover:not(:disabled), .app button.quiet:hover:not(:disabled) { background: rgba(var(--primary-rgb), 0.12); transform: none; box-shadow: none; }
.app button.icon-button:hover, .app button.dollar:hover { transform: none; box-shadow: none; }       /* a tab is not here: the selected tab's underline is a box-shadow that must survive the mouse */
.app button.danger:not(:disabled) { box-shadow: 0 4px 16px rgba(var(--red-rgb), 0.35); }
.app button.approve:not(:disabled) { box-shadow: 0 4px 16px rgba(var(--green-rgb), 0.35); }

/* ---- fields -------------------------------------------------------------------------------------------------------------- */
input[type="email"], input[type="password"], input[type="text"], .app input[type="text"], .app input[type="search"], .app input[type="email"], .app input[type="tel"],
.app input[type="url"], .app input[type="number"], .app input[type="date"], .app input[type="month"], .app input[type="datetime-local"], .app input[type="password"], .app select, .app textarea {
  background: var(--bg-alt);
  border-color: var(--border-strong);
  color: var(--text);
}
input:focus, .app input:focus, .app select:focus, .app textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.35); }       /* the keyboard ring of app.css stays: a field never loses its outline */
::placeholder { color: var(--text-muted); opacity: 1; }
.branding-form .field > .label { display: block; font-weight: 600; margin: 16px 0 6px; }       /* the caption of a group of choices looks like the caption of a field (app.css label) */
.app select option { background: var(--card); color: var(--text); }
/* The browser's own controls follow the theme and the company's main colour: a checkbox, a radio and a slider take the main colour; the file picker's grey button is drawn like a quiet button;
   the "It may read" box is a themed group like the install and onboarding groups (visual review of the page pictures, tests/test_visual_review_fixes.py). A disabled checked box stays the browser's grey
   whatever the colour (Chromium draws it so): it says "the system ticked this", which is what it means. */
input[type="checkbox"], input[type="radio"], input[type="range"], progress { accent-color: var(--primary); }
input[type="file"] { font-family: inherit; font-size: 1rem; color: var(--text-muted); max-width: 100%; }       /* the browser's own 13 pixels looked small beside the 18 pixel fields and buttons */
input[type="file"]::file-selector-button { margin-right: 12px; padding: 8px 14px; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--card-raised); color: var(--text); font: inherit; font-weight: 600; cursor: pointer; }
input[type="file"]::file-selector-button:hover { background: rgba(var(--primary-rgb), 0.12); border-color: var(--primary); }
.app fieldset.field { border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 14px 12px; margin: 0 0 12px; min-width: 0; }
.app fieldset.field legend { padding: 0 6px; font-weight: 600; }
.edit-form .field > label > input[type="checkbox"] { width: 20px; height: 20px; vertical-align: middle; margin: 0 6px 0 0; }       /* the app's own check boxes are 20 pixels; the bare ones were the browser's 13 */
.edit-form > button + button { margin-left: 10px; }                                          /* two buttons put straight in a form (the chart builder) did not touch by design: .app button has no margin */
/* three small page defects from the same review */
.rep-rate-control { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 8px; }      /* on its own line under the sentence: inline, the drop-down and the button made the line that carried them taller than its neighbours */
.rep-rate-control select { width: auto; }                                                    /* the Statements rep rate drop-down was as wide as its card (.app select is 100 percent) */
a.row-card { text-decoration: none; }                                                        /* a support ticket card is one link: only its title is the link's look, not its three grey lines */
a.row-card:hover .main > strong { text-decoration: underline; text-underline-offset: 3px; }

/* ---- the colour classes every piece below shares: --c (rgb triple), --tc (text colour), --tint (a solid tint over the card) ---------- */
.c-purple { --c: var(--primary-rgb); --tc: var(--link); --tint: var(--primary-tint); }
.c-green { --c: var(--green-rgb); --tc: var(--green-text); --tint: var(--green-tint); }
.c-red { --c: var(--red-rgb); --tc: var(--red-text); --tint: var(--red-tint); }
.c-orange { --c: var(--orange-rgb); --tc: var(--orange-text); --tint: var(--orange-tint); }
.c-teal { --c: var(--teal-rgb); --tc: var(--teal-text); --tint: var(--teal-tint); }
.c-pink { --c: var(--pink-rgb); --tc: var(--pink-text); --tint: var(--pink-tint); }

/* ---- icon chip: a rounded square, a tint of its colour, a thin ring and a glow (a soft shadow in the light theme) --------------- */
.chip {
  width: 34px; height: 34px; flex: none; border-radius: 11px; display: inline-grid; place-items: center;
  background: var(--tint, var(--primary-tint));                       /* no colour class: the main colour; a .c-* class sets --c and --tint (a default set here would beat the class) */
  box-shadow: inset 0 0 0 1px rgba(var(--c, var(--primary-rgb)), 0.38), 0 0 16px rgba(var(--c, var(--primary-rgb)), 0.3);
  color: rgb(var(--c, var(--primary-rgb)));
}
:root[data-theme="light"] .chip { box-shadow: inset 0 0 0 1px rgba(var(--c, var(--primary-rgb)), 0.3), 0 4px 12px rgba(var(--c, var(--primary-rgb)), 0.2); }
.chip svg { width: 19px; height: 19px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.chip.sm { width: 28px; height: 28px; border-radius: 9px; }
.chip.sm svg { width: 16px; height: 16px; }
.chip.lg { width: 42px; height: 42px; border-radius: 13px; }
.chip.lg svg { width: 23px; height: 23px; }

/* ---- tag and pill: a status word on a tint of its colour --------------------------------------------------------------------- */
.tag { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 0.78rem; font-weight: 700; background: var(--tint, var(--card-raised)); color: var(--tc, var(--text)); box-shadow: inset 0 0 0 1px rgba(var(--c, var(--primary-rgb)), 0.3); }
.pill { background: var(--card-raised); color: var(--text); }
.pill.c-green, .pill.c-red, .pill.c-orange, .pill.c-teal, .pill.c-pink, .pill.c-purple { background: var(--tint); color: var(--tc); border-color: transparent; box-shadow: inset 0 0 0 1px rgba(var(--c), 0.3); }
.pill.status-prospect, .pill.screen-planned { background: var(--primary-tint); color: var(--link); }
.pill.status-customer, .pill.screen-live, .pill.state-operational, .pill.p7-good { background: var(--green-tint); color: var(--green-text); }
.pill.status-former, .pill.screen-closed, .pill.screen-down, .pill.screen-removed, .pill.state-down, .pill.waiting, .pill.sev-critical, .pill.sev-high, .pill.p7-bad { background: var(--red-tint); color: var(--red-text); }
.pill.state-degraded, .pill.state-maintenance { background: var(--orange-tint); color: var(--orange-text); }

/* ---- number tile: a label, a big number, an icon chip and a change pill --------------------------------------------------------- */
.tile { padding: 16px 18px; display: flex; flex-direction: column; gap: 6px; min-width: 0; position: relative; }
.tile .tile-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.tile .tile-label { color: var(--text-muted); font-size: 0.85rem; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.tile .tile-num { font-size: 2rem; font-weight: 800; letter-spacing: -0.02em; color: var(--text-strong); line-height: 1.1; font-variant-numeric: tabular-nums; text-shadow: 0 0 18px rgba(var(--c, var(--primary-rgb)), 0.4); background: none; border: 0; padding: 0; text-align: left; font-family: inherit; }
:root[data-theme="light"] .tile .tile-num { text-shadow: none; }
.change { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font-size: 0.78rem; font-weight: 700; background: var(--tint); color: var(--tc); box-shadow: inset 0 0 0 1px rgba(var(--c), 0.3); width: fit-content; }
.change svg { width: 10px; height: 10px; fill: currentColor; }
.tile .vs { color: var(--text-muted); font-size: 0.78rem; }
.app .tile button.tile-num { cursor: pointer; width: auto; margin: 0; box-shadow: none; background: none; }
.app .tile button.tile-num:hover { transform: none; box-shadow: none; text-decoration: underline; text-underline-offset: 4px; }

/* ---- toggle chip (a coloured dot and a name, lit when on) and segmented control (tabs such as Overview, Funnel, Calls) -------------- */
.app .toggle-chip { display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--border-strong); background: transparent; color: var(--text-muted); font-size: 0.85rem; font-weight: 600; cursor: pointer; width: auto; margin: 0; box-shadow: none; }
.app .toggle-chip:hover:not(:disabled) { transform: none; box-shadow: none; color: var(--text); background: rgba(var(--c, var(--primary-rgb)), 0.1); }
.toggle-chip .dot { width: 10px; height: 10px; border-radius: 50%; background: rgb(var(--c, var(--primary-rgb))); opacity: 0.45; }
.app .toggle-chip[aria-pressed="true"] { color: var(--text); background: var(--tint, var(--primary-tint)); border-color: rgba(var(--c, var(--primary-rgb)), 0.6); box-shadow: 0 0 12px rgba(var(--c, var(--primary-rgb)), 0.25); }
.toggle-chip[aria-pressed="true"] .dot { opacity: 1; box-shadow: 0 0 8px rgba(var(--c, var(--primary-rgb)), 0.9); }
.seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: 11px; background: var(--card-raised); border: 1px solid var(--border); }
.app .seg button { width: auto; margin: 0; padding: 5px 12px; border-radius: 8px; font-size: 0.85rem; font-weight: 600; color: var(--text-muted); background: transparent; box-shadow: none; }
.app .seg button:hover:not(:disabled) { transform: none; box-shadow: none; color: var(--text); }
.app .seg button[aria-pressed="true"], .app .seg button[aria-selected="true"] { background: var(--primary-tint); color: var(--link); box-shadow: inset 0 0 0 1px rgba(var(--primary-rgb), 0.45); }

/* ---- tooltip: one shared floating box, drawn by ui.js tooltip(), the same in both themes --------------------------------------------- */
.tooltip { position: fixed; z-index: 1100; max-width: 280px; padding: 8px 11px; border-radius: 10px; background: var(--tip-bg); color: var(--tip-text); border: 1px solid var(--tip-border); box-shadow: var(--shadow-pop); font-size: 0.82rem; line-height: 1.4; display: none; }
.tooltip.show { display: block; }
.tooltip b { display: block; font-size: 0.85rem; margin-bottom: 2px; }
.tooltip span { display: block; color: var(--tip-text-soft); }
.app .tooltip button { margin: 8px 0 0; padding: 4px 10px; font-size: 0.8rem; }
[data-tip] { cursor: help; }
svg.chart [data-tip], .tile [data-tip] { cursor: pointer; }

/* ---- glass preview card (frosted; a solid card where blur is not supported or the person asked for less transparency) ------------- */
.glass { background: var(--card-raised); border: 1px solid var(--border-strong); border-radius: var(--radius); box-shadow: var(--shadow-pop); padding: 14px 16px; }
@supports (backdrop-filter: blur(1px)) {
  .glass { background: color-mix(in srgb, var(--card-raised) 82%, transparent); backdrop-filter: blur(14px); }
}

/* ---- drawer: a panel that opens beside a list so the list stays in view ---------------------------------------------------------------- */
.drawer-layout { display: flex; gap: 16px; align-items: flex-start; }
.drawer-layout > :first-child { flex: 1 1 auto; min-width: 0; }
.drawer { flex: 0 0 340px; max-width: 100%; position: sticky; top: 72px; max-height: calc(100vh - 96px); overflow: auto; padding: 16px; background: var(--card); border: 1px solid var(--border-strong); border-radius: var(--radius); box-shadow: var(--shadow-pop); }
.drawer[hidden] { display: none; }
@media (max-width: 760px) { .drawer-layout { display: block; } .drawer { position: static; max-height: none; margin-top: 12px; } }

/* ---- list bar: a row with a soft fill behind it sized to its share (top lists, reply categories) --------------------------------------- */
.list-bar { position: relative; display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 9px; font-size: 0.9rem; margin: 3px 0; overflow: hidden; color: var(--text); }
.list-bar .fill { position: absolute; left: 0; top: 0; bottom: 0; background: linear-gradient(90deg, rgba(var(--c, var(--primary-rgb)), 0.3), rgba(var(--c, var(--primary-rgb)), 0.06)); border-radius: 9px; box-shadow: inset 0 0 0 1px rgba(var(--c, var(--primary-rgb)), 0.25); }
.list-bar > span, .list-bar > b, .list-bar > a, .list-bar > button { position: relative; }
.list-bar b { margin-left: auto; font-variant-numeric: tabular-nums; color: var(--text-strong); }
a.list-bar { text-decoration: none; }
a.list-bar:hover .fill { filter: brightness(1.2); }

/* ---- empty state: a small orb, one sentence and one button; loading skeleton: a calm shimmer ----------------------------------------- */
.empty-state { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 22px 12px; text-align: center; color: var(--text-muted); font-style: normal; }
.empty-state p { margin: 0; }
p.empty-state { flex-direction: row; justify-content: flex-start; padding: 6px 0; text-align: left; }
.skeleton { display: block; position: relative; overflow: hidden; height: 14px; margin: 8px 0; border-radius: 8px; background: var(--card-raised); }
.skeleton::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent 0%, var(--border) 50%, transparent 100%); transform: translateX(-100%); animation: ltb-shimmer 1.6s ease-in-out infinite; }       /* a light slides across a block that stays where it is: only transform moves (the plan's budget) */
.skeleton.tall { height: 64px; }
@keyframes ltb-shimmer { to { transform: translateX(100%); } }

/* ---- toast: the saved and failed notes (the CRM's own saved() and error(); one box, restyled) -------------------------------------------- */
#crm-saved.toast { border-left: 3px solid rgb(var(--green-rgb)); }
#crm-saved.toast.failed { border-left-color: rgb(var(--red-rgb)); }
#crm-saved.toast .toast-text { font-weight: 600; }

/* ---- the assistant orb: inline SVG with three states (static/js/orb.js) ----------------------------------------------------------------- */
.orb { width: 176px; height: 176px; display: block; }
.orb.small, svg.mini-orb { width: 24px; height: 24px; }
.empty-state svg.mini-orb { width: 36px; height: 36px; }
.orb .ring1 { transform-origin: 100px 100px; animation: ltb-spin var(--spin, 22s) linear infinite; }
.orb .ring2 { transform-origin: 100px 100px; animation: ltb-spin calc(var(--spin, 22s) * 1.5) linear infinite reverse; }
.orb .core, .orb .halo { transform-origin: 100px 100px; animation: ltb-breathe 4.5s ease-in-out infinite; }
.orb .halo { opacity: 0.7; }
.orb[data-state="listening"] { --spin: 8s; }
.orb[data-state="listening"] .halo { opacity: 1; }                                      /* listening: the rings turn faster and the glow is brighter */
.orb[data-state="answering"] .core { animation-duration: 1.2s; }
.orb .core-fill { filter: drop-shadow(0 0 16px rgba(var(--primary-rgb), 0.8)); }
.orb[data-state="listening"] .core-fill { filter: drop-shadow(0 0 26px rgba(var(--primary-rgb), 1)); }
@keyframes ltb-spin { to { transform: rotate(360deg); } }
@keyframes ltb-breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.045); } }

/* ---- charts (static/js/charts.js): colour from the series names, never typed ------------------------------------------------------------------------------------- */
.series-phone { --mark: var(--channel-phone); }
.series-email { --mark: var(--channel-email); }
.series-both { --mark: var(--channel-both); }
.series-slate-1 { --mark: var(--slate-1); }
.series-slate-2 { --mark: var(--slate-2); }
.series-purple { --mark: var(--primary); }
.series-green { --mark: var(--green); }
.series-red { --mark: var(--red); }
.series-orange { --mark: var(--orange); }
.series-teal { --mark: var(--teal); }
.series-pink { --mark: var(--pink); }
svg.chart .fill { fill: var(--mark, var(--channel-phone)); }
svg.chart .ln { stroke: var(--mark, var(--channel-phone)); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; fill: none; filter: drop-shadow(0 0 5px color-mix(in srgb, var(--mark, var(--channel-phone)) 70%, transparent)); }
svg.chart .ln.dotted { stroke-dasharray: 2 6; stroke-opacity: 0.7; filter: none; }
svg.chart .arc { stroke: var(--mark, var(--channel-phone)); fill: none; filter: drop-shadow(0 0 5px color-mix(in srgb, var(--mark, var(--channel-phone)) 70%, transparent)); }       /* a donut slice: its thickness is the chart's own stroke-width, which a class here must not set */
svg.chart .area { fill: var(--mark, var(--channel-phone)); fill-opacity: 0.14; stroke: none; }
svg.chart .chart-grid { stroke: var(--grid); stroke-width: 1; }
svg.chart .chart-axis { stroke: var(--viz-axis); }
svg.chart .chart-big { fill: var(--text-strong); font-size: 22px; font-weight: 800; font-family: var(--font); }
svg.chart .chart-sub { fill: var(--text-muted); font-size: 12px; font-family: var(--font); }
svg.chart .chart-value { paint-order: stroke; stroke: var(--card); stroke-width: 6px; stroke-linejoin: round; }       /* a printed number is wider than a bar and can lie over the bar beside it: a halo in the card's colour keeps its letters readable whatever is behind them */
svg.chart .chart-value-top { pointer-events: none; }                         /* the numbers of a column chart sit in a layer of their own above the bars: the mouse goes through them to the bar */
svg.chart .tile-base { fill: var(--card); }                                  /* what a tile is painted on: the colour shown through its own translucent fill is then known, whatever the page behind the chart is */
svg.chart .chart-tile-code { fill: var(--text-strong); font-size: 13px; font-weight: 700; font-family: var(--font); pointer-events: none; }       /* the page picks a better ink for it as soon as it knows the colours (charts.js, ink.js) */
svg.chart .donut-track { stroke: var(--card-raised); }
svg.chart.donut { max-width: 220px; }
svg.chart.heat, svg.chart.tilemap { max-width: 520px; }
svg.chart.trend { width: 96px; height: 28px; max-width: none; display: inline-block; }
svg.chart .ribbon-total { fill: var(--primary); fill-opacity: 0.55; }
svg.chart .flow .fill { fill-opacity: 0.35; }
svg.chart .flow:hover .fill, svg.chart .flow:focus .fill { fill-opacity: 0.55; }
svg.chart g.mk { cursor: default; outline: none; }
svg.chart g.mk.clickable { cursor: pointer; }
svg.chart g.mk:hover .fill, svg.chart g.mk:focus .fill { filter: brightness(1.25); }
svg.chart g.tile-state:hover .fill, svg.chart g.tile-state:focus .fill { filter: none; stroke: var(--text-strong); stroke-width: 2; }       /* a state tile is not brightened (its strength is the data, and its code has the ink that reads on the colour the tile paints, which a brighter tile would take away): hover and focus outline it instead */
svg.chart g.mk:focus-visible .fill, svg.chart g.mk:focus-visible .ln { stroke: var(--link); stroke-width: 3; }
svg.chart g.mk:focus-visible .fill { stroke-linejoin: round; }
.legend .swatch { background: var(--mark, var(--channel-phone)); }
.legend .swatch.dash { background: none; border-top: 2px dotted var(--text-muted); border-radius: 0; height: 0; width: 14px; vertical-align: 3px; }
.pipeline { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.home-card .pipeline { grid-template-columns: repeat(auto-fit, minmax(94px, 1fr)); }          /* four steps fit side by side in the narrower card beside Recent payments */
.pipeline .pipe-step { display: block; width: auto; margin: 0; text-align: left; padding: 12px 14px; border-radius: 12px; background: var(--card-raised); border: 1px solid var(--border); color: var(--text); box-shadow: none; }
.pipeline button.pipe-step:hover { transform: none; box-shadow: none; border-color: rgba(var(--c), 0.6); }
.pipe-num { font-size: 1.6rem; font-weight: 800; color: var(--text-strong); font-variant-numeric: tabular-nums; }
.pipe-label { color: var(--text-muted); font-size: 0.85rem; font-weight: 600; margin-top: 1px; }
.pipe-bar { height: 3px; border-radius: 3px; margin-top: 9px; background: rgb(var(--c)); box-shadow: 0 0 10px rgba(var(--c), 0.8); }
.info-mark { display: inline-grid; width: 14px; height: 14px; color: var(--text-muted); cursor: help; }

/* ---- the company's logo: one picture for each theme, and the style sheet shows the one for the theme on screen (static/js/logo.js) -------------------------------- */
:root[data-theme="dark"] .brand-logo[data-for="light"], :root[data-theme="light"] .brand-logo[data-for="dark"] { display: none; }
.brand-logo.plate-dark { background: var(--plate-dark); padding: 4px 8px; border-radius: 10px; }          /* the other theme's page: the one logo on a small rounded plate so it never shows as a box */
.brand-logo.plate-light { background: var(--plate-light); padding: 4px 8px; border-radius: 10px; }

/* ---- Settings, Branding (static/js/pages/branding.js): the form and the two live previews ---------------------------------------------------------------------- */
.branding-form .colour-field { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.branding-form input[type="color"] { width: 46px; height: 38px; padding: 2px; border-radius: 8px; border: 1px solid var(--border-strong); background: var(--bg-alt); cursor: pointer; }
.branding-form input.hex { width: 9.5rem; font-family: var(--font); }
/* an optional colour that is not set: a colour box can never be empty, so it showed black beside an empty text box and read as "black chosen"; it shows hatching instead (branding.js adds the class unset) */
.branding-form input[type="color"].unset { background: repeating-linear-gradient(135deg, var(--bg-alt) 0 6px, var(--border-strong) 6px 8px); }
.branding-form input[type="color"].unset::-webkit-color-swatch { opacity: 0; }
.branding-form input[type="color"].unset::-moz-color-swatch { opacity: 0; }
.branding-form .logo-sample { display: flex; align-items: center; gap: 12px; margin: 6px 0; min-height: 44px; }
.branding-form .logo-sample .brand-logo { max-height: 44px; max-width: 12rem; }
.branding-form .check-words { margin: 4px 0 0; min-height: 1.2em; }
.branding-form .suggest { display: inline-flex; align-items: center; gap: 8px; margin-top: 4px; }
.branding-form .swatch-dot { width: 16px; height: 16px; border-radius: 50%; border: 1px solid var(--border-strong); display: inline-block; }
.branding-form .theme-choice { display: flex; gap: 16px; }
.branding-form .buttons { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.brand-preview { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 14px; }
@media (max-width: 760px) { .brand-preview { grid-template-columns: 1fr; } }
.brand-preview h3 { margin: 0 0 6px; font-size: 0.95rem; color: var(--text-strong); }
.theme-scope.brand-sample { background: var(--bg); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.brand-sample .sample-brand { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--text-strong); }
.brand-sample .sample-brand .brand-logo { max-height: 32px; max-width: 9rem; }
.brand-sample .sample-button { align-self: flex-start; background: var(--primary); color: var(--on-primary); box-shadow: var(--glow-button); border-radius: 10px; padding: 8px 14px; font-weight: 600; }
.brand-sample .sample-link { color: var(--link); text-decoration: underline; text-underline-offset: 3px; align-self: flex-start; }
.brand-sample .sample-card { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; color: var(--text-muted); }

/* ---- the day line of Home (charts.js dayLine): the hover band of each day, the marker of the last day with a number, the axis words ---------------------------------------- */
svg.chart .band .hit { fill: transparent; }
svg.chart g.band:hover .hit, svg.chart g.band:focus .hit { fill: rgba(var(--primary-rgb), 0.08); }
svg.chart g.band:focus-visible .hit { stroke: var(--link); stroke-width: 2; }
svg.chart g.today circle.fill { fill: var(--mark, var(--primary)); filter: drop-shadow(0 0 6px color-mix(in srgb, var(--mark, var(--primary)) 80%, transparent)); }
svg.chart g.today circle.core { fill: var(--mark-ink-light); }
svg.chart .ytick { font-size: 12px; }

/* ---- Home, the Morning brief (static/js/pages/home.js): the page grid, the card heads and the pieces inside the cards. Names start with home-; the colours are the kit's. ----------------- */
.home { display: flex; flex-direction: column; gap: 18px; }
.home-head h1 { margin-bottom: 2px; }
.home-head p { margin: 2px 0 0; color: var(--text-muted); font-size: 0.85rem; }
.home-tiles { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 18px; }
.home-tiles .tile { padding: 14px 16px; }
.home-tiles .tile .tile-num { font-size: 1.75rem; }
.home-hero { display: grid; grid-template-columns: 1.9fr 1fr; gap: 18px; }
.home-mid { display: grid; grid-template-columns: 1.25fr 1fr; gap: 18px; }
.home-stack { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.home-card { padding: 18px 20px; min-width: 0; position: relative; }
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.card-head h2 { margin: 0; font-size: 1.05rem; font-weight: 700; color: var(--text-strong); }
.card-head .sub { margin-left: auto; font-size: 0.8rem; font-weight: 500; color: var(--text-muted); text-align: right; }
.home-hint { color: var(--text-muted); font-size: 0.8rem; margin: 10px 0 0; }
.home-tiles .home-wide { grid-column: 1 / -1; }
.home-card .message { margin: 8px 0; }
.home-card .vs { color: var(--text-muted); font-size: 0.78rem; }
.home-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.home-table th { text-align: left; color: var(--text-muted); font-weight: 600; font-size: 0.78rem; padding: 8px 8px; border-bottom: 1px solid var(--border); }
.home-table td { padding: 9px 8px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.home-table tbody tr:last-child td { border-bottom: 0; }
.home-table th.num, .home-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.home-table tbody tr:hover td { background: rgba(var(--primary-rgb), 0.06); }
.home-name { font-weight: 700; color: var(--text-strong); }
a.home-name { text-decoration: none; }
a.home-name:hover { text-decoration: underline; text-underline-offset: 3px; }
.home-sub { display: block; color: var(--text-muted); font-size: 0.78rem; font-weight: 500; }
.home-owes { color: var(--orange-text); font-weight: 700; font-variant-numeric: tabular-nums; }
.home-timeline { list-style: none; margin: 8px 0 0; padding: 0; }
.home-timeline li { position: relative; padding: 3px 0 12px 22px; font-size: 0.9rem; }
.home-timeline li::before { content: ""; position: absolute; left: 4px; top: 9px; width: 9px; height: 9px; border-radius: 50%; background: rgb(var(--c)); box-shadow: 0 0 10px rgba(var(--c), 0.9); }
.home-timeline li::after { content: ""; position: absolute; left: 8px; top: 20px; bottom: -4px; width: 1px; background: var(--border); }
.home-timeline li:last-child::after { display: none; }
.home-timeline small { display: block; color: var(--text-muted); font-size: 0.78rem; }
.home-timeline a { color: var(--text-strong); font-weight: 600; text-decoration: none; }
.home-timeline a:hover { text-decoration: underline; text-underline-offset: 3px; }
.home-orb { display: grid; place-items: center; padding: 6px 0 2px; }
.home-say { font-size: 0.95rem; line-height: 1.55; color: var(--text); }
.home-say p { margin: 6px 0; }
.home-ask { display: flex; align-items: center; gap: 8px; margin-top: 10px; padding: 6px 8px 6px 12px; border-radius: 11px; background: var(--bg); border: 1px solid var(--border-strong); }
.home-ask:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.35); }
.app .home-ask input[type="text"], .app .home-ask input[type="text"]:focus { flex: 1; min-width: 0; margin: 0; padding: 6px 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; font-size: 0.92rem; }
.app .home-ask button { margin: 0 0 0 auto; width: auto; flex: none; }
.home-answer { margin-top: 12px; font-size: 0.92rem; }
.home-answer p { margin: 6px 0; }
.home-answer dl { margin: 6px 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; }
.home-answer dt { color: var(--text-muted); }
.home-answer dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; color: var(--text-strong); font-weight: 700; }
.home-answer .chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.app .home-open { width: 24px; height: 24px; padding: 0; margin: 0 6px 0 0; vertical-align: middle; border-radius: 8px; color: var(--text-muted); }
.home-open svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.home-open[aria-expanded="true"] svg { transform: rotate(90deg); }
.home-expand-row[hidden] { display: none; }
.home-expand-row > td { padding: 0 8px 4px; }
.home-expand { margin: 2px 0 8px; padding: 10px 12px; border-radius: 10px; background: var(--card-raised); border: 1px solid var(--border); display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 16px; font-size: 0.85rem; }
.home-expand small { display: block; color: var(--text-muted); font-size: 0.74rem; }
.home-expand-value { overflow-wrap: anywhere; }                                        /* a long email address wraps inside its cell, never over the next one */
.home-expand .home-owes { font-size: inherit; }
@media (max-width: 1100px) {
  .home-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .home-hero, .home-mid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .home, .home-stack { gap: 12px; }
  .home-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .home-card { padding: 14px 14px; }
  .home-expand { grid-template-columns: minmax(0, 1fr); }
  .card-head { flex-wrap: wrap; }
  .card-head .sub { margin-left: 0; text-align: left; flex-basis: 100%; }
}

/* ---- the reserved strip for the AI usage bar (the Settings Round fills it) ------------------------------------------------------------- */
#ai-usage-slot { position: sticky; bottom: 0; z-index: 40; min-height: var(--footer-h); display: flex; align-items: center; padding: 0 16px; background: var(--card); border-top: 1px solid var(--border); color: var(--text-muted); font-size: 0.85rem; }

/* ---- reduced motion: everything that moves stops --------------------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .orb .ring1, .orb .ring2, .orb .core, .orb .halo, .skeleton::after { animation: none; }
  button, .app a.button-link { transition: none; }
  button:where(:hover:not(:disabled)), .app a.button-link:where(:hover) { transform: none; }
  .bar-fill, .sec-tools, .upload-fill { transition: none; }
}
/* Less motion or less transparency asked for: the frosted layers become solid (the glass card and the top bar). */
@media (prefers-reduced-motion: reduce), (prefers-reduced-transparency: reduce) {
  .glass { background: var(--card-raised); -webkit-backdrop-filter: none; backdrop-filter: none; }
  body.app .topbar { background: var(--bg); -webkit-backdrop-filter: none; backdrop-filter: none; }
}

/* ---- print: the paper is white, so every text colour is dark whichever theme is on screen (app.css keeps its own print rules exactly as they were) ------------------------ */
@media print {
  :root, :root[data-theme="dark"], :root[data-theme="light"] {
    --text: var(--print-ink) !important; --text-strong: var(--print-ink) !important; --text-muted: var(--print-ink-soft) !important; --link: var(--print-ink) !important;
    --green-text: var(--print-ink) !important; --red-text: var(--print-ink) !important; --orange-text: var(--print-ink) !important; --teal-text: var(--print-ink) !important; --pink-text: var(--print-ink) !important;
    --on-primary: var(--print-ink) !important;
  }
  svg.chart .chart-value { stroke: none; }       /* paper is white and the text above is dark: a halo in the card's colour (near black in the dark theme) would print as a dark outline round the numbers */
}
