:root {
  color-scheme: dark;
  --bg: #07111f;
  --panel: rgba(10, 18, 32, 0.92);
  --panel-border: rgba(255, 255, 255, 0.09);
  --text: #f3f7ff;
  --muted: #96aac9;
  --accent: #7dd3fc;
  --ok: #4ade80;
  --warn: #fbbf24;
  --err: #f87171;
  --idle: #64748b;
  --shadow: rgba(0, 0, 0, 0.4);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  display: grid;
  place-items: center;
  padding: 24px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top, rgba(56, 189, 248, 0.13), transparent 26%),
    linear-gradient(180deg, #08111f 0%, #040812 100%);
}

.app {
  width: min(1120px, 100%);
  overflow: hidden;
  border: 1px solid var(--panel-border);
  border-radius: 28px;
  background: var(--panel);
  box-shadow: 0 24px 60px var(--shadow);
  backdrop-filter: blur(10px);
}

.hero {
  padding: 28px 28px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.hero-top {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: flex-start;
  justify-content: space-between;
}

.title-wrap h1 {
  margin: 0;
  font-size: clamp(1.5rem, 2.4vw, 2.2rem);
  line-height: 1.1;
}

.subtitle {
  max-width: 66ch;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.5;
}

.sync-pill {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  padding: 12px 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  font-size: 0.96rem;
  white-space: nowrap;
}

.dot {
  display: inline-block;
  flex: 0 0 auto;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--idle);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.04);
}

.dot.ok {
  background: var(--ok);
  box-shadow: 0 0 12px rgba(74, 222, 128, 0.55);
}

.dot.warn {
  background: var(--warn);
  box-shadow: 0 0 12px rgba(251, 191, 36, 0.55);
}

.dot.err {
  background: var(--err);
  box-shadow: 0 0 12px rgba(248, 113, 113, 0.55);
}

.dot.idle {
  background: var(--idle);
}

.content {
  display: grid;
  grid-template-columns: 1.32fr 0.98fr;
}

.clock-panel,
.side-panel {
  padding: 28px;
}

.clock-panel {
  border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.clock-face {
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.time {
  font-size: clamp(2.7rem, 10vw, 6.3rem);
  font-weight: 800;
  font-feature-settings: "tnum" 1;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
  line-height: 1;
  text-shadow: 0 10px 24px rgba(0, 0, 0, 0.3);
}

.milliseconds {
  margin-top: 14px;
  color: var(--accent);
  font-size: clamp(1.15rem, 3vw, 1.6rem);
  font-weight: 700;
  font-feature-settings: "tnum" 1;
  font-variant-numeric: tabular-nums;
}

.date-line,
.zone-line,
.offset-line {
  margin-top: 12px;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.5;
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.meta-card,
.panel-card {
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.035);
}

.meta-label,
.panel-title,
.provider-name,
.select-label {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.meta-value {
  margin-top: 8px;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.4;
}

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

.api-select {
  width: 100%;
  margin-top: 10px;
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  color: var(--text);
  background: rgba(7, 12, 24, 0.9);
  font-size: 1rem;
  outline: none;
}

.helper {
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.5;
}

.providers {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.provider-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: start;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
}

.provider-row.active {
  border-color: rgba(125, 211, 252, 0.5);
  background: rgba(125, 211, 252, 0.08);
}

.provider-main {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: baseline;
}

.provider-status {
  color: var(--text);
  font-weight: 600;
}

.provider-detail {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.footer {
  padding: 0 28px 24px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.6;
}

.footer a {
  color: var(--accent);
  text-decoration: none;
}

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

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

  .clock-panel {
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  }

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

@media (max-width: 640px) {
  body {
    padding: 14px;
  }

  .hero,
  .clock-panel,
  .side-panel,
  .footer {
    padding-right: 18px;
    padding-left: 18px;
  }

  .clock-face {
    padding: 18px;
  }

  .sync-pill {
    width: 100%;
    justify-content: center;
    white-space: normal;
  }
}
