:root {
  color-scheme: dark;
  --ink: #f5f2ea;
  --muted: #9b9da5;
  --muted-2: #6f717a;
  --base: #101114;
  --base-2: #15171b;
  --panel: rgba(28, 30, 35, 0.88);
  --panel-solid: #1b1d22;
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.16);
  --stim: #f4a261;
  --stim-soft: rgba(244, 162, 97, 0.14);
  --brim: #61d6c7;
  --brim-soft: rgba(97, 214, 199, 0.14);
  --danger: #ff6b73;
  --danger-soft: rgba(255, 107, 115, 0.13);
  --good: #7ce4ad;
  --good-soft: rgba(124, 228, 173, 0.13);
  --warning: #f7c66b;
  --warning-soft: rgba(247, 198, 107, 0.13);
  --accent: var(--stim);
  --accent-soft: var(--stim-soft);
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.34);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--base);
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 0%, color-mix(in srgb, var(--accent) 13%, transparent), transparent 38rem),
    radial-gradient(circle at 92% 20%, rgba(97, 214, 199, 0.08), transparent 34rem),
    linear-gradient(145deg, #0d0e10 0%, #121318 50%, #0e0f12 100%);
  transition: background 240ms ease;
}

body[data-band="brim"] {
  --accent: var(--brim);
  --accent-soft: var(--brim-soft);
}

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

button {
  color: inherit;
}

a {
  color: var(--accent);
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.boot-screen,
.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
}

.boot-screen {
  align-content: center;
  gap: 18px;
  color: var(--muted);
}

.boot-screen p {
  margin: 0;
  font-size: 14px;
  letter-spacing: 0.06em;
}

.boot-mark,
.brand-mark {
  display: grid;
  grid-template-columns: 1fr 1fr;
  overflow: hidden;
  color: #101114;
  font-weight: 900;
  letter-spacing: -0.08em;
  border-radius: 13px;
  box-shadow: 0 12px 38px rgba(0, 0, 0, 0.3);
}

.boot-mark {
  width: 70px;
  height: 70px;
  font-size: 26px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  font-size: 16px;
  flex: 0 0 auto;
}

.boot-mark span,
.brand-mark span {
  display: grid;
  place-items: center;
  padding-right: 2px;
}

.boot-mark span:first-child,
.brand-mark span:first-child {
  background: var(--stim);
}

.boot-mark span:last-child,
.brand-mark span:last-child {
  background: var(--brim);
}

.login-card {
  width: min(100%, 460px);
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: linear-gradient(160deg, rgba(31, 33, 39, 0.96), rgba(20, 22, 26, 0.96));
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px);
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 38px;
}

.login-brand__copy strong {
  display: block;
  font-size: 18px;
  letter-spacing: 0.01em;
}

.login-brand__copy span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.login-card h1 {
  margin: 0;
  font-size: clamp(30px, 7vw, 46px);
  line-height: 0.98;
  letter-spacing: -0.05em;
}

.login-card > p {
  margin: 16px 0 28px;
  color: var(--muted);
  line-height: 1.6;
}

.field {
  display: grid;
  gap: 8px;
}

.field + .field {
  margin-top: 16px;
}

.field label,
.field > span {
  color: #c7c8cd;
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  min-height: 46px;
  padding: 11px 13px;
  color: var(--ink);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: rgba(7, 8, 10, 0.48);
  transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.field textarea {
  min-height: 108px;
  resize: vertical;
  line-height: 1.5;
}

.field input:hover,
.field textarea:hover,
.field select:hover {
  border-color: rgba(255, 255, 255, 0.25);
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
  background: rgba(7, 8, 10, 0.72);
  outline: none;
}

.field small {
  color: var(--muted-2);
  line-height: 1.45;
}

.login-submit {
  width: 100%;
  margin-top: 18px;
}

.login-note {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  margin-top: 22px;
  padding-top: 20px;
  color: var(--muted-2);
  border-top: 1px solid var(--line);
  font-size: 12px;
  line-height: 1.5;
}

.login-note::before {
  content: "";
  width: 7px;
  height: 7px;
  margin-top: 5px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--good);
  box-shadow: 0 0 0 4px var(--good-soft);
}

.portal {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  align-items: center;
  min-height: 70px;
  padding: 12px clamp(16px, 3vw, 42px);
  border-bottom: 1px solid var(--line);
  background: rgba(13, 14, 17, 0.83);
  backdrop-filter: blur(22px) saturate(145%);
}

.topbar__brand {
  display: flex;
  align-items: center;
  min-width: 205px;
  gap: 12px;
}

