/* ==========================================================================
   Winterhoff Soft Glass — app layer (app.css)
   Product UI on top of core.css: app shell (sidebar, top bar, mobile tab bar),
   screens, dashboard widgets, chat, list views, settings, command palette.
   Requires: fonts.css, tokens.css, core.css. Behaviour: js/winterhoff.js + js/app.js.
   ========================================================================== */

/* ---------- Shell ---------- */
.wh-app { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); }
@media (max-width: 960px) { .wh-app { grid-template-columns: minmax(0, 1fr); } }

/* Sidebar */
.wh-sidebar {
  position: sticky; top: 0; height: 100vh; height: 100dvh; display: flex; flex-direction: column; gap: 6px;
  padding: calc(16px + env(safe-area-inset-top, 0px)) 14px calc(16px + env(safe-area-inset-bottom, 0px)) max(14px, env(safe-area-inset-left, 0px));
  background: var(--nav-bg); border-right: 1px solid var(--nav-line);
  -webkit-backdrop-filter: var(--nav-blur); backdrop-filter: var(--nav-blur); overflow-y: auto; z-index: 40;
}
.wh-sidebar .wh-logo { padding: 6px 8px 14px; }
.wh-side-label { padding: 14px 10px 6px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); }
.wh-side-link {
  position: relative; display: flex; align-items: center; gap: 12px; height: 42px; padding: 0 12px; border-radius: var(--r-md);
  color: var(--muted); text-decoration: none; font-size: 14px; font-weight: 600; transition: background-color .2s, color .2s;
}
.wh-side-link svg { width: 20px; height: 20px; flex-shrink: 0; }
.wh-side-link:hover { background: var(--hover); color: var(--fg); }
.wh-side-link[aria-current="page"] { background: var(--card-bg); color: var(--fg); box-shadow: var(--shadow-sm); }
.wh-side-link[aria-current="page"]::before { content: ""; position: absolute; left: -14px; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: var(--brand); }
.wh-side-link .wh-count { margin-left: auto; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px; background: var(--brand-fill); color: var(--on-brand); font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.wh-side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.wh-usage { padding: 14px; display: flex; flex-direction: column; gap: 8px; font-size: 13px; }
.wh-user { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: var(--r-md); color: var(--fg); text-decoration: none; }
.wh-user:hover { background: var(--hover); }
.wh-user .wh-avatar { margin: 0; border-color: transparent; }
.wh-user__meta { display: flex; flex-direction: column; min-width: 0; font-size: 13px; }
.wh-user__meta span { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Drawer behaviour on small screens */
.wh-scrim { position: fixed; inset: 0; z-index: 35; background: var(--scrim); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); opacity: 0; pointer-events: none; transition: opacity .3s var(--ease); }
@media (max-width: 960px) {
  .wh-sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: min(300px, 86vw); background: var(--menu-bg); box-shadow: var(--shadow-lg); transform: translateX(-104%); transition: transform .4s var(--ease); }
  .wh-app.is-drawer-open .wh-sidebar { transform: none; }
  .wh-app.is-drawer-open .wh-scrim { opacity: 1; pointer-events: auto; }
}

/* Main column */
.wh-main { min-width: 0; display: flex; flex-direction: column; }
@media (max-width: 720px) { .wh-main { padding-bottom: calc(var(--tabbar-h) + 16px + env(safe-area-inset-bottom, 0px)); } }

