/* RelayDesk shared design system ------------------------------------------ */

:root,
[data-theme="night"] {
  color-scheme: dark;
  --bg: #070b10;
  --bg-soft: #0a1017;
  --panel: #101a24;
  --panel-2: #15222e;
  --panel-3: #1b2a38;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #e9eff6;
  --muted: #95a6b8;
  --faint: #6d7f92;
  --accent: #3ddc97;
  --accent-2: #9ebeff;
  --accent-warm: #ffb45a;
  --accent-ink: #04140d;
  --danger: #ff8b8b;
  --danger-soft: rgba(255, 139, 139, 0.12);
  --warn: #ffb45a;
  --warn-soft: rgba(255, 180, 90, 0.14);
  --ok-soft: rgba(61, 220, 151, 0.14);
  --wash: rgba(255, 255, 255, 0.03);
  --wash-hover: rgba(255, 255, 255, 0.05);
  --wash-strong: rgba(255, 255, 255, 0.08);
  --wash-border-hover: rgba(255, 255, 255, 0.24);
  --btn-fill: rgba(255, 255, 255, 0.04);
  --input-bg: rgba(4, 8, 12, 0.6);
  --inset-bg: rgba(4, 8, 12, 0.5);
  --switch-track: rgba(255, 255, 255, 0.12);
  --switch-knob: #c7d3df;
  --progress-track: rgba(255, 255, 255, 0.08);
  --spinner-track: rgba(255, 255, 255, 0.12);
  --card-bg: linear-gradient(180deg, rgba(21, 34, 46, 0.92), rgba(13, 20, 28, 0.92));
  --step-bg: linear-gradient(180deg, rgba(21, 34, 46, 0.7), rgba(13, 20, 28, 0.7));
  --modal-bg: linear-gradient(180deg, #16222e, #0e161f);
  --modal-backdrop: rgba(3, 6, 9, 0.72);
  --toast-bg: rgba(16, 26, 36, 0.97);
  --toolbar-bg: rgba(16, 26, 36, 0.7);
  --picker-bg: rgba(255, 255, 255, 0.02);
  --segment-bg: rgba(0, 0, 0, 0.25);
  --tile-bg: rgba(0, 0, 0, 0.28);
  --control-hint-bg: rgba(4, 20, 13, 0.9);
  --bg-glow-a: rgba(61, 220, 151, 0.14);
  --bg-glow-b: rgba(255, 180, 90, 0.1);
  --bg-gradient: linear-gradient(180deg, #080d13 0%, #070b10 100%);
  --brand-mark-bg: linear-gradient(150deg, rgba(61, 220, 151, 0.22), rgba(255, 180, 90, 0.16));
  --accent-border: rgba(61, 220, 151, 0.35);
  --accent-border-strong: rgba(61, 220, 151, 0.55);
  --accent-border-soft: rgba(61, 220, 151, 0.22);
  --accent-border-mid: rgba(61, 220, 151, 0.28);
  --accent-border-alert: rgba(61, 220, 151, 0.3);
  --accent-border-toast: rgba(61, 220, 151, 0.4);
  --accent-fill: rgba(61, 220, 151, 0.18);
  --accent-fill-strong: rgba(61, 220, 151, 0.35);
  --accent-ring-soft: rgba(61, 220, 151, 0.25);
  --accent-glow: rgba(61, 220, 151, 0.25);
  --accent-2-soft: rgba(158, 190, 255, 0.14);
  --accent-2-border: rgba(158, 190, 255, 0.3);
  --accent-warm-soft: rgba(255, 180, 90, 0.14);
  --accent-warm-border: rgba(255, 180, 90, 0.35);
  --warn-border: rgba(255, 180, 90, 0.35);
  --warn-border-soft: rgba(255, 180, 90, 0.3);
  --danger-border: rgba(255, 139, 139, 0.35);
  --danger-border-toast: rgba(255, 139, 139, 0.4);
  --danger-hover: rgba(255, 139, 139, 0.2);
  --primary-btn: linear-gradient(180deg, #55e8a8, #3ddc97);
  --primary-btn-hover: linear-gradient(180deg, #6ef0b6, #32d08a);
  --code-glow: 0 0 34px rgba(61, 220, 151, 0.28);
  --feature-icon-bg: rgba(61, 220, 151, 0.12);
  --stage-overlay: radial-gradient(600px 300px at 50% 40%, rgba(21, 34, 46, 0.6), rgba(4, 7, 10, 0.85));
  --radius-lg: 24px;
  --radius: 16px;
  --radius-sm: 11px;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.5);
  --shadow-soft: 0 12px 34px rgba(0, 0, 0, 0.32);
  --font: "Segoe UI", Ubuntu, Cantarell, "Noto Sans", "Liberation Sans", system-ui, sans-serif;
  --mono: "Cascadia Code", "Ubuntu Mono", "Noto Sans Mono", "Liberation Mono", ui-monospace, Menlo, Consolas, monospace;
  --ring: 0 0 0 3px rgba(61, 220, 151, 0.35);
}

[data-theme="day"] {
  color-scheme: light;
  --bg: #f3f6f5;
  --bg-soft: #e8eef0;
  --panel: #ffffff;
  --panel-2: #f7faf9;
  --panel-3: #eef3f2;
  --border: rgba(18, 32, 43, 0.1);
  --border-strong: rgba(18, 32, 43, 0.18);
  --text: #12202b;
  --muted: #3d5163;
  --faint: #526577;
  --accent: #0c7a52;
  --accent-2: #3b6fd4;
  --accent-warm: #c56a12;
  --accent-ink: #04140d;
  --danger: #9f1d28;
  --danger-soft: rgba(159, 29, 40, 0.1);
  --warn: #c56a12;
  --warn-soft: rgba(197, 106, 18, 0.12);
  --ok-soft: rgba(12, 122, 82, 0.1);
  --wash: rgba(18, 32, 43, 0.03);
  --wash-hover: rgba(18, 32, 43, 0.06);
  --wash-strong: rgba(18, 32, 43, 0.09);
  --wash-border-hover: rgba(18, 32, 43, 0.22);
  --btn-fill: rgba(18, 32, 43, 0.04);
  --input-bg: rgba(255, 255, 255, 0.92);
  --inset-bg: rgba(18, 32, 43, 0.04);
  --switch-track: rgba(18, 32, 43, 0.14);
  --switch-knob: #ffffff;
  --progress-track: rgba(18, 32, 43, 0.1);
  --spinner-track: rgba(18, 32, 43, 0.14);
  --card-bg: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 250, 249, 0.96));
  --step-bg: linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(238, 243, 242, 0.95));
  --modal-bg: linear-gradient(180deg, #ffffff, #f3f6f5);
  --modal-backdrop: rgba(18, 32, 43, 0.42);
  --toast-bg: rgba(255, 255, 255, 0.97);
  --toolbar-bg: rgba(255, 255, 255, 0.88);
  --picker-bg: rgba(18, 32, 43, 0.03);
  --segment-bg: rgba(18, 32, 43, 0.06);
  --tile-bg: rgba(255, 255, 255, 0.9);
  --control-hint-bg: rgba(232, 248, 239, 0.95);
  --bg-glow-a: rgba(12, 122, 82, 0.1);
  --bg-glow-b: rgba(197, 106, 18, 0.08);
  --bg-gradient: linear-gradient(180deg, #f7faf9 0%, #eef3f2 100%);
  --brand-mark-bg: linear-gradient(150deg, rgba(12, 122, 82, 0.14), rgba(197, 106, 18, 0.12));
  --accent-border: rgba(12, 122, 82, 0.35);
  --accent-border-strong: rgba(12, 122, 82, 0.55);
  --accent-border-soft: rgba(12, 122, 82, 0.22);
  --accent-border-mid: rgba(12, 122, 82, 0.28);
  --accent-border-alert: rgba(12, 122, 82, 0.3);
  --accent-border-toast: rgba(12, 122, 82, 0.4);
  --accent-fill: rgba(12, 122, 82, 0.14);
  --accent-fill-strong: rgba(12, 122, 82, 0.28);
  --accent-ring-soft: rgba(12, 122, 82, 0.22);
  --accent-glow: rgba(12, 122, 82, 0.18);
  --accent-2-soft: rgba(59, 111, 212, 0.1);
  --accent-2-border: rgba(59, 111, 212, 0.28);
  --accent-warm-soft: rgba(197, 106, 18, 0.12);
  --accent-warm-border: rgba(197, 106, 18, 0.32);
  --warn-border: rgba(197, 106, 18, 0.35);
  --warn-border-soft: rgba(197, 106, 18, 0.3);
  --danger-border: rgba(159, 29, 40, 0.35);
  --danger-border-toast: rgba(159, 29, 40, 0.4);
  --danger-hover: rgba(159, 29, 40, 0.16);
  --primary-btn: linear-gradient(180deg, #55e8a8, #3ddc97);
  --primary-btn-hover: linear-gradient(180deg, #6ef0b6, #32d08a);
  --code-glow: 0 0 24px rgba(12, 122, 82, 0.18);
  --feature-icon-bg: rgba(12, 122, 82, 0.1);
  --stage-overlay: radial-gradient(600px 300px at 50% 40%, rgba(21, 34, 46, 0.6), rgba(4, 7, 10, 0.85));
  --shadow: 0 24px 70px rgba(18, 32, 43, 0.12);
  --shadow-soft: 0 12px 34px rgba(18, 32, 43, 0.08);
  --ring: 0 0 0 3px rgba(12, 122, 82, 0.28);
}

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

button {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background-color: var(--bg);
  background-image:
    radial-gradient(1000px 600px at 12% -10%, var(--bg-glow-a), transparent 60%),
    radial-gradient(900px 600px at 100% 0%, var(--bg-glow-b), transparent 55%),
    var(--bg-gradient);
  background-attachment: fixed;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

p {
  margin: 0;
}

a {
  color: var(--accent-2);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

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

:focus-visible {
  outline: none;
  box-shadow: var(--ring);
  border-radius: 8px;
}

[hidden] {
  display: none !important;
}

.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;
}

/* Layout ------------------------------------------------------------------ */
/* Bootstrap-aligned breakpoints:
   xs <576 | sm ≥576 | md ≥768 | lg ≥992 | xl ≥1200 | xxl ≥1400 */

.app {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  padding: 16px 14px 40px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--text);
}

.brand:hover {
  text-decoration: none;
}

.brand__mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--brand-mark-bg);
  border: 1px solid var(--border-strong);
  color: var(--accent);
  overflow: hidden;
  padding: 0;
}

.brand__mark-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.brand__name {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand__name span {
  color: var(--muted);
  font-weight: 500;
}

.topbar__nav {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.topbar__nav a {
  color: var(--muted);
  font-size: 14px;
  padding: 8px 10px;
  border-radius: 10px;
}

.topbar__nav a:hover {
  color: var(--text);
  background: var(--wash-hover);
  text-decoration: none;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 11px;
  border: 1px solid var(--border);
  background: var(--wash);
  color: var(--muted);
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
}

.theme-toggle:hover {
  color: var(--text);
  background: var(--wash-hover);
  border-color: var(--border-strong);
}

.theme-toggle:focus-visible {
  box-shadow: var(--ring);
}

.theme-toggle svg {
  display: block;
  animation: theme-swap 320ms ease;
}

.theme-toggle [data-theme-icon] {
  display: none;
}

[data-theme="night"] .theme-toggle [data-theme-icon="sun"],
[data-theme="day"] .theme-toggle [data-theme-icon="moon"] {
  display: block;
}

.page-head {
  margin-bottom: 26px;
}

.page-head h1 {
  font-size: clamp(26px, 4vw, 38px);
}

.page-head p {
  color: var(--muted);
  margin-top: 8px;
  max-width: 60ch;
}

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

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

.grid--sidebar {
  align-items: start;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.row--between {
  justify-content: space-between;
}

.row--wrap {
  flex-wrap: wrap;
}

.spacer {
  flex: 1;
}

/* Cards ------------------------------------------------------------------- */

.card {
  position: relative;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: clamp(20px, 3vw, 28px);
  box-shadow: var(--shadow-soft);
}

.card--flat {
  background: var(--panel);
  box-shadow: none;
}

.card__title {
  font-size: 17px;
  font-weight: 650;
}

.card__subtitle {
  color: var(--muted);
  font-size: 14px;
  margin-top: 5px;
}

.card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

/* Pills + badges ---------------------------------------------------------- */

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--wash);
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
  transition: color 200ms ease, background 200ms ease, border-color 200ms ease;
}

.pill--accent {
  color: var(--accent);
  border-color: var(--accent-border);
  background: var(--ok-soft);
}

.pill--warn {
  color: var(--warn);
  border-color: var(--warn-border);
  background: var(--warn-soft);
}

.pill--danger {
  color: var(--danger);
  border-color: var(--danger-border);
  background: var(--danger-soft);
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 0 currentColor;
}

.dot--live {
  animation: pulse 2s ease-out infinite;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 var(--accent-border-toast);
  }
  70% {
    box-shadow: 0 0 0 9px transparent;
  }
  100% {
    box-shadow: 0 0 0 0 transparent;
  }
}

/* Buttons ----------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 11px 18px;
  border-radius: 12px;
  border: 1px solid var(--border-strong);
  background: var(--btn-fill);
  color: var(--text);
  font-weight: 600;
  font-size: 14.5px;
  cursor: pointer;
  transition: transform 120ms ease, background 160ms ease, border-color 160ms ease, opacity 160ms ease;
  white-space: nowrap;
}

.btn:hover:not(:disabled) {
  background: var(--wash-strong);
  border-color: var(--wash-border-hover);
}

.btn svg {
  transition: transform 180ms ease;
}

.btn:hover:not(:disabled) svg {
  transform: translateX(4px);
}

.btn:active:not(:disabled) {
  transform: translateY(1px) scale(0.985);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn--primary {
  background: var(--primary-btn);
  border-color: transparent;
  color: var(--accent-ink);
}

.btn--primary:hover:not(:disabled) {
  background: var(--primary-btn-hover);
}

.btn--danger {
  background: var(--danger-soft);
  border-color: var(--danger-border);
  color: var(--danger);
}

.btn--danger:hover:not(:disabled) {
  background: var(--danger-hover);
}

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

.btn--ghost:hover:not(:disabled) {
  color: var(--text);
  background: var(--wash-hover);
}

.btn--block {
  width: 100%;
}

.btn--lg {
  padding: 14px 22px;
  font-size: 16px;
  border-radius: 14px;
}

.btn--sm {
  padding: 8px 13px;
  font-size: 13.5px;
  border-radius: 10px;
}

.btn--icon {
  padding: 10px;
  border-radius: 11px;
}

/* Forms ------------------------------------------------------------------- */

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field__label {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--muted);
}

.input {
  width: 100%;
  padding: 13px 15px;
  border-radius: 12px;
  border: 1px solid var(--border-strong);
  background: var(--input-bg);
  color: var(--text);
  transition: border-color 160ms ease, background 160ms ease;
}

.input::placeholder {
  color: var(--faint);
}

.input:focus {
  outline: none;
  border-color: var(--accent-border-strong);
  box-shadow: var(--ring);
}

.input--code {
  font-family: var(--mono);
  font-size: clamp(28px, 7vw, 40px);
  letter-spacing: 0.32em;
  text-align: center;
  padding: 20px 10px 20px 30px;
  font-weight: 600;
}

.input--code::placeholder {
  letter-spacing: 0.32em;
  color: var(--faint);
}

.hint {
  font-size: 13px;
  color: var(--faint);
}

.switch {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  user-select: none;
}

.switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.switch__track {
  position: relative;
  width: 46px;
  height: 26px;
  border-radius: 999px;
  background: var(--switch-track);
  border: 1px solid var(--border);
  transition: background 180ms ease;
  flex: none;
}

.switch__track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--switch-knob);
  transition: transform 180ms ease, background 180ms ease;
}

