/* Mobile-only controls use the same views and actions as the desktop app. */
.mobile-disclosure-toggle,
.todo-filter-toggle,
.dashboard-mobile-actions,
.file-tile-menu { display: none; }

.nav-icon svg,
.bottom-nav-icon svg,
.more-sheet-icon svg,
.incoming-message-icon svg { display: block; flex: none; }
.quiet-hours-toggle { display: flex; align-items: center; gap: .65rem; min-height: 44px; margin-bottom: 1rem; }
.quiet-hours-toggle input { width: 20px; height: 20px; flex: none; margin: 0; accent-color: var(--brand); }
.quiet-hours-times { max-width: 440px; }
[data-quiet-status]:empty { display: none; }

/* Match the calendar renderer at the tablet boundary. */
@media (min-width: 768px) and (max-width: 800px) {
  .calendar-grid#calendar-cells,
  .calendar-weekdays { display: grid !important; }
  #calendar-agenda { display: none !important; }
}

@media (max-width: 767px) {
  .main-content { overflow-wrap: anywhere; }
  .main-content > *,
  .card > *,
  .grid > * { min-width: 0; }
  .page-header:not(.messages-page-header) { align-items: center; margin-bottom: 1.15rem; gap: .85rem; }
  .page-header:not(.messages-page-header) h1 { font-size: clamp(1.8rem, 7.5vw, 2.3rem); line-height: 1.1; }
  .page-header:not(.messages-page-header) .eyebrow { display: none; }
  .page-header-actions { width: 100%; flex-wrap: wrap; }
  .page-header-actions > button { flex: 1 1 auto; }
  .page-header > .badge { max-width: 100%; white-space: normal; line-height: 1.4; }
  .card { border-radius: 18px; padding: 1rem; box-shadow: 0 3px 12px color-mix(in srgb, var(--deep) 4%, transparent); }
  .card h2 { font-size: 1.4rem; line-height: 1.2; }
  .card h3 { font-size: 1.12rem; line-height: 1.3; }
  .grid { gap: 1rem; }
  .grid-cols-2,
  .grid-cols-3,
  .two-col,
  .template-grid,
  .team-board-grid { grid-template-columns: minmax(0, 1fr); }
  .field { min-width: 0; }
  .field label { line-height: 1.4; }
  .field input,
  .field select,
  .field textarea { min-width: 0; max-width: 100%; }
  .stat-label { font-size: .82rem; line-height: 1.5; letter-spacing: 0; }
  .empty-state { padding: 2rem 1rem; }
  .badge { max-width: 100%; }
  .attachment-row { flex-wrap: wrap; gap: .5rem; }
  .attachment-row > a,
  .attachment-row > span { min-width: 0; overflow-wrap: anywhere; }
  .attachment-row > button { flex: none; }
  .modal .two-col { gap: .4rem; }
  .modal form > div:has(> [data-upload]) { flex-wrap: wrap; }
  .modal [data-upload] { width: 100%; }
  .modal [data-search] { min-width: 0; width: 100%; }
  .modal .rules-table { display: block; max-width: 100%; overflow-x: auto; }

  .mobile-disclosure-toggle {
    display: flex;
    width: 100%;
    min-height: 48px;
    margin-bottom: .7rem;
    padding: .75rem 1rem;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--paper);
    color: var(--fg);
    font-size: .94rem;
    text-align: left;
    text-transform: none;
    letter-spacing: 0;
  }
  .mobile-disclosure-toggle::before { display: none; }
  .mobile-disclosure-indicator { font-size: 1.4rem; line-height: 1; }
  .mobile-disclosure-toggle[aria-expanded="true"] .mobile-disclosure-indicator { transform: rotate(45deg); }
  .mobile-disclosure-panel[data-mobile-expanded="false"] { display: none; }

  .dashboard-mobile-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem; margin-bottom: 1.2rem; }
  .dashboard-mobile-actions a { min-width: 0; min-height: 56px; padding: .7rem; justify-content: space-between; border-radius: 14px; background: var(--brand-tint); border-color: transparent; font-size: .87rem; line-height: 1.3; }
  .dashboard-mobile-actions a:last-child { background: var(--paper-2); border-color: var(--line); }
  .dashboard-person-card .stat-value { font-size: 2.35rem; }
  .dashboard-person-counts { flex-wrap: wrap; gap: .5rem; }
  .dashboard-poll { gap: .75rem; align-items: center; }
  .dashboard-poll > div { min-width: 0; }
  .dashboard-poll > a { flex: none; padding: .6rem .75rem; font-size: .83rem; }
  .activity-item { gap: .6rem; }
  .activity-item > div { min-width: 0; line-height: 1.5; }
  .activity-item time { display: block; font-size: .75rem; line-height: 1.4; }

  .view-switch { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; padding: .25rem; gap: .25rem; margin-bottom: 1rem; border-radius: 14px; background: var(--paper-2); }
  .view-switch button { width: 100%; padding: .65rem .5rem; border-radius: 11px; font-size: .86rem; white-space: normal; letter-spacing: 0; }
  .todo-filter-bar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .6rem; margin-bottom: 1rem; padding: 0; border: 0; }
  .todo-filter-bar[hidden] { display: none; }
  .todo-filter-bar #f-search { grid-column: 1; grid-row: 1; width: 100%; }
  .todo-filter-toggle { display: block; grid-column: 2; grid-row: 1; min-width: 76px; padding: .6rem .75rem; border-radius: 12px; font-size: .85rem; }
  .todo-filter-toggle.has-active-filters { border-color: var(--brand); background: var(--brand-tint); }
  .todo-filter-bar #f-assignee { grid-row: 2; grid-column: 1 / -1; }
  .todo-filter-bar select,
  .todo-filter-bar label { grid-column: 1 / -1; min-width: 0; width: 100%; }
  .todo-filter-bar:not(.filters-expanded) .todo-filter-extra { display: none !important; }
  .todo-filter-bar .todo-filter-extra { min-height: 44px; }
  .todo-row { padding: .9rem .65rem; gap: .65rem; }
  .todo-row:hover { padding-left: .65rem; }
  .todo-check { width: 36px; min-width: 36px; height: 36px; min-height: 36px; margin-top: 0; font-size: .9rem; }
  .todo-title { font-size: 1rem; line-height: 1.35; }
  .todo-meta { gap: .35rem .65rem; font-family: var(--body); font-size: .76rem; letter-spacing: 0; text-transform: none; line-height: 1.5; }
  .todo-meta .badge { white-space: normal; line-height: 1.3; }
  .team-summary { flex-wrap: wrap; gap: .5rem; }
  .team-lane { padding: .9rem; border-radius: 16px; background: var(--paper); }
  .team-lane-header { flex-wrap: wrap; gap: .5rem; }
  .team-workload { font-family: var(--body); text-align: left; text-transform: none; font-size: .78rem; }
  .team-lane-todos .todo-row { padding-left: 0; }

  .calendar-create { padding: .65rem .8rem; font-size: .85rem; }
  .calendar-nav { display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; gap: .5rem; margin-bottom: 1rem; }
  .calendar-nav #prev-month,
  .calendar-nav #next-month { width: 44px; padding: 0; border-radius: 12px; font-size: 1.1rem; }
  .calendar-nav #month-label { text-align: center; font-size: 1.02rem; line-height: 1.3; }
  .calendar-nav-text { display: none; }
  .calendar-nav #today-btn { grid-column: 1 / -1; justify-self: center; min-height: 40px; padding: .4rem .85rem; }
  #calendar-agenda { gap: 1rem; }
  .agenda-day { gap: .5rem; padding: .8rem; border: 1px solid var(--line); border-radius: 16px; background: var(--paper); }
  .agenda-day-today { border-color: var(--brand); }
  .agenda-day-label { display: flex; width: 100%; min-height: 44px; padding: .2rem .1rem .65rem; align-items: center; justify-content: space-between; gap: .5rem; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; color: var(--fg-2); background: transparent; font-family: var(--body); font-size: .88rem; font-weight: 600; text-transform: none; letter-spacing: 0; }
  .agenda-day-label::before { display: none; }
  .agenda-day-today .agenda-day-label { color: var(--brand-ink); }
  .agenda-events .calendar-event { min-height: 50px; padding: .7rem .6rem; gap: .6rem; border-left-width: 3px; border-radius: 0 10px 10px 0; background: var(--paper-2); font-size: .9rem; line-height: 1.45; }
  .agenda-events .calendar-event-label { white-space: normal; overflow-wrap: anywhere; }
  .ics-details summary { min-height: 44px; display: flex; align-items: center; font-family: var(--body); font-size: .9rem; letter-spacing: 0; text-transform: none; }

  .files-header-actions #file-search { flex: 1 1 100%; width: 100% !important; }
  .files-layout { grid-template-columns: minmax(0, 1fr); gap: .7rem; }
  .files-layout .mobile-disclosure-toggle { margin: 0; }
  .files-folders-card { max-height: 50dvh; overflow: auto; overscroll-behavior: contain; }
  .files-main { min-width: 0; }
  .folder-item { min-height: 48px; gap: .25rem; }
  .folder-name { min-height: 44px; display: flex; align-items: center; font-size: .9rem; }
  .folder-actions { opacity: 1; }
  .folder-actions button { width: 36px; min-width: 36px; padding: 0; }
  .folder-chevron { min-width: 30px; min-height: 44px; }
  .folder-chevron-spacer { width: 8px; }
  .files-toolbar { gap: .65rem; margin-bottom: .65rem; padding-bottom: .75rem; }
  .files-breadcrumb { display: flex; width: 100%; align-items: center; flex-wrap: wrap; gap: .15rem; font-size: .8rem; }
  .breadcrumb-link { display: inline-flex; min-height: 40px; align-items: center; padding: .4rem .15rem; overflow-wrap: anywhere; }
  .files-toolbar .view-toggle { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; }
  .files-toolbar .view-toggle button { padding: .55rem .65rem; font-size: .85rem; }
  .file-table { display: block; width: 100%; margin: 0; }
  .file-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .file-table tbody { display: grid; gap: .85rem; }
  .file-table tr { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .6rem; padding: .85rem; border: 1px solid var(--line); border-radius: 14px; background: var(--paper-2); }
  .file-table td { display: block; min-width: 0; padding: 0; border: 0; font-size: .74rem; line-height: 1.4; overflow-wrap: anywhere; }
  .file-table td:first-child { grid-column: 1 / -1; font-size: .95rem; font-weight: 600; }
  .file-table td[data-label]::before { display: block; margin-bottom: .1rem; color: var(--fg-3); font-size: .7rem; content: attr(data-label); }
  .file-name-link { display: block; padding-bottom: .3rem; overflow-wrap: anywhere; }
  .file-drag-handle,
  .tile-drag-handle { display: none; }
  .file-table .file-row-actions { display: flex; grid-column: 1 / -1; flex-wrap: wrap; gap: .35rem; margin-top: .2rem; padding-top: .5rem; border-top: 1px solid var(--line); text-align: left; white-space: normal; opacity: 1; }
  .file-row-actions > a,
  .file-row-actions > button { display: inline-flex; min-width: 40px; min-height: 44px; padding: .5rem; align-items: center; justify-content: center; border-radius: 10px; background: var(--paper); font-size: .83rem; }
  .file-row-actions .file-open-link { flex: 1 1 100%; }
  .file-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); border: 0; gap: .7rem; background: transparent; }
  .file-tile { min-width: 0; padding: 2.8rem .6rem .6rem; border: 1px solid var(--line); border-radius: 14px; }
  .file-tile-menu { display: block; position: absolute; top: .2rem; right: .2rem; width: 44px; min-height: 44px; padding: .4rem; border: 0; background: transparent; font-size: .9rem; }
  .tile-name { width: 100%; max-height: none; font-size: .85rem; overflow-wrap: anywhere; }
  .tile-open { display: inline-flex; min-height: 44px; align-items: center; justify-content: center; opacity: 1; font-family: var(--body); font-size: .8rem; text-transform: none; letter-spacing: 0; }
  .context-menu { max-width: calc(100vw - 1rem); border-radius: 14px; }
  .context-item { min-height: 48px; font-size: .9rem; }

  .vote-tabs { gap: .35rem; margin-bottom: 1rem; }
  .vote-tab { display: flex; flex: 1; min-width: 0; min-height: 48px; padding: .65rem .35rem; align-items: center; justify-content: center; text-align: center; font-family: var(--body); font-size: .9rem; line-height: 1.35; letter-spacing: 0; text-transform: none; }
  .poll-list { gap: 1rem; }
  .poll-card,
  .meeting-card,
  .claim-card { min-width: 0; padding: 1rem; }
  .poll-head { gap: .65rem; }
  .poll-head > div { min-width: 0; }
  .poll-title { font-size: 1.2rem; line-height: 1.3; }
  .poll-description,
  .claim-reason { font-size: .94rem; overflow-wrap: anywhere; }
  .poll-links .badge { white-space: normal; line-height: 1.4; }
  .poll-option-head { gap: .6rem; font-size: .9rem; }
  .poll-option-head > span { min-width: 0; }
  .poll-option-head > strong { flex: none; }
  .poll-choices { display: grid; grid-template-columns: minmax(0, 1fr); width: 100%; gap: .55rem; }
  .poll-choice { min-width: 0; min-height: 50px; padding: .8rem; border-radius: 12px; font-size: .9rem; line-height: 1.4; }
  .poll-choice input { flex: none; width: 20px; height: 20px; }
  .slot-day-row .poll-choices { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .slot-day-row { gap: .5rem; }
  .slot-day-label { width: 100%; font-family: var(--body); font-size: .85rem; }
  .poll-actions > button { flex: 1 1 auto; }
  .poll-vote-form > button { width: 100%; }
  .poll-vote-form > small { display: block; margin-top: .5rem; }
  .penalty-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .55rem; }
  .penalty-row-weight { min-width: 40px; font-size: 1.5rem; }
  .penalty-row-action { grid-column: 1 / -1; min-width: 0; width: 100%; text-align: left; letter-spacing: 0; text-transform: none; }
  .penalty-row-action button { width: 100%; }
  .claim-vote > div { min-width: 0; }
  .claim-card > div:has(> [data-vote]) { flex-wrap: wrap; }
  .claim-card [data-vote] { flex: 1 1 auto; }

  .top-header-actions { width: 100%; gap: .6rem; }
  .top-header-actions select { width: 100%; max-width: 100%; }
  .top-header-actions button { width: 100%; }
  .top-summary-head { gap: 1rem; }
  .top-countdown { display: flex; align-items: baseline; gap: .65rem; min-width: 0; text-align: left; }
  .top-countdown .countdown { font-size: 2rem; }
  .top-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
  .top-actions > * { flex: 1 1 auto; max-width: 100%; }
  .top-actions .button-link { justify-content: center; }
  .top-form,
  .top-form--modal { grid-template-columns: minmax(0, 1fr); gap: .25rem; }
  .top-form-head h2 { font-size: 1.45rem; }
  .top-form-actions button { width: 100%; }
  .top-item { grid-template-columns: 30px minmax(0, 1fr); gap: .65rem; padding: 1rem 0; }
  .top-num { font-size: 1rem; }
  .top-body { min-width: 0; }
  .top-title { font-size: 1rem; line-height: 1.4; }
  .top-meta { gap: .4rem .6rem; font-family: var(--body); font-size: .78rem; letter-spacing: 0; text-transform: none; }
  .top-item-actions { grid-column: 2; opacity: 1; justify-content: flex-end; gap: .25rem; }
  .top-item-actions button { min-width: 44px; padding: .5rem; }
  .top-archive-row { flex-wrap: wrap; gap: .4rem; min-height: 60px; }
  .milestone-card { flex-wrap: wrap; gap: .85rem; }
  .milestone-card > div:first-child { flex: 1 1 100%; min-width: 0; }
  .milestone-actions { width: 100%; gap: .55rem; }
  .milestone-countdown { flex: 1; text-align: left; }
  .milestone-countdown .countdown { font-size: 2rem; }
  .milestone-actions button { padding: .6rem .7rem; }
  .milestone-form-actions { flex-wrap: wrap; }
  .milestone-form-actions button { flex: 1 1 auto; }
  #template-page-form > label { display: flex; min-height: 44px; align-items: center; gap: .6rem; }
  #template-page-form > label input { width: 20px; height: 20px; }
  .admin-user-row { grid-template-columns: 20px minmax(0, 1fr); gap: .7rem; }
  .admin-user-fields { min-width: 0; gap: .5rem; }
  .admin-user-fields select { min-width: 0; width: 100%; }
  .admin-user-row > button { grid-column: 2; width: 100%; }
  .channel-status-grid { gap: .6rem; }

  .quiet-hours-times { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
  .quiet-hours-times input { width: 100%; min-width: 0; padding-inline: .65rem; }
  .quiet-hours-toggle { font-size: .94rem; line-height: 1.4; }
  #quiet-hours-form > button { width: 100%; }
  [data-quiet-status] { font-size: .9rem; line-height: 1.4; }
  .profile-guide { flex-wrap: wrap; }
  .profile-guide-actions { flex-wrap: wrap; width: 100%; }
  .profile-guide-actions > * { flex: 1 1 100%; justify-content: center; }
  .more-sheet-icon svg { width: 24px; height: 24px; }
  .bottom-nav-icon svg { width: 23px; height: 23px; }
}
