:root {
  color-scheme: light;
  --bg: #f4f6f9;
  --panel: rgba(255, 255, 255, 0.82);
  --panel-strong: #ffffff;
  --text: #18202a;
  --muted: #617084;
  --line: rgba(23, 34, 54, 0.08);
  --accent: #2d7dd2;
  --accent-soft: rgba(45, 125, 210, 0.12);
  --success: #169a63;
  --warning: #d99b19;
  --stale: #d46d2c;
  --danger: #d84545;
  --shadow: 0 20px 48px rgba(18, 35, 64, 0.10);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --content-width: 1240px;
  --font: "SF Pro Display", "Inter", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top left, rgba(45, 125, 210, 0.16), transparent 28%),
    radial-gradient(circle at top right, rgba(85, 197, 170, 0.14), transparent 24%),
    linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
  color: var(--text);
  font-family: var(--font);
}

body {
  min-height: 100vh;
}

.popup-body {
  display: grid;
  place-items: center;
  padding: 20px;
}

.popup-card {
  width: min(100%, 360px);
  padding: 28px 24px;
  background: var(--panel);
  backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 28px;
  box-shadow: var(--shadow);
  text-align: center;
}

.popup-spinner {
  width: 38px;
  height: 38px;
  margin: 0 auto 4px;
  border-radius: 999px;
  border: 3px solid rgba(24, 32, 42, 0.12);
  border-top-color: var(--text);
  animation: popup-spin 0.9s linear infinite;
}

@keyframes popup-spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
}

.app-shell,
.auth-shell {
  width: min(var(--content-width), calc(100vw - 32px));
  margin: 0 auto;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 0;
}

.auth-card {
  width: min(460px, 100%);
  background: var(--panel);
  backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 32px;
  box-shadow: var(--shadow);
  padding: 28px;
}

.brand-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(24, 32, 42, 0.06);
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 600;
}

.auth-title,
.page-title {
  margin: 18px 0 8px;
  font-size: clamp(2rem, 4vw, 2.7rem);
  line-height: 1.02;
  letter-spacing: -0.03em;
}

