:root {
  --ink: #173332;
  --muted: #607373;
  --line: #dce6e4;
  --page: #f7f8f5;
  --paper: #ffffff;
  --teal: #126c69;
  --teal-soft: #dcefed;
  --lime: #cfe477;
  --orange: #e07c4e;
  --red: #b84c42;
  --serif: Georgia, "Times New Roman", serif;
  --sans: "Noto Sans SC", system-ui, sans-serif;
  --mono: "DM Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--page); font-family: var(--sans); }
button, input { font: inherit; }
button { cursor: pointer; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 240px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 30px 22px 24px; background: #173332; color: #eef5f2; display: flex; flex-direction: column; }
.brand { display: flex; align-items: center; gap: 9px; color: inherit; text-decoration: none; font-size: 25px; font-weight: 700; letter-spacing: 0; }
.brand-mark { display: grid; place-items: center; width: 27px; height: 27px; color: #173332; background: var(--lime); border-radius: 6px; font-family: var(--serif); font-size: 19px; }
.brand-dot { color: var(--lime); }
.brand-subtitle { margin: 10px 0 48px 36px; font-size: 12px; color: #a7bfbb; }
.nav { display: grid; gap: 6px; }
.nav-link { padding: 12px 10px; border: 0; border-radius: 5px; color: #bdd0cd; background: transparent; text-align: left; font-size: 14px; }
.nav-link:hover, .nav-link.active { color: #fff; background: rgba(255,255,255,.1); }
.nav-icon { display: inline-block; width: 32px; color: #7faaa4; font-family: var(--mono); font-size: 11px; }
.nav-link.active .nav-icon { color: var(--lime); }
.sidebar-bottom { margin-top: auto; }
.deadline-mini { padding: 18px 10px; border-top: 1px solid #31514f; border-bottom: 1px solid #31514f; color: #bdd0cd; font-size: 12px; }
.deadline-mini strong { margin: 0 5px; color: var(--lime); font-family: var(--serif); font-size: 31px; font-weight: 400; }
.settings-link { margin: 18px 10px 0; padding: 0; border: 0; color: #a7bfbb; background: transparent; font-size: 12px; }
.settings-link:hover { color: white; }
.main-content { width: min(1100px, 100%); padding: 52px 7vw 80px; }
.view { display: none; }
.view.active { display: block; }
.page-header { display: flex; justify-content: space-between; gap: 16px; align-items: start; margin-bottom: 30px; }
.eyebrow { margin: 0 0 8px; color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: .06em; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 0; font-family: var(--serif); font-size: clamp(32px, 4vw, 48px); font-weight: 400; letter-spacing: 0; }
h2 { margin-bottom: 0; font-family: var(--serif); font-size: 25px; font-weight: 400; letter-spacing: 0; }
.icon-button, .close-button { width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 5px; color: var(--ink); background: var(--paper); }
.icon-button { font-family: var(--mono); font-weight: 600; }
.status-strip { display: flex; align-items: center; gap: 9px; margin-bottom: 24px; padding: 13px 16px; border-left: 3px solid var(--teal); background: var(--teal-soft); font-size: 13px; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--teal); }
.today-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(220px, .75fr); gap: 16px; }
.focus-panel, .countdown-panel, .plan-summary, .metrics-grid > div { background: var(--paper); border: 1px solid var(--line); border-radius: 7px; }
.focus-panel { min-height: 300px; padding: 29px; display: flex; flex-direction: column; }
.focus-topline { display: flex; justify-content: space-between; align-items: baseline; }
.focus-topline span { font-family: var(--mono); font-size: 13px; }
.progress-track { height: 8px; margin: 15px 0 31px; overflow: hidden; border-radius: 8px; background: #e6edeb; }
.progress-track span { display: block; width: 0%; height: 100%; border-radius: inherit; background: var(--teal); transition: width .35s ease; }
.focus-copy h2 { font-size: 29px; }
.focus-copy i { color: var(--orange); font-style: normal; }
.focus-copy p { margin: 10px 0 23px; color: var(--muted); font-size: 13px; }
.primary-button, .secondary-button { display: inline-flex; justify-content: center; align-items: center; gap: 12px; min-height: 43px; padding: 0 18px; border: 0; border-radius: 5px; font-weight: 600; }
.primary-button { margin-top: auto; color: #fff; background: var(--teal); }
.primary-button:hover { background: #0e5a57; }
.primary-button span { font-size: 20px; line-height: 0; }
.secondary-button { color: var(--ink); border: 1px solid var(--line); background: white; }
.countdown-panel { padding: 29px; background: #e8efcc; border-color: #d6e1a6; }
.countdown-number { display: flex; align-items: baseline; gap: 5px; margin-top: 20px; }
.countdown-number strong { font-family: var(--serif); font-size: 70px; line-height: .85; font-weight: 400; }
.countdown-number span { font-size: 14px; }
#deadline-caption { margin: 15px 0 20px; color: #5d6540; font-family: var(--mono); font-size: 11px; }
.countdown-rule { height: 1px; background: #cbd69f; }
.small-state { margin: 16px 0 0; color: #4d5a3d; font-size: 12px; line-height: 1.7; }
.section-block { margin-top: 54px; }
.section-heading { display: flex; justify-content: space-between; gap: 16px; align-items: end; margin-bottom: 20px; }
.section-heading .eyebrow { margin-bottom: 5px; }
.section-heading h2 { font-size: 27px; }
.muted-note { color: var(--muted); font-size: 11px; }
.week-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 9px; }
.day-column { min-width: 0; }
.day-label { display: flex; justify-content: space-between; margin-bottom: 8px; color: var(--muted); font-family: var(--mono); font-size: 11px; }
.day-label strong { color: var(--ink); font-weight: 500; }
.heat-cells { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.heat-cells span { aspect-ratio: 1; border-radius: 2px; background: #e5ebea; }
.heat-cells span.mid { background: #a8cfca; }
.heat-cells span.heavy { background: var(--teal); }
.attention-list { display: grid; border-top: 1px solid var(--line); }
.attention-row { display: grid; grid-template-columns: 1.4fr 2fr auto; gap: 20px; align-items: center; padding: 15px 8px; border-bottom: 1px solid var(--line); }
.attention-word { font-family: var(--serif); font-size: 20px; }
.attention-meaning, .attention-reason { color: var(--muted); font-size: 13px; }
.attention-reason { color: var(--red); font-size: 12px; }
.text-button { padding: 0; border: 0; color: var(--teal); background: transparent; font-size: 13px; font-weight: 600; }
.text-button:hover { text-decoration: underline; }
.plan-summary { display: grid; grid-template-columns: repeat(3, 1fr); margin-bottom: 50px; overflow: hidden; }
.plan-summary > div { padding: 25px; border-right: 1px solid var(--line); }
.plan-summary > div:last-child { border-right: 0; }
.plan-summary strong, .metric-value { display: block; margin-bottom: 7px; font-family: var(--serif); font-size: 36px; font-weight: 400; }
.plan-summary span, .metric-label { color: var(--muted); font-size: 12px; }
.phase-list { display: grid; border-top: 1px solid var(--line); }
.phase-item { display: grid; grid-template-columns: 100px 1fr auto; gap: 20px; align-items: center; padding: 18px 8px; border-bottom: 1px solid var(--line); }
.phase-date { color: var(--teal); font-family: var(--mono); font-size: 12px; }
.phase-item strong { font-size: 15px; }.phase-item p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }.phase-state { color: var(--muted); font-size: 12px; }
.filter-row { display: flex; gap: 8px; margin-bottom: 25px; }
.data-note { margin: -12px 0 24px; color: var(--muted); font-size: 12px; }
.search-field { display: block; margin: 0 0 14px; }.search-field input { width: min(100%, 360px); min-height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: 4px; color: var(--ink); background: var(--paper); }.search-field input:focus { outline: 2px solid var(--teal); outline-offset: 2px; }
.known-button { min-height: 38px; margin-top: 18px; padding: 0 14px; border: 1px solid var(--line); border-radius: 5px; color: var(--muted); background: transparent; font-weight: 600; }.known-button:hover { border-color: var(--teal); color: var(--teal); background: var(--teal-soft); }
.card-word-line { display: flex; align-items: center; justify-content: center; gap: 10px; }.card-word-line .study-card h2, .card-word-line h2 { margin-right: 0; }.speak-button { width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 5px; color: var(--teal); background: transparent; font-size: 17px; line-height: 1; }.speak-button:hover:not(:disabled) { border-color: var(--teal); background: var(--teal-soft); }.speak-button:disabled { cursor: not-allowed; color: var(--muted); opacity: .55; }
.filter { min-height: 34px; padding: 0 13px; border: 1px solid var(--line); border-radius: 4px; color: var(--muted); background: transparent; font-size: 12px; }
.filter.active { color: white; border-color: var(--teal); background: var(--teal); }
.word-list { border-top: 1px solid var(--line); }
.word-row { display: grid; grid-template-columns: 1fr 2fr auto; gap: 18px; align-items: center; padding: 18px 8px; border-bottom: 1px solid var(--line); }
.word-head { font-family: var(--serif); font-size: 22px; }.word-head small { display: block; margin-top: 4px; color: var(--muted); font-family: var(--mono); font-size: 10px; }.word-meaning { color: var(--muted); font-size: 13px; }.word-source { display: block; margin-top: 6px; color: var(--muted); font-size: 11px; }.word-tag { padding: 4px 7px; border-radius: 4px; color: var(--teal); background: var(--teal-soft); font-size: 11px; white-space: nowrap; }.word-tag.unstable { color: #8a362f; background: #fae5df; }
.metrics-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; background: transparent; border: 0; }.metrics-grid > div { padding: 24px; }.metric-value { font-size: 42px; }.metric-trend { color: var(--teal); font-size: 12px; }
.mastery-map { display: grid; grid-template-columns: 120px repeat(3, 1fr); grid-template-rows: 36px 100px 100px; gap: 8px; font-size: 12px; }.map-axis { align-self: center; color: var(--muted); }.map-cell { padding: 15px; border-radius: 5px; background: #e8eeec; }.map-cell.priority { background: #f5ddd3; }.map-cell.good { background: var(--teal-soft); }.map-cell strong { display: block; margin-bottom: 8px; font-family: var(--serif); font-size: 28px; font-weight: 400; }
dialog { color: var(--ink); }.study-dialog { width: min(700px, calc(100vw - 32px)); padding: 0; border: 0; border-radius: 8px; box-shadow: 0 26px 90px rgba(10, 37, 35, .28); background: var(--paper); }.study-dialog::backdrop, .settings-dialog::backdrop { background: rgba(17, 45, 43, .6); }.study-header { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 18px 20px; border-bottom: 1px solid var(--line); color: var(--muted); font-family: var(--mono); font-size: 11px; }.study-header .close-button { justify-self: start; width: 30px; height: 30px; font-size: 19px; }.study-header #study-kind { justify-self: end; }.study-card { min-height: 450px; padding: 58px clamp(25px, 8vw, 80px) 40px; text-align: center; }.card-label { color: var(--muted); font-size: 12px; }.study-card h2 { margin: 12px 0 7px; font-family: var(--serif); font-size: clamp(46px, 9vw, 70px); font-weight: 400; }.phonetic { margin-bottom: 35px; color: var(--muted); font-family: var(--mono); font-size: 13px; }.prompt-box { min-height: 78px; display: grid; place-items: center; padding: 12px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }.prompt-box p { margin: 0; font-size: 16px; }.answer-box { padding: 22px 0 0; text-align: left; }.hidden { display: none !important; }.definition { margin-bottom: 8px; font-size: 17px; font-weight: 600; }.collocation { color: var(--teal); font-size: 14px; }.example { margin: 14px 0 0; color: var(--muted); font-size: 13px; line-height: 1.8; }.reveal-button { min-height: 42px; margin-top: 26px; padding: 0 20px; border: 1px solid var(--teal); border-radius: 5px; color: var(--teal); background: white; font-weight: 600; }.rating-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 25px; }.rating-row button { min-height: 59px; border: 1px solid var(--line); border-radius: 5px; color: var(--ink); background: white; }.rating-row button:hover { border-color: var(--teal); color: var(--teal); background: var(--teal-soft); }.rating-row span { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; }.study-hint { margin: 0; padding: 14px; border-top: 1px solid var(--line); color: var(--muted); text-align: center; font-size: 12px; }
.settings-dialog { width: min(440px, calc(100vw - 32px)); padding: 0; border: 0; border-radius: 8px; background: var(--paper); }.settings-dialog form { padding: 27px; }.dialog-heading { display: flex; justify-content: space-between; align-items: start; margin-bottom: 28px; }.dialog-heading h2 { font-size: 28px; }.settings-dialog label { display: grid; gap: 8px; margin: 16px 0; color: var(--muted); font-size: 12px; }.settings-dialog input { width: 100%; min-height: 42px; padding: 0 11px; border: 1px solid var(--line); border-radius: 4px; color: var(--ink); background: #fff; }.settings-actions { display: flex; justify-content: end; gap: 10px; margin-top: 28px; }.settings-actions .primary-button { margin-top: 0; }
@media (max-width: 780px) { .app-shell { display: block; }.sidebar { position: static; height: auto; padding: 16px 18px; flex-direction: row; align-items: center; gap: 17px; }.brand-subtitle, .sidebar-bottom { display: none; }.nav { display: flex; gap: 2px; margin-left: auto; }.nav-link { padding: 7px 8px; font-size: 12px; }.nav-icon { display: none; }.main-content { padding: 36px 20px 70px; }.today-grid { grid-template-columns: 1fr; }.countdown-panel { min-height: 180px; }.week-grid { gap: 5px; }.heat-cells { grid-template-columns: repeat(3, 1fr); }.attention-row, .word-row { grid-template-columns: 1fr auto; gap: 8px; }.attention-meaning, .word-meaning { grid-column: 1 / -1; grid-row: 2; }.plan-summary, .metrics-grid { grid-template-columns: 1fr; }.plan-summary > div { border-right: 0; border-bottom: 1px solid var(--line); }.phase-item { grid-template-columns: 1fr auto; }.phase-date { grid-column: 1 / -1; }.mastery-map { grid-template-columns: 72px repeat(3, 1fr); }.map-cell { padding: 9px; }.map-cell strong { font-size: 22px; }.rating-row { grid-template-columns: repeat(2, 1fr); }.study-card { min-height: 430px; padding-top: 45px; } }
