:root {
  color-scheme: dark;
  --bg: #102033;
  --rail: #0c1a2b;
  --surface: #173049;
  --elevated: #1e3a56;
  --ink: #e8eef6;
  --muted: #96a9c2;
  --line: rgba(186, 210, 236, 0.16);
  --hover: rgba(186, 210, 236, 0.09);
  --current: rgba(186, 210, 236, 0.16);
  --accent: #e8eef6;
  --accent-ink: #102033;
  --warn: #f0b4ac;
  --shadow: 0 0 0 1px rgba(186, 210, 236, 0.14);
}

* { box-sizing: border-box; }

html { background: var(--bg); }

body {
  margin: 0;
  min-height: 100vh;
  font: 15px/1.5 ui-sans-serif, -apple-system, "Segoe UI", system-ui, sans-serif;
  letter-spacing: -0.011em;
  background: var(--bg);
  color: var(--ink);
}

a { color: inherit; }

button, input, select, textarea { font: inherit; color: inherit; }

:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.rail {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  width: 15rem;
  height: 100vh;
  position: sticky;
  top: 0;
  padding: 0.9rem 0.75rem 0.85rem;
  background: var(--rail);
  border-right: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin: 0.15rem 0.35rem 0.7rem;
  color: inherit;
  text-decoration: none;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.mark {
  display: grid;
  place-items: center;
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 999px;
  background: var(--ink);
  color: var(--accent-ink);
  font-size: 0.85rem;
}

.rail nav, .subnav {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.rail nav a, .subnav a {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.48rem 0.7rem;
  border-radius: 10px;
  color: var(--muted);
  text-decoration: none;
}

.rail nav a:hover, .subnav a:hover { background: var(--hover); color: var(--ink); }

.rail nav a[aria-current="page"], .subnav a[aria-current="page"] {
  background: var(--current);
  color: var(--ink);
  font-weight: 560;
}

.rail svg {
  width: 1.05rem;
  height: 1.05rem;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.rail-foot { margin-top: auto; }

.rail-foot button, button.wide { width: 100%; }

body.shell, body.chat-app {
  display: grid;
  grid-template-columns: 15rem minmax(0, 1fr);
}

main { min-width: 0; }

.notice {
  position: fixed;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 7;
  margin: 0;
  max-width: min(28rem, calc(100% - 2rem));
  background: var(--ink);
  color: var(--accent-ink);
  box-shadow: 0 12px 32px rgba(6, 14, 28, 0.35);
  border-radius: 999px;
  padding: 0.65rem 1rem;
}

.error, .banner {
  margin: 0.85rem 0 0;
  background: var(--surface);
  box-shadow: var(--shadow);
  border-radius: 12px;
  padding: 0.7rem 0.85rem;
}

.error { color: var(--warn); }

.page {
  width: auto;
  margin: 0;
  padding: 1.4rem 1.75rem 3rem;
}

.workspace {
  display: grid;
  grid-template-columns: 12rem minmax(0, 40rem);
  gap: 2.25rem;
  align-items: start;
  padding: 1.6rem 2rem 3.5rem;
}

.subnav { position: sticky; top: 1.25rem; }

.subnav-label {
  margin: 0.2rem 0.7rem 0.45rem;
  color: var(--muted);
  font-size: 0.8rem;
}

.pane-head { margin-bottom: 1.25rem; }

h1, h2 { font-weight: 600; letter-spacing: -0.03em; }

h1 { font-size: 1.45rem; margin: 0 0 0.4rem; }

h2 { font-size: 1rem; margin: 1.4rem 0 0.7rem; }

.pane-head h1 { margin-bottom: 0.35rem; }

.card, .panel {
  background: var(--surface);
  box-shadow: var(--shadow);
  border-radius: 16px;
  padding: 1.05rem 1.15rem 1.2rem;
  margin-bottom: 0.9rem;
}

.narrow { width: min(24rem, 100%); }

body.bare {
  display: grid;
  place-items: center;
  min-height: 100vh;
}

body.bare main { width: min(24rem, calc(100% - 2rem)); }

body.chat-app { height: 100vh; overflow: hidden; }

body.chat-app main {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

.chat-row {
  display: flex;
  flex: 1;
  min-height: 0;
}

.sidebar {
  width: 17.5rem;
  flex: none;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  padding: 0.9rem 0.75rem;
  border-right: 1px solid var(--line);
  background: var(--bg);
  min-height: 0;
}

.thread-list {
  list-style: none;
  padding: 0;
  margin: 0;
  overflow: auto;
}

.thread-list li { padding: 0; }

.thread-list a {
  display: block;
  padding: 0.55rem 0.7rem;
  border-radius: 10px;
  color: inherit;
  text-decoration: none;
  font-weight: 550;
}

.thread-list a:hover,
.thread-list a[aria-current="page"] { background: var(--hover); }

.chat-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: auto;
  padding: 1.25rem 1.75rem 1.5rem;
  min-width: 0;
}

.hero {
  max-width: 36rem;
  margin: 18vh auto 0;
  text-align: center;
}

.hero h1 { font-size: 1.8rem; }

.thread { width: 100%; max-width: none; margin: 0; padding-bottom: 1rem; }

.thread-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.thread-head h1 { margin: 0; }

.thread-menu { position: relative; flex: none; }

.thread-menu summary {
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 999px;
  color: var(--muted);
  cursor: pointer;
  list-style: none;
}

.thread-menu summary::-webkit-details-marker { display: none; }

.thread-menu summary:hover,
.thread-menu[open] summary {
  background: var(--hover);
  color: var(--ink);
}

.thread-menu summary svg {
  width: 1.15rem;
  height: 1.15rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.menu-panel {
  position: absolute;
  top: calc(100% + 0.35rem);
  right: 0;
  z-index: 4;
  width: 15.5rem;
  padding: 0.8rem;
  border-radius: 16px;
  background: var(--surface);
  box-shadow: 0 16px 40px rgba(6, 14, 28, 0.4), var(--shadow);
}

.menu-label {
  margin: 0 0 0.4rem;
  color: var(--muted);
  font-size: 0.78rem;
}

.segment {
  display: flex;
  gap: 0.15rem;
  padding: 0.18rem;
  border-radius: 999px;
  background: var(--elevated);
}

.segment button {
  flex: 1;
  background: transparent;
  color: var(--muted);
  box-shadow: none;
  border-radius: 999px;
  padding: 0.32rem 0.35rem;
  font-size: 0.82rem;
  text-transform: capitalize;
}

.segment button.on,
.segment button:hover {
  background: var(--ink);
  color: var(--accent-ink);
  filter: none;
}

.menu-panel form + form { margin-top: 0.2rem; }

.menu-panel form:has(.segment) + form {
  margin-top: 0.7rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--line);
}

.menu-row {
  display: flex;
  width: 100%;
  justify-content: flex-start;
  background: transparent;
  color: var(--ink);
  box-shadow: none;
  border-radius: 10px;
  padding: 0.45rem 0.55rem;
  font-weight: 500;
}

.menu-row:hover { background: var(--hover); filter: none; }

.menu-row.danger { color: var(--warn); box-shadow: none; }

.composer {
  position: sticky;
  bottom: 0.4rem;
  display: flex;
  align-items: flex-end;
  gap: 0.55rem;
  margin-top: 1.25rem;
  padding: 0.55rem 0.55rem 0.55rem 0.85rem;
  border-radius: 22px;
  background: var(--elevated);
  box-shadow: var(--shadow);
}

.composer textarea {
  flex: 1;
  background: transparent;
  box-shadow: none;
  min-height: 2.5rem;
  padding: 0.45rem 0.1rem;
}

.composer button { margin-bottom: 0.1rem; }

#transcript { max-height: 16rem; overflow: auto; }

.stack, .row { display: flex; gap: 0.75rem; }

.stack { flex-direction: column; align-items: stretch; }

.row { flex-wrap: wrap; align-items: end; }

label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.92rem;
  color: var(--muted);
}

.check { flex-direction: row; align-items: center; color: var(--ink); }

input, select, textarea {
  background: var(--elevated);
  border: 0;
  box-shadow: var(--shadow);
  border-radius: 12px;
  padding: 0.62rem 0.75rem;
}

textarea { width: 100%; resize: vertical; }

button {
  background: var(--accent);
  color: var(--accent-ink);
  border: 0;
  border-radius: 999px;
  padding: 0.5rem 0.95rem;
  font-weight: 560;
  cursor: pointer;
}

button:hover { filter: brightness(0.92); }

button.quiet, button.danger {
  background: transparent;
  color: var(--ink);
  box-shadow: var(--shadow);
}

button.danger { color: var(--warn); }

#people-search { width: min(24rem, 100%); margin: 0 0 1rem; }

.directory {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr));
  gap: 0.85rem;
  margin-bottom: 1.25rem;
}