/* Top bar */
.wh-topbar {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 30; min-height: var(--topbar-h);
  display: flex; align-items: center; gap: 12px; padding-block: 10px;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
  background: var(--nav-bg); border-bottom: 1px solid var(--line);
  -webkit-backdrop-filter: var(--nav-blur); backdrop-filter: var(--nav-blur);
}
@media (min-width: 720px) { .wh-topbar { padding-left: 28px; padding-right: 28px; } }
.wh-topbar__title { display: flex; flex-direction: column; min-width: 0; }
.wh-topbar__title h1 { font-size: 20px; letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wh-topbar__title span { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wh-topbar__actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.wh-topbar__burger { display: none; }
@media (max-width: 960px) { .wh-topbar__burger { display: inline-flex; } }
.wh-search-btn { display: inline-flex; align-items: center; gap: 10px; height: 40px; min-width: 240px; padding: 0 12px 0 14px; border-radius: var(--r-field); border: 1px solid var(--field-line); background: var(--field-bg); color: var(--faint); font-size: 14px; cursor: pointer; transition: border-color .2s; }
.wh-search-btn:hover { border-color: var(--line-strong); }
.wh-search-btn svg { width: 17px; height: 17px; color: var(--muted); }
.wh-search-btn kbd { margin-left: auto; padding: 2px 7px; border-radius: 6px; background: var(--track); color: var(--muted); font: 600 11px var(--font-body); }
@media (max-width: 720px) { .wh-search-btn { min-width: 0; width: 40px; padding: 0; justify-content: center; } .wh-search-btn span, .wh-search-btn kbd { display: none; } }

/* Mobile tab bar */
.wh-tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: none;
  padding: 8px max(12px, env(safe-area-inset-left, 0px)) calc(8px + env(safe-area-inset-bottom, 0px)) max(12px, env(safe-area-inset-right, 0px));
}
.wh-tabbar__inner { display: flex; justify-content: space-around; gap: 4px; padding: 6px; border-radius: var(--r-nav); background: var(--nav-bg); border: 1px solid var(--nav-line); box-shadow: var(--shadow-lg); -webkit-backdrop-filter: var(--nav-blur); backdrop-filter: var(--nav-blur); }
.wh-tabbar a { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px; border-radius: calc(var(--r-nav) - 6px); color: var(--muted); text-decoration: none; font-size: 11px; font-weight: 600; transition: color .2s, background-color .25s; }
.wh-tabbar a svg { width: 22px; height: 22px; }
.wh-tabbar a[aria-current="page"] { color: var(--on-brand); background: var(--brand-fill); }
@media (max-width: 720px) { .wh-tabbar { display: block; } }

/* ---------- Screens ---------- */
.wh-screen { width: 100%; max-width: var(--content-max); margin-inline: auto; padding-block: 24px 48px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); display: flex; flex-direction: column; gap: 20px; }
@media (min-width: 720px) { .wh-screen { padding: 28px; gap: 24px; } }
.wh-screen:not([hidden]) { animation: wh-screen-in .45s var(--ease); }
.wh-screen-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; }
.wh-screen-head h2 { font-size: clamp(24px, 3vw, 32px); }
.wh-toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.wh-toolbar .wh-affix { flex: 1 1 220px; max-width: 360px; }

/* Dashboard */
.wh-kpis { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr)); }
.wh-kpi-card { padding: 20px; display: flex; flex-direction: column; gap: 8px; }
.wh-kpi-card__top { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--muted); font-weight: 600; }
.wh-kpi-card__icon { width: 34px; height: 34px; border-radius: var(--r-sm); display: grid; place-items: center; background: var(--chip); color: var(--accent-text); }
.wh-kpi-card__icon svg { width: 18px; height: 18px; }
.wh-kpi-card__value { font-family: var(--font-display); font-size: 32px; font-weight: 800; letter-spacing: -.035em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.wh-spark { height: 36px; width: 100%; }
.wh-dash-grid { display: grid; gap: 16px; grid-template-columns: repeat(12, minmax(0, 1fr)); }
.wh-dash-grid > * { grid-column: span 12; min-width: 0; }
@media (min-width: 1100px) { .wh-span-8 { grid-column: span 8; } .wh-span-4 { grid-column: span 4; } .wh-span-6 { grid-column: span 6; } }
.wh-panel-card { padding: 20px; display: flex; flex-direction: column; gap: 16px; }
.wh-panel-card__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.wh-panel-card__head h3 { font-size: 17px; letter-spacing: -.015em; }
.wh-activity { display: flex; flex-direction: column; margin: 0; padding: 0; list-style: none; }
.wh-activity li { display: flex; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); font-size: 14px; }
.wh-activity li:first-child { border-top: 0; padding-top: 0; }
.wh-activity .wh-avatar { margin: 0; width: 32px; height: 32px; font-size: 11px; flex-shrink: 0; border-color: transparent; }
.wh-activity time { display: block; font-size: 12px; color: var(--muted); }

