html,
body {
  padding: 0;
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  touch-action: manipulation;
  -webkit-text-size-adjust: 100%;
}

body {
  background: #f8fafc;
  color: #172033;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

#app {
  width: 100%;
  height: 100%;
}
.app-shell {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  max-width: 640px;
  margin: 0 auto;
  background: #f8fafc;
}

.titlebar {
  position: relative;
  display: grid;
  grid-template-columns: 88px 1fr 88px;
  align-items: center;
  min-height: 52px;
  padding: 0 12px;
  padding: env(safe-area-inset-top) 12px 0;
  background: #2563eb;
  color: #fff;
  flex: 0 0 auto;
}

.titlebar h1 {
  margin: 0;
  text-align: center;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0;
}

.title-left,
.title-right {
  min-width: 0;
}

.title-right {
  display: flex;
  justify-content: flex-end;
  gap: 2px;
}

.back,
.ghost,
.titlebar button {
  border: 0;
  background: transparent;
  color: inherit;
}

.title-icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
}

.title-icon-button svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
}

.back {
  padding: 10px 0;
  text-align: left;
}

.page-body {
  position: relative;
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  flex-direction: column;
  gap: 12px;
  padding: 12px;
  overflow: hidden;
}

.menu {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.menu-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 54px;
  padding: 0 14px;
  border: 1px solid #dbe4f0;
  border-radius: 8px;
  background: #fff;
  color: #172033;
  text-align: left;
  font-weight: 650;
}

.menu-item:disabled {
  background: #f1f5f9;
  color: #94a3b8;
  cursor: default;
}

.settings-page {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  flex-direction: column;
  gap: 12px;
}

.settings-page.scroll-area {
  overflow-y: auto;
  padding-bottom: 10px;
}

.settings-action-footer {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 0 0 auto;
  padding-top: 10px;
  padding-bottom: 0;
  padding-bottom: env(safe-area-inset-bottom);
}

.settings-section {
  display: flex;
  width: 100%;
  box-sizing: border-box;
  flex-direction: column;
  gap: 12px;
  padding: 14px 16px;
}

.settings-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.settings-check-list,
.settings-radio-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.settings-check {
  display: flex;
  align-items: center;
  min-height: 32px;
  gap: 10px;
  color: #172033;
  font-size: 14px;
}

.settings-check input {
  flex: 0 0 auto;
}

.settings-check small {
  display: block;
  margin-top: 2px;
  color: #64748b;
  font-size: 12px;
  font-weight: 400;
}

.settings-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: #172033;
  font-size: 14px;
  font-weight: 650;
}

.settings-field input {
  width: 100%;
  min-height: 42px;
  box-sizing: border-box;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 0 12px;
  background: #fff;
  color: #172033;
  font: inherit;
}

.settings-action-footer.inline {
  padding-top: 0;
}

.sync-alert {
  margin: 0;
  border: 1px solid #fecaca;
  border-radius: 8px;
  padding: 10px 12px;
  background: #fef2f2;
  color: #991b1b;
  font-size: 14px;
}

.hidden-file-input {
  display: none;
}

.secondary {
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  color: #172033;
  font-weight: 700;
}

.icp-link {
  color: #2563eb;
  font-size: 14px;
  text-decoration: none;
}

.icp-link:active {
  color: #1d4ed8;
}

.help-page {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  flex-direction: column;
  gap: 12px;
}

.help-page.scroll-area {
  display: block;
}

.help-page.scroll-area > .help-section {
  margin-bottom: 12px;
}

.help-section-head,
.help-info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.help-text {
  margin: 0;
  color: #334155;
  font-size: 14px;
  line-height: 1.7;
  overflow-wrap: anywhere;
}

.help-muted {
  color: #64748b;
  font-size: 12px;
}

.help-link-list,
.help-list {
  display: flex;
  flex: 0 0 auto;
  width: 100%;
  box-sizing: border-box;
  flex-direction: column;
  gap: 10px;
}

.help-section {
  display: flex;
  flex: 0 0 auto;
  width: 100%;
  box-sizing: border-box;
  flex-direction: column;
  gap: 10px;
  padding: 14px 16px;
}

.help-info-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.help-info-row {
  min-height: 28px;
  padding-bottom: 10px;
  border-bottom: 1px solid #eef2f7;
  font-size: 14px;
}

.help-info-row:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.help-info-row strong {
  font-weight: 600;
  word-break: break-all;
  text-align: right;
}

.help-icp {
  color: #2563eb;
  font-size: 14px;
  font-weight: 600;
}

.help-list-item {
  flex: 0 0 auto;
  width: 100%;
  box-sizing: border-box;
  padding: 14px 16px;
}

