/* Compact presentation layer. Keep DOM, scroll owners and room state intact. */
:root {
  --compact-gap:12px;
  --compact-padding:16px;
  --workspace-card-padding:14px;
  --workspace-gap:12px;
}

/* A quiet, consistent rhythm: content keeps its readable type size. */
.sidebar { gap:16px; padding:16px 12px 12px; }
.sidebar-start > .primary { margin-bottom:8px; }
.home-button,.hub-button { min-height:38px; padding-block:7px; }
.sidebar-tip { padding:10px; }
.sidebar-legal-links { gap:6px 10px; }
.chat-panel,html:not(.water-disabled) .chat-panel { margin:12px; }
.chat-header { padding:12px 16px; gap:10px; }
.chat-header h2 { font-size:18px; }
.chat-actions button { padding:7px 10px; }
.room-mode-tabs { margin:8px 16px 6px; max-width:calc(100% - 32px); }
.room-control-bar { gap:8px; padding:6px 16px 8px; }
.room-tool-button { padding:7px 10px; }
.room-content > .message-list { padding:18px 16px; }
.room-tool-header { padding:10px 14px; }
.room-tool-header h3 { font-size:15px; }
.room-composer { margin:8px 16px 12px !important; }
.room-composer textarea { min-height:48px; }
.room-composer .composer-toolbar { padding:6px 10px; gap:8px; }
.room-side-panels .room-tools-drawer .hub-mechanics-panel { padding:14px; }
.room-tools-drawer .mechanics-shell,.mechanics-grid,.room-tools-drawer .mechanics-grid,
.party-shell,.screen-workspace { gap:var(--compact-gap); }
.mechanics-card,.room-tools-drawer .mechanics-card { gap:10px; box-shadow:none; }
.mechanics-card h4 { font-size:15px; }
.mechanics-card form,.mechanics-card > form,.room-tools-drawer .mechanics-card > form,
.room-tools-drawer form.mechanics-card,.hub-inline-form { gap:10px; }
.mechanics-shell > form,.hub-mechanics-panel > form { padding:14px; gap:10px; }
.tool-settings > summary { padding:10px 12px; }
.tool-settings > form { padding:12px; gap:10px; }
.tool-context,.hub-workspace-overview { padding:12px; }
.hub-workspace-overview { gap:8px; }
.hub-metrics { gap:8px; }
.hub-metrics > div { padding:8px 10px; }
.hub-metrics dd { font-size:18px; }
.hub-entry-list { padding:10px; gap:10px; }
.character-row,.wiki-entry,.hub-event { padding:10px; }
.party-heading,.party-settings,.party-history,.party-role { padding:12px; }
.party-heading strong { font-size:18px; }
.party-settings form { margin-top:12px; gap:10px; }
.party-settings form > div,.party-shell form { gap:10px; }
.party-question { padding:14px; }
.party-question > strong { font-size:16px; }
.party-choices { margin-top:12px; gap:8px; }
.party-choice,.vote-choice { padding:10px 12px; min-height:54px; }
.party-roster { gap:8px; }
.party-roster li,.party-results li { padding:10px; }
.mechanics-status { padding:10px 12px; }

