:root {
  color-scheme: light;
  --bg: #f7f7f2;
  --surface: #ffffff;
  --ink: #17202a;
  --muted: #62707f;
  --line: #dfe4e8;
  --accent: #0f766e;
  --accent-strong: #115e59;
  --warm: #d97706;
  --shadow: 0 18px 60px rgba(23, 32, 42, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.10), transparent 38%),
    linear-gradient(315deg, rgba(217, 119, 6, 0.14), transparent 34%),
    var(--bg);
  color: var(--ink);
}

button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  min-height: 44px;
  padding: 0 18px;
}

button:hover:not(:disabled) {
  border-color: var(--accent);
}

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

.app-shell {
  width: min(1040px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0;
}

.topbar {
  align-items: center;
  display: flex;
  gap: 24px;
  justify-content: space-between;
  margin-bottom: 28px;
}

.brand-home-link {
  color: inherit;
  text-decoration: none;
}

.topbar-status {
  align-items: center;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  display: inline-flex;
  font-size: 0.9rem;
  font-weight: 800;
  gap: 8px;
  min-height: 40px;
  padding: 0 14px;
}

.status-dot {
  background: var(--accent);
  border-radius: 50%;
  display: inline-block;
  height: 9px;
  width: 9px;
}

.brand {
  align-items: center;
  color: var(--ink);
  display: inline-flex;
  font-size: 1.12rem;
  font-weight: 850;
  gap: 10px;
  text-decoration: none;
}

.brand-mark {
  border: 3px solid var(--accent);
  border-radius: 50%;
  display: inline-block;
  height: 28px;
  position: relative;
  width: 28px;
}

.brand-mark::before,
.brand-mark::after {
  background: var(--accent);
  content: "";
  left: 50%;
  position: absolute;
  top: 50%;
  transform-origin: left center;
}

.brand-mark::before {
  height: 3px;
  transform: rotate(-90deg);
  width: 8px;
}

.brand-mark::after {
  height: 3px;
  transform: rotate(25deg);
  width: 10px;
}

.tabs {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 4px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  padding: 4px;
  width: min(540px, 100%);
}

.tab {
  background: transparent;
  border: 0;
  min-height: 38px;
  padding: 0 14px;
}

.tab.is-active {
  background: var(--ink);
  color: #fff;
}

.panel {
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(223, 228, 232, 0.9);
  border-radius: 8px;
  box-shadow: var(--shadow);
  min-height: 540px;
  padding: clamp(24px, 5vw, 56px);
}

.page-panel {
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(223, 228, 232, 0.9);
  border-radius: 8px;
  box-shadow: var(--shadow);
  line-height: 1.7;
  margin-bottom: 28px;
  padding: clamp(24px, 5vw, 56px);
}

.page-panel h2 {
  font-size: clamp(2rem, 5vw, 3.75rem);
  line-height: 1;
  margin: 0 0 22px;
}

.page-panel h3 {
  font-size: 1.18rem;
  margin: 28px 0 8px;
}

.page-panel p,
.page-panel li {
  color: var(--muted);
}

.page-panel a,
.app-footer a {
  color: var(--accent-strong);
  font-weight: 800;
}

.page-meta {
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 850;
  margin: 0 0 10px;
  text-transform: uppercase;
}

.page-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 30px;
}

.page-nav a {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 14px;
  text-decoration: none;
}

.home-info {
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(223, 228, 232, 0.9);
  border-radius: 8px;
  box-shadow: var(--shadow);
  line-height: 1.7;
  margin-top: 28px;
  padding: clamp(24px, 5vw, 56px);
}

.home-info h2 {
  font-size: clamp(2rem, 5vw, 3.75rem);
  line-height: 1;
  margin: 0 0 22px;
  max-width: 820px;
}

.home-info p {
  color: var(--muted);
  line-height: 1.65;
  max-width: 880px;
}

.home-info-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 28px;
}

.home-info-grid div {
  background: #f9fbfb;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
}

.home-info-grid h3 {
  font-size: 1rem;
  margin: 0 0 8px;
}

.home-info-grid p {
  font-size: 0.95rem;
  margin: 0;
}

.app-footer {
  align-items: center;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: space-between;
  padding: 28px 0 8px;
}

.ad-spacer {
  align-items: center;
  background: rgba(255, 255, 255, 0.45);
  border: 1px dashed var(--line);
  border-radius: 8px;
  display: flex;
  justify-content: center;
  margin: 28px 0 0;
  min-height: 100px;
  overflow: hidden;
}

.app-footer p {
  margin: 0;
}

.app-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.eyebrow {
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0;
  margin: 0 0 10px;
  text-transform: uppercase;
}

h1 {
  font-size: clamp(2.2rem, 7vw, 5rem);
  line-height: 0.95;
  margin: 0;
}

.support {
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.6;
  margin: 18px 0 0;
  max-width: 620px;
}

.compact {
  max-width: 720px;
}

.time-layout {
  align-items: center;
  display: grid;
  gap: 32px;
  grid-template-columns: minmax(0, 1fr) 240px;
}

