:root {
  --bg: #0B0D10;
  --surface: #12151B;
  --surface-2: #171B23;
  --surface-hover: #1D222D;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --text: #F2F4F8;
  --text-2: #9CA5B4;
  --text-3: #656E7E;
  --accent: #FF4655;
  --accent-soft: rgba(255, 70, 85, 0.14);
  --mint: #3DD6C6;
  --mint-soft: rgba(61, 214, 198, 0.13);
  --amber: #F5B951;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --max-w: 1200px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

body.modal-open {
  overflow: hidden;
}

.hidden {
  display: none !important;
}

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

a {
  color: inherit;
  text-decoration: none;
}

/* Auth Gate */
.auth-gate {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(600px 360px at 50% 0%, rgba(255, 70, 85, 0.09), transparent 70%),
    var(--bg);
}

.auth-card {
  width: 100%;
  max-width: 380px;
  padding: 36px 28px 30px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  text-align: center;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
}

.brand-mark-lg {
  width: 56px;
  height: 56px;
  margin: 0 auto 18px;
}

.auth-title {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.auth-sub {
  margin: 8px 0 24px;
  color: var(--text-2);
  font-size: 13px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.auth-form input {
  width: 100%;
  height: 46px;
  padding: 0 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: #0D1015;
  font-size: 15px;
  outline: none;
  transition: border-color 0.15s ease;
}

.auth-form input:focus {
  border-color: var(--accent);
}

.auth-error {
  min-height: 20px;
  margin: 12px 0 0;
  color: #FF7B86;
  font-size: 13px;
}

.auth-foot {
  margin: 14px 0 0;
  font-size: 12px;
  color: var(--text-3);
}

/* Buttons */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 20px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: #FFFFFF;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s ease, transform 0.1s ease;
}

.btn-primary:hover { opacity: 0.92; }
.btn-primary:active { transform: scale(0.985); }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 36px;
  padding: 0 13px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.btn-ghost:hover {
  background: var(--surface-hover);
  border-color: var(--border-strong);
}

.btn-subtle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-2);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-subtle:hover {
  color: var(--text);
  background: var(--surface-2);
  border-color: var(--border-strong);
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-2);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-icon svg {
  width: 17px;
  height: 17px;
}

.btn-icon:hover {
  color: var(--text);
  border-color: var(--border-strong);
}

/* Topbar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  padding-top: env(safe-area-inset-top);
  background: rgba(11, 13, 16, 0.84);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  height: 62px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.brand-icon {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
}

.brand-name {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.rank-pill {
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: #FF8C96;
  font-size: 11px;
  font-weight: 600;
  font-family: var(--mono);
  letter-spacing: 0.03em;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.daily-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 36px;
  padding: 0 13px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 13px;
  color: var(--text-2);
  font-family: var(--mono);
}

.daily-pill .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--amber);
}

.daily-pill.done {
  border-color: rgba(61, 214, 198, 0.35);
  color: var(--mint);
}

.daily-pill.done .dot {
  background: var(--mint);
}

.mini-count {
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.09);
  font-size: 11px;
  font-family: var(--mono);
}

/* Main Content */
.main-wrap {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 28px 20px 64px;
}

.eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--text-3);
  margin-bottom: 4px;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.section-title {
  margin: 0;
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.count-muted {
  color: var(--text-3);
  font-size: 15px;
  font-weight: 500;
  margin-left: 4px;
}

.section-meta-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.duration-chip {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-2);
  padding: 5px 10px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
}

/* Complete Banner */
.complete-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  margin-bottom: 18px;
  border-radius: var(--radius-md);
  background: var(--mint-soft);
  border: 1px solid rgba(61, 214, 198, 0.28);
}

.complete-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--mint);
  color: #081A18;
  font-weight: 800;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.complete-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.complete-copy strong {
  color: #A8F5EC;
  font-size: 14px;
}

.complete-copy span {
  color: var(--text-2);
  font-size: 13px;
}

/* Today Grid */
.today-section {
  margin-bottom: 44px;
}

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

/* Library Controls */
.library-head {
  flex-wrap: wrap;
}

.library-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.status-segmented {
  display: inline-flex;
  padding: 3px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
}

