/* The four everyday destinations share one shell. Advanced views remain
   routable under their parent; a conversation owns the mobile viewport. */
[hidden] { display: none !important; }
.app-shell { grid-template-columns: 232px minmax(0, 1fr); }
.sidebar { padding: 28px 18px 22px; }
.brand { gap: 10px; padding: 0 2px; }
.brand strong { font-size: 16px; }
.brand small { margin-top: 3px; font-size: 10px; }
.workspace-label { margin: 30px 4px 20px; }
.nav-list { gap: 8px; }
.nav-link { min-height: 50px; padding: 12px 15px; font-size: 14px; }
.nav-link .icon { width: 21px; height: 21px; }
.nav-link.active { color: var(--action); background: var(--glass-raised); }
.sidebar-install { margin-top: 24px; }
.sidebar-install:empty { display: none; }
.sidebar-install .button { width: 100%; justify-content: flex-start; }
.sidebar-help { display: flex; align-items: center; justify-content: space-between; min-height: 44px; margin-bottom: 14px; color: var(--ink-secondary); font-size: 12px; }
.sidebar-help:hover { color: var(--action); }
.sidebar-bottom { padding: 24px 8px 0; }
.topbar { height: 64px; padding: 0 28px; }
.breadcrumb { min-width: 0; font-size: 15px; }
#breadcrumb-current { overflow: hidden; text-overflow: ellipsis; font-weight: 650; }
.mobile-brand { display: none; }
.global-search { width: min(280px, 35vw); min-width: 150px; }
.shell-context-action { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 10px; border-radius: 12px; color: var(--action); font-size: 13px; font-weight: 600; white-space: nowrap; }
.shell-context-action:hover { background: var(--action-soft); }
.app-back { margin-left: -10px; }
main { min-width: 0; min-height: calc(100dvh - 64px); padding: 28px; }
#view { min-width: 0; }
.app-bottom-nav { display: none; }
.page-heading { gap: 20px; align-items: flex-start; }
.page-heading > div:first-child { min-width: 0; }
.page-heading h1 { font-size: 27px; line-height: 1.4; letter-spacing: -.6px; }
.page-description { margin-top: 9px; line-height: 1.75; max-width: 720px; }
.tool-grid { gap: 16px; }
.tool-card { padding: 22px; }
.tool-description { font-size: 13px; line-height: 1.8; margin: 16px 0 20px; }
.tool-kind, .tool-card-footer { font-size: 11px; }
.tool-card-metrics { gap: 22px; }
.tool-card-metrics span { font-size: 11px; }
.tool-card-metrics strong { font-size: 19px; }
.settings-home { max-width: 1060px; margin: 0 auto; }
.settings-profile { display: flex; align-items: center; gap: 18px; padding: 5px 4px 27px; }
.settings-profile img { width: 64px; height: 64px; border-radius: 20px; box-shadow: var(--glass-control-shadow); flex: 0 0 auto; }
.settings-profile h1 { font-size: 26px; letter-spacing: -.7px; }
.settings-profile p { margin-top: 6px; font-size: 13px; color: var(--ink-secondary); }
.settings-home-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 22px; align-items: start; }
.settings-home-grid .column-stack { gap: 20px; }
.settings-group .panel-header { padding: 20px 22px 15px; flex-wrap: wrap; }
.settings-group h2 { font-size: 16px; }
.settings-group .panel-body { padding: 0 22px 20px; }
.settings-group .settings-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; min-height: 68px; padding: 12px 0; }
.settings-group .settings-row + .settings-row { border-top: 1px solid var(--line-soft); }
.settings-group .settings-label { display: block; font-size: 14px; font-weight: 550; color: var(--ink); }
.settings-group .settings-help { color: var(--ink-secondary); font-size: 12px; line-height: 1.8; margin-top: 3px; }
.settings-group select { min-height: 44px; width: auto; min-width: 112px; max-width: 140px; font-size: 13px; padding: 8px 10px; }
.settings-group .mini-definition { margin: 18px 0; font-size: 12px; }
.settings-install { margin-top: 16px; }
.settings-install .button { min-height: 46px; }
.settings-menu { padding: 0 10px 10px; }
.settings-menu-row { display: flex; align-items: center; gap: 13px; padding: 13px 12px; min-height: 76px; color: var(--ink); border-radius: 13px; }
.settings-menu-row:hover { background: var(--group-quiet); }
.settings-menu-row > span:nth-child(2) { min-width: 0; flex: 1; }
.settings-menu-row strong { display: block; font-size: 14px; font-weight: 550; }
.settings-menu-row small { display: block; margin-top: 5px; font-size: 11px; line-height: 1.6; color: var(--ink-tertiary); overflow-wrap: anywhere; }
.settings-menu-row > .icon { width: 16px; height: 16px; flex: 0 0 16px; color: var(--ink-tertiary); }
.settings-menu-icon { display: grid; place-items: center; width: 36px; height: 36px; flex: 0 0 36px; border-radius: 11px; background: var(--action-soft); color: var(--action); }
.settings-menu-icon .icon { width: 19px; height: 19px; }
.settings-footnote { padding: 0 4px; color: var(--ink-tertiary); font-size: 11px; }
.settings-connection-note { padding: 15px 0; color: var(--ink-secondary); font-size: 12px; line-height: 1.8; }
.settings-group .text-link { padding: 0; }
html[data-theme="dark"] .nav-link.active { color: var(--action); background: var(--group-selected); }
html[data-theme="dark"] .settings-menu-row:hover { background: var(--group-selected); }