/* Chat */
.wh-chat { display: grid; grid-template-columns: 300px minmax(0, 1fr); min-height: 640px; height: calc(100dvh - var(--topbar-h) - 56px); padding: 0; overflow: hidden; }
@media (max-width: 860px) { .wh-chat { grid-template-columns: minmax(0, 1fr); height: auto; min-height: 0; } .wh-chat__list { display: none; } }
.wh-chat__list { border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.wh-chat__list-head { padding: 16px; border-bottom: 1px solid var(--line); }
.wh-convos { flex: 1; overflow-y: auto; padding: 8px; display: flex; flex-direction: column; gap: 2px; }
.wh-convo { display: flex; gap: 12px; align-items: center; padding: 10px; border: 0; border-radius: var(--r-md); background: transparent; color: var(--fg); text-align: left; cursor: pointer; width: 100%; transition: background-color .2s; }
.wh-convo:hover { background: var(--hover); }
.wh-convo[aria-current="true"] { background: var(--chip); }
.wh-convo .wh-avatar { margin: 0; flex-shrink: 0; border-color: transparent; }
.wh-convo__meta { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.wh-convo__meta strong { font-size: 14px; }
.wh-convo__meta span { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wh-convo time { align-self: flex-start; font-size: 11px; color: var(--faint); }
.wh-thread { display: flex; flex-direction: column; min-height: 0; }
.wh-thread__head { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.wh-thread__head .wh-avatar { margin: 0; border-color: transparent; }
.wh-messages { flex: 1; overflow-y: auto; padding: 20px 18px; display: flex; flex-direction: column; gap: 10px; min-height: 360px; scroll-behavior: smooth; }
.wh-day { align-self: center; padding: 4px 12px; border-radius: 999px; background: var(--track); color: var(--muted); font-size: 11px; font-weight: 600; }
.wh-msg { max-width: min(78%, 560px); padding: 10px 14px; border-radius: 20px; font-size: 15px; line-height: 1.5; animation: wh-msg-in .35s var(--spring); overflow-wrap: anywhere; }
.wh-msg time { display: block; margin-top: 4px; font-size: 11px; opacity: .75; }
.wh-msg--them { align-self: flex-start; background: var(--bubble-them-bg); color: var(--bubble-them-fg); border: 1px solid var(--card-line); border-bottom-left-radius: 6px; }
.wh-msg--me { align-self: flex-end; background: var(--bubble-me-bg); color: var(--bubble-me-fg); border-bottom-right-radius: 6px; }
.wh-typing { align-self: flex-start; display: inline-flex; gap: 4px; padding: 14px 16px; border-radius: 20px 20px 20px 6px; background: var(--bubble-them-bg); border: 1px solid var(--card-line); }
.wh-typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: wh-typing 1.2s ease-in-out infinite; }
.wh-typing span:nth-child(2) { animation-delay: .15s; }
.wh-typing span:nth-child(3) { animation-delay: .3s; }
.wh-composer { display: flex; align-items: flex-end; gap: 8px; padding: 12px; border-top: 1px solid var(--line); }
.wh-composer .wh-textarea { min-height: 46px; max-height: 160px; resize: none; padding-top: 12px; }
.wh-quick { display: flex; gap: 6px; padding: 0 12px 10px; overflow-x: auto; }
.wh-quick button { flex-shrink: 0; height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--card-line); background: var(--card-bg); color: var(--fg); font-size: 13px; font-weight: 600; cursor: pointer; transition: border-color .2s; }
.wh-quick button:hover { border-color: var(--brand); }

/* Projects: list + grid views */
.wh-check-col { width: 44px; }
.wh-table input[type="checkbox"] { width: 17px; height: 17px; accent-color: var(--brand); }
.wh-table tr.is-selected { background: var(--chip); }
.wh-project-name { display: flex; align-items: center; gap: 12px; }
.wh-project-dot { width: 34px; height: 34px; flex-shrink: 0; border-radius: var(--r-sm); display: grid; place-items: center; background: var(--brand-fill); color: var(--on-brand); font-size: 13px; font-weight: 800; }
.wh-mini-progress { display: flex; align-items: center; gap: 10px; min-width: 140px; }
.wh-mini-progress .wh-progress { flex: 1; height: 6px; }
.wh-bulkbar { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: var(--r-md); background: var(--toast-bg); color: var(--toast-fg); font-size: 14px; font-weight: 600; animation: wh-pop .25s var(--ease); }
.wh-bulkbar .wh-btn { --h: 32px; padding: 0 12px; font-size: 13px; }
.wh-bulkbar .wh-btn--ghost { color: var(--toast-fg); }
.wh-cards { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }
.wh-project-card { padding: 20px; display: flex; flex-direction: column; gap: 14px; }

/* Settings */
.wh-settings { display: grid; gap: 24px; grid-template-columns: 220px minmax(0, 1fr); align-items: start; }
@media (max-width: 860px) { .wh-settings { grid-template-columns: minmax(0, 1fr); } .wh-settings__nav { position: static !important; flex-direction: row !important; overflow-x: auto; } }
.wh-settings__nav { position: sticky; top: calc(var(--topbar-h) + 24px); display: flex; flex-direction: column; gap: 2px; }
.wh-settings__nav a { padding: 9px 12px; border-radius: var(--r-md); color: var(--muted); text-decoration: none; font-size: 14px; font-weight: 600; white-space: nowrap; }
.wh-settings__nav a:hover, .wh-settings__nav a.is-active { background: var(--hover); color: var(--fg); }
.wh-set-section { padding: 24px; display: flex; flex-direction: column; gap: 18px; scroll-margin-top: calc(var(--topbar-h) + 24px); }
.wh-set-section h3 { font-size: 18px; }
.wh-set-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; padding-top: 16px; border-top: 1px solid var(--line); }
.wh-set-row:first-of-type { border-top: 0; padding-top: 0; }
.wh-set-row__text { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1 1 260px; }
.wh-set-row__text span { font-size: 13px; color: var(--muted); }
.wh-two { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.wh-theme-cards { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); }
.wh-theme-card { position: relative; display: flex; flex-direction: column; gap: 10px; padding: 10px; border-radius: var(--r-lg); border: 1.5px solid var(--card-line); background: var(--card-bg); cursor: pointer; font-size: 14px; font-weight: 600; transition: border-color .2s, transform .25s var(--spring); }
.wh-theme-card:hover { transform: translateY(-2px); }
.wh-theme-card input { position: absolute; opacity: 0; pointer-events: none; }
.wh-theme-card:has(input:checked) { border-color: var(--brand); box-shadow: 0 0 0 4px var(--ring); }
.wh-theme-card:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 3px; }
.wh-theme-card__preview { height: 72px; border-radius: var(--r-md); border: 1px solid var(--line); }
.wh-danger { border: 1px solid var(--error-bg); }
.wh-savebar {
  position: sticky; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 20; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 12px 12px 18px; border-radius: var(--r-nav); background: var(--toast-bg); color: var(--toast-fg); box-shadow: var(--shadow-lg); animation: wh-toast-in .4s var(--spring);
}
@media (max-width: 720px) { .wh-savebar { bottom: calc(var(--tabbar-h) + 24px + env(safe-area-inset-bottom, 0px)); } }
.wh-savebar .wh-btn--ghost { color: var(--toast-fg); }

