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

@font-face {
  font-family: "InterLocal";
  src: url("../fonts/Inter-Medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --font-main: "InterLocal", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --page: #101014;
  --page-deep: #07070a;
  --page-raised: #16161b;
  --surface: rgba(255, 255, 255, .055);
  --surface-soft: rgba(255, 255, 255, .038);
  --surface-strong: rgba(255, 255, 255, .09);
  --surface-hover: rgba(255, 255, 255, .055);

  --ink: rgba(255, 255, 255, .96);
  --ink-soft: rgba(255, 255, 255, .78);
  --muted: rgba(255, 255, 255, .58);
  --muted-soft: rgba(255, 255, 255, .38);

  --line: rgba(255, 255, 255, .10);
  --line-strong: rgba(255, 255, 255, .18);
  --line-bright: rgba(255, 255, 255, .28);

  --glass: rgba(20, 20, 26, .64);
  --glass-strong: rgba(31, 31, 38, .74);
  --glass-soft: rgba(255, 255, 255, .055);
  --glass-blur: blur(18px) saturate(1.08);

  --accent: #33daff;
  --accent-strong: #0055fe;
  --accent-soft: rgba(51, 218, 255, .17);
  --primary: #33daff;
  --foreground: rgba(255, 255, 255, .96);
  --danger: #ff7366;
  --warning: #facc15;
  --success: #36ff82;

  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --radius-pill: 999rem;

  --shadow-panel: none;
  --shadow-soft: none;
  --transition: .16s ease;

  --text-on-accent: #fff;
  --control-bg: rgba(255, 255, 255, .075);
  --control-bg-hover: rgba(255, 255, 255, .10);
  --secondary-bg: rgba(255, 255, 255, .065);
  --secondary-bg-hover: rgba(255, 255, 255, .105);
  --field-bg: rgba(255, 255, 255, .06);
  --field-bg-focus: rgba(255, 255, 255, .065);
  --field-border-focus: rgba(255, 255, 255, .22);
  --switch-bg: rgba(255, 255, 255, .085);
  --switch-knob: rgba(255, 255, 255, .82);
  --switch-knob-active: #fff;
  --scroll-thumb: rgba(255, 255, 255, .20);
  --row-line: rgba(255, 255, 255, .075);
  --modal-backdrop: rgba(0, 0, 0, .58);
  --modal-bg: rgba(18, 18, 23, .92);
  --toast-bg: rgba(20, 20, 26, .82);
  --select-menu-bg: rgba(19, 19, 25, .96);

  --success-ink: rgba(220, 255, 232, .92);
  --success-line: rgba(54, 255, 130, .23);
  --success-bg: rgba(54, 255, 130, .075);
  --danger-ink: rgba(255, 235, 232, .98);
  --danger-line: rgba(255, 115, 102, .38);
  --danger-bg: rgba(255, 115, 102, .105);
  --danger-bg-strong: rgba(255, 115, 102, .235);
  --danger-line-strong: rgba(255, 115, 102, .72);
  --warning-ink: rgba(255, 246, 206, .94);
  --warning-line: rgba(250, 204, 21, .25);
  --warning-bg: rgba(250, 204, 21, .075);
}


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

* {
  border: 0;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

[hidden] {
  display: none !important;
}

html {
  min-height: 100%;
  overflow-x: hidden;
  background: var(--page);
  text-size-adjust: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--ink);
  background: var(--page);
  font-family: var(--font-main);
  font-variation-settings: "wght" 400;
  -moz-osx-font-smoothing: grayscale;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

button,
[role="button"] {
  cursor: pointer;
}

button:disabled,
input:disabled,
textarea:disabled {
  cursor: not-allowed;
  opacity: .52;
}

button:focus-visible,
textarea:focus-visible,
input:focus-visible,
select:focus-visible,
[role="button"]:focus-visible {
  outline: 2px solid rgba(51, 218, 255, .52);
  outline-offset: 3px;
}

.app-shell {
  width: min(1120px, calc(100% - 28px));
  margin: 0 auto;
  padding: clamp(12px, 2.2vw, 24px) 0 18px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  clip-path: inset(50%);
}

.page-heading {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin: clamp(10px, 2vw, 18px) auto clamp(18px, 3vw, 30px);
  text-align: center;
}

.page-heading .text-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  gap: 16px;
  text-align: center;
}

.page-heading .inline-flex {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: clamp(68px, 7vw, 80px);
  height: clamp(68px, 7vw, 80px);
  margin-bottom: 0;
  border: 1px solid rgba(91, 203, 255, .24);
  border-radius: 22px;
  color: #5bcbff;
  background: linear-gradient(135deg, rgba(91, 203, 255, .13), rgba(91, 203, 255, .045));
  box-shadow: none;
}

.page-heading .lucide-shield {
  width: clamp(34px, 4vw, 40px);
  height: clamp(34px, 4vw, 40px);
  display: block;
  color: #5bcbff;
  filter: none;
}

.page-heading h1 {
  max-width: 920px;
  margin-inline: auto;
  color: transparent;
  background: linear-gradient(90deg, var(--foreground), rgba(255, 255, 255, .70));
  -webkit-background-clip: text;
  background-clip: text;
  font-size: clamp(28px, 4.2vw, 44px);
  line-height: 1.04;
  letter-spacing: -.045em;
  font-weight: 700;
  text-align: center;
}


.glass-panel {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--surface-soft);
  box-shadow: none;
  backdrop-filter: blur(14px) saturate(1.02);
  -webkit-backdrop-filter: blur(14px) saturate(1.02);
}

