:root {
  color-scheme: light;
  --paper: #f5f2ec;
  --paper-deep: #ebe6dd;
  --ink: #252724;
  --muted: #77756d;
  --line: #ded9cf;
  --line-strong: #cbc4b7;
  --white: #fffdf9;
  --sage: #657b6d;
  --sage-light: #e4ebe4;
  --terracotta: #b96f54;
  --terracotta-light: #f2e0d8;
  --blue: #59758b;
  --blue-light: #e3ebf0;
  --gold: #a98543;
  --shadow: 0 18px 45px rgba(52, 49, 42, .07);
  font-family: "Yu Gothic", "Hiragino Kaku Gothic ProN", Meiryo, system-ui, sans-serif;
  background: var(--paper);
  color: var(--ink);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--paper); }
body { margin: 0; min-height: 100vh; background: var(--paper); }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 3px solid rgba(89, 117, 139, .3); outline-offset: 2px; }

.app-shell { display: grid; grid-template-columns: 250px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 30px 20px 24px; background: #eeeae2; border-right: 1px solid var(--line); display: flex; flex-direction: column; }
.brand { display: flex; align-items: center; gap: 11px; padding: 0 8px; }
.brand-mark { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px; background: var(--ink); color: var(--paper); font: 700 12px/1 Georgia, serif; letter-spacing: .04em; }
.brand strong { display: block; font: 600 14px/1.2 Georgia, "Yu Mincho", serif; letter-spacing: -.01em; }
.brand small { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; letter-spacing: .02em; }
.sidebar-rule { height: 1px; margin: 28px 8px 18px; background: var(--line); }
.nav-list { display: grid; gap: 5px; }
.nav-item { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 11px 12px; border: 1px solid transparent; border-radius: 9px; background: transparent; color: var(--muted); text-align: left; transition: background .16s ease, color .16s ease, border-color .16s ease; }
.nav-item span { font-size: 13px; font-weight: 600; }
.nav-item small { font-size: 10px; }
.nav-item:hover { color: var(--ink); background: rgba(255, 253, 249, .55); }
.nav-item.is-active { color: var(--ink); background: var(--white); border-color: var(--line); box-shadow: 0 3px 12px rgba(52, 49, 42, .04); }
.sidebar-footer { margin-top: auto; padding: 18px 8px 0; color: var(--muted); font-size: 11px; line-height: 1.7; }
.sidebar-footer p { margin: 0 0 8px; color: var(--ink); font-family: Georgia, "Yu Mincho", serif; }
.sidebar-footer span { font-size: 10px; }

.main-content { min-width: 0; }
.topbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; max-width: 1180px; margin: 0 auto; padding: 46px 54px 22px; }
.topbar-kicker, .eyebrow { margin: 0 0 9px; color: var(--sage); font-size: 10px; font-weight: 700; letter-spacing: .16em; line-height: 1.3; text-transform: uppercase; }
.topbar h1 { margin: 0; font: 400 clamp(30px, 3.2vw, 44px)/1.08 Georgia, "Yu Mincho", serif; letter-spacing: -.035em; }
.page-content { max-width: 1180px; margin: 0 auto; padding: 0 54px 70px; }
.notice { max-width: 1180px; margin: 0 auto 18px; padding: 11px 54px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.notice.success { color: #4f6b59; background: rgba(228, 235, 228, .45); }
.notice.error { color: #9b5947; background: rgba(242, 224, 216, .5); }

.button { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 9px 16px; border: 1px solid var(--line-strong); border-radius: 7px; background: var(--white); color: var(--ink); font-size: 12px; font-weight: 700; letter-spacing: .01em; text-decoration: none; transition: border-color .16s ease, background .16s ease, transform .16s ease; }
.button:hover { border-color: var(--ink); transform: translateY(-1px); }
.button-primary { border-color: var(--ink); background: var(--ink); color: var(--white); }
.button-primary:hover { background: #3d403a; border-color: #3d403a; }
.button-secondary { background: transparent; }
.button-danger { border-color: #c9927f; background: var(--terracotta-light); color: #8e4f3c; }
.text-button { min-height: 28px; padding: 4px 0; border: 0; background: transparent; color: var(--sage); font-size: 12px; font-weight: 700; }
.text-button:hover { color: var(--ink); }
.text-button.danger { color: var(--terracotta); }
.topbar-actions, .inline-actions, .practice-actions, .settings-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; }

.hero-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 18px; }
.hero-copy { min-height: 312px; padding: 37px 39px; border: 1px solid #d3cbbd; border-radius: 12px; background: #e8e3d9; }
.hero-copy h2 { margin: 0 0 16px; font: 400 clamp(31px, 4vw, 54px)/1.08 Georgia, "Yu Mincho", serif; letter-spacing: -.045em; }
.hero-copy h2 em { color: var(--sage); font-style: normal; }
.hero-copy p:not(.eyebrow) { max-width: 390px; margin: 0 0 27px; color: #66665e; font-size: 13px; line-height: 1.9; }
.today-note { min-height: 312px; padding: 32px; border: 1px solid var(--line); border-radius: 12px; background: var(--white); display: flex; flex-direction: column; justify-content: center; box-shadow: var(--shadow); }
.note-label, .label { display: block; color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.focus-english, .practice-english { margin: 15px 0 11px; color: var(--ink); font: 400 25px/1.35 Georgia, "Yu Mincho", serif; }
.today-note > p:not(.focus-english):not(.focus-empty) { margin: 0 0 24px; color: var(--muted); font-size: 13px; line-height: 1.7; }
.focus-empty { margin: 18px 0 24px; color: var(--muted); font-size: 13px; line-height: 1.8; }
.metrics-strip { display: grid; grid-template-columns: repeat(4, 1fr); margin: 18px 0 50px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.metric { min-height: 111px; padding: 21px 22px; border-right: 1px solid var(--line); }
.metric:last-child { border-right: 0; }
.metric span, .metric small { display: block; color: var(--muted); font-size: 10px; }
.metric strong { display: block; margin: 7px 0 5px; font: 400 27px/1 Georgia, "Yu Mincho", serif; }
.metric small { line-height: 1.5; }
.section-block { margin-top: 44px; }
.section-heading, .panel-heading, .toolbar, .detail-header, .reading-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.section-heading { align-items: flex-end; margin-bottom: 14px; }
.section-heading h2 { margin: 0; font: 400 26px/1.2 Georgia, "Yu Mincho", serif; letter-spacing: -.025em; }
.moment-list, .list-panel, .review-map { border-top: 1px solid var(--line); }
.moment-row, .review-row { display: flex; align-items: center; justify-content: space-between; width: 100%; gap: 18px; padding: 18px 3px 18px 0; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: var(--ink); text-align: left; }
.moment-row:hover, .review-row:hover { background: rgba(255, 253, 249, .5); }
.moment-row-main, .review-row > div { min-width: 0; }
.moment-type { display: block; margin-bottom: 5px; color: var(--sage); font-size: 10px; font-weight: 700; letter-spacing: .04em; }
.moment-row strong, .review-row strong { display: block; overflow: hidden; font-size: 14px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.moment-row small, .review-row small { display: block; margin-top: 7px; color: var(--muted); font-size: 11px; }
.moment-row-side { display: flex; align-items: center; flex: none; gap: 10px; }
.chevron { color: var(--sage); font-size: 17px; }
.mastery-mini { color: var(--muted); font-size: 10px; }
.status-captured { background: #ece8e0; color: #77746b; }
.status-analyzed { background: var(--blue-light); color: #557387; }
.status-practicing { background: #e9e3f0; color: #706182; }
.status-transferred, .independent { background: var(--sage-light); color: #55705e; }
.status-archived { background: #e5e5e2; color: #6e706b; }
.tag { display: inline-flex; align-items: center; min-height: 22px; padding: 3px 8px; border-radius: 5px; background: var(--paper-deep); color: var(--muted); font-size: 10px; font-weight: 700; white-space: nowrap; }
.tag.issue { background: var(--blue-light); color: var(--blue); }
.tag.priority { background: var(--terracotta-light); color: #9a5c48; }
.tag.support { background: #ece7f0; color: #706080; }
.tag.mastery { background: var(--sage-light); color: #55705e; }
.tag.due { background: var(--terracotta-light); color: #9a5c48; }
.tag.scheduled { background: var(--paper-deep); color: var(--muted); }
.tag.with_support { background: #e8e3ef; color: #706080; }
.tag.unsuccessful { background: var(--terracotta-light); color: #9a5c48; }
.two-column { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 18px; }
.quiet-panel { padding: 25px 27px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255, 253, 249, .45); }
.quiet-panel h3, .panel h3 { margin: 0 0 9px; font: 400 20px/1.35 Georgia, "Yu Mincho", serif; }
.quiet-panel p:not(.eyebrow), .panel p:not(.eyebrow) { color: var(--muted); font-size: 12px; line-height: 1.8; }
.loop-line { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 20px 0 15px; color: var(--ink); font-size: 11px; font-weight: 700; }
.loop-line span { padding: 7px 9px; border: 1px solid var(--line-strong); border-radius: 5px; background: var(--white); }
.loop-line i { color: var(--sage); font-style: normal; }

.toolbar { align-items: center; margin-bottom: 28px; }
.toolbar-copy { margin: 0; color: var(--muted); font-size: 13px; }
.toolbar-stat { display: flex; align-items: baseline; gap: 8px; color: var(--muted); }
.toolbar-stat strong { color: var(--ink); font: 400 38px/1 Georgia, "Yu Mincho", serif; }
.toolbar-stat span { font-size: 10px; text-transform: uppercase; letter-spacing: .1em; }
.list-panel-head { display: flex; justify-content: space-between; padding: 12px 3px; color: var(--muted); font-size: 10px; }
.empty-state { padding: 70px 20px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); text-align: center; }
.empty-state h2 { margin: 0 0 12px; font: 400 28px/1.2 Georgia, "Yu Mincho", serif; }
.empty-state p:not(.eyebrow) { max-width: 460px; margin: 0 auto 22px; color: var(--muted); font-size: 13px; line-height: 1.9; }

.detail-back { margin-bottom: 23px; }
.detail-header { align-items: flex-start; margin-bottom: 27px; }
.detail-header h2, .reading-header h2, .practice-header h2, .insight-hero h2 { max-width: 790px; margin: 0 0 11px; font: 400 clamp(27px, 3.2vw, 42px)/1.2 Georgia, "Yu Mincho", serif; letter-spacing: -.035em; }
.muted, .fine-print { color: var(--muted); font-size: 11px; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 285px; align-items: start; gap: 19px; }
.detail-main, .detail-aside { display: grid; gap: 18px; }
.panel, .side-card { padding: 27px; border: 1px solid var(--line); border-radius: 10px; background: var(--white); box-shadow: 0 8px 26px rgba(52, 49, 42, .035); }
.analysis-placeholder { min-height: 260px; display: flex; flex-direction: column; justify-content: center; }
.analysis-placeholder h3 { margin-top: 0; }
.analysis-placeholder .fine-print { margin-top: 19px; }
.panel-heading { align-items: center; margin-bottom: 19px; }
.panel-heading h3 { margin-bottom: 0; }
.expression-hero { padding: 18px 20px; border-left: 3px solid var(--sage); background: #f1f4ef; }
.expression-hero p { margin: 7px 0 0; color: var(--ink) !important; font: 400 25px/1.42 Georgia, "Yu Mincho", serif; }
.expression-trio { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 13px; }
.expression-trio > div { padding: 14px; border: 1px solid var(--line); border-radius: 7px; }
.expression-trio p { margin: 8px 0 0; color: var(--ink) !important; font: 400 14px/1.5 Georgia, "Yu Mincho", serif; }
.issue-line { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; }
.explanation-list { margin-top: 21px; padding-top: 18px; border-top: 1px solid var(--line); }
.explanation-list > div { display: grid; grid-template-columns: 23px 1fr; gap: 9px; align-items: start; }
.explanation-list span { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--paper-deep); color: var(--muted); font-size: 10px; }
.explanation-list p { margin: 0 0 11px; }
.panel-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.practice-panel { background: #fbfaf6; }
.practice-english { margin: 12px 0 4px; font-size: 23px; }
.practice-panel > p:not(.eyebrow):not(.practice-english) { margin-top: 0; }
.practice-actions { margin-top: 20px; }
.side-card h3 { margin: 0 0 10px; font: 400 17px/1.4 Georgia, "Yu Mincho", serif; }
.data-list { margin: 19px 0 0; }
.data-list div { display: flex; justify-content: space-between; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.data-list dt { color: var(--muted); font-size: 11px; }
.data-list dd { margin: 0; color: var(--ink); font-size: 11px; text-align: right; }
.mastery-rail { display: grid; gap: 8px; margin: 20px 0 12px; }
.mastery-rail span { display: grid; grid-template-columns: 12px 1fr; align-items: center; gap: 8px; color: #b5b2aa; }
.mastery-rail i { width: 8px; height: 8px; border-radius: 50%; background: #d5d1c8; }
.mastery-rail span.is-done { color: var(--sage); }
.mastery-rail span.is-done i { background: var(--sage); }
.recording-status { margin: 15px 0 12px; padding: 9px 10px; border-radius: 5px; background: var(--paper); color: var(--muted); font-size: 11px; }
.recording-card p:not(.eyebrow) { margin: 0; }
.compact-form { display: grid; gap: 15px; }
.compact-form label, .practice-form label { display: grid; gap: 7px; color: var(--muted); font-size: 11px; font-weight: 700; }
input, textarea, select { width: 100%; border: 1px solid var(--line-strong); border-radius: 6px; background: #fffefa; color: var(--ink); padding: 10px 11px; font-size: 13px; }
textarea { min-height: 90px; resize: vertical; line-height: 1.7; }
input::placeholder, textarea::placeholder { color: #aaa69c; }
select { height: 40px; }
.compact-form .button { justify-self: start; }
.form-two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.transfer-panel > p { max-width: 720px; }
.evidence-list { display: grid; gap: 7px; margin-top: 18px; }
.evidence-item { padding: 12px 14px; border-left: 2px solid var(--sage); background: #f5f6f2; }
.evidence-item > span { margin-right: 8px; color: var(--muted); font-size: 10px; }
.evidence-item p { margin: 8px 0 0 !important; color: var(--ink) !important; }

.practice-header { max-width: 780px; margin-bottom: 28px; }
.practice-header > p:not(.eyebrow) { max-width: 600px; margin: 0; color: var(--muted); font-size: 14px; line-height: 1.8; }
.practice-stage { max-width: 780px; }
.prompt-card { padding: 20px 22px; border: 1px solid var(--line); border-radius: 8px; background: #e9e5dc; }
.hint-text { margin: 9px 0 13px; color: var(--ink); font: 400 18px/1.5 Georgia, "Yu Mincho", serif; }
details { color: var(--muted); font-size: 11px; }
details p { margin: 9px 0 0; color: var(--ink); font: 400 16px/1.5 Georgia, "Yu Mincho", serif; }
.practice-form { margin-top: 16px; padding: 23px; border: 1px solid var(--line); border-radius: 9px; background: var(--white); }
.practice-form textarea { min-height: 150px; margin-top: 2px; font-size: 16px; }
.practice-submit-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 13px; }
.result-card { margin-top: 16px; padding: 22px; border: 1px solid var(--line); border-radius: 9px; background: #f2f5ef; }
.result-card.retry { background: #f8eee9; }
.result-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.result-heading strong { font: 400 19px/1.3 Georgia, "Yu Mincho", serif; }
.result-heading > span { color: var(--sage); font: 400 22px/1 Georgia, "Yu Mincho", serif; }
.result-card p { margin: 11px 0 17px; }
.result-answer { padding: 13px 15px; border: 1px solid var(--line); background: var(--white); }
.result-answer span { display: block; color: var(--muted); font-size: 10px; }
.result-answer strong { display: block; margin-top: 5px; font: 400 17px/1.4 Georgia, "Yu Mincho", serif; }
.result-card .inline-actions { margin-top: 18px; }
.practice-note { max-width: 780px; margin-top: 22px; padding-top: 17px; border-top: 1px solid var(--line); }
.practice-note p:not(.eyebrow) { max-width: 650px; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.8; }
.review-map { display: grid; }
.review-map-row { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 15px 3px; border-bottom: 1px solid var(--line); }
.review-map-row strong, .review-map-row small { display: block; }
.review-map-row strong { font-size: 13px; }
.review-map-row small { margin-top: 5px; color: var(--muted); font-size: 10px; }

.article-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.article-card { min-height: 235px; padding: 25px; border: 1px solid var(--line); border-radius: 10px; background: var(--white); display: flex; flex-direction: column; }
.article-card h3 { margin: 0 0 12px; font: 400 22px/1.3 Georgia, "Yu Mincho", serif; }
.article-card > p:not(.eyebrow) { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.8; }
.article-meta { display: flex; gap: 12px; margin-top: auto; padding: 18px 0 14px; color: var(--muted); font-size: 10px; }
.form-panel { margin-bottom: 17px; }
.reading-header { align-items: flex-end; margin-bottom: 27px; }
.reading-header > div:first-child { max-width: 780px; }
.reading-header p:not(.eyebrow) { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.8; }
.reading-layout { display: grid; grid-template-columns: 1fr 1fr; align-items: start; gap: 18px; }
.script-card { padding: 29px; border: 1px solid #d1c7b8; border-radius: 10px; background: #eae4d9; }
.script-text { margin: 24px 0; white-space: pre-wrap; color: #2e302b; font: 400 20px/1.85 Georgia, "Yu Mincho", serif; }
.reading-controls { padding-top: 16px; border-top: 1px solid #d6cbbb; }
.reading-work { display: grid; gap: 16px; }
.reading-result .panel-heading { margin-bottom: 10px; }
.reading-score { color: var(--sage); font: 400 28px/1 Georgia, "Yu Mincho", serif; }
.finding-list { display: grid; gap: 7px; margin-top: 16px; }
.finding { display: grid; grid-template-columns: 85px 1fr; gap: 9px; padding: 10px; border-left: 2px solid var(--terracotta); background: #fbf3ee; }
.finding.match { border-color: var(--sage); background: #f1f5ef; }
.finding span { color: var(--muted); font-size: 10px; text-transform: uppercase; }
.finding p { margin: 0 !important; color: var(--ink) !important; font: 400 14px/1.5 Georgia, "Yu Mincho", serif; }
.match-note { color: var(--sage) !important; }
.focus-box { margin-top: 18px; padding: 15px; border: 1px solid var(--line); background: #faf9f4; }
.focus-box p { margin: 8px 0 14px !important; color: var(--ink) !important; font: 400 16px/1.5 Georgia, "Yu Mincho", serif; }
.saved-note { display: block; margin-top: 9px; color: var(--sage); font-size: 10px; }

.insight-hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 22px; margin-bottom: 33px; }
.insight-hero > div { max-width: 700px; }
.insight-hero p:not(.eyebrow) { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.85; }
.metrics-grid { display: grid; grid-template-columns: repeat(4, 1fr); margin-bottom: 18px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.metrics-grid .metric { padding-left: 0; }
.insight-columns { display: grid; grid-template-columns: .9fr 1.1fr; gap: 18px; }
.insight-list { display: grid; gap: 5px; margin-top: 20px; }
.insight-list > div { display: grid; grid-template-columns: 28px 1fr; gap: 10px; padding: 13px 0; border-top: 1px solid var(--line); }
.insight-list span { color: var(--sage); font: 400 14px Georgia, serif; }
.insight-list p { margin: 0 !important; color: var(--ink) !important; }
.learning-map { margin-top: 20px; border-top: 1px solid var(--line); }
.learning-map-row { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.learning-map-row strong, .learning-map-row small { display: block; }
.learning-map-row strong { font-size: 12px; }
.learning-map-row small { margin-top: 4px; color: var(--muted); font-size: 10px; }
.learning-map-row > div:last-child { flex: none; text-align: right; }
.big-number { color: var(--ink) !important; font: 400 42px/1 Georgia, "Yu Mincho", serif; }

.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.settings-grid .panel { min-height: 240px; }
.settings-grid h3 { margin-bottom: 13px; }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 26px; padding: 15px; border: 1px solid var(--line); border-radius: 7px; background: #faf9f5; }
.toggle-row strong, .toggle-row small { display: block; }
.toggle-row strong { font-size: 12px; }
.toggle-row small { margin-top: 5px; color: var(--muted); font-size: 10px; }
.toggle-row input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.toggle-row i { position: relative; flex: none; width: 38px; height: 22px; border-radius: 20px; background: #d0cbc1; }
.toggle-row i::after { position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--white); content: ""; transition: transform .16s ease; }
.toggle-row input:checked + i { background: var(--sage); }
.toggle-row input:checked + i::after { transform: translateX(16px); }
.settings-actions { margin-top: 24px; }
.architecture-note { margin-top: 18px; }
.architecture-note ul { margin: 15px 0 0; padding-left: 20px; color: var(--muted); font-size: 12px; line-height: 2; }

.modal-backdrop { position: fixed; z-index: 20; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(37, 39, 36, .34); }
.modal { width: min(620px, 100%); max-height: calc(100vh - 40px); overflow-y: auto; padding: 30px; border: 1px solid var(--line); border-radius: 12px; background: var(--white); box-shadow: 0 25px 80px rgba(37, 39, 36, .2); }
.modal-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.modal h2 { margin: 0; font: 400 28px/1.2 Georgia, "Yu Mincho", serif; }
.modal-copy { margin: 14px 0 23px; color: var(--muted); font-size: 12px; }

@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; padding: 16px 18px 11px; border-right: 0; border-bottom: 1px solid var(--line); }
  .sidebar-rule, .sidebar-footer { display: none; }
  .brand { padding: 0; }
  .nav-list { display: flex; overflow-x: auto; gap: 4px; margin-top: 15px; padding-bottom: 2px; }
  .nav-item { flex: 0 0 auto; display: block; padding: 8px 10px; }
  .nav-item small { display: none; }
  .topbar { padding: 31px 25px 19px; }
  .page-content { padding: 0 25px 55px; }
  .notice { padding: 10px 25px; }
  .hero-grid, .detail-grid, .reading-layout, .insight-columns, .settings-grid { grid-template-columns: 1fr; }
  .hero-copy, .today-note { min-height: auto; }
  .metrics-strip, .metrics-grid { grid-template-columns: repeat(2, 1fr); }
  .metrics-strip .metric:nth-child(2) { border-right: 0; }
  .metrics-strip .metric:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .metrics-grid .metric:nth-child(2) { border-right: 0; }
  .metrics-grid .metric:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .article-grid { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .topbar { align-items: flex-start; padding: 25px 17px 17px; }
  .topbar-actions { display: none; }
  .page-content { padding: 0 17px 45px; }
  .notice { padding: 10px 17px; }
  .hero-copy, .today-note, .panel, .side-card, .article-card, .script-card, .modal { padding: 21px; }
  .hero-copy h2 { font-size: 36px; }
  .section-heading, .toolbar, .detail-header, .reading-header, .insight-hero { display: block; }
  .section-heading .text-button, .toolbar .button, .detail-header .text-button, .insight-hero .button { margin-top: 13px; }
  .moment-row-side .mastery-mini { display: none; }
  .expression-trio, .form-two, .two-column { grid-template-columns: 1fr; }
  .metrics-strip, .metrics-grid { grid-template-columns: 1fr 1fr; }
  .metric { padding: 16px 13px; }
  .metric strong { font-size: 23px; }
  .practice-submit-row { display: block; }
  .practice-submit-row .button { margin-top: 12px; }
  .review-row { padding-right: 0; }
}

/* Apple Design refinement: clarity, deference, and quiet depth. */
:root {
  --ui-font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Hiragino Sans", "Yu Gothic UI", "Yu Gothic", Meiryo, system-ui, sans-serif;
  --display-font: Georgia, "Yu Mincho", "Hiragino Mincho ProN", serif;
  --line: #e2ded6;
  --line-strong: #c7c1b6;
  --shadow: 0 14px 36px rgba(52, 49, 42, .055);
  --focus-ring: rgba(89, 117, 139, .48);
}

html {
  background: var(--paper);
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--ui-font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button, input, textarea, select {
  font-family: var(--ui-font);
}

.topbar h1,
.hero-copy h2,
.focus-english,
.practice-english,
.section-heading h2,
.detail-header h2,
.reading-header h2,
.practice-header h2,
.insight-hero h2,
.quiet-panel h3,
.panel h3,
.side-card h3,
.article-card h3,
.modal h2,
.hint-text,
details p,
.expression-hero p,
.expression-trio p,
.script-text,
.finding p,
.focus-box p,
.result-heading strong,
.result-answer strong {
  font-family: var(--display-font);
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
.nav-item:focus-visible,
.moment-row:focus-visible,
.review-row:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 3px;
}

button:disabled,
.button:disabled {
  cursor: default;
}

.sidebar {
  padding: 28px 18px 24px;
  background: #efede8;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
}

.nav-list {
  gap: 3px;
}

.nav-item {
  min-height: 44px;
  padding: 10px 12px;
  border-radius: 12px;
  transition: background-color .18s ease, color .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.nav-item.is-active {
  box-shadow: 0 2px 8px rgba(52, 49, 42, .035);
}

.topbar {
  padding-top: 42px;
  padding-bottom: 25px;
}

.page-content {
  padding-bottom: 80px;
}

.button {
  min-height: 44px;
  padding: 10px 17px;
  border-radius: 999px;
  transition: border-color .18s ease, background-color .18s ease, color .18s ease, transform .12s ease;
}

.button:hover {
  transform: none;
}

.button:active {
  transform: scale(.98);
}

.text-button {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

.hero-copy,
.today-note {
  border-radius: 16px;
}

.today-note {
  box-shadow: 0 10px 28px rgba(52, 49, 42, .045);
}

.moment-row,
.review-row {
  min-height: 72px;
  transition: background-color .18s ease;
}

.tag {
  border-radius: 999px;
}

.quiet-panel {
  background: var(--white);
}

.loop-line span {
  border-radius: 999px;
}

input,
textarea,
select {
  min-height: 44px;
  border-radius: 10px;
  background: var(--white);
  transition: border-color .18s ease, box-shadow .18s ease;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(89, 117, 139, .12);
  outline: 0;
}

select {
  height: auto;
}

.toggle-row {
  min-height: 72px;
  border-radius: 12px;
}

.toggle-row:focus-within {
  outline: 2px solid var(--focus-ring);
  outline-offset: 3px;
}

.toggle-row i {
  width: 46px;
  height: 28px;
}

.toggle-row i::after {
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
}

.toggle-row input:checked + i::after {
  transform: translateX(18px);
}

.modal-backdrop {
  background: rgba(37, 39, 36, .38);
}

.modal {
  border-radius: 18px;
  box-shadow: 0 24px 70px rgba(37, 39, 36, .18);
}

.nav-list {
  scrollbar-width: none;
}

.nav-list::-webkit-scrollbar {
  display: none;
}

@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: minmax(0, 1fr);
  }

  .sidebar {
    min-width: 0;
    padding: 15px 18px 10px;
  }

  .main-content,
  .topbar,
  .page-content,
  .notice {
    min-width: 0;
  }

  .nav-list {
    min-height: 44px;
    align-items: center;
    -webkit-overflow-scrolling: touch;
  }

  .nav-item {
    min-height: 44px;
  }

  .page-content {
    padding-bottom: 64px;
  }
}

@media (max-width: 560px) {
  .topbar {
    align-items: center;
  }

  .topbar-actions {
    display: flex;
    flex: none;
  }

  .topbar-actions .button {
    min-height: 42px;
    padding-right: 13px;
    padding-left: 13px;
  }

  .page-content {
    padding-bottom: 52px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
}

@media (prefers-contrast: more) {
  :root {
    --muted: #54534d;
    --line: #aaa59b;
    --line-strong: #6f6b62;
  }

  .button,
  .panel,
  .side-card,
  .article-card,
  .today-note,
  .quiet-panel,
  .practice-form,
  .result-card,
  input,
  textarea,
  select {
    border-color: var(--line-strong);
  }
}

@media (forced-colors: active) {
  .button,
  .nav-item,
  input,
  textarea,
  select {
    border: 1px solid ButtonText;
  }

  .button-primary {
    background: ButtonText;
    color: ButtonFace;
  }
}
