/* Shared responsive layer. Desktop branding and board structure remain intact. */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
.view-mode-controls { text-align:center; padding:16px; }
.view-mode-controls a { color:var(--color-text-muted,#6b7076); font-size:12px; text-decoration:none; }
.view-mode-controls a:hover { text-decoration:underline; }
.mobile-account-toggle { display:none; }
.quick-tool-items { display:grid; gap:6px; }
.quick-tools h3 .mobile-tools-toggle { border:0; padding:0; background:transparent; color:inherit; font:inherit; cursor:default; width:100%; }
html[data-site-view=desktop] body { min-width:1200px; }
html:not([data-mobile-layout]) .mobile-tools-toggle { pointer-events:none; }
html[data-site-view=mobile] body { max-width:480px; margin-inline:auto; }

html[data-mobile-layout] {
  body { min-width:0; }
  body.provery-theme { font-size:14px; }
  .provery-theme :is(input:not([type=checkbox]):not([type=radio]),textarea,select) { font-size:16px !important; }
  .provery-theme :is(input,select,textarea,button,a) { -webkit-tap-highlight-color:rgba(32,84,204,.12); }
  .theme-community :is(.community-header,.portal-nav,.page-wrap,.site-footer) { margin-left:max(16px,env(safe-area-inset-left)); margin-right:max(16px,env(safe-area-inset-right)); max-width:none; }
  .theme-community .community-header { display:flex; flex-wrap:wrap; padding:max(20px,env(safe-area-inset-top)) 0 16px; gap:18px; }
  .theme-community .community-wordmark strong { font-size:42px; }
  .theme-community .community-wordmark .wordmark-description { font-size:12px; }
  .theme-community .header-search { position:static; transform:none; flex:0 0 100%; width:100%; margin:0; padding:0; }
  .theme-community .header-search-row { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:4px; }
  .theme-community .header-search :is(.hero-search-input,.hero-search-btn) { height:46px; }
  .theme-community .header-search .hero-search-input { padding:10px; }
  .theme-community .hero-search-btn { min-width:48px; padding:0 10px; }
  .theme-community .header-search-options summary { min-height:44px; font-size:11px; padding:0 5px; }
  .theme-community .header-search-options .search-options { width:calc(100vw - 32px); max-width:calc(100vw - 32px); gap:8px; }
  .theme-community .search-options select { width:100%; min-height:44px; }
  .theme-community .portal-nav { padding:0; min-height:48px; margin-bottom:14px; overflow:hidden; }
  .theme-community .portal-nav .menu-list { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:0; border:0; padding:0; width:100%; }
  .theme-community .portal-nav .menu-btn { min-height:48px; padding:10px 2px; font-size:12px; letter-spacing:-.5px; }
  .theme-community .page-wrap { display:flex; flex-direction:column; gap:20px; }
  .theme-community .sidebar { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:10px; padding:0; width:100%; border:0; }
  .theme-community .portal-login { padding:0; border:0; background:transparent; min-width:0; }
  .theme-community .portal-login :is(h2,p,.password-help) { display:none; }
  .theme-community .portal-login .topbar { margin:0; display:block; }
  .theme-community .auth-area { display:flex; gap:6px; flex-wrap:wrap; align-items:center; }
  .theme-community .auth-btn { min-height:44px; padding:9px 12px; font-size:13px; }
  .theme-community .sidebar-write { display:block; align-self:start; margin:0; min-height:44px; padding:10px 15px; font-size:13px; width:auto; }
  .theme-community .portal-login.is-member { position:relative; grid-column:1 / -1; padding:12px; border:1px solid var(--color-border); border-radius:8px; }
  .theme-community .portal-login.is-member .mobile-account-toggle { display:block; position:absolute; top:10px; right:10px; min-height:40px; padding:6px 12px; font:inherit; font-size:12px; background:var(--color-surface-subtle); border:1px solid var(--color-border); border-radius:5px; color:var(--color-text-secondary); }
  .theme-community .portal-login.is-member:not(.is-expanded) :is(.member-activity-links,.account-actions,.member-joined,.member-verification-status) { display:none; }
  .theme-community .portal-login.is-member .member-identity { padding-right:76px; border:0; }
  .theme-community .portal-login.is-member:not(.is-expanded) .member-grade-row { margin:0; padding-left:52px; justify-content:flex-start; }
  .theme-community .portal-login.is-member:not(.is-expanded) .member-grade-row > span { display:none; }
  .theme-community .portal-login.is-member + .sidebar-write { grid-column:1 / -1; width:100%; }
  .theme-community .member-identity { padding-bottom:8px; }
  .theme-community .member-grade-row { margin:8px 0 0; }
  .theme-community .member-joined { font-size:11px; }
  .theme-community .member-activity-links { display:flex; gap:16px; }
  .theme-community .member-activity-links button { min-height:40px; }
  .theme-community .account-actions { display:flex; flex-wrap:wrap; gap:4px 12px; }
  .theme-community .account-actions :is(button,a) { display:inline-flex; align-items:center; min-height:36px; font-size:12px; }
  .theme-community .quick-tools { grid-column:1 / -1; margin:0; padding:0; gap:0; border:1px solid var(--color-border); border-radius:7px; overflow:hidden; }
  .theme-community .quick-tools h3 { border:0; padding:0; margin:0; }
  .theme-community .quick-tools h3 .mobile-tools-toggle { padding:11px 13px; min-height:44px; cursor:pointer; display:flex; align-items:center; justify-content:space-between; font-size:13px; }
  .mobile-tools-toggle::after { content:'＋'; font-size:17px; font-weight:400; }
  .mobile-tools-toggle[aria-expanded=true]::after { content:'−'; }
  .quick-tools:not(.is-expanded) .quick-tool-items { display:none; }
  /* Before view-mode wraps the controls, keep the same collapsed geometry. */
  .quick-tools:not(:has(.quick-tool-items)) > button { display:none; }
  .quick-tools:not(:has(.quick-tool-items)) > h3 { min-height:44px; padding:11px 13px; box-sizing:border-box; }
  .quick-tools.is-expanded .quick-tool-items { grid-template-columns:1fr 1fr; padding:0 10px 10px; gap:7px; }
  .quick-tool-items button { min-height:44px; }
  .quick-tool-items .fx-tool-button { grid-column:1 / -1; }
  .theme-community .reading-post .post-board-nav { grid-column:1 / -1; width:100%; box-sizing:border-box; margin:0; padding:4px 0; }
  .theme-community .post-board-nav a { min-height:40px; box-sizing:border-box; display:flex; align-items:center; }
  .theme-community .main-area { padding:0; width:100%; min-width:0; }
  .theme-community .topic-board-grid { grid-template-columns:1fr; gap:18px; margin-bottom:28px; }
  .theme-community .topic-board-header { padding:14px 12px 10px; gap:8px; }
  .theme-community .topic-board-header h3 { font-size:16px; line-height:1.5; gap:8px; }
  .theme-community .topic-board-header .topic-heading p { margin:7px 0 0; font-size:12px; }
  .theme-community .topic-list-heading { font-size:11px; }
  .theme-community .topic-list-heading button { min-height:36px; }
  /* Reserve the six-row preview before its asynchronous content arrives. */
  .theme-community .topic-posts { min-height:288px !important; }
  .theme-community .topic-posts .topic-empty-row { display:none; }
  .theme-community .topic-posts .latest-item { min-height:48px; padding:11px 12px; align-items:center; gap:8px; }
  .theme-community .topic-posts .new-badge { display:none; }
  .theme-community .topic-posts .post-title-btn { font-size:14px; line-height:1.6; }
  .theme-community .topic-ask { min-height:46px; font-size:13px; }
  .theme-community .board-title { font-size:20px; }
  .theme-community .board-subtitle { font-size:12px; line-height:1.7; }
  .theme-community .board-header { align-items:center; gap:12px; }
  .theme-community .control-select { min-height:44px; height:auto; width:auto; max-width:100%; }
  .theme-community .board-filter { width:auto; }
  .theme-community .board-controls { flex-direction:row; }
  .theme-community .board-table .post-title-btn { font-size:15px; }
  .theme-community .board-table td { padding:14px 8px; }
  .theme-community .board-table :is(thead,colgroup) { display:none; }
  .theme-community .board-table tbody { display:block; }
  .theme-community .board-table tr { display:flex; flex-wrap:wrap; gap:0 12px; padding:12px 4px; border-bottom:1px solid var(--color-border-subtle); }
  .theme-community .board-table tr td { border:0; padding:0; }
  .theme-community .board-table td.title-cell { width:100%; padding:0 0 7px; }
  .theme-community .board-table tr td.post-author,.theme-community .board-table tr td.date { display:block; width:auto; font-size:11px; text-align:left; overflow-wrap:anywhere; }
  .theme-community .board-table tr td.date { margin-left:auto; }
  .theme-community .page-btn { min-width:40px; height:42px; }
  .theme-community .question-board-links .topic-hover-example { visibility:visible; font-size:12px; }
  .theme-community .question-board-links .topic-link-copy { grid-template-columns:1fr; }
  .theme-community .question-board-links a { padding:16px 10px; }
  .theme-community .write-panel.open { padding:16px 0; border:0; }
  .theme-community :is(.control-input,#postTitle,#postContent) { box-sizing:border-box; width:100%; }
  .theme-community .overview-fields { grid-template-columns:1fr 1fr; }
  .theme-community .overview-field { min-width:0; grid-column:span 1; }
  .theme-community .overview-field.overview-half,.theme-community .overview-field.overview-measure-floors { grid-column:1 / -1; }
  .theme-community #buildingOverviewFields input { height:44px; }
  .theme-community .post-media-composer { padding:12px; }
  .theme-community input[type=file] { max-width:100%; width:100%; font-size:13px !important; }
  .theme-community input::file-selector-button { min-height:40px; margin-right:8px; }
  .theme-community .write-actions :is(button,a),.theme-community .comment-actions button { min-height:46px; padding:10px 18px; }
  .theme-community .post-page .post-modal { border-radius:8px; }
  .theme-community .post-page .post-modal-head { padding:18px 14px; gap:10px; }
  .theme-community .post-page .post-modal-title { font-size:22px; line-height:1.5; }
  .theme-community .post-page .post-modal-body { padding:14px; }
  .theme-community .post-content { padding:12px 0; font-size:16px; line-height:1.85; }
  .theme-community .comment-item { gap:8px; padding:9px 0; }
  .theme-community .comment-avatar { width:28px; height:28px; flex-basis:28px; }
  .theme-community .comment-main { padding:12px; }
  .theme-community .comment-body { font-size:15px; line-height:1.8; }
  .theme-community .comment-tool-btn { min-height:36px; padding:4px 8px; }
  .theme-community .comment-input { min-height:130px; padding:12px; line-height:1.7; }
  .theme-community #commentMediaHelp { flex-basis:100%; font-size:12px; }
  .theme-community .comment-login-prompt { flex-wrap:wrap; }
  .theme-community :is(.post-back-button,.post-share-tools button,.mini-btn) { min-height:40px; }
  .theme-community .modal-overlay { padding:12px; box-sizing:border-box; }
  .theme-community :is(.auth-modal,.verification-modal,.site-guide-dialog) { box-sizing:border-box; max-height:calc(100vh - 24px); max-height:calc(100dvh - 24px); }
  .theme-community #authModalOverlay .auth-modal { max-height:calc(100dvh - 24px); }
  .theme-community #authModalOverlay .auth-modal-header { padding:18px 16px 12px; }
  .theme-community #authModalOverlay .auth-modal-body { padding:0 16px 20px; }
  .theme-community .site-guide-dialog { padding:18px 16px; width:calc(100% - 24px); }
  .theme-community :is(.auth-modal-close,.site-guide-header button,.quick-tool-dialog header button) { min-width:44px; min-height:44px; }
  .theme-community .verification-modal { padding:18px 16px; }
  .theme-community .verification-choices { grid-template-columns:1fr; }
  .theme-community .verification-choices strong { margin:4px 0; }
  .theme-community .member-type-choices { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .theme-community .member-type-choices span { min-height:48px; height:auto; padding:10px 6px; white-space:normal; }
  .theme-community .quick-tool-dialog { max-height:calc(100dvh - 24px); }
  .theme-community .tool-keypad button { min-height:48px; font-size:17px; }
  .theme-community .site-footer { padding:22px 0 max(20px,env(safe-area-inset-bottom)); }
  .theme-community .footer-links { display:flex; flex-wrap:wrap; gap:2px 14px; margin-bottom:6px; line-height:1.6; }
  .theme-community .footer-links a { display:inline-flex; align-items:center; min-height:26px; font-size:12px; }
  .theme-community .footer-links a::before { display:none; }
  .theme-community .post-success-toast { width:calc(100% - 40px); max-width:450px; box-sizing:border-box; top:max(12px,env(safe-area-inset-top)); }
  .legal-contact-box strong { font-size:18px; overflow-wrap:anywhere; }
  .legal-page .legal-nav a { display:inline-flex; align-items:center; min-height:40px; }
  .theme-admin header { flex-wrap:wrap; gap:10px; padding:14px 16px; height:auto; }
  .theme-admin header nav { display:flex; align-items:center; gap:12px; }
  .theme-admin #workspace { display:block; }
  .theme-admin #workspace > aside { box-sizing:border-box; width:100%; overflow:visible; display:flex; flex-wrap:wrap; gap:8px; padding:12px; }
  .theme-admin #workspace > aside :is(strong,p) { display:none; }
  .theme-admin #workspace > aside .admin-nav-section { width:100%; display:flex; flex-wrap:wrap; gap:5px; margin:0; padding-top:8px; border-top:1px solid #eeebf4; }
  .theme-admin #workspace > aside .admin-nav-section:first-of-type { border-top:0; padding-top:0; }
  .theme-admin #workspace > aside .admin-nav-section .nav-group { display:block; width:100%; margin:0 4px 2px; font-size:11px; }
  .theme-admin #workspace > aside .admin-nav-section button { white-space:normal; font-size:12px; padding:7px 9px; flex-shrink:1; }
  .theme-admin #workspace > aside button { width:auto; flex-shrink:0; white-space:nowrap; margin:0; }
  .theme-admin :is(.main,.list-panel,.detail-panel,.metric-card,#contentView) { min-width:0; box-sizing:border-box; }
  .theme-admin .main { padding:16px; }
  .theme-admin .panels { display:block; }
  .theme-admin .detail-panel { margin-top:16px; }
  .theme-admin :is(#searchForm,.metrics-controls,.moderation-actions) { flex-wrap:wrap; }
  .theme-admin :is(#searchForm input,.metrics-controls input,.moderation-actions input) { min-width:0; max-width:100%; flex-basis:100%; }
  .theme-admin :is(button,select) { min-height:44px; }
  .theme-admin .page-title { display:block; overflow-wrap:anywhere; }
  .theme-admin .dashboard-columns { grid-template-columns:1fr; }
  .theme-admin .table-scroll { max-width:100%; overscroll-behavior-x:contain; }
  .theme-admin .stats { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .theme-admin #gate { margin:30px 16px; padding:20px; }
  .theme-reset main { margin:24px 16px; box-sizing:border-box; width:auto; }
}
@media (max-width:359px) {
  .theme-community :is(.community-header,.portal-nav,.page-wrap,.site-footer) { margin-left:12px; margin-right:12px; }
  .theme-community .portal-nav .menu-btn { font-size:11px; }
  .theme-community .auth-btn { padding:8px; font-size:12px; }
  .theme-community .sidebar-write { padding:10px; font-size:12px; }
  .theme-community .topic-board-header h3 { font-size:14px; }
}

/* Keep activity links stacked consistently in natural and requested mobile views. */
html[data-mobile-layout] .theme-community .member-activity-links{flex-wrap:wrap;row-gap:0}
html[data-mobile-layout] .theme-community .member-activity-links button{flex:1;min-width:0}
html[data-mobile-layout] .theme-community .member-activity-links #memberCoffeeLink:not([hidden]){flex-basis:100%;min-height:40px;display:flex;align-items:center}
html[data-mobile-layout] .theme-community .quick-tool-dialog header button{flex:0 0 44px;width:44px;height:44px;padding:0}
html[data-mobile-layout] .theme-community .portal-login.is-member .mobile-account-toggle{display:flex;align-items:center;gap:4px;max-width:120px}
html[data-mobile-layout] .theme-community .portal-login.is-member .member-identity{padding-right:110px}
