@font-face {
  font-family: "Million";
  src: url("/assets/fonts/Million-Regular.woff") format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Million";
  src: url("/assets/fonts/Million-Bold.woff") format("woff");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-soft: #fafafa;
  --surface-muted: #ededf0;
  --text: #1d1d1f;
  --muted: #6e6e73;
  --faint: #a1a1a6;
  --line: rgba(29, 29, 31, 0.1);
  --line-strong: rgba(29, 29, 31, 0.18);
  --brand: #7f56d9;
  --blue: #0071e3;
  --blue-hover: #0077ed;
  --danger: #d83b50;
  --success: #34c759;
  --shadow-soft: 0 18px 45px rgba(0, 0, 0, 0.06);
  --shadow-card: 0 28px 80px rgba(0, 0, 0, 0.08);
  --radius-lg: 28px;
  --radius-md: 20px;
  --radius-sm: 14px;
  --header-height: 52px;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #101012;
  --surface: #1c1c1e;
  --surface-soft: #242427;
  --surface-muted: #2d2d31;
  --text: #f5f5f7;
  --muted: #b8b8bd;
  --faint: #7f7f86;
  --line: rgba(255, 255, 255, 0.11);
  --line-strong: rgba(255, 255, 255, 0.2);
  --brand: #a98af1;
  --blue: #2997ff;
  --blue-hover: #46a6ff;
  --danger: #ff6475;
  --success: #30d158;
  --shadow-soft: 0 18px 45px rgba(0, 0, 0, 0.28);
  --shadow-card: 0 28px 80px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.45;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
}

a {
  color: inherit;
  text-decoration: none;
}

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

button,
a,
input,
textarea,
select {
  -webkit-tap-highlight-color: transparent;
}

img {
  max-width: 100%;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2 {
  color: var(--text);
  letter-spacing: 0;
}

h1 {
  font-weight: 760;
}

h2 {
  font-weight: 720;
}

.site-header {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 50;
  min-height: var(--header-height);
  padding: 0 1rem;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(180%) blur(22px);
}

.header-inner {
  position: relative;
  display: grid;
  grid-template-columns: minmax(8rem, 1fr) auto minmax(8rem, 1fr);
  align-items: center;
  gap: 1rem;
  width: min(1120px, 100%);
  min-height: var(--header-height);
  margin: 0 auto;
}

.header-inner::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 1px;
  background: var(--line);
}

.brand {
  display: grid;
  grid-template-columns: 2.35rem auto;
  grid-template-rows: auto auto;
  column-gap: 0.62rem;
  align-items: center;
  justify-self: start;
  min-width: 0;
}

.brand img {
  grid-row: 1 / 3;
  width: 2.35rem;
  height: 1.9rem;
  object-fit: contain;
  object-position: center;
  transform: translateY(-0.03rem);
  filter: drop-shadow(0 0.35rem 0.7rem rgba(127, 86, 217, 0.16));
}

.brand span {
  font-family: "Million", Inter, sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1;
}

.brand small {
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 650;
  line-height: 1.1;
}

.primary-nav {
  display: flex;
  justify-self: center;
  align-items: center;
  justify-content: center;
  gap: clamp(1.1rem, 3.2vw, 2.25rem);
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 520;
}

.primary-nav a {
  transition: color 160ms ease;
}

.primary-nav a:hover {
  color: var(--text);
}

.top-actions,
.hero-actions,
.chat-actions,
.admin-nav {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  flex-wrap: wrap;
}

.top-actions {
  justify-self: end;
}

.listener-status {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.34rem;
  min-height: auto;
  padding: 0;
  color: var(--muted);
  background: transparent;
  font-size: 0.72rem;
  font-weight: 680;
  line-height: 1;
  white-space: nowrap;
}

.listener-status[data-listener-tooltip] {
  cursor: help;
  outline: 0;
}

.listener-tooltip {
  position: absolute;
  top: calc(100% + 0.62rem);
  right: 0;
  z-index: 40;
  width: max-content;
  max-width: min(16rem, 80vw);
  padding: 0.58rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--text);
  color: var(--surface);
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.14);
  font-size: 0.76rem;
  font-weight: 580;
  line-height: 1.35;
  text-align: left;
  white-space: normal;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-0.25rem) scale(0.98);
  transition: opacity 160ms ease, transform 160ms ease;
}

.listener-tooltip::before {
  content: "";
  position: absolute;
  top: -0.31rem;
  right: 1rem;
  width: 0.58rem;
  height: 0.58rem;
  background: var(--text);
  transform: rotate(45deg);
}

.listener-status:hover .listener-tooltip,
.listener-status:focus-visible .listener-tooltip {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.listener-status i {
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 50%;
  background: var(--danger);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--danger) 30%, transparent);
}

.listener-status.online i {
  background: var(--success);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--success) 30%, transparent);
  animation: listener-online 1.9s ease-out infinite;
}

.listener-status.large {
  font-size: 0.86rem;
}

.button,
.sos-button,
.theme-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.72rem 1.15rem;
  color: var(--text);
  background: var(--surface);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.75) inset, 0 8px 22px rgba(0, 0, 0, 0.05);
  cursor: pointer;
  transition: transform 180ms cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 180ms ease, border-color 180ms ease, background 180ms ease, color 180ms ease;
}

.button:hover,
.sos-button:hover,
.theme-toggle:hover {
  transform: translateY(-1px);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8) inset, 0 12px 30px rgba(0, 0, 0, 0.08);
}

.sos-button:hover {
  border-color: var(--danger);
  box-shadow: 0 12px 30px rgba(216, 59, 80, 0.16);
}

.button:active,
.sos-button:active,
.theme-toggle:active {
  transform: translateY(0) scale(0.985);
}

.button:disabled,
button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  transform: none;
  box-shadow: none;
}

.button.primary {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
  box-shadow: none;
}

.button.primary:hover {
  background: var(--blue-hover);
}

