/* Hallmark · pre-emit critique: P5 H5 E4 S5 R5 V4
 * macrostructure: Workbench · genre: modern-minimal · theme: Cobalt
 * audience: company employees and managers · use: publish and track goals · tone: utilitarian
 * nav: N3 side-rail · footer: none (internal application) · enrichment: none
 * contrast: pass (40-41) · slop: pass (42-45) · honest: pass (46)
 * chrome: pass (47) · tokens: pass (48) · responsive: pass (34, 49-57) · icons: pass (30)
 */
@import url("tokens.css");

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; overflow-x: clip; }
body { background: var(--color-paper); color: var(--color-ink-2); font-family: var(--font-body); font-size: var(--text-base); line-height: 1.5; letter-spacing: 0; }
button, input, select, textarea { font: inherit; letter-spacing: 0; }
button, select, label[for] { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, label.upload-zone:has(input:focus-visible) { outline: 2px solid var(--color-accent); outline-offset: 2px; border-color: var(--color-accent); }
button:disabled { cursor: not-allowed; opacity: .48; }
svg { width: 18px; height: 18px; stroke-width: 1.8; flex: 0 0 auto; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3, strong { color: var(--color-ink); }
h1, h2 { font-family: var(--font-display); font-style: normal; overflow-wrap: anywhere; min-width: 0; }
h1 { font-size: var(--text-2xl); line-height: 1.2; font-weight: 600; }
h2 { font-size: var(--text-lg); line-height: 1.3; font-weight: 600; }
h3 { font-size: var(--text-sm); font-weight: 600; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
[hidden] { display: none !important; }

.auth-screen { min-height: 100dvh; display: grid; grid-template-columns: minmax(320px, 42%) minmax(0, 1fr); background: var(--color-paper); }
.auth-brand-panel { min-height: 100dvh; display: flex; flex-direction: column; background: var(--color-ink); color: var(--color-accent-ink); }
.auth-brand { width: 100%; border-color: var(--color-ink-2); }
.auth-brand strong { color: var(--color-accent-ink); }
.auth-brand span:not(.brand-mark) { color: var(--color-faint); }
.auth-statement { margin: auto 0; max-width: 620px; padding: var(--space-10); }
.auth-statement .eyebrow { color: var(--color-rule-strong); }
.auth-statement h1 { max-width: 12ch; color: var(--color-accent-ink); font-size: 42px; line-height: 1.14; }
.auth-statement > p { max-width: 36ch; margin-top: var(--space-5); color: var(--color-rule-strong); }
.auth-form-panel { min-height: 100dvh; display: grid; place-items: center; padding: var(--space-8); }
.auth-form-wrap { width: min(100%, 420px); }
.auth-heading { margin-bottom: var(--space-6); }
.auth-heading h2 { font-size: var(--text-2xl); }
.auth-heading > p { margin-top: var(--space-2); color: var(--color-muted); font-size: var(--text-sm); }
.auth-tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: var(--space-6); border-bottom: var(--rule-thin) solid var(--color-rule); }
.auth-tab { min-height: 44px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--color-muted); font-size: var(--text-sm); }
.auth-tab:hover { color: var(--color-ink); background: var(--color-surface-subtle); }
.auth-tab:active { background: var(--color-surface-hover); }
.auth-tab.is-active { border-bottom-color: var(--color-accent); color: var(--color-accent); font-weight: 600; }
.auth-form { display: grid; gap: var(--space-4); }
.auth-submit { width: 100%; margin-top: var(--space-1); }
.auth-error { min-height: 20px; margin: 0; }
.auth-notice { min-height: 22px; margin-top: var(--space-4); color: var(--color-success); font-size: var(--text-sm); }

.app-shell { min-height: 100dvh; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: var(--z-sidebar); width: var(--sidebar-width); display: flex; flex-direction: column; background: var(--color-surface); border-right: var(--rule-thin) solid var(--color-rule); }
.brand { height: var(--header-height); padding: 0 var(--space-5); display: flex; align-items: center; gap: var(--space-3); border-bottom: var(--rule-thin) solid var(--color-rule); }
.brand-mark { width: 32px; height: 32px; display: grid; place-items: center; color: var(--color-accent-ink); background: var(--color-accent); border-radius: var(--radius-md); font-family: var(--font-display); font-weight: 600; }
.brand div, .profile div { display: flex; flex-direction: column; min-width: 0; }
.brand strong { font-family: var(--font-display); font-size: var(--text-base); }
.brand span:not(.brand-mark), .profile span { color: var(--color-muted); font-size: var(--text-xs); }
.nav-list { padding: var(--space-5) var(--space-3); display: grid; gap: var(--space-1); }
.nav-label { padding: var(--space-4) var(--space-3) var(--space-1); color: var(--color-faint); font-size: var(--text-xs); font-weight: 500; }
.review-filter { display: grid; gap: var(--space-2); padding: var(--space-2) var(--space-3) var(--space-4); }
.review-filter > label { color: var(--color-muted); font-size: var(--text-xs); font-weight: 500; }
.review-filter input, .review-filter select { min-height: 40px; font-size: var(--text-sm); }
.sidebar-select { position: relative; }
.sidebar-select select { appearance: none; padding-right: var(--space-8); }
.sidebar-select svg { position: absolute; top: 50%; right: var(--space-3); width: 15px; transform: translateY(-50%); color: var(--color-muted); pointer-events: none; }
.review-submit { width: 100%; margin-top: var(--space-1); }
.review-error { min-height: 18px; color: var(--color-danger); font-size: var(--text-xs); }
.nav-item { width: 100%; min-height: 44px; display: flex; align-items: center; gap: var(--space-3); padding: 0 var(--space-3); border: 0; border-radius: var(--radius-md); background: transparent; color: var(--color-muted); text-align: left; transition: background var(--dur-fast), color var(--dur-fast); }
.nav-item:hover { background: var(--color-surface-hover); color: var(--color-ink); }
.nav-item:active { background: var(--color-rule); }
.nav-item.is-active { background: var(--color-accent-soft); color: var(--color-accent); font-weight: 600; }
.nav-count { min-width: 20px; height: 20px; margin-left: auto; display: grid; place-items: center; border-radius: var(--radius-sm); background: var(--color-danger); color: var(--color-accent-ink); font-size: var(--text-xs); }
.sidebar-footer { margin-top: auto; padding: var(--space-3); border-top: var(--rule-thin) solid var(--color-rule); }
.profile { min-height: 56px; display: flex; align-items: center; gap: var(--space-3); padding: var(--space-2); margin-top: var(--space-2); }
.avatar { width: 34px; height: 34px; display: grid !important; place-items: center; flex: 0 0 auto; border-radius: 50%; background: var(--color-ink); color: var(--color-accent-ink) !important; font-size: var(--text-sm) !important; }
.profile div { flex: 1; }
.profile strong { font-size: var(--text-sm); }
.profile .profile-actions { flex: 0 0 auto; display: flex; flex-direction: row; gap: var(--space-1); }
.profile-actions .icon-button { width: 34px; height: 34px; }
.main-content { min-height: 100dvh; margin-left: var(--sidebar-width); }
.topbar { height: var(--header-height); position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; padding: 0 var(--space-8); background: var(--color-paper); border-bottom: var(--rule-thin) solid var(--color-rule); }
.breadcrumb { display: flex; align-items: center; gap: var(--space-2); font-size: var(--text-sm); color: var(--color-muted); }
.breadcrumb svg { width: 14px; height: 14px; }
.breadcrumb strong { font-weight: 500; }
.top-actions, .section-head, .detail-section-head { display: flex; align-items: center; gap: var(--space-2); }
.icon-button { width: 44px; height: 44px; padding: 0; position: relative; display: grid; place-items: center; border: var(--rule-thin) solid transparent; border-radius: var(--radius-md); background: transparent; color: var(--color-muted); transition: background var(--dur-fast), border-color var(--dur-fast), color var(--dur-fast); }
.icon-button:hover { background: var(--color-surface-hover); color: var(--color-ink); }
.icon-button:active, .icon-button.is-selected { background: var(--color-accent-soft); color: var(--color-accent); }
.notification-dot { position: absolute; top: 10px; right: 10px; width: 6px; height: 6px; border-radius: 50%; background: var(--color-danger); border: 1px solid var(--color-paper); }
.button { min-height: 44px; padding: 0 var(--space-4); display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); border: var(--rule-thin) solid transparent; border-radius: var(--radius-md); white-space: nowrap; font-weight: 500; font-size: var(--text-sm); transition: background var(--dur-fast), border-color var(--dur-fast), color var(--dur-fast), opacity var(--dur-fast); }
a.button { text-decoration: none; }
.button-primary { background: var(--color-accent); color: var(--color-accent-ink); }
.button-primary:hover { background: var(--color-accent-hover); }
.button-primary:active { opacity: .88; }
.button-secondary { background: var(--color-surface); color: var(--color-ink-2); border-color: var(--color-rule-strong); }
.button-secondary:hover { border-color: var(--color-accent); color: var(--color-accent); }
.page-wrap { width: min(100%, 1480px); margin: 0 auto; padding: var(--space-8); }
.page-heading { display: flex; justify-content: space-between; align-items: end; margin: var(--space-2) 0 var(--space-8); }
.page-heading p:not(.eyebrow) { margin-top: var(--space-2); color: var(--color-muted); font-size: var(--text-sm); }
.eyebrow { margin-bottom: var(--space-2); color: var(--color-accent); font-family: var(--font-mono); font-size: var(--text-xs); text-transform: uppercase; }
.member-scope { max-width: 100%; display: flex; align-items: center; flex-wrap: wrap; border: var(--rule-thin) solid var(--color-rule-strong); border-radius: var(--radius-md); background: var(--color-surface); }
.member-scope button { min-height: 40px; padding: 0 var(--space-4); border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--color-muted); font-size: var(--text-sm); white-space: nowrap; }
.member-scope button:hover { background: var(--color-surface-hover); color: var(--color-ink); }
.member-scope button:active { background: var(--color-rule); }
.member-scope button.is-active { background: var(--color-accent-soft); color: var(--color-accent); font-weight: 600; }
.scope-team-select { min-width: 150px; padding: 3px; border-left: var(--rule-thin) solid var(--color-rule); }
.scope-team-select select { min-height: 34px; border: 0; background: var(--color-surface-subtle); font-size: var(--text-sm); }
.metric-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: var(--rule-thin) solid var(--color-rule); border-radius: var(--radius-lg); background: var(--color-surface); }
.metric { min-width: 0; padding: var(--space-5) var(--space-6); border-right: var(--rule-thin) solid var(--color-rule); }
.metric:last-child { border-right: 0; }
.metric > span { display: block; color: var(--color-muted); font-size: var(--text-sm); }
.metric strong { display: block; margin: var(--space-1) 0; font-family: var(--font-display); font-size: var(--text-xl); font-variant-numeric: tabular-nums; }
.metric small { display: flex; align-items: center; gap: var(--space-2); color: var(--color-muted); font-size: var(--text-xs); }
.status-dot { width: 7px; height: 7px; border-radius: 50%; }
.dot-blue { background: var(--color-accent); }.dot-green { background: var(--color-success); }.dot-amber { background: var(--color-warning); }
.workbench { margin-top: var(--space-8); }
.section-head { justify-content: space-between; margin-bottom: var(--space-4); }
.section-head > div:first-child { display: flex; align-items: baseline; gap: var(--space-3); }
.section-head p { color: var(--color-muted); font-size: var(--text-sm); }
.view-switch { display: flex; border: var(--rule-thin) solid var(--color-rule); border-radius: var(--radius-md); background: var(--color-surface); }
.view-switch .icon-button { width: 38px; height: 36px; border-radius: var(--radius-sm); }
.toolbar { min-height: 65px; display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3); border: var(--rule-thin) solid var(--color-rule); border-bottom: 0; border-radius: var(--radius-lg) var(--radius-lg) 0 0; background: var(--color-surface); }
.search-field { flex: 1; min-width: 240px; position: relative; }
.search-field svg { position: absolute; left: var(--space-3); top: 50%; transform: translateY(-50%); color: var(--color-faint); pointer-events: none; }
input, select, textarea { width: 100%; min-height: 44px; border: var(--rule-thin) solid var(--color-rule-strong); border-radius: var(--radius-md); background: var(--color-surface); color: var(--color-ink); padding: 0 var(--space-3); }
input::placeholder, textarea::placeholder { color: var(--color-faint); }
textarea { padding-top: var(--space-3); resize: vertical; }
.search-field input { padding-left: var(--space-10); }
.select-field { width: 140px; position: relative; }
.select-field select { appearance: none; padding-right: var(--space-8); }
.select-field svg { position: absolute; right: var(--space-3); top: 50%; transform: translateY(-50%); width: 15px; pointer-events: none; color: var(--color-muted); }
.table-frame { overflow: clip; border: var(--rule-thin) solid var(--color-rule); border-radius: 0 0 var(--radius-lg) var(--radius-lg); background: var(--color-surface); }
table { width: 100%; border-collapse: collapse; table-layout: fixed; }
th { height: 44px; padding: 0 var(--space-4); color: var(--color-muted); background: var(--color-surface-subtle); font-size: var(--text-xs); font-weight: 500; text-align: left; }
td { height: 72px; padding: var(--space-3) var(--space-4); border-top: var(--rule-thin) solid var(--color-rule); color: var(--color-ink-2); font-size: var(--text-sm); vertical-align: middle; }
tbody tr { cursor: pointer; transition: background var(--dur-fast); }
tbody tr:hover { background: var(--color-surface-subtle); }
tbody tr:focus-visible { outline: 2px solid var(--color-accent); outline-offset: -2px; }
th:first-child { width: 28%; } th:nth-child(2) { width: 8%; } th:nth-child(3) { width: 11%; } th:nth-child(4), th:nth-child(5) { width: 10%; } th:nth-child(6) { width: 11%; } th:nth-child(7) { width: 13%; } th:last-child { width: 44px; }
.task-name { display: block; color: var(--color-ink); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-summary { display: block; margin-top: var(--space-1); color: var(--color-muted); font-size: var(--text-xs); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cycle-tag, .status-badge { width: fit-content; display: inline-flex; align-items: center; gap: var(--space-2); min-height: 26px; padding: 0 var(--space-2); border-radius: var(--radius-sm); font-size: var(--text-xs); font-weight: 500; white-space: nowrap; }
.cycle-week { background: var(--color-accent-soft); color: var(--color-accent); }.cycle-month { background: var(--color-warning-soft); color: var(--color-warning); }.cycle-year { background: var(--color-danger-soft); color: var(--color-danger); }
.status-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-active { background: var(--color-accent-soft); color: var(--color-accent); }.status-done { background: var(--color-success-soft); color: var(--color-success); }.status-due { background: var(--color-warning-soft); color: var(--color-warning); }
.status-overdue { background: var(--color-danger-soft); color: var(--color-danger); }
.attachment-cell { display: flex; align-items: center; gap: var(--space-2); color: var(--color-muted); white-space: nowrap; }
.attachment-cell svg { width: 16px; }
.row-action { width: 36px; height: 36px; }
.empty-state { padding: 80px var(--space-6); display: grid; justify-items: center; text-align: center; }
.empty-state > svg { width: 32px; height: 32px; color: var(--color-faint); }
.empty-state h3 { margin-top: var(--space-3); font-size: var(--text-base); }
.empty-state p { margin: var(--space-1) 0 var(--space-5); color: var(--color-muted); font-size: var(--text-sm); }
.card-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-3); }
.task-card { min-width: 0; display: flex; flex-direction: column; gap: var(--space-4); padding: var(--space-5); border: var(--rule-thin) solid var(--color-rule); border-radius: var(--radius-lg); background: var(--color-surface); cursor: pointer; transition: border-color var(--dur-fast), background var(--dur-fast); }
.task-card:hover { border-color: var(--color-accent); background: var(--color-surface-subtle); }
.task-card:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; border-color: var(--color-accent); }
.task-card-head, .task-card-meta { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }
.task-card h3 { font-size: var(--text-base); overflow-wrap: anywhere; }
.task-context { display: block; margin-bottom: var(--space-1); color: var(--color-accent); font-size: var(--text-xs); font-weight: 500; }
.task-card > p { flex: 1; color: var(--color-muted); font-size: var(--text-sm); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.task-card-meta { padding-top: var(--space-3); border-top: var(--rule-thin) solid var(--color-rule); color: var(--color-muted); font-size: var(--text-xs); }
.mobile-menu { display: none; }
.sidebar-scrim { display: none; }

.team-page .page-heading { margin-bottom: var(--space-8); }
.account-section + .account-section { margin-top: var(--space-8); }
.team-section-head { display: flex; align-items: end; gap: var(--space-5); }
.inline-team-form { width: min(100%, 430px); display: flex; align-items: center; gap: var(--space-2); }
.inline-team-form input { flex: 1; min-width: 160px; }
.member-section-head { align-items: end; }
.member-search { width: min(100%, 340px); position: relative; display: block; }
.member-search > svg { position: absolute; top: 50%; left: var(--space-3); z-index: 1; width: 17px; transform: translateY(-50%); color: var(--color-muted); pointer-events: none; }
.member-search input { padding-left: var(--space-10); }
.account-table-frame { overflow-x: auto; overflow-y: hidden; border: var(--rule-thin) solid var(--color-rule); border-radius: var(--radius-lg); background: var(--color-surface); }
.account-table-frame table { min-width: 960px; }
.account-table-frame th, .account-table-frame td { overflow-wrap: anywhere; }
.account-table-frame th:first-child { width: 20%; }
.account-table-frame th:nth-child(2) { width: 12%; }
.account-table-frame th:nth-child(3) { width: 14%; }
.account-table-frame th:nth-child(4) { width: 10%; }
.account-table-frame th:nth-child(5) { width: 16%; }
.account-table-frame th:nth-child(6) { width: 18%; }
.account-table-frame th:last-child { width: 10%; }
#pendingSection .account-table-frame table { min-width: 920px; }
#pendingSection .account-table-frame th:first-child { width: 20%; }
#pendingSection .account-table-frame th:nth-child(2) { width: 14%; }
#pendingSection .account-table-frame th:nth-child(3) { width: 16%; }
#pendingSection .account-table-frame th:nth-child(4) { width: 18%; }
#pendingSection .account-table-frame th:nth-child(5) { width: 18%; }
#pendingSection .account-table-frame th:last-child { width: 14%; }
#teamDirectorySection .account-table-frame table { min-width: 880px; }
#teamDirectorySection .account-table-frame th:first-child { width: 19%; }
#teamDirectorySection .account-table-frame th:nth-child(2) { width: 21%; }
#teamDirectorySection .account-table-frame th:nth-child(3) { width: 24%; }
#teamDirectorySection .account-table-frame th:nth-child(4) { width: 20%; }
#teamDirectorySection .account-table-frame th:last-child { width: 16%; }
.account-table-frame tbody tr { cursor: default; }
.account-person { display: flex; align-items: center; gap: var(--space-3); }
.account-person .avatar { width: 32px; height: 32px; }
.account-person div { min-width: 0; display: flex; flex-direction: column; }
.account-person span { color: var(--color-muted); font-size: var(--text-xs); }
.account-person-main { flex: 1; }
.account-person .rename-account { width: 30px; height: 30px; margin-left: auto; color: var(--color-muted); }
.platform-id { color: var(--color-ink-2); font-family: var(--font-mono); font-size: var(--text-xs); font-variant-numeric: tabular-nums; white-space: nowrap; }
.account-actions { display: flex; align-items: center; gap: var(--space-2); white-space: nowrap; }
.account-actions .button { min-height: 36px; padding: 0 var(--space-3); }
.button-danger { border-color: var(--color-danger-soft); background: var(--color-danger-soft); color: var(--color-danger); }
.button-danger:hover { border-color: var(--color-danger); }
.danger-icon { color: var(--color-danger); }
.danger-icon:hover { background: var(--color-danger-soft); }
.role-select { width: 100%; min-width: 0; min-height: 36px; font-size: var(--text-sm); }
.permission-note { display: block; margin-top: var(--space-1); color: var(--color-muted); font-size: var(--text-xs); }
.role-chip { width: fit-content; display: inline-flex; min-height: 28px; align-items: center; padding: 0 var(--space-2); border-radius: var(--radius-sm); background: var(--color-surface-subtle); color: var(--color-ink-2); font-size: var(--text-xs); font-weight: 600; }
.role-admin { background: var(--color-accent-soft); color: var(--color-accent); }
.role-leader { background: var(--color-warning-soft); color: var(--color-warning); }
.compact-empty { padding: var(--space-10) var(--space-6); }

.overlay { position: fixed; inset: 0; z-index: var(--z-overlay); display: flex; justify-content: flex-end; background: var(--color-overlay); }
.drawer { width: min(520px, 100%); height: 100dvh; min-height: 0; display: flex; flex-direction: column; overflow: hidden; background: var(--color-surface); animation: slide-in var(--dur-base) var(--ease-out); }
.modal { width: min(680px, calc(100% - 32px)); max-height: calc(100dvh - 48px); margin: auto; overflow: auto; background: var(--color-surface); border-radius: var(--radius-lg); box-shadow: 0 18px 50px var(--color-shadow); animation: modal-in var(--dur-base) var(--ease-out); }
.panel-header { min-height: 76px; flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); padding: var(--space-4) var(--space-6); border-bottom: var(--rule-thin) solid var(--color-rule); }
.panel-header > div { min-width: 0; }
.panel-header .cycle-tag, .panel-header .eyebrow { margin-bottom: var(--space-2); }
.panel-header h2 { font-size: var(--text-xl); }
.drawer-content, .form-body { flex: 1; padding: var(--space-6); }
.drawer-content { min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; scrollbar-gutter: stable; }
.detail-section { padding-bottom: var(--space-6); border-bottom: var(--rule-thin) solid var(--color-rule); }
.detail-section + .detail-section { padding-top: var(--space-6); }
.detail-section h3 { margin-bottom: var(--space-3); }
.detail-section p { color: var(--color-muted); line-height: 1.75; }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-5); padding: var(--space-6) 0; border-bottom: var(--rule-thin) solid var(--color-rule); }
.detail-grid div { display: flex; flex-direction: column; gap: var(--space-1); }
.detail-grid span { color: var(--color-muted); font-size: var(--text-xs); }
.detail-grid strong { font-size: var(--text-sm); font-weight: 500; }
.detail-section-head { justify-content: space-between; }
.file-button input { display: none; }
.attachment-list { display: grid; gap: var(--space-2); }
.attachment-item { min-height: 48px; display: flex; align-items: center; gap: var(--space-3); padding: var(--space-2) var(--space-3); border: var(--rule-thin) solid var(--color-rule); border-radius: var(--radius-md); }
.attachment-item > svg { color: var(--color-accent); }
.attachment-item div { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.attachment-item strong { font-size: var(--text-sm); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attachment-item span { color: var(--color-muted); font-size: var(--text-xs); }
.attachment-actions { display: flex; flex-direction: row !important; flex: 0 0 auto !important; gap: var(--space-1); }
.attachment-actions .icon-button { width: 36px; height: 36px; }
.attachment-actions a.icon-button { text-decoration: none; }
.attachment-unavailable { color: var(--color-warning); font-size: var(--text-xs); white-space: nowrap; }
.no-attachments { color: var(--color-muted); font-size: var(--text-sm); }
.panel-footer { min-height: 72px; flex: 0 0 auto; display: flex; align-items: center; justify-content: flex-end; gap: var(--space-3); padding: var(--space-3) var(--space-6); border-top: var(--rule-thin) solid var(--color-rule); background: var(--color-surface-subtle); }
.form-body { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-4); }
.form-field { min-width: 0; }
.form-field-wide, .form-error { grid-column: 1 / -1; }
.form-field > label:first-child { display: block; margin-bottom: var(--space-2); color: var(--color-ink); font-size: var(--text-sm); font-weight: 500; }
.form-field > label span { color: var(--color-danger); }
.upload-zone { min-height: 96px; display: grid; place-items: center; align-content: center; gap: var(--space-1); border: var(--rule-thin) dashed var(--color-rule-strong); border-radius: var(--radius-md); background: var(--color-surface-subtle); text-align: center; transition: border-color var(--dur-fast), background var(--dur-fast); }
.upload-zone:hover { border-color: var(--color-accent); background: var(--color-accent-soft); }
.upload-zone svg { color: var(--color-accent); }
.upload-zone strong { font-size: var(--text-sm); }.upload-zone span { color: var(--color-muted) !important; font-size: var(--text-xs); }
.selected-files { margin-top: var(--space-2); color: var(--color-muted); font-size: var(--text-xs); }
.form-error { min-height: 20px; color: var(--color-danger); font-size: var(--text-sm); }
.toast { position: fixed; left: 50%; bottom: var(--space-6); z-index: var(--z-toast); max-width: calc(100% - 32px); min-height: 44px; display: flex; align-items: center; padding: 0 var(--space-4); border-radius: var(--radius-md); background: var(--color-ink); color: var(--color-accent-ink); font-size: var(--text-sm); opacity: 0; pointer-events: none; transform: translate(-50%, 12px); transition: opacity var(--dur-base), transform var(--dur-base); }
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
.preview-overlay { z-index: var(--z-modal); justify-content: center; }
.preview-modal { width: min(1080px, calc(100% - 32px)); height: min(820px, calc(100dvh - 48px)); display: flex; flex-direction: column; }
.preview-content { flex: 1; min-height: 0; overflow: auto; padding: var(--space-6); background: var(--color-surface-subtle); }
.preview-frame { width: 100%; height: 100%; min-height: 560px; border: var(--rule-thin) solid var(--color-rule); border-radius: var(--radius-md); background: var(--color-surface); }
.image-preview { width: 100%; height: 100%; min-height: 420px; display: grid; place-items: center; }
.image-preview img { display: block; max-width: 100%; max-height: 680px; object-fit: contain; border-radius: var(--radius-md); }
.document-preview, .spreadsheet-preview { max-width: 900px; margin: 0 auto; padding: var(--space-8); border: var(--rule-thin) solid var(--color-rule); border-radius: var(--radius-md); background: var(--color-surface); color: var(--color-ink-2); }
.document-preview img { max-width: 100%; height: auto; }
.spreadsheet-preview { overflow: auto; max-width: none; padding: var(--space-4); }
.spreadsheet-preview table { table-layout: auto; background: var(--color-surface); }
.spreadsheet-preview th, .spreadsheet-preview td { min-width: 120px; height: auto; padding: var(--space-2) var(--space-3); border: var(--rule-thin) solid var(--color-rule); }
.preview-message { min-height: 100%; display: grid; place-items: center; align-content: center; gap: var(--space-3); color: var(--color-muted); text-align: center; }
.preview-message svg { width: 36px; height: 36px; }
.rename-overlay { z-index: var(--z-modal); justify-content: center; }
.rename-modal { width: min(440px, calc(100% - 32px)); }
.rename-form-body { display: grid; gap: var(--space-4); padding: var(--space-6); }
.rename-description { color: var(--color-muted); font-size: var(--text-sm); }
.rename-form-body .form-error { min-height: 20px; }
@keyframes slide-in { from { transform: translateX(24px); opacity: 0; } }
@keyframes modal-in { from { transform: translateY(12px); opacity: 0; } }

@media (max-width: 1100px) {
  .page-wrap { padding: var(--space-6); }
  th:nth-child(4), td:nth-child(4), th:nth-child(7), td:nth-child(7) { display: none; }
  th:first-child { width: 34%; }
  .card-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .account-table-frame { overflow: hidden; border: 0; background: transparent; }
  .account-table-frame table, #pendingSection .account-table-frame table, #teamDirectorySection .account-table-frame table { min-width: 0; table-layout: auto; }
  .account-table-frame thead { display: none; }
  .account-table-frame tbody { display: grid; gap: var(--space-3); }
  .account-table-frame tbody tr { display: grid; padding: var(--space-2) var(--space-4); border: var(--rule-thin) solid var(--color-rule); border-radius: var(--radius-lg); background: var(--color-surface); }
  .account-table-frame tbody tr:hover { background: var(--color-surface); }
  .account-table-frame tbody td { width: 100% !important; min-width: 0; height: auto; display: grid; grid-template-columns: minmax(88px, 27%) minmax(0, 1fr); align-items: center; gap: var(--space-3); padding: var(--space-3) 0; border-top: var(--rule-thin) solid var(--color-rule); overflow-wrap: anywhere; }
  .account-table-frame tbody td:first-child { border-top: 0; }
  .account-table-frame tbody td::before { content: attr(data-label); align-self: start; padding-top: 7px; color: var(--color-muted); font-size: var(--text-xs); font-weight: 500; }
  .account-table-frame .account-person { min-width: 0; }
  .account-table-frame .account-actions { width: 100%; }
  .account-table-frame .account-actions .button { flex: 1; min-height: 40px; }
  .account-table-frame td > .button { width: 100%; min-height: 40px; }
  .account-table-frame .permission-note { margin-top: var(--space-1); }
  .account-table-frame .compact-empty { border: var(--rule-thin) solid var(--color-rule); border-radius: var(--radius-lg); background: var(--color-surface); }
}
@media (max-width: 820px) {
  .auth-screen { grid-template-columns: minmax(0, 1fr); }
  .auth-brand-panel { min-height: auto; }
  .auth-brand { border-bottom-color: var(--color-ink-2); }
  .auth-statement { padding: var(--space-8) var(--space-5); }
  .auth-statement h1 { font-size: var(--text-2xl); max-width: 16ch; }
  .auth-statement > p { margin-top: var(--space-3); }
  .auth-form-panel { min-height: auto; padding: var(--space-8) var(--space-5); place-items: start center; }
  .sidebar { transform: translateX(-100%); transition: transform var(--dur-base) var(--ease-out); }
  .sidebar.is-open { transform: translateX(0); }
  .sidebar-scrim.is-visible { display: block; position: fixed; inset: 0; z-index: 15; background: var(--color-overlay); }
  .main-content { margin-left: 0; }
  .mobile-menu { display: grid; }
  .breadcrumb > span, .breadcrumb > svg { display: none; }
  .topbar { padding: 0 var(--space-4); }
  .page-wrap { padding: var(--space-5) var(--space-4); }
  .metric-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric:nth-child(2) { border-right: 0; }.metric:nth-child(-n+2) { border-bottom: var(--rule-thin) solid var(--color-rule); }
  .toolbar { flex-wrap: wrap; }
  .search-field { flex-basis: 100%; }
  .select-field { flex: 1; min-width: 130px; }
  .table-frame { display: none; }
  .card-list { display: grid !important; }
  .view-switch { display: none; }
}
@media (max-width: 560px) {
  .top-actions > .icon-button { display: none; }
  .topbar .button { padding: 0 var(--space-3); }
  .page-heading { margin-bottom: var(--space-6); }
  .page-heading { align-items: stretch; flex-direction: column; gap: var(--space-4); }
  .member-scope { width: 100%; }
  .member-scope button { flex: 1 1 42%; padding: 0 var(--space-2); }
  .scope-team-select { flex: 1 0 100%; border-top: var(--rule-thin) solid var(--color-rule); border-left: 0; }
  .page-heading p:not(.eyebrow) { max-width: 34ch; }
  .metric { padding: var(--space-4); }
  .metric small { min-height: 18px; }
  .section-head { align-items: end; }
  .team-section-head { align-items: stretch; flex-direction: column; }
  .member-section-head { align-items: stretch; flex-direction: column; }
  .member-search { width: 100%; }
  .inline-team-form { width: 100%; align-items: stretch; flex-direction: column; }
  .inline-team-form .button { width: 100%; }
  .toolbar .button { width: 44px; padding: 0; }
  .toolbar .button span { display: none; }
  .card-list { grid-template-columns: minmax(0, 1fr); }
  .modal { width: 100%; max-height: 100dvh; min-height: 100dvh; border-radius: 0; }
  .rename-modal { width: calc(100% - 32px); min-height: auto; border-radius: var(--radius-lg); }
  .preview-modal { width: 100%; height: 100dvh; }
  .preview-content { padding: var(--space-3); }
  .document-preview { padding: var(--space-4); }
  .form-body { grid-template-columns: minmax(0, 1fr); padding: var(--space-5) var(--space-4); }
  .form-field-wide, .form-error { grid-column: auto; }
  .panel-header, .panel-footer { padding-left: var(--space-4); padding-right: var(--space-4); }
  .drawer-content { padding: var(--space-5) var(--space-4); }
  .detail-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 1ms !important; transition-duration: 1ms !important; }
}
