.ss-card.ss-card-hsmath {
  border-color: rgba(94, 234, 212, .38);
}
.ss-card-hsmath .ss-card-name, .hm-link {
  color: #79e4d3;
}
.container:has(.hm-shell) {
  max-width: 1020px;
}
.hm-shell .mode-kicker {
  color: #80d9cc;
}
.hm-subtitle, .hm-actions {
  text-align: center;
  margin-top: 10px;
}
.hm-subtitle {
  color: #c5c0d6;
  font-size: 18px;
}
.hm-modes {
  margin: 24px auto;
}
.hm-modes .mode-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.hm-modes .mode-card button {
  margin-top: auto;
}
.hm-modes .hm-file-card {
  grid-column: 1 / -1;
  background: linear-gradient(110deg, rgba(45, 212, 191, .13), rgba(45, 212, 191, .025));
  border-color: rgba(94, 234, 212, .36);
}
.hm-file-card .btn-primary {
  background: #79e4d3;
  color: #102e32;
}
.hm-modes .hm-ultra-card {
  border-color: rgba(245, 186, 80, .52);
  background: linear-gradient(140deg, rgba(245, 186, 80, .10), rgba(255, 255, 255, .03));
}
.hm-ultra-card .btn-primary {
  background: #f2c76f;
  color: #322409;
}
@media (min-width: 800px) {
  .hm-modes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hm-modes .btn-primary { padding-inline: 21px; }
}
.hm-modes .hm-full-card { border-color:rgba(94,234,212,.48); }
.hm-full-card .btn-primary, .hm-full .btn-primary { background:#79e4d3; color:#102e32; }
.hm-full .btn-primary:disabled { opacity:.45; cursor:default; }
.hm-full nav { margin-bottom:16px; }
.hm-full-switch { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:5px; margin:12px auto; }
.hm-full-switch button { min-height:40px; display:flex; align-items:center; gap:6px; padding:6px 8px; color:inherit; background:transparent;
  border:1px solid #615878; border-radius:6px; text-align:left; font-family:inherit; font-size:.88rem; font-weight:600; cursor:pointer; }
.hm-full-switch button span { font:normal .78rem/1.15 sans-serif; }
.hm-full-switch button[aria-current], .hm-full-switch button:focus-visible { border-color:#67cdbf; background:rgba(50,160,145,.16); }
@media(max-width:690px) {
  .hm-full-switch { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .hm-full-switch button { flex-direction:column; align-items:flex-start; justify-content:center; gap:2px; padding:5px 7px; min-height:44px; }
  .hm-full-switch button span { font-size:.72rem; overflow-wrap:anywhere; }
}
.hm-full h1 { margin-bottom:12px; }
.hm-full > p { text-align:center; }
.hm-full-topics { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,245px),1fr)); gap:12px; margin-top:24px; }
.hm-full-topic { display:grid; gap:10px; align-content:start; color:inherit; text-align:left; cursor:pointer;
  border:1px solid #615878; border-radius:12px; padding:18px; background:rgba(130,128,170,.09); font:inherit; }
.hm-full-topic:hover, .hm-full-topic:focus-visible { border-color:#64c9b9; }
.hm-full-topic span, .hm-full-summary strong { font-size:1.2rem; font-weight:700; }
.hm-full-topic small, .hm-full-goal { font-size:.95rem; }
.hm-full progress { width:100%; height:6px; border:0; border-radius:4px; overflow:hidden; background:#444052; accent-color:#59ccbb; }
.hm-full progress::-webkit-progress-bar { background:#444052; }
.hm-full progress::-webkit-progress-value { background:#59ccbb; }
.hm-full-summary { display:grid; gap:8px; text-align:center; max-width:490px; margin:18px auto; }
.hm-full-targets { display:flex; flex-wrap:wrap; justify-content:center; gap:8px; margin:12px 0; }
.hm-full-rules { padding:8px 12px; border:1px solid #635e72; border-radius:8px; align-self:flex-start; }
.hm-full-rules summary { cursor:pointer; }
.hm-full-rules ul { padding-inline-start:20px; }
.hm-full-rules li { margin:4px 0; }
.hm-full .hm-met { font-weight:700; }
.hm-full-question { margin:16px auto; max-width:800px; overflow-wrap:anywhere; }
.hm-full-question .question-text img { width:auto; max-height:380px; object-fit:contain; }
.hm-full-question .hm-data-scroll { overflow-x:auto; margin:12px 0; }
.hm-full-question table { border-collapse:collapse; }
.hm-full-question th,.hm-full-question td { padding:5px 10px; border:1px solid #6b657b; text-align:left; }
.hm-full-question details summary { cursor:pointer; margin-bottom:10px; }
.container:has(.hm-ultra-shell) { max-width: none; padding: 0; }
.hm-ultra-shell { display: flex; flex-direction: column; height: 100vh; height: 100dvh; }
.hm-ultra-nav { padding: 6px 12px; }
#hsMathUltraFrame { width: 100%; flex: 1; min-height: 0; border: 0; }
body:has(.hm-ultra-shell) #themeToggleBtn { top: 11px; bottom: auto !important; }
.hm-shell .hub-save-bar {
  flex-wrap: wrap;
}
.hm-heading {
  margin: 28px 0 18px;
}
.hm-heading h1 {
  text-align: left;
  font-size: 38px;
}
.hm-library {
  display: grid;
  grid-template-columns: minmax(210px, .8fr) minmax(0, 2fr);
  align-items: start;
  gap: 18px;
}
.hm-topics, .hm-lesson {
  min-width: 0;
  background: rgba(255, 255, 255, .035);
  border: 1px solid rgba(167, 139, 250, .23);
  border-radius: 18px;
}
.hm-topics {
  padding: 16px 10px;
}
.hm-topics h2 {
  font-size: 20px;
  margin: 0 10px 10px;
}
.hm-topic-list {
  display: grid;
  gap: 2px;
}
.hm-topic-button {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 10px;
  width: 100%;
  text-align: left;
  background: transparent;
  color: #d1cbe0;
  border: 1px solid transparent;
  border-radius: 8px;
  font: inherit;
  line-height: 1.2;
  cursor: pointer;
}
.hm-topic-button:hover, .hm-task:hover {
  background: rgba(255, 255, 255, .055);
}
.hm-topic-button[aria-current=true] {
  color: #b2f5ea;
  background: rgba(45, 212, 191, .1);
  border-color: rgba(94, 234, 212, .38);
}
.hm-lesson-number, .hm-task-range, .hm-page-hint, .hm-preview-meta {
  font: 12px/1.4 'JetBrains Mono', monospace;
}
.hm-lesson-number {
  flex: 0 0 2ch;
  text-align: right;
  color: #9dd8d1;
}
.hm-mobile-topic, #hm-topic-select {
  display: none;
}
.hm-lesson {
  padding: clamp(16px, 3vw, 28px);
}
.hm-lesson h2 {
  margin: 6px 0 8px;
  font-size: clamp(26px, 3vw, 32px);
  line-height: 1.12;
}
.hm-lesson header p {
  color: #d3cddd;
  line-height: 1.5;
  font-size: 16px;
}
.hm-file-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0 22px;
}
.hm-lesson h3 {
  font-size: 20px;
  margin: 20px 0 5px;
}
.hm-tasks {
  list-style: none;
}
.hm-task {
  display: grid;
  grid-template-columns: 102px minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 10px;
  padding: 12px 4px;
  line-height: 1.3;
  border-top: 1px solid rgba(167, 139, 250, .18);
  color: #eeeaf6;
  text-decoration: none;
}
.hm-task-range {
  color: #9cebdc;
}
.hm-page-hint, .hm-preview-meta {
  color: #b5adc8;
}
.hm-files :focus-visible {
  outline: 2px solid #8ae8d9;
  outline-offset: 2px;
}
#hm-preview {
  position: fixed;
  margin: auto;
  width: min(880px, 96vw);
  height: min(1000px, 92vh);
  height: min(1000px, 92dvh);
  max-height: 100%;
  padding: 0;
  border: 1px solid #696680;
  border-radius: 14px;
  background: #1b1b30;
  color: #eeeaf6;
  overflow: hidden;
}
#hm-preview[open] {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  grid-template-areas: "heading" "problems" "paper" "footer";
}
.hm-preview-bar { grid-area: heading; }
.hm-preview-paper { grid-area: paper; }
.hm-preview-footer { grid-area: footer; }
.hm-problem-tools {
  grid-area: problems;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 10px;
  padding: 4px 14px 10px;
}
.hm-problem-tools[hidden], .hm-completion[hidden], .hm-done-mark[hidden] { display: none; }
.hm-problem-tools select {
  padding: 5px 8px;
  font: inherit;
  color: #eeeaf6;
  background: #29263e;
  border: 1px solid #716888;
  border-radius: 6px;
}
.hm-completion[aria-pressed="true"], .hm-done-mark { color: #91e7d0; }
.hm-done-mark { margin-left: 4px; }
.hm-completion-message { font-size: 14px; }
.hm-problem-links { display: flex; flex-wrap: wrap; gap: 5px; padding: 0 4px 9px; }
.hm-problem-jump {
  display: inline-flex;
  min-width: 32px;
  min-height: 32px;
  align-items: center;
  justify-content: center;
  color: #c8eee9;
  border: 1px solid #4e6b72;
  border-radius: 6px;
  font: 13px/1.25 'JetBrains Mono', monospace;
  text-decoration: none;
}
.hm-problem-jump:hover { background: rgba(94,234,212,.12); }
.hm-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
#hm-preview::backdrop {
  background: rgba(5, 8, 21, .82);
}
.hm-preview-bar, .hm-preview-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
}
.hm-preview-bar h2 {
  font-size: 20px;
}
.hm-zoom {
  margin-left: auto;
}
.hm-preview-paper {
  overflow: auto;
  overscroll-behavior: contain;
  background: white;
}
.hm-preview-paper img {
  width: 100%;
  height: auto;
  display: block;
}
.hm-sheet {
  position: relative;
}
.hm-zoomed .hm-sheet {
  width: max(1040px, 140%);
}
.hm-task-pointer {
  position: absolute;
  left: 6%;
  width: 3%;
  height: 1.6%;
  background: #00796c;
  clip-path: polygon(0 0, 100% 50%, 0 100%);
}
.hm-preview-footer button:disabled {
  opacity: .4;
  cursor: default;
}
@media (max-width: 680px) {
  .hm-library, .hm-modes {
    grid-template-columns: minmax(0, 1fr);
  }
  .hm-heading {
    margin-top: 20px;
  }
  .hm-topics {
    padding: 11px 14px;
  }
  .hm-topic-list, .hm-topics h2 {
    display: none;
  }
  .hm-mobile-topic, #hm-topic-select {
    display: block;
  }
  .hm-mobile-topic {
    font-size: 14px;
    margin-bottom: 5px;
    color: #cdc6dc;
  }
  #hm-topic-select {
    width: 100%;
    padding: 9px 6px;
    font: inherit;
    color: #eeeaf6;
    border: 1px solid #655d7d;
    border-radius: 6px;
    background: #242239;
  }
  .hm-task {
    grid-template-columns: 1fr auto;
    gap: 3px 8px;
  }
  .hm-task > :nth-child(2) {
    grid-column: 1 / -1;
    grid-row: 2;
  }
  .hm-preview-bar, .hm-preview-footer {
    padding: 8px;
  }
  .hm-preview-footer .btn-ghost {
    padding: 8px 10px;
  }
}
