/* Zelvai agent inbox. Brand tokens from CLAUDE.md; dark theme follows the OS.
   Layout (redesign, 2 Nov): a glass top bar with one segmented menu (the bottom tab bar on phones);
   three panes on wide screens (list · thread · details), the details as a side drawer on tablets and a
   bottom sheet on phones, where the list and the conversation are two screens of their own. */
:root {
  --ink: #0B2538; --ink-2: #33495A; --mute: #64798A; --paper: #EEF3F2; --bg: #F4F7F7; --card: #FFFFFF; --line: #DCE5E4; --line-2: #C9D6D5;
  --teal: #1F6F78; --teal-2: #2D8C96; --teal-soft: #E1F0F1; --teal-ink: #17565D; --sun: #FFB547; --sun-soft: #FFF2DE; --sun-ink: #6A4300;
  --ok: #1E8E5A; --ok-soft: #E2F4EA; --warn: #B4661A; --warn-soft: #FFF0DB; --bad: #C4373D; --bad-soft: #FCE8E8;
  --glass: rgba(255, 255, 255, .78);
  --shadow-1: 0 1px 2px rgba(11, 37, 56, .05), 0 1px 1px rgba(11, 37, 56, .03);
  --shadow-2: 0 2px 6px rgba(11, 37, 56, .06), 0 10px 28px rgba(11, 37, 56, .08);
  --shadow-3: 0 18px 50px rgba(11, 37, 56, .22);
  --font: "Bricolage Grotesque", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --wordmark: "Poppins", var(--font);
  --r: 14px; --r-lg: 20px;
  --gutter: max(16px, env(safe-area-inset-left, 0px));
  --gutter-r: max(16px, env(safe-area-inset-right, 0px));
  --tabbar: 0px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ink: #EEF3F2; --ink-2: #C3D1D6; --mute: #8DA1AC; --paper: #0C1923; --bg: #0C1923; --card: #13222E; --line: #233543; --line-2: #2F4454;
    --teal: #63C5CF; --teal-2: #84D6DD; --teal-soft: #173740; --teal-ink: #9FE1E7; --sun: #FFB547; --sun-soft: #3A2812; --sun-ink: #FFC57A;
    --ok: #5BD39A; --ok-soft: #133426; --warn: #F0A24A; --warn-soft: #3A2812; --bad: #F48C8C; --bad-soft: #3B1C1E;
    --glass: rgba(19, 34, 46, .78);
    --shadow-1: 0 1px 2px rgba(0, 0, 0, .3);
    --shadow-2: 0 2px 8px rgba(0, 0, 0, .3), 0 12px 30px rgba(0, 0, 0, .25);
    --shadow-3: 0 20px 60px rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}

