/* ==========================================================================
   Panel wysyłki Signal
   Bricolage Grotesque (display) · Manrope (UI) · JetBrains Mono (data)
   ========================================================================== */

@font-face {
  font-family: "Bricolage Grotesque";
  src: url("/static/fonts/BricolageGrotesque.ttf") format("truetype");
  font-weight: 200 800;
  font-display: swap;
}

@font-face {
  font-family: "Manrope";
  src: url("/static/fonts/Manrope.ttf") format("truetype");
  font-weight: 200 800;
  font-display: swap;
}

@font-face {
  font-family: "JetBrains Mono";
  src: url("/static/fonts/JetBrainsMono.ttf") format("truetype");
  font-weight: 100 800;
  font-display: swap;
}

/* ------------------------------------------------------------------ tokens */

:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-2: #f8fafd;
  --surface-3: #eef2f8;
  --ink: #101828;
  --ink-2: #526079;
  --ink-3: #8b96ab;
  --line: #e5eaf3;
  --line-strong: #d3dce9;

  --primary: #405cf5;
  --primary-strong: #2e44d6;
  --primary-soft: #edf0ff;
  --violet: #8b5cf6;
  --violet-soft: #f2edff;
  --teal: #0e9f95;
  --teal-soft: #e1f7f3;
  --amber: #b7791f;
  --amber-soft: #fff4df;
  --red: #cf4a4a;
  --red-soft: #fdeeee;

  --blue: var(--primary);
  --blue-hover: var(--primary-strong);
  --blue-soft: var(--primary-soft);
  --mint: var(--teal);
  --mint-soft: var(--teal-soft);
  --aqua: var(--teal);
  --aqua-soft: var(--teal-soft);

  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.04), 0 6px 18px rgba(16, 24, 40, 0.04);
  --shadow-md: 0 4px 12px rgba(16, 24, 40, 0.06), 0 18px 44px rgba(16, 24, 40, 0.09);
  --shadow-lg: 0 24px 80px rgba(10, 16, 24, 0.28);
  --radius: 16px;
  --radius-sm: 10px;

  --display: "Bricolage Grotesque", "Iowan Old Style", Palatino, Georgia, serif;
  --sans: "Manrope", ui-sans-serif, system-ui, "Segoe UI", Roboto, Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
}

html.dark {
  color-scheme: dark;
  --bg: #0a0e16;
  --surface: #121826;
  --surface-2: #161e2e;
  --surface-3: #1c2638;
  --ink: #e8edf7;
  --ink-2: #a3b0c7;
  --ink-3: #75839b;
  --line: #24304a;
  --line-strong: #324160;

  --primary: #7a90ff;
  --primary-strong: #93a5ff;
  --primary-soft: #1a2445;
  --violet: #a78bfa;
  --violet-soft: #251f45;
  --teal: #2dd4bf;
  --teal-soft: #102b29;
  --amber: #f0b455;
  --amber-soft: #2a2111;
  --red: #ef8b8b;
  --red-soft: #2c1616;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35), 0 8px 24px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 6px 16px rgba(0, 0, 0, 0.35), 0 22px 52px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 28px 90px rgba(0, 0, 0, 0.55);
}

/* -------------------------------------------------------------------- base */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14.5px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
p,
dl,
dd,
figure {
  margin: 0;
}

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

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

button {
  cursor: pointer;
}

.mono {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}

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

.eyebrow {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 600;
}

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

[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 6px;
}

/* ------------------------------------------------------------------ layout */

.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 268px;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 22px 18px 16px;
  background: var(--surface);
  border-right: 1px solid var(--line);
  overflow-y: auto;
  scrollbar-width: thin;
}

.sidebar__head {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 2px 6px 0;
}

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

.brand__mark {
  color: var(--primary);
}

.brand__mark svg {
  display: block;
  width: 38px;
  height: 38px;
}

.brand__text {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
  font-family: var(--display);
  font-size: 20px;
  letter-spacing: -0.03em;
}

.brand__text strong {
  font-weight: 750;
}

.brand__text span {
  color: var(--primary);
  font-weight: 600;
}

.sidebar__label {
  font-size: 12px;
  color: var(--ink-3);
  padding-left: 49px;
}