.help-item-title {
  margin: 0 0 8px;
  font-size: 15px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.help-item-text {
  margin: 0;
  color: #334155;
  font-size: 14px;
  line-height: 1.7;
  overflow-wrap: anywhere;
}

.help-iframe-page {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
}

.help-iframe-shell {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  display: block;
  overflow: hidden;
}

.help-iframe {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  border: 0;
  background: #fff;
}

.scroll-area {
  min-height: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.row-actions,
.inline-actions {
  display: inline-flex;
  flex: 0 0 auto;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.row-actions button,
.inline-actions button,
.ghost,
.modal button {
  min-height: 32px;
  padding: 0 9px;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  background: #fff;
  color: #172033;
}

.row-actions button:disabled,
.inline-actions button:disabled,
.ghost:disabled {
  border-color: #e2e8f0;
  background: #f8fafc;
  color: #94a3b8;
}

select,
input,
textarea {
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  background: #fff;
  color: #172033;
}

select,
input {
  min-height: 34px;
  padding: 0 8px;
}

textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 8px;
  resize: none;
}

.primary {
  border: 0;
  border-radius: 8px;
  background: #2563eb;
  color: #fff;
  font-weight: 700;
}

.primary:disabled {
  background: #bfdbfe;
  color: #eff6ff;
}

.wide {
  width: 100%;
  min-height: 44px;
}

.panel,
.form-section {
  border: 1px solid #dbe4f0;
  border-radius: 8px;
  background: #fff;
}

.panel-head {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
}

.panel-title,
.section-title {
  font-size: 14px;
  font-weight: 700;
}

.muted,
.empty {
  color: #64748b;
  font-size: 13px;
}

.detail-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 6px;
  border-bottom: 1px solid #eef2f7;
}

.toolbar-action {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 1;
}

.toolbar-action .ghost {
  color: #2563eb;
  border-color: #bfdbfe;
  background: #fff;
}

.fixed-footer {
  flex: 0 0 auto;
  margin-top: auto;
  padding: 10px 0 0;
  color: gray;
  font-size: 13px;
  text-align: center;
}

.unfinished-list {
  flex: 1 1 auto;
  border: 1px solid #dbe4f0;
  border-radius: 8px;
  background: #fff;
}

.unfinished-row {
  display: grid;
  grid-template-columns: minmax(92px, 1fr) 56px auto;
  gap: 8px;
  align-items: center;
  min-height: 50px;
  padding: 8px 10px;
  border-bottom: 1px solid #eef2f7;
}

.unfinished-row > span {
  min-width: 0;
}

.modal-mask {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(15, 23, 42, 0.45);
  z-index: 20;
}

.modal {
  display: flex;
  width: 100%;
  max-width: 520px;
  max-height: 82vh;
  flex-direction: column;
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.modal-head,
.modal-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid #e2e8f0;
}

.modal-head > *,
.modal-foot > * {
  margin-left: 8px;
}

.modal-head > :first-child,
.modal-foot > :first-child {
  margin-left: 0;
}

.modal-head h2 {
  margin: 0;
  font-size: 16px;
}

.modal-body {
  min-height: 0;
  overflow: auto;
  padding: 12px;
}

.modal-foot {
  border-top: 1px solid #e2e8f0;
  border-bottom: 0;
  justify-content: flex-end;
}

.search-form {
  display: grid;
  grid-template-columns: 1fr 64px;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

.modal-list {
  max-height: 42vh;
}

.fatal {
  padding: 24px;
}

@media (max-width: 380px) {
  .unfinished-row {
    grid-template-columns: 1fr 44px;
    font-size: 13px;
  }

  .unfinished-row .row-actions {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.split-view {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1 1 auto;
  height: 100%;
  min-height: 0;
}

.split-view > .panel:first-child {
  flex: 0 1 42%;
  min-height: 140px;
}

.split-view > .panel:last-child {
  flex: 1 1 0;
  min-height: 0;
}

.dictation-content {
  position: relative;
  display: block;
  flex: 1 1 auto;
  height: 100%;
  min-height: 0;
}

.dictation-content > .panel {
  position: absolute;
  right: 0;
  left: 0;
  box-sizing: border-box;
}

.dictation-content > .panel:first-child {
  top: 0;
  height: 42%;
  min-height: 0;
}

.dictation-content > .panel:last-child {
  top: calc(42% + 12px);
  bottom: 0;
  min-height: 0;
}

.panel {
  display: flex;
  min-height: 0;
  flex-direction: column;
  overflow: hidden;
  padding: 10px;
}

.category-toolbar {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 8px;
}

.category-toolbar button {
  min-width: 0;
  min-height: 32px;
  padding: 0 4px;
  overflow: hidden;
  font-size: 12px;
  line-height: 1;
  white-space: nowrap;
  text-align: center;
}

.tree {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.tree.scroll-area {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.word-list.scroll-area {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.tree-row,
.word-row,
.result-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 6px 6px 6px calc(var(--depth, 0) * 18px);
  border-bottom: 1px solid #eef2f7;
}

.tree-row label,
.word-row .word-main,
.result-row .word {
  flex: 1 1 auto;
  min-width: 0;
  overflow-wrap: anywhere;
}

.word-row .word-main {
  display: grid;
  gap: 3px;
}

.word-row .word-text {
  font-weight: 700;
}

.word-row .word-pinyin {
  min-height: 16px;
  color: #475569;
  font-size: 13px;
  line-height: 1.25;
}

.tree-row label {
  display: flex;
  align-items: center;
  gap: 6px;
}

.tree-row label input[type="radio"],
.tree-row label input[type="checkbox"] {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  margin: 0;
}

.tree-row .row-actions {
  align-items: center;
  flex-wrap: nowrap;
}

.tree-row .row-actions button {
  min-height: 32px;
  line-height: 1;
}

.known {
  background: #e8f7ed;
}

@media (max-width: 380px) {
  .category-toolbar {
    gap: 4px;
  }

  .category-toolbar button {
    min-height: 30px;
    padding: 0 2px;
  }

  .word-row {
    align-items: stretch;
    flex-direction: column;
  }

  .word-row .row-actions {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .word-row .row-actions button {
    min-width: 0;
  }
}

@media (max-width: 340px) {
  .category-toolbar {
    gap: 3px;
  }

  .category-toolbar button {
    padding: 0 1px;
    font-size: 10px;
  }
}

.setup-form {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-bottom: 0;
  padding-bottom: env(safe-area-inset-bottom);
  -webkit-overflow-scrolling: touch;
}

.form-section {
  padding: 10px;
}

.form-section.grow {
  display: flex;
  min-height: 0;
  flex: 1 1 auto;
  flex-direction: column;
}

.form-section label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  flex-wrap: wrap;
}

.small-input {
  width: 74px;
}

@media (max-height: 700px), (max-width: 380px) {
  .setup-form {
    gap: 8px;
  }

  .setup-form .form-section {
    padding: 8px;
  }

  .setup-form .form-section label {
    min-height: 32px;
  }

  .setup-form select,
  .setup-form input {
    min-height: 32px;
  }

  .setup-form .wide {
    min-height: 40px;
  }
}

.copybook-form {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-bottom: 0;
  padding-bottom: env(safe-area-inset-bottom);
  -webkit-overflow-scrolling: touch;
}

.copybook-form .form-section:not(.grow) {
  display: grid;
  gap: 6px;
}

.copybook-form .form-section:not(.grow) label {
  min-height: 30px;
}

.copybook-form.is-blank .import-only,
.copybook-form.is-blank .import-actions,
.copybook-form.is-import .blank-actions,
.copybook-form.is-import .blank-fill-options,
.copybook-form.is-blank .import-fill-options,
.copybook-form:not(.is-custom-rows) .custom-rows-input {
  display: none;
}

.choice-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.choice-row label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.wrong-word-source-select {
  min-height: 30px;
}

.copybook-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.copybook-list-page,
.copybook-preview-page {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  flex-direction: column;
  gap: 10px;
}

.copybook-word-list {
  display: flex;
  min-height: 0;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 4px;
}

.copybook-word-row {
  display: grid;
  grid-template-columns: 34px minmax(70px, 1fr) minmax(90px, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-height: 42px;
  padding: 6px 0;
  border-bottom: 1px solid #eef2f7;
}

.copybook-word-row .seq {
  color: #64748b;
  text-align: center;
}

.copybook-word-row .word,
.copybook-word-row .pinyin {
  min-width: 0;
  overflow-wrap: anywhere;
}

.copybook-preview-stage {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid #dbe4f0;
  border-radius: 8px;
  background: #e2e8f0;
  touch-action: none;
}

.copybook-preview-image {
  display: block;
  width: 65%;
  height: 92%;
  max-width: 92%;
  max-height: 92%;
  aspect-ratio: var(--copybook-paper-width, 210) / var(--copybook-paper-height, 297);
  transform-origin: center;
  user-select: none;
  -webkit-user-drag: none;
}

.copybook-preview-image svg {
  display: block;
  width: 100%;
  height: 100%;
}

@media (max-width: 420px) {
  .copybook-word-row {
    grid-template-columns: 28px minmax(54px, 0.8fr) minmax(68px, 1fr) auto;
    gap: 5px;
    font-size: 13px;
  }

  .copybook-word-row .row-actions {
    gap: 4px;
  }

  .copybook-word-row .row-actions button {
    padding: 0 5px;
    font-size: 12px;
  }
}

@media (max-height: 700px), (max-width: 380px) {
  .copybook-form {
    gap: 6px;
  }

  .copybook-form .form-section {
    padding: 6px 8px;
  }

  .copybook-form .form-section:not(.grow) {
    gap: 2px;
  }

  .copybook-form .form-section:not(.grow) label,
  .copybook-form .form-section label,
  .copybook-form select,
  .copybook-form input {
    min-height: 28px;
  }

  .copybook-form .choice-row {
    gap: 8px;
  }

  .copybook-form .form-section.grow.import-only {
    min-height: 180px;
  }

  .copybook-form .wide {
    min-height: 40px;
  }

  .copybook-actions {
    gap: 6px;
  }
}

@media (min-width: 520px) {
  .copybook-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .copybook-actions.import-actions {
    grid-template-columns: 1fr;
  }
}

.playback {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
  padding: 16px;
  border: 1px solid #dbe4f0;
  border-radius: 8px;
  background: #fff;
}

.progress {
  font-size: 22px;
  font-weight: 800;
}

.hidden-word {
  color: #475569;
}

.button-grid {
  display: grid;
  width: 100%;
  max-width: 320px;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.button-grid button {
  min-height: 32px;
  padding: 0 9px;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  background: #fff;
  color: #172033;
}

.stats {
  flex: 0 0 auto;
  padding: 10px;
  border: 1px solid #dbe4f0;
  border-radius: 8px;
  background: #fff;
  font-weight: 700;
}

.result-list {
  flex: 1 1 auto;
  border: 1px solid #dbe4f0;
  border-radius: 8px;
  background: #fff;
}

.result-row {
  padding: 8px;
}

.result-row button {
  min-height: 32px;
  padding: 0 9px;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  background: #fff;
  color: #172033;
}

.result-row.correct {
  background: #dcfce7;
}

.result-row.wrong {
  background: #fee2e2;
}

.result-row.skipped {
  background: #f1f5f9;
}

.seq {
  width: 28px;
  color: #64748b;
}

@media (max-width: 380px) {
  .result-row button {
    padding: 0 7px;
    font-size: 13px;
  }
}

.record-list {
  flex: 1 1 auto;
  border: 1px solid #dbe4f0;
  border-radius: 8px;
  background: #fff;
}

.record-row {
  display: grid;
  width: 100%;
  grid-template-columns: 78px 1fr 36px 36px;
  gap: 8px;
  min-height: 44px;
  align-items: center;
  padding: 0 10px;
  border: 0;
  border-bottom: 1px solid #eef2f7;
  background: #fff;
  color: #172033;
  text-align: left;
}

@media (max-width: 380px) {
  .record-row {
    grid-template-columns: 72px 1fr 30px 30px;
    font-size: 13px;
  }
}

.char-error-row {
  display: grid;
  grid-template-columns: 36px 120px 1fr;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

.detail-row {
  justify-content: space-between;
}

.summary p {
  margin: 4px 0;
}

.field {
  display: grid;
  gap: 8px;
}

.field input {
  width: 100%;
  box-sizing: border-box;
}
.homework-page {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  flex-direction: column;
  gap: 10px;
}

.homework-filter,
.homework-summary,
.homework-toolbar,
.homework-stats-result {
  border: 1px solid #dbe4f0;
  border-radius: 8px;
  background: #fff;
}

.homework-filter {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 10px;
}

.homework-filter label,
.homework-summary label,
.homework-form label {
  display: grid;
  gap: 5px;
  color: #334155;
  font-size: 13px;
}

.homework-filter input,
.homework-filter select,
.homework-summary input,
.homework-form input,
.homework-form select {
  width: 100%;
  box-sizing: border-box;
}

.homework-filter .inline-actions,
.homework-filter .wide {
  grid-column: 1 / 3;
}

.homework-toolbar {
  display: grid;
  flex: 0 0 auto;
  gap: 8px;
  padding: 10px;
}

.homework-toolbar-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.homework-toolbar button,
.homework-toolbar-row button,
.homework-summary-actions button {
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  background: #fff;
  color: #172033;
}

.homework-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.homework-table-wrap {
  overflow-x: hidden;
  border: 1px solid #dbe4f0;
  border-radius: 8px;
  background: #fff;
}

.homework-task-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  background: #fff;
}

.homework-task-table th,
.homework-task-table td {
  padding: 10px 8px;
  border-bottom: 1px solid #eef2f7;
  text-align: left;
  vertical-align: top;
  font-size: 13px;
  overflow-wrap: break-word;
}

.homework-task-table th {
  background: #f8fafc;
  color: #334155;
  font-weight: 700;
}

.homework-task-table-row {
  cursor: pointer;
}

.homework-date-cell {
  width: 54px;
  white-space: nowrap;
}

.homework-range-cell {
  width: 46px;
  text-align: center;
  white-space: nowrap;
}

.homework-title-cell {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.homework-task-table-row.is-expanded td {
  background: #eff6ff;
}

.homework-task-detail-row td {
  background: #fff;
}

.homework-task-detail {
  display: grid;
  gap: 6px;
}

.homework-task-detail p {
  margin: 0;
  color: #172033;
  overflow-wrap: anywhere;
}

.homework-detail-actions {
  justify-content: flex-start;
}

.homework-detail-actions button {
  min-width: 54px;
}

.homework-row {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 10px;
  border: 1px solid #dbe4f0;
  border-radius: 8px;
  background: #fff;
}

.homework-row-main {
  flex: 1 1 auto;
  min-width: 0;
}

.homework-row-title {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  color: #172033;
}

.homework-row-title strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.homework-subject,
.homework-status,
.homework-seq {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 7px;
  border-radius: 7px;
  background: #eef2ff;
  color: #1e40af;
  font-size: 12px;
  font-weight: 700;
}

.homework-status {
  background: #f1f5f9;
  color: #334155;
}

.status-in_progress {
  border-color: #93c5fd;
  background: #eff6ff;
}

.status-paused {
  border-color: #fde68a;
  background: #fffbeb;
}

.status-completed {
  background: #f0fdf4;
}

.status-terminated {
  background: #f8fafc;
  color: #64748b;
}

.homework-meta {
  margin-top: 5px;
  color: #64748b;
  font-size: 13px;
  line-height: 1.35;
}

.homework-grid-fields {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.homework-grid-fields label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #334155;
  font-size: 13px;
}

.homework-plan-footer {
  flex: 0 0 auto;
}

.homework-plan-check {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 32px;
  padding: 0 7px;
  color: #334155;
  font-size: 13px;
  white-space: nowrap;
}

.homework-plan-check input {
  width: auto;
  margin: 0;
}

.homework-summary {
  display: grid;
  gap: 8px;
  padding: 10px;
}

.homework-plan-date {
  color: #172033;
}

.homework-summary-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.homework-finish,
.homework-total {
  padding: 10px;
  border-radius: 8px;
  background: #eff6ff;
  color: #1e40af;
  font-weight: 700;
}

.homework-stats-result {
  padding: 12px;
}

.homework-total {
  margin-bottom: 8px;
  font-size: 20px;
}

.homework-form,
.homework-manager {
  display: grid;
  gap: 10px;
}

.homework-form textarea {
  min-height: 76px;
}

.homework-form .homework-checkline {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
}

.homework-form .homework-checkline input {
  width: auto;
}

.homework-inline-form {
  display: grid;
  grid-template-columns: 100px minmax(0, 1fr) 64px;
  gap: 8px;
  align-items: center;
}

.homework-inline-form > * {
  min-width: 0;
}

.homework-done {
  color: #64748b;
  font-size: 13px;
}

.homework-empty {
  padding: 18px;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  background: #fff;
  text-align: center;
}

@media (max-width: 420px) {
  .homework-filter {
    grid-template-columns: 1fr;
  }

  .homework-filter .inline-actions,
  .homework-filter .wide {
    grid-column: 1;
  }

  .homework-row {
    flex-direction: column;
  }

  .homework-row .row-actions {
    width: 100%;
    justify-content: flex-start;
  }
}

@media (max-width: 360px) {
  .homework-toolbar,
  .homework-toolbar-row {
    gap: 6px;
  }

  .homework-toolbar button,
  .homework-toolbar-row button,
  .homework-row .row-actions button {
    min-height: 32px;
    padding: 0 7px;
    font-size: 13px;
  }

  .homework-inline-form {
    grid-template-columns: 1fr;
  }
}
.math-page {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  flex-direction: column;
  gap: 10px;
}

.math-segmented {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
}

.math-option-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid #dbe4f0;
  border-radius: 8px;
  background: #fff;
  color: #334155;
  font-size: 13px;
}

.math-option-row > span {
  font-weight: 700;
}

.math-option-row label {
  display: inline-flex;
  gap: 4px;
  align-items: center;
}

.math-option-row input {
  min-height: auto;
  padding: 0;
}

.math-segmented button,
.math-toolbar button,
.math-target-net-list button {
  min-height: 34px;
  padding: 0 7px;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  background: #fff;
  color: #172033;
  font-size: 12px;
}

.math-segmented button.active,
.math-toolbar button.is-active {
  border-color: #2563eb;
  background: #eff6ff;
  color: #1d4ed8;
  font-weight: 700;
}

.math-net-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  grid-auto-rows: minmax(112px, auto);
  gap: 8px;
  align-items: start;
}

.math-net-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 8px;
  padding: 8px;
  border: 1px solid #dbe4f0;
  border-radius: 8px;
  background: #fff;
  color: #172033;
  text-align: center;
  font-size: 12px;
  overflow: hidden;
  box-sizing: border-box;
  align-items: stretch;
  justify-content: flex-start;
  min-height: 112px;
}

.math-net-card span {
  display: block;
  width: 100%;
  min-height: 20px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.math-net-card.is-selected {
  border-color: #2563eb;
  background: #eff6ff;
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.18) inset;
}

.math-net-thumb {
  display: block;
  width: 100%;
  flex: 0 0 72px;
  height: 72px;
  min-height: 72px;
  overflow: hidden;
}

.math-net-thumb svg {
  width: 100%;
  height: 100%;
}

.math-net-thumb text {
  fill: #334155;
  font-size: 8px;
  font-weight: 700;
  pointer-events: none;
}

.math-toolbar,
.math-summary,
.math-canvas-wrap,
.math-size-form {
  border: 1px solid #dbe4f0;
  border-radius: 8px;
  background: #fff;
}

.math-toolbar {
  display: grid;
  gap: 8px;
  padding: 8px;
}

.math-toolbar-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.math-toolbar-row-nowrap {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  flex-wrap: nowrap;
  overflow: visible;
  gap: 4px;
}

.math-toolbar-row-nowrap button {
  min-width: 0;
  padding: 0 3px;
  font-size: clamp(10px, 2.8vw, 12px);
  white-space: nowrap;
}

.math-toolbar-row .primary {
  border: 0;
  background: #2563eb;
  color: #fff;
}

.math-toolbar-row .primary:disabled {
  background: #bfdbfe;
  color: #1d4ed8;
}

.math-size-form .primary {
  border: 0;
  background: #2563eb;
  color: #fff;
}

.math-size-form .primary:disabled {
  background: #bfdbfe;
  color: #1d4ed8;
}

.math-summary {
  flex: 0 0 auto;
  padding: 8px 10px;
  color: #334155;
  font-size: 13px;
  line-height: 1.35;
}

.math-canvas-wrap {
  position: relative;
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.math-net-svg {
  width: 100%;
  max-height: 100%;
  touch-action: none;
}

.math-net-face {
  cursor: pointer;
}

.math-net-face text,
.math-edge-label {
  pointer-events: none;
  fill: #0f172a;
  font-size: 12px;
  font-weight: 700;
}

.math-edge-label {
  fill: #1d4ed8;
  paint-order: stroke;
  stroke: #fff;
  stroke-width: 3px;
}

.math-3d-stage {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 320px;
  touch-action: none;
}

.math-3d-stage canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}

.math-floating-panel {
  position: absolute;
  z-index: 4;
  width: 156px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.16);
  overflow: hidden;
}

.math-floating-panel-wide {
  width: 204px;
}

.math-floating-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 13px;
  font-weight: 700;
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.math-floating-panel-head button {
  width: 26px;
  min-height: 24px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #1d4ed8;
  font-size: 18px;
  line-height: 1;
}

.math-floating-panel-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  padding: 8px;
}

.math-floating-panel button,
.math-floating-form button {
  min-height: 32px;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  background: #fff;
  color: #172033;
  font-size: 12px;
}

.math-floating-form {
  display: grid;
  gap: 8px;
  padding: 8px;
}

.math-floating-form label,
.math-floating-field {
  display: grid;
  gap: 4px;
  color: #334155;
  font-size: 12px;
}

.math-floating-form input {
  min-height: 30px;
}

.math-line-style-row {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 8px;
  align-items: end;
}

.math-floating-field input[type='color'] {
  width: 42px;
  min-height: 30px;
  padding: 2px;
}

.math-axis-distance-control,
.math-fold-duration-control {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 6px;
  align-items: center;
}

.math-axis-distance-control input[type='range'],
.math-fold-duration-control input[type='range'] {
  width: 100%;
  min-height: 30px;
  padding: 0;
}

.math-visual-quality-control {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.math-visual-quality-control label {
  display: flex;
  min-height: 30px;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  background: #fff;
}

.math-visual-quality-control input {
  min-height: 0;
}

.math-floating-form .primary {
  border: 0;
  background: #2563eb;
  color: #fff;
}

.math-animation-cover {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(248, 250, 252, 0.78);
  color: #1d4ed8;
  font-weight: 700;
}

.math-canvas-wrap.is-animating .math-net-svg {
  animation: math-fold-pulse 900ms ease-in-out infinite alternate;
}

@keyframes math-fold-pulse {
  from {
    transform: scale(0.96) rotate(-1deg);
  }
  to {
    transform: scale(1.02) rotate(1deg);
  }
}

.math-hint {
  flex: 0 0 auto;
  color: #64748b;
  font-size: 12px;
  line-height: 1.35;
}

.mental-setup,
.mental-result {
  padding: 0 0 8px;
}

.mental-setup-compact {
  gap: 6px;
  padding-bottom: 0;
}

.mental-panel {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid #dbe4f0;
  border-radius: 8px;
  background: #fff;
}

.mental-panel-compact {
  gap: 7px;
  padding: 8px;
}

.mental-section-title {
  color: #0f172a;
  font-size: 13px;
  font-weight: 700;
}

.mental-choice-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.mental-choice-grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.mental-choice-grid-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.mental-pill {
  display: flex;
  min-width: 0;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0 6px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #f8fafc;
  color: #172033;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  box-sizing: border-box;
}

.mental-range-inputs,
.mental-single-input {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.mental-single-input {
  grid-template-columns: 1fr;
}

.mental-range-inputs label,
.mental-single-input label {
  display: grid;
  gap: 4px;
  color: #334155;
  font-size: 12px;
  font-weight: 700;
}

.mental-range-inputs input,
.mental-single-input input {
  min-width: 0;
  min-height: 32px;
  padding: 0 8px;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  background: #fff;
  color: #0f172a;
  font-size: 14px;
  box-sizing: border-box;
}

.mental-pill input {
  width: auto;
  min-height: 0;
  padding: 0;
  flex: 0 0 auto;
}

.mental-pill.is-selected {
  border-color: #2563eb;
  background: #eff6ff;
  color: #1d4ed8;
}

.mental-primary,
.mental-answer-form .primary,
.mental-action-row .primary {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  background: #2563eb;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
}

.mental-practice {
  display: grid;
  grid-template-rows: auto minmax(72px, 1fr) auto auto minmax(46%, 50%);
  gap: 6px;
  min-height: 0;
}

.mental-status-row {
  display: flex;
  flex: 0 0 auto;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 9px;
  border: 1px solid #dbe4f0;
  border-radius: 8px;
  background: #fff;
  color: #334155;
  font-size: 13px;
  font-weight: 700;
}

.mental-question-card {
  display: flex;
  min-height: 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px;
  border: 1px solid #dbe4f0;
  border-radius: 8px;
  background: #fff;
  text-align: center;
}

.mental-expression {
  color: #0f172a;
  font-size: clamp(28px, 10vw, 46px);
  font-weight: 800;
  line-height: 1.1;
}

.mental-listening-mark {
  color: #0f172a;
  font-size: 24px;
  font-weight: 800;
}

.mental-replay,
.mental-secondary,
.mental-action-row button,
.mental-wrong-book .math-toolbar button {
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  color: #172033;
  font-size: 14px;
  font-weight: 700;
}

.mental-answer-line {
  color: #1d4ed8;
  font-size: 14px;
  font-weight: 700;
}

.mental-answer-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 88px;
  flex: 0 0 auto;
  gap: 8px;
}

.mental-answer-form input {
  min-width: 0;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  color: #0f172a;
  font-size: 18px;
  font-weight: 700;
}

.mental-answer-form input[readonly] {
  caret-color: transparent;
  user-select: none;
}

.mental-keyboard {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
  min-height: 0;
}

.mental-keyboard button {
  min-height: 44px;
  padding: 0 6px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  color: #0f172a;
  font-size: 16px;
  font-weight: 800;
}

.mental-keyboard button:disabled {
  border-color: #e2e8f0;
  background: #f1f5f9;
  color: #94a3b8;
}

.mental-keyboard .mental-key-wide {
  grid-column: span 1;
  font-size: 13px;
  color: #334155;
}

.mental-keyboard .mental-key-skip {
  border-color: #fecaca;
  background: #fff7ed;
  color: #b45309;
}

.mental-feedback-slot {
  min-height: 34px;
}

.mental-feedback,
.mental-feedback-placeholder {
  padding: 7px 9px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
}

.mental-feedback-placeholder {
  border: 1px solid transparent;
  color: #94a3b8;
}

.mental-feedback.is-correct {
  background: #dcfce7;
  color: #166534;
}

.mental-feedback.is-wrong {
  background: #fee2e2;
  color: #991b1b;
}

.mental-secondary {
  width: 100%;
  flex: 0 0 auto;
}

.mental-result-grid {
  grid-template-columns: repeat(auto-fit, minmax(62px, 1fr));
  gap: 8px;
}

.mental-result-grid div {
  display: grid;
  gap: 3px;
  padding: 8px 4px;
  border-radius: 8px;
  background: #f8fafc;
  text-align: center;
}

.mental-result-grid strong {
  color: #1d4ed8;
  font-size: 21px;
}

.mental-result-grid span,
.mental-meta {
  color: #475569;
  font-size: 12px;
}

.mental-meta {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  line-height: 1.4;
}

.mental-question-list {
  display: grid;
  gap: 8px;
}

.mental-question-row {
  display: grid;
  gap: 4px;
  padding: 9px 10px;
  border: 1px solid #e5edf7;
  border-radius: 8px;
  background: #f8fafc;
}

.mental-question-row strong {
  color: #0f172a;
  font-size: 17px;
}

.mental-question-row span {
  color: #64748b;
  font-size: 12px;
}

.mental-action-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.mental-action-row button:disabled,
.mental-wrong-book button:disabled {
  opacity: 0.55;
}

.mental-wrong-list {
  min-height: 0;
}

@media (max-width: 380px) {
  .mental-choice-grid,
  .mental-choice-grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mental-action-row,
  .mental-meta {
    grid-template-columns: 1fr;
  }
}

.math-size-form,
.math-dialog-form {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.math-size-form label,
.math-dialog-form label {
  display: grid;
  gap: 5px;
  color: #334155;
  font-size: 13px;
}

.math-size-setup {
  display: flex;
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  min-height: 0;
  box-sizing: border-box;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.math-size-card {
  display: flex;
  flex: 1 1 auto;
  width: 100%;
  max-width: none;
  min-width: 0;
  min-height: 100%;
  box-sizing: border-box;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  border: 1px solid #dbe4f0;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

.math-size-preview {
  display: flex;
  flex: 1 1 auto;
  min-height: clamp(150px, 36vh, 280px);
  min-height: clamp(150px, 36svh, 280px);
  padding: 10px;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 8px;
  background: #f3f8ff;
}

.math-size-cuboid-svg {
  width: 100%;
  max-width: none;
  height: 100%;
  min-height: 0;
}

.math-size-face {
  stroke: #4267ad;
  stroke-width: 1.8;
  vector-effect: non-scaling-stroke;
}

.math-size-face-front {
  fill: rgba(96, 150, 226, 0.42);
}

.math-size-face-top {
  fill: rgba(147, 197, 253, 0.5);
}

.math-size-face-side {
  fill: rgba(96, 165, 250, 0.28);
}

.math-size-edge {
  fill: none;
  stroke: #2f4c93;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.2;
  vector-effect: non-scaling-stroke;
}

.math-size-hidden-edge {
  stroke: #6b8bc7;
  stroke-dasharray: 4 4;
  stroke-linecap: round;
  stroke-width: 1.4;
  vector-effect: non-scaling-stroke;
}

.math-size-measure {
  fill: none;
  stroke-linecap: round;
  stroke-width: 1.8;
  marker-start: url('#math-size-arrow-blue');
  marker-end: url('#math-size-arrow-blue');
  vector-effect: non-scaling-stroke;
}

.math-size-measure-length {
  stroke: #2563eb;
}

.math-size-measure-width {
  marker-start: url('#math-size-arrow-green');
  marker-end: url('#math-size-arrow-green');
  stroke: #16a34a;
}

.math-size-measure-height {
  marker-start: url('#math-size-arrow-indigo');
  marker-end: url('#math-size-arrow-indigo');
  stroke: #4f46e5;
}

.math-size-pill-bg {
  stroke: rgba(255, 255, 255, 0.9);
  stroke-width: 1;
}

.math-size-pill-bg-length {
  fill: #dbeafe;
}

.math-size-pill-bg-width {
  fill: #dcfce7;
}

.math-size-pill-bg-height {
  fill: #eef2ff;
}

.math-size-pill {
  font-size: 11px;
  font-weight: 700;
}

.math-size-pill-length {
  fill: #1d4ed8;
}

.math-size-pill-width {
  fill: #15803d;
}

.math-size-pill-height {
  fill: #4338ca;
}

.math-size-inputs {
  display: grid;
  flex: 0 0 auto;
  gap: 8px;
  padding: 0;
  width: 100%;
  max-width: none;
  margin: 0;
}

.math-size-settings {
  display: grid;
  flex: 0 0 auto;
  width: 100%;
  max-width: none;
  grid-template-columns: minmax(92px, 0.8fr) minmax(0, 1.2fr);
  gap: 8px;
  margin: 0;
}

.math-size-unit-field,
.math-size-net-field {
  display: grid;
  min-width: 0;
  gap: 5px;
  padding: 8px;
  border: 1px solid #e5edf7;
  border-radius: 8px;
  background: #fff;
  color: #0f172a;
  font-size: 12px;
  font-weight: 700;
}

.math-size-unit-field input {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  min-height: 30px;
  padding: 0 8px;
  border: 0;
  border-radius: 6px;
  background: #f8fafc;
  color: #0f172a;
  font-size: 14px;
  font-weight: 700;
}

.math-size-net-field {
  grid-template-columns: 1fr auto;
  align-items: center;
}

.math-size-net-field button {
  min-height: 30px;
  padding: 0 8px;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  background: #fff;
  color: #172033;
  font-size: 12px;
  font-weight: 700;
}

.math-size-net-field small {
  grid-column: 1 / -1;
  min-width: 0;
  overflow: hidden;
  color: #64748b;
  font-size: 11px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.math-size-input-row {
  display: grid;
  width: 100%;
  max-width: none;
  box-sizing: border-box;
  grid-template-columns: 26px 48px minmax(76px, 1fr) minmax(78px, 88px);
  gap: 8px;
  align-items: center;
  min-height: 46px;
  padding: 7px 8px;
  border: 1px solid #e5edf7;
  border-radius: 8px;
  background: #fff;
  margin: 0;
  min-width: 0;
}

.math-size-input-icon {
  display: inline-flex;
  width: 22px;
  height: 22px;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: var(--dimension-icon-bg);
  color: var(--dimension-icon-color);
  font-size: 12px;
  font-weight: 800;
}

.math-size-input-label {
  color: #0f172a;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  min-width: 0;
}

.math-size-input-label small {
  color: #64748b;
  font-size: 11px;
  font-weight: 600;
}

.math-size-stepper {
  min-width: 78px;
}

.math-size-input-row input {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  min-height: 30px;
  padding: 0 6px;
  border: 0;
  border-radius: 6px;
  background: #f8fafc;
  color: #0f172a;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
}

.math-size-stepper {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  box-sizing: border-box;
  overflow: hidden;
  border: 1px solid #e2e8f0;
  border-radius: 7px;
  background: #fff;
}

.math-size-stepper button {
  width: 100%;
  min-height: 30px;
  padding: 0;
  border: 0;
  border-right: 1px solid #e2e8f0;
  background: #fff;
  color: #475569;
  font-size: 17px;
  font-weight: 800;
  line-height: 1;
}

.math-size-stepper button:last-child {
  border-right: 0;
}

.math-size-stepper button:disabled {
  color: #cbd5e1;
  background: #f8fafc;
}

.math-size-card > .primary {
  min-height: 42px;
  border-radius: 8px;
  background: #4ca765;
  color: #fff;
  font-size: 14px;
  font-weight: 800;
}

.math-size-card > .primary:disabled {
  background: #b7dac2;
  color: #eef8f1;
}

.math-target-net-list {
  display: grid;
  max-height: 60vh;
  gap: 8px;
  padding: 10px;
}

.math-target-net-list button {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 42px;
  text-align: left;
}

.math-target-net-list small {
  color: #64748b;
}

.math-setup-net-dialog {
  display: grid;
  gap: 8px;
}

.math-setup-net-grid {
  max-height: 48vh;
}

@media (max-width: 420px) {
  .math-segmented {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .math-net-grid {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  }

  .math-size-input-row {
    grid-template-columns: 26px minmax(82px, 1fr) minmax(78px, 84px);
    gap: 7px;
  }

  .math-size-input-label {
    display: none;
  }

  .math-size-settings {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    align-items: center;
  }

  .math-size-unit-field,
  .math-size-net-field {
    min-width: 0;
  }

  .math-size-preview {
    min-height: clamp(130px, 32vh, 220px);
    min-height: clamp(130px, 32svh, 220px);
    padding: 8px;
  }

  .math-size-cuboid-svg {
    max-width: none;
    min-height: 0;
  }
}

@media (max-height: 700px) {
  .math-size-card {
    gap: 8px;
    padding: 10px;
  }

  .math-size-preview {
    min-height: clamp(120px, 30vh, 200px);
    min-height: clamp(120px, 30svh, 200px);
    padding: 8px;
  }

  .math-size-unit-field,
  .math-size-net-field {
    padding: 7px;
  }

  .math-size-input-row {
    min-height: 42px;
    padding: 6px 8px;
  }

  .math-size-card > .primary {
    min-height: 38px;
  }
}

@media (max-height: 600px) {
  .math-size-card {
    gap: 6px;
    padding: 8px;
  }

  .math-size-preview {
    min-height: clamp(96px, 26vh, 160px);
    min-height: clamp(96px, 26svh, 160px);
    padding: 6px;
  }

  .math-size-unit-field input,
  .math-size-input-row input,
  .math-size-net-field button {
    min-height: 28px;
  }

  .math-size-input-row {
    min-height: 38px;
  }

  .math-size-stepper button {
    min-height: 28px;
  }

  .math-size-card > .primary {
    min-height: 36px;
  }
}
.english-content .segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin: 10px 0;
}

.radio-inline {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
}

.radio-inline label + label {
  margin-left: 22px;
}

.radio-inline.three label + label {
  margin-left: 18px;
}

.radio-inline label {
  flex: 0 0 auto;
  min-height: 36px;
  white-space: nowrap;
}

.english-setup-form.is-category-mode .english-wrong-source {
  display: none;
}

.english-content .segmented button {
  min-height: 36px;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  background: #fff;
  color: #172033;
}

.english-content .segmented button.active {
  border-color: #2563eb;
  background: #eff6ff;
  color: #1d4ed8;
  font-weight: 700;
}

.english-list-head {
  margin-bottom: 8px;
}

.english-list {
  min-height: 0;
  max-width: 100%;
  overflow-x: hidden;
}

.english-term-table {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  border: 1px solid #dbe4f0;
  border-radius: 8px;
  background: #fff;
}

.english-term-header,
.english-term-row {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 0.75fr) minmax(112px, 1fr);
  align-items: stretch;
}

.english-term-header {
  min-height: 34px;
  background: #f8fafc;
  color: #475569;
  font-size: 13px;
  font-weight: 700;
}

.english-term-header span,
.english-term-cell,
.english-term-actions {
  min-width: 0;
  padding: 8px 6px;
  border-bottom: 1px solid #eef2f7;
  overflow-wrap: anywhere;
  white-space: normal;
}

.english-term-header span + span,
.english-term-cell + .english-term-cell,
.english-term-actions {
  border-left: 1px solid #eef2f7;
}

.english-term-row:last-child .english-term-cell,
.english-term-row:last-child .english-term-actions {
  border-bottom: 0;
}

.english-term-cell {
  color: #172033;
  line-height: 1.35;
}

.english-term-english {
  display: block;
}

.english-term-english small {
  display: block;
  margin-top: 3px;
  color: #64748b;
  font-size: 12px;
}

.english-term-actions {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
}

.english-term-actions button {
  flex: 1 1 0;
  min-width: 0;
  min-height: 28px;
  padding: 0 3px;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  background: #fff;
  color: #172033;
  font-size: 11px;
  white-space: nowrap;
}

.english-term-actions button + button {
  margin-left: 4px;
}

.english-passage-row {
  display: flex;
  align-items: flex-start;
  padding: 9px 6px;
  border-bottom: 1px solid #eef2f7;
}

.english-passage-row > * + * {
  margin-left: 10px;
}

.english-passage-main {
  display: grid;
  flex: 1 1 auto;
  min-width: 0;
  gap: 4px;
}

.english-passage-main p {
  margin: 0;
  color: #475569;
  font-size: 13px;
  line-height: 1.35;
}

.english-dialog-form {
  display: grid;
  gap: 10px;
}

.english-dialog-form label {
  display: grid;
  gap: 5px;
}

.english-reading-list {
  display: grid;
  gap: 8px;
  padding-top: 8px;
}

.english-reading-row {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid #dbe4f0;
  border-radius: 8px;
  background: #fff;
  color: #172033;
  text-align: left;
}

.english-reading-row span,
.english-reading-row small {
  color: #64748b;
}

.english-reader {
  display: flex;
  min-height: 0;
  flex: 1 1 auto;
  flex-direction: column;
}

.english-reader > * + * {
  margin-top: 10px;
}

.english-reader-head {
  flex: 0 0 auto;
}

.english-reader-head h2 {
  margin: 0;
  font-size: 18px;
}

.english-reader-controls {
  display: flex;
  width: 100%;
  min-width: 0;
  flex-wrap: nowrap;
  align-items: center;
}

.english-reader-controls > * + * {
  margin-left: 6px;
}

.english-reader-controls button {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 34px;
  padding: 0 8px;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  background: #fff;
  color: #172033;
  white-space: nowrap;
}

.english-reader-controls .primary {
  border: 0;
  background: #2563eb;
  color: #fff;
}

.english-reader-body {
  display: grid;
  gap: 10px;
}

.english-passage-body {
  margin: 0;
  padding: 10px;
  border: 1px solid #dbe4f0;
  border-radius: 8px;
  background: #fff;
  color: #172033;
  line-height: 1.6;
  white-space: pre-wrap;
}

.english-passage-sentence {
  border-radius: 6px;
  padding: 1px 2px;
}

.english-passage-sentence.active {
  background: #2563eb;
  color: #fff;
}

.english-rate-row {
  display: inline-flex;
  flex: 0 1 auto;
  align-items: center;
  min-width: 0;
  min-height: 34px;
  white-space: nowrap;
}

.english-rate-row .english-rate-select {
  margin-left: 4px;
}

.english-rate-select {
  width: 78px;
  min-width: 0;
}

.english-sentence-list {
  display: grid;
  gap: 6px;
}

.english-sentence-row {
  display: grid;
  grid-template-columns: 32px 1fr 56px;
  gap: 8px;
  align-items: center;
  padding: 8px;
  border: 1px solid #dbe4f0;
  border-radius: 8px;
  background: #fff;
}

.english-sentence-row.active {
  border-color: #2563eb;
  background: #eff6ff;
}

.english-sentence-dialog {
  display: grid;
  gap: 10px;
}

.english-sentence-dialog-list {
  display: grid;
  gap: 6px;
  max-height: 56vh;
}

.english-sentence-row button {
  min-height: 30px;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  background: #fff;
}

.english-result-word {
  display: grid;
  gap: 3px;
}

.english-result-word small,
.english-detail-row small {
  display: block;
  color: #64748b;
}

.english-detail-row {
  justify-content: space-between;
}

@media (max-width: 380px) {
  .english-term-header,
  .english-term-row {
    grid-template-columns: minmax(0, 0.8fr) minmax(0, 0.7fr) minmax(104px, 1fr);
  }

  .english-term-header span,
  .english-term-cell,
  .english-term-actions {
    padding: 7px 5px;
  }

  .english-term-actions button {
    min-height: 27px;
    padding: 0 2px;
    font-size: 10px;
  }

  .english-term-actions button + button {
    margin-left: 3px;
  }

  .english-reader-controls > * + * {
    margin-left: 4px;
  }

  .english-reader-controls button {
    min-height: 32px;
    padding: 0 6px;
    font-size: 14px;
  }

  .english-rate-row {
    font-size: 14px;
  }

  .english-rate-row .english-rate-select {
    margin-left: 3px;
  }

  .english-rate-select {
    width: 72px;
    padding: 0 4px;
  }

  .english-passage-row {
    flex-direction: column;
  }

  .english-passage-row > * + * {
    margin-top: 8px;
    margin-left: 0;
  }

  .english-passage-row .row-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .english-sentence-row {
    grid-template-columns: 28px 1fr;
  }

  .english-sentence-row button {
    grid-column: 2;
    justify-self: start;
  }
}

@media (max-width: 340px) {
  .english-reader-controls > * + * {
    margin-left: 3px;
  }

  .english-reader-controls button {
    padding: 0 4px;
    font-size: 13px;
  }

  .english-rate-row {
    font-size: 13px;
  }

  .english-rate-select {
    width: 66px;
    font-size: 13px;
  }
}
.focus-page {
  display: flex;
  min-height: 0;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 12px;
}

.focus-setup {
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.focus-home,
.focus-setup,
.focus-result,
.focus-records {
  padding-bottom: 4px;
  padding-bottom: calc(env(safe-area-inset-bottom) + 4px);
}

.focus-records {
  overflow: hidden;
}

.focus-records .focus-overview {
  flex: 0 0 auto;
}

.focus-overview {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 12px;
}

.focus-overview div,
.focus-score-panel {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-align: center;
}

.focus-overview strong {
  color: #0f766e;
  font-size: 18px;
}

.focus-overview span,
.focus-entry small,
.focus-record-row span,
.focus-score-panel span {
  color: #64748b;
  font-size: 12px;
}

.focus-entry > span:first-child {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
}

.focus-form-panel {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
}

.focus-current-training {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  gap: 4px;
  padding: 12px;
}

.focus-current-training strong {
  color: #172033;
  font-size: 16px;
}

.focus-current-training span {
  color: #64748b;
  font-size: 13px;
}

.focus-choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.focus-choice-grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.focus-choice-grid-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.focus-pill {
  min-width: 0;
}

.focus-pill input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.focus-pill span {
  display: flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  color: #172033;
  font-size: 14px;
  text-align: center;
}

.focus-pill input:checked + span {
  border-color: #2563eb;
  background: #dbeafe;
  color: #1d4ed8;
  font-weight: 700;
}

.focus-switch {
  display: flex;
  min-height: 40px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.focus-primary {
  flex: 0 0 auto;
  min-height: 44px;
}

.focus-countdown {
  align-items: center;
  justify-content: center;
  text-align: center;
}

.focus-count-number {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: #2563eb;
  color: #fff;
  font-size: 64px;
  font-weight: 800;
  line-height: 120px;
}

.focus-count-label {
  color: #475569;
  font-size: 16px;
  font-weight: 700;
}

.focus-training {
  gap: 0;
  overflow: hidden;
}

.focus-status-row {
  display: grid;
  flex: 0 0 auto;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.focus-status-row span {
  min-width: 0;
  min-height: 34px;
  padding: 0 6px;
  border: 1px solid #dbe4f0;
  border-radius: 8px;
  background: #fff;
  color: #334155;
  font-size: 12px;
  font-weight: 700;
  line-height: 34px;
  overflow: hidden;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.focus-schulte-grid,
.focus-target-grid,
.focus-memory-grid,
.focus-option-grid {
  display: grid;
  min-height: 0;
  gap: 12px;
}

.focus-schulte-grid {
  width: 100%;
  margin: 96px auto 0;
  grid-template-columns: repeat(var(--focus-grid-size), minmax(40px, 1fr));
}

.focus-cell,
.focus-target-item,
.focus-option,
.focus-memory-card {
  min-width: 0;
  min-height: 40px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  color: #172033;
  font-weight: 800;
}

.focus-cell,
.focus-memory-card {
  height: var(--focus-cell-size, auto);
  aspect-ratio: 1;
}

.focus-cell {
  font-size: clamp(26px, 8vw, 42px);
}

.focus-cell.is-done,
.focus-target-item.is-found,
.focus-memory-card.is-matched {
  border-color: #99f6e4;
  background: #ccfbf1;
  color: #0f766e;
}

.focus-cell.is-error,
.focus-target-item.is-error {
  border-color: #fca5a5;
  background: #fee2e2;
  color: #b91c1c;
}

.focus-target-grid {
  margin-top: clamp(28px, 6vh, 64px);
  grid-template-columns: repeat(auto-fit, minmax(76px, 1fr));
  align-content: start;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.focus-target-item,
.focus-option {
  aspect-ratio: 1.1;
  font-size: clamp(24px, 7vw, 36px);
}

.focus-color-red {
  color: #dc2626;
}

.focus-color-blue {
  color: #2563eb;
}

.focus-color-green {
  color: #16a34a;
}

.focus-color-purple {
  color: #7c3aed;
}

.focus-color-orange {
  color: #ea580c;
}

.focus-audio-panel {
  align-items: center;
  padding: 14px;
  text-align: center;
}

.focus-listening-mark {
  color: #334155;
  font-weight: 800;
}

.focus-replay {
  min-height: 42px;
  padding: 0 18px;
}

.focus-answer-hint {
  margin-top: 8px;
  color: #0f766e;
  font-weight: 700;
}

.focus-option-grid {
  margin-top: clamp(18px, 4vh, 42px);
  grid-template-columns: repeat(2, minmax(0, 1fr));
  overflow: auto;
}

.focus-memory-grid {
  margin-top: clamp(24px, 5vh, 56px);
  grid-template-columns: repeat(4, minmax(40px, 1fr));
  align-content: center;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.focus-memory-grid.is-large {
  grid-template-columns: repeat(5, minmax(40px, 1fr));
  gap: 8px;
}

.focus-memory-card {
  background: #e0f2fe;
  color: #0369a1;
  font-size: clamp(20px, 5.5vw, 30px);
}

.focus-memory-card.is-open {
  background: #fff;
  color: #172033;
}

.focus-memory-card span {
  display: block;
  overflow: hidden;
  padding: 2px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.focus-reaction {
  align-items: center;
  justify-content: space-between;
}

.focus-stimulus {
  display: flex;
  width: 78vw;
  height: 78vw;
  max-width: 340px;
  max-height: 340px;
  align-items: center;
  justify-content: center;
  margin: auto;
  border: 0;
  border-radius: 50%;
  background: #e2e8f0;
  color: #172033;
  font-size: clamp(48px, 12vw, 72px);
  font-weight: 900;
}

@supports (margin-top: clamp(1px, 2vw, 3px)) {
  .focus-schulte-grid {
    margin-top: clamp(84px, 13vh, 128px);
  }
}

.focus-stimulus.is-green {
  background: #22c55e;
  color: #fff;
}

.focus-stimulus.is-red {
  background: #ef4444;
  color: #fff;
}

.focus-stimulus.is-yellow {
  background: #facc15;
  color: #713f12;
}

.focus-stimulus.is-blank {
  border: 1px solid #e2e8f0;
  background: #fff;
  color: transparent;
}

.focus-score-panel {
  padding: 18px 12px;
}

.focus-score-panel strong {
  color: #2563eb;
  font-size: 48px;
  line-height: 1;
}

.focus-rest-tip {
  margin-top: 6px;
  color: #b45309;
  font-size: 13px;
}

.focus-result-list {
  display: flex;
  flex-direction: column;
  padding: 8px 12px;
}

.focus-result-list div,
.focus-record-row {
  display: flex;
  min-height: 38px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid #e2e8f0;
}

.focus-result-list div:last-child,
.focus-record-row:last-child {
  border-bottom: 0;
}

.focus-result-list span {
  color: #64748b;
}

.focus-action-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.focus-action-row button {
  min-height: 42px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
}

.focus-action-row .primary {
  border: 0;
  background: #2563eb;
  color: #fff;
}

.focus-record-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 12px;
  -webkit-overflow-scrolling: touch;
}

.focus-danger-button {
  flex: 0 0 auto;
  min-height: 42px;
  border: 1px solid #fecaca;
  border-radius: 8px;
  background: #fff;
  color: #b91c1c;
  font-weight: 700;
}

.focus-danger-button:disabled {
  border-color: #e2e8f0;
  color: #94a3b8;
}

.focus-record-row > div {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
}

.focus-record-row > div:last-child {
  align-items: flex-end;
  text-align: right;
}

@media (max-width: 380px) {
  .page-body.page-focusSetup {
    gap: 8px;
    padding: 8px;
  }

  .focus-page {
    gap: 8px;
  }

  .focus-setup {
    padding-bottom: 12px;
    padding-bottom: calc(env(safe-area-inset-bottom) + 12px);
  }

  .focus-form-panel {
    gap: 8px;
    padding: 10px;
  }

  .focus-current-training {
    padding: 10px;
  }

  .focus-choice-grid {
    gap: 7px;
  }

  .focus-choice-grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .focus-pill span {
    min-height: 34px;
    font-size: 13px;
  }

  .focus-switch {
    min-height: 34px;
    font-size: 14px;
  }

  .focus-primary {
    min-height: 40px;
  }

  .focus-status-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .focus-memory-grid.is-large {
    grid-template-columns: repeat(4, minmax(40px, 1fr));
  }

  .focus-schulte-grid {
    margin-top: 76px;
  }

  .focus-target-grid {
    grid-template-columns: repeat(auto-fit, minmax(64px, 1fr));
    margin-top: clamp(18px, 4vh, 36px);
  }

  .focus-target-item,
  .focus-option {
    font-size: clamp(20px, 6.5vw, 30px);
  }

  .focus-memory-grid {
    margin-top: clamp(18px, 4vh, 36px);
  }

  .focus-stimulus {
    width: 76vw;
    height: 76vw;
    max-width: 300px;
    max-height: 300px;
  }

  .focus-action-row {
    grid-template-columns: 1fr;
  }
}

@supports (margin-top: clamp(1px, 2vw, 3px)) {
  @media (max-width: 380px) {
    .focus-schulte-grid {
      margin-top: clamp(64px, 10vh, 96px);
    }
  }
}

@media (max-height: 700px) {
  .page-body.page-focusSetup {
    gap: 8px;
    padding: 8px;
  }

  .focus-setup {
    gap: 8px;
    padding-bottom: 12px;
    padding-bottom: calc(env(safe-area-inset-bottom) + 12px);
  }

  .focus-form-panel {
    gap: 7px;
    padding: 9px 10px;
  }

  .focus-current-training {
    padding: 9px 10px;
  }

  .focus-choice-grid {
    gap: 7px;
  }

  .focus-pill span {
    min-height: 32px;
    font-size: 13px;
  }

  .focus-switch {
    min-height: 32px;
    font-size: 14px;
  }

  .focus-primary {
    min-height: 40px;
  }
}

@media (max-height: 620px) {
  .page-body.page-focusSetup {
    padding: 6px 8px;
  }

  .focus-setup {
    gap: 6px;
  }

  .focus-form-panel {
    gap: 6px;
    padding: 8px;
  }

  .focus-current-training {
    padding: 8px;
  }

  .focus-pill span {
    min-height: 30px;
    font-size: 12px;
  }

  .focus-switch {
    min-height: 30px;
  }

  .focus-primary {
    min-height: 38px;
  }

  .focus-schulte-grid,
  .focus-target-grid,
  .focus-memory-grid,
  .focus-option-grid {
    gap: 8px;
  }
}
/* Compatibility fallbacks for Android WebView around Chrome 61/API25. */

.help-text,
.help-item-title,
.help-item-text,
.homework-task-detail p,
.homework-row-title strong,
.english-term-header span,
.english-term-cell,
.english-term-actions,
.copybook-word-row .word,
.copybook-word-row .pinyin,
.tree-row label,
.word-row .word-main,
.result-row .word {
  overflow-wrap: break-word;
  word-break: break-word;
}

.math-toolbar button {
  font-size: 11px;
  font-size: clamp(10px, 2.8vw, 12px);
}

.mental-expression {
  font-size: 40px;
  font-size: clamp(28px, 10vw, 46px);
}

.math-size-preview {
  min-height: 200px;
  min-height: clamp(150px, 36vh, 280px);
  min-height: clamp(150px, 36svh, 280px);
}

.focus-cell {
  font-size: 34px;
  font-size: clamp(26px, 8vw, 42px);
}

.focus-target-grid {
  margin-top: 48px;
  margin-top: clamp(28px, 6vh, 64px);
}

.focus-target-item,
.focus-option {
  font-size: 30px;
  font-size: clamp(24px, 7vw, 36px);
}

.focus-option-grid {
  margin-top: 30px;
  margin-top: clamp(18px, 4vh, 42px);
}

.focus-memory-grid {
  margin-top: 40px;
  margin-top: clamp(24px, 5vh, 56px);
}

.focus-memory-card {
  font-size: 25px;
  font-size: clamp(20px, 5.5vw, 30px);
}

.focus-count-number {
  font-size: 64px;
  font-size: clamp(48px, 12vw, 72px);
}

.titlebar,
.homework-filter,
.homework-filter label,
.homework-summary label,
.homework-form label,
.homework-toolbar,
.homework-task-detail,
.copybook-actions,
.copybook-word-row,
.button-grid,
.search-form,
.unfinished-row,
.math-mode-grid,
.math-card-grid,
.math-size-form,
.math-dialog-form,
.mental-practice,
.mental-keypad,
.mental-action-row,
.mental-question-list,
.mental-question-row,
.math-size-input-grid,
.math-size-input-row,
.math-size-control-grid,
.math-size-row,
.math-size-net-actions,
.english-content .segmented,
.english-passage-main,
.english-dialog-form,
.english-reading-list,
.english-reading-row,
.focus-overview,
.focus-choice-grid,
.focus-status-row,
.focus-schulte-grid,
.focus-target-grid,
.focus-memory-grid,
.focus-option-grid,
.focus-record-row {
  grid-gap: 8px;
}

.homework-filter label,
.homework-summary label,
.homework-form label,
.english-dialog-form label,
.math-size-form label,
.math-dialog-form label {
  grid-gap: 5px;
}

.mental-question-list,
.mental-question-row,
.english-passage-main,
.english-reading-row {
  grid-gap: 4px;
}

.tree,
.math-size-form,
.math-dialog-form,
.english-dialog-form,
.english-reading-list,
.focus-current-training {
  grid-gap: 10px;
}

@media (max-width: 380px) {
  .focus-target-grid,
  .focus-option-grid {
    margin-top: 28px;
    margin-top: clamp(18px, 4vh, 36px);
  }

  .focus-memory-card {
    font-size: 24px;
    font-size: clamp(20px, 6.5vw, 30px);
  }
}

@media (max-height: 700px) {
  .math-size-preview {
    min-height: 160px;
    min-height: clamp(120px, 30vh, 200px);
    min-height: clamp(120px, 30svh, 200px);
  }
}

@media (max-height: 600px) {
  .math-size-preview {
    min-height: 128px;
    min-height: clamp(96px, 26vh, 160px);
    min-height: clamp(96px, 26svh, 160px);
  }
}

@supports not (aspect-ratio: 1) {
  .copybook-preview-image {
    width: 65%;
    height: 92%;
  }

  .focus-cell,
  .focus-memory-card {
    height: var(--focus-cell-size, 64px);
  }

  .focus-target-item,
  .focus-option {
    min-height: 64px;
  }
}

.no-flex-gap .title-right > * + * {
  margin-left: 2px;
}

.no-flex-gap .page-body > * + *,
.no-flex-gap .split-view > * + *,
.no-flex-gap .menu > * + *,
.no-flex-gap .settings-page > * + *,
.no-flex-gap .settings-action-footer > * + *,
.no-flex-gap .settings-section > * + *,
.no-flex-gap .settings-check-list > * + *,
.no-flex-gap .settings-field > * + *,
.no-flex-gap .settings-radio-group > * + *,
.no-flex-gap .help-page > * + *,
.no-flex-gap .help-link-list > * + *,
.no-flex-gap .help-list > * + *,
.no-flex-gap .help-section > * + *,
.no-flex-gap .help-info-list > * + *,
.no-flex-gap .homework-page > * + *,
.no-flex-gap .homework-list > * + *,
.no-flex-gap .setup-form > * + *,
.no-flex-gap .copybook-form > * + *,
.no-flex-gap .copybook-list-page > * + *,
.no-flex-gap .copybook-preview-page > * + *,
.no-flex-gap .copybook-word-list > * + *,
.no-flex-gap .playback > * + *,
.no-flex-gap .focus-page > * + *,
.no-flex-gap .focus-form-panel > * + *,
.no-flex-gap .focus-current-training > * + *,
.no-flex-gap .english-reader > * + * {
  margin-top: 10px;
}

.no-flex-gap .row-actions > * + *,
.no-flex-gap .inline-actions > * + *,
.no-flex-gap .settings-section-head > * + *,
.no-flex-gap .help-section-head > * + *,
.no-flex-gap .help-info-row > * + *,
.no-flex-gap .panel-head > * + *,
.no-flex-gap .detail-row > * + *,
.no-flex-gap .homework-toolbar-row > * + *,
.no-flex-gap .homework-row > * + *,
.no-flex-gap .homework-row-title > * + *,
.no-flex-gap .choice-row > * + *,
.no-flex-gap .form-section label > * + *,
.no-flex-gap .tree-row > * + *,
.no-flex-gap .tree-row label > * + *,
.no-flex-gap .word-row > * + *,
.no-flex-gap .result-row > * + *,
.no-flex-gap .english-term-actions > * + *,
.no-flex-gap .english-reader-controls > * + *,
.no-flex-gap .focus-switch > * + *,
.no-flex-gap .modal-head > * + *,
.no-flex-gap .modal-foot > * + * {
  margin-left: 8px;
}

.no-flex-gap .tree > * + *,
.no-flex-gap .word-row .word-main > * + *,
.no-flex-gap .math-page > * + *,
.no-flex-gap .math-size-card > * + *,
.no-flex-gap .math-size-form > * + *,
.no-flex-gap .math-dialog-form > * + *,
.no-flex-gap .math-size-form label > * + *,
.no-flex-gap .math-dialog-form label > * + *,
.no-flex-gap .focus-overview div > * + *,
.no-flex-gap .focus-score-panel > * + *,
.no-flex-gap .focus-entry > span:first-child > * + *,
.no-flex-gap .english-passage-main > * + *,
.no-flex-gap .english-dialog-form > * + *,
.no-flex-gap .english-dialog-form label > * + *,
.no-flex-gap .english-reading-list > * + *,
.no-flex-gap .english-reading-row > * + * {
  margin-top: 6px;
}

.no-flex-gap .modal-head > :first-child,
.no-flex-gap .modal-foot > :first-child {
  margin-left: 0;
}

.no-flex-gap .page-body > * + *,
.no-flex-gap .settings-page > * + *,
.no-flex-gap .help-page > * + *,
.no-flex-gap .focus-page > * + * {
  margin-top: 12px;
}

.no-flex-gap .playback > * + * {
  margin-top: 28px;
}

.no-flex-gap .dictation-content > * + * {
  margin-top: 0;
}
