/* Persistent dashboard chrome; onboarding keeps its full-width header. */
.dashboard-page { --sidebar: 280px; }
.dashboard-page .app-shell:not(.is-setup) .sidebar { padding: 16px 16px 12px; }
.dashboard-page .app-shell:not(.is-setup) .sidebar > .brand { gap: 8px; margin: 6px 8px 30px; align-self: flex-start; }
.dashboard-page .app-shell:not(.is-setup) .brand-mark { display: block; width: 28px; height: 28px; }
.dashboard-page .app-shell:not(.is-setup) .brand-wordmark { width: 119px; height: 30px; }
.dashboard-page .app-shell:not(.is-setup) .sidebar-collapse { position: absolute; top: 21px; right: 17px; width: 30px; height: 32px; min-height: 0; padding: 6px; margin: 0; border: 0; }
.sidebar-collapse svg { width: 18px; height: 18px; }
.shell-menu-anchor { position: relative; min-width: 0; }
.project-picker { margin-bottom: 7px; --project-menu-bg: #fff; --project-trigger-bg: #f0f1f3; --project-selected: #eeeef0; --project-hover: #f5f5f6; --project-line: #e6e6e9; --project-check: #626774; --project-status: #737782; }
html[data-theme=dark] .project-picker { --project-menu-bg: #17181a; --project-trigger-bg: #18191b; --project-selected: #232427; --project-hover: #252629; --project-line: #292a2e; --project-check: #a1a5b0; --project-status: #92959e; }
.project-picker-trigger { display: flex; align-items: center; gap: 11px; width: 100%; min-height: 64px; padding: 12px; border: 0; border-radius: 10px; text-align: left; background: var(--project-trigger-bg); color: var(--ink); transition: background .16s; }
.project-picker-trigger:hover, .project-picker-trigger[aria-expanded=true] { background: var(--project-trigger-bg); box-shadow: none; }
.project-picker-trigger:focus-visible { outline: 1px solid var(--project-check); outline-offset: 2px; box-shadow: none; }
.project-picker-trigger > svg { flex: none; width: 15px; height: 15px; color: var(--muted); transition: transform .2s; }
.project-picker-trigger[aria-expanded=true] > svg { transform: rotate(180deg); }
.project-switch-copy, .project-option-copy { display: grid; flex: 1; min-width: 0; gap: 3px; }
.project-switch-copy strong, .project-option-copy strong { font-weight: 550; font-size: var(--text-sm); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.project-switch-copy small, .project-option-copy small { color: var(--muted); font-size: var(--text-sm); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.dashboard-page .app-shell:not(.is-setup) .project-picker .project-avatar { display: inline-flex; }
.project-avatar { flex: none; width: 36px; height: 36px; overflow: hidden; background: var(--soft); }
.project-avatar img { width: 100%; height: 100%; object-fit: contain; }
.dashboard-page .app-shell:not(.is-setup) .sidebar-project-action { margin: 0 0 24px; padding: 10px 12px; min-height: 38px; color: var(--muted); }
.dashboard-page .app-shell:not(.is-setup) .sidebar-section-label { font-size: var(--text-sm); margin: 0 0 10px; padding-inline: 12px; }
.dashboard-page .app-shell:not(.is-setup) .sidebar-help { margin-top: auto; padding-top: 20px; }
.dashboard-page .app-shell:not(.is-setup) .profile-footer { margin-top: 12px; padding-top: 10px; }
.dashboard-page .app-shell:not(.is-setup) .profile-trigger { padding: 8px 6px; gap: 10px; }
.profile-chevron { margin-left: auto; flex: none; width: 15px; height: 15px; }
.profile-chevron svg { width: 15px; height: 15px; transition: transform .2s; }
.profile-trigger[aria-expanded=true] .profile-chevron svg { transform: rotate(180deg); }
.dashboard-page .profile-copy { font-size: var(--text-sm); }
.dashboard-page .profile-copy small { font-size: var(--text-sm); }
.shell-dropdown { position: absolute; z-index: 65; min-width: 240px; padding: 6px; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 12px 40px #00000014, 0 2px 6px #00000005; animation: none; }
.shell-menu-heading { padding: 9px 10px 8px; color: var(--muted); font-size: var(--text-sm); font-weight: 550; letter-spacing: .02em; }
.shell-dropdown button[role^=menuitem] { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; padding: 10px; min-height: 40px; border-radius: 10px; background: transparent; color: var(--ink); text-align: left; font-size: var(--text-sm); }
.shell-dropdown button[role^=menuitem]:hover, .shell-dropdown button[role^=menuitem]:focus-visible { background: var(--soft); outline-offset: -2px; }
.shell-dropdown button[role^=menuitem] > svg { width: 17px; height: 17px; flex: none; color: var(--muted); }
.shell-dropdown button[role=menuitemradio] > svg { margin-left: auto; opacity: 0; width: 15px; color: var(--blue); }
.shell-dropdown button[aria-checked=true] { background: var(--soft); }
.shell-dropdown button[aria-checked=true] > svg { opacity: 1; }
.shell-dropdown button[role^=menuitem] + button[role^=menuitem] { margin-top: 3px; }
.shell-dropdown .menu-divider { margin: 5px 8px; }
.project-menu { top: calc(100% + 8px); left: 0; width: 100%; min-width: 0; padding: 7px; display: flex; flex-direction: column; max-height: min(620px, calc(100dvh - 190px)); background: var(--project-menu-bg); border-color: var(--project-line); border-radius: 10px; box-shadow: 0 12px 34px #00000024; }
#project-options { min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.project-menu .shell-menu-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 10px 12px; font-size: var(--text-sm); font-weight: 400; letter-spacing: 0; color: var(--project-status); }
.project-option-list { display: grid; gap: 3px; }
.project-menu button.project-option { min-height: 61px; padding: 12px 10px; gap: 11px; border: 0; border-radius: 5px; background: transparent; }
.project-menu button.project-option[aria-checked=true] { background: var(--project-selected); }
.project-menu button.project-option:hover, .project-menu button.project-option:focus-visible { background: var(--project-hover); }
.project-menu button.project-option[aria-checked=true]:hover, .project-menu button.project-option[aria-checked=true]:focus-visible { background: var(--project-selected); }
.project-menu button.project-option:focus-visible { outline: 1px solid var(--project-check); outline-offset: -2px; }
.project-picker-trigger .project-avatar { width: 32px; height: 32px; border-radius: 10px; }
.project-menu .project-avatar { width: 29px; height: 29px; border-radius: 10px; }
.project-menu .project-option-copy { gap: 5px; }
.project-menu .project-option-copy strong { font-size: var(--text-sm); font-weight: 500; line-height: 1.4; }
.project-menu .project-option-status { display: flex; align-items: center; gap: 5px; line-height: 1.4; font-size: var(--text-sm); color: var(--project-status); }
.project-option-status[data-kind=unread] { color: var(--blue); }
.project-option-status[data-kind=unpublished] { color: var(--warning); }
.project-option-status:is([data-kind=payment],[data-kind=unread],[data-kind=unpublished],[data-kind=setup])::before { content: ""; width: 3px; height: 3px; border-radius: 50%; background: currentColor; flex: none; }
.project-option-status[data-kind=payment]::before { background: #a4947c; }
.project-option-status:is([data-kind=unpublished],[data-kind=setup])::before { width: 5px; height: 5px; }
.project-menu button.project-option > svg { display: block; width: 14px; height: 14px; color: var(--project-check); }
.project-menu-footer { flex: none; margin: 10px 4px 0; padding-top: 6px; border-top: 1px solid var(--project-line); }
.project-menu-footer button[role=menuitem] { color: var(--project-status); gap: 10px; padding: 10px 7px; font-size: var(--text-sm); border-radius: 5px; }
.project-menu-footer button[role=menuitem]:hover, .project-menu-footer button[role=menuitem]:focus-visible { background: var(--project-hover); outline-color: var(--project-check); }
.dashboard-page .profile-menu { width: 100%; min-width: 248px; bottom: calc(100% + 8px); border-radius: 14px; }
.profile-theme-toggle .theme-sun { display: none; }
html[data-theme=dark] .profile-theme-toggle .theme-sun { display: block; }
html[data-theme=dark] .profile-theme-toggle .theme-moon { display: none; }
.dashboard-page .app-shell:not(.is-setup) .topbar { position: relative; z-index: 25; height: 72px; min-height: 72px; }
.dashboard-page .app-shell:not(.is-setup) .topbar-title > h1 { display: block; font-size: var(--text-md); color: var(--ink); font-weight: 550; }
.dashboard-page .app-shell:not(.is-setup) .topbar-actions { gap: 14px; }
.dashboard-page .app-shell:not(.is-setup) .topbar { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); }
.dashboard-page .app-shell:not(.is-setup) .topbar-actions { justify-self: end; grid-column: 3; }
.view-toggle { position: relative; display: grid; grid-template-columns: 1fr 1fr; padding: 3px; border-radius: 999px; background: #1922380d; }
.view-toggle[hidden] { display: none; }
.view-toggle-thumb { position: absolute; inset: 3px auto 3px 3px; width: calc(50% - 3px); border-radius: 999px; background: var(--surface); box-shadow: 0 1px 2px #19223824, 0 0 0 .5px #19223814; transition: transform .28s var(--ease); }
.view-toggle[data-mode=support] .view-toggle-thumb { transform: translateX(100%); }
.view-toggle button { position: relative; z-index: 1; display: flex; align-items: center; justify-content: center; min-width: 84px; height: 30px; padding: 0 16px; border: 0; border-radius: 999px; background: none; color: var(--muted); font-size: var(--text-sm); font-weight: 550; transition: color .2s; }
.view-toggle button:hover, .view-toggle button[aria-checked=true] { color: var(--ink); }
.view-toggle button:focus-visible { outline: 2px solid var(--blue); outline-offset: 1px; }
html[data-theme=dark] .view-toggle { background: #ffffff0d; }
html[data-theme=dark] .view-toggle-thumb { background: #ffffff1a; box-shadow: inset 0 .5px 0 #ffffff1f; }
@media (prefers-reduced-motion: reduce) { .view-toggle-thumb { transition: none; } }
@media (max-width: 1024px) {
  .view-toggle button { min-width: 0; padding: 0 12px; }
}
.availability-trigger { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 7px 10px; border: 1px solid transparent; border-radius: 10px; background: transparent; color: var(--muted); font-size: var(--text-sm); }
.availability-trigger:hover, .availability-trigger[aria-expanded=true] { background: var(--soft); border-color: var(--line); }
.availability-trigger > svg { width: 14px; height: 14px; }
#availability-menu { top: calc(100% + 12px); right: 0; width: 264px; }
#availability-menu button > span:nth-child(2) { display: grid; gap: 4px; }
#availability-menu strong { font-size: var(--text-sm); font-weight: 550; }
#availability-menu small { color: var(--muted); font-size: var(--text-sm); }
#availability-menu .status-dot { flex: none; width: 7px; height: 7px; }
/* Away presets: icon, reason, and its length on the right (or when you're back, once chosen). */
#availability-menu { width: 300px; }
#availability-menu button[role=menuitemradio] > .away-icon { width: 16px; height: 16px; flex: none; margin-left: 0; opacity: 1; color: var(--muted); }
#availability-menu [data-away] strong, #availability-menu [data-availability=away] > strong { flex: 1; }
#availability-menu .away-length { margin-left: auto; white-space: nowrap; font-size: var(--text-sm); }
#availability-menu [data-availability=away][aria-checked=true] .away-length { color: var(--ink); }
.availability-trigger .status-dot.away, #availability-menu .status-dot.away { background: var(--warning); }
/* The confirm step when going away would leave a team uncovered or you hold open conversations. */
.away-confirm { display: grid; gap: 10px; padding: 8px 8px 6px; }
.away-confirm[hidden] { display: none; }
.away-confirm-back { display: inline-flex; align-items: center; gap: 4px; justify-self: start; padding: 2px 4px 2px 0; border: 0; background: none; color: var(--muted); font-size: var(--text-sm); }
.away-confirm-back svg { width: 14px; height: 14px; }
.away-confirm-back:hover { color: var(--ink); }
.away-confirm-title { margin: 0; color: var(--ink); font-size: var(--text-base, 14px); font-weight: 600; }
.away-confirm-warning { display: flex; gap: 9px; padding: 10px; border: 1px solid color-mix(in srgb, var(--warning) 35%, transparent); border-radius: 10px; background: color-mix(in srgb, var(--warning) 11%, transparent); color: var(--ink); font-size: var(--text-sm); line-height: 1.45; }
.away-confirm-warning[hidden] { display: none; }
.away-confirm-warning > svg { width: 16px; height: 16px; flex: none; margin-top: 1px; color: var(--warning); }
.away-confirm-warning ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 2px; }
.away-confirm-check { display: flex; align-items: flex-start; gap: 10px; width: 100%; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: transparent; color: var(--ink); text-align: left; font-size: var(--text-sm); line-height: 1.45; }
.away-confirm-check[hidden] { display: none; }
.away-confirm-check:hover { background: var(--soft); }
.away-confirm-check strong { display: block; font-weight: 500; }
.away-confirm-check small { display: block; color: var(--muted); font-size: var(--text-sm); }
.away-check-box { display: grid; place-items: center; width: 16px; height: 16px; flex: none; margin-top: 1px; border: 1px solid var(--line); border-radius: 5px; }
.away-check-box svg { width: 11px; height: 11px; opacity: 0; color: #fff; }
.away-confirm-check[aria-checked=true] .away-check-box { border-color: var(--blue); background: var(--blue); }
.away-confirm-check[aria-checked=true] .away-check-box svg { opacity: 1; }
.away-confirm-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 2px; }
.availability-back { margin-left: -4px; color: var(--muted); white-space: nowrap; }
.availability-back::before { content: "· "; }
.notification-menu { top: calc(100% + 15px); right: 0; width: min(376px, calc(100vw - 32px)); padding: 0; overflow: hidden; }
.notification-menu > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px; border-bottom: 1px solid var(--line); }
.notification-menu h2 { font-size: var(--text-md); letter-spacing: -.2px; font-weight: 600; }
.notification-menu header .text-button { font-size: var(--text-sm); color: var(--muted); }
#notification-items { max-height: min(420px, calc(100dvh - 170px)); overflow-y: auto; overscroll-behavior: contain; }
.notification-item { display: flex; align-items: flex-start; gap: 11px; padding: 16px; width: 100%; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: var(--ink); text-align: left; }
.notification-item:hover, .notification-item:focus-visible { background: var(--soft); }
.notification-item-icon { display: grid; place-items: center; flex: none; width: 32px; height: 32px; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); }
.notification-item-icon svg { width: 16px; height: 16px; }
.notification-item > span:nth-child(2) { display: grid; flex: 1; gap: 5px; min-width: 0; }
.notification-item strong { font-size: var(--text-sm); font-weight: 500; line-height: 1.5; overflow-wrap: anywhere; }
.notification-item small { color: var(--muted); font-size: var(--text-sm); }
.notification-unread-dot { flex: none; width: 6px; height: 6px; margin-top: 6px; border-radius: 50%; }
.unread .notification-unread-dot { background: var(--blue); }
.notification-empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 42px 28px; font-size: var(--text-sm); color: var(--muted); }
.notification-empty svg { width: 24px; height: 24px; margin-bottom: 6px; }
.notification-empty strong { color: var(--ink); font-weight: 550; }
.notification-empty p { margin: 0; font-size: var(--text-sm); line-height: 1.6; }
.is-setup .project-picker { display: none; }
.is-setup .profile-menu { top: calc(100% + 8px); bottom: auto; left: auto; right: 0; width: 248px; }
.is-setup .profile-menu .shell-menu-heading { display: none; }
@media (max-width: 680px) {
  .dashboard-page .app-shell:not(.is-setup) .sidebar > .brand { margin-bottom: 26px; }
  .dashboard-page .app-shell:not(.is-setup) .topbar-actions { gap: 5px; }
  .dashboard-page .app-shell:not(.is-setup) .topbar-title > h1 { font-size: var(--text-sm); }
  .project-menu { min-width: 0; width: 100%; }
  .availability-trigger { padding-inline: 6px; gap: 6px; }
  #availability-menu { right: -45px; }
  .dashboard-page .profile-menu { min-width: 0; }
}
/* Phones: a tighter view pill, and availability shows just its dot so the pill fits. */
@media (max-width: 480px) {
  .view-toggle button { height: 28px; padding: 0 9px; font-size: 13px; }
  .availability-trigger :is([data-availability-label], [data-availability-back]) { display: none; }
}
/* No room for the sound toggle beside the view switcher on the narrowest phones. */
@media (max-width: 400px) {
  .dashboard-page .sound-toggle { display: none; }
}
@media (max-height: 720px) {
  .dashboard-page .app-shell:not(.is-setup) .sidebar > .brand { margin-bottom: 16px; }
  .dashboard-page .app-shell:not(.is-setup) .sidebar-project-action { margin-bottom: 14px; }
  .dashboard-page .app-shell:not(.is-setup) .sidebar-help { padding-top: 8px; }
}
@media (prefers-reduced-motion: reduce) { .project-picker-trigger, .project-picker-trigger > svg, .profile-chevron svg { transition: none; } }
#sidebar-collapse .nav-text { display: none; }
@media (max-height: 660px) {
  .dashboard-page .app-shell:not(.is-setup) { grid-template-rows: minmax(0, 1fr); }
  .dashboard-page .app-shell:not(.is-setup) .sidebar { overflow: visible; min-height: 0; }
  .dashboard-page .app-shell:not(.is-setup) .sidebar > * { flex-shrink: 0; }
  .dashboard-page .app-shell:not(.is-setup) #main-nav { flex-shrink: 1; min-height: 38px; overflow-y: auto; scrollbar-width: thin; }
}

/* A colour dot before a sub-link's label (e.g. each inbox's widget colour). */
.nav-sublink .nav-sub-dot {
  flex: none;
  width: 8px;
  height: 8px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--dot, var(--muted));
}
/* The label sits right after the dot, not pushed to the far side. */
.nav-sublink .nav-sub-dot + span {
  flex: 1;
  min-width: 0;
}

/* ---------- Tool hover (tool-hover.js) ----------
   One highlight slides between the tools of a row and the button's name rides along on a small card.
   Round by default; a row with "is-boxed" has outlined buttons, and the highlight fills each one's own shape.
   :not(#_) beats the app-wide and dark-theme .icon-button:hover box. */
.tool-hover {
  position: relative;
  --tool-border: transparent;
}
.tool-hover.is-boxed {
  --tool-border: var(--line);
}
.tool-hover :is(.icon-button, [data-tool]):not(#_) {
  transition: color 0.14s ease, background-color 0.14s ease, transform 0.14s ease;
}
.tool-hover .icon-button:not(#_),
.tool-hover .icon-button:not(#_):hover {
  border-color: var(--tool-border);
}
.tool-hover .icon-button:not(#_):hover {
  background: transparent;
  color: var(--ink);
}
/* A named tool (data-tool) with its menu open keeps its own open look. */
.tool-hover [data-tool]:not(#_):not([aria-expanded="true"]):hover {
  background: transparent;
  border-color: transparent;
  color: var(--ink);
}
.tool-hover :is(.icon-button, [data-tool]):not(#_):active {
  transform: scale(0.94);
}
.tool-hover [data-tool]:not(#_):active {
  transform: scale(0.98);
}
.tool-hover-glide {
  position: absolute;
  left: 0;
  top: 0;
  width: var(--w, 30px);
  height: var(--h, 30px);
  border-radius: 50%;
  background: color-mix(in srgb, var(--composer-accent, #5f80e6) 20%, transparent);
  pointer-events: none;
  opacity: 0;
  translate: var(--x, 0) var(--y, 0);
  transform: scale(0.6);
  transition:
    translate 0.26s cubic-bezier(0.3, 1.3, 0.5, 1),
    transform 0.26s cubic-bezier(0.3, 1.3, 0.5, 1),
    width 0.26s cubic-bezier(0.3, 1.3, 0.5, 1),
    height 0.26s cubic-bezier(0.3, 1.3, 0.5, 1),
    opacity 0.14s ease;
}
.tool-hover.is-boxed > .tool-hover-glide {
  border-radius: 10px;
  transform: scale(0.9);
}
.tool-hover > .tool-hover-glide.is-on {
  opacity: 1;
  transform: none;
}
.tool-hover-tip {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.3;
  white-space: nowrap;
  box-shadow: 0 14px 30px -14px rgb(20 30 60 / 45%);
  pointer-events: none;
  opacity: 0;
  translate: calc(var(--x, 0px) - 50%) calc(var(--y, 0px) - 100% - 9px);
  transform: translateY(4px);
  transition:
    translate 0.26s cubic-bezier(0.3, 1.3, 0.5, 1),
    transform 0.14s ease,
    opacity 0.14s ease;
}
.tool-hover-tip.is-below {
  translate: calc(var(--x, 0px) - 50%) calc(var(--y, 0px) + 9px);
  transform: translateY(-4px);
}
.tool-hover-tip.has-key {
  padding-right: 7px;
}
.tool-hover-tip.is-on {
  opacity: 1;
  transform: none;
}
.tool-hover-tip kbd {
  display: inline-grid;
  place-items: center;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
}
html[data-theme="dark"] .tool-hover-tip {
  background: #1c1c1f;
  border-color: #3a3a3f;
}
html[data-theme="dark"] .tool-hover-tip kbd {
  border-color: #44444a;
}
@media (prefers-reduced-motion: reduce) {
  .tool-hover-glide,
  .tool-hover-tip {
    transition-duration: 0.01s;
  }
}