.auth-subtitle,
.page-subtitle {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

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

.stack-lg {
  display: grid;
  gap: 20px;
}

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

.field label,
.section-label {
  font-size: 0.95rem;
  font-weight: 600;
}

.input,
.select,
.textarea {
  width: 100%;
  border: 1px solid rgba(24, 32, 42, 0.10);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.96);
  color: var(--text);
  padding: 14px 15px;
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.textarea {
  min-height: 112px;
  resize: vertical;
}

.input:focus,
.select:focus,
.textarea:focus {
  border-color: rgba(45, 125, 210, 0.44);
  box-shadow: 0 0 0 4px rgba(45, 125, 210, 0.12);
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.button,
.button-secondary,
.button-danger,
.button-ghost,
.button-inline,
.button-apple {
  border: 0;
  border-radius: 16px;
  padding: 13px 16px;
  font-weight: 700;
  transition: transform 0.14s ease, box-shadow 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.button:hover,
.button-secondary:hover,
.button-danger:hover,
.button-ghost:hover,
.button-inline:hover,
.button-apple:hover {
  transform: translateY(-1px);
}

.button {
  color: #fff;
  background: linear-gradient(135deg, #2d7dd2 0%, #4b95e3 100%);
  box-shadow: 0 14px 28px rgba(45, 125, 210, 0.24);
}

.button-secondary {
  color: var(--text);
  background: rgba(24, 32, 42, 0.07);
}

.button-danger {
  color: #fff;
  background: linear-gradient(135deg, #d84545 0%, #f06767 100%);
  box-shadow: 0 14px 28px rgba(216, 69, 69, 0.22);
}

.button-ghost {
  color: var(--muted);
  background: transparent;
  padding-inline: 0;
}

.button-inline {
  padding: 10px 12px;
  background: rgba(24, 32, 42, 0.06);
  color: var(--text);
}

.button-apple {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #fff;
  background: #111;
  box-shadow: 0 14px 28px rgba(17, 17, 17, 0.16);
}

.button-apple:disabled {
  cursor: not-allowed;
  opacity: 0.52;
  transform: none;
}

.button-apple__icon {
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1 1 auto;
  height: 1px;
  background: var(--line);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  padding: 18px 0 14px;
  backdrop-filter: blur(18px);
  background: linear-gradient(180deg, rgba(244, 246, 249, 0.92), rgba(244, 246, 249, 0.72));
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  width: min(var(--content-width), calc(100vw - 32px));
  margin: 0 auto;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.topbar-mark {
  width: 46px;
  height: 46px;
  border-radius: 16px;
  background: linear-gradient(135deg, #2d7dd2 0%, #53c2b3 100%);
  box-shadow: 0 18px 30px rgba(45, 125, 210, 0.22);
}

.topbar-title {
  font-size: 1.05rem;
  font-weight: 800;
}

.topbar-subtitle {
  color: var(--muted);
  font-size: 0.88rem;
}

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

.nav-link {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  padding: 11px 14px;
  border-radius: 999px;
}

.nav-link.is-active {
  color: var(--text);
  background: rgba(24, 32, 42, 0.07);
}

.session-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 999px;
  background: rgba(24, 32, 42, 0.06);
  color: var(--muted);
  font-size: 0.88rem;
}

.page {
  padding: 14px 0 48px;
}

.hero-card,
.panel-card,
.sensor-card,
.metric-card,
.chart-card,
.empty-card,
.inline-form,
.settings-card {
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(18px);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
}

.hero-card,
.settings-card,
.panel-card,
.inline-form,
.empty-card {
  padding: 22px;
}

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

.dashboard-grid {
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
}

.sensor-card {
  position: relative;
  padding: 18px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(249, 251, 254, 0.96));
}

.sensor-card::after {
  content: "";
  position: absolute;
  inset: auto -20px -20px auto;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(45, 125, 210, 0.11), transparent 68%);
}

.sensor-card__top,
.sensor-card__bottom,
.detail-meta-row,
.panel-header,
.chart-header,
.notification-row,
.share-row,
.transfer-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.sensor-card__top {
  margin-bottom: 14px;
}

.sensor-card__title,
.detail-title {
  margin: 0;
  font-size: 1.18rem;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.detail-title {
  font-size: clamp(1.8rem, 3vw, 2.45rem);
}

.sensor-card__meta,
.muted,
.panel-subtext,
.helper {
  color: var(--muted);
}

.favorite-button {
  width: 38px;
  height: 38px;
  border-radius: 14px;
  border: 0;
  background: rgba(255, 255, 255, 0.74);
  color: #9aa6b6;
}

.favorite-button.is-active {
  color: #e59c18;
}

.badge-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 11px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
}

.badge--ownership {
  background: rgba(24, 32, 42, 0.07);
  color: var(--muted);
}

.badge--live {
  background: rgba(22, 154, 99, 0.15);
  color: var(--success);
}

.badge--delayed {
  background: rgba(217, 155, 25, 0.16);
  color: var(--warning);
}

.badge--stale {
  background: rgba(212, 109, 44, 0.16);
  color: var(--stale);
}

.badge--offline {
  background: rgba(216, 69, 69, 0.14);
  color: var(--danger);
}

.badge--never {
  background: rgba(97, 112, 132, 0.15);
  color: var(--muted);
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.metric-card {
  padding: 12px 13px;
  background: rgba(255, 255, 255, 0.76);
  border-radius: 20px;
  border: 1px solid rgba(24, 32, 42, 0.06);
  box-shadow: none;
}

.metric-label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
}

.metric-value {
  font-size: 1.18rem;
  font-weight: 800;
  line-height: 1.1;
}

.bottom-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: auto;
}

.meta-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 0.86rem;
  white-space: nowrap;
}

.spacer {
  flex: 1 1 auto;
}

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

.page-grid--detail {
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, 0.95fr);
  align-items: start;
}

.section-title {
  margin: 0 0 12px;
  font-size: 1.1rem;
  letter-spacing: -0.01em;
}

.chart-grid {
  display: grid;
  gap: 14px;
}

.chart-card {
  padding: 18px;
}

.chart-title {
  margin: 0;
  font-size: 1rem;
}

.chart-meta {
  color: var(--muted);
  font-size: 0.85rem;
}

.chart-svg {
  width: 100%;
  height: 160px;
  display: block;
  margin-top: 14px;
}

.chart-area {
  fill: rgba(45, 125, 210, 0.12);
}

.chart-line {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chart-empty {
  min-height: 160px;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 0.92rem;
}

.table-list {
  display: grid;
  gap: 10px;
}

.table-item {
  display: grid;
  gap: 12px;
  padding: 14px 15px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.70);
  border: 1px solid rgba(24, 32, 42, 0.05);
}

.rule-summary,
.share-summary {
  display: grid;
  gap: 4px;
}

.summary-title {
  font-weight: 700;
}

.summary-caption {
  color: var(--muted);
  font-size: 0.88rem;
}

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

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.toggle-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(24, 32, 42, 0.06);
  color: var(--muted);
  font-size: 0.9rem;
}