/* Landing: the hub choices become a directory, rather than tall tiles. */
.landing-inner { max-width:1280px; margin-inline:auto; padding:28px; }
.landing-hero { gap:24px; padding-bottom:22px; }
.landing-hero h1 { margin-bottom:12px; font-size:clamp(30px,3vw,40px); }
.landing-hero-copy > p:last-of-type { margin-bottom:16px; line-height:1.65; }
.home-room-preview { padding:20px; }
.landing-actions { gap:10px; padding:16px 0; }
.landing-action { min-height:68px; padding:12px 14px; gap:10px; border-radius:var(--radius-md); }
.landing-action strong { font-size:14px; }
.landing-action small { margin-top:2px; font-size:12px; line-height:1.5; }
.landing-action-icon { width:32px; height:32px; border-radius:var(--radius-sm); }
.landing-hubs { margin-top:22px; }
.section-heading { margin-bottom:12px; }
.section-heading h2 { font-size:21px; }
.landing-hub-grid { grid-template-columns:repeat(auto-fit,minmax(min(100%,180px),1fr)); gap:10px; }
.landing-hub-grid button { display:grid; grid-template-columns:32px minmax(0,1fr) 22px; grid-template-rows:auto 1fr; align-content:start; align-items:start; gap:6px 10px; min-height:116px; padding:14px; border-radius:var(--radius-md); }
.landing-hub-grid .welcome-action-icon { grid-column:1; grid-row:1 / 3; width:32px; height:32px; border-radius:var(--radius-sm); }
.landing-hub-grid strong { grid-column:2; grid-row:1; margin:0; font-size:14px; line-height:1.4; }
.landing-hub-grid small { grid-column:2 / 4; grid-row:2; font-size:12px; line-height:1.5; }
.landing-hub-grid .hub-card-link { grid-column:3; grid-row:1; align-self:center; margin:0; width:22px; height:22px; background:transparent; }
.landing-hub-grid .hub-card-link .icon { width:16px; height:16px; }
.landing-hub-grid button::before,.welcome-action::before { opacity:0; }
.landing-hub-grid button:is(:hover,:focus-visible),.welcome-action:is(:hover,:focus-visible),.landing-action:hover { transform:none; box-shadow:var(--shadow-sm); }
.landing-hub-grid button:is(:hover,:focus-visible)::before,.welcome-action:is(:hover,:focus-visible)::before { opacity:0; }
.landing-hub-grid button:hover .hub-card-link { transform:none; }
.discovery-view { padding:24px; }
.discovery-header { margin-bottom:18px; }
.discovery-header h1 { font-size:26px; }
.discovery-controls { gap:8px; margin-bottom:16px; }
.discovery-room-grid { gap:12px; }
.discovery-room-grid .room-card { min-height:124px; padding:14px; }
.discovery-room-grid .room-card h3 { font-size:15px; line-height:1.45; }
.empty-rooms { padding:24px 16px; }
.friends-header { padding:24px; }
.friends-content { padding:20px 24px; }
.friend-card { padding:12px; gap:10px; }
.friend-tabs { margin-block:16px; }
.empty-state { padding:28px; }
.welcome-heading { margin-bottom:20px; }
.welcome-heading h2 { font-size:30px; }
.assistant-surface { padding:18px; }
.room-templates { margin-top:22px; }
.welcome-actions { gap:10px; }
.welcome-action { min-height:92px; padding:12px; gap:10px; border-radius:var(--radius-md); }
.welcome-action strong { font-size:14px; }

/* Forms and dialogs retain their scroll boundaries and sticky actions. */
.profile-modal,.create-modal { padding:22px; border-radius:var(--radius-lg); }
.profile-form { gap:12px; }
.profile-divider { margin-block:18px; }
.profile-avatar-editor { gap:12px; }
.avatar-file-label { gap:8px; }
.modal-header { gap:10px; margin-bottom:14px; }
.modal-header h2 { font-size:21px; }
.modal-symbol { width:36px; height:36px; border-radius:var(--radius-sm); }
.create-modal > .muted { padding-bottom:12px; margin-bottom:12px; }
.create-form-fields { gap:12px; }
.form-section { gap:12px; }
.form-section > legend { margin-bottom:8px; }
.create-footer { padding-top:12px; margin-top:12px; }
.choice-chips { gap:6px; }
.model-tier-option { padding:12px; gap:6px; }
.model-tier-option strong,.privacy-option strong { font-size:13px; }
.model-tier-option small,.tier-caption,.privacy-option small { line-height:1.5; }
.advanced-room-options > * + * { margin-top:12px; }
.invitation-intro,.invitation-room-preview { padding:12px; margin-bottom:16px; gap:10px; }
.wallet-panel { margin-top:18px; padding-top:16px; }
.wallet-summary { margin:12px 0; padding:14px; gap:12px; }
.wallet-summary strong { font-size:24px; }
.wallet-topup { margin:16px 0; padding-top:12px; }
.notification-settings { margin-top:16px; border:1px solid var(--line); border-radius:var(--radius-md); }
.notification-settings > summary { padding:12px; min-height:44px; cursor:pointer; font-size:13px; }
.notification-settings-body { display:grid; gap:12px; padding:0 12px 12px; }
.notification-sound-row { display:flex; align-items:center; flex-wrap:wrap; gap:8px 12px; }
.notification-sound-row > label { flex:1; min-width:0; }
.notification-volume { display:flex; align-items:center; flex-wrap:wrap; gap:8px; min-width:0; }
.notification-volume input[type="range"] { flex:1; min-width:80px; min-height:32px; }
.notification-volume output { font-size:12px; font-variant-numeric:tabular-nums; color:var(--muted); }
.auth-layout { gap:clamp(28px,6vw,88px); padding:32px 24px; }
.brand-card h1 { font-size:42px; margin:12px 0; }
.brand-card > p[data-i18n=tagline] { font-size:24px; }
.auth-card { padding:24px; border-radius:var(--radius-lg); }
.auth-preferences { margin-top:14px; }