.glass-panel::before {
  content: none;
}

.glass-panel > * {
  position: relative;
  z-index: 1;
}

.panel {
  border-radius: var(--radius-xl);
}


h1,
h2,
p {
  margin: 0;
}

h1 {
  max-width: 760px;
  margin-top: 0;
  color: var(--ink);
  font-size: clamp(33px, 4.8vw, 52px);
  line-height: .96;
  letter-spacing: -.062em;
  font-weight: 500;
}

h2 {
  color: var(--ink);
  font-size: clamp(18px, 2vw, 24px);
  line-height: 1.06;
  letter-spacing: -.045em;
  font-weight: 500;
}

p {
  max-width: 740px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.48;
}

.bulk-actions,
.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.bulk-actions {
  margin-top: 12px;
}

button,
.button-like {
  min-height: 39px;
  padding: 0 15px;
  color: var(--text-on-accent);
  border: 1px solid rgba(51, 218, 255, .27);
  border-radius: var(--radius-pill);
  background:
    linear-gradient(135deg, rgba(0, 85, 254, .72), rgba(51, 218, 255, .24)),
    var(--control-bg);
  box-shadow: inset 0 1px 0 var(--line);
  font-weight: 500;
  white-space: nowrap;
  transition: transform var(--transition), background var(--transition), border-color var(--transition), opacity var(--transition);
}

button:hover,
.button-like:hover {
  transform: translateY(-1px);
  border-color: rgba(51, 218, 255, .42);
  background:
    linear-gradient(135deg, rgba(0, 85, 254, .82), rgba(51, 218, 255, .32)),
    var(--control-bg-hover);
}

button:active,
.button-like:active {
  transform: translateY(0);
}

.button-secondary {
  color: var(--ink-soft);
  background: var(--secondary-bg);
  border-color: var(--line);
}

.button-secondary:hover {
  color: var(--ink);
  background: var(--secondary-bg-hover);
  border-color: var(--line-strong);
}

.is-online { color: var(--success); }
.is-offline { color: var(--danger); }
.is-checking { color: var(--accent); }

.switch {
  display: inline-flex;
  flex: 0 0 auto;
}

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

