/* ==========================================================================
   Mirava Design System — Enterprise dark theme (8px grid)
   ========================================================================== */

:root {
  /* Spacing */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;

  /* Background */
  --bg-base: #060d18;
  --bg-elevated: #0b1422;
  --bg-surface: #101a2b;
  --bg-muted: #152033;
  --bg-hover: #1a2740;

  /* Border */
  --border-subtle: rgba(148, 163, 184, 0.1);
  --border-default: rgba(148, 163, 184, 0.16);
  --border-strong: rgba(148, 163, 184, 0.24);

  /* Text */
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-tertiary: #64748b;
  --text-disabled: #475569;

  /* Brand */
  --brand-50: rgba(59, 130, 246, 0.08);
  --brand-100: rgba(59, 130, 246, 0.14);
  --brand-400: #60a5fa;
  --brand-500: #3b82f6;
  --brand-600: #2563eb;

  /* Secondary accent */
  --accent-50: rgba(139, 92, 246, 0.09);
  --accent-100: rgba(139, 92, 246, 0.16);
  --accent-300: #c4b5fd;
  --accent-400: #a78bfa;
  --accent-500: #8b5cf6;
  --accent-600: #7c3aed;

  /* Status */
  --status-up: #34d399;
  --status-up-muted: #10b981;
  --status-up-bg: rgba(52, 211, 153, 0.1);
  --status-down: #f87171;
  --status-down-muted: #ef4444;
  --status-down-bg: rgba(248, 113, 113, 0.1);
  --status-warn: #fbbf24;
  --status-warn-bg: rgba(251, 191, 36, 0.1);
  --status-checking: #94a3b8;
  --status-checking-bg: rgba(148, 163, 184, 0.1);

  /* Radius */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;

  /* Shadow */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.24);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.28);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.36);
  --shadow-inset: inset 0 1px 0 rgba(255, 255, 255, 0.04);

  /* Typography */
  --font-sans-fa: "Vazirmatn", "IRANSans", system-ui, sans-serif;
  --font-sans-en: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-sans: var(--font-sans-fa);
  --font-mono: ui-monospace, "SF Mono", "Cascadia Code", monospace;

  --text-xs: 0.6875rem;
  --text-sm: 0.8125rem;
  --text-base: 0.9375rem;
  --text-lg: 1.0625rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 2rem;
  --text-4xl: 2.5rem;

  --leading-tight: 1.25;
  --leading-normal: 1.55;
  --leading-relaxed: 1.7;

  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;

  /* Layout */
  --content-max: 1104px;
  --header-h: 56px;
  --topbar-offset: 56px;

  /* Motion */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --duration-fast: 120ms;
  --duration-normal: 200ms;

  /* Legacy aliases */
  --page-bg: var(--bg-base);
  --panel: var(--bg-elevated);
  --panel-soft: var(--bg-surface);
  --line: var(--border-default);
  --ink-strong: var(--text-primary);
  --ink-body: #cbd5e1;
  --ink-muted: var(--text-secondary);
  --blue: var(--brand-400);
  --green: var(--status-up);
  --red: var(--status-down);
  --amber: var(--status-warn);
  --text-main: var(--text-primary);
  --text-muted: var(--text-secondary);
  --text-soft: var(--text-tertiary);
  --success: var(--status-up);
  --danger: var(--status-down);
  --white: #ffffff;
  --taupe: var(--text-tertiary);
}

/* ==========================================================================
   Reset & base
   ========================================================================== */

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--topbar-offset);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

body {
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--ink-body);
  background: var(--bg-base);
  overflow-x: hidden;
}

html[dir="ltr"] body {
  font-family: var(--font-sans-en);
  letter-spacing: -0.011em;
}

html[dir="rtl"] body {
  font-family: var(--font-sans-fa);
}

:focus {
  outline: none;
}

:focus-visible {
  outline: 2px solid var(--brand-400);
  outline-offset: 2px;
}

img,
svg {
  display: block;
  max-width: 100%;
}

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

/* ==========================================================================
   Background
   ========================================================================== */

.bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(37, 99, 235, 0.12), transparent),
    radial-gradient(ellipse 55% 40% at 100% 8%, rgba(139, 92, 246, 0.1), transparent),
    radial-gradient(ellipse 45% 32% at 0% 72%, rgba(124, 58, 237, 0.055), transparent),
    var(--bg-base);
  pointer-events: none;
}

/* ==========================================================================
   Shared surfaces
   ========================================================================== */

.glass,
.dashboard,
.contributors,
.support-card,
.footer,
.mirror-card,
.chart-card,
.uptime-card,
.featured-monitor,
.about-card,
.status-grid,
.modal-content {
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md), var(--shadow-inset);
}

/* ==========================================================================
   Topbar & navigation
   ========================================================================== */

.topbar {
  position: fixed;
  top: 0;
  inset-inline: 0;
  z-index: 900;
  width: 100%;
  min-height: var(--header-h);
  margin: 0;
  padding: 0 max(var(--space-6), calc((100% - var(--content-max)) / 2 + var(--space-6)));
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: var(--space-4);
  border: none;
  border-bottom: 1px solid var(--border-default);
  border-radius: 0;
  background: rgba(6, 13, 24, 0.82);
  box-shadow: none;
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  justify-self: start;
  color: var(--text-primary);
  text-decoration: none;
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  white-space: nowrap;
  transition: color var(--duration-normal) var(--ease-out);
}

.brand-mark:hover {
  color: var(--brand-400);
}

.brand-mark img {
  width: 24px;
  height: 24px;
  border-radius: var(--radius-sm);
}