.name-card {
  display: flex;
  align-items: center;
  gap: 0.95rem;
  min-height: 6.75rem;
  padding: 1rem 1.1rem;
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow);
  color: inherit;
  text-decoration: none;
}

.name-card:hover { background: var(--elevated); }

.monogram {
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  flex: none;
  border-radius: 999px;
  background: var(--elevated);
  font-size: 1.15rem;
  font-weight: 600;
}

.name-card:hover .monogram { background: var(--surface); }

.who { display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; }

.name {
  font-size: 1.28rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.narrow-form { max-width: 36rem; }

.picker { position: relative; }

.picker-button {
  width: 100%;
  text-align: left;
  background: var(--elevated);
  color: var(--ink);
  box-shadow: var(--shadow);
  border-radius: 12px;
  padding: 0.62rem 2rem 0.62rem 0.75rem;
  font-weight: 500;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 1.1rem) 55%, calc(100% - 0.7rem) 55%;
  background-size: 0.4rem 0.4rem, 0.4rem 0.4rem;
  background-repeat: no-repeat;
}

.picker-button:hover { filter: none; background-color: var(--elevated); }

.picker-panel[hidden],
.voice-results[hidden],
.voice-current[hidden] {
  display: none;
}

.picker-panel {
  position: absolute;
  z-index: 8;
  left: 0;
  right: 0;
  top: calc(100% + 0.35rem);
  max-height: 18rem;
  overflow: auto;
  padding: 0.4rem;
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 16px 40px rgba(6, 14, 28, 0.45), var(--shadow);
}