.switch span {
  position: relative;
  display: block;
  width: 46px;
  height: 26px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill);
  background: var(--switch-bg);
  transition: background var(--transition), border-color var(--transition);
}

.switch span::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: var(--radius-pill);
  background: var(--switch-knob);
  box-shadow: none;
  transition: transform .18s ease, background .18s ease;
}

.switch input:checked + span {
  border-color: rgba(51, 218, 255, .42);
  background: linear-gradient(135deg, rgba(0, 85, 254, .62), rgba(51, 218, 255, .26));
}

.switch input:checked + span::after {
  transform: translateX(20px);
  background: var(--switch-knob-active);
}


.panel {
  margin-bottom: 10px;
  padding: clamp(15px, 2vw, 20px);
}

.panel__header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.panel__header--split {
  align-items: flex-start;
}

.panel-controls {
  flex: 0 0 auto;
  display: flex;
  align-items: stretch;
  justify-content: flex-end;
  gap: 8px;
}

.monitor-inline {
  min-width: 188px;
  min-height: 53px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
}

.monitor-inline span {
  display: block;
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.monitor-inline strong {
  display: block;
  margin-top: 4px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
}

.monitor-inline[data-enabled="false"] strong {
  color: var(--muted);
}


.sync-info,
.history-note {
  flex: 0 0 auto;
  min-width: 128px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
  color: var(--muted);
  text-align: right;
  font-size: 11.5px;
  font-weight: 500;
}

.history-note {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 142px;
  text-align: center;
  white-space: nowrap;
}

.history-header-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: stretch;
  justify-content: flex-end;
  gap: 8px;
}

.history-clear-button {
  min-height: 38px;
  padding-inline: 13px;
  color: var(--ink-soft);
  border-color: var(--line);
  background: var(--surface-soft);
  box-shadow: none;
  font-size: 12px;
}

.history-clear-button:hover {
  transform: none;
  color: var(--ink);
  border-color: var(--line-strong);
  background: var(--surface);
}

.sync-info {
  display: grid;
  gap: 3px;
  transition: none;
}

.sync-info:hover {
  transform: none;
  background: var(--surface-soft);
  border-color: var(--line);
}