@media (min-width: 801px) and (max-width: 1100px) {
  .app-shell { display: grid; grid-template-columns: 204px minmax(0, 1fr); }
  .sidebar { display: flex; padding: 26px 14px 20px; }
  .topbar { padding: 0 22px; }
  main { padding: 24px 22px; }
  .settings-home-grid { grid-template-columns: minmax(0, 1fr); }
  .tool-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 800px) {
  :root { --app-bottom-height: calc(64px + env(safe-area-inset-bottom, 0px)); }
  html { scroll-padding-top: 72px; scroll-padding-bottom: calc(var(--app-bottom-height) + 16px); }
  .app-shell { display: block; }
  .sidebar { display: none; }
  .topbar { height: calc(56px + env(safe-area-inset-top, 0px)); padding: env(safe-area-inset-top, 0px) 12px 0; gap: 6px; }
  .topbar .breadcrumb { flex: 1; min-width: 0; gap: 9px; font-size: 18px; }
  .mobile-brand { display: block; flex: 0 0 30px; border-radius: 10px; }
  body[data-shell-level="secondary"] .mobile-brand { display: none; }
  .topbar .global-search { display: none; }
  .topbar .icon-button { width: 44px; height: 44px; flex-basis: 44px; }
  .topbar .shell-context-action { padding: 0 7px; font-size: 12px; }
  .app-back { margin-left: -4px; }
  main { padding: 18px 16px calc(var(--app-bottom-height) + 24px); min-height: calc(100dvh - 56px); }
  body[data-workspace="groups"] main, body[data-workspace="knowledge"] main { padding: 10px 10px calc(var(--app-bottom-height) + 10px); }
  .app-bottom-nav { position: fixed; inset: auto 0 0; z-index: 20; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); height: var(--app-bottom-height); padding: 5px 10px calc(env(safe-area-inset-bottom, 0px) + 5px); background: rgba(248, 252, 255, .94); border-top: 1px solid var(--line); box-shadow: 0 -4px 24px -16px rgba(23, 50, 77, .2); backdrop-filter: blur(22px) saturate(125%); -webkit-backdrop-filter: blur(22px) saturate(125%); }
  .app-bottom-nav .nav-link { flex-direction: column; justify-content: center; gap: 3px; min-height: 54px; padding: 5px 4px; margin: 0 3px; border-radius: 15px; font-size: 11px; line-height: 1.25; color: var(--ink-secondary); box-shadow: none; }
  .app-bottom-nav .nav-link .icon { width: 23px; height: 23px; }
  .app-bottom-nav .nav-link.active { color: var(--action); background: var(--action-soft); }
  .app-bottom-nav .nav-link.active::before { display: none; }
  html[data-theme="dark"] .app-bottom-nav { background: rgba(17, 35, 53, .96); }
  html[data-theme="dark"] .app-bottom-nav .nav-link.active { background: var(--group-selected); }
  body.group-room-open .topbar, body.group-room-open #app-bottom-nav { display: none; }
  body.group-room-open main { min-height: 0; padding: 0; max-width: none; margin: 0; }
  body.group-room-open .page-footer { display: none; }
  .page-heading { display: flex; flex-direction: column; gap: 14px; margin-bottom: 20px; }
  .page-heading h1 { font-size: 24px; line-height: 1.45; }
  .page-description { font-size: 13px; line-height: 1.8; }
  .page-heading-actions { width: 100%; margin: 0; padding: 0; }
  .page-heading-actions .button { min-height: 44px; flex: 0 1 auto; }
  .tool-grid { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .tool-card { padding: 20px; }
  .tool-identity h2 { font-size: 16px; }
  .tool-card-metrics { padding: 13px 0; gap: 26px; }
  .tool-card-footer { flex-wrap: wrap; }
  .settings-profile { gap: 14px; padding: 8px 2px 25px; }
  .settings-profile img { width: 58px; height: 58px; border-radius: 18px; }
  .settings-profile h1 { font-size: 23px; }
  .settings-profile p { font-size: 12px; line-height: 1.75; }
  .settings-home-grid { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .settings-home-grid .column-stack { gap: 18px; }
  .settings-group .panel-header { padding: 18px 18px 12px; }
  .settings-group .panel-body { padding: 0 18px 18px; }
  .settings-group .settings-row { gap: 12px; }
  .settings-group select { font-size: 16px; max-width: 140px; min-width: 108px; }
  .settings-menu-row { min-height: 80px; padding: 13px 9px; }
  .settings-menu-row strong { font-size: 15px; }
  .settings-menu-row small { font-size: 12px; }
  .settings-footnote { font-size: 11px; }
  .settings-install .button { width: 100%; }
  .page-footer { font-size: 10px; padding-top: 20px; flex-wrap: wrap; gap: 6px; }
  .toast-region { bottom: calc(var(--app-bottom-height) + 12px); }
  #dialog-toast-region { bottom: 12px; }
  .search-field input, .select-field { font-size: 16px; }
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .app-bottom-nav { background: var(--paper); }
}
/* Cloud status typography belongs to the application layer, not materials. */
html:root .cloud-bridge-banner :is(strong, p, .cloud-heartbeat) { font-size: 12px; line-height: 1.55; }
html:root .cloud-bridge-banner strong { font-size: 13px; }
.live-read-diagnostics { color: var(--ink-muted); font-size: 12px; line-height: 1.6; }
.live-read-diagnostics > summary { cursor: pointer; padding: 8px 0; color: var(--ink-secondary); }
.live-read-diagnostics dl { display: grid; grid-template-columns: minmax(100px, auto) minmax(0, 1fr); gap: 7px 18px; margin: 6px 0 0; }
.live-read-diagnostics dt, .live-read-diagnostics dd { margin: 0; overflow-wrap: anywhere; }
.connection-banner > .live-read-diagnostics { flex-basis: 100%; }