.switch input:checked + .switch__track {
  background: var(--accent-fill-strong);
  border-color: var(--accent-border-strong);
}

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

[data-theme="day"] .switch input:checked + .switch__track::after {
  background: #5ef2b0;
}

.switch input:focus-visible + .switch__track {
  box-shadow: var(--ring);
}

.switch input:disabled + .switch__track {
  opacity: 0.45;
}

.switch__label {
  font-size: 14px;
  color: var(--text);
}

.switch__meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.switch__meta small {
  color: var(--faint);
  font-size: 12.5px;
}

/* Code display ------------------------------------------------------------ */

.code-display {
  font-family: var(--mono);
  font-weight: 700;
  font-size: clamp(36px, 9vw, 58px);
  letter-spacing: 0.16em;
  line-height: 1;
  padding-left: 0.16em;
  color: var(--text);
  text-shadow: var(--code-glow);
  user-select: all;
  word-break: break-word;
}

.code-display--muted {
  color: var(--faint);
  text-shadow: none;
}

.progress {
  height: 6px;
  border-radius: 999px;
  background: var(--progress-track);
  overflow: hidden;
}

.progress__bar {
  height: 100%;
  width: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #5ef2b0, #7cc4ff);
  transition: width 950ms linear;
}

.progress__bar--expiring {
  background: linear-gradient(90deg, var(--warn), var(--danger));
}