/* Media stays subordinate to its actual content. */
.room-voice-panel { margin:0 16px 6px; }
.room-voice-panel .voice-bar { min-height:52px; padding:8px 10px; gap:8px; }
.room-voice-panel .voice-mark { width:30px; height:30px; }
.room-voice-panel .voice-copy { gap:2px; }
.room-voice-panel .voice-actions { gap:4px; }
.room-voice-panel .voice-status { padding:0 10px 8px; }
.room-voice-panel .voice-settings { padding:10px; }
.room-music-player { margin:0 16px 6px; padding:8px 10px; gap:8px; }
.screen-workspace-header { gap:10px; }
.screen-workspace-header h3 { font-size:18px; margin-bottom:4px; }
.screen-workspace-header > [data-icon],.screen-workspace-icon { width:34px; height:34px; padding:8px; }
.screen-viewer-bar { padding:8px 10px; }
.screen-workspace .screen-empty { padding:20px 16px; gap:8px; }
.screen-workspace .screen-empty strong { font-size:16px; }
.screen-controls { gap:8px; }
.screen-workspace .screen-analysis-card { padding:14px; gap:10px; }
.screen-viewer-note { padding:8px 10px; }
.screen-analysis-answer { padding:10px; }
.screen-audio-controls { display:flex; align-items:center; flex-wrap:wrap; gap:8px 12px; padding:8px 10px; border-top:1px solid var(--line); background:var(--panel); }
.screen-audio-toggle { flex:none; min-height:38px; }
.screen-audio-volume { display:flex; align-items:center; flex:1 1 160px; gap:8px; min-width:0; font-size:12px; }
.screen-audio-volume input[type="range"] { flex:1; min-width:70px; min-height:32px; }
.screen-audio-volume output { flex:none; color:var(--muted); font-variant-numeric:tabular-nums; }
.screen-audio-note,#screenAudioFeedback { flex-basis:100%; margin:0; color:var(--muted); font-size:12px; line-height:1.5; }

/* Standalone pages and the in-app reader share an editorial scale. */
body:has(> main:not(.shell)) > :is(header,main,footer) { width:min(960px,100%); padding:22px 24px; }
body:has(> main:not(.shell)) h1 { font-size:clamp(30px,4.5vw,48px); line-height:1.15; margin:16px 0; }
body:has(> main:not(.shell)) h2 { font-size:24px; }
body:has(> main:not(.shell)) .intro { font-size:17px; line-height:1.65; }
body:has(> main:not(.shell)) section { margin-top:32px; }
body:has(> main:not(.shell)) .eyebrow { margin-top:24px; }
body:has(> main:not(.shell)) article { padding:16px; }
.legal-reader .legal-reader-header { padding:14px 20px 10px; gap:10px; }
.legal-reader-header h2 { font-size:21px; }
.legal-reader .legal-reader-tabs { padding:0 16px 10px; gap:4px; }
.legal-reader .legal-reader-body { padding:20px 28px 32px; }
.legal-reader-body h1 { font-size:30px; }
.legal-reader-body section { margin-top:24px; }
.legal-reader-body .intro { font-size:16px; }