.site-nav {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  justify-self: center;
  gap: var(--space-1);
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 var(--space-3);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  transition:
    color var(--duration-normal) var(--ease-out),
    background var(--duration-normal) var(--ease-out);
}

.site-nav a:hover {
  color: var(--text-primary);
  background: rgba(148, 163, 184, 0.06);
}

.site-nav a[aria-current="page"],
.site-nav a[aria-current="location"] {
  color: var(--text-primary);
  background: transparent;
  font-weight: var(--weight-semibold);
  box-shadow: inset 0 -2px 0 var(--brand-400);
  border-radius: 0;
}

.site-nav a[aria-current="page"]:focus-visible,
.site-nav a[aria-current="location"]:focus-visible,
.site-nav a[href^="#"]:focus:not(:focus-visible) {
  outline: none;
}

.lang-toggle {
  justify-self: end;
  min-width: 40px;
  height: 32px;
  padding: 0 var(--space-2);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text-tertiary);
  cursor: pointer;
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: 0.03em;
  transition:
    border-color var(--duration-normal) var(--ease-out),
    color var(--duration-normal) var(--ease-out),
    background var(--duration-normal) var(--ease-out);
}

.lang-toggle:hover {
  color: var(--text-primary);
  border-color: var(--border-strong);
  background: rgba(148, 163, 184, 0.06);
}

/* ==========================================================================
   Hero
   ========================================================================== */

.hero {
  position: relative;
  max-width: var(--content-max);
  margin: 0 auto var(--space-6);
  padding: calc(var(--header-h) + var(--space-12)) var(--space-6) var(--space-8);
  text-align: center;
  background: transparent;
  border: none;
  box-shadow: none;
  border-radius: 0;
}

.hero::before {
  content: none;
}

.hero-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
  max-width: 640px;
  margin: 0 auto;
}

.logo {
  width: 48px;
  height: 48px;
  object-fit: contain;
  border: none;
  border-radius: var(--radius-md);
  background: transparent;
}

.logo:hover {
  transform: none;
}

.hero-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.hero-text h1 {
  font-size: clamp(1.75rem, 3.5vw, 2.125rem);
  font-weight: var(--weight-semibold);
  line-height: 1.2;
  letter-spacing: -0.025em;
  color: var(--text-primary);
}

.hero-text p {
  max-width: 38rem;
  margin: var(--space-3) auto 0;
  font-size: var(--text-base);
  line-height: 1.65;
  color: var(--text-secondary);
}

.hero-actions {
  display: flex;
  justify-content: center;
  margin-top: var(--space-5);
}

.hero-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 36px;
  padding: 0 var(--space-4);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text-primary);
  text-decoration: none;
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  cursor: pointer;
  box-shadow: none;
  transition:
    background var(--duration-normal) var(--ease-out),
    border-color var(--duration-normal) var(--ease-out);
}

.hero-btn:hover {
  background: rgba(148, 163, 184, 0.08);
  border-color: var(--border-strong);
  transform: none;
  box-shadow: none;
}

.support-link {
  border-color: rgba(167, 139, 250, 0.3);
  background: var(--accent-50);
  color: var(--accent-300);
}

.support-link:hover {
  border-color: rgba(167, 139, 250, 0.55);
  background: var(--accent-100);
  color: #ddd6fe;
}

.suggest-btn,
.payment-btn,
.submit-suggestion,
.suggest-btn.glass {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 40px;
  padding: 0 var(--space-5);
  border: none;
  border-radius: var(--radius-md);
  background: var(--brand-500);
  color: #fff;
  text-decoration: none;
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition:
    background var(--duration-normal) var(--ease-out),
    transform var(--duration-fast) var(--ease-out),
    box-shadow var(--duration-normal) var(--ease-out);
}

.suggest-btn:hover,
.payment-btn:hover,
.submit-suggestion:hover,
.suggest-btn.glass:hover {
  background: var(--brand-600);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
  border: none;
}

.hero-btn svg,
.payment-btn svg,
.social-links svg {
  width: 1rem;
  height: 1rem;
  fill: currentColor;
  flex-shrink: 0;
}

.payment-btn-secondary {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-strong);
  box-shadow: none;
}

.payment-btn-secondary:hover {
  background: var(--brand-50);
  border-color: var(--brand-400);
  color: var(--text-primary);
}

/* ==========================================================================
   Sections & typography
   ========================================================================== */

.section {
  max-width: var(--content-max);
  margin: var(--space-10) auto;
  padding: 0 var(--space-6);
}

.section-title {
  margin-bottom: var(--space-5);
}

.section h2,
.support-card h2,
.chart-header h3,
.about-card h2 {
  font-size: var(--text-2xl);
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
  letter-spacing: -0.015em;
  color: var(--text-primary);
}

.eyebrow {
  display: inline-flex;
  margin-bottom: var(--space-2);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent-400);
}

.section-subtitle {
  margin-top: var(--space-2);
  max-width: 520px;
  font-size: var(--text-sm);
  line-height: var(--leading-relaxed);
  color: var(--text-secondary);
}

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

.center-title .section-subtitle {
  margin-inline: auto;
}

/* ==========================================================================
   Controls — search, filters, category tabs
   ========================================================================== */

.controls-section {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--space-3);
  align-items: center;
  margin-top: var(--space-4);
}

.category-tabs {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-2);
}

.category-tab {
  min-height: 48px;
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  color: var(--text-secondary);
  cursor: pointer;
  font-weight: var(--weight-semibold);
  font-size: var(--text-sm);
  transition:
    border-color var(--duration-normal) var(--ease-out),
    background var(--duration-normal) var(--ease-out),
    color var(--duration-normal) var(--ease-out);
}