.topbar__brand-copy strong {
  display: block;
  font-size: 14px;
  letter-spacing: 0.02em;
}

.topbar__brand-copy span {
  display: block;
  margin-top: 2px;
  color: var(--muted-2);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.band-tabs {
  display: flex;
  align-items: center;
  gap: 5px;
  margin: 0 auto;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.035);
}

.band-tab {
  min-width: 112px;
  padding: 9px 18px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.1em;
  transition: color 150ms ease, background 150ms ease, box-shadow 150ms ease;
}

.band-tab:hover {
  color: var(--ink);
}

.band-tab.is-active {
  color: #101114;
  background: var(--accent);
  box-shadow: 0 7px 20px color-mix(in srgb, var(--accent) 24%, transparent);
}

.topbar__actions {
  display: flex;
  min-width: 205px;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
}

.role-pill,
.status-pill,
.count-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 28px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.035);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.role-pill::before,
.status-pill::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.role-pill--owner {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 26%, transparent);
  background: var(--accent-soft);
}

.status-pill--good {
  color: var(--good);
  border-color: rgba(124, 228, 173, 0.25);
  background: var(--good-soft);
}

.status-pill--locked {
  color: var(--warning);
  border-color: rgba(247, 198, 107, 0.22);
  background: var(--warning-soft);
}

.status-pill--danger {
  color: var(--danger);
  border-color: rgba(255, 107, 115, 0.22);
  background: var(--danger-soft);
}

.portal-main {
  width: min(1460px, 100%);
  margin: 0 auto;
  padding: clamp(22px, 4vw, 48px) clamp(16px, 3vw, 42px) 70px;
}

.page-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: end;
  margin-bottom: 26px;
}

.eyebrow {
  margin: 0 0 9px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.page-head h1 {
  margin: 0;
  font-size: clamp(35px, 5vw, 64px);
  line-height: 0.95;
  letter-spacing: -0.055em;
}

.page-head__summary {
  max-width: 620px;
  margin: 15px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}

.connection-summary {
  display: grid;
  min-width: 245px;
  gap: 10px;
  justify-items: end;
}

.connection-summary strong {
  font-size: 13px;
}

.connection-summary span:not(.status-pill) {
  color: var(--muted-2);
  font-size: 12px;
}

.section-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 22px;
  padding: 5px;
  width: fit-content;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.025);
}

.section-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 9px 14px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 750;
  transition: color 140ms ease, background 140ms ease;
}

.section-tab:hover {
  color: var(--ink);
}

.section-tab.is-active {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.08);
}

.section-tab svg,
.button svg,
.icon-button svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--panel);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.16);
  overflow: hidden;
}

.panel + .panel {
  margin-top: 18px;
}

.panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 66px;
  padding: 17px 20px;
  border-bottom: 1px solid var(--line);
}

.panel__head h2,
.panel__head h3 {
  margin: 0;
  font-size: 15px;
  letter-spacing: -0.01em;
}

.panel__head p {
  margin: 4px 0 0;
  color: var(--muted-2);
  font-size: 12px;
}

.panel__body {
  padding: 20px;
}

.panel__body--flush {
  padding: 0;
}

.grid {
  display: grid;
  gap: 18px;
}

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

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

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 9px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.055);
  color: var(--ink);
  cursor: pointer;
  font-size: 12px;
  font-weight: 780;
  transition: transform 120ms ease, border-color 120ms ease, background 120ms ease, opacity 120ms ease;
}

.button:hover:not(:disabled) {
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.09);
  transform: translateY(-1px);
}

.button:active:not(:disabled) {
  transform: translateY(0);
}

.button:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.button--primary {
  color: #101114;
  border-color: var(--accent);
  background: var(--accent);
}

.button--primary:hover:not(:disabled) {
  border-color: color-mix(in srgb, var(--accent) 88%, white);
  background: color-mix(in srgb, var(--accent) 88%, white);
}

.button--danger {
  color: var(--danger);
  border-color: rgba(255, 107, 115, 0.24);
  background: var(--danger-soft);
}

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

.button--small {
  min-height: 32px;
  padding: 6px 10px;
  font-size: 11px;
}

.icon-button {
  display: inline-grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted);
  cursor: pointer;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.toolbar__group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.metric {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.026);
}

.metric span {
  display: block;
  color: var(--muted-2);
  font-size: 10px;
  font-weight: 780;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.metric strong {
  display: block;
  margin-top: 8px;
  font-size: 25px;
  letter-spacing: -0.035em;
}

.metric small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
}

.empty-state,
.error-state,
.locked-state,
.loading-state {
  display: grid;
  min-height: 280px;
  place-items: center;
  padding: 40px 24px;
  text-align: center;
}