.button.secondary {
  color: var(--blue);
  background: transparent;
  border-color: color-mix(in srgb, var(--blue) 58%, transparent);
  box-shadow: none;
}

.button.ghost {
  color: var(--muted);
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

.button.danger,
.sos-button {
  border-color: var(--danger);
  background: var(--danger);
  color: #fff;
  font-weight: 760;
  box-shadow: none;
}

.theme-toggle {
  width: 2.3rem;
  min-height: 2.3rem;
  padding: 0;
  border-radius: 50%;
  color: var(--muted);
}

.sos-button {
  min-height: 2.3rem;
  padding: 0.45rem 0.78rem;
  border-radius: 999px;
  font-size: 0.8rem;
}

.button.full {
  width: 100%;
}

.button.small {
  min-height: 2.25rem;
  padding: 0.45rem 0.78rem;
  font-size: 0.88rem;
}

.hero-shell,
.content-shell,
.dashboard-shell,
.waiting-shell,
.chat-shell {
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto;
}

.home-main {
  min-height: 100vh;
}

.home-page .hero-shell {
  height: 178svh;
}

.hero {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: calc(var(--header-height) + 2rem) 0 3rem;
  text-align: center;
}

.home-page .hero {
  position: sticky;
  top: 0;
  height: 100svh;
  min-height: 100svh;
}

.hero-copy {
  display: grid;
  justify-items: center;
  width: min(980px, 100%);
}

.hero-text-swap {
  position: relative;
  display: grid;
  width: min(980px, 100%);
  min-height: clamp(10.8rem, 23vw, 17.5rem);
  place-items: center;
  margin-bottom: 0.1rem;
  transform: translateY(calc(var(--hero-scroll, 0) * -0.35rem));
  will-change: transform;
}

.hero-text-state {
  grid-area: 1 / 1;
  display: grid;
  justify-items: center;
  width: 100%;
  opacity: 0;
  transform: translateY(0.45rem) scale(0.992);
  pointer-events: none;
  will-change: opacity, transform;
}

.hero-text-state.active {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.hero-text-swap.swapped .hero-text-state:nth-child(1) {
  pointer-events: none;
}

.home-page h1 {
  max-width: 15ch;
  margin-bottom: 0.65rem;
  font-size: clamp(3.3rem, 8.2vw, 6.6rem);
  line-height: 1.03;
  text-wrap: balance;
}

.lead,
.home-page .lead {
  max-width: 620px;
  margin-bottom: 1.25rem;
  color: color-mix(in srgb, var(--muted) 82%, var(--text));
  font-size: clamp(1.02rem, 1.45vw, 1.22rem);
  line-height: 1.42;
  font-weight: 450;
}

.hero-actions {
  justify-content: center;
  margin-bottom: 0.8rem;
}

.hero-actions .button {
  min-height: 2.9rem;
  padding: 0.68rem 1.32rem;
  font-size: 1.02rem;
  font-weight: 520;
}

.small-warning {
  color: var(--muted);
  font-size: 0.9rem;
}

.home-page .hero .hero-text-swap,
.home-page .hero .hero-actions,
.home-page .hero .small-warning {
  opacity: 0;
  transform: translateY(1rem);
  animation: home-enter 760ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.home-page .hero .hero-actions {
  animation-delay: 130ms;
}

.home-page .hero .small-warning {
  animation-delay: 210ms;
}

@keyframes home-enter {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.home-info-shell {
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 0 0 clamp(4rem, 8vw, 6rem);
}

.home-section-intro {
  display: grid;
  justify-items: center;
  max-width: 820px;
  margin: 0 auto clamp(1.6rem, 4vw, 2.4rem);
  text-align: center;
}

.home-section-intro span {
  margin-bottom: 0.75rem;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.home-section-intro h2 {
  max-width: 17ch;
  margin-bottom: 0.8rem;
  font-size: clamp(2.2rem, 5.5vw, 4.8rem);
  line-height: 1;
  text-wrap: balance;
}

.home-section-intro p {
  max-width: 44rem;
  margin: 0;
  color: var(--muted);
  font-size: clamp(1rem, 1.8vw, 1.16rem);
}

.home-info-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
  margin-bottom: 1rem;
}

.home-info-grid article,
.home-listener-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--surface-soft) 70%, var(--surface));
  box-shadow: var(--shadow-soft);
}

.home-info-grid article {
  display: grid;
  align-content: start;
  gap: 0.6rem;
  min-height: 13.5rem;
  padding: clamp(1.05rem, 2.6vw, 1.45rem);
}

.home-info-grid strong {
  display: grid;
  place-items: center;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 50%;
  background: var(--text);
  color: var(--bg);
  font-size: 0.92rem;
}

.home-info-grid h3 {
  margin: 0;
  font-size: clamp(1.15rem, 2vw, 1.45rem);
  line-height: 1.12;
}

.home-info-grid p {
  margin: 0;
  color: var(--muted);
  font-size: 0.96rem;
}

.home-listener-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.3rem;
  padding: clamp(1.2rem, 3vw, 1.7rem);
}

.home-listener-panel h2 {
  margin: 0.85rem 0 0.45rem;
  font-size: clamp(1.55rem, 3.5vw, 2.65rem);
  line-height: 1.05;
}

.home-listener-panel p {
  max-width: 42rem;
  margin: 0;
  color: var(--muted);
}

.home-listener-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.content-shell,
.dashboard-shell {
  padding: calc(var(--header-height) + 3rem) 0 4rem;
}

.content-shell.narrow {
  max-width: 760px;
}

.page-intro {
  margin-bottom: 1.2rem;
}

.page-intro h1,
.form-card h1,
.sos-panel h1,
.dashboard-head h1 {
  margin-bottom: 0.6rem;
  font-size: clamp(2.35rem, 6vw, 4.6rem);
  line-height: 1.02;
}

