:root {
  --bg: #f7f9fc;
  --surface: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --brand: #2563eb;
  --brand-dark: #1d4ed8;
  --accent: #10b981;
  --border: #e2e8f0;
  --shadow: 0 1px 3px rgba(15,23,42,.06), 0 1px 2px rgba(15,23,42,.04);
  --radius: 10px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .5em; }
h1 { font-size: clamp(1.8rem, 3.2vw, 2.6rem); }
h2 { font-size: 1.6rem; margin-top: 2rem; }
h3 { font-size: 1.2rem; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 1rem; }

/* Header */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 50;
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: .75rem 1rem;
}
.logo { font-weight: 700; font-size: 1.15rem; color: var(--text); }
.logo span { margin-left: .25rem; }
.site-header nav ul {
  display: flex; gap: 1.25rem; list-style: none; margin: 0; padding: 0; flex-wrap: wrap;
}
.site-header nav a { color: var(--text); font-weight: 500; }
.site-header nav a:hover { color: var(--brand); }

/* Hero */
.hero { padding: 2.5rem 1rem 1.5rem; text-align: center; }
.lede { color: var(--muted); font-size: 1.1rem; max-width: 720px; margin: 0 auto 1.25rem; }
.hero-cta { display: flex; gap: .75rem; justify-content: center; flex-wrap: wrap; }

.btn {
  display: inline-block; padding: .65rem 1.1rem; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  cursor: pointer; font-weight: 600; font-size: .95rem; text-decoration: none;
  transition: all .15s ease;
}
.btn:hover { border-color: var(--brand); color: var(--brand); text-decoration: none; }
.btn.primary { background: var(--brand); color: #fff; border-color: var(--brand); }
.btn.primary:hover { background: var(--brand-dark); color: #fff; }
.btn.icon { width: 38px; height: 38px; padding: 0; }

/* Layout */
.layout {
  display: grid; gap: 1.5rem; grid-template-columns: minmax(0,1fr) 320px;
  margin-top: 1.5rem;
}
@media (max-width: 960px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { order: 2; }
}

.content section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow);
}

/* Clocks */
.controls { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; margin: 1rem 0; }
.controls select { flex: 1; min-width: 200px; }
.clock-grid {
  display: grid; gap: .75rem;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}