.status-ok {
  color: var(--success);
}

.status-warn {
  color: var(--warning);
}

.status-danger {
  color: var(--danger);
}

.info-banner {
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(45, 125, 210, 0.10);
  color: var(--text);
}

.notice-card {
  padding: 16px;
  border-radius: 18px;
  background: rgba(24, 32, 42, 0.05);
}

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

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

.search-input {
  min-width: min(100%, 320px);
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 40;
  min-width: min(360px, calc(100vw - 32px));
  max-width: 420px;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(24, 32, 42, 0.94);
  color: #fff;
  box-shadow: 0 24px 46px rgba(17, 26, 46, 0.24);
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.toast.is-error {
  background: rgba(150, 32, 32, 0.96);
}

.hidden {
  display: none !important;
}

@media (max-width: 980px) {
  .page-grid--detail {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .topbar-inner {
    flex-direction: column;
    align-items: stretch;
  }

  .topbar-nav {
    justify-content: space-between;
  }

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

  .auth-card,
  .hero-card,
  .panel-card,
  .settings-card,
  .inline-form,
  .empty-card {
    padding: 18px;
  }

  .sensor-card {
    padding: 16px;
  }

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

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

:root {
  color-scheme: dark;
  --bg: #071019;
  --panel: rgba(10, 17, 27, 0.88);
  --panel-strong: #101924;
  --text: #ecf3ff;
  --muted: #91a4bc;
  --line: rgba(157, 177, 201, 0.14);
  --accent: #8ab4ff;
  --accent-soft: rgba(138, 180, 255, 0.14);
  --success: #49d49e;
  --warning: #f2b84b;
  --stale: #ef8b45;
  --danger: #ef6666;
  --shadow: 0 30px 90px rgba(0, 0, 0, 0.42);
}

html,
body {
  background:
    radial-gradient(circle at top left, rgba(76, 111, 255, 0.22), transparent 26%),
    radial-gradient(circle at top right, rgba(65, 184, 131, 0.14), transparent 22%),
    linear-gradient(180deg, #060c13 0%, #0a131d 100%);
  color: var(--text);
}

.popup-body,
.auth-shell {
  min-height: 100vh;
  width: 100%;
}

.auth-shell {
  display: grid;
  place-items: center;
  padding: 32px 16px;
}

.auth-card,
.popup-card,
.hero-card,
.panel-card,
.sensor-card,
.metric-card,
.chart-card,
.empty-card,
.inline-form,
.settings-card,
.notice-card,
.table-item,
.modal-card {
  background: linear-gradient(180deg, rgba(11, 19, 29, 0.92), rgba(12, 21, 32, 0.9));
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.auth-card {
  width: min(520px, 100%);
  padding: 34px 30px;
  text-align: center;
}

.auth-brand {
  display: grid;
  gap: 12px;
  text-align: center;
}

.brand-kicker {
  background: rgba(138, 180, 255, 0.12);
  color: #b7d1ff;
}

.auth-title,
.page-title,
.detail-title,
.topbar-title {
  color: var(--text);
}

.auth-subtitle,
.page-subtitle,
.panel-subtext,
.helper,
.summary-caption,
.chart-meta,
.topbar-subtitle,
.session-chip,
.meta-badge,
.muted {
  color: var(--muted);
}

.input,
.select,
.textarea {
  border-color: rgba(157, 177, 201, 0.16);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

.input:focus,
.select:focus,
.textarea:focus {
  border-color: rgba(138, 180, 255, 0.5);
  box-shadow: 0 0 0 4px rgba(138, 180, 255, 0.14);
}

.button {
  background: linear-gradient(135deg, #6d9cff 0%, #8ab4ff 100%);
  box-shadow: 0 16px 28px rgba(109, 156, 255, 0.22);
}

.button-secondary,
.button-inline,
.favorite-button,
.toggle-pill,
.session-chip,
.notice-card,
.info-banner {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}

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

.button-apple {
  background: linear-gradient(180deg, #111720 0%, #090d13 100%);
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.28);
}

.button-row {
  align-items: center;
}

.auth-card .button-row {
  justify-content: center;
}

.auth-card .button,
.auth-card .button-apple {
  width: 100%;
}

.auth-divider::before,
.auth-divider::after {
  background: var(--line);
}

.topbar {
  border-bottom: 1px solid rgba(157, 177, 201, 0.08);
  background: linear-gradient(180deg, rgba(5, 10, 16, 0.88), rgba(5, 10, 16, 0.68));
}

.topbar-mark {
  background: linear-gradient(135deg, #5f8dff 0%, #4ad39e 100%);
  box-shadow: 0 18px 34px rgba(95, 141, 255, 0.24);
}

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

.nav-link.is-active {
  color: var(--text);
  background: rgba(138, 180, 255, 0.12);
}

.page {
  padding: 18px 0 56px;
}

.dashboard-hero__header,
.dashboard-toolbar,
.section-block__header,
.folder-chip,
.folder-create-row,
.sensor-card__actions,
.toolbar-select {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.dashboard-toolbar {
  align-items: flex-end;
}

.toolbar-hint {
  color: var(--muted);
  font-size: 0.88rem;
}

.dashboard-search {
  width: min(280px, 100%);
}

.search-input--compact {
  min-width: 0;
  padding: 12px 14px;
}

.toolbar-select label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--muted);
}

.folder-create-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
}

.folder-chip-list,
.section-block,
.metric-detail-view {
  display: grid;
  gap: 14px;
}

.folder-chip {
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
}

.folder-chip strong {
  display: block;
}

.folder-chip span {
  color: var(--muted);
  font-size: 0.88rem;
}

.hero-card--sensor,
.panel-card--subtle,
.inline-form--dark,
.chart-panel,
.chart-card--interactive {
  background: linear-gradient(180deg, rgba(10, 18, 28, 0.94), rgba(8, 15, 24, 0.9));
}

.sensor-card {
  background:
    radial-gradient(circle at top right, rgba(138, 180, 255, 0.12), transparent 34%),
    linear-gradient(180deg, rgba(13, 23, 35, 0.94), rgba(10, 18, 27, 0.92));
}

.sensor-card::after {
  background: radial-gradient(circle, rgba(138, 180, 255, 0.12), transparent 68%);
}

.sensor-card__top {
  margin-bottom: 16px;
}

.sensor-name-link {
  color: inherit;
  text-decoration: none;
}

.sensor-name-link:hover {
  color: #bcd2ff;
}

.icon-button {
  width: 38px;
  height: 38px;
  border-radius: 14px;
  border: 1px solid rgba(157, 177, 201, 0.08);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  display: inline-grid;
  place-items: center;
  font-size: 1rem;
}

.icon-button:hover {
  transform: translateY(-1px);
}

.favorite-button {
  border: 1px solid rgba(157, 177, 201, 0.08);
  color: #8fa3ba;
}

.favorite-button.is-active {
  color: #f4c75d;
}

.badge--ownership,
.badge--folder {
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
}

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

.metric-grid--hero {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.metric-card {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(157, 177, 201, 0.08);
  min-width: 0;
}

.metric-card .metric-value,
.sensor-card .metric-value {
  font-size: 1rem;
}

.metric-card .metric-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chart-card {
  padding: 20px;
}

.chart-shell {
  position: relative;
  display: grid;
  gap: 12px;
}

.chart-inspector {
  display: grid;
  gap: 4px;
}

.chart-inspector__value {
  font-size: clamp(1.1rem, 2vw, 1.45rem);
  font-weight: 800;
  line-height: 1.05;
}

.chart-inspector__meta {
  color: var(--muted);
  font-size: 0.88rem;
}

.chart-stage {
  position: relative;
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(13, 23, 35, 0.9), rgba(8, 15, 23, 0.96));
  padding: 14px;
}

.chart-stage__surface {
  height: 220px;
}

.chart-shell--detail .chart-stage__surface {
  height: 380px;
}

.chart-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.chart-grid-line {
  stroke: rgba(157, 177, 201, 0.12);
  stroke-width: 1;
}

.chart-grid-line--vertical {
  stroke-dasharray: 4 5;
}

.chart-axis-label {
  fill: #8297b0;
  font-size: 13px;
  font-family: var(--font);
}

.chart-axis-label--x {
  font-size: 12px;
}

.chart-area {
  fill: rgba(138, 180, 255, 0.14);
}

.chart-line {
  fill: none;
  stroke: #8ab4ff;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chart-focus-line {
  stroke: rgba(138, 180, 255, 0.34);
  stroke-width: 1.5;
  stroke-dasharray: 4 5;
}

.chart-focus-point {
  fill: #8ab4ff;
  stroke: #071019;
  stroke-width: 3;
}

.chart-hitbox {
  cursor: crosshair;
}

.chart-tooltip {
  position: absolute;
  z-index: 2;
  min-width: 150px;
  padding: 10px 12px;
  border-radius: 16px;
  background: rgba(4, 9, 16, 0.94);
  border: 1px solid rgba(138, 180, 255, 0.16);
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.32);
  pointer-events: none;
  transform: translate(-50%, -110%);
}

.chart-tooltip__value {
  font-weight: 800;
  margin-bottom: 4px;
}

.chart-tooltip__meta,
.chart-axis-caption {
  color: var(--muted);
  font-size: 0.82rem;
}

.chart-axis-caption--y {
  margin-top: -6px;
}

.chart-empty {
  min-height: 240px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px dashed rgba(157, 177, 201, 0.16);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(2, 6, 11, 0.68);
  backdrop-filter: blur(12px);
}

.modal-card {
  width: min(460px, calc(100vw - 32px));
  padding: 26px;
}

.table-item,
.notice-card,
.toggle-pill {
  border: 1px solid rgba(157, 177, 201, 0.08);
}

.toast {
  background: rgba(5, 11, 18, 0.96);
  box-shadow: 0 28px 48px rgba(0, 0, 0, 0.42);
}

.toast.is-error {
  background: rgba(116, 23, 23, 0.96);
}

@media (max-width: 980px) {
  .dashboard-toolbar,
  .dashboard-hero__header,
  .section-block__header {
    align-items: stretch;
  }

  .dashboard-search {
    width: 100%;
  }

  .toolbar-select {
    width: 100%;
    justify-content: flex-start;
  }
}

@media (max-width: 720px) {
  .auth-card {
    padding: 26px 22px;
  }

  .folder-create-row {
    grid-template-columns: 1fr;
  }

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

  .chart-shell--detail .chart-stage__surface {
    height: 300px;
  }
}