.sidebar-backdrop {
  display: none;
}

.main {
  flex: 1;
  min-width: 0;
}

.main__topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 32px;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.main__heading {
  flex: 1;
  min-width: 0;
}

.page-title {
  font-family: var(--display);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.page-subtitle {
  font-size: 12.5px;
  color: var(--ink-3);
  margin-top: 2px;
  text-transform: capitalize;
}

.main__actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.menu-btn {
  display: none;
}

.main__content {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 1180px;
  padding: 26px 32px 48px;
}

.grid-2 {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 20px;
  align-items: start;
}

/* --------------------------------------------------------------------- nav */

.nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav__link {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--ink-2);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  transition: background 0.15s ease, color 0.15s ease;
}

.nav__link svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.nav__link:hover {
  background: var(--surface-2);
  color: var(--ink);
}

.nav__link.is-active {
  background: var(--primary-soft);
  color: var(--primary);
}

.nav__link--button {
  border: 0;
  background: none;
  width: 100%;
  text-align: left;
}

/* -------------------------------------------------------------- side cards */

.side-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-2);
  padding: 16px;
}

.side-card__head {
  margin-bottom: 12px;
}

.side-card__date {
  font-family: var(--display);
  font-size: 17px;
  font-weight: 600;
  margin-top: 2px;
}

