/* v15 visual rebuild pass 1: match reference app shell, homepage, question sheet */
:root {
  --jlpt-blue: #0b6fff;
  --jlpt-blue-2: #0057e7;
  --jlpt-bg: #f6f8fc;
  --jlpt-card: #ffffff;
  --jlpt-line: #e3eaf4;
  --jlpt-text: #0f172a;
  --jlpt-muted: #667085;
  --jlpt-soft: 0 10px 32px rgba(15, 23, 42, .055);
}

body {
  background: var(--jlpt-bg) !important;
  color: var(--jlpt-text);
}

.app-shell {
  width: 100% !important;
  min-height: 100vh !important;
  margin: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: var(--jlpt-bg) !important;
  box-shadow: none !important;
  display: block !important;
  overflow: visible !important;
}

.sidebar {
  position: sticky !important;
  top: 0 !important;
  z-index: 80 !important;
  min-height: 92px !important;
  padding: 0 32px !important;
  display: grid !important;
  grid-template-columns: minmax(300px, 1fr) auto !important;
  align-items: center !important;
  gap: 32px !important;
  background: rgba(255,255,255,.97) !important;
  border-bottom: 1px solid #e7edf5 !important;
  box-shadow: 0 4px 18px rgba(15, 23, 42, .035) !important;
  backdrop-filter: blur(18px) !important;
  color: var(--jlpt-text) !important;
}