.picker-search { width: 100%; margin-bottom: 0.35rem; }

.picker-list { display: flex; flex-direction: column; gap: 0.1rem; }

.picker-list button {
  width: 100%;
  text-align: left;
  background: transparent;
  color: var(--ink);
  box-shadow: none;
  border-radius: 8px;
  padding: 0.45rem 0.6rem;
  font-weight: 500;
}

.picker-list button[aria-selected="true"],
.picker-list button:hover { background: var(--hover); filter: none; }

.voice-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.voice-filters > label { flex: 1 1 8.5rem; }

.voice-results {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-top: 0.4rem;
  max-height: 18rem;
  overflow: auto;
}

.voice-row { display: flex; gap: 0.4rem; align-items: center; }

.voice-current { margin-top: 0.45rem; }

.voice-current-label { flex: 1; display: flex; flex-direction: column; gap: 0.1rem; }

.voice-choose {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.1rem;
  text-align: left;
  background: var(--elevated);
  color: var(--ink);
  box-shadow: none;
  border-radius: 12px;
  padding: 0.55rem 0.7rem;
  font-weight: 500;
}

.voice-choose:hover { filter: none; background: var(--hover); }

.voice-row .quiet { flex: none; }

.split {
  display: grid;
  grid-template-columns: minmax(18rem, 26rem) minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}

.split .card > h2:first-child { margin-top: 0; }

.list { list-style: none; padding: 0; margin: 0 0 1rem; }

.list li {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.7rem;
  align-items: center;
  padding: 0.7rem 0;
  border-top: 1px solid var(--line);
}

.meta { color: var(--muted); font-size: 0.86rem; }

.pane .meta a, .page .meta a, .hero a { text-decoration: underline; text-underline-offset: 0.18em; }

.pill {
  display: inline-flex;
  align-items: center;
  padding: 0.05rem 0.45rem;
  border-radius: 999px;
  background: var(--current);
  color: var(--ink);
  font-size: 0.75rem;
}