.page-intro p,
.form-card > p,
.dashboard-head p,
.text-block p {
  color: var(--muted);
}

.eyebrow {
  margin: 0 0 0.65rem;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 760;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.eyebrow.danger,
.danger-text {
  color: var(--danger);
}

.form-card,
.sos-panel,
.panel,
.stat,
.listener-profile,
.chat-info-card,
.chat-card,
.chat-notice,
.safety-inline,
.context-bar {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  box-shadow: var(--shadow-soft);
}

.form-card,
.sos-panel,
.panel,
.stat {
  padding: clamp(1.25rem, 3vw, 1.8rem);
}

.stack-form,
.start-form,
.list {
  display: grid;
  gap: 1rem;
}

.field {
  display: grid;
  gap: 0.45rem;
}

.start-page .field {
  text-align: left;
}

.field span {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 560;
}

.field input,
.field textarea,
select,
.chat-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  color: var(--text);
  padding: 0.9rem 1rem;
  outline: 0;
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.field input:focus,
.field textarea:focus,
select:focus,
.chat-form textarea:focus {
  border-color: color-mix(in srgb, var(--blue) 55%, var(--line));
  background: var(--surface);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--blue) 12%, transparent);
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
  margin: 1.25rem 0;
}

.choice {
  position: relative;
}

.choice input {
  position: absolute;
  opacity: 0;
}

.choice span {
  display: grid;
  place-items: center;
  min-height: 3rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-soft);
  color: var(--text);
  padding: 0.65rem;
  text-align: center;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.start-page .choice {
  opacity: 0;
  transform: translateY(0.65rem);
  animation: choice-enter 520ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.start-page .choice:nth-child(1) { animation-delay: 190ms; }
.start-page .choice:nth-child(2) { animation-delay: 230ms; }
.start-page .choice:nth-child(3) { animation-delay: 270ms; }
.start-page .choice:nth-child(4) { animation-delay: 310ms; }
.start-page .choice:nth-child(5) { animation-delay: 350ms; }
.start-page .choice:nth-child(6) { animation-delay: 390ms; }
.start-page .choice:nth-child(7) { animation-delay: 430ms; }

@keyframes choice-enter {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.choice:hover span {
  transform: translateY(-1px);
  border-color: var(--line-strong);
}

.choice input:checked + span {
  border-color: var(--blue);
  background: color-mix(in srgb, var(--blue) 8%, var(--surface));
  color: var(--blue);
}

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

.muted {
  color: var(--muted);
}

.text-block {
  display: grid;
  gap: 0.8rem;
}

.legal-copy {
  gap: 1rem;
  color: var(--muted);
}

.legal-copy h2 {
  margin: 1.2rem 0 0;
  color: var(--text);
  font-size: clamp(1.35rem, 2.5vw, 1.85rem);
  line-height: 1.12;
}

.legal-copy h2:first-child {
  margin-top: 0;
}

.legal-copy p,
.legal-copy li {
  margin-bottom: 0;
  line-height: 1.65;
}

.legal-copy ul {
  display: grid;
  gap: 0.45rem;
  margin: 0;
  padding-left: 1.2rem;
}

.legal-copy a,
.legal-consent-inline a {
  color: var(--blue);
}

.legal-consent-inline {
  max-width: 36rem;
  margin: 0.1rem 0 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.5;
}

.sos-panel {
  text-align: center;
}

.sos-panel .hero-actions,
.hero-actions.stacked {
  justify-content: center;
}

.help-shell {
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto;
  padding: calc(var(--header-height) + clamp(3rem, 8vw, 5.6rem)) 0 4.5rem;
}

.help-hero {
  display: grid;
  justify-items: center;
  max-width: 820px;
  margin: 0 auto clamp(2rem, 5vw, 3.8rem);
  text-align: center;
  animation: help-rise 720ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.help-kicker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 720;
}

.help-kicker span {
  min-height: 2rem;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.34rem 0.76rem;
  background: var(--surface);
}

.help-kicker span:first-child {
  color: var(--text);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
}

.help-hero h1 {
  max-width: 16ch;
  margin-bottom: 0.85rem;
  font-size: clamp(2.35rem, 5.7vw, 5rem);
  line-height: 1;
  text-wrap: balance;
}

.help-hero p {
  max-width: 36rem;
  margin: 0;
  color: var(--muted);
  font-size: clamp(1.04rem, 2vw, 1.28rem);
}

.help-locator {
  display: grid;
  gap: 1.2rem;
  align-items: center;
  margin-bottom: clamp(2rem, 5vw, 3.2rem);
  padding: 1.05rem 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  animation: help-rise 720ms 90ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.help-locator strong {
  display: block;
  margin-bottom: 0.24rem;
  font-size: clamp(1.25rem, 2.5vw, 1.65rem);
  line-height: 1.1;
}

.help-locator p {
  max-width: 44rem;
  margin: 0;
  color: var(--muted);
  font-size: 0.96rem;
}

.location-tools {
  display: flex;
  align-items: end;
  justify-content: flex-start;
  gap: 0.8rem;
  flex-wrap: wrap;
  margin: 0;
}

.location-tools .button {
  min-height: 3rem;
}

.select-field {
  display: grid;
  gap: 0.42rem;
  min-width: min(100%, 15rem);
}

.select-field span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.select-field select {
  min-height: 3rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 2.6rem 0 1rem;
  color: var(--text);
  background: var(--surface);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.04);
}

.source-list {
  color: var(--muted);
  font-size: 0.92rem;
}

.source-list {
  margin: 1.2rem auto 0;
  max-width: 780px;
  text-align: center;
}

.source-list a {
  color: var(--blue);
}

.emergency-section {
  animation: help-rise 720ms 170ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.emergency-section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.85rem;
}

.emergency-section-head span {
  color: var(--text);
  font-size: clamp(1.25rem, 3vw, 1.85rem);
  font-weight: 760;
  line-height: 1.1;
}

.emergency-section-head small {
  color: var(--muted);
  font-size: 0.92rem;
  text-align: right;
}

.emergency-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

.emergency-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(1rem, 4vw, 2.5rem);
  min-height: clamp(6.8rem, 13vw, 9.6rem);
  border: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
  border-radius: clamp(1.25rem, 3vw, 2rem);
  padding: clamp(1.1rem, 3vw, 1.7rem);
  background: color-mix(in srgb, var(--surface-soft) 70%, var(--surface));
  box-shadow: 0 16px 55px rgba(0, 0, 0, 0.045);
  overflow: hidden;
  transition: transform 180ms cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 180ms ease, border-color 180ms ease, background 180ms ease;
}

.emergency-card:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--blue) 34%, var(--line));
  background: var(--surface);
  box-shadow: 0 26px 80px rgba(0, 0, 0, 0.08);
}

