.hm-full .hm-full-short { display: none; }
.hm-full-task-head > p { text-align: center; }

@media (max-width: 700px), (orientation: landscape) and (max-height: 540px) and (pointer: coarse) {
  #app:has(.hm-full) {
    max-width: 100%;
    padding: 8px max(12px,env(safe-area-inset-right)) max(30px,env(safe-area-inset-bottom)) max(12px,env(safe-area-inset-left));
  }
  .hm-full {
    min-width: 0;
    margin: 0 auto;
    width: 100%;
  }
  .hm-full:focus, #hmFullCard[tabindex="-1"]:focus, .hm-full .explanation[tabindex="-1"]:focus { outline: none; }
  .hm-full :is(button,summary):focus-visible { outline: 2px solid #92ecde; outline-offset: -2px; }
  .hm-full .hm-full-short { display: inline; }
  .hm-full .hm-full-wide { display: none; }
  .hm-full-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
  }
  .hm-full .hm-full-topbar nav { margin: 0; flex: none; }
  .hm-full-topbar .btn-ghost {
    min-height: 44px;
    padding: 6px 10px;
    font: 600 .8rem/1.25 system-ui,sans-serif;
  }
  .hm-full-topbar .header-tag {
    margin: 0;
    text-align: right;
    font: 600 .72rem/1.3 system-ui,sans-serif;
    letter-spacing: .055em;
  }
  .hm-full h1 {
    margin: 4px 0 12px;
    text-align: left;
    font-size: clamp(1.5rem,5.5vw,2.1rem);
    line-height: 1.08;
    overflow-wrap: anywhere;
  }
  .hm-full[data-lesson=""] > h1 { font-size: clamp(2.15rem,8vw,3.15rem); }
  .hm-full[data-lesson=""] > p { text-align: left; }
  .hm-full[data-lesson=""] .hm-subtitle, .hm-full-overview-rules { margin: 7px 0; }
  .hm-full .hm-full-topics {
    display: grid;
    grid-template-columns: repeat(auto-fit,minmax(min(100%,280px),1fr));
    gap: 8px;
    margin: 18px 0 0;
  }
  .hm-full .hm-full-topic {
    min-height: 82px;
    grid-template-columns: minmax(0,1fr) 12px;
    align-content: center;
    align-items: center;
    gap: 5px 12px;
    padding: 12px 14px;
    border-color: #4d606b;
    border-radius: 12px;
    background: #1a2930;
  }
  .hm-full-topic::after {
    content: '';
    grid-column: 2;
    grid-row: 1/3;
    width: 8px;
    height: 8px;
    transform: rotate(-45deg);
    border: solid #8bdfd0;
    border-width: 0 2px 2px 0;
  }
  .hm-full .hm-full-topic > span { grid-column: 1; font: 700 1.03rem/1.25 system-ui,sans-serif; }
  .hm-full .hm-full-topic > small { grid-column: 1; font: .8rem/1.35 system-ui,sans-serif; color: #ccd8d8; }
  .hm-full .hm-full-topic > progress { grid-column: 1/-1; margin-top: 3px; }

  .hm-full:not([data-lesson=""]) {
    padding-bottom: calc(74px + env(safe-area-inset-bottom));
  }
  .hm-full .hm-full-switch {
    display: grid;
    grid-template-columns: repeat(2,minmax(0,1fr));
    gap: 5px;
    max-height: 124px;
    margin: 0 0 10px;
    padding: 3px 5px 3px 3px;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    scroll-padding: 3px;
    scrollbar-color: #66948c #202731;
    scrollbar-width: thin;
    border: 1px solid #495760;
    border-radius: 10px;
    background: #182029;
  }
  .hm-full .hm-full-switch button {
    min-width: 0;
    min-height: 44px;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 6px;
    padding: 5px 7px;
    text-align: left;
    border-color: #49545e;
    background: #242a37;
    font: 700 .875rem/1.15 system-ui,sans-serif;
  }
  .hm-full .hm-full-switch button span {
    display: block;
    overflow-wrap: anywhere;
    color: #e1e3eb;
    font: 550 .875rem/1.18 system-ui,sans-serif;
  }
  .hm-full .hm-full-switch button[aria-current] {
    color: #ddfff7;
    border-color: #75cbba;
    background: #284b4a;
  }
  .hm-full .hm-full-summary {
    grid-template-columns: minmax(0,1fr) auto;
    gap: 5px 10px;
    align-items: baseline;
    margin: 9px 0 7px;
    max-width: none;
    text-align: left;
  }
  .hm-full .hm-full-summary strong { color: #b4eee0; font: 700 .93rem/1.25 system-ui,sans-serif; }
  .hm-full .hm-full-summary > span { font: .8rem/1.3 system-ui,sans-serif; }
  .hm-full .hm-full-summary progress { grid-column: 1/-1; }
  .hm-full .hm-full-levels, .hm-full .hm-full-goal { display: none; }
  .hm-full .hm-full-targets { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 6px; margin: 6px 0 8px; }
  .hm-full .hm-full-rules { min-width: 0; padding: 0; border-color: transparent; }
  .hm-full .hm-full-rules summary {
    display: list-item;
    min-height: 44px;
    align-content: center;
    padding: 5px 8px;
    font: 600 .875rem/1.25 system-ui,sans-serif;
    color: #c4d5ef;
  }
  .hm-full .hm-full-rules[open] { grid-column: 1/-1; background: #202937; border-color: #516174; }
  .hm-full .hm-full-rules[open] ul { padding: 0 10px 8px 28px; }
  .hm-full .hm-full-question { margin: 8px 0 12px; max-width: none; scroll-margin-top: 8px; }
  .hm-full .hm-full-question .explanation { scroll-margin-block: 12px calc(84px + env(safe-area-inset-bottom)); }
  .hm-full .hm-actions {
    position: fixed;
    z-index: 10;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    padding: 8px max(12px,env(safe-area-inset-right)) max(8px,env(safe-area-inset-bottom)) max(12px,env(safe-area-inset-left));
    margin: 0;
    background: #14232b;
    border-top: 1px solid #42605f;
  }
  .hm-full .hm-actions .btn-primary {
    min-height: 46px;
    width: 100%;
    max-width: 640px;
    margin: 0;
    padding: 8px 16px;
    font: 700 1.1rem/1.25 system-ui,sans-serif;
  }
  .hm-full #hm-full-message { scroll-margin-bottom: calc(76px + env(safe-area-inset-bottom)); }
}
@media (orientation: landscape) and (max-height: 540px) and (pointer: coarse) {
  .hm-full .hm-full-switch {
    grid-template-columns: repeat(4,minmax(0,1fr));
    max-height: 62px;
  }
}
@media (min-width: 600px) and (orientation: landscape) and (max-height: 540px) and (pointer: coarse) {
  .hm-full:not([data-lesson=""]) {
    display: grid;
    grid-template-columns: minmax(185px,30%) minmax(0,1fr);
    gap: 0 14px;
    align-items: start;
  }
  .hm-full:not([data-lesson=""]) .hm-full-topbar { grid-column: 1/-1; }
  .hm-full .hm-full-task-head { grid-column: 1; grid-row: 2; min-width: 0; }
  .hm-full .hm-full-switch {
    grid-template-columns: repeat(auto-fit,minmax(min(100%,135px),1fr));
    max-height: 107px;
  }
  .hm-full #hmFullCard { grid-column: 2; grid-row: 2; min-width: 0; margin: 0; }
  .hm-full #hm-full-message { grid-column: 1/-1; }
}
