/* Shared by the installed student app and the self-contained offline edition. */
:root {
  --ui-ink: #20342d;
  --ui-muted: #53695e;
  --ui-canvas: #f4f5f0;
  --ui-paper: #fffefa;
  --ui-line: #dce2d9;
  --ui-pine: #183d34;
  --ui-action: #1f624f;
  --ui-tint: #edf3e9;
  --ui-amber: #a47125;
  --ui-shadow: 0 3px 10px rgb(31 57 43 / 4%);
  --ui-radius: 14px;
  accent-color: var(--ui-action);
}
body {
  color: var(--ui-ink);
  background: var(--ui-canvas);
  font: 15px/1.65 "Microsoft YaHei UI","PingFang SC","Microsoft YaHei",system-ui,sans-serif;
  -webkit-font-smoothing: antialiased;
}
.layout { display: grid; grid-template-columns: clamp(210px, 17.2vw, 252px) minmax(0,1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; height: 100dvh; overflow-y: auto;
  display: flex; flex-direction: column;
  padding: 30px clamp(14px,1.45vw,24px) 20px;
  background: linear-gradient(160deg,#193f35 0%,#173a31 72%,#13352d 100%);
  color: #f5f7ea; border: 0; scrollbar-width: thin; scrollbar-color: #466657 transparent;
}
.sidebar-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.sidebar .brand {
  display: inline-flex; align-items: center; gap: 11px; margin: 0; padding: 0 6px;
  color: #f5f7ea; font-size: 23px; font-weight: 730; line-height: 1.3; letter-spacing: .035em;
  background: transparent; border: 0; text-decoration: none;
}
.brand :is(i,.mark,.brand-mark) {
  position: relative; display: inline-block; flex: 0 0 33px; width: 33px; height: 35px;
  margin: 0; padding: 0; border-radius: 9px; background: #d9e7c6; font-size: 0; transform: none;
}
.brand :is(i,.mark,.brand-mark)::before,.brand :is(i,.mark,.brand-mark)::after {
  content: ""; position: absolute; top: 10px; width: 8px; height: 13px;
  border: 1.6px solid #28503e; border-radius: 2px; background: none;
}
.brand :is(i,.mark,.brand-mark)::before { left: 7px; transform: skewY(12deg); }
.brand :is(i,.mark,.brand-mark)::after { left: 16px; transform: skewY(-12deg); }
#nav-toggle { display: none; }
.sidebar #nav { display: flex; flex-direction: column; align-items: stretch; margin: 31px 0 18px; gap: 21px; }
.nav-group { display: grid; gap: 4px; }
.sidebar .nav-group-title { display: block; width: auto; margin: 0 0 4px 13px; color: #afc4b6; font-size: 12px; font-weight: 550; letter-spacing: .075em; }
.sidebar .nav-link {
  display: flex; align-items: center; gap: 13px; min-height: 43px; width: 100%; padding: 8px 13px; margin: 0;
  border: 1px solid transparent; border-radius: 8px; background: transparent; box-shadow: none;
  color: #dfebe1; text-align: left; font-size: 15px; font-weight: 510; line-height: 1.45;
}
.sidebar .nav-label { display: inline; width: auto; color: inherit; font: inherit; }
.sidebar .nav-count {
  display: inline-flex; align-items: center; justify-content: center; margin-inline-start: auto;
  width: auto; min-width: 23px; height: 21px; padding-inline: 5px; border: 1px solid #557667;
  border-radius: 6px; color: #d0e0d4; font-size: 11px; line-height: 1; font-variant-numeric: tabular-nums;
}
.sidebar .nav-link:hover { color: white; background: #285043; }
.sidebar .nav-link:is(.on,[aria-current="page"]) { color: #fff; background: #325e4e; border-color: #527564; font-weight: 680; }
.sidebar [data-progress-toggle]::after {
  content: ""; width: 7px; height: 7px; flex: 0 0 7px; margin-inline-start: auto;
  margin-inline-end: 3px; border: solid currentColor; border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg) translateY(-2px);
}
.sidebar [data-progress-toggle][aria-expanded="true"]::after { transform: rotate(225deg) translate(-1px,-1px); }
.sidebar .nav-submenu { display: grid; gap: 2px; margin: 2px 0 5px 22px; padding-left: 9px; border-left: 1px solid #577869; }
.sidebar .nav-submenu[hidden] { display: none; }
.sidebar .nav-child { min-height: 35px; padding: 5px 11px; font-size: 14px; }
.sidebar .nav-link:focus-visible,.sidebar #nav-toggle:focus-visible { outline: 3px solid #f0cc82; outline-offset: 2px; }
.sidebar :is(.foot,.sidefoot) {
  margin: auto 0 0; padding: 17px 7px 0; border-top: 1px solid #416051;
  color: #c0d2c6; font-size: 12px; font-weight: 450;
}
.work { min-width: 0; }
.work > header,.work > .topbar,.work .topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; height: auto;
  padding: 12px clamp(22px,4vw,64px); background: #fbfcf7; border-bottom: 1px solid var(--ui-line);
  color: var(--ui-muted); font-size: 13px;
}
#crumb { color: #506458; font-weight: 550; }
#status { color: #415d4c; overflow-wrap: anywhere; }
.work main,.work .wrap {
  width: 100%; max-width: 1320px; margin: 0 auto; padding: 28px clamp(22px,4vw,64px) 56px;
}
.work h1 { color: var(--ui-ink); font-size: clamp(27px,2.4vw,38px); line-height: 1.25; font-weight: 730; letter-spacing: -.035em; }
.work h2 { color: var(--ui-ink); font-size: clamp(19px,1.55vw,24px); line-height: 1.5; font-weight: 680; }
.work :is(.muted,.sub) { color: var(--ui-muted); }
.work :is(.card,.row,.item) { background: var(--ui-paper); border: 1px solid var(--ui-line); border-radius: var(--ui-radius); box-shadow: var(--ui-shadow); }
.work :is(.card,.row,.item)>:is(h2,h3):first-child { margin-top: 0; }
.work :is(.page-heading,.dashboard-section-title) { display: flex; align-items: center; flex-wrap: wrap; justify-content: space-between; gap: 8px 18px; }
.work .page-heading { margin: 0 0 19px; }
.page-heading h1,.dashboard-section-title h2 { margin: 0; }
.page-heading p { margin: 5px 0 0; }
.page-heading-actions,.catalog-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.work :is(input:not([type=checkbox]):not([type=radio]):not([type=file]),select,textarea) {
  max-width: 100%; color: var(--ui-ink); border: 1px solid #b9c7ba; border-radius: 8px; background-color: #fffefa;
}
.work :is(button,input,select,textarea,label.file):focus-visible,dialog button:focus-visible { outline: 3px solid #946812; outline-offset: 3px; }
.work button:disabled,dialog button:disabled { cursor: not-allowed; }
.work :where(.actions,.page-heading-actions,.catalog-actions) > button,.work .file {
  min-height: 39px; padding: 7px 14px; border-radius: 8px; line-height: 1.45;
}
.work :where(.actions,.page-heading-actions,.catalog-actions) > :where(button:not(.primary):not(.cta):not(.be-primary)) {
  color: #294e3e; background: #fffefa; border: 1px solid #c5d0c4;
}
.work :is(.primary,.cta),dialog .primary {
  border: 1px solid var(--ui-action); background: var(--ui-action); color: white; font-weight: 620; border-radius: 8px;
}
.work :is(.primary,.cta):hover:enabled,dialog .primary:hover { background: #174c3c; border-color: #174c3c; color: white; }
.work .tag { color: #375b45; background: #e9f0e5; font-size: 12px; font-weight: 560; padding: 2px 9px; border-radius: 6px; }
.work :is(.notice,.note) { color: #345442; background: #edf3e9; border-color: #82a58a; }
.work .problem { background: #fff1e9; color: #803e27; border-color: #b97650; }
dialog { width: min(440px,calc(100% - 32px)); color: var(--ui-ink); background: var(--ui-paper); border: 1px solid #bdcbbd; border-radius: 15px; padding: 22px; }
dialog::backdrop { background: rgb(13 35 27 / 52%); }
dialog .actions,.dialog .actions { justify-content: flex-end; }
.reset-dialog > h2 { margin: 0; line-height: 1.4; }
.reset-dialog > p { margin: .65rem 0 1rem; }
.reset-dialog > .field { display: grid; gap: .5rem; margin: 0; min-width: 0; }
.reset-dialog > .field input { box-sizing: border-box; width: 100%; min-width: 0; margin: 0; }
.reset-dialog > .actions { gap: .65rem; margin: 1.25rem 0 0; }

/* These icons are interface controls. Their adjacent labels remain readable without them. */
.sidebar .nav-icon,.shortcut-icon {
  position: relative; display: inline-block; flex: 0 0 auto; width: 20px; height: 20px; color: inherit;
  font-size: 0; line-height: 1; vertical-align: middle;
}
[data-icon]::before,[data-icon]::after { content: ""; position: absolute; box-sizing: border-box; }
[data-icon="home"]::before { width: 12px; height: 11px; top: 8px; left: 4px; border: 1.6px solid; border-top: 0; border-radius: 0 0 2px 2px; }
[data-icon="home"]::after { width: 12px; height: 12px; left: 4px; top: 3px; border: 1.6px solid; border-right: 0; border-bottom: 0; border-radius: 2px 0 0; transform: rotate(45deg); }
[data-icon="papers"]::before { inset: 1px 4px 2px 3px; border: 1.6px solid; border-radius: 2px; }
[data-icon="papers"]::after { left: 6px; top: 6px; width: 7px; height: 1.5px; background: currentColor; box-shadow: 0 4px currentColor; }
[data-icon="knowledge"]::before,[data-icon="knowledge"]::after { width: 9px; height: 14px; top: 3px; border: 1.6px solid; border-radius: 2px; }
[data-icon="knowledge"]::before { left: 1px; transform: skewY(12deg); }
[data-icon="knowledge"]::after { left: 10px; transform: skewY(-12deg); }
[data-icon="recall"]::before { width: 11px; height: 11px; top: 2px; left: 3px; border: 1.6px solid; border-radius: 3px; transform: rotate(45deg); }
[data-icon="recall"]::after { width: 6px; height: 6px; bottom: 2px; right: 1px; border: 1.5px solid; border-radius: 2px; transform: rotate(45deg); }
[data-icon="review"]::before { width: 15px; height: 15px; top: 3px; left: 3px; border: 1.6px solid; border-left-color: transparent; border-radius: 50%; }
[data-icon="review"]::after { width: 7px; height: 7px; left: 2px; top: 2px; border: 1.6px solid; border-top: 0; border-right: 0; }
[data-icon="history"]::before { inset: 2px; border: 1.6px solid; border-radius: 50%; }
[data-icon="history"]::after { width: 5px; height: 6px; top: 5px; left: 9px; border: 1.6px solid; border-top: 0; border-right: 0; }
[data-icon="settings"]::before { width: 16px; height: 9px; top: 5px; left: 2px; border: solid currentColor; border-width: 1.6px 0; }
[data-icon="settings"]::after { width: 4px; height: 5px; top: 3px; left: 6px; border-radius: 2px; background: currentColor; box-shadow: 5px 8px currentColor; }
[data-icon="progress"]::before { inset: 2px 1px 2px 3px; border: solid currentColor; border-width: 0 0 1.5px 1.5px; border-radius: 0 0 0 2px; }
[data-icon="progress"]::after { width: 2px; height: 5px; left: 6px; bottom: 5px; background: currentColor; box-shadow: 4px -3px currentColor, 8px -6px currentColor; }
[data-icon="summary"]::before { inset: 1px 3px; border: 1.5px solid; border-radius: 3px; }
[data-icon="summary"]::after { top: 6px; left: 7px; width: 6px; height: 1.5px; background: currentColor; box-shadow: 0 4px currentColor, 0 8px currentColor; }
[data-icon="honors"]::before { width: 13px; height: 13px; left: 3.5px; top: 1px; border: 1.5px solid; border-radius: 50%; }
[data-icon="honors"]::after { left: 5px; top: 12px; width: 10px; height: 7px; background: currentColor; clip-path: polygon(12% 0,88% 0,100% 100%,52% 65%,0 100%); }

.work .dashboard-hero {
  display: flex; position: relative; isolation: isolate; align-items: center; min-height: 224px;
  margin: 0 0 26px; padding: 0; overflow: hidden; border: 1px solid #c5cfbb; border-radius: 17px;
  background: #e9eddf; box-shadow: var(--ui-shadow); color: #1f3e30;
}
.dashboard-hero-copy { z-index: 1; width: 58%; padding: clamp(23px,2.7vw,41px); overflow-wrap: anywhere; }
.dashboard-hero-copy :is(h1,h2) { color: #203e2f; font-size: clamp(27px,2.7vw,40px); margin: 5px 0 8px; line-height: 1.26; letter-spacing: -.035em; }
.dashboard-hero-copy :is(p,small,.dashboard-hero-kicker) { color: #3e5c48; }
.dashboard-hero-kicker { font-size: 13px; font-weight: 650; letter-spacing: .025em; }
.dashboard-hero-copy p { margin: 0 0 17px; }
.dashboard-hero .primary,.dashboard-hero .cta { display: inline-flex; align-items: center; justify-content: center; gap: 12px; padding: 9px 16px; min-height: 42px; }
.dashboard-hero-art {
  position: absolute; inset: 0 0 0 auto; width: 61%; z-index: 0; pointer-events: none;
  background: url('./study-desk.webp') center 54% / cover no-repeat;
  mask-image: linear-gradient(to right,transparent 0%,#000 29%);
}
.work .dashboard-section-title { margin: 22px 0 12px; }
.dashboard-section-title h2 { font-size: 20px; }
.dashboard-shortcuts { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; }
.work .dashboard-shortcut {
  position: relative; display: grid; grid-template-columns: 1fr auto; align-content: start; justify-items: start; gap: 13px 8px;
  width: 100%; min-width: 0; min-height: 133px; margin: 0; padding: 19px 20px; text-align: left;
  background: var(--ui-paper); border: 1px solid var(--ui-line); border-radius: var(--ui-radius); color: var(--ui-ink); box-shadow: var(--ui-shadow);
}
.work .dashboard-shortcut:hover { border-color: #9fb4a1; background: #fff; box-shadow: 0 4px 15px rgb(31 57 43 / 8%); }
.dashboard-shortcut .shortcut-icon { grid-area: 1/1; width: 20px; height: 20px; margin: 7px 8px; color: #286245; isolation: isolate; }
.shortcut-icon { --shortcut-bg: #e4eee1; }
.dashboard-shortcut .shortcut-icon { box-shadow: 0 0 0 7px var(--shortcut-bg); border-radius: 3px; background: var(--shortcut-bg); }
.shortcut-icon[data-icon="recall"] { --shortcut-bg:#f3ead5; color:#865b22; }
.shortcut-icon[data-icon="review"] { --shortcut-bg:#e5ebf1; color:#41617a; }
.shortcut-arrow { grid-area: 1/2; justify-self: end; color: #607a69; font: 19px/1.3 system-ui,sans-serif; }
.shortcut-copy { grid-area: 2/1/3/-1; display: grid; gap: 3px; }
.dashboard-shortcut strong { font-size: 17px; font-weight: 690; }
.dashboard-shortcut small { font-size: 13px; color: var(--ui-muted); font-weight: 450; }
.dashboard-recent { min-width: 0; }
.work .dashboard-empty { display: flex; align-items: center; gap: 17px; padding: 21px; }
.dashboard-empty .shortcut-icon { color: #657f70; margin: 8px; background: #edf2e9; border-radius: 3px; box-shadow: 0 0 0 8px #edf2e9; }
.dashboard-empty p { margin: 3px 0 0; }
.dashboard-grant { font-size: 13px; margin-top: 23px; }
.work .settings-links { display: flex; flex-wrap: wrap; gap: 6px 9px; margin: 0 0 18px; }
.settings-links a { display: inline-block; padding: 5px 12px; color: #325d47; background: #e6ede2; border-radius: 6px; text-decoration: none; }
.settings-links a:is(:hover,:focus-visible) { background: #d8e6d7; text-decoration: underline; text-underline-offset: .2em; }
.settings-layout :is(section,form)[id] { scroll-margin-top: 16px; }
.work .subject-picker { min-width: 0; padding: 0; margin: 15px 0 6px; border: 0; }
.subject-picker legend { padding: 0; font-weight: 600; margin-bottom: 6px; }
.subject-picker #subjects { display: flex; flex-wrap: wrap; gap: 5px 8px; }
.subject-picker label { display: inline-flex; align-items: center; gap: 6px; min-height: 35px; margin: 0; padding: 3px 10px; border: 1px solid #d7dfd4; border-radius: 6px; cursor: pointer; }
.subject-picker label:has(:checked) { background: #eef4ea; border-color: #a4bca5; }
.subject-picker input { margin: 0; }
.work .catalog-row { padding: 18px 20px; }
.catalog-row h3 { font-size: 17px; line-height: 1.55; }
.catalog-actions { justify-content: flex-end; }
.work .review-filters {
  display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,11rem),1fr));
  align-items: end; gap: 10px 14px;
}
.work :is(.review-filters,.review-controls) > label {
  display: grid; min-width: 0; max-width: 100%; gap: 4px;
}
.work .review-filters select,.work .review-controls input { width: 100%; min-width: 0; }
.work .review-filters + .review-controls { margin-top: 1rem; }
.work .review-controls { align-items: end; }
.work .review-controls > label { width: min(9rem,100%); }
.work .settings-layout { display: grid; gap: 14px; }
.settings-layout > .card { margin: 0; }
.exam-clock { display: inline-flex; align-items: baseline; gap: 9px; white-space: nowrap; padding: 6px 12px; border: 1px solid #c8d7c8; border-radius: 8px; background: #edf3e9; color: #2e5946; }
.exam-clock strong { font-size: 18px; line-height: 1.25; font-variant-numeric: tabular-nums; }
.work .exam-pager { display: flex; justify-content: space-between; gap: 12px; padding-top: 16px; margin-top: 18px; border-top: 1px solid var(--ui-line); }
.exam-pager button { min-width: 82px; }
.exam-sheet { align-self: start; min-width: 0; }
.work .exam-submit { justify-content: flex-end; border-top: 1px solid var(--ui-line); margin-top: 18px; padding-top: 15px; }
@media(max-width:1000px) and (min-width:761px) {
  .layout { grid-template-columns: 194px minmax(0,1fr); }
  .work main,.work .wrap { padding-inline: 24px; }
  .dashboard-shortcuts { gap: 10px; }
  .work .dashboard-shortcut { padding: 15px; }
}
@media(max-width:760px) {
  .layout { display: block; }
  .sidebar { position: relative; height: auto; padding: 10px 16px; overflow: visible; }
  .sidebar .brand { font-size: 19px; padding: 0; }
  .sidebar #nav-toggle {
    display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 6px 11px; border-radius: 7px;
    border: 1px solid #6a8276; background: transparent; color: white; font-size: 14px;
  }
  #nav-toggle::before { content: ""; width: 14px; height: 10px; border-block: 1.5px solid; background: linear-gradient(currentColor,currentColor) center / 100% 1.5px no-repeat; }
  .sidebar #nav { display: none; margin: 14px 0 2px; }
  .sidebar.nav-open #nav { display: flex; gap: 12px; padding-top: 10px; border-top: 1px solid #456254; }
  .nav-group { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 3px 8px; }
  .sidebar .nav-group-title { grid-column: 1/-1; }
  .sidebar [data-progress-toggle],.sidebar .nav-submenu { grid-column: 1/-1; }
  .sidebar .nav-submenu { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 2px 6px; margin-left: 13px; }
  .sidebar .nav-child { min-height: 40px; }
  .sidebar :is(.foot,.sidefoot) { display: none; }
  .work > header,.work .topbar { min-height: 40px; padding: 8px 16px; font-size: 12px; }
  .work main,.work .wrap { padding: 19px 16px 38px; }
  .work .page-heading { margin-bottom: 14px; }
  .work .dashboard-hero { min-height: 190px; border-radius: 12px; margin-bottom: 18px; }
  .dashboard-hero-copy { padding: 21px; }
  .dashboard-shortcuts { gap: 9px; }
  .work .dashboard-shortcut { min-height: 108px; padding: 13px; }
  .work .catalog-row { padding: 15px; }
}
@media(max-width:560px) {
  .dashboard-hero-copy { width: 67%; padding: 18px; }
  .dashboard-hero-copy :is(h1,h2) { font-size: 25px; text-wrap: balance; }
  .dashboard-hero-copy p { font-size: 13px; }
  .dashboard-hero-art { width: 45%; }
  .dashboard-shortcuts { grid-template-columns: 1fr; }
  .work .dashboard-shortcut { min-height: 0; grid-template-columns: 37px 1fr auto; padding: 12px 14px; align-items: center; gap: 10px; }
  .shortcut-copy { grid-area: 1/2; }
  .shortcut-arrow { grid-area: 1/3; }
  .work .catalog-actions { justify-content: flex-start; }
}
@media(max-width:380px) {
  .sidebar .nav-link { gap: 7px; padding-inline: 8px; }
  .sidebar .nav-label { min-width: 0; white-space: normal; }
}