/* Command palette */
.wh-palette { width: min(620px, calc(100% - 24px)); margin-top: 12vh; padding: 0; border: 1px solid var(--card-line); border-radius: var(--r-lg); background: var(--menu-bg); color: var(--fg); box-shadow: var(--shadow-lg); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); }
.wh-palette[open] { animation: wh-dialog-in .3s var(--spring); }
.wh-palette::backdrop { background: var(--scrim); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.wh-palette__search { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.wh-palette__search svg { width: 20px; height: 20px; color: var(--muted); flex-shrink: 0; }
.wh-palette__search input { flex: 1; min-width: 0; border: 0; background: transparent; font-size: 17px; outline: none; }
.wh-palette__list { max-height: min(50vh, 380px); overflow-y: auto; padding: 8px; margin: 0; list-style: none; }
.wh-palette__group { padding: 10px 10px 4px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); }
.wh-palette__item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--r-md); font-size: 15px; cursor: pointer; }
.wh-palette__item svg { width: 18px; height: 18px; color: var(--muted); }
.wh-palette__item[aria-selected="true"] { background: var(--chip); }
.wh-palette__item kbd { margin-left: auto; font: 600 11px var(--font-body); color: var(--muted); }
.wh-palette__empty { padding: 28px; text-align: center; color: var(--muted); font-size: 14px; }
.wh-palette__foot { display: flex; gap: 16px; padding: 10px 18px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }

@keyframes wh-screen-in { from { opacity: 0; transform: translateY(8px); } }
@keyframes wh-msg-in { from { opacity: 0; transform: translateY(10px) scale(.96); } }
@keyframes wh-typing { 0%, 60%, 100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-4px); opacity: 1; } }

/* ==========================================================================
   App menu systems
   ========================================================================== */

/* Sidebar head: logo + collapse button */
.wh-side-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.wh-side-head .wh-logo { padding: 6px 8px 14px; }
.wh-rail-toggle { margin-bottom: 8px; }
.wh-rail-toggle svg { transition: transform .35s var(--ease); }
@media (max-width: 960px) { .wh-rail-toggle { display: none; } }
.wh-side-link__label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Collapsible groups in the sidebar */
.wh-side-group > summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; border-radius: var(--r-sm); }
.wh-side-group > summary::-webkit-details-marker { display: none; }
.wh-side-group > summary:hover { color: var(--muted); }
.wh-side-group > summary svg { width: 14px; height: 14px; transition: transform .3s var(--ease); }
.wh-side-group[open] > summary svg { transform: rotate(90deg); }
.wh-side-group[open] > .wh-side-sub { animation: wh-fade-up .3s var(--ease); }
.wh-side-sub { display: flex; flex-direction: column; gap: 2px; }