.emergency-card span {
  color: var(--muted);
}

.emergency-copy {
  display: grid;
  gap: 0.36rem;
  min-width: 0;
}

.emergency-card .emergency-copy span {
  color: var(--text);
  font-size: clamp(1.12rem, 2vw, 1.45rem);
  font-weight: 760;
  line-height: 1.05;
}

.emergency-card .emergency-copy small {
  max-width: 34rem;
  color: var(--muted);
  font-size: clamp(0.88rem, 1.4vw, 1rem);
  line-height: 1.35;
}

.emergency-card strong {
  color: var(--text);
  font-size: clamp(2.4rem, 7vw, 4.8rem);
  font-weight: 780;
  line-height: 1;
  white-space: nowrap;
}

@keyframes help-rise {
  from {
    opacity: 0;
    transform: translateY(1rem);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.waiting-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: calc(var(--header-height) + 2rem) 0 3rem;
}

.sos-shell {
  width: min(960px, calc(100% - 2rem));
  min-height: 100vh;
  display: grid;
  place-items: center;
  margin: 0 auto;
  padding: calc(var(--header-height) + 2rem) 0 3rem;
}

.sos-open {
  width: 100%;
  text-align: center;
  animation: home-enter 760ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.sos-open h1 {
  max-width: 28ch;
  margin: 0 auto 1.6rem;
  font-size: clamp(1.9rem, 4.5vw, 3.3rem);
  line-height: 1.08;
  text-wrap: balance;
}

.sos-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
  width: min(760px, 100%);
  margin: 0 auto 1.2rem;
}

.sos-actions a {
  display: grid;
  gap: 0.35rem;
  min-height: 8.5rem;
  align-content: center;
  border: 1px solid color-mix(in srgb, var(--danger) 22%, var(--line));
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--danger) 6%, var(--surface));
  color: var(--danger);
  transition: transform 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.sos-actions a:hover {
  transform: translateY(-2px);
  background: color-mix(in srgb, var(--danger) 10%, var(--surface));
  box-shadow: 0 18px 48px color-mix(in srgb, var(--danger) 14%, transparent);
}

.sos-actions span {
  color: var(--muted);
  font-size: 0.95rem;
}

.sos-actions strong {
  font-size: clamp(2.4rem, 5vw, 4rem);
  line-height: 1;
}

.sos-secondary {
  display: flex;
  justify-content: center;
}

.start-shell {
  width: min(920px, calc(100% - 2rem));
  min-height: 100vh;
  display: grid;
  place-items: center;
  margin: 0 auto;
  padding: calc(var(--header-height) + 2rem) 0 3rem;
}

.start-panel {
  width: 100%;
  text-align: center;
  animation: start-enter 820ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.start-panel h1 {
  max-width: 11ch;
  margin: 0 auto 0.8rem;
  font-size: clamp(3rem, 8vw, 6rem);
  line-height: 1.02;
  text-wrap: balance;
}

.start-panel > p:not(.eyebrow) {
  max-width: 38rem;
  margin: 0 auto 1.6rem;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.2rem);
}

.start-panel .start-form {
  width: min(720px, 100%);
  margin: 0 auto;
  animation: start-form-enter 820ms cubic-bezier(0.16, 1, 0.3, 1) 120ms both;
}