.side-card__next {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.side-card__time {
  font-size: 19px;
  font-weight: 700;
  margin-top: 3px;
}

.side-card__countdown {
  font-size: 12.5px;
  color: var(--ink-2);
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.stat dt {
  font-size: 10px;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
}

.stat dd {
  margin: 3px 0 0;
  font-size: 14px;
  font-weight: 700;
}

.stat:nth-child(1) dd {
  color: var(--primary);
}

.stat:nth-child(2) dd {
  color: var(--teal);
}

.stat:nth-child(3) dd {
  color: var(--violet);
}

.sidebar__foot {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.side-health__title {
  font-family: var(--display);
  font-size: 16px;
  font-weight: 650;
  margin-top: 4px;
}

.side-health__detail {
  font-size: 12.5px;
  color: var(--ink-2);
  margin-top: 3px;
}

.account {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.account__avatar {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--primary-soft);
  color: var(--primary);
  display: grid;
  place-items: center;
  font-weight: 800;
  flex-shrink: 0;
}

.account__info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.account__label {
  font-size: 10.5px;
  color: var(--ink-3);
}

.account__number {
  font-size: 12px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ------------------------------------------------------------------- cards */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 22px;
}

.card--accent {
  border-color: color-mix(in srgb, var(--primary) 28%, var(--line));
  background: linear-gradient(160deg, var(--primary-soft), var(--surface) 70%);
}

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

.card-title {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
}

.section-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  flex-shrink: 0;
}

.section-icon svg {
  width: 18px;
  height: 18px;
}

.section-icon--blue {
  background: var(--primary-soft);
  color: var(--primary);
}

.section-icon--violet {
  background: var(--violet-soft);
  color: var(--violet);
}

.section-icon--aqua {
  background: var(--teal-soft);
  color: var(--teal);
}

.section-icon--amber {
  background: var(--amber-soft);
  color: var(--amber);
}

.section-icon--green {
  background: var(--teal-soft);
  color: var(--teal);
}

.section-head h2 {
  font-family: var(--display);
  font-size: 20px;
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.section-head .muted {
  font-size: 13px;
  margin-top: 3px;
}

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

/* -------------------------------------------------------------------- hero */

.hero {
  position: relative;
  padding: 26px 26px 24px 30px;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(var(--teal), var(--primary));
}

.hero[data-state="paused"]::before,
.hero[data-state="idle"]::before {
  background: linear-gradient(var(--amber), var(--violet));
}

.hero[data-state="stopped"]::before {
  background: linear-gradient(var(--ink-3), var(--violet));
}

.hero__main {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

.hero__state {
  font-family: var(--display);
  font-size: clamp(32px, 4vw, 42px);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.035em;
  margin: 5px 0 8px;
}

.hero__next {
  color: var(--ink-2);
  font-size: 14px;
}

.hero__next strong {
  color: var(--ink);
  font-weight: 700;
}

.hero__actions {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
  padding-bottom: 4px;
}

.progress-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
  max-width: 520px;
}

.progress {
  flex: 1;
  height: 6px;
  border-radius: 999px;
  background: var(--surface-3);
  overflow: hidden;
}

.progress__bar {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--teal), var(--primary), var(--violet));
  transition: width 0.4s ease;
}

.progress__label {
  font-size: 12px;
  color: var(--ink-2);
  white-space: nowrap;
}

/* ------------------------------------------------------------------ safety */

.safety {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 22px;
  border-left: 3px solid var(--teal);
}

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

.safety__head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.safety h2 {
  font-family: var(--display);
  font-size: 18px;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.safety p {
  font-size: 13px;
  color: var(--ink-2);
  margin-top: 2px;
}

/* ----------------------------------------------------------------- buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 9px 18px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease,
    box-shadow 0.15s ease, transform 0.08s ease;
  white-space: nowrap;
}

.btn:active {
  transform: translateY(1px);
}

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

.btn--primary {
  background: linear-gradient(135deg, var(--primary), var(--violet));
  color: #fff;
  box-shadow: 0 5px 16px color-mix(in srgb, var(--primary) 25%, transparent);
}

.btn--primary:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--primary-strong), var(--violet));
  box-shadow: 0 10px 26px color-mix(in srgb, var(--primary) 32%, transparent);
  transform: translateY(-1px);
}

.btn--secondary {
  background: linear-gradient(135deg, var(--primary-soft), var(--violet-soft));
  color: var(--primary);
  border-color: color-mix(in srgb, var(--primary) 20%, transparent);
}

.btn--secondary:hover:not(:disabled) {
  border-color: var(--primary);
  transform: translateY(-1px);
}

.btn--ghost {
  background: var(--surface);
  border-color: var(--line-strong);
  color: var(--ink-2);
}

.btn--ghost:hover:not(:disabled) {
  color: var(--ink);
  background: var(--surface-2);
}

.btn--danger {
  background: var(--surface);
  border-color: color-mix(in srgb, var(--red) 35%, var(--line));
  color: var(--red);
}

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

.btn--sm {
  min-height: 34px;
  padding: 6px 12px;
  font-size: 13px;
  border-radius: 9px;
}

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

.btn .icon {
  width: 16px;
  height: 16px;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink-2);
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.icon-btn:hover {
  background: var(--surface-2);
  color: var(--ink);
}

.icon-btn svg {
  width: 18px;
  height: 18px;
}

/* ------------------------------------------------------------------- forms */

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.field--grow {
  flex: 1;
}

.field--half {
  flex: 1;
  min-width: 120px;
}

.field-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.field__label {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink-2);
}

.field__hint {
  font-size: 12px;
  color: var(--ink-3);
  margin-top: 2px;
  line-height: 1.45;
}

.input,
.textarea,
.select {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  color: var(--ink);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.input:focus,
.textarea:focus,
.select:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--surface);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 15%, transparent);
}

.input--sm {
  min-height: 34px;
  padding: 5px 10px;
  font-size: 13px;
}

.range-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 4px 0;
}

.range {
  flex: 1;
  appearance: none;
  -webkit-appearance: none;
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--primary), var(--violet));
  accent-color: var(--primary);
  cursor: pointer;
}

.range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--surface);
  border: 3px solid var(--primary);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
}

.range::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--surface);
  border: 3px solid var(--primary);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
}

.range-value {
  min-width: 78px;
  text-align: right;
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
}

.textarea {
  resize: vertical;
  min-height: 150px;
  line-height: 1.6;
}

.variants {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 12px;
}

.variant {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
  padding: 12px;
}

.variant__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.variant__label {
  font-weight: 800;
  font-size: 12.5px;
  color: var(--ink-2);
}

.variant__meta {
  display: flex;
  align-items: center;
  gap: 10px;
}

.variant__count {
  font-size: 11px;
  color: var(--ink-3);
}

.variant__remove {
  border: 0;
  background: transparent;
  color: var(--ink-3);
  width: 26px;
  height: 26px;
  border-radius: 50%;
  font-size: 18px;
  line-height: 1;
}