.empty-state__inner,
.error-state__inner,
.locked-state__inner {
  max-width: 510px;
}

.empty-icon,
.locked-icon {
  display: grid;
  width: 58px;
  height: 58px;
  margin: 0 auto 18px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  color: var(--accent);
  background: var(--accent-soft);
}

.empty-icon svg,
.locked-icon svg {
  width: 25px;
  height: 25px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.empty-state h3,
.error-state h3,
.locked-state h3 {
  margin: 0;
  font-size: 20px;
  letter-spacing: -0.025em;
}

.empty-state p,
.error-state p,
.locked-state p {
  margin: 10px auto 0;
  color: var(--muted);
  line-height: 1.6;
}

.empty-state .button,
.error-state .button {
  margin-top: 20px;
}

.loading-state {
  min-height: 220px;
  color: var(--muted);
}

.spinner {
  width: 28px;
  height: 28px;
  margin: 0 auto 14px;
  border: 3px solid rgba(255, 255, 255, 0.09);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 720ms linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.inbox-layout {
  display: grid;
  min-height: 610px;
  grid-template-columns: minmax(290px, 0.76fr) minmax(0, 1.5fr);
}

.thread-list {
  border-right: 1px solid var(--line);
  overflow: auto;
  max-height: 710px;
}

.thread-list__head {
  position: sticky;
  z-index: 2;
  top: 0;
  padding: 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(27, 29, 34, 0.96);
  backdrop-filter: blur(12px);
}

.thread-row {
  width: 100%;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 11px;
  align-items: center;
  padding: 15px 16px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: inherit;
  cursor: pointer;
  text-align: left;
}

.thread-row:hover,
.thread-row.is-active {
  background: rgba(255, 255, 255, 0.045);
}

.thread-row.is-active {
  box-shadow: inset 3px 0 0 var(--accent);
}

.avatar {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  border-radius: 14px;
  color: var(--accent);
  background: var(--accent-soft);
  font-weight: 850;
  text-transform: uppercase;
}

.thread-row__copy {
  min-width: 0;
}

.thread-row__copy strong,
.thread-row__copy span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.thread-row__copy strong {
  font-size: 13px;
}

.thread-row__copy span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
}

.thread-row time {
  color: var(--muted-2);
  font-size: 10px;
}

.conversation {
  display: grid;
  min-width: 0;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.conversation__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 70px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}

.conversation__identity {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.conversation__identity strong,
.conversation__identity span {
  display: block;
}

.conversation__identity strong {
  font-size: 14px;
}

.conversation__identity span {
  margin-top: 3px;
  color: var(--muted-2);
  font-size: 11px;
}

.messages {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 22px;
  overflow: auto;
  max-height: 540px;
}

.message {
  width: fit-content;
  max-width: min(76%, 620px);
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 15px 15px 15px 5px;
  background: rgba(255, 255, 255, 0.055);
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.message--outbound {
  margin-left: auto;
  border-color: color-mix(in srgb, var(--accent) 25%, transparent);
  border-radius: 15px 15px 5px 15px;
  background: var(--accent-soft);
}

.message time {
  display: block;
  margin-top: 6px;
  color: var(--muted-2);
  font-size: 9px;
}

.composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 14px;
  border-top: 1px solid var(--line);
}

.composer textarea {
  min-height: 44px;
  max-height: 130px;
  resize: vertical;
  padding: 11px 13px;
  color: var(--ink);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: rgba(7, 8, 10, 0.4);
}

.card-list {
  display: grid;
  gap: 12px;
}

.automation-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.025);
}

.automation-card__top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
}

.automation-card h3 {
  margin: 0;
  font-size: 14px;
}

.automation-card p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.automation-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 11px;
  color: var(--muted-2);
  font-size: 10px;
}

.automation-card__actions {
  display: flex;
  align-items: center;
  gap: 7px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 23px;
  padding: 4px 8px;
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.055);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.tag--active {
  color: var(--good);
  background: var(--good-soft);
}

.tag--paused,
.tag--draft {
  color: var(--warning);
  background: var(--warning-soft);
}

.safety-grid {
  display: grid;
  gap: 12px;
}

.safety-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px;
  align-items: center;
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
}

.safety-row:last-child {
  border-bottom: 0;
}

.safety-row strong,
.safety-row span {
  display: block;
}

.safety-row strong {
  font-size: 13px;
}

.safety-row span {
  margin-top: 4px;
  color: var(--muted-2);
  font-size: 11px;
  line-height: 1.5;
}

.switch {
  position: relative;
  display: inline-flex;
  width: 44px;
  height: 25px;
}

