:root {
  color-scheme: dark;
  --bg: #11130f;
  --surface: #191c17;
  --surface-2: #20231e;
  --surface-3: #262a23;
  --ink: #eef1e8;
  --muted: #92998b;
  --line: #30352b;
  --accent: #d8ff3e;
  --accent-ink: #151713;
  --easy: #35c88a;
  --medium: #f1a62a;
  --hard: #ff6464;
  --header: #151713;
  --text-secondary: #c0c5ba;
  --code-bg: #1e1e1e;
  --code-ink: #d4d4d4;
  --statement-code-bg: #30342e;
  --card-bg: #151713;
  --hover-border: #525a4b;
  --popup-border: #3d4438;
  --popup-shadow: rgb(0 0 0 / 35%);
  --link: #79aaff;
  --link-hover: #a9c8ff;
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #eef1ec;
  --surface: #ffffff;
  --surface-2: #f7f8f5;
  --surface-3: #edf0e9;
  --ink: #1b2318;
  --muted: #687264;
  --line: #d9dfd5;
  --accent: #789600;
  --accent-ink: #ffffff;
  --easy: #07885a;
  --medium: #b96b00;
  --hard: #d43d3d;
  --header: #ffffff;
  --text-secondary: #4e594a;
  --code-bg: #ffffff;
  --code-ink: #333333;
  --statement-code-bg: #f7f8f7;
  --card-bg: #fbfcfa;
  --hover-border: #aab4a5;
  --popup-border: #cbd3c6;
  --popup-shadow: rgb(35 48 30 / 18%);
  --link: #1267c4;
  --link-hover: #084d96;
}
* { box-sizing: border-box; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}
html, body { height: 100%; }
body { margin: 0; overflow: hidden; background: var(--bg); color: var(--ink); font-family: "Noto Sans SC", system-ui, sans-serif; }
button, textarea, select { font: inherit; }
button, select { color: inherit; }
.workspace-header {
  height: 58px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 18px; border-bottom: 1px solid var(--line); background: var(--header);
}
.workspace-brand { display: flex; align-items: center; gap: 8px; color: var(--ink); text-decoration: none; font-weight: 800; }
.workspace-brand > span { padding: 7px; border-radius: 7px; background: var(--accent); color: var(--accent-ink); font: 700 12px "DM Mono"; }
.workspace-brand strong { color: var(--accent); }
.problem-nav { display: flex; align-items: center; gap: 8px; }
.problem-nav a,
.collection-drawer-button { padding: 7px 11px; border-radius: 6px; color: var(--muted); text-decoration: none; font-size: 12px; }
.problem-nav a:hover,
.collection-drawer-button:hover { background: var(--surface-2); color: var(--ink); }
.problem-nav a.disabled { opacity: .3; pointer-events: none; }
.collection-drawer-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 210px;
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
}

.site-record-footer {
  display: flex;
  justify-content: center;
  padding: 18px 24px 24px;
  color: #8b928e;
  font-size: 11px;
}
.site-record-footer a {
  color: inherit;
  text-decoration: none;
}
.site-record-footer a:hover {
  color: #d9dfda;
  text-decoration: underline;
}
.collection-drawer-button > span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.collection-drawer-button > span:last-child {
  color: var(--ink);
  font-size: 16px;
  line-height: 1;
}
.collection-drawer-button[aria-expanded="true"] {
  border-color: var(--line);
  background: var(--surface-2);
  color: var(--ink);
}
.workspace-user { display: flex; align-items: center; gap: 12px; }
.workspace-user > div { width: 31px; height: 31px; display: grid; place-items: center; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font: 700 10px "DM Mono"; }
.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 31px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--muted);
  cursor: pointer;
  font-size: 11px;
}
.theme-toggle:hover { border-color: var(--hover-border); color: var(--ink); }
.theme-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.save-state { color: var(--muted); font-size: 11px; }
.workspace {
  height: calc(100vh - 58px);
  display: grid;
  grid-template-columns: minmax(300px, var(--statement-width, 46%)) 6px minmax(360px, 1fr);
  gap: 0;
  padding: 5px;
}
.statement-pane, .coding-pane { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.statement-pane { display: flex; flex-direction: column; }
.workspace-resizer {
  position: relative;
  z-index: 4;
  touch-action: none;
  outline: none;
}
.workspace-resizer::after {
  position: absolute;
  border-radius: 3px;
  background: transparent;
  content: "";
  transition: background .15s ease;
}
.workspace-resizer:hover::after,
.workspace-resizer:focus-visible::after,
.workspace-resizer.dragging::after { background: color-mix(in srgb, var(--accent) 65%, var(--line)); }
.workspace-resizer-vertical { cursor: col-resize; }
.workspace-resizer-vertical::after { top: 8px; bottom: 8px; left: 2px; width: 2px; }
.workspace-resizer-horizontal { cursor: row-resize; }
.workspace-resizer-horizontal::after { top: 2px; right: 8px; left: 8px; height: 2px; }
body.resizing-workspace {
  cursor: col-resize;
  user-select: none;
}
body.resizing-console {
  cursor: row-resize;
  user-select: none;
}
.pane-tabs, .console-tabs { display: flex; min-height: 45px; padding: 0 12px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.pane-tabs button, .console-tabs button { border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--muted); cursor: pointer; padding: 0 14px; font-size: 12px; }
.pane-tabs button.active, .console-tabs button.active { border-color: var(--accent); color: var(--ink); }
.statement-scroll { flex: 1; overflow-y: auto; padding: 30px 34px 60px; }
.problem-meta-line { display: flex; align-items: center; gap: 8px; color: var(--muted); font: 11px "DM Mono"; }
.statement-scroll h1 { margin: 13px 0 12px; font-size: 26px; }
.difficulty, .adapter-state, .problem-tags span { width: fit-content; padding: 4px 8px; border-radius: 5px; font-size: 10px; }
.difficulty.easy { color: var(--easy); background: color-mix(in srgb, var(--easy) 12%, transparent); }
.difficulty.medium { color: var(--medium); background: color-mix(in srgb, var(--medium) 12%, transparent); }
.difficulty.hard { color: var(--hard); background: color-mix(in srgb, var(--hard) 12%, transparent); }
.adapter-state { color: var(--medium); background: color-mix(in srgb, var(--medium) 10%, transparent); }
.problem-tags { display: flex; gap: 6px; margin-bottom: 16px; }
.problem-tags span { border: 1px solid var(--line); color: var(--muted); }
.leetcode-source-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  color: var(--link);
  text-decoration: none;
  font-size: 14px;
  line-height: 1.6;
}
.leetcode-source-link:hover { color: var(--link-hover); text-decoration: underline; }
.leetcode-source-link:focus-visible { outline: 2px solid var(--link); outline-offset: 4px; border-radius: 2px; }
.external-link-icon { font: 600 13px "DM Mono"; transition: transform .15s ease; }
.leetcode-source-link:hover .external-link-icon { transform: translate(2px, -2px); }
.statement-scroll section { margin-top: 30px; }
.statement-scroll h2, .placeholder-panel h2 { margin: 0 0 12px; font-size: 20px; }
.statement-scroll p, .placeholder-panel p { color: var(--text-secondary); font-size: 13px; line-height: 1.9; }
.statement-section > h2, .sample-card > h2 {
  padding-bottom: 11px;
  border-bottom: 1px solid var(--line);
}
.statement-text { margin: 0; white-space: pre-line; }
.statement-markdown--plain { white-space: pre-wrap; color: var(--text-secondary); font-size: 13px; line-height: 1.9; }
.statement-formula,
#problemDescription code:not(pre code) {
  color: var(--ink);
  padding: 1px 4px;
  border-radius: 3px;
  background: var(--statement-code-bg);
  font-family: "DM Mono", Consolas, monospace;
  font-size: .9em;
  font-style: normal;
  font-weight: 400;
  letter-spacing: 0;
  box-decoration-break: clone;
}
.constraints-list { display: grid; gap: 8px; margin: 0; padding-left: 20px; color: var(--text-secondary); font: 12px/1.7 "DM Mono"; }
.sample-card { padding-top: 2px; }
.sample-part, .sample-explanation { margin-top: 20px; }
.sample-part h3, .sample-explanation h3 { margin: 0 0 12px; font-size: 14px; }
.sample-image { margin: 20px 0 0; text-align: center; }
.sample-image img { display: block; max-width: 100%; max-height: 360px; margin: 0 auto; object-fit: contain; }
.sample-image figcaption { margin-top: 8px; color: var(--muted); font-size: 12px; }
.sample-code { position: relative; overflow: hidden; border: 1px solid var(--line); border-radius: 7px; background: var(--code-bg); }
.sample-code pre {
  overflow-x: auto;
  min-height: 64px;
  margin: 0;
  padding: 16px 72px 16px 16px;
  color: var(--code-ink);
  font: 12px/1.8 "DM Mono";
  white-space: pre-wrap;
}
.copy-sample {
  position: absolute;
  top: 0;
  right: 0;
  height: 34px;
  padding: 0 13px;
  border: 0;
  border-left: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  border-radius: 0 0 0 6px;
  background: var(--surface-2);
  color: var(--muted);
  cursor: pointer;
  font-size: 11px;
}
.copy-sample:hover { color: var(--ink); background: var(--surface-3); }
.sample-explanation p { margin: 0; color: var(--text-secondary); white-space: pre-line; }
.sample-explanation-trace { max-width: 620px; margin-top: 14px; overflow-x: auto; color: var(--text-secondary); }
.sample-explanation-trace-row {
  display: grid;
  grid-template-columns: minmax(390px, 1fr) 64px;
  gap: 28px;
  min-width: 500px;
  padding: 3px 0;
  align-items: center;
}
.sample-explanation-trace-row.is-header {
  margin-bottom: 5px;
  padding-bottom: 7px;
  border-bottom: 1px solid var(--line);
  color: var(--text-secondary);
  font-size: 13px;
}
.sample-explanation-trace-row code {
  color: var(--text-secondary);
  font: 13px/1.55 "DM Mono", monospace;
  white-space: pre;
}
.sample-explanation-trace-row strong { color: var(--text); font-size: 14px; }
@media (max-width: 700px) {
  .sample-explanation-trace-row {
    grid-template-columns: minmax(230px, 1fr) 44px;
    gap: 10px;
    min-width: 284px;
  }
  .sample-explanation-trace-row code { font-size: 11px; }
}
.sample-empty { margin-top: 30px; padding: 18px; border: 1px dashed var(--line); border-radius: 7px; }
.adaptation-notice { margin-top: 30px; padding: 17px; border: 1px solid color-mix(in srgb, var(--medium) 30%, var(--line)); border-radius: 8px; background: color-mix(in srgb, var(--medium) 6%, transparent); }
.adaptation-notice strong { color: var(--medium); font-size: 12px; }
.adaptation-notice p { margin: 7px 0 0; font-size: 12px; }
.placeholder-panel { flex: 1; padding: 32px; }
.solution-panel {
  flex: 1;
  overflow-y: auto;
  padding: 30px 34px 60px;
}
.solution-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}
.solution-header h2 { margin: 7px 0 0; font-size: 24px; }
.solution-kicker {
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
}
.solution-strategy {
  flex: 0 0 auto;
  padding: 7px 10px;
  border: 1px solid color-mix(in srgb, var(--accent) 38%, var(--line));
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  color: var(--accent);
  font-size: 11px;
  font-weight: 600;
}
  .solution-section {
    margin-top: 30px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
  }
  .solution-section h3 {
    margin: 0 0 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--line);
    color: var(--ink);
    font-size: 19px;
    line-height: 1.45;
  }
  .solution-section p,
  .solution-section li {
    color: var(--ink);
    font-size: 15px;
    line-height: 2;
  }
  .solution-section p { margin: 0; }
  .solution-section ol,
  .solution-section ul { display: grid; gap: 9px; margin: 0; padding-left: 25px; }
