:root {
  color-scheme: light;
  --bg: #eef6f2;
  --sidebar: #042b2d;
  --sidebar-soft: #0b453f;
  --surface: #ffffff;
  --surface-soft: #f7fbf8;
  --line: #cfe0d8;
  --line-soft: #e6f0eb;
  --text: #102522;
  --muted: #60746f;
  --blue: #008565;
  --green: #00a94f;
  --red: #d72e20;
  --amber: #986b00;
  --accent-soft: #e3f7ec;
  --accent-line: #a8dfc3;
  --sidebar-text: #dff4ee;
  --sidebar-muted: #83aaa0;
  --sidebar-icon: #76d6b9;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  color: inherit;
}

.app-shell {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 18px;
  background: var(--sidebar);
  color: #fff;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 4px 16px;
  border-bottom: 1px solid rgba(118, 214, 185, 0.22);
}

.brand-logo {
  flex: 0 0 auto;
  border: 1px solid rgba(33, 226, 122, 0.28);
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 0 3px rgba(33, 226, 122, 0.08);
}

.sidebar-brand strong {
  font-size: 20px;
}

.sidebar-brand span {
  overflow-wrap: anywhere;
  color: var(--sidebar-muted);
  font-size: 12px;
}

.side-nav {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.nav-group {
  display: grid;
  gap: 5px;
}

.nav-group-title,
.mobile-nav-group > span {
  color: var(--sidebar-muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.nav-group-title {
  padding: 0 12px 2px;
}

.side-nav a,
.mobilebar a {
  border-radius: 6px;
  text-decoration: none;
}

.mobilebar a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.mobile-nav-groups {
  display: flex;
  gap: 10px;
  overflow-x: auto;
}

.mobile-nav-group {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
}

.mobile-nav-group > span {
  color: var(--muted);
  font-size: 10px;
}

.side-nav a {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 12px;
  color: var(--sidebar-text);
  font-size: 14px;
  font-weight: 700;
}

.nav-icon {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  color: var(--sidebar-icon);
  font-size: 15px;
}

.nav-icon i,
.button-icon,
.traffic-icon {
  display: inline-grid;
  place-items: center;
  width: 1.05em;
  line-height: 1;
}

.side-nav a:hover,
.side-nav a.active {
  background: var(--sidebar-soft);
  color: #fff;
}

.side-nav a.active {
  box-shadow: inset 3px 0 0 #21e27a;
}

.side-nav a.active .nav-icon,
.side-nav a:hover .nav-icon {
  color: #21e27a;
}

.sidebar-logout {
  margin-top: auto;
}

.content-shell {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 100vh;
  width: 100%;
}

.mobilebar {
  display: none;
}

.mobile-brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.mobile-brand strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.page {
  display: flex;
  flex: 1;
  flex-direction: column;
  width: auto;
  max-width: none;
  margin: 0 20px;
}

.page {
  padding: 24px 0 0;
}

.page-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-height: 34px;
  margin: auto -20px 0;
  border-top: 1px solid var(--line-soft);
  padding: 0 20px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.auth-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: min(1280px, calc(100% - 40px));
  margin: 0 auto;
  min-height: 100vh;
  padding-top: 14vh;
}

.auth-page .page-footer {
  align-self: stretch;
  margin-right: 0;
  margin-left: 0;
}

.breadcrumbs {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.breadcrumbs ol {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.breadcrumbs li {
  display: inline-flex;
  align-items: center;
  min-width: 0;
}

.breadcrumbs li + li::before {
  content: "/";
  margin: 0 8px;
  color: #8aa59c;
  font-weight: 700;
}

.breadcrumbs a,
.breadcrumb-current {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  max-width: min(360px, 70vw);
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 0 7px;
  overflow: hidden;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.breadcrumbs a:hover {
  border-color: var(--line-soft);
  background: #fff;
  color: var(--blue);
}

.breadcrumb-current {
  color: var(--text);
}

.breadcrumbs i {
  flex: 0 0 auto;
  width: 14px;
  text-align: center;
}

.breadcrumbs span span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.auth-box,
.surface,
.stat-card,
.client-card,
.peer-card,
.ebu-peer-card,
.empty-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.auth-box {
  width: min(420px, 100%);
  padding: 24px;
}

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

.auth-logo {
  flex: 0 0 auto;
  border: 1px solid var(--accent-line);
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.auth-box h1 {
  margin: 0 0 16px;
  font-size: 24px;
}

.auth-brand h1 {
  margin: 0;
}

.auth-box {
  border-top: 4px solid var(--green);
  box-shadow: 0 18px 60px rgba(4, 43, 45, 0.12);
}

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

.page-head h1 {
  margin: 2px 0 4px;
  font-size: 28px;
  line-height: 1.2;
}

.page-head p,
.section-head p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.eyebrow,
.label,
label span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.eyebrow {
  color: var(--blue);
}

.stack {
  display: grid;
  gap: 14px;
}

input,
select,
textarea {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
  color: var(--text);
  background: #fff;
  font: inherit;
}

select {
  appearance: auto;
}

textarea {
  resize: vertical;
}

textarea.copy-source {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

button,
.button {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 12px;
  color: var(--text);
  background: #fff;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.icon-button {
  width: 38px;
  min-width: 38px;
  padding: 0;
  font-size: 15px;
}

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

.primary:hover {
  border-color: #006c55;
  background: #006c55;
}

.danger {
  border-color: #f1b7b0;
  color: var(--red);
}

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

.card-actions form,
.page-head form,
.sidebar-logout form {
  margin: 0;
}

.sidebar-logout button {
  width: 100%;
  border-color: rgba(118, 214, 185, 0.22);
  background: rgba(118, 214, 185, 0.08);
  color: #fff;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.stat-grid.tight {
  margin-bottom: 18px;
}

.stat-card {
  min-width: 0;
  padding: 14px;
}

.stat-card strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 20px;
  line-height: 1.25;
}

.stat-card small {
  display: block;
  margin-top: 6px;
  overflow-wrap: anywhere;
  color: var(--muted);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
  gap: 16px;
}

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

.surface {
  padding: 16px;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
}

.data-table {
  width: 100%;
  min-width: 1220px;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table.compact-table {
  min-width: 640px;
}

.data-table th,
.data-table td {
  border-bottom: 1px solid var(--line-soft);
  padding: 10px;
  text-align: left;
  vertical-align: middle;
}

.data-table th {
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

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

.data-table td > strong {
  display: block;
  overflow-wrap: anywhere;
}

.data-table td > span:not(.status) {
  display: block;
  margin-top: 2px;
  color: var(--muted);
}

.inline-copy {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 6px;
  align-items: center;
}

.inline-copy input {
  min-width: 0;
}

.name-edit {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto;
  gap: 6px;
  align-items: center;
  margin: 0;
}

.password-edit {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto;
  gap: 6px;
  align-items: center;
  min-width: 260px;
  margin: 0;
}

.access-edit {
  display: grid;
  grid-template-columns: minmax(120px, 0.9fr) minmax(130px, 1fr) auto;
  gap: 6px;
  align-items: center;
  min-width: 330px;
  margin: 0;
}

.turn-group-edit {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) auto;
  gap: 6px;
  align-items: center;
  min-width: 220px;
  margin: 0;
}

.name-edit input {
  min-width: 0;
  font-weight: 800;
}

.password-edit input,
.access-edit input,
.access-edit select,
.turn-group-edit select {
  min-width: 0;
}

.table-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.table-actions form {
  margin: 0;
}

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

.system-panel {
  margin-bottom: 16px;
}

.group-panel {
  margin-bottom: 16px;
}

.load-panel {
  margin-bottom: 16px;
}

.load-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
}

.load-card {
  display: grid;
  min-width: 0;
  gap: 9px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  padding: 12px;
  background: var(--surface-soft);
}

.load-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.load-card-head strong {
  overflow-wrap: anywhere;
  font-size: 18px;
}

.load-card small {
  overflow-wrap: anywhere;
  color: var(--muted);
}

.metric-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.metric-list div {
  min-width: 0;
}

.metric-list dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.metric-list dd {
  margin: 2px 0 0;
  overflow-wrap: anywhere;
}

.meter {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #d9ebe4;
}

.meter span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--blue);
}

.service-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.service-card {
  display: grid;
  min-width: 0;
  gap: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  padding: 12px;
  background: var(--surface-soft);
}

.service-card > div {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.service-card strong {
  overflow-wrap: anywhere;
}

.service-card form,
.service-card button {
  width: 100%;
}

.danger-zone {
  border-color: #f1c4bc;
}

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

.section-head h2,
.form-section h2 {
  margin: 0 0 4px;
  font-size: 19px;
}

.live-state,
.status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 24px;
  border-radius: 999px;
  padding: 3px 9px;
  background: var(--accent-soft);
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
}

.live-state::before,
.live-stat .label::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: currentColor;
  box-shadow: 0 0 0 0 rgba(0, 169, 79, 0.34);
}

.live-stat .label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.live-state.on::before {
  animation: live-pulse 1.6s ease-out infinite;
}

.live-state.error {
  background: #fff0ee;
  color: var(--red);
}

.status.off {
  background: #fff5d6;
  color: var(--amber);
}

.status.disabled {
  background: #e8efec;
  color: var(--muted);
}

.live-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.live-metrics > div {
  min-width: 0;
  border-left: 3px solid var(--accent-line);
  padding-left: 10px;
}

.live-metrics strong {
  display: block;
  font-size: 18px;
}

[data-group-field].is-disabled {
  opacity: 0.58;
}

.history-strip {
  display: flex;
  align-items: end;
  gap: 3px;
  height: 38px;
  margin: 0 0 14px;
  border-bottom: 1px solid var(--line);
}

.history-bar {
  width: 8px;
  min-height: 3px;
  border-radius: 2px 2px 0 0;
  background: var(--blue);
  opacity: 0.82;
}

.history-empty {
  align-self: center;
  color: var(--muted);
  font-size: 13px;
}

.client-grid,
.peer-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 14px;
}

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

.client-card,
.peer-card,
.empty-card {
  min-width: 0;
  padding: 14px;
}

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

.card-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.card-title-row strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 17px;
}

.card-title-row span:not(.status) {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 13px;
}

.copy-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin-bottom: 12px;
}

