:root {
  --bg: #09111f;
  --surface: #101c2e;
  --surface-2: #14243a;
  --text: #f4f8ff;
  --muted: #a9bad0;
  --accent: #73d5ac;
  --accent-deep: #0b684a;
  --line: #28415d;
  --danger: #ff9c9c;
  --radius: 18px;
  --shadow: 0 12px 30px rgba(0, 0, 0, .2);
  color: var(--text);
  background: var(--bg);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  min-width: 320px;
  margin: 0;
  background: radial-gradient(circle at 100% 0, #173154 0, transparent 34rem), var(--bg);
  line-height: 1.5;
}

header,
main,
footer {
  width: min(100% - 32px, 700px);
  margin-inline: auto;
}

header { padding: 24px 0 18px; }
main { padding-bottom: 36px; }
footer { padding: 0 0 30px; color: var(--muted); font-size: .85rem; text-align: center; }
section,
.settings { margin: 20px 0; }

.topbar,
.section-heading,
.brand,
.achievement-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand,
.achievement-heading { justify-content: flex-start; }
.app-icon,
.achievement-icon { display: block; border-radius: 14px; box-shadow: 0 5px 18px rgba(0, 0, 0, .25); }
.achievement-heading { margin-bottom: 10px; }
.achievement-heading h2,
.achievement-heading p { margin-bottom: 0; }

h1,
h2,
p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(2rem, 7vw, 2.7rem); line-height: 1; letter-spacing: -.05em; }
h2 { margin-bottom: 6px; font-size: 1.2rem; }

