/* Shared customer/category workspace, using the homepage chrome and theme tokens.
   .grouped-sidebar / .grouped-nav-button are the single source for every sidebar
   (rules: .claude/ops/ui-principles.md §1); pages must not restyle them locally. */
.grouped-workspace { display: flex; flex: 1; min-width: 0; }
.grouped-sidebar { width: 228px; flex: 0 0 228px; position: sticky; top: var(--app-header-live-h, 64px); height: calc(100vh - var(--app-header-live-h, 64px)); overflow-y: auto; padding: 20px 12px; border-right: 1px solid var(--border-soft); background: rgb(var(--c-black) / .8); }
.grouped-sidebar-label { padding: 0 12px 12px; color: var(--ink-soft); font-size: 11px; letter-spacing: .15em; }
html.sdhaus-embedded .grouped-sidebar { top: 0; height: 100vh; }
.grouped-nav { display: flex; flex-direction: column; gap: 6px; }
.grouped-nav-button { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid transparent; border-radius: 8px; color: var(--ink-soft); text-align: left; font-size: 13px; cursor: pointer; transition: color .2s, background .2s, border-color .2s; }
.grouped-nav-button:hover { color: var(--ink); background: var(--surface); border-color: var(--border-soft); }
.grouped-nav-button.active { background: var(--brand); color: var(--canvas); border-color: var(--brand); }
.grouped-nav-name { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.grouped-nav-count { flex: 0 0 auto; font-size: 11px; opacity: .8; }
.grouped-nav-button > svg { flex: 0 0 auto; }
.grouped-nav-button:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }
/* A selected row is already brand-filled: draw its keyboard focus ring in the text color so it stays visible. */
.grouped-nav-button.active:focus-visible { outline-color: var(--ink); }
/* Narrow screens turn sidebars into short scrolling rows that would clip an outer ring: draw it inside. */
@media (max-width: 1023px) { .app-sidebar .grouped-nav-button:focus-visible { outline-offset: -2px; } }
/* Data-list sidebars (law list, folder tree, note entries) scroll inside a fixed-height column:
   rows keep their height, the second line is dimmer, and inline icon/text colors follow the row state. */
.grouped-nav > * { flex-shrink: 0; }
.grouped-nav-meta { display: block; margin-top: 2px; font-size: 11px; line-height: 1.4; color: var(--ink-dim); }
.grouped-nav-button.active .grouped-nav-meta { color: inherit; opacity: .8; }
.grouped-nav-button.active :is([class*="text-zinc-"], [class*="text-brand"], [class*="text-white"]):not(input, textarea, select) { color: inherit; }
/* Loaded after tailwind.css, so display:flex above would otherwise beat Tailwind's .hidden. */
.grouped-nav-button.hidden, .grouped-nav-button[hidden] { display: none; }
.grouped-content { flex: 1; min-width: 0; padding: 22px 24px 32px; }
.grouped-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 20px; }
.grouped-heading { flex: 1; min-width: 130px; }
.grouped-heading h1 { font-size: 19px; font-weight: 700; color: var(--ink); }
.grouped-heading p { margin-top: 3px; font-size: 12px; color: var(--ink-dim); }
.grouped-search { width: min(100%, 300px); min-height: 44px; padding: 10px 14px; border-radius: 8px; font-size: 13px; }
.grouped-filter { min-height: 44px; max-width: 100%; padding: 10px 12px; border-radius: 8px; font-size: 13px; }
.grouped-sections { display: flex; flex-direction: column; gap: 22px; }
.grouped-section-title { margin-bottom: 10px; display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; color: var(--ink-2); overflow-wrap: anywhere; }
.grouped-section-title span { font-size: 11px; font-weight: 500; color: var(--ink-dim); white-space: nowrap; }
.grouped-card-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.grouped-empty { padding: 64px 16px; text-align: center; font-size: 14px; color: var(--ink-dim); }
.project-card { display: flex; flex-direction: column; min-width: 0; padding: 16px; border-radius: 10px; transition: border-color .2s, box-shadow .2s; }
.project-card:hover { border-color: var(--brand); box-shadow: 0 3px 12px rgb(var(--c-brand) / .08); }
.project-card-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; }
.project-card-status { overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.project-card-title { margin: 14px 0 16px; font-size: 15px; line-height: 1.55; font-weight: 700; color: var(--ink); overflow-wrap: anywhere; }
.project-card-progress { margin-top: auto; height: 3px; border-radius: 3px; overflow: hidden; background: var(--border-soft); }
.project-card-footer { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding-top: 10px; font-size: 11px; color: var(--ink-soft); }
.project-card-owner { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-name-preview { padding: 12px 14px; border: 1px solid var(--border-soft); border-radius: 8px; background: var(--canvas); font-size: 13px; line-height: 1.6; overflow-wrap: anywhere; }
.project-name-preview-label { font-size: 10px; letter-spacing: .1em; color: var(--ink-dim); margin-bottom: 4px; }
.vault-card { min-width: 0; padding: 16px; border-radius: 10px; }
.vault-card h3 { overflow-wrap: anywhere; }
.vault-card button { min-width: 32px; min-height: 32px; }
.grouped-workspace button:focus-visible, .project-card:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }
@media (max-width: 1199px) { .grouped-card-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } .grouped-sidebar { width: 210px; flex-basis: 210px; } .grouped-content { padding: 20px; } }
@media (max-width: 959px) { .grouped-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 767px) {
    .grouped-workspace { flex-direction: column; }
    .grouped-sidebar { position: static; width: 100%; height: auto; flex-basis: auto; padding: 12px; border-right: 0; border-bottom: 1px solid var(--border-soft); }
    html.sdhaus-embedded .grouped-sidebar { height: auto; }
    .grouped-sidebar-label { padding: 0 4px 8px; }
    .grouped-nav { flex-direction: row; overflow-x: auto; padding: 2px 2px 6px; }
    .grouped-nav-button { width: auto; flex: 0 0 auto; }
    .grouped-nav-name { white-space: nowrap; }
    .grouped-content { padding: 18px 16px 28px; }
    .grouped-search { width: 100%; flex: 1 1 200px; }
    .workspace-header { flex-wrap: wrap; gap: 12px; padding-left: 16px; padding-right: 16px; }
    .workspace-header > div { min-width: 0; }
}
@media (max-width: 539px) { .grouped-card-grid { grid-template-columns: minmax(0, 1fr); } }
@media (prefers-reduced-motion: reduce) { .grouped-nav-button, .project-card { transition: none; } }