.variant__remove:hover:not(:disabled) {
  background: var(--red-soft);
  color: var(--red);
}

.variant__remove:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.variant__input {
  min-height: 90px;
  background: var(--surface);
}

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

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

.composer-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.attachment {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding: 8px 12px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  font-size: 13px;
}

.attachment__name {
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment__size {
  color: var(--ink-3);
  font-size: 12px;
}

.attachment__remove {
  margin-left: auto;
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ink-2);
  font-size: 18px;
  line-height: 1;
}

.attachment__remove:hover {
  background: var(--red-soft);
  color: var(--red);
}

.segmented {
  display: inline-flex;
  padding: 3px;
  gap: 3px;
  background: var(--surface-3);
  border: 1px solid var(--line);
  border-radius: 11px;
}

.segmented__option {
  border: 0;
  background: transparent;
  padding: 7px 13px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-2);
}

.segmented__option.is-active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 4px rgba(16, 24, 40, 0.14);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.chip-time {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 6px 5px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface-2);
  font-family: var(--mono);
  font-size: 13px;
}

.chip-time button {
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ink-3);
  font-size: 15px;
  line-height: 1;
}

.chip-time button:hover {
  background: var(--red-soft);
  color: var(--red);
}

.inline-add {
  display: flex;
  gap: 8px;
  align-items: center;
}

.inline-add .input {
  width: 130px;
}

.advanced {
  margin: 6px 0 14px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.advanced summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-2);
  margin-bottom: 10px;
}

.advanced summary:hover {
  color: var(--ink);
}

.risk-note {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 12px 0 0;
  padding: 10px 12px;
  border-radius: 11px;
  background: var(--amber-soft);
  border: 1px solid color-mix(in srgb, var(--amber) 28%, var(--line));
  color: var(--amber);
  font-size: 12.5px;
  line-height: 1.45;
}

.risk-note--red {
  background: var(--red-soft);
  border-color: color-mix(in srgb, var(--red) 28%, var(--line));
  color: var(--red);
}

.link-btn {
  border: 0;
  background: none;
  padding: 0;
  color: inherit;
  font: inherit;
  font-weight: 800;
  text-decoration: underline;
}

/* ------------------------------------------------------------------ groups */

.group-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.group {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  transition: background 0.15s ease, border-color 0.15s ease;
}

.group:hover {
  border-color: var(--line-strong);
  background: var(--surface-2);
}

.group__check {
  appearance: none;
  width: 19px;
  height: 19px;
  flex-shrink: 0;
  border: 1.5px solid var(--line-strong);
  border-radius: 5px;
  background: var(--surface);
  position: relative;
  transition: background 0.12s ease, border-color 0.12s ease;
}

.group__check:hover:not(:disabled) {
  border-color: var(--primary);
}

.group__check:checked {
  background: var(--primary);
  border-color: var(--primary);
}

.group__check:checked::after {
  content: "";
  position: absolute;
  left: 5.5px;
  top: 2px;
  width: 4px;
  height: 8px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.group__check:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.group__avatar {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  flex-shrink: 0;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.02em;
  background: hsl(var(--h, 220) 72% 93%);
  color: hsl(var(--h, 220) 52% 32%);
  border: 1px solid hsl(var(--h, 220) 60% 86%);
}

html.dark .group__avatar {
  background: hsl(var(--h, 220) 42% 19%);
  color: hsl(var(--h, 220) 72% 78%);
  border-color: hsl(var(--h, 220) 34% 30%);
}

.group__main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.group__name {
  font-weight: 700;
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.group__error {
  font-size: 12px;
  color: var(--red);
}

.group__meta {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.group__count {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-3);
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
}

.badge--warn {
  background: var(--amber-soft);
  color: var(--amber);
}

.badge--muted {
  background: var(--surface-3);
  color: var(--ink-2);
}

.badge--ok {
  background: var(--teal-soft);
  color: var(--teal);
}

.badge--danger {
  background: var(--red-soft);
  color: var(--red);
}

.empty {
  padding: 22px 12px;
  text-align: center;
  color: var(--ink-2);
  font-size: 14px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

/* -------------------------------------------------------------------- logs */

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

.log-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.log-table th {
  text-align: left;
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 700;
  padding: 0 12px 10px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.log-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.log-table tr:last-child td {
  border-bottom: 0;
}

.log-table .time {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--ink-2);
  white-space: nowrap;
}

.log-table .group-name {
  font-weight: 600;
}

.log-table .details {
  color: var(--ink-3);
  font-size: 12.5px;
  max-width: 340px;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  font-size: 12.5px;
  white-space: nowrap;
}

.status__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.status--sent .status__dot {
  background: var(--teal);
}

.status--unconfirmed .status__dot {
  background: var(--amber);
}

.status--failed .status__dot {
  background: var(--red);
}

.status--skipped .status__dot {
  background: var(--ink-3);
}

.status--sent {
  color: var(--teal);
}

.status--unconfirmed {
  color: var(--amber);
}

.status--failed {
  color: var(--red);
}

.status--skipped {
  color: var(--ink-3);
}

/* ------------------------------------------------------------------ health */

.health {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-size: 12.5px;
  font-weight: 700;
  white-space: nowrap;
}

.health__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ink-3);
}

.health--green .health__dot {
  background: var(--teal);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--teal) 16%, transparent);
}