.copy-fields label {
  min-width: 0;
}

.copy-fields button {
  align-self: end;
}

.card-facts {
  display: grid;
  gap: 8px;
  margin: 0 0 12px;
}

.card-facts.compact {
  margin-top: -2px;
}

.card-facts div {
  min-width: 0;
  border-top: 1px solid var(--line-soft);
  padding-top: 8px;
}

.card-facts dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.card-facts dd {
  margin: 2px 0 0;
  overflow-wrap: anywhere;
  font-size: 14px;
}

.ebu-map-panel,
.ebu-cards-panel {
  margin-bottom: 16px;
}

.ebu-map-wrap {
  position: relative;
  min-height: 360px;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #d7e5df;
}

.ebu-map {
  width: 100%;
  height: 420px;
  min-height: 360px;
}

.ebu-map-empty {
  position: absolute;
  left: 14px;
  bottom: 14px;
  z-index: 450;
  max-width: min(360px, calc(100% - 28px));
  border: 1px solid rgba(16, 37, 34, 0.12);
  border-radius: 8px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  box-shadow: 0 10px 30px rgba(4, 43, 45, 0.14);
}

.ebu-map-empty[hidden] {
  display: none;
}

.ebu-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 14px;
}

.ebu-peer-card {
  display: grid;
  min-width: 0;
  gap: 12px;
  padding: 12px;
}

