/* == theme == */
:root {
  --radius: 14px;
  --radius-s: 10px;
  --speed: 160ms;
  color-scheme: dark;
  --bg0: #0a0d13;
  --bg1: #0f131b;
  --bg2: #141a24;
  --bg3: #1a2130;
  --ink: #edf1f7;
  --ink2: #a6b0c2;
  --ink3: #76839a;
  --hair: rgba(160, 176, 205, 0.14);
  --hair-strong: rgba(160, 176, 205, 0.26);
  --accent: #7c8cff;
  --accent-deep: #5b6cf2;
  --accent-hover: #98a5ff;
  --accent-soft: rgba(124, 140, 255, 0.13);
  --accent-line: rgba(124, 140, 255, 0.38);
  --accent-glow: rgba(124, 140, 255, 0.55);
  --live: #3ddc97;
  --live-soft: rgba(61, 220, 151, 0.12);
  --live-line: rgba(61, 220, 151, 0.35);
  --live-glow: rgba(61, 220, 151, 0.35);
  --warn: #f0b45c;
  --warn-soft: rgba(240, 180, 92, 0.12);
  --danger: #ff7a76;
  --code-bg: #070a10;
  --code-ink: #9fb2d8;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.25);
  --shadow-2: 0 14px 40px rgba(0, 0, 0, 0.40);
  --shadow-3: 0 10px 28px rgba(0, 0, 0, 0.38);
  --edge: rgba(237, 241, 247, 0.05);
  --wash: rgba(124, 140, 255, 0.08);
  --selection: rgba(124, 140, 255, 0.35);
  --select-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23a6b0c2' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
}
:root[data-theme='light'] {
  color-scheme: light;
  --bg0: #f2f4f9;
  --bg1: #f9fafc;
  --bg2: #ffffff;
  --bg3: #e8ecf4;
  --ink: #181e2b;
  --ink2: #4c576e;
  --ink3: #5c6880;
  --hair: rgba(24, 30, 43, 0.10);
  --hair-strong: rgba(24, 30, 43, 0.20);
  --accent: #4353e8;
  --accent-deep: #3644c9;
  --accent-hover: #2f3cb0;
  --accent-soft: rgba(67, 83, 232, 0.09);
  --accent-line: rgba(67, 83, 232, 0.35);
  --accent-glow: rgba(67, 83, 232, 0.35);
  --live: #0c7f56;
  --live-soft: rgba(12, 127, 86, 0.11);
  --live-line: rgba(12, 127, 86, 0.35);
  --live-glow: rgba(12, 127, 86, 0.30);
  --warn: #8f5a0a;
  --warn-soft: rgba(143, 90, 10, 0.11);
  --danger: #cf3f39;
  --code-bg: #10141c;
  --code-ink: #9fb2d8;
  --shadow-1: 0 1px 2px rgba(24, 30, 43, 0.05), 0 4px 14px rgba(24, 30, 43, 0.05);
  --shadow-2: 0 12px 32px rgba(24, 30, 43, 0.10);
  --shadow-3: 0 14px 34px rgba(24, 30, 43, 0.13);
  --edge: rgba(255, 255, 255, 0.9);
  --wash: rgba(67, 83, 232, 0.05);
  --selection: rgba(67, 83, 232, 0.22);
  --select-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%234c576e' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme='dark']) {
  color-scheme: light;
  --bg0: #f2f4f9;
  --bg1: #f9fafc;
  --bg2: #ffffff;
  --bg3: #e8ecf4;
  --ink: #181e2b;
  --ink2: #4c576e;
  --ink3: #5c6880;
  --hair: rgba(24, 30, 43, 0.10);
  --hair-strong: rgba(24, 30, 43, 0.20);
  --accent: #4353e8;
  --accent-deep: #3644c9;
  --accent-hover: #2f3cb0;
  --accent-soft: rgba(67, 83, 232, 0.09);
  --accent-line: rgba(67, 83, 232, 0.35);
  --accent-glow: rgba(67, 83, 232, 0.35);
  --live: #0c7f56;
  --live-soft: rgba(12, 127, 86, 0.11);
  --live-line: rgba(12, 127, 86, 0.35);
  --live-glow: rgba(12, 127, 86, 0.30);
  --warn: #8f5a0a;
  --warn-soft: rgba(143, 90, 10, 0.11);
  --danger: #cf3f39;
  --code-bg: #10141c;
  --code-ink: #9fb2d8;
  --shadow-1: 0 1px 2px rgba(24, 30, 43, 0.05), 0 4px 14px rgba(24, 30, 43, 0.05);
  --shadow-2: 0 12px 32px rgba(24, 30, 43, 0.10);
  --shadow-3: 0 14px 34px rgba(24, 30, 43, 0.13);
  --edge: rgba(255, 255, 255, 0.9);
  --wash: rgba(67, 83, 232, 0.05);
  --selection: rgba(67, 83, 232, 0.22);
  --select-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%234c576e' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  }
}
/* == /theme == */

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0;
  font: 15px/1.55 -apple-system, BlinkMacSystemFont, 'Segoe UI Variable Text', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg0);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1 { font-size: 1.6rem; font-weight: 650; letter-spacing: -0.022em; margin: 0 0 0.35rem; }