/* Alerts ------------------------------------------------------------------ */

.alert {
  display: flex;
  gap: 11px;
  padding: 13px 15px;
  border-radius: 13px;
  border: 1px solid var(--border);
  background: var(--wash);
  font-size: 14px;
  color: var(--muted);
  animation: rise 220ms ease;
}

.alert--error {
  color: var(--danger);
  border-color: var(--danger-border);
  background: var(--danger-soft);
}

.alert--warn {
  color: var(--warn);
  border-color: var(--warn-border-soft);
  background: var(--warn-soft);
}

.alert--ok {
  color: var(--accent);
  border-color: var(--accent-border-alert);
  background: var(--ok-soft);
}

.alert__icon {
  flex: none;
  margin-top: 2px;
}

/* Stats ------------------------------------------------------------------- */

.stat {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.stat__label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--faint);
}

.stat__value {
  font-family: var(--mono);
  font-size: 15px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 16px;
}

/* Video stage ------------------------------------------------------------- */

.stage {
  position: relative;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: #04070a;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  box-shadow: var(--shadow);
}

.stage video,
.stage canvas {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #04070a;
}

.stage--preview {
  aspect-ratio: 16 / 9;
}

.stage__overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-align: center;
  padding: 24px;
  color: #95a6b8;
  background: var(--stage-overlay);
}