.sync-info span {
  display: block;
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.sync-info strong {
  display: block;
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
}

.interval-button {
  appearance: none;
  width: auto;
  min-height: unset;
  color: inherit;
  text-align: right;
}

.bulk-form {
  display: grid;
  gap: 10px;
}

textarea,
.input-field,
select {
  width: 100%;
  color: var(--ink);
  background: var(--field-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  font-size: 13px;
  line-height: 1.6;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
}

textarea {
  min-height: 126px;
  resize: vertical;
  padding: 12px 13px;
}

textarea:hover,
.input-field:hover,
select:hover {
  background: var(--field-bg);
  border-color: var(--line);
}

textarea:focus,
.input-field:focus,
select:focus {
  background: var(--secondary-bg);
  border-color: var(--field-border-focus);
}

textarea::placeholder,
.input-field::placeholder {
  color: var(--muted-soft);
}

.domain-chip-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 9px;
}

.domain-chip {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 4px 9px;
  color: var(--ink-soft);
  background: var(--field-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 500;
}

.domain-cell {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  min-width: 0;
  width: 100%;
}

.domain-cell__name {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.domain-link-button {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 27px;
  height: 27px;
  color: #5bcbff;
  border: 1px solid rgba(91, 203, 255, .20);
  border-radius: var(--radius-pill);
  background: rgba(91, 203, 255, .07);
  text-decoration: none;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
}

.domain-link-button:hover {
  color: #8fddff;
  border-color: rgba(91, 203, 255, .36);
  background: rgba(91, 203, 255, .12);
}

.domain-link-button:focus-visible {
  outline: 2px solid rgba(91, 203, 255, .46);
  outline-offset: 2px;
}

.domain-link-button svg {
  display: block;
}

/* Result tables */
.table-wrap {
  overflow: auto;
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface-soft);
  scrollbar-width: thin;
  scrollbar-color: var(--scroll-thumb) transparent;
}

.table-wrap::-webkit-scrollbar { height: 9px; width: 9px; }
.table-wrap::-webkit-scrollbar-thumb { background: var(--scroll-thumb); border-radius: 999px; }
.table-wrap::-webkit-scrollbar-track { background: transparent; }

table {
  width: 100%;
  min-width: 780px;
  border-collapse: collapse;
  table-layout: fixed;
}

th,
td {
  height: 42px;
  padding: 10px 12px;
  text-align: left;
  vertical-align: middle;
  border-bottom: 1px solid var(--line);
}

th {
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .075em;
  text-transform: uppercase;
}

td {
  color: var(--ink-soft);
  font-size: 13px;
}

th:nth-child(1),
td:nth-child(1) {
  width: 28%;
}

th:nth-child(2),
td:nth-child(2) {
  width: 22%;
  white-space: nowrap;
}

th:nth-child(3),
th:nth-child(4),
th:nth-child(5),
td:nth-child(3),
td:nth-child(4),
td:nth-child(5) {
  width: 16.66%;
  text-align: center;
  white-space: nowrap;
}

td:first-child {
  overflow: hidden;
  color: var(--ink);
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

tbody tr {
  transition: none;
}

tbody tr:hover {
  background: transparent;
}

.table-wrap .badge,
.table-wrap .risk-pill {
  vertical-align: middle;
}

.badge,
.risk-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 82px;
  min-height: 24px;
  padding: 4px 8px;
  color: var(--ink-soft);
  background: var(--field-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: .03em;
  text-transform: uppercase;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
}

.badge::before,
.risk-pill::before {
  content: "";
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  border-radius: var(--radius-pill);
  background: var(--muted-soft);
}

.badge--active,
.badge--clear,
.badge--healthy,
.badge--online,
.badge--low,
.risk-pill--active,
.risk-pill--low {
  color: var(--success-ink);
  border-color: var(--success-line);
  background: var(--success-bg);
}

.badge--active::before,
.badge--clear::before,
.badge--healthy::before,
.badge--online::before,
.badge--low::before,
.risk-pill--active::before,
.risk-pill--low::before {
  background: var(--success);
}

.badge--attention,
.badge--indicated,
.badge--medium,
.badge--timeout,
.risk-pill--medium {
  color: var(--warning-ink);
  border-color: var(--warning-line);
  background: var(--warning-bg);
}

.badge--attention::before,
.badge--indicated::before,
.badge--medium::before,
.badge--timeout::before,
.risk-pill--medium::before {
  background: var(--warning);
}

.badge--blocked,
.badge--blocked_or_flagged,
.badge--high,
.risk-pill--blocked,
.risk-pill--high {
  color: var(--danger-ink);
  border-color: var(--danger-line);
  background: var(--danger-bg);
  animation: blockedChipFade 1.28s ease-in-out infinite;
}

.badge--offline {
  color: var(--warning-ink);
  border-color: var(--warning-line);
  background: var(--warning-bg);
}

.badge--blocked::before,
.badge--blocked_or_flagged::before,
.badge--high::before,
.risk-pill--blocked::before,
.risk-pill--high::before {
  background: var(--danger);
  animation: blockedDotFade 1.28s ease-in-out infinite;
}

.badge--offline::before {
  background: var(--warning);
}

.badge--checking::before,
.badge--unknown::before,
.risk-pill--unknown::before {
  background: var(--accent);
}

@keyframes blockedChipFade {
  0%, 100% {
    background: var(--danger-bg);
    border-color: var(--danger-line);
  }

  50% {
    background: var(--danger-bg-strong);
    border-color: var(--danger-line-strong);
  }
}

@keyframes blockedDotFade {
  0%, 100% { opacity: .86; }
  50% { opacity: 1; }
}

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

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

.loading-card,
.error-card,
.empty-card {
  border: 1px solid var(--line);
  background: var(--surface-soft);
  border-radius: var(--radius-lg);
  padding: 12px;
}

/* History table */
.history-table {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface-soft);
}

.history-table__head,
.history-row {
  display: grid;
  grid-template-columns: minmax(190px, 1.28fr) minmax(170px, .9fr) repeat(3, minmax(96px, .62fr));
  align-items: center;
  gap: 8px;
}

.history-table__head {
  min-height: 38px;
  padding: 0 12px;
  color: var(--muted);
  background: var(--surface-soft);
  border-bottom: 1px solid var(--line);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .075em;
  text-transform: uppercase;
}

.history-table__head span:nth-child(n+3) {
  text-align: center;
}

.history-table__body {
  display: grid;
}

.history-row {
  min-height: 48px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--row-line);
  transition: none;
}

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

.history-row:hover {
  background: transparent;
}

.history-row__domain {
  display: flex;
  align-items: center;
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.3;
}

.history-row__date {
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.3;
  white-space: nowrap;
}

.history-row__cell {
  display: flex;
  justify-content: center;
  min-width: 0;
}

.history-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 82px;
  min-height: 24px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: .03em;
  line-height: 1;
  text-align: center;
  text-transform: uppercase;
  white-space: nowrap;
}

