:root {
  --bg: #0d1117;
  --surface: #141a21;
  --surface-2: #1b232c;
  --border: #232c36;
  --accent: #38bdf8;
  --accent-dim: #1c3f4e;
  --text: #e6edf3;
  --muted: #8b98a5;
  --green: #3fb950;
  --yellow: #d29922;
  --radius: 16px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }

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

#app {
  max-width: 560px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

#view {
  flex: 1;
  padding: 20px 16px calc(90px + var(--safe-bottom));
}

.eyebrow {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin: 22px 0 8px;
}
.eyebrow:first-child { margin-top: 0; }

.header-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.date-title { font-size: 20px; font-weight: 700; text-transform: capitalize; }

.block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 14px;
}
.block h3 { margin: 0 0 10px; font-size: 15px; color: var(--text); }

.item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 4px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}
.item:last-child { border-bottom: none; }
.item input[type="checkbox"] {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  accent-color: var(--accent);
}
.item-text { display: flex; flex-direction: column; }
.item-subject { font-size: 15px; font-weight: 600; }
.item-detail { font-size: 13px; color: var(--muted); }
.item.done .item-subject, .item.done .item-detail { text-decoration: line-through; opacity: 0.5; }

.muted { color: var(--muted); font-size: 13px; }
.muted.center { text-align: center; }
.muted.small { font-size: 12px; }

/* Landing */
.landing {
  min-height: calc(100vh - 40px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 6px;
}
.landing-logo {
  width: 88px; height: 88px;
  border-radius: 22px;
  background: var(--surface-2);
  border: 2px solid var(--accent);
  color: var(--accent);
  font-weight: 800;
  font-size: 26px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 14px;
}
.landing h1 { margin: 0; font-size: 26px; }
.big-btn {
  margin-top: 26px;
  background: var(--accent);
  color: #04202b;
  border: none;
  font-size: 18px;
  font-weight: 800;
  padding: 18px 34px;
  border-radius: 999px;
  cursor: pointer;
}
.big-btn:active { transform: scale(0.98); }

/* Dashboard */
.progress-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 20px;
}
.progress-ring {
  width: 84px; height: 84px;
  border-radius: 50%;
  border: 6px solid var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 16px;
  flex-shrink: 0;
}
.progress-stats { display: grid; gap: 4px; font-size: 14px; color: var(--muted); }
.progress-stats strong { color: var(--text); }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.stat-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 6px;
  text-align: center;
  font-size: 11px;
  color: var(--muted);
}
.stat-box span { display: block; font-size: 18px; font-weight: 800; color: var(--text); margin-bottom: 2px; }

.field-label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
input[type="date"] {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 15px;
}

.subject-list { display: grid; gap: 12px; }
.subject-row { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; }
.subject-row-top { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 8px; color: var(--muted); }
.bar { height: 6px; background: var(--surface-2); border-radius: 4px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--accent); }

/* Calendar */
.cal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.cal-header button {
  background: var(--surface); border: 1px solid var(--border); color: var(--text);
  width: 36px; height: 36px; border-radius: 10px; font-size: 18px; cursor: pointer;
}
.cal-title { font-weight: 700; text-transform: capitalize; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-bottom: 4px; }
.cal-week { text-align: center; color: var(--muted); font-size: 12px; margin-bottom: 8px; }
.cal-cell {
  aspect-ratio: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-size: 12px; cursor: pointer;
}
.cal-cell.empty { background: transparent; border: none; cursor: default; }
.cal-cell.today { border-color: var(--accent); }
.cal-num { font-weight: 600; }
.cal-dot { font-size: 10px; margin-top: 2px; }

/* Bottom nav */
#bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  max-width: 560px;
  margin: 0 auto;
  display: flex;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 8px 8px calc(8px + var(--safe-bottom));
}
.navbtn {
  flex: 1;
  background: none;
  border: none;
  color: var(--muted);
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  font-size: 20px;
  padding: 6px 0;
  cursor: pointer;
}
.navbtn span { font-size: 11px; }
.navbtn.active { color: var(--accent); }