.category-tab:hover {
  border-color: var(--border-strong);
  color: var(--text-primary);
  background: var(--bg-hover);
}

.category-tab.active {
  color: var(--text-primary);
  border-color: var(--brand-400);
  background: var(--brand-100);
}

.search-container {
  margin-bottom: var(--space-5);
  text-align: center;
}

.search-input,
.filter-select {
  height: 40px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-size: var(--text-sm);
  transition:
    border-color var(--duration-normal) var(--ease-out),
    box-shadow var(--duration-normal) var(--ease-out);
}

.search-input {
  width: 100%;
  max-width: none;
  padding: 0 var(--space-4);
}

.search-input::placeholder {
  color: var(--text-tertiary);
}

.search-input:focus,
.filter-select:focus {
  border-color: var(--brand-400);
  box-shadow: 0 0 0 3px var(--brand-50);
}

.filters {
  display: flex;
  gap: var(--space-2);
}

.filter-select {
  min-width: 160px;
  padding: 0 var(--space-3);
  cursor: pointer;
}

/* ==========================================================================
   Mirror cards
   ========================================================================== */

.mirror-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
}

.mirror-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  min-height: 0;
  margin: 0;
  padding: var(--space-4);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition:
    border-color var(--duration-normal) var(--ease-out),
    background var(--duration-normal) var(--ease-out),
    transform var(--duration-fast) var(--ease-out),
    box-shadow var(--duration-normal) var(--ease-out);
}

.mirror-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
  background: var(--bg-surface);
  box-shadow: var(--shadow-lg);
}

.mirror-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
}

.mirror-card h3 {
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  line-height: var(--leading-tight);
  color: var(--text-primary);
}

.mirror-card .desc {
  font-size: var(--text-sm);
  line-height: var(--leading-relaxed);
  color: var(--text-secondary);
}

.packages {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
}

.package {
  appearance: none;
  font-family: inherit;
  line-height: inherit;
  cursor: pointer;
  padding: var(--space-1) var(--space-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: var(--bg-muted);
  color: var(--text-secondary);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  transition:
    border-color var(--duration-normal) var(--ease-out),
    color var(--duration-normal) var(--ease-out),
    transform var(--duration-fast) var(--ease-out);
}

.package:hover,
.package:focus-visible {
  border-color: var(--border-strong);
  color: var(--text-primary);
  transform: translateY(-1px);
}

.package.pkg-up {
  border-color: rgba(52, 211, 153, 0.2);
  background: var(--status-up-bg);
  color: var(--status-up-muted);
}

.package.pkg-down {
  border-color: rgba(248, 113, 113, 0.2);
  background: var(--status-down-bg);
  color: var(--status-down-muted);
}

.package.pkg-checking {
  color: var(--text-tertiary);
  animation: pkg-pulse 1.8s ease-in-out infinite;
}

@keyframes pkg-pulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

.card-head-badges {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
  justify-content: flex-end;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 var(--space-2);
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  background: var(--status-checking-bg);
  color: var(--status-checking);
}

.status-pill.up {
  background: var(--status-up-bg);
  color: var(--status-up-muted);
}

.status-pill.down {
  background: var(--status-down-bg);
  color: var(--status-down-muted);
}

.status-pill.checking {
  background: var(--status-warn-bg);
  color: var(--status-warn);
}

.source-tag {
  appearance: none;
  font-family: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.card-head-badges .status-pill {
  appearance: none;
  border: 0;
  font-family: inherit;
  cursor: pointer;
}

.source-mirror-ir {
  background: var(--status-up-bg);
  color: var(--status-up-muted);
  border: 1px solid rgba(52, 211, 153, 0.18);
}

.source-mirror-intl {
  background: var(--accent-50);
  color: var(--accent-400);
  border: 1px solid rgba(167, 139, 250, 0.22);
}

.source-original {
  background: var(--status-warn-bg);
  color: #d97706;
  border: 1px solid rgba(251, 191, 36, 0.18);
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  margin-top: auto;
  padding-top: var(--space-2);
  border-top: 1px solid var(--border-subtle);
}

.mirror-link {
  flex: 1;
  min-width: 0;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  word-break: break-all;
}

.copy-url-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background: var(--bg-muted);
  color: var(--text-secondary);
  cursor: pointer;
  transition:
    background var(--duration-normal) var(--ease-out),
    color var(--duration-normal) var(--ease-out),
    border-color var(--duration-normal) var(--ease-out);
}

.copy-url-btn:hover {
  background: var(--brand-50);
  border-color: var(--brand-400);
  color: var(--brand-400);
}

/* Legacy status classes */
.status {
  margin-top: var(--space-2);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
}

.status.checking {
  color: var(--status-checking);
  animation: pulse 1.5s infinite;
}

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

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

@keyframes pulse {
  0%, 100% { opacity: 0.45; }
  50% { opacity: 1; }
}

.card a {
  display: block;
  margin-top: var(--space-3);
  color: var(--brand-400);
  text-decoration: none;
  word-break: break-all;
}

.card a:hover {
  text-decoration: underline;
}

.empty-state {
  grid-column: 1 / -1;
  padding: var(--space-8) var(--space-6);
  text-align: center;
  font-size: var(--text-sm);
  color: var(--text-secondary);
  border: 1px dashed var(--border-default);
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
}

/* ==========================================================================
   Status grid (24-hour heatmap)
   ========================================================================== */

.status-grid {
  padding: 0;
  border-radius: var(--radius-xl);
  overflow: visible;
}

.sg-headline {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--border-subtle);
}