.clock-card {
  position: relative;
  background: linear-gradient(180deg, #ffffff, #f8fafc);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
}
.clock-card .city { font-weight: 600; }
.clock-card .zone { font-size: .8rem; color: var(--muted); }
.clock-card .time {
  font-variant-numeric: tabular-nums;
  font-size: 1.6rem; font-weight: 700; margin-top: .25rem;
  color: var(--brand-dark);
}
.clock-card .date { font-size: .85rem; color: var(--muted); }
.clock-card .remove {
  position: absolute; top: .35rem; right: .5rem;
  background: transparent; border: 0; color: var(--muted); cursor: pointer;
  font-size: 1.1rem; line-height: 1;
}
.clock-card .remove:hover { color: #ef4444; }

/* Converter */
.converter {
  background: #f1f5f9;
  border-radius: var(--radius);
  padding: 1rem;
  margin: 1rem 0 1.5rem;
}
.conv-row { margin-bottom: .75rem; }
.conv-row label { display: block; font-size: .85rem; font-weight: 600; color: var(--muted); margin-bottom: .25rem; }
.conv-row input, .conv-row select, .controls select {
  width: 100%; padding: .6rem .7rem; border: 1px solid var(--border);
  border-radius: 8px; background: #fff; font-size: 1rem;
}
.conv-row.two-col { display: grid; grid-template-columns: 1fr auto 1fr; gap: .5rem; align-items: end; }
.swap-wrap { display: flex; align-items: end; }
.result {
  font-size: 1.8rem; font-weight: 700; text-align: center;
  padding: 1rem; background: #fff; border-radius: 8px; border: 1px solid var(--border);
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.rate-note { font-size: .85rem; color: var(--muted); text-align: center; margin-top: .5rem; }

.pair-grid {
  display: grid; gap: .5rem;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
}
.pair-card {
  background: #fff; border: 1px solid var(--border); border-radius: 8px;
  padding: .65rem .8rem; font-size: .9rem;
}
.pair-card .pair { font-weight: 600; }
.pair-card .rate { color: var(--accent); font-variant-numeric: tabular-nums; }

/* Features */
.features { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); margin-top: 1rem; }
.feature {
  background: #f8fafc; border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem;
}
.feature h3 { margin-top: 0; font-size: 1rem; }
.feature p { margin: 0; color: var(--muted); font-size: .92rem; }

/* FAQ */
details {
  background: #f8fafc; border: 1px solid var(--border); border-radius: 8px;
  padding: .65rem .9rem; margin-bottom: .5rem;
}
details summary { font-weight: 600; cursor: pointer; }
details[open] summary { color: var(--brand); }

/* Sidebar */
.sidebar { display: flex; flex-direction: column; gap: 1rem; }
.widget {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1rem; box-shadow: var(--shadow);
}
.widget h3 { margin-top: 0; font-size: 1rem; border-bottom: 1px solid var(--border); padding-bottom: .4rem; }
.widget ul { list-style: none; padding: 0; margin: 0; }
.widget ul li {
  display: flex; justify-content: space-between; padding: .35rem 0;
  border-bottom: 1px dashed var(--border); font-size: .92rem;
}
.widget ul li:last-child { border-bottom: 0; }

/* Ad slots */
.ad-slot {
  background: #eef2f7;
  border: 1px dashed #cbd5e1;
  border-radius: var(--radius);
  margin: 1.25rem 0;
  min-height: 100px;
  display: flex; align-items: center; justify-content: center;
  position: relative;
  overflow: hidden;
}
.ad-slot .ad-label {
  position: absolute; top: 4px; left: 8px;
  font-size: .65rem; color: #94a3b8; text-transform: uppercase; letter-spacing: .08em;
}
.ad-leaderboard { min-height: 90px; }
.ad-rectangle { min-height: 250px; }
.ad-inarticle { min-height: 200px; }
.ad-sidebar { min-height: 250px; }
.ad-sidebar.sticky { position: sticky; top: 80px; }

.ad-anchor {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: #fff; border-top: 1px solid var(--border);
  min-height: 70px; display: flex; align-items: center; justify-content: center;
  z-index: 40;
}
.ad-anchor .ad-label {
  position: absolute; top: 2px; left: 6px; font-size: .6rem; color: #94a3b8;
}
@media (max-width: 700px) {
  body { padding-bottom: 80px; }
}

/* Footer */
.site-footer {
  background: #0f172a; color: #cbd5e1;
  margin-top: 2.5rem; padding: 2rem 0 0;
}
.footer-inner {
  display: grid; gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  padding-top: 1rem; padding-bottom: 1.5rem;
}
.site-footer h4 { color: #fff; margin: 0 0 .5rem; font-size: .95rem; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer ul li { padding: .2rem 0; font-size: .9rem; }
.site-footer a { color: #cbd5e1; }
.site-footer a:hover { color: #fff; }
.site-footer .copyright {
  border-top: 1px solid #1e293b; padding: 1rem;
  text-align: center; font-size: .85rem; color: #64748b;
}

/* Tables (timezones page) */
.tz-table {
  width: 100%; border-collapse: collapse; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
}
.tz-table th, .tz-table td {
  text-align: left; padding: .65rem .9rem; border-bottom: 1px solid var(--border);
  font-size: .92rem;
}
.tz-table th { background: #f1f5f9; font-weight: 600; }
.tz-table tr:last-child td { border-bottom: 0; }
.tz-table .time { font-variant-numeric: tabular-nums; color: var(--brand-dark); font-weight: 600; }