.stage__badge {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 3;
}

.stage__chip {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 3;
}

/* Spinner ----------------------------------------------------------------- */

.spinner {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 3px solid var(--spinner-track);
  border-top-color: var(--accent);
  animation: spin 900ms linear infinite;
}

.spinner--sm {
  width: 18px;
  height: 18px;
  border-width: 2px;
}

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

/* Modal ------------------------------------------------------------------- */

dialog.modal {
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 0;
  width: min(480px, calc(100vw - 32px));
  color: var(--text);
  background: var(--modal-bg);
  box-shadow: var(--shadow);
}

dialog.modal[open] {
  animation: modal-in 260ms cubic-bezier(0.16, 1, 0.3, 1);
}

dialog.modal[open]::backdrop {
  background: var(--modal-backdrop);
  backdrop-filter: blur(3px);
  animation: backdrop-in 260ms ease;
}

.modal__body {
  padding: 26px;
}

.modal__title {
  font-size: 19px;
  margin-bottom: 6px;
}

.modal__text {
  color: var(--muted);
  font-size: 14.5px;
}

.modal__actions {
  display: flex;
  gap: 10px;
  margin-top: 22px;
}

.modal__actions .btn {
  flex: 1;
}

.request-card {
  margin-top: 18px;
  padding: 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--inset-bg);
  display: grid;
  gap: 12px;
}

