@media (max-width: 1120px) {
  .app-header { grid-template-columns: auto 1fr auto; }
  .document-switcher { justify-self: center; }
  .workspace { grid-template-columns: minmax(390px, 48%) 1fr; }
  .document-page { min-height: 927px; padding: 39px 42px; width: 655px; }
  .profile-name { min-height: 57px !important; }
  .draft-primary-row { align-items: flex-start; grid-template-columns: 1fr; }
  .draft-action-group { justify-content: flex-start; }
  .draft-normal-actions,
  .draft-sample-actions { justify-content: flex-start; }
}

@media (max-width: 820px), (max-width: 900px) and (max-height: 500px) {
  body { overflow: hidden; }
  .app-header { height: 62px; padding: 0 14px; }
  .brand small, .desktop-only { display: none; }
  .brand-mark { border-radius: 9px; height: 34px; width: 34px; }
  .document-switcher { display: none; }
  html[lang="ja"] .app-header {
    grid-template-areas:
      "brand actions"
      "documents documents";
    grid-template-columns: auto 1fr;
    grid-template-rows: 62px 52px;
    height: 120px;
    padding: 0 14px 5px;
  }
  html[lang="ja"] .brand { grid-area: brand; }
  html[lang="ja"] .header-actions { grid-area: actions; }
  html[lang="ja"] .document-switcher {
    align-self: start;
    display: grid;
    grid-area: documents;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    justify-self: stretch;
    width: 100%;
  }
  html[lang="ja"] .document-tab {
    min-height: 44px;
    min-width: 0;
    padding: 0 13px;
    white-space: nowrap;
  }
  .data-menu-label { display: none; }
  .data-menu-short-label { display: inline; }
  .primary-button { padding: 0 11px; }
  .print-label { display: none; }
  .print-short-label { display: inline; }
  .export-menu summary { height: 44px; min-width: 44px; width: 44px; }
  .export-actions > .primary-button { min-height: 44px; }
  .mobile-view-switch { background: #fff; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 1fr 1fr; height: 44px; padding: 5px 14px; }
  .mobile-view-switch button { background: none; border: 0; border-bottom: 2px solid transparent; color: var(--muted); font-size: 12px; font-weight: 700; }
  .mobile-view-switch button.is-active { border-color: var(--blue); color: var(--blue); }
  .workspace { display: block; height: calc(100vh - 106px - var(--app-notice-height)); }
  .english-workspace,
  .zh-workspace {
    height: calc(100vh - 62px - var(--app-notice-height));
    height: calc(100dvh - 62px - var(--app-notice-height));
  }
  #japaneseWorkspace {
    height: calc(100vh - 164px - var(--app-notice-height));
    height: calc(100dvh - 164px - var(--app-notice-height));
  }
  .workspace[data-mobile-mode="editor"] .preview-panel { display: none; }
  .workspace[data-mobile-mode="preview"] .editor-panel { display: none; }
  .editor-panel { border: 0; height: 100%; padding: 26px 18px 48px; }
  .preview-panel { height: 100%; }
  .preview-toolbar { position: relative; }
  .page-break-menu { align-items: center; display: inline-flex; min-height: 44px; }
  .page-break-panel-toggle { min-height: 44px; }
  .preview-toolbar { gap: 6px; justify-content: flex-end; padding: 0 10px; }
  .preview-toolbar > div:first-child { display: none; }
  .preview-panel > .page-break-panel { margin: 0; max-height: calc(100% - 57px); position: absolute; right: 8px; top: 48px; width: min(330px, calc(100% - 16px)); }
  .page-break-overlay { display: block; z-index: 9; }
  .page-break-boundary { border-radius: 10px; height: 44px; left: var(--page-break-marker-left); top: -22px; width: 44px; }
  .page-break-sign { height: 22px; width: 22px; }
  .page-break-visual-boundary.is-marker-crowded .page-break-sign, .page-break-visual-boundary.is-viewport-clamped .page-break-sign { height: 22px; width: 22px; }
  .page-break-visual-boundary.is-marker-crowded .page-break-sign svg, .page-break-visual-boundary.is-viewport-clamped .page-break-sign svg { height: 13px; width: 13px; }
  .page-break-passive-marker { left: calc(var(--page-break-marker-left) + 13px); top: -9px; }
  .page-break-visual-boundary.is-marker-crowded .page-break-passive-marker, .page-break-visual-boundary.is-viewport-clamped .page-break-passive-marker { font-size: 16px; height: 18px; left: calc(var(--page-break-marker-left) + 13px); top: -9px; width: 18px; }
  .preview-scroll { padding: 20px 14px 50px; }
  .document-preview { transform-origin: top left; }
  .document-preview { padding-right: 0; }
  .document-page { min-height: 842px; padding: 34px 37px; width: 595px; }
  .action-menu-panel .secondary-button,
  .action-menu-panel .danger-button { min-height: 44px; }
  .app-notice { font-size: 11px; padding: 9px 14px; }
  .remove-career-button,
  .remove-career-detail-button,
  .career-detail-add-button { min-height: 44px; }
}

