/* ==========================================================================
   DialLine+ design system
   Clean, calm, content-first: translucent chrome, grouped surfaces,
   generous spacing, one accent colour, automatic light / dark.
   ========================================================================== */

:root {
  color-scheme: light dark;

  /* Surfaces */
  --bg: #f5f5f7;
  --surface: #ffffff;
  --surface-2: #fbfbfd;
  --elevated: #ffffff;
  --sidebar: rgba(242, 242, 245, .78);
  --sidebar-solid: #f2f2f5;
  --toolbar: rgba(245, 245, 247, .72);
  --fill: rgba(118, 118, 128, .12);
  --fill-2: rgba(118, 118, 128, .08);
  --fill-hover: rgba(118, 118, 128, .18);
  --hairline: rgba(60, 60, 67, .13);
  --hairline-strong: rgba(60, 60, 67, .22);

  /* Text */
  --label: #1d1d1f;
  --label-2: #6e6e73;
  --label-3: #86868b;
  --label-4: #aeaeb2;

  /* System colours */
  --blue: #0071e3;
  --blue-hover: #0077ed;
  --green: #28a745;
  --green-2: #34c759;
  --orange: #ff9500;
  --red: #ff3b30;
  --purple: #af52de;
  --indigo: #5856d6;
  --teal: #30b0c7;
  --yellow: #ffcc00;

  --blue-t: rgba(0, 113, 227, .10);
  --green-t: rgba(52, 199, 89, .14);
  --orange-t: rgba(255, 149, 0, .14);
  --red-t: rgba(255, 59, 48, .11);
  --purple-t: rgba(175, 82, 222, .12);
  --gray-t: rgba(118, 118, 128, .12);

  --green-ink: #1f7a36;
  --orange-ink: #a65f00;
  --red-ink: #d70015;
  --purple-ink: #8e3ab8;
  --blue-ink: #0066cc;

  --r-sm: 8px;
  --r: 12px;
  --r-lg: 18px;
  --r-xl: 22px;
  --shadow-card: 0 0 0 .5px rgba(0, 0, 0, .05), 0 1px 3px rgba(0, 0, 0, .04), 0 4px 14px rgba(0, 0, 0, .03);
  --shadow-pop: 0 0 0 .5px rgba(0, 0, 0, .08), 0 12px 40px rgba(0, 0, 0, .14), 0 3px 10px rgba(0, 0, 0, .06);
  --ring: 0 0 0 4px rgba(0, 113, 227, .28);
  --ease: cubic-bezier(.32, .72, 0, 1);

  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI Variable Text", "Segoe UI", system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.43;
  letter-spacing: -.006em;
  color: var(--label);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "cv11", "ss01";
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --surface: #1c1c1e;
    --surface-2: #232325;
    --elevated: #2c2c2e;
    --sidebar: rgba(30, 30, 32, .78);
    --sidebar-solid: #1e1e20;
    --toolbar: rgba(0, 0, 0, .66);
    --fill: rgba(118, 118, 128, .24);
    --fill-2: rgba(118, 118, 128, .16);
    --fill-hover: rgba(118, 118, 128, .32);
    --hairline: rgba(84, 84, 88, .5);
    --hairline-strong: rgba(84, 84, 88, .75);
    --label: #f5f5f7;
    --label-2: #a1a1a6;
    --label-3: #8e8e93;
    --label-4: #636366;
    --blue: #0a84ff;
    --blue-hover: #409cff;
    --green: #30d158;
    --green-2: #30d158;
    --red: #ff453a;
    --orange: #ff9f0a;
    --purple: #bf5af2;
    --blue-t: rgba(10, 132, 255, .18);
    --green-t: rgba(48, 209, 88, .18);
    --orange-t: rgba(255, 159, 10, .18);
    --red-t: rgba(255, 69, 58, .18);
    --purple-t: rgba(191, 90, 242, .18);
    --gray-t: rgba(142, 142, 147, .2);
    --green-ink: #30d158;
    --orange-ink: #ffb340;
    --red-ink: #ff6961;
    --purple-ink: #da8fff;
    --blue-ink: #64aaff;
    --shadow-card: 0 0 0 .5px rgba(255, 255, 255, .06);
    --shadow-pop: 0 0 0 .5px rgba(255, 255, 255, .1), 0 20px 50px rgba(0, 0, 0, .6);
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); }
body { overflow-y: scroll; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4, p { margin: 0; }
svg { flex: none; }
::selection { background: rgba(0, 113, 227, .22); }

.boot { display: grid; place-items: center; height: 100vh; color: var(--label-3); }
.muted { color: var(--label-2); }
.faint { color: var(--label-3); }
.small { font-size: 12px; }
.footnote { font-size: 12px; color: var(--label-3); }
.right { text-align: right; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }
.mono { font-family: "SF Mono", ui-monospace, Menlo, Consolas, monospace; font-size: 12.5px; }
.hidden { display: none !important; }
.semibold { font-weight: 600; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.nw { flex-wrap: nowrap; }
.row.between { justify-content: space-between; }
.row.end { justify-content: flex-end; }
.row.top { align-items: flex-start; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.stack.tight { gap: 8px; }
.stack.loose { gap: 24px; }
.grow { flex: 1; min-width: 0; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.span-all { grid-column: 1 / -1; }
@media (max-width: 1180px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 720px) { .g2, .g3, .g4 { grid-template-columns: 1fr; } }

/* ---------- App shell ---------- */
.shell { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: 100vh; background: linear-gradient(to right, var(--sidebar-solid) 252px, transparent 252px); }
.sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column;
  padding: 14px 12px 12px; background: var(--sidebar-solid);
  border-right: .5px solid var(--hairline); z-index: 30;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 6px 10px 18px; font-weight: 700; font-size: 17px; letter-spacing: -.02em; color: var(--label); }
.brand-mark { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; color: #fff;
  background: linear-gradient(160deg, #34c3ff 0%, #0071e3 55%, #3a3ad6 100%);
  box-shadow: inset 0 .5px 0 rgba(255,255,255,.4), 0 1px 3px rgba(0, 60, 160, .35); }
.brand-mark.xl { width: 68px; height: 68px; border-radius: 16px; margin: 0 auto; }
.brand sup { color: var(--blue); font-size: 15px; font-weight: 700; vertical-align: 0; margin-left: 1px; }

.nav { display: flex; flex-direction: column; gap: 1px; overflow-y: auto; }
.nav-label { font-size: 11px; font-weight: 600; color: var(--label-3); padding: 16px 10px 6px; letter-spacing: .01em; }
.nav a {
  display: flex; align-items: center; gap: 10px; height: 32px; padding: 0 10px; border-radius: 8px;
  color: var(--label); font-size: 13.5px; font-weight: 500; transition: background .15s;
}
.nav a svg { color: var(--blue); width: 18px; height: 18px; }
.nav a:hover { background: var(--fill-2); text-decoration: none; }
.nav a.active { background: var(--fill); font-weight: 600; }
.nav a .count { margin-left: auto; font-size: 12px; color: var(--label-3); font-weight: 500; }

.me { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 12px; }
.me:hover { background: var(--fill-2); }
.me .who { min-width: 0; flex: 1; line-height: 1.25; }
.me .who b { display: block; font-size: 13px; font-weight: 600; }
.me .who span { font-size: 11.5px; color: var(--label-3); }

.main { min-width: 0; display: flex; flex-direction: column; }
.toolbar {
  position: sticky; top: 0; z-index: 20; height: 60px; display: flex; align-items: center; gap: 12px; padding: 0 32px;
  background: var(--toolbar); backdrop-filter: saturate(180%) blur(24px); -webkit-backdrop-filter: saturate(180%) blur(24px);
  border-bottom: .5px solid var(--hairline);
}
.toolbar .crumb { font-weight: 600; font-size: 14px; color: var(--label-2); }
.content { padding: 28px 40px 64px; width: 100%; max-width: 1360px; margin: 0 auto; animation: fade .35s var(--ease); }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } }

@media (max-width: 960px) {
  .shell { grid-template-columns: 1fr; background: none; }
  .sidebar { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 8px; }
  .brand { padding: 4px 8px; }
  .nav { flex-direction: row; flex-wrap: wrap; }
  .nav-label, .me .who { display: none; }
  .me { margin: 0 0 0 auto; }
  .toolbar { padding: 0 16px; }
  .content { padding: 20px 16px 48px; }
}

/* ---------- Page header ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.page-head h1 { font-size: 30px; line-height: 1.12; font-weight: 700; letter-spacing: -.028em; }
.page-head .sub { color: var(--label-2); font-size: 15px; margin-top: 4px; letter-spacing: -.01em; }
.eyebrow { font-size: 13px; font-weight: 600; color: var(--label-3); margin-bottom: 4px; }
.section-title { font-size: 20px; font-weight: 700; letter-spacing: -.02em; margin: 8px 0 12px; }
.group-label { font-size: 12.5px; font-weight: 500; color: var(--label-2); padding: 0 16px 6px; text-transform: uppercase; letter-spacing: .02em; }
.group-foot { font-size: 12.5px; color: var(--label-3); padding: 8px 16px 0; line-height: 1.45; }

/* ---------- Cards ---------- */
.card { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-card); padding: 20px; min-width: 0; }
.card.flush { padding: 0; overflow: hidden; }
.card.pad-lg { padding: 28px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-head h2, .card-title { font-size: 17px; font-weight: 600; letter-spacing: -.02em; }
.card-head .aside { font-size: 13px; color: var(--label-3); }
.card-head a { font-size: 13px; font-weight: 500; }

/* Stat tiles */
.stat { display: flex; flex-direction: column; gap: 6px; }
.stat .lbl { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 500; color: var(--label-2); }
.stat .ico { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; color: #fff; }
.stat .ico svg { width: 16px; height: 16px; }
.stat .val { font-size: 30px; font-weight: 700; letter-spacing: -.03em; font-variant-numeric: tabular-nums; line-height: 1.1; margin-top: 4px; }
.stat .foot { font-size: 12.5px; color: var(--label-3); }
.ico.blue { background: linear-gradient(180deg, #3d9bff, #0071e3); }
.ico.green { background: linear-gradient(180deg, #4cd964, #28a745); }
.ico.orange { background: linear-gradient(180deg, #ffb340, #ff9500); }
.ico.purple { background: linear-gradient(180deg, #d27cf5, #af52de); }
.ico.red { background: linear-gradient(180deg, #ff6b61, #ff3b30); }
.ico.indigo { background: linear-gradient(180deg, #7a78ff, #5856d6); }
.ico.teal { background: linear-gradient(180deg, #5ac8e0, #30b0c7); }
.ico.gray { background: linear-gradient(180deg, #a1a1a6, #8e8e93); }

/* ---------- Grouped lists (Settings style) ---------- */
.list { background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow-card); overflow: hidden; }
.list .item { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 8px 16px; position: relative; }
.list .item + .item::before { content: ""; position: absolute; top: 0; left: 16px; right: 0; height: .5px; background: var(--hairline); }
.list .item.indent + .item.indent::before { left: 56px; }
.list .item.link { cursor: pointer; }
.list .item.link:hover { background: var(--fill-2); }
.list .item .title { font-size: 14px; font-weight: 500; }
.list .item .detail { color: var(--label-2); font-size: 13px; }
.list .item .chev { color: var(--label-4); width: 14px; height: 14px; }
.list .item .ico { width: 30px; height: 30px; border-radius: 7px; display: grid; place-items: center; color: #fff; }
.list .item .ico svg { width: 17px; height: 17px; }
.list .empty { padding: 28px 16px; }

/* ---------- Buttons ---------- */
button { font: inherit; }
.btn {
  -webkit-appearance: none; appearance: none; border: 0; cursor: pointer; font: inherit; font-size: 13.5px; font-weight: 500;
  height: 32px; padding: 0 14px; border-radius: 980px; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--fill); color: var(--label); white-space: nowrap; letter-spacing: -.01em;
  transition: background .15s, transform .1s, box-shadow .15s, opacity .15s; text-decoration: none !important;
}
.btn svg { width: 16px; height: 16px; }
.btn:hover { background: var(--fill-hover); }
.btn:active { transform: scale(.97); }
.btn:focus-visible { outline: none; box-shadow: var(--ring); }
.btn:disabled { opacity: .4; cursor: default; transform: none; }
.btn.primary { background: var(--blue); color: #fff; }
.btn.primary:hover { background: var(--blue-hover); }
.btn.go { background: var(--green-2); color: #fff; }
.btn.go:hover { filter: brightness(1.06); }
.btn.tinted { background: var(--blue-t); color: var(--blue); }
.btn.tinted:hover { background: rgba(0, 113, 227, .16); }
.btn.destructive { background: var(--red-t); color: var(--red); }
.btn.destructive:hover { background: rgba(255, 59, 48, .18); }
.btn.destructive.filled { background: var(--red); color: #fff; }
.btn.plain { background: transparent; color: var(--blue); padding: 0 8px; }
.btn.plain:hover { background: var(--blue-t); }
.btn.plain.danger { color: var(--red); }
.btn.plain.danger:hover { background: var(--red-t); }
.btn.sm { height: 28px; padding: 0 12px; font-size: 12.5px; }
.btn.lg { height: 44px; padding: 0 22px; font-size: 15px; font-weight: 600; }
.btn.xl { height: 52px; padding: 0 28px; font-size: 16px; font-weight: 600; }
.btn.block { width: 100%; }
.btn.icon { width: 32px; padding: 0; }
.btn.icon.sm { width: 28px; }
.btn.icon.lg { width: 44px; }

/* ---------- Form controls ---------- */
label, .lbl-sm { display: block; font-size: 12px; font-weight: 500; color: var(--label-2); margin: 0 0 6px 2px; }
input, select, textarea {
  font: inherit; font-size: 14px; width: 100%; color: var(--label); background: var(--fill-2);
  border: .5px solid transparent; border-radius: 10px; padding: 0 12px; height: 36px; outline: none;
  transition: background .15s, box-shadow .15s, border-color .15s;
}
textarea { height: auto; min-height: 84px; padding: 10px 12px; resize: vertical; line-height: 1.45; }
input::placeholder, textarea::placeholder { color: var(--label-4); }
input:hover, select:hover, textarea:hover { background: var(--fill); }
input:focus, select:focus, textarea:focus { background: var(--surface); border-color: var(--blue); box-shadow: var(--ring); }
input:disabled { color: var(--label-3); }
select {
  -webkit-appearance: none; appearance: none; padding-right: 32px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='14' viewBox='0 0 10 14'%3E%3Cpath d='M1.5 5 5 1.5 8.5 5M1.5 9 5 12.5 8.5 9' fill='none' stroke='%238e8e93' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
input[type=checkbox], input[type=radio] { width: auto; height: auto; }
input[type=date], input[type=datetime-local] { padding-right: 8px; }
input[type=file] { height: auto; padding: 18px; border: 1.5px dashed var(--hairline-strong); background: var(--fill-2); cursor: pointer; }
.field { min-width: 0; }
.search { position: relative; }
.search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--label-3); width: 15px; height: 15px; pointer-events: none; }
.search input { padding-left: 34px; }

/* iOS-style switch */
.switch {
  -webkit-appearance: none; appearance: none; position: relative; flex: none; cursor: pointer;
  width: 42px !important; height: 26px !important; border-radius: 26px; background: var(--fill-hover); border: 0; padding: 0;
  transition: background .25s var(--ease);
}
.switch::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 22px; height: 22px; border-radius: 50%; background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .18), 0 0 0 .5px rgba(0, 0, 0, .04); transition: transform .25s var(--ease);
}
.switch:checked { background: var(--green-2); }
.switch:checked::after { transform: translateX(16px); }
.switch:focus-visible { box-shadow: var(--ring); }
.switch.sm { width: 36px !important; height: 22px !important; }
.switch.sm::after { width: 18px; height: 18px; }
.switch.sm:checked::after { transform: translateX(14px); }

/* Round checkbox */
.check { -webkit-appearance: none; appearance: none; width: 20px !important; height: 20px !important; border-radius: 50%;
  border: 1.5px solid var(--label-4); background: transparent; cursor: pointer; display: inline-grid; place-items: center; padding: 0; flex: none; }
.check:checked { background: var(--blue); border-color: var(--blue); }
.check:checked::after { content: ""; width: 5px; height: 9px; border: solid #fff; border-width: 0 2px 2px 0; transform: translateY(-1px) rotate(45deg); }

/* Segmented control */
.seg { display: inline-flex; background: var(--fill); border-radius: 9px; padding: 2px; gap: 2px; }
.seg button { border: 0; background: transparent; color: var(--label); font-size: 13px; font-weight: 500; height: 28px; padding: 0 14px; border-radius: 7px; cursor: pointer; white-space: nowrap; }
.seg button.on { background: var(--surface); box-shadow: 0 1px 3px rgba(0, 0, 0, .12), 0 0 0 .5px rgba(0, 0, 0, .04); font-weight: 600; }
@media (prefers-color-scheme: dark) { .seg button.on { background: #636366; } }

/* Filter chips */
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 0; cursor: pointer; font-size: 13px; font-weight: 500; height: 30px; padding: 0 12px; border-radius: 980px; background: var(--fill-2); color: var(--label); display: inline-flex; align-items: center; gap: 6px; }
.chip:hover { background: var(--fill); }
.chip .n { color: var(--label-3); font-weight: 500; font-variant-numeric: tabular-nums; }
.chip.on { background: var(--label); color: var(--surface); }
.chip.on .n { color: inherit; opacity: .6; }

/* ---------- Tags / badges ---------- */
.tag { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px; border-radius: 980px; font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--gray-t); color: var(--label-2); letter-spacing: -.005em; }
.tag svg { width: 12px; height: 12px; }
.tag.blue { background: var(--blue-t); color: var(--blue-ink); }
.tag.green { background: var(--green-t); color: var(--green-ink); }
.tag.orange { background: var(--orange-t); color: var(--orange-ink); }
.tag.red { background: var(--red-t); color: var(--red-ink); }
.tag.purple { background: var(--purple-t); color: var(--purple-ink); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--label-4); display: inline-block; flex: none; }
.dot.green { background: var(--green-2); } .dot.orange { background: var(--orange); } .dot.red { background: var(--red); } .dot.blue { background: var(--blue); }
.dot.pulse { animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; transform: scale(.8); } }

/* Avatar */
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 600; font-size: 13px; flex: none;
  background: linear-gradient(180deg, #a1a1a6, #7c7c80); letter-spacing: 0; }
.avatar.lg { width: 56px; height: 56px; font-size: 21px; }
.avatar.xl { width: 72px; height: 72px; font-size: 26px; }
.avatar.c0 { background: linear-gradient(180deg, #5ac8fa, #0a84ff); }
.avatar.c1 { background: linear-gradient(180deg, #ffb340, #ff9500); }
.avatar.c2 { background: linear-gradient(180deg, #4cd964, #28a745); }
.avatar.c3 { background: linear-gradient(180deg, #d27cf5, #af52de); }
.avatar.c4 { background: linear-gradient(180deg, #ff6b8b, #ff2d55); }
.avatar.c5 { background: linear-gradient(180deg, #7a78ff, #5856d6); }

/* ---------- Tables ---------- */
.table-card { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-card); overflow: hidden; }
.table-scroll { overflow: auto; }
table { width: 100%; border-collapse: separate; border-spacing: 0; }
th { text-align: left; font-size: 12px; font-weight: 500; color: var(--label-3); padding: 12px 14px 10px; border-bottom: .5px solid var(--hairline); white-space: nowrap; background: var(--surface); position: sticky; top: 0; z-index: 1; }
td { padding: 11px 14px; border-bottom: .5px solid var(--hairline); vertical-align: middle; font-size: 13.5px; }
tr:last-child td { border-bottom: 0; }
th:first-child, td:first-child { padding-left: 20px; }
th:last-child, td:last-child { padding-right: 20px; }
tbody tr { transition: background .12s; }
tr.click { cursor: pointer; }
tr.click:hover td { background: var(--fill-2); }
td .sub { display: block; font-size: 12px; color: var(--label-3); margin-top: 1px; }
td input, td select { height: 30px; font-size: 13px; }
.table-foot { display: flex; align-items: center; justify-content: space-between; padding: 12px 20px; border-top: .5px solid var(--hairline); font-size: 12.5px; color: var(--label-3); }

.empty { padding: 44px 20px; text-align: center; color: var(--label-3); }
.empty .glyph { width: 48px; height: 48px; margin: 0 auto 12px; border-radius: 14px; background: var(--fill-2); display: grid; place-items: center; color: var(--label-3); }
.empty .glyph svg { width: 24px; height: 24px; }
.empty b { display: block; color: var(--label); font-size: 15px; font-weight: 600; margin-bottom: 4px; }

/* Callouts */
.callout { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r); background: var(--blue-t); color: var(--label); font-size: 13px; line-height: 1.45; }
.callout svg { width: 18px; height: 18px; color: var(--blue); margin-top: 1px; }
.callout.warn { background: var(--orange-t); } .callout.warn svg { color: var(--orange); }
.callout.err { background: var(--red-t); } .callout.err svg { color: var(--red); }
.callout.ok { background: var(--green-t); } .callout.ok svg { color: var(--green-2); }

/* ---------- Dialer capsule (toolbar) ---------- */
.island { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.capsule {
  display: inline-flex; align-items: center; gap: 10px; height: 38px; padding: 0 6px 0 14px; border-radius: 980px;
  background: #1d1d1f; color: #f5f5f7; font: inherit; font-size: 13px; font-weight: 500; box-shadow: 0 4px 16px rgba(0, 0, 0, .16); border: 0;
  transition: all .4s var(--ease); max-width: 100%;
}
@media (prefers-color-scheme: dark) { .capsule { background: #2c2c2e; box-shadow: 0 0 0 .5px rgba(255,255,255,.1); } }
.capsule .state { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.capsule .lines { display: inline-flex; gap: 4px; }
.capsule .ln { width: 6px; height: 16px; border-radius: 3px; background: rgba(255, 255, 255, .22); }
.capsule .ln.ringing, .capsule .ln.initiated, .capsule .ln.queued, .capsule .ln.dialing { background: var(--orange); animation: pulse 1s infinite; }
.capsule .ln.connected, .capsule .ln.in-progress { background: var(--green-2); }
.capsule .ln.abandoned, .capsule .ln.failed { background: var(--red); }
.capsule .cbtn { width: 28px; height: 28px; border-radius: 50%; border: 0; cursor: pointer; display: grid; place-items: center; background: rgba(255, 255, 255, .14); color: #fff; transition: background .15s, transform .1s; }
.capsule .cbtn:hover { background: rgba(255, 255, 255, .24); }
.capsule .cbtn:active { transform: scale(.92); }
.capsule .cbtn svg { width: 15px; height: 15px; }
.capsule .cbtn.red { background: var(--red); }
.capsule .cbtn.green { background: var(--green-2); }
.capsule .cbtn.on { background: #fff; color: #1d1d1f; }
.capsule .sep { width: .5px; height: 18px; background: rgba(255, 255, 255, .2); }
.capsule .txt-btn { border: 0; background: rgba(255,255,255,.14); color: #fff; height: 28px; padding: 0 12px; border-radius: 980px; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.capsule .txt-btn:hover { background: rgba(255,255,255,.24); }
.capsule.idle { background: var(--green-2); padding: 0 16px; cursor: pointer; box-shadow: 0 4px 14px rgba(52, 199, 89, .35); }
.capsule.idle:hover { filter: brightness(1.05); }
.capsule.idle svg { width: 15px; height: 15px; }

/* Line strip under toolbar */
.linestrip { display: flex; gap: 8px; flex-wrap: wrap; }
.line-pill { display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 12px 0 10px; border-radius: 980px; background: var(--surface); box-shadow: var(--shadow-card); font-size: 12.5px; max-width: 240px; }
.line-pill .n { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.line-pill .s { color: var(--label-3); text-transform: capitalize; }

/* ---------- Client screen ---------- */
.client-head { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin-bottom: 24px; }
.client-head h1 { font-size: 28px; font-weight: 700; letter-spacing: -.028em; line-height: 1.15; }
.client-head .meta { display: flex; gap: 6px 14px; flex-wrap: wrap; margin-top: 6px; color: var(--label-2); font-size: 13.5px; }
.client-head .meta span { display: inline-flex; align-items: center; gap: 5px; }
.client-head .meta svg { width: 14px; height: 14px; color: var(--label-3); }
.client-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 24px; align-items: start; }
@media (max-width: 1240px) { .client-grid { grid-template-columns: 1fr; } }
.sticky-col { position: sticky; top: 84px; }
@media (max-width: 1240px) { .sticky-col { position: static; } }

.oncall {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 14px 16px 14px 20px; margin-bottom: 20px;
  border-radius: var(--r-xl); color: #fff; background: #1d1d1f; box-shadow: 0 10px 30px rgba(0,0,0,.18);
  animation: rise .5s var(--ease);
}
@keyframes rise { from { opacity: 0; transform: translateY(-8px) scale(.98); } }
.oncall .t { font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.oncall .who { color: rgba(255,255,255,.6); font-size: 13px; }
.oncall .ctl { display: flex; gap: 10px; margin-left: auto; }
.oncall .round { width: 44px; height: 44px; border-radius: 50%; border: 0; cursor: pointer; display: grid; place-items: center; color: #fff; background: rgba(255,255,255,.14); transition: background .15s, transform .1s; }
.oncall .round:hover { background: rgba(255,255,255,.22); }
.oncall .round:active { transform: scale(.93); }
.oncall .round.on { background: #fff; color: #1d1d1f; }
.oncall .round.end { background: var(--red); }
.oncall .round svg { width: 20px; height: 20px; }

.form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 12px; }
@media (max-width: 720px) { .form-grid { grid-template-columns: 1fr 1fr; } }
.saved { font-size: 12px; color: var(--label-3); transition: opacity .3s; }

.hq-cat { font-size: 12.5px; font-weight: 500; color: var(--label-2); text-transform: uppercase; letter-spacing: .02em; padding: 16px 16px 6px; }
.hq-cat:first-child { padding-top: 4px; }
.hq { display: flex; align-items: center; gap: 14px; padding: 7px 16px; min-height: 42px; position: relative; cursor: pointer; font-size: 13.5px; }
.hq + .hq::before { content: ""; position: absolute; top: 0; left: 16px; right: 0; height: .5px; background: var(--hairline); }
.hq:hover { background: var(--fill-2); }
.hq span { flex: 1; }
.hq.on span { font-weight: 500; }
.hq-group { background: var(--surface-2); border-radius: var(--r); overflow: hidden; box-shadow: inset 0 0 0 .5px var(--hairline); }
@media (prefers-color-scheme: dark) { .hq-group { background: var(--elevated); } }

.fit { display: flex; gap: 14px; padding: 14px 16px; border-radius: var(--r); background: var(--surface-2); box-shadow: inset 0 0 0 .5px var(--hairline); transition: box-shadow .2s, opacity .2s; }
@media (prefers-color-scheme: dark) { .fit { background: var(--elevated); } }
.fit.best { box-shadow: inset 0 0 0 1.5px var(--green-2), 0 6px 20px rgba(52, 199, 89, .12); }
.fit.out { opacity: .55; }
.fit .rank { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 13px; background: var(--fill); color: var(--label-2); flex: none; font-variant-numeric: tabular-nums; }
.fit.best .rank { background: var(--green-2); color: #fff; }
.fit .name { font-weight: 600; font-size: 14.5px; letter-spacing: -.01em; }
.fit .prod { font-size: 13px; color: var(--label-2); }
.fit ul { margin: 8px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 3px; }
.fit li { font-size: 12.5px; color: var(--label-3); display: flex; gap: 6px; }
.fit li::before { content: "·"; }

.secret { display: flex; gap: 6px; }
.secret input { font-family: "SF Mono", ui-monospace, Menlo, Consolas, monospace; letter-spacing: .04em; }

.timeline { display: flex; flex-direction: column; max-height: 420px; overflow: auto; margin: 0 -4px; padding: 0 4px; }
.tl { display: flex; gap: 12px; padding: 10px 0; position: relative; }
.tl + .tl { border-top: .5px solid var(--hairline); }
.tl .ic { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--fill-2); color: var(--label-2); flex: none; }
.tl .ic svg { width: 14px; height: 14px; }
.tl .ic.note { background: var(--blue-t); color: var(--blue); }
.tl .meta { font-size: 12px; color: var(--label-3); }
.tl .body { font-size: 13.5px; white-space: pre-wrap; word-break: break-word; }
.composer { display: flex; gap: 8px; align-items: flex-end; background: var(--fill-2); border-radius: 14px; padding: 6px 6px 6px 12px; }
.composer textarea { background: transparent !important; box-shadow: none !important; border: 0 !important; min-height: 24px; height: 36px; padding: 8px 0; resize: none; }

/* ---------- Sheets (modals) ---------- */
.sheet-bg { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px;
  background: rgba(0, 0, 0, .28); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); animation: bgin .25s ease; }
@keyframes bgin { from { opacity: 0; } }
.sheet { width: min(560px, 100%); max-height: calc(100vh - 40px); overflow: auto; background: var(--elevated); border-radius: var(--r-xl); box-shadow: var(--shadow-pop);
  animation: sheetin .45s var(--ease); }
@keyframes sheetin { from { opacity: 0; transform: translateY(16px) scale(.97); } }
.sheet.wide { width: min(880px, 100%); }
.sheet-head { display: flex; align-items: center; gap: 12px; padding: 20px 20px 4px 24px; }
.sheet-head h2 { font-size: 20px; font-weight: 700; letter-spacing: -.024em; flex: 1; }
.sheet-head .x { width: 30px; height: 30px; border-radius: 50%; border: 0; background: var(--fill); color: var(--label-2); cursor: pointer; display: grid; place-items: center; }
.sheet-head .x:hover { background: var(--fill-hover); }
.sheet-head .x svg { width: 13px; height: 13px; }
.sheet-sub { padding: 0 24px; color: var(--label-2); font-size: 13.5px; }
.sheet-body { padding: 18px 24px 8px; }
.sheet-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 24px 20px; position: sticky; bottom: 0; background: var(--elevated); border-radius: 0 0 var(--r-xl) var(--r-xl); }
.sheet-foot .left { margin-right: auto; }

.dispo-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 720px) { .dispo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.dispo { border: 0; cursor: pointer; border-radius: 14px; padding: 14px 12px; min-height: 76px; text-align: left; background: var(--fill-2); color: var(--label);
  display: flex; flex-direction: column; gap: 8px; font-size: 13.5px; font-weight: 600; transition: background .15s, box-shadow .15s, transform .1s; }
.dispo:hover { background: var(--fill); }
.dispo:active { transform: scale(.98); }
.dispo svg { width: 20px; height: 20px; }
.dispo.sel { background: var(--blue-t); box-shadow: inset 0 0 0 2px var(--blue); }
.dispo.good svg { color: var(--green-2); } .dispo.warn svg { color: var(--orange); } .dispo.bad svg { color: var(--red); } .dispo.neutral svg { color: var(--label-3); } .dispo.info svg { color: var(--blue); }

.keypad { display: grid; grid-template-columns: repeat(3, 72px); gap: 14px; justify-content: center; padding: 8px 0 4px; }
.keypad button { width: 72px; height: 72px; border-radius: 50%; border: 0; background: var(--fill); color: var(--label); font-size: 28px; font-weight: 400; cursor: pointer; }
.keypad button:hover { background: var(--fill-hover); }
.keypad button:active { background: var(--label-4); }

/* ---------- Toasts (HUD) ---------- */
#toasts { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.toast { display: inline-flex; align-items: center; gap: 10px; max-width: min(520px, 92vw); padding: 10px 18px 10px 14px; border-radius: 980px; font-size: 13.5px; font-weight: 500;
  color: var(--label); background: var(--elevated); box-shadow: var(--shadow-pop); animation: toastin .5s var(--ease); pointer-events: auto; }
.toast svg { width: 18px; height: 18px; color: var(--blue); }
.toast.ok svg { color: var(--green-2); } .toast.err svg { color: var(--red); }
.toast.out { opacity: 0; transform: translateY(-10px); transition: all .3s ease; }
@keyframes toastin { from { opacity: 0; transform: translateY(-14px) scale(.96); } }

/* ---------- Auth ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--bg); }
.auth-card { width: min(400px, 100%); text-align: center; animation: fade .5s var(--ease); }
.auth-card h1 { font-size: 28px; font-weight: 700; letter-spacing: -.028em; margin: 20px 0 6px; }
.auth-card p.sub { color: var(--label-2); font-size: 15px; margin-bottom: 28px; }
.joined { background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow-card); overflow: hidden; text-align: left; margin-bottom: 16px; }
.joined input { background: transparent; border-radius: 0; height: 50px; font-size: 15px; padding: 0 16px; border: 0; }
.joined input:focus { box-shadow: none; background: var(--fill-2); }
.joined input + input { border-top: .5px solid var(--hairline); }
.auth-foot { margin-top: 28px; font-size: 12px; color: var(--label-3); }

/* Hero (dashboard) */
.hero { position: relative; overflow: hidden; border-radius: var(--r-xl); padding: 28px 32px; color: #fff; display: flex; align-items: center; gap: 24px; flex-wrap: wrap;
  background: radial-gradient(120% 140% at 0% 0%, #2d8cff 0%, #0058d0 45%, #3b2bb5 100%); box-shadow: 0 16px 40px rgba(0, 80, 200, .22); }
.hero h2 { font-size: 24px; font-weight: 700; letter-spacing: -.024em; }
.hero p { color: rgba(255, 255, 255, .78); font-size: 14.5px; margin-top: 4px; max-width: 520px; }
.hero .btn { background: #fff; color: #0058d0; }
.hero .btn:hover { background: rgba(255,255,255,.9); }
.hero .glow { position: absolute; right: -60px; top: -80px; width: 320px; height: 320px; border-radius: 50%; background: radial-gradient(closest-side, rgba(255,255,255,.22), transparent); pointer-events: none; }

/* Billing plan card */
.plan { text-align: center; padding: 36px 28px; }
.plan .price { font-size: 44px; font-weight: 700; letter-spacing: -.035em; font-variant-numeric: tabular-nums; }
.plan .price small { font-size: 17px; font-weight: 500; color: var(--label-3); letter-spacing: -.01em; }
.plan ul { list-style: none; padding: 0; margin: 22px auto; text-align: left; max-width: 320px; display: flex; flex-direction: column; gap: 10px; }
.plan li { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; }
.plan li svg { color: var(--green-2); width: 18px; height: 18px; margin-top: 1px; }

/* UW outcome select tints */
.uw-select { width: 190px; font-weight: 500; }
.o-level { background-color: var(--green-t) !important; color: var(--green-ink); }
.o-graded { background-color: var(--orange-t) !important; color: var(--orange-ink); }
.o-gi { background-color: var(--purple-t) !important; color: var(--purple-ink); }
.o-review { color: var(--label-2); }
.o-decline { background-color: var(--red-t) !important; color: var(--red-ink); }

.kbd { font-family: inherit; font-size: 11px; font-weight: 600; padding: 1px 6px; border-radius: 5px; background: var(--fill); color: var(--label-2); }
.divider { height: .5px; background: var(--hairline); margin: 16px 0; }
.credential { font-family: "SF Mono", ui-monospace, Menlo, Consolas, monospace; background: var(--fill-2); border-radius: var(--r); padding: 14px 16px; line-height: 1.8; font-size: 13.5px; }

/* Row call button */
.call-btn { width: 32px; height: 32px; box-shadow: 0 2px 8px rgba(52, 199, 89, .3); }
.call-btn:disabled { box-shadow: none; background: var(--fill); color: var(--label-3); }
tr .call-btn { opacity: .9; }
tr:hover .call-btn:not(:disabled) { opacity: 1; transform: scale(1.06); }

/* ---------- Messages ---------- */
.nav a .badge-n { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--red); color: #fff; font-size: 11.5px; font-weight: 700; display: inline-grid; place-items: center; font-variant-numeric: tabular-nums; }
.msg-shell { display: grid; grid-template-columns: 340px minmax(0, 1fr); height: calc(100vh - 60px - 150px); min-height: 480px; background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-card); overflow: hidden; }
@media (max-width: 900px) { .msg-shell { grid-template-columns: 1fr; height: auto; } }
.convs { border-right: .5px solid var(--hairline); display: flex; flex-direction: column; min-height: 0; }
.convs .top { padding: 14px; border-bottom: .5px solid var(--hairline); }
.convs .scroll { overflow: auto; flex: 1; }
.conv { display: flex; gap: 12px; padding: 12px 14px; cursor: pointer; position: relative; align-items: center; }
.conv + .conv::before { content: ""; position: absolute; top: 0; left: 62px; right: 0; height: .5px; background: var(--hairline); }
.conv:hover { background: var(--fill-2); }
.conv.on { background: var(--blue); color: #fff; }
.conv.on .when, .conv.on .snip { color: rgba(255,255,255,.8); }
.conv.on::before, .conv.on + .conv::before { display: none; }
.conv .nm { font-weight: 600; font-size: 14px; }
.conv .when { font-size: 12px; color: var(--label-3); margin-left: auto; white-space: nowrap; }
.conv .snip { font-size: 13px; color: var(--label-2); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.35; }
.conv .unread { position: absolute; left: 4px; top: 50%; transform: translateY(-50%); width: 8px; height: 8px; border-radius: 50%; background: var(--blue); }
.conv.on .unread { background: #fff; }

.thread { display: flex; flex-direction: column; min-height: 0; }
.thread-head { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: .5px solid var(--hairline); }
.thread-head .nm { font-weight: 600; font-size: 15px; }
.bubbles { flex: 1; overflow: auto; padding: 18px 18px 8px; display: flex; flex-direction: column; gap: 3px; }
.bubbles.compact { max-height: 380px; padding: 6px 2px; }
.day-sep { text-align: center; font-size: 11.5px; color: var(--label-3); font-weight: 500; margin: 14px 0 8px; }
.bubble { max-width: 72%; padding: 8px 13px; border-radius: 19px; font-size: 14.5px; line-height: 1.35; white-space: pre-wrap; word-wrap: break-word; position: relative; letter-spacing: -.01em; }
.bubble.out { align-self: flex-end; background: var(--green-2); color: #fff; border-bottom-right-radius: 6px; }
.bubble.out.auto { background: #30c14e; }
.bubble.in { align-self: flex-start; background: #e9e9eb; color: #000; border-bottom-left-radius: 6px; }
@media (prefers-color-scheme: dark) { .bubble.in { background: #3a3a3c; color: #fff; } }
.bubble.failed { background: var(--red-t) !important; color: var(--red-ink) !important; }
.bubble + .bubble.out, .bubble + .bubble.in { margin-top: 2px; }
.bubble.in + .bubble.out, .bubble.out + .bubble.in { margin-top: 10px; }
.bmeta { font-size: 11px; color: var(--label-3); margin: 2px 6px 4px; }
.bmeta.r { align-self: flex-end; }
.bmeta.l { align-self: flex-start; }
.composer-bar { display: flex; gap: 8px; align-items: flex-end; padding: 10px 14px 14px; border-top: .5px solid var(--hairline); }
.composer-bar textarea { border-radius: 18px; min-height: 36px; height: 36px; padding: 8px 14px; resize: none; background: var(--fill-2); }
.send-btn { width: 32px; height: 32px; border-radius: 50%; border: 0; background: var(--green-2); color: #fff; display: grid; place-items: center; cursor: pointer; flex: none; margin-bottom: 2px; }
.send-btn:disabled { background: var(--fill-hover); cursor: default; }
.send-btn svg { width: 16px; height: 16px; }
.var-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.var-chips button { border: 0; background: var(--blue-t); color: var(--blue); font-size: 12px; font-weight: 600; height: 24px; padding: 0 10px; border-radius: 980px; cursor: pointer; font-family: inherit; }
.step-card { background: var(--fill-2); border-radius: var(--r); padding: 14px; }
.step-num { width: 26px; height: 26px; border-radius: 50%; background: var(--green-2); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 12.5px; flex: none; }
.seq-timeline { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.seq-timeline .d { font-size: 12px; font-weight: 600; background: var(--fill); padding: 3px 9px; border-radius: 980px; color: var(--label-2); }
.seq-timeline .ar { color: var(--label-4); font-size: 12px; }
