:root {
  --bg: #0a0a0c;
  --panel: #14151a;
  --text: #e8e8ec;
  --muted: #8a8a94;
  --border: #26272e;
  --field: #0d0e11;
  --study: #4ade80;
  --work: #60a5fa;
  --break: #38bdf8;
  --warn: #f59e0b;
  --critical: #ef4444;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.hidden { display: none !important; }

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
  width: 100%;
  max-width: 420px;
}

h1 {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin: 0 0 20px;
  text-align: center;
}

.countdown {
  font-size: 60px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  text-align: center;
  margin: 10px 0;
}

.status-line {
  font-size: 21px;
  font-weight: 600;
  text-align: center;
  margin-bottom: 6px;
}

.sub {
  color: var(--muted);
  font-size: 14px;
  text-align: center;
  margin-bottom: 16px;
}

label {
  font-size: 13px;
  color: var(--muted);
  display: block;
  margin-bottom: 4px;
}

input[type=email], input[type=password], input[type=text] {
  width: 100%;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--field);
  color: var(--text);
  font-size: 15px;
  margin-bottom: 12px;
}

button {
  width: 100%;
  padding: 14px;
  border-radius: 10px;
  border: none;
  background: var(--study);
  color: #08150a;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  margin-bottom: 8px;
}

button.secondary { background: transparent; border: 1px solid var(--border); color: var(--text); }
button.danger { background: var(--critical); color: #1a0505; }

.dot-row { display: flex; gap: 8px; justify-content: center; margin: 12px 0 20px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--border); }
.dot.filled { background: var(--study); }

.state-study { color: var(--study); }
.state-work { color: var(--work); }
.state-break { color: var(--break); }
.state-warn { color: var(--warn); }
.state-critical { color: var(--critical); }

.presets { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px; }
.presets button {
  margin-bottom: 0;
  background: #1c1d24;
  color: var(--text);
  border: 1px solid var(--border);
  font-weight: 500;
  font-size: 13px;
  padding: 12px 6px;
}

.freshness { font-size: 12px; color: var(--muted); text-align: center; margin-top: 16px; }

.banner {
  background: var(--critical);
  color: #1a0505;
  padding: 9px 12px;
  border-radius: 8px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 16px;
}

.totals { display: flex; justify-content: space-between; margin: 8px 0; font-size: 15px; }
.totals b { font-variant-numeric: tabular-nums; }

.timezone-line { font-size: 13px; color: var(--muted); text-align: center; margin-bottom: 18px; }

.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.65);
  display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 50;
}

.conn-dot { display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 12px; color: var(--muted); }
.conn-dot .pip { width: 7px; height: 7px; border-radius: 50%; background: var(--study); }
.conn-dot.offline .pip { background: var(--critical); }

.history-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.history-row:last-child { border-bottom: none; }
.history-time { color: var(--muted); min-width: 58px; font-variant-numeric: tabular-nums; }
.history-what { flex: 1; }
.history-what .reason { color: var(--warn); font-size: 12px; display: block; margin-top: 2px; }
.history-dur { color: var(--muted); font-variant-numeric: tabular-nums; }
.history-empty { color: var(--muted); font-size: 14px; text-align: center; padding: 20px 0; }
