/* Final shared UI layer. One comfortable baseline; Kanban owns only its geometry. */
:root {
  --space-1:4px; --space-2:8px; --space-3:12px; --space-4:20px; --space-5:24px;
  --control-height:42px; --panel-padding:20px; --radius-sm:7px; --radius-md:12px;
  --table-row-y:12px; --base-size:15px; --column-width:225px;
  --surface:#fff; --canvas:#f5f6f7; --soft:#f5f6f7; --sidebar:#fafafa;
  --white:var(--surface); --ink:#111827; --text:#374151; --muted:#6b7280;
  --line:#e5e7eb; --input-line:#cbd0d8; --action:#334155; --action-hover:#1f2937; --active-bg:#eef1f4; --accent:#334155; --accent-dark:#1f2937;
  --positive-bg:#eef1f4; --positive-text:#374151; --attention-bg:#faf2e0; --attention-text:#876321;
  --danger-bg:#faeeeb; --danger-text:#a74338; --focus:#94a3b8; --on-accent:#fff;
  --overlay:#11182766; --shadow:0 10px 28px #11182720;
  color-scheme:light;
}
[data-theme="dark"] {
  --surface:#20242b; --canvas:#15181e; --soft:#2b3038; --sidebar:#1b1f26;
  --ink:#f3f4f6; --text:#d1d5db; --muted:#a1a8b3; --line:#3b424d; --input-line:#596270;
  --accent:#cbd5e1; --accent-dark:#e2e8f0; --on-accent:#111827;
  --action:#334155; --action-hover:#475569; --active-bg:#303741;
  --positive-bg:#303741; --positive-text:#d1d5db; --attention-bg:#443b28; --attention-text:#e5cd91;
  --danger-bg:#452f2c; --danger-text:#efb2a8; --focus:#94a3b8;
  --overlay:#080b11b3; --shadow:0 12px 32px #0005;
  color-scheme:dark;
}
[hidden] { display:none !important; }
body { background:var(--canvas); font-size:var(--base-size); line-height:1.5; }
button,input,select,textarea { font:inherit; }
textarea,summary { color:var(--ink); }
textarea:focus-visible,summary:focus-visible,:focus-visible { outline:3px solid var(--focus); outline-offset:3px; }
.app-shell { grid-template-columns:220px minmax(0,1fr); }
.sidebar { padding:24px 12px 16px; }
.sidebar .brand { margin:0 8px 22px; gap:9px; }
.brand-mark { flex-shrink:0; color:var(--on-accent); }
.brand-name { font-size:19px; }
.brand-logo { max-width:170px; max-height:64px; object-fit:contain; }
.workspace-label { margin:0 8px 18px; font-size:12px; }
.nav-caption { font-size:10px; margin:16px 12px 8px; }
.nav-link { font-size:14px; min-height:42px; padding:10px 12px; gap:10px; }
.nav-link .icon { width:19px; height:19px; }
.nav-link.is-active { color:var(--ink); background:var(--active-bg); font-weight:650; }
.nav-attention-badge { display:inline-flex; align-items:center; justify-content:center; flex-shrink:0; margin-left:auto; min-width:18px; height:18px; padding:0 5px; border-radius:10px; background:#b43a38; color:#fff; font-size:11px; line-height:18px; font-weight:600; font-variant-numeric:tabular-nums; }
.sidebar-footer { margin-top:24px; padding-top:18px; }
.main-nav + .sidebar-footer { margin-top:auto; }
.user-identity strong { font-size:13px; }
.topbar { height:auto; min-height:80px; padding:16px 26px; gap:20px; background:var(--surface); }
.topbar-title { min-width:0; flex:1; }
.breadcrumb { font-size:12px; }
.breadcrumb strong { font-size:17px; font-weight:600; color:var(--ink); }
.topbar-subtitle { font-size:12px; color:var(--muted); margin-top:4px; }
.topbar-meta { gap:10px; font-size:12px; }
.topbar-meta strong,.topbar-meta small { display:block; }
.topbar-meta strong { font-weight:600; color:var(--text); }
.topbar-meta small { color:var(--muted); margin-top:2px; }
.main-content { padding:24px 26px 36px; max-width:none; }
.workspace-footer { padding:16px 26px; font-size:11px; }
h1,.detail-heading h1,.page-heading h1 { font-size:24px; letter-spacing:-.4px; }
h2 { font-size:17px; line-height:1.4; }
.page-heading { margin-bottom:24px; }
.button,.button-secondary { min-height:var(--control-height); padding:9px 15px; font-size:14px; line-height:1.35; background:var(--surface); border:1px solid var(--input-line); color:var(--text); border-radius:var(--radius-sm); }
.button:hover,.button-secondary:hover { background:var(--active-bg); border-color:var(--input-line); color:var(--ink); }
.button-primary { background:var(--action); border-color:var(--action); color:#fff; }
.button-primary:hover { background:var(--action-hover); border-color:var(--action-hover); color:#fff; }
.topbar-action { min-height:37px; padding:7px 12px; font-size:13px; }
.demo-banner { padding:8px 12px; margin-bottom:16px; border:1px solid var(--line); border-radius:8px; background:var(--attention-bg); color:var(--attention-text); font-size:12px; }
.button-danger { background:var(--surface); color:var(--danger-text); border-color:var(--danger-text); }
.button-danger:hover { background:var(--danger-bg); color:var(--danger-text); border-color:var(--danger-text); }
.button:disabled { opacity:.6; cursor:wait; }
.panel,dialog { background:var(--surface); color:var(--text); }
.panel { border-radius:var(--radius-md); box-shadow:none; min-width:0; }
.panel-header { padding:16px var(--panel-padding); gap:12px; flex-wrap:wrap; }
.panel-header h2 { font-size:16px; }
.panel-header>.muted,.panel-header>.quiet-link { font-size:12px; }
.field { min-width:0; }
.field>label { font-size:13px; margin-bottom:6px; }
.field input,.field select { height:var(--control-height); min-width:0; border-color:var(--input-line); background:var(--surface); color:var(--ink); padding:8px 11px; }
.field textarea { width:100%; padding:10px 12px; border:1px solid var(--input-line); border-radius:var(--radius-sm); background:var(--surface); color:var(--ink); resize:vertical; }
.field input[type="checkbox"] { width:18px; height:18px; accent-color:var(--accent); }
.application-filters { display:flex; flex-wrap:wrap; align-items:flex-end; gap:12px; padding:14px 16px; margin:0 0 24px; }
.application-filters .field { flex:1 1 148px; min-width:0; max-width:240px; }
.application-filters .field>label { font-size:12px; margin-bottom:5px; }
.application-filters .field input,.application-filters .field select { width:100%; font-size:14px; padding:8px 10px; }
.filter-checks { display:flex; flex-wrap:wrap; gap:10px 14px; align-items:center; min-height:40px; }
.filter-checks label { display:flex; gap:7px; align-items:center; font-size:13px; }
.filter-actions { display:flex; flex:0 0 auto; min-height:var(--control-height); align-items:center; gap:14px; margin-left:auto; font-size:13px; }
.client-search .field { flex:1; max-width:540px; }
.workspace-toolbar { margin-bottom:18px; font-size:13px; gap:12px; }
.view-tabs { padding:3px; }
.view-tabs a { padding:8px 18px; min-height:36px; font-size:14px; }
.view-tabs [aria-current] { background:var(--surface); }
.task-tabs { margin:0 0 20px; gap:4px; padding:4px; background:var(--soft); border-radius:9px; width:fit-content; max-width:100%; }
.task-tabs .button { padding:8px 12px; min-height:38px; font-size:13px; border-color:transparent; background:transparent; }
.task-tabs .button[aria-current] { background:var(--surface); border-color:var(--line); }
.count-badge { font-size:12px; padding:2px 7px; font-weight:500; }
table { font-size:14px; }
td,th { padding:var(--table-row-y) 14px; line-height:1.5; }
th { font-size:12px; font-weight:600; color:var(--muted); background:var(--soft); }
tbody tr:hover { background:var(--soft); }
.applications-table td,.applications-table th { font-size:14px; }
.records-table small,.applications-table td small,.dashboard-table small { display:block; font-size:12px; color:var(--muted); margin-top:4px; }
.table-person strong { font-size:14px; }
.table-scroll { position:relative; max-width:100%; overflow:auto; }
.records-table table { min-width:850px; }
.table-footer { padding:14px 20px; font-size:13px; }
.empty-table { padding:38px 20px; color:var(--muted); text-align:center; }
.related-panel { margin-top:24px; }
.record-panel,.form-panel { padding:var(--panel-padding); }
.record-actions { margin-top:20px; gap:10px; }
.section-title { margin:24px 0 12px; font-size:17px; }
.back-link { margin-bottom:20px; }
.money-value { font-variant-numeric:tabular-nums; font-weight:600; }
/* Standalone component: no dependency on records.css or the enclosing page. */
.financial-summary { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); align-items:stretch; gap:0; padding:0; margin:20px 0; border:1px solid var(--line); border-radius:var(--radius-md); overflow:hidden; background:var(--surface); line-height:1.5; }
.financial-summary .financial-card { min-width:0; padding:22px 20px; border:0; border-right:1px solid var(--line); border-radius:0; overflow-wrap:anywhere; }
.financial-summary .financial-card:last-child { border-right:0; }
.financial-card h2 { font-size:13px; color:var(--muted); font-weight:500; margin:0 0 12px; }
.financial-card p { font-size:clamp(20px,1.7vw,28px); line-height:1.4; font-weight:650; color:var(--ink); margin:0; font-variant-numeric:tabular-nums; overflow-wrap:anywhere; }
.financial-card:hover { background:var(--soft); }
.financial-card.is-zero p { color:var(--muted); }
.dashboard-greeting { margin:0; min-width:0; }
.dashboard-greeting p { margin-top:6px; font-size:13px; }
.dashboard-header { display:flex; align-items:flex-end; justify-content:space-between; gap:24px; margin-bottom:24px; }
/* Decoration is out of flow: preserve the existing header and KPI geometry. */
.dashboard-workspace { --dashboard-accent:#486657; --dashboard-icon-bg:#eef3ef; --dashboard-line:#dce3df; --dashboard-shadow:0 2px 6px #172b2008; }
[data-theme="dark"] .dashboard-workspace { --dashboard-accent:#b2c9bb; --dashboard-icon-bg:#29392f; --dashboard-line:var(--line); --dashboard-shadow:0 2px 6px #0002; }
.dashboard-header { position:relative; isolation:isolate; }
/* Place the line art beside the opaque period form, within the same header. */
.dashboard-header::before { content:""; position:absolute; inset:0; pointer-events:none; z-index:0; background-image:var(--dashboard-background); background-repeat:no-repeat; background-size:auto 180%; background-position:right 500px center; opacity:.68; mix-blend-mode:multiply; filter:brightness(.75) contrast(2); mask-image:linear-gradient(to right,transparent 15%,#000 48%); }
.dashboard-header > * { position:relative; z-index:1; }
[data-theme="dark"] .dashboard-header::before { display:none; }
@media(max-width:900px) { .dashboard-header::before { display:none; } }
.dashboard-widget > .panel { border-color:var(--dashboard-line); box-shadow:var(--dashboard-shadow); }
.dashboard-workspace .operational-kpi:hover { border-color:var(--dashboard-accent); }
.dashboard-workspace .kpi-label .icon { width:18px; height:18px; color:var(--dashboard-accent); background:var(--dashboard-icon-bg); border-radius:5px; box-shadow:0 0 0 5px var(--dashboard-icon-bg); }
.dashboard-workspace .funnel-stage .stage-dot { background:var(--muted); }
.dashboard-workspace .funnel-stage:last-child .stage-dot { background:var(--dashboard-accent); }
.dashboard-header.is-admin { justify-content:flex-end; }
.dashboard-period { display:flex; align-items:flex-end; justify-content:flex-end; gap:10px; flex-wrap:wrap; padding:10px 12px; border:1px solid var(--line); border-radius:var(--radius-md); background:var(--surface); }
.dashboard-period .field { min-width:138px; }
.dashboard-period .field>label { margin-bottom:3px; font-size:11px; }
.dashboard-period .field input { width:138px; height:36px; padding:6px 8px; font-size:13px; }
.dashboard-period .filter-actions { min-height:36px; gap:10px; margin-left:2px; }
.dashboard-period .button { min-height:36px; padding:7px 11px; font-size:13px; }
.dashboard-composition { display:grid; gap:24px; }
.dashboard-kpis { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:16px; }
.operational-kpi { padding:20px; min-width:0; display:flex; flex-direction:column; gap:10px; transition:border-color .15s; }
.operational-kpi:hover { border-color:var(--focus); }
.operational-kpi .kpi-label { display:flex; justify-content:space-between; gap:10px; align-items:flex-start; font-size:13px; color:var(--text); min-height:22px; }
.kpi-label .icon { width:19px; height:19px; flex-shrink:0; color:var(--accent); }
.operational-kpi>strong { font-size:34px; line-height:1.15; color:var(--ink); font-weight:650; letter-spacing:-1px; }
.operational-kpi small { font-size:12px; color:var(--muted); }
.operational-kpi small b { font-weight:600; color:var(--text); }
.operational-kpi.zero>strong { color:var(--muted); font-weight:500; }
.kpi-foot { display:flex; flex-wrap:wrap; align-items:center; gap:7px 10px; margin-top:auto; padding-top:5px; font-size:12px; }
.danger-dot { display:inline-block; height:5px; width:5px; border-radius:50%; background:var(--danger-text); margin-right:6px; vertical-align:middle; }
.dashboard-row { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:24px; align-items:stretch; }
.sales-panel { display:flex; flex-direction:column; }
.sales-panel .financial-summary { margin:24px 0 auto; border:0; border-radius:0; }
.sales-panel .financial-card { padding:16px 18px; }
.panel-note { padding:20px; font-size:12px; color:var(--muted); }
.panel-more { display:block; padding:14px 20px; color:var(--accent); font-size:13px; border-top:1px solid var(--line); }
.panel-more:hover { background:var(--soft); }
.quick-items { list-style:none; padding:0 20px; margin:0; font-size:14px; }
.quick-items li { display:flex; align-items:center; gap:14px; padding:16px 0; border-top:1px solid var(--line); overflow-wrap:anywhere; }
.quick-items li:first-child { border-top:0; }
.quick-items li>div { min-width:0; flex:1; }
.quick-items small { display:block; color:var(--muted); margin-top:4px; font-size:12px; }
.quick-items .empty-state { padding:30px 0; min-height:110px; font-size:14px; }
.quick-items .action-status { flex-shrink:0; font-size:11px; }
.row-time { font-size:13px; color:var(--muted); flex:0 0 42px; font-variant-numeric:tabular-nums; }
.row-time b { display:block; color:var(--ink); font-weight:600; }
.workspace-tabs { display:flex; gap:16px; padding:0 20px; border-bottom:1px solid var(--line); }
.workspace-tabs button { padding:13px 0; font-size:12px; line-height:1.5; color:var(--muted); border:0; border-bottom:2px solid transparent; background:none; text-align:left; }
.workspace-tabs button[aria-selected="true"] { color:var(--ink); border-bottom-color:var(--ink); font-weight:600; }
.workspace-tabs button span { margin-left:4px; font-variant-numeric:tabular-nums; }
.attention-mark { display:grid; place-items:center; width:24px; height:24px; border-radius:50%; background:var(--attention-bg); color:var(--attention-text); font-size:13px; }
.manager-person { display:flex; gap:10px; align-items:center; }
.manager-table table { min-width:990px; table-layout:auto; }
.manager-table th:first-child { min-width:200px; }
.danger-number { color:var(--danger-text); background:var(--danger-bg); border-radius:5px; padding:2px 7px; font-weight:600; }
.attention-number { color:var(--attention-text); }
.personal-funnel { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); padding:24px 12px 14px; }
.funnel-stage { padding:0 12px; min-width:0; border-right:1px solid var(--line); }
.funnel-stage:last-child { border-right:0; }
.funnel-stage:hover { color:var(--accent); }
.funnel-stage-label { display:block; min-height:48px; font-size:12px; color:var(--muted); overflow-wrap:anywhere; }
.funnel-stage strong { display:block; font-size:26px; font-weight:600; color:var(--ink); margin:8px 0; }
.funnel-stage small { display:block; font-size:12px; font-variant-numeric:tabular-nums; overflow-wrap:anywhere; }
.stage-dot { display:inline-block; width:7px; height:7px; margin-right:6px; border-radius:50%; background:var(--accent); }
.color-slate,.color-amber,.color-red,.color-blue,.color-green { background:var(--muted); }
.sales-chart { position:relative; padding:16px 20px 12px; }
.sales-chart svg { display:block; width:100%; height:148px; overflow:visible; }
.chart-scale,.chart-labels { display:flex; justify-content:space-between; gap:10px; color:var(--muted); font-size:11px; }
.chart-grid { fill:none; stroke:var(--line); stroke-width:1; vector-effect:non-scaling-stroke; stroke-dasharray:3 5; }
.chart-bar { fill:var(--accent); opacity:.8; }
.chart-bar:hover { opacity:1; }
.chart-empty { position:absolute; inset:75px 20px auto; text-align:center; font-size:13px; color:var(--muted); }
.chart-values { padding:0 20px 14px; font-size:12px; }
.chart-values summary { color:var(--muted); font-weight:400; }
.chart-values .table-scroll { max-height:240px; }
.dashboard-table table { min-width:510px; }
.dashboard-table .money-value { white-space:nowrap; }
.conversion-list { gap:20px; margin:20px 0; font-size:14px; }
.conversion-list dd { font-size:24px; }
/* Kanban: five columns at 1440px, readable type independent of global density. */
.kanban-board { gap:10px; }
.kanban-column { width:var(--column-width); flex-basis:var(--column-width); padding:8px; border-radius:10px; background:var(--soft); border:1px solid var(--line); border-top:3px solid var(--accent); }
[data-color] { border-top-color:var(--muted); }
.column-heading { min-height:42px; padding:2px 3px 8px; align-items:flex-start; }
.column-heading h2 { font-size:13px; line-height:1.5; }
.column-heading .count-badge { background:var(--surface); }
.column-amount { font-size:13px; color:var(--muted); padding:0 3px 14px; font-variant-numeric:tabular-nums; }
.column-cards { gap:12px; }
.application-card { border-radius:9px; box-shadow:none; }
.application-card:hover { border-color:var(--input-line); box-shadow:0 2px 6px #11182708; }
.card-link { padding:13px 12px; }
.card-link h3 { font-size:15px; line-height:1.45; }
.card-meta { font-size:12px; margin-bottom:9px; }
.card-phone { font-size:12px; color:var(--muted); margin-top:6px; }
.card-amount { font-size:16px; font-weight:600; margin-top:8px; color:var(--ink); font-variant-numeric:tabular-nums; overflow-wrap:anywhere; }
.card-link .next-action { margin-top:16px; min-height:38px; gap:5px; }
.next-action strong { font-size:13px; }
.next-action time,.action-status { font-size:12px; }
.action-status { display:inline-block; padding:3px 7px; border-radius:5px; line-height:1.5; }
.status-overdue { background:var(--danger-bg); color:var(--danger-text); }
.status-today { background:var(--positive-bg); color:var(--positive-text); }
.status-missing { background:var(--attention-bg); color:var(--attention-text); }
.status-upcoming { background:var(--soft); color:var(--muted); }
.card-times { font-size:11px; margin-top:14px; padding-top:10px; gap:4px; }
.card-assignment { padding:7px 10px; }
.card-assignment select { font-size:12px; min-height:32px; }
.assign-button { min-width:32px; min-height:32px; }
.column-empty { padding:20px 5px; font-size:13px; }
.column-all { margin-top:12px; font-size:13px; }
.kanban-column.drag-target { background:var(--positive-bg); border-color:var(--focus); }
.application-card.is-dragging { opacity:.6; }
.kanban-drag-ghost { position:fixed; left:0; top:0; pointer-events:none; z-index:100; opacity:.95; background:var(--surface); border:1px solid var(--input-line); box-shadow:var(--shadow); transform:rotate(-2deg); }
.below-note { font-size:12px; margin-top:16px; }
/* Shared record surfaces and inline editor. */
.application-drawer { width:min(760px,100vw); background:var(--surface); }
.application-drawer .application-detail { padding:0 24px 24px; }
.application-drawer .detail-heading { position:sticky; top:0; z-index:2; background:var(--surface); margin:0 -24px 16px; padding:22px 24px; border-bottom:1px solid var(--line); }
.detail-heading h1 { font-size:24px; }
.detail-heading p { display:flex; align-items:center; gap:10px; flex-wrap:wrap; font-size:13px; }
.detail-section { padding:24px 0; }
.detail-section h2 { margin-bottom:14px; }
.section-heading { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:16px; }
.section-heading h2 { margin:0; }
.detail-data { gap:18px 24px; margin:14px 0; }
.detail-data dt { font-size:12px; margin-bottom:5px; }
.detail-data dd { font-size:15px; line-height:1.5; }
.detail-form { margin:18px 0; padding:0; gap:14px; border:0; background:transparent; }
.workflow-actions { margin-top:20px; padding:16px 0 0; border-top:1px solid var(--line); }
.workflow-actions summary { font-size:13px; color:var(--muted); }
.project-summary { margin:0; }
.project-summary .detail-data { grid-template-columns:repeat(auto-fit,minmax(155px,1fr)); padding:18px; background:var(--soft); border-radius:var(--radius-md); gap:20px; }
.project-summary dd { font-weight:500; }
.project-summary .project-amount { border-left:3px solid var(--accent); padding-left:12px; }
.project-summary .project-amount dd { color:var(--accent); font-size:18px; font-weight:600; }
.detail-items li { padding:16px 0; }
.inline-edit-form { padding:18px; background:var(--soft); border-radius:var(--radius-md); }
.inline-edit-form .form-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; }
.inline-edit-form .form-actions { padding:20px 0 0; margin:0; justify-content:flex-start; }
.inline-field-error { color:var(--danger-text); font-size:12px; margin-top:5px; }
.inline-edit-error { margin-bottom:16px; }
.application-detail>details.detail-section summary { font-size:14px; color:var(--muted); }
.settings-tabs { display:flex; flex-wrap:wrap; gap:8px; border-bottom:1px solid var(--line); margin-bottom:24px; }
.settings-tabs a { padding:13px 16px; font-size:14px; border-bottom:2px solid transparent; }
.settings-tabs [aria-current] { color:var(--ink); background:var(--active-bg); border-color:var(--ink); font-weight:600; }
.directory-grid { gap:24px; grid-template-columns:1fr; }
.directory-form,.interface-form { max-width:680px; gap:20px; }
.action-dialog { padding:24px; max-height:calc(100dvh - 32px); overflow:auto; }
.action-dialog h2 { font-size:20px; }
.workspace-notice { background:var(--ink); color:var(--surface); }
.inbound-card { padding:20px; }
pre { max-width:100%; overflow:auto; }
.mobile-menu-toggle,.mobile-nav-close,.nav-overlay { display:none; }
body:has(.application-drawer[open]),body.navigation-open { overflow:hidden; }
@media(min-width:1600px) { :root { --column-width:254px; } }
@media(max-width:1200px) {
  .topbar-meta { display:none; }
  .dashboard-kpis { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .dashboard-row { grid-template-columns:1fr; }
  .sales-panel .financial-summary { margin:20px 0; }
  .personal-funnel { padding:24px 20px; }
}
@media(max-width:768px) {
  :root { --control-height:44px; --panel-padding:18px; }
  .app-shell { display:block; }
  .sidebar { position:fixed; inset:0 auto 0 0; z-index:51; height:100dvh; width:min(82vw,320px); padding:24px 16px 20px; transform:translateX(-100%); visibility:hidden; transition:transform .2s ease,visibility .2s; box-shadow:var(--shadow); }
  .navigation-open .sidebar { transform:translateX(0); visibility:visible; }
  .sidebar .brand { margin:0 36px 22px 6px; }
  .sidebar .brand-name { font-size:18px; }
  .workspace-label { display:flex; }
  .nav-caption { display:block; }
  .main-nav,.admin-nav { display:block; }
  .admin-nav { padding-top:20px; margin-top:auto; }
  .nav-link { min-height:44px; padding:11px 12px; font-size:15px; }
  .nav-link .icon { width:19px; height:19px; }
  .sidebar-footer { margin-top:22px; padding-top:18px; }
  .sidebar-footer .user-identity { display:flex; }
  .sidebar-footer form { display:block; }
  .mobile-nav-close { display:flex; position:absolute; top:16px; right:12px; padding:8px; min-width:40px; min-height:40px; }
  .mobile-menu-toggle { display:flex; flex-shrink:0; padding:9px; min-width:44px; z-index:52; }
  .navigation-open .mobile-menu-toggle { position:fixed; top:12px; left:min(82vw,320px); margin-left:8px; }
  .nav-overlay:not([hidden]) { display:block; position:fixed; inset:0; z-index:50; border:0; padding:0; background:var(--overlay); }
  .topbar { min-height:72px; padding:12px 16px; gap:12px; flex-wrap:wrap; }
  .topbar-title { flex:1; }
  .breadcrumb { font-size:0; }
  .breadcrumb span { display:none; }
  .breadcrumb strong { font-size:16px; }
  .topbar-subtitle { display:none; }
  .topbar-action { margin-left:auto; padding:9px 12px; font-size:13px; }
  .main-content { padding:20px 16px 28px; }
  .workspace-footer { padding:16px; }
  .dashboard-composition,.dashboard-row { gap:20px; }
  .dashboard-kpis { gap:12px; }
  .operational-kpi { padding:16px; }
  .operational-kpi>strong { font-size:30px; }
  .application-filters { padding:14px; gap:12px; margin-bottom:20px; }
  .application-filters .field { flex:1 1 140px; max-width:none; }
  .filter-actions { margin-left:0; }
  .financial-summary { grid-template-columns:1fr; }
  .financial-summary .financial-card { display:flex; align-items:center; justify-content:space-between; gap:14px; padding:16px 18px; border-right:0; border-bottom:1px solid var(--line); }
  .financial-summary .financial-card:last-child { border-bottom:0; }
  .financial-card h2 { margin:0; max-width:45%; }
  .financial-card p { font-size:22px; text-align:right; }
  .personal-funnel { grid-template-columns:repeat(2,minmax(0,1fr)); gap:20px 0; padding:20px 8px; }
  .funnel-stage-label { min-height:0; }
  .funnel-stage:nth-child(even) { border-right:0; }
  .workspace-tabs { padding:0 18px; gap:14px; }
  .quick-items { padding:0 18px; }
  .quick-items li { gap:10px; flex-wrap:wrap; }
  .quick-items li>div { flex-basis:180px; }
  .quick-items .action-status { margin-left:auto; }
  .application-drawer { width:100vw; max-width:100vw; }
  .application-drawer .application-detail { padding:0 18px 24px; }
  .application-drawer .detail-heading { margin:0 -18px 16px; padding:18px; }
  .detail-data { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .form-grid,.inline-edit-form .form-grid { grid-template-columns:1fr; }
  .form-grid .span-two { grid-column:auto; }
  .task-actions,.form-actions { flex-wrap:wrap; }
  .inline-edit-form .form-actions { flex-direction:row; }
  .settings-tabs { gap:0; }
  .settings-tabs a { padding:12px; font-size:13px; }
  .workspace-toolbar { flex-wrap:wrap; }
}
@media(max-width:480px) {
  .dashboard-kpis { grid-template-columns:1fr; }
  .operational-kpi { display:grid; grid-template-columns:1fr auto; gap:10px 14px; }
  .operational-kpi .kpi-label { grid-column:1; }
  .operational-kpi>strong { grid-column:2; grid-row:1/3; align-self:center; }
  .operational-kpi .kpi-foot { grid-column:1/-1; }
  .detail-data { grid-template-columns:1fr; }
  .detail-data .span-two { grid-column:auto; }
  .financial-card p { font-size:20px; }
}
@media(prefers-reduced-motion:reduce) { *,*::before,*::after { transition:none !important; scroll-behavior:auto !important; } }

/* Shared document, dialog and responsive controls. */
#permanent-detail { max-width:1040px; margin:0 auto; padding:28px 32px; border:1px solid var(--line); border-radius:12px; background:var(--surface); }
.read-fields>div { border:1px solid var(--line); border-radius:7px; background:var(--soft); padding:10px 12px; min-width:0; }
.read-fields dd { margin:0; overflow-wrap:anywhere; }
.kanban-tools,.kanban-navigation { display:flex; align-items:center; gap:6px; }
.kanban-tools { gap:16px; }
.kanban-navigation button { border:1px solid var(--line); background:var(--surface); color:var(--text); border-radius:6px; width:34px; height:34px; display:grid; place-items:center; padding:5px; }
.kanban-navigation button:hover:not(:disabled) { background:var(--active-bg); }
.kanban-navigation button:disabled { opacity:.35; cursor:default; }
.kanban-navigation svg { width:20px; height:20px; fill:none; stroke:currentColor; stroke-width:1.7; stroke-linecap:round; stroke-linejoin:round; }
.filter-toggle-bar { display:none; }
.filter-fields { display:contents; }
.crm-dialog { width:min(620px,calc(100vw - 40px)); max-width:100%; max-height:calc(100dvh - 40px); padding:24px; border:1px solid var(--line); border-radius:12px; background:var(--surface); color:var(--text); overflow:auto; box-shadow:var(--shadow); }
.crm-dialog::backdrop { background:var(--overlay); }
.crm-dialog.client-drawer { position:fixed; inset:0 0 0 auto; margin:0; width:min(780px,100vw); height:100dvh; max-height:100dvh; border-radius:0; }
.dialog-heading { display:flex; justify-content:space-between; align-items:start; gap:16px; margin-bottom:20px; }
.dialog-heading h1 { font-size:22px; }
.dialog-heading .button { min-height:36px; flex-shrink:0; padding:6px 10px; }
.dialog-context { margin-bottom:20px; font-weight:600; overflow-wrap:anywhere; }
.dialog-close { display:none; }
.crm-dialog .dialog-close { display:inline-flex; }
.crm-dialog .record-form,.action-page .record-form { display:grid; gap:18px; max-width:100%; }
.crm-dialog .field,.action-page .field { min-width:0; }
.crm-dialog .field input,.crm-dialog .field select,.crm-dialog textarea,.action-page textarea { width:100%; min-width:0; }
.crm-dialog textarea,.action-page textarea { padding:10px 12px; border:1px solid var(--input-line); border-radius:6px; background:var(--surface); }
.crm-dialog .dialog-actions { display:flex; flex-wrap:wrap; gap:10px; position:sticky; bottom:-24px; background:var(--surface); margin:0 -24px -24px; padding:16px 24px 24px; border-top:1px solid var(--line); z-index:1; }
.followup-fields { border:0; border-top:1px solid var(--line); padding:20px 0 0; margin:0; display:grid; gap:16px; min-width:0; }
.followup-fields legend { color:var(--ink); font-weight:600; padding:0 10px 0 0; }
.next-action-preview,.selected-application { padding:14px; border:1px solid var(--line); background:var(--soft); border-radius:8px; }
.next-action-preview p { margin-top:6px; font-size:13px; }
.selected-application { margin-bottom:20px; }
.selected-application dl { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; font-size:13px; }
.selected-application dt { color:var(--muted); }
.selected-application dd { margin:3px 0 0; overflow-wrap:anywhere; }
.picker-results { list-style:none; margin:12px 0; padding:0; }
.picker-results a { display:block; padding:12px; border-bottom:1px solid var(--line); border-radius:6px; }
.picker-results a:hover { background:var(--active-bg); }
.picker-results small { display:block; margin-top:4px; color:var(--muted); }
.application-picker [role="status"] { margin-top:12px; font-size:13px; }
.client-detail-content { position:relative; min-width:0; }
.client-close { position:absolute; right:0; top:0; }
.client-drawer .page-heading { padding-right:42px; flex-wrap:wrap; }
.client-drawer .related-panel,.client-drawer .record-panel { border:0; border-top:1px solid var(--line); border-radius:0; padding:20px 0; }
.client-drawer .records-table { overflow:auto; }
.client-drawer .records-table table { min-width:650px; }
.action-notice { position:fixed; bottom:24px; left:50%; transform:translateX(-50%); width:max-content; max-width:calc(100vw - 32px); padding:12px 18px; border:1px solid var(--line); border-radius:8px; background:var(--ink); color:var(--surface); z-index:60; font-size:14px; }
body:has(.crm-dialog[open]) { overflow:hidden; }
@media(max-width:768px) {
  .topbar-action { min-height:42px; padding:9px 12px; }
  #permanent-detail { padding:18px; }
  [data-responsive-filters][data-enhanced] { display:block; padding:0; }
  .filter-toggle-bar { display:flex; align-items:center; gap:12px; padding:0 14px; }
  .filter-toggle { display:flex; align-items:center; justify-content:space-between; flex:1; gap:12px; border:0; padding:12px 0; min-height:48px; color:var(--text); background:transparent; font-size:13px; text-align:left; }
  .filter-toggle span { color:var(--muted); }
  .filter-toggle-bar a { font-size:12px; }
  .filter-fields { display:flex; flex-wrap:wrap; gap:12px; padding:14px; border-top:1px solid var(--line); }
  .filter-fields .field { min-width:0; flex:1 1 140px; }
  .task-tabs { flex-wrap:nowrap; overflow-x:auto; max-width:100%; padding-bottom:8px; scrollbar-width:thin; }
  .task-tabs>a { flex:0 0 auto; }
  .workspace-toolbar { gap:10px; }
  .kanban-tools { flex:1 1 100%; justify-content:space-between; }
  .kanban-navigation { gap:0; }
  .kanban-navigation button { width:42px; height:42px; padding:9px; border:5px solid var(--canvas); border-radius:10px; background:var(--surface); }
  .crm-dialog,.crm-dialog.client-drawer { position:fixed; inset:0; width:100vw; max-width:100vw; height:100dvh; max-height:100dvh; margin:0; border:0; border-radius:0; padding:20px 18px; }
  .crm-dialog .dialog-actions { bottom:-20px; margin:0 -18px -20px; padding:14px 18px 20px; }
  .selected-application dl { grid-template-columns:1fr; gap:8px; }
  .crm-dialog .table-scroll { max-width:100%; }
}

/* Persistent Russian phone mask: typed digits stay dark, the remaining example stays visible. */
.phone-mask-shell { position:relative; display:block; min-width:0; }
.phone-mask-shell>input[data-phone-mask] { position:relative; z-index:1; font-variant-numeric:tabular-nums; }
.phone-mask-guide { position:absolute; z-index:2; left:13px; top:50%; transform:translateY(-50%); pointer-events:none; color:var(--muted); opacity:.55; white-space:pre; font:inherit; font-variant-numeric:tabular-nums; }
.phone-mask-guide__filled { visibility:hidden; }

/* Application aggregate: management, immutable lead, client and working project. */
.application-detail { container-type:inline-size; }
.application-detail .detail-data { grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px 20px; }
.workflow-actions { padding:18px; background:var(--surface); border:1px solid var(--line); border-radius:12px; }
.workflow-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:20px; }
.workflow-grid .detail-form { margin:0; }
.workflow-grid.manager-workflow { display:block; }
.manager-workflow .stage-form { display:grid; grid-template-columns:minmax(180px,1fr) auto; align-items:end; gap:12px; }
.manager-workflow .stage-form>.field { max-width:340px; }
.manager-workflow .stage-form>.rejection-fields { grid-column:1/-1; }
.manager-workflow .stage-form>.button { align-self:end; }
.project-files { border-top:1px solid var(--line); margin-top:16px; padding-top:12px; }
.file-upload { display:flex; flex-wrap:wrap; gap:10px; align-items:center; }
.file-upload input { max-width:100%; }
@container (max-width:650px) { .application-detail .detail-data { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media(max-width:600px) {
 .application-detail .detail-data,.workflow-grid { grid-template-columns:1fr; }
 .manager-workflow .stage-form { grid-template-columns:1fr; }
 .manager-workflow .stage-form>.field { max-width:none; }
 .manager-workflow .stage-form>.rejection-fields { grid-column:auto; }
 .application-detail .span-two { grid-column:auto; }
 .file-upload { display:grid; }
}
.danger-zone { border-top:1px solid #bc5454; } .button-danger { color:#a52a2a; border:1px solid #bc5454; background:var(--surface); }
.dashboard-widgets { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:20px; }
.dashboard-widget { min-width:0; grid-column:span 2; }
.dashboard-widget>.panel { height:100%; }
.widget-kpi { grid-column:span 1; }
.widget-manager_performance { grid-column:1/-1; }
.widget-options { display:grid; gap:14px; margin:20px 0; }
.widget-options label { display:flex; align-items:center; gap:10px; }
.widget-options input { width:auto; }
@media(max-width:1100px) { .dashboard-widgets { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media(max-width:600px) { .dashboard-widgets { grid-template-columns:1fr; } .dashboard-widget { grid-column:auto; } }
.notifications { position:relative; }
.notification-bell { position:relative; padding:9px; }
.notification-bell [data-unread-count] { border-radius:10px; padding:1px 5px; background:#b43a38; color:white; font-size:11px; }
.notification-panel { position:absolute; z-index:80; right:0; top:calc(100% + 10px); width:420px; max-width:calc(100vw - 24px); max-height:min(640px,75vh); overflow:hidden; display:grid; grid-template-rows:auto minmax(0,1fr) auto; box-shadow:0 12px 38px #0003; padding:0; }
.notification-panel-header { display:flex; align-items:center; justify-content:space-between; gap:16px; padding:16px 18px 14px; border-bottom:1px solid var(--line); }
.notification-panel-header h2 { font-size:16px; }
.notification-panel-header small { display:block; margin-top:2px; color:var(--muted); font-size:11px; }
.notification-panel-header .quiet-button { white-space:nowrap; font-size:12px; }
.notification-panel-body { min-height:82px; max-height:430px; overflow-y:auto; padding:4px 10px 4px 16px; scrollbar-gutter:stable; }
.notification-item { padding:13px 8px 13px 12px; border-bottom:1px solid var(--line); overflow-wrap:anywhere; }
.notification-item:last-child { border-bottom:0; }
.notification-item.is-unread { position:relative; }
.notification-item.is-unread::before { content:""; position:absolute; left:0; top:16px; width:3px; height:28px; border-radius:2px; background:var(--accent); }
.notification-item form { display:grid; gap:7px; }
.notification-title { appearance:none; display:block; width:fit-content; max-width:100%; border:0; padding:0; background:transparent; color:var(--ink); text-align:left; line-height:1.4; cursor:pointer; }
.notification-title:hover { color:var(--accent); }
.notification-item p,.notification-toast p { margin:0; font-size:13px; line-height:1.5; }
.notification-item small,.notification-toast small { display:block; color:var(--muted); font-size:11px; }
.notification-read-action { appearance:none; width:fit-content; margin-top:2px; padding:3px 0; border:0; background:transparent; color:var(--accent); font-size:12px; text-align:left; }
.notification-read-action:hover,.notification-toast>.quiet-button:hover { color:var(--ink); }
.notification-empty { display:grid; place-items:center; min-height:104px; color:var(--muted); font-size:13px; text-align:center; }
.notification-panel>.panel-more { padding:13px 18px; }
.notification-toasts { position:fixed; right:20px; bottom:20px; z-index:120; display:grid; gap:10px; width:340px; max-width:calc(100vw - 32px); }
.notification-toast { padding:16px; background:var(--surface); border:1px solid var(--line); border-radius:12px; box-shadow:0 8px 35px #0002; overflow-wrap:anywhere; }
.notification-toast form { display:grid; gap:7px; }
.notification-toast>.quiet-button { appearance:none; margin-top:10px; padding:3px 0; border:0; background:transparent; color:var(--muted); font-size:12px; }
.crm-toasts { position:fixed; right:20px; bottom:20px; z-index:140; display:grid; gap:10px; width:min(380px,calc(100vw - 32px)); }
.crm-toast { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:start; gap:12px; padding:14px 16px; color:var(--ink); background:var(--surface); border:1px solid var(--line); border-left:4px solid var(--accent); border-radius:10px; box-shadow:0 10px 36px #0003; overflow-wrap:anywhere; }
.crm-toast-success { border-left-color:var(--positive-text); }
.crm-toast-error { border-left-color:var(--danger-text); }
.crm-toast p { margin:0; line-height:1.45; }
.crm-toast-close { border:0; background:transparent; color:var(--muted); padding:0 2px; font-size:22px; line-height:1; cursor:pointer; }
.crm-toast-close:focus-visible { outline:3px solid var(--focus); outline-offset:3px; }
.notifications-history { width:min(960px,100%); margin:0 auto; }
.notifications-history-header { display:flex; justify-content:space-between; align-items:flex-end; gap:20px; margin-bottom:22px; }
.notifications-history-header h1 { margin-top:3px; }
.notifications-history-header p { margin-top:5px; font-size:13px; }
.notification-history-list { display:grid; gap:10px; }
.notification-history-item { border:1px solid var(--line); border-radius:var(--radius-md); background:var(--surface); overflow:hidden; }
.notification-history-item.is-unread { border-left:4px solid var(--accent); background:var(--active-bg); }
.notification-history-item.is-read { color:var(--text); }
.notification-history-item form { display:flex; align-items:center; justify-content:space-between; gap:20px; padding:16px 18px; }
.notification-history-main { min-width:0; flex:1; }
.notification-history-title { display:flex; align-items:center; gap:10px; }
.notification-history-title strong { font-size:15px; }
.notification-state { flex-shrink:0; padding:2px 7px; border:1px solid var(--line); border-radius:999px; color:var(--muted); background:var(--surface); font-size:10px; font-weight:600; text-transform:uppercase; letter-spacing:.4px; }
.notification-history-item.is-unread .notification-state { color:var(--ink); border-color:var(--input-line); }
.notification-history-item p { margin:7px 0 5px; line-height:1.5; }
.notification-history-item time { color:var(--muted); font-size:11px; }
.notification-history-empty { padding:32px; text-align:center; color:var(--muted); }
.destructive-screen { width:min(680px,100%); margin:0 auto; padding:28px; }
.destructive-heading { display:flex; align-items:flex-start; gap:16px; }
.destructive-heading h1 { margin:4px 0 7px; }
.destructive-heading p { color:var(--muted); }
.danger-icon { display:grid; place-items:center; flex:0 0 38px; height:38px; border:1px solid var(--danger-text); border-radius:50%; color:var(--danger-text); background:var(--danger-bg); font-weight:700; }
.destructive-summary { margin:24px 0; padding:17px 18px; border:1px solid var(--line); border-radius:var(--radius-md); background:var(--soft); }
.destructive-summary h2 { margin-bottom:7px; font-size:14px; }
.destructive-summary p { color:var(--muted); font-size:13px; }
.destructive-form { display:grid; gap:16px; }
.destructive-form>.field { max-width:260px; }
@media(max-width:900px) {
 .dashboard-header { align-items:flex-start; flex-direction:column; }
 .dashboard-header.is-admin { align-items:flex-end; }
 .dashboard-period { width:100%; }
}
@media(max-width:600px) {
 .notification-panel { position:fixed; top:75px; left:12px; right:12px; width:auto; max-height:calc(100dvh - 90px); }
 .notification-panel-body { max-height:calc(100dvh - 210px); }
 .topbar [data-dashboard-preferences] { font-size:12px; padding:8px; }
 .dashboard-header,.dashboard-header.is-admin { align-items:stretch; gap:16px; }
 .dashboard-period { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); padding:12px; }
 .dashboard-period .field { min-width:0; }
 .dashboard-period .field input { width:100%; }
 .dashboard-period .filter-actions { grid-column:1/-1; justify-content:flex-start; margin:0; }
 .notifications-history-header { align-items:flex-start; flex-direction:column; }
 .notification-history-item form { align-items:flex-start; flex-direction:column; gap:12px; padding:15px; }
 .notification-history-title { align-items:flex-start; justify-content:space-between; }
 .destructive-screen { padding:20px; }
 .destructive-heading { gap:12px; }
}

.project-files h3 { font:600 15px var(--font, system-ui); }

.workflow-heading { flex-wrap:wrap; gap:12px; align-items:baseline; }
.workflow-heading h2 { margin:0; }
.workflow-heading .permanent-link { margin:0; font-size:12px; }
@media(max-width:600px) { .topbar-title { flex-basis:calc(100% - 56px); } .topbar-action { margin-left:0; } .workflow-heading .permanent-link { white-space:normal; } }

/* Hotfix: clearer drawer actions and document workspace. */
.client-detail-heading { align-items:flex-start; }
.client-detail-actions,.detail-heading-actions { display:flex; align-items:center; justify-content:flex-end; gap:10px; flex-shrink:0; }
.client-close { position:static; right:auto; top:auto; }
.client-drawer .page-heading { padding-right:0; flex-wrap:nowrap; }
.detail-heading-actions .permanent-link { margin:0; white-space:nowrap; }

.project-files { margin-top:24px; padding-top:20px; }
.project-files-heading { display:flex; align-items:flex-end; justify-content:space-between; gap:16px; margin-bottom:12px; }
.project-files-heading h3 { margin:0; font:600 15px var(--font,system-ui); }
.project-files-heading p { margin-top:4px; font-size:12px; }
.project-files-table { border:1px solid var(--line); border-radius:10px; background:var(--surface); overflow:auto; }
.project-files-table table { min-width:760px; margin:0; }
.project-files-table th { white-space:nowrap; font-size:11px; }
.project-files-table td { vertical-align:middle; }
.project-file-name { display:flex; align-items:center; gap:10px; min-width:220px; }
.project-file-name>div { min-width:0; }
.project-file-name .record-name { display:block; max-width:330px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.project-file-name small { display:block; max-width:330px; margin-top:3px; color:var(--muted); font-size:10px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.file-type-icon { display:grid; place-items:center; flex:0 0 42px; height:42px; border:1px solid var(--line); border-radius:9px; background:var(--soft); color:var(--ink); font-size:10px; font-weight:750; letter-spacing:.35px; }
.file-type-pdf,.file-type-word,.file-type-excel,.file-type-image,.file-type-rar { border-color:var(--input-line); }
.project-file-actions { display:flex; align-items:center; gap:10px; white-space:nowrap; }
.project-file-actions form { margin:0; }
.file-delete-button { color:var(--muted); }
.file-delete-button:hover { color:var(--danger-text); }
.project-files-empty { display:flex; align-items:center; gap:12px; padding:18px; border:1px solid var(--line); border-radius:10px; background:var(--soft); }
.project-files-empty p { margin-top:3px; font-size:12px; }
.file-upload-box { display:grid; grid-template-columns:minmax(150px,.55fr) minmax(0,1.45fr); align-items:center; gap:18px; margin-top:14px; padding:14px 16px; border:1px dashed var(--input-line); border-radius:10px; background:var(--soft); }
.file-upload-copy { display:grid; gap:3px; }
.file-upload-copy small { font-size:11px; line-height:1.4; }
.file-upload { display:flex; align-items:center; justify-content:flex-end; gap:10px; min-width:0; }
.file-picker { display:flex; align-items:center; min-width:0; flex:1 1 auto; gap:10px; cursor:pointer; }
.file-picker-input { position:absolute !important; width:1px !important; height:1px !important; padding:0 !important; margin:-1px !important; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; border:0; }
.file-picker-button { flex:0 0 auto; pointer-events:none; }
.file-picker:focus-within .file-picker-button { outline:3px solid var(--focus); outline-offset:3px; }
.file-picker-name { min-width:0; color:var(--muted); font-size:12px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.file-picker-name.has-file { color:var(--text); }
.file-upload-submit { flex:0 0 auto; gap:7px; }
.file-upload-submit .icon { width:15px; height:15px; }
.dialog-file-input { padding:7px; border:1px solid var(--input-line); border-radius:7px; background:var(--surface); }
.dialog-file-input::file-selector-button { margin-right:10px; padding:7px 10px; border:1px solid var(--line); border-radius:6px; background:var(--soft); color:var(--text); cursor:pointer; }

@media(max-width:760px) {
  .client-drawer .page-heading,.client-detail-heading { flex-wrap:wrap; }
  .client-detail-actions { margin-left:auto; }
  .detail-heading { align-items:flex-start; flex-wrap:wrap; }
  .detail-heading-actions { width:100%; justify-content:flex-end; }
  .file-upload-box { grid-template-columns:1fr; gap:12px; }
  .file-upload { justify-content:flex-start; flex-wrap:wrap; }
  .file-picker { flex:1 1 260px; }
  .project-files-table { overflow:visible; }
  .project-files-table table { min-width:0; }
}
@media(max-width:460px) {
  .client-detail-actions { width:100%; justify-content:flex-end; }
  .detail-heading-actions { justify-content:space-between; }
  .detail-heading-actions .permanent-link { flex:1 1 auto; justify-content:center; white-space:normal; text-align:center; }
  .file-upload { display:grid; grid-template-columns:1fr; }
  .file-picker { width:100%; }
  .file-upload-submit { width:100%; justify-content:center; }
}