.sg-hl-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.sg-hl-ok .sg-hl-dot {
  background: var(--status-up);
}

.sg-hl-warn .sg-hl-dot {
  background: var(--status-warn);
}

.sg-hl-crit .sg-hl-dot {
  background: var(--status-down);
}

.sg-hl-text {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
}

.sg-hl-ok .sg-hl-text { color: var(--status-up-muted); }
.sg-hl-warn .sg-hl-text { color: #d97706; }
.sg-hl-crit .sg-hl-text { color: var(--status-down-muted); }

.sg-hl-time {
  margin-inline-start: auto;
  font-size: var(--text-xs);
  color: var(--text-tertiary);
}

.sg-summary {
  display: flex;
  align-items: center;
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--border-subtle);
}

.sg-sum-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 var(--space-5);
}

.sg-sum-item:first-child {
  padding-inline-start: 0;
}

.sg-sum-num {
  font-size: var(--text-2xl);
  font-weight: var(--weight-bold);
  line-height: 1;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.sg-sum-lbl {
  margin-top: var(--space-1);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.sg-sum-sep {
  width: 1px;
  height: 32px;
  background: var(--border-subtle);
  flex-shrink: 0;
}

.sg-wrap {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  padding: var(--space-4) var(--space-5);
}

.sg-head,
.sg-row {
  display: grid;
  grid-template-columns: 148px 12px 1fr 52px 20px;
  gap: 0 var(--space-2);
  align-items: center;
}

.sg-head {
  align-items: end;
  padding-bottom: var(--space-2);
  margin-bottom: var(--space-1);
  border-bottom: 1px solid var(--border-subtle);
}

.sg-hour-labels,
.sg-cells {
  display: grid;
  grid-template-columns: repeat(24, 1fr);
  gap: 3px;
}

.sg-hour-label {
  font-size: 0.5625rem;
  font-weight: var(--weight-medium);
  color: var(--text-tertiary);
  text-align: center;
  overflow: hidden;
  white-space: nowrap;
  line-height: 1.2;
}

.sg-hour-label.sg-now {
  color: var(--brand-400);
  font-weight: var(--weight-bold);
}

.sg-pct-head {
  font-size: 0.5625rem;
  font-weight: var(--weight-semibold);
  color: var(--text-tertiary);
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.sg-row-wrap {
  border-radius: var(--radius-md);
  transition: background var(--duration-normal) var(--ease-out);
}

.sg-row-wrap:hover {
  background: rgba(148, 163, 184, 0.04);
}

.sg-row-wrap.sg-row-open {
  background: var(--brand-50);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  margin: var(--space-1) 0;
}

.sg-row {
  padding: var(--space-1) 0;
}

.sg-row-clickable {
  cursor: pointer;
}

.sg-label {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: var(--space-1) 0;
}

.sg-name {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: var(--leading-tight);
}

.sg-url {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sg-live {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-disabled);
  margin: 0 auto;
  flex-shrink: 0;
}

.sg-live.up {
  background: var(--status-up);
}

.sg-live.down {
  background: var(--status-down);
}

.sg-cell {
  height: 24px;
  border-radius: var(--radius-sm);
  cursor: default;
  transition: opacity var(--duration-fast) var(--ease-out);
  position: relative;
}

.sg-cell:hover {
  opacity: 0.85;
  z-index: 2;
}

.sg-up {
  background: var(--status-up-muted);
}

.sg-down {
  background: var(--status-down-muted);
}

.sg-nodata {
  background: var(--bg-muted);
  border: 1px solid var(--border-subtle);
}

.sg-est {
  opacity: 0.4;
}

.sg-est:hover {
  opacity: 0.65;
}

.sg-current {
  outline: 2px solid var(--brand-400);
  outline-offset: 1px;
}

.sg-pct {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  text-align: center;
  font-variant-numeric: tabular-nums;
  color: var(--text-tertiary);
  white-space: nowrap;
}

.sg-good { color: var(--status-up-muted); }
.sg-mid  { color: #d97706; }
.sg-bad  { color: var(--status-down-muted); }

.sg-chevron {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-lg);
  color: var(--text-tertiary);
  transition:
    transform var(--duration-normal) var(--ease-out),
    color var(--duration-normal) var(--ease-out);
  user-select: none;
}

.sg-chevron.open {
  transform: rotate(90deg);
  color: var(--brand-400);
}

.sg-pkg-panel {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  border-top: 1px solid var(--border-subtle);
}

.sg-pkg-panel.sg-hidden {
  display: none;
}

.sg-pkg-label {
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-inline-end: var(--space-1);
  white-space: nowrap;
}

.sg-pkg-item {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  border: 1px solid var(--border-subtle);
  background: var(--bg-muted);
  color: var(--text-secondary);
}

.sg-pkg-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

.sg-pkg-up {
  border-color: rgba(52, 211, 153, 0.2);
  background: var(--status-up-bg);
  color: var(--status-up-muted);
}

.sg-pkg-down {
  border-color: rgba(248, 113, 113, 0.2);
  background: var(--status-down-bg);
  color: var(--status-down-muted);
}

.sg-pkg-checking {
  opacity: 0.55;
  animation: pkg-pulse 1.8s ease-in-out infinite;
}

.sg-legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-5);
  align-items: center;
  padding: var(--space-4) var(--space-5);
  border-top: 1px solid var(--border-subtle);
}

.sg-legend-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  color: var(--text-tertiary);
}

.sg-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