.messages { list-style: none; padding: 0; margin: 0 0 1rem; }

.messages li {
  max-width: min(64rem, 88%);
  margin: 0.85rem 0;
  padding: 0;
  background: transparent;
}

.messages li.user {
  margin-left: auto;
  padding: 0.7rem 0.9rem;
  border-radius: 18px;
  background: var(--elevated);
}

.messages p { margin: 0.2rem 0; white-space: pre-wrap; }

.choices { display: flex; flex-wrap: wrap; gap: 0.45rem; }

form.row button, form .choices button { align-self: end; }

audio { width: min(100%, 28rem); margin-top: 0.4rem; }

.modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(6, 14, 28, 0.62);
}

.modal[hidden] { display: none; }

.modal-card {
  width: min(24rem, 100%);
  padding: 1.2rem 1.2rem 1.05rem;
  border-radius: 18px;
  background: var(--surface);
  box-shadow: 0 18px 48px rgba(6, 14, 28, 0.45), var(--shadow);
}

.modal-card h2 { margin: 0 0 0.35rem; }

.modal-card .row { margin-top: 1rem; justify-content: flex-end; }

.toast {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  max-width: 22rem;
  background: var(--ink);
  color: var(--accent-ink);
  padding: 0.8rem 1rem;
  border-radius: 14px;
  z-index: 5;
}

.toast a { color: inherit; text-decoration: underline; text-underline-offset: 0.15em; }

