/* Shared interaction rules load after page styles. No additional network polling. */
html.has-modal,html.has-modal body{overflow:hidden;overscroll-behavior:none}
dialog{max-height:calc(100dvh - 40px);overflow-y:auto;overscroll-behavior:contain;box-sizing:border-box}
.interaction-dialog-heading{display:flex;align-items:center;justify-content:space-between;gap:12px}
.interaction-dialog-heading>h3{margin:0;min-width:0;overflow-wrap:anywhere}
.interaction-dialog-heading>.icon-button{flex:none;min-width:44px;min-height:44px}
.context-back{display:inline-flex;align-items:center;gap:6px;min-height:44px;font-size:13px;color:var(--muted)}
.context-back>svg{width:16px;height:16px}
.submit-feedback{display:flex;align-items:center;gap:8px;font-size:12px;line-height:1.6;color:var(--muted);grid-column:1/-1}
form[aria-busy=true] [aria-disabled=true]{opacity:.65;cursor:wait}
.action-label-small{display:none}
.topic-like-action,.topic-like-action>form{display:flex;align-items:center;min-width:0;margin:0}
@media(min-width:761px){
  /* Keep one set of actions: expanded on desktop, a menu on small screens. */
  .thread-page [data-responsive-actions]{display:block;flex:0 1 auto;width:auto;min-width:0}
  .thread-page [data-responsive-actions]>.post-more-menu{display:flex;align-items:center;flex-wrap:wrap;gap:8px;padding:0;margin:0;border:0;background:transparent}
  .thread-page [data-responsive-actions]>summary{display:none}
  .thread-page .topic-actions>.collection-picker{order:3}
  .thread-page .topic-actions>.topic-save-login{order:3}
  .thread-page .topic-actions>.topic-share-action{order:1}
  .thread-page .topic-actions>.reply-jump{order:4}
  .thread-page .topic-actions>[data-responsive-actions]{order:2;margin:0}
  .thread-page .topic-actions>.collection-picker>.collection-popover{left:auto;right:0;box-sizing:border-box}
  .thread-page .topic-actions .reply-jump{margin-left:0}
  .thread-page .topic-actions .post-more-menu>.icon-button,.thread-page .reply-tools .post-more-menu .icon-button{min-height:36px;padding:7px 10px;font-size:12px}
  .thread-page .topic-actions button[data-report-topic]{border:1px solid var(--line);background:var(--surface);color:var(--text)}
  .thread-page .reply-tools .post-more-menu>form{display:flex;align-items:center;gap:3px}
}
@media(max-width:760px){
  /* Keep editable text at 16px to avoid focus zoom on iOS. */
  body input:not([type=checkbox]):not([type=radio]):not([type=hidden]):not([type=button]):not([type=submit]):not([type=reset]):not([type=range]):not([type=color]):not([type=file]),body select,body textarea{font-size:16px;min-height:44px;scroll-margin-block:90px}
  button,a,summary{touch-action:manipulation}
  dialog:modal{position:fixed;inset-block-start:calc(var(--interaction-top,0px) + 12px);inset-block-end:auto;margin-block:0;max-height:calc(var(--interaction-height,100dvh) - 24px);max-width:calc(100vw - 24px);padding:16px;scroll-padding-block:16px}
  dialog .form-actions,dialog .dm-dialog-actions{display:flex;flex-wrap:wrap;gap:8px}
  dialog .form-actions>.button,dialog .dm-dialog-actions>.button{flex:1 1 auto;min-height:44px;white-space:normal;justify-content:center}
  dialog header>.icon-button,dialog .dialog-heading>.icon-button{min-width:44px;min-height:44px}
  html.has-modal .mobile-bottom-nav,html.has-keyboard .mobile-bottom-nav{visibility:hidden;pointer-events:none}
  html.has-keyboard .config-save-bar{position:static}
  html.has-keyboard .toast{bottom:12px}
  .account-nav a,.account-nav-more>summary{min-height:44px}
  .shop-nav{gap:8px;flex-wrap:wrap}
  .shop-nav a{min-height:44px;display:inline-flex;align-items:center}
  .thread-page .topic-actions{flex-wrap:nowrap;gap:2px;position:relative;padding:6px 0}
  .thread-page .topic-actions>.collection-picker,.thread-page .topic-actions>.topic-save-login,.thread-page .topic-actions>.topic-like-action,.thread-page .topic-actions>.topic-share-action,.thread-page .topic-actions>.post-more{flex:1 1 0;width:0;min-width:0;margin:0}
  .thread-page .topic-actions .action-label-wide{display:none}
  .thread-page .topic-actions .action-label-small{display:inline}
  .thread-page .topic-actions>.post-more>summary,.thread-page .topic-actions>.collection-picker>summary,.thread-page .topic-actions>.topic-save-login,.thread-page .topic-actions>.topic-share-action,.thread-page .topic-actions .topic-like-action .button{display:flex;align-items:center;justify-content:center;gap:4px;width:100%;min-width:0;min-height:44px;height:auto;padding:6px 2px;border-color:transparent;background:transparent;box-shadow:none;font-size:12px;line-height:1.5;white-space:nowrap}
  .thread-page .topic-actions .topic-like-action>form{width:100%}
  .thread-page .topic-actions .topic-like-action .button{flex-wrap:wrap;column-gap:3px;row-gap:0}
  .thread-page .topic-actions .topic-like-action .like-price{font-size:9px;line-height:12px}
  .thread-page .topic-actions .topic-like-action .button>span{overflow-wrap:anywhere;white-space:normal}
  .thread-page .topic-actions .button.pressed,.thread-page .topic-actions>.collection-picker[open]>summary,.thread-page .topic-actions>.post-more[open]>summary{color:var(--accent);background:var(--accent-soft)}
  .thread-page .topic-actions>details>.collection-popover{max-width:calc(100vw - 64px);width:270px;box-sizing:border-box;left:0;padding:14px}
  .thread-page .topic-actions .collection-chevron{display:none}
  .thread-page .topic-actions svg,.thread-page .reply-tools svg{width:14px;height:14px;flex:none}
  .thread-page .topic-actions .like-price svg{width:10px;height:10px}
  .thread-page .post-more[open]{flex-basis:auto;width:auto}
  .thread-page .post-more{position:relative}
  .thread-page .post-more>.post-more-menu{position:absolute;right:0;bottom:calc(100% + 6px);z-index:20;width:280px;max-width:calc(100vw - 64px);max-height:min(60dvh,360px);overflow-y:auto;overscroll-behavior:contain;box-sizing:border-box;margin:0;padding:8px;gap:4px;background:var(--surface);box-shadow:0 8px 24px #00000018}
  .thread-page .post-more-menu>.button,.thread-page .post-more-menu>.icon-button,.thread-page .post-more-menu>form{flex:1 1 calc(50% - 4px);min-width:0;justify-content:flex-start}
  .thread-page .post-more-menu>form{display:flex;flex-wrap:wrap;gap:4px}
  .thread-page .post-more-menu>form>.button,.thread-page .post-more-menu>form>.icon-button{width:100%;justify-content:flex-start}
  .thread-page .reply-tools{gap:6px;padding:4px 0;min-height:44px}
  .thread-page .reply-tools>.content-like-form>.button,.thread-page .reply-tools>.icon-button,.thread-page .reply-tools>.post-more>summary{min-height:44px;height:auto;padding:6px 8px;font-size:12px;gap:5px;border-color:transparent;background:transparent;box-shadow:none}
  .thread-page .reply-tools>.post-more{margin-left:auto}
  .thread-page .reply-tools>.post-more[open]>summary{color:var(--accent);background:var(--accent-soft)}
}