@keyframes start-enter {
  from {
    opacity: 0;
    transform: translateY(1rem);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes start-form-enter {
  from {
    opacity: 0;
    transform: translateY(1.2rem) scale(0.985);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.waiting-panel {
  display: grid;
  justify-items: center;
  width: min(760px, 100%);
  text-align: center;
  animation: waiting-page-enter 860ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.waiting-orb {
  position: relative;
  display: grid;
  align-items: center;
  justify-content: center;
  width: 7.8rem;
  height: 6.7rem;
  margin-bottom: 1.65rem;
  animation: waiting-orb-float 3.8s ease-in-out infinite;
}

.waiting-orb img {
  position: relative;
  z-index: 1;
  width: 7.2rem;
  height: auto;
  filter: drop-shadow(0 1.2rem 2rem rgba(127, 86, 217, 0.18));
  transform-origin: 50% 88%;
  animation: waiting-icon-breathe 2.8s cubic-bezier(0.37, 0, 0.63, 1) infinite;
}

.waiting-panel h1 {
  max-width: 18ch;
  margin-bottom: 1.35rem;
  font-size: clamp(2.2rem, 5.2vw, 4.2rem);
  line-height: 1.04;
  text-wrap: balance;
}

.waiting-actions {
  display: flex;
  justify-content: center;
  gap: 0.7rem;
  flex-wrap: wrap;
}

.waiting-actions form {
  margin: 0;
}

.waiting-phrases {
  position: relative;
  width: min(18ch, 100%);
  min-height: 3.25em;
  margin-inline: auto;
}

.waiting-phrases span {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  opacity: 0;
  transform: translateY(0.5rem);
  text-align: center;
  animation: waiting-phrase 15s cubic-bezier(0.16, 1, 0.3, 1) infinite;
}

.waiting-phrases span:nth-child(2) {
  animation-delay: 5s;
}

.waiting-phrases span:nth-child(3) {
  animation-delay: 10s;
}

.waiting-connection {
  display: grid;
  justify-items: center;
  gap: 0.46rem;
  width: min(560px, 100%);
  margin: -0.15rem auto 1.35rem;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: var(--text);
  text-align: center;
  animation: waiting-connect-enter 720ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.waiting-connection span {
  max-width: 15ch;
  font-size: clamp(1.75rem, 4vw, 3.1rem);
  font-weight: 790;
  line-height: 1;
  text-wrap: balance;
}

.waiting-connection small {
  color: color-mix(in srgb, var(--muted) 86%, var(--text));
  font-size: clamp(0.98rem, 1.5vw, 1.12rem);
  line-height: 1.42;
}

.waiting-connection i {
  display: block;
  width: 4.8rem;
  height: 0.12rem;
  margin-top: 0.65rem;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--brand) 72%, var(--text)), transparent);
  animation: waiting-connect-line 1.55s ease-in-out infinite;
}

.waiting-shell.is-connecting .waiting-phrases {
  opacity: 0;
  transform: translateY(-0.55rem) scale(0.985);
  transition: opacity 420ms ease, transform 420ms ease;
}

.waiting-shell.is-connecting .waiting-actions {
  opacity: 0;
  pointer-events: none;
  transform: translateY(0.4rem);
  transition: opacity 360ms ease, transform 360ms ease;
}

.waiting-status {
  max-width: 36rem;
  margin-bottom: 1.35rem;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.18rem);
}

.waiting-meta {
  display: grid;
  grid-template-columns: minmax(0, 0.6fr) minmax(0, 1fr);
  gap: 0.8rem;
  width: min(560px, 100%);
  margin-bottom: 1.25rem;
}

.agent-count,
.queue-note {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  padding: 0.9rem 1rem;
  text-align: left;
  box-shadow: var(--shadow-soft);
}

.agent-count span {
  display: block;
  color: var(--text);
  font-size: 2.2rem;
  font-weight: 760;
  line-height: 1;
}

.agent-count small,
.queue-note {
  color: var(--muted);
  font-size: 0.9rem;
}

@keyframes waiting-page-enter {
  from {
    opacity: 0;
    transform: translateY(1rem) scale(0.985);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes waiting-orb-float {
  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }

  50% {
    transform: translateY(-0.55rem) rotate(-1.2deg);
  }
}

@keyframes waiting-icon-breathe {
  0%,
  100% {
    transform: scale(1);
  }

  45% {
    transform: scale(1.055);
  }

  68% {
    transform: scale(0.985);
  }
}

@keyframes waiting-phrase {
  0% {
    opacity: 0;
    transform: translateY(0.5rem);
  }

  8%,
  28% {
    opacity: 1;
    transform: translateY(0);
  }

  36%,
  100% {
    opacity: 0;
    transform: translateY(-0.45rem);
  }
}

@keyframes waiting-connect-enter {
  from {
    opacity: 0;
    transform: translateY(0.75rem) scale(0.97);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes waiting-connect-line {
  0%,
  100% {
    opacity: 0.28;
    transform: scaleX(0.72);
  }

  50% {
    opacity: 0.9;
    transform: scaleX(1);
  }
}

.chat-shell {
  height: 100vh;
  padding: calc(var(--header-height) + 1rem) 0 1rem;
}

.user-chat,
.agent-chat {
  display: grid;
  grid-template-columns: minmax(250px, 320px) minmax(0, 760px);
  gap: 1rem;
  justify-content: center;
  align-items: stretch;
}

.agent-chat {
  grid-template-columns: minmax(280px, 360px) minmax(0, 820px);
}

.chat-sidebar,
.agent-sidebar {
  display: grid;
  align-content: start;
  gap: 0.9rem;
  min-height: 0;
}

.listener-profile,
.chat-info-card,
.agent-context-card,
.agent-rule-card,
.agent-documentation-card,
.agent-action-card {
  padding: 1rem;
}

.agent-context-card,
.agent-rule-card,
.agent-documentation-card,
.agent-action-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  box-shadow: var(--shadow-soft);
}

.agent-context-card h1 {
  margin: 0 0 1rem;
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  line-height: 1.04;
  overflow-wrap: anywhere;
}

.agent-context-card dl {
  display: grid;
  gap: 0.65rem;
  margin: 0;
}

.agent-context-card dl div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  border-top: 1px solid var(--line);
  padding-top: 0.65rem;
}

.agent-context-card dt {
  color: var(--muted);
  font-size: 0.88rem;
}

.agent-context-card dd {
  margin: 0;
  color: var(--text);
  font-weight: 650;
  text-align: right;
}

.agent-rule-card {
  display: grid;
  gap: 0.65rem;
}

.agent-rule-card h2 {
  margin: 0;
  font-size: 1.2rem;
}

.agent-rule-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.94rem;
}

.agent-documentation-card {
  display: grid;
  gap: 0.8rem;
}

.agent-documentation-card h2 {
  margin: 0 0 0.35rem;
  font-size: 1.2rem;
}

.agent-documentation-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.42;
}

.agent-documentation-card textarea {
  width: 100%;
  min-height: 10.5rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface-soft);
  color: var(--text);
  padding: 0.85rem;
  resize: vertical;
  outline: 0;
  line-height: 1.45;
}

.agent-documentation-card textarea:focus {
  border-color: color-mix(in srgb, var(--blue) 55%, var(--line));
  background: var(--surface);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--blue) 11%, transparent);
}

.documentation-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
}

.documentation-footer span {
  color: var(--muted);
  font-size: 0.86rem;
}

.agent-action-card {
  display: grid;
  gap: 0.65rem;
}

.agent-action-card .button {
  width: 100%;
}

.listener-profile {
  display: grid;
  grid-template-columns: 3.8rem minmax(0, 1fr);
  gap: 0.9rem;
  align-items: center;
}

