/* ============================================================
   Dzenity 2026 — application shell & components
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }

html { height: 100%; }

body {
  margin: 0;
  min-height: 100%;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  letter-spacing: var(--track);
  font-feature-settings: "ss01" on, "cv11" on;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  caret-color: var(--flame);
}

::selection { background: var(--flame-soft); color: var(--ink); }
[data-theme="dark"] ::selection { background: rgba(251, 106, 20, 0.35); color: #fff6ec; }

/* Themed scrollbars — the chrome we did not draw still carries the design */
* { scrollbar-width: thin; scrollbar-color: var(--line-input) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: var(--line-input); border-radius: 999px; border: 3px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-track { background: transparent; }

a { color: var(--flame); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

h1, h2, h3, h4, p { margin: 0; }

button {
  font: inherit;
  letter-spacing: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

:focus-visible {
  outline: 2px solid var(--flame);
  outline-offset: 2px;
  border-radius: 6px;
}

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: 16px; top: -48px; z-index: 100;
  background: var(--card); color: var(--ink);
  padding: 10px 16px; border-radius: var(--r-btn);
  box-shadow: var(--shadow-raised);
  transition: transform var(--t-fast) var(--ease-out);
}
.skip-link:focus-visible { top: 12px; }

.icon { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.icon-sm { width: 15px; height: 15px; }

/* ============================================================
   Shell
   ============================================================ */

.shell { display: flex; min-height: 100vh; }

/* ---------------- Sidebar ---------------- */

.sidebar {
  position: sticky; top: 0; align-self: flex-start;
  display: flex; flex-direction: column;
  width: var(--sidebar-w);
  height: 100vh;
  flex: none;
  padding: 14px 12px;
  border-right: 1px solid var(--line-canvas);
  background: var(--canvas);
}

.workspace-switcher {
  display: flex; align-items: center; gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border-radius: var(--r-btn-lg);
  text-align: left;
  transition: background-color var(--t-fast) var(--ease-out);
}
.workspace-switcher:hover { background: var(--flame-soft-2); }
[data-theme="dark"] .workspace-switcher:hover { background: var(--flame-soft); }

.logo-mark {
  width: 30px; height: 30px; flex: none;
  display: grid; place-items: center;
  border-radius: 9px;
  background: var(--flame);
  color: #fff;
  box-shadow: var(--shadow-btn);
}
.logo-mark svg { width: 17px; height: 17px; stroke: #fff; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.workspace-meta { min-width: 0; flex: 1; }
.workspace-name { font-size: var(--fs-md); font-weight: 600; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.workspace-kind { font-size: 12px; color: var(--ink-3); line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.workspace-switcher .icon { color: var(--ink-3); width: 16px; height: 16px; }

.sidebar-create {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin: 12px 4px 6px;
  height: 42px;
  border-radius: var(--r-btn-lg);
  background: var(--flame);
  color: #fff;
  font-weight: 600;
  font-size: var(--fs-md);
  box-shadow: var(--shadow-btn);
  transition: background-color var(--t-fast) var(--ease-out), transform var(--t-fast) var(--ease-out);
}
.sidebar-create:hover { background: var(--flame-hover); box-shadow: var(--shadow-glow); }
.sidebar-create:active { transform: scale(0.98); background: var(--flame-press); }
.sidebar-create .icon { stroke-width: 2.2; width: 16px; height: 16px; }

.sidebar-search {
  display: flex; align-items: center; gap: 9px;
  margin: 0 4px 10px;
  height: 38px;
  padding: 0 10px;
  border-radius: var(--r-btn-lg);
  border: 1px solid var(--line-canvas);
  background: var(--card);
  color: var(--ink-3);
  font-size: var(--fs-body);
  transition: border-color var(--t-fast) var(--ease-out);
}
.sidebar-search:hover { border-color: var(--line-input); }
.sidebar-search .kbd-hint { margin-left: auto; }

.kbd-hint {
  font-size: 11.5px; font-weight: 500;
  color: var(--ink-3);
  background: var(--card-sunken);
  border: 1px solid var(--line-canvas);
  border-radius: 6px;
  padding: 2px 6px;
  font-variant-numeric: tabular-nums;
}

.sidebar-nav { flex: 1; overflow-y: auto; padding: 2px 0 8px; min-height: 0; }
.sidebar-nav ul { list-style: none; margin: 0; padding: 0; }

.nav-item {
  display: flex; align-items: center; gap: 10px;
  height: 36px;
  padding: 0 10px;
  margin: 1px 4px;
  border-radius: 10px;
  color: var(--ink-2);
  font-size: var(--fs-body);
  font-weight: 500;
  text-decoration: none;
  transition: background-color var(--t-fast) var(--ease-out), color var(--t-fast) var(--ease-out);
}
.nav-item:hover { background: var(--flame-soft-2); color: var(--ink); text-decoration: none; }
[data-theme="dark"] .nav-item:hover { background: var(--flame-soft); }
.nav-item[aria-current="page"] {
  background: var(--flame-soft);
  color: var(--ink);
  font-weight: 600;
  position: relative;
}
.nav-item[aria-current="page"]::before {
  content: ""; position: absolute; left: -4px; top: 8px; bottom: 8px;
  width: 3px; border-radius: 999px; background: var(--flame);
}
.nav-item[aria-current="page"] .icon { color: var(--flame); }
.nav-item .icon { color: var(--ink-3); }
.nav-item[aria-current="page"]:hover { background: var(--flame-soft); }

.nav-group { margin-top: 14px; }
.nav-group-label {
  display: flex; align-items: center; gap: 6px;
  padding: 0 14px; margin: 0 4px 3px;
  font-size: 11.5px; font-weight: 600;
  letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--ink-3);
}

.nav-project {
  display: flex; align-items: center; gap: 9px;
  height: 34px; padding: 0 10px; margin: 1px 4px;
  border-radius: 10px;
  color: var(--ink-2);
  font-size: 13.5px;
  text-decoration: none;
  transition: background-color var(--t-fast) var(--ease-out), color var(--t-fast) var(--ease-out);
}
.nav-project:hover { background: var(--flame-soft-2); color: var(--ink); text-decoration: none; }
[data-theme="dark"] .nav-project:hover { background: var(--flame-soft); }
.nav-project .icon { width: 15px; height: 15px; color: var(--ink-3); }
.nav-project .name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Health marks: shape + color, never color alone (spec §14) */
.health-dot { width: 8px; height: 8px; flex: none; }
.health-dot.ok { background: var(--ok); border-radius: 50%; }
.health-dot.warn { background: var(--warn); clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.health-dot.danger { background: transparent; border-radius: 50%; border: 2.5px solid var(--danger); }

.sidebar-foot {
  border-top: 1px solid var(--line-canvas);
  padding-top: 8px;
  display: flex; flex-direction: column;
}

.badge-count {
  margin-left: auto;
  min-width: 19px; height: 19px;
  display: grid; place-items: center;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--flame);
  color: #fff;
  font-size: 11px; font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.account-item {
  display: flex; align-items: center; gap: 10px;
  width: calc(100% - 8px);
  margin: 4px;
  padding: 7px 10px;
  border-radius: var(--r-btn-lg);
  text-align: left;
  transition: background-color var(--t-fast) var(--ease-out);
}
.account-item:hover { background: var(--flame-soft-2); }
[data-theme="dark"] .account-item:hover { background: var(--flame-soft); }

.avatar {
  width: 30px; height: 30px; flex: none;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--ink);
  color: var(--canvas);
  font-size: 12px; font-weight: 600; letter-spacing: 0.02em;
}
[data-theme="dark"] .avatar { background: var(--ink); color: #191411; }

.account-meta { min-width: 0; flex: 1; }
.account-name { font-size: 13.5px; font-weight: 600; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.account-role { font-size: 12px; color: var(--ink-3); line-height: 1.3; }

/* ---------------- Main column ---------------- */

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.context-bar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 14px;
  height: 58px;
  padding: 0 28px;
  background: color-mix(in srgb, var(--canvas) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line-canvas);
}

.breadcrumb { display: flex; align-items: center; gap: 8px; min-width: 0; }
.breadcrumb .crumb { font-size: var(--fs-md); font-weight: 600; color: var(--ink); }
.breadcrumb .crumb-muted { color: var(--ink-3); font-weight: 500; }
.breadcrumb .sep { color: var(--line-input); }

.context-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.live-status {
  display: flex; align-items: center; gap: 7px;
  font-size: 12.5px; color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}
.live-status .health-dot { width: 6px; height: 6px; }

.icon-btn {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: 10px;
  color: var(--ink-2);
  transition: background-color var(--t-fast) var(--ease-out), color var(--t-fast) var(--ease-out), transform var(--t-fast) var(--ease-out);
}
.icon-btn:hover { background: var(--flame-soft-2); color: var(--ink); }
[data-theme="dark"] .icon-btn:hover { background: var(--flame-soft); }
.icon-btn:active { transform: scale(0.94); }

/* theme toggle: swap icons via data-theme */
.theme-toggle .icon-moon { display: none; }
[data-theme="dark"] .theme-toggle .icon-moon { display: block; }
[data-theme="dark"] .theme-toggle .icon-sun { display: none; }

.content {
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 26px 28px 64px;
  display: flex; flex-direction: column; gap: 22px;
}

.page-head { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.page-title { font-size: var(--fs-heading-lg); line-height: var(--lh-heading-lg); font-weight: 650; letter-spacing: 0.01em; }
.page-sub { font-size: var(--fs-body); color: var(--ink-2); }

/* ---------------- Inspector: collapsible right panel ---------------- */

.inspector {
  position: sticky; top: 0; align-self: flex-start;
  width: 316px; flex: none;
  height: 100vh;
  overflow-y: auto;
  border-left: 1px solid var(--line-canvas);
  background: var(--canvas);
  padding: 12px 14px 24px;
}
/* frequent toggle: instant on desktop (spec §13 — no entrance animation) */
html[data-inspector="closed"] .inspector { display: none; }

.inspector-head {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 4px 10px;
}
.inspector-title { font-size: var(--fs-md); font-weight: 650; flex: 1; }

.inspector-section { margin-top: 14px; }
.inspector-label {
  padding: 0 4px 6px;
  font-size: 11.5px; font-weight: 600;
  letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--ink-3);
}
.inspector-card {
  background: var(--card);
  border: 1px solid var(--line-card);
  border-radius: 14px;
  box-shadow: var(--shadow-card);
  padding: 6px;
}
.inspector-row {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 9px;
  border-radius: 9px;
  font-size: 13px;
  color: inherit; text-decoration: none;
  transition: background-color var(--t-fast) var(--ease-out);
}
.inspector-row:hover { background: var(--card-sunken); text-decoration: none; }
.inspector-row .icon { width: 14px; height: 14px; color: var(--ink-3); flex: none; }
.inspector-row .name { flex: 1; min-width: 0; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inspector-row .meta { color: var(--ink-3); font-size: 12px; white-space: nowrap; font-variant-numeric: tabular-nums; }

.inspector-kv { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 8px 9px; font-size: 13px; }
.inspector-kv .k { color: var(--ink-2); }
.inspector-kv .v { font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }
.inspector-kv .v.danger { color: var(--danger); }

.inspector-banner {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 11px;
  border-radius: 12px;
  background: var(--ok-bg); color: var(--ok);
  font-size: 12.5px; font-weight: 600;
}
.inspector-banner.warn { background: var(--warn-bg); color: var(--warn); }
.inspector-banner .icon { width: 14px; height: 14px; stroke-width: 2.2; }

/* overlay mode on narrow screens: slides in over content */
@media (max-width: 1180px) {
  .inspector {
    position: fixed; right: 0; top: 0; bottom: 0; z-index: 45;
    height: auto;
    box-shadow: var(--shadow-raised);
    transition: transform var(--t-med) var(--ease-out);
  }
  html[data-inspector="closed"] .inspector { display: block; transform: translateX(105%); visibility: hidden; }
  .inspector-scrim {
    position: fixed; inset: 0; z-index: 44;
    background: var(--scrim);
    opacity: 1;
    transition: opacity var(--t-med) var(--ease-out);
  }
  html[data-inspector="closed"] .inspector-scrim { opacity: 0; pointer-events: none; }
}
@media (min-width: 1181px) {
  .inspector-scrim { display: none; }
}
@media (max-width: 640px) {
  .inspector { width: min(316px, 88vw); }
}

/* ============================================================
   Cards & building blocks
   ============================================================ */

.card {
  background: var(--card);
  border: 1px solid var(--line-card);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-card);
}

.card-head {
  display: flex; align-items: center; gap: 10px;
  padding: 18px 22px 0;
}
.card-title { font-size: var(--fs-subheading); font-weight: 600; line-height: var(--lh-subheading); }
.card-head .aux { margin-left: auto; font-size: 13px; }

.card-body { padding: 14px 22px 20px; }

/* ---- Buttons ---- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 36px; padding: 0 15px;
  border-radius: var(--r-btn);
  font-size: var(--fs-body); font-weight: 600;
  white-space: nowrap;
  transition: background-color var(--t-fast) var(--ease-out), border-color var(--t-fast) var(--ease-out), transform var(--t-fast) var(--ease-out);
}
.btn:active { transform: scale(0.97); }
.btn .icon { width: 15px; height: 15px; }

.btn-primary { background: var(--flame); color: #fff; box-shadow: var(--shadow-btn); }
.btn-primary:hover { background: var(--flame-hover); }
.btn-primary:active { background: var(--flame-press); }

.btn-secondary {
  background: var(--card);
  border: 1px solid var(--line-input);
  color: var(--ink);
}
.btn-secondary:hover { border-color: var(--ink-3); }

.btn-quiet { color: var(--flame); padding: 0 10px; }
.btn-quiet:hover { background: var(--flame-soft); }

.btn:disabled, .btn[aria-disabled="true"] {
  background: var(--card-sunken);
  border: 1px solid var(--line-card);
  color: var(--ink-disabled);
  box-shadow: none;
  cursor: not-allowed;
}
.btn:disabled:active, .btn[aria-disabled="true"]:active { transform: none; }

/* refresh in-flight */
@keyframes dz-spin { to { transform: rotate(360deg); } }
.icon-btn[aria-busy="true"] { pointer-events: none; color: var(--ink-3); }
.icon-btn[aria-busy="true"] .icon { animation: dz-spin 700ms linear infinite; }

.btn-sm { height: 31px; padding: 0 12px; font-size: 13px; border-radius: 10px; }

/* ---- Status badge: icon + text, never color alone ---- */

.status {
  display: inline-flex; align-items: center; gap: 5px;
  height: 22px; padding: 0 9px 0 6px;
  border-radius: var(--r-chip);
  font-size: 12px; font-weight: 600;
}
.status .icon { width: 12.5px; height: 12.5px; stroke-width: 2.2; }
.status-ok { background: var(--ok-bg); color: var(--ok); }
.status-warn { background: var(--warn-bg); color: var(--warn); }
.status-danger { background: var(--danger-bg); color: var(--danger); }
.status-info { background: var(--info-bg); color: var(--info); }

/* ============================================================
   Overview page blocks
   ============================================================ */

/* ---- 1 · Needs attention ---- */

.attention-card { border-color: color-mix(in srgb, var(--danger) 22%, var(--line-card)); }

.attention-list { list-style: none; margin: 0; padding: 6px 8px 10px; }
.attention-row {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 14px;
  border-radius: 14px;
  transition: background-color var(--t-fast) var(--ease-out);
}
.attention-row:hover { background: var(--card-sunken); }
.attention-row + .attention-row { margin-top: 2px; }

.attention-ico {
  width: 36px; height: 36px; flex: none;
  display: grid; place-items: center;
  border-radius: 11px;
}
.attention-ico .icon { width: 18px; height: 18px; }
.attention-ico.danger { background: var(--danger-bg); color: var(--danger); }
.attention-ico.warn { background: var(--warn-bg); color: var(--warn); }

.attention-text { flex: 1; min-width: 0; }
.attention-title { font-size: var(--fs-md); font-weight: 600; line-height: 1.35; }
.attention-meta { font-size: 13px; color: var(--ink-2); margin-top: 1px; }
.attention-meta .obj { color: var(--ink); font-weight: 500; }

/* ---- Setup prompt: messenger alerts ---- */

.connect-banner {
  display: flex; align-items: center; gap: 16px;
  padding: 16px 18px 16px 20px;
  border-radius: var(--r-card);
  border: 1px solid color-mix(in srgb, var(--flame) 18%, var(--line-card));
  background: linear-gradient(105deg, var(--flame-soft) 0%, var(--card) 46%);
  box-shadow: var(--shadow-card);
}
[data-theme="dark"] .connect-banner {
  background: linear-gradient(105deg, var(--flame-soft) 0%, var(--card) 52%);
}
.connect-banner[hidden] { display: none; }

.connect-ico {
  width: 40px; height: 40px; flex: none;
  display: grid; place-items: center;
  border-radius: 12px;
  background: var(--flame);
  color: #fff;
  box-shadow: var(--shadow-btn);
}
.connect-ico .icon { width: 19px; height: 19px; }

.connect-text { flex: 1; min-width: 0; }
.connect-title { font-size: var(--fs-md); font-weight: 600; line-height: 1.35; }
.connect-sub { font-size: 13px; color: var(--ink-2); margin-top: 1px; }

.connect-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.connect-dismiss { flex: none; color: var(--ink-3); }

@media (max-width: 900px) {
  .connect-banner { flex-wrap: wrap; }
  .connect-text { flex-basis: calc(100% - 120px); }
  .connect-actions { margin-left: 56px; }
}

/* ---- 2 · Continue working ---- */

/* Client rule 31.08.2026: center zone is single-column — cards stack,
   never two cards side by side. Project cards render as full-width rows. */
.project-grid {
  display: flex; flex-direction: column;
  gap: 10px;
}

.project-card {
  display: flex; flex-direction: row; align-items: center; gap: 18px;
  padding: 13px 18px;
  background: var(--card);
  border: 1px solid var(--line-card);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-card);
  color: inherit; text-decoration: none;
  transition: transform var(--t-fast) var(--ease-out), box-shadow var(--t-fast) var(--ease-out), border-color var(--t-fast) var(--ease-out);
}
.project-card:hover {
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: var(--shadow-raised);
  border-color: var(--line-input);
}
.project-card:active { transform: translateY(0) scale(0.99); }

.project-card-top { display: flex; align-items: center; gap: 9px; flex: 0 0 250px; min-width: 0; }
.type-ico {
  width: 32px; height: 32px; flex: none;
  display: grid; place-items: center;
  border-radius: 10px;
  background: var(--card-sunken);
  color: var(--ink-2);
  border: 1px solid var(--line-card);
}
.type-ico .icon { width: 16px; height: 16px; }

.project-card-name { font-size: var(--fs-md); font-weight: 600; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.project-card-type { font-size: 12px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.project-card-endpoint {
  font-size: 13px; color: var(--ink-2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  font-variant-numeric: tabular-nums;
  flex: 1; min-width: 0;
}

.project-card-foot {
  display: flex; align-items: center; gap: 16px;
  font-size: 12.5px; color: var(--ink-3);
  flex: none;
}
.project-card-foot .plan { font-weight: 500; color: var(--ink-2); }

/* ---- 3 · Projects summary strip ---- */

.summary-strip {
  display: flex; align-items: center; gap: 18px;
  padding: 14px 22px;
  flex-wrap: wrap;
}
.summary-total { font-size: var(--fs-subheading); font-weight: 600; }
.summary-states { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.summary-types {
  display: flex; align-items: center; gap: 4px; flex-wrap: wrap;
  color: var(--ink-3); font-size: 12.5px;
}
.summary-types .t { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: var(--r-chip); background: var(--card-sunken); border: 1px solid var(--line-card); color: var(--ink-2); font-weight: 500; font-variant-numeric: tabular-nums; }
.summary-strip .aux { margin-left: auto; font-size: 13.5px; font-weight: 500; }

/* ---- two-column zone: Upcoming + Activity ---- */

/* single-column center (client rule 31.08.2026) */
.two-col {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

/* ---- 4 · Upcoming ---- */

.upcoming-list { list-style: none; margin: 0; padding: 4px 10px 8px; }
.upcoming-row {
  display: flex; align-items: center; gap: 14px;
  padding: 11px 12px;
  border-radius: 12px;
  transition: background-color var(--t-fast) var(--ease-out);
}
.upcoming-row:hover { background: var(--card-sunken); }

.date-chip {
  width: 46px; flex: none; text-align: center;
  padding: 5px 0 6px;
  border-radius: 11px;
  background: var(--card-sunken);
  border: 1px solid var(--line-card);
}
.date-chip .mon { display: block; font-size: 10px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); }
.date-chip .day { display: block; font-size: 16px; font-weight: 650; line-height: 1.15; font-variant-numeric: tabular-nums; }

.upcoming-text { flex: 1; min-width: 0; }
.upcoming-title { font-size: var(--fs-body); font-weight: 600; line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.upcoming-meta { font-size: 12.5px; color: var(--ink-2); }

.amount { font-size: var(--fs-body); font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---- 5 · Recent activity ---- */

.activity-list { list-style: none; margin: 0; padding: 4px 10px 10px; }
.activity-row {
  display: flex; gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  color: inherit; text-decoration: none;
  transition: background-color var(--t-fast) var(--ease-out);
}
.activity-row:hover { background: var(--card-sunken); text-decoration: none; }

.activity-ico {
  width: 28px; height: 28px; flex: none;
  display: grid; place-items: center;
  border-radius: 9px;
  margin-top: 1px;
}
.activity-ico .icon { width: 14px; height: 14px; stroke-width: 2; }
.activity-ico.ok { background: var(--ok-bg); color: var(--ok); }
.activity-ico.danger { background: var(--danger-bg); color: var(--danger); }
.activity-ico.info { background: var(--info-bg); color: var(--info); }
.activity-ico.neutral { background: var(--card-sunken); color: var(--ink-2); border: 1px solid var(--line-card); }

.activity-text { flex: 1; min-width: 0; }
.activity-title { font-size: var(--fs-body); line-height: 1.4; }
.activity-title strong { font-weight: 600; }
.activity-meta { font-size: 12.5px; color: var(--ink-3); margin-top: 1px; font-variant-numeric: tabular-nums; }

/* ============================================================
   Command palette (⌘K) — frequent action: no entrance animation
   ============================================================ */

.palette[open] { display: flex; }
.palette {
  position: fixed; inset: 0; z-index: 90;
  display: none; align-items: flex-start; justify-content: center;
  padding: 12vh 20px 20px;
  border: 0; margin: 0;
  width: 100%; height: 100%;
  max-width: none; max-height: none;
  background: var(--scrim);
}
.palette-panel {
  width: 100%; max-width: 560px;
  background: var(--card);
  border: 1px solid var(--line-card);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-raised);
  overflow: hidden;
}
.palette-input-row { display: flex; align-items: center; gap: 10px; padding: 15px 18px; border-bottom: 1px solid var(--line-card); }
.palette-input-row .icon { color: var(--ink-3); }
.palette-input {
  flex: 1; border: 0; outline: 0; background: none;
  font: inherit; letter-spacing: inherit; color: var(--ink);
  font-size: var(--fs-md);
}
.palette-input::placeholder { color: var(--ink-3); }
.palette-list { list-style: none; margin: 0; padding: 8px; max-height: 320px; overflow-y: auto; }
.palette-group { padding: 8px 12px 4px; font-size: 11.5px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); }
.palette-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px;
  border-radius: 10px;
  font-size: var(--fs-body);
  color: var(--ink-2);
  cursor: pointer;
}
.palette-item .icon { color: var(--ink-3); width: 16px; height: 16px; }
.palette-item:hover, .palette-item[aria-selected="true"] { background: var(--flame-soft); color: var(--ink); }
.palette-item:hover .icon, .palette-item[aria-selected="true"] .icon { color: var(--flame); }
.palette-item .kbd-hint { margin-left: auto; }

/* ============================================================
   Responsive
   ============================================================ */

@media (max-width: 760px) {
  .project-card { flex-wrap: wrap; gap: 10px 18px; }
  .project-card-top { flex-basis: 100%; }
}

/* Tablet: icon rail (spec §4.3) */
@media (max-width: 900px) {
  .sidebar { width: var(--sidebar-rail); padding: 14px 8px; }
  .sidebar .workspace-meta, .sidebar .workspace-switcher > .icon,
  .sidebar-create span, .sidebar-search span, .sidebar-search .kbd-hint,
  .nav-item span, .nav-group-label span, .nav-project .name, .nav-project .health-dot,
  .account-meta, .badge-count { display: none; }
  .workspace-switcher { justify-content: center; padding: 8px 0; }
  .sidebar-create { width: 42px; margin-left: auto; margin-right: auto; padding: 0; }
  .sidebar-search { width: 42px; justify-content: center; padding: 0; margin-left: auto; margin-right: auto; }
  .nav-item, .nav-project { justify-content: center; padding: 0; }
  .nav-group-label { justify-content: center; padding: 0; }
  .account-item { justify-content: center; padding: 7px 0; }
  .context-bar { padding: 0 18px; }
  .content { padding: 22px 18px 56px; }
}

/* Mobile: single column, bottom navigation (spec §4.2) */
@media (max-width: 640px) {
  .sidebar { display: none; }
  .main { padding-bottom: 66px; }
  .project-grid { grid-template-columns: minmax(0, 1fr); }
  .context-bar { height: 52px; padding: 0 14px; }
  .breadcrumb .crumb-muted, .breadcrumb .sep { display: none; }
  .live-status { display: none; }
  .content { padding: 18px 14px 56px; gap: 16px; }
  .page-title { font-size: var(--fs-heading); }
  .attention-row { flex-wrap: wrap; }
  .attention-text { flex: 1 1 calc(100% - 50px); }
  .attention-row .btn { margin-left: 50px; }
  .summary-strip .aux { margin-left: 0; width: 100%; }
}

.mobile-nav {
  display: none;
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  height: 64px;
  background: color-mix(in srgb, var(--canvas) 92%, transparent);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--line-canvas);
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  justify-content: space-around; align-items: stretch;
}
.mobile-nav a {
  flex: 1; max-width: 96px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  border-radius: 12px;
  color: var(--ink-3);
  font-size: 11px; font-weight: 600;
  text-decoration: none;
}
.mobile-nav a:hover { text-decoration: none; }
.mobile-nav a[aria-current="page"] { color: var(--flame); }
.mobile-nav .icon { width: 20px; height: 20px; }

@media (max-width: 640px) {
  .mobile-nav { display: flex; }
}

/* ============================================================
   Motion discipline (spec §13)
   ============================================================ */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