.solution-section li::marker { color: var(--accent); font-weight: 700; }
.complexity-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.complexity-grid > div {
  display: grid;
  gap: 6px;
  padding: 13px 14px;
  border-radius: 7px;
  background: var(--surface-3);
}
.complexity-grid span { color: var(--muted); font-size: 10px; }
.complexity-grid strong { color: var(--code-ink); font: 500 13px "DM Mono"; }
  .solution-warning {
    padding: 16px 18px;
    border-left: 4px solid var(--medium);
    border-radius: 0 8px 8px 0;
    background: color-mix(in srgb, var(--medium) 7%, var(--surface-2));
  }
  .solution-warning h3 { border: 0; padding-bottom: 0; }
  .solution-content { display: block; }
  .solution-markdown { padding-top: 8px; color: var(--ink); }
  .solution-markdown h2,
  .solution-markdown h3,
  .solution-markdown h4,
  .solution-markdown h5 {
    margin: 32px 0 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--line);
    color: var(--ink);
    line-height: 1.45;
  }
  .solution-markdown h2 { font-size: 21px; }
  .solution-markdown h3 { font-size: 19px; }
  .solution-markdown h4,
  .solution-markdown h5 { font-size: 17px; }
  .solution-markdown p,
  .solution-markdown li { font-size: 15px; line-height: 2; }
  .solution-markdown p { margin: 12px 0; }
  .solution-markdown ol,
  .solution-markdown ul { display: grid; gap: 8px; padding-left: 26px; }
  .solution-markdown li::marker { color: var(--accent); font-weight: 700; }
  .solution-markdown code {
    padding: 2px 6px;
    border-radius: 4px;
    background: var(--surface-3);
    color: var(--code-ink);
    font: 500 .9em "DM Mono", monospace;
  }
  .solution-markdown .markdown-image {
    margin: 18px 0;
    text-align: center;
  }
  .solution-markdown .markdown-image img {
    display: block;
    max-width: 100%;
    max-height: 360px;
    margin: 0 auto;
    object-fit: contain;
  }
  .solution-markdown .markdown-image figcaption {
    margin-top: 8px;
    color: var(--muted);
    font-size: 12px;
  }
  .solution-code-section {
    margin-top: 27px;
    overflow: hidden;
    border: 1px solid #353535;
    border-radius: 10px;
    background: #1e1e1e;
    box-shadow: 0 8px 24px rgb(0 0 0 / 12%);
  }
  .solution-code-toolbar {
    display: flex;
    min-height: 44px;
    align-items: stretch;
    justify-content: space-between;
    gap: 12px;
    padding: 0 10px;
    border-bottom: 1px solid #333;
    background: #252526;
  }
  .solution-code-caption {
    padding: 12px 16px 0;
    color: #e7e7e7;
    background: #292929;
    font-size: 13px;
    font-weight: 600;
  }
  .solution-code-missing {
    margin: 24px 0;
    padding: 14px 16px;
    border-left: 4px solid var(--medium);
    background: color-mix(in srgb, var(--medium) 8%, var(--surface-2));
  }
  .solution-code-tabs {
    display: flex;
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: thin;
  }
  .solution-code-tabs button,
  .solution-copy {
    border: 0;
    color: #aaa;
    background: transparent;
    font: 500 13px/1.2 system-ui, sans-serif;
    cursor: pointer;
  }
  .solution-code-tabs button {
    position: relative;
    flex: 0 0 auto;
    min-width: 68px;
    padding: 0 15px;
  }
  .solution-code-tabs button:hover { color: #eee; }
  .solution-code-tabs button.active {
    color: #fff;
    background: #202020;
  }
  .solution-code-tabs button.active::after {
    position: absolute;
    right: 14px;
    bottom: 0;
    left: 14px;
    height: 2px;
    background: #ffa116;
    content: "";
  }
  .solution-copy {
    align-self: center;
    flex: 0 0 auto;
    padding: 7px 12px;
    border: 1px solid #4a4a4a;
    border-radius: 6px;
    background: #363636;
    color: #ddd;
  }
  .solution-code-view { display: none; max-height: 620px; overflow: auto; }
  .solution-code-view.active { display: block; }
  .solution-code-lines {
    display: block;
    min-width: max-content;
    margin: 0;
    padding: 18px 0 18px 58px;
    gap: 0;
    list-style: none;
    color: #858585;
    background: #1e1e1e;
    font: 13px/1.4 "DM Mono", "Cascadia Code", Consolas, monospace;
    counter-reset: code-line;
  }
  .solution-code-lines li {
    display: block;
    position: relative;
    min-height: 18px;
    margin: 0;
    padding: 0 22px 0 14px;
    border-left: 0;
    color: #d4d4d4;
    font: inherit;
    line-height: 1.4;
    counter-increment: code-line;
  }
  .solution-code-lines li::before {
    position: absolute;
    right: calc(100% + 14px);
    width: 34px;
    color: #6e7681;
    text-align: right;
    content: counter(code-line);
    user-select: none;
  }
  .solution-code-lines li::marker { content: ""; }
  .solution-code-lines code {
    padding: 0;
    border-radius: 0;
    background: transparent;
    color: #d4d4d4;
    font: inherit;
    white-space: pre;
  }
  .solution-code-lines .syntax-comment { color: #6a9955; font-style: normal; }
  .solution-code-lines .syntax-keyword { color: #569cd6; }
  .solution-code-lines .syntax-control { color: #c586c0; }
  .solution-code-lines .syntax-type { color: #4ec9b0; }
  .solution-code-lines .syntax-predefined { color: #4fc1ff; }
  .solution-code-lines .syntax-string { color: #ce9178; }
  .solution-code-lines .syntax-number { color: #b5cea8; }
  .solution-code-lines .syntax-meta { color: #c586c0; }
  [data-theme="light"] .solution-code-section { border-color: #d5d9df; }
  .solution-video-section {
    margin: 28px 0 34px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #050605;
  }
  .solution-video-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 12px 15px;
    border-bottom: 1px solid #242922;
    background: #0d100d;
  }
  .solution-video-head span {
    flex: 0 0 auto;
    color: #8ec981;
    font-size: 11px;
    font-weight: 700;
  }
  .solution-video-head strong {
    min-width: 0;
    color: #f4f7ef;
    font-size: 14px;
    line-height: 1.45;
  }
  .solution-video-player {
    display: block;
    width: 100%;
    max-height: 520px;
    background: #000;
    aspect-ratio: 16 / 9;
  }
  .algorithm-animation {
    margin: 28px 0 34px;
    overflow: hidden;
    border: 1px solid color-mix(in srgb, var(--accent) 24%, var(--line));
    border-radius: 8px;
    background: #050605;
    color: #f4f7ef;
  }
  .algorithm-animation-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 16px;
    border-bottom: 1px solid #242922;
    background: #0d100d;
  }
  .algorithm-animation-kicker {
    display: block;
    margin-bottom: 5px;
    color: #8ec981;
    font-size: 11px;
    font-weight: 700;
  }
  .algorithm-animation h3 {
    margin: 0;
    padding: 0;
    border: 0;
    color: #f4f7ef;
    font-size: 17px;
    line-height: 1.35;
  }
  .algorithm-animation-controls {
    display: flex;
    flex: 0 0 auto;
    gap: 7px;
  }
  .algorithm-animation-controls button {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border: 1px solid #2f382d;
    border-radius: 6px;
    background: #141813;
    color: #dce6d5;
    cursor: pointer;
    font: 700 15px "DM Mono", monospace;
  }
  .algorithm-animation-controls button:hover,
  .algorithm-animation-controls button:focus-visible {
    border-color: #8ec981;
    color: #ffffff;
    outline: none;
  }
  .zeroes-stage {
    display: grid;
    min-height: 270px;
    align-content: center;
    gap: 24px;
    padding: 34px 18px 30px;
  }
  .zeroes-result {
    justify-self: center;
    color: #8ec981;
    font: 700 21px/1.3 "DM Mono", monospace;
  }
  .zeroes-array {
    display: flex;
    justify-content: center;
    gap: 6px;
    min-width: 0;
    padding: 34px 8px 42px;
    overflow-x: auto;
  }
  .zeroes-cell {
    position: relative;
    display: grid;
    width: 56px;
    height: 56px;
    flex: 0 0 auto;
    place-items: center;
    border: 2px solid #747b72;
    border-radius: 7px;
    background: #0c0f0b;
    color: #ffffff;
    font: 700 28px/1 "DM Mono", monospace;
    transition:
      transform .28s ease,
      border-color .28s ease,
      background .28s ease,
      box-shadow .28s ease;
  }
  .zeroes-cell.done {
    border-color: #8ec981;
    box-shadow: 0 0 0 2px rgb(142 201 129 / 22%);
  }
  .zeroes-cell.active {
    border-color: #61c4e8;
    background: #10191b;
    transform: translateY(-5px);
  }
  .zeroes-cell.swapped {
    border-color: #8ec981;
    background: #112013;
    transform: translateY(-9px) scale(1.03);
  }
  .zeroes-cell.zero-hit {
    border-color: #ef6b5a;
    background: #1d0e0b;
  }
  .zeroes-pointer {
    position: absolute;
    left: 50%;
    min-width: 42px;
    transform: translateX(-50%);
    text-align: center;
    font: 700 13px/1 "DM Mono", monospace;
  }
  .zeroes-pointer::before {
    display: block;
    margin: 0 auto 5px;
    font-size: 22px;
    line-height: 1;
  }
  .zeroes-pointer.slow {
    top: calc(100% + 8px);
    color: #61c4e8;
  }
  .zeroes-pointer.slow::before { content: "↑"; }
  .zeroes-pointer.fast {
    bottom: calc(100% + 8px);
    color: #ef6b5a;
  }
  .zeroes-pointer.fast::before {
    margin: 5px auto 0;
    content: "↓";
  }
  .zeroes-message {
    min-height: 28px;
    margin: 0;
    color: #cbd7c5;
    text-align: center;
    font-size: 14px;
    line-height: 1.8;
  }
  .zeroes-progress {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px 15px;
    border-top: 1px solid #242922;
    background: #0d100d;
  }
  .zeroes-progress span {
    flex: 0 0 auto;
    color: #8f9b8a;
    font: 700 11px "DM Mono", monospace;
  }
  .zeroes-progress div {
    overflow: hidden;
    width: 100%;
    height: 4px;
    border-radius: 999px;
    background: #252b23;
  }
  .zeroes-progress i {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: #8ec981;
    transition: width .25s ease;
  }
  .two-sum-animation {
    display: block;
    padding: 24px 12px 20px;
  }
  .two-sum-visual {
    display: grid;
    justify-items: center;
    gap: 28px;
    width: min(100%, 640px);
    margin: 0 auto;
  }
  .two-sum-track {
    display: flex;
    justify-content: center;
    gap: 8px;
    min-width: 0;
  }
  .two-sum-cell {
    position: relative;
    display: grid;
    width: 66px;
    height: 62px;
    flex: 0 0 auto;
    place-items: center;
    border: 2px solid #596158;
    border-radius: 7px;
    background: #0c0f0b;
    color: #f4f7ef;
    transition: transform .25s ease, border-color .25s ease, background .25s ease, box-shadow .25s ease;
  }
  .two-sum-cell strong { font: 800 22px/1 "DM Mono", monospace; }
  .two-sum-cell span { color: #7e8979; font: 700 9px/1 "DM Mono", monospace; }
  .two-sum-cell em {
    position: absolute;
    bottom: calc(100% + 7px);
    color: #61c4e8;
    font: normal 800 12px/1 "DM Mono", monospace;
  }
  .two-sum-cell em::after { content: " ↓"; }
  .two-sum-cell.active {
    border-color: #61c4e8;
    background: #0b1a20;
    transform: translateY(-4px);
  }
  .two-sum-cell.found {
    border-color: #8ec981;
    background: #112013;
    transform: translateY(-7px) scale(1.03);
    box-shadow: 0 0 0 2px rgb(142 201 129 / 22%);
  }
  .two-sum-map {
    display: flex;
    min-height: 38px;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 7px;
  }
  .two-sum-map > span { color: #8ec981; font: 800 13px/1 "DM Mono", monospace; }
  .two-sum-map code {
    padding: 8px 10px;
    border: 1px solid #3b4439;
    border-radius: 6px;
    background: #121612;
    color: #dce6d5;
    font: 700 12px/1 "DM Mono", monospace;
  }
  .two-sum-map code.needed {
    border-color: #8ec981;
    color: #bfff73;
    box-shadow: 0 0 0 2px rgb(142 201 129 / 16%);
  }
  .two-sum-map code.empty { color: #7e8979; }
  [data-algorithm-animation="find-anagrams"] { display: grid; grid-template-rows: auto auto auto; container-type: inline-size; background: #f5f8fc; color: #202c3c; }
  [data-algorithm-animation="find-anagrams"] .algorithm-animation-head { flex-direction: row; align-items: center; gap: 8px; padding: 8px 12px; background: #fff; border-color: #d5deea; }
  [data-algorithm-animation="find-anagrams"] .algorithm-animation-head > div:first-child { flex: 1; min-width: 0; }
  [data-algorithm-animation="find-anagrams"] .algorithm-animation-kicker { display: none; }
  [data-algorithm-animation="find-anagrams"] h3 { color: #202c3c; font-size: 14px; line-height: 1.4; }
  [data-algorithm-animation="find-anagrams"] .algorithm-animation-controls { gap: 4px; }
  [data-algorithm-animation="find-anagrams"] .algorithm-animation-controls button { width: 28px; height: 28px; background: #fff; color: #2563eb; border-color: #b8c9e0; }
  [data-algorithm-animation="find-anagrams"] .algorithm-animation-controls button:hover { background: #e9f0ff; border-color: #2563eb; }
  [data-algorithm-animation="find-anagrams"] .zeroes-stage { min-height: 0; min-height: calc(56.25cqw - 72px); gap: 6px; padding: 12px; }
  [data-algorithm-animation="find-anagrams"] .zeroes-result { order: 2; width: min(100%, 680px); justify-self: center; color: #147d45; font-size: 14px; line-height: 20px; }
  [data-algorithm-animation="find-anagrams"] .zeroes-message { order: 3; width: min(100%, 680px); justify-self: center; min-height: 36px; margin: 0; color: #334155; text-align: left; font-size: 13px; line-height: 18px; }
  [data-algorithm-animation="find-anagrams"] .zeroes-progress { padding: 6px 12px; background: #fff; border-color: #d5deea; }
  [data-algorithm-animation="find-anagrams"] .zeroes-progress span { color: #64748b; }
  [data-algorithm-animation="find-anagrams"] .zeroes-progress div { background: #e1e8f2; }
  [data-algorithm-animation="find-anagrams"] .zeroes-progress i { background: #2563eb; }
  .find-anagrams-animation { display: block; order: 1; padding: 0; overflow: visible; }
  .find-anagrams-visual { display: grid; grid-template-areas: "target legend counts" "phase phase counts" "track track counts"; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(170px, 1.4fr); gap: 6px 12px; width: min(100%, 680px); min-width: 0; margin: 0 auto; }
  .find-anagrams-meta { grid-area: target; display: flex; flex-wrap: wrap; align-items: center; gap: 4px; color: #334155; font-size: 11px; }
  .find-anagrams-meta span { margin-right: 2px; }
  .find-anagrams-meta b { display: grid; width: 22px; height: 24px; place-items: center; border: 1px solid color-mix(in srgb, var(--letter-color) 40%, white); border-radius: 4px; background: color-mix(in srgb, var(--letter-color) 8%, white); color: var(--letter-color); font: 700 14px "DM Mono", monospace; }
  .find-anagrams-legend { grid-area: legend; display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; font-size: 9px; font-weight: 600; }
  .find-anagrams-legend .is-enter { color: #087f68; }
  .find-anagrams-legend .is-leave { color: #c94345; }
  .find-anagrams-legend .is-match { color: #147d45; }
  .find-anagrams-phase { grid-area: phase; display: flex; min-height: 24px; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 8px; }
  .find-anagrams-phase strong { color: #2563eb; font-size: 12px; }
  .find-anagrams-phase span { color: #64748b; font-size: 10px; }
  [data-phase="remove"] .find-anagrams-phase strong { color: #c94345; }
  [data-phase="record"] .find-anagrams-phase strong { color: #147d45; }
  .find-anagrams-rail { grid-area: track; padding: 18px 3px 0; min-width: 0; }
  .find-anagrams-track { position: relative; display: grid; gap: 4px; width: 100%; min-width: 0; }
  .find-anagrams-cell { position: relative; display: grid; grid-template-rows: 36px 18px; min-width: 0; justify-items: stretch; text-align: center; }
  .find-anagrams-cell strong { display: grid; place-items: center; min-width: 0; border: 1px solid #d5deea; border-radius: 4px; background: #fff; color: var(--letter-color); font: 700 16px/1 "DM Mono", monospace; transition: background .2s, border-color .2s; }
  .find-anagrams-cell span { padding-top: 5px; color: #64748b; font: 700 9px/1 "DM Mono", monospace; }
  .find-anagrams-cell em { position: absolute; inset: -17px 0 auto; color: #2563eb; font: normal 700 9px/1 "DM Mono", monospace; }
  .find-anagrams-cell.in-window strong { background: color-mix(in srgb, var(--letter-color) 7%, white); }
  .find-anagrams-cell.enter strong { border: 2px solid #087f68; background: #e4f6ee; }
  .find-anagrams-cell.leave strong { border: 2px dashed #c94345; background: #fdebed; }
  .find-anagrams-window { position: absolute; top: -3px; height: 42px; z-index: 1; pointer-events: none; border: 3px solid #2563eb; border-radius: 6px; transition: left .38s ease, width .38s ease, border-color .2s ease; }
  .find-anagrams-window[hidden] { display: none; }
  .find-anagrams-frequencies { grid-area: counts; align-self: center; width: 100%; table-layout: fixed; border-spacing: 2px; font: 600 11px/1.4 "DM Mono", monospace; }
  .find-anagrams-frequencies caption { padding-bottom: 4px; color: #64748b; text-align: left; font: 11px "Noto Sans SC", sans-serif; }
  .find-anagrams-frequencies th, .find-anagrams-frequencies td { height: 24px; padding: 2px 0; border-radius: 3px; text-align: center; }
  .find-anagrams-frequencies th { background: #e9eef6; color: #475569; }
  .find-anagrams-frequencies td { background: #fff; color: #334155; }
  .find-anagrams-frequencies [data-comparison="equal"] { background: #e4f6ee; color: #147d45; }
  .find-anagrams-frequencies [data-comparison="different"] { background: #fdebed; color: #b32f40; }
  @container (max-width: 480px) {
    [data-algorithm-animation="find-anagrams"] .zeroes-stage { min-height: 0; padding: 10px; }
    .find-anagrams-visual { grid-template-areas: "target legend" "phase phase" "track track" "counts counts"; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 6px 8px; }
    .find-anagrams-cell { grid-template-rows: 32px 18px; }
    .find-anagrams-cell strong { font-size: 15px; }
    .find-anagrams-window { height: 38px; }
    .find-anagrams-frequencies th, .find-anagrams-frequencies td { height: 22px; }
  }
  @media (prefers-reduced-motion: reduce) { .find-anagrams-window { transition: none; } }
  .pascal-triangle-animation {
    display: block;
    padding: 18px 10px 24px;
  }
  .pascal-triangle-visual {
    display: grid;
    justify-items: center;
    gap: 0;
    width: min(100%, 420px);
    margin: 0 auto;
  }
  .pascal-row {
    display: flex;
    justify-content: center;
    height: 48px;
    margin-top: -6px;
  }
  .pascal-row:first-child {
    margin-top: 0;
  }
  .pascal-cell {
    display: grid;
    width: 56px;
    height: 56px;
    margin: 0 -1px;
    place-items: center;
    clip-path: polygon(50% 0, 93% 25%, 93% 75%, 50% 100%, 7% 75%, 7% 25%);
    background: #58ecec;
    color: #051111;
    font: 700 25px/1 "DM Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
    box-shadow: inset 0 0 0 2px #050505;
    transition: transform .24s ease, background .24s ease, opacity .24s ease;
  }
  .pascal-cell.parent {
    background: #ff946b;
    transform: translateY(-2px);
  }
  .pascal-cell.active {
    background: #91ff6b;
    transform: translateY(-4px) scale(1.04);
  }
  .pascal-cell.empty {
    background: #ffffff;
    color: transparent;
  }
  .product-except-self-animation {
    display: block;
    padding: 22px 12px 20px;
  }
  .product-except-self-visual {
    display: grid;
    width: min(100%, 620px);
    margin: 0 auto;
    gap: 12px;
  }
  .product-row {
    display: grid;
    grid-template-columns: 72px repeat(var(--product-count, 4), 58px);
    justify-content: center;
    gap: 6px;
    align-items: center;
  }
  .product-row-label {
    color: #98a493;
    text-align: right;
    font: 700 12px/1 "DM Mono", monospace;
  }
  .product-cell {
    position: relative;
    display: grid;
    width: 58px;
    height: 58px;
    place-items: center;
    border: 2px solid #596158;
    border-radius: 7px;
    background: #0c0f0b;
    color: #f4f7ef;
    transition: transform .25s ease, border-color .25s ease, background .25s ease, box-shadow .25s ease;
  }
  .product-cell strong {
    font: 800 18px/1 "DM Mono", monospace;
  }
  .product-cell span {
    position: absolute;
    right: 5px;
    bottom: 4px;
    color: #7e8979;
    font: 700 9px/1 "DM Mono", monospace;
  }
  .product-cell.active {
    transform: translateY(-6px);
  }
  .product-cell.prefix-phase {
    border-color: #61c4e8;
    background: #0b1a20;
    box-shadow: 0 0 0 2px rgb(97 196 232 / 16%);
  }
  .product-cell.suffix-phase {
    border-color: #8ec981;
    background: #112013;
    box-shadow: 0 0 0 2px rgb(142 201 129 / 18%);
  }
  .first-missing-animation {
    display: block;
    padding: 34px 12px 44px;
  }
  .first-missing-track {
    display: flex;
    justify-content: center;
    gap: 7px;
    min-width: 0;
  }
  .first-missing-cell {
    position: relative;
    display: grid;
    width: 58px;
    height: 58px;
    flex: 0 0 auto;
    place-items: center;
    border: 2px solid #596158;
    border-radius: 7px;
    background: #0c0f0b;
    color: #f4f7ef;
    transition: transform .25s ease, border-color .25s ease, background .25s ease, box-shadow .25s ease;
  }
  .first-missing-cell strong {
    font: 800 18px/1 "DM Mono", monospace;
  }
  .first-missing-cell > span {
    position: absolute;
    right: 5px;
    bottom: 4px;
    color: #7e8979;
    font: 700 9px/1 "DM Mono", monospace;
  }
  .first-missing-cell.active {
    border-color: #61c4e8;
    background: #0b1a20;
    transform: translateY(-6px);
  }
  .first-missing-cell.target {
    border-color: #f0b84f;
    box-shadow: 0 0 0 2px rgb(240 184 79 / 16%);
  }
  .first-missing-cell.swapped {
    border-color: #8ec981;
    background: #112013;
    transform: translateY(-9px) scale(1.03);
  }
  .first-missing-cell.correct {
    box-shadow: inset 0 -4px 0 #8ec981;
  }
  .first-missing-cell.answer {
    border-color: #ef6b5a;
    background: #1f0f0b;
  }
  .first-missing-cell em {
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    color: #61c4e8;
    transform: translateX(-50%);
    font: 800 11px/1 "DM Mono", monospace;
    font-style: normal;
  }
  .first-missing-cell em::before {
    display: block;
    margin-bottom: 4px;
    content: "↑";
    text-align: center;
    font-size: 16px;
  }
  .first-missing-cell em.target {
    top: auto;
    bottom: calc(100% + 8px);
    color: #f0b84f;
  }
  .first-missing-cell em.target::before {
    margin: 0 0 4px;
    content: "↓";
  }
  .set-zeroes-animation {
    display: block;
    padding: 24px 12px 22px;
  }
  .set-zeroes-grid {
    display: grid;
    grid-template-columns: repeat(var(--matrix-cols), 58px);
    justify-content: center;
    gap: 7px;
  }
  .set-zeroes-cell {
    position: relative;
    display: grid;
    width: 58px;
    height: 58px;
    place-items: center;
    border: 2px solid #596158;
    border-radius: 7px;
    background: #0c0f0b;
    color: #f4f7ef;
    transition: transform .25s ease, border-color .25s ease, background .25s ease, box-shadow .25s ease;
  }
  .set-zeroes-cell strong {
    font: 800 18px/1 "DM Mono", monospace;
  }
  .set-zeroes-cell span {
    position: absolute;
    right: 4px;
    bottom: 4px;
    color: #7e8979;
    font: 700 8px/1 "DM Mono", monospace;
  }
  .set-zeroes-cell.marker-row,
  .set-zeroes-cell.marker-col {
    border-style: dashed;
  }
  .set-zeroes-cell.zero {
    color: #91ddfa;
  }
  .set-zeroes-cell.active {
    border-color: #61c4e8;
    background: #0b1a20;
    transform: translateY(-6px);
  }
  .set-zeroes-cell.marked-row,
  .set-zeroes-cell.marked-col {
    border-color: #f0b84f;
    box-shadow: 0 0 0 2px rgb(240 184 79 / 16%);
  }
  .set-zeroes-cell.marked-row.marked-col,
  .set-zeroes-cell.active.zero {
    border-color: #8ec981;
    background: #112013;
  }
  .rotate-matrix-animation {
    display: block;
    padding: 24px 12px 22px;
  }
  .rotate-matrix-grid {
    display: grid;
    grid-template-columns: repeat(var(--matrix-cols), 58px);
    justify-content: center;
    gap: 7px;
  }
  .rotate-matrix-cell {
    position: relative;
    display: grid;
    width: 58px;
    height: 58px;
    place-items: center;
    border: 2px solid #596158;
    border-radius: 7px;
    background: #0c0f0b;
    color: #f4f7ef;
    transition: transform .25s ease, border-color .25s ease, background .25s ease, box-shadow .25s ease;
  }
  .rotate-matrix-cell strong {
    font: 800 18px/1 "DM Mono", monospace;
  }
  .rotate-matrix-cell span {
    position: absolute;
    right: 4px;
    bottom: 4px;
    color: #7e8979;
    font: 700 8px/1 "DM Mono", monospace;
  }
  .rotate-matrix-cell.diagonal {
    border-style: dashed;
  }
  .rotate-matrix-cell.active {
    border-color: #61c4e8;
    background: #0b1a20;
    box-shadow: 0 0 0 2px rgb(97 196 232 / 18%);
    transform: translateY(-6px);
  }
  .search-matrix-animation {
    display: block;
    padding: 24px 12px 34px;
  }
  .search-matrix-grid {
    display: grid;
    grid-template-columns: repeat(var(--matrix-cols), 54px);
    justify-content: center;
    gap: 6px;
  }
  .search-matrix-cell {
    position: relative;
    display: grid;
    width: 54px;
    height: 54px;
    place-items: center;
    border: 2px solid #596158;
    border-radius: 7px;
    background: #0c0f0b;
    color: #f4f7ef;
    transition: transform .25s ease, opacity .25s ease, border-color .25s ease, background .25s ease;
  }
  .search-matrix-cell strong {
    font: 800 16px/1 "DM Mono", monospace;
  }
  .search-matrix-cell span {
    position: absolute;
    right: 4px;
    bottom: 4px;
    color: #7e8979;
    font: 700 8px/1 "DM Mono", monospace;
  }
  .search-matrix-cell em {
    position: absolute;
    top: calc(100% + 7px);
    left: 50%;
    color: #61c4e8;
    transform: translateX(-50%);
    font: 800 10px/1 "DM Mono", monospace;
    font-style: normal;
  }
  .search-matrix-cell em::before {
    display: block;
    margin-bottom: 3px;
    content: "↑";
    text-align: center;
    font-size: 14px;
  }
  .search-matrix-cell.eliminated {
    opacity: .38;
  }
  .search-matrix-cell.active {
    border-color: #61c4e8;
    background: #0b1a20;
    opacity: 1;
    transform: translateY(-6px);
  }
  .search-matrix-cell.found {
    border-color: #8ec981;
    background: #112013;
    box-shadow: 0 0 0 2px rgb(142 201 129 / 18%);
  }
  .container-water-bars {
    align-items: end;
    gap: 8px;
    min-height: 230px;
    padding-top: 48px;
  }
  .water-bar-cell {
    position: relative;
    display: grid;
    width: 44px;
    min-height: 190px;
    flex: 0 0 auto;
    align-items: end;
    justify-items: center;
  }
  .water-bar {
    display: grid;
    width: 28px;
    min-height: 14px;
    place-items: start center;
    border: 2px solid #6a7480;
    border-bottom-width: 4px;
    border-radius: 5px 5px 2px 2px;
    background: linear-gradient(180deg, #3f86c8 0%, #1a4f88 100%);
    color: #ffffff;
    font: 700 11px/1 "DM Mono", monospace;
    padding-top: 5px;
    transition:
      height .25s ease,
      border-color .25s ease,
      box-shadow .25s ease,
      transform .25s ease;
  }
  .water-bar-cell.active .water-bar {
    border-color: #8ec981;
    box-shadow: 0 0 0 2px rgb(142 201 129 / 22%);
    transform: translateY(-3px);
  }
  .water-bar-cell.moving .water-bar {
    border-color: #ef6b5a;
    box-shadow: 0 0 0 2px rgb(239 107 90 / 22%);
  }
  .water-pointer {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    color: #f4f7ef;
    font: 700 12px/1 "DM Mono", monospace;
  }
  .water-pointer.left { bottom: -24px; color: #61c4e8; }
  .water-pointer.right { top: -28px; color: #ef6b5a; }
  .three-sum-array {
    gap: 10px;
    padding-top: 54px;
    padding-bottom: 58px;
  }
  .three-sum-cell {
    position: relative;
    display: grid;
    width: 58px;
    height: 58px;
    flex: 0 0 auto;
    place-items: center;
    border: 2px solid #747b72;
    border-radius: 7px;
    background: #0c0f0b;
    color: #ffffff;
    font: 700 22px/1 "DM Mono", monospace;
    transition:
      transform .28s ease,
      border-color .28s ease,
      background .28s ease,
      box-shadow .28s ease;
  }
  .three-sum-cell.fixed {
    border-color: #f0b84f;
    background: #1f1708;
    box-shadow: 0 0 0 2px rgb(240 184 79 / 20%);
  }
  .three-sum-cell.left {
    border-color: #61c4e8;
    background: #0b1a20;
  }
  .three-sum-cell.right {
    border-color: #ef6b5a;
    background: #1f0f0b;
  }
  .three-sum-cell.found {
    border-color: #8ec981;
    background: #112013;
    transform: translateY(-8px) scale(1.04);
    box-shadow: 0 0 0 2px rgb(142 201 129 / 24%);
  }
  .three-sum-cell.moving {
    transform: translateY(-7px);
    box-shadow: 0 0 0 2px rgb(255 255 255 / 14%);
  }
  .three-sum-cell.skip {
    border-color: #8f9b8a;
    opacity: .62;
  }
  .three-sum-value {
    display: inline-grid;
    place-items: center;
  }
  .three-sum-pointer {
    position: absolute;
    left: 50%;
    min-width: 46px;
    transform: translateX(-50%);
    text-align: center;
    white-space: nowrap;
    font: 800 13px/1 "DM Mono", monospace;
  }
  .three-sum-pointer::before {
    display: block;
    margin: 0 auto 5px;
    font-size: 21px;
    line-height: 1;
  }
  .three-sum-pointer.k {
    top: calc(100% + 9px);
    color: #f0b84f;
  }
  .three-sum-pointer.k::before { content: "↑"; }
  .three-sum-pointer.i {
    bottom: calc(100% + 9px);
    color: #61c4e8;
  }
  .three-sum-pointer.i::before { content: "↓"; }
  .three-sum-pointer.j {
    bottom: calc(100% + 9px);
    color: #ef6b5a;
  }
  .three-sum-pointer.j::before { content: "↓"; }
  .trap-array {
    display: grid;
    grid-template-columns: repeat(var(--trap-bars, 12), minmax(0, 1fr));
    align-items: end;
    gap: clamp(2px, .8%, 7px);
    width: 100%;
    max-width: 620px;
    margin-inline: auto;
    min-height: 238px;
    padding-top: 50px;
    padding-bottom: 54px;
    overflow-x: visible;
  }
  .trap-cell {
    position: relative;
    display: grid;
    width: 100%;
    min-width: 0;
    min-height: 190px;
    align-items: end;
    justify-items: center;
  }
  .trap-stack {
    position: relative;
    display: flex;
    width: min(100%, 28px);
    min-height: 16px;
    flex-direction: column;
    justify-content: flex-end;
    overflow: hidden;
    border: 1px solid #384337;
    border-radius: 6px 6px 3px 3px;
    background: #0b0f0c;
    transition:
      transform .28s ease,
      border-color .28s ease,
      box-shadow .28s ease;
  }
  .trap-bar {
    display: grid;
    min-height: 12px;
    place-items: start center;
    padding-top: 4px;
    background: linear-gradient(180deg, #8ec981, #4e8c46);
    color: #061007;
    font: 800 11px/1 "DM Mono", monospace;
  }
  .trap-water {
    display: block;
    min-height: 0;
    background:
      linear-gradient(180deg, rgb(97 196 232 / 85%), rgb(55 139 190 / 78%));
  }
  .trap-cell.active .trap-stack {
    border-color: #f0b84f;
    box-shadow: 0 0 0 2px rgb(240 184 79 / 18%);
  }
  .trap-cell.moving .trap-stack {
    transform: translateY(-6px);
  }
  .trap-pointer {
    position: absolute;
    left: 50%;
    width: 100%;
    transform: translateX(-50%);
    text-align: center;
    white-space: nowrap;
    font: 800 11px/1 "DM Mono", monospace;
  }
  .trap-pointer::before {
    display: block;
    margin: 0 auto 5px;
    font-size: 21px;
    line-height: 1;
  }
  .trap-pointer.left {
    bottom: -28px;
    color: #61c4e8;
  }
  .trap-pointer.left::before { content: "↑"; }
  .trap-pointer.right {
    top: -30px;
    color: #ef6b5a;
  }
  .trap-pointer.right::before { content: "↓"; }
  .substring-array {
    --substring-cell-width: 54px;
    --substring-gap: 8px;
    position: relative;
    gap: 0;
    padding-top: 58px;
    padding-bottom: 62px;
  }
  .substring-track {
    position: relative;
    display: flex;
    gap: var(--substring-gap);
    flex: 0 0 auto;
  }
  .substring-window-box {
    position: absolute;
    z-index: 0;
    top: -7px;
    left: calc(var(--window-start) * (var(--substring-cell-width) + var(--substring-gap)) - 6px);
    width: calc(var(--window-count) * var(--substring-cell-width) + (var(--window-count) - 1) * var(--substring-gap) + 12px);
    height: 72px;
    border: 3px solid #61c4e8;
    border-radius: 10px;
    background: rgb(97 196 232 / 8%);
    box-shadow:
      0 0 0 2px rgb(97 196 232 / 14%),
      inset 0 0 0 1px rgb(255 255 255 / 12%);
    pointer-events: none;
    transition:
      left .28s ease,
      width .28s ease;
  }
  .substring-cell {
    position: relative;
    z-index: 1;
    display: grid;
    width: 54px;
    height: 58px;
    flex: 0 0 auto;
    place-items: center;
    border: 2px solid #747b72;
    border-radius: 7px;
    background: #0c0f0b;
    color: #ffffff;
    transition:
      transform .28s ease,
      border-color .28s ease,
      background .28s ease,
      box-shadow .28s ease;
  }
  .substring-cell.in-window {
    border-color: #61c4e8;
    background: #0b1a20;
  }
  .substring-cell.best {
    box-shadow: inset 0 -4px 0 #8ec981;
  }
  .substring-cell.active {
    transform: translateY(-6px);
  }
  .substring-cell.duplicate {
    border-color: #ef6b5a;
    background: #1f0f0b;
    box-shadow: 0 0 0 2px rgb(239 107 90 / 22%);
  }
  .substring-cell.left-target {
    border-color: #f0b84f;
    box-shadow: 0 0 0 2px rgb(240 184 79 / 24%);
  }
  .minimum-window-cell.covered {
    color: #ffffff;
    box-shadow: inset 0 4px 0 #f0b84f;
  }
  .minimum-window-cell.best {
    border-color: #8ec981;
    box-shadow: inset 0 -5px 0 #8ec981;
  }
  .minimum-window-box {
    border-color: #61c4e8;
    background: rgb(97 196 232 / 10%);
  }
  .substring-value {
    font: 800 24px/1 "DM Mono", monospace;
  }
  .substring-index {
    position: absolute;
    right: 5px;
    bottom: 4px;
    color: #8f9b8a;
    font: 700 10px/1 "DM Mono", monospace;
  }
  .substring-pointer {
    position: absolute;
    left: 50%;
    min-width: 48px;
    transform: translateX(-50%);
    text-align: center;
    white-space: nowrap;
    font: 800 12px/1 "DM Mono", monospace;
  }
  .substring-pointer::before {
    display: block;
    margin: 0 auto 5px;
    font-size: 21px;
    line-height: 1;
  }
  .substring-pointer.left {
    bottom: -30px;
    color: #61c4e8;
  }
  .substring-pointer.left::before { content: "↑"; }
  .substring-pointer.right {
    top: -30px;
    color: #ef6b5a;
  }
  .substring-pointer.right::before { content: "↓"; }
  .longest-palindrome-animation {
    display: block;
    padding: 24px 12px 22px;
  }
  .longest-palindrome-visual {
    display: grid;
    width: min(100%, 760px);
    margin: 0 auto;
    gap: 14px;
    justify-items: center;
  }
  .longest-palindrome-call {
    padding: 8px 12px;
    border: 1px solid #f0b84f;
    border-radius: 6px;
    background: #1f1708;
    color: #fff3c4;
    font: 800 14px/1 "DM Mono", monospace;
  }
  .longest-palindrome-track {
    --pal-cell-width: 54px;
    --pal-gap: 8px;
    display: flex;
    position: relative;
    max-width: 100%;
    gap: var(--pal-gap);
    overflow-x: auto;
    padding: 62px 4px 42px;
  }
  .longest-palindrome-center-arrow {
    position: absolute;
    z-index: 3;
    top: 4px;
    left: calc(var(--center-position) * (var(--pal-cell-width) + var(--pal-gap)) + var(--pal-cell-width) / 2 - 26px);
    display: grid;
    width: 52px;
    justify-items: center;
    color: #f0b84f;
    pointer-events: none;
  }
  .longest-palindrome-center-arrow span {
    padding: 3px 6px;
    border: 1px solid #f0b84f;
    border-radius: 999px;
    background: #1f1708;
    color: #fff3c4;
    font: 800 10px/1 "DM Mono", monospace;
  }
  .longest-palindrome-center-arrow strong {
    margin-top: 3px;
    color: #f0b84f;
    font: 900 24px/1 "DM Mono", monospace;
  }
  .longest-palindrome-candidate-box {
    position: absolute;
    z-index: 0;
    top: 53px;
    left: calc(var(--candidate-start) * (var(--pal-cell-width) + var(--pal-gap)) - 6px);
    width: calc(var(--candidate-count) * var(--pal-cell-width) + (var(--candidate-count) - 1) * var(--pal-gap) + 12px);
    height: 70px;
    border: 3px solid #8ec981;
    border-radius: 10px;
    background: rgb(142 201 129 / 9%);
    box-shadow: inset 0 0 0 1px rgb(255 255 255 / 10%);
    pointer-events: none;
    transition:
      left .25s ease,
      width .25s ease;
  }
  .longest-palindrome-cell {
    position: relative;
    z-index: 1;
    display: grid;
    width: var(--pal-cell-width);
    height: 58px;
    flex: 0 0 auto;
    place-items: center;
    border: 2px solid #747b72;
    border-radius: 7px;
    background: #0c0f0b;
    color: #fff;
    transition:
      transform .25s ease,
      border-color .25s ease,
      background .25s ease,
      box-shadow .25s ease;
  }
  .longest-palindrome-cell strong {
    font: 800 24px/1 "DM Mono", monospace;
  }
  .longest-palindrome-cell span {
    position: absolute;
    right: 5px;
    bottom: 4px;
    color: #8f9b8a;
    font: 700 10px/1 "DM Mono", monospace;
  }
  .longest-palindrome-cell.active {
    border-color: #61c4e8;
    background: #0b1a20;
  }
  .longest-palindrome-cell.match {
    border-color: #8ec981;
    background: #102014;
  }
  .longest-palindrome-cell.mismatch {
    border-color: #ef6b5a;
    background: #1f0f0b;
    box-shadow: 0 0 0 2px rgb(239 107 90 / 22%);
  }
  .longest-palindrome-cell.center {
    box-shadow: inset 0 5px 0 #f0b84f;
  }
  .longest-palindrome-cell.best {
    box-shadow: inset 0 -5px 0 #8ec981;
  }
  .longest-palindrome-cell.left-pointer,
  .longest-palindrome-cell.right-pointer {
    transform: translateY(-5px);
  }
  .longest-palindrome-cell em {
    position: absolute;
    left: 50%;
    display: inline-flex;
    min-width: 58px;
    align-items: center;
    justify-content: center;
    gap: 3px;
    transform: translateX(-50%);
    text-align: center;
    font: 800 11px/1 "DM Mono", monospace;
    font-style: normal;
    white-space: nowrap;
  }
  .longest-palindrome-cell em.left {
    bottom: -24px;
    color: #61c4e8;
  }
  .longest-palindrome-cell em.right {
    top: -24px;
    color: #ef6b5a;
  }
  .longest-palindrome-cell em span {
    position: static;
    color: inherit;
    font: 900 14px/1 "DM Mono", monospace;
  }
  .longest-palindrome-status {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
  }
  .longest-palindrome-status span,
  .longest-palindrome-formula {
    padding: 8px 11px;
    border: 1px solid #2f382d;
    border-radius: 6px;
    background: #0d100d;
    color: #dce6d5;
    font: 800 13px/1.35 "DM Mono", monospace;
  }
  .longest-palindrome-status .longest-palindrome-best {
    border-color: #8ec981;
    background: #102014;
    color: #dff6d8;
  }
  .longest-palindrome-formula {
    max-width: 100%;
    white-space: normal;
    text-align: center;
  }
  .parentheses-animation {
    display: block;
    padding: 24px 12px 20px;
  }
  .parentheses-visual {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 120px;
    width: min(100%, 680px);
    margin: 0 auto;
    gap: 18px;
    align-items: stretch;
  }
  .parentheses-panel {
    display: grid;
    min-width: 0;
    align-content: center;
    gap: 10px;
  }
  .parentheses-label {
    color: #98a493;
    text-align: center;
    font-size: 11px;
    font-weight: 700;
  }
  .parentheses-track {
    display: flex;
    justify-content: center;
    gap: 7px;
    min-width: 0;
    overflow-x: auto;
    padding: 8px 2px 14px;
  }
  .parentheses-cell {
    display: grid;
    width: 50px;
    height: 58px;
    flex: 0 0 auto;
    place-items: center;
    border: 2px solid #747b72;
    border-radius: 7px;
    background: #0c0f0b;
    color: #fff;
    transition:
      transform .25s ease,
      border-color .25s ease,
      background .25s ease,
      opacity .25s ease;
  }
  .parentheses-cell strong {
    font: 800 24px/1 "DM Mono", monospace;
  }
  .parentheses-cell span {
    color: #8f9b8a;
    font: 700 10px/1 "DM Mono", monospace;
  }
  .parentheses-cell.processed {
    opacity: .64;
  }
  .parentheses-cell.active {
    border-color: #61c4e8;
    background: #0b1a20;
    transform: translateY(-6px);
  }
  .parentheses-cell.matched {
    border-color: #8ec981;
    background: #112013;
  }
  .parentheses-cell.failed {
    border-color: #ef6b5a;
    background: #1f0f0b;
    box-shadow: 0 0 0 2px rgb(239 107 90 / 20%);
  }
  .parentheses-stack-panel {
    min-height: 170px;
  }
  .parentheses-stack {
    display: flex;
    min-height: 150px;
    flex-direction: column;
    justify-content: flex-end;
    gap: 6px;
    padding: 10px;
    border: 1px solid #2f382d;
    border-radius: 7px;
    background: #0b0f0c;
  }
  .parentheses-stack em {
    margin: auto;
    color: #8f9b8a;
    font-style: normal;
  }
  .parentheses-stack-item {
    display: grid;
    height: 34px;
    place-items: center;
    border: 1px solid #384337;
    border-radius: 6px;
    background: #141813;
    color: #f4f7ef;
    font: 800 18px/1 "DM Mono", monospace;
  }
  .parentheses-stack-item.top {
    border-color: #f0b84f;
    background: #1f1708;
    box-shadow: 0 0 0 2px rgb(240 184 79 / 18%);
  }
  .max-subarray-animation {
    display: block;
    padding: 24px 12px 20px;
  }
  .max-subarray-visual {
    display: grid;
    width: min(100%, 780px);
    margin: 0 auto;
    gap: 10px;
  }
  .max-subarray-row {
    display: grid;
    grid-template-columns: 46px repeat(9, 56px);
    justify-content: center;
    gap: 6px;
    min-width: 0;
    overflow-x: auto;
    padding: 2px 0;
  }
  .max-subarray-label {
    display: grid;
    min-width: 42px;
    place-items: center;
    color: #98a493;
    font: 800 11px/1 "DM Mono", monospace;
  }
  .max-subarray-cell {
    display: grid;
    width: 56px;
    height: 56px;
    flex: 0 0 auto;
    place-items: center;
    border: 2px solid #747b72;
    border-radius: 7px;
    background: #0c0f0b;
    color: #fff;
    transition:
      transform .25s ease,
      border-color .25s ease,
      background .25s ease,
      box-shadow .25s ease,
      opacity .25s ease;
  }
  .max-subarray-cell strong {
    font: 800 20px/1 "DM Mono", monospace;
  }
  .max-subarray-cell span {
    color: #8f9b8a;
    font: 700 9px/1 "DM Mono", monospace;
  }
  .max-subarray-cell.current-range {
    border-color: #61c4e8;
    background: #0b1a20;
  }
  .max-subarray-cell.best-range {
    box-shadow: inset 0 -5px 0 #8ec981;
  }
  .max-subarray-cell.active {
    border-color: #f0b84f;
    transform: translateY(-5px);
    box-shadow: 0 0 0 2px rgb(240 184 79 / 18%);
  }
  .max-subarray-dp-cell {
    background: #10130f;
  }
  .max-subarray-dp-cell.empty {
    opacity: .35;
  }
  .max-subarray-formula {
    justify-self: center;
    margin-top: 6px;
    padding: 8px 11px;
    border: 1px solid #2f382d;
    border-radius: 6px;
    background: #0d100d;
    color: #dce6d5;
    font: 800 13px/1.4 "DM Mono", monospace;
    white-space: nowrap;
  }
  .house-robber-animation {
    display: block;
    padding: 24px 12px 20px;
  }
  .house-robber-visual {
    display: grid;
    width: min(100%, 760px);
    margin: 0 auto;
    gap: 12px;
  }
  .house-robber-row {
    display: flex;
    justify-content: center;
    gap: 8px;
    min-width: 0;
    overflow-x: auto;
    padding: 6px 0;
  }
  .house-robber-label {
    display: grid;
    width: 44px;
    flex: 0 0 44px;
    place-items: center;
    color: #98a493;
    font: 800 11px/1 "DM Mono", monospace;
  }
  .house-robber-house,
  .house-robber-dp-cell {
    position: relative;
    display: grid;
    width: 62px;
    height: 62px;
    flex: 0 0 62px;
    place-items: center;
    border: 2px solid #747b72;
    border-radius: 7px;
    background: #0c0f0b;
    color: #fff;
    transition:
      transform .25s ease,
      border-color .25s ease,
      background .25s ease,
      box-shadow .25s ease,
      opacity .25s ease;
  }
  .house-robber-house {
    padding-top: 7px;
  }
  .house-robber-roof {
    position: absolute;
    top: -8px;
    left: 12px;
    width: 34px;
    height: 34px;
    border-top: 2px solid #747b72;
    border-left: 2px solid #747b72;
    background: #0c0f0b;
    transform: rotate(45deg);
    transition:
      border-color .25s ease,
      background .25s ease;
  }
  .house-robber-house strong,
  .house-robber-dp-cell strong {
    position: relative;
    z-index: 1;
    font: 800 20px/1 "DM Mono", monospace;
  }
  .house-robber-house span:not(.house-robber-roof),
  .house-robber-dp-cell span {
    position: relative;
    z-index: 1;
    color: #8f9b8a;
    font: 700 9px/1 "DM Mono", monospace;
  }
  .house-robber-house.active,
  .house-robber-dp-cell.active {
    border-color: #f0b84f;
    transform: translateY(-5px);
    box-shadow: 0 0 0 2px rgb(240 184 79 / 18%);
  }
  .house-robber-house.active .house-robber-roof {
    border-color: #f0b84f;
  }
  .house-robber-house.selected {
    border-color: #8ec981;
    background: #102014;
    box-shadow: inset 0 -5px 0 #8ec981;
  }
  .house-robber-house.selected .house-robber-roof {
    border-color: #8ec981;
    background: #102014;
  }
  .house-robber-house.processed {
    opacity: .55;
  }
  .house-robber-dp-cell {
    background: #10130f;
  }
  .house-robber-dp-cell.empty {
    opacity: .35;
  }
  .house-robber-formula {
    justify-self: center;
    margin-top: 4px;
    padding: 8px 11px;
    border: 1px solid #2f382d;
    border-radius: 6px;
    background: #0d100d;
    color: #dce6d5;
    font: 800 13px/1.4 "DM Mono", monospace;
    white-space: nowrap;
  }
  .perfect-squares-animation {
    display: block;
    padding: 22px 12px 20px;
  }
  .perfect-squares-visual {
    display: grid;
    width: min(100%, 820px);
    margin: 0 auto;
    gap: 12px;
  }
  .perfect-squares-track {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(44px, 54px));
    justify-content: center;
    gap: 6px;
    width: 100%;
    min-width: 0;
    overflow: visible;
    padding: 7px 0;
  }
  .perfect-squares-cell {
    display: grid;
    width: 54px;
    height: 54px;
    place-items: center;
    border: 2px solid #747b72;
    border-radius: 7px;
    background: #0c0f0b;
    color: #fff;
    transition:
      transform .25s ease,
      border-color .25s ease,
      background .25s ease,
      box-shadow .25s ease,
      opacity .25s ease;
  }
  .perfect-squares-cell strong {
    font: 800 19px/1 "DM Mono", monospace;
  }
  .perfect-squares-cell span {
    color: #8f9b8a;
    font: 700 9px/1 "DM Mono", monospace;
  }
  .perfect-squares-cell.empty {
    opacity: .32;
  }
  .perfect-squares-cell.source {
    border-color: #61c4e8;
    background: #0b1a20;
    box-shadow: inset 0 -5px 0 #61c4e8;
  }
  .perfect-squares-cell.active {
    border-color: #f0b84f;
    transform: translateY(-5px);
    box-shadow: 0 0 0 2px rgb(240 184 79 / 18%);
  }
  .perfect-squares-cell.updated {
    border-color: #8ec981;
    background: #102014;
    box-shadow: inset 0 -5px 0 #8ec981;
  }
  .perfect-squares-cell.done {
    border-color: #8ec981;
    background: #102014;
    transform: translateY(-5px);
  }
  .perfect-squares-formula {
    justify-self: center;
    padding: 8px 11px;
    border: 1px solid #2f382d;
    border-radius: 6px;
    background: #0d100d;
    color: #dce6d5;
    font: 800 13px/1.4 "DM Mono", monospace;
    white-space: nowrap;
  }
  .perfect-squares-options {
    display: flex;
    justify-content: center;
    gap: 8px;
    min-height: 30px;
  }
  .perfect-squares-option {
    display: grid;
    min-width: 34px;
    height: 28px;
    place-items: center;
    border: 1px solid #384337;
    border-radius: 999px;
    background: #10130f;
    color: #dce6d5;
    font: 800 12px/1 "DM Mono", monospace;
  }
  .perfect-squares-option.active {
    border-color: #f0b84f;
    background: #1f1708;
    color: #fff;
  }
  .word-break-animation {
    display: block;
    padding: 20px 12px 26px;
  }
  .word-break-visual {
    --word-cell-size: 38px;
    --word-gap: 5px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 96px;
    width: min(100%, 760px);
    margin: 0 auto;
    gap: 34px;
    align-items: center;
  }
  .word-break-main {
    display: grid;
    min-width: 0;
    gap: 8px;
    justify-items: center;
  }
  .word-break-overview {
    justify-self: start;
    margin: 0 0 36px 6px;
    color: #f4f7ef;
    font: 800 22px/1 "Times New Roman", Georgia, serif;
    letter-spacing: 9px;
  }
  .word-break-label {
    color: #dce6d5;
    font: 500 25px/1 "Times New Roman", Georgia, serif;
  }
  .word-break-string,
  .word-break-dp {
    position: relative;
    display: flex;
    justify-content: center;
    gap: var(--word-gap);
    max-width: 100%;
  }
  .word-break-range-box {
    position: absolute;
    z-index: 0;
    top: -2px;
    left: calc(var(--word-start) * (var(--word-cell-size) + var(--word-gap)) - 1px);
    width: calc(var(--word-count) * var(--word-cell-size) + (var(--word-count) - 1) * var(--word-gap) + 2px);
    height: calc(var(--word-cell-size) + 4px);
    border: 2px solid #f5ee42;
    border-radius: 0;
    pointer-events: none;
  }
  .word-break-range-box.matched {
    border-color: #8ec981;
  }
  .word-break-char,
  .word-break-dp-cell {
    position: relative;
    display: grid;
    width: var(--word-cell-size);
    height: var(--word-cell-size);
    flex: 0 0 var(--word-cell-size);
    place-items: center;
    border: 2px solid transparent;
    background: transparent;
    color: #f4f7ef;
    transition:
      transform .25s ease,
      border-color .25s ease,
      background .25s ease,
      box-shadow .25s ease;
  }
  .word-break-char strong,
  .word-break-dp-cell strong {
    font: 800 22px/1 "Times New Roman", Georgia, serif;
  }
  .word-break-char span {
    display: none;
  }
  .word-break-dp-cell span {
    position: absolute;
    left: 50%;
    bottom: calc(100% + 6px);
    color: #dce6d5;
    transform: translateX(-50%);
    font: 700 18px/1 "Times New Roman", Georgia, serif;
  }
  .word-break-char.range {
    border-color: transparent;
    background: transparent;
    box-shadow: none;
  }
  .word-break-char.matched {
    border-color: transparent;
    background: transparent;
    box-shadow: none;
  }
  .word-break-dp {
    margin-top: 22px;
  }
  .word-break-dp-cell {
    border-color: #5bbce2;
    background: #050605;
  }
  .word-break-dp-cell.true {
    border-color: #8ec981;
    color: #bdf0b2;
  }
  .word-break-dp-cell.false {
    color: #ef7b6d;
  }
  .word-break-dp-cell.unknown {
    color: #dce6d5;
  }
  .word-break-dp-cell.active {
    border-color: #f5ee42;
    transform: translateY(-3px);
  }
  .word-break-dp-cell.source {
    border-color: #61c4e8;
    background: #0b1a20;
  }
  .word-break-dp-cell.set-true {
    border-color: #8ec981;
    background: #102014;
    transform: translateY(-4px);
    box-shadow: 0 0 0 2px rgb(142 201 129 / 18%);
  }
  .word-break-dp-cell em {
    position: absolute;
    top: calc(100% + 5px);
    left: 50%;
    color: #ef7b6d;
    transform: translateX(-50%);
    font: 800 20px/1 "DM Mono", monospace;
    font-style: normal;
  }
  .word-break-dp-cell.true em {
    color: #8ec981;
  }
  .word-break-formula {
    max-width: 100%;
    margin-top: 26px;
    padding: 8px 10px;
    overflow-wrap: anywhere;
    border: 1px solid #2f382d;
    border-radius: 6px;
    background: #0d100d;
    color: #dce6d5;
    font: 800 12px/1.45 "DM Mono", monospace;
    text-align: center;
  }
  .word-break-dict {
    display: grid;
    gap: 9px;
    justify-items: stretch;
    padding: 14px 10px;
    border: 2px dashed #d8ded4;
    color: #dce6d5;
  }
  .word-break-dict > span {
    color: #98a493;
    font: 800 11px/1 "DM Mono", monospace;
    text-align: center;
  }
  .word-break-dict code {
    display: block;
    padding: 0 6px;
    border-radius: 4px;
    color: #bfe6ae;
    font: 800 21px/1 "DM Mono", monospace;
    text-align: center;
  }
  .word-break-dict code.active {
    background: #1f1708;
    color: #fff;
  }
  .lis-animation {
    display: block;
    padding: 24px 12px 28px;
  }
  .lis-visual {
    display: grid;
    width: min(100%, 720px);
    margin: 0 auto;
    gap: 16px;
  }
  .lis-row {
    display: flex;
    justify-content: center;
    gap: 7px;
    min-width: 0;
    padding: 8px 0 14px;
  }
  .lis-label {
    display: grid;
    width: 54px;
    flex: 0 0 54px;
    place-items: center;
    color: #dce6d5;
    font: 800 13px/1 "DM Mono", monospace;
  }
  .lis-cell,
  .lis-dp-cell {
    position: relative;
    display: grid;
    width: 58px;
    height: 58px;
    flex: 0 0 58px;
    place-items: center;
    border: 2px solid #596158;
    border-radius: 7px;
    background: #0c0f0b;
    color: #f4f7ef;
    transition:
      transform .25s ease,
      border-color .25s ease,
      background .25s ease,
      box-shadow .25s ease,
      opacity .25s ease;
  }
  .lis-cell strong,
  .lis-dp-cell strong {
    font: 800 18px/1 "DM Mono", monospace;
  }
  .lis-cell > span,
  .lis-dp-cell > span {
    position: absolute;
    right: 4px;
    bottom: 4px;
    color: #7e8979;
    font: 700 8px/1 "DM Mono", monospace;
  }
  .lis-cell.active-i,
  .lis-dp-cell.active-i {
    border-color: #f0b84f;
    background: #1f1708;
    transform: translateY(-5px);
  }
  .lis-cell.active-j,
  .lis-dp-cell.source {
    border-color: #61c4e8;
    background: #0b1a20;
  }
  .lis-cell.can-append {
    box-shadow: inset 0 -5px 0 #8ec981;
  }
  .lis-cell.skip {
    box-shadow: inset 0 -5px 0 #ef7b6d;
  }
  .lis-dp-cell.updated {
    border-color: #8ec981;
    background: #102014;
    box-shadow: 0 0 0 2px rgb(142 201 129 / 18%);
  }
  .lis-cell em {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    font: 800 11px/1 "DM Mono", monospace;
    font-style: normal;
  }
  .lis-cell em.i {
    top: calc(100% + 7px);
    color: #f0b84f;
  }
  .lis-cell em.i::before {
    display: block;
    margin-bottom: 4px;
    content: "↑";
    text-align: center;
    font-size: 15px;
  }
  .lis-cell em.j {
    bottom: calc(100% + 7px);
    color: #61c4e8;
  }
  .lis-cell em.j::after {
    display: block;
    margin-top: 4px;
    content: "↓";
    text-align: center;
    font-size: 15px;
  }
  .lis-formula {
    justify-self: center;
    max-width: 100%;
    padding: 8px 11px;
    overflow-wrap: anywhere;
    border: 1px solid #2f382d;
    border-radius: 6px;
    background: #0d100d;
    color: #dce6d5;
    font: 800 13px/1.45 "DM Mono", monospace;
    text-align: center;
  }
  .max-product-animation {
    display: block;
    padding: 24px 12px 28px;
  }
  .max-product-visual {
    display: grid;
    width: min(100%, 760px);
    margin: 0 auto;
    gap: 12px;
  }
  .max-product-row {
    display: flex;
    justify-content: center;
    gap: 7px;
    min-width: 0;
    padding: 6px 0;
  }
  .max-product-label {
    display: grid;
    width: 58px;
    flex: 0 0 58px;
    place-items: center;
    color: #dce6d5;
    font: 800 12px/1 "DM Mono", monospace;
  }
  .max-product-cell,
  .max-product-state {
    position: relative;
    display: grid;
    width: 62px;
    height: 56px;
    flex: 0 0 62px;
    place-items: center;
    border: 2px solid #596158;
    border-radius: 7px;
    background: #0c0f0b;
    color: #f4f7ef;
    transition:
      transform .25s ease,
      border-color .25s ease,
      background .25s ease,
      box-shadow .25s ease,
      opacity .25s ease;
  }
  .max-product-cell strong,
  .max-product-state strong {
    font: 800 17px/1 "DM Mono", monospace;
  }
  .max-product-cell > span,
  .max-product-state > span {
    position: absolute;
    right: 4px;
    bottom: 4px;
    color: #7e8979;
    font: 700 8px/1 "DM Mono", monospace;
  }
  .max-product-cell.active {
    border-color: #f0b84f;
    background: #1f1708;
    transform: translateY(-4px);
  }
  .max-product-state:not(.filled) {
    opacity: .25;
  }
  .max-product-state.active {
    transform: translateY(-4px);
  }
  .max-product-state.max-state.active {
    border-color: #8ec981;
    background: #102014;
  }
  .max-product-state.min-state.active {
    border-color: #61c4e8;
    background: #0b1a20;
  }
  .max-product-candidates {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 4px;
  }
  .max-product-candidates > span {
    display: grid;
    place-items: center;
    color: #98a493;
    font: 800 11px/1 "DM Mono", monospace;
  }
  .max-product-candidates code {
    padding: 7px 9px;
    border: 1px solid #384337;
    border-radius: 6px;
    background: #10130f;
    color: #dce6d5;
    font: 800 12px/1 "DM Mono", monospace;
  }
  .max-product-candidates code.max {
    border-color: #8ec981;
    color: #bdf0b2;
  }
  .max-product-candidates code.min {
    border-color: #61c4e8;
    color: #b9eaff;
  }
  .max-product-formula {
    justify-self: center;
    max-width: 100%;
    padding: 8px 11px;
    overflow-wrap: anywhere;
    border: 1px solid #2f382d;
    border-radius: 6px;
    background: #0d100d;
    color: #dce6d5;
    font: 800 13px/1.45 "DM Mono", monospace;
    text-align: center;
  }
  .lvp-animation {
    display: block;
    padding: 24px 12px 28px;
  }
  .lvp-visual {
    display: grid;
    width: min(100%, 720px);
    margin: 0 auto;
    gap: 16px;
  }
  .lvp-row {
    display: flex;
    justify-content: center;
    gap: 7px;
    min-width: 0;
    padding: 8px 0 14px;
  }
  .lvp-label {
    display: grid;
    width: 54px;
    flex: 0 0 54px;
    place-items: center;
    color: #dce6d5;
    font: 800 13px/1 "DM Mono", monospace;
  }
  .lvp-cell,
  .lvp-dp-cell {
    position: relative;
    display: grid;
    width: 58px;
    height: 58px;
    flex: 0 0 58px;
    place-items: center;
    border: 2px solid #596158;
    border-radius: 7px;
    background: #0c0f0b;
    color: #f4f7ef;
    transition:
      transform .25s ease,
      border-color .25s ease,
      background .25s ease,
      box-shadow .25s ease,
      opacity .25s ease;
  }
  .lvp-cell strong,
  .lvp-dp-cell strong {
    font: 800 20px/1 "DM Mono", monospace;
  }
  .lvp-cell > span,
  .lvp-dp-cell > span {
    position: absolute;
    right: 4px;
    bottom: 4px;
    color: #7e8979;
    font: 700 8px/1 "DM Mono", monospace;
  }
  .lvp-cell.range,
  .lvp-dp-cell.filled {
    border-color: #8ec981;
    background: #102014;
  }
  .lvp-cell.active-i,
  .lvp-dp-cell.active-i {
    border-color: #f0b84f;
    background: #1f1708;
    transform: translateY(-5px);
  }
  .lvp-cell.source {
    border-color: #61c4e8;
    background: #0b1a20;
  }
  .lvp-cell em {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    font: 800 11px/1 "DM Mono", monospace;
    font-style: normal;
  }
  .lvp-cell em.i {
    top: calc(100% + 7px);
    color: #f0b84f;
  }
  .lvp-cell em.i::before {
    display: block;
    margin-bottom: 4px;
    content: "↑";
    text-align: center;
    font-size: 15px;
  }
  .lvp-cell em.j {
    bottom: calc(100% + 7px);
    color: #61c4e8;
  }
  .lvp-cell em.j::after {
    display: block;
    margin-top: 4px;
    content: "↓";
    text-align: center;
    font-size: 15px;
  }
  .lvp-formula {
    justify-self: center;
    max-width: 100%;
    padding: 8px 11px;
    overflow-wrap: anywhere;
    border: 1px solid #2f382d;
    border-radius: 6px;
    background: #0d100d;
    color: #dce6d5;
    font: 800 13px/1.45 "DM Mono", monospace;
    text-align: center;
  }
  .lvp-cell.failed {
    border-color: #ef6b5a;
    background: #1f0f0b;
    box-shadow: 0 0 0 2px rgb(239 107 90 / 20%);
  }
  .lvp-stack-animation {
    display: block;
    padding: 24px 12px 28px;
  }
  .lvp-stack-visual {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 130px;
    width: min(100%, 760px);
    margin: 0 auto;
    gap: 18px;
    align-items: stretch;
  }
  .lvp-stack-main {
    display: grid;
    min-width: 0;
    align-content: center;
    gap: 14px;
  }
  .unique-paths-animation {
    display: block;
    padding: 22px 12px 28px;
  }
  .unique-paths-visual {
    display: grid;
    justify-items: center;
    gap: 14px;
    width: min(100%, 760px);
    margin: 0 auto;
  }
  .unique-paths-grid {
    display: grid;
    grid-template-columns: repeat(var(--unique-paths-cols), 58px);
    justify-content: center;
    gap: 6px;
    width: max-content;
    max-width: 100%;
    overflow-x: auto;
    padding: 6px;
  }
  .unique-paths-cell {
    position: relative;
    display: grid;
    width: 58px;
    height: 58px;
    place-items: center;
    border: 2px solid #596158;
    border-radius: 7px;
    background: #0c0f0b;
    color: #f4f7ef;
    transition:
      transform .25s ease,
      border-color .25s ease,
      background .25s ease,
      box-shadow .25s ease;
  }
  .unique-paths-cell strong {
    font: 800 18px/1 "DM Mono", monospace;
  }
  .unique-paths-cell > span {
    position: absolute;
    right: 4px;
    bottom: 4px;
    color: #7e8979;
    font: 700 8px/1 "DM Mono", monospace;
  }
  .unique-paths-cell em {
    position: absolute;
    left: 4px;
    top: 4px;
    color: #98a493;
    font: 800 8px/1 "DM Mono", monospace;
    font-style: normal;
  }
  .unique-paths-cell.edge,
  .unique-paths-cell.filled {
    border-color: #8ec981;
    background: #102014;
  }
  .unique-paths-cell.source-top {
    border-color: #61c4e8;
    background: #0b1a20;
  }
  .unique-paths-cell.source-left {
    border-color: #c58df4;
    background: #160f1f;
  }
  .unique-paths-cell.active {
    border-color: #f0b84f;
    background: #1f1708;
    transform: translateY(-4px);
  }
  .unique-paths-cell.done {
    box-shadow: 0 0 0 3px rgba(142, 201, 129, .22);
  }
  .unique-paths-formula {
    justify-self: center;
    max-width: 100%;
    padding: 8px 11px;
    overflow-wrap: anywhere;
    border: 1px solid #2f382d;
    border-radius: 6px;
    background: #0d100d;
    color: #dce6d5;
    font: 800 13px/1.45 "DM Mono", monospace;
    text-align: center;
  }
  .minimum-path-sum-cell > span {
    color: #f0b84f;
  }
  .minimum-path-sum-matrices {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, max-content));
    justify-content: center;
    gap: 18px;
    max-width: 100%;
    overflow-x: auto;
  }
  .minimum-path-sum-panel {
    display: grid;
    gap: 8px;
    justify-items: center;
  }
  .minimum-path-sum-panel-title {
    color: #dce6d5;
    font: 800 13px/1 "DM Mono", monospace;
  }
  .minimum-path-sum-grid-cell {
    border-color: #596158;
    background: #10130f;
  }
  .minimum-path-sum-grid-cell.active,
  .minimum-path-sum-grid-cell.path,
  .minimum-path-sum-grid-cell.chosen-source {
    transform: none;
    box-shadow: none;
  }
  .minimum-path-sum-dp-cell:not(.filled) {
    background: #0c0f0b;
    border-style: dashed;
    opacity: .62;
  }
  .minimum-path-sum-cell small {
    position: absolute;
    left: 5px;
    bottom: 4px;
    color: #98a493;
    font: 700 8px/1 "DM Mono", monospace;
  }
  .minimum-path-sum-cell strong {
    color: #f4f7ef;
  }
  .minimum-path-sum-cell.filled {
    border-color: #8ec981;
    background: #102014;
  }
  .minimum-path-sum-cell.source-top {
    border-color: #61c4e8;
    background: #0b1a20;
  }
  .minimum-path-sum-cell.source-left {
    border-color: #c58df4;
    background: #160f1f;
  }
  .minimum-path-sum-cell.path {
    box-shadow: inset 0 -5px 0 #f0b84f;
  }
  .minimum-path-sum-cell.chosen-source {
    border-color: #f0b84f;
    background: #1f1708;
    transform: translateY(-4px);
  }
  .minimum-path-sum-cell.active {
    border-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(240, 184, 79, .26), inset 0 -5px 0 #f0b84f;
  }
  .minimum-path-sum-compare {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
  }
  .minimum-path-sum-candidate {
    display: grid;
    min-width: 112px;
    gap: 4px;
    padding: 8px 10px;
    border: 1px solid #2f382d;
    border-radius: 7px;
    background: #0d100d;
    color: #98a493;
    text-align: center;
  }
  .minimum-path-sum-candidate strong {
    color: #f4f7ef;
    font: 800 18px/1 "DM Mono", monospace;
  }
  .minimum-path-sum-candidate.selected {
    border-color: #f0b84f;
    background: #1f1708;
    color: #f0b84f;
  }
  .coin-change-animation {
    display: block;
    padding: 22px 12px 28px;
  }
  .coin-change-visual {
    display: grid;
    width: min(100%, 940px);
    margin: 0 auto;
    gap: 14px;
  }
  .coin-change-coins {
    display: flex;
    justify-content: center;
    gap: 10px;
    min-width: 0;
    padding: 4px 0 8px;
  }
  .coin-change-coins > span,
  .coin-change-label {
    display: grid;
    width: 54px;
    flex: 0 0 54px;
    place-items: center;
    color: #dce6d5;
    font: 800 13px/1 "DM Mono", monospace;
  }
  .coin-change-coin {
    display: grid;
    width: 46px;
    height: 46px;
    place-items: center;
    border: 2px solid #d8ded4;
    border-radius: 50%;
    background: #0c0f0b;
    color: #f4f7ef;
    font: 800 18px/1 "DM Mono", monospace;
    transition:
      transform .25s ease,
      border-color .25s ease,
      background .25s ease;
  }
  .coin-change-coin.active {
    border-color: #f0b84f;
    background: #1f1708;
    transform: translateY(-4px);
  }
  .coin-change-row {
    display: flex;
    justify-content: center;
    gap: 6px;
    min-width: 0;
    padding: 5px 0;
  }
  .coin-change-cell {
    position: relative;
    display: grid;
    width: 54px;
    height: 54px;
    flex: 0 0 54px;
    place-items: center;
    border: 2px solid #596158;
    border-radius: 7px;
    background: #0c0f0b;
    color: #f4f7ef;
    transition:
      transform .25s ease,
      border-color .25s ease,
      background .25s ease,
      box-shadow .25s ease,
      opacity .25s ease;
  }
  .coin-change-cell strong {
    font: 800 18px/1 "DM Mono", monospace;
  }
  .coin-change-cell > span {
    position: absolute;
    right: 4px;
    bottom: 4px;
    color: #7e8979;
    font: 700 8px/1 "DM Mono", monospace;
  }
  .coin-change-cell.active {
    border-color: #f0b84f;
    background: #1f1708;
    transform: translateY(-4px);
  }
  .coin-change-cell.source {
    border-color: #61c4e8;
    background: #0b1a20;
  }
  .coin-change-dp-cell.filled {
    border-color: #8ec981;
    background: #102014;
  }
  .coin-change-dp-cell.updated {
    border-color: #8ec981;
    background: #102014;
    box-shadow: 0 0 0 2px rgb(142 201 129 / 18%);
  }
  .coin-change-formula {
    justify-self: center;
    max-width: 100%;
    padding: 8px 11px;
    overflow-wrap: anywhere;
    border: 1px solid #2f382d;
    border-radius: 6px;
    background: #0d100d;
    color: #dce6d5;
    font: 800 13px/1.45 "DM Mono", monospace;
    text-align: center;
  }
  .partition-animation {
    display: block;
    padding: 24px 12px 28px;
  }
  .partition-visual {
    display: grid;
    width: min(100%, 780px);
    margin: 0 auto;
    gap: 12px;
  }
  .partition-nums {
    display: flex;
    justify-content: center;
    gap: 7px;
    min-width: 0;
    padding: 4px 0;
  }
  .partition-nums > span {
    display: grid;
    width: 58px;
    flex: 0 0 58px;
    place-items: center;
    color: #dce6d5;
    font: 800 12px/1 "DM Mono", monospace;
  }
  .partition-num,
  .partition-cell,
  .partition-head {
    position: relative;
    display: grid;
    width: 40px;
    height: 40px;
    place-items: center;
    border: 2px solid #596158;
    border-radius: 6px;
    background: #0c0f0b;
    color: #f4f7ef;
    font: 800 14px/1 "DM Mono", monospace;
    transition:
      transform .25s ease,
      border-color .25s ease,
      background .25s ease,
      box-shadow .25s ease;
  }
  .partition-num {
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
  }
  .partition-num small {
    position: absolute;
    right: 4px;
    bottom: 4px;
    color: #7e8979;
    font: 700 8px/1 "DM Mono", monospace;
  }
  .partition-num.active,
  .partition-cell.active {
    border-color: #f0b84f;
    background: #1f1708;
    transform: translateY(-3px);
  }
  .partition-table {
    overflow-x: auto;
    padding: 4px 0 18px;
  }
  .partition-grid {
    display: grid;
    grid-template-columns: 62px repeat(var(--partition-cols), 40px);
    justify-content: center;
    gap: 5px;
    width: max-content;
    margin: 0 auto;
  }
  .partition-head {
    height: 28px;
    border-color: #384337;
    background: #10130f;
    color: #98a493;
    font-size: 11px;
  }
  .partition-corner {
    width: 62px;
  }
  .partition-row-label {
    display: grid;
    width: 62px;
    height: 40px;
    place-items: center;
    border: 1px solid #384337;
    border-radius: 6px;
    background: #10130f;
    color: #dce6d5;
    font: 800 11px/1 "DM Mono", monospace;
  }
  .partition-row-label.active {
    border-color: #f0b84f;
    color: #f7d78b;
  }
  .partition-cell.true {
    border-color: #8ec981;
    background: #102014;
    color: #bdf0b2;
  }
  .partition-cell.false {
    color: #ef7b6d;
  }
  .partition-cell.source {
    border-color: #61c4e8;
    background: #0b1a20;
    color: #b9eaff;
  }
  .partition-cell.updated {
    box-shadow: 0 0 0 3px rgba(142, 201, 129, .22);
  }
  .partition-cell.target,
  .partition-head.target {
    box-shadow: inset 0 -4px 0 rgba(240, 184, 79, .85);
  }
  .partition-formula {
    justify-self: center;
    max-width: 100%;
    padding: 8px 11px;
    overflow-wrap: anywhere;
    border: 1px solid #2f382d;
    border-radius: 6px;
    background: #0d100d;
    color: #dce6d5;
    font: 800 13px/1.45 "DM Mono", monospace;
    text-align: center;
  }
  .sliding-maximum-array {
    display: block;
    padding: 24px 12px 18px;
  }
  .sliding-maximum-visual {
    --sliding-cell-size: 36px;
    --sliding-gap: 4px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 86px;
    width: 100%;
    max-width: 470px;
    margin: 0 auto;
    gap: 14px;
    align-items: stretch;
  }
  .sliding-maximum-array-panel {
    display: grid;
    min-width: 0;
    align-content: center;
  }
  .sliding-maximum-panel-label {
    display: block;
    color: #98a493;
    text-align: center;
    font-size: 11px;
    font-weight: 700;
  }
  .sliding-maximum-track {
    display: flex;
    gap: var(--sliding-gap);
    justify-content: center;
    padding: 16px 0 18px;
  }
  .sliding-maximum-cell {
    position: relative;
    display: grid;
    width: var(--sliding-cell-size);
    height: 52px;
    flex: 0 0 auto;
    place-items: center;
    border: 2px solid #596158;
    background: #0c0f0b;
    color: #f4f7ef;
    transition: transform .25s ease, border-color .25s ease, background .25s ease, box-shadow .25s ease;
  }
  .sliding-maximum-cell:first-child { border-radius: 7px 0 0 7px; }
  .sliding-maximum-cell:last-child { border-radius: 0 7px 7px 0; }
  .sliding-maximum-cell strong { font: 800 15px/1 "DM Mono", monospace; }
  .sliding-maximum-cell > span {
    position: absolute;
    right: 4px;
    bottom: 3px;
    color: #7e8979;
    font: 700 9px/1 "DM Mono", monospace;
  }
  .sliding-maximum-cell.in-window {
    border-top-color: #61c4e8;
    border-bottom-color: #61c4e8;
    background: #0b1a20;
  }
  .sliding-maximum-cell.window-start { border-left-color: #61c4e8; }
  .sliding-maximum-cell.window-end { border-right-color: #61c4e8; }
  .sliding-maximum-cell.in-queue { box-shadow: inset 0 -4px 0 #8ec981; }
  .sliding-maximum-cell.active { transform: translateY(-7px); }
  .sliding-maximum-cell.removed {
    border-color: #ef6b5a;
    background: #1f0f0b;
    box-shadow: 0 0 0 2px rgb(239 107 90 / 20%);
  }
  .sliding-maximum-queue-panel {
    display: grid;
    grid-template-rows: auto 1fr;
    gap: 10px;
    padding: 10px 8px 12px;
    border: 1px solid #293027;
    border-radius: 7px;
    background: #0d100d;
  }
  .sliding-maximum-queue {
    display: flex;
    min-height: 174px;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 13px;
  }
  .sliding-maximum-queue em {
    margin: auto;
    color: #6f796b;
    font-size: 12px;
  }
  .sliding-maximum-queue-item {
    position: relative;
    display: grid;
    width: 50px;
    height: 46px;
    flex: 0 0 auto;
    place-items: center;
    border: 1px solid #465044;
    border-radius: 5px;
    background: #151a14;
    color: #dbe5d5;
    font-family: "DM Mono", monospace;
  }
  .sliding-maximum-queue-item:not(:last-child)::after {
    position: absolute;
    top: calc(100% + 2px);
    left: 50%;
    color: #657061;
    content: "↓";
    transform: translateX(-50%);
    font: 700 10px/1 "DM Mono", monospace;
  }
  .sliding-maximum-queue-item > span {
    position: absolute;
    top: 3px;
    left: 4px;
    color: #8f9b8a;
    font: 700 8px/1 "Noto Sans SC", sans-serif;
  }
  .sliding-maximum-queue-item strong {
    color: inherit;
    font: 800 17px/1 "DM Mono", monospace;
  }
  .sliding-maximum-queue-item small {
    position: absolute;
    right: 3px;
    bottom: 3px;
    color: #7e8979;
    font: 700 8px/1 "DM Mono", monospace;
  }
  .sliding-maximum-queue-item.is-front {
    border-color: #61c4e8;
    background: #0b1a20;
    color: #91ddfa;
    box-shadow: 0 0 0 2px rgb(97 196 232 / 14%);
  }
  .sliding-maximum-queue-item.is-tail:not(.is-front) {
    border-color: #8ec981;
  }
    @media (max-width: 680px) {
    .solution-header { display: grid; }
    .solution-strategy { justify-self: start; }
    .complexity-grid { grid-template-columns: 1fr; }
    .solution-code-tabs button { min-width: 60px; padding-inline: 10px; }
    .algorithm-animation-head {
      align-items: stretch;
      flex-direction: column;
    }
    .algorithm-animation-controls { justify-content: flex-start; }
    .zeroes-stage { min-height: 250px; padding-inline: 10px; }
    .zeroes-cell {
      width: 47px;
      height: 47px;
      font-size: 23px;
    }
      .zeroes-result { font-size: 17px; }
      .water-bar-cell { width: 36px; }
      .water-bar { width: 24px; }
      .three-sum-array { gap: 7px; }
      .three-sum-cell {
        width: 48px;
        height: 48px;
        font-size: 18px;
      }
      .two-sum-track { gap: 4px; }
      .two-sum-cell { width: 42px; height: 54px; }
      .two-sum-cell strong { font-size: 18px; }
      .three-sum-pointer { min-width: 38px; font-size: 11px; }
      .trap-stack { width: min(100%, 23px); }
      .trap-pointer { font-size: 10px; }
      .substring-array {
        --substring-cell-width: 44px;
        --substring-gap: 6px;
        gap: 6px;
      }
      .substring-window-box {
        top: -6px;
        height: 62px;
      }
      .substring-cell {
        width: 44px;
        height: 50px;
      }
      .substring-value { font-size: 20px; }
      .substring-pointer { min-width: 42px; font-size: 10px; }
      .parentheses-visual {
        grid-template-columns: 1fr;
        gap: 12px;
      }
      .parentheses-cell {
        width: 42px;
        height: 52px;
      }
      .parentheses-cell strong { font-size: 21px; }
      .parentheses-stack-panel { min-height: 0; }
      .parentheses-stack { min-height: 92px; }
      .lvp-stack-visual {
        grid-template-columns: 1fr;
        gap: 12px;
      }
      .max-subarray-row {
        grid-template-columns: 38px repeat(9, 46px);
        gap: 5px;
      }
      .max-subarray-cell {
        width: 46px;
        height: 46px;
      }
      .max-subarray-cell strong { font-size: 17px; }
      .max-subarray-formula {
        max-width: 100%;
        overflow-x: auto;
        font-size: 11px;
      }
      .house-robber-house,
      .house-robber-dp-cell {
        width: 50px;
        height: 50px;
        flex-basis: 50px;
      }
      .house-robber-roof {
        left: 10px;
        width: 28px;
        height: 28px;
      }
      .house-robber-house strong,
      .house-robber-dp-cell strong { font-size: 17px; }
      .house-robber-formula {
        max-width: 100%;
        overflow-x: auto;
        font-size: 11px;
      }
      .perfect-squares-cell {
        width: 46px;
        height: 46px;
      }
      .perfect-squares-cell strong { font-size: 16px; }
      .perfect-squares-formula {
        max-width: 100%;
        overflow-x: auto;
        font-size: 11px;
      }
      .sliding-maximum-visual {
        --sliding-cell-size: 20px;
        --sliding-gap: 1px;
        grid-template-columns: minmax(0, 1fr) 64px;
        gap: 8px;
      }
      .sliding-maximum-cell { height: 44px; }
      .sliding-maximum-cell strong { font-size: 11px; }
      .sliding-maximum-cell > span { right: 2px; font-size: 7px; }
      .sliding-maximum-queue-panel { padding-inline: 5px; }
      .sliding-maximum-queue-item { width: 44px; height: 43px; }
      .sliding-maximum-queue-item strong { font-size: 15px; }
    }
.note-panel {
  display: flex;
  flex: 1;
  min-height: 0;
  flex-direction: column;
  background: var(--surface);
}
.note-toolbar {
  display: flex;
  align-items: center;
  gap: 3px;
  min-height: 55px;
  padding: 0 26px;
  border-bottom: 1px solid var(--line);
}
.note-toolbar button {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: 500 13px "Noto Sans SC", system-ui, sans-serif;
}
.note-toolbar button:hover,
.note-toolbar button.active { background: var(--surface-3); color: var(--ink); }
.note-toolbar button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.note-toolbar-divider { width: 1px; height: 18px; margin: 0 5px; background: var(--line); }
.note-toolbar .note-preview-toggle { margin-left: auto; font-size: 17px; }
.note-panel textarea {
  flex: 1;
  width: 100%;
  min-height: 0;
  resize: none;
  padding: 22px 26px;
  border: 0;
  background: transparent;
  color: var(--ink);
  outline: none;
  font: 14px/1.8 "Noto Sans SC", system-ui, sans-serif;
}
.note-panel textarea::placeholder { color: color-mix(in srgb, var(--muted) 62%, transparent); }
.note-preview {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 22px 26px;
}
.note-preview:empty::before { color: var(--muted); content: "暂无内容"; font-size: 13px; }
.note-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 54px;
  padding: 8px 24px;
  border-top: 1px solid var(--line);
}
.note-footer > div { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 11px; }
.note-save-state { color: var(--muted); }
.note-footer > button {
  min-width: 76px;
  height: 34px;
  border: 0;
  border-radius: 7px;
  background: var(--accent);
  color: var(--accent-ink);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}
.note-footer > button:disabled { cursor: wait; opacity: .65; }
.ai-analysis-panel {
  display: flex;
  flex: 1;
  min-height: 0;
  flex-direction: column;
  background: var(--surface);
}
.ai-analysis-controls {
  display: grid;
  gap: 12px;
  padding: 16px 20px 14px;
  border-bottom: 1px solid var(--line);
}
.ai-source-field {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 11px;
}
.ai-analysis-controls select {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--ink);
  outline: none;
}
.ai-analysis-controls select:focus {
  border-color: color-mix(in srgb, var(--accent) 65%, var(--line));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 12%, transparent);
}
.ai-analysis-actions { display: flex; align-items: center; gap: 10px; }
.ai-analysis-actions label { min-width: 132px; }
.ai-analysis-actions select { height: 36px; }
.ai-analysis-start {
  height: 36px;
  padding: 0 18px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: var(--accent-ink);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}
.ai-analysis-start:disabled { cursor: not-allowed; opacity: .48; }
.ai-analysis-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 24px 28px 48px;
}
.ai-analysis-empty {
  display: grid;
  min-height: 240px;
  place-content: center;
  justify-items: center;
  color: var(--muted);
  text-align: center;
}
.ai-analysis-empty > span {
  display: grid;
  width: 44px;
  height: 44px;
  margin-bottom: 14px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--accent);
  font-size: 22px;
}
.ai-analysis-empty strong { color: var(--ink); font-size: 14px; }
.ai-analysis-empty p { max-width: 460px; margin: 8px 0 0; font-size: 12px; line-height: 1.75; }
.ai-analysis-loading > span { animation: ai-pulse 1s ease-in-out infinite alternate; }
@keyframes ai-pulse { to { transform: scale(1.08); opacity: .55; } }
.ai-analysis-result { max-width: 850px; margin: 0 auto; padding-top: 0; }
.ai-analysis-result > h2 { margin-top: 0; }
.ai-code-block {
  margin: 18px 0;
  overflow: hidden;
  border: 1px solid #353535;
  border-radius: 9px;
  background: #1e1e1e;
}
.ai-code-block > span {
  display: block;
  padding: 8px 14px;
  border-bottom: 1px solid #333;
  color: #aaa;
  background: #252526;
  font: 11px "DM Mono", monospace;
}
.ai-code-block pre {
  margin: 0;
  overflow-x: auto;
  padding: 16px;
}
.ai-code-block code {
  padding: 0;
  background: transparent;
  color: #d4d4d4;
  font: 13px/1.65 "DM Mono", monospace;
  white-space: pre;
}
.ai-analysis-error { color: var(--hard); }
.ai-analysis-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 20px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 10px;
}
.coding-pane {
  display: grid;
  grid-template-rows: 45px minmax(160px, 1fr) 6px minmax(160px, var(--console-height, 40%)) 55px;
}
.editor-toolbar { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 0 12px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.editor-toolbar select, .editor-toolbar button { height: 30px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface-3); color: var(--ink); font-size: 11px; }
.editor-toolbar select { padding: 0 27px 0 9px; }
.editor-toolbar span { min-width: 0; margin-right: auto; overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.editor-toolbar button { padding: 0 10px; cursor: pointer; }
.practice-timer {
  position: relative;
  flex: 0 0 auto;
}
.practice-timer-button {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 78px;
  height: 30px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface-3);
  color: var(--ink);
  text-align: center;
  font-family: "DM Mono", "Cascadia Code", Consolas, monospace;
}
#practiceTimerDisplay {
  display: block;
  width: 100%;
  color: inherit;
  text-align: center;
  font: 400 12px/1 "DM Mono", "Cascadia Code", Consolas, monospace;
}
.practice-timer-button[aria-expanded="true"] {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 16%, transparent);
}
.practice-timer-panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 45;
  width: 255px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card-bg);
  box-shadow: 0 14px 38px var(--popup-shadow);
}
.practice-timer-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.practice-timer-actions button:first-child {
  border-color: #1a8cff;
  background: #1a8cff;
  color: #fff;
}
.practice-timer-label {
  display: block;
  margin: 10px 0 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}
.practice-timer-modes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-2);
}
.practice-timer-modes button {
  border: 0;
  border-radius: 0;
  background: transparent;
}
.practice-timer-modes button.active {
  background: var(--surface-3);
  color: var(--accent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 55%, var(--line));
}
.practice-countdown-setting {
  display: flex;
  align-items: center;
  gap: 8px;
}
.practice-countdown-setting[hidden],
.practice-countdown-label[hidden] {
  display: none;
}
.practice-countdown-setting input {
  width: 82px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface-3);
  color: var(--ink);
  text-align: center;
}
.practice-timer button.active {
  border-color: color-mix(in srgb, var(--medium) 70%, var(--line));
  background: color-mix(in srgb, var(--medium) 16%, var(--surface-3));
  color: var(--medium);
}
.code-editor {
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border: 0;
  outline: 0;
  background: var(--code-bg);
  color: var(--code-ink);
}
.code-editor.editor-fallback {
  overflow: auto;
  padding: 20px;
  white-space: pre;
  tab-size: 4;
  font: 13px/1.75 "DM Mono", monospace;
}
.code-editor .monaco-editor,
.code-editor .overflow-guard { border-radius: 0; }
.code-editor .monaco-editor [class*="bracket-indent-guide"],
.code-editor .monaco-editor [class*="horizontal-bracket-guide"] {
  display: none !important;
  border-color: transparent !important;
}
.code-editor .suggest-widget {
  border: 1px solid var(--popup-border) !important;
  box-shadow: 0 10px 32px var(--popup-shadow) !important;
}
.suggest-widget .monaco-list-row.focused,
.suggest-widget .monaco-list-row.focused:hover,
.suggest-widget .monaco-list-row.selected,
.suggest-widget .monaco-list-row.selected:hover,
.suggest-widget .monaco-list-row[aria-selected="true"],
.suggest-widget .monaco-list-row[aria-selected="true"]:hover {
  background: #073b7a !important;
  background-color: #073b7a !important;
  color: #fff !important;
}
.suggest-widget .monaco-list-row.focused > .contents,
.suggest-widget .monaco-list-row.selected > .contents,
.suggest-widget .monaco-list-row[aria-selected="true"] > .contents,
.suggest-widget .monaco-list-row.focused > .contents > .main,
.suggest-widget .monaco-list-row.selected > .contents > .main,
.suggest-widget .monaco-list-row[aria-selected="true"] > .contents > .main,
.suggest-widget .monaco-list-row.focused > .contents > .main > .left,
.suggest-widget .monaco-list-row.selected > .contents > .main > .left,
.suggest-widget .monaco-list-row[aria-selected="true"] > .contents > .main > .left {
  background: #073b7a !important;
  background-color: #073b7a !important;
}
.suggest-widget .monaco-list-row.focused *,
.suggest-widget .monaco-list-row.selected *,
.suggest-widget .monaco-list-row[aria-selected="true"] * {
  color: #fff !important;
}
.suggest-widget .monaco-highlighted-label .highlight {
  background: transparent !important;
  background-color: transparent !important;
  color: inherit !important;
  font-weight: inherit !important;
}
.suggest-widget .monaco-list-row.focused .monaco-highlighted-label .highlight,
.suggest-widget .monaco-list-row.selected .monaco-highlighted-label .highlight,
.suggest-widget .monaco-list-row[aria-selected="true"] .monaco-highlighted-label .highlight {
  background: transparent !important;
  background-color: transparent !important;
  color: #fff !important;
}
.suggest-widget .monaco-list-row:hover {
  background: #0b4d99 !important;
  background-color: #0b4d99 !important;
}
.console-pane { overflow: hidden; background: var(--surface); }
.console-tabs { min-height: 38px; }
.console-panel { height: calc(100% - 38px); overflow: auto; }
.testcases-panel { display: grid; grid-template-rows: 42px 1fr; }
.testcase-toolbar { display: flex; align-items: center; gap: 10px; padding: 6px 12px; border-bottom: 1px solid var(--line); }
.testcase-tabs { display: flex; min-width: 0; flex: 1; gap: 6px; overflow-x: auto; }
.testcase-tabs button, .testcase-actions button {
  height: 28px; flex: 0 0 auto; border: 1px solid var(--line); border-radius: 5px;
  background: var(--surface-2); color: var(--muted); cursor: pointer; font-size: 11px;
}
.testcase-tabs button { padding: 0 10px; }
.testcase-tabs button.active { border-color: var(--accent); color: var(--ink); background: color-mix(in srgb, var(--accent) 8%, var(--surface-2)); }
.testcase-tabs .remove-case { margin-left: 7px; color: var(--muted); }
.testcase-actions { display: flex; gap: 6px; }
.testcase-actions button { padding: 0 10px; }
.testcase-actions button:last-child { width: 29px; padding: 0; font-size: 16px; }
.testcase-tabs button:hover, .testcase-actions button:hover { color: var(--ink); border-color: var(--hover-border); }
.testcase-editor { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 10px 12px 12px; min-height: 0; }
.testcase-editor label { display: block; min-width: 0; min-height: 0; color: var(--ink); font-size: 11px; }
.testcase-editor label span { color: var(--muted); }
.testcase-editor textarea {
  display: block; width: 100%; height: calc(100% - 24px); min-height: 90px; margin-top: 7px; resize: none; border: 1px solid var(--line);
  border-radius: 6px; outline: 0; padding: 11px 13px; background: var(--code-bg); color: var(--ink);
  font: 12px/1.65 "DM Mono";
}
.testcase-editor textarea:focus { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); }
.console-result { padding: 12px; color: var(--muted); }
.console-empty { display: grid; min-height: 80px; place-items: center; color: var(--muted); font-size: 11px; }
.run-summary, .submission-detail-summary {
  display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 10px; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 7px; background: var(--surface-2); font-size: 11px;
}
.verdict-pill { display: inline-flex; align-items: center; min-height: 25px; padding: 0 9px; border-radius: 5px; font-weight: 700; }
.verdict-pill.accepted, .verdict-pill.finished { color: var(--easy); background: color-mix(in srgb, var(--easy) 12%, transparent); }
.verdict-pill.wrong_answer, .verdict-pill.compile_error, .verdict-pill.runtime_error,
.verdict-pill.time_limit, .verdict-pill.output_limit, .verdict-pill.system_error {
  color: var(--hard); background: color-mix(in srgb, var(--hard) 12%, transparent);
}
.case-result-list { display: grid; gap: 8px; }
.case-result-card { overflow: hidden; border: 1px solid var(--line); border-radius: 7px; background: var(--card-bg); }
.case-result-head { display: flex; align-items: center; gap: 10px; padding: 8px 11px; border-bottom: 1px solid var(--line); font-size: 11px; }
.case-result-head strong { margin-right: auto; }
.case-result-card.accepted .case-result-head { color: var(--easy); }
.case-result-card.failed .case-result-head { color: var(--hard); }
.case-result-grid { display: grid; grid-template-columns: repeat(3, 1fr); }
.case-result-grid.output-compare { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.case-result-grid > div { min-width: 0; padding: 9px 11px; border-right: 1px solid var(--line); }
.case-result-grid > div:last-child { border-right: 0; }
.case-result-grid label { display: block; margin-bottom: 5px; color: var(--muted); font-size: 9px; }
.case-result-grid pre { max-height: 90px; overflow: auto; margin: 0; color: var(--code-ink); font: 10px/1.55 "DM Mono"; white-space: pre-wrap; }
.case-result-error-card .case-result-head { align-items: center; color: var(--ink); }
.case-error-body { display: grid; gap: 8px; padding: 11px 12px 14px; }
.case-error-message {
  padding: 9px 11px; border: 1px solid color-mix(in srgb, var(--hard) 40%, var(--line));
  border-radius: 5px; color: var(--hard); background: color-mix(in srgb, var(--hard) 9%, transparent);
  font-size: 11px;
}
.case-error-detail {
  overflow: hidden; border: 1px solid color-mix(in srgb, #f3b617 55%, var(--line));
  border-radius: 5px; background: color-mix(in srgb, #f3b617 10%, var(--card-bg));
}
.case-error-detail label {
  display: block; padding: 8px 10px 0; color: #b77900; font-size: 10px; font-weight: 700;
}
.case-error-detail pre {
  min-height: 130px; max-height: 260px; overflow: auto; margin: 7px 10px 10px; padding: 10px 12px;
  border-radius: 3px; background: var(--code-bg); color: var(--code-ink);
  font: 11px/1.55 "DM Mono"; white-space: pre; tab-size: 2;
}
.history-panel { color: var(--code-ink); }
.history-hint { padding: 8px 12px; border-bottom: 1px solid color-mix(in srgb, var(--accent) 25%, var(--line)); color: var(--accent); background: color-mix(in srgb, var(--accent) 5%, transparent); font-size: 10px; }
.history-table-wrap { overflow: auto; }
.history-table, .case-detail-table { width: 100%; border-collapse: collapse; font-size: 10px; }
.history-table th, .history-table td, .case-detail-table th, .case-detail-table td { padding: 9px 11px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
.history-table th, .case-detail-table th { color: var(--muted); background: var(--surface-2); font-weight: 500; }
.history-table tbody tr { cursor: pointer; }
.history-table tbody tr:hover { background: var(--surface-2); }
.history-status.accepted { color: var(--easy); }
.history-status:not(.accepted) { color: var(--hard); }
.submission-detail { padding: 12px; }
.submission-detail-toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.submission-detail-toolbar button, .source-toolbar button, .case-preview-trigger, .case-preview-panel button {
  height: 28px; border: 1px solid var(--line); border-radius: 5px; padding: 0 10px;
  background: var(--surface-2); color: var(--ink); cursor: pointer; font-size: 10px;
}
.submission-detail-toolbar strong { font-size: 12px; }
.case-detail-table { margin-bottom: 14px; border: 1px solid var(--line); }
.case-preview-trigger { height: 24px; color: var(--accent); background: color-mix(in srgb, var(--accent) 7%, var(--surface-2)); }
.case-preview-dialog {
  position: fixed; inset: 0; z-index: 30; display: grid; place-items: center;
  padding: 20px; background: color-mix(in srgb, #000 34%, transparent);
}
.case-preview-shell {
  display: grid; grid-template-rows: auto auto minmax(0, 1fr) auto;
  width: min(1120px, calc(100vw - 40px)); max-height: min(760px, calc(100vh - 40px));
  overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: var(--card-bg);
  box-shadow: 0 18px 40px color-mix(in srgb, #000 22%, transparent);
}
.case-preview-header {
  display: flex; align-items: center; justify-content: space-between;
  min-height: 48px; padding: 0 14px; border-bottom: 1px solid var(--line);
}
.case-preview-header strong { font-size: 14px; }
.case-preview-close {
  width: 32px; height: 32px; border: 0; background: transparent; color: var(--ink);
  cursor: pointer; font-size: 24px; line-height: 1;
}
.case-preview-meta { padding: 10px 14px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.case-preview-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px;
  min-height: 0; overflow: auto; padding: 12px;
}
.case-preview-panel {
  display: grid; grid-template-rows: auto minmax(180px, 1fr); min-width: 0;
  overflow: hidden; border: 1px solid var(--line); border-radius: 7px; background: var(--surface-2);
}
.case-preview-panel-wide { grid-column: 1 / -1; grid-template-rows: auto minmax(110px, 220px); }
.case-preview-panel > div {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 8px 10px; border-bottom: 1px solid var(--line); font-size: 11px;
}
.case-preview-panel pre {
  overflow: auto; margin: 0; padding: 12px; background: var(--code-bg); color: var(--code-ink);
  font: 12px/1.65 "DM Mono"; white-space: pre; tab-size: 2;
}
.case-preview-footer {
  display: flex; align-items: center; justify-content: flex-end; gap: 14px;
  padding: 10px 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px;
}
.case-preview-footer button {
  height: 34px; border: 0; border-radius: 6px; padding: 0 16px;
  background: var(--accent); color: var(--accent-ink); cursor: pointer; font-weight: 700;
}
.source-block { overflow: hidden; border: 1px solid var(--line); border-radius: 7px; }
.source-toolbar { display: flex; align-items: center; justify-content: space-between; padding: 7px 10px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 10px; }
.source-code-view { max-height: 300px; overflow: auto; }
.source-code-view .solution-code-lines { padding-block: 12px; font-size: 12px; }
.statement-submission-list { display: grid; gap: 8px; margin-top: 20px; }
.statement-submission-item { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 12px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface-2); cursor: pointer; }
.statement-submission-item:hover { border-color: var(--hover-border); }
.statement-submission-item strong { font-size: 12px; }
.statement-submission-item span { color: var(--muted); font-size: 10px; }
.statement-submission-item .accepted { color: var(--easy); }
.collection-drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: color-mix(in srgb, #000 48%, transparent);
  opacity: 0;
  transition: opacity .18s ease;
}
.collection-drawer-backdrop.open { opacity: 1; }
.collection-drawer {
  position: fixed;
  z-index: 71;
  top: 0;
  bottom: 0;
  left: 0;
  display: flex;
  flex-direction: column;
  width: min(600px, 88vw);
  border-right: 1px solid var(--line);
  background: var(--surface);
  box-shadow: 18px 0 45px color-mix(in srgb, #000 28%, transparent);
  transform: translateX(-104%);
  transition: transform .2s ease;
}
.collection-drawer.open { transform: translateX(0); }
.collection-drawer-header {
  flex: 0 0 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 22px;
  border-bottom: 1px solid var(--line);
  background: var(--header);
}
.collection-drawer-header span {
  color: var(--muted);
  font-size: 11px;
}
.collection-drawer-header h2 {
  margin: 4px 0 0;
  font-size: 20px;
}
.collection-drawer-header button {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 28px;
  line-height: 1;
}
.collection-drawer-header button:hover {
  background: var(--surface-2);
  color: var(--ink);
}
.collection-drawer-search {
  flex: none;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--header);
}
.collection-drawer-search label {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.collection-drawer-search input {
  width: 100%;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--ink);
  font: 500 13px "Noto Sans SC", sans-serif;
  outline: none;
  padding: 0 12px;
}
.collection-drawer-search input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent);
}
.collection-drawer-search input::placeholder {
  color: var(--muted);
}
.collection-drawer-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 16px 18px 28px;
}
.collection-drawer-empty {
  margin-top: 12px;
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 13px;
}
.collection-drawer-group {
  overflow: hidden;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card-bg);
}
.collection-drawer-group h3 {
  margin: 0;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text-secondary);
  font-size: 13px;
}
.collection-drawer-items { display: grid; }
.collection-drawer-item {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  min-height: 52px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  text-decoration: none;
}
.collection-drawer-item.no-score {
  grid-template-columns: 22px minmax(0, 1fr) auto;
}
.collection-drawer-item:last-child { border-bottom: 0; }
.collection-drawer-item:hover {
  background: var(--surface-2);
}
.collection-drawer-item.active {
  background: color-mix(in srgb, var(--link) 10%, var(--surface-2));
  color: var(--link);
}
.collection-drawer-status {
  display: grid;
  width: 16px;
  height: 16px;
  place-items: center;
  border: 1px solid var(--muted);
  border-radius: 50%;
  color: transparent;
  font-size: 11px;
  line-height: 1;
}
.collection-drawer-status.done {
  border-color: var(--easy);
  color: var(--easy);
}
.collection-drawer-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 600;
}
.collection-drawer-score {
  color: var(--text-secondary);
  font-size: 12px;
  white-space: nowrap;
}
.collection-drawer-difficulty {
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.collection-drawer-difficulty.easy { color: var(--easy); }
.collection-drawer-difficulty.medium { color: var(--medium); }
.collection-drawer-difficulty.hard { color: var(--hard); }
.action-bar { display: flex; align-items: center; justify-content: flex-end; gap: 9px; padding: 0 12px; border-top: 1px solid var(--line); background: var(--surface-2); }
.action-bar > div { display: flex; align-items: center; gap: 7px; margin-right: auto; color: var(--muted); font-size: 10px; }
.status-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--medium); }
.action-bar button { height: 34px; padding: 0 18px; border-radius: 6px; border: 0; font-weight: 600; }
.action-bar button.secondary { background: var(--surface-3); }
.action-bar button.primary { background: var(--accent); color: var(--accent-ink); }
.action-bar button:disabled { cursor: not-allowed; opacity: .38; }
.toast { position: fixed; z-index: 10; left: 50%; bottom: 22px; padding: 9px 15px; border-radius: 6px; background: var(--accent); color: var(--accent-ink); opacity: 0; transform: translate(-50%, 8px); transition: .2s; pointer-events: none; font-size: 12px; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
[hidden] { display: none !important; }
@media (max-width: 850px) {
  body { overflow: auto; }
  .save-state { display: none; }
  .workspace-header { gap: 8px; padding: 0 10px; }
  .workspace-brand { font-size: 13px; }
  .problem-nav { min-width: 0; flex: 1; justify-content: center; gap: 4px; }
  .problem-nav a, .collection-drawer-button { padding: 7px 8px; font-size: 11px; }
  .collection-drawer-button { max-width: 130px; }
  #collectionBackLink { display: none; }
  .workspace-user { gap: 6px; }
  .theme-toggle { width: 31px; padding: 0; justify-content: center; }
  #themeText { display: none; }
  .workspace { height: auto; min-height: calc(100vh - 58px); grid-template-columns: 1fr; gap: 5px; }
  .workspace > .workspace-resizer { display: none; }
  .statement-pane { min-height: 70vh; }
  .coding-pane { min-height: 85vh; grid-template-rows: 45px minmax(220px, 1fr) minmax(250px, 40%) 55px; }
  .coding-pane > .workspace-resizer { display: none; }
  .testcase-editor { grid-template-columns: 1fr; }
  .case-preview-dialog { padding: 10px; }
  .case-preview-shell { width: calc(100vw - 20px); max-height: calc(100vh - 20px); }
  .case-preview-grid { grid-template-columns: 1fr; }
  .case-preview-panel-wide { grid-column: auto; }
  .case-preview-footer { align-items: stretch; flex-direction: column; }
  .collection-drawer {
    width: min(560px, 94vw);
  }
  .collection-drawer-item {
    grid-template-columns: 22px minmax(0, 1fr) auto;
    gap: 9px;
    min-height: 58px;
    padding: 0 12px;
  }
  .collection-drawer-score {
    display: none;
  }
  .collection-drawer-name {
    font-size: 12px;
  }
}
@media (max-width: 620px) {
  .word-break-visual {
    --word-cell-size: 28px;
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .word-break-dict {
    grid-template-columns: repeat(auto-fit, minmax(58px, 1fr));
    align-items: center;
  }
  .word-break-dict > span {
    grid-column: 1 / -1;
  }
  .word-break-formula {
    font-size: 11px;
  }
  .lis-row {
    justify-content: flex-start;
    overflow-x: auto;
    padding-inline: 4px;
  }
  .lis-cell,
  .lis-dp-cell {
    width: 48px;
    height: 48px;
    flex-basis: 48px;
  }
  .lis-label {
    width: 44px;
    flex-basis: 44px;
  }
  .lis-formula {
    font-size: 11px;
  }
  .max-product-row {
    justify-content: flex-start;
    overflow-x: auto;
    padding-inline: 4px;
  }
  .lvp-row {
    justify-content: flex-start;
    overflow-x: auto;
    padding-inline: 4px;
  }
  .lvp-cell,
  .lvp-dp-cell {
    width: 48px;
    height: 48px;
    flex-basis: 48px;
  }
  .lvp-label {
    width: 44px;
    flex-basis: 44px;
  }
  .lvp-formula {
    font-size: 11px;
  }
  .coin-change-coins,
  .coin-change-row {
    justify-content: flex-start;
    overflow-x: auto;
    padding-inline: 4px;
  }
  .coin-change-cell {
    width: 46px;
    height: 46px;
    flex-basis: 46px;
  }
  .coin-change-coins > span,
  .coin-change-label {
    width: 44px;
    flex-basis: 44px;
  }
  .coin-change-formula {
    font-size: 11px;
  }
  .partition-nums {
    justify-content: flex-start;
    overflow-x: auto;
    padding-inline: 4px;
  }
  .partition-num {
    width: 42px;
    height: 42px;
    flex-basis: 42px;
  }
  .partition-grid {
    grid-template-columns: 54px repeat(var(--partition-cols), 34px);
  }
  .partition-cell {
    width: 34px;
    height: 34px;
    font-size: 12px;
  }
  .partition-head {
    width: 34px;
    height: 26px;
  }
  .partition-corner,
  .partition-row-label {
    width: 54px;
  }
  .partition-row-label {
    height: 34px;
    font-size: 10px;
  }
  .partition-formula {
    font-size: 11px;
  }
  .max-product-cell,
  .max-product-state {
    width: 52px;
    height: 50px;
    flex-basis: 52px;
  }
  .max-product-label {
    width: 44px;
    flex-basis: 44px;
  }
  .max-product-formula {
    font-size: 11px;
  }
}