.health--yellow .health__dot {
  background: var(--amber);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--amber) 16%, transparent);
}

.health--red .health__dot {
  background: var(--red);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--red) 16%, transparent);
}

/* ----------------------------------------------------------------- banners */

.banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  border-radius: 14px;
  border: 1px solid var(--line);
  font-size: 14px;
}

.banner--amber {
  background: var(--amber-soft);
  border-color: color-mix(in srgb, var(--amber) 30%, var(--line));
}

.banner--red {
  background: var(--red-soft);
  border-color: color-mix(in srgb, var(--red) 30%, var(--line));
}

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

.banner__text span {
  color: var(--ink-2);
}

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

.banner-help {
  margin-top: 6px;
  font-size: 12px;
  color: var(--ink-2);
}

.banner-help summary {
  cursor: pointer;
  font-weight: 700;
}

.banner-help ol {
  margin: 6px 0 0;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  line-height: 1.45;
}

/* ---------------------------------------------------------------- timeline */

.timeline {
  position: relative;
  height: 230px;
  margin: 4px 0;
  padding-left: 30px;
}

.timeline__hours {
  position: absolute;
  inset: 0 auto 0 0;
  width: 30px;
}

.tl-hour {
  position: absolute;
  right: 6px;
  transform: translateY(-50%);
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink-3);
}

.timeline__track {
  position: absolute;
  inset: 0 0 0 30px;
  border-left: 1px solid var(--line-strong);
}

.tl-line {
  position: absolute;
  left: 0;
  right: 0;
  border-top: 1px dashed var(--line);
}

.tl-quiet {
  position: absolute;
  left: 0;
  right: 0;
  background: repeating-linear-gradient(
    -45deg,
    var(--surface-3),
    var(--surface-3) 4px,
    transparent 4px,
    transparent 8px
  );
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.tl-quiet__label {
  position: absolute;
  right: 5px;
  top: 3px;
  font-family: var(--mono);
  font-size: 9px;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.tl-now {
  position: absolute;
  left: -4px;
  right: 0;
  height: 0;
  border-top: 2px solid var(--primary);
  z-index: 3;
}

.tl-now__dot {
  position: absolute;
  left: -4px;
  top: -5px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
}

.tl-now__label {
  position: absolute;
  right: 4px;
  top: -18px;
  font-family: var(--mono);
  font-size: 9.5px;
  color: var(--primary);
  background: var(--surface-2);
  padding: 0 3px;
}

.tl-sent {
  position: absolute;
  left: -3px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--teal);
  transform: translateY(-50%);
  opacity: 0.7;
  z-index: 2;
}

.tl-sent--unconfirmed {
  background: var(--amber);
}

.tl-next {
  position: absolute;
  left: -6px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--surface);
  border: 2.5px solid var(--primary);
  transform: translateY(-50%);
  z-index: 4;
  animation: beacon 2.6s ease-in-out infinite;
}

/* ----------------------------------------------------------------- dialogs */

