.mobile-section-name, .mobile-cell-label, .mobile-standalone, #preview-zoom { display: none; }

@media screen and (max-width: 760px) {
  body[data-screen="kajian"] main, .mast-inner, .shell { width: calc(100% - 24px); }
  .mast-inner { min-height: 56px; flex-wrap: nowrap; gap: 8px; }
  .mast-inner > .standalone { display: none; }
  .mast-inner .app-brand { gap: 7px; }
  .cloud-controls { flex: 1 1 auto; gap: 4px 8px; }
  #cloud-status { order: 0; flex-basis: auto; max-width: 19ch; }
  #cloud-copy { flex-shrink: 1; }
  .cloud-account { flex-shrink: 0; }
  #cloud-login, .cloud-account summary, #new-project { min-height: 42px; }
  #cloud-login { padding-inline: 10px; }

  .overview { padding: 14px 0 10px; gap: 8px; }
  .overview h1 { font-size: 1.25rem; }
  .project-controls { width: 100%; grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .project-controls .button-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; }
  body[data-screen="kajian"] #save-status { grid-column: 1; text-align: start; }

  .workspace { display: block; border: 0; background: none; }
  .sidebar {
    position: sticky;
    top: 0;
    z-index: 3;
    max-height: 62dvh;
    margin-bottom: 8px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: #fff;
    box-shadow: 0 2px 6px #19283d0d;
  }

  .section-nav-toggle {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 9px;
    min-height: 46px;
    padding: 8px 12px;
    list-style: none;
  }

  .section-nav-toggle::-webkit-details-marker { display: none; }
  .section-nav-toggle::after {
    content: "";
    width: 6px;
    height: 6px;
    border: solid currentColor;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
  }

  #section-navigation[open] .section-nav-toggle { border-bottom: 1px solid var(--line); }
  #section-navigation[open] .section-nav-toggle::after { transform: rotate(225deg); }
  .mobile-section-name {
    display: block;
    justify-self: end;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--muted);
    font-size: .8125rem;
    font-weight: 500;
  }

  .side-head { padding: 6px 10px 3px; }
  .side-head p { padding: 0; }
  #outline { grid-template-columns: minmax(0, 1fr); padding-inline: 6px; }
  .outline-entry { min-height: 42px; grid-template-columns: 24px minmax(0, 1fr); align-items: center; }
  .side-actions { margin: 6px 7px 7px; align-items: center; }
  .mobile-standalone { display: inline-block; padding: 6px 8px; font-size: .875rem; text-decoration: none; color: #234d92; }

  .surface { border: 1px solid var(--line); border-radius: 9px; min-height: 0; }
  .surface-head { display: grid; grid-template-columns: minmax(0, 1fr); align-items: stretch; gap: 10px; }
  .surface-head > .button-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .surface-head button { min-height: 42px; }
  .editor { padding: 14px 13px 18px; }
  .editor :is(.form-grid, .matrix, .auto-checklist, fieldset, label, .block-head) { min-width: 0; }
  .form-grid { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .block-head { align-items: flex-start; flex-wrap: wrap; gap: 5px; }
  .nested-block { margin-inline-start: 4px; }
  .editor details[id] { scroll-margin-top: 54px; }
  .editor a, .inspection-reference, .photo-feedback { overflow-wrap: anywhere; }
  :is(.editor, .identity, .checklist) input:not([type="checkbox"], [type="radio"], [type="range"]),
  :is(.editor, .identity, .checklist) select,
  :is(.editor, .identity, .checklist) textarea,
  .text-format-surface { font-size: 1rem; }

  .team-matrix table, .team-matrix thead, .team-matrix tbody { display: block; }
  .team-matrix tr { display: grid; gap: 6px; padding: 10px; }
  .team-matrix thead { margin-block-end: 8px; background: var(--panel); border-radius: 6px; }
  .team-matrix tbody tr { margin-block-end: 8px; border: 1px solid var(--line); border-radius: 6px; }
  .team-matrix tbody tr::before { content: attr(aria-label); font-size: .875rem; font-weight: 700; }
  .team-matrix :is(th, td) { padding: 0; min-width: 0; }
  .team-matrix thead th:last-child { display: none; }
  .team-matrix td:last-child { justify-self: start; }

  .text-format-toolbar { gap: 4px; padding: 5px 6px; }
  .text-format-toolbar select { max-width: 100%; font-size: .875rem; }
  .text-format-toolbar button, .text-format-toolbar select { min-height: 36px; }
  .text-format-surface { padding: 9px; }
  .checklist-frame { display: block; width: 100%; height: 75dvh; min-height: 360px; }

  .auto-checklist .editor-table { display: block; min-width: 0; }
  .editor-table thead { position: absolute; clip-path: inset(50%); width: 1px; height: 1px; overflow: hidden; }
  .editor-table tbody { display: grid; gap: 8px; }
  .editor-table tr { display: block; border: 1px solid var(--line); border-radius: 7px; }
  .auto-checklist .editor-table td {
    display: grid;
    grid-template-columns: minmax(85px, 32%) minmax(0, 1fr);
    gap: 8px;
    border: 0;
    border-top: 1px solid var(--line);
    padding: 8px;
    font-size: .875rem;
    overflow-wrap: anywhere;
  }

  .editor-table td:first-child {
    display: block;
    border-top: 0;
    border-radius: 6px 6px 0 0;
    background: var(--panel);
    font-weight: 660;
  }

  .editor-table .mobile-cell-label { display: block; gap: 0; color: var(--muted); font-weight: 620; }
  .editor-table td:first-child .mobile-cell-label { display: none; }

  .top-inner { gap: 8px; min-height: 54px; }
  .top-inner > nav { display: flex; gap: 8px; }
  .top-inner > nav a:not(#project-editor) { display: none; }
  .hero { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .progress-card { margin: 0; }
  .identity, .sample { border-radius: 9px; }
  .identity-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .check-head .actions { display: grid; width: 100%; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 6px; }
  .check-head .actions button { min-height: 42px; }
  #export { grid-column: 1 / -1; justify-self: start; }
  .filters { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
  .filters label:first-child { grid-column: 1 / -1; }
  .category-nav { gap: 4px; }
  .category-nav a { padding: 4px 8px; border: 1px solid var(--line); border-radius: 6px; }
  .item-status { float: none; display: inline-block; white-space: nowrap; }
  .embedded-checklist .shell { width: calc(100% - 14px); }

  #preview-dialog[open], #simak-print-dialog[open] {
    position: fixed;
    inset: 0;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    width: 100%;
    max-width: none;
    height: 100dvh;
    max-height: none;
    margin: 0;
    border: 0;
    border-radius: 0;
    overflow: hidden;
  }

  .preview-controls { display: grid; gap: 5px; padding: 8px 12px; }
  .preview-controls .button-row { gap: 5px; }
  .preview-controls button, .simak-preview-actions button { min-height: 40px; }
  #preview-zoom { display: inline-block; }
  #report, #simak-paper { min-width: 0; min-height: 0; overflow: auto; padding: 8px; }
  #report .pagedjs_pages { width: max-content; min-width: 0; padding: 0; margin-inline: auto; zoom: var(--preview-page-zoom, 1); }
  #report .pagedjs_page { margin-block-end: 14px; }
  #simak-paper .simak-form { min-width: 580px; }
}