.listener-avatar {
  display: grid;
  place-items: center;
  width: 3.8rem;
  height: 3.8rem;
  border-radius: 20px;
  background: var(--text);
  color: var(--bg);
  font-size: 1.65rem;
  font-weight: 800;
}

.listener-kicker {
  margin: 0 0 0.25rem;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 760;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.listener-profile h1 {
  margin: 0 0 0.2rem;
  overflow-wrap: anywhere;
  font-size: clamp(1.7rem, 3vw, 2.25rem);
  line-height: 1.05;
}

.listener-state {
  display: flex;
  align-items: center;
  gap: 0.42rem;
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.listener-dot {
  display: inline-block;
  width: 0.52rem;
  height: 0.52rem;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--success) 28%, transparent);
  animation: listener-online 1.8s ease-out infinite;
}

@keyframes listener-online {
  100% {
    box-shadow: 0 0 0 1rem color-mix(in srgb, var(--success) 0%, transparent);
  }
}

.chat-info-card {
  display: grid;
  gap: 0.65rem;
}

.chat-info-card h2 {
  margin: 0;
  font-size: 1.18rem;
}

.chat-info-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.94rem;
}

.chat-card {
  position: relative;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  width: min(760px, 100%);
  height: calc(100vh - var(--header-height) - 2rem);
  gap: 0;
  padding: 0;
  overflow: hidden;
}

.agent-chat-card {
  width: min(820px, 100%);
}

.user-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4.5rem;
  padding: 1rem 1.15rem;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
}

.user-chat-header div {
  display: grid;
  gap: 0.1rem;
}

.user-chat-header span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 680;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.user-chat-header strong {
  color: var(--text);
  font-size: 1.3rem;
  line-height: 1.1;
}

.user-chat-header p {
  display: flex;
  align-items: center;
  gap: 0.42rem;
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.chat-notice,
.safety-inline,
.context-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
}

.safety-inline {
  margin: 0.8rem 0.8rem 0;
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 35%, var(--line));
}

.chat-ended {
  display: grid;
  justify-items: center;
  gap: 0.55rem;
  margin: 0.8rem 0.8rem 0;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: color-mix(in srgb, var(--surface) 88%, var(--surface-soft));
  text-align: center;
}

.chat-ended h2 {
  margin: 0;
  font-size: 1.05rem;
}

.chat-ended p {
  max-width: 34rem;
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.chat-ended .button {
  margin-top: 0.15rem;
}

.context-bar {
  color: var(--muted);
}

.chat-window {
  overflow-y: auto;
  min-height: 0;
  border: 0;
  border-radius: 0;
  background: linear-gradient(180deg, var(--surface-soft), var(--surface));
  padding: 1.15rem 1.15rem 6.8rem;
  scroll-behavior: smooth;
}

.message {
  width: fit-content;
  max-width: min(78%, 560px);
  margin-bottom: 0.8rem;
  padding: 0.76rem 0.95rem;
  border-radius: 19px;
  background: var(--surface);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.02), 0 8px 20px rgba(0, 0, 0, 0.035);
}

.message span {
  display: block;
  margin-bottom: 0.18rem;
  color: var(--faint);
  font-size: 0.76rem;
}

.message p {
  margin: 0;
  white-space: pre-wrap;
}

.message.user {
  margin-left: auto;
  border-bottom-right-radius: 7px;
  background: var(--blue);
  color: #fff;
}

.message.user span {
  color: rgba(255, 255, 255, 0.72);
}

.message.agent {
  border-bottom-left-radius: 7px;
  background: var(--surface);
}

.message.system {
  width: fit-content;
  max-width: 100%;
  margin-inline: auto;
  color: var(--muted);
  text-align: center;
  background: transparent;
  border: 0;
  box-shadow: none;
  font-size: 0.86rem;
}

.typing-indicator {
  display: flex;
  align-items: center;
  gap: 0.34rem;
  width: fit-content;
  max-width: 100%;
  margin: 0.2rem 0 0.8rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  padding: 0.48rem 0.7rem;
  font-size: 0.86rem;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.045);
}

.typing-indicator.from-user {
  margin-left: auto;
  background: color-mix(in srgb, var(--blue) 8%, var(--surface));
}

.typing-indicator.from-agent {
  margin-right: auto;
}

.typing-indicator span {
  width: 0.38rem;
  height: 0.38rem;
  border-radius: 50%;
  background: var(--muted);
  opacity: 0.45;
  animation: typing-dot 1.05s ease-in-out infinite;
}

.typing-indicator span:nth-child(2) {
  animation-delay: 120ms;
}

.typing-indicator span:nth-child(3) {
  animation-delay: 240ms;
}

.typing-indicator p {
  margin: 0 0 0 0.28rem;
}

@keyframes typing-dot {
  0%,
  80%,
  100% {
    transform: translateY(0);
    opacity: 0.35;
  }

  40% {
    transform: translateY(-0.22rem);
    opacity: 1;
  }
}

.chat-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.65rem;
  align-items: end;
}

.chat-card .chat-form {
  position: absolute;
  right: 1rem;
  bottom: 1rem;
  left: 1rem;
  padding: 0.5rem;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.1);
  backdrop-filter: saturate(180%) blur(22px);
}

.chat-form textarea {
  min-height: 2.9rem;
  max-height: 10rem;
  border: 0;
  background: transparent;
  resize: none;
  box-shadow: none;
}

.chat-form textarea:focus {
  border: 0;
  box-shadow: none;
}

.chat-form .button {
  min-height: 2.9rem;
}

.chat-actions {
  justify-content: flex-start;
  padding-inline: 0.2rem;
}

.chat-sidebar .chat-actions {
  flex-direction: column;
  align-items: stretch;
  padding-inline: 0;
}

.chat-sidebar .chat-actions .button {
  width: 100%;
}

.dashboard-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.4rem;
}