.request-card__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 14px;
}

.request-card__row span:first-child {
  color: var(--faint);
}

.request-card__row span:last-child {
  font-family: var(--mono);
  color: var(--text);
  text-align: right;
  overflow-wrap: anywhere;
}

/* Toasts ------------------------------------------------------------------ */

.toasts {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 1000;
  width: min(440px, calc(100vw - 32px));
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  border-radius: 13px;
  border: 1px solid var(--border-strong);
  background: var(--toast-bg);
  box-shadow: var(--shadow-soft);
  font-size: 14px;
  color: var(--text);
  animation: toast-in 200ms ease;
}

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

.toast--success {
  border-color: var(--accent-border-toast);
}

.toast--leaving {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 200ms ease, transform 200ms ease;
}

.toast__text {
  flex: 1;
}

.toast__action {
  border: none;
  background: none;
  color: var(--accent);
  font-weight: 600;
  cursor: pointer;
}

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

/* Motion ------------------------------------------------------------------ */

.brand__mark {
  animation: mark-in 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) backwards;
}

.page-head,
.grid > .card,
.stack > .card,
.waiting-card {
  animation: rise 0.5s ease backwards;
}

.grid > .card:nth-child(2),
.stack > .card:nth-child(2) {
  animation-delay: 70ms;
}

