:root {
  --bg: #0b0b0d;
  --bg-elev: #18181b;
  --card: #19191c;
  --card-active: #212125;
  --border: #29292e;
  --text: #f0f0f2;
  --text-dim: #9a9aa2;
  --accent: #7fb2ff;
  --accent-2: #3f6fe0;
  --radius: 18px;
  --shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f4f5f7;
    --bg-elev: #ffffff;
    --card: #ffffff;
    --card-active: #eef1f6;
    --border: #e4e6ea;
    --text: #1a1b1e;
    --text-dim: #6b6d75;
    --accent: #3f6fe0;
    --accent-2: #2c53b8;
    --shadow: 0 2px 10px rgba(20, 30, 60, 0.08);
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

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-font-smoothing: antialiased;
  height: 100%;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px 16px;
  padding-top: calc(env(safe-area-inset-top, 0) + 16px);
  background: linear-gradient(180deg, var(--bg) 70%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.back-btn {
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin-left: -4px;
  border-radius: 14px;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform 0.12s ease, background 0.12s ease;
}
.back-btn:active { transform: scale(0.92); background: var(--card-active); }

.topbar-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}

#title {
  font-size: 22px;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.02em;
}

#app {
  max-width: 720px;
  margin: 0 auto;
  padding: 4px 14px 48px;
}

.hint {
  color: var(--text-dim);
  padding: 24px 8px;
  font-size: 15px;
  text-align: center;
}

.list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 16px;
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  min-height: 76px;
  transition: transform 0.12s ease, background 0.12s ease, border-color 0.12s ease;
}

.row:active {
  transform: scale(0.98);
  background: var(--card-active);
}

@media (hover: hover) {
  .row:hover {
    border-color: var(--accent);
    background: var(--card-active);
  }
}

.icon {
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  color: #fff;
}

.icon svg { width: 22px; height: 22px; }

.icon.pdf {
  background: linear-gradient(155deg, #ff8a7a, #e0503f);
}

.row-main {
  flex: 1;
  min-width: 0;
}

.row-name {
  font-size: 16.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.01em;
}

.row-sub {
  font-size: 13px;
  color: var(--text-dim);
  margin-top: 3px;
}

.chevron {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  opacity: 0.7;
}

.empty {
  color: var(--text-dim);
  font-size: 15px;
  padding: 56px 8px;
  text-align: center;
}

/* subject color palette, cycled by index */
.c0 { background: linear-gradient(155deg, #8ec9ff, #3f6fe0); }
.c1 { background: linear-gradient(155deg, #ffc98e, #e08c3f); }
.c2 { background: linear-gradient(155deg, #9be0a8, #2ea854); }
.c3 { background: linear-gradient(155deg, #d6a8ff, #8b3fe0); }
.c4 { background: linear-gradient(155deg, #ffa8c8, #e03f80); }
.c5 { background: linear-gradient(155deg, #8effe8, #3fbfe0); }