@media (min-width:721px) {
  .room-composer-input { align-items:center; padding:4px 8px; }
  .room-composer-input textarea { height:48px; min-height:48px; padding-block:6px; }
  .room-composer-input .speech-input-button { bottom:10px; }
}
@media (max-width:1100px) and (min-width:721px) {
  .landing-inner { padding:22px; }
  .landing-hub-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
/* A short desktop window still keeps a usable conversation and send action. */
@media (min-width:721px) and (max-height:600px) {
  .topbar { height:52px; }
  .workspace { height:calc(100dvh - 52px); }
  .chat-panel,html:not(.water-disabled) .chat-panel { margin:6px; }
  #chatView > .chat-header { align-items:center; padding:4px 12px; }
  #chatView .chat-heading:not(:has(.room-details[open])) { display:flex; align-items:center; flex-wrap:wrap; gap:8px 12px; }
  #chatView .room-details { margin-top:0; }
  #chatView .room-mode-tabs { margin:4px 12px; padding:2px; min-height:40px; }
  #chatView .room-mode-tab { min-height:32px; padding-block:5px; }
  #chatView .room-control-bar { padding:4px 12px; }
  #chatView .room-voice-panel { margin:0 12px 4px; }
  #chatView .room-voice-panel .voice-bar { min-height:44px; padding:4px 8px; }
  #chatView .room-speaker-identity { margin:2px 12px 0; }
  #chatView .room-composer { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:4px; margin:4px 12px 8px !important; }
  #chatView .room-composer-input { padding:4px; }
  #chatView .room-composer .composer-toolbar { padding:4px; border:0; align-self:end; }
  #chatView .room-composer .composer-context { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); }
}
@media (max-width:720px) {
  :root { --workspace-card-padding:12px; }
  .workspace { padding:6px; }
  .chat-panel,html:not(.water-disabled) .chat-panel { margin:0; }
  .topbar { padding-inline:6px; }
  .top-actions .language,.top-actions .utility-button,.top-actions .icon-button,
  .top-actions .profile-button,#navigationToggle { width:44px; min-width:44px; min-height:44px; padding:8px; margin:0; }
  .top-actions { gap:0; }
  .brand-home { min-height:44px; }
  .home-button,.hub-button { min-height:44px; }
  .sidebar { gap:12px; }
  .sidebar-legal-links a { display:inline-flex; align-items:center; min-height:44px; font-size:11px; }
  .landing-inner,.discovery-view { padding:18px 14px; }
  .landing-hero { padding-bottom:16px; gap:16px; }
  .landing-hero h1 { font-size:30px; margin-bottom:12px; line-height:1.15; }
  .landing-hero-copy > p:last-of-type { margin-bottom:14px; font-size:13px; }
  .landing-hero-copy > .primary { min-height:44px; }
  .landing-actions { gap:8px; padding:12px 0; }
  .landing-action { min-height:64px; padding:10px 12px; }
  .landing-action strong { font-size:13px; }
  .landing-hubs { margin-top:18px; }
  .section-heading h2 { font-size:20px; }
  .landing-hub-grid { grid-template-columns:minmax(0,1fr); gap:8px; }
  .landing-hub-grid button { min-height:78px; padding:12px; gap:3px 10px; }
  .landing-hub-grid .welcome-action-icon { align-self:center; }
  .landing-hub-grid strong { font-size:14px; }
  .landing-hub-grid small { font-size:12px; }
  .discovery-header { margin-bottom:14px; gap:12px; }
  .discovery-header h1 { font-size:24px; }
  .discovery-header .primary { min-height:44px; }
  .discovery-controls { gap:8px; }
  .friends-header { padding:18px 14px; }
  .friends-content { padding:14px; }
  .friend-card-actions button,.friend-tabs button,.friend-search button { min-height:44px; }
  .empty-state { padding:18px 14px; }
  .welcome-heading h2 { font-size:26px; }
  .welcome-heading { margin-bottom:16px; }
  .assistant-surface { padding:12px; }
  .room-templates { margin-top:18px; }
  .welcome-action { min-height:84px; }
  .suggestion-button { min-height:44px; padding:8px 10px; font-size:12px; }
  .profile-modal,.create-modal { width:calc(100vw - 20px); max-height:calc(100dvh - 20px); padding:16px; }
  .modal-header h2 { font-size:20px; }
  .modal-close,.profile-modal .icon-button,.create-modal .icon-button { width:44px; min-width:44px; min-height:44px; height:44px; }
  .profile-modal button,.create-modal button,.select-option,.choice-chip { min-height:44px; }
  .profile-modal input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]),
  .profile-modal textarea,.profile-modal select,.create-modal input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]),
  .create-modal textarea,.create-modal select { min-height:44px; font-size:16px; }
  .quick-start-choices { grid-template-columns:repeat(2,minmax(0,1fr)); gap:6px; }
  .quick-start-choices button { min-height:56px; padding:8px; gap:6px; font-size:12px; }
  .form-section { gap:10px; }
  .model-tier-picker { gap:8px; }
  .auth-layout { gap:18px; padding:22px 16px; }
  .brand-card h1 { font-size:30px; margin:8px 0; }
  .brand-card > p[data-i18n=tagline] { font-size:21px; }
  .brand-card > p:has(a) { font-size:11px; margin-top:12px; line-height:1.6; }
  .auth-card { padding:18px; }
  .auth-card input:not([type=checkbox]),.auth-card button { min-height:44px; }
  .auth-card input:not([type=checkbox]) { font-size:16px; }
  .auth-preferences button { min-width:44px; min-height:44px; }
  .room-tools-drawer button,.mechanics-shell > form > button,.hub-mechanics-panel > form > button,
  .screen-controls button,.screen-analysis-card > button,.party-shell > button { min-height:44px; }
  .room-tools-drawer[data-tool="board"] .whiteboard-toolbar button { width:44px; min-width:44px; height:44px; min-height:44px; }
  #chatView .room-composer-input .attachment-button { width:44px; min-width:44px; }
  #chatView .room-mode-tab { min-height:44px; }
  #chatView .room-mode-tabs { min-height:48px; }
  #chatView .room-side-panels .music-video-header .icon-button { width:44px; min-width:44px; height:44px; min-height:44px; }
  #chatView .mobile-room-controls .room-voice-panel { margin:0 8px 6px; }
  .room-voice-panel .voice-bar { min-height:52px; padding:6px 8px; }
  .room-voice-panel .voice-settings { padding:8px; }
  .room-voice-panel .voice-control { min-height:44px; min-width:44px; }
  .room-voice-panel .voice-summary { font-size:11px; }
  .room-voice-panel .voice-privacy { font-size:12px; }
  .screen-audio-toggle { min-height:44px; min-width:44px; }
  .screen-audio-volume input[type="range"],.notification-volume input[type="range"] { min-height:44px; }
  .notification-settings-body button { min-height:44px; }
  .screen-workspace-header h3 { font-size:17px; }
  .screen-workspace .screen-empty { min-height:144px; padding:16px 12px; }
  .screen-workspace .screen-analysis-card { padding:12px; }
  .room-pins-bar > .ghost { min-width:44px; min-height:44px; }
  .room-pin-jump { min-height:44px; }
  .legal-reader .legal-reader-header { padding:12px 14px 8px; }
  .legal-reader-header h2 { font-size:19px; }
  .legal-reader-header button { width:44px; min-width:44px; min-height:44px; }
  .legal-reader .legal-reader-tabs { flex-wrap:nowrap; overflow-x:auto; gap:2px; padding:0 10px 8px; }
  .legal-reader-tabs a { display:flex; align-items:center; flex:none; min-height:44px; padding:8px; white-space:nowrap; }
  .legal-reader .legal-reader-body { padding:16px 18px 24px; }
  .legal-reader-body h1 { font-size:26px; }
  body:has(> main:not(.shell)) > :is(header,main,footer) { padding:16px 18px; }
  body:has(> main:not(.shell)) h1 { font-size:32px; }
  body:has(> main:not(.shell)) h2 { font-size:22px; }
  body:has(> main:not(.shell)) section { margin-top:26px; }
  body:has(> main:not(.shell)) .intro { font-size:16px; }
  body:has(> main:not(.shell)) nav a,body:has(> main:not(.shell)) .button { display:inline-flex; align-items:center; min-height:44px; }
}
@media (max-width:355px) {
  .topbar { gap:0; }
  .brand-inline { gap:0; }
  .brand-home { gap:0; width:44px; min-width:44px; min-height:44px; padding:8px; }
  .brand-home strong { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); }
  .brand-home .brand-symbol-mini { display:grid; width:24px; height:24px; }
  .landing-hero h1 { font-size:28px; }
  .landing-inner,.discovery-view,.empty-state { padding-inline:12px; }
  .room-voice-panel .voice-actions { max-width:100%; }
  .room-voice-panel .voice-bar { flex-wrap:wrap; }
  .room-voice-panel .voice-heading { flex-basis:100%; }
  .auth-card { padding:14px; }
}
@media (prefers-reduced-motion:reduce) {
  .landing-hub-grid button,.welcome-action,.landing-action { transition:none; transform:none; }
}