.admin-shell {
  width: min(1180px, calc(100% - 2rem));
}

.admin-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 1.1rem;
  padding-bottom: 1.1rem;
  border-bottom: 1px solid var(--line);
}

.admin-hero h1 {
  margin-bottom: 0.45rem;
  font-size: clamp(2.6rem, 6vw, 5.5rem);
  line-height: 0.98;
}

.admin-hero p,
.admin-hero-actions span,
.panel-title p {
  color: var(--muted);
}

.admin-hero-actions {
  display: grid;
  justify-items: end;
  gap: 0.65rem;
  min-width: max-content;
}

.dashboard-grid,
.stat-grid {
  display: grid;
  gap: 1rem;
}

.dashboard-grid {
  grid-template-columns: 1fr;
}

.stat-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 1rem;
}

.stat span {
  color: var(--muted);
  text-transform: capitalize;
}

.stat strong {
  display: block;
  margin-top: 0.25rem;
  font-size: 2.2rem;
  line-height: 1;
}

.admin-nav {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
  padding: 0.32rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface-soft) 76%, var(--surface));
  width: fit-content;
}

.admin-nav a {
  min-height: 2.35rem;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.48rem 0.82rem;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 650;
  transition: color 160ms ease, background 160ms ease;
}

.admin-nav a:hover {
  color: var(--text);
  background: var(--surface);
}

.admin-stat-grid {
  margin-bottom: 1.15rem;
}

.admin-stat {
  position: relative;
  overflow: hidden;
  min-height: 8rem;
}

.admin-stat::after {
  content: "";
  position: absolute;
  right: -1.8rem;
  bottom: -2.2rem;
  width: 6.6rem;
  height: 6.6rem;
  border-radius: 50%;
  opacity: 0.14;
  background: var(--blue);
}

.admin-stat.safety::after {
  background: var(--danger);
}

.admin-stat.agents::after {
  background: var(--success);
}

.admin-stat.wait::after {
  background: var(--brand);
}

.admin-overview {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
}

.admin-panel {
  display: grid;
  gap: 1rem;
  align-content: start;
}

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

.panel-title h2 {
  margin: 0 0 0.22rem;
  font-size: clamp(1.25rem, 2vw, 1.55rem);
  line-height: 1.12;
}

.panel-title p {
  margin: 0;
  font-size: 0.92rem;
}

.panel-title a {
  color: var(--blue);
  font-size: 0.9rem;
  font-weight: 680;
  white-space: nowrap;
}

.agent-status-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.5rem;
}

.agent-status-strip span {
  display: grid;
  gap: 0.1rem;
  border-radius: 18px;
  padding: 0.72rem;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 0.78rem;
}

.agent-status-strip strong {
  color: var(--text);
  font-size: 1.35rem;
  line-height: 1;
}

.compact-list {
  gap: 0.55rem;
}

.admin-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface-soft);
  padding: 0.78rem 0.85rem;
}

.admin-row span:first-child {
  display: grid;
  gap: 0.16rem;
  min-width: 0;
}

.admin-row strong {
  color: var(--text);
  line-height: 1.15;
}

.admin-row small {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.admin-review-actions {
  display: grid;
  justify-items: end;
  gap: 0.45rem;
  min-width: fit-content;
}

.admin-review-actions form {
  margin: 0;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 1.9rem;
  border-radius: 999px;
  padding: 0.28rem 0.62rem;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 760;
  white-space: nowrap;
}

.status-pill.available {
  color: #148a3b;
  background: color-mix(in srgb, var(--success) 13%, var(--surface));
}

.status-pill.back_soon {
  color: var(--brand);
  background: color-mix(in srgb, var(--brand) 12%, var(--surface));
}

.status-pill.offline {
  color: var(--muted);
}

.status-pill.danger {
  color: var(--danger);
  background: color-mix(in srgb, var(--danger) 10%, var(--surface));
}

.admin-mini-feed {
  display: grid;
  gap: 0.55rem;
}

.admin-mini-feed a {
  display: grid;
  gap: 0.12rem;
  border-left: 2px solid var(--line-strong);
  padding: 0.25rem 0 0.25rem 0.75rem;
}

.admin-mini-feed strong {
  color: var(--text);
  font-size: 0.92rem;
}

.admin-mini-feed span {
  color: var(--muted);
  font-size: 0.82rem;
}

.admin-docs-shell {
  display: grid;
  gap: 1rem;
}

.admin-table-wrap {
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

.admin-table th,
.admin-table td {
  padding: 0.82rem 0.75rem;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  text-align: left;
  vertical-align: top;
  font-size: 0.9rem;
}

.admin-table th {
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 760;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.admin-table td strong,
.admin-table td small {
  display: block;
}

.admin-table td strong {
  color: var(--text);
  margin-bottom: 0.16rem;
}

.admin-documentation-list {
  display: grid;
  gap: 0.75rem;
}

.admin-documentation,
.log-documentation {
  display: grid;
  gap: 0.65rem;
  padding: 0.9rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
}

.admin-documentation header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.admin-documentation strong,
.log-documentation strong {
  color: var(--text);
}

.admin-documentation small,
.log-documentation small {
  color: var(--muted);
}

.admin-documentation p,
.log-documentation p {
  margin: 0;
  color: var(--muted);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(11, 10, 18, 0.28);
  backdrop-filter: blur(18px);
}

.admin-modal {
  position: relative;
  display: grid;
  gap: 1rem;
  width: min(720px, 100%);
  max-height: min(78vh, 760px);
  padding: 1.1rem;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.18);
  overflow: hidden;
}

.admin-modal h2 {
  margin: 0;
  font-size: clamp(1.35rem, 2.4vw, 1.9rem);
}

.modal-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  display: grid;
  place-items: center;
  width: 2.1rem;
  height: 2.1rem;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface-soft);
  color: var(--text);
  cursor: pointer;
  font-size: 1.25rem;
}

