/* Shared mobile presentation: website and native preview use the same rules. */
@media (max-width: 600px), (max-height: 500px) and (hover: none) and (pointer: coarse) {
  :root { --pitmap-touch-target: 44px; --pitmap-control-radius: 12px; }
  /* Prevent WebKit rotation from retaining an inflated shop paragraph size. */
  dialog.garage-shop { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
  /* Keep each sheet’s scroll gesture inside it, rather than refreshing its parent. */
  dialog[open], .garage-shop .gs-body, .garage-bolt-sheet .gb-content,
  .comm-dialog, .garage-dialog { overscroll-behavior-y: contain; }
  .comm-modal-head > button, .garage-dialog .garage-dialog-head > button,
  .garage-shop .gs-header-actions > button, .garage-bolt-sheet .gb-head > button {
    min-width: var(--pitmap-touch-target); min-height: var(--pitmap-touch-target);
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: var(--pitmap-control-radius); flex-shrink: 0;
  }
  .comm-modal-head { align-items: center; gap: 12px; }
  .comm-modal-head h2 { font-size: 20px; line-height: 1.35; }
  .comm-modal-head > button { padding: 0; line-height: 1; }
  /* The dialog already supplies its horizontal inset; avoid nesting form padding. */
  .comm-dialog #commCommentForm { padding: 16px 0 0; }
  .comm-dialog #commCommentForm > button[type="submit"] { margin-top: 12px; min-height: 44px; }
  .garage-shop .gs-brand { flex-wrap: nowrap; margin: 0; }
  .garage-shop .gs-brand img { flex: 0 1 105px; min-width: 0; }
  .garage-shop .gs-brand .gs-shop-label { flex: none; font-size: 16px; white-space: nowrap; }
  .garage-shop .gs-brand .gs-coming:empty { display: none; }
  .garage-shop .gs-wallet > div { min-width: min-content; max-width: 100%; }
  .garage-shop .gs-wallet strong > .pitmap-bolt-amount {
    max-width: 100%;
    font-size: clamp(20px, 5.8vw, 28px); white-space: normal; gap: 6px;
  }
  /* Same single-row navigation pattern as the community tabs. */
  dialog.garage-shop nav[aria-label="상점 분류"] {
    display: flex; flex-wrap: nowrap; overflow-x: auto; gap: 6px;
    scrollbar-width: thin; overscroll-behavior-x: contain; padding-bottom: 3px;
  }
  dialog.garage-shop nav[aria-label="상점 분류"] button {
    flex: 0 0 auto; min-height: var(--pitmap-touch-target); min-width: 72px;
    padding: 10px 14px; font-size: 14px; line-height: 1.4; white-space: nowrap;
  }
  .garage-shop .gs-wallet button { border-radius: var(--pitmap-control-radius); }
}
@media (max-width: 360px) {
  .garage-shop .gs-brand { gap: 4px; }
  .garage-shop .gs-brand img { flex-basis: 80px; width: 80px; }
  .garage-shop .gs-brand .gs-shop-label { font-size: 14px; }
  .garage-shop .gs-wallet { flex-wrap: wrap; }
  .garage-shop .gs-wallet strong > .pitmap-bolt-amount { font-size: 18px; }
  .garage-shop .gs-wallet .pitmap-bolt-icon { width: 1.5em; height: 1.5em; }
}

/* Role-scoped controls; keep photo dots, legal links and motion toggles compact. */
.comm-dialog > form:not(.pm-search-form):not([role="search"]) { padding: 0; }
.comm-dialog .member-requests > form { padding: 16px 0 0; }
.member-request-actions { flex-wrap: wrap; gap: 12px; }
.member-request-actions > button { min-height: 44px; padding: 10px 14px; border: 1px solid var(--line,#344958); border-radius: 10px; background: var(--surface,#131e26); color: var(--text,#edf4fa); }
.comm-dialog form > button[type="submit"], .comm-dialog form > .comm-submit { margin-top: 12px; min-height: 44px; }
.comm-primary, .community .comm-primary { min-height: 44px; }
.compact-map-zoom button { width: 44px; height: 44px; }
.chips > .chip, .comm-filters > button, .comm-more,
.comm-post > footer > button, .comm-comment-actions > button { min-height: 44px; min-width: 44px; }
.chips > .chip, .comm-filters > button { flex: 0 0 auto; }
.comm-post > footer, .comm-comment-actions { gap: 12px; }
.comm-modal-head > button, .garage-dialog-head > button,
.gk-head > button[data-close], .pr-head > button[data-close], .comm-photo-close {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 44px; min-height: 44px; flex-shrink: 0;
  font-family: system-ui, sans-serif; line-height: 1;
}
.comm-modal-head h2 { min-width: 0; overflow-wrap: anywhere; }
.comm-dialog button:focus-visible, .garage-dialog button:focus-visible,
.garage-keyring button:focus-visible, .pr-dialog button:focus-visible {
  outline: 3px solid #74b2ff; outline-offset: 2px;
}

.member-request-actions > button[aria-selected="true"] { border-color: #79a9d9; background: var(--bg,#0c1217); box-shadow: inset 0 0 0 1px #79a9d9; }
.comm-dialog .comm-file-label { position: relative; }
.comm-dialog .comm-file-label input[type="file"] { position: absolute; width: 1px; height: 1px; padding: 0; margin: 0; border: 0; clip-path: inset(50%); overflow: hidden; white-space: nowrap; }
.comm-dialog .comm-file-label:focus-within { outline: 3px solid #74b2ff; outline-offset: 2px; }
.comm-file-count:empty { display: none; }
/* Grid gaps replace child label margins; avoid doubled spacing when stacked. */
.comm-dialog .comm-form-row { margin: 14px 0; row-gap: 14px; }
.comm-dialog .comm-form-row > label { margin: 0; }
.comm-dialog .comm-file-label { color: var(--text,#edf4fa); }
.comm-dialog .comm-file-label > small { color: var(--muted,#a4b7c8); }
.comm-dialog .comm-upload-preview:empty, .comm-dialog .comm-video-preview:empty { display: none; }
/* Independent actions found in the place/club/room source-rendered samples. */
.place-share-actions > button { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }
.comm-club-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.comm-club-controls > button { min-height: 44px; padding: 10px 12px; }
.pr-dialog button, .pr-list-group button { min-height: 44px; }
.tune-studio-head > button { min-height: 44px; min-width: 44px; display: inline-flex; align-items: center; justify-content: center; line-height: 1; font-family: system-ui,sans-serif; }
.community[data-mode] > .comm-heading > .comm-primary { min-height: 44px; }
.place-detail-heading .place-share-actions > button { min-height: 44px; }
.place-detail-heading .place-share-actions { gap: 8px; }
.pitmap-guide-dialog .guide-links > a, .pitmap-guide-dialog .guide-links > button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; }
.pitmap-guide-dialog .guide-heading > button { min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; line-height: 1; }
.gv-help > button { min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; line-height: 1; }
