:root {
  --blue: #3355d9;
  --blue-dark: #2945b5;
  --soft: #edf1ff;
  --ink: #19273c;
  --muted: #677384;
  --line: #dce1e7;
  --paper: #fbfaf4;
  --bg: #f6f7f5;
  --surface: #fff;
  --rail: 209px;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
  font-size: 14px;
  font-synthesis: none;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
}
button,
a,
input,
select {
  font: inherit;
}
button {
  cursor: pointer;
  color: inherit;
}
button {
  border: 0;
  background: none;
}
button:disabled {
  cursor: default;
  opacity: 0.42;
}
a {
  color: var(--blue);
}
button,
a,
input,
select,
textarea {
  outline-offset: 3px;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--blue);
}
[hidden] {
  display: none !important;
}
h1,
h2,
p {
  margin: 0;
}
i[data-icon] {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
}
i svg {
  width: 18px;
  height: 18px;
  display: block;
  stroke-width: 1.65;
}
.shell {
  display: flex;
  min-height: 100vh;
}
.rail {
  width: var(--rail);
  flex: none;
  background: #fcfcfb;
  border-right: 1px solid var(--line);
  position: fixed;
  inset: 0 auto 0 0;
  display: flex;
  flex-direction: column;
  padding: 29px 16px 17px;
  z-index: 4;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  font-size: 27px;
  letter-spacing: -1.7px;
  line-height: 0.93;
  text-decoration: none;
  font-weight: 720;
  color: var(--ink);
  padding: 0 10px;
}
.brand-mark {
  height: 41px;
  width: 41px;
  background: var(--blue);
  border-radius: 11px;
  display: grid;
  place-content: center;
  color: white;
  font:
    italic 42px/0.85 Georgia,
    serif;
  padding: 0 3px 4px 0;
  box-shadow: inset 0 0 0 1px #293fb744;
}
.brand small,
.account small {
  font-size: 11px;
  letter-spacing: 0.05px;
  font-weight: 450;
  display: block;
  color: var(--muted);
  margin-top: 7px;
}
.nav-main {
  display: grid;
  gap: 5px;
  margin-top: 48px;
}
.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  height: 40px;
  border-radius: 7px;
  text-align: left;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 560;
  color: #596579;
}
.nav-link:hover,
.text-btn:hover,
.tool:hover,
.icon:hover,
.zoom:hover {
  background: #f0f2f5;
}
.nav-link.active {
  color: var(--blue-dark);
  background: #e9edfd;
}
.rail-bottom {
  margin-top: auto;
}
.account {
  border-top: 1px solid var(--line);
  margin: 12px 3px 0;
  padding: 19px 5px 0;
  display: flex;
  gap: 10px;
  align-items: center;
}
.account small {
  margin: 3px 0 0;
}
.account b {
  font-size: 13px;
}
.avatar {
  width: 33px;
  height: 33px;
  display: grid;
  place-items: center;
  border: 1px solid #d2d8e7;
  border-radius: 50%;
  background: #e7ebf5;
  font-family: Georgia, serif;
  font-size: 20px;
  color: #364575;
}
.workspace {
  margin-left: var(--rail);
  min-width: 0;
  width: calc(100% - var(--rail));
}
.top {
  height: 56px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 clamp(22px, 3vw, 52px);
  font-size: 12px;
  font-weight: 600;
  background: #fcfcfb;
}
.crumb,
.chev {
  color: var(--muted);
  font-weight: 450;
}
.chev {
  color: #a6adb6;
}
.sync-pill {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 7px;
  border: 1px solid #d9dfe0;
  padding: 6px 9px;
  border-radius: 6px;
  color: #54635e;
  font-size: 11px;
  background: #f8faf7;
}
.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #69876f;
}
.sync-pill.pending .dot {
  background: #cf9143;
}
.sync-pill.error .dot {
  background: #ba513c;
}
main {
  max-width: 1510px;
  margin: 0 auto;
  padding: 32px clamp(22px, 3vw, 52px) 40px;
}
.page-heading,
.card-head,
.exercise-meta,
.toolstrip,
.graph-caption,
.paper-foot,
.dialog-head,
.notebook-actions,
.end-controls {
  display: flex;
  align-items: center;
}
.page-heading {
  justify-content: space-between;
  margin-bottom: 23px;
  gap: 10px;
}
.eyebrow {
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 1.9px;
  color: #566781;
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 7px;
}
.eyebrow i svg {
  width: 14px;
  height: 14px;
}
h1 {
  font-size: clamp(28px, 3vw, 43px);
  font-weight: 650;
  letter-spacing: -1.95px;
  line-height: 1.08;
}
h2 {
  font-size: 17px;
  letter-spacing: -0.55px;
  line-height: 1.25;
}
.btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 620;
  line-height: 1.25;
  border: 1px solid transparent;
  min-height: 37px;
}
.primary {
  background: var(--blue);
  color: white;
}
.primary:hover {
  background: var(--blue-dark);
}
.dark {
  background: #253650;
  color: white;
}
.dark:hover {
  background: #17263d;
}
.simple {
  background: white;
  border: 1px solid var(--line);
}
.simple:hover,
.under-link:hover {
  background: #f7f8fa;
}
.columns {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(235px, 29%);
  gap: 19px;
  align-items: start;
}
.main-col,
.side-col {
  display: grid;
  gap: 16px;
  min-width: 0;
}
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 2px #19273c05;
}
.exercise {
  padding: 18px 22px 20px;
  border-top: 3px solid #6276d4;
}
.exercise-meta {
  gap: 10px;
  color: var(--muted);
  font-size: 11px;
}
.exercise-meta .blue {
  color: var(--blue-dark);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.exercise-meta .blue svg {
  width: 15px;
  height: 15px;
}
.exercise-meta > .icon {
  margin-left: auto;
}
.exercise h2 {
  font-size: 23px;
  margin: 6px 0 4px;
}
.section-ref {
  color: var(--muted);
  font-size: 12px;
}
.section-ref span {
  padding: 0 5px;
}
.formula {
  margin-top: 15px;
  border-left: 2px solid #b9c4f0;
  padding: 1px 0 1px 13px;
  font:
    italic 29px/1.3 Cambria,
    Georgia,
    'Times New Roman',
    serif;
  display: flex;
  align-items: center;
  gap: 0.16em;
}
.lim {
  display: inline-flex;
  flex-flow: column;
  align-items: center;
  line-height: 0.95;
  font-style: normal;
}
.lim small {
  font-size: 0.42em;
  margin-top: 0.1em;
}
.formula .fn {
  font-style: normal;
}
.formula sup {
  font-size: 0.55em;
}
.exercise-img {
  max-height: 170px;
  max-width: 100%;
  object-fit: contain;
  display: block;
  margin-top: 12px;
}
.card-head {
  min-height: 52px;
  padding: 0 18px;
  justify-content: space-between;
  gap: 8px;
}
.head-title {
  display: flex;
  align-items: center;
  gap: 9px;
}
.head-title > i {
  color: #51627d;
}
.card-head h2 {
  font-size: 16px;
}
.toolstrip {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #f9fafb;
  padding: 6px 12px;
  gap: 3px;
}
.icon,
.tool,
.text-btn,
.zoom {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 5px;
}
.icon {
  width: 30px;
  height: 30px;
}
.ghost {
  color: var(--muted);
}
.tool,
.zoom,
.text-btn {
  font-size: 12px;
  font-weight: 550;
  padding: 6px 8px;
}
.tool {
  color: #56647a;
}
.tool.active {
  background: #e5eafe;
  color: var(--blue-dark);
}
.tool-group {
  display: flex;
  gap: 3px;
}
.tool-spacer {
  flex: 1;
}
.divider {
  width: 1px;
  height: 17px;
  background: var(--line);
  margin: 0 5px;
}
.zoom {
  font-size: 10px;
  padding: 6px 0;
  color: #627084;
  min-width: 29px;
}
.toolstrip .icon {
  width: 25px;
}
.text-btn {
  color: #586780;
}
.text-btn i svg {
  width: 15px;
  height: 15px;
}
.paper {
  background-color: var(--paper);
  background-image: radial-gradient(#bebcaf 0.75px, transparent 0.75px);
  background-size: 15px 15px;
  background-position: 7px 6px;
  overflow: auto;
  overscroll-behavior-x: contain;
  position: relative;
  min-height: 234px;
}
.ink-line {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 125px;
  border-bottom: 1px dashed #cbcfc5;
}
.ink-line:last-child {
  border-bottom: 0;
}
.line-index {
  z-index: 1;
  position: absolute;
  left: 10px;
  top: 10px;
  border: 1px solid #d6d6ca;
  background: #fbfaf4;
  color: #767b78;
  border-radius: 5px;
  min-width: 23px;
  height: 19px;
  font:
    10px ui-monospace,
    monospace;
}
.ink-line.current .line-index {
  color: var(--blue-dark);
  border-color: #bdc8ef;
  background: #eaf0ff;
}
.ink-canvas {
  width: 100%;
  height: clamp(125px, 13vw, 180px);
  display: block;
  touch-action: none;
}
.line-hint {
  position: absolute;
  pointer-events: none;
  left: 8%;
  top: 47%;
  color: #93968b;
  font-size: 12px;
}
.tutor-equation {
  padding: 37px 13px 17px 40px;
  font:
    20px/1.4 Georgia,
    serif;
  overflow-wrap: anywhere;
}
.tutor-equation small {
  display: block;
  font: 10px/1.7 system-ui;
  color: var(--blue-dark);
}
.paper-foot,
.graph-caption {
  font-size: 11px;
  color: var(--muted);
  gap: 9px;
}
.paper-foot {
  justify-content: space-between;
  padding: 5px 12px;
  border-top: 1px solid #dddcd2;
  background: #fdfcf7;
}
.paper-foot .text-btn {
  color: #526379;
}
.notebook-actions {
  padding: 12px;
  gap: 8px;
  border-top: 1px solid var(--line);
}
.end-controls {
  justify-content: space-between;
}
.graph-area {
  padding: 0 11px;
}
.graph-area canvas,
.graph-detail {
  display: block;
  width: 100%;
  background: #f4f6fb;
  border-radius: 6px;
  height: 169px;
}
.graph-caption {
  padding: 11px 16px 13px;
  font:
    italic 15px Georgia,
    serif;
  color: #364869;
}
.swatch {
  width: 17px;
  height: 2px;
  background: var(--blue);
}
.under-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  padding: 11px 16px;
  width: 100%;
  color: var(--blue-dark);
  font-size: 12px;
  font-weight: 600;
  text-align: left;
}
.under-link svg {
  width: 15px;
  height: 15px;
}
.context-block,
.finding {
  margin: 0 15px 14px;
  padding: 11px 12px;
  background: #f6f7f8;
  border-radius: 7px;
}
.context-block b,
.finding b {
  display: block;
  font-size: 12px;
}
.context-block p,
.finding p {
  font-size: 12px;
  color: #59667a;
  line-height: 1.5;
  margin-top: 5px;
}
.inline-status {
  padding: 9px 14px;
  color: #795a20;
  background: #fff7e6;
  font-size: 12px;
}
.mobile-menu {
  display: none;
}
.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: #203049;
  color: white;
  box-shadow: 0 5px 22px #17283c30;
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 13px;
  z-index: 10;
  text-align: center;
  max-width: 92%;
}
dialog {
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 16px 65px #18283b30;
  padding: 0;
  width: min(520px, 94vw);
  max-height: 85dvh;
}
dialog::backdrop {
  background: #16283e50;
}
.dialog-head {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #fff;
  justify-content: space-between;
  padding: 15px 18px;
  border-bottom: 1px solid var(--line);
}
.dialog-body {
  padding: 18px;
  display: grid;
  gap: 12px;
}
.dialog-body > p,
.help {
  font-size: 13px;
  line-height: 1.55;
  color: #606d7d;
}
.dialog-body label {
  font-size: 12px;
  font-weight: 600;
  display: grid;
  gap: 6px;
}
.dialog-body input:not([type='checkbox']):not([type='range']),
.dialog-body select,
.dialog-body textarea {
  width: 100%;
  padding: 9px;
  border: 1px solid #c7cfda;
  border-radius: 6px;
  color: var(--ink);
  background: #fff;
}
.dialog-body textarea {
  min-height: 74px;
  resize: vertical;
}
.row {
  display: flex;
  gap: 7px;
  align-items: center;
  flex-wrap: wrap;
}
.row > label {
  flex: 1;
}
.list-btn,
.list-entry {
  display: block;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfcfd;
  padding: 10px 12px;
  line-height: 1.4;
  text-align: left;
  overflow-wrap: anywhere;
}
.list-btn:hover {
  background: #f0f3fc;
}
.list-btn b,
.list-entry b {
  display: block;
  font-size: 13px;
}
.list-btn small,
.list-entry small {
  display: block;
  font-size: 11px;
  color: #677585;
  margin-top: 3px;
}
.dialog-img,
.share-preview {
  display: block;
  max-width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 7px;
}
.graph-detail {
  height: 240px;
}
.crop-surface {
  width: 100%;
  height: auto;
  display: block;
  touch-action: none;
  border: 1px solid var(--line);
  border-radius: 5px;
}
.capture {
  background: #a43838;
  color: #fff;
}
.mobile-menu,
.rail-shade {
  display: none;
}
audio {
  max-width: 100%;
}
.empty {
  color: #798493;
  font-size: 12px;
}
.dialog-body h3 {
  margin: 5px 0 0;
  font-size: 14px;
}
.nav-link i svg {
  width: 17px;
  height: 17px;
}
.sidenote {
  color: var(--muted);
  font-size: 11px;
}
@media (min-width: 1420px) {
  .paper {
    min-height: 285px;
  }
  .ink-canvas {
    height: 170px;
  }
  .exercise {
    padding: 21px 25px 24px;
  }
  .graph-area canvas {
    height: 195px;
  }
}
@media (max-width: 1060px) {
  :root {
    --rail: 165px;
  }
  .rail {
    padding: 24px 9px 15px;
  }
  .brand {
    padding: 0 7px;
  }
  .columns {
    grid-template-columns: minmax(0, 1fr) 225px;
    gap: 12px;
  }
  main {
    padding: 25px 16px;
  }
  .top {
    padding: 0 18px;
  }
  .card-head {
    padding: 0 13px;
  }
  .side-col,
  .main-col {
    gap: 12px;
  }
  .notebook-actions {
    gap: 6px;
    padding: 10px;
  }
  .notebook-actions .btn {
    padding: 8px;
  }
  .toolstrip {
    padding: 6px;
  }
  .tool {
    padding: 5px;
  }
  .graph-area canvas {
    height: 145px;
  }
}
@media (max-width: 800px) {
  :root {
    --rail: 0px;
  }
  .rail {
    transform: translateX(-101%);
    width: 214px;
    transition: none;
  }
  .rail.open {
    transform: none;
    box-shadow: 0 0 0 100vmax #19273b55;
  }
  .mobile-menu {
    display: inline-flex;
  }
  .top {
    height: 48px;
    padding: 0 14px;
    gap: 8px;
  }
  .workspace {
    width: 100%;
    margin: 0;
  }
  main {
    padding: 22px 18px;
  }
  .columns {
    grid-template-columns: minmax(0, 1.8fr) minmax(200px, 1fr);
  }
}
@media (max-width: 650px) {
  .columns {
    display: flex;
    flex-direction: column;
    gap: 13px;
  }
  .main-col,
  .side-col {
    width: 100%;
  }
  .page-heading {
    margin-bottom: 15px;
  }
  .page-heading .btn {
    padding: 8px 10px;
    font-size: 11px;
  }
  .eyebrow {
    font-size: 9px;
    letter-spacing: 1.45px;
    margin-bottom: 5px;
  }
  main {
    padding: 16px 12px 28px;
  }
  .exercise {
    padding: 10px 14px 13px;
  }
  .exercise h2 {
    font-size: 20px;
    margin-top: 3px;
  }
  .formula {
    margin-top: 9px;
    font-size: 24px;
  }
  .exercise-meta .icon {
    height: 25px;
  }
  .card-head {
    min-height: 43px;
  }
  .paper {
    min-height: 260px;
  }
  .ink-canvas {
    height: 148px;
  }
  .toolstrip {
    gap: 2px;
  }
  .tool {
    padding: 6px;
  }
  .notebook-actions .btn {
    min-height: 38px;
    padding: 8px 10px;
  }
  .end-controls {
    margin-top: -3px;
  }
  .side-col {
    grid-template-columns: minmax(0, 1fr);
  }
  .graph-area canvas {
    height: 165px;
  }
  .notebook-actions {
    flex-wrap: wrap;
  }
  .exercise-img {
    max-height: 115px;
  }
  .dialog-body {
    padding: 15px;
  }
  .line-index {
    left: 7px;
    top: 7px;
  }
}
@media (max-width: 360px) {
  .tool span {
    display: none;
  }
  .crumb,
  .chev {
    display: none;
  }
  .top .sync-pill {
    font-size: 10px;
  }
  .page-heading h1 {
    font-size: 25px;
  }
}

.ink-line:only-child .ink-canvas:not([style*='aspect-ratio']) {
  height: 234px;
}
@media (max-width: 650px) {
  .ink-line:only-child .ink-canvas:not([style*='aspect-ratio']) {
    height: 260px;
  }
}
.ink-line:has(.ink-canvas[style*='aspect-ratio']) {
  min-height: 0;
}

.dialog-body .check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
}
.cue {
  padding: 12px 15px;
  background: #fff3d2;
  border-top: 2px solid #d6a139;
  line-height: 1.5;
}
.cue button {
  color: #614812;
  border: 1px solid #d7bd7c;
  border-radius: 5px;
  padding: 4px 7px;
  margin-top: 6px;
}

#draft-reading {
  max-width: 55%;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
  display: block;
  color: var(--blue-dark);
}
