:root { color-scheme: light dark; }

/* Base */
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}
.wrap { max-width: 980px; margin: 0 auto; padding: 16px; }

h1 { margin: 12px 0 4px; font-size: 28px; }
.sub { margin: 0 0 8px; opacity: .8; }

hr { border: none; border-top: 1px solid rgba(127,127,127,.25); margin: 0; }
.card { border: 1px solid rgba(127,127,127,.25); border-radius: 14px; }
.foot { opacity: .8; }

/* Form controls */
input, select, button {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(127,127,127,.35);
  background: transparent;
  font-size: 14px;
}
button { cursor: pointer; }

/* Subtle, suite-wide focus ring (kills default blue outline) */
button:focus, select:focus, input:focus, .navlinks a:focus { outline: none; }
button:focus-visible,
select:focus-visible,
input:focus-visible,
.navlinks a:focus-visible {
  outline: 2px solid rgba(127,127,127,.65);
  outline-offset: 2px;
}

/* Layout */
.row {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 12px;
  padding: 16px;
  align-items: end;
}
.btncol { width: 130px; }
.col label { display: block; font-size: 13px; margin-bottom: 6px; opacity: .8; }

/* Cards / results */
.nowgrid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 0 16px 16px;
}
.nowcard { padding: 12px; border: 1px solid rgba(127,127,127,.25); border-radius: 12px; }
.nowcard .tz { font-weight: 600; }
.nowcard .t { font-size: 22px; margin-top: 6px; }

.hint { padding: 0 16px 16px; margin: 0; opacity: .8; }

/* Timezone grid */
.grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  padding: 0 16px 16px;
}
.cell {
  padding: 10px;
  border-radius: 12px;
  border: 1px solid rgba(127,127,127,.2);
}
.cell .hour { font-weight: 700; }
.cell .local { opacity: .85; margin-top: 4px; font-size: 13px; }

/* Status colouring */
.cell.good {
  background: rgba(0, 180, 90, 0.18);
  border-color: rgba(0, 180, 90, 0.45);
}
.cell.ok {
  background: rgba(255, 185, 0, 0.18);
  border-color: rgba(255, 185, 0, 0.45);
}
.cell.bad {
  background: rgba(220, 70, 70, 0.14);
  border-color: rgba(220, 70, 70, 0.35);
}

/* Tags (pill badges) */
.tag {
  display: inline-block;
  margin-top: 8px;
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(127,127,127,.35);
}
.tag.good { background: rgba(0, 180, 90, 0.22); border-color: rgba(0, 180, 90, 0.55); }
.tag.ok   { background: rgba(255, 185, 0, 0.22); border-color: rgba(255, 185, 0, 0.55); opacity: .85; }
.tag.bad  { background: rgba(220, 70, 70, 0.18); border-color: rgba(220, 70, 70, 0.45); opacity: .65; }

/* Shared nav */
.topbar {
  border-bottom: 1px solid rgba(127,127,127,.25);
  background: rgba(127,127,127,.06);
}
.navwrap {
  max-width: 980px;
  margin: 0 auto;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.brand .logo {
  width: 28px;
  height: 28px;
  border-radius: 10px;
  border: 1px solid rgba(127,127,127,.35);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 14px;
}
.brand .name { font-weight: 700; letter-spacing: .2px; }

.navlinks {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.navlinks a {
  text-decoration: none;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(127,127,127,.25);
  opacity: .9;
}
.navlinks a:hover { opacity: 1; }
.navlinks a.active { border-color: rgba(127,127,127,.55); font-weight: 650; }

/* Selected timezone badge */
.tzbadge {
  display: inline-block;
  margin-left: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(127,127,127,.35);
  background: rgba(127,127,127,.10);
  font-weight: 700;
  letter-spacing: .2px;
  opacity: 1;
}

/* Highlight current time slot */
.cell.now-slot {
  border: 2px solid rgba(220, 60, 60, 0.85);
  box-shadow: 0 0 0 2px rgba(220, 60, 60, 0.15);
  position: relative;
}
.cell.now-slot::after {
  content: "NOW";
  position: absolute;
  top: 6px;
  right: 8px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .5px;
  color: rgba(220, 60, 60, 0.9);
}

/* Timezone: first row base | swap | target */
.tzrow {
  grid-template-columns: 1fr auto 1fr;
  align-items: end;
}
.swapcol { width: 110px; }

/* Responsive */
@media (max-width: 720px) {
  .row { grid-template-columns: 1fr; }
  .btncol { width: 100%; }
  .nowgrid { grid-template-columns: 1fr; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .navwrap { align-items: flex-start; }
  .navlinks { justify-content: flex-start; }
}

/* ---- Epoch tool layout (scoped) ---- */
.epoch-grid {
  display: grid;
  grid-template-columns: 2fr 2fr 160px;
  gap: 16px;
  align-items: start;
}

.epoch-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.epoch-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 22px; /* align buttons with input row (label height) */
}

/* Result card header + copy button (used by epoch results) */
.cardtop {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.copybtn {
  width: auto;
  padding: 6px 10px;
  border-radius: 10px;
  font-size: 12px;
  opacity: 0.9;
}

@media (max-width: 900px) {
  .epoch-grid {
    grid-template-columns: 1fr;
  }
  .epoch-actions {
    padding-top: 0;
  }
}

