:root {
  color-scheme: light;
  --bg: #f4f6fb;
  --card-bg: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --danger: #dc2626;
  --danger-dark: #b91c1c;
  --success: #16a34a;
  --track: #e5e7eb;
  --border: #d1d5db;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* {
  box-sizing: border-box;
}

/*
 * Author `display` rules always beat the UA stylesheet's `[hidden] { display:
 * none }`, regardless of selector specificity - so anything toggled via the
 * `hidden` attribute in app.js needs this to actually disappear. Keep this
 * one rule instead of one-off overrides per element.
 */
[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
}

#app {
  max-width: 640px;
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
}

h1 {
  font-size: 1.75rem;
  margin: 0 0 0.25rem;
}

h2 {
  font-size: 1.2rem;
  margin: 1.5rem 0 0.5rem;
}

h3 {
  font-size: 1rem;
  color: var(--muted);
  margin: 1rem 0 0.4rem;
}

.tagline {
  color: var(--muted);
  margin-top: 0;
}

.privacy-note {
  color: var(--muted);
  font-size: 0.85rem;
}

.hint {
  color: var(--muted);
  font-size: 0.85rem;
  margin: 0;
}

form {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

label {
  font-weight: 600;
  font-size: 0.95rem;
}

input[type="text"],
input[type="number"],
textarea {
  font-size: 1rem;
  padding: 0.6rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card-bg);
  color: var(--text);
  margin-bottom: 0.75rem;
  width: 100%;
}

button {
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  padding: 0.65rem 1rem;
  border: none;
  border-radius: 8px;
  background: var(--primary);
  color: white;
}

button:hover {
  background: var(--primary-dark);
}

.link-btn {
  background: none;
  color: var(--primary);
  padding: 0.25rem;
  font-weight: 500;
  text-decoration: underline;
}

.link-btn:hover {
  background: none;
  color: var(--primary-dark);
}

header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.5rem;
}

#timer-area {
  background: var(--card-bg);
  border-radius: 16px;
  padding: 1.5rem;
  margin-top: 1rem;
  text-align: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

#countdown {
  font-size: 3.5rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

#progress-track {
  height: 16px;
  border-radius: 999px;
  background: var(--track);
  overflow: hidden;
  margin: 1rem 0;
}

#progress-bar {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, var(--success), var(--primary));
  transition: width 1s linear;
}

#timer-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

#interval-label {
  font-weight: 500;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

#interval-label input {
  width: 4.5rem;
  margin-bottom: 0;
  display: inline-block;
}

#report-card {
  background: var(--card-bg);
  border-radius: 16px;
  padding: 1.5rem;
  margin-top: 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

#distraction-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

#distraction-list li {
  padding: 0.5rem 0.7rem;
  background: var(--bg);
  border-radius: 8px;
  font-size: 0.95rem;
}

#report-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.import-label {
  font-weight: 500;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* Check-in overlay */

#checkin-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 1000;
}

#checkin-box {
  background: var(--card-bg);
  border-radius: 20px;
  padding: 2rem;
  max-width: 420px;
  width: 100%;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

#checkin-question {
  font-size: 1.4rem;
  font-weight: 700;
  margin-top: 0;
}

#checkin-yesno {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

.big-btn {
  flex: 1;
  padding: 1rem;
  font-size: 1.2rem;
  border-radius: 12px;
}

.big-btn.yes {
  background: var(--success);
}

.big-btn.yes:hover {
  background: #15803d;
}

.big-btn.no {
  background: var(--danger);
}

.big-btn.no:hover {
  background: var(--danger-dark);
}

#joke-text {
  font-size: 1.15rem;
  font-style: italic;
}

@media (max-width: 480px) {
  #countdown {
    font-size: 2.75rem;
  }
  #checkin-yesno {
    flex-direction: column;
  }
}