.brand { gap: 18px !important; padding: 0 !important; }
.brand-mark {
  width: 52px !important;
  height: 52px !important;
  border-radius: 12px !important;
  background: linear-gradient(145deg, var(--jlpt-blue), var(--jlpt-blue-2)) !important;
  color: #fff !important;
  box-shadow: 0 12px 24px rgba(11,111,255,.22) !important;
  font-size: 0 !important;
}
.brand-mark::after { content: "N2"; font-size: 24px; font-weight: 900; }
.brand h1 { margin: 0 !important; font-size: 28px !important; font-weight: 950 !important; letter-spacing: .01em; }
.brand p { margin-top: 5px !important; color: #7a8699 !important; font-size: 15px !important; font-weight: 700 !important; }
.level-card, .today-card, .sync-card { display: none !important; }

.side-nav {
  display: flex !important;
  align-items: stretch !important;
  justify-content: flex-end !important;
  gap: 28px !important;
  height: 92px !important;
}
.nav-item {
  position: relative !important;
  width: auto !important;
  min-width: 88px !important;
  padding: 0 4px !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: #111827 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  font-weight: 900 !important;
}
.nav-item b { font-size: 18px !important; white-space: nowrap; }
.nav-item span { display: none !important; }
.nav-item.active, .nav-item:hover { background: transparent !important; color: var(--jlpt-blue) !important; }
.nav-item.active::after {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 8px;
  height: 4px;
  border-radius: 999px;
  background: var(--jlpt-blue);
  box-shadow: 0 4px 10px rgba(11,111,255,.3);
}
.nav-extra { display: none !important; }

.main {
  width: min(1480px, calc(100% - 48px)) !important;
  margin: 0 auto !important;
  padding: 30px 0 52px !important;
  overflow: visible !important;
}
.route-n2 .topbar,
.route-n2 .dashboard-grid { display: none !important; }
.route-n2 .collections {
  margin: 0 0 16px !important;
  padding: 0 !important;
  gap: 12px !important;
}
.collection-chip {
  border: 1px solid var(--jlpt-line) !important;
  background: #fff !important;
  color: #334155 !important;
  border-radius: 12px !important;
  padding: 11px 16px !important;
  box-shadow: none !important;
}
.collection-chip.active { background: var(--jlpt-blue) !important; border-color: var(--jlpt-blue) !important; color: #fff !important; }
.collection-chip small { opacity: .78; }

/* Homepage */
.home-dashboard { gap: 18px !important; }
.home-heading { margin-top: 2px; }
.home-heading h2 { font-size: 28px !important; }
.level-grid-home { gap: 22px !important; }
.level-select-card {
  border-color: var(--jlpt-line) !important;
  border-radius: 13px !important;
  box-shadow: var(--jlpt-soft) !important;
}
.level-select-card.selected { border: 2px solid var(--jlpt-blue) !important; }
.home-layout { grid-template-columns: minmax(0, 1fr) 460px !important; align-items: start; }
.home-main-card, .home-side-card, .home-extra-card {
  background: #fff !important;
  border: 1px solid var(--jlpt-line) !important;
  border-radius: 14px !important;
  box-shadow: var(--jlpt-soft) !important;
}
.today-plan-card { border-radius: 0 0 0 0; background: linear-gradient(135deg, #0874ff, #0059ee) !important; }
.quick-start-home button { box-shadow: none !important; }
.home-side-card { display: grid; gap: 18px; }
.home-side-card > h3 { margin-bottom: 0 !important; }
.home-recent-list, .home-streak-card { border-top: 1px solid #edf2f7; padding-top: 16px; }
.home-recent-list h4, .home-streak-card h4 { margin: 0 0 12px; font-size: 18px; }
.home-recent-item { display: grid; grid-template-columns: 34px 1fr auto; gap: 12px; align-items: center; padding: 10px 0; color: #475569; font-weight: 700; }
.home-recent-item i { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: #eef5ff; color: var(--jlpt-blue); font-style: normal; font-weight: 950; }
.home-recent-item b { color: #111827; }
.home-recent-item small { color: #94a3b8; }
.home-streak-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; }
.home-streak-days span { height: 30px; border-radius: 999px; display: grid; place-items: center; background: #eef2f7; color: #94a3b8; font-weight: 900; }
.home-streak-days span.done { background: #20c463; color: #fff; }

/* Practice layout */
.workspace {
  grid-template-columns: minmax(0, 1fr) 384px !important;
  gap: 22px !important;
  align-items: start !important;
}
.question-card, .explanation-card, .answer-sheet-card {
  border: 1px solid var(--jlpt-line) !important;
  border-radius: 14px !important;
  box-shadow: var(--jlpt-soft) !important;
  background: #fff !important;
}
.question-card { min-height: 0 !important; }
.question-head {
  min-height: 112px !important;
  padding: 24px 34px !important;
}
.question-progress-wrap { width: 100%; display: grid !important; grid-template-columns: auto minmax(220px, 1fr) auto; align-items: center; gap: 26px !important; }
.question-head h3 { min-width: 142px; font-size: 24px !important; }
.question-progress { width: 100% !important; max-width: none !important; height: 10px !important; }
.level-chip { color: var(--jlpt-blue) !important; background: #eef5ff !important; border-color: #bfd7ff !important; }
.prompt { font-weight: 650 !important; letter-spacing: .03em !important; }
.question-actions { grid-template-columns: 220px minmax(240px, 1fr) 220px !important; }
#revealBtn { display: none !important; }
#favoriteBtn { order: 4; }
#prevBtn { order: 1; }
#nextBtn { order: 2; }
#favoriteBtn { order: 3; }

/* Right rail cards */
.right-rail { gap: 18px !important; top: 112px !important; }
.explanation-card, .answer-sheet-card { padding: 24px 26px !important; }
.explanation-head h3, .sheet-head h3 { font-size: 22px !important; margin: 0; }
.info-icon { background: transparent !important; color: var(--jlpt-blue) !important; border: 2px solid var(--jlpt-blue); width: 24px !important; height: 24px !important; font-size: 0; }
.info-icon::after { content: "i"; font-size: 16px; font-weight: 950; }
.info-row { border-bottom: 1px solid #edf2f7; padding-bottom: 14px; margin-bottom: 14px !important; justify-content: space-between; }
.info-row span { min-width: auto !important; }
.mini-explain { border-top: 0 !important; background: #f8fafc; border-radius: 12px; padding: 14px 16px !important; }

/* Numeric question grid: no dates, no year labels */
.answer-sheet {
  display: grid !important;
  grid-template-columns: repeat(5, 1fr) !important;
  gap: 12px !important;
}
.sheet-btn.sheet-number-btn,
.sheet-btn.sheet-date-btn {
  width: 46px !important;
  height: 46px !important;
  min-width: 46px !important;
  border-radius: 999px !important;
  justify-self: center !important;
  display: grid !important;
  place-items: center !important;
  background: #fff !important;
  border: 1.5px solid #dce5f0 !important;
  color: #111827 !important;
  font-size: 17px !important;
  font-weight: 850 !important;
}
.sheet-btn.sheet-number-btn.current,
.sheet-btn.sheet-date-btn.current {
  background: var(--jlpt-blue) !important;
  color: #fff !important;
  border-color: var(--jlpt-blue) !important;
  box-shadow: 0 8px 18px rgba(11,111,255,.28) !important;
}
.sheet-btn.sheet-number-btn.answered:not(.current) { color: #16a34a !important; border-color: #bbf7d0 !important; }
.sheet-btn.sheet-number-btn.wrong:not(.current) { color: #ef4444 !important; border-color: #fecaca !important; background: #fff8f8 !important; }
.sheet-legend { border-top: 1px solid #edf2f7; padding-top: 16px; }
.wrongbook-link { border-color: #fecaca !important; background: #fff !important; }

@media (max-width: 1180px) {
  .home-layout { grid-template-columns: 1fr !important; }
  .workspace { grid-template-columns: 1fr !important; }
  .right-rail { position: static !important; grid-template-columns: 1fr 1fr; }
}

@media (max-width: 760px) {
  .sidebar { min-height: 74px !important; padding: 0 16px !important; display: flex !important; justify-content: space-between !important; }
  .brand-mark { width: 44px !important; height: 44px !important; }
  .brand h1 { font-size: 18px !important; }
  .brand p { font-size: 12px !important; }
  .side-nav { display: none !important; }
  .main { width: 100% !important; padding: 14px 10px 88px !important; }
  .level-grid-home { grid-template-columns: 1fr 1fr !important; gap: 12px !important; }
  .home-layout { gap: 12px !important; }
  .workspace { gap: 12px !important; }
  .question-head { min-height: 78px !important; padding: 16px !important; }
  .question-progress-wrap { grid-template-columns: auto 1fr auto; gap: 12px !important; }
  .question-head h3 { min-width: 92px; font-size: 16px !important; }
  .question-actions { grid-template-columns: 1fr 1fr !important; }
  #nextBtn { grid-column: 1 / -1; order: -1; }
  .right-rail { grid-template-columns: 1fr; }
  .answer-sheet { grid-template-columns: repeat(5, 1fr) !important; gap: 9px !important; }
  .sheet-btn.sheet-number-btn { width: 38px !important; height: 38px !important; min-width: 38px !important; font-size: 14px !important; }
}