.ebu-video-frame {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: linear-gradient(135deg, #062f30, #0b453f);
  color: var(--sidebar-text);
}

.ebu-video-frame img {
  display: none;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ebu-video-frame.has-video img {
  display: block;
}

.ebu-video-placeholder {
  display: grid;
  place-items: center;
  gap: 7px;
  color: #c8ede3;
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}

.ebu-video-placeholder i {
  color: #21e27a;
  font-size: 28px;
}

.ebu-battery {
  display: grid;
  gap: 7px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  padding: 10px;
  background: var(--surface-soft);
}

.ebu-battery-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.ebu-battery-head .label {
  margin: 0;
}

.ebu-battery-head strong {
  font-size: 18px;
}

.ebu-battery small {
  overflow-wrap: anywhere;
  color: var(--muted);
}

.ebu-battery-meter span {
  background: var(--green);
}

.ebu-table {
  min-width: 1180px;
}

.ebu-table td:nth-child(4) {
  color: var(--blue);
  font-size: 18px;
  text-align: center;
}

.settings-form {
  display: grid;
  gap: 18px;
}

.modal {
  width: min(480px, calc(100% - 24px));
  max-width: none;
  border: 0;
  padding: 0;
  color: var(--text);
  background: transparent;
}

.modal-wide {
  width: min(860px, calc(100% - 24px));
}

.modal::backdrop {
  background: rgba(15, 23, 42, 0.48);
}

.modal-card {
  display: grid;
  gap: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: var(--surface);
  box-shadow: 0 22px 70px rgba(15, 23, 42, 0.25);
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.modal-head h2 {
  margin: 0;
  font-size: 22px;
  line-height: 1.2;
}

.modal-body {
  display: grid;
  gap: 12px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.wg-config-modal {
  display: grid;
  grid-template-columns: minmax(220px, 0.42fr) minmax(0, 0.58fr);
  gap: 14px;
  align-items: start;
}

.qr-frame {
  display: grid;
  place-items: center;
  min-width: 0;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  padding: 12px;
  background: var(--surface-soft);
}

.qr-frame img {
  width: min(100%, 320px);
  aspect-ratio: 1;
}

.config-preview {
  min-width: 0;
}

.config-preview textarea {
  min-height: 320px;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
}

.form-section {
  display: grid;
  gap: 12px;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.settings-grid .wide {
  grid-column: 1 / -1;
}

.wg-danger-confirm {
  display: grid;
  gap: 12px;
  border: 1px solid #efc56f;
  border-left: 4px solid var(--amber);
  border-radius: 8px;
  padding: 14px;
  background: #fff8e4;
}

.wg-danger-confirm[hidden] {
  display: none;
}

.wg-danger-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.wg-danger-head i {
  color: var(--amber);
  font-size: 20px;
  line-height: 1.2;
}

.wg-danger-head h3 {
  margin: 0 0 4px;
  font-size: 17px;
}

.wg-danger-head p {
  margin: 0;
  color: var(--text);
}

.wg-change-list {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.wg-change-list li {
  display: grid;
  grid-template-columns: minmax(120px, 0.35fr) minmax(0, 0.65fr);
  gap: 8px;
  border: 1px solid rgba(152, 107, 0, 0.22);
  border-radius: 6px;
  padding: 7px 9px;
  background: #fffdf5;
}

.wg-change-list span {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--muted);
}

.confirm-check {
  display: flex;
  align-items: flex-start;
  gap: 9px;
}

.confirm-check input {
  width: 18px;
  min-height: 18px;
  margin-top: 2px;
  flex: 0 0 auto;
}

.confirm-check span {
  margin: 0;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  text-transform: none;
}

.confirm-phrase {
  display: grid;
  gap: 6px;
}

.confirm-phrase > span {
  margin: 0;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  text-transform: none;
}

.confirm-phrase strong {
  color: var(--red);
}

.settings-grid textarea {
  min-height: 86px;
}

.settings-divider {
  border-top: 1px solid var(--line-soft);
}

.form-actions {
  display: flex;
  justify-content: flex-end;
}

.messages {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 80;
  display: grid;
  gap: 10px;
  width: min(390px, calc(100vw - 32px));
  margin: 0;
  pointer-events: none;
}

.message {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  min-width: 0;
  border: 1px solid var(--accent-line);
  border-left: 4px solid var(--blue);
  border-radius: 8px;
  padding: 12px 10px 12px 14px;
  background: #fff;
  color: var(--text);
  box-shadow: 0 16px 45px rgba(4, 43, 45, 0.16);
  pointer-events: auto;
  animation: toast-in 180ms ease-out;
}

.message.error {
  border-color: #f1c4bc;
  border-left-color: var(--red);
}

.message.success {
  border-color: var(--accent-line);
  border-left-color: var(--green);
}

.message.is-hiding {
  animation: toast-out 180ms ease-in forwards;
}

.toast-close {
  width: 28px;
  min-width: 28px;
  min-height: 28px;
  border: 0;
  padding: 0;
  color: var(--muted);
  background: transparent;
  font-size: 18px;
}

.toast-close:hover {
  background: var(--surface-soft);
  color: var(--text);
}

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

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

@keyframes live-pulse {
  70% {
    box-shadow: 0 0 0 8px rgba(0, 169, 79, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(0, 169, 79, 0);
  }
}

@media (max-width: 1080px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    display: none;
  }

  .mobilebar {
    position: sticky;
    top: 0;
    z-index: 5;
    display: grid;
    gap: 8px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--line);
    background: rgba(247, 251, 248, 0.96);
    backdrop-filter: blur(10px);
  }

  .mobilebar nav {
    display: flex;
    gap: 6px;
    overflow-x: auto;
  }

  .mobilebar a {
    flex: 0 0 auto;
    padding: 8px 10px;
    color: var(--text);
    font-size: 13px;
    font-weight: 800;
  }

  .mobilebar a.active {
    background: var(--accent-soft);
    color: var(--blue);
  }

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

  .stat-grid,
  .load-grid,
  .service-grid,
  .settings-grid,
  .wg-config-modal {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .auth-page {
    width: min(100% - 20px, 1280px);
  }

  .page {
    margin: 0 10px;
    padding-top: 14px;
  }

  .page-footer {
    margin-right: -10px;
    margin-left: -10px;
    padding: 0 10px;
  }

  .breadcrumbs {
    margin-bottom: 10px;
  }

  .breadcrumbs a,
  .breadcrumb-current {
    max-width: 58vw;
    min-height: 26px;
    padding: 0 5px;
  }

  .breadcrumbs li + li::before {
    margin: 0 5px;
  }

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

  .page-head .section-actions,
  .page-head form,
  .page-head button {
    width: 100%;
  }

  .stat-grid,
  .load-grid,
  .service-grid,
  .settings-grid,
  .wg-config-modal,
  .live-metrics,
  .client-grid,
  .peer-card-grid,
  .ebu-card-grid {
    grid-template-columns: 1fr;
  }

  .ebu-map-wrap,
  .ebu-map {
    min-height: 300px;
    height: 320px;
  }

  .copy-fields {
    grid-template-columns: 1fr;
  }

  .copy-fields button,
  .icon-button,
  .card-actions button,
  .card-actions .button,
  .card-actions form {
    width: 100%;
  }

  .card-actions {
    align-items: stretch;
  }

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

  .modal-actions {
    flex-direction: column-reverse;
  }
}