.sg-dot.sg-up { background: var(--status-up-muted); }
.sg-dot.sg-down { background: var(--status-down-muted); }
.sg-dot.sg-nodata {
  background: var(--bg-muted);
  border: 1px solid var(--border-subtle);
}
.sg-dot.sg-est { opacity: 0.4; }

.sg-legend-pkg {
  margin-inline-start: auto;
  font-size: var(--text-xs);
  color: var(--text-tertiary);
}

.sg-tooltip {
  position: absolute;
  padding: var(--space-3) var(--space-4);
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  pointer-events: none;
  white-space: nowrap;
  z-index: 300;
  box-shadow: var(--shadow-lg);
}

.sg-tooltip[hidden] { display: none; }

.sg-tip-name {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
  margin-bottom: var(--space-1);
}

.sg-tip-time {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  margin-bottom: var(--space-2);
}

.sg-tip-status {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
}

.sg-tip-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

.sg-tip-up { color: var(--status-up-muted); }
.sg-tip-down { color: var(--status-down-muted); }
.sg-tip-nodata { color: var(--text-tertiary); }

/* ==========================================================================
   Radar iframe
   ========================================================================== */

.radar-frame-wrap {
  width: 100%;
  min-height: 700px;
  padding: 0;
  border-radius: var(--radius-xl);
  overflow: hidden;
}

.radar-frame {
  display: block;
  width: 100%;
  height: 700px;
  border: none;
  border-radius: var(--radius-xl);
  background: transparent;
  color-scheme: dark;
}

.radar-external-link {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  min-height: 48px;
  width: fit-content;
  margin: var(--space-4) auto 0;
  padding: 0 var(--space-5);
  border: 1px solid rgba(196, 181, 253, 0.32);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(135deg, rgba(59, 130, 246, 0.22), rgba(139, 92, 246, 0.3)),
    var(--bg-elevated);
  color: #f5f3ff;
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  text-decoration: none;
  box-shadow:
    0 10px 28px rgba(76, 29, 149, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  overflow: hidden;
  transition:
    transform var(--duration-normal) var(--ease-out),
    border-color var(--duration-normal) var(--ease-out),
    box-shadow var(--duration-normal) var(--ease-out);
}

.radar-external-link::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background: linear-gradient(120deg, transparent 15%, rgba(255, 255, 255, 0.13), transparent 70%);
  transform: translateX(-120%);
  transition: transform 500ms var(--ease-out);
}

.radar-external-link:hover {
  color: #fff;
  border-color: rgba(196, 181, 253, 0.62);
  transform: translateY(-2px);
  box-shadow:
    0 14px 36px rgba(76, 29, 149, 0.32),
    0 0 0 1px rgba(96, 165, 250, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.radar-external-link:hover::before {
  transform: translateX(120%);
}

.radar-external-link:active {
  transform: translateY(0);
}

.radar-external-link:focus-visible {
  outline-color: var(--accent-400);
}

.radar-button-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid rgba(196, 181, 253, 0.25);
  border-radius: var(--radius-md);
  background: rgba(139, 92, 246, 0.16);
  color: var(--accent-300);
}

.radar-button-icon svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.radar-button-arrow {
  color: var(--accent-300);
  font-family: var(--font-sans-en);
  font-size: var(--text-lg);
  line-height: 1;
  transition: transform var(--duration-normal) var(--ease-out);
}

.radar-external-link:hover .radar-button-arrow {
  transform: translate(2px, -2px);
}

/* ==========================================================================
   Charts (legacy)
   ========================================================================== */

.dashboard {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: var(--space-6);
  overflow-x: auto;
}

.charts-shell {
  display: grid;
  gap: var(--space-4);
}

.status-charts {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
}

.chart-card {
  padding: var(--space-4);
}

.chart-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-3);
}

.chart-header h3 {
  margin: 0;
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
}

.chart-header strong {
  color: var(--brand-400);
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
}

.line-chart {
  width: 100%;
  height: 180px;
  overflow: visible;
}

.chart-grid line {
  stroke: var(--border-subtle);
  stroke-width: 1;
}

.chart-area {
  fill: var(--brand-50);
}

.chart-line {
  fill: none;
  stroke: var(--brand-400);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.legend-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-inline-end: var(--space-2);
  border-radius: 50%;
}

.legend-dot.up { background: var(--status-up-muted); }
.legend-dot.down { background: var(--status-down-muted); }

/* Featured monitor (legacy) */
.featured-monitor {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.9fr);
  gap: var(--space-4);
  padding: var(--space-4);
}

.featured-table-wrap {
  padding: var(--space-4);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
}

.featured-table-head h3 {
  margin: 0;
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
}

.featured-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--space-2) var(--space-3);
  align-items: center;
  padding: var(--space-3);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  background: var(--bg-muted);
}

.featured-main strong {
  display: block;
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
}