/* Rail mode: sidebar collapsed to icons (desktop). Toggle: [data-rail-toggle] → .wh-app.is-rail */
@media (min-width: 961px) {
  .wh-app { transition: grid-template-columns .35s var(--ease); }
  .wh-app.is-rail { grid-template-columns: 80px minmax(0, 1fr); }
  .wh-app.is-rail .wh-sidebar { padding-left: 12px; padding-right: 12px; overflow: visible; }
  .wh-app.is-rail .wh-side-head { flex-direction: column; }
  .wh-app.is-rail .wh-logo { font-size: 0; gap: 0; padding: 6px 0 8px; }
  .wh-app.is-rail .wh-rail-toggle svg { transform: rotate(180deg); }
  .wh-app.is-rail .wh-side-link { justify-content: center; padding: 0; }
  .wh-app.is-rail .wh-side-link__label, .wh-app.is-rail .wh-side-group > summary, .wh-app.is-rail .wh-usage,
  .wh-app.is-rail .wh-user__meta, .wh-app.is-rail .wh-sidebar .wh-search-btn span, .wh-app.is-rail .wh-sidebar .wh-search-btn kbd { display: none; }
  .wh-app.is-rail .wh-side-group:not([open]) > .wh-side-sub { display: flex; }
  .wh-app.is-rail .wh-sidebar .wh-search-btn { justify-content: center; padding: 0; }
  .wh-app.is-rail .wh-side-link .wh-count { position: absolute; top: 2px; right: 6px; min-width: 18px; height: 18px; padding: 0 5px; font-size: 10px; }
  .wh-app.is-rail .wh-user { justify-content: center; }
  /* Tooltip with the label */
  .wh-app.is-rail .wh-side-link::after {
    content: attr(data-label); position: absolute; left: calc(100% + 12px); top: 50%; translate: -4px -50%; padding: 6px 10px; border-radius: var(--r-sm);
    background: var(--fg); color: var(--bg); font-size: 12px; font-weight: 600; white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity .15s, translate .2s var(--ease); z-index: 50;
  }
  .wh-app.is-rail .wh-side-link:hover::after, .wh-app.is-rail .wh-side-link:focus-visible::after { opacity: 1; translate: 0 -50%; }
  .wh-app.is-rail .wh-side-link[aria-current="page"]::before { left: -12px; }
}

/* Top bar user button + menu */
.wh-user-btn { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 10px 0 4px; border-radius: var(--r-control); border: 1px solid var(--line); background: var(--surface); color: var(--fg); cursor: pointer; font-weight: 600; font-size: 14px; }
.wh-user-btn:hover { border-color: var(--line-strong); }
.wh-user-btn .wh-avatar { margin: 0; width: 32px; height: 32px; font-size: 11px; border-color: transparent; }
.wh-user-btn svg { width: 16px; height: 16px; color: var(--muted); }
@media (max-width: 720px) { .wh-user-btn { padding: 0 4px; } .wh-user-btn > span:not(.wh-avatar), .wh-user-btn > svg { display: none; } }

/* Tab bar with a centered create button and a "More" item */
.wh-tabbar__inner { align-items: center; }
.wh-tabbar button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px; border: 0; border-radius: calc(var(--r-nav) - 6px); background: transparent; color: var(--muted); font-size: 11px; font-weight: 600; cursor: pointer; }
.wh-tabbar button svg { width: 22px; height: 22px; }
.wh-tabbar .wh-tabbar__fab { flex: 0 0 auto; width: 52px; height: 52px; padding: 0; margin: -18px 4px 0; border-radius: 50%; background: var(--brand-fill); color: var(--on-brand); box-shadow: var(--brand-shadow); justify-content: center; transition: transform .25s var(--spring); }
.wh-tabbar .wh-tabbar__fab:active { transform: scale(.92); }
.wh-tabbar .wh-tabbar__fab svg { width: 24px; height: 24px; }
.wh-tabbar a[aria-current="page"] svg { animation: wh-pop .35s var(--spring); }

/* Row actions button in tables */
.wh-row-actions { width: 52px; text-align: right; }
.wh-tabbar button[aria-current="page"]:not(.wh-tabbar__fab) { color: var(--on-brand); background: var(--brand-fill); }
.wh-menu a[role="menuitem"] { text-decoration: none; }
