.mobile-tools,
.mobile-filter-toggle,
.preview-label .mobile-scene-name,
.mobile-group-title,
.mobile-samples {
  display: none;
}

@media (max-width: 739px) {
  .mast {
    height: 54px;
    padding-inline: 12px;
  }

  .wrap {
    width: calc(100% - 16px);
  }

  .intro {
    margin-bottom: 12px;
    padding: 14px 4px 12px;
  }

  .intro h1 {
    margin-bottom: 5px;
    font-size: clamp(22px, 6vw, 34px);
  }

  .intro p {
    font-size: 13px;
    line-height: 1.4;
  }

  .intro .mobile-break {
    display: none;
  }

  .workspace {
    --rail-width: clamp(48px, 14vw, 68px);
    grid-template-columns: var(--rail-width) minmax(0, 1fr) var(--rail-width);
    gap: 8px 5px;
  }

  .workspace > .templates {
    position: relative;
    grid-area: 1 / 1;
    align-self: stretch;
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--paper);
  }

  .templates .section-head {
    justify-content: center;
    margin: 5px 0 1px;
  }

  .templates .section-head h2 {
    font-size: 11px;
    white-space: nowrap;
  }

  .templates .section-head span {
    display: none;
  }

  .mobile-filter-toggle {
    display: block;
    min-height: 34px;
    width: 100%;
    border: 0;
    background: transparent;
    color: var(--red);
    font-size: 12px;
  }

  .templates .gallery-filter {
    position: absolute;
    z-index: 4;
    display: none;
    top: 48px;
    left: -1px;
    width: min(224px, calc(100vw - 16px));
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--paper);
    box-shadow: 0 4px 14px #52392238;
  }

  .mobile-filter-toggle[aria-expanded="true"] + .gallery-filter {
    display: flex;
  }

  .templates .gallery-filter button {
    min-height: 36px;
  }

  .templates .template-list {
    position: absolute;
    inset: 55px 1px 2px;
    grid-template-columns: minmax(0, 1fr);
    grid-auto-rows: max-content;
    gap: 5px;
    max-height: none;
    padding: 2px;
    overflow: auto;
    overscroll-behavior-y: contain;
    touch-action: pan-y;
  }

  .templates .template {
    display: block;
    min-height: 44px;
    width: 100%;
    padding: 2px;
    border-radius: 5px;
  }

  .templates .template span {
    position: absolute;
    width: 1px;
    height: 1px;
    min-height: 0;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .workspace > .preview {
    grid-area: 1 / 2;
    display: flex;
    flex-direction: column;
    min-width: 0;
    border-radius: 8px;
  }

  .preview-head {
    padding: 4px;
  }

  .switch {
    width: 100%;
    max-width: 310px;
    justify-content: space-between;
    padding: 2px;
  }

  .switch button {
    flex: 1;
    min-height: 36px;
    padding: 3px 2px;
    white-space: nowrap;
    font-size: clamp(11px, 3.2vw, 14px);
  }

  .preview .stage {
    padding: 12px 10px;
  }

  .stage .canvas-frame,
  .stage .canvas-frame.landscape {
    width: 100%;
  }

  .preview .year-tools {
    order: 1;
    padding: 7px;
    border-top: 1px solid var(--line);
    font-size: 12px;
  }

  #year-scenes[open] .year-months {
    max-height: 150px;
    overflow: auto;
    overscroll-behavior-y: contain;
  }

  .preview .preview-foot {
    gap: 1px;
    min-height: 58px;
    padding: 3px 1px;
  }

  .preview-foot button {
    flex: 0 0 25px;
    min-height: 44px;
    padding: 0;
  }

  .preview-label {
    min-width: 0;
    font-size: 13px;
  }

  .preview-label #template-note {
    display: none;
  }

  .preview-label .mobile-scene-name {
    display: block;
    overflow-wrap: anywhere;
  }

  #month-selection {
    flex-wrap: wrap;
    gap: 1px 5px;
    margin-top: 4px;
    font-size: 11px;
  }

  #selected-count {
    font-size: 11px;
    white-space: nowrap;
  }

  .mobile-tools {
    display: grid;
    grid-area: 1 / 3;
    gap: 5px;
  }

  .mobile-tools button {
    display: grid;
    align-content: center;
    justify-items: center;
    gap: 2px;
    min-height: 48px;
    padding: 3px 1px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: var(--paper);
    color: #6b3d31;
    font-size: 12px;
  }

  .mobile-tools button[aria-expanded="true"] {
    border-color: #832c29;
    background: #832c29;
    color: #fff7eb;
  }

  .mobile-tools button span {
    font: bold 18px/1 Georgia, serif;
  }

  .workspace > .settings {
    grid-area: 2 / 1 / auto / -1;
    min-width: 0;
  }

  .settings > .section-head,
  .settings .workbench-divider,
  .settings .workbench-group {
    display: none;
  }

  .workspace[data-mobile-panel="photo"] #workbench-photo,
  .workspace[data-mobile-panel="copy"] #workbench-copy,
  .workspace[data-mobile-panel="date"] #workbench-date,
  .workspace[data-mobile-panel="export"] #workbench-export {
    display: block;
  }

  .mobile-group-title {
    display: block;
    margin: 0 0 8px;
    font-size: 14px;
  }

  .settings .panel {
    padding: 10px;
  }

  .settings .upload-choices .drop {
    min-height: 68px;
  }

  .settings .examples button,
  .settings .files button,
  .settings .download,
  .settings .batch {
    min-height: 42px;
  }

  .settings .mobile-samples {
    display: block;
  }

  .settings .date-fields {
    margin: 0;
  }

  .settings select,
  .settings input[type="number"],
  .year-months select {
    font-size: 16px;
  }

  .pet-frame button,
  #copy-frame button {
    width: 30px;
    height: 30px;
  }

  .about {
    margin-top: 14px;
    padding-block: 12px;
  }
}
