:root {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  font-synthesis: none;
  color: #000;
  color-scheme: light;
  --accent: #004d4d;
  --primary: #00ffff;
  --theme-end: #fff;
  --text: #000;
  --muted: rgba(0, 0, 0, .5);
  --bg: #fff;
  --panel: rgba(255, 255, 255, .3);
  --line: color-mix(in srgb, var(--primary) 30%, transparent);
  --sidebar: rgba(255, 255, 255, .55);
  --tint: rgba(0, 85, 85, .08);
  --control: rgba(0, 85, 85, .1);
  --selected: rgba(0, 85, 85, .28);
  --gradient: linear-gradient(135deg, var(--primary) 0%, var(--theme-end) 100%);
  --shadow: none;
  --red: #ff3b30;
  --yellow: #ffcc00;
  --green: #34c759;
  background: #fff;
}
* { box-sizing: border-box; }
html { min-width: 320px; min-height: 100%; }
body { margin: 0; background: var(--gradient) fixed; min-height: 100vh; }
body::before { content: ""; position: fixed; inset: 0; z-index: -1; background: var(--gradient); pointer-events: none; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button, a, select, input { -webkit-tap-highlight-color: transparent; }
button { color: inherit; cursor: pointer; }
button:disabled { cursor: default; opacity: .42; }
input, select, textarea {
  color: var(--text);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px 13px;
  max-width: 100%;
}
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .8; }
select { cursor: pointer; font-size: 15px; }
textarea { resize: vertical; width: 100%; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 2px; }
a:focus-visible, button:focus-visible, summary:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.icon { width: 22px; height: 22px; flex-shrink: 0; vertical-align: middle; }
.workspace { min-height: 100vh; display: flex; }
.main-shell { width: 100%; min-width: 0; display: flex; flex-direction: column; }
.topbar { position: relative; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 15px; min-height: 86px; padding: 14px 18px; }
.topbar-left, .topbar-right { display: flex; align-items: center; gap: 10px; min-width: 0; }
.icon-button.mobile-sidebar-toggle { display: none; }
.topbar-right { justify-content: flex-end; }
.topbar-left .brand { font-size: 18px; margin: 0; gap: 8px; }
.native-tabs { display: flex; align-items: center; padding: 4px; background: rgba(255,255,255,.14); border: 1px solid rgba(0,85,85,.1); border-radius: 30px; min-height: 45px; gap: 2px; }
.native-tabs a { font-size: 17px; padding: 10px 17px; border-radius: 24px; white-space: nowrap; line-height: 1; }
.native-tabs a.active { background: rgba(0,85,85,.1); color: #003939; font-weight: 600; }
.native-tabs a:hover { background: var(--control); }
.native-tabs .icon { width: 21px; height: 21px; }
.native-tabs > .icon-button { border: 0; background: transparent; width: 46px; height: 38px; margin-right: 2px; }
.native-tabs a .icon { display: none; }
.native-app-icon { display: block; width: 32px; height: 32px; border-radius: 8px; overflow: hidden; flex-shrink: 0; }
.native-app-icon img { display: block; width: 100%; height: 100%; object-fit: contain; }
.breadcrumbs { display: flex; align-items: center; gap: 8px; color: var(--accent); font-size: 16px; }
.edition { font-size: 12px; color: var(--accent); }
.edition i { display: none; }
main { width: 100%; padding: 0 18px 36px; margin: 0 auto; flex: 1; min-width: 0; }
main:focus { outline: none; }
.page-head { display: flex; position: relative; justify-content: center; align-items: center; gap: 16px; text-align: center; min-height: 40px; margin-bottom: 28px; }
.page-head > div { min-width: 0; }
.page-head h1 { font-size: 17px; font-weight: 600; letter-spacing: 0; line-height: 1.35; margin: 0; }
.page-head .eyebrow, .page-head p { display: none; }
.page-head > .button { position: absolute; right: 0; }
.page-actions { position: absolute; right: 0; }
.eyebrow { font-size: 13px; color: var(--muted); font-weight: 500; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: 28px; font-weight: 650; letter-spacing: -.4px; }
h2 { font-size: 20px; font-weight: 600; line-height: 1.3; letter-spacing: -.25px; }
h3 { font-size: 17px; font-weight: 600; line-height: 1.35; }
p { line-height: 1.4; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 8px 13px; min-height: 38px; border: 1px solid var(--line); border-radius: 13px; background: var(--panel); font-size: 15px; font-weight: 500; }
.button:hover { background: rgba(255,255,255,.5); }
.button.primary { background: var(--accent); color: #fff; border-color: transparent; font-weight: 600; }
.button.primary:hover { filter: brightness(1.1); }
.button.small { font-size: 15px; min-height: 34px; padding: 7px 12px; }
.button .icon { width: 20px; height: 20px; }
.text-button { border: 0; background: transparent; padding-left: 0; color: var(--accent); box-shadow: none; }
.text-button:hover { background: transparent; }
.icon-button { display: inline-grid; place-items: center; width: 44px; height: 44px; min-height: 44px; padding: 10px; border: 1px solid rgba(0,85,85,.1); background: rgba(255,255,255,.12); border-radius: 50%; color: var(--accent); flex-shrink: 0; }
.icon-button .icon { width: 24px; height: 24px; }
.icon-button:hover { background: rgba(255,255,255,.35); }
.full-width { width: 100%; }
.centered { text-align: center; font-size: 15px; }
.muted { color: var(--muted); }
.text-link { display: inline-flex; align-items: center; gap: 7px; font-size: 16px; color: var(--accent); }
.text-link .icon { width: 19px; height: 19px; }
.back-link { display: inline-flex; align-items: center; gap: 6px; margin: 0 0 12px; font-size: 15px; color: var(--accent); }
.back-link .icon { width: 19px; height: 19px; }
.app-footer { display: none; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: 300px; max-width: calc(100vw - 44px); z-index: 60; display: flex; flex-direction: column; overflow-y: auto; padding: 23px 18px; background: var(--sidebar); backdrop-filter: blur(28px); -webkit-backdrop-filter: blur(28px); border-right: 1px solid var(--line); transform: translateX(-101%); transition: transform .22s ease; visibility: hidden; }
.sidebar-open .sidebar { visibility: visible; transform: translateX(0); }
.sidebar-scrim { display: none; position: fixed; inset: 0; border: 0; background: rgba(0,55,55,.2); z-index: 59; }
.sidebar-open .sidebar-scrim { display: block; }
.sidebar-backdrop { position: fixed; inset: 0; z-index: 59; width: 100%; height: 100%; border: 0; background: rgba(0,55,55,.2); padding: 0; }
.native-sidebar-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 25px; }
.native-sidebar-header .brand { margin: 0; }
.sidebar .primary-nav { margin-bottom: 25px; }
.brand { display: flex; align-items: center; gap: 12px; font-size: 23px; font-weight: 650; letter-spacing: -.6px; margin-bottom: 28px; }
.brand small { display: block; font-size: 12px; color: var(--muted); font-weight: 400; letter-spacing: 0; margin-top: 3px; }
.brand-mark { width: 37px; height: 37px; display: grid; place-items: center; color: var(--accent); }
.brand-mark .icon { width: 30px; height: 30px; }
.sidebar-label { padding: 0 12px; margin-bottom: 9px; font-size: 13px; color: var(--muted); }
.primary-nav, .puzzle-nav { display: grid; gap: 4px; }
.nav-item, .puzzle-link { display: flex; align-items: center; gap: 12px; width: 100%; padding: 13px 12px; border: 0; border-radius: 13px; background: transparent; font-size: 17px; text-align: left; }
.nav-item.active, .puzzle-link.selected { background: var(--control); color: var(--accent); font-weight: 600; }
.nav-item:hover, .puzzle-link:hover { background: rgba(255,255,255,.45); }
.nav-arrow { margin-left: auto; opacity: .5; }
.puzzle-label { margin-top: 30px; }
.tiny-puzzle .icon { width: 21px; height: 21px; }
.tiny-puzzle { display: block; width: 25px; height: 28px; flex-shrink: 0; }
.tiny-puzzle img { width: 100%; height: 100%; object-fit: contain; }
.puzzle-link i { width: 6px; height: 6px; border-radius: 50%; margin-left: auto; background: var(--accent); }
.puzzle-link small { font-size: 10px; margin-left: auto; color: var(--muted); }
.sidebar-bottom { display: flex; align-items: center; gap: 10px; margin-top: auto; padding-top: 24px; }
.device-avatar { width: 35px; height: 35px; display: grid; place-items: center; color: var(--accent); }
.sidebar-bottom strong { font-size: 14px; display: block; }
.sidebar-bottom span { display: block; font-size: 12px; color: var(--muted); margin-top: 3px; }
.online-dot { width: 7px; height: 7px; background: var(--green); border-radius: 50%; margin-left: auto; }
.native-catalog-intro { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin: 5px 0 26px; }
.native-catalog-intro > div { display: flex; align-items: center; gap: 15px; flex: 1; }
.native-puzzle-image { display: block; width: 60px; height: 65px; flex-shrink: 0; }
.native-puzzle-image img { width: 100%; height: 100%; object-fit: contain; }
.native-catalog-intro h2 { margin: 0 0 5px; font-size: 20px; }
.native-catalog-intro p { margin: 0; color: var(--accent); }
.native-overview-card { display: flex; align-items: center; gap: 25px; border: 1px solid var(--line); border-radius: 20px; padding: 24px; background: var(--panel); margin-bottom: 24px; }
.native-overview-card img { max-width: 150px; max-height: 150px; object-fit: contain; }
.native-overview-card h2 { margin-bottom: 10px; }
.native-overview-card p { margin-bottom: 0; color: var(--accent); }
.overview-hero { display: flex; align-items: center; padding: 25px; border: 1px solid var(--line); border-radius: 20px; background: var(--panel); margin-bottom: 20px; min-height: 220px; }
.hero-copy { flex: 1; min-width: 0; }
.hero-copy h2 { font-size: 27px; line-height: 1.25; margin: 16px 0 10px; }
.hero-copy h2 span { color: var(--accent); }
.hero-copy p { color: var(--accent); font-size: 16px; }
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 5px 9px; border-radius: 10px; background: var(--panel); color: var(--accent); font-size: 12px; }
.pill .icon { width: 15px; height: 15px; }
.hero-progress { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.hero-progress strong span { font-weight: 400; color: var(--muted); }
.avatar-stack { color: var(--accent); }
.progress-track, .mini-progress { height: 3px; border-radius: 5px; background: var(--control); margin-top: 8px; }
.progress-track { max-width: 200px; }
.progress-track span, .mini-progress span { display: block; height: 100%; background: var(--accent); border-radius: 5px; }
.hero-art { width: 30%; display: grid; place-items: center; }
.hero-art picture, .hero-art img { width: 160px; max-width: 100%; height: 160px; object-fit: contain; }
.floating-tag { display: none; }
.overview-stats { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); border: 1px solid var(--line); background: var(--panel); border-radius: 17px; margin: 19px 0 27px; }
.overview-stats > div, .overview-stats > a { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 9px; padding: 16px 12px; }
.overview-stats strong { font-size: 19px; }
.overview-stats span { font-size: 14px; color: var(--muted); }
.overview-stats > a > .icon:last-child { width: 15px; }
.library-title { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 20px; }
.library-title h2 { font-size: 22px; margin: 0; }
.library-title h2 span { font-size: 16px; font-weight: 400; color: var(--muted); margin-left: 10px; }
.library-title select { min-width: 125px; }
.section-caption { font-size: 16px; font-weight: 600; color: var(--accent); margin-bottom: 12px; }
.set-section { margin-bottom: 20px; }
.set-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; }
.set-card { display: flex; align-items: center; gap: 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; min-height: 76px; }
.set-card:hover { background: rgba(255,255,255,.5); }
.set-card.native-overview-card { margin: 0; }
.set-card > .icon { margin-left: auto; color: var(--accent); width: 17px; height: 17px; }
.set-image { width: 52px; height: 56px; flex-shrink: 0; display: grid; place-items: center; }
.set-image picture, .set-image img { display: block; width: 100%; height: 100%; object-fit: contain; }
.set-copy { min-width: 0; flex: 1; }
.set-copy h3 { font-size: 16px; margin: 0 0 4px; }
.set-copy p { font-size: 13px; color: var(--muted); margin: 0; }
.set-copy p span { padding: 0 3px; }
.set-arrow { color: var(--accent); }
.set-arrow .icon { width: 16px; height: 16px; }
.quiet-note { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--accent); margin-top: 26px; line-height: 1.5; }
.quiet-note .icon { width: 18px; height: 18px; }
.status-dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; background: var(--red); }
.status-dot.unlearned { background: var(--red); }
.status-dot.learning { background: var(--yellow); }
.status-dot.learned { background: var(--green); }
.algorithm-list-layout { display: grid; grid-template-columns: minmax(0,7fr) minmax(245px,2.7fr); gap: 28px; align-items: start; margin-left: -7px; margin-right: -3px; }
.algorithm-list-main { min-width: 0; }
.algorithm-list-aside { min-width: 0; display: grid; gap: 18px; position: sticky; top: 20px; padding: 8px 0; }
.algorithm-list-aside .panel { padding: 16px; }
.algorithm-list-aside .panel-heading { margin-bottom: 16px; }
.algorithm-list-aside h2 { font-size: 18px; }
.algorithm-list-aside p { font-size: 16px; line-height: 1.35; margin-bottom: 16px; }
.algorithm-list-aside .info-image { display: block; margin: 12px auto 24px; width: 155px; height: 155px; }
.algorithm-list-aside .info-image img { width: 100%; height: 100%; object-fit: contain; }
.algorithm-list-aside .button { border-radius: 13px; width: 100%; }
.algorithm-list-aside .text-button { justify-content: flex-start; }
.native-info-panel .info-content { display: block; border: 0; padding: 0; }
.native-info-panel details summary { color: var(--accent); cursor: pointer; list-style: none; margin: 10px 0 0; }
.native-info-panel details summary::-webkit-details-marker { display: none; }
.native-info-panel details[open] summary { margin-bottom: 14px; }
.native-info-panel .info-description { white-space: pre-line; margin-top: 12px; }
.list-toolbar { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 24px; }
.search-input { position: relative; min-width: 200px; width: 100%; flex: 1; }
.list-toolbar > .search-input { flex: 0 0 100%; }
.list-toolbar > .filter-chips { width: 100%; }
.search-input input { width: 100%; height: 45px; padding: 9px 14px 9px 40px; font-size: 17px; border-radius: 16px; }
.search-input .icon { position: absolute; top: 12px; left: 13px; width: 21px; height: 21px; color: var(--muted); }
.filter-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.chip { display: inline-flex; align-items: center; justify-content: center; gap: 5px; font-size: 13px; padding: 7px 14px; border: 1px solid var(--line); border-radius: 24px; color: var(--accent); background: var(--panel); min-height: 30px; }
.chip.selected { color: #000; background: rgba(255,255,255,.45); }
.chip .icon { width: 15px; height: 15px; }
.info-card { border: 1px solid var(--line); border-radius: 16px; background: var(--panel); margin-bottom: 20px; overflow: hidden; }
.info-card summary { list-style: none; display: flex; align-items: center; gap: 9px; padding: 15px 17px; cursor: pointer; font-size: 17px; }
.info-card summary > span { margin-left: auto; font-size: 13px; color: var(--muted); }
.info-card summary > .icon:last-child { width: 16px; }
.info-content { display: flex; flex-wrap: wrap; gap: 20px; padding: 20px; border-top: 1px solid var(--line); font-size: 16px; }
.info-content > div { flex: 1; min-width: 160px; }
.info-image img { max-height: 155px; max-width: 180px; }
.info-content p { white-space: pre-line; }
.info-content code { display: block; margin: 8px 0; }
.results-label { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin: 18px 0; font-size: 13px; color: var(--muted); }
.results-label > span { display: flex; align-items: center; gap: 7px; }
.results-label .status-dot { width: 8px; height: 8px; margin-left: 7px; }
.case-section { margin-bottom: 27px; }
.case-section > h2 { font-size: 17px; font-weight: 600; color: var(--muted); margin-bottom: 7px; }
.case-section h2 > span { font-size: 13px; font-weight: 400; margin-left: 6px; }
.case-grid { display: grid; grid-template-columns: minmax(0,1fr); gap: 7px; }
.case-card { display: flex; align-items: center; gap: 10px; padding: 9px 10px 9px 7px; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; min-height: 94px; }
.case-card:hover { background: rgba(255,255,255,.5); }
.case-card > div { min-width: 0; flex: 1; }
.case-card h3 { display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 400; margin: 0 0 2px; }
.case-card .notation { font-family: inherit; font-weight: 600; font-size: 17px; line-height: 1.35; white-space: normal; overflow-wrap: anywhere; margin: 0; }
.case-diagram { display: block; width: 75px; height: 75px; flex-shrink: 0; filter: drop-shadow(0 2px 4px rgba(0,0,0,.22)); }
.case-diagram img { width: 100%; height: 100%; object-fit: contain; }
.case-card > .icon { display: none; }
.favorite-star { color: var(--yellow); width: 16px; height: 16px; fill: var(--yellow); }
.panel { padding: 18px; background: var(--panel); border: 1px solid var(--line); border-radius: 17px; min-width: 0; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.panel-heading h2 { display: inline-flex; align-items: center; gap: 9px; margin: 0; font-size: 18px; }
.panel-heading .muted, .count-label { color: var(--muted); font-size: 13px; }
.panel-description { font-size: 15px; color: var(--muted); line-height: 1.5; }
.detail-layout { display: grid; grid-template-columns: minmax(0,48fr) minmax(0,52fr); gap: 38px; align-items: start; padding: 0 14px; }
.detail-right { display: grid; gap: 22px; min-width: 0; }
.case-preview { position: relative; padding: 0; border: 0; background: transparent; }
.case-preview > .panel-heading { display: none; }
.variation-tabs { display: flex; flex-wrap: wrap; gap: 7px; margin: 13px 0 17px; }
.variation-tabs .chip { font-size: 13px; padding: 7px 11px; }
.learning-control { margin: 0 0 16px; }
.learning-control > span { display: none; }
.segmented { display: flex; gap: 2px; padding: 2px; background: var(--control); border: 0; border-radius: 22px; min-width: 0; }
.segmented button { display: flex; align-items: center; justify-content: center; gap: 7px; flex: 1; min-width: 0; background: transparent; border: 0; border-radius: 20px; font-size: 13px; padding: 8px 12px; color: var(--accent); white-space: nowrap; }
.segmented .selected { background: var(--selected); color: #000; font-weight: 600; }
.status-picker button { font-size: 13px; padding: 8px 4px; color: #000; }
.status-picker .status-dot { display: none; }
.status-picker .selected { color: #fff; box-shadow: 0 2px 5px rgba(0,0,0,.08); }
.status-picker .selected.unlearned { background: var(--red); }
.status-picker .selected.learning { background: var(--yellow); }
.status-picker .selected.learned { background: var(--green); }
.preview-mode-tabs { margin-bottom: 16px; }
.native-preview-content { min-height: 340px; }
.diagram-stage { display: grid; place-items: center; min-height: 340px; margin: 24px 0 20px; background: transparent; }
.detail-diagram { display: block; width: min(85%,300px); height: 300px; filter: drop-shadow(0 2px 5px rgba(0,0,0,.22)); }
.detail-diagram img { width: 100%; height: 100%; object-fit: contain; }
.preview-actions { display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; margin: 18px 0 20px; }
.preview-actions .button { font-size: 15px; }
.native-case-notation { font-size: 21px; line-height: 1.5; font-weight: 600; text-align: center; margin: 25px 0 16px; overflow-wrap: anywhere; }
.native-setup { text-align: center; font-size: 16px; color: var(--accent); line-height: 1.45; overflow-wrap: anywhere; }
.native-setup code { color: #000; }
.solutions-panel { padding: 16px 9px 0; border: 0; background: transparent; }
.solutions-panel .panel-heading { color: var(--accent); margin: 0 16px 14px; }
.solutions-panel .panel-heading h2 { font-size: 16px; font-weight: 400; }
.solution { display: flex; align-items: center; gap: 12px; text-align: left; width: 100%; border: 0; background: color-mix(in srgb,var(--primary) 19%,transparent); border-radius: 15px; margin: 7px 0; padding: 12px 13px; min-height: 44px; }
.solution.selected { background: color-mix(in srgb,var(--primary) 19%,transparent); }
.solution-row { display: flex; align-items: center; gap: 7px; min-width: 0; }
.solution-row .solution { flex: 1; min-width: 0; }
.solution > div { flex: 1; min-width: 0; }
.solution small { display: none; }
.solution code { font-family: inherit; font-size: 17px; line-height: 1.35; overflow-wrap: anywhere; }
.solution > code { flex: 1; min-width: 0; }
.solution.selected code { font-weight: 600; }
.solution > .icon { width: 20px; height: 20px; color: var(--accent); }
.radio-dot { display: none; }
.solutions-panel > .text-button { width: 100%; background: color-mix(in srgb,var(--primary) 19%,transparent); border-radius: 15px; margin-top: 0; }
code, .notation { font-family: inherit; }
.remove-notation .icon { width: 18px; height: 18px; color: var(--red); }
.playback-panel { border: 0; background: transparent; padding: 0; }
.playback-panel > .panel-heading { justify-content: center; }
.playback-panel > .panel-heading h2 { color: var(--accent); font-size: 17px; font-weight: 400; }
.playback-panel > .panel-heading .pill { display: none; }
.preview-expansion { display: flex; justify-content: center; }
.playback-expanded { grid-template-columns: minmax(0,1fr); }
.playback-expanded .detail-right { display: none; }
.playback-expanded #playback-cube { height: min(60vh,620px); }
.playback-panel #playback-cube { display: grid; place-items: center; width: 100%; height: clamp(280px,40vw,480px); }
.playback-panel .cube-illustration { width: 100%; height: 100%; }
.move-tokens { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 2px; margin: 12px 0 25px; }
.move-token { border: 0; background: transparent; border-radius: 5px; padding: 4px 6px; color: #000; font-family: ui-monospace,SFMono-Regular,Menlo,monospace; font-size: 18px; }
.move-token.done { color: var(--accent); }
.move-token.current { color: var(--accent); font-weight: 750; background: rgba(255,255,255,.2); }
.playback-controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 7px; margin: 24px 0; }
.playback-controls span { font-size: 13px; color: var(--muted); margin: 0 8px; }
.playback-controls .button:not(.icon-button) { font-size: 15px; }
.playback-controls select { font-size: 13px; padding: 8px; border-radius: 20px; }
.playback-position { font-size: 13px; text-align: center; color: var(--muted); margin: 16px 0; }
.practice-options { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin: 6px 0 26px; }
.practice-options .segmented { margin-right: auto; }
.practice-options select { font-size: 14px; }
.practice-options .icon { width: 19px; height: 19px; }
.practice-layout { display: grid; grid-template-columns: minmax(0,62fr) minmax(0,38fr); gap: 28px; align-items: start; }
.practice-stage { display: flex; flex-direction: column; min-height: calc(100vh - 230px); padding: 0; border: 0; background: transparent; min-width: 0; }
.practice-sidebar { display: grid; gap: 18px; min-width: 0; }
.timer-panel { border: 0; background: transparent; padding: 0; }
.scramble-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 4px 14px; }
.scramble-heading .eyebrow { color: var(--muted); margin: 0; }
.scramble-heading .eyebrow span { margin-left: 8px; font-weight: 400; }
.scramble-heading .button { font-size: 14px; padding: 7px 12px; }
.scramble { font-family: inherit; font-size: 27px; font-weight: 600; line-height: 1.3; text-align: center; overflow-wrap: anywhere; margin: 5px 0 20px; padding: 0 5px; }
.timer-face { width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; flex: 1; min-height: 335px; padding: 16px 0; margin: 20px 0 0; border: 0; background: transparent; color: var(--accent); user-select: none; touch-action: manipulation; }
#timer-digits { font-size: clamp(75px,9.3vw,110px); letter-spacing: -2px; font-weight: 500; line-height: 1.2; font-variant-numeric: tabular-nums; }
#timer-hint { color: var(--muted); font-size: 13px; margin-top: 12px; }
.timer-face[data-phase="running"] { color: var(--accent); }
.timer-face[data-phase="inspection"] { color: #a58000; }
.timer-face[data-phase="arming"] { color: var(--green); }
.timer-lower { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 20px; font-size: 16px; color: var(--muted); padding: 8px 0 20px; }
.timer-lower > span { display: flex; align-items: center; gap: 6px; }
.timer-lower .button { font-size: 16px; }
.practice-summary { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 22px; margin: 10px 0; font-size: 17px; color: var(--muted); }
.practice-summary strong { font-weight: 400; }
.timer-penalties { display: flex; justify-content: center; gap: 12px; margin: 10px 0; }
.timer-penalties .button { min-width: 86px; border-radius: 25px; }
.practice-bottom { display: grid; grid-template-columns: 1.3fr 1fr; gap: 20px; margin: 20px 0; }
.stats-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; padding: 12px 0 22px; }
.stats-grid > div { display: flex; flex-direction: column; align-items: center; gap: 5px; border: 1px solid var(--line); background: var(--panel); padding: 9px 6px; border-radius: 17px; }
.stats-grid span { font-size: 12px; color: var(--muted); }
.stats-grid strong { font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; }
.practice-history-card .stats-grid { max-width: 250px; margin: 10px auto; }
.native-stat-pills { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 24px 0 25px; }
.native-stat-pills > div { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 63px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 18px; background: var(--panel); }
.native-stat-pills span { font-size: 12px; color: var(--muted); }
.native-stat-pills strong { font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; }
.trend { display: block; width: 100%; height: auto; margin: 15px 0 4px; color: var(--accent); overflow: visible; }
.trend-labels { display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; margin: 5px 6px 24px; }
.chart-empty { font-size: 14px; color: var(--muted); text-align: center; margin: 0; padding: 30px 0; }
.history-empty { font-size: 14px; color: var(--muted); margin: 14px 0 8px; }
.native-chart-label { font-size: 15px; color: var(--muted); margin: 12px 0; }
.net-panel { text-align: center; }
.practice-stage .net-panel { margin-top: auto; padding: 35px 0 14px; background: transparent; border: 0; }
.practice-preview-bottom { margin-top: auto; padding: 30px 0 14px; text-align: center; }
.practice-preview-bottom .cube-net { height: 215px; }
.practice-preview-bottom picture { display: block; margin: 0 auto 10px; width: 110px; height: 110px; }
.practice-preview-bottom picture img { width: 100%; height: 100%; object-fit: contain; }
.practice-preview-bottom p { font-size: 13px; color: var(--muted); margin: 0 0 9px; }
.practice-preview-bottom code { display: block; font-size: 17px; font-weight: 600; overflow-wrap: anywhere; }
.cube-net { display: block; width: min(85%,255px); height: 215px; margin: auto; }
.net-panel .muted { font-size: 13px; margin: 10px 0 0; }
.net-fallback { display: block; margin: auto; }
.net-fallback img { max-width: 140px; max-height: 160px; }
.practice-case { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; font-size: 13px; color: var(--muted); margin: 15px 0; }
.practice-case img { width: 110px; height: 110px; object-fit: contain; }
.practice-case code { color: #000; font-size: 17px; font-weight: 600; text-align: center; }
.recent-panel { margin-top: 20px; }
.native-history-list { display: grid; gap: 7px; margin-top: 20px; }
.native-history-date { font-size: 16px; font-weight: 600; margin: 22px 0 7px; }
.native-history-item, .native-solve-card { border: 1px solid var(--line); border-radius: 17px; background: var(--panel); padding: 15px; min-width: 0; }
.native-history-item > div, .native-solve-card > div { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.native-history-item strong, .native-solve-card strong { font-size: 18px; font-weight: 600; }
.native-history-item time, .native-solve-card time { font-size: 12px; color: var(--muted); white-space: nowrap; }
.native-history-item p, .native-solve-card p { font-size: 13px; color: var(--muted); margin: 5px 0 0; overflow-wrap: anywhere; line-height: 1.35; }
.native-history-item > small { display: block; font-size: 13px; color: var(--muted); margin: 5px 0 0; overflow-wrap: anywhere; line-height: 1.35; }
.native-history-item > .penalty-select { margin-top: 9px; }
.native-history-item .time-link, .native-solve-card .time-link { color: #000; font-size: 18px; }
.native-history-item .icon-button, .native-solve-card .icon-button { width: 30px; height: 30px; min-height: 30px; padding: 5px; }
.native-history-item .icon-button .icon, .native-solve-card .icon-button .icon { width: 17px; height: 17px; }
.solve-table { width: 100%; border-collapse: collapse; text-align: left; font-size: 15px; }
.solve-table th { font-size: 13px; font-weight: 400; color: var(--muted); padding: 12px 8px; }
.solve-table td { padding: 13px 8px; border-top: 1px solid var(--line); }
.solve-table small { display: block; color: var(--muted); font-size: 12px; margin-top: 4px; }
.solve-table strong { font-weight: 600; }
.time-link { border: 0; padding: 0; background: transparent; color: var(--accent); font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; }
.penalty-select { font-size: 13px; padding: 6px 9px; min-width: 68px; }
.table-scroll { overflow: auto; }
.empty-state { text-align: center; padding: 40px 15px; color: var(--muted); }
.empty-state > .icon { width: 35px; height: 35px; opacity: .45; margin-bottom: 14px; }
.empty-state h3 { color: var(--text); font-size: 18px; margin-bottom: 8px; }
.empty-state p { font-size: 15px; margin-bottom: 0; }
.history-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; margin-bottom: 20px; font-size: 15px; }
.history-toolbar .button { margin-left: auto; }
.learning-banner { display: flex; align-items: center; gap: 20px; padding: 24px; border: 1px solid var(--line); border-radius: 18px; background: var(--panel); margin-bottom: 28px; }
.learning-banner > .icon { width: 36px; height: 36px; color: var(--accent); }
.learning-banner h2 { margin-bottom: 8px; }
.learning-banner p { font-size: 15px; color: var(--muted); margin: 0; }
.video-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 15px; }
.video-card { display: block; background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 14px; min-width: 0; }
.video-art { display: flex; align-items: center; justify-content: center; position: relative; height: 160px; background: transparent; border-radius: 9px; overflow: hidden; }
.video-art img { width: 100%; height: 100%; object-fit: contain; }
.video-art img.video-thumbnail { object-fit: cover; }
.play-badge { position: absolute; inset: 50% auto auto 50%; transform: translate(-50%,-50%); width: 37px; height: 37px; border-radius: 50%; background: rgba(255,255,255,.8); color: #fff; display: grid; place-items: center; }
.play-badge .icon { width: 22px; height: 22px; fill: #fff; }
.video-card > div:last-child { padding: 10px 0 0; }
.video-card small { font-size: 13px; color: var(--muted); }
.video-card h3 { font-size: 17px; margin: 5px 0 12px; line-height: 1.35; }
.video-card > div > span:last-child { color: var(--accent); font-size: 13px; }
.video-card > div > span:last-child .icon { width: 15px; height: 15px; }
.learn-layout { display: grid; grid-template-columns: minmax(0,42fr) minmax(0,58fr); gap: 30px; align-items: start; }
.learn-layout .video-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.learn-layout .video-art { height: auto; aspect-ratio: 16 / 9; }
.learn-layout .video-art picture { display: block; width: 100%; height: 100%; }
.learn-library > .filter-chips { margin-bottom: 30px; }
.learn-library > .set-section > h2 { font-size: 18px; margin-bottom: 17px; }
.learn-player { position: sticky; top: 18px; min-width: 0; }
.learn-player h2 { font-size: 22px; margin-bottom: 20px; }
.learn-player iframe { border: 0; width: 100%; aspect-ratio: 9 / 16; border-radius: 22px; background: #000; }
.learn-player .video-card.selected { outline: 2px solid var(--accent); }
.native-video-placeholder { display: grid; place-items: center; min-height: 450px; padding: 35px; text-align: center; color: var(--accent); background: var(--panel); border: 1px solid var(--line); border-radius: 20px; }
.native-video-placeholder p { max-width: 300px; }
.video-card.selected { border-color: var(--accent); outline: 1px solid var(--accent); }
.lesson-select { width: 100%; text-align: left; cursor: pointer; color: #000; }
.lesson-select .video-art { width: 100%; }
.notation-guide h2 { font-size: 22px; margin-bottom: 7px; }
.notation-guide p { color: var(--muted); font-size: 16px; }
.notation-grid { display: grid; grid-template-columns: repeat(6,minmax(0,1fr)); gap: 12px; }
.notation-card { border: 1px solid var(--line); border-radius: 17px; background: var(--panel); padding: 12px; text-align: center; min-width: 0; }
.notation-card h3 { font-size: 23px; margin: 0; }
.notation-card .cube-illustration { display: block; width: 100%; height: 130px; margin: 12px auto; }
.notation-card small { font-size: 12px; color: var(--muted); }
.settings-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 20px; align-items: start; }
.field-label { display: block; color: var(--accent); font-size: 15px; font-weight: 500; margin: 20px 0 10px; }
.theme-swatches { display: flex; flex-wrap: wrap; gap: 14px; margin: 18px 0 25px; }
.swatch { display: grid; place-items: center; width: 34px; height: 34px; background: var(--swatch); border: 3px solid var(--panel); border-radius: 50%; outline: 1px solid var(--line); color: #fff; }
.swatch.selected { outline: 2px solid var(--swatch); outline-offset: 2px; }
.swatch .icon { width: 17px; height: 17px; }
.setting-row { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 17px 0; border-top: 1px solid var(--line); font-size: 16px; }
.setting-row:last-child { padding-bottom: 0; }
.setting-row select { font-size: 14px; padding: 8px 10px; }
.setting-row input[type="checkbox"] { appearance: none; -webkit-appearance: none; width: 50px; height: 28px; border: 0; padding: 0; border-radius: 18px; background: rgba(0,85,85,.18); position: relative; cursor: pointer; flex-shrink: 0; }
.setting-row input[type="checkbox"]::after { content: ""; width: 24px; height: 24px; position: absolute; top: 2px; left: 2px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.1); }
.setting-row input[type="checkbox"]:checked { background: var(--accent); }
.setting-row input[type="checkbox"]:checked::after { transform: translateX(22px); }
.help-text { font-size: 14px; color: var(--muted); line-height: 1.5; }
.data-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 20px 0; }
.danger { color: var(--red); border-color: rgba(255,59,48,.3); }
.button.danger:not(.text-button) { background: rgba(255,59,48,.08); }
.about-panel > a { display: flex; align-items: center; justify-content: space-between; padding: 15px 0; border-top: 1px solid var(--line); color: var(--accent); font-size: 16px; }
.about-panel > a .icon { width: 18px; height: 18px; }
.pro-note { display: flex; align-items: start; gap: 12px; background: var(--panel); border: 1px solid var(--line); padding: 16px; border-radius: 15px; margin: 20px 0; }
.pro-note > .icon { width: 21px; height: 21px; color: var(--accent); }
.pro-note strong { font-size: 16px; }
.pro-note p { font-size: 14px; color: var(--muted); margin: 6px 0 0; }
.notice { background: var(--panel); padding: 13px 16px; border-radius: 13px; color: var(--accent); font-size: 15px; line-height: 1.5; }
.error-notice { color: #b02d26; background: rgba(255,59,48,.1); }
dialog { width: calc(100% - 32px); max-width: 575px; max-height: 90vh; padding: 22px 16px; background: var(--gradient); color: var(--text); border: 1px solid var(--line); border-radius: 30px; box-shadow: 0 15px 65px rgba(0,50,50,.15); }
dialog::backdrop { background: rgba(0,50,50,.25); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 20px; }
.modal-head h2 { font-size: 17px; font-weight: 600; margin: 0; }
.modal-head .icon-button { border: 0; background: transparent; }
.modal-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; margin-top: 23px; }
dialog p { font-size: 15px; color: var(--accent); }
dialog input { width: 100%; }
.solve-detail-time { color: var(--accent); font-size: 48px; font-weight: 600; margin: 20px 0; }
.solve-detail-time + p { margin-bottom: 22px; }
#toast { position: fixed; left: 50%; bottom: 28px; max-width: calc(100vw - 32px); transform: translate(-50%,15px); padding: 12px 20px; background: var(--accent); color: #fff; border-radius: 16px; font-size: 15px; box-shadow: 0 8px 25px rgba(0,50,50,.15); opacity: 0; pointer-events: none; transition: opacity .2s,transform .2s; z-index: 100; }
#toast.visible { opacity: 1; transform: translate(-50%,0); }
#toast.error { background: #b02d26; }
.boot { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 100vh; padding: 30px; text-align: center; }
.boot p { font-size: 16px; color: var(--accent); max-width: 450px; }
.boot-cube { color: var(--accent); margin-bottom: 16px; }
.boot-cube .icon { width: 65px; height: 65px; }
.boot-app-icon { display: block; width: 80px; height: 80px; border-radius: 18px; overflow: hidden; margin: 0 auto 20px; }
.boot-app-icon img { display: block; width: 100%; height: 100%; object-fit: contain; }
.mobile-tabs { display: none; }
.missing-diagram { display: flex; align-items: center; justify-content: center; width: 75px; height: 75px; color: var(--muted); font-size: 12px; text-align: center; }
.hero-diagram img { max-width: 200px; }
.sr-only { position: absolute; clip: rect(0,0,0,0); width: 1px; height: 1px; overflow: hidden; }
.favorited { color: #a07800; }
.favorited .icon { fill: var(--yellow); }
:root[data-row-style="glow"] .case-card > .status-dot { display: none; }
:root[data-row-style="glow"] .case-card.unlearned .case-diagram { filter: drop-shadow(0 0 6px rgba(255,59,48,.6)); }
:root[data-row-style="glow"] .case-card.learning .case-diagram { filter: drop-shadow(0 0 6px rgba(255,204,0,.6)); }
:root[data-row-style="glow"] .case-card.learned .case-diagram { filter: drop-shadow(0 0 6px rgba(52,199,89,.6)); }
@media (min-width: 1500px) {
  main { max-width: 1600px; padding-left: 28px; padding-right: 28px; }
  .set-grid { grid-template-columns: repeat(4,minmax(0,1fr)); }
  .topbar { padding-left: 30px; padding-right: 30px; }
}
@media (max-width: 1050px) {
  .topbar-left .brand { display: none; }
  .topbar { padding-left: 12px; padding-right: 12px; }
  .native-tabs a { padding-left: 14px; padding-right: 14px; }
  .set-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .algorithm-list-layout { grid-template-columns: minmax(0,7fr) minmax(230px,2.8fr); gap: 20px; }
  .detail-layout { gap: 25px; padding: 0 7px; }
  .practice-layout { gap: 22px; }
  .scramble { font-size: 25px; }
  .video-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .practice-sidebar .panel { padding: 15px; }
  .playback-controls { gap: 5px; }
  .playback-controls span { margin: 0 4px; }
}
@media (max-width: 800px) {
  .native-tabs a { padding: 10px 12px; font-size: 16px; }
  .native-tabs > .icon-button { width: 36px; }
  .algorithm-list-layout { grid-template-columns: minmax(0,1fr); margin: 0; }
  .algorithm-list-aside { position: static; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 15px; }
  .detail-layout { gap: 22px; padding: 0; }
  .detail-diagram { width: 240px; max-width: 100%; height: 240px; }
  .diagram-stage { min-height: 270px; }
  .solution code { font-size: 16px; }
  .practice-layout { grid-template-columns: minmax(0,58fr) minmax(0,42fr); gap: 17px; }
  .practice-stage { min-height: calc(100vh - 250px); }
  .practice-options { gap: 9px; }
  .practice-options .segmented { width: 100%; }
  .timer-face { min-height: 270px; }
  .scramble { font-size: 22px; }
  .stats-grid strong { font-size: 17px; }
  .settings-grid { grid-template-columns: minmax(0,1fr); }
  .learn-layout { gap: 20px; }
  .learn-layout .video-card { padding: 10px; }
  .learn-layout .video-card h3 { font-size: 15px; }
  .notation-grid { grid-template-columns: repeat(4,minmax(0,1fr)); }
}
@media (max-width: 620px) {
  :root { font-size: 16px; }
  .topbar { min-height: 65px; grid-template-columns: 1fr 1fr; padding: 10px 13px; }
  .topbar-left .brand { display: flex; font-size: 18px; }
  .topbar-left .brand img { width: 28px; height: 28px; }
  .topbar-left { gap: 7px; }
  .topbar-right { gap: 8px; }
  .topbar-left > .icon-button, .topbar-right > .icon-button { width: 40px; height: 40px; min-height: 40px; padding: 9px; }
  .topbar .native-tabs { display: none; }
  .icon-button.mobile-sidebar-toggle { display: inline-grid; }
  .edition, .breadcrumbs, .brand small { display: none; }
  main { padding: 0 13px calc(100px + env(safe-area-inset-bottom)); }
  .page-head { min-height: 35px; margin-bottom: 22px; }
  .page-head h1 { font-size: 17px; max-width: calc(100vw - 100px); }
  .page-head > .button { padding: 9px; min-height: 35px; gap: 0; font-size: 0; }
  .page-head > .button .icon { width: 20px; height: 20px; }
  .page-actions .button { padding: 8px; min-height: 35px; font-size: 0; gap: 0; }
  .page-actions .button .icon { width: 20px; height: 20px; }
  .mobile-tabs { display: flex; justify-content: space-around; position: fixed; left: 10px; right: 10px; bottom: calc(9px + env(safe-area-inset-bottom)); padding: 7px 5px; border: 1px solid rgba(0,85,85,.1); border-radius: 30px; background: rgba(255,255,255,.45); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); z-index: 30; }
  .mobile-tabs a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-width: 0; flex: 1; padding: 5px 7px; border-radius: 24px; color: var(--accent); font-size: 11px; }
  .mobile-tabs a.active { background: rgba(0,85,85,.12); color: #003939; font-weight: 600; }
  .mobile-tabs .icon { width: 21px; height: 21px; }
  .button { font-size: 16px; padding: 10px 14px; }
  .native-catalog-intro { margin-top: 0; gap: 14px; }
  .native-catalog-intro h2 { font-size: 23px; }
  .native-catalog-intro p { font-size: 14px; }
  .native-puzzle-image { width: 45px; height: 48px; }
  .native-catalog-intro > div { gap: 9px; }
  .native-catalog-intro > .button { padding: 10px 12px; font-size: 14px; }
  .native-overview-card { padding: 18px; gap: 17px; }
  .native-overview-card img { max-width: 90px; max-height: 110px; }
  .native-overview-card h2 { font-size: 19px; }
  .native-overview-card p { font-size: 14px; }
  .overview-hero { padding: 19px; min-height: 190px; }
  .hero-copy h2 { font-size: 22px; }
  .hero-copy p { font-size: 14px; }
  .hero-art { width: 27%; }
  .hero-art picture, .hero-art img { width: 90px; height: 110px; }
  .hero-progress { font-size: 12px; }
  .hero-copy .desktop-only { display: none; }
  .overview-stats { grid-template-columns: repeat(2,minmax(0,1fr)); margin-bottom: 25px; }
  .overview-stats > div, .overview-stats > a { padding: 12px 8px; gap: 7px; }
  .overview-stats strong { font-size: 17px; }
  .overview-stats span { font-size: 12px; }
  .library-title { margin-bottom: 15px; }
  .library-title h2 { font-size: 20px; }
  .library-title h2 span { font-size: 14px; }
  .library-title select { min-width: 90px; padding: 8px; font-size: 14px; }
  .section-caption { font-size: 17px; }
  .set-grid { gap: 9px; }
  .set-card { gap: 10px; padding: 10px 12px; min-height: 76px; border-radius: 14px; }
  .set-image { width: 43px; height: 52px; }
  .set-copy h3 { font-size: 14px; margin-bottom: 5px; }
  .set-copy p { font-size: 11px; }
  .set-arrow { display: none; }
  .set-card > .icon { display: none; }
  .quiet-note { font-size: 13px; align-items: start; }
  .list-toolbar { margin-bottom: 18px; gap: 10px; }
  .search-input { min-width: 100%; }
  .search-input input { font-size: 16px; }
  .chip { font-size: 12px; padding: 7px 11px; }
  .filter-chips { gap: 5px; }
  .results-label { font-size: 12px; gap: 8px; }
  .results-label > span { gap: 4px; flex-wrap: wrap; }
  .results-label .status-dot { margin-left: 4px; width: 7px; height: 7px; }
  .case-section { margin-bottom: 22px; }
  .case-section > h2 { font-size: 16px; }
  .case-card { gap: 9px; min-height: 77px; padding: 9px 10px 9px 7px; }
  .case-card h3 { font-size: 15px; }
  .case-card .notation { font-size: 15px; }
  .case-card .status-dot { width: 9px; height: 9px; }
  .case-diagram { width: 55px; height: 55px; }
  .algorithm-list-aside { grid-template-columns: minmax(0,1fr); gap: 14px; padding: 0; }
  .algorithm-list-aside .info-image { width: 130px; height: 130px; }
  .algorithm-list-aside .panel { padding: 16px; }
  .panel { padding: 16px; border-radius: 17px; }
  .panel-heading h2 { font-size: 18px; }
  .detail-layout { grid-template-columns: minmax(0,1fr); gap: 24px; }
  .detail-right { gap: 18px; }
  .case-preview { padding: 0; }
  .learning-control { margin-bottom: 14px; }
  .segmented button { font-size: 13px; padding: 8px; }
  .status-picker button { padding: 8px 4px; }
  .native-preview-content { min-height: 270px; }
  .diagram-stage { min-height: 270px; margin: 18px 0 16px; }
  .detail-diagram { width: 250px; height: 250px; }
  .preview-actions { gap: 9px; }
  .native-case-notation { font-size: 19px; margin: 15px 0; }
  .native-setup { font-size: 15px; }
  .solutions-panel { padding: 0; }
  .solutions-panel .panel-heading { margin-left: 13px; }
  .solution code { font-size: 16px; }
  .playback-panel { padding: 0; }
  .playback-panel #playback-cube { height: 330px; }
  .move-token { font-size: 16px; padding: 4px; }
  .playback-controls { gap: 6px; }
  .playback-controls .icon-button { width: 40px; height: 40px; min-height: 40px; }
  .playback-controls span { font-size: 12px; margin: 0 4px; }
  .playback-controls select { font-size: 12px; padding: 7px; }
  .practice-options { margin-bottom: 20px; gap: 9px; }
  .practice-options .segmented { margin: 0; }
  .practice-options select { font-size: 14px; max-width: 100%; flex: 1; min-width: 0; }
  .practice-layout { grid-template-columns: minmax(0,1fr); gap: 25px; }
  .practice-stage { min-height: 580px; }
  .scramble-heading { margin-bottom: 12px; }
  .scramble-heading .eyebrow { font-size: 12px; }
  .scramble-heading .button { font-size: 12px; padding: 7px 9px; min-height: 34px; }
  .scramble { font-size: 21px; line-height: 1.4; margin-bottom: 0; }
  .timer-face { min-height: 230px; margin-top: 5px; }
  #timer-digits { font-size: 84px; }
  #timer-hint { font-size: 12px; }
  .timer-lower { font-size: 14px; gap: 15px; padding-bottom: 9px; }
  .timer-lower .button { font-size: 14px; }
  .practice-summary { font-size: 16px; margin: 6px 0; }
  .practice-stage .net-panel { padding: 20px 0 0; }
  .practice-preview-bottom { padding: 20px 0 0; }
  .practice-preview-bottom .cube-net { height: 160px; }
  .cube-net { height: 160px; width: 215px; }
  .practice-case img { width: 95px; height: 95px; }
  .practice-case code { font-size: 16px; }
  .practice-bottom { grid-template-columns: minmax(0,1fr); }
  .stats-grid { gap: 8px; }
  .practice-history-card .stats-grid { max-width: 255px; }
  .trend { height: auto; }
  .native-history-item, .native-solve-card { padding: 14px; }
  .solve-table { font-size: 13px; }
  .solve-table th, .solve-table td { padding: 12px 5px; }
  .solve-table th { font-size: 12px; }
  .solve-table small { font-size: 11px; }
  .time-link { font-size: 16px; }
  .solve-table .icon-button { width: 30px; height: 30px; min-height: 30px; padding: 6px; }
  .solve-table .icon-button .icon { width: 18px; height: 18px; }
  .penalty-select { font-size: 12px; min-width: 60px; padding: 6px; }
  .history-toolbar { gap: 10px; font-size: 14px; }
  .history-toolbar .button { padding: 8px 12px; font-size: 14px; }
  .learning-banner { padding: 18px; gap: 13px; }
  .learning-banner h2 { font-size: 18px; }
  .learning-banner p { font-size: 14px; }
  .video-grid { gap: 10px; }
  .video-card { padding: 10px; border-radius: 17px; }
  .video-art { height: 110px; }
  .video-card h3 { font-size: 15px; }
  .video-card small { font-size: 12px; }
  .learn-layout { grid-template-columns: minmax(0,1fr); }
  .learn-player { position: static; }
  .learn-player iframe { aspect-ratio: 16 / 9; border-radius: 17px; }
  .notation-grid { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 9px; }
  .notation-card { padding: 10px 5px; }
  .notation-card .cube-illustration { height: 100px; }
  .notation-card h3 { font-size: 20px; }
  .notation-card small { font-size: 11px; }
  .settings-grid { gap: 17px; }
  .setting-row { font-size: 15px; gap: 12px; }
  .setting-row select { font-size: 13px; max-width: 56%; }
  .data-actions .button { flex: 1; font-size: 14px; }
  .field-label { font-size: 14px; }
  .help-text { font-size: 13px; }
  .pro-note strong { font-size: 15px; }
  .pro-note p { font-size: 13px; }
  dialog { border-radius: 25px; padding: 20px 15px; }
  #toast { bottom: calc(91px + env(safe-area-inset-bottom)); font-size: 14px; text-align: center; width: max-content; }
}
@media (max-width: 380px) {
  .set-grid { grid-template-columns: minmax(0,1fr); }
  .set-card { min-height: 76px; padding: 10px 12px; }
  .set-image { width: 60px; height: 60px; }
  .set-copy h3 { font-size: 16px; }
  .set-copy p { font-size: 13px; }
  .topbar-left .brand { font-size: 17px; }
  .native-catalog-intro { flex-wrap: wrap; }
  .mobile-tabs a { font-size: 10px; }
  .scramble { font-size: 19px; }
  #timer-digits { font-size: 75px; }
  .video-grid { grid-template-columns: minmax(0,1fr); }
  .playback-controls { gap: 4px; }
  .playback-controls span { margin: 0 2px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after, *::backdrop { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* Keep the averages with the stopwatch, as in the native practice view. */
.practice-clock { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 335px; }
.practice-clock .timer-face { flex: 0; min-height: 0; margin: 0; padding: 0; }
.practice-clock .practice-summary { margin: 14px 0 8px; }
@media(max-width:620px) { .practice-clock { min-height: 260px; } }

.timer-penalties .button.selected { background: var(--accent); color: #fff; }

/* A bounded app frame keeps the stopwatch, preview, and navigation together. */
html, body, #app { height: 100%; }
body { min-height: 0; overflow: hidden; }
.workspace {
  display: grid;
  grid-template-columns: 0 minmax(0, 1fr);
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
  transition: grid-template-columns .32s cubic-bezier(.22,.8,.25,1);
}
.workspace.sidebar-open { grid-template-columns: 250px minmax(0, 1fr); }
.main-shell { grid-column: 2; grid-row: 1; width: auto; height: 100%; min-height: 0; overflow: hidden; }
.topbar { flex: 0 0 70px; min-height: 70px; padding: 10px 16px; }
main { min-height: 0; max-width: none; padding: 0 20px 16px; overflow-y: auto; overflow-x: hidden; overscroll-behavior-y: contain; }
.page-head { min-height: 32px; margin-bottom: 18px; flex-shrink: 0; }
.sidebar {
  grid-column: 1;
  grid-row: 1;
  position: relative;
  inset: auto;
  width: 250px;
  max-width: none;
  height: 100%;
  min-height: 0;
  padding: 18px 14px;
  border-right: 1px solid var(--line);
  z-index: 5;
  transform: translateX(-100%);
  transition: transform .32s cubic-bezier(.22,.8,.25,1), visibility 0s .32s;
  overflow-x: hidden;
  overflow-y: auto;
}
.sidebar-open .sidebar { transform: none; transition-delay: 0s; }
.sidebar-open .sidebar-launch { display: none; }
.sidebar-backdrop, .sidebar-scrim { display: none !important; }
.native-sidebar-header { gap: 8px; margin-bottom: 20px; }
.native-sidebar-header .brand { font-size: 18px; gap: 10px; }
.native-sidebar-header .icon-button { width: 34px; height: 34px; min-height: 34px; padding: 6px; }
.sidebar .primary-nav { margin-bottom: 20px; }
.sidebar .nav-item { font-size: 15px; padding: 8px 11px; }
.sidebar .puzzle-link { font-size: 14px; padding: 6px 11px; }
.sidebar .sidebar-bottom { padding-top: 20px; }
.native-tabs { min-height: 40px; }
.native-tabs a { padding: 8px 13px; font-size: 15px; }
.mobile-sidebar-toggle, .mobile-practice-actions { display: none; }

@media (min-width: 701px) {
  .workspace[data-screen="algorithms"] main:has(.algorithm-list-layout),
  .workspace[data-screen="case"] main:has(.detail-layout),
  .workspace[data-screen="learn"] main:has(.learn-layout) {
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }
  .algorithm-list-layout, .detail-layout, .learn-layout { flex: 1 1 0; min-height: 0; grid-template-rows: minmax(0,1fr); align-items: stretch; overflow: hidden; margin-left: 0; margin-right: 0; gap: 24px; }
  .algorithm-list-main, .algorithm-list-aside, .case-preview, .detail-right, .learn-library, .learn-player { height: 100%; min-height: 0; overflow-y: auto; overscroll-behavior-y: contain; }
  .algorithm-list-main, .case-preview, .learn-library { padding-right: 6px; }
  .algorithm-list-aside { position: static; padding-top: 0; padding-bottom: 6px; display: flex; flex-direction: column; }
  .algorithm-list-aside .panel { flex-shrink: 0; }
  .case-card { min-height: 76px; }
  .case-diagram { width: 56px; height: 56px; }
  .case-card .notation { font-size: 16px; }
  .detail-layout { padding: 0 4px; }
  .detail-right { padding-right: 4px; gap: 18px; }
  .solutions-panel { padding-top: 0; }
  .diagram-stage { min-height: 240px; margin: 16px 0; }
  .detail-diagram { height: 225px; width: 225px; max-width: 90%; }
  .native-preview-content { min-height: 0; }
  .native-case-notation { font-size: 18px; margin: 16px 0; }
  .native-setup { font-size: 14px; margin-bottom: 16px; }
  .preview-actions { margin: 14px 0; gap: 9px; }
  .preview-actions .button { font-size: 14px; min-height: 36px; padding: 8px 11px; }
  .playback-panel #playback-cube { height: clamp(220px, 34vh, 340px); }
  .playback-expanded #playback-cube { height: min(48vh, 480px); }
  .move-tokens { margin: 8px 0 16px; }
  .move-token { font-size: 16px; padding: 3px 4px; }
  .playback-controls { margin: 16px 0; }
  .learn-player { position: static; padding-right: 3px; }
  .learn-player iframe { aspect-ratio: 16 / 10; max-height: calc(100dvh - 185px); }
  .learn-player h2 { font-size: 19px; margin-bottom: 10px; }
  .learn-library > .filter-chips { margin-bottom: 22px; }
  .learn-layout .video-card h3 { font-size: 15px; }
  .native-video-placeholder { min-height: 320px; }
}

.workspace[data-screen="practice"] main { display: flex; flex-direction: column; overflow: hidden; }
.practice-screen { display: flex; flex-direction: column; flex: 1; height: 100%; min-height: 0; }
.practice-screen > .page-head { margin-bottom: 12px; }
.practice-options { flex: 0 0 auto; gap: 10px; margin: 0 0 14px; }
.practice-options .segmented { width: auto; margin-right: auto; }
.practice-options select { padding: 8px 11px; font-size: 14px; max-width: 245px; }
.practice-options .segmented button { padding: 8px 12px; font-size: 13px; }
.practice-layout { flex: 1; min-height: 0; height: auto; align-items: stretch; gap: 24px; grid-template-columns: minmax(0, 62fr) minmax(260px, 38fr); }
.practice-stage {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  gap: 8px;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}
.practice-stage > .scramble { margin: 0; padding: 3px 8px; font-size: clamp(19px, 1.7vw, 25px); line-height: 1.35; }
.practice-clock { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 0; gap: 0; }
.practice-clock .timer-face { flex: 0 0 auto; min-height: 0; margin: 0; padding: 0; }
#timer-digits { font-size: clamp(74px, 8vw, 104px); }
.practice-clock #timer-hint { font-size: 12px; margin-top: 9px; }
.practice-clock .practice-summary { margin: 10px 0 0; font-size: 16px; line-height: 1.4; }
.timer-penalties { margin: 10px 0 0; }
.timer-penalties .button { min-height: 36px; min-width: 75px; padding: 7px 15px; font-size: 16px; }
.practice-preview-bottom { margin-top: 0; padding: 4px 0; }
.practice-preview-bottom .cube-net { width: min(85%, 225px); height: clamp(115px, 19vh, 165px); }
.practice-preview-bottom picture { width: 95px; height: 95px; margin-bottom: 5px; }
.practice-preview-bottom p { font-size: 12px; line-height: 1.35; margin: 5px 0; }
.practice-preview-bottom p.native-case-notation { font-size: 16px; margin: 6px 0 0; color: #000; }
.practice-stage > .timer-lower { flex-wrap: nowrap; gap: 12px; justify-content: space-between; padding: 0; min-height: 38px; font-size: 12px; }
.practice-stage > .timer-lower .button { min-height: 36px; font-size: 14px; padding: 7px 10px; }
.practice-stage > .help-text { display: none; }
.practice-stage > .error-notice { position: absolute; left: 20px; right: 20px; bottom: 20px; z-index: 15; }
.practice-sidebar { min-height: 0; height: 100%; overflow-y: auto; overscroll-behavior-y: contain; display: block; }
.practice-history-card { min-height: 100%; padding: 16px; }
.practice-history-card .native-stat-pills { margin: 18px 0 20px; }
.practice-history-card .trend { max-height: 215px; width: 100%; }
.practice-history-card .native-history-list { margin-top: 16px; }
.practice-history-card .native-history-item { padding: 12px 14px; }
.practice-history-card .panel-heading h2 { font-size: 18px; }
.practice-history-card > p.muted { font-size: 14px; }
.practice-option-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.practice-options-modal { display: grid; gap: 16px; }
.practice-options-modal .practice-options { display: grid; gap: 12px; margin: 0; }
.practice-options-modal .practice-options .segmented { margin: 0; width: 100%; }
.practice-options-modal .practice-options select { max-width: none; width: 100%; }
.mobile-puzzle-menu { display: none; }

@media (min-width: 701px) and (max-height: 800px) {
  .topbar { flex-basis: 64px; min-height: 64px; }
  main { padding-bottom: 12px; }
  .page-head { margin-bottom: 14px; }
  .practice-screen > .page-head { min-height: 28px; margin-bottom: 10px; }
  .practice-options { margin-bottom: 12px; }
  .practice-stage > .scramble { font-size: 21px; }
  #timer-digits { font-size: 85px; }
  .practice-preview-bottom .cube-net { height: 130px; width: 200px; }
  .practice-preview-bottom picture { width: 85px; height: 85px; }
  .practice-history-card .native-stat-pills { margin: 15px 0; }
  .practice-history-card .trend { max-height: 170px; }
}

@media (max-width: 700px), (max-height: 500px) and (pointer: coarse) {
  .workspace, .workspace.sidebar-open { display: flex; grid-template-columns: none; height: 100vh; height: 100dvh; }
  .sidebar, .sidebar-open .sidebar, .sidebar-backdrop, .sidebar-scrim, [data-action="toggle-sidebar"] { display: none !important; }
  .main-shell { width: 100%; height: 100%; flex: 1; }
  .topbar { display: flex; justify-content: space-between; flex: 0 0 54px; min-height: 54px; padding: 7px 13px; gap: 12px; }
  .topbar-left, .topbar-right { flex: 1; }
  .topbar .native-tabs { display: none; }
  .topbar-left .icon-button, .topbar-right .icon-button { width: 38px; height: 38px; min-height: 38px; padding: 8px; }
  .topbar .mobile-practice-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
  main { padding: 0 13px calc(84px + env(safe-area-inset-bottom)); }
  .page-head { justify-content: flex-start; text-align: left; min-height: 40px; margin: 8px 0 22px; }
  .page-head h1 { font-size: 30px; font-weight: 700; letter-spacing: -.5px; line-height: 1.2; max-width: none; }
  .page-actions { top: 50%; transform: translateY(-50%); }
  .mobile-tabs { display: flex; justify-content: space-around; position: fixed; left: 12px; right: 12px; bottom: calc(9px + env(safe-area-inset-bottom)); padding: 7px 5px; border: 1px solid rgba(0,85,85,.1); border-radius: 30px; background: rgba(255,255,255,.45); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); z-index: 30; }
  .mobile-tabs a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-width: 0; flex: 1; padding: 5px 7px; border-radius: 24px; color: var(--accent); font-size: 11px; }
  .mobile-tabs a.active { background: rgba(0,85,85,.12); color: #003939; font-weight: 600; }
  .mobile-tabs .icon { width: 21px; height: 21px; }
  .mobile-puzzle-menu { display: grid; grid-template-columns: minmax(0,1fr); gap: 9px; }
  .mobile-puzzle-menu > a, .mobile-puzzle-menu > button { display: flex; align-items: center; gap: 17px; width: 100%; min-height: 84px; padding: 14px 18px; text-align: left; background: var(--panel); border: 1px solid var(--line); border-radius: 17px; font-size: 20px; font-weight: 600; }
  .mobile-puzzle-menu picture { display: block; width: 52px; height: 56px; flex-shrink: 0; }
  .mobile-puzzle-menu picture img { display: block; width: 100%; height: 100%; object-fit: contain; }
  .mobile-puzzle-menu > a > .icon, .mobile-puzzle-menu > button > .icon { width: 17px; height: 17px; margin-left: auto; color: var(--muted); }
  .mobile-puzzle-menu + .desktop-library, .desktop-puzzle-library { display: none; }
  .puzzle-overview .native-catalog-intro { margin: 0 0 22px; }
  .puzzle-overview .native-catalog-intro .native-puzzle-image { display: none; }
  .puzzle-overview .set-grid { grid-template-columns: minmax(0,1fr); gap: 10px; }
  .puzzle-overview .set-card { min-height: 76px; padding: 10px 12px; gap: 12px; }
  .puzzle-overview .set-image { width: 52px; height: 52px; }
  .puzzle-overview .set-copy h3 { font-size: 16px; margin-bottom: 4px; }
  .puzzle-overview .set-copy p { font-size: 13px; }
  .puzzle-overview .set-card > .icon { display: block; width: 16px; height: 16px; color: var(--muted); }
  .algorithm-list-layout { display: block; min-height: 0; margin: 0; }
  .algorithm-list-main { overflow: visible; }
  .algorithm-list-aside { position: static; display: grid; grid-template-columns: minmax(0,1fr); margin-top: 20px; padding: 0; }
  .detail-layout { display: grid; grid-template-columns: minmax(0,1fr); gap: 24px; padding: 0; }
  .detail-right, .case-preview { overflow: visible; }
  .workspace[data-screen="case"] .page-head { justify-content: center; text-align: center; margin-top: 0; margin-bottom: 18px; min-height: 30px; }
  .workspace[data-screen="case"] .page-head h1 { font-size: 17px; font-weight: 600; letter-spacing: 0; }
  .workspace[data-screen="practice"] main { overflow: hidden; padding-bottom: calc(83px + env(safe-area-inset-bottom)); }
  .practice-screen > .page-head { justify-content: center; text-align: center; min-height: 27px; margin: 0 0 8px; }
  .practice-screen > .page-head h1 { font-size: 17px; font-weight: 600; letter-spacing: 0; }
  .practice-screen > .practice-options { display: none; }
  .practice-layout { display: block; flex: 1; min-height: 0; }
  .practice-sidebar { display: none; }
  .practice-stage { height: 100%; min-height: 0; gap: 6px; grid-template-rows: auto minmax(0,1fr) auto auto; }
  .practice-stage > .scramble { font-size: 21px; line-height: 1.4; padding: 2px 5px; margin: 0; }
  .practice-clock { min-height: 0; }
  .practice-clock #timer-digits { font-size: clamp(72px, 20vw, 95px); }
  .practice-clock #timer-hint { font-size: 11px; margin-top: 8px; }
  .practice-clock .practice-summary { font-size: 16px; margin-top: 10px; }
  .timer-penalties { margin-top: 10px; gap: 10px; }
  .timer-penalties .button { min-width: 78px; min-height: 36px; padding: 7px 16px; font-size: 16px; }
  .practice-preview-bottom { margin: 0; padding: 0 0 4px; }
  .practice-preview-bottom .cube-net { width: 220px; max-width: 75%; height: clamp(100px, 17vh, 155px); }
  .practice-preview-bottom picture { width: 91px; height: 91px; margin: 0 auto 7px; }
  .practice-preview-bottom p { font-size: 12px; margin: 4px 0; line-height: 1.4; }
  .practice-preview-bottom p.native-case-notation { font-size: 16px; font-weight: 600; color: #000; margin: 6px 0 0; }
  .practice-stage > .timer-lower { display: flex; flex-wrap: nowrap; gap: 6px; justify-content: space-between; min-height: 38px; padding: 0; margin: 0; }
  .practice-stage > .timer-lower > span { font-size: 11px; }
  .practice-stage > .timer-lower .button { min-height: 34px; padding: 7px 5px; font-size: 12px; gap: 5px; }
  .practice-stage > .timer-lower .icon { width: 17px; height: 17px; }
  .practice-stage > .help-text { display: none; }
  .practice-stage > .error-notice { bottom: calc(87px + env(safe-area-inset-bottom)); left: 13px; right: 13px; font-size: 13px; }
  .practice-options-modal .practice-options { display: grid; }
  .practice-options-modal .practice-options .segmented { width: 100%; }
  .practice-options-modal .practice-options select { max-width: none; width: 100%; flex: auto; }
  .learn-layout { grid-template-columns: minmax(0,1fr); }
  .learn-player { position: static; }
  .learn-player iframe { aspect-ratio: 16 / 9; max-height: none; }
  .native-video-placeholder { min-height: 260px; }
}

@media (max-width: 700px) and (max-height: 740px) {
  .topbar { flex-basis: 47px; min-height: 47px; padding-top: 4px; padding-bottom: 4px; }
  .workspace[data-screen="practice"] main { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
  .practice-screen > .page-head { min-height: 24px; margin-bottom: 5px; }
  .practice-stage { gap: 4px; }
  .practice-stage > .scramble { font-size: 18px; line-height: 1.35; }
  .practice-clock #timer-digits { font-size: 70px; }
  .practice-clock #timer-hint { font-size: 10px; }
  .practice-clock .practice-summary { font-size: 14px; margin-top: 7px; }
  .timer-penalties { margin-top: 7px; }
  .timer-penalties .button { min-height: 32px; padding: 5px 14px; font-size: 15px; }
  .practice-preview-bottom .cube-net { height: 110px; width: 185px; }
  .practice-preview-bottom picture { width: 75px; height: 75px; }
  .practice-preview-bottom p.native-case-notation { font-size: 14px; }
  .practice-stage > .timer-lower { min-height: 32px; }
}


.mobile-puzzle-menu { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 24px; width: 100%; max-width: 960px; margin: 0 auto; }
.mobile-puzzle-menu > a, .mobile-puzzle-menu > button { display: flex; align-items: center; gap: 18px; min-height: 94px; width: 100%; padding: 16px 20px; text-align: left; border: 1px solid var(--line); border-radius: 18px; background: var(--panel); font-size: 20px; font-weight: 600; }
.mobile-puzzle-menu picture { display: block; width: 62px; height: 65px; flex-shrink: 0; }
.mobile-puzzle-menu picture img { width: 100%; height: 100%; object-fit: contain; }
.mobile-puzzle-menu > a > .icon, .mobile-puzzle-menu > button > .icon { margin-left: auto; width: 18px; height: 18px; color: var(--muted); }
.practice-menu { display: block; padding-top: 0; }
.practice-puzzle-picker { display: flex; flex-direction: column; align-items: center; gap: 12px; width: min(100%, 340px); margin: 0 auto; min-width: 0; padding: 22px 24px; background: var(--panel); border: 1px solid var(--line); border-radius: 20px; }
.practice-puzzle-image { display: block; width: 140px; height: 140px; flex-shrink: 0; }
.practice-puzzle-image img { width: 100%; height: 100%; object-fit: contain; }
.practice-puzzle-picker h2 { font-size: 25px; margin: 0; }
.practice-puzzle-picker select { min-width: 145px; font-size: 16px; text-align: center; }
.practice-menu-options { display: flex; flex-wrap: nowrap; gap: 3px; width: min(100%, 460px); margin: 0 auto 25px; }
.practice-menu-options .button { flex: 1; }
.practice-set-groups { display: grid; gap: 24px; min-width: 0; }
.practice-set-groups > section > h2, .practice-set-groups > h2 { font-size: 18px; font-weight: 600; margin: 0 0 12px; color: var(--accent); }
.practice-set-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.practice-set-card { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 76px; padding: 10px 12px; text-align: left; color: #000; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; }
.practice-set-card picture { display: block; width: 52px; height: 52px; flex-shrink: 0; }
.practice-set-card picture img { width: 100%; height: 100%; object-fit: contain; }
.practice-set-card > div { min-width: 0; flex: 1; }
.practice-set-card h3 { font-size: 16px; margin: 0 0 4px; }
.practice-set-card p, .practice-set-card small { color: var(--muted); font-size: 13px; margin: 0; }
.practice-set-card > .icon { width: 17px; height: 17px; color: var(--muted); margin-left: auto; }
.practice-options-form { display: grid; gap: 15px; }
.practice-options-form label { display: grid; gap: 7px; color: var(--accent); font-size: 15px; }
.practice-options-form select { width: 100%; max-width: none; }
.practice-options-form .segmented { width: 100%; }
.practice-options-form .setting-row { display: flex; margin: 0; }
.practice-options-form .modal-actions { margin-top: 10px; }
@media (max-width: 700px), (max-height: 500px) and (pointer: coarse) {
  .mobile-puzzle-menu { grid-template-columns: minmax(0,1fr); gap: 9px; }
  .mobile-puzzle-menu > a, .mobile-puzzle-menu > button { min-height: 84px; padding: 14px 18px; gap: 17px; }
  .mobile-puzzle-menu picture { width: 52px; height: 56px; }
  .practice-menu { display: block; padding-top: 0; }
  .practice-puzzle-picker { border: 0; background: transparent; padding: 0; gap: 12px; margin-bottom: 25px; }
  .practice-puzzle-image { width: 110px; height: 110px; }
  .practice-puzzle-picker h2 { font-size: 24px; }
  .practice-puzzle-picker select { min-width: 120px; }
  .practice-menu-options { display: flex; gap: 12px; margin: 16px 0 25px; }
  .practice-menu-options .button { min-height: 48px; padding: 12px 15px; border-radius: 20px; font-size: 16px; }
  .practice-set-groups { gap: 22px; }
  .practice-set-grid { grid-template-columns: minmax(0,1fr); gap: 9px; }
  .practice-set-card { min-height: 76px; padding: 10px 12px; gap: 12px; }
  .practice-set-card h3 { font-size: 16px; }
  .practice-set-card picture { width: 52px; height: 52px; }
  .workspace[data-screen="learn"] .learn-player { display: none; }
  dialog .learn-player { display: block; }
  dialog .native-video-player { width: 100%; border: 0; border-radius: 15px; aspect-ratio: 16 / 9; background: #000; }
  .practice-options-form .setting-row { font-size: 15px; }
}

.puzzle-menu-buttons { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.puzzle-menu-button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 48px; padding: 8px 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; font-size: 16px; line-height: 1.25; font-weight: 600; text-align: center; }
.puzzle-menu-button small { color: var(--muted); font-size: 11px; line-height: 1.2; font-weight: 400; }
.practice-puzzle-picker .field-label { margin: 0; }
.practice-puzzle-picker .help-text { text-align: center; font-size: 13px; margin: 0; }
.practice-menu .practice-menu-options button { font-size: 15px; padding: 11px 18px; }
.practice-set-groups .set-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
.practice-menu .set-section { margin-bottom: 0; }
.practice-history-sheet .native-history-list { margin-bottom: 22px; }
@media (max-width: 1000px) {
  .practice-set-groups .set-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 700px), (max-height: 500px) and (pointer: coarse) {
  .workspace[data-screen="algorithms"] main:has(.algorithm-list-layout),
  .workspace[data-screen="case"] main:has(.detail-layout),
  .workspace[data-screen="learn"] main:has(.learn-layout) { display: block; overflow-y: auto; }
  .mobile-session-title { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 17px; font-weight: 600; line-height: 1.3; letter-spacing: 0; margin: 0; }
  .workspace[data-screen="practice"] .topbar-right { flex: 0 0 auto; }
  .workspace[data-screen="practice"] .topbar-left { flex: 1; min-width: 0; gap: 9px; }
  .practice-screen > .page-head { display: none; }
  .practice-menu > .practice-menu-options { width: 100%; margin: 0 0 24px; min-height: 38px; gap: 3px; }
  .practice-menu .practice-menu-options button { padding: 9px; font-size: 14px; }
  .practice-puzzle-picker { width: 100%; max-width: 380px; margin: 0 auto 25px; }
  .practice-set-groups .set-grid { grid-template-columns: minmax(0,1fr); }
  .mobile-puzzle-menu { gap: 20px; }
  .puzzle-menu-buttons { grid-template-columns: minmax(0,1fr); gap: 6px; }
  .puzzle-menu-button { min-height: 44px; font-size: 17px; padding: 8px 12px; border-radius: 12px; }
  .workspace[data-screen="algorithms"] .algorithm-list-aside { display: none; }
  .practice-screen { padding-top: 8px; }
}

@media (max-width: 700px), (max-height: 500px) and (pointer: coarse) {
  .algorithm-list-layout, .detail-layout, .learn-layout { height: auto; overflow: visible; }
  .algorithm-list-main, .algorithm-list-aside, .case-preview, .detail-right, .learn-library, .learn-player { height: auto; }
}

/* In a short touch viewport the preview sits beside the stopwatch. */
@media (max-width: 700px) and (max-height: 500px), (max-height: 500px) and (pointer: coarse) {
  .workspace[data-screen="practice"] main { overflow: hidden; padding-bottom: calc(80px + env(safe-area-inset-bottom)); }
  .workspace[data-screen="practice"] .topbar { flex-basis: 44px; min-height: 44px; padding-top: 3px; padding-bottom: 3px; }
  .practice-screen { min-height: 0; padding-top: 4px; }
  .practice-layout { height: 100%; min-height: 0; display: block; }
  .practice-sidebar { display: none; }
  .practice-stage {
    height: 100%;
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(0,1.1fr) minmax(0,.9fr);
    grid-template-rows: auto minmax(0,1fr) auto;
    grid-template-areas: "scramble scramble" "clock preview" "clock controls";
    gap: 5px 14px;
    overflow: hidden;
  }
  .practice-stage > .scramble { grid-area: scramble; font-size: 16px; line-height: 1.3; padding: 0 5px; }
  .practice-clock { grid-area: clock; min-height: 0; }
  .practice-clock #timer-digits { font-size: 61px; }
  .practice-clock #timer-hint { font-size: 10px; margin-top: 4px; }
  .practice-clock .practice-summary { font-size: 13px; margin-top: 5px; gap: 14px; }
  .timer-penalties { gap: 8px; margin-top: 5px; }
  .timer-penalties .button { min-height: 29px; min-width: 68px; font-size: 13px; padding: 4px 12px; }
  .practice-preview-bottom { grid-area: preview; align-self: center; padding: 0; min-height: 0; }
  .practice-preview-bottom .cube-net { height: min(110px,29vh); width: 180px; max-width: 95%; }
  .practice-preview-bottom picture { width: 65px; height: 65px; margin-bottom: 3px; }
  .practice-preview-bottom p { font-size: 10px; margin: 3px 0; }
  .practice-preview-bottom p.native-case-notation { font-size: 12px; margin-top: 3px; }
  .practice-stage > .timer-lower { grid-area: controls; min-height: 29px; justify-content: center; gap: 8px; }
  .practice-stage > .timer-lower > span { display: none; }
  .practice-stage > .timer-lower .button { min-height: 29px; font-size: 11px; padding: 5px 4px; }
  .practice-stage > .timer-lower .icon { width: 14px; height: 14px; }
}

@media (max-width: 700px), (max-height: 500px) and (pointer: coarse) {
  .workspace[data-screen="case"] .page-head { justify-content: flex-start; text-align: left; min-height: 40px; margin: 8px 0 22px; }
  .workspace[data-screen="case"] .page-head h1 { font-size: 30px; font-weight: 700; letter-spacing: -.5px; }
  .mobile-tabs a { min-height: 44px; font-size: 12px; }
  .mobile-tabs .icon { width: 24px; height: 24px; stroke-width: 2; }
}

/* Long scrambles scroll inside their own region without moving the stopwatch. */
.practice-stage > .scramble {
  max-height: min(22dvh, 170px);
  overflow-y: auto;
  overscroll-behavior-y: contain;
  scrollbar-width: thin;
}
@media (min-width: 701px) and (min-height: 501px) {
  .practice-stage { grid-template-rows: auto minmax(175px,1fr) auto auto; }
  .practice-stage > .scramble { max-height: min(22dvh,160px); }
}
@media (max-width: 700px), (max-height: 500px) and (pointer: coarse) {
  .practice-stage { grid-template-rows: auto minmax(180px,1fr) auto auto; }
}
@media (max-width: 700px) and (max-height: 740px) {
  .practice-stage { grid-template-rows: auto minmax(170px,1fr) auto auto; }
  .practice-preview-bottom .cube-net { height: clamp(80px,16dvh,110px); }
}
@media (max-width: 700px) and (max-height: 500px), (max-height: 500px) and (pointer: coarse) {
  .practice-stage { grid-template-rows: auto minmax(0,1fr) auto; }
  .practice-clock { min-height: 146px; }
  .practice-stage > .scramble { max-height: min(22dvh,110px); }
}

@media (min-width: 701px) and (min-height: 501px) {
  .settings-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
  .settings-grid > .panel { padding: 14px; }
  .settings-grid .panel-heading { margin-bottom: 10px; }
  .settings-grid .panel-heading h2 { font-size: 17px; }
  .settings-grid .panel-heading > .icon { width: 20px; height: 20px; }
  .settings-grid .field-label { margin: 9px 0 7px; font-size: 14px; }
  .settings-grid .theme-swatches { gap: 12px; margin: 10px 0 13px; }
  .settings-grid .swatch { width: 30px; height: 30px; }
  .settings-grid .setting-row { padding: 8px 0; font-size: 15px; gap: 12px; }
  .settings-grid .setting-row:last-child { padding-bottom: 0; }
  .settings-grid .setting-row select { font-size: 14px; padding: 5px 8px; border-radius: 10px; }
  .settings-grid .help-text { font-size: 13px; line-height: 1.4; margin: 8px 0; }
  .settings-grid .panel-description { font-size: 14px; line-height: 1.4; margin-bottom: 10px; }
  .settings-grid .data-actions { gap: 9px; margin: 12px 0; }
  .settings-grid .button { min-height: 35px; padding: 7px 12px; font-size: 14px; border-radius: 12px; }
  .settings-grid .button .icon { width: 18px; height: 18px; }
  .settings-grid .about-panel > a { font-size: 14px; padding: 7px 0; }
  .settings-grid .about-panel > a .icon { width: 16px; height: 16px; }
  .settings-grid .pro-note { padding: 10px; margin: 12px 0; gap: 10px; border-radius: 13px; }
  .settings-grid .pro-note > .icon { width: 18px; height: 18px; }
  .settings-grid .pro-note strong { font-size: 14px; }
  .settings-grid .pro-note p { font-size: 13px; line-height: 1.4; margin: 5px 0 0; }
  .settings-grid .pill { font-size: 11px; padding: 4px 7px; }
}

@media (min-width: 701px) and (min-height: 501px) {
  .settings-grid .help-text { margin: 6px 0; }
  .settings-grid .pro-note { margin: 8px 0; padding: 8px; }
  .settings-grid .about-panel > a { padding: 5px 0; }
}
@media (max-width: 700px), (max-height: 500px) and (pointer: coarse) {
  .workspace[data-screen="practice"] main { padding-bottom: calc(89px + env(safe-area-inset-bottom)); }
}
@media (max-width: 700px) and (max-height: 500px), (max-height: 500px) and (pointer: coarse) {
  .workspace[data-screen="practice"] main { padding-bottom: calc(86px + env(safe-area-inset-bottom)); }
}

/* Native document scrolling lets mobile browsers collapse their own toolbars.
   The timer retains its viewport-sized layout; libraries grow with their content. */
@media (max-width: 700px), (max-height: 500px) and (pointer: coarse) {
  html { height: auto; min-height: 100%; overflow-x: clip; }
  body { height: auto; min-height: 100vh; min-height: 100dvh; overflow: visible; }
  #app { height: auto; min-height: 100vh; min-height: 100dvh; }
  .workspace, .workspace.sidebar-open { height: auto; min-height: 100vh; min-height: 100dvh; overflow: visible; }
  .main-shell { height: auto; min-height: 100vh; min-height: 100dvh; overflow: visible; }
  .topbar { position: sticky; top: 0; z-index: 40; background: color-mix(in srgb,var(--primary) 80%,transparent); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); }
  .workspace main,
  .workspace[data-screen="algorithms"] main:has(.algorithm-list-layout),
  .workspace[data-screen="case"] main:has(.detail-layout),
  .workspace[data-screen="learn"] main:has(.learn-layout) { overflow: visible; overscroll-behavior-y: auto; }
  .workspace[data-screen="practice"] .main-shell { height: 100vh; height: 100dvh; }
  .workspace[data-screen="practice"] main { overflow: hidden; }
}

.button, .icon-button, .chip, .native-tabs a, .mobile-tabs a, .nav-item, .puzzle-link,
.segmented button, .solution, .swatch, .setting-row input[type="checkbox"] {
  transition: background-color .2s ease, color .2s ease, border-color .2s ease, opacity .2s ease;
}
.setting-row input[type="checkbox"]::after { transition: transform .22s cubic-bezier(.22,.8,.25,1); }
dialog[open]::backdrop { animation: backdrop-enter .28s ease both; }
@keyframes backdrop-enter { from { background-color: rgba(0,50,50,0); } to { background-color: rgba(0,50,50,.25); } }
