:root {
  --bg: #0d1117;
  --surface: #151b23;
  --surface-2: #1f2631;
  --text: #f5f7fa;
  --muted: #9aa4b2;
  --accent: #ff3b30;
  --accent-2: #ffb020;
  --success: #2ecc71;
  --warning: #f1c40f;
  --danger: #ff5c5c;
  --border: rgba(255, 255, 255, 0.1);
  --shadow: 0 16px 40px rgba(0, 0, 0, 0.28);
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 12px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  background:
    radial-gradient(circle at top left, rgba(255, 59, 48, 0.22), transparent 34%),
    radial-gradient(circle at top right, rgba(255, 176, 32, 0.16), transparent 28%),
    var(--bg);
  color: var(--text);
  line-height: 1.5;
  padding-bottom: 88px;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
  border: none;
}

.app {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 18px;
}

.hero {
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: linear-gradient(145deg, rgba(21, 27, 35, 0.95), rgba(31, 38, 49, 0.9));
  box-shadow: var(--shadow);
  margin-bottom: 18px;
}

.hero-top {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.eyebrow {
  color: var(--accent-2);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

h1 {
  font-size: clamp(1.8rem, 8vw, 3.4rem);
  line-height: 1.02;
  letter-spacing: -0.05em;
  margin-bottom: 10px;
}

.subtitle {
  color: var(--muted);
  font-size: 0.98rem;
  max-width: 680px;
}

.countdown {
  min-width: 110px;
  padding: 14px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.06);
  text-align: center;
  border: 1px solid var(--border);
}

.countdown strong {
  display: block;
  font-size: 2rem;
  line-height: 1;
}

.countdown span {
  color: var(--muted);
  font-size: 0.8rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.stat {
  padding: 14px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
}

.stat-label {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  margin-bottom: 4px;
}

.stat-value {
  font-weight: 800;
  font-size: 1rem;
}

.progress-wrap {
  margin-top: 18px;
}

.progress-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 0.86rem;
  margin-bottom: 8px;
}

.progress-track {
  width: 100%;
  height: 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 0.25s ease;
}

.tabs {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  gap: 8px;
  padding: 10px 0 14px;
  margin-bottom: 6px;
  background: linear-gradient(180deg, var(--bg) 70%, rgba(13, 17, 23, 0));
  overflow-x: auto;
  scrollbar-width: none;
}

.tabs::-webkit-scrollbar {
  display: none;
}

.tab-btn {
  flex: 0 0 auto;
  padding: 10px 14px;
  border-radius: 999px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--border);
  font-weight: 700;
  font-size: 0.9rem;
}

.tab-btn.active {
  background: var(--text);
  color: #0d1117;
}

.section {
  display: none;
}

.section.active {
  display: block;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.card {
  border: 1px solid var(--border);
  background: rgba(21, 27, 35, 0.88);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.18);
}

.card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.card h2,
.card h3 {
  line-height: 1.15;
  letter-spacing: -0.025em;
}

.card h2 {
  font-size: 1.3rem;
}

.card h3 {
  font-size: 1.1rem;
}

.meta {
  color: var(--muted);
  font-size: 0.84rem;
  margin-top: 4px;
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 10px 0 14px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--border);
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 700;
}

.pill.high {
  color: #ffd0d0;
  background: rgba(255, 92, 92, 0.14);
}

.pill.medium {
  color: #ffe6a7;
  background: rgba(255, 176, 32, 0.14);
}

.pill.low {
  color: #bef5d2;
  background: rgba(46, 204, 113, 0.14);
}

.task-list {
  display: grid;
  gap: 9px;
  margin-top: 12px;
}

.task {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 11px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.task input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: var(--accent);
  margin-top: 2px;
  flex: 0 0 auto;
}

.task label {
  flex: 1;
  color: var(--text);
  font-size: 0.92rem;
}

.task.done label {
  color: var(--muted);
  text-decoration: line-through;
}

.today-card {
  border-color: rgba(255, 176, 32, 0.42);
  background: linear-gradient(145deg, rgba(255, 176, 32, 0.12), rgba(21, 27, 35, 0.9));
}

.small-btn {
  padding: 8px 10px;
  border-radius: 999px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border);
  font-weight: 700;
  font-size: 0.78rem;
}

.small-btn:hover {
  background: rgba(255, 255, 255, 0.13);
}

.combo-list,
.forms-list,
.notes-list {
  display: grid;
  gap: 12px;
}

.combo {
  padding: 15px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid var(--border);
}

.combo-title {
  font-weight: 900;
  margin-bottom: 6px;
  font-size: 1rem;
}

.combo-purpose {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 10px;
}

.mini-checks {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.mini-check {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 0.82rem;
  padding: 8px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
}

.mini-check input {
  accent-color: var(--accent);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid var(--border);
}

.rating {
  min-width: 74px;
  text-align: right;
  font-weight: 900;
  color: var(--accent-2);
}

.bar-mini {
  margin-top: 8px;
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
}

.bar-mini span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border-radius: inherit;
}

textarea {
  width: 100%;
  min-height: 140px;
  resize: vertical;
  padding: 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  outline: none;
}

textarea:focus {
  border-color: rgba(255, 176, 32, 0.55);
}

.footer-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
}

.action-btn {
  padding: 13px 14px;
  border-radius: var(--radius-md);
  font-weight: 900;
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border);
}

.action-btn.primary {
  background: linear-gradient(135deg, var(--accent), #ff6b3d);
}

.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  display: none;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  background: rgba(13, 17, 23, 0.88);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--border);
}

.bottom-nav-inner {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  max-width: 520px;
  margin: 0 auto;
}

.nav-btn {
  min-height: 48px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  border: 1px solid transparent;
}

.nav-btn.active {
  color: var(--text);
  border-color: rgba(255, 176, 32, 0.45);
  background: rgba(255, 176, 32, 0.13);
}

.empty {
  color: var(--muted);
  padding: 16px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  text-align: center;
}

.mt-14 {
  margin-top: 14px;
}

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

  .hero-top {
    flex-direction: column;
  }

  .countdown {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-align: left;
  }

  .countdown strong {
    font-size: 2.2rem;
  }
}

@media (max-width: 640px) {
  body {
    padding-bottom: 92px;
  }

  .app {
    padding: 12px;
  }

  .hero,
  .card {
    padding: 16px;
    border-radius: 22px;
  }

  .tabs {
    display: none;
  }

  .bottom-nav {
    display: block;
  }

  .mini-checks {
    grid-template-columns: 1fr;
  }

  .footer-actions {
    grid-template-columns: 1fr;
  }
}