.dialog {
  width: min(560px, calc(100vw - 32px));
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 0;
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-lg);
}

.dialog--wide {
  width: min(780px, calc(100vw - 32px));
  max-height: calc(100vh - 40px);
  overflow-y: auto;
}

.dialog::backdrop {
  background: rgba(7, 10, 15, 0.55);
  backdrop-filter: blur(3px);
}

.dialog__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 22px 10px;
}

.dialog__head h2 {
  font-family: var(--display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.dialog__close {
  border: 0;
  background: transparent;
  font-size: 22px;
  width: 34px;
  height: 34px;
  color: var(--ink-2);
}

.dialog__body {
  padding: 8px 22px 18px;
}

.dialog__body--center {
  text-align: center;
}

.dialog__foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 22px 20px;
  border-top: 1px solid var(--line);
  background: var(--surface-2);
  border-radius: 0 0 18px 18px;
}

.qr {
  display: block;
  width: 240px;
  height: 240px;
  margin: 8px auto 18px;
  padding: 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
}

.steps {
  text-align: left;
  margin: 0 auto;
  padding-left: 22px;
  max-width: 420px;
  color: var(--ink-2);
  font-size: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.dialog__status {
  margin-top: 16px;
  font-size: 13px;
  color: var(--ink-2);
}

.accounts-list {
  list-style: none;
  margin: 12px 0 14px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.account-option {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
  text-align: left;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.account-option:hover {
  border-color: var(--line-strong);
}

.account-option.is-selected {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.account-option__main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.account-option__number {
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 700;
}

.account-option__aci {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--ink-3);
  word-break: break-all;
}

.account-option__badge {
  flex-shrink: 0;
}

.join-results {
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.join-result {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface-2);
  font-size: 13px;
}

.join-result--ok {
  border-color: color-mix(in srgb, var(--teal) 35%, var(--line));
  background: var(--teal-soft);
}

.join-result--warn {
  border-color: color-mix(in srgb, var(--amber) 35%, var(--line));
  background: var(--amber-soft);
}

.join-result--error {
  border-color: color-mix(in srgb, var(--red) 35%, var(--line));
  background: var(--red-soft);
}

.join-result__link {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--ink-3);
  word-break: break-all;
}

.summary {
  font-size: 14.5px;
  color: var(--ink-2);
  margin-bottom: 16px;
  line-height: 1.6;
}

.summary strong {
  color: var(--ink);
}

.radio-group {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin: 0 0 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.radio-group legend {
  padding: 0 6px;
}

.radio {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 14px;
}

.radio input {
  accent-color: var(--primary);
  width: 16px;
  height: 16px;
}

/* -------------------------------------------------------------------- guide */

.guide-lead {
  font-size: 14.5px;
  line-height: 1.65;
  color: var(--ink-2);
  margin-bottom: 16px;
}

.guide-now {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  margin-bottom: 18px;
}

.guide-metric dt {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-3);
  font-weight: 700;
}

.guide-metric dd {
  margin: 3px 0 0;
  font-family: var(--mono);
  font-size: 19px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.guide-metric:nth-child(1) dd {
  color: var(--primary);
}

.guide-metric:nth-child(2) dd {
  color: var(--violet);
}

.guide-metric:nth-child(3) dd {
  color: var(--teal);
}

.guide-hint {
  grid-column: 1 / -1;
  font-size: 12.5px;
  color: var(--ink-2);
  line-height: 1.5;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.preset-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 6px 0 20px;
}

.preset {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface-2);
}

.preset--featured {
  border-color: color-mix(in srgb, var(--primary) 30%, var(--line));
  background: linear-gradient(155deg, var(--primary-soft), var(--surface) 75%);
}

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

.preset h3 {
  font-family: var(--display);
  font-size: 17px;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.preset p {
  font-size: 12.5px;
  color: var(--ink-2);
  line-height: 1.5;
}

.preset ul {
  margin: 0;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 12.5px;
  color: var(--ink-2);
}

.preset .btn {
  margin-top: auto;
}

.guide-h3 {
  font-family: var(--display);
  font-size: 18px;
  font-weight: 650;
  letter-spacing: -0.02em;
  margin: 20px 0 10px;
}

.guide-rules {
  margin: 0;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13.5px;
  color: var(--ink-2);
  line-height: 1.55;
}

.guide-rules strong {
  color: var(--ink);
}

.guide-note {
  margin-top: 18px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--amber-soft);
  border: 1px solid color-mix(in srgb, var(--amber) 26%, var(--line));
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--ink-2);
}

/* ------------------------------------------------------------------ toasts */

.toasts {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: min(380px, calc(100vw - 40px));
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-md);
  font-size: 13.5px;
  animation: toast-in 0.22s ease;
  pointer-events: auto;
}

.toast__dot {
  width: 8px;
  height: 8px;
  margin-top: 6px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--ink-3);
}