.documentation-modal-body {
  max-height: min(54vh, 540px);
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface-soft);
  padding: 0.95rem;
  color: var(--muted);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.55;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.25rem;
  padding: 0.25rem;
  border-radius: 18px;
  background: var(--surface-muted);
}

.segmented button {
  border: 0;
  border-radius: 14px;
  padding: 0.65rem 0.5rem;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}

.segmented .active {
  color: var(--text);
  background: var(--surface);
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.06);
}

.capacity-control {
  display: grid;
  gap: 0.75rem;
}

.capacity-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.45rem;
}

.capacity-options input {
  position: absolute;
  opacity: 0;
}

.capacity-options span {
  display: grid;
  place-items: center;
  min-height: 3rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-soft);
  color: var(--muted);
  font-weight: 750;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease;
}

.capacity-options input:checked + span {
  border-color: var(--blue);
  background: color-mix(in srgb, var(--blue) 8%, var(--surface));
  color: var(--blue);
}

.capacity-state {
  margin: 0.85rem 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.request-row,
.chat-row,
.admin-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
}

.chat-row small,
.admin-item small {
  color: var(--muted);
}

.chat-row span {
  display: grid;
  gap: 0.15rem;
}

.list-panel,
.list {
  display: grid;
  gap: 0.75rem;
}

.admin-chat-log {
  display: grid;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.log-messages {
  display: grid;
  gap: 0.35rem;
  padding: 0.85rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
}

.log-messages p {
  margin: 0;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.site-footer {
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 2rem 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.86rem;
}

.site-footer nav {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 0.6rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.hidden {
  display: none !important;
}

@media (min-width: 760px) {
  .choice-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .emergency-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .help-page .help-locator {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .help-page .location-tools {
    justify-content: flex-end;
  }

  .help-page .emergency-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stat-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .admin-overview {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-panel.wide {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  .header-inner {
    display: flex;
    gap: 0.65rem;
  }

  .primary-nav {
    display: none;
  }

  .brand {
    min-width: auto;
    grid-template-columns: 2.05rem auto;
    column-gap: 0.52rem;
  }

  .brand img {
    width: 2.05rem;
    height: 1.65rem;
  }

  .brand span {
    font-size: 0.86rem;
  }

  .brand small {
    display: none;
  }

  .top-actions {
    gap: 0.38rem;
    margin-left: auto;
    flex-wrap: nowrap;
  }

  .listener-status {
    font-size: 0.66rem;
  }

  .listener-status i {
    width: 0.38rem;
    height: 0.38rem;
  }

  .theme-toggle,
  .sos-button {
    min-height: 2.05rem;
  }

  .theme-toggle {
    width: 2.05rem;
  }

  .sos-button {
    padding: 0.38rem 0.58rem;
  }

  .home-page .hero-shell {
    width: 100%;
    height: 168svh;
  }

  .home-page .hero {
    padding-inline: 1rem;
  }

  .hero-text-swap {
    min-height: clamp(10.2rem, 42vw, 15rem);
  }

  .home-page h1 {
    font-size: clamp(3rem, 13vw, 5rem);
  }

  .home-page .lead {
    max-width: 23rem;
    font-size: clamp(0.98rem, 4vw, 1.12rem);
  }

  .hero-actions .button,
  .chat-actions .button {
    width: 100%;
  }

  .home-info-shell {
    width: min(100% - 1rem, 100%);
    padding-bottom: 3rem;
  }

  .home-section-intro {
    justify-items: start;
    text-align: left;
  }

  .home-section-intro h2 {
    max-width: 12ch;
    font-size: clamp(2.05rem, 10vw, 3.3rem);
  }

  .home-info-grid {
    grid-template-columns: 1fr;
  }

  .home-info-grid article {
    min-height: 0;
  }

  .home-listener-panel {
    display: grid;
  }

  .home-listener-actions,
  .home-listener-actions .button {
    width: 100%;
  }

  .help-shell {
    width: min(100% - 1.1rem, 100%);
    padding-top: calc(var(--header-height) + 2.2rem);
  }

  .help-kicker {
    flex-wrap: wrap;
  }

  .help-hero h1 {
    max-width: 10ch;
  }

  .help-locator {
    gap: 1rem;
    padding: 0.95rem 0;
  }

  .location-tools,
  .location-tools .button,
  .select-field {
    width: 100%;
  }

  .emergency-section-head {
    display: grid;
    gap: 0.25rem;
  }

  .emergency-section-head small {
    text-align: left;
  }

  .emergency-card {
    align-items: flex-start;
    min-height: 0;
  }

  .emergency-card strong {
    font-size: clamp(2.15rem, 12vw, 3.3rem);
  }

  .waiting-meta {
    grid-template-columns: 1fr;
  }

  .waiting-actions,
  .waiting-actions .button,
  .waiting-actions form {
    width: 100%;
  }

  .sos-actions {
    grid-template-columns: 1fr;
  }

  .sos-open h1 {
    max-width: 12ch;
  }

  .user-chat,
  .agent-chat {
    height: auto;
    min-height: 100vh;
    grid-template-columns: 1fr;
  }

  .chat-card {
    width: 100%;
    height: auto;
    min-height: 34rem;
  }

  .chat-card .chat-form {
    right: 1rem;
    bottom: 1rem;
    left: 1rem;
    grid-template-columns: 1fr;
  }

  .chat-window {
    padding-bottom: 9.2rem;
  }

  .chat-notice,
  .context-bar,
  .dashboard-head,
  .admin-hero,
  .panel-title,
  .request-row,
  .chat-row,
  .admin-item {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-hero {
    align-items: flex-start;
  }

  .admin-hero-actions {
    justify-items: start;
    width: 100%;
  }

  .admin-nav {
    width: 100%;
    border-radius: 22px;
  }

  .admin-nav a {
    flex: 1 1 auto;
    justify-content: center;
  }

  .agent-status-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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