/* Mobile is a complete workspace view; desktop keeps the existing board. */
.mobile-brand, .mobile-nav, .mobile-column-tabs, .mobile-move-card { display: none; }
.mobile-connection { display: none; }
.mobile-inbox-filters { display: none; }
.task-card:has(.task-action-menu) { z-index: 10; transform: none; }
.task-card:has(.task-action-menu) .task-more { display: block; }
.install-link { display: inline-flex; gap: 9px; align-items: center; min-height: 44px; margin-top: 10px; padding: 0; border: 0; background: transparent; color: #7653bd; font-size: 13px; font-weight: 600; }
.move-destinations, .mobile-option-list { display: grid; gap: 8px; }
.move-destinations button, .mobile-option-list button { display: flex; align-items: center; gap: 12px; min-height: 58px; padding: 12px; text-align: left; background: #f6f8fc; border: 1px solid #e7ecf4; border-radius: 12px; color: #293b54; }
.move-destinations button:disabled { opacity: .5; cursor: default; }
.move-destinations button > span:nth-child(2) { display: grid; gap: 4px; flex: 1; min-width: 0; }
.move-destinations strong { font-size: 14px; overflow-wrap: anywhere; }
.move-destinations small { color: #70809a; font-size: 12px; }
.move-option-dot { width: 10px; height: 10px; border-radius: 4px; flex: none; }
.mobile-option-list button { justify-content: space-between; flex-wrap: wrap; font-size: 14px; }
.mobile-option-list button span:last-child { color: #7c8ba1; font-size: 12px; }
.mobile-option-list .selected-board { border-color: #9cbcf3; background: #edf3ff; color: #1769df; }
.mobile-wide-action { width: 100%; min-height: 48px; padding: 12px 16px; margin-top: 15px; border: 0; border-radius: 12px; background: #1769df; color: white; font-size: 15px; font-weight: 700; }
.install-app-icon { border-radius: 13px; }
.install-steps { padding-left: 23px; color: #40536f; font-size: 15px; line-height: 1.7; }
.install-steps li { padding: 6px 0 6px 5px; }
.install-note { color: #7b899d; font-size: 12px; line-height: 1.6; }
.app-update { position: fixed; bottom: 20px; left: 50%; z-index: 45; display: flex; align-items: center; gap: 15px; width: min(450px, calc(100% - 28px)); padding: 14px 16px; border-radius: 14px; background: #263854; color: white; box-shadow: 0 8px 30px #26385430; transform: translateX(-50%); font-size: 13px; }
.app-update button { border: 0; border-radius: 8px; padding: 10px 12px; min-height: 44px; color: #1769df; background: white; font-weight: 700; }

@media (max-width: 820px), (max-height: 500px) and (pointer: coarse) {
  html, body { width: 100%; height: 100%; min-width: 320px; overflow: hidden; overscroll-behavior: none; }
  button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
  button { touch-action: manipulation; }
  button:focus-visible, [tabindex]:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid #97b7f7; outline-offset: 3px; }
  input, textarea, select { font-size: 16px !important; }
  .app-shell, .app-shell.inbox-collapsed, .app-shell.inbox-compact { display: flex; flex-direction: column; height: var(--mobile-vh, 100dvh); min-height: 0; padding-top: env(safe-area-inset-top, 0px); transition: none; }
  .app-shell .inbox-panel { display: none; }
  .app-shell .workspace { display: flex; flex: 1; min-height: 0; overflow: hidden; }
  .app-shell[data-mobile-screen="inbox"] .workspace { display: none; }
  .app-shell[data-mobile-screen="inbox"] .inbox-panel { display: flex; flex-direction: column; flex: 1; min-height: 0; width: 100%; padding: 18px 18px 0; color: #26364d; background: #f4f7fb; gap: 0; }
  .app-shell[data-mobile-screen="inbox"] .inbox-panel::after { display: none; }
  .app-shell .inbox-panel .brand-row { display: flex; flex-direction: row; height: 35px; gap: 9px; }
  .app-shell .inbox-panel .brand-name { display: block; font-size: 18px; color: #26364d; }
  .app-shell .inbox-panel .brand-mark { background: #b752e8; }
  .app-shell .inbox-panel .brand-mark span { background: white; }
  .app-shell .inbox-panel .inbox-intro { display: block; margin-top: 17px; }
  .app-shell .inbox-title { font-size: 25px; color: #26364d; letter-spacing: -.6px; }
  .app-shell .inbox-title .inbox-glyph { display: none; }
  .app-shell .inbox-title-row { margin-bottom: 14px; }
  .app-shell .inbox-count { min-width: 28px; height: 28px; font-size: 12px; color: #8f45bd; background: #eee1fa; }
  .app-shell .quick-add { padding: 14px; border: 1px solid #e1e7f0; border-radius: 15px; box-shadow: 0 3px 10px #23345005; }
  .app-shell .quick-add input { min-height: 32px; color: #30425e; }
  .app-shell .quick-add-foot { margin-top: 5px; color: #8491a5; }
  .app-shell .quick-add-foot button { width: 44px; height: 44px; border-radius: 12px; }
  .app-shell .inbox-list-heading { display: flex; margin: 18px 2px 12px; color: #7c8ca4; font-size: 10px; letter-spacing: 1px; }
  .app-shell .inbox-list-heading button { min-width: 44px; min-height: 44px; color: #76618e; }
  .mobile-inbox-filters:not([hidden]) { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; padding: 5px 10px; border-radius: 10px; background: #fff3d9; color: #8d6326; font-size: 12px; }
  .mobile-inbox-filters button { min-height: 44px; padding: 6px; border: 0; color: #8d6326; background: transparent; font-weight: 700; }
  .app-shell .inbox-list { display: block; flex: 1; min-height: 0; overflow-x: hidden; overflow-y: auto; padding: 0 0 12px; overscroll-behavior-y: contain; }
  .app-shell .inbox-item { min-width: 0; max-width: none; margin: 0 0 10px; padding: 16px; border-radius: 15px; border-color: #e1e7f0; }
  .inbox-item-title { font-size: 15px; line-height: 1.5; }
  .inbox-item-meta { font-size: 12px; gap: 8px; }
  .inbox-empty { min-width: 0; padding: 28px 18px; color: #77859d; border-color: #ccd7e6; font-size: 14px; }
  .inbox-empty strong { color: #3c4f6a; font-size: 16px; }
  .sidebar-bottom, .panel-collapse { display: none !important; }
  .topbar { flex: none; flex-direction: column; align-items: stretch; gap: 13px; min-height: 0; padding: 16px 18px 13px; background: #fff; color: #24344d; box-shadow: none; border-bottom: 1px solid #e9edf4; }
  .topbar::after, .topbar .breadcrumb, #mobileInboxToggle { display: none; }
  .mobile-brand { display: flex; align-items: center; gap: 8px; width: 100%; }
  .mobile-brand .brand-mark { width: 27px; height: 27px; background: #b752e8; }
  .mobile-brand .brand-mark span { background: white; }
  .mobile-brand strong { font: 800 19px Manrope, sans-serif; letter-spacing: -.5px; }
  .mobile-brand > span:last-child { margin-left: auto; color: #8a96a8; font-size: 10px; }
  .topbar-actions { width: 100%; gap: 8px; }
  .search-box, .search-box:focus-within { flex: 1; width: auto; height: 44px; padding: 0 12px; border: 1px solid #e6ebf3; border-radius: 12px; background: #f4f7fb; }
  .search-box input { color: #344760; }
  .search-box input::placeholder { color: #8d9aae; }
  .search-icon { color: #899bb5; }
  .search-box kbd, .topbar #shareButton, #topAddCard { display: none; }
  .top-icon { width: 44px; height: 44px; border: 1px solid #e6ebf3; color: #647b9e; border-radius: 12px; background: #f4f7fb; }
  .board-stage { flex: 1; min-height: 0; padding: 15px 16px 0; overflow: hidden; }
  .board-heading { gap: 6px; padding-bottom: 7px; align-items: flex-start; }
  .board-heading-main { min-width: 0; }
  .board-title-line { gap: 8px; }
  .board-title-line h1 { font-size: 22px; max-width: calc(100vw - 108px); letter-spacing: -.7px; }
  .board-emoji { width: 28px; height: 28px; }
  #renameBoard { display: none; }
  .board-heading p { margin: 7px 0 0; max-width: calc(100vw - 82px); color: #8492a6; font-size: 11px; }
  .board-heading-actions { gap: 0; }
  .board-heading-actions .view-button:not(#boardMenuButton) { display: none; }
  #boardMenuButton { width: 44px; height: 44px; border-radius: 12px; background: #eaf0fa; }
  .board-menu { top: 47px; right: 0; z-index: 8; }
  .board-visibility { max-width: 100%; margin: 0 0 8px; font-size: 10px; line-height: 1.5; }
  .visibility-alert { margin: 0 0 8px; padding: 10px; font-size: 12px; flex-wrap: wrap; }
  .visibility-alert button { min-height: 44px; font-size: 12px; }
  .mobile-column-tabs { display: flex; flex: none; gap: 8px; min-height: 48px; overflow-x: auto; padding: 2px 0 10px; margin-bottom: 3px; scrollbar-width: none; }
  .mobile-column-tabs::-webkit-scrollbar { display: none; }
  .mobile-column-tabs button { display: flex; align-items: center; justify-content: center; gap: 7px; flex: none; min-height: 44px; max-width: 240px; padding: 0 14px; border: 1px solid #e0e6ef; border-radius: 13px; color: #74829a; background: #fff; font-size: 13px; font-weight: 600; }
  .mobile-column-tabs button > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .mobile-column-tabs button small { min-width: 20px; padding: 3px 5px; border-radius: 6px; color: #8695aa; background: #f0f3f8; font-size: 10px; }
  .mobile-column-tabs button[aria-selected="true"] { color: white; background: #1769df; border-color: #1769df; box-shadow: 0 4px 9px #1769df20; }
  .mobile-column-tabs button[aria-selected="true"] small { color: #fff; background: #ffffff25; }
  .board-scroll { display: block; flex: 1; min-height: 0; overflow: hidden; padding: 0; }
  .columns-track { display: block; width: 100%; height: 100%; min-height: 0; }
  .column { display: none; width: 100%; height: 100%; max-height: 100%; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
  .column.mobile-column-active { display: flex; }
  .column-head { padding: 8px 1px; gap: 7px; }
  .column-name { font-size: 13px; }
  .column-sort, .column-more { width: 44px; height: 44px; font-size: 19px; }
  .column-wip { padding: 0 2px 10px; font-size: 11px; }
  .column-wip-line strong { font-size: 11px; }
  .column-policy-summary { font-size: 11px; }
  .cards-list { padding: 0 2px 6px; scrollbar-width: thin; scrollbar-gutter: auto; -webkit-overflow-scrolling: touch; touch-action: pan-y pinch-zoom; }
  .cards-list::-webkit-scrollbar { width: 4px; }
  .cards-list::-webkit-scrollbar-thumb { background: #becadd; border: 0; }
  .task-card { margin-bottom: 11px; padding: 16px 15px 8px; border: 1px solid #e2e8f2; border-radius: 15px; box-shadow: 0 3px 9px #23345004; cursor: pointer; }
  .task-card:hover { transform: none; box-shadow: none; }
  .task-title { padding-right: 30px; font-size: 15px; line-height: 1.5; }
  .task-description { margin-top: 6px; font-size: 12px; line-height: 1.6; }
  .task-more { display: block; width: 44px; height: 44px; top: 5px; right: 4px; opacity: 1; font-size: 20px; }
  .task-meta { flex-wrap: wrap; gap: 7px; font-size: 11px; }
  .task-label { padding: 5px 7px; font-size: 10px; }
  .priority, .task-team, .task-policy-warning { font-size: 10px; }
  .task-booking, .task-booking strong { font-size: 11px; }
  .mobile-move-card { display: flex; align-items: center; justify-content: flex-end; gap: 6px; width: 100%; min-height: 44px; padding: 5px 0 0; border: 0; background: transparent; color: #6480aa; font-size: 12px; font-weight: 600; }
  .add-card-button { min-height: 48px; margin-top: 3px; padding: 10px; border: 1px dashed #cbd8ec; border-radius: 12px; color: #4d73ac; font-size: 13px; }
  .board-scroll > .add-column { display: none; }
  .board-footer { flex: none; min-height: 26px; padding: 7px 2px; }
  .sync-indicator { font-size: 10px; }
  .sync-action { min-height: 36px; font-size: 11px; }
  .mobile-nav { display: flex; flex: none; justify-content: space-around; align-items: flex-start; min-height: 73px; padding: 8px 9px max(8px, env(safe-area-inset-bottom, 0px)); border-top: 1px solid #e4eaf3; background: #fff; box-shadow: 0 -4px 20px #23345004; z-index: 4; }
  .mobile-nav button { position: relative; display: grid; justify-items: center; align-content: center; gap: 5px; min-height: 56px; min-width: 52px; padding: 3px 9px; border: 0; border-radius: 13px; background: transparent; color: #8b98ad; font-size: 10px; font-weight: 600; }
  .mobile-nav button[aria-current="page"] { color: #1769df; background: #eef4ff; }
  .mobile-nav svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  .mobile-nav [data-mobile-action="create"] { min-width: 61px; color: #1769df; }
  .mobile-nav [data-mobile-action="create"] svg { width: 42px; height: 36px; padding: 8px; border-radius: 12px; background: #1769df; color: #fff; margin-top: -5px; }
  .mobile-nav .mobile-badge { position: absolute; top: 0; right: 3px; display: grid; place-items: center; min-width: 17px; height: 17px; padding: 0 4px; border: 2px solid white; border-radius: 10px; color: white; background: #b252dc; font-size: 8px; }
  .keyboard-open .mobile-nav { display: none; }
  .mobile-connection:not([hidden]) { display: block; flex: none; padding: 8px 16px; color: #8d6326; background: #fff3d9; font-size: 12px; line-height: 1.4; }
  .modal { position: fixed; inset-inline: 0; top: auto; bottom: 0; margin: 0; width: 100%; max-width: none; max-height: calc(var(--mobile-vh, 100dvh) - env(safe-area-inset-top, 0px) - 12px); padding: 20px 20px max(16px, env(safe-area-inset-bottom, 0px)); border: 0; border-radius: 23px 23px 0 0; overscroll-behavior-y: contain; }
  .modal::backdrop { background: #14233a77; }
  .modal h2 { margin-bottom: 8px; font-size: 23px; }
  .modal-description { font-size: 13px; line-height: 1.6; }
  .modal-close { width: 44px; height: 44px; font-size: 26px; }
  .field-label { margin-top: 17px; font-size: 13px; }
  .field-input { min-height: 50px; border-radius: 11px; padding: 10px 12px; line-height: 1.4; }
  .field-grid { grid-template-columns: 1fr; gap: 0; }
  .modal-actions { position: sticky; bottom: 0; padding: 14px 0 max(5px, env(safe-area-inset-bottom, 0px)); background: white; z-index: 2; }
  .modal-actions button { min-height: 48px; border-radius: 11px; font-size: 14px; }
  .modal-actions .primary-button { flex: 1; }
  .column-requirements label { min-height: 44px; font-size: 13px; }
  .column-requirements input { width: 20px; height: 20px; }
  .task-action-menu button, .column-menu button, .board-menu button { min-height: 44px; font-size: 13px; }
  .filter-popover { top: calc(env(safe-area-inset-top, 0px) + 110px); right: 18px; max-width: calc(100vw - 36px); border-radius: 15px; }
  .filter-option { min-height: 48px; font-size: 14px; }
  .toast { bottom: calc(87px + env(safe-area-inset-bottom, 0px)); max-width: calc(100% - 32px); font-size: 13px; padding: 13px 17px; }
  .app-update { bottom: calc(87px + env(safe-area-inset-bottom, 0px)); }
  .auth-screen { height: var(--mobile-vh, 100dvh); min-height: 0; padding: max(20px, env(safe-area-inset-top, 0px)) 20px max(20px, env(safe-area-inset-bottom, 0px)); }
  .auth-card { margin: auto; padding: 26px 22px; }
  .auth-card h1 { font-size: 26px; }
  .auth-copy { font-size: 14px; }
  .auth-brand { margin-bottom: 27px; }
  .auth-form .field-label { font-size: 13px; }
  .auth-input, .google-auth-button, .auth-submit { min-height: 50px; font-size: 15px; border-radius: 12px; }
  .auth-link, .auth-policy-links a, .auth-policy-links button { min-height: 44px; display: inline-flex; align-items: center; font-size: 12px; }
  .public-home { padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); }
  .public-nav .public-login { min-height: 44px; font-size: 14px; }
  .public-hero { padding-top: 28px; }
  .public-hero h1 { font-size: clamp(34px, 9.5vw, 48px); }
  .public-cta-row { flex-wrap: wrap; gap: 10px 18px; }
  .public-cta, .public-secondary-cta { min-height: 48px; font-size: 14px; }
  .public-lede { font-size: 15px; }
  .public-auth-note { font-size: 12px; }
  .public-footer a { min-height: 44px; display: inline-flex; align-items: center; }
  .public-footer > div { flex-wrap: wrap; }
}
@media (max-height: 500px) and (pointer: coarse) {
  .topbar { flex-direction: row; align-items: center; padding: 7px 16px; gap: 16px; }
  .topbar-left { flex: none; }
  .topbar-actions { flex: 1; }
  .mobile-brand > span:last-child { display: none; }
  .board-stage { padding-top: 5px; }
  .board-heading { padding-bottom: 1px; }
  .board-title-line h1 { font-size: 18px; }
  .board-heading p, .board-visibility, .column-head, .column-policy-summary, .add-card-button { display: none; }
  .column-wip { padding: 3px 1px; }
  .mobile-column-tabs { padding-bottom: 4px; margin-bottom: 0; }
  .mobile-nav { min-height: 56px; padding-top: 3px; padding-bottom: max(3px, env(safe-area-inset-bottom, 0px)); }
  .mobile-nav button { min-height: 48px; gap: 2px; }
  .board-footer { min-height: 20px; padding: 4px 1px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