.featured-main small {
  display: block;
  margin-top: var(--space-1);
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-history {
  display: flex;
  gap: 3px;
  grid-column: 1 / -1;
}

.mini-history i {
  flex: 1;
  height: 4px;
  border-radius: 999px;
  background: var(--border-subtle);
}

.mini-history i.up { background: var(--status-up-muted); }
.mini-history i.down { background: var(--status-down-muted); }

.featured-packages {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
}

.featured-packages span {
  padding: var(--space-1) var(--space-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: var(--bg-muted);
  color: var(--text-secondary);
  font-size: var(--text-xs);
}

.featured-row.up { border-color: rgba(52, 211, 153, 0.18); }
.featured-row.down { border-color: rgba(248, 113, 113, 0.18); }

.featured-table {
  display: grid;
  gap: var(--space-2);
}

.uptime-card {
  padding: var(--space-4);
  background: transparent;
  border: 0;
  box-shadow: none;
}

.uptime-head {
  display: flex;
  justify-content: space-between;
  gap: var(--space-4);
  align-items: flex-start;
  margin-bottom: var(--space-4);
}

.uptime-head h3 {
  margin: var(--space-1) 0 var(--space-2);
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
  color: var(--text-primary);
}

.uptime-score {
  min-width: 108px;
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  text-align: center;
  background: var(--bg-surface);
}

.uptime-score strong {
  display: block;
  color: var(--brand-400);
  font-size: var(--text-3xl);
  font-weight: var(--weight-bold);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.uptime-score span {
  display: block;
  margin-top: var(--space-1);
  font-size: var(--text-xs);
  color: var(--text-tertiary);
}

.timeline-chart {
  position: relative;
  min-height: 260px;
  padding: var(--space-4) var(--space-3) var(--space-3);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-surface);
}

.uptime-line {
  position: absolute;
  inset: var(--space-4) var(--space-3) 72px;
  width: calc(100% - var(--space-6));
  height: 160px;
  pointer-events: none;
}

.uptime-area {
  fill: var(--brand-50);
}

.uptime-line-path {
  fill: none;
  stroke: var(--brand-400);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.hour-bars {
  position: absolute;
  inset: 40px var(--space-3) var(--space-4);
  display: grid;
  grid-template-columns: repeat(24, minmax(6px, 1fr));
  align-items: end;
  gap: var(--space-1);
}

.hour-slot {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 2px;
  height: 188px;
  min-width: 0;
}

.hour-slot span {
  display: block;
  width: 100%;
  min-height: 2px;
  border-radius: var(--radius-sm) var(--radius-sm) 2px 2px;
}

.up-bar {
  background: var(--status-up-muted);
}

.down-bar {
  background: var(--status-down-muted);
  opacity: 0.85;
}

.hour-slot small {
  position: absolute;
  bottom: -2px;
  inset-inline-start: 50%;
  transform: translateX(-50%);
  color: var(--text-tertiary);
  font-size: 0.5625rem;
  white-space: nowrap;
}

.current-hour {
  margin-inline-start: auto;
  font-size: var(--text-xs);
  color: var(--text-tertiary);
}

/* Accessibility row (fallback charts) */
.acc-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--space-2) var(--space-3);
  align-items: center;
  padding: var(--space-3);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
}

.acc-bar-wrap {
  grid-column: 1 / -1;
  height: 4px;
  border-radius: 999px;
  background: var(--bg-muted);
  overflow: hidden;
}

.acc-bar {
  height: 100%;
  border-radius: 999px;
  transition: width var(--duration-normal) var(--ease-out);
}

.acc-pkgs {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
}

.acc-pkg {
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  background: var(--bg-muted);
  border: 1px solid var(--border-subtle);
}

.acc-no-data {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
}

/* Table (legacy) */
#mirrorTable {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

#mirrorTable th,
#mirrorTable td {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-size: var(--text-sm);
}

#mirrorTable th {
  font-weight: var(--weight-semibold);
  color: var(--text-secondary);
}

.dashboard table tbody tr {
  transition: background var(--duration-normal) var(--ease-out);
}

.dashboard table tbody tr:hover {
  background: var(--brand-50);
  cursor: pointer;
}

.history-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  margin: 1px;
  cursor: pointer;
}

.status-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border-default);
  position: relative;
  margin: 0 auto;
  background: var(--bg-muted);
}

.status-text {
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

/* ==========================================================================
   Support & donation
   ========================================================================== */

.support-section {
  margin-top: var(--space-6);
}

.support-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-6);
  padding: var(--space-6);
}

.support-card h2 {
  margin-bottom: var(--space-2);
}

.support-card p {
  font-size: var(--text-sm);
  line-height: var(--leading-relaxed);
  color: var(--text-secondary);
}

.donation-panel {
  display: grid;
  gap: var(--space-3);
  min-width: min(420px, 100%);
}

.crypto-list {
  display: grid;
  gap: var(--space-2);
}

.crypto-list div {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: var(--space-3);
  align-items: center;
  padding: var(--space-3);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  cursor: copy;
  transition:
    border-color var(--duration-normal) var(--ease-out),
    background var(--duration-normal) var(--ease-out);
}

.crypto-list div:hover {
  border-color: var(--border-strong);
  background: var(--bg-hover);
}

.crypto-list strong {
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  color: var(--text-secondary);
  letter-spacing: 0.04em;
}

.crypto-list code {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ==========================================================================
   Contributors & footer
   ========================================================================== */

.contributors {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-6);
  justify-content: center;
  flex-wrap: wrap;
}

.contributors a {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  color: inherit;
}

.contributors img {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 1px solid var(--border-default);
  transition:
    transform var(--duration-normal) var(--ease-out),
    border-color var(--duration-normal) var(--ease-out);
}

.contributors a:hover img {
  transform: translateY(-2px);
  border-color: var(--border-strong);
}

.thanks {
  margin-top: var(--space-4);
  text-align: center;
  font-size: var(--text-sm);
  color: var(--text-tertiary);
}

.footer {
  margin: var(--space-10) auto var(--space-8);
  padding: var(--space-5);
  max-width: 900px;
  text-align: center;
  font-size: var(--text-sm);
  color: var(--text-tertiary);
}

.footer a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color var(--duration-normal) var(--ease-out);
}

.footer a:hover {
  color: var(--brand-400);
}

.social-links {
  display: flex;
  justify-content: center;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}

