:root {
  --n1-bg: #11130f;
  --n1-surface: #191b17;
  --n1-surface-2: #23271f;
  --n1-ink: #f1efe8;
  --n1-body: #bec2b9;
  --n1-muted: #8f978b;
  --n1-rule: #30342d;
  --n1-rule-strong: #50564c;
  --n1-accent: #ff8a4c;
  --n1-accent-strong: #e65312;
  --n1-accent-soft: #342116;
  --n1-brand: #8e9cff;
  --n1-success: #75d7a0;
  --n1-success-soft: #173126;
  --n1-orange: #ff8a4c;
  --n1-font: var(--font-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif);
  --n1-jp-sans: var(--font-jp-sans, "Hiragino Sans", "Yu Gothic UI", "Yu Gothic", Meiryo, sans-serif);
  --n1-jp-serif: var(--font-jp-serif, "Hiragino Mincho ProN", "Yu Mincho", YuMincho, serif);
  --n1-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

:root[data-theme="light"] {
  --n1-bg: #fbfaf6;
  --n1-surface: #fbfaf6;
  --n1-surface-2: #e9e6dd;
  --n1-ink: #1d211e;
  --n1-body: #505750;
  --n1-muted: #697169;
  --n1-rule: #d9d5cb;
  --n1-rule-strong: #bbb8ad;
  --n1-accent: #b44518;
  --n1-accent-strong: #e65312;
  --n1-accent-soft: #fff2eb;
  --n1-brand: #4657d8;
  --n1-success: #237447;
  --n1-success-soft: #eaf6ef;
  --n1-orange: #b44518;
}

* { box-sizing: border-box; }
html { background: var(--n1-bg); color-scheme: dark; }
html[data-theme="light"] { color-scheme: light; }
body { margin: 0; background: var(--n1-bg); color: var(--n1-ink); font-family: var(--n1-font); font-size: 16px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
.main .lh-dashboard { --accent: var(--n1-accent); color: var(--n1-ink); }
button, a { font: inherit; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--n1-accent); outline-offset: 3px; }
.skip-link { position: fixed; top: -60px; left: 12px; z-index: 100; background: var(--n1-accent); color: #11130f; padding: 10px 14px; }
.skip-link:focus { top: 12px; }

.n1-shell { min-height: 100vh; display: grid; grid-template-columns: 240px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; border-right: 1px solid var(--n1-rule); background: var(--n1-bg); }
.sidebar-head { min-height: 92px; display: flex; align-items: center; justify-content: space-between; padding: 0 32px; }
.brand { display: inline-flex; align-items: center; gap: 9px; font-size: 22px; font-weight: 700; letter-spacing: -.035em; }
.brand-mark { color: var(--n1-brand); font: 700 17px/1 var(--n1-mono); letter-spacing: -.08em; }
.brand-dot { color: var(--n1-brand); }
.sidebar-actions { display: flex; align-items: center; gap: 8px; }
.mobile-menu { display: none; width: 38px; height: 38px; border: 1px solid var(--n1-rule); background: transparent; cursor: pointer; }
.sidebar-body { min-height: 0; display: flex; flex: 1; flex-direction: column; }
.primary-nav { display: grid; gap: 3px; padding: 16px 12px; }
.nav-item { position: relative; min-height: 48px; display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; align-items: center; gap: 12px; width: 100%; border: 0; border-radius: 4px; background: transparent; padding: 0 18px; color: var(--n1-body); text-align: left; cursor: pointer; }
.nav-item::before { content: ""; position: absolute; inset: 6px auto 6px -12px; width: 3px; background: transparent; }
.nav-item i { width: 20px; color: var(--n1-muted); text-align: center; }
.nav-item small { min-width: 20px; color: var(--n1-muted); font: 500 13px/1 var(--n1-mono); text-align: right; }
.nav-item:hover { color: var(--n1-ink); background: color-mix(in srgb, var(--n1-surface) 50%, transparent); }
.nav-item.is-active { background: color-mix(in srgb, var(--n1-accent-soft) 68%, transparent); color: var(--n1-accent); }
.nav-item.is-active::before { background: var(--n1-accent); }
.nav-item.is-active i { color: var(--n1-accent); }
.nav-item .wrong-count:not(:empty) { color: var(--n1-orange); }
.sidebar-foot { margin-top: auto; display: grid; gap: 14px; padding: 24px 28px 26px; }
.data-note { display: grid; gap: 3px; border-top: 1px solid var(--n1-rule); padding-top: 18px; color: var(--n1-muted); font-size: 11px; }
.data-note strong { color: var(--n1-body); font-size: 12px; font-weight: 600; }
.copyright-note { margin: 0; color: var(--n1-muted); font-size: 10px; line-height: 1.5; }
.back-apps { min-height: 42px; display: flex; align-items: center; gap: 10px; border: 1px solid var(--n1-rule); background: var(--n1-surface); padding: 0 12px; color: var(--n1-body); font-size: 12px; }
.back-apps i { transform: rotate(180deg); }
.theme-toggle { width: 38px; height: 38px; display: grid; place-items: center; flex: 0 0 38px; border: 1px solid var(--n1-rule); background: var(--n1-surface); color: var(--n1-body); font-size: 15px; cursor: pointer; }
.theme-toggle:hover { border-color: var(--n1-rule-strong); color: var(--n1-ink); }

.main { min-width: 0; padding: 46px clamp(34px, 4.3vw, 66px) 54px; }
.view { width: min(1160px, 100%); margin: 0 auto; }
.view-header { display: grid; grid-template-columns: minmax(0, 1fr) minmax(290px, 360px); gap: 44px; align-items: end; border-bottom: 1px solid var(--n1-rule); padding-bottom: 34px; }
.eyebrow { margin: 0 0 14px; color: var(--n1-accent); font: 650 12px/1.4 var(--n1-mono); letter-spacing: .055em; text-transform: uppercase; }
.view-title { margin: 0; color: var(--n1-ink); font-size: clamp(42px, 4.1vw, 58px); line-height: 1.08; font-weight: 700; letter-spacing: -.025em; }
.view-lead { max-width: 600px; margin: 18px 0 0; color: var(--n1-body); font-size: 15px; line-height: 1.7; }
.progress-panel { align-self: stretch; display: grid; grid-template-columns: 100px 1fr; align-content: end; gap: 6px 24px; }
.progress-copy span { color: var(--n1-body); font-size: 11px; }
.progress-copy strong { display: block; margin-top: 1px; color: var(--n1-accent); font: 650 32px/1.1 var(--n1-mono); }
.progress-track { align-self: center; height: 7px; overflow: hidden; background: var(--n1-surface-2); }
.progress-fill { display: block; height: 100%; background: var(--n1-accent-strong); transition: width .25s ease; }
.progress-detail { grid-column: 2; color: var(--n1-muted); font-size: 11px; }
.primary-action { grid-column: 1 / -1; min-width: 280px; min-height: 52px; display: inline-flex; align-items: center; justify-content: space-between; gap: 20px; justify-self: end; margin-top: 15px; border: 1px solid var(--n1-accent-strong); background: var(--n1-accent-strong); color: #fff; padding: 0 20px; font-size: 14px; font-weight: 600; }
.primary-action:hover { filter: brightness(1.08); }

.view-tabs { display: flex; gap: 42px; border-bottom: 1px solid var(--n1-rule); }
.view-tab { position: relative; min-height: 66px; border: 0; background: transparent; padding: 0; color: var(--n1-body); cursor: pointer; }
.view-tab::after { content: ""; position: absolute; right: 0; bottom: -1px; left: 0; height: 2px; background: transparent; }
.view-tab:hover { color: var(--n1-ink); }
.view-tab.is-active { color: var(--n1-accent); }
.view-tab.is-active::after { background: var(--n1-accent); }

.module-list { border-bottom: 1px solid var(--n1-rule); }
.module-row { position: relative; min-height: 128px; display: grid; grid-template-columns: 64px 64px minmax(0, 1fr) 170px 34px; align-items: center; gap: 22px; border-bottom: 1px solid var(--n1-rule); color: inherit; }
.module-row:last-child { border-bottom: 0; }
.module-row::before { content: ""; position: absolute; top: 0; bottom: 0; left: -12px; width: 3px; background: transparent; }
.module-row.is-current::before { background: var(--n1-accent-strong); }
.module-index { color: var(--n1-body); font: 500 32px/1 var(--n1-mono); letter-spacing: -.06em; }
.module-row.is-current .module-index { color: var(--n1-accent); }
.module-icon { width: 58px; height: 58px; display: grid; place-items: center; border: 1px solid var(--n1-rule-strong); color: var(--n1-body); font-size: 20px; }
.module-row.is-current .module-icon { border-color: var(--n1-accent); color: var(--n1-accent); }
.module-copy h2 { margin: 0; color: var(--n1-ink); font-size: 20px; font-weight: 600; letter-spacing: -.015em; }
.module-row.is-current .module-copy h2 { color: var(--n1-accent); }
.module-copy p { margin: 6px 0 0; color: var(--n1-muted); font-size: 13px; }
.module-state { color: var(--n1-muted); font-size: 12px; }
.module-state strong { display: block; color: var(--n1-body); font-weight: 550; }
.module-state.is-complete strong { color: var(--n1-success); }
.row-action { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 10px; border: 1px solid var(--n1-accent); color: var(--n1-accent); padding: 0 16px; font-size: 13px; font-weight: 600; }
.row-arrow { color: var(--n1-muted); text-align: right; }
.module-row:hover .row-arrow { color: var(--n1-accent); }

.support-section { border-bottom: 1px solid var(--n1-rule); padding: 30px 0 14px; }
.support-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 14px; }
.support-head h2 { margin: 0; font-size: 17px; font-weight: 600; }
.support-head button { border: 0; background: transparent; color: var(--n1-accent); font-size: 13px; cursor: pointer; }
.support-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.support-link { min-height: 76px; display: grid; grid-template-columns: 44px minmax(0, 1fr) 24px; align-items: center; gap: 14px; border-top: 1px solid var(--n1-rule); padding: 0 14px 0 0; }
.support-link + .support-link { border-left: 1px solid var(--n1-rule); padding-left: 24px; }
.support-link > i:first-child { width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid var(--n1-rule); color: var(--n1-muted); }
.support-link strong { display: block; color: var(--n1-accent); font-size: 14px; }
.support-link small { display: block; margin-top: 2px; color: var(--n1-muted); font-size: 11px; }
.exam-row { min-height: 80px; display: grid; grid-template-columns: 44px minmax(0, 1fr) 24px; align-items: center; gap: 14px; border-bottom: 1px solid var(--n1-rule); }
.exam-row > i:first-child { width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid var(--n1-rule); color: var(--n1-muted); }
.exam-row strong { display: block; font-size: 16px; }
.exam-row small { color: var(--n1-muted); font-size: 11px; }

.overview-list { border-top: 1px solid var(--n1-rule); margin-top: 32px; }
.track-row { display: grid; grid-template-columns: 64px 200px minmax(0, 1fr) 150px; gap: 24px; align-items: center; border-bottom: 1px solid var(--n1-rule); padding: 28px 0; }
.track-row { width: 100%; border-width: 0 0 1px; border-color: var(--n1-rule); background: transparent; color: inherit; text-align: left; cursor: pointer; }
.track-row:hover { background: color-mix(in srgb, var(--n1-surface) 45%, transparent); }
.track-num { color: var(--n1-accent); font: 550 30px/1 var(--n1-mono); }
.track-title strong { display: block; font-size: 19px; }
.track-title small { color: var(--n1-muted); }
.track-modules { color: var(--n1-body); font-size: 13px; line-height: 1.8; }
.track-progress { text-align: right; }
.track-progress strong { color: var(--n1-accent); font: 600 20px/1 var(--n1-mono); }
.track-progress span { display: block; margin-top: 5px; color: var(--n1-muted); font-size: 11px; }
.empty-view { max-width: 720px; border-top: 1px solid var(--n1-rule); margin-top: 32px; padding: 32px 0; }
.simple-header { grid-template-columns: 1fr; border-bottom: 0; padding-bottom: 0; }
.simple-view .empty-view { margin-top: 28px; }
.empty-view h2 { margin: 0 0 8px; font-size: 22px; }
.empty-view p { margin: 0; color: var(--n1-body); }
.empty-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.empty-actions button, .empty-actions a { min-height: 44px; display: inline-flex; align-items: center; border: 1px solid var(--n1-rule-strong); background: transparent; padding: 0 16px; color: var(--n1-body); cursor: pointer; }
.empty-actions button:hover, .empty-actions a:hover { border-color: var(--n1-accent); color: var(--n1-accent); }

.quiz-setup { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, .75fr); gap: 38px 56px; border-top: 1px solid var(--n1-rule); margin-top: 34px; padding-top: 32px; }
.setup-label { display: block; margin-bottom: 13px; color: var(--n1-muted); font: 650 11px/1.4 var(--n1-mono); letter-spacing: .05em; text-transform: uppercase; }
.quiz-sizes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.quiz-size { min-height: 84px; display: grid; place-content: center; border: 1px solid var(--n1-rule-strong); background: transparent; color: var(--n1-body); cursor: pointer; }
.quiz-size strong { font: 650 26px/1 var(--n1-mono); }
.quiz-size span { margin-top: 7px; color: var(--n1-muted); font-size: 11px; }
.quiz-size.is-active { border-color: var(--n1-accent); background: var(--n1-accent-soft); color: var(--n1-accent); }
.quiz-size.is-active span { color: inherit; }
.quiz-rules { display: grid; align-content: start; gap: 14px; border-left: 1px solid var(--n1-rule); padding-left: 28px; }
.quiz-rules > span { display: grid; grid-template-columns: 24px 1fr; align-items: center; gap: 8px; color: var(--n1-body); font-size: 13px; }
.quiz-rules > span > span { display: block; }
.quiz-rules i { color: var(--n1-accent); }
.quiz-rules strong { display: inline; margin-right: 4px; color: var(--n1-ink); font-weight: 600; }
.quiz-start { grid-column: 1 / -1; justify-self: start; margin-top: 0; }
.quiz-topline { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 20px; color: var(--n1-muted); font-size: 12px; }
.quiz-topline button { justify-self: start; border: 0; background: transparent; padding: 0; color: var(--n1-body); cursor: pointer; }
.quiz-topline #quizTimer { justify-self: end; color: var(--n1-accent); font: 650 22px/1 var(--n1-mono); }
.quiz-status { display: grid; gap: 2px; justify-items: center; }
.quiz-status strong { color: var(--n1-accent); font: 650 12px/1.25 var(--n1-mono); }
.quiz-timer-track { height: 3px; margin-top: 14px; background: var(--n1-rule); }
.quiz-timer-track span { display: block; height: 100%; background: var(--n1-accent); transition: width 1s linear; }
.quiz-card { width: min(780px, 100%); margin: 58px auto 0; }
.quiz-card h1 { margin: 0 0 32px; color: var(--n1-ink); font-size: clamp(26px, 3vw, 38px); font-weight: 560; line-height: 1.7; letter-spacing: -.025em; }
.quiz-options { display: grid; gap: 10px; }
.quiz-option { min-height: 64px; display: grid; grid-template-columns: 46px minmax(0, 1fr); align-items: center; gap: 14px; border: 1px solid var(--n1-rule); background: transparent; padding: 8px 16px 8px 8px; color: var(--n1-ink); text-align: left; cursor: pointer; }
.quiz-option:hover:not(:disabled) { border-color: var(--n1-accent); background: color-mix(in srgb, var(--n1-accent-soft) 60%, transparent); }
.quiz-option > span { min-height: 46px; display: grid; place-items: center; background: var(--n1-surface-2); color: var(--n1-body); font: 650 13px/1 var(--n1-mono); }
.quiz-option strong { font-weight: 540; }
.quiz-option.is-correct { border-color: var(--n1-success); color: var(--n1-success); }
.quiz-option.is-wrong { border-color: #d95555; color: #d95555; }
.quiz-feedback { margin-top: 18px; border-left: 3px solid var(--n1-success); background: var(--n1-success-soft); padding: 16px 18px; }
.quiz-feedback.is-wrong { border-left-color: #d95555; background: color-mix(in srgb, #d95555 9%, var(--n1-surface)); }
.quiz-feedback strong { display: block; margin-bottom: 5px; }
.quiz-feedback p { margin: 3px 0 0; color: var(--n1-body); font-size: 13px; }
.quiz-next { justify-self: start; margin-top: 20px; }

@media (max-width: 1040px) {
  .n1-shell { grid-template-columns: 230px minmax(0, 1fr); }
  .sidebar-head { padding-inline: 22px; }
  .main { padding-inline: 32px; }
  .view-header { grid-template-columns: minmax(0, 1fr) 300px; gap: 28px; }
  .module-row { grid-template-columns: 54px 56px minmax(0, 1fr) 130px 24px; gap: 16px; }
  .track-row { grid-template-columns: 52px 160px minmax(0, 1fr) 120px; }
}

@media (max-width: 820px) {
  .n1-shell { display: block; }
  .sidebar { position: relative; height: auto; border-right: 0; border-bottom: 1px solid var(--n1-rule); }
  .sidebar-head { min-height: 66px; padding-inline: 18px; }
  .mobile-menu { display: grid; place-items: center; }
  .sidebar-body { display: none; }
  .sidebar-body.is-open { display: flex; }
  .primary-nav { grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 8px 12px 14px; }
  .nav-item { min-height: 46px; }
  .nav-item::before { inset: auto 12px 0; width: auto; height: 2px; }
  .sidebar-foot { gap: 10px; margin-top: 0; border-top: 1px solid var(--n1-rule); padding: 14px 18px 18px; }
  .sidebar-foot .data-note { display: none; }
  .back-apps { min-height: 44px; }
  .main { padding: 34px 24px 48px; }
  .view-header { grid-template-columns: 1fr; align-items: start; }
  .progress-panel { grid-template-columns: 90px minmax(0, 1fr); max-width: 460px; }
  .primary-action { width: 100%; justify-self: stretch; }
  .view-title { font-size: 44px; }
  .module-row { grid-template-columns: 46px 48px minmax(0, 1fr) 20px; min-height: 112px; gap: 13px; }
  .module-icon { width: 46px; height: 46px; }
  .module-state { display: none; }
  .row-action { display: none; }
  .track-row { grid-template-columns: 42px minmax(0, 1fr) 90px; gap: 16px; }
  .track-modules { grid-column: 2 / -1; }
  .quiz-setup { grid-template-columns: 1fr; }
  .quiz-rules { border-left: 0; border-top: 1px solid var(--n1-rule); padding: 24px 0 0; }
}

@media (max-width: 520px) {
  .main { padding: 28px 18px 42px; }
  .primary-nav { gap: 2px 8px; }
  .nav-item { grid-template-columns: 24px minmax(0, 1fr) auto; gap: 6px; padding-inline: 10px; font-size: 14px; }
  .nav-item span { white-space: nowrap; }
  .view-title { font-size: 38px; }
  .view-lead { font-size: 14px; }
  .view-tabs { gap: 24px; overflow-x: auto; }
  .view-tab { flex: 0 0 auto; min-height: 58px; font-size: 14px; }
  .module-row { grid-template-columns: 38px 44px minmax(0, 1fr) 18px; gap: 10px; }
  .module-index { font-size: 24px; }
  .module-icon { width: 42px; height: 42px; font-size: 16px; }
  .module-copy h2 { font-size: 17px; }
  .module-copy p { font-size: 12px; }
  .support-grid { grid-template-columns: 1fr; }
  .support-link + .support-link { border-left: 0; padding-left: 0; }
  .track-row { grid-template-columns: 38px minmax(0, 1fr); }
  .track-progress { grid-column: 2; text-align: left; }
}