.history-status::before {
  content: "";
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  border-radius: var(--radius-pill);
}

.history-status--active,
.history-status--clear,
.history-status--healthy,
.history-status--online,
.history-status--low {
  color: var(--success-ink);
  border-color: var(--success-line);
  background: var(--success-bg);
}

.history-status--active::before,
.history-status--clear::before,
.history-status--healthy::before,
.history-status--online::before,
.history-status--low::before {
  background: var(--success);
}

.history-status--blocked,
.history-status--blocked_or_flagged,
.history-status--high {
  color: var(--danger-ink);
  border-color: var(--danger-line);
  background: var(--danger-bg);
  animation: blockedChipFade 1.28s ease-in-out infinite;
}

.history-status--blocked::before,
.history-status--blocked_or_flagged::before,
.history-status--high::before {
  background: var(--danger);
  animation: blockedDotFade 1.28s ease-in-out infinite;
}

.history-status--offline,
.history-status--timeout,
.history-status--medium {
  color: var(--warning-ink);
  border-color: var(--warning-line);
  background: var(--warning-bg);
}

.history-status--offline::before,
.history-status--timeout::before,
.history-status--medium::before {
  background: var(--warning);
}

.history-status--checking::before,
.history-status--unknown::before {
  background: var(--accent);
}


.history-pagination {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 8px 10px;
  border-top: 1px solid var(--line);
}

.history-pagination__summary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 96px;
  color: var(--muted);
  text-align: center;
  font-size: 11.5px;
  font-weight: 500;
}

.history-pagination__actions {
  display: inline-flex;
  gap: 7px;
}

.history-page-button {
  min-height: 31px;
  padding: 0 12px;
  color: var(--ink-soft);
  border-color: var(--line);
  background: var(--surface-soft);
  box-shadow: none;
  font-size: 12px;
}

.history-page-button:hover {
  transform: none;
  color: var(--ink);
  border-color: var(--line-strong);
  background: var(--surface);
}

.error-card {
  color: var(--ink-soft);
}

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

.footer {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 3px;
  color: var(--muted);
  font-size: 12px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  z-index: 100;
  width: min(440px, calc(100% - 28px));
  padding: 13px 15px;
  color: var(--ink);
  background: var(--toast-bg);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-panel);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  font-size: 14px;
  font-weight: 500;
}

.toast[data-type="warn"] {
  border-color: rgba(250, 204, 21, .28);
}