.social-links a {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  transition:
    background var(--duration-normal) var(--ease-out),
    color var(--duration-normal) var(--ease-out),
    border-color var(--duration-normal) var(--ease-out);
}

.social-links a:hover {
  background: var(--brand-50);
  border-color: var(--brand-400);
  color: var(--brand-400);
}

.footer-text {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.footer-text a {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  white-space: nowrap;
}

.footer-text img {
  border-radius: var(--radius-sm);
}

/* ==========================================================================
   Modal & suggestion FAB
   ========================================================================== */

.suggestion-fab {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  z-index: 100;
}

.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
}

.modal-content {
  margin: 5% auto;
  padding: var(--space-8);
  width: 90%;
  max-width: 560px;
  max-height: 85vh;
  overflow-y: auto;
  position: relative;
}

.close-modal {
  position: absolute;
  right: var(--space-5);
  top: var(--space-5);
  font-size: var(--text-2xl);
  font-weight: var(--weight-bold);
  cursor: pointer;
  color: var(--text-tertiary);
  line-height: 1;
  transition: color var(--duration-normal) var(--ease-out);
}

.close-modal:hover {
  color: var(--text-primary);
}

.modal-content h2 {
  margin-bottom: var(--space-5);
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
  color: var(--text-primary);
}

.form-group {
  margin-bottom: var(--space-5);
}

.form-group label {
  display: block;
  margin-bottom: var(--space-2);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--text-secondary);
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: var(--space-3);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-size: var(--text-sm);
  transition: border-color var(--duration-normal) var(--ease-out);
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--brand-400);
  box-shadow: 0 0 0 3px var(--brand-50);
}

.submit-suggestion {
  width: 100%;
}

/* ==========================================================================
   Toasts
   ========================================================================== */

.copy-toast,
.toast {
  position: fixed;
  bottom: var(--space-6);
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--text-primary);
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  opacity: 0;
  pointer-events: none;
  z-index: 999;
  box-shadow: var(--shadow-lg);
  transition:
    opacity var(--duration-normal) var(--ease-out),
    transform var(--duration-normal) var(--ease-out);
}

.copy-toast.show,
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ==========================================================================
   About page
   ========================================================================== */

.about-page .hero {
  text-align: start;
}

.about-page .hero-content {
  align-items: flex-start;
  margin: 0;
  max-width: none;
}

.about-page .hero-text {
  align-items: flex-start;
}

.about-page .hero-text p {
  margin-inline: 0;
}

.about-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(280px, 0.75fr);
  gap: var(--space-4);
  align-items: start;
}

.about-card {
  padding: var(--space-6);
}

.about-card h2 {
  margin-bottom: var(--space-3);
}

.about-card p {
  font-size: var(--text-sm);
  line-height: var(--leading-relaxed);
  color: var(--text-secondary);
}

.about-list {
  display: grid;
  gap: var(--space-3);
  margin-top: var(--space-4);
  list-style: none;
}

.about-list li {
  padding: var(--space-4);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  font-size: var(--text-sm);
  line-height: var(--leading-relaxed);
  color: var(--text-secondary);
}

/* ==========================================================================
   Provider detail page
   ========================================================================== */

.provider-hero {
  max-width: none;
  margin: 0;
  padding: calc(var(--header-h) + var(--space-4)) max(var(--space-6), calc((100% - var(--content-max)) / 2 + var(--space-6))) var(--space-4);
  text-align: start;
}

.provider-back {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--text-tertiary);
  text-decoration: none;
  margin-bottom: var(--space-6);
  transition: color var(--duration-normal) var(--ease-out);
}

.provider-back:hover {
  color: var(--text-primary);
}

.provider-card {
  max-width: 800px;
  margin: 0 auto;
  padding: var(--space-8);
}

.provider-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
  margin-bottom: var(--space-5);
}

.provider-title-group h1 {
  font-size: var(--text-2xl);
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
  color: var(--text-primary);
}

.provider-badges {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.provider-country {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
}

.provider-desc {
  font-size: var(--text-sm);
  line-height: var(--leading-relaxed);
  color: var(--text-secondary);
  margin-bottom: var(--space-6);
}

.provider-url-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  margin-bottom: var(--space-6);
  flex-wrap: wrap;
}

.provider-url-row a {
  flex: 1;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  word-break: break-all;
  text-decoration: none;
}

.provider-url-row a:hover {
  color: var(--brand-400);
}

.provider-copy-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-default);
  background: var(--bg-muted);
  color: var(--text-secondary);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  cursor: pointer;
  white-space: nowrap;
  transition:
    background var(--duration-normal) var(--ease-out),
    color var(--duration-normal) var(--ease-out);
}

.provider-copy-btn:hover {
  background: var(--brand-50);
  color: var(--brand-400);
}

.provider-section-label {
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin-bottom: var(--space-3);
}

.provider-packages-grid {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-6);
}

.provider-pkg-item {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  background: var(--bg-muted);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  text-decoration: none;
  transition:
    background var(--duration-normal) var(--ease-out),
    border-color var(--duration-normal) var(--ease-out);
}

.provider-pkg-item:hover {
  background: var(--bg-hover);
  border-color: var(--border-strong);
  color: var(--text-primary);
}

.provider-pkg-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-disabled);
  flex-shrink: 0;
}

.provider-pkg-item.pkg-up .provider-pkg-dot { background: var(--status-up-muted); }
.provider-pkg-item.pkg-down .provider-pkg-dot { background: var(--status-down-muted); }
.provider-pkg-item.pkg-checking .provider-pkg-dot { background: var(--status-warn); }

.provider-status-row {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4);
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  flex-wrap: wrap;
}