.eyebrow,
.date {
  margin-bottom: 5px;
  color: var(--accent);
  font-size: .78rem;
  font-weight: 750;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.date { color: var(--muted); letter-spacing: 0; text-transform: none; }

.hero-card,
.add-card,
.delay-card,
.info-card,
.login-card,
.stats-grid article {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(145deg, var(--surface-2), var(--surface));
  box-shadow: var(--shadow);
}

.hero-card { display: grid; gap: 22px; }
.hero-card h2,
.info-card h2 { margin: 0 0 8px; font-size: 3.1rem; line-height: 1; }
.hero-card h2 span,
.info-card h2 span { color: var(--muted); font-size: 1.1rem; font-weight: 500; }
.hero-card p,
.add-card p,
.delay-card p,
.info-card p,
.intro,
.empty,
.entry p { margin-bottom: 0; color: var(--muted); }
.limit-reached { border-color: #815d32; }
.limit-reached .progress span { background: #ffc46b; }

.progress-wrap { display: flex; align-items: center; gap: 12px; }
.progress { flex: 1; height: 12px; overflow: hidden; border-radius: 99px; background: #07101d; }
.progress span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), #b3f39c); transition: width .25s ease; }

form { display: grid; gap: 13px; }
label { display: grid; gap: 6px; color: var(--muted); font-size: .92rem; }
input,
textarea,
select {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  background: #091525;
  font: inherit;
}
textarea { resize: vertical; }
.optional { color: var(--muted); font-size: .8em; }

.button,
.text-button {
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 10px;
  font: inherit;
  font-weight: 750;
  cursor: pointer;
}

.button { padding: 10px 16px; }
.primary { color: #052417; background: var(--accent); box-shadow: 0 3px 0 var(--accent-deep); }
.accent { color: #052417; background: #b3f39c; box-shadow: 0 3px 0 #5d9d5a; }
.secondary { border-color: var(--line); color: var(--text); background: transparent; }
.text-button { padding: 8px; color: var(--muted); background: transparent; }
.danger { color: var(--danger); }
.add-button { min-height: 56px; font-size: 1.05rem; }
button:hover { filter: brightness(1.08); }
button:active { transform: translateY(1px); }

.delay-card { display: grid; gap: 18px; }
.countdown { color: var(--accent); font-size: 1.2rem; font-weight: 750; }

.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stats-grid article { padding: 16px; }
.stats-grid span,
.stats-grid small { display: block; color: var(--muted); font-size: .8rem; }
.stats-grid strong { display: block; margin: 5px 0; font-size: 1rem; }

.bar-chart { display: flex; align-items: end; height: 150px; gap: 7px; padding: 0 5px; border-bottom: 1px solid var(--line); }
.bar-day { display: flex; flex: 1; flex-direction: column; align-items: center; justify-content: end; height: 100%; gap: 5px; color: var(--muted); font-size: .78rem; }
.bar-day strong { color: var(--text); }
.bar { display: block; width: 100%; max-width: 38px; min-height: 6px; border-radius: 7px 7px 1px 1px; background: #416788; }
.bar-day.today .bar { background: var(--accent); }
.trend { margin: 12px 0 0; color: var(--muted); font-size: .9rem; }
.trend span,
.chip,
.badges span { display: inline-block; margin: 3px; padding: 3px 8px; border-radius: 99px; color: #c0f5d9; background: #163a34; font-size: .8rem; }

.badges { display: flex; flex-wrap: wrap; }
.badges span { margin: 0 6px 6px 0; padding: 7px 10px; }
.history { display: grid; gap: 7px; }
.history article { display: grid; grid-template-columns: 1fr auto; gap: 3px 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.history .chip { justify-self: end; margin: 0; }
.history strong { grid-column: 1 / -1; color: var(--muted); font-size: .9rem; }

.settings { border: 1px solid var(--line); border-radius: var(--radius); background: rgba(16, 28, 46, .65); }
.settings summary { min-height: 56px; padding: 18px; font-weight: 750; }
.details-content { padding: 0 18px 18px; }
.details-content fieldset { margin: 0; padding: 14px; border: 1px solid var(--line); border-radius: 12px; }
.details-content legend { padding: 0 5px; color: var(--accent); font-weight: 750; }
.check { grid-template-columns: auto 1fr; align-items: center; }
.check input { width: 20px; min-height: 20px; }
.hint { margin: 0; color: var(--muted); font-size: .9rem; }
.exports { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

.notice { padding: 11px 13px; border: 1px solid var(--accent); border-radius: 10px; background: #183a33; }
.entries { display: grid; gap: 10px; }
.entry { display: flex; justify-content: space-between; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); }
time { font-weight: 750; }
.entry details { min-width: max-content; }
summary { color: var(--accent); cursor: pointer; }
.edit-form { min-width: min(100%, 270px); margin-top: 14px; }
.delete-form { margin-top: 6px; }

.skip-link { position: absolute; top: -60px; left: 12px; z-index: 2; padding: 8px; color: #000; background: var(--text); }
.skip-link:focus { top: 12px; }
.login-page { display: grid; place-items: center; min-height: 100vh; padding: 16px; }
.login-card { width: min(100%, 430px); }
.login-card h1 { margin-bottom: 14px; }

.width-0 { width: 0; }
.width-5 { width: 5%; }
.width-10 { width: 10%; }
.width-15 { width: 15%; }
.width-20 { width: 20%; }
.width-25 { width: 25%; }
.width-30 { width: 30%; }
.width-35 { width: 35%; }
.width-40 { width: 40%; }
.width-45 { width: 45%; }
.width-50 { width: 50%; }
.width-55 { width: 55%; }
.width-60 { width: 60%; }
.width-65 { width: 65%; }
.width-70 { width: 70%; }
.width-75 { width: 75%; }
.width-80 { width: 80%; }
.width-85 { width: 85%; }
.width-90 { width: 90%; }
.width-95 { width: 95%; }
.width-100 { width: 100%; }

.height-0 { height: 6px; }
.height-5 { height: 5%; }
.height-10 { height: 10%; }
.height-15 { height: 15%; }
.height-20 { height: 20%; }
.height-25 { height: 25%; }
.height-30 { height: 30%; }
.height-35 { height: 35%; }
.height-40 { height: 40%; }
.height-45 { height: 45%; }
.height-50 { height: 50%; }
.height-55 { height: 55%; }
.height-60 { height: 60%; }
.height-65 { height: 65%; }
.height-70 { height: 70%; }
.height-75 { height: 75%; }
.height-80 { height: 80%; }
.height-85 { height: 85%; }
.height-90 { height: 90%; }
.height-95 { height: 95%; }
.height-100 { height: 100%; }

:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }

@media (max-width: 640px) {
  .stats-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  header,
  main,
  footer { width: min(100% - 24px, 700px); }
  .hero-card,
  .add-card,
  .delay-card,
  .info-card { padding: 18px; }
  .entry { align-items: flex-start; }
  .entry > details { min-width: 0; }
  .exports { display: grid; }
  .exports form,
  .exports button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