.toast--success .toast__dot {
  background: var(--teal);
}

.toast--error .toast__dot {
  background: var(--red);
}

.toast--info .toast__dot {
  background: var(--primary);
}

.toast--error {
  border-color: color-mix(in srgb, var(--red) 35%, var(--line));
}

/* ------------------------------------------------------------------- login */

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--bg);
}

.login-shell {
  width: min(420px, 100%);
}

.login-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow-md);
  padding: 34px 30px 28px;
}

.brand--center {
  flex-direction: column;
  text-align: center;
  gap: 12px;
  margin-bottom: 26px;
}

.brand--center .brand__mark svg {
  width: 48px;
  height: 48px;
}

.brand--center h1 {
  font-family: var(--display);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.brand__sub {
  color: var(--ink-2);
  font-size: 13.5px;
  margin-top: 2px;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-error {
  color: var(--red);
  font-size: 13px;
  margin: 2px 0 6px;
}

.login-foot {
  margin-top: 18px;
  text-align: center;
  font-size: 12px;
  color: var(--ink-3);
}

/* -------------------------------------------------------------- animations */

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

.main__content > * {
  animation: rise 0.45s cubic-bezier(0.2, 0.7, 0.3, 1) both;
}

.main__content > *:nth-child(2) {
  animation-delay: 0.04s;
}

.main__content > *:nth-child(3) {
  animation-delay: 0.08s;
}

.main__content > *:nth-child(4) {
  animation-delay: 0.12s;
}

.main__content > *:nth-child(5) {
  animation-delay: 0.16s;
}

@keyframes beacon {
  0%,
  100% {
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 16%, transparent);
  }
  50% {
    box-shadow: 0 0 0 9px color-mix(in srgb, var(--primary) 4%, transparent);
  }
}

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

/* --------------------------------------------------------------- responsive */

@media (max-width: 1100px) {
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 60;
    transform: translateX(-100%);
    transition: transform 0.22s ease;
    box-shadow: var(--shadow-lg);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 55;
    background: rgba(7, 10, 15, 0.5);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease;
  }

  .sidebar.open + .sidebar-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  .menu-btn {
    display: inline-flex;
  }

  .main__topbar {
    padding: 16px 20px;
  }

  .main__content {
    padding: 22px 20px 40px;
  }
}

@media (max-width: 860px) {
  .grid-2 {
    grid-template-columns: 1fr;
  }

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

  .hero__actions {
    padding-top: 6px;
  }

  .hero__actions .btn {
    flex: 1;
  }

  .section-head {
    flex-direction: column;
  }
}

@media (max-width: 640px) {
  .page-title {
    font-size: 21px;
  }

  .page-subtitle {
    display: none;
  }

  .health {
    display: none;
  }

  .card {
    padding: 18px;
  }

  .main__content {
    gap: 16px;
  }

  .hero {
    padding: 22px 20px 20px 24px;
  }

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

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

  .banner__actions .input {
    flex: 1;
  }

  .group {
    flex-wrap: wrap;
  }

  .group__main {
    flex: 1 1 200px;
  }

  .group__name {
    white-space: normal;
  }

  .group__meta {
    margin-left: auto;
  }

  .log-table th:nth-child(4),
  .log-table .details {
    display: none;
  }

  .guide-now {
    grid-template-columns: 1fr 1fr;
  }

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

  .toasts {
    right: 14px;
    bottom: 14px;
    left: 14px;
    max-width: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