.stack > .card:nth-child(3) {
  animation-delay: 120ms;
}

.stage {
  animation: screen-on 0.75s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.is-arrive {
  animation: arrive 0.55s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes mark-in {
  from {
    opacity: 0;
    transform: scale(0.86) rotate(-8deg);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes theme-swap {
  from {
    opacity: 0;
    transform: rotate(-35deg) scale(0.7);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes screen-on {
  0% {
    opacity: 0;
    clip-path: inset(46% 8% 46% 8%);
    filter: brightness(1.8);
  }
  45% {
    opacity: 1;
    clip-path: inset(42% 0 42% 0);
    filter: brightness(1.35);
  }
  100% {
    opacity: 1;
    clip-path: inset(0);
    filter: none;
  }
}

@keyframes arrive {
  from {
    opacity: 0.2;
    filter: blur(7px);
  }
  to {
    opacity: 1;
    filter: none;
  }
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes backdrop-in {
  from {
    opacity: 0;
  }
}

/* Misc -------------------------------------------------------------------- */

.kv {
  display: grid;
  gap: 10px;
}

.kv__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  font-size: 14px;
}

.kv__row dt {
  color: var(--faint);
}

.kv__row dd {
  margin: 0;
  font-family: var(--mono);
  text-align: right;
  overflow-wrap: anywhere;
}

.divider {
  height: 1px;
  background: var(--border);
  border: none;
  margin: 0;
}

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

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

.mono {
  font-family: var(--mono);
}

.small {
  font-size: 13px;
}

.feature-list {
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.feature {
  display: flex;
  gap: 13px;
  align-items: flex-start;
}

.feature__icon {
  flex: none;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--feature-icon-bg);
  border: 1px solid var(--accent-border-soft);
  color: var(--accent);
}

.feature__body h3 {
  font-size: 15px;
  margin-bottom: 3px;
}

.feature__body p {
  color: var(--muted);
  font-size: 13.5px;
}

/* Responsive containers & grids (Bootstrap breakpoints) ------------------- */

@media (min-width: 576px) {
  .app {
    padding: 18px 20px 48px;
  }

  .topbar {
    gap: 16px;
    margin-bottom: 26px;
  }

  .topbar__nav {
    gap: 8px;
  }

  .topbar__nav a {
    padding: 8px 12px;
  }

  .grid {
    gap: 18px;
  }
}

@media (min-width: 768px) {
  .app {
    padding: 20px 28px 52px;
  }

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

  .grid {
    gap: 20px;
  }
}

@media (min-width: 992px) {
  .app {
    max-width: 960px;
    padding: 22px 32px 56px;
  }

  .grid--sidebar {
    grid-template-columns: minmax(0, 340px) minmax(0, 1fr);
  }
}

@media (min-width: 1200px) {
  .app {
    max-width: 1140px;
    padding: 22px 40px 56px;
  }

  .grid--sidebar {
    grid-template-columns: minmax(0, 380px) minmax(0, 1fr);
  }
}

@media (min-width: 1400px) {
  .app {
    max-width: 1320px;
  }
}

@media (max-width: 575.98px) {
  .brand__name {
    font-size: 15px;
  }

  .brand__mark {
    width: 34px;
    height: 34px;
    border-radius: 10px;
  }

  .page-head h1 {
    font-size: clamp(22px, 7vw, 28px);
  }

  .topbar__nav .pill {
    display: none;
  }

  .card {
    padding: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-delay: 0s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