h2 { font-size: 1.02rem; font-weight: 600; letter-spacing: -0.01em; margin: 0; }
h3 { font-size: 0.92rem; font-weight: 600; color: var(--ink2); margin: 1.5rem 0 0.4rem; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }
p { margin: 0.4rem 0; }
::selection { background: var(--selection); }

/* ------------------------------------------------------------------ controls */
button { font: inherit; cursor: pointer; color: inherit; }
.primary, button.primary {
  display: inline-flex; align-items: center; gap: 0.45rem;
  background: linear-gradient(180deg, var(--accent) -35%, var(--accent-deep) 90%);
  color: #fff; border: 0;
  border-radius: var(--radius-s); padding: 0.55rem 1.05rem; font-weight: 600;
  box-shadow: var(--shadow-1);
  transition: filter var(--speed) ease, transform var(--speed) ease, box-shadow var(--speed) ease;
}
.primary:hover, button.primary:hover { filter: brightness(1.08); color: #fff; transform: translateY(-1px); box-shadow: var(--shadow-3); }
.primary:active, button.primary:active { transform: translateY(0) scale(0.99); box-shadow: var(--shadow-1); }
.primary[disabled] { opacity: 0.45; cursor: default; transform: none; filter: none; }
.ghost, button.quiet {
  display: inline-flex; align-items: center; gap: 0.45rem;
  background: transparent; color: var(--ink); border: 1px solid var(--hair-strong);
  border-radius: var(--radius-s); padding: 0.5rem 0.95rem; font-weight: 550;
  transition: border-color var(--speed) ease, background var(--speed) ease, transform var(--speed) ease;
}
.ghost:hover, button.quiet:hover { border-color: var(--accent-line); background: var(--accent-soft); color: var(--ink); transform: translateY(-1px); }
button.quiet[disabled] { opacity: 0.45; cursor: default; transform: none; }
button.linky { background: none; border: 0; color: var(--accent); padding: 0; font-weight: 550; }
button.linky:hover { color: var(--accent-hover); }
:is(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px;
}
input, select, textarea {
  width: 100%; padding: 0.55rem 0.7rem;
  border: 1px solid var(--hair); border-radius: var(--radius-s);
  font: inherit; background: var(--bg1); color: var(--ink);
  transition: border-color var(--speed) ease, background var(--speed) ease;
}
input:hover, select:hover, textarea:hover { border-color: var(--hair-strong); }
input:focus, select:focus, textarea:focus { border-color: var(--accent-line); background: var(--bg2); outline: none; }
input::placeholder, textarea::placeholder { color: var(--ink3); }
select {
  appearance: none; -webkit-appearance: none; padding-right: 2rem;
  background-image: var(--select-arrow);
  background-repeat: no-repeat; background-position: right 0.7rem center;
}
input[type='checkbox'], input[type='radio'] { width: auto; accent-color: var(--accent-deep); }
label { display: block; font-size: 0.82rem; color: var(--ink2); margin-bottom: 0.3rem; }
label.check { display: flex; align-items: center; gap: 0.45rem; color: var(--ink); font-size: 0.92rem; }
.field { margin-bottom: 0.85rem; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 0.85rem; }
.hint { color: var(--ink3); font-size: 0.84rem; margin: 0.3rem 0 0.8rem; }
.muted { color: var(--ink2); }
.error { color: var(--danger); min-height: 1.2rem; margin: 0.5rem 0; font-size: 0.92rem; }
.saved { color: var(--live); font-size: 0.88rem; margin-left: 0.65rem; }
.actions { display: flex; align-items: center; margin-top: 0.9rem; gap: 0.5rem; }
.notice {
  background: var(--warn-soft); border: 1px solid var(--warn); color: var(--warn);
  border-radius: var(--radius-s); padding: 0.55rem 0.8rem; margin: 0 0 1rem;
}

/* -------------------------------------------------------------------- views */
body[data-view='loading'] .auth, body[data-view='loading'] .shell { display: none; }
body[data-view='auth'] .shell { display: none; }
body[data-view='shell'] .auth { display: none; }

/* --------------------------------------------------------------------- auth */
.auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1.5rem; }
.auth form {
  display: none; width: 100%; max-width: 23rem;
  background: radial-gradient(140% 100% at 50% 0%, var(--wash) 0%, transparent 60%), var(--bg2);
  border: 1px solid var(--hair); border-radius: 20px;
  padding: 2.1rem 2rem 1.8rem;
  box-shadow: inset 0 1px 0 var(--edge), var(--shadow-2);
}
body[data-authstep='signin'] .signin-form { display: block; }
body[data-authstep='mfa'] .mfa-form { display: block; }
.auth h1 { font-size: 1.35rem; }
.auth .lede { color: var(--ink2); margin: 0 0 1.4rem; font-size: 0.95rem; }
.auth .primary { width: 100%; justify-content: center; margin-top: 0.35rem; }
.auth .swap { color: var(--ink3); font-size: 0.88rem; margin-top: 1.2rem; }