/* ---------- base ---------- */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { height: 100%; -webkit-text-size-adjust: 100%; }
body { margin: 0; height: 100%; height: 100dvh; overflow: hidden; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 15px; line-height: 1.45; -webkit-font-smoothing: antialiased; display: flex; flex-direction: column; -webkit-tap-highlight-color: transparent; }
h1, h2, h3 { margin: 0; letter-spacing: -0.02em; line-height: 1.15; text-wrap: balance; }
h1 { font-size: 1.6rem; font-weight: 750; } h2 { font-size: 1.2rem; font-weight: 700; } h3 { font-size: 1rem; font-weight: 700; }
p { margin: 0; }
svg { flex: none; }
.muted { color: var(--mute); } .small { font-size: .82rem; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 1px solid var(--line-2); background: var(--card); color: var(--ink); border-radius: 999px; padding: .5rem 1rem; font-weight: 600; line-height: 1.2; transition: background-color .15s, border-color .15s, color .15s, box-shadow .15s, transform .1s; }
button:hover { border-color: var(--teal); }
button:active:not([disabled]) { transform: scale(.97); }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, a:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
button.primary { background: linear-gradient(180deg, var(--teal-2), var(--teal)); color: #fff; border-color: transparent; box-shadow: 0 1px 2px rgba(31, 111, 120, .3), 0 4px 14px rgba(31, 111, 120, .22); }
button.primary:hover { filter: brightness(1.06); }
@media (prefers-color-scheme: dark) { button.primary { color: #06222A; } }
button.ghost { background: transparent; border-color: transparent; }
button.ghost:hover { background: var(--teal-soft); color: var(--teal-ink); }
button.danger { color: var(--bad); }
button.ghost.danger:hover { background: var(--bad-soft); color: var(--bad); }
button[disabled] { opacity: .55; cursor: wait; }
input:not([type]), input[type="text"], input[type="email"], input[type="password"], input[type="search"], textarea, select { width: 100%; border: 1px solid var(--line-2); border-radius: 12px; background: var(--card); padding: .62rem .8rem; transition: border-color .15s, box-shadow .15s; }
input:focus, textarea:focus, select:focus { border-color: var(--teal); box-shadow: 0 0 0 4px color-mix(in srgb, var(--teal) 16%, transparent); outline: none; }
textarea { resize: vertical; line-height: 1.55; min-height: 10rem; }
label { display: block; margin: .7rem 0 .3rem; color: var(--ink-2); font-weight: 600; font-size: .88rem; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 1.1rem 1.2rem; box-shadow: var(--shadow-1); }
code { font-family: ui-monospace, "Cascadia Code", Menlo, monospace; font-size: .88em; }

/* ---------- top bar ---------- */
.top { position: relative; z-index: 40; display: flex; align-items: center; gap: .75rem; min-height: 60px; padding: .5rem var(--gutter-r) .5rem var(--gutter); padding-top: max(.5rem, env(safe-area-inset-top, 0px)); background: var(--glass); -webkit-backdrop-filter: saturate(1.6) blur(16px); backdrop-filter: saturate(1.6) blur(16px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: .45rem; text-decoration: none; color: var(--ink); font-family: var(--wordmark); font-weight: 700; font-size: 1.32rem; letter-spacing: -0.04em; }
.brand svg { width: 1.55em; height: 1.55em; }
.brand em { font-style: normal; color: var(--sun); }

/* the menu: a segmented control with a sliding highlight */
.tabs { position: relative; display: flex; gap: 2px; padding: 4px; margin: 0 auto; border-radius: 999px; background: color-mix(in srgb, var(--ink) 6%, transparent); border: 1px solid var(--line); isolation: isolate; }
.tabs-ink { position: absolute; z-index: -1; top: 4px; bottom: 4px; left: 0; width: 0; border-radius: 999px; background: var(--card); box-shadow: var(--shadow-2); transition: transform .35s var(--ease), width .35s var(--ease); }
.nav { display: inline-flex; align-items: center; gap: .45rem; border: 0; background: transparent; color: var(--mute); padding: .5rem 1rem; font-weight: 650; border-radius: 999px; }
.nav svg { width: 1.15rem; height: 1.15rem; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.nav:hover { color: var(--ink); background: transparent; }
.nav[aria-pressed="true"] { color: var(--ink); }
.nav-count { min-width: 1.25rem; height: 1.25rem; padding: 0 .35rem; border-radius: 999px; background: #E5484D; color: #fff; font-size: .7rem; font-weight: 700; line-height: 1.25rem; text-align: center; }

.who { display: flex; align-items: center; gap: .4rem; position: relative; }
.menuwrap { position: relative; }
.iconbtn { position: relative; display: inline-grid; place-items: center; width: 2.5rem; height: 2.5rem; padding: 0; border-radius: 50%; background: transparent; border-color: transparent; color: var(--ink-2); }
.iconbtn svg { width: 1.3rem; height: 1.3rem; }
.iconbtn svg path, .iconbtn svg rect, .iconbtn svg circle { vector-effect: non-scaling-stroke; }
.iconbtn:not(#bell) svg { fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.iconbtn:hover, .iconbtn[aria-expanded="true"] { background: var(--teal-soft); color: var(--teal-ink); }
.iconbtn .count { position: absolute; top: .15rem; right: .1rem; min-width: 1.15rem; height: 1.15rem; padding: 0 .3rem; border-radius: 999px; background: #E5484D; color: #fff; font-size: .68rem; font-weight: 700; line-height: 1.15rem; text-align: center; box-shadow: 0 0 0 2px var(--card); }
.avatar-btn { padding: 0; border: 2px solid transparent; border-radius: 50%; background: transparent; }
.avatar-btn:hover, .avatar-btn[aria-expanded="true"] { border-color: var(--teal); }
.avatar { display: inline-grid; place-items: center; width: 2.15rem; height: 2.15rem; border-radius: 50%; background: linear-gradient(135deg, var(--teal-2), var(--teal)); color: #fff; font-weight: 700; font-size: .85rem; letter-spacing: .02em; overflow: hidden; background-size: cover; background-position: center; }
.avatar.big { width: 3rem; height: 3rem; font-size: 1.1rem; flex: none; }
.avatar.huge { width: 5.5rem; height: 5.5rem; font-size: 1.9rem; }

/* drop-down panels (bell, account) */
.menu-panel { position: absolute; right: 0; top: calc(100% + .5rem); z-index: 60; width: min(340px, calc(100vw - 24px)); box-shadow: var(--shadow-3); display: grid; gap: .15rem; padding: .5rem; border-radius: 18px; transform-origin: top right; }
@media (prefers-reduced-motion: no-preference) { .menu-panel:not([hidden]) { animation: pop .18s var(--ease); } @keyframes pop { from { opacity: 0; transform: translateY(-4px) scale(.97); } } }
.menu-panel hr { border: 0; border-top: 1px solid var(--line); margin: .3rem 0; }
.acct-head { display: flex; gap: .75rem; align-items: center; padding: .5rem .5rem .7rem; border-bottom: 1px solid var(--line); margin-bottom: .3rem; }
.acct-head .tenant { font-weight: 700; color: var(--ink-2); margin-top: .1rem; }
.menuitem { display: flex; align-items: center; gap: .55rem; width: 100%; text-align: left; background: transparent; border-color: transparent; padding: .6rem .65rem; font-weight: 550; border-radius: 12px; }
.menuitem:hover:not([disabled]) { background: var(--teal-soft); }
.menuitem[disabled] { opacity: 1; color: var(--mute); cursor: default; }
.menuitem.danger { color: var(--bad); } .menuitem.danger:hover { background: var(--bad-soft); }
.waitlist { display: grid; gap: .15rem; max-height: min(60vh, 440px); overflow: auto; }
.waitlist h3 { margin: .3rem .55rem .4rem; font-size: .9rem; }
.waititem { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .15rem .5rem; text-align: left; width: 100%; padding: .6rem .65rem; background: transparent; border-color: transparent; font-weight: 500; border-radius: 12px; }
.waititem:hover { background: var(--teal-soft); }
.waititem .name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.waititem .subj { grid-column: 1 / -1; color: var(--ink-2); font-size: .85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.waititem .when { color: var(--mute); font-size: .75rem; }

/* language: a drop-down with each language in its own name, no flags (same as the marketing site's picker) */
.langpick { position: relative; }
.langpick summary { list-style: none; display: inline-flex; align-items: center; gap: .45rem; padding: .48rem .75rem; border-radius: 999px; border: 1px solid var(--line-2); background: var(--card); cursor: pointer; font-weight: 600; font-size: .9rem; color: var(--ink-2); user-select: none; }
.langpick summary::-webkit-details-marker { display: none; }
.langpick summary:hover, .langpick[open] summary { border-color: var(--teal); color: var(--ink); }
.langpick .ico { display: inline-flex; }
.langpick svg { width: 1.05rem; height: 1.05rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.langpick .chev { width: .8rem; height: .8rem; transition: transform .2s var(--ease); }
.langpick[open] .chev { transform: rotate(180deg); }
.langpick .lbl { display: none; }
.langpick ul { position: absolute; left: 0; top: calc(100% + .4rem); z-index: 70; min-width: 13rem; margin: 0; padding: .4rem; list-style: none; display: grid; gap: 2px; background: var(--card); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-3); }
@media (prefers-reduced-motion: no-preference) { .langpick[open] ul { animation: pop .18s var(--ease); } }
.langpick li button { display: flex; align-items: center; justify-content: space-between; gap: 1rem; width: 100%; padding: .55rem .75rem; border-radius: 12px; border-color: transparent; background: transparent; font-weight: 550; text-align: left; }
.langpick li button:hover { background: var(--teal-soft); }
.langpick li small { color: var(--mute); font-size: .72rem; font-weight: 700; letter-spacing: .06em; }
.langpick li button[aria-current="true"] { background: var(--teal-soft); color: var(--teal-ink); font-weight: 700; }
.langpick li button[aria-current="true"] small::before { content: "✓ "; }
/* in the account menu it is a menu row that opens in place */
.acct-menu .langpick summary { display: flex; width: 100%; border: 0; border-radius: 12px; background: transparent; padding: .6rem .65rem; font-size: inherit; font-weight: 550; color: var(--ink); }
.acct-menu .langpick summary:hover { background: var(--teal-soft); }
.acct-menu .langpick .lbl { display: inline; flex: 1; }
.acct-menu .langpick .name { color: var(--mute); font-weight: 500; }
.acct-menu .langpick ul { position: static; box-shadow: none; border: 0; padding: .1rem 0 .2rem 1.6rem; min-width: 0; animation: none; }
.lang-row { display: flex; align-items: center; gap: .75rem; margin-top: .9rem; }
.lang-row-label { font-weight: 600; }
.lang-row + .muted { margin-top: .35rem; }
.login-lang { display: flex; justify-content: center; margin-top: .6rem; }
.login-lang .langpick ul { left: 50%; margin-left: -6.5rem; }

/* ---------- sign in ---------- */
.login { flex: 1; display: grid; place-items: center; padding: 2rem var(--gutter-r) 2rem var(--gutter); background: radial-gradient(1200px 500px at 50% -10%, var(--teal-soft), transparent 70%); overflow: auto; }
.login-card { width: min(420px, 100%); display: flex; flex-direction: column; gap: .5rem; padding: 1.8rem; box-shadow: var(--shadow-2); }
.login-card h1 { font-size: 1.7rem; }
.login-card .primary { margin-top: .8rem; padding-block: .75rem; }

/* ---------- inbox: three panes ---------- */
.app { flex: 1; min-height: 0; display: grid; grid-template-columns: 360px minmax(0, 1fr) 340px; }
.list { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--line); background: var(--card); }
.list { min-width: 0; overflow: hidden; }
.list-head { display: grid; grid-template-columns: minmax(0, 1fr); gap: .7rem; padding: 1rem 1rem .75rem; border-bottom: 1px solid var(--line); }
.list-title { display: flex; align-items: baseline; justify-content: space-between; gap: .5rem; }
.list-title h1 { font-size: 1.45rem; }

.search { position: relative; display: flex; align-items: center; }
.search svg { position: absolute; left: .8rem; width: 1.05rem; height: 1.05rem; fill: none; stroke: var(--mute); stroke-width: 2; stroke-linecap: round; pointer-events: none; }
.search input { padding-left: 2.4rem; padding-right: 2.3rem; border-radius: 999px; background: var(--bg); border-color: transparent; }
.search input:focus { background: var(--card); }
.search input::-webkit-search-cancel-button { display: none; }
.search .clear { position: absolute; right: .35rem; width: 1.8rem; height: 1.8rem; padding: 0; border: 0; border-radius: 50%; background: var(--line); color: var(--ink-2); font-size: 1.1rem; line-height: 1; }

/* status pills: one line that scrolls sideways, edges fade */
.filters-row { position: relative; margin-inline: -1rem; }
.filters-row::before, .filters-row::after { content: ""; position: absolute; top: 0; bottom: 0; width: 1rem; z-index: 1; pointer-events: none; }
.filters-row::before { left: 0; background: linear-gradient(90deg, var(--card), transparent); }
.filters-row::after { right: 0; background: linear-gradient(270deg, var(--card), transparent); }
.pills { display: flex; gap: .4rem; overflow-x: auto; padding: .1rem 1rem; scroll-padding-inline: 1rem; scroll-snap-type: x proximity; scrollbar-width: none; overscroll-behavior-x: contain; }
.pills::-webkit-scrollbar { display: none; }
.pills button { --tone: var(--mute); display: inline-flex; align-items: center; gap: .4rem; flex: none; scroll-snap-align: start; padding: .42rem .8rem; font-size: .84rem; font-weight: 600; white-space: nowrap; border-color: var(--line); background: var(--card); color: var(--ink-2); }
.pills button::before { content: ""; width: .5rem; height: .5rem; border-radius: 50%; background: var(--tone); display: none; }
.pills button[class*="tone-"]::before { display: inline-block; }
.pills .tone-teal { --tone: var(--teal); } .pills .tone-bad { --tone: var(--bad); } .pills .tone-sun { --tone: var(--sun); } .pills .tone-ok { --tone: var(--ok); }
.pills button b { font-size: .74rem; font-weight: 700; color: var(--mute); font-variant-numeric: tabular-nums; }
.pills button b:empty { display: none; }
.pills button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); box-shadow: var(--shadow-2); }
.pills button[aria-pressed="true"] b { color: inherit; opacity: .75; }
.pills button[aria-pressed="true"]::before { box-shadow: 0 0 0 2px var(--ink); }
.pills button.zero:not([aria-pressed="true"]) { opacity: .55; }

.source-filter { position: relative; display: inline-flex; align-items: center; margin: 0; justify-self: start; }
.source-filter svg { position: absolute; left: .7rem; width: 1rem; height: 1rem; fill: none; stroke: var(--ink-2); stroke-width: 2; stroke-linecap: round; pointer-events: none; }
.source-filter select { width: auto; appearance: none; -webkit-appearance: none; padding: .38rem 2rem .38rem 2.1rem; border-radius: 999px; font-size: .84rem; font-weight: 600; color: var(--ink-2); border-color: var(--line); cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 15px) 52%, calc(100% - 10px) 52%; background-size: 5px 5px; background-repeat: no-repeat; }
.source-filter select.active { background-color: var(--teal-soft); border-color: var(--teal); color: var(--teal-ink); }

.conv-list { list-style: none; margin: 0; padding: .5rem; overflow: auto; display: flex; flex-direction: column; gap: 2px; flex: 1; min-height: 0; overscroll-behavior: contain; }
.conv { position: relative; width: 100%; text-align: left; border: 0; border-radius: 16px; padding: .75rem .8rem .75rem .75rem; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; column-gap: .75rem; row-gap: .12rem; font-weight: 500; background: transparent; }
.conv:hover { background: color-mix(in srgb, var(--teal) 6%, transparent); border-color: transparent; }
.conv.sel { background: var(--teal-soft); }
/* on the selected card's tint a teal chip ("Draft ready") would vanish: chips get their own white ground there */
.conv.sel .chip { background: var(--card); box-shadow: inset 0 0 0 1px color-mix(in srgb, currentColor 30%, transparent); }
.conv .face { grid-row: 1 / span 3; align-self: start; width: 2.5rem; height: 2.5rem; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: .9rem; color: #fff; background: hsl(var(--hue, 186) 42% 44%); }
.conv .name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv .subj { grid-column: 2 / -1; color: var(--ink-2); font-size: .88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv .when { color: var(--mute); font-size: .76rem; font-variant-numeric: tabular-nums; align-self: center; }
.conv .meta { grid-column: 2 / -1; display: flex; align-items: center; gap: .4rem; min-width: 0; font-size: .76rem; color: var(--mute); margin-top: .2rem; }
.conv .meta .ref { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv .channel { font-size: .74rem; color: var(--mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* waiting for the agent: a dot in the status colour next to the time */
.conv.waiting .when::before { content: ""; display: inline-block; width: .5rem; height: .5rem; margin-right: .35rem; border-radius: 50%; background: var(--teal); vertical-align: .05em; }
.conv.waiting.needs_agent .when::before, .conv.waiting.failed .when::before { background: var(--bad); }
.conv.waiting.booking .when::before { background: var(--sun); }
.conv.waiting .name { color: var(--ink); }
.empty { display: grid; justify-items: center; gap: .6rem; padding: 2.5rem 1rem; text-align: center; color: var(--mute); }
.empty svg { width: 2.6rem; height: 2.6rem; fill: none; stroke: var(--line-2); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

/* status chips */
.chip { display: inline-flex; align-items: center; gap: .3rem; padding: .12rem .55rem; border-radius: 999px; font-size: .72rem; font-weight: 700; letter-spacing: .01em; background: var(--teal-soft); color: var(--teal-ink); vertical-align: middle; white-space: nowrap; }
.chip.new, .chip.extracting, .chip.booking { background: var(--sun-soft); color: var(--sun-ink); }
.chip.drafted { background: var(--teal-soft); color: var(--teal-ink); }
.chip.needs_agent, .chip.failed { background: var(--bad-soft); color: var(--bad); }
.chip.sent, .chip.closed, .chip.booked { background: var(--ok-soft); color: var(--ok); }
.chip.taken_over { background: transparent; color: var(--mute); box-shadow: inset 0 0 0 1px var(--line-2); }
.chip.conf-hi { background: var(--ok-soft); color: var(--ok); } .chip.conf-mid { background: var(--warn-soft); color: var(--warn); } .chip.conf-lo { background: var(--bad-soft); color: var(--bad); }

/* ---------- thread ---------- */
.thread { min-width: 0; min-height: 0; overflow: auto; display: flex; flex-direction: column; overscroll-behavior: contain; scroll-padding-top: 5rem; }
.placeholder { margin: auto; padding: 3rem 1.5rem; text-align: center; max-width: 44ch; display: grid; gap: .6rem; justify-items: center; }
.placeholder::before { content: ""; width: 4.5rem; height: 4.5rem; border-radius: 22px; background: var(--teal-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231F6F78' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6.5A2.5 2.5 0 0 1 6.5 4h11A2.5 2.5 0 0 1 20 6.5v7a2.5 2.5 0 0 1-2.5 2.5H11l-4 3.5V16h-.5A2.5 2.5 0 0 1 4 13.5z'/%3E%3C/svg%3E") center / 2.2rem no-repeat; margin-bottom: .4rem; }
#thread-body { display: flex; flex-direction: column; gap: 1rem; padding: 0 1.5rem 1.5rem; max-width: 980px; width: 100%; margin: 0 auto; }
.thread-head { position: sticky; top: 0; z-index: 5; display: flex; gap: .6rem; align-items: center; margin: 0 -1.5rem; padding: .9rem 1.5rem; background: var(--glass); -webkit-backdrop-filter: saturate(1.6) blur(14px); backdrop-filter: saturate(1.6) blur(14px); border-bottom: 1px solid var(--line); }
.thread-title { flex: 1; min-width: 0; display: grid; gap: .25rem; }
.thread-title h2 { font-size: 1.15rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#t-meta { font-size: .82rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thread-actions { display: flex; gap: .2rem; align-items: center; flex: none; }
.thread-actions button.ghost { padding: .45rem .8rem; font-size: .88rem; }
.back { display: none; margin-left: -.5rem; }
#btn-details { display: none; }

.messages { list-style: none; margin: 0; padding: .5rem 0 0; display: flex; flex-direction: column; gap: .9rem; }
.msg-item { position: relative; border: 1px solid var(--line); border-radius: 20px 20px 20px 6px; background: var(--card); padding: .85rem 1.05rem; max-width: min(72ch, 88%); box-shadow: var(--shadow-1); }
.msg-item.out { border-color: transparent; background: var(--teal-soft); margin-left: auto; border-radius: 20px 20px 6px 20px; }
.msg-item .from { display: flex; justify-content: space-between; gap: .8rem; font-size: .76rem; color: var(--mute); margin-bottom: .4rem; }
.msg-item .from span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.msg-item .from span:last-child { flex: none; font-variant-numeric: tabular-nums; }
.msg-item .body { white-space: pre-wrap; overflow-wrap: anywhere; }
.messages .event { align-self: center; display: flex; align-items: center; gap: .55rem; max-width: 100%; padding: .4rem .9rem .4rem .45rem; border-radius: 999px; background: var(--ok-soft); color: var(--ok); font-size: .84rem; font-weight: 600; }
.messages .event.declined { background: var(--bad-soft); color: var(--bad); }
.messages .event.tentative { background: var(--sun-soft); color: var(--sun-ink); }
.event-icon { display: grid; place-items: center; width: 1.4rem; height: 1.4rem; flex: none; border-radius: 50%; background: var(--ok); color: var(--card); font-size: .78rem; }
.event.declined .event-icon { background: var(--bad); } .event.tentative .event-icon { background: var(--sun); color: var(--ink); }
.event-text { min-width: 0; }
.event-when { flex: none; font-weight: 500; opacity: .75; font-variant-numeric: tabular-nums; }

/* the draft: a composer pinned under the conversation */
.draft { border-color: color-mix(in srgb, var(--teal) 35%, var(--line)); box-shadow: var(--shadow-2); }
.draft-head { display: flex; justify-content: space-between; gap: .6rem; align-items: center; flex-wrap: wrap; }
.draft-head h3 { display: flex; align-items: center; gap: .5rem; }
.draft-head h3::before { content: ""; width: .6rem; height: .6rem; border-radius: 50%; background: var(--teal); box-shadow: 0 0 0 4px var(--teal-soft); }
#draft-text { background: var(--bg); border-color: transparent; }
#draft-text:focus { background: var(--card); border-color: var(--teal); }
.draft-actions { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .9rem; align-items: center; }
.draft-actions .danger { margin-left: auto; }
.needs { margin-top: .7rem; padding: .7rem .9rem; border-radius: 12px; background: var(--sun-soft); color: var(--sun-ink); font-size: .88rem; }
#no-draft h3 { margin-bottom: .3rem; }
#suggest { margin-top: .8rem; padding: .9rem 1rem; border-radius: 16px; background: var(--sun-soft); }
#suggest strong { font-size: 1.05rem; }
.msg { min-height: 1.2em; font-size: .86rem; margin-top: .55rem; color: var(--mute); }
.msg:empty { min-height: 0; margin: 0; }
.msg.err { color: var(--bad); } .msg.ok { color: var(--ok); }

/* ---------- details: right pane / drawer / sheet ---------- */
.rail { display: flex; flex-direction: column; gap: .9rem; min-height: 0; overflow: auto; padding: 1rem; border-left: 1px solid var(--line); background: var(--bg); overscroll-behavior: contain; }
.rail .card { padding: 1rem 1.05rem; }
.rail h3 { font-size: .8rem; text-transform: uppercase; letter-spacing: .07em; color: var(--mute); font-weight: 700; }
.rail-head { display: none; }
.scrim { display: none; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: .45rem .8rem; margin: .7rem 0 0; font-size: .9rem; }
.facts dt { color: var(--mute); } .facts dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.questions { margin: .8rem 0 0; padding: .7rem .9rem .7rem 1.8rem; font-size: .88rem; color: var(--ink-2); background: var(--bg); border-radius: 12px; }
.questions:empty { display: none; }
.slots { list-style: none; margin: .7rem 0 0; padding: 0; display: flex; flex-direction: column; gap: .4rem; }
.slots:empty { display: none; }
.slots label { display: flex; align-items: center; gap: .6rem; margin: 0; padding: .6rem .75rem; border: 1px solid var(--line); border-radius: 12px; font-weight: 550; cursor: pointer; transition: border-color .15s, background-color .15s; }
.slots label:hover { border-color: var(--teal); }
.slots label:has(input:checked) { border-color: var(--teal); background: var(--teal-soft); }
.slots input { accent-color: var(--teal); width: 1.05rem; height: 1.05rem; margin: 0; }
.bookings { list-style: none; margin: .8rem 0 0; padding: 0; display: flex; flex-direction: column; gap: .4rem; font-size: .88rem; }
.bookings:empty { display: none; }
.bookings li { padding: .65rem .8rem; border-radius: 12px; background: var(--ok-soft); color: var(--ok); font-weight: 600; }
#book-box { margin-top: .7rem; }
#book-box .primary { margin-top: .6rem; width: 100%; }

/* ---------- toast ---------- */
.toast { position: fixed; z-index: 90; left: 50%; bottom: calc(1.2rem + var(--tabbar) + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--ink); color: var(--paper); padding: .7rem 1.15rem; border-radius: 999px; font-weight: 600; box-shadow: var(--shadow-3); max-width: calc(100% - 32px); text-align: center; }
@media (prefers-reduced-motion: no-preference) { .toast { animation: rise .3s var(--ease); } @keyframes rise { from { transform: translate(-50%, 12px); opacity: 0; } } }

/* ---------- report ---------- */
.report, .settings, .calendar { flex: 1; min-height: 0; overflow: auto; display: flex; flex-direction: column; gap: 1rem; padding: 1.5rem var(--gutter-r) 2rem var(--gutter); width: 100%; }
.report > *, .settings > *, .calendar > * { width: 100%; max-width: 1180px; margin-inline: auto; }
.settings > * { max-width: 1000px; }
.report-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; }
/* a segmented control (the report period) */
.filters:not(.pills) { display: inline-flex; gap: 2px; padding: 4px; border-radius: 999px; background: color-mix(in srgb, var(--ink) 6%, transparent); border: 1px solid var(--line); }
.filters:not(.pills) button { border: 0; background: transparent; padding: .4rem .9rem; font-size: .85rem; color: var(--mute); }
.filters:not(.pills) button[aria-pressed="true"] { background: var(--card); color: var(--ink); box-shadow: var(--shadow-2); }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: .9rem; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 1.1rem 1.2rem; display: grid; gap: .25rem; box-shadow: var(--shadow-1); }
.tile .k { font-size: .75rem; letter-spacing: .07em; text-transform: uppercase; color: var(--mute); font-weight: 700; }
.tile .v { font-size: 2.1rem; font-weight: 800; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.tile .s { font-size: .84rem; color: var(--ink-2); }
.tile.accent { background: linear-gradient(145deg, #12384F, var(--ink) 60%); color: #EEF3F2; border-color: transparent; box-shadow: var(--shadow-2); }
.tile.accent .k { color: var(--sun); } .tile.accent .s { color: #EEF3F2; opacity: .85; }
@media (prefers-color-scheme: dark) { .tile.accent { background: linear-gradient(145deg, #1D4A5A, #12303D); } }
.report-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: .9rem; }
table.mini { width: 100%; border-collapse: collapse; margin-top: .6rem; font-size: .9rem; }
table.mini td { padding: .45rem 0; border-bottom: 1px solid var(--line); }
table.mini td:last-child { text-align: right; font-variant-numeric: tabular-nums; font-weight: 650; }
table.mini tr:last-child td { border-bottom: 0; }
.bar { display: inline-block; height: .5rem; background: linear-gradient(90deg, var(--teal), var(--teal-2)); border-radius: 999px; vertical-align: middle; margin-right: .5rem; max-width: 120px; }
a.btn, .btnlink { display: inline-flex; align-items: center; text-decoration: none; border: 1px solid var(--line-2); background: var(--card); color: var(--ink); border-radius: 999px; padding: .5rem 1rem; font-weight: 600; }
a.btn:hover, .btnlink:hover { border-color: var(--teal); }

/* ---------- settings ---------- */
.settings h1 { margin: 0; }
.settings-grid { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 1.2rem; align-items: start; }
.settings-nav { display: grid; gap: .2rem; position: sticky; top: 0; }
.settings-nav button { text-align: left; border-color: transparent; background: transparent; color: var(--ink-2); padding: .6rem .9rem; border-radius: 12px; }
.settings-nav button:hover { background: var(--teal-soft); color: var(--ink); }
.settings-nav button[aria-pressed="true"] { background: var(--card); color: var(--ink); box-shadow: var(--shadow-2); }
.settings-body { display: grid; gap: 1rem; }
.settings-body h2 { margin: 0 0 .7rem; font-size: 1.2rem; }
.settings-body h3 { margin: 1.2rem 0 .5rem; font-size: .95rem; }
.row { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.profile-row { display: flex; gap: 1.4rem; align-items: flex-start; flex-wrap: wrap; }
.profile-row .grow { flex: 1; min-width: 220px; display: grid; gap: .6rem; }
.name-form label { margin-top: 0; }
.name-form .row { flex-wrap: nowrap; } .name-form input { flex: 1; min-width: 0; }
.avatar-edit { position: relative; padding: 0; border: 0; background: transparent; border-radius: 50%; flex: none; cursor: pointer; }
.avatar-edit .cam { position: absolute; right: -.1rem; bottom: -.1rem; display: grid; place-items: center; width: 1.4rem; height: 1.4rem; border-radius: 50%; background: var(--card); color: var(--teal); border: 1px solid var(--line); box-shadow: var(--shadow-2); }
.avatar-edit.large .cam { width: 2rem; height: 2rem; }
.avatar-edit .cam svg { width: 62%; height: 62%; }
.avatar-edit:hover .avatar, .avatar-edit:focus-visible .avatar { filter: brightness(.9); }
.devices { list-style: none; margin: 0; padding: 0; display: grid; gap: .45rem; }
.devices li { display: flex; align-items: center; gap: .6rem; justify-content: space-between; border: 1px solid var(--line); border-radius: var(--r); padding: .6rem .8rem; }
.devices .this { font-size: .72rem; font-weight: 700; color: var(--ok); background: var(--ok-soft); border-radius: 999px; padding: .05rem .5rem; margin-left: .4rem; }
.address { padding: .45rem .7rem; border-radius: 10px; background: var(--bg); border: 1px solid var(--line); word-break: break-all; }

/* calendar connections */
.calstatus { display: inline-flex; align-items: center; gap: .35rem; font-size: .8rem; font-weight: 500; color: var(--mute); background: transparent; border-color: transparent; padding: .3rem .6rem; }
.calstatus::before { content: ""; width: .55em; height: .55em; border-radius: 50%; background: var(--sun); }
.calstatus.on::before { background: var(--ok); }
.calmenu-panel { display: grid; gap: .65rem; }
.calmenu-panel.inline { position: static; width: auto; box-shadow: none; padding: 0; border: 0; background: transparent; }
.calmenu-panel h3, .calmenu-panel h4 { margin: 0; } .calmenu-panel h4 { font-size: .78rem; color: var(--mute); text-transform: uppercase; letter-spacing: .06em; margin-top: .4rem; }
.provlist { list-style: none; margin: 0; padding: 0; display: grid; gap: .45rem; }
.provrow { display: flex; align-items: center; gap: .75rem; padding: .7rem .85rem; border: 1px solid var(--line); border-radius: 14px; color: var(--ink); text-decoration: none; background: var(--card); }
.provrow.current { background: var(--teal-soft); border-color: var(--teal); }
a.provrow:hover, button.provrow:hover { border-color: var(--teal); }
.provrow strong { flex: 1; min-width: 0; } .provrow .muted { overflow-wrap: anywhere; }
.provrow .go { color: var(--teal); font-weight: 700; }
.provlogo { width: 28px; height: 28px; flex: none; object-fit: contain; }
button.provrow { width: 100%; font-weight: 400; text-align: left; }
button.provrow[aria-expanded="true"] { border-color: var(--teal); background: var(--teal-soft); }
.pwform { display: grid; gap: .1rem; padding: .3rem .2rem .2rem; }
.pwform label { margin: .4rem 0 .2rem; font-size: .85rem; }
.pwform .row { margin-top: .5rem; }
.pwform p { margin: .35rem 0 0; }

/* ---------- tablets: details slide in from the right ---------- */
@media (max-width: 1180px) {
  .app { grid-template-columns: 340px minmax(0, 1fr); }
  #btn-details { display: inline-grid; }
  .rail { position: fixed; z-index: 70; top: 0; right: 0; bottom: 0; width: min(400px, 92vw); border-left: 0; box-shadow: var(--shadow-3); padding: 0 1rem calc(1rem + env(safe-area-inset-bottom, 0px)); transform: translateX(105%); visibility: hidden; transition: transform .35s var(--ease), visibility 0s linear .35s; }
  body.details-open .rail { transform: none; visibility: visible; transition: transform .35s var(--ease), visibility 0s; }
  .rail-head { display: flex; align-items: center; gap: .5rem; position: sticky; top: 0; z-index: 2; margin: 0 -1rem; padding: max(.8rem, env(safe-area-inset-top, 0px)) 1rem .6rem; background: var(--bg); }
  .rail-head h2 { flex: 1; font-size: 1.1rem; }
  .scrim { display: block; position: fixed; inset: 0; z-index: 65; background: rgba(6, 20, 30, .42); opacity: 0; pointer-events: none; transition: opacity .3s var(--ease); }
  body.details-open .scrim { opacity: 1; pointer-events: auto; }
}

/* ---------- phones: list and conversation are two screens; the menu is a bottom tab bar ---------- */
@media (max-width: 760px) {
  :root { --tabbar: 64px; }
  body { font-size: 16px; }
  /* solid, not frosted: a backdrop-filter would make the header the containing block of the fixed tab bar */
  .top { min-height: 56px; padding-block: .35rem; padding-top: max(.35rem, env(safe-area-inset-top, 0px)); -webkit-backdrop-filter: none; backdrop-filter: none; background: var(--card); }
  .tabs { position: fixed; z-index: 50; left: 0; right: 0; bottom: 0; margin: 0; padding: .35rem .5rem calc(.35rem + env(safe-area-inset-bottom, 0px)); border-radius: 0; border: 0; border-top: 1px solid var(--line); background: var(--glass); -webkit-backdrop-filter: saturate(1.6) blur(18px); backdrop-filter: saturate(1.6) blur(18px); justify-content: space-around; }
  .tabs-ink { display: none; }
  .nav { position: relative; flex: 1; flex-direction: column; gap: .2rem; padding: .35rem .2rem; font-size: .72rem; font-weight: 650; border-radius: 14px; }
  .nav svg { width: 1.45rem; height: 1.45rem; transition: transform .2s var(--ease); }
  .nav[aria-pressed="true"] { color: var(--teal); }
  .nav[aria-pressed="true"] svg { transform: translateY(-1px); stroke-width: 2.2; }
  .nav[aria-pressed="true"]::before { content: ""; position: absolute; top: .1rem; width: 2.6rem; height: 1.9rem; border-radius: 999px; background: var(--teal-soft); z-index: -1; }
  .nav-count { position: absolute; top: 0; left: calc(50% + .45rem); }
  .who { margin-left: auto; }
  .app, .report, .settings, .calendar { padding-bottom: calc(var(--tabbar) + env(safe-area-inset-bottom, 0px)); }
  .report, .settings, .calendar { padding-bottom: calc(var(--tabbar) + 1.5rem + env(safe-area-inset-bottom, 0px)); padding-top: 1.1rem; }

  .app { grid-template-columns: 1fr; }
  .list { border-right: 0; }
  .list-head { padding: .9rem 1rem .7rem; }
  .list-title h1 { font-size: 1.7rem; }
  .conv { padding: .8rem .75rem; }
  .thread { display: none; }
  body.thread-open .list { display: none; }
  body.thread-open .thread { display: flex; }
  body.thread-open .top { display: none; }
  body.thread-open .tabs { display: none; }
  body.thread-open .app { padding-bottom: 0; }
  body.thread-open .toast { bottom: calc(1rem + env(safe-area-inset-bottom, 0px)); }

  #thread-body { padding: 0 1rem calc(1.2rem + env(safe-area-inset-bottom, 0px)); gap: .8rem; }
  .thread-head { margin: 0 -1rem; padding: max(.6rem, env(safe-area-inset-top, 0px)) .75rem .6rem; gap: .35rem; }
  .thread-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "back title details" ". actions actions"; row-gap: .15rem; }
  .back { display: inline-grid; margin-left: 0; grid-area: back; }
  .thread-title { grid-area: title; }
  #btn-details { grid-area: details; }
  .thread-title h2 { font-size: 1.05rem; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .thread-actions { grid-area: actions; margin-left: -.6rem; }
  .thread-actions button.ghost { padding: .3rem .6rem; font-size: .8rem; color: var(--ink-2); }
  .msg-item { max-width: 94%; padding: .75rem .9rem; }
  .card { padding: 1rem; border-radius: 18px; }
  .draft-actions { gap: .45rem; }
  .draft-actions button { flex: 1 1 auto; padding-block: .7rem; }
  .draft-actions .primary { flex-basis: 100%; order: -1; }
  .draft-actions .danger { margin-left: 0; }
  #suggest .draft-actions .primary { flex-basis: 100%; }

  /* the details become a bottom sheet */
  .rail { top: auto; left: 0; right: 0; width: auto; max-height: 86dvh; border-radius: 24px 24px 0 0; transform: translateY(105%); padding-inline: 1rem; }
  .rail-head { flex-wrap: wrap; padding-top: .5rem; border-radius: 24px 24px 0 0; }
  .grabber { flex-basis: 100%; height: 5px; display: flex; justify-content: center; margin-bottom: .35rem; }
  .grabber::before { content: ""; width: 2.6rem; height: 5px; border-radius: 999px; background: var(--line-2); }

  .settings-grid { grid-template-columns: 1fr; }
  .settings-nav { display: flex; overflow-x: auto; position: static; scrollbar-width: none; gap: .3rem; }
  .settings-nav::-webkit-scrollbar { display: none; }
  .settings-nav button { white-space: nowrap; flex: none; }
  .report-head { align-items: stretch; }
  .tiles { grid-template-columns: 1fr 1fr; gap: .6rem; }
  .tile { padding: .9rem; } .tile .v { font-size: 1.6rem; }
  .tile.accent { grid-column: 1 / -1; }
}
@media (max-width: 380px) { .brand span { display: none; } .tiles { grid-template-columns: 1fr; } }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }

/* ---------- calendar (2 Nov): the week's appointments, coloured by the buyer's answer ---------- */
.cal-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; }
.cal-nav { display: flex; align-items: center; gap: .3rem; }
.cal-nav .iconbtn svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.cal-legend { display: flex; flex-wrap: wrap; gap: .4rem 1rem; margin-top: -.3rem; }
.cal-legend .lg { display: inline-flex; align-items: center; gap: .4rem; }
.cal-legend .lg::before { content: ""; width: .7rem; height: .7rem; border-radius: 4px; background: var(--ev-bg); box-shadow: inset 3px 0 0 var(--ev-c); }
.ev, .lg { --ev-c: var(--teal); --ev-bg: var(--teal-soft); }
.ev.accepted, .lg.accepted { --ev-c: var(--ok); --ev-bg: var(--ok-soft); }
.ev.tentative { --ev-c: var(--sun); --ev-bg: var(--sun-soft); }
.ev.declined, .lg.declined { --ev-c: var(--bad); --ev-bg: var(--bad-soft); }
.ev.cancelled, .lg.cancelled { --ev-c: var(--line-2); --ev-bg: var(--bg); }
.ev.cancelled .ev-who, .ev.cancelled .ev-time { text-decoration: line-through; color: var(--mute); }

.week-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--card); box-shadow: var(--shadow-1); }
.week { display: grid; grid-template-columns: 58px repeat(7, minmax(112px, 1fr)); grid-template-rows: auto calc(var(--hours) * var(--hour)); min-width: 840px; }
.wk-corner { border-bottom: 1px solid var(--line); }
.wk-day { display: flex; align-items: baseline; justify-content: center; gap: .4rem; padding: .7rem .4rem; border-bottom: 1px solid var(--line); border-left: 1px solid var(--line); color: var(--mute); font-size: .82rem; font-weight: 650; text-transform: uppercase; letter-spacing: .05em; }
.wk-day b { font-size: 1.15rem; color: var(--ink); letter-spacing: -0.02em; text-transform: none; }
.wk-day.today b { display: inline-grid; place-items: center; min-width: 1.9rem; height: 1.9rem; border-radius: 50%; background: var(--teal); color: var(--card); }
.wk-hours { display: grid; grid-auto-rows: var(--hour); }
.wk-hours span { font-size: .72rem; color: var(--mute); text-align: right; padding-right: .5rem; transform: translateY(-.55em); font-variant-numeric: tabular-nums; }
.wk-hours span:first-child { visibility: hidden; }
.wk-col { position: relative; border-left: 1px solid var(--line); background-image: linear-gradient(to bottom, var(--line) 1px, transparent 1px); background-size: 100% var(--hour); }
.wk-col.today { background-color: color-mix(in srgb, var(--teal) 4%, transparent); }
.wk-ev { position: absolute; display: flex; flex-direction: column; gap: 1px; padding: .3rem .5rem; border: 0; border-radius: 10px; background: var(--ev-bg); box-shadow: inset 3px 0 0 var(--ev-c); color: var(--ink); text-align: left; font-size: .76rem; font-weight: 500; line-height: 1.25; overflow: hidden; }
.wk-ev:hover { filter: brightness(.97); border: 0; box-shadow: inset 3px 0 0 var(--ev-c), var(--shadow-2); z-index: 2; }
.wk-ev > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ev-time { font-variant-numeric: tabular-nums; color: var(--ink-2); font-weight: 600; }
.ev-who { font-weight: 700; }
.ev-what { color: var(--ink-2); }
.ev-state { color: var(--ev-c); font-weight: 650; }
.ev.pending .ev-state { color: var(--mute); }
.wk-ev.short { flex-direction: row; flex-wrap: wrap; column-gap: .35rem; align-content: flex-start; }
.wk-ev.short .ev-what, .wk-ev.short .ev-state { display: none; }
.wk-now { position: absolute; left: 0; right: 0; height: 2px; background: var(--bad); z-index: 3; pointer-events: none; }
.wk-now::before { content: ""; position: absolute; left: -5px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--bad); }
.week-empty { text-align: center; padding: .5rem; }

.agenda { display: grid; gap: .5rem; }
.agenda-day { display: flex; align-items: center; gap: .5rem; margin-top: .8rem; font-size: .95rem; color: var(--ink-2); }
.agenda-day:first-child { margin-top: 0; }
.agenda-day.today { color: var(--ink); }
.agenda-item { display: grid; grid-template-columns: 4.6rem minmax(0, 1fr); column-gap: .8rem; row-gap: .1rem; align-items: baseline; width: 100%; padding: .8rem .9rem; border: 0; border-radius: 16px; background: var(--card); box-shadow: inset 4px 0 0 var(--ev-c), var(--shadow-1); text-align: left; font-weight: 500; }
.agenda-item .ev-time { grid-row: 1 / span 3; font-size: .9rem; }
.agenda-item > span:not(.ev-time) { grid-column: 2; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agenda-item .ev-state { font-size: .82rem; }

/* ---------- settings → channels (2 Nov) ---------- */
.channels-box { display: grid; gap: .2rem; }
.chan { display: grid; gap: .6rem; }
.chan h3 { margin-top: 1.2rem; }
.chan .provrow { justify-content: space-between; }
.snippet { width: 100%; font-family: ui-monospace, "Cascadia Code", Menlo, monospace; font-size: .78rem; line-height: 1.5; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: .7rem .8rem; resize: vertical; color: var(--ink-2); }

/* ---------- roles (2 Nov): scope, handled by, team ---------- */
.list-head .scope { justify-self: start; }
.conv .meta .assignee { margin-left: auto; padding: .05rem .5rem; border-radius: 999px; background: var(--bg); color: var(--ink-2); font-weight: 600; white-space: nowrap; }
.assign-box { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.assign-box select { width: 100%; }
#cal-scope { margin-right: .4rem; }
.team-list { list-style: none; margin: .4rem 0 0; padding: 0; display: grid; gap: .4rem; }
.member { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: .8rem; align-items: center; padding: .7rem .8rem; border: 1px solid var(--line); border-radius: 16px; }
.member.inactive { opacity: .6; }
.member .face { width: 2.4rem; height: 2.4rem; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: .85rem; background: hsl(var(--hue, 186) 42% 44%); }
.member .who { display: grid; min-width: 0; }
.member .who > * { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member-actions { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.member-actions select { width: auto; padding: .35rem .6rem; border-radius: 999px; font-size: .85rem; }
.invite-form { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto auto; gap: .6rem; align-items: end; }
.invite-form label { display: grid; gap: .25rem; margin: 0; }
.invite-form select { width: auto; }
@media (max-width: 760px) {
  .invite-form { grid-template-columns: 1fr; }
  .member { grid-template-columns: auto minmax(0, 1fr); }
  .member-actions { grid-column: 1 / -1; justify-content: flex-start; }
}

/* ---------- settings → agency, price list, plan (2 Nov) ---------- */
.biz-form { display: grid; gap: 1rem; }
.biz-form fieldset { border: 1px solid var(--line); border-radius: 16px; padding: .9rem 1rem 1rem; margin: 0; display: grid; gap: .7rem; }
.biz-form legend { padding: 0 .4rem; font-weight: 700; }
.biz-form .field { display: grid; gap: .3rem; margin: 0; }
.biz-form .field > span { font-weight: 600; font-size: .88rem; color: var(--ink-2); }
.biz-form .note { margin: 0; padding: .6rem .8rem; border-radius: 12px; background: var(--teal-soft); color: var(--teal-ink); font-size: .85rem; }
.biz-form .fixed { background: var(--bg); }
.hours { display: grid; gap: .4rem; }
.hour-row { display: grid; grid-template-columns: 7.5rem minmax(0, 1fr); gap: .6rem; align-items: center; margin: 0; font-weight: 600; }
.cat-rows { display: grid; gap: .45rem; margin-bottom: .8rem; }
.cat-row { display: grid; grid-template-columns: 7.5rem minmax(0, .9fr) minmax(0, 1.6fr) 5.5rem 6.5rem 5.5rem auto; gap: .4rem; align-items: center; }
.cat-row input, .cat-row select { padding: .5rem .6rem; border-radius: 10px; }
.cat-row .iconbtn { width: 2.2rem; height: 2.2rem; font-size: 1.2rem; }
.plan-card { opacity: .8; }
.plan-card h2 { display: flex; align-items: center; gap: .6rem; }
@media (max-width: 900px) {
  .cat-row { grid-template-columns: 1fr 1fr; padding: .7rem; border: 1px solid var(--line); border-radius: 14px; }
  .cat-row .cat-name { grid-column: 1 / -1; order: -1; }
  .hour-row { grid-template-columns: 6rem minmax(0, 1fr); }
}