.switch input {
  width: 1px;
  height: 1px;
  opacity: 0;
}

.switch span {
  position: absolute;
  inset: 0;
  margin: 0;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  cursor: pointer;
  transition: background 150ms ease, border-color 150ms ease;
}

.switch span::after {
  content: "";
  position: absolute;
  width: 17px;
  height: 17px;
  left: 3px;
  top: 3px;
  border-radius: 50%;
  background: var(--muted);
  transition: transform 150ms ease, background 150ms ease;
}

.switch input:checked + span {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.switch input:checked + span::after {
  transform: translateX(19px);
  background: var(--accent);
}

.switch input:disabled + span {
  cursor: not-allowed;
  opacity: 0.45;
}

.notice {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 15px;
  border: 1px solid var(--line);
  border-radius: 13px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.03);
  font-size: 12px;
  line-height: 1.55;
}

.notice--warning {
  color: #e9c580;
  border-color: rgba(247, 198, 107, 0.21);
  background: var(--warning-soft);
}

.notice--danger {
  color: #ff9aa0;
  border-color: rgba(255, 107, 115, 0.23);
  background: var(--danger-soft);
}

.notice--good {
  color: #a7ecc5;
  border-color: rgba(124, 228, 173, 0.23);
  background: var(--good-soft);
}

.notice__icon {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  margin-top: 5px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 4px color-mix(in srgb, currentColor 14%, transparent);
}

.modal-backdrop {
  position: fixed;
  z-index: 60;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(4, 5, 7, 0.73);
  backdrop-filter: blur(9px);
}

.modal {
  width: min(100%, 680px);
  max-height: min(90vh, 920px);
  overflow: auto;
  border: 1px solid var(--line-strong);
  border-radius: 22px;
  background: #1a1c21;
  box-shadow: 0 30px 110px rgba(0, 0, 0, 0.52);
}

.modal__head {
  position: sticky;
  z-index: 2;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
  background: rgba(26, 28, 33, 0.97);
  backdrop-filter: blur(12px);
}

.modal__head h2 {
  margin: 0;
  font-size: 17px;
}

.modal__body {
  padding: 20px;
}

.modal__actions {
  position: sticky;
  bottom: 0;
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  padding: 15px 20px;
  border-top: 1px solid var(--line);
  background: rgba(26, 28, 33, 0.97);
  backdrop-filter: blur(12px);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.form-grid .field--full {
  grid-column: 1 / -1;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.025);
}

.check-row input {
  width: 17px;
  height: 17px;
  accent-color: var(--accent);
}

.check-row span {
  font-size: 12px;
}

.toast-stack {
  position: fixed;
  z-index: 90;
  right: 18px;
  bottom: 18px;
  display: grid;
  width: min(380px, calc(100vw - 36px));
  gap: 9px;
}

.toast {
  padding: 13px 15px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: rgba(29, 31, 36, 0.97);
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.35);
  color: var(--ink);
  font-size: 12px;
  line-height: 1.5;
  animation: toast-in 170ms ease-out;
}

.toast--error {
  border-color: rgba(255, 107, 115, 0.34);
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
}

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

@media (max-width: 900px) {
  .topbar {
    flex-wrap: wrap;
    gap: 10px;
  }

  .topbar__brand,
  .topbar__actions {
    min-width: auto;
  }

  .band-tabs {
    order: 3;
    width: 100%;
  }

  .band-tab {
    flex: 1;
  }

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

  .connection-summary {
    justify-items: start;
  }

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

  .inbox-layout {
    grid-template-columns: 1fr;
  }

  .thread-list {
    max-height: 320px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
}

@media (max-width: 680px) {
  .login-screen {
    padding: 14px;
  }

  .login-card {
    padding: 26px 20px;
    border-radius: 22px;
  }

  .topbar {
    padding-inline: 14px;
  }

  .topbar__brand-copy span,
  .role-pill {
    display: none;
  }

  .portal-main {
    padding-inline: 13px;
  }

  .page-head h1 {
    font-size: 42px;
  }

  .section-tabs {
    width: 100%;
  }

  .section-tab {
    flex: 1;
    justify-content: center;
  }

  .grid--2,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .form-grid .field--full {
    grid-column: auto;
  }

  .automation-card {
    grid-template-columns: 1fr;
  }

  .automation-card__actions {
    justify-content: flex-start;
  }

  .panel__head {
    align-items: flex-start;
    flex-direction: column;
  }

  .panel__head .button {
    width: 100%;
  }

  .conversation__head {
    align-items: flex-start;
    flex-direction: column;
  }

  .message {
    max-width: 88%;
  }

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

  .composer .button {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