/* -------------------------------------------------------------------- shell */
.shell { display: grid; grid-template-columns: 15.5rem 1fr; min-height: 100vh; }
aside {
  background: var(--bg1); border-right: 1px solid var(--hair);
  padding: 1.5rem 1rem 1.2rem; display: flex; flex-direction: column; gap: 1.35rem;
  position: sticky; top: 0; height: 100vh;
}
.brand {
  display: flex; align-items: center; gap: 0.55rem; margin: 0 0 0 0.6rem;
  font-size: 1rem; font-weight: 700; letter-spacing: 0.045em;
}
.brand::before {
  content: ''; width: 10px; height: 10px; border-radius: 3.5px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-deep) 100%);
  box-shadow: 0 0 14px var(--accent-glow);
}
.org {
  color: var(--ink2); font-weight: 600; font-size: 0.86rem; margin: -1.05rem 0 0 0.6rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
aside nav { display: flex; flex-direction: column; gap: 3px; }
aside nav a {
  position: relative;
  display: flex; align-items: center; gap: 0.7rem;
  padding: 0.55rem 0.75rem; border-radius: var(--radius-s);
  color: var(--ink2); font-weight: 550; font-size: 0.94rem;
  transition: background var(--speed) ease, color var(--speed) ease;
}
aside nav a svg { flex: none; opacity: 0.7; transition: opacity var(--speed) ease; }
aside nav a:hover { background: var(--bg2); color: var(--ink); }
aside nav a:hover svg { opacity: 1; }
aside nav a[aria-current='page'] {
  background: var(--bg3); color: var(--ink);
  box-shadow: inset 0 1px 0 var(--edge);
}
aside nav a[aria-current='page']::before {
  content: ''; position: absolute; left: -0.35rem; top: 0.55rem; bottom: 0.55rem;
  width: 3px; border-radius: 2px; background: var(--accent);
}
aside nav a[aria-current='page'] svg { opacity: 1; color: var(--accent); }
.badge {
  margin-left: auto; background: var(--accent-deep); color: #fff; border-radius: 999px;
  font-size: 0.7rem; font-weight: 700; padding: 0.05rem 0.45rem; line-height: 1.5;
}
.aside-foot {
  margin-top: auto; display: flex; flex-direction: column; gap: 0.35rem;
  padding: 0.9rem 0.6rem 0; border-top: 1px solid var(--hair);
}
.aside-foot .who { color: var(--ink3); font-size: 0.78rem; overflow-wrap: anywhere; }
.content { padding: 2.3rem 2.6rem 4.5rem; min-width: 0; background: var(--bg0); }
.panel { display: none; max-width: 62rem; }
body[data-panel='home'] .panel[data-panel='home'] { display: block; }
body[data-panel='conversations'] .panel[data-panel='conversations'] { display: block; }
body[data-panel='appointments'] .panel[data-panel='appointments'] { display: block; }
body[data-panel='customers'] .panel[data-panel='customers'] { display: block; }
body[data-panel='team'] .panel[data-panel='team'] { display: block; }
body[data-panel='employee'] .panel[data-panel='employee'] { display: block; }
body[data-panel='settings'] .panel[data-panel='settings'] { display: block; }
@media (prefers-reduced-motion: no-preference) {
  .panel { animation: rise 240ms ease; }
  @keyframes rise { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
  .home-flow > * { animation: rise 300ms ease backwards; }
  .home-flow > *:nth-child(2) { animation-delay: 45ms; }
  .home-flow > *:nth-child(3) { animation-delay: 90ms; }
  .home-flow > *:nth-child(4) { animation-delay: 135ms; }
}

/* ---------------------------------------------------------------- surfaces */
.card {
  background: var(--bg2); border: 1px solid var(--hair); border-radius: 16px;
  padding: 1.35rem 1.5rem;
  box-shadow: inset 0 1px 0 var(--edge), var(--shadow-1);
  transition: border-color var(--speed) ease, transform var(--speed) ease;
}
.card h2 {
  font-size: 0.72rem; font-weight: 650; text-transform: uppercase;
  letter-spacing: 0.1em; color: var(--ink3); margin-bottom: 0.9rem;
}

/* ---------------------------------------------------------------- portraits */
.avatar-wrap { position: relative; flex: none; }
img.avatar {
  display: block; width: 4.5rem; height: 4.5rem; border-radius: 1.4rem;
  object-fit: cover; border: 1px solid var(--hair-strong); background: var(--bg3);
  box-shadow: var(--shadow-1);
}
@media (prefers-reduced-motion: no-preference) {
  img.avatar { opacity: 0; transition: opacity 320ms ease; }
  img.avatar.ready { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  img.avatar { opacity: 1; }
}
.dot {
  position: absolute; right: -2px; bottom: -2px; width: 12px; height: 12px;
  border-radius: 50%; border: 2.5px solid var(--bg2); background: var(--ink3);
}
.dot[data-state='live'] { background: var(--live); }
.dot[data-state='off'] { background: var(--warn); }
@media (prefers-reduced-motion: no-preference) {
  .dot[data-state='live'] { animation: breathe 2.6s ease-in-out infinite; }
  @keyframes breathe {
    0%, 100% { box-shadow: 0 0 0 0 var(--live-glow); }
    50% { box-shadow: 0 0 0 5px transparent; }
  }
}

/* --------------------------------------------------------------------- home */
.home-head { margin-bottom: 1.9rem; }
.home-title { font-size: 1.9rem; letter-spacing: -0.028em; margin-bottom: 0.2rem; }
.home-sub { color: var(--ink3); font-size: 0.92rem; margin: 0; }
.home-status { color: var(--ink2); font-size: 1.02rem; margin: 0.65rem 0 0; }
.home-status[data-live='yes'] { color: var(--live); font-weight: 550; }
.home-flow { display: grid; gap: 1.35rem; }
.next-band {
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
  background: linear-gradient(100deg, var(--accent-soft) 0%, transparent 70%), var(--bg2);
  border: 1px solid var(--accent-line); border-radius: 16px;
  padding: 1.05rem 1.4rem;
  box-shadow: inset 0 1px 0 var(--edge), var(--shadow-1);
}
.next-band .lead { font-weight: 600; }
.next-band .why { color: var(--ink2); font-size: 0.92rem; }
.next-band .primary { margin-left: auto; }

.needs { padding: 1.1rem 1.4rem; }
.needs .n-rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.15rem; }
.n-row {
  display: flex; align-items: baseline; gap: 0.7rem; width: 100%; text-align: left;
  background: none; border: 0; border-radius: var(--radius-s); padding: 0.55rem 0.65rem;
  transition: background var(--speed) ease;
}
.n-row:hover { background: var(--bg3); }
.n-row .n-dot {
  flex: none; width: 8px; height: 8px; border-radius: 50%;
  background: var(--warn); transform: translateY(-1px);
}
.n-row .n-who { font-weight: 600; }
.n-row .n-why { color: var(--ink2); font-size: 0.92rem; }
.n-row .n-when { margin-left: auto; color: var(--ink3); font-size: 0.82rem; flex: none; font-variant-numeric: tabular-nums; }
.calm { display: flex; align-items: baseline; gap: 0.6rem; padding: 0.2rem 0.65rem 0.1rem; }
.calm .n-dot { background: var(--live); }
.calm .n-who { font-weight: 600; }
.calm .n-why { color: var(--ink3); font-size: 0.92rem; }

/* The team: people first, each an equal profile. */
.team-cards {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: 1.1rem; grid-template-columns: repeat(auto-fill, minmax(15.5rem, 1fr));
}
.p-card {
  position: relative;
  display: flex; flex-direction: column; align-items: center; text-align: center;
  width: 100%; cursor: pointer; color: inherit;
  background: radial-gradient(120% 90% at 50% 0%, var(--wash) 0%, transparent 55%), var(--bg2);
  border: 1px solid var(--hair); border-radius: 18px;
  padding: 1.7rem 1.35rem 1.45rem;
  box-shadow: inset 0 1px 0 var(--edge), var(--shadow-1);
  transition: border-color var(--speed) ease, transform 200ms ease, box-shadow 200ms ease;
}
.p-card:hover { border-color: var(--accent-line); transform: translateY(-3px); box-shadow: inset 0 1px 0 var(--edge), var(--shadow-3); color: inherit; }
.p-head { display: flex; flex-direction: column; align-items: center; gap: 0.85rem; }
.p-head .dot { width: 13px; height: 13px; right: 2px; bottom: 2px; }
.p-head .name { font-weight: 650; font-size: 1.16rem; letter-spacing: -0.014em; }
.p-head .role { color: var(--ink2); font-size: 0.85rem; margin-top: 0.1rem; }
.p-line {
  margin: 0.7rem 0 0; color: var(--ink2); font-size: 0.9rem;
  display: flex; align-items: baseline; justify-content: center; gap: 0.5rem;
}
.p-line[data-live='yes'] { color: var(--live); font-weight: 550; }
.p-line .p-mark { flex: none; width: 7px; height: 7px; border-radius: 50%; background: currentColor; transform: translateY(-1px); }
.p-note { margin: 0.5rem 0 0; color: var(--warn); font-size: 0.84rem; }
.p-actions { display: flex; justify-content: center; gap: 0.6rem; margin-top: 1rem; }
.p-actions .ghost { padding: 0.4rem 0.85rem; font-size: 0.88rem; }
.hire-tile {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 0.5rem; text-align: center; color: var(--ink3); font-weight: 550; font-size: 0.92rem;
  border: 1.5px dashed var(--hair-strong); border-radius: 18px; padding: 1.7rem 1.35rem;
  transition: border-color var(--speed) ease, color var(--speed) ease, background var(--speed) ease;
}
.hire-tile::before {
  content: '+'; display: flex; align-items: center; justify-content: center;
  width: 2.6rem; height: 2.6rem; border-radius: 50%;
  background: var(--bg3); color: var(--ink2); font-size: 1.4rem; font-weight: 500;
  transition: background var(--speed) ease, color var(--speed) ease;
}
.hire-tile:hover { border-color: var(--accent-line); color: var(--accent); background: var(--accent-soft); }
.hire-tile:hover::before { background: var(--accent-soft); color: var(--accent); }

/* Today: the day's numbers and what crossed the desk, one quiet zone. */
.today { padding: 1.1rem 1.4rem 1rem; }
.today .day-strip {
  display: flex; flex-wrap: wrap; gap: 0.4rem 2.2rem; align-items: baseline;
  padding: 0.15rem 0.65rem 0.75rem;
}
.day-strip .stat { display: flex; align-items: baseline; gap: 0.5rem; color: inherit; }
.day-strip .stat .n {
  font-size: 1.45rem; font-weight: 700; letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.day-strip .stat .n[data-zero='yes'] { color: var(--ink3); font-weight: 500; }
.day-strip .stat .what { color: var(--ink2); font-size: 0.88rem; }
a.stat:hover .what { color: var(--ink); }
.today .t-rows { list-style: none; margin: 0; padding: 0.55rem 0 0; border-top: 1px solid var(--hair); }
.t-row {
  display: flex; align-items: baseline; gap: 0.7rem; width: 100%; text-align: left;
  background: none; border: 0; border-radius: var(--radius-s); padding: 0.45rem 0.65rem;
  transition: background var(--speed) ease; font-size: 0.93rem;
}
.t-row:hover { background: var(--bg3); }
.t-row .t-who { font-weight: 600; flex: none; }
.t-row .t-what {
  color: var(--ink2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0;
}
.t-row .t-when { margin-left: auto; color: var(--ink3); font-size: 0.82rem; flex: none; font-variant-numeric: tabular-nums; }

.empty {
  color: var(--ink3); padding: 2.2rem 1rem; text-align: center; font-size: 0.95rem;
  border: 1px dashed var(--hair); border-radius: 16px;
}

/* ------------------------------------------------------------ conversations */
.convo { display: grid; grid-template-columns: minmax(17rem, 24rem) 1fr; gap: 1.1rem; min-height: 72vh; }
.convo .list { min-width: 0; }
.list-head { display: flex; align-items: baseline; gap: 0.75rem; }
.filters { display: flex; flex-wrap: wrap; gap: 0.35rem; margin: 0.7rem 0 0.9rem; }
.filters button {
  background: transparent; border: 1px solid var(--hair); border-radius: 999px;
  padding: 0.22rem 0.75rem; font-size: 0.84rem; color: var(--ink2); font-weight: 550;
  transition: border-color var(--speed) ease, color var(--speed) ease, background var(--speed) ease;
}
.filters button:hover { border-color: var(--hair-strong); color: var(--ink); }
.filters button[aria-pressed='true'] {
  color: var(--accent); border-color: var(--accent-line); background: var(--accent-soft);
}
.rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.rows .empty { padding: 1.6rem 1rem; }
.row {
  display: block; width: 100%; text-align: left; background: var(--bg2);
  border: 1px solid var(--hair); border-radius: var(--radius-s); padding: 0.7rem 0.85rem;
  box-shadow: inset 0 1px 0 var(--edge);
  transition: border-color var(--speed) ease, background var(--speed) ease;
}
.row:hover { border-color: var(--hair-strong); background: var(--bg3); }
.row[aria-current='true'] { border-color: var(--accent-line); background: var(--bg3); }
.row-top { display: flex; justify-content: space-between; gap: 0.5rem; }
.row-name { font-weight: 600; }
.row-when { color: var(--ink3); font-size: 0.8rem; flex: none; font-variant-numeric: tabular-nums; }
.row-preview {
  color: var(--ink2); font-size: 0.87rem; margin: 0.2rem 0 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.row-tags { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.5rem; }
.tag {
  display: inline-block; font-size: 0.73rem; font-weight: 550; border-radius: 999px;
  padding: 0.12rem 0.55rem; background: var(--bg3); color: var(--ink2);
}
.tag--attention { background: var(--warn-soft); color: var(--warn); }
.tag--human { background: var(--accent-soft); color: var(--accent); }
.chips { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.9rem; }
.chip {
  display: inline-flex; align-items: center; gap: 0.35rem;
  font-size: 0.78rem; font-weight: 550; border-radius: 999px; padding: 0.16rem 0.65rem;
  background: var(--bg3); color: var(--ink2); border: 1px solid transparent;
}
.chip.ok { background: var(--live-soft); color: var(--live); }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.convo .detail {
  background: var(--bg1); border: 1px solid var(--hair); border-radius: 16px;
  padding: 1.15rem 1.25rem; display: flex; flex-direction: column; min-width: 0;
  box-shadow: inset 0 1px 0 var(--edge);
}
.convo .placeholder { color: var(--ink3); margin: auto; }
.detail-head { display: flex; justify-content: space-between; gap: 0.75rem; align-items: start; }
.detail-head h2 { font-size: 1.12rem; font-weight: 650; }
.detail-sub { color: var(--ink2); font-size: 0.87rem; margin: 0.2rem 0 0; }
.controls { display: flex; gap: 0.5rem; flex: none; flex-wrap: wrap; justify-content: end; }
.controls button {
  border: 1px solid var(--hair-strong); background: transparent; color: var(--ink);
  border-radius: var(--radius-s); padding: 0.4rem 0.8rem; font-weight: 550;
  transition: border-color var(--speed) ease, background var(--speed) ease;
}
.controls button:hover { border-color: var(--accent-line); background: var(--accent-soft); }
.controls button.is-primary { background: var(--accent-deep); color: #fff; border-color: transparent; }
.controls button.is-primary:hover { background: var(--accent); }
.controls button[disabled] { opacity: 0.45; cursor: default; }
.banner { border-radius: var(--radius-s); padding: 0.55rem 0.8rem; margin: 0.8rem 0 0; font-size: 0.9rem; }
.banner--attention { background: var(--warn-soft); border: 1px solid var(--warn); color: var(--warn); }
.banner--context { background: var(--bg2); border: 1px solid var(--hair); color: var(--ink2); }
.log { flex: 1; overflow-y: auto; margin: 0.9rem 0; display: flex; flex-direction: column; gap: 0.65rem; min-height: 12rem; }
.msg { max-width: 85%; }
.msg--visitor { align-self: flex-start; }
.msg--receptionist, .msg--person { align-self: flex-end; text-align: right; }
.msg-who { font-size: 0.75rem; color: var(--ink3); margin-bottom: 0.15rem; font-weight: 550; }
.msg-body {
  display: inline-block; text-align: left; background: var(--bg3);
  border-radius: 12px; padding: 0.5rem 0.75rem; font-size: 0.95rem;
  white-space: pre-wrap; overflow-wrap: anywhere;
}
.msg--receptionist .msg-body { background: var(--accent-soft); border: 1px solid var(--accent-line); }
.msg--person .msg-body { background: var(--live-soft); border: 1px solid var(--live-line); }
.msg-meta { font-size: 0.72rem; color: var(--ink3); margin-top: 0.15rem; }
.msg-meta[data-delivery='Failed'], .msg-meta[data-delivery='Undeliverable'] { color: var(--danger); }
.composer { display: flex; gap: 0.5rem; align-items: end; }
.composer textarea { resize: vertical; min-height: 2.6rem; }
.composer-note { color: var(--ink3); font-size: 0.88rem; margin: 0; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); border: 0;
}

/* ------------------------------------------------------------- appointments */
.appt-groups h2 { margin: 1.6rem 0 0.6rem; font-size: 0.98rem; }
.appt {
  background: var(--bg2); border: 1px solid var(--hair); border-radius: var(--radius-s);
  padding: 0.85rem 1rem; margin-bottom: 0.55rem;
  box-shadow: inset 0 1px 0 var(--edge), var(--shadow-1);
}
.appt .top { display: flex; justify-content: space-between; gap: 0.5rem; flex-wrap: wrap; }
.appt .service { font-weight: 600; }
.appt .who-when { color: var(--ink2); font-size: 0.87rem; }
.appt .raw { color: var(--ink3); font-size: 0.87rem; font-style: italic; margin: 0.35rem 0 0; }
.appt .note { font-size: 0.87rem; margin: 0.35rem 0 0; color: var(--ink2); }
.appt .row-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 0.75rem; }
.appt input.notes { margin-top: 0.55rem; }
.row-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; }

/* ---------------------------------------------------------------- customers */
.intro { margin: 0 0 1.2rem; font-size: 0.95rem; }
.customers-list .people { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.person {
  display: block; width: 100%; text-align: left; background: var(--bg2);
  border: 1px solid var(--hair); border-radius: var(--radius-s); padding: 0.7rem 0.85rem;
  box-shadow: inset 0 1px 0 var(--edge);
  transition: border-color var(--speed) ease, background var(--speed) ease;
}
.person:hover { border-color: var(--hair-strong); background: var(--bg3); }
.person .p-name { font-weight: 600; }
.person .p-sub { color: var(--ink3); font-size: 0.84rem; }
.customer-detail .crumb { margin: 0 0 0.9rem; }
.kv { display: grid; grid-template-columns: minmax(8rem, 12rem) 1fr; gap: 0.3rem 1.2rem; margin: 0.6rem 0 0; }
.kv dt { color: var(--ink3); font-size: 0.87rem; }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.customer-detail section { margin-top: 1.6rem; }
.linklist { list-style: none; margin: 0.35rem 0 0; padding: 0; display: grid; gap: 0.4rem; }

/* ----------------------------------------------------------------- employee */
.crumb { margin: 0 0 1rem; font-size: 0.9rem; }
.emp-head { display: flex; align-items: center; gap: 1.35rem; margin-bottom: 1.3rem; }
.emp-head img.avatar { width: 6rem; height: 6rem; border-radius: 1.8rem; box-shadow: var(--shadow-2); }
.emp-head .dot { width: 14px; height: 14px; right: 0; bottom: 0; }
.emp-head h1 { margin: 0; }
.emp-id { min-width: 0; }
.emp-sub { color: var(--ink2); margin: 0.15rem 0 0; }
.emp-presence { color: var(--ink3); font-size: 0.9rem; margin: 0.3rem 0 0; }
.emp-presence[data-live='yes'] { color: var(--live); font-weight: 550; }
.emp-actions { margin-left: auto; display: flex; gap: 0.6rem; flex: none; }
.emp-tabs {
  display: flex; flex-wrap: wrap; gap: 0.35rem; margin: 0 0 1.1rem;
  border-bottom: 1px solid var(--hair); padding-bottom: 0.8rem;
}
.emp-tabs button {
  background: transparent; border: 1px solid transparent; border-radius: 999px;
  padding: 0.32rem 0.9rem; font-size: 0.9rem; color: var(--ink2); font-weight: 550;
  transition: border-color var(--speed) ease, color var(--speed) ease, background var(--speed) ease;
}
.emp-tabs button:hover { color: var(--ink); background: var(--bg2); }
.emp-tabs button[aria-pressed='true'] {
  color: var(--accent); border-color: var(--accent-line); background: var(--accent-soft);
}
.emp-section {
  background: var(--bg2); border: 1px solid var(--hair); border-radius: 16px;
  padding: 1.35rem 1.5rem;
  box-shadow: inset 0 1px 0 var(--edge), var(--shadow-1);
}
.emp-section > form > h3:first-child { margin-top: 0; }
table.hours { border-collapse: collapse; }
table.hours th { text-align: left; font-weight: 500; color: var(--ink2); padding: 0.18rem 0.9rem 0.18rem 0; }
table.hours td { padding: 0.18rem 0.55rem 0.18rem 0; }
table.hours input[type='time'] { width: auto; }
tr[data-shut='yes'] input[type='time'] { opacity: 0.3; }
ul.rows.services li, ul.rows.faqs li {
  background: var(--bg1); border: 1px solid var(--hair); border-radius: var(--radius-s);
  padding: 0.6rem 0.7rem; display: grid; gap: 0.45rem;
}
ul.rows.services .line { display: grid; grid-template-columns: 2fr 5rem 1fr; gap: 0.45rem; }
ul.rows { margin-bottom: 0.6rem; }
.drop { justify-self: end; font-size: 0.83rem; }
.channel-card { border: 1px solid var(--hair); border-radius: var(--radius-s); padding: 0.95rem 1.05rem; background: var(--bg1); }
.channel-card .c-head { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.channel-card .c-name { font-weight: 600; }
.snippet {
  background: var(--code-bg); border: 1px solid var(--hair); border-radius: var(--radius-s);
  padding: 0.85rem; overflow-x: auto; font-size: 0.8rem; margin: 0.7rem 0;
  color: var(--code-ink);
}
.snippet code { font-family: ui-monospace, SFMono-Regular, Consolas, Menlo, monospace; white-space: pre; }

/* ----------------------------------------------------------------- settings */
.set-section {
  background: var(--bg2); border: 1px solid var(--hair); border-radius: 16px;
  padding: 1.35rem 1.5rem; margin-bottom: 1.1rem; max-width: 42rem;
  box-shadow: inset 0 1px 0 var(--edge), var(--shadow-1);
}
.set-section h2 { margin-bottom: 0.7rem; font-size: 1rem; }
.appearance { display: flex; flex-wrap: wrap; gap: 1.2rem; margin-top: 0.6rem; }
.identities, .members { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.identities li { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.identities input { flex: 1; min-width: 10rem; width: auto; }
.members li { display: flex; gap: 0.75rem; align-items: baseline; flex-wrap: wrap; }
.members .m-name { font-weight: 600; }
.members .m-sub { color: var(--ink3); font-size: 0.84rem; }

/* --------------------------------------------------------------- scrollbars */
* { scrollbar-width: thin; scrollbar-color: var(--bg3) transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb { background: var(--bg3); border-radius: 4px; }
*::-webkit-scrollbar-track { background: transparent; }

/* --------------------------------------------------------------- responsive */
@media (max-width: 880px) {
  .shell { grid-template-columns: 1fr; }
  aside { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--hair); padding-bottom: 0.6rem; }
  aside nav { flex-direction: row; overflow-x: auto; padding-bottom: 0.3rem; }
  aside nav a { flex: none; }
  aside nav a[aria-current='page']::before { left: 0.55rem; right: 0.55rem; top: auto; bottom: -1px; width: auto; height: 3px; }
  .aside-foot { flex-direction: row; align-items: baseline; gap: 0.75rem; margin-top: 0.3rem; border-top: 0; padding-top: 0; }
  .content { padding: 1.2rem 1rem 3.5rem; }
  .home-title { font-size: 1.55rem; }
  .convo { grid-template-columns: 1fr; }
  body[data-pane='detail'] .convo .list { display: none; }
  body[data-pane='list'] .convo .detail { display: none; }
  .pair { grid-template-columns: 1fr; }
  .next-band .primary { margin-left: 0; }
  .emp-head { flex-wrap: wrap; }
  .emp-actions { margin-left: 0; width: 100%; }
  .today .day-strip { gap: 0.4rem 1.4rem; }
}
@media (min-width: 881px) {
  .convo .detail { display: flex !important; }
  .convo .list { display: block !important; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