.seg-btn {
  border: none;
  background: transparent;
  color: var(--text-2);
  font-size: 13px;
  padding: 5px 12px;
  border-radius: 7px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.seg-btn.active {
  background: var(--surface-hover);
  color: var(--text);
  font-weight: 600;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 12px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-3);
  min-width: 210px;
}

.search-box svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.search-box input {
  width: 100%;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 13px;
  outline: none;
}

.channel-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  margin-bottom: 20px;
  scrollbar-width: none;
}

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

.ch-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.ch-tab:hover {
  border-color: var(--border-strong);
  color: var(--text);
}

.ch-tab.active {
  background: var(--text);
  color: #0B0D10;
  border-color: var(--text);
  font-weight: 600;
}

.ch-pct {
  font-family: var(--mono);
  font-size: 11px;
  opacity: 0.65;
}

/* Video Card */
.library-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.video-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.video-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
  background: var(--surface-2);
}

.video-card.featured {
  border-color: rgba(255, 70, 85, 0.25);
}

.thumb-wrap {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #0E1117;
  overflow: hidden;
}

.thumb-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.video-card:hover .thumb-wrap img {
  transform: scale(1.03);
}

.thumb-overlay-top {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  background: rgba(11, 13, 16, 0.78);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text);
}

.badge.ch-review { color: #FF9EA7; border-color: rgba(255, 70, 85, 0.35); }
.badge.ch-mechanics { color: #91D5FF; border-color: rgba(91, 184, 255, 0.35); }
.badge.ch-macro { color: #F9D285; border-color: rgba(245, 185, 81, 0.35); }
.badge.ch-agents { color: #8EF0E4; border-color: rgba(61, 214, 198, 0.35); }

.score-badge {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(11, 13, 16, 0.82);
  color: var(--amber);
  border: 1px solid rgba(245, 185, 81, 0.3);
}

.duration-tag {
  position: absolute;
  right: 10px;
  bottom: 10px;
  padding: 2px 7px;
  border-radius: 5px;
  background: rgba(8, 10, 14, 0.86);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  color: #FFFFFF;
}

.state-tag {
  position: absolute;
  left: 10px;
  bottom: 10px;
  padding: 2px 8px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 600;
}

.state-tag.watched {
  background: rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(8px);
  color: #F2F4F8;
}

.state-tag.mastered {
  background: rgba(61, 214, 198, 0.9);
  color: #071917;
}

.card-progress-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.12);
}

.card-progress-fill {
  height: 100%;
  background: var(--accent);
}

.card-body {
  padding: 14px 15px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.card-title {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.42;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-why {
  margin: 0;
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.48;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-foot {
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  color: var(--text-3);
}

.card-author {
  color: var(--text-2);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-note-dot {
  color: var(--mint);
  font-size: 11px;
  flex-shrink: 0;
}

.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-3);
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
}

.site-footer {
  border-top: 1px solid var(--border);
  padding: 20px;
  text-align: center;
  font-size: 12px;
  color: var(--text-3);
  padding-bottom: calc(20px + env(safe-area-inset-bottom));
}

/* Modals */
.modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  justify-content: center;
  align-items: center;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 7, 10, 0.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.player-sheet {
  position: relative;
  z-index: 1;
  width: min(1040px, 100%);
  height: min(94dvh, 920px);
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.65);
}

.player-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  padding-top: max(12px, env(safe-area-inset-top));
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  flex-shrink: 0;
}

.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 6px;
}

.btn-back svg {
  width: 18px;
  height: 18px;
}

.player-top-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.player-scroll {
  overflow-y: auto;
  flex: 1;
  padding-bottom: calc(28px + env(safe-area-inset-bottom));
}

.video-stage {
  position: relative;
  width: 100%;
  background: #000000;
  aspect-ratio: 16 / 9;
  max-height: 62dvh;
}

.video-stage video {
  width: 100%;
  height: 100%;
  display: block;
  background: #000000;
}

.pruned-overlay {
  position: absolute;
  inset: 0;
  background: rgba(11, 13, 16, 0.92);
  display: grid;
  place-items: center;
  padding: 24px;
  text-align: center;
}

.pruned-inner {
  max-width: 420px;
}

.pruned-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 8px;
}

.pruned-inner p {
  font-size: 13px;
  color: var(--text-2);
  margin: 0 0 18px;
}