.clock-face {
  aspect-ratio: 1;
  background: #fbfaf6;
  border: 10px solid var(--ink);
  border-radius: 50%;
  box-shadow: inset 0 0 0 2px var(--line);
  position: relative;
}

.clock-face::before {
  border: 2px dashed rgba(23, 32, 42, 0.18);
  border-radius: 50%;
  content: "";
  inset: 22px;
  position: absolute;
}

.hand {
  background: var(--ink);
  border-radius: 999px;
  left: 50%;
  position: absolute;
  top: 50%;
  transform-origin: left center;
}

.hour-hand {
  height: 7px;
  width: 28%;
}

.minute-hand {
  height: 5px;
  width: 36%;
}

.second-hand {
  background: var(--warm);
  height: 3px;
  width: 41%;
}

.clock-center {
  background: var(--warm);
  border: 4px solid var(--ink);
  border-radius: 50%;
  height: 18px;
  left: 50%;
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 18px;
}

.time-readout {
  margin-top: 42px;
}

.large-time,
.stopwatch-display {
  font-variant-numeric: tabular-nums;
  font-size: clamp(3rem, 11vw, 8rem);
  font-weight: 900;
  line-height: 0.95;
}

.date-line {
  color: var(--muted);
  font-size: clamp(1.1rem, 3vw, 1.55rem);
  margin-top: 14px;
}

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

.meta-grid > div,
.timestamp-item {
  background: #f9fbfb;
  border: 1px solid var(--line);
  border-radius: 8px;
  min-width: 0;
  padding: 18px;
}

.label {
  color: var(--muted);
  display: block;
  font-size: 0.78rem;
  font-weight: 800;
  margin-bottom: 8px;
  text-transform: uppercase;
}

strong,
code {
  overflow-wrap: anywhere;
}

.stopwatch-display {
  margin: 48px 0 28px;
}

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

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

.primary:hover:not(:disabled) {
  background: var(--accent-strong);
}

.laps {
  display: grid;
  gap: 8px;
  margin: 28px 0 0;
  max-width: 620px;
  padding-left: 24px;
}

.laps li {
  border-bottom: 1px solid var(--line);
  font-variant-numeric: tabular-nums;
  padding: 10px 0;
}

.zone-tool {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1.2fr) minmax(260px, 0.8fr);
  margin-top: 34px;
}

.zone-search,
.zone-card {
  background: #f9fbfb;
  border: 1px solid var(--line);
  border-radius: 8px;
  min-width: 0;
  padding: 18px;
}

input[type="search"] {
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  font: inherit;
  min-height: 48px;
  outline: none;
  padding: 0 14px;
  width: 100%;
}

input[type="search"]:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.14);
}

.city-results {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  max-height: 244px;
  overflow: auto;
}

.city-result {
  align-items: center;
  display: flex;
  justify-content: space-between;
  min-height: 48px;
  text-align: left;
  width: 100%;
}

.city-result span {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
  margin-left: 12px;
}

.city-message {
  color: var(--muted);
  font-weight: 700;
  padding: 10px 2px;
}

.zone-time {
  font-variant-numeric: tabular-nums;
  font-size: clamp(1.78rem, 5.67vw, 4.46rem);
  font-weight: 900;
  line-height: 1;
  margin-top: 16px;
}

.map-wrap {
  margin-top: 20px;
}

.world-map {
  aspect-ratio: 2 / 1;
  border: 1px solid #9ec7cd;
  border-radius: 8px;
  overflow: hidden;
  width: 100%;
}

.leaflet-container {
  font: inherit;
}

.leaflet-marker-icon.zone-marker {
  background: var(--warm);
  border: 3px solid #fff;
  border-radius: 50%;
  box-shadow: 0 8px 24px rgba(23, 32, 42, 0.28);
  height: 18px;
  width: 18px;
}

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

.timestamp-row {
  align-items: center;
  display: flex;
  gap: 16px;
  justify-content: space-between;
}

.converter-inputs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.converter-inputs input {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  padding: 0 8px;
  min-height: 32px;
  width: 60px;
  text-align: center;
}

.converter-inputs input[placeholder="YYYY"] {
  width: 80px;
}

.timestamp-item code {
  color: var(--ink);
  display: block;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: clamp(1.35rem, 5vw, 3rem);
  font-weight: 800;
}

.copy-button {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  font-size: 0.75rem;
  font-weight: 800;
  justify-content: center;
  min-height: 32px;
  padding: 0 10px;
  text-transform: uppercase;
  transition: all 0.2s;
}

.copy-text {
  border: 0;
  clip: rect(0 0 0 0);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

.copy-button:hover {
  background: var(--line);
  color: var(--ink);
}

.copy-button.copied {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

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

  .tabs {
    width: 100%;
  }

  .time-layout {
    grid-template-columns: 1fr;
  }

  .clock-face {
    justify-self: center;
    width: min(240px, 78vw);
  }

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

  .zone-tool {
    grid-template-columns: 1fr;
  }

  .home-info-grid {
    grid-template-columns: 1fr;
  }

  .panel {
    min-height: 0;
  }

  .timestamp-row {
    flex-wrap: wrap;
    gap: 12px;
  }
}
