:root {
  --ink: #1d2924;
  --muted: #718078;
  --paper: #f6f5ef;
  --panel: #fffefa;
  --line: #dedfd8;
  --green: #294f40;
  --green-soft: #e0e9e3;
  --shadow: 0 16px 50px rgba(39, 49, 43, 0.08);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: "DM Sans", sans-serif; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
.app-shell { --sidebar-size: 250px; display: grid; grid-template-columns: var(--sidebar-size) minmax(0, 1fr); min-height: 100vh; transition: grid-template-columns .2s ease; }
.app-shell.sidebar-collapsed { --sidebar-size: 0px; }
.sidebar { width: var(--sidebar-size); min-width: 0; overflow: hidden; border-right: 1px solid var(--line); padding: 30px 20px 22px; display: flex; flex-direction: column; background: #f0f1eb; transition: width .2s ease, padding .2s ease, border-color .2s ease; }
.sidebar nav { width: 209px; flex: none; }
.app-shell.sidebar-collapsed .sidebar { padding-right: 0; padding-left: 0; border-right-color: transparent; pointer-events: none; }
.nav-item { border: 0; width: 100%; background: transparent; color: #526058; display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 10px; text-align: left; margin: 2px 0; }
.nav-item:hover, .nav-item.active { background: #fffefa; color: var(--ink); box-shadow: 0 2px 10px rgba(33,45,39,.04); }
#course-nav { position: relative; }
.course-nav-item { cursor: grab; }
.course-nav-item:active { cursor: grabbing; }
.course-drag-handle { margin-left: auto; color: #a8b0ab; font-size: 13px; line-height: 1; opacity: 0; transition: opacity .12s; }
.course-nav-item:hover .course-drag-handle, .course-nav-item:focus-visible .course-drag-handle { opacity: 1; }
.course-nav-item.course-dragging { border: 1px dashed #8fa297; padding: 9px 11px; color: transparent; background: rgba(255,255,255,.38); box-shadow: none; }
.course-nav-item.course-dragging .course-dot, .course-nav-item.course-dragging .course-drag-handle { visibility: hidden; }
.course-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.nav-heading { display: flex; align-items: center; justify-content: space-between; margin: 28px 10px 8px; color: #8b948f; text-transform: uppercase; letter-spacing: .12em; font-size: 10px; font-weight: 700; }
.nav-heading button { border: 0; background: none; color: var(--muted); font-size: 18px; padding: 0; }
.nav-heading-actions { display: flex; align-items: center; gap: 10px; }
.nav-heading-actions button { display: flex; align-items: center; }
.nav-heading button:hover { color: var(--ink); }
.course-nav-loose { min-height: 2px; }
#course-nav.is-course-dragging .course-nav-loose { min-height: 34px; border-radius: 10px; outline: 1px dashed #c3ccc6; outline-offset: -2px; }
.course-folder { margin-top: 6px; border-radius: 12px; }
.course-folder.drop-target { background: rgba(255,255,255,.5); box-shadow: inset 0 0 0 1px #c3ccc6; }
.folder-header { display: flex; align-items: center; }
.folder-toggle { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; border: 0; background: none; padding: 8px 10px; color: #6b766f; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-align: left; border-radius: 8px; }
.folder-toggle:hover { color: var(--ink); }
.folder-caret { font-size: 10px; width: 10px; transition: transform .15s; }
.course-folder.collapsed .folder-caret { transform: rotate(-90deg); }
.folder-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.folder-count { margin-left: auto; font-size: 11px; font-weight: 600; color: #8b948f; }
.folder-count.has-active { color: var(--green); }
.folder-edit { border: 0; background: none; color: #a8b0ab; padding: 4px 8px; border-radius: 6px; opacity: 0; transition: opacity .12s; }
.folder-header:hover .folder-edit, .folder-edit:focus-visible { opacity: 1; }
.folder-edit:hover { color: var(--ink); background: #fffefa; }
.folder-courses { padding-left: 12px; }
.course-folder.collapsed .folder-courses { display: none; }
.folder-empty { margin: 2px 0 6px; padding: 8px 12px; color: #a8b0ab; font-size: 12px; }
#course-dialog .dialog-actions, #folder-dialog .dialog-actions { align-items: center; }
#delete-folder-button { margin-right: auto; }
.settings-links { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; margin-right: auto; }
.plain-link { border: 0; padding: 0; color: var(--muted); background: none; font-size: 13px; }
.plain-link:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.danger-link { border: 0; padding: 0; color: #9d4d42; background: none; font-size: 13px; }
.danger-link:hover { text-decoration: underline; text-underline-offset: 3px; }
#rename-course-dialog .dialog-actions { align-items: center; }
.danger-button:disabled { opacity: .4; cursor: not-allowed; }
label[hidden] { display: none; }
main { padding: 42px 5.5vw 70px; max-width: 1400px; width: 100%; }
.topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 42px; }
.topbar-left { min-width: 0; display: flex; align-items: center; gap: 15px; }
.topbar-left > div { min-width: 0; }
.sidebar-toggle { display: none; flex: none; place-items: center; width: 34px; height: 34px; padding: 0; border: 0; border-radius: 8px; color: var(--muted); background: none; }
.sidebar-toggle:hover { color: var(--ink); background: rgba(0,0,0,.04); }
.sidebar-toggle:focus-visible { outline: 3px solid #afc7b8; outline-offset: 2px; }
.sidebar-backdrop { display: none; }
h1, h2, h3 { font-family: "Newsreader", serif; margin: 0; font-weight: 600; }
h1 { font-size: clamp(36px, 4vw, 52px); letter-spacing: -.03em; }
h2 { font-size: 30px; }
h3 { font-size: 21px; }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: 10px; color: var(--muted); font-weight: 700; margin: 0 0 8px; }
.primary, .secondary { border-radius: 10px; padding: 11px 17px; font-weight: 600; border: 1px solid var(--green); }
.primary { color: white; background: var(--green); }
.primary:hover { background: #1d3e32; }
.secondary { background: transparent; color: var(--ink); border-color: var(--line); }
[hidden] { display: none !important; }
.home { max-width: 720px; }
.home .planner-board { gap: 18px; }
.home .task-list { border: 0; border-top: 1px solid var(--line); border-radius: 0; background: none; }
.home .task-row { min-height: 0; padding: 10px 4px; border-bottom: 1px solid var(--line); }
.home .task-row:last-child { border-bottom: 1px solid var(--line); }
.home .task-row:hover { background: rgba(255,255,255,.6); }
.course-empty { margin: 8px 0 0; padding-top: 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.course-empty button { border: 0; padding: 0; color: var(--green); background: none; font: inherit; font-weight: 600; }
.course-empty button:hover { text-decoration: underline; text-underline-offset: 3px; }
.study-options { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: -4px 0 14px; color: var(--muted); font-size: 12px; }
.study-options label { display: flex; align-items: center; gap: 7px; margin: 0; color: var(--muted); font-size: 12px; font-weight: 500; cursor: pointer; }
.study-options input { width: auto; margin: 0; accent-color: var(--green); }
.typed-answer { width: min(460px, 100%); margin: 22px auto 0; padding: 10px 12px; resize: vertical; font: inherit; font-size: 15px; text-align: left; }
.typed-answer-shown { width: min(460px, 100%); margin: 0 auto 14px; padding: 10px 12px; border-radius: 9px; color: var(--ink); background: rgba(0,0,0,.04); font-size: 14px; text-align: left; white-space: pre-wrap; }
.typed-answer-shown span { display: block; margin-bottom: 3px; color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.study-progress { height: 3px; margin: -6px 0 14px; overflow: hidden; border-radius: 3px; background: #ecede8; }
.study-progress span { display: block; height: 100%; border-radius: 3px; background: var(--green); transition: width .25s ease; }
.card-extras { margin: 4px 0 0; }
.card-extras > summary { width: max-content; color: var(--muted); font-size: 12px; font-weight: 600; cursor: pointer; }
.card-extras[open] > summary { margin-bottom: 12px; }
.undo-toast { position: fixed; z-index: 80; bottom: 20px; left: 50%; display: flex; align-items: center; gap: 16px; max-width: calc(100vw - 32px); padding: 10px 14px 10px 16px; border-radius: 10px; color: #f1f4f1; background: #1f2a25; box-shadow: 0 8px 24px rgba(20,30,25,.2); font-size: 13px; transform: translateX(-50%); }
.undo-toast[hidden] { display: none; }
.undo-toast span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.undo-toast button { flex: none; border: 0; padding: 0; color: #9fd3b5; background: none; font-weight: 700; }
@media (hover: none) {
  .term-row .delete-term, .folder-header .folder-edit { opacity: .55; }
}
.review-list { display: grid; border-top: 1px solid var(--line); }
.review-row { display: flex; align-items: center; gap: 10px; padding: 10px 2px; border-bottom: 1px solid var(--line); font-size: 13px; }
.review-row i { width: 7px; height: 7px; flex: none; border-radius: 50%; }
.review-name { border: 0; padding: 0; color: var(--ink); background: none; font-weight: 600; }
.review-name:hover { text-decoration: underline; text-underline-offset: 3px; }
.review-detail { color: var(--muted); font-size: 12px; }
.review-study { margin-left: auto; border: 0; padding: 5px 12px; border-radius: 999px; color: var(--green); background: var(--green-soft); font-size: 12px; font-weight: 600; }
.review-study:hover { color: white; background: var(--green); }
.nav-item kbd { margin-left: auto; color: #a8b0ab; font: 11px "DM Sans", sans-serif; }
.search-dialog { width: min(600px, calc(100vw - 32px)); margin-top: 12vh; padding: 0; }
.search-wrap { display: grid; }
#global-search { margin: 0; padding: 18px 20px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; font-size: 16px; }
#global-search:focus { outline: none; box-shadow: none; }
.search-results { max-height: min(420px, 60vh); overflow-y: auto; }
.search-results:empty { display: none; }
.search-result { display: grid; gap: 2px; width: 100%; padding: 11px 20px; border: 0; border-bottom: 1px solid #ecede8; border-radius: 0; color: var(--ink); background: none; text-align: left; }
.search-result.selected, .search-result:hover { background: var(--green-soft); }
.search-result strong { font-size: 14px; }
.search-result-course { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 11px; }
.search-result-course i { width: 6px; height: 6px; border-radius: 50%; }
.search-result-back { overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.search-empty { margin: 0; padding: 16px 20px; color: var(--muted); font-size: 13px; }
.term-row.search-hit { background: var(--green-soft); }
.study-prompt-definition { font-size: 18px; line-height: 1.6; }
.flashcard .back h2 { color: var(--ink); }
.study-prompt-definition.muted { color: var(--muted); font-size: 15px; }
.dialog-hint { margin: 0 auto 0 0; color: #a3aca6; font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#card-dialog .dialog-actions { align-items: center; }
.format-preview { margin: -9px 0 17px; padding: 10px 12px; overflow-x: auto; border-radius: 9px; color: var(--ink); background: rgba(0,0,0,.035); font-size: 14px; line-height: 1.6; }
.format-preview[hidden] { display: none; }
.import-help { margin: -8px 0 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.import-preview { min-height: 18px; margin: -6px 0 0; color: var(--green); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#import-text { font: 13px/1.5 ui-monospace, "SF Mono", Menlo, monospace; tab-size: 4; }
.flashcard.flippable { cursor: pointer; }
.study-hint { margin: 12px 0 0; color: #a3aca6; font-size: 11px; text-align: center; }
.katex-display { margin: .35em 0; text-align: left; }
.katex-display > .katex { text-align: left; }
.flashcard .katex-display, .flashcard .katex-display > .katex { text-align: center; }
.term-row .katex-display { overflow-x: auto; overflow-y: hidden; }
.code-block { margin: .4em 0; padding: 10px 12px; overflow-x: auto; border-radius: 8px; color: #e8ece9; background: #1f2a25; font: 12.5px/1.55 ui-monospace, "SF Mono", Menlo, monospace; white-space: pre; }
.course-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; margin: -18px 0 30px; color: var(--muted); font-size: 13px; }
.course-links { display: flex; align-items: center; gap: 18px; margin-left: auto; }
.course-links button, .course-todos-add { border: 0; padding: 0; color: var(--muted); background: none; font-size: 13px; }
.course-links button:hover, .course-todos-add:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.course-links .study-link { padding: 7px 14px; border-radius: 999px; color: white; background: var(--green); font-weight: 600; }
.course-links .study-link:hover { color: white; text-decoration: none; background: #1d3e32; }
.course-links .study-link:disabled { opacity: .4; }
.course-notes { margin: -14px 0 26px; }
.course-notes summary { width: max-content; color: var(--muted); font-size: 13px; cursor: pointer; }
.course-notes summary span { color: var(--green); font-weight: 600; }
.course-notes-body { display: grid; justify-items: start; gap: 10px; margin-top: 12px; padding-left: 14px; border-left: 2px solid var(--line); }
.course-notes-body .planner-board { width: 100%; }
.course-notes-body .task-list { border: 0; border-radius: 0; background: none; }
.course-notes-body .task-row { min-height: 0; padding: 6px 4px; border-bottom: 0; }
.course-notes-body .task-row:hover { background: rgba(255,255,255,.6); }
.course-notes-body .task-context { display: none; }
.course-notes-text { width: 100%; min-height: 0; margin: 0; padding: 8px 0; border: 0; border-radius: 0; resize: none; overflow: hidden; color: var(--ink); background: transparent; font: inherit; font-size: 14px; line-height: 1.6; }
.course-notes-text:focus { outline: none; box-shadow: none; }
.primary.quiet-add { white-space: nowrap; padding: 8px 12px; border-color: var(--line); color: var(--ink); background: none; box-shadow: none; font-size: 13px; }
.primary.quiet-add:hover { background: var(--panel); }
.home-section { margin-bottom: 44px; }
.home-section-head { display: flex; align-items: baseline; gap: 12px; margin: 0 0 14px; }
.home-section-head h2 { font-size: 24px; }
.home-section-head span { color: var(--muted); font-size: 12px; }
.home-empty { margin: 0; color: var(--muted); font-size: 13px; }
.activity-list { display: grid; }
.activity-row { display: flex; align-items: center; gap: 10px; padding: 10px 2px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; color: var(--ink); background: none; text-align: left; font-size: 13px; }
.activity-row:hover .activity-name { text-decoration: underline; text-underline-offset: 3px; }
.activity-row i { width: 7px; height: 7px; flex: none; border-radius: 50%; }
.activity-name { font-weight: 600; }
.activity-stats { margin-left: auto; color: var(--muted); font-size: 12px; }
.planner-reminder { display: flex; align-items: center; gap: 14px; margin: 0 0 36px; padding: 0 0 14px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.planner-reminder span { margin-right: auto; }
.planner-reminder button, .home-footer button { border: 0; padding: 0; color: var(--muted); background: none; font-size: 12px; }
.planner-reminder button:hover, .home-footer button:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.planner-reminder #planner-reminder-add { color: var(--green); font-weight: 600; }
.home-footer { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.backup-status { margin-right: auto; color: var(--muted); font-size: 11px; }
.backup-status.error { color: #a75045; }
.recently-deleted-wrap { padding: 28px; }
.recently-deleted-note { margin: -14px 0 20px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.recently-deleted-list { display: grid; gap: 8px; }
.recently-deleted-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 13px 14px; border: 1px solid var(--line); border-radius: 11px; background: white; }
.recently-deleted-row > div { min-width: 0; }
.recently-deleted-row strong { display: block; overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.recently-deleted-row span { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; }
.recently-deleted-row button { flex: none; padding: 7px 10px; font-size: 11px; }
.section-head { display: flex; justify-content: space-between; align-items: end; margin: 0 0 16px; }
.section-head p { color: var(--muted); margin: 5px 0 0; font-size: 13px; }
.terms-head .primary { padding: 9px 13px; }
.planner-head { display: flex; align-items: center; justify-content: space-between; margin: 0 0 16px; }
.planner-head > div { display: flex; align-items: baseline; gap: 12px; }
.planner-head span { color: var(--muted); font-size: 12px; }
.planner-board { display: grid; gap: 24px; }
.task-group { display: grid; gap: 9px; }
.task-group-head { display: flex; align-items: center; justify-content: space-between; padding: 0 3px; }
.task-group-head h3 { display: flex; align-items: center; gap: 7px; font: 600 13px "DM Sans", sans-serif; }
.task-group-head h3 i { width: 8px; height: 8px; border-radius: 50%; background: var(--task-group-accent); }
.task-group-head span { color: var(--muted); font-size: 11px; }
.task-group .task-context, .course-planner .task-context { display: none; }
.task-list { border: 1px solid var(--line); border-radius: 14px; background: var(--panel); overflow: hidden; }
.task-row { display: grid; grid-template-columns: 20px minmax(0, 1fr) 32px; gap: 13px; align-items: center; min-height: 68px; padding: 12px 14px 12px 17px; border-bottom: 1px solid #e8e9e4; }
.task-row[data-edit-task] { cursor: pointer; }
.task-row[data-edit-task]:focus-visible { position: relative; z-index: 1; outline: 2px solid #759181; outline-offset: -2px; }
.task-row:last-child { border-bottom: 0; }
.task-row:hover { background: #fff; }
.task-check { width: 18px; height: 18px; margin: 0; padding: 0; accent-color: var(--green); cursor: pointer; }
.task-copy { min-width: 0; }
.task-copy strong { display: block; font-size: 14px; line-height: 1.4; }
.task-meta { display: flex; flex-wrap: wrap; gap: 9px 14px; margin-top: 5px; color: var(--muted); font-size: 11px; }
.task-context { display: inline-flex; align-items: center; gap: 6px; }
.task-context i { width: 7px; height: 7px; border-radius: 50%; background: var(--task-accent); }
.task-due.today { color: #3f7651; font-weight: 600; }
.task-due.overdue { color: #a75045; font-weight: 600; }
.delete-task { display: grid; place-items: center; width: 30px; height: 30px; padding: 0; border: 0; border-radius: 8px; color: #9b7770; background: transparent; font-size: 19px; }
.delete-task:hover { color: #8c3f34; background: #f5e9e6; }
.task-row.completed { opacity: .58; }
.task-row.completed .task-copy strong { text-decoration: line-through; }
.task-row { transition: opacity .25s ease; }
.task-row.leaving { opacity: 0; }
.completed-tasks { border-top: 1px solid var(--line); padding-top: 17px; }
.completed-tasks summary { width: fit-content; color: var(--muted); font-size: 12px; font-weight: 600; cursor: pointer; }
.completed-tasks .task-list { margin-top: 10px; }
.planner-empty { padding: 4px 0; color: var(--muted); font-size: 13px; }
.course-planner { margin-bottom: 34px; }
.course-planner .planner-head .secondary { padding: 9px 13px; }
.course-planner-board { gap: 14px; }
.course-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; }
.course-card { text-align: left; border: 1px solid var(--line); border-top: 4px solid var(--accent); background: var(--panel); border-radius: 15px; padding: 21px; min-height: 160px; color: var(--ink); transition: transform .15s, box-shadow .15s; }
.course-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.course-card .count { color: var(--muted); margin: 8px 0 25px; font-size: 12px; }
.progress { height: 5px; background: #e8e9e3; border-radius: 5px; overflow: hidden; }
.progress span { height: 100%; display: block; background: var(--accent); border-radius: inherit; }
.progress-label { display: flex; justify-content: space-between; color: var(--muted); font-size: 10px; margin-top: 7px; }
.empty { border: 1px dashed #cbd0c9; border-radius: 18px; padding: 60px 30px; text-align: center; color: var(--muted); }
.empty h3 { color: var(--ink); margin-bottom: 8px; }
.empty .primary { margin-top: 18px; }
.pending-section { margin: 0 0 34px; border: 1px solid #d8dcd7; border-radius: 14px; background: rgba(255,254,250,.65); overflow: hidden; }
.pending-section summary { padding: 16px 19px; color: var(--ink); font: 600 20px "Newsreader", serif; cursor: pointer; user-select: none; }
.pending-section[open] summary { border-bottom: 1px solid var(--line); }
.pending-list { display: grid; }
.pending-row { display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: center; padding: 15px 19px; border-bottom: 1px solid #e8e9e4; }
.pending-row:last-child { border-bottom: 0; }
.pending-row strong { font-size: 13px; }
.pending-row p { color: var(--muted); font-size: 12px; line-height: 1.45; margin: 4px 0 0; }
.pending-actions { display: flex; gap: 7px; }
.pending-actions button { padding: 7px 10px; border-radius: 8px; font-size: 11px; font-weight: 600; }
.reject-pending { border: 1px solid var(--line); color: #8c5148; background: transparent; }
.approve-pending { border: 1px solid #789080; color: #315442; background: #edf3ef; }
.reject-pending:hover { background: #f7ebe8; border-color: #c99b93; }
.approve-pending:hover { background: #dfeae3; border-color: #557560; }
.card-list { position: relative; display: grid; border-top: 1px solid var(--line); }
.term-row[hidden] { display: none !important; }
.term-search-wrap { margin: 0 0 0 auto; }
.term-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0 0 14px; }
.term-tools .sorting-filters { margin: 0; }
.term-search { width: min(240px, 100%); margin: 0; padding: 8px 12px; border-color: transparent; background: rgba(0,0,0,.035); font-size: 13px; }
.term-search:focus { border-color: var(--line); background: var(--panel); }
.sorting-filters { display: flex; flex-wrap: wrap; gap: 7px; margin: 0 0 12px; }
.sorting-filters button { padding: 7px 11px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: transparent; font-size: 11px; font-weight: 600; }
.sorting-filters button:hover { border-color: #aeb9b1; color: var(--ink); background: white; }
.sorting-filters button.active { border-color: var(--green); color: white; background: var(--green); }
.no-term-results { margin: 18px 0 0; color: var(--muted); font-size: 13px; }
.between-add-card { position: absolute; z-index: 3; top: -5px; left: 50%; display: grid; place-items: center; width: 30px; height: 30px; padding: 0 0 2px; border: 0; border-radius: 50%; color: white; background: var(--green); box-shadow: 0 5px 15px rgba(41,79,64,.2); font-size: 20px; line-height: 1; opacity: 0; transform: translate(-50%, -50%) scale(.72); transition: opacity .12s, transform .12s; }
.between-add-card[hidden] { display: none !important; }
.between-add-card:hover, .between-add-card:focus-visible { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.between-add-card:focus-visible { outline: 3px solid #afc7b8; outline-offset: 2px; }
.bottom-add-wrap { display: flex; justify-content: center; padding-top: 24px; }
.bottom-add-card { display: grid; place-items: center; width: 38px; height: 38px; padding: 0 0 2px; border: 1px solid var(--line); border-radius: 50%; color: var(--muted); background: transparent; font-size: 22px; font-weight: 400; line-height: 1; }
.bottom-add-card:hover { color: var(--ink); background: var(--panel); }
.bottom-add-card:focus-visible { outline: 3px solid #afc7b8; outline-offset: 3px; }
.term-row { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) max-content; column-gap: 16px; row-gap: 4px; align-items: start; padding: 14px 40px 14px 18px; border-bottom: 1px solid var(--line); cursor: pointer; transition: opacity .12s, background .12s; }
.term-row .term-front { grid-column: 1; grid-row: 1; }
.term-row .form-guide { grid-column: 2; grid-row: 1; align-self: center; }
.term-row .answer { grid-column: 1 / -1; grid-row: 2; }
.term-row:hover { background: rgba(255,255,255,.6); }
.term-row:focus-visible { outline: 2px solid #759181; outline-offset: 2px; }
.card-list.is-dragging .between-add-card { display: none; }
.term-row.dragging { outline: 1px dashed #7f9b8b; background: rgba(224,233,227,.45); box-shadow: none; cursor: grabbing; }
.term-row.dragging > * { visibility: hidden; }
.drag-handle { position: absolute; top: 50%; left: 3px; opacity: 0; transition: opacity .12s; color: #a8b0ab; font-size: 15px; line-height: 1; cursor: grab; user-select: none; transform: translateY(-50%); }
.term-row:active .drag-handle { cursor: grabbing; }
.term-row:hover .drag-handle { opacity: 1; }
.term-row strong { min-width: 0; font-size: 15px; line-height: 1.4; overflow-wrap: anywhere; }
.term-front { min-width: 0; }
.term-front > strong { display: block; }
.term-sorting-badges { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.term-sorting-badges > span { padding: 3px 7px; border-radius: 999px; color: #4f685b; background: var(--green-soft); font-size: 9px; font-weight: 700; line-height: 1.2; }
.term-row .answer { color: var(--muted); font-size: 14px; line-height: 1.6; white-space: normal; }
.term-row .answer:empty { display: none; }
.definition-image-gallery { display: grid; gap: 8px; margin-top: 9px; }
.term-definition-image-gallery { grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr)); max-width: 360px; }
.term-definition-image { display: block; width: 100%; max-height: 190px; border: 1px solid var(--line); border-radius: 9px; object-fit: contain; background: white; }
.term-row .answer > .definition-image-gallery:only-child { margin-top: 0; }
.form-guide { display: inline-flex; align-items: center; gap: 5px; width: max-content; justify-self: end; }
.form-guide { gap: 4px; }
.form-dot { display: inline-block; width: 9px; color: #cfd4cf; font-size: 12px; line-height: 1; text-align: center; }
.form-dot.known { color: #4f8a60; }
.form-dot.missed { color: #b85f52; }
.delete-term { position: absolute; top: 10px; right: 6px; opacity: 0; transition: opacity .12s; display: grid; place-items: center; width: 28px; height: 28px; border: 0; border-radius: 8px; color: #9b7770; background: transparent; font-size: 20px; line-height: 1; }
.delete-term:hover { color: #8c3f34; background: #f5e9e6; }
.term-row:hover .delete-term, .delete-term:focus-visible { opacity: 1; }
dialog { width: min(520px, calc(100vw - 30px)); max-height: calc(100dvh - 30px); overflow: auto; border: 0; border-radius: 20px; padding: 0; background: var(--panel); box-shadow: 0 24px 80px rgba(22,35,28,.2); }
dialog::backdrop { background: rgba(24,34,29,.48); backdrop-filter: blur(3px); }
dialog form { padding: 28px; }
.dialog-head { display: flex; justify-content: space-between; margin-bottom: 26px; }
.icon-button { border: 0; background: #f0f1ec; width: 31px; height: 31px; border-radius: 50%; font-size: 21px; line-height: 1; color: var(--muted); }
label { display: block; font-size: 12px; font-weight: 600; color: #536158; margin: 17px 0; }
input, textarea, select { display: block; margin-top: 7px; width: 100%; border: 1px solid var(--line); background: white; border-radius: 10px; padding: 12px 13px; color: var(--ink); outline: none; resize: vertical; }
input:focus, textarea:focus, select:focus { border-color: #719080; box-shadow: 0 0 0 3px #e8eee9; }
.prompt-field { min-height: 108px; line-height: 1.5; }
.sorting-picker { margin: 20px 0 17px; padding: 0; border: 0; }
.sorting-picker legend { margin-bottom: 9px; color: #536158; font-size: 12px; font-weight: 600; }
.sorting-options { display: flex; flex-wrap: wrap; gap: 7px; min-height: 30px; }
.sorting-option { display: inline-flex; align-items: center; gap: 7px; margin: 0; padding: 7px 10px; border: 1px solid var(--line); border-radius: 999px; color: var(--ink); background: white; cursor: pointer; font-size: 11px; }
.sorting-option:has(input:checked) { border-color: #718e7e; background: var(--green-soft); }
.sorting-option input { width: 14px; height: 14px; margin: 0; padding: 0; accent-color: var(--green); }
.sorting-empty { margin: 7px 0; color: var(--muted); font-size: 11px; }
.sorting-create { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; margin-top: 10px; }
.sorting-create input { margin: 0; }
.sorting-create button { padding: 10px 12px; }
.sorting-status { min-height: 15px; margin: 6px 0 0; color: var(--muted); font-size: 10px; }
.image-upload input { padding: 8px; color: var(--muted); font-size: 11px; }
.image-upload input::file-selector-button { margin-right: 10px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: #f3f3ee; font-weight: 600; cursor: pointer; }
.definition-image-previews { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: -5px; }
.definition-image-previews[hidden] { display: none; }
.definition-image-preview { position: relative; min-width: 0; padding: 8px; border: 1px solid var(--line); border-radius: 12px; background: white; }
.definition-image-preview img { display: block; width: 100%; height: 150px; border-radius: 7px; object-fit: contain; }
.remove-definition-image { position: absolute; top: 5px; right: 5px; display: grid; place-items: center; width: 27px; height: 27px; padding: 0 0 2px; border: 0; border-radius: 50%; color: white; background: rgba(29,41,36,.78); font-size: 18px; line-height: 1; }
.remove-definition-image:hover { background: #8c3f34; }
.image-field-status { min-height: 16px; margin: 6px 0 0; color: var(--muted); font-size: 11px; }
.image-field-status.error { color: #a75045; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 25px; }
.danger-button { border: 1px solid #9d4d42; border-radius: 10px; padding: 11px 17px; color: white; background: #9d4d42; font-weight: 600; }
.danger-button:hover { border-color: #82372e; background: #82372e; }
.delete-course-message { margin: 0; color: var(--ink); font-size: 14px; line-height: 1.55; }
.delete-course-recovery { margin: 10px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.color-options { display: flex; gap: 10px; margin-top: 10px; }
.color-choice { width: 27px; height: 27px; border: 3px solid var(--panel); box-shadow: 0 0 0 1px var(--line); border-radius: 50%; }
.color-choice.selected { box-shadow: 0 0 0 2px var(--ink); }
.study-dialog { width: min(680px, calc(100vw - 30px)); }
.study-dialog.maximized { width: calc(100vw - 28px); max-width: none; height: calc(100dvh - 28px); max-height: none; }
.study-dialog.maximized #study-content { height: 100%; }
.study-wrap { padding: 28px; }
.study-dialog.maximized .study-wrap { display: flex; flex-direction: column; min-height: 100%; }
.study-top { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 12px; margin-bottom: 20px; }
.study-top-actions { display: flex; align-items: center; gap: 8px; }
.study-edit, .study-size-toggle { border: 1px solid var(--line); border-radius: 8px; padding: 7px 11px; color: var(--ink); background: var(--panel); font-size: 12px; font-weight: 600; }
.study-edit:hover, .study-size-toggle:hover { border-color: #9caaa1; background: white; }
.flashcard { min-height: 340px; border: 1px solid var(--line); background: #fff; border-radius: 17px; padding: 48px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.study-dialog.maximized .flashcard { flex: 1; min-height: 0; overflow: auto; padding: clamp(34px, 6vw, 84px); }
.flashcard h2 { max-width: 100%; font-size: clamp(24px, 4vw, 36px); line-height: 1.28; overflow-wrap: anywhere; white-space: pre-wrap; }
.flashcard .back { border-top: 1px solid var(--line); padding-top: 24px; margin-top: 24px; color: #526159; line-height: 1.65; white-space: pre-wrap; }
.flashcard.practice-card { align-items: stretch; }
.flashcard.practice-card h2 { width: min(650px, 100%); margin: 0 auto; font-size: clamp(22px, 3.2vw, 32px); text-align: center; }
.regex-practice { width: min(580px, 100%); margin: 30px auto 0; text-align: left; }
.regex-practice label { display: block; margin-bottom: 8px; color: var(--ink); font-size: 12px; font-weight: 700; }
.regex-answer-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 9px; }
.regex-answer-row input { min-width: 0; margin: 0; font: 15px/1.4 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; }
.regex-answer-row button { padding-right: 15px; padding-left: 15px; white-space: nowrap; }
.regex-input-hint { margin: 7px 0 0; color: var(--muted); font-size: 10px; line-height: 1.45; }
.regex-feedback { min-height: 0; margin-top: 12px; border-radius: 10px; font-size: 12px; line-height: 1.5; }
.regex-feedback:empty { display: none; }
.regex-feedback.correct, .regex-feedback.incorrect { padding: 11px 13px; border: 1px solid; }
.regex-feedback.correct { border-color: #b8d0c0; color: #315e41; background: #edf5ef; }
.regex-feedback.incorrect { border-color: #e1c0ba; color: #85483f; background: #fbefec; }
.regex-feedback ul { margin: 7px 0 0; padding-left: 18px; }
.regex-feedback code { color: inherit; font: 11px/1.4 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; overflow-wrap: anywhere; }
.practice-card > .regex-feedback { width: min(580px, 100%); margin: 25px auto 0; text-align: left; }
.regex-solution { display: block; color: inherit; font: 15px/1.65 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; overflow-wrap: anywhere; white-space: pre-wrap; }
.study-definition-image-gallery { grid-template-columns: repeat(auto-fit, minmax(min(210px, 100%), 1fr)); width: min(520px, 100%); margin-right: auto; margin-left: auto; }
.study-definition-image { display: block; width: 100%; max-height: 360px; border-radius: 11px; object-fit: contain; background: white; }
.flashcard .back > .definition-image-gallery:only-child { margin-top: 0; }
.study-actions { display: flex; justify-content: center; gap: 9px; margin-top: 18px; }
.rating { border: 1px solid var(--line); background: var(--panel); border-radius: 10px; padding: 10px 18px; color: var(--ink); }
.rating:hover { border-color: var(--green); }
.missed-rating:hover { border-color: #a35b50; background: #f8ece9; }
.known-rating { border-color: #668874; background: #edf3ef; }
@media (max-width: 1100px) {
  .app-shell { --sidebar-size: 210px; }
  .app-shell.sidebar-collapsed { --sidebar-size: 0px; }
  .sidebar { padding: 26px 14px 20px; }
  .sidebar nav { width: 181px; }
  main { padding: 34px 30px 60px; }
  .topbar { margin-bottom: 32px; }
}
@media (max-width: 760px) {
  .app-shell, .app-shell.sidebar-collapsed { --sidebar-size: 0px; grid-template-columns: 1fr; }
  .sidebar, .app-shell.sidebar-collapsed .sidebar { position: fixed; z-index: 50; inset: 0 auto 0 0; width: min(280px, calc(100vw - 42px)); height: 100dvh; padding: 78px 18px 22px; border-right: 1px solid var(--line); box-shadow: 18px 0 44px rgba(26,39,32,.14); opacity: 1; pointer-events: none; transform: translateX(-105%); transition: transform .2s ease; }
  .sidebar nav { width: 100%; }
  .app-shell.sidebar-open .sidebar { pointer-events: auto; transform: translateX(0); }
  .app-shell:not(.sidebar-open) .sidebar { box-shadow: none; }
  .sidebar-backdrop { position: fixed; z-index: 40; inset: 0; display: block; padding: 0; border: 0; background: rgba(24,34,29,.34); opacity: 0; pointer-events: none; transition: opacity .2s ease; }
  .app-shell.sidebar-open .sidebar-backdrop { opacity: 1; pointer-events: auto; }
  body.sidebar-drawer-open { overflow: hidden; }
  main { padding: 26px 20px 50px; }
  .sidebar-toggle { display: grid; position: fixed; z-index: 60; top: 18px; left: 14px; }
  .topbar-left { padding-left: 34px; }
  .topbar { margin-bottom: 28px; }
  .planner-head { align-items: flex-end; }
  .planner-head > div { display: block; }
  .planner-head span { display: block; margin-top: 3px; }
  .drag-handle { display: none; }
  .pending-row { grid-template-columns: 1fr; gap: 12px; }
  .pending-actions { justify-content: flex-end; }
  .study-wrap { padding: 20px; }
  .study-top-actions { gap: 6px; }
  .study-edit, .study-size-toggle { padding: 7px 9px; }
  .flashcard { padding: 30px 22px; }
  .regex-answer-row { grid-template-columns: 1fr; }
  .regex-answer-row button { width: 100%; }
}

/* Website sign-in screen and sign-out link (cloud.js). */
.cloud-gate { position: fixed; inset: 0; z-index: 2000; display: grid; place-items: center; background: var(--paper); }
.cloud-gate-box { max-width: 340px; padding: 0 24px; text-align: center; }
.cloud-gate-box h1 { margin: 0 0 10px; font-family: "Newsreader", serif; font-weight: 600; font-size: 34px; }
.cloud-gate-box p { margin: 0 0 22px; color: var(--muted); line-height: 1.5; }
.sign-out-link { position: fixed; bottom: 18px; right: 18px; z-index: 1000; border: 0; background: none; color: var(--muted); font: 12px "DM Sans", sans-serif; cursor: pointer; }
.sign-out-link:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