.playback-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.speed-group, .seek-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.pb-label {
  font-size: 12px;
  color: var(--text-3);
  margin-right: 4px;
}

.speed-btn {
  height: 28px;
  padding: 0 9px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-2);
  font-family: var(--mono);
  font-size: 12px;
  cursor: pointer;
}

.speed-btn.active {
  background: var(--accent-soft);
  border-color: rgba(255, 70, 85, 0.45);
  color: #FF9EA7;
  font-weight: 600;
}

.resume-hint {
  padding: 7px 20px;
  font-size: 12px;
  color: var(--mint);
  background: rgba(61, 214, 198, 0.08);
  border-bottom: 1px solid rgba(61, 214, 198, 0.16);
}

.player-header {
  padding: 20px 22px 14px;
}

.player-title {
  margin: 0 0 12px;
  font-size: 19px;
  font-weight: 700;
  line-height: 1.4;
}

.attribution-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 13px;
}

.author-info {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
}

.author-label {
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-2);
}

.author-name {
  font-weight: 600;
  color: var(--text);
}

.author-name:hover {
  text-decoration: underline;
}

.sep, .meta-muted {
  color: var(--text-3);
}

.source-link {
  color: #91D5FF;
  font-size: 12px;
  font-weight: 600;
}

.source-link:hover {
  text-decoration: underline;
}

.study-grid {
  padding: 6px 22px 0;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 18px;
}

.study-card, .drill-box, .note-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px;
}

.card-kicker {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--text-3);
  margin-bottom: 8px;
}

.card-kicker.accent {
  color: #FF8C96;
}

.mt-lg {
  margin-top: 20px;
}

.why-text {
  margin: 0;
  font-size: 14px;
  color: var(--text);
}

.takeaway-list {
  margin: 0;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  color: var(--text-2);
  font-size: 14px;
}

.takeaway-list li::marker {
  color: var(--accent);
  font-family: var(--mono);
  font-weight: 700;
}

.study-side {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.drill-box {
  border-left: 3px solid var(--accent);
  background: linear-gradient(135deg, rgba(255, 70, 85, 0.08), var(--surface) 60%);
}

.drill-text {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}

.action-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.btn-toggle {
  height: 42px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-toggle:hover {
  background: var(--surface-hover);
}

.btn-toggle.active {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.35);
}

.btn-toggle.mastered.active {
  background: var(--mint-soft);
  border-color: rgba(61, 214, 198, 0.5);
  color: var(--mint);
}

.note-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.save-status {
  font-size: 11px;
  color: var(--mint);
}

.note-box textarea {
  width: 100%;
  margin-top: 6px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #0D1015;
  color: var(--text);
  font-size: 13px;
  resize: vertical;
  outline: none;
}

.note-box textarea:focus {
  border-color: var(--border-strong);
}

/* Notes Sheet */
.notes-sheet {
  position: relative;
  z-index: 1;
  width: min(760px, 96%);
  max-height: 88dvh;
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.notes-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.notes-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.notes-stats {
  display: flex;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-2);
}

.notes-list {
  overflow-y: auto;
  padding: 18px 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.note-item {
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--border);
}

.note-item-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.note-item-title {
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
}

.note-item-title:hover {
  color: #FF8C96;
}

.note-item-body {
  margin: 0;
  font-size: 13px;
  color: var(--text-2);
  white-space: pre-wrap;
}

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 90;
  padding: 10px 18px;
  border-radius: 999px;
  background: #1E2430;
  border: 1px solid var(--border-strong);
  color: var(--text);
  font-size: 13px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
}

/* Responsive */
@media (max-width: 960px) {
  .library-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .study-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .topbar-inner {
    padding: 0 14px;
    height: 56px;
  }
  .rank-pill {
    display: none;
  }
  .main-wrap {
    padding: 18px 14px 48px;
  }
  .today-grid,
  .library-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .section-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .search-box {
    width: 100%;
    min-width: 0;
  }
  .library-tools {
    width: 100%;
  }
  .player-sheet {
    width: 100%;
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
    border: none;
  }
  .player-header {
    padding: 16px 14px 12px;
  }
  .player-title {
    font-size: 17px;
  }
  .study-grid {
    padding: 4px 14px 0;
  }
  .playback-bar {
    padding: 10px 14px;
  }
}