.provider-status-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-1);
  min-width: 72px;
}

.provider-status-item strong {
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

.provider-status-item span {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
}

.provider-status-sep {
  width: 1px;
  height: 32px;
  background: var(--border-subtle);
}

.provider-not-found {
  text-align: center;
  padding: var(--space-12) var(--space-6);
  color: var(--text-secondary);
}

.provider-not-found h2 {
  font-size: var(--text-xl);
  margin-bottom: var(--space-2);
  color: var(--text-primary);
}

/* ==========================================================================
   LTR overrides
   ========================================================================== */

html[dir="ltr"] .hero,
html[dir="ltr"] .support-section {
  direction: ltr;
}

html[dir="ltr"] .hero-text p {
  direction: ltr;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 992px) {
  .mirror-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .hero-text h1 {
    font-size: var(--text-3xl);
  }
}

@media (max-width: 820px) {
  .topbar {
    grid-template-columns: 1fr auto;
    row-gap: var(--space-2);
    min-height: auto;
    padding-block: var(--space-3);
  }

  .site-nav {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-self: stretch;
    width: 100%;
    justify-content: flex-start;
    gap: var(--space-2);
    padding-top: var(--space-2);
    border-top: 1px solid var(--border-subtle);
  }

  .site-nav a {
    flex: 0 1 auto;
    min-height: 32px;
    padding: 0 var(--space-2);
  }

  .controls-section {
    grid-template-columns: 1fr;
  }

  .filters {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .category-tabs,
  .about-layout {
    grid-template-columns: 1fr;
  }

  .featured-monitor {
    grid-template-columns: 1fr;
  }

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

  .donation-panel {
    min-width: 0;
  }

  .payment-btn {
    width: 100%;
  }

  .hero {
    padding-top: calc(var(--header-h) + var(--space-16));
    padding-inline: var(--space-5);
  }
}

@media (max-width: 768px) {
  .section {
    margin: var(--space-8) auto;
    padding: 0 var(--space-4);
  }

  .section h2 {
    font-size: var(--text-xl);
  }

  .dashboard {
    padding: var(--space-4);
  }

  .sg-head,
  .sg-row {
    grid-template-columns: 110px 10px 1fr 42px 18px;
  }

  .sg-name { font-size: var(--text-sm); }
  .sg-url { display: none; }
  .sg-cell { height: 20px; }
  .sg-sum-item { padding: 0 var(--space-3); }
  .sg-sum-num { font-size: var(--text-xl); }
}

@media (max-width: 600px) {
  .radar-frame,
  .radar-frame-wrap {
    height: 520px;
    min-height: 520px;
  }

  .radar-external-link {
    width: 100%;
  }
}

@media (max-width: 520px) {
  :root {
    --topbar-offset: 96px;
  }

  html {
    scroll-padding-top: 96px;
  }

  .topbar {
    padding-inline: var(--space-4);
  }

  .site-nav a {
    min-height: 32px;
    padding: 0 var(--space-2);
    font-size: var(--text-xs);
  }

  .hero {
    margin: 0 auto var(--space-6);
    padding-top: calc(var(--topbar-offset) + var(--space-8));
    padding-inline: var(--space-4);
  }

  .hero-text h1 {
    font-size: var(--text-2xl);
  }

  .hero-text p {
    font-size: var(--text-base);
  }

  .hero-actions,
  .hero-btn {
    width: 100%;
  }

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

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

  .filter-select,
  .search-input {
    width: 100%;
    min-width: 0;
  }

  .category-tab {
    min-height: 44px;
    padding: var(--space-2) var(--space-3);
    font-size: var(--text-xs);
  }

  .suggestion-fab {
    right: var(--space-3);
    left: var(--space-3);
    bottom: var(--space-3);
  }

  .suggest-btn {
    width: 100%;
  }

  .crypto-list div {
    grid-template-columns: 1fr;
    gap: var(--space-1);
  }

  .sg-head,
  .sg-row {
    grid-template-columns: 84px 8px 1fr 36px 16px;
    gap: 0 var(--space-1);
  }

  .sg-cell {
    height: 16px;
    border-radius: 3px;
  }

  .sg-cells,
  .sg-hour-labels {
    gap: 2px;
  }

  .sg-hour-label {
    font-size: 0.5rem;
  }

  .sg-wrap,
  .sg-summary,
  .sg-headline,
  .sg-legend {
    padding-inline: var(--space-4);
  }

  .sg-summary {
    flex-wrap: wrap;
    justify-content: center;
  }

  .footer {
    margin-inline: var(--space-4);
    line-height: var(--leading-relaxed);
  }

  #mirrorTable thead {
    display: none;
  }

  #mirrorTable,
  #mirrorTable tbody,
  #mirrorTable tr,
  #mirrorTable td {
    display: block;
    width: 100%;
  }

  #mirrorTable tr {
    padding: var(--space-3) 0;
    border-bottom: 1px solid var(--border-subtle);
  }

  #mirrorTable td {
    border-bottom: 0;
    padding: var(--space-1) 0;
    text-align: right;
  }

  #mirrorTable td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: var(--space-1);
    color: var(--text-tertiary);
    font-size: var(--text-xs);
    font-weight: var(--weight-bold);
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }

  .status-circle {
    width: 28px;
    height: 28px;
    margin-inline-start: auto;
  }
}

@media (min-width: 1400px) {
  .section,
  .hero {
    max-width: 1200px;
  }

  .topbar {
    padding-inline: max(var(--space-8), calc((100% - 1200px) / 2 + var(--space-8)));
  }
}