.toast[data-type="error"] {
  border-color: rgba(255, 115, 102, .28);
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 18px;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: var(--modal-backdrop);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.modal__panel {
  width: min(480px, 100%);
  overflow: visible;
  border-radius: var(--radius-xl);
  padding: 20px;
  background: var(--modal-bg);
  box-shadow: none;
}

.modal__panel::before {
  border-radius: inherit;
}

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

.modal__header p {
  margin-top: 7px;
  font-size: 14px;
}

.modal__close {
  width: 38px;
  height: 38px;
  min-height: 38px;
  flex: 0 0 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border-radius: var(--radius-pill);
  color: var(--ink);
  background: var(--secondary-bg);
  border: 1px solid var(--line);
}

.modal__close:hover {
  background: var(--secondary-bg-hover);
  border-color: var(--line-strong);
}

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

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

.form-field {
  display: grid;
  gap: 7px;
}

.form-field label,
.mode-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.input-field,
select {
  min-height: 44px;
  padding: 0 13px;
}

.interval-help {
  margin-top: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.modal-actions {
  justify-content: flex-end;
  margin-top: 4px;
}

.select-shell {
  position: relative;
}

.native-select {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
  pointer-events: none;
}

.select-trigger {
  width: 100%;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 13px;
  color: var(--ink);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: none;
  text-align: left;
}

.select-trigger:hover,
.select-shell.is-open .select-trigger {
  background: var(--surface-soft);
  border-color: var(--line);
  transform: none;
}

.select-trigger__chevron {
  flex: 0 0 auto;
  color: var(--muted);
  transition: transform var(--transition), color var(--transition);
}

.select-shell.is-open .select-trigger__chevron {
  color: var(--ink-soft);
  transform: rotate(180deg);
}

.select-menu {
  position: absolute;
  inset-inline: 0;
  top: calc(100% + 7px);
  z-index: 25;
  overflow: hidden;
  padding: 5px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  background: var(--select-menu-bg);
  box-shadow: var(--shadow-panel);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
}

.select-option {
  width: 100%;
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 11px;
  color: var(--ink-soft);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 12px;
  box-shadow: none;
  text-align: left;
}

.select-option:hover {
  transform: none;
  color: var(--ink);
  background: var(--surface);
  border-color: var(--line);
}

.select-option.is-selected {
  color: var(--ink);
  background: var(--surface-soft);
  border-color: var(--field-border-focus);
}

.select-option.is-selected::after {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: var(--radius-pill);
  background: var(--accent);
}



@media (max-width: 720px) {
  .app-shell {
    width: min(100% - 18px, 1120px);
    padding-top: 9px;
  }

  .panel__header,
  .footer {
    flex-direction: column;
  }

  .panel__header {
    align-items: stretch;
  }

  .panel-controls {
    width: 100%;
    flex-wrap: wrap;
    justify-content: stretch;
  }

  .sync-info,
  .history-note,
  .history-header-actions,
  .interval-button,
  .monitor-inline {
    width: 100%;
    min-width: 0;
    text-align: left;
  }

  .history-header-actions {
    flex-wrap: wrap;
    justify-content: stretch;
  }

  .history-header-actions .history-note,
  .history-header-actions .history-clear-button {
    flex: 1 1 100%;
  }

  .history-table {
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--scroll-thumb) transparent;
  }

  .history-table::-webkit-scrollbar { height: 8px; }
  .history-table::-webkit-scrollbar-thumb { background: var(--scroll-thumb); border-radius: 999px; }
  .history-table::-webkit-scrollbar-track { background: transparent; }

  .history-table__head,
  .history-row {
    grid-template-columns: minmax(170px, 1.2fr) minmax(152px, .9fr) repeat(3, 92px);
    min-width: 640px;
  }
}

@media (max-width: 560px) {
  .app-shell {
    width: min(100% - 14px, 1120px);
  }

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

  .panel,
  .modal__panel {
    padding: 15px;
  }


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

  .bulk-actions button,
  .modal-actions button {
    flex: 1 1 100%;
    justify-content: center;
  }


  .modal {
    padding: 10px;
  }
}

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