@media (max-width: 900px) {
  body.shell, body.chat-app {
    display: block;
    height: auto;
    overflow: auto;
  }

  body.chat-app main { height: auto; }

  .rail {
    position: sticky;
    top: 0;
    z-index: 6;
    width: 100%;
    height: auto;
    flex-direction: row;
    align-items: center;
    overflow: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .brand { margin: 0 0.4rem 0 0; }
  .rail nav { flex-direction: row; }
  .rail-foot { margin: 0 0 0 auto; }
  .rail-foot button { width: auto; white-space: nowrap; }
  .rail nav a span { display: none; }
  .workspace, .page { width: auto; grid-template-columns: 1fr; padding: 1rem; }
  .split { grid-template-columns: 1fr; }
  .subnav { position: static; flex-direction: row; overflow: auto; }
  .subnav a { flex: none; white-space: nowrap; }
  .subnav-label { display: none; }
  .chat-row { flex-direction: column; }
  .sidebar { width: 100%; max-height: 38vh; border-right: 0; border-bottom: 1px solid var(--line); }
  .hero { margin-top: 3rem; }
}

.qr {
  width: 240px;
  height: 240px;
  object-fit: contain;
  background: #fff;
  padding: 12px;
}

/* Conversation workspace */
body { font-size: 16px; }
body.chat-app { background: #0e1b2c; }
.chat-app .rail { background: #091522; }
.chat-app .sidebar { background: #101f31; padding: 1.5rem 1rem; }
.sidebar-heading { padding: 0 .35rem .3rem; }
.sidebar-heading span, .eyebrow { color: #93a9c2; font-size: .75rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; }
.sidebar-heading h2 { margin: .2rem 0 0; font-size: 1.35rem; }
.sidebar .wide { background: #d4e5f4; color: #10243a; border-radius: 10px; text-align: left; padding: .7rem .85rem; }
.sidebar input { background: #192d42; }
.thread-list a { padding: .7rem .8rem; font-size: .94rem; font-weight: 500; }
.thread-list a[aria-current="page"] { background: #27435d; box-shadow: inset 3px 0 #8ccbbf; }
.chat-main { padding: 1.8rem clamp(1rem, 4vw, 4rem) 2rem; gap: 1rem; }
.thread { max-width: 62rem; width: 100%; margin: 0 auto; }
.thread-head { align-items: center; padding: .15rem 0 1.25rem; border-bottom: 1px solid var(--line); }
.thread-head h1 { font-size: 1.55rem; }
.eyebrow { margin: 0 0 .25rem; }
#thread-messages { display: flex; flex-direction: column; gap: 1.2rem; padding: 1.2rem 0; min-height: 5rem; }
#thread-messages li { max-width: min(44rem, 85%); margin: 0; padding: .85rem 1.05rem; background: #1a3046; border: 1px solid rgba(186,210,236,.1); border-radius: 6px 16px 16px 16px; }
#thread-messages li.user { background: #274c60; border-radius: 16px 6px 16px 16px; }
.message-author, .speaker { display: block; margin-bottom: .25rem; color: #a6c7d7; font-size: .76rem; font-weight: 700; letter-spacing: .025em; }
#thread-messages p { line-height: 1.6; overflow-wrap: anywhere; }
#thread-messages .meta { margin-top: .55rem; font-size: .78rem; }
.chat-empty { color: var(--muted); padding: 1rem 0; }
.composer { background: #1c3249; border: 1px solid rgba(186,210,236,.16); border-radius: 16px; box-shadow: 0 12px 35px rgba(0,0,0,.12); }
.composer button { border-radius: 10px; padding: .65rem 1.15rem; }
.live-call { width: 100%; max-width: 62rem; margin: 0 auto; padding: 1.35rem; border: 1px solid #365567; border-radius: 16px; background: #142c3d; box-shadow: 0 12px 32px rgba(2,10,20,.16); }
.live-call[hidden], .transcript-empty[hidden] { display: none; }
.live-call-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.live-badge { display: inline-flex; align-items: center; gap: .45rem; color: #a5e3cb; font-size: .76rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.live-badge span { width: .5rem; height: .5rem; border-radius: 50%; background: #78d7ac; }
.live-call h2 { margin: .3rem 0 .15rem; font-size: 1.2rem; }
.live-subtitle { color: #abc0cc; font-size: .9rem; margin: 0; }
.listen-control { display: flex; flex-direction: column; align-items: center; gap: .3rem; }
.listen-control button { white-space: nowrap; background: #d4eee6; color: #12382f; border-radius: 10px; padding: .65rem .9rem; }
.listen-control button[aria-pressed="true"] { background: #31574f; color: #e1fff1; }
#listen-status { color: #aec6cb; font-size: .76rem; text-align: center; }
.transcript-header { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-top: 1.3rem; padding-top: 1rem; border-top: 1px solid rgba(190,220,225,.15); }
.transcript-header h3 { font-size: .9rem; margin: 0; }
.transcript-header span { color: #abc0cc; font-size: .76rem; }
.transcript { list-style: none; max-height: 18rem; overflow: auto; margin: .6rem 0 0; padding: 0; }
.transcript li { display: grid; grid-template-columns: 6rem minmax(0,1fr); gap: .6rem; padding: .55rem 0; border-bottom: 1px solid rgba(190,220,225,.08); }
.transcript li p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.transcript .speaker { padding-top: .2rem; }
.transcript-empty { color: #abc0cc; font-size: .9rem; margin: .7rem 0; }
.call-guidance { margin-top: 1rem; border-top: 1px solid rgba(190,220,225,.15); padding-top: .8rem; }
.call-guidance summary { color: #c1ddd9; cursor: pointer; font-size: .9rem; }
.call-guidance form { margin-top: .8rem; }
.call-guidance button { align-self: flex-start; }
.recordings { max-width: 62rem; width: 100%; margin: 0 auto; }
.recordings h2 { color: var(--muted); font-size: .9rem; }
@media (max-width: 600px) {
  .chat-main { padding: 1rem; }
  .live-call-head { align-items: flex-start; flex-direction: column; }
  .listen-control { align-items: flex-start; }
  .transcript li { grid-template-columns: 1fr; gap: .1rem; }
  #thread-messages li { max-width: 95%; }
}

.directory-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.directory-head > div { max-width: 48rem; }
.directory-head > button { flex: none; }
.monogram svg { width: 1.35rem; height: 1.35rem; }
.form-dialog { width: min(36rem, calc(100% - 2rem)); max-height: min(85vh, 55rem); overflow: auto; border: 1px solid var(--line); border-radius: 18px; padding: 1.4rem; color: var(--ink); background: var(--surface); box-shadow: 0 24px 70px rgba(0,0,0,.5); }
.form-dialog::backdrop { background: rgba(4,12,22,.72); }
.dialog-heading { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.dialog-heading h2 { margin: 0; font-size: 1.2rem; }
.dialog-close { padding: 0; width: 2rem; height: 2rem; font-size: 1.5rem; line-height: 1; background: transparent; color: var(--muted); }
.dialog-actions { display: flex; justify-content: flex-end; gap: .6rem; margin-top: .6rem; }
.form-dialog .picker-panel { z-index: 10; }
@media (max-width: 600px) { .directory-head { flex-direction: column; } }

/* Consistent navigation and layout for directory details. */
.detail-page { max-width: 90rem; padding: 1.75rem clamp(1rem, 3vw, 3rem) 3rem; }
.detail-header { margin-bottom: 1.6rem; }
.back-link { display: inline-flex; align-items: center; gap: .5rem; margin-bottom: 1.1rem; color: #aec5d8; font-size: .9rem; font-weight: 600; text-decoration: none; }
.back-link:hover { color: var(--ink); }
.back-link span { font-size: 1.5rem; line-height: .7; }
.detail-kicker { margin: 0 0 .25rem; color: var(--muted); font-size: .76rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.detail-heading h1 { margin: 0; font-size: 1.65rem; overflow-wrap: anywhere; }
.detail-heading .meta { margin: .35rem 0 0; }
.detail-layout { display: grid; grid-template-columns: minmax(19rem, 29rem) minmax(0, 1fr); gap: 1.1rem; align-items: start; }
.detail-sections { display: grid; gap: 1.1rem; min-width: 0; }
.detail-card { margin: 0; padding: 1.3rem; min-width: 0; }
.section-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 1rem; }
.section-heading h2, .danger-zone h2 { margin: 0; font-size: 1rem; }
.section-heading .meta, .danger-zone .meta { margin: .25rem 0 0; }
.section-action { flex: none; white-space: nowrap; }
.detail-card .stack > .meta { margin: -.25rem 0 .3rem; }
.detail-card .list { margin: 0; }
.detail-card .list li { justify-content: space-between; overflow-wrap: anywhere; }
.detail-empty { color: var(--muted); font-size: .9rem; margin: .5rem 0 0; }
.form-actions { display: flex; justify-content: flex-end; padding-top: .6rem; margin-top: .2rem; border-top: 1px solid var(--line); }
.merge-details { border-top: 1px solid var(--line); margin-top: 1rem; padding-top: .8rem; }
.merge-details summary { color: #bdd2e1; cursor: pointer; font-size: .9rem; }
.merge-details form { margin-top: .8rem; }
.danger-zone { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.danger-zone form { flex: none; }
@media (max-width: 1050px) { .detail-layout { grid-template-columns: 1fr; } }
@media (max-width: 600px) {
  .detail-page { padding: 1rem; }
  .section-heading, .danger-zone { flex-wrap: wrap; }
  .detail-card { padding: 1rem; }
}


.listen-control[hidden], .composer-status[hidden] { display: none; }
.composer-status { display: inline-flex; align-items: center; gap: .45rem; padding: .5rem; color: #b8d1df; font-size: .85rem; white-space: nowrap; }
.composer-spinner { width: .9rem; height: .9rem; border: 2px solid rgba(184,209,223,.3); border-top-color: #b8d1df; border-radius: 50%; animation: composer-spin .8s linear infinite; }
.composer button:disabled { cursor: wait; opacity: .5; }
@keyframes composer-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .composer-spinner { animation-duration: 2s; } }
@media (max-width: 480px) { .composer-status { font-size: 0; gap: 0; } }


.call-actions { display: flex; align-items: flex-start; gap: .7rem; }
.call-actions[hidden] { display: none; }
#end-call-form { display: flex; align-items: center; flex-direction: column; gap: .3rem; }
.end-call-button { border-radius: 10px; padding: .65rem .9rem; color: #fff; background: #a9434a; white-space: nowrap; }
.end-call-button:disabled { opacity: .65; cursor: wait; }
.end-call-status { color: #efc3c2; font-size: .76rem; text-align: center; max-width: 12rem; }
@media (max-width: 600px) { .call-actions { flex-wrap: wrap; } }