@media (max-width: 360px) {
  .app-header,
  html[lang="ja"] .app-header { padding-left: 8px; padding-right: 8px; }
  .brand { gap: 4px; }
  .header-actions { gap: 4px; }
  .locale-picker select { padding-left: 3px; padding-right: 3px; }
  .export-actions > .primary-button { min-width: 44px; padding: 0 8px; }
  .export-actions > .primary-button svg { display: none; }
}

@media (min-width: 521px) and (max-width: 820px),
  (min-width: 521px) and (max-width: 900px) and (max-height: 500px) {
  .repeating-row {
    align-items: start;
    grid-template-columns: minmax(160px, .7fr) minmax(0, 1fr) 44px;
  }
  .remove-row-button {
    align-self: end;
    height: 44px;
    margin-bottom: 0;
    width: 44px;
  }
}

@media (max-width: 520px) {
  .brand strong { font-size: 12px; }
  .locale-picker select { font-size: 11px; }
  .data-menu summary { padding: 0; width: 38px; }
  .data-menu-short-label,
  .data-menu-chevron { display: none; }
  .data-menu-icon { display: block; }
  .primary-button { font-size: 10px; min-height: 34px; }
  .app-notice { gap: 8px; padding-left: 12px; padding-right: 12px; }
  .app-notice-dismiss { min-height: 36px; }
  .editor-heading { align-items: start; }
  .editor-heading h1 { font-size: 24px; }
  .section-content { padding-left: 0; }
  .photo-and-name { grid-template-columns: 82px 1fr; }
  .photo-thumbnail { height: 103px; width: 78px; }
  .two-columns, .three-columns, .postal-grid { grid-template-columns: 1fr; }
  .repeating-row {
    align-items: start;
    grid-template-columns: minmax(0, 1fr) 44px;
  }
  .repeating-row > .compact-field:not(.credential-link-field) { grid-column: 1; }
  .remove-row-button {
    align-self: end;
    grid-column: 2;
    grid-row: 2;
    height: 44px;
    margin-bottom: 0;
    width: 44px;
  }
  .repeating-row.has-credential-link .remove-row-button { grid-column: 2; grid-row: 2; }
  .repeating-row.has-credential-link .credential-link-field { grid-column: 1; grid-row: 3; }
  .editor-footer { gap: 20px; }
  .editor-footer-actions { align-items: flex-start; }
  .editor-legal { padding-bottom: 62px; }
  .draft-controls { gap: 0; padding: 8px; }
  .draft-primary-row { align-items: center; gap: 4px; grid-template-columns: minmax(0, 1fr) auto; }
  .draft-controls.is-sample-mode .draft-primary-row,
  .draft-controls.is-error .draft-primary-row { align-items: flex-start; grid-template-columns: 1fr; }
  .draft-normal-actions { justify-content: flex-end; }
  .draft-sample-actions { justify-content: flex-start; }
  .draft-controls .secondary-button { min-height: 44px; }
  .draft-normal-actions .secondary-button {
    background: transparent;
    border-color: transparent;
    color: var(--blue);
    padding: 0 8px;
  }
  .draft-sample-actions .primary-button { min-height: 44px; }
  .draft-message { font-size: 9px; gap: 5px; overflow: hidden; white-space: nowrap; }
  .draft-controls.is-sample-mode .draft-message,
  .draft-controls.is-error .draft-message { overflow: visible; white-space: normal; }
  .trust-capsule {
    bottom: calc(9px + env(safe-area-inset-bottom));
    right: calc(9px + env(safe-area-inset-right));
  }
  .trust-source-link { width: 38px; }
  .trust-source-link,
  .trust-privacy-button { min-height: 38px; }
  .trust-privacy-button { gap: 5px; padding: 0 9px 0 8px; }
  .trust-privacy-button #privacySecurityBadgeLabel { display: none; }
  .privacy-security-content { max-height: calc(100vh - 20px); max-width: calc(100vw - 20px); padding: 20px; }
  .privacy-security-heading { gap: 11px; }
  .privacy-security-heading h2 { font-size: 17px; }
  .privacy-security-icon { height: 36px; width: 36px; }
}
