:root {
  color-scheme: light;
  --bg: #f4f5f3;
  --ink: #022d16;
  --muted: #365543;
  --subtle: #68786f;
  --line: rgba(2, 45, 22, 0.22);
  --line-soft: rgba(2, 45, 22, 0.11);
  --surface: rgba(255, 255, 255, 0.58);
  --surface-solid: #ffffff;
  --surface-soft: rgba(2, 45, 22, 0.07);
  --rail: #022d16;
  --rail-muted: rgba(218, 217, 217, 0.72);
  --accent: #ff5e1a;
  --accent-soft: rgba(255, 94, 26, 0.14);
  --good: #0f6b3b;
  --bad: #b93222;
  --warn: #ff5e1a;
  --shadow: 0 10px 28px rgba(2, 45, 22, 0.09);
  --radius-sm: 4px;
  --radius: 6px;
  --radius-lg: 8px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --row-h: 40px;
  --font-body: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: Syne, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  letter-spacing: 0;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: wait;
  opacity: 0.62;
}

.app-shell {
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr);
  min-height: 100vh;
  height: 100vh;
  overflow: hidden;
}

.side-rail {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  padding: 24px 18px;
  background: var(--rail);
  color: var(--bg);
}

.brand {
  display: flex;
  align-items: center;
  color: inherit;
  text-decoration: none;
  min-height: 46px;
}

.brand-logo {
  display: block;
  width: min(178px, 100%);
  height: auto;
  filter: brightness(0) invert(1);
}

.domain-switch {
  display: grid;
  /* Eén rij, ongeacht het aantal knoppen. Finance is alleen zichtbaar voor
     finance-gebruikers, dus een vast kolomaantal laat die knop eronder vallen. */
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: 4px;
  margin-top: 22px;
  padding: 4px;
  border: 1px solid rgba(218, 217, 217, 0.22);
  border-radius: 8px;
  background: rgba(218, 217, 217, 0.08);
}

.domain-button {
  min-height: 34px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--rail-muted);
  font-size: 13px;
  font-weight: 800;
}

.domain-button.is-active {
  background: var(--bg);
  color: var(--rail);
}

.brand-kicker {
  display: block;
  margin-bottom: 8px;
  color: var(--accent);
  font-family: "Syne Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.rail-nav {
  display: grid;
  gap: 6px;
  margin-top: 20px;
  min-height: 0;
  overflow-y: auto;
  padding-right: 2px;
}

.rail-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 11px 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--rail-muted);
  text-align: left;
  font-size: 14px;
  font-weight: 650;
}

.rail-item svg,
.btn-icon svg,
.icon-button svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
  flex: 0 0 auto;
}

.rail-item:hover,
.rail-item.is-active {
  background: var(--accent);
  color: var(--rail);
}

.rail-footer {
  margin-top: auto;
  padding: 16px 12px;
  border-top: 1px solid rgba(218, 217, 217, 0.26);
}

.rail-caption,
.status-strip span,
.select-shell span,
.scenario-form span {
  display: block;
}

.rail-caption,
.status-strip span,
.select-shell span,
.scenario-form span,
th {
  color: var(--subtle);
  font-family: "Syne Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 11px;
  font-weight: 750;
  line-height: 1.2;
  text-transform: uppercase;
}

.rail-footer strong {
  display: block;
  margin-top: 6px;
  font-size: 15px;
}

.workspace {
  min-width: 0;
  height: 100vh;
  overflow-x: hidden;
  overflow-y: auto;
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  gap: 6px;
  padding: 8px 14px 10px;
}

.workspace-domain-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 0;
  min-height: 44px;
  padding: 5px 8px 5px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-solid);
  box-shadow: none;
}

/* De hamburger en zijn achtergrond horen bij het smalle scherm; op een groot
   scherm staat de navigatie gewoon in beeld. */
.btn.nav-toggle,
.nav-backdrop {
  display: none;
}

.workspace-domain-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.workspace-domain-heading span {
  display: block;
  color: var(--subtle);
  font-family: "Syne Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 9px;
  font-weight: 750;
  line-height: 1.1;
  text-transform: uppercase;
}

.workspace-domain-heading strong {
  display: block;
  margin-top: 2px;
  font-size: 14px;
}

.workspace-domain-switch {
  min-width: 220px;
  margin-top: 0;
  border-color: var(--line);
  background: rgba(2, 45, 22, 0.08);
}

.workspace-domain-switch .domain-button {
  min-height: 32px;
  color: var(--muted);
}

.workspace-domain-switch .domain-button.is-active {
  background: var(--rail);
  color: var(--bg);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 36px;
  margin-bottom: 0;
}

.topbar-context {
  display: none;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-family: var(--font-display);
  font-size: clamp(30px, 4vw, 54px);
  font-weight: 800;
  line-height: 0.94;
  text-transform: uppercase;
}

h2 {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 800;
}

p {
  color: var(--muted);
  line-height: 1.5;
}

.topbar-context p {
  color: var(--muted);
  font-size: 15px;
  font-weight: 700;
}

.topbar-actions {
  order: -1;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  min-width: 0;
}

.logout-form {
  margin: 0;
}

.btn.logout-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}

.logout-button svg {
  width: 17px;
  height: 17px;
  fill: currentColor;
}

#workContextSelect {
  min-width: 260px;
  font-size: 16px;
  font-weight: 800;
}

.select-shell {
  display: grid;
  gap: 6px;
}

select,
input {
  min-height: 39px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-solid);
  color: var(--ink);
  padding: 0 12px;
  font-size: 14px;
  font-weight: 620;
  outline: none;
}

select:focus,
input:focus,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.btn,
.icon-button,
.account-button,
.text-button,
.primary-button {
  min-height: 39px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: var(--surface-solid);
  color: var(--ink);
  font-size: 13px;
  font-weight: 740;
}

.btn {
  display: inline-grid;
  place-items: center;
  padding: 0 12px;
  white-space: nowrap;
}

.btn-primary,
.primary-button {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--rail);
}

a.primary-button {
  display: inline-grid;
  place-items: center;
  padding: 0 12px;
  text-decoration: none;
}

.btn-secondary,
.account-button {
  background: var(--surface-solid);
}

.btn-text,
.text-button {
  border-color: transparent;
  background: transparent;
}

.btn-icon,
.icon-button {
  width: 42px;
  display: grid;
  place-items: center;
  padding: 0;
}

.btn-prio,
.btn-ruis {
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 820;
}

.btn-prio {
  border-color: var(--accent);
  background: transparent;
  color: var(--accent);
}

.btn-prio:hover {
  background: var(--accent);
  color: #fff;
}

.btn-ruis {
  border-color: var(--line);
  background: transparent;
  color: var(--muted);
}

.btn-ruis:hover {
  border-color: var(--bad);
  background: var(--bad);
  color: #fff;
}

.learning-toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 90;
  display: flex;
  gap: 10px;
  align-items: center;
  max-width: min(420px, calc(100vw - 36px));
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-solid);
  color: var(--ink);
  box-shadow: var(--shadow-soft);
  font-size: 13px;
  font-weight: 720;
}

.learning-toast .btn {
  min-height: 28px;
  padding: 0 6px;
}

.icon-button {
  margin-top: 18px;
}

.account-button {
  padding: 0 15px;
  margin-top: 18px;
}

.danger-button {
  color: var(--bad);
  border-color: rgba(159, 47, 52, 0.28);
}

.primary-button {
  width: 100%;
  padding: 0 16px;
}

.status-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  min-height: 24px;
  margin-bottom: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--line);
}

.status-strip > div {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  padding: 3px 8px;
  background: var(--surface);
}

.status-strip span {
  flex: 0 0 auto;
  font-size: 9px;
}

.status-strip strong {
  display: block;
  overflow: hidden;
  margin-top: 0;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-section="work-mail"] .status-strip {
  visibility: hidden;
  height: 0;
  min-height: 0;
  overflow: hidden;
  border: 0;
}

body[data-section="work-mail"] .status-strip > div {
  padding: 0;
}

body[data-section="work-mail"] .app-shell {
  grid-template-columns: 220px minmax(0, 1fr);
}

body[data-section="work-mail"] .side-rail {
  padding: 12px 10px;
}

body[data-section="work-mail"] .brand {
  min-height: 34px;
}

body[data-section="work-mail"] .brand-logo {
  width: 132px;
}

body[data-section="work-mail"] .domain-switch {
  margin-top: 8px;
}

body[data-section="work-mail"] .rail-nav {
  gap: 2px;
  margin-top: 10px;
}

body[data-section="work-mail"] .rail-item {
  min-height: 31px;
  padding: 6px 8px;
  border-radius: 6px;
  font-size: 13px;
}

body[data-section="work-mail"] .rail-footer {
  display: none;
}

body[data-section="work-mail"] .workspace {
  grid-template-rows: auto auto 0 minmax(0, 1fr);
  gap: 4px;
  padding: 6px 10px 8px;
}

body[data-section="work-mail"] .workspace-domain-bar {
  min-height: 34px;
  padding: 3px 4px 3px 9px;
  border-radius: 6px;
  box-shadow: none;
}

body[data-section="work-mail"] .workspace-domain-heading span {
  display: none;
}

body[data-section="work-mail"] .workspace-domain-heading strong {
  margin-top: 0;
  font-size: 13px;
}

body[data-section="work-mail"] .workspace-domain-switch {
  min-width: 180px;
  margin-top: 0;
  padding: 2px;
}

body[data-section="work-mail"] .workspace-domain-switch .domain-button {
  min-height: 27px;
  border-radius: 4px;
  font-size: 12px;
}

body[data-section="work-mail"] .topbar {
  min-height: 33px;
  gap: 8px;
}

body[data-section="work-mail"] .topbar-context {
  display: none;
}

body[data-section="work-mail"] .topbar-actions {
  width: 100%;
  justify-content: flex-start;
  gap: 6px;
}

body[data-section="work-mail"] .topbar-actions form {
  margin-left: auto;
}

body[data-section="work-mail"] .select-shell {
  min-height: 33px;
  min-width: 300px;
  gap: 1px;
  padding: 3px 8px;
  border-radius: 6px;
}

body[data-section="work-mail"] .select-shell span {
  font-size: 9px;
}

body[data-section="work-mail"] .select-shell select {
  min-height: 18px;
  padding: 0 22px 0 0;
  font-size: 14px;
}

body[data-section="work-mail"] .topbar-actions .btn,
body[data-section="work-mail"] .topbar-actions .btn-icon,
body[data-section="work-mail"] .topbar-actions form .btn {
  min-height: 33px;
}

.work-page {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(340px, 0.8fr);
  gap: 18px;
  align-items: start;
  min-height: 0;
  overflow: auto;
}

.work-hero {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.4fr);
  gap: 18px;
  align-items: stretch;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 20px;
  box-shadow: var(--shadow);
}

.work-hero p {
  max-width: 700px;
  margin-top: 10px;
  font-weight: 650;
}

.workbench-hero {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: 18px;
  align-items: start;
}

.workbench-hero p {
  max-width: 760px;
  margin-top: 8px;
  font-weight: 650;
}

.work-signal-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.work-signal-card {
  min-width: 0;
  padding: 10px;
}

.work-signal-card strong {
  font-size: 18px;
}

.workbench-actions-panel {
  grid-column: 1;
}

.workbench-mail-panel,
.workbench-slack-panel,
.workbench-automation-panel {
  grid-column: 2;
}

.workbench-page {
  grid-template-columns: minmax(240px, 0.48fr) minmax(500px, 1.12fr) minmax(240px, 0.48fr);
}

.workbench-page .workbench-hero,
.workbench-page .workbench-daily-panel,
.workbench-page .workbench-signals-panel,
.workbench-page .workbench-board-panel {
  grid-column: 1 / -1;
}

.workbench-page .workbench-actions-panel {
  grid-column: 1;
}

.workbench-page .workbench-mail-panel {
  grid-column: 2;
}

.workbench-page .workbench-focus-panel {
  grid-column: 3;
}

.work-cockpit {
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
}

.work-cockpit-panel {
  display: grid;
  grid-template-rows: auto 32px minmax(0, 1fr) 84px;
  gap: 8px;
  min-height: min(682px, calc(100vh - 218px));
  max-height: calc(100vh - 190px);
  overflow: hidden;
  padding: 12px;
}

.work-cockpit-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
}

.work-cockpit-head h2 {
  margin: 0;
  font-size: 20px;
  line-height: 1.1;
}

.work-cockpit-head p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.work-cockpit-status {
  display: flex;
  align-items: center;
  overflow: hidden;
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  color: var(--muted);
  font-size: 13px;
  font-weight: 820;
  white-space: nowrap;
}

.work-cockpit-list {
  min-height: 0;
  overflow: auto;
  border-top: 1px solid var(--line-soft);
}

.cockpit-row.list-row {
  grid-template-columns: minmax(0, 1fr) 58px auto;
  height: 40px;
  min-height: 40px;
  padding: 0 4px;
}

.cockpit-row-main {
  display: grid;
  min-width: 0;
  width: 100%;
  border: 0;
  background: transparent;
  padding: 0;
  color: inherit;
  text-align: left;
}

.cockpit-action-main {
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
}

.cockpit-row-main span,
.cockpit-row-main em {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 720;
  line-height: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cockpit-row-main strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  line-height: 16px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cockpit-row time {
  color: var(--subtle);
  font-size: 11px;
  font-weight: 760;
  text-align: right;
}

.cockpit-row:hover .mail-row-actions,
.cockpit-row:focus-within .mail-row-actions {
  opacity: 1;
}

.work-cockpit-stack {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  min-height: 0;
}

.work-cockpit-stack details {
  min-width: 0;
  max-height: 84px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-soft);
  padding: 7px 9px;
}

.work-cockpit-stack summary {
  cursor: pointer;
  color: var(--ink);
  font-size: 12px;
  font-weight: 820;
  line-height: 1.2;
}

.work-cockpit-stack summary span {
  color: var(--muted);
}

.work-cockpit-stack .list-row {
  height: 38px;
  min-height: 38px;
}

.cockpit-stats-grid {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}

.work-actions-page {
  grid-template-columns: minmax(0, 1fr);
  height: 100%;
  overflow: hidden;
}

.work-actions-board-panel {
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  gap: 10px;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  padding: 10px 12px;
}

.work-actions-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.work-actions-head h2 {
  margin: 0;
  font-size: 20px;
}

.work-actions-head p,
.work-action-status {
  color: var(--muted);
  font-size: 13px;
  font-weight: 760;
}

.work-actions-page .work-action-form {
  grid-template-columns: minmax(0, 1fr) minmax(150px, 230px) auto;
  align-items: end;
  border-bottom: 1px solid var(--line-soft);
  margin-bottom: 4px;
  padding-bottom: 8px;
}

.work-actions-page .work-action-form-status {
  grid-column: 1 / -1;
}

.work-actions-page .work-board-full {
  display: block;
  min-height: 0;
  overflow: auto;
  padding-right: 2px;
}

.task-source-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  min-height: 28px;
}

.task-source-button {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 820;
  line-height: 1;
  min-height: 26px;
  padding: 0 10px;
}

.task-source-button strong {
  color: var(--ink);
  margin-left: 4px;
}

.task-source-button.is-selected {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--surface-solid);
}

.task-source-button.is-selected strong {
  color: var(--surface-solid);
}

.unified-action-list {
  min-height: 0;
  overflow: visible;
  border-top: 1px solid var(--line-soft);
}

.unified-action-row.list-row {
  grid-template-columns: minmax(0, 1fr) 64px auto auto;
  height: 40px;
  min-height: 40px;
  padding: 0 4px;
}

.unified-action-row label {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  min-width: 0;
}

.unified-action-row span {
  min-width: 0;
}

.unified-action-row .btn {
  min-height: 26px;
  padding: 0 7px;
  font-size: 11px;
}

.unified-action-edit {
  border-bottom: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.66);
  padding: 8px 4px;
}

.unified-action-edit form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 145px auto;
  gap: 6px 8px;
  align-items: end;
}

.unified-action-edit label {
  display: grid;
  gap: 4px;
}

.unified-action-edit span,
.action-edit-meta {
  color: var(--subtle);
  font-size: 10px;
  font-weight: 780;
  line-height: 1.2;
  text-transform: uppercase;
}

.unified-action-edit input,
.unified-action-edit textarea {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface-solid);
  color: var(--ink);
  padding: 6px 8px;
  font-size: 12px;
  font-weight: 700;
}

.unified-action-edit textarea {
  min-height: 52px;
  resize: vertical;
}

.action-edit-title {
  grid-column: 1 / 2;
}

.action-edit-notes {
  grid-column: 1 / 3;
}

.action-edit-meta {
  align-self: center;
  text-transform: none;
}

.action-edit-buttons {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}

.unified-action-edit .work-action-form-status {
  grid-column: 1 / -1;
}

.unified-action-row strong,
.unified-action-row em {
  overflow: hidden;
  display: block;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.unified-action-row time {
  color: var(--subtle);
  font-size: 11px;
  font-weight: 760;
  text-align: right;
}

.completed-actions {
  padding-top: 8px;
}

.completed-actions summary,
.work-actions-details summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 12px;
  font-weight: 820;
}

.work-actions-details {
  max-height: 90px;
  overflow: auto;
  border-top: 1px solid var(--line-soft);
  padding-top: 8px;
}

.workbench-mail-workspace {
  display: grid;
  grid-template-columns: minmax(210px, 0.46fr) minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.workbench-mail-queue,
.workbench-mail-detail,
.workbench-focus-stack {
  min-width: 0;
}

.workbench-mail-queue .priority-mail-list {
  max-height: 620px;
  overflow: auto;
  padding-right: 2px;
}

.workbench-focus-stack {
  display: grid;
  gap: 14px;
}

.workbench-focus-stack h3 {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 820;
  line-height: 1.2;
  text-transform: uppercase;
}

.daily-priority-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.company-focus-strip {
  display: grid;
  grid-template-columns: minmax(220px, 0.45fr) minmax(0, 1fr);
  gap: 10px;
  margin-bottom: 10px;
}

.company-focus-head,
.company-focus-metrics > div,
.action-focus-summary {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--panel-muted);
}

.company-focus-head span,
.company-focus-metrics span,
.action-focus-summary span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  line-height: 1.15;
  text-transform: uppercase;
}

.company-focus-head strong,
.company-focus-metrics strong,
.action-focus-summary strong {
  display: block;
  margin-top: 3px;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.15;
}

.company-focus-head em,
.company-focus-metrics em,
.action-focus-summary em {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  line-height: 1.25;
}

.company-focus-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.action-focus-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

.daily-priority-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: color-mix(in srgb, var(--panel) 72%, var(--accent-soft));
}

.daily-priority-item label {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.daily-priority-item div,
.daily-priority-item span {
  min-width: 0;
}

.daily-priority-item span,
.daily-priority-item b {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  line-height: 1.15;
  text-transform: uppercase;
}

.daily-priority-item strong {
  display: block;
  margin-top: 3px;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.2;
}

.daily-priority-item em,
.daily-priority-item small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  line-height: 1.25;
}

.daily-priority-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.workbench-signals-panel,
.workbench-board-panel,
.work-action-composer-panel,
.work-google-tasks-panel {
  grid-column: 1 / -1;
}

.workbench-signals-panel > summary {
  cursor: pointer;
  color: var(--ink);
  font-size: 15px;
  font-weight: 850;
}

.workbench-signals-panel[open] > summary {
  margin-bottom: 14px;
}

.work-action-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(170px, 0.35fr) auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 14px;
}

.work-action-form label {
  display: grid;
  gap: 6px;
}

.work-action-form span,
.work-action-form-status {
  color: var(--subtle);
  font-size: 11px;
  font-weight: 780;
  line-height: 1.2;
  text-transform: uppercase;
}

.work-action-form-status {
  grid-column: 1 / -1;
  min-height: 16px;
  color: var(--muted);
  text-transform: none;
}

.workbench-actions-panel .work-action-form {
  grid-template-columns: 1fr;
}

.workbench-actions-panel .work-action-form button {
  width: 100%;
}

.work-action-list {
  display: grid;
  gap: 8px;
}

.work-google-tasks-panel {
  display: grid;
  gap: 10px;
}

.work-google-tasks-panel .work-action-form {
  grid-template-columns: minmax(0, 1fr) minmax(180px, 0.45fr) minmax(130px, 0.25fr) auto;
}

.work-google-tasks-status {
  color: var(--muted);
  font-size: 12px;
  font-weight: 720;
}

.work-google-tasks-list {
  display: grid;
  gap: 8px;
}

.work-action-row {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  cursor: pointer;
}

.work-action-row input {
  width: 18px;
  height: 18px;
  margin: 1px 0 0;
  accent-color: var(--ink);
}

.work-action-row.is-done {
  opacity: 0.62;
}

.work-action-row.is-done strong {
  text-decoration: line-through;
}

.work-kpi-compact {
  margin-bottom: 12px;
}

.work-kpi-compact .kpi-card {
  min-height: auto;
  padding: 10px;
}

.work-kpi-compact .kpi-card strong {
  margin-top: 8px;
  font-size: 20px;
}

.work-hero-stack,
.work-action-status,
.work-archive-grid {
  display: grid;
  gap: 10px;
}

.work-hero-stack {
  align-content: stretch;
}

.work-signal-card,
.work-focus-item,
.work-mail-bucket,
.work-lane,
.work-account,
.work-rule,
.priority-mail-item,
.work-action-row,
.reply-draft-preview,
.work-setting,
.work-channel,
.work-automation-item,
.work-ai-step,
.work-integration,
.work-status-card,
.work-archive-card {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-soft);
  padding: 13px;
}

.work-signal-card span,
.work-focus-item span,
.work-mail-bucket span,
.work-lane span,
.work-account span,
.work-rule span,
.priority-mail-item span,
.work-action-row em,
.reply-draft-preview span,
.work-setting span,
.work-channel span,
.work-automation-item span,
.work-ai-step span,
.work-integration span,
.work-status-card span,
.work-archive-card span {
  display: block;
  color: var(--subtle);
  font-size: 11px;
  font-weight: 780;
  line-height: 1.2;
  text-transform: uppercase;
}

.work-signal-card strong,
.work-focus-item strong,
.work-mail-bucket strong,
.work-lane strong,
.work-account strong,
.work-rule strong,
.priority-mail-item strong,
.work-action-row strong,
.reply-draft-preview strong,
.work-setting strong,
.work-channel strong,
.work-automation-item strong,
.work-ai-step strong,
.work-integration strong,
.work-status-card strong,
.work-archive-card strong {
  display: block;
  margin-top: 7px;
  font-size: 14px;
  line-height: 1.25;
}

.work-signal-card em,
.work-focus-item em,
.work-mail-bucket em,
.work-lane em,
.work-account em,
.work-rule em,
.priority-mail-item em,
.work-action-row em,
.work-setting em,
.work-channel em,
.work-automation-item em,
.work-ai-step em,
.work-integration em,
.work-status-card em,
.work-archive-card em {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 650;
  line-height: 1.35;
}

.work-focus-list,
.work-mail-buckets,
.work-slack-digest,
.work-automation-list,
.work-account-list,
.priority-mail-list,
.work-channel-list,
.work-rule-list,
.work-ai-flow,
.work-settings-list,
.work-integration-list {
  display: grid;
  gap: 10px;
}

.list-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  width: 100%;
  min-height: var(--row-h);
  max-height: var(--row-h);
  padding: 0 6px;
  overflow: hidden;
  border: 0;
  border-bottom: 1px solid var(--line-soft);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.list-row:hover {
  background: rgba(2, 45, 22, 0.045);
}

.list-row.is-selected {
  border-color: var(--line-soft);
  background: var(--accent-soft);
  box-shadow: inset 2px 0 0 var(--accent);
}

.list-row strong,
.list-row em,
.list-row small,
.list-row span {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.list-row span,
.list-row em,
.list-row small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
  line-height: 14px;
  text-transform: none;
}

.list-row strong {
  color: var(--ink);
  font-size: 13px;
  font-weight: 780;
  line-height: 16px;
}

.priority-mail-item.list-row {
  position: relative;
  grid-template-columns: minmax(0, 1fr) 44px;
}

.mail-service-row.list-row {
  grid-template-columns: minmax(0, 1fr) auto;
}

.work-mail-main .priority-mail-list {
  height: calc(100% - 27px);
  min-height: 0;
  overflow: auto;
  gap: 0;
  border-top: 1px solid var(--line-soft);
}

.priority-mail-item.list-row .priority-mail-select {
  display: grid;
  grid-template-rows: 12px 15px;
  gap: 0;
  height: 100%;
  align-content: center;
}

.priority-mail-item.list-row em,
.priority-mail-item.list-row small {
  display: none;
}

.priority-mail-item.list-row time {
  color: var(--subtle);
  font-size: 10px;
  font-weight: 760;
  text-align: right;
  white-space: nowrap;
}

.work-mail-main .priority-mail-item.list-row {
  min-height: 34px;
  max-height: 34px;
  padding: 0 5px;
}

.work-mail-main .priority-mail-item.list-row span {
  font-size: 10px;
  line-height: 12px;
}

.work-mail-main .priority-mail-item.list-row strong {
  font-size: 12px;
  line-height: 15px;
}

.work-mail-main .priority-mail-item.list-row .mail-row-actions {
  position: absolute;
  top: 50%;
  right: 4px;
  z-index: 2;
  padding-left: 6px;
  background: var(--surface-solid);
  transform: translateY(-50%);
}

.mail-row-actions {
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity 120ms ease;
}

.priority-mail-item:hover .mail-row-actions,
.priority-mail-item:focus-within .mail-row-actions,
.mail-service-row:hover .mail-row-actions,
.mail-service-row:focus-within .mail-row-actions {
  opacity: 1;
}

.mail-row-actions .btn {
  min-height: 21px;
  padding: 0 6px;
  font-size: 10px;
}

.work-action-row.list-row {
  grid-template-columns: 22px minmax(0, 1fr);
  cursor: pointer;
}

.daily-priority-item.list-row {
  grid-template-columns: minmax(0, 1fr) auto;
  min-height: 48px;
  max-height: 48px;
  padding: 3px 6px;
}

.daily-priority-item.list-row > div,
.daily-priority-item.list-row > label {
  min-width: 0;
}

.daily-priority-item.list-row small {
  display: none;
}

.work-action-row.list-row > span {
  display: grid;
  gap: 1px;
}

.recurring-mail-group.list-row {
  grid-template-columns: minmax(0, 1fr) auto;
}

.recurring-mail-group.list-row .recurring-mail-select {
  min-width: 0;
}

.recurring-mail-group.list-row small {
  display: none;
}

.work-archive-panel .work-mail-buckets {
  margin-bottom: 14px;
}

.work-setting.is-missing {
  border-color: rgba(159, 47, 52, 0.35);
  background: rgba(159, 47, 52, 0.055);
}

.work-settings-editor {
  margin-top: 18px;
}

.work-runtime-settings-form {
  display: grid;
  gap: 14px;
}

.work-runtime-settings-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.work-runtime-wide {
  grid-column: 1 / -1;
}

.priority-mail-item {
  display: grid;
  width: 100%;
  gap: 10px;
  color: inherit;
  cursor: default;
  text-align: left;
}

.priority-mail-item.is-selected {
  border-color: rgba(241, 91, 40, 0.75);
  box-shadow: inset 3px 0 0 var(--accent);
}

.priority-mail-select {
  display: grid;
  gap: 4px;
  width: 100%;
  min-height: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  padding: 0;
  text-align: left;
}

.priority-mail-item small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
}

.mail-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.mail-card-actions .account-button,
.mail-card-actions .text-button {
  min-height: 34px;
  margin-top: 0;
}

.reply-assistant,
.reply-prompt-field,
.reply-provider-field {
  display: grid;
  gap: 12px;
}

.reply-composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(210px, 0.35fr);
  gap: 12px;
  align-items: start;
}

.reply-side {
  display: grid;
  gap: 10px;
}

.reply-prompt-field span,
.reply-provider-field span {
  color: var(--subtle);
  font-size: 11px;
  font-weight: 780;
  line-height: 1.2;
  text-transform: uppercase;
}

.reply-prompt-field textarea,
.reply-provider-field select {
  width: 100%;
  min-width: 0;
}

.reply-prompt-field textarea {
  min-height: 116px;
  resize: vertical;
}

.reply-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.reply-status {
  min-height: 18px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.reply-draft-preview textarea {
  width: 100%;
  min-height: 220px;
  margin: 10px 0 0;
  resize: vertical;
  color: var(--text);
  font: 650 13px/1.45 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.reply-draft-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
}

.reply-editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: flex-end;
}

.reply-format-button {
  display: inline-grid;
  min-width: 28px;
  min-height: 26px;
  place-items: center;
  border: 1px solid var(--line-soft);
  border-radius: 4px;
  background: var(--surface-solid);
  color: var(--ink);
  font: 800 11px/1 var(--font-sans);
  cursor: pointer;
}

.reply-format-button:hover {
  border-color: var(--line);
  background: var(--surface-soft);
}

.reply-rich-editor {
  min-height: 180px;
  max-height: 260px;
  margin-top: 8px;
  overflow: auto;
  border: 1px solid var(--line-soft);
  border-radius: 4px;
  background: var(--surface-solid);
  padding: 10px;
  color: var(--text);
  font: 620 13px/1.45 var(--font-sans);
  outline: none;
}

.reply-rich-editor:focus {
  border-color: rgba(255, 92, 31, 0.55);
  box-shadow: 0 0 0 2px rgba(255, 92, 31, 0.12);
}

.reply-rich-editor p,
.reply-rich-editor ul,
.reply-rich-editor ol,
.reply-rich-editor blockquote {
  margin: 0 0 9px;
}

.reply-rich-editor p:last-child,
.reply-rich-editor ul:last-child,
.reply-rich-editor ol:last-child,
.reply-rich-editor blockquote:last-child {
  margin-bottom: 0;
}

.reply-rich-editor ul,
.reply-rich-editor ol {
  padding-left: 22px;
}

.reply-rich-editor a {
  color: var(--accent);
}

.reply-draft-preview pre {
  margin: 10px 0 0;
  overflow: auto;
  white-space: pre-wrap;
  color: var(--text);
  font: 650 13px/1.45 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.work-focus-panel,
.work-actions-panel,
.work-archive-panel {
  grid-column: 1;
}

.work-mail-manager > * {
  grid-column: 1 / -1;
}

.work-mail-manager {
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr);
  gap: 4px;
  height: 100%;
  overflow: hidden;
}

.work-mail-manager .work-archive-panel {
  display: none;
}

.work-mail-load-panel {
  grid-column: 1 / -1;
}

.work-mail-panel,
.work-slack-panel,
.work-automation-panel {
  grid-column: 2;
}

.work-mail-grid,
.work-slack-grid,
.work-ai-grid,
.gmail-config-layout {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.gmail-rules-panel {
  grid-column: 1 / -1;
}

.gmail-config-tabs {
  grid-column: 1 / -1;
  display: flex;
  gap: 8px;
}

.gmail-config-tab {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-solid);
  color: var(--muted);
  padding: 0 14px;
  font-size: 13px;
  font-weight: 820;
}

.gmail-config-tab.is-active {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--rail);
}

.gmail-config-layout [hidden] {
  display: none;
}

.gmail-config-layout {
  grid-template-columns: minmax(0, 1fr);
}

.work-mail-manager-hero .panel-heading {
  align-items: center;
  display: contents;
  margin-bottom: 0;
}

.panel.work-mail-manager-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2px 8px;
  align-items: center;
  position: relative;
  border-color: transparent;
  background: transparent;
  padding: 0;
  box-shadow: none;
}

.work-mail-manager-hero .panel-heading > div {
  display: none;
}

.work-mail-manager-hero h2 {
  font-size: 14px;
  line-height: 1.1;
}

.work-mail-manager-hero p {
  display: none;
}

.work-mail-manager-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  grid-column: 2;
  grid-row: 1;
}

.work-mail-manager-actions .account-button,
.work-mail-manager-actions .text-button {
  margin-top: 0;
}

.work-mail-manager-actions .btn {
  min-height: 25px;
  padding: 0 9px;
  font-size: 11px;
}

.work-mail-manage-stats {
  display: flex;
  flex-wrap: nowrap;
  grid-column: 1;
  grid-row: 1;
  gap: 10px;
  overflow: hidden;
  min-height: 25px;
  align-items: center;
}

.work-mail-manage-stat {
  min-width: 0;
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  border: 0;
  background: transparent;
  padding: 0;
}

.work-mail-manage-stat span,
.work-mail-manage-stat em,
.mail-action-status {
  display: block;
  color: var(--subtle);
  font-size: 11px;
  font-weight: 780;
  line-height: 1.2;
  text-transform: uppercase;
}

.work-mail-manage-stat strong {
  display: inline;
  margin-top: 0;
  color: var(--ink);
  font-size: 12px;
  line-height: 1.1;
}

.work-mail-manage-stat em {
  display: none;
}

.mail-action-status {
  position: absolute;
  top: 27px;
  left: 0;
  right: 0;
  z-index: 3;
  min-height: 0;
  max-height: 14px;
  margin-top: 0;
  overflow: hidden;
  background: var(--bg);
  color: var(--muted);
  font-style: normal;
  line-height: 1.3;
  text-transform: none;
}

.work-mail-manager-grid {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 6px;
  align-items: stretch;
  min-height: 0;
  height: 100%;
}

.panel.work-mail-main,
.panel.work-mail-reader-panel {
  height: 100%;
  min-height: 0;
  overflow: hidden;
  border-color: var(--line-soft);
  border-radius: 5px;
  background: var(--surface-solid);
  box-shadow: none;
  padding: 4px;
}

.work-mail-main .panel-heading {
  display: none;
}

.mail-tier-tabs {
  display: flex;
  gap: 2px;
  margin-bottom: 3px;
}

.mail-tier-tab {
  display: flex;
  flex: 1 1 0;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 0;
  min-height: 24px;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  padding: 0 5px;
  font-size: 10px;
  font-weight: 820;
  line-height: 1.1;
  text-align: center;
}

.mail-tier-tab span {
  color: var(--ink);
  font-size: 11px;
}

.mail-tier-tab.is-active {
  border-bottom-color: var(--accent);
  background: rgba(255, 94, 26, 0.08);
  color: var(--ink);
}

.mail-reader-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 276px;
  gap: 6px;
  align-items: stretch;
  height: 100%;
  min-height: 0;
}

.mail-tier-empty {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-soft);
  padding: 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 720;
  line-height: 1.35;
}

.work-mail-admin-grid {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
  gap: 18px;
  min-width: 0;
}

.work-mail-settings {
  grid-column: 1 / -1;
}

.work-mail-settings > summary,
.mail-policy-details > summary {
  cursor: pointer;
  color: var(--ink);
  font-size: 15px;
  font-weight: 850;
  line-height: 1.2;
}

.work-mail-settings[open] > summary,
.mail-policy-details[open] > summary {
  margin-bottom: 14px;
}

.mail-settings-block {
  min-width: 0;
  border: 1px solid rgba(2, 45, 22, 0.12);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.45);
  padding: 14px;
}

.mail-reader,
.mail-reader-card,
.priority-person-form,
.priority-person-list,
.mail-rule-config-panel,
.mail-rule-list,
.newsletter-candidate-list {
  display: grid;
  gap: 10px;
}

.mail-rule-form,
.mail-rule-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(150px, 0.45fr) minmax(170px, 0.55fr) auto;
  gap: 10px;
  align-items: end;
}

.mail-rule-form {
  margin-bottom: 12px;
}

.mail-rule-config {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-soft);
  padding: 13px;
}

.mail-rule-config-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  margin-bottom: 10px;
}

.mail-rule-config-head span,
.mail-rule-config-head em {
  display: block;
  color: var(--subtle);
  font-size: 11px;
  font-weight: 780;
  line-height: 1.2;
  text-transform: uppercase;
}

.mail-rule-config-head strong {
  display: block;
  margin-top: 7px;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.25;
}

.mail-rule-config-head em {
  margin-top: 6px;
  color: var(--muted);
  text-transform: none;
}

.mail-reader-card {
  height: 100%;
  min-height: 0;
  border: 1px solid var(--line-soft);
  border-radius: 5px;
  background: var(--surface-solid);
  padding: 6px;
  gap: 5px;
  grid-template-rows: auto auto auto minmax(0, 1fr) auto;
}

.mail-reader-card header span,
.mail-reader-meta span,
.priority-person-form span,
.priority-person-item span,
.newsletter-candidate span {
  display: block;
  color: var(--subtle);
  font-size: 11px;
  font-weight: 780;
  line-height: 1.2;
  text-transform: uppercase;
}

.mail-reader-card header strong,
.priority-person-item strong,
.newsletter-candidate strong {
  display: block;
  margin-top: 2px;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.25;
}

.mail-reader-card header em,
.priority-person-item em,
.newsletter-candidate em,
.priority-person-status {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 650;
  line-height: 1.35;
}

.mail-reader-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 3px 8px;
  min-height: 13px;
  margin-top: 0;
}

.mail-reader-navigation {
  display: grid;
  grid-template-columns: minmax(62px, auto) 1fr minmax(62px, auto);
  align-items: center;
  gap: 4px;
}

.mail-reader-navigation span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-align: center;
}

.mail-reader-navigation .text-button {
  margin-top: 0;
}

.mail-reader-body {
  min-height: 0;
  max-height: none;
  overflow: auto;
  border: 1px solid rgba(2, 45, 22, 0.14);
  border-radius: 4px;
  background: var(--surface-solid);
  padding: 8px;
  white-space: pre-wrap;
  color: var(--text);
  font-size: 12px;
  font-weight: 620;
  line-height: 1.38;
}

.mail-reader-body.is-html {
  padding: 0;
  overflow: hidden;
  white-space: normal;
}

.mail-reader-html-frame {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 420px;
  border: 0;
  background: #fff;
}

.mail-reader-privacy {
  align-self: center;
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
}

.mail-reader-actions,
.reply-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.work-mail-reader-panel {
  padding: 4px;
}

.work-mail-reader-panel .reply-assistant {
  position: sticky;
  bottom: 0;
  align-self: end;
  border: 1px solid var(--line-soft);
  border-radius: 5px;
  background: var(--surface-solid);
  padding: 6px;
}

.work-mail-reader-panel .reply-composer {
  grid-template-columns: 1fr;
  gap: 8px;
}

.work-mail-reader-panel .reply-prompt-field textarea {
  min-height: 42px;
}

.work-mail-reader-panel .reply-prompt-field textarea:focus {
  min-height: 96px;
}

.work-mail-reader-panel .reply-side {
  gap: 5px;
}

.work-mail-reader-panel .reply-actions .btn {
  min-height: 28px;
}

.work-mail-reader-panel .reply-draft-preview {
  padding: 6px;
}

.work-mail-reader-panel .reply-draft-head {
  grid-template-columns: 1fr;
  gap: 6px;
}

.work-mail-reader-panel .reply-editor-toolbar {
  justify-content: flex-start;
}

.work-mail-reader-panel .reply-rich-editor {
  min-height: 120px;
  max-height: 180px;
  padding: 8px;
  font-size: 12px;
}

.mail-reader-actions .account-button,
.mail-reader-actions .text-button,
.mail-unsubscribe-link {
  margin-top: 0;
}

.priority-person-form {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(180px, 0.7fr) auto;
  align-items: end;
  margin-bottom: 12px;
}

.priority-person-form .account-button {
  margin-top: 0;
}

.priority-person-status {
  grid-column: 1 / -1;
  min-height: 18px;
}

.priority-person-item,
.newsletter-candidate {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-soft);
  padding: 12px;
}

.priority-person-item .text-button,
.newsletter-candidate .account-button,
.newsletter-candidate .text-button {
  margin-top: 0;
}

.newsletter-candidate-list {
  margin-bottom: 14px;
}

.newsletter-candidate small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.mail-hygiene-toolbar {
  display: grid;
  grid-template-columns: auto auto auto auto minmax(180px, 1fr);
  align-items: center;
  gap: 8px;
}

.mail-hygiene-toolbar .account-button,
.mail-hygiene-toolbar .text-button {
  margin-top: 0;
}

.mail-hygiene-status {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.35;
}

.recurring-mail-list {
  display: grid;
  gap: 9px;
}

.recurring-mail-group {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-soft);
  padding: 11px;
}

.recurring-mail-select {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  cursor: pointer;
}

.recurring-mail-select input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--accent);
}

.recurring-mail-select span,
.recurring-mail-select em {
  display: block;
  color: var(--subtle);
  font-size: 11px;
  font-weight: 780;
  line-height: 1.2;
  text-transform: uppercase;
}

.recurring-mail-select strong {
  display: block;
  margin-top: 6px;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.2;
}

.recurring-mail-select em,
.recurring-mail-select small {
  margin-top: 5px;
  color: var(--muted);
  font-style: normal;
  font-weight: 650;
  text-transform: none;
}

.recurring-mail-select small {
  display: block;
  font-size: 12px;
  line-height: 1.35;
}

.recurring-mail-actions {
  display: flex;
  justify-content: flex-end;
}

.recurring-mail-actions .account-button,
.recurring-mail-actions .text-button {
  margin-top: 0;
}

.recurring-mail-actions small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.mail-policy-details {
  margin-top: 12px;
}

.gmail-config-panel {
  min-width: 0;
}

.gmail-policy-panel {
  align-self: start;
}

.gmail-config-status {
  min-height: 22px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.gmail-config-bulk-actions,
.gmail-add-account-form,
.gmail-add-account-fields,
.gmail-connect-all {
  display: grid;
  gap: 12px;
}

.gmail-config-bulk-actions {
  grid-template-columns: 1fr;
  align-items: start;
  margin-bottom: 14px;
}

.gmail-connect-all {
  align-self: stretch;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.42);
  padding: 14px;
}

.gmail-connect-all .account-button {
  width: 100%;
}

.gmail-connect-all span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
}

.gmail-add-account-form {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.52);
  padding: 14px;
}

.gmail-add-account-fields {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: end;
}

.gmail-account-config-list {
  display: grid;
  gap: 12px;
}

.gmail-account-config,
.gmail-oauth-settings-form {
  display: grid;
  gap: 10px;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.5);
  padding: 14px;
}

.gmail-account-config-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-width: 0;
}

.gmail-account-config-header .text-button {
  justify-self: start;
  max-width: 100%;
  white-space: normal;
}

.gmail-account-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}

.gmail-account-settings {
  border-top: 1px solid rgba(101, 116, 109, 0.2);
  padding-top: 8px;
}

.gmail-account-settings summary {
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 780;
}

.gmail-account-settings[open] summary {
  margin-bottom: 10px;
}

.gmail-account-error {
  margin: 8px 0 0;
  color: #9f2f34;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
}

.gmail-account-config-header span,
.gmail-field span,
.gmail-toggle-row span {
  display: block;
  color: var(--subtle);
  font-size: 11px;
  font-weight: 780;
  line-height: 1.2;
  text-transform: uppercase;
}

.gmail-account-config-header strong {
  display: block;
  margin-top: 7px;
  font-size: 15px;
  line-height: 1.25;
}

.gmail-account-config-header em {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 650;
  line-height: 1.35;
}

.gmail-config-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  gap: 10px;
  align-items: end;
}

.gmail-field {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.gmail-field input,
.gmail-field select,
.gmail-field textarea {
  width: 100%;
  min-width: 0;
}

.gmail-signature-field {
  grid-column: 1 / -1;
}

.gmail-signature-field em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 650;
}

.gmail-toggle-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 39px;
}

.gmail-toggle-row input {
  width: 17px;
  height: 17px;
  accent-color: var(--accent);
}

.gmail-policy-grid {
  display: grid;
  gap: 10px;
}

.gmail-oauth-settings {
  margin-bottom: 12px;
}

.gmail-oauth-status {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-soft);
  padding: 13px;
}

.gmail-oauth-status.is-missing {
  border-color: rgba(159, 47, 52, 0.35);
  background: rgba(159, 47, 52, 0.055);
}

.gmail-oauth-status span,
.gmail-oauth-status em {
  display: block;
  color: var(--subtle);
  font-size: 11px;
  font-weight: 780;
  line-height: 1.2;
  text-transform: uppercase;
}

.gmail-oauth-status strong {
  display: block;
  margin-top: 7px;
  font-size: 14px;
  line-height: 1.25;
}

.gmail-oauth-status em {
  margin-top: 6px;
  color: var(--muted);
  font-style: normal;
  line-height: 1.35;
  text-transform: none;
}

.work-section-hero {
  grid-column: 1 / -1;
}

#workSlackSection > .work-section-hero,
#workGmailConfigSection > .work-section-hero,
#workAutomationSection > .work-section-hero {
  display: none;
}

.work-board-preview,
.work-board-full {
  display: grid;
  gap: 12px;
}

.work-board-preview {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.work-board-full {
  grid-column: 1 / -1;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}

.work-lane {
  display: grid;
  gap: 8px;
  align-content: start;
}

.work-lane header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.work-lane header strong {
  margin-top: 0;
}

.work-card {
  border: 1px solid rgba(2, 45, 22, 0.16);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.45);
  padding: 9px 10px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 720;
  line-height: 1.35;
}

.work-mail-bucket {
  position: relative;
  overflow: hidden;
}

.work-mail-bucket::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  content: "";
}

.work-mail-bucket.tone-critical::before {
  background: var(--bad);
}

.work-mail-bucket.tone-important::before {
  background: var(--accent);
}

.work-mail-bucket.tone-safe::before {
  background: var(--good);
}

.work-mail-bucket.tone-muted::before {
  background: var(--line);
}

.work-mail-bucket strong {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.work-mail-bucket strong b {
  font-size: 22px;
}

.work-mail-load-summary {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  margin-bottom: 16px;
}

.work-mail-load-stat {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-soft);
  padding: 12px;
  min-width: 0;
}

.work-mail-load-stat span,
.work-mail-load-stat em {
  display: block;
  color: var(--subtle);
  font-size: 11px;
  font-weight: 780;
  line-height: 1.2;
  text-transform: uppercase;
}

.work-mail-load-stat strong {
  display: block;
  margin-top: 6px;
  color: var(--ink);
  font-size: 22px;
  line-height: 1.1;
}

.work-mail-load-stat em {
  margin-top: 6px;
  color: var(--muted);
  font-style: normal;
  line-height: 1.3;
  text-transform: none;
}

.work-mail-load-chart {
  display: grid;
  gap: 8px;
  align-items: end;
  min-height: 190px;
  overflow-x: auto;
  padding-bottom: 3px;
}

.work-mail-load-bar {
  display: grid;
  gap: 6px;
  min-width: 0;
  text-align: center;
}

.work-mail-load-track {
  display: flex;
  align-items: end;
  height: 118px;
  border: 1px solid rgba(2, 45, 22, 0.14);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.42);
  overflow: hidden;
}

.work-mail-load-track span {
  display: block;
  width: 100%;
  background: linear-gradient(180deg, #ff5a1f 0%, #b73517 100%);
}

.work-mail-load-bar strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 12px;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.work-mail-load-bar em {
  color: var(--muted);
  font-size: 10px;
  font-style: normal;
  font-weight: 800;
  line-height: 1.1;
}

.work-action-status {
  grid-column: 1 / -1;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.work-archive-grid {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(330px, 0.8fr);
  gap: 18px;
  align-items: start;
  align-self: start;
}

.kpi-row {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
  gap: 12px;
}

.kpi-card,
.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
}

.kpi-card {
  min-height: 128px;
  padding: 16px;
}

.finance-page .kpi-row {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1px;
  align-items: stretch;
  overflow: hidden;
  margin-bottom: 4px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--line);
}

.finance-page .kpi-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 10px;
  min-height: 58px;
  overflow: hidden;
  padding: 7px 10px;
  border: 0;
  border-radius: 0;
  background: var(--surface-solid);
  box-shadow: none;
  backdrop-filter: none;
}

.finance-page .kpi-card.is-liquidity {
  background: var(--accent-soft);
}

.kpi-card.is-liquidity {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.kpi-card.is-negative strong {
  color: var(--bad);
}

.kpi-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.finance-page .kpi-card span {
  font-size: 10px;
}

.kpi-card strong {
  display: block;
  margin-top: 22px;
  font-size: clamp(21px, 2vw, 30px);
  line-height: 1;
  overflow-wrap: anywhere;
  white-space: nowrap;
}

.finance-page .kpi-card strong {
  grid-column: 2;
  grid-row: 1 / 3;
  justify-self: end;
  max-width: 100%;
  overflow: hidden;
  margin-top: 0;
  font-size: clamp(14px, 1.05vw, 18px);
  overflow-wrap: normal;
  text-overflow: ellipsis;
}

.kpi-card em {
  display: block;
  margin-top: 10px;
  color: var(--subtle);
  font-size: 12px;
  font-style: normal;
  font-weight: 650;
}

.finance-page .kpi-card em {
  overflow: hidden;
  margin-top: 0;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chart-panel,
.entity-panel {
  grid-column: 1;
}

.scenario-panel,
.contribution-panel {
  grid-column: 2;
}

.performance-panel {
  grid-column: 1 / -1;
}

.watch-panel {
  grid-column: 1 / -1;
}

.trend-panel {
  grid-column: 1 / -1;
}

.cash-panel {
  grid-column: 1 / -1;
  position: relative;
  z-index: 1;
  background: var(--surface-solid);
}

.panel {
  min-width: 0;
  padding: 14px;
}

.panel-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.panel-heading p {
  margin-top: 3px;
  font-size: 13px;
}

.cash-panel .panel-heading .text-button {
  flex: 0 0 auto;
  white-space: nowrap;
}

.chart-wrap {
  height: 280px;
}

.chart-wrap.tall {
  height: 320px;
}

.chart-wrap svg {
  display: block;
  width: 100%;
  height: 100%;
}

.trend-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.trend-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-soft);
  padding: 14px;
}

.trend-card h3 {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 800;
}

.trend-card svg {
  display: block;
  width: 100%;
  height: auto;
}

.performance-totals {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.private-current-totals {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
  gap: 12px;
  margin: 18px 0;
}

.convenant-totals {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
  margin: 18px 0;
}

.cash-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.watch-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.watch-total {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-soft);
  padding: 13px;
}

.watch-total.needs-attention {
  border-color: var(--bad);
  background: rgba(185, 50, 34, 0.08);
}

.watch-total span,
.watch-total em,
.watch-issue span,
.watch-issue em {
  display: block;
  color: var(--subtle);
  font-size: 11px;
  font-weight: 750;
  text-transform: uppercase;
}

.watch-total strong {
  display: block;
  margin-top: 8px;
  font-size: clamp(18px, 2vw, 24px);
  line-height: 1;
}

.watch-total em {
  margin-top: 7px;
  font-style: normal;
  line-height: 1.35;
  text-transform: none;
}

.watch-list {
  display: grid;
  gap: 8px;
}

.watch-issue {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid var(--line);
  border-left-width: 5px;
  border-radius: 7px;
  background: var(--surface-soft);
  padding: 12px;
}

.watch-issue.severity-hoog {
  border-left-color: var(--bad);
}

.watch-issue.severity-middel {
  border-left-color: var(--warn);
}

.watch-issue.severity-laag {
  border-left-color: var(--good);
}

.watch-issue strong {
  display: block;
  font-size: 13px;
}

.watch-issue > strong {
  flex: 0 0 auto;
  text-align: right;
  white-space: nowrap;
}

.watch-issue em {
  margin-top: 4px;
  font-style: normal;
  line-height: 1.35;
  text-transform: none;
}

.watch-empty {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-soft);
  color: var(--muted);
  padding: 14px;
  font-size: 13px;
  font-weight: 650;
}

.cash-total {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-soft);
  padding: 13px;
}

.cash-total.is-primary {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.cash-total span,
.cash-head span,
.cash-row small,
.cash-total em,
.cash-balance span,
.cash-balance em,
.cash-balance small {
  display: block;
  color: var(--subtle);
  font-size: 11px;
  font-weight: 750;
  text-transform: uppercase;
}

.cash-total strong {
  display: block;
  margin-top: 8px;
  font-size: clamp(18px, 2vw, 24px);
  line-height: 1;
  white-space: nowrap;
}

.cash-total.is-primary strong {
  font-size: clamp(28px, 3vw, 40px);
}

.cash-total em {
  margin-top: 8px;
  font-style: normal;
  line-height: 1.35;
  text-transform: none;
}

.cash-balances {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.cash-balance {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-soft);
  padding: 12px;
}

.cash-balance > div {
  min-width: 0;
}

.cash-balance > div:last-child {
  text-align: right;
}

.cash-balance strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 15px;
  line-height: 1.2;
}

.cash-balance > div:last-child strong {
  margin-top: 4px;
  font-size: 18px;
  white-space: nowrap;
}

.cash-balance small {
  margin-top: 4px;
  text-transform: none;
}

.cash-balance.is-negative {
  border-color: var(--bad);
}

.cash-balance.is-negative > div:last-child strong {
  color: var(--bad);
}

.cash-table {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.cash-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.2fr) repeat(5, minmax(120px, 1fr));
  min-width: 900px;
  border-bottom: 1px solid var(--line);
}

.cash-row:last-child {
  border-bottom: 0;
}

.cash-row > * {
  min-width: 0;
  padding: 12px;
  border-right: 1px solid var(--line);
}

.cash-row > *:last-child {
  border-right: 0;
}

.cash-head {
  background: var(--surface-soft);
}

.cash-row strong,
.cash-row span {
  font-size: 13px;
  font-weight: 720;
}

.cash-row span {
  display: grid;
  gap: 3px;
}

.cash-row small {
  margin-top: 4px;
  text-transform: none;
}

.cash-total.is-negative strong,
.cash-row .is-negative {
  color: var(--bad);
}

.equity-totals {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
  gap: 12px;
}

.open-item-totals {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
  margin: 18px 0;
}

.performance-total,
.equity-total,
.private-current-total,
.convenant-total,
.open-item-total {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-soft);
  padding: 13px;
}

.performance-total span,
.performance-total em,
.equity-total span,
.equity-total em,
.private-current-total span,
.private-current-total em,
.convenant-total span,
.convenant-total em,
.open-item-total span,
.open-item-total em,
.equity-cell span,
.metric-bar span,
.pl-summary span {
  display: block;
  color: var(--subtle);
  font-size: 11px;
  font-weight: 750;
  text-transform: uppercase;
}

.performance-total strong,
.equity-total strong,
.private-current-total strong,
.convenant-total strong,
.open-item-total strong {
  display: block;
  margin-top: 8px;
  font-size: clamp(18px, 2vw, 26px);
  line-height: 1;
}

.performance-total em,
.equity-total em,
.private-current-total em,
.convenant-total em,
.open-item-total em {
  margin-top: 8px;
  font-style: normal;
  line-height: 1.35;
  text-transform: none;
}

.performance-total.is-negative strong,
.equity-total.is-negative strong,
.private-current-total.is-negative strong,
.convenant-total.is-negative strong,
.open-item-total.is-negative strong,
.equity-cell.is-negative strong,
.private-current-cell.is-negative strong,
.pl-summary .is-negative strong,
.metric-bar.is-negative strong {
  color: var(--bad);
}

.open-items-panel {
  min-width: 0;
}

.open-items-table td {
  vertical-align: top;
}

.open-items-table td > strong,
.open-items-table td > small {
  display: block;
}

.open-items-table td > strong {
  font-size: 13px;
}

.open-items-table td > small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
  line-height: 1.35;
}

.open-item-row {
  transition: background 140ms ease;
}

.open-item-row:hover,
.open-item-row.is-expanded {
  background: color-mix(in srgb, var(--accent) 7%, transparent);
}

.open-item-toggle {
  display: grid;
  gap: 4px;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.open-item-toggle strong {
  font-size: 13px;
}

.open-item-toggle span {
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
}

.open-item-toggle span::after {
  content: "  ›";
}

.open-item-toggle[aria-expanded="true"] span::after {
  content: "  ⌄";
}

.open-item-toggle:focus-visible {
  border-radius: 4px;
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.open-item-detail-row > td {
  padding: 0 12px 16px;
  border-top: 0;
}

.open-item-transactions {
  padding: 14px;
  border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--line));
  border-radius: 7px;
  background: color-mix(in srgb, var(--accent) 5%, var(--surface));
}

.open-item-transactions > header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.open-item-transactions > header span,
.open-item-transactions > header strong {
  display: block;
}

.open-item-transactions > header span {
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.open-item-transactions table {
  min-width: 880px;
}

.open-item-document-cell {
  width: 190px;
}

.open-item-source-hint {
  display: grid;
  gap: 2px;
  margin-bottom: 8px;
  padding: 8px;
  border: 1px solid color-mix(in srgb, var(--accent) 42%, var(--border));
  border-radius: 6px;
  background: color-mix(in srgb, var(--accent) 7%, var(--surface));
}

.open-item-source-hint > span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.open-item-source-hint > strong {
  font-size: 11px;
}

.open-item-source-hint > small {
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  line-height: 1.25;
}

.open-item-source-hint > div {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 4px;
}

.open-item-source-link,
.open-item-source-help {
  color: var(--accent-strong);
  font-size: 10px;
  font-weight: 850;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.open-item-document-upload {
  display: grid;
  gap: 5px;
  min-width: 128px;
}

.open-item-document-upload label {
  justify-content: center;
  padding: 7px 9px;
  white-space: nowrap;
  cursor: pointer;
}

.open-item-document-upload input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.open-item-document-upload span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.25;
}

.open-item-transactions th,
.open-item-transactions td {
  padding: 9px 10px;
  font-size: 11px;
}

.open-item-transactions tbody tr:last-child td {
  border-bottom: 0;
}

.open-items-table .amount-cell {
  text-align: right;
  white-space: nowrap;
}

.open-items-table .amount-cell strong {
  font-size: 15px;
}

.open-items-table .is-negative,
.open-items-table tr.is-credit .amount-cell strong {
  color: var(--bad);
}

.finance-invoices-page {
  display: grid;
  gap: 12px;
}

.finance-invoice-panel {
  min-height: calc(100vh - 230px);
  overflow: hidden;
}

.finance-invoice-panel .panel-heading {
  align-items: center;
  margin-bottom: 8px;
}

.finance-invoice-status {
  min-height: 18px;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.finance-invoice-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  margin-bottom: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--line);
}

.finance-invoice-stat {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 34px;
  padding: 7px 10px;
  background: var(--surface-solid);
}

.finance-invoice-stat span,
.finance-invoice-stat strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.finance-invoice-stat span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 780;
  text-transform: uppercase;
}

.finance-invoice-stat strong {
  font-size: 14px;
}

.finance-control-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.finance-control-card {
  padding: 12px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--warn);
  border-radius: 7px;
  background: var(--surface-solid);
}

.finance-control-card.is-healthy {
  border-left-color: var(--good);
}

.finance-control-card.is-stale,
.finance-control-card.is-disconnected,
.finance-control-card.is-blocked {
  border-left-color: var(--bad);
}

.finance-control-card header,
.finance-control-card footer,
.finance-control-card header div {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.finance-control-card header div {
  flex-direction: column;
  gap: 1px;
}

.finance-control-card header span,
.finance-control-card header em,
.finance-control-card footer,
.finance-control-values small,
.finance-control-values em {
  color: var(--muted);
  font-size: 10px;
  font-style: normal;
}

.finance-control-card header em {
  font-weight: 800;
  text-transform: uppercase;
}

.finance-control-values {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0;
}

.finance-control-values span {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.finance-control-values strong {
  overflow: hidden;
  font-size: 15px;
  text-overflow: ellipsis;
}

.finance-control-card footer {
  flex-wrap: wrap;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.finance-invoice-workspace {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: 12px;
  height: min(680px, calc(100vh - 330px));
  min-height: 520px;
}

.finance-invoice-sidebar,
.finance-invoice-detail {
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.42);
}

.finance-invoice-sidebar {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.finance-payroll-sidebar {
  grid-template-rows: minmax(0, 1fr);
}

.finance-invoice-mailbox-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 34px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line-soft);
}

.finance-invoice-mailbox-head div,
.finance-invoice-list-head {
  display: grid;
  gap: 1px;
}

.finance-invoice-mailbox-head span,
.finance-invoice-list-head span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.finance-invoice-list-head {
  min-height: 34px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.3);
}

.finance-invoice-mailbox,
.finance-invoice-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 46px;
  padding: 7px 10px;
  border: 0;
  border-bottom: 1px solid var(--line-soft);
  background: transparent;
  color: inherit;
  text-align: left;
}

.finance-invoice-mailbox-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.finance-invoice-mailbox-actions .btn {
  min-height: 26px;
  padding: 3px 7px;
  font-size: 11px;
}

.finance-invoice-mailbox strong,
.finance-invoice-mailbox span,
.finance-invoice-mailbox em,
.finance-invoice-row strong,
.finance-invoice-row em {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.finance-invoice-mailbox span,
.finance-invoice-mailbox em,
.finance-invoice-row em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 700;
}

.finance-invoice-row:hover,
.finance-invoice-row.is-selected {
  background: var(--surface-soft);
}

.finance-invoice-row.is-selected {
  box-shadow: inset 3px 0 0 var(--accent);
}

.finance-invoice-list {
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.finance-invoice-add {
  border-bottom: 1px solid var(--line-soft);
}

.finance-invoice-add summary {
  padding: 8px 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.finance-invoice-mini-form,
.finance-invoice-edit-form,
.finance-invoice-map-form {
  display: grid;
  gap: 8px;
}

.finance-invoice-mini-form {
  padding: 0 10px 10px;
}

.finance-invoice-mini-form label,
.finance-invoice-edit-form label,
.finance-invoice-map-form label {
  display: grid;
  gap: 3px;
}

.finance-invoice-mini-form span,
.finance-invoice-edit-form span,
.finance-invoice-map-form span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 820;
  text-transform: uppercase;
}

.finance-invoice-mini-form input,
.finance-invoice-mini-form select,
.finance-invoice-edit-form input,
.finance-invoice-edit-form select,
.finance-invoice-map-form input {
  width: 100%;
  min-height: 34px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface-solid);
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

.finance-payroll-upload {
  display: flex;
  align-items: center;
  gap: 8px;
}

.finance-payroll-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}

.finance-payroll-upload input {
  max-width: 320px;
  font-size: 12px;
  font-weight: 700;
}

.finance-invoice-detail {
  overflow: auto;
  padding: 12px;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.finance-invoice-detail-card header {
  display: grid;
  gap: 3px;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line-soft);
}

.finance-invoice-detail-card header span,
.finance-invoice-detail-card header em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 760;
}

.finance-invoice-detail-card header strong {
  font-size: 18px;
}

.finance-invoice-warning {
  margin: 0 0 10px;
  padding: 8px 10px;
  border: 1px solid rgba(255, 93, 24, 0.45);
  border-radius: 5px;
  background: rgba(255, 93, 24, 0.11);
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
}

.finance-invoice-warning.is-ocr {
  border-color: rgba(15, 139, 86, 0.42);
  background: rgba(15, 139, 86, 0.1);
}

.finance-invoice-edit-form,
.finance-invoice-map-form {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: end;
  margin-bottom: 10px;
}

.finance-invoice-map-form {
  grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
  padding-top: 10px;
  border-top: 1px solid var(--line-soft);
}

.finance-invoice-edit-form .btn,
.finance-invoice-map-form .btn {
  min-height: 34px;
}

.finance-invoice-actions {
  display: flex;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--line-soft);
}

/* The invoice inbox is a workbench: reserve the viewport for the two panes. */
body[data-section="invoices"] .app-shell {
  grid-template-columns: 220px minmax(0, 1fr);
}

body[data-section="invoices"] .side-rail {
  padding: 12px 10px;
}

body[data-section="invoices"] .brand {
  min-height: 34px;
}

body[data-section="invoices"] .brand-logo {
  width: 132px;
}

body[data-section="invoices"] .domain-switch {
  margin-top: 8px;
}

body[data-section="invoices"] .rail-nav {
  gap: 2px;
  margin-top: 10px;
}

body[data-section="invoices"] .rail-item {
  min-height: 31px;
  padding: 6px 8px;
  border-radius: 6px;
  font-size: 13px;
}

body[data-section="invoices"] .rail-footer {
  display: none;
}

body[data-section="invoices"] .workspace {
  grid-template-rows: 34px 34px 0 minmax(0, 1fr);
  gap: 4px;
  overflow: hidden;
  padding: 6px 10px 8px;
}

body[data-section="invoices"] .workspace-domain-bar {
  min-height: 34px;
  padding: 3px 4px 3px 9px;
}

body[data-section="invoices"] .workspace-domain-heading span {
  display: none;
}

body[data-section="invoices"] .workspace-domain-heading strong {
  margin-top: 0;
  font-size: 13px;
}

body[data-section="invoices"] .workspace-domain-switch {
  min-width: 180px;
  padding: 2px;
}

body[data-section="invoices"] .workspace-domain-switch .domain-button {
  min-height: 27px;
  border-radius: 4px;
  font-size: 12px;
}

body[data-section="invoices"] .topbar {
  min-height: 34px;
}

/* Mail en Factuur inbox drukken de bovenste balk plat tot 34px; de knoppen
   ernaast moeten dan mee, anders duwen ze de balk weer open. */
body[data-section="work-mail"] .workspace-domain-tools .btn,
body[data-section="invoices"] .workspace-domain-tools .btn {
  min-height: 28px;
}

body[data-section="work-mail"] .workspace-domain-tools .btn-icon,
body[data-section="invoices"] .workspace-domain-tools .btn-icon {
  width: 32px;
}

body[data-section="work-mail"] .workspace-domain-tools .lang-switch,
body[data-section="invoices"] .workspace-domain-tools .lang-switch {
  padding: 2px;
}

body[data-section="work-mail"] .workspace-domain-tools .lang-option,
body[data-section="invoices"] .workspace-domain-tools .lang-option {
  min-height: 24px;
  min-width: 29px;
  font-size: 11px;
}

body[data-section="work-mail"] .workspace-domain-tools .logout-button svg,
body[data-section="invoices"] .workspace-domain-tools .logout-button svg {
  width: 15px;
  height: 15px;
}

body[data-section="invoices"] .topbar-actions {
  width: 100%;
  gap: 6px;
}

body[data-section="invoices"] .select-shell {
  gap: 1px;
}

body[data-section="invoices"] .select-shell span {
  font-size: 9px;
}

body[data-section="invoices"] .select-shell select,
body[data-section="invoices"] .topbar-actions .btn {
  min-height: 31px;
}

body[data-section="invoices"] .status-strip {
  visibility: hidden;
  height: 0;
  min-height: 0;
  overflow: hidden;
  border: 0;
}

body[data-section="invoices"] .status-strip > div {
  padding: 0;
}

body[data-section="invoices"] .finance-invoices-page,
body[data-section="invoices"] .finance-invoice-panel {
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

body[data-section="invoices"] .finance-invoice-panel {
  display: grid;
  grid-template-rows: auto auto auto auto minmax(0, 1fr);
  gap: 6px;
  padding: 9px;
}

body[data-section="invoices"] .finance-invoice-panel .panel-heading {
  min-height: 32px;
  margin: 0;
}

body[data-section="invoices"] .finance-invoice-panel .panel-heading h2 {
  font-size: 16px;
}

body[data-section="invoices"] .finance-invoice-panel .panel-heading p {
  display: none;
}

body[data-section="invoices"] .finance-invoice-panel .panel-heading .btn {
  min-height: 32px;
}

body[data-section="invoices"] .finance-invoice-status {
  min-height: 0;
  margin: 0;
}

body[data-section="invoices"] .finance-invoice-status:empty {
  display: none;
}

body[data-section="invoices"] .finance-invoice-stats {
  min-height: 32px;
  margin: 0;
}

body[data-section="invoices"] .finance-invoice-stat {
  min-height: 30px;
  padding: 5px 9px;
}

body[data-section="invoices"] .finance-control-grid {
  gap: 4px;
  margin: 0;
}

body[data-section="invoices"] .finance-control-card {
  display: grid;
  grid-template-columns: minmax(185px, 0.7fr) minmax(0, 3fr);
  align-items: center;
  gap: 10px;
  min-height: 54px;
  padding: 6px 10px;
}

body[data-section="invoices"] .finance-control-card header {
  align-items: center;
}

body[data-section="invoices"] .finance-control-card header strong {
  font-size: 14px;
}

body[data-section="invoices"] .finance-control-values {
  gap: 10px;
  margin: 0;
}

body[data-section="invoices"] .finance-control-values strong {
  font-size: 14px;
}

body[data-section="invoices"] .finance-control-card footer {
  display: none;
}

body[data-section="invoices"] .finance-invoice-workspace {
  height: auto;
  min-height: 0;
  gap: 8px;
}

body[data-section="invoices"] .finance-invoice-sidebar,
body[data-section="invoices"] .finance-invoice-detail {
  height: 100%;
}

body[data-section="invoices"] .finance-invoice-detail {
  padding: 10px;
}

.finance-payroll-balance {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 10px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface-solid);
}

.finance-payroll-balance span {
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.finance-payroll-balance.is-warning {
  border-color: var(--bad);
  color: var(--bad);
}

.finance-payroll-lines {
  max-height: 260px;
  overflow: auto;
  margin-bottom: 10px;
  border: 1px solid var(--line-soft);
  border-radius: 5px;
}

.finance-invoice-source {
  margin-top: 10px;
}

.finance-invoice-source summary {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.finance-invoice-source pre {
  max-height: 160px;
  overflow: auto;
  padding: 8px;
  border: 1px solid var(--line-soft);
  border-radius: 5px;
  background: var(--surface-soft);
  white-space: pre-wrap;
  font-size: 12px;
}

.finance-invoice-booking-guide {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1rem;
  border: 1px solid color-mix(in srgb, var(--accent) 55%, var(--line));
  border-radius: 0.75rem;
  background: color-mix(in srgb, var(--accent) 8%, var(--panel));
}

.finance-invoice-booking-guide > div {
  min-width: 0;
}

.finance-invoice-booking-guide strong,
.finance-invoice-booking-guide span {
  display: block;
}

.finance-invoice-booking-guide span {
  margin-top: 0.2rem;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

.finance-invoice-booking-guide .btn {
  flex: 0 0 auto;
}

.finance-invoice-booking-guide.is-ready {
  border-color: color-mix(in srgb, #15803d 55%, var(--line));
  background: color-mix(in srgb, #15803d 7%, var(--panel));
}

.finance-reconciliation-panel {
  margin-top: 1rem;
  border-color: rgba(255, 93, 24, 0.52);
  box-shadow: 0 14px 34px rgba(71, 35, 14, 0.08);
  scroll-margin-top: 1rem;
}

.finance-reconciliation-list {
  display: grid;
  gap: 0.7rem;
}

.finance-reconciliation-heading-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.6rem;
}

.finance-reconciliation-heading-actions select {
  min-height: 2.35rem;
  border: 1px solid var(--line);
  border-radius: 0.65rem;
  background: var(--panel);
  color: var(--text);
  padding: 0 0.7rem;
}

.finance-reconciliation-row {
  display: grid;
  grid-template-columns: minmax(12rem, 1.2fr) minmax(9rem, 0.8fr) minmax(16rem, 1.7fr) auto;
  gap: 0.85rem;
  align-items: center;
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  border-radius: 0.85rem;
  background: color-mix(in srgb, var(--panel) 96%, var(--accent) 4%);
}

.finance-reconciliation-row.is-missing_document,
.finance-reconciliation-row.is-document_found_not_booked {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--line));
}

.finance-reconciliation-row.is-paid_unmatched,
.finance-reconciliation-row.is-payment_allocation_required {
  border-color: color-mix(in srgb, #f59e0b 55%, var(--line));
}

.finance-reconciliation-row > div {
  min-width: 0;
}

.finance-reconciliation-row strong,
.finance-reconciliation-row span,
.finance-reconciliation-row small {
  display: block;
}

.finance-reconciliation-row span,
.finance-reconciliation-row small {
  color: var(--muted);
  margin-top: 0.2rem;
}

.finance-reconciliation-row .finance-reconciliation-amount {
  text-align: right;
  white-space: nowrap;
}

.finance-reconciliation-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.45rem;
}

.finance-reconciliation-upload {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.finance-reconciliation-upload input[type="file"] {
  max-width: 13rem;
  font-size: 0.78rem;
}

@media (max-width: 900px) {
  .finance-invoice-booking-guide {
    align-items: stretch;
    flex-direction: column;
  }

  .finance-reconciliation-row {
    grid-template-columns: 1fr;
  }

  .finance-reconciliation-row .finance-reconciliation-amount {
    text-align: left;
  }

  .finance-reconciliation-actions {
    justify-content: flex-start;
  }
}

.performance-chart {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.performance-row {
  display: grid;
  grid-template-columns: minmax(180px, 0.72fr) repeat(var(--year-count, 3), minmax(190px, 1fr));
  min-width: calc(180px + (var(--year-count, 3) * 190px));
  border-bottom: 1px solid var(--line);
}

.performance-row:last-child {
  border-bottom: 0;
}

.performance-row > * {
  min-width: 0;
  border-right: 1px solid var(--line);
}

.performance-row > *:last-child {
  border-right: 0;
}

.performance-head {
  background: var(--surface-soft);
}

.performance-head span {
  padding: 11px 12px;
  color: var(--subtle);
  font-size: 11px;
  font-weight: 780;
  text-transform: uppercase;
}

.performance-entity,
.performance-cell {
  padding: 12px;
}

.performance-entity {
  display: grid;
  align-content: center;
  gap: 5px;
}

.performance-entity strong {
  overflow-wrap: anywhere;
  font-size: 13px;
}

.performance-entity span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.performance-cell {
  display: grid;
  gap: 8px;
}

.metric-bar {
  display: grid;
  grid-template-columns: 58px minmax(70px, 1fr) minmax(92px, auto);
  align-items: center;
  gap: 9px;
}

.metric-bar strong {
  font-size: 12px;
  text-align: right;
  white-space: nowrap;
}

.metric-track {
  height: 8px;
  overflow: hidden;
  border-radius: 99px;
  background: var(--surface-soft);
}

.metric-track i {
  display: block;
  min-width: 2px;
  height: 100%;
  border-radius: inherit;
  background: var(--ink);
}

.metric-bar.revenue .metric-track i {
  background: var(--good);
}

.metric-bar.costs .metric-track i {
  background: var(--warn);
}

.metric-bar.result .metric-track i {
  background: var(--ink);
}

.metric-bar.result.is-negative .metric-track i {
  background: var(--bad);
}

.equity-page,
.convenant-page {
  display: grid;
  gap: 18px;
}

.equity-page[hidden],
.convenant-page[hidden],
.audit-page[hidden] {
  display: none;
}

.audit-page {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 0.42fr);
  gap: 18px;
}

.audit-hero,
.audit-totals,
.audit-entity-panel,
.audit-issue-panel {
  grid-column: 1 / -1;
}

.audit-type-panel {
  grid-column: 1 / -1;
}

.audit-totals {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.audit-total {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  padding: 14px;
  box-shadow: var(--shadow);
}

.audit-total span,
.audit-total em,
.audit-type-item span,
.audit-issue span,
.audit-entity-table small {
  display: block;
  color: var(--subtle);
  font-size: 11px;
  font-weight: 750;
  text-transform: uppercase;
}

.audit-total strong {
  display: block;
  margin-top: 9px;
  font-size: clamp(19px, 2vw, 27px);
  line-height: 1;
  white-space: nowrap;
}

.audit-total em {
  margin-top: 8px;
  font-style: normal;
  line-height: 1.35;
  text-transform: none;
}

.audit-total.needs-attention strong {
  color: var(--bad);
}

.audit-type-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.audit-type-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-width: 0;
  border: 1px solid var(--line);
  border-left-width: 5px;
  border-radius: 7px;
  background: var(--surface-soft);
  padding: 13px;
}

.audit-type-item strong {
  display: block;
  font-size: 13px;
  line-height: 1.25;
}

.audit-type-item span {
  margin-top: 5px;
}

.audit-type-item em {
  flex: 0 0 auto;
  color: var(--ink);
  font-size: 13px;
  font-style: normal;
  font-weight: 780;
  white-space: nowrap;
}

.audit-type-item.severity-hoog,
.audit-issue.severity-hoog {
  border-left-color: var(--bad);
}

.audit-type-item.severity-middel,
.audit-issue.severity-middel {
  border-left-color: var(--warn);
}

.audit-type-item.severity-laag,
.audit-issue.severity-laag {
  border-left-color: var(--good);
}

.audit-status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 0 9px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 780;
}

.audit-status.status-kritiek {
  background: rgba(185, 50, 34, 0.12);
  color: var(--bad);
}

.audit-status.status-controle {
  background: var(--accent-soft);
  color: var(--warn);
}

.audit-status.status-ok {
  background: rgba(15, 107, 59, 0.12);
  color: var(--good);
}

.audit-issue-list {
  display: grid;
  gap: 12px;
}

.audit-issue {
  border: 1px solid var(--line);
  border-left-width: 5px;
  border-radius: 7px;
  background: var(--surface-soft);
  padding: 14px;
}

.audit-issue header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.audit-issue header strong {
  display: block;
  margin-top: 5px;
  font-size: 15px;
}

.audit-issue header em {
  color: var(--bad);
  font-size: 14px;
  font-style: normal;
  font-weight: 800;
  white-space: nowrap;
}

.audit-issue-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--line);
}

.audit-issue-grid > div {
  min-width: 0;
  background: var(--surface);
  padding: 10px;
}

.audit-issue-grid strong {
  display: block;
  overflow-wrap: anywhere;
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.3;
}

.audit-issue p {
  margin-top: 11px;
  font-size: 13px;
}

.audit-empty {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-soft);
  color: var(--muted);
  padding: 14px;
  font-size: 13px;
  font-weight: 650;
}

.equity-panel {
  min-width: 0;
}

.equity-chart {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.equity-row {
  display: grid;
  grid-template-columns: minmax(180px, 0.72fr) repeat(var(--year-count, 3), minmax(190px, 1fr));
  min-width: calc(180px + (var(--year-count, 3) * 190px));
  border-bottom: 1px solid var(--line);
}

.equity-row:last-child {
  border-bottom: 0;
}

.equity-row > * {
  min-width: 0;
  border-right: 1px solid var(--line);
}

.equity-row > *:last-child {
  border-right: 0;
}

.equity-head {
  background: var(--surface-soft);
}

.equity-head span {
  padding: 11px 12px;
  color: var(--subtle);
  font-size: 11px;
  font-weight: 780;
  text-transform: uppercase;
}

.equity-entity,
.equity-cell {
  padding: 12px;
}

.equity-entity {
  display: grid;
  align-content: center;
  gap: 5px;
}

.equity-entity strong {
  overflow-wrap: anywhere;
  font-size: 13px;
}

.equity-entity span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.equity-cell strong {
  display: block;
  margin-top: 5px;
  font-size: 17px;
  line-height: 1.1;
  white-space: nowrap;
}

.equity-track {
  height: 8px;
  overflow: hidden;
  margin-top: 10px;
  border-radius: 99px;
  background: var(--surface-soft);
}

.equity-track i {
  display: block;
  min-width: 2px;
  height: 100%;
  border-radius: inherit;
  background: var(--good);
}

.equity-cell.is-negative .equity-track i {
  background: var(--bad);
}

.equity-cell dl {
  display: grid;
  gap: 5px;
  margin: 10px 0 0;
}

.equity-cell dl div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.equity-cell dt,
.equity-cell dd {
  margin: 0;
  font-size: 12px;
  font-weight: 650;
}

.equity-cell dt {
  color: var(--muted);
}

.equity-cell dd {
  text-align: right;
  white-space: nowrap;
}

.private-current-panel {
  min-width: 0;
}

.private-current-chart {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.private-current-row {
  display: grid;
  grid-template-columns: minmax(180px, 0.72fr) repeat(var(--year-count, 3), minmax(190px, 1fr));
  min-width: calc(180px + (var(--year-count, 3) * 190px));
  border-bottom: 1px solid var(--line);
}

.private-current-row:last-child {
  border-bottom: 0;
}

.private-current-row > * {
  min-width: 0;
  border-right: 1px solid var(--line);
}

.private-current-row > *:last-child {
  border-right: 0;
}

.private-current-head {
  background: var(--surface-soft);
}

.private-current-head span {
  padding: 11px 12px;
  color: var(--subtle);
  font-size: 11px;
  font-weight: 780;
  text-transform: uppercase;
}

.private-current-entity,
.private-current-cell {
  padding: 12px;
}

.private-current-entity {
  display: grid;
  align-content: center;
  gap: 5px;
}

.private-current-entity strong {
  overflow-wrap: anywhere;
  font-size: 13px;
}

.private-current-entity span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.private-current-cell strong {
  display: block;
  margin-top: 5px;
  font-size: 17px;
  line-height: 1.1;
  white-space: nowrap;
}

.private-current-cell span,
.private-current-total span {
  display: block;
  color: var(--subtle);
  font-size: 11px;
  font-weight: 750;
  text-transform: uppercase;
}

.private-current-track {
  height: 8px;
  overflow: hidden;
  margin-top: 10px;
  border-radius: 99px;
  background: var(--surface-soft);
}

.private-current-track i {
  display: block;
  min-width: 2px;
  height: 100%;
  border-radius: inherit;
  background: var(--good);
}

.private-current-cell.is-negative .private-current-track i {
  background: var(--bad);
}

.private-current-cell dl {
  display: grid;
  gap: 5px;
  margin: 10px 0 0;
}

.private-current-cell dl div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.private-current-cell dt,
.private-current-cell dd {
  margin: 0;
  font-size: 12px;
  font-weight: 650;
}

.private-current-cell dt {
  color: var(--muted);
}

.private-current-cell dd {
  text-align: right;
  white-space: nowrap;
}

.convenant-panel {
  min-width: 0;
}

.convenant-bars {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.convenant-year {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 13px;
}

.convenant-year-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.convenant-year-head span,
.convenant-metric span {
  color: var(--subtle);
  font-size: 11px;
  font-weight: 750;
  text-transform: uppercase;
}

.convenant-metric {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}

.convenant-metric strong {
  font-size: 12px;
  white-space: nowrap;
}

.convenant-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-soft);
}

.convenant-track i {
  display: block;
  min-width: 2px;
  height: 100%;
  border-radius: inherit;
  background: var(--good);
}

.convenant-metric.rc .convenant-track i {
  background: var(--warn);
}

.convenant-metric.net .convenant-track i {
  background: var(--ink);
}

.convenant-metric.is-negative strong,
.convenant-metric.is-negative .convenant-track i {
  color: var(--bad);
  background: var(--bad);
}

.convenant-assumptions {
  margin: 16px 0 0;
  padding-left: 18px;
  color: var(--subtle);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.45;
}

.convenant-assumptions li + li {
  margin-top: 5px;
}

.chart-grid-line {
  stroke: rgba(2, 45, 22, 0.13);
  stroke-width: 1;
}

.chart-axis {
  fill: var(--subtle);
  font-size: 11px;
  font-weight: 700;
}

.chart-line {
  fill: none;
  stroke: var(--ink);
  stroke-linecap: round;
  stroke-width: 3;
}

.chart-area {
  fill: rgba(255, 94, 26, 0.08);
}

.chart-point {
  fill: var(--bg);
  stroke: var(--ink);
  stroke-width: 2;
}

.trend-line {
  fill: none;
  stroke: var(--ink);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3;
}

.trend-point {
  fill: var(--bg);
  stroke: var(--ink);
  stroke-width: 2;
}

.trend-line.series-revenue,
.trend-point.series-revenue,
.trend-line.series-equity,
.trend-point.series-equity {
  stroke: var(--good);
}

.trend-line.series-costs,
.trend-point.series-costs {
  stroke: var(--warn);
}

.trend-line.series-result,
.trend-point.series-result {
  stroke: var(--ink);
}

.trend-line.series-scenario,
.trend-point.series-scenario {
  stroke: var(--accent);
}

.bar-list {
  display: grid;
  gap: 14px;
}

.bar-row {
  display: grid;
  gap: 7px;
}

.bar-row header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  font-weight: 720;
}

.bar-track {
  height: 9px;
  overflow: hidden;
  border-radius: 99px;
  background: var(--surface-soft);
}

.bar-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--ink);
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 13px 10px;
  text-align: left;
  vertical-align: middle;
}

td {
  font-size: 13px;
  font-weight: 620;
}

tbody tr:hover {
  background: var(--surface-soft);
}

.status-dot {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.status-dot::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 99px;
  background: var(--warn);
}

.status-dot.good::before {
  background: var(--good);
}

.scenario-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.scenario-form label {
  display: grid;
  gap: 6px;
}

.scenario-form label:first-child,
.scenario-form label:nth-child(2),
.scenario-form label:nth-child(6),
.scenario-form button {
  grid-column: 1 / -1;
}

.scenario-list {
  display: grid;
  gap: 8px;
  margin-top: 18px;
}

.scenario-list.standalone {
  margin-top: 0;
}

.scenario-item {
  display: grid;
  gap: 4px;
  padding: 11px 0;
  border-top: 1px solid var(--line);
}

.scenario-item strong {
  font-size: 13px;
}

.scenario-item span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.secondary-section {
  margin-top: 18px;
}

.scenario-page {
  display: grid;
  gap: 18px;
}

.scenario-page[hidden],
.security-page[hidden] {
  display: none;
}

.scenario-totals,
.security-totals {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.scenario-total,
.security-total {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  padding: 14px;
  box-shadow: var(--shadow);
}

.scenario-total span,
.scenario-total em,
.scenario-component-table small,
.security-total span,
.security-total em,
.security-passkey span {
  display: block;
  color: var(--subtle);
  font-size: 11px;
  font-weight: 750;
  text-transform: uppercase;
}

.scenario-total strong,
.security-total strong {
  display: block;
  margin-top: 9px;
  overflow-wrap: anywhere;
  font-size: clamp(19px, 2vw, 27px);
  line-height: 1;
}

.scenario-total em,
.security-total em {
  margin-top: 8px;
  font-style: normal;
  line-height: 1.35;
  text-transform: none;
}

.scenario-total.is-negative strong {
  color: var(--bad);
}

.scenario-component-table small {
  margin-top: 5px;
  line-height: 1.35;
  text-transform: none;
}

.scenario-component-table td:nth-child(4),
.scenario-component-table td:nth-child(5),
.scenario-component-table td:nth-child(6),
.scenario-component-table th:nth-child(4),
.scenario-component-table th:nth-child(5),
.scenario-component-table th:nth-child(6) {
  text-align: right;
}

.security-page {
  display: grid;
  gap: 18px;
}

.security-list {
  display: grid;
  gap: 10px;
}

.security-passkey {
  display: grid;
  grid-template-columns: minmax(220px, 1.3fr) repeat(2, minmax(150px, 0.7fr));
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-soft);
  padding: 13px;
}

.security-passkey strong {
  display: block;
  margin-top: 5px;
  font-size: 14px;
  line-height: 1.25;
}

.security-message {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-soft);
  padding: 12px;
  font-size: 13px;
  font-weight: 700;
}

.scenario-bar {
  fill: var(--good);
  opacity: 0.82;
}

.scenario-bar.is-negative {
  fill: var(--bad);
}

.annual-page {
  display: grid;
  gap: 18px;
}

.annual-page[hidden] {
  display: none;
}

.annual-heading {
  margin-bottom: 12px;
}

.annual-notice {
  display: flex;
  align-items: center;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.annual-notice strong {
  font-size: 13px;
}

.annual-notice span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.annual-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

.annual-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.annual-card {
  display: grid;
  gap: 18px;
}

.pl-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.pl-summary div {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-soft);
  padding: 12px;
}

.pl-summary strong {
  display: block;
  margin-top: 8px;
  overflow-wrap: anywhere;
  font-size: 18px;
  line-height: 1.1;
}

.annual-card-header {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.annual-card-header div {
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 12px;
}

.annual-card-header span,
.detail-tile span {
  color: var(--subtle);
  font-size: 11px;
  font-weight: 750;
  text-transform: uppercase;
}

.annual-card-header strong {
  display: block;
  margin-top: 8px;
  font-size: 15px;
}

.accountant-validation {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-soft);
  padding: 12px;
}

.accountant-validation header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.accountant-validation span,
.validation-checks span {
  display: block;
  color: var(--subtle);
  font-size: 11px;
  font-weight: 750;
  text-transform: uppercase;
}

.accountant-validation strong {
  display: block;
  margin-top: 6px;
  font-size: 15px;
}

.accountant-validation em,
.validation-checks em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 650;
}

.accountant-validation.validation-match {
  border-color: rgba(15, 107, 59, 0.42);
  background: rgba(15, 107, 59, 0.08);
}

.accountant-validation.validation-mismatch,
.accountant-validation.validation-missing_portal_data {
  border-color: rgba(185, 50, 34, 0.44);
  background: rgba(185, 50, 34, 0.08);
}

.validation-checks {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
}

.validation-checks > div {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.28);
  padding: 10px;
}

.validation-checks strong {
  overflow-wrap: anywhere;
}

.validation-checks .is-mismatch strong,
.validation-checks .is-mismatch em {
  color: var(--bad);
}

.statement-section {
  display: grid;
  gap: 8px;
}

.statement-section h3 {
  margin: 0;
  font-size: 14px;
}

.statement-table {
  min-width: 480px;
}

.statement-table td:last-child,
.statement-table th:last-child,
.statement-table tfoot td:last-child {
  text-align: right;
}

.statement-table tfoot td {
  border-bottom: 0;
  font-size: 13px;
  font-weight: 800;
}

.annual-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
  font-size: 13px;
}

.annual-card-footer span {
  color: var(--muted);
  font-weight: 650;
}

.annual-card-footer > div {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.detail-tile {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

.detail-tile span {
  color: var(--subtle);
  font-size: 12px;
  font-weight: 740;
  text-transform: uppercase;
}

.detail-tile strong {
  display: block;
  margin-top: 10px;
  font-size: 20px;
}

.detail-action {
  width: auto;
  margin-top: 18px;
}

.sync-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.login-page {
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--bg);
  color: var(--ink);
}

.login-shell {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(320px, 420px);
  gap: 24px;
  width: min(960px, 100%);
  align-items: stretch;
}

.login-brand,
.login-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
}

.login-brand {
  min-height: 520px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 36px;
  background:
    linear-gradient(135deg, rgba(255, 94, 26, 0.18) 0 1px, transparent 1px 22px),
    var(--rail);
  color: var(--bg);
}

.login-logo {
  width: min(360px, 100%);
  height: auto;
  filter: brightness(0) invert(1);
}

.login-brand p {
  margin-top: 18px;
  color: rgba(218, 217, 217, 0.78);
  font-size: 18px;
  text-transform: uppercase;
}

.login-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 18px;
  padding: 32px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow);
}

.login-panel h1,
.login-panel h2 {
  font-size: 28px;
}

.login-panel p {
  margin-top: 7px;
}

.login-panel label {
  display: grid;
  gap: 7px;
}

.passkey-login-button,
.sso-login-button {
  min-height: 46px;
}

.login-support {
  margin-top: -8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.login-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--subtle);
  font-size: 11px;
  font-weight: 750;
  text-transform: uppercase;
}

.login-divider::before,
.login-divider::after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--line);
}

.login-error {
  color: var(--bad);
  font-size: 13px;
  font-weight: 700;
}

@media (max-width: 1100px) {
  .app-shell {
    grid-template-columns: 82px minmax(0, 1fr);
  }

  .rail-item span,
  .rail-footer {
    display: none;
  }

  .domain-switch {
    width: 100%;
  }

  .workspace-domain-switch {
    min-width: 220px;
  }

  .domain-button {
    min-height: 30px;
    padding: 0;
    font-size: 11px;
  }

  .brand-logo {
    width: 42px;
    max-width: none;
  }

  .side-rail {
    padding: 20px 14px;
    align-items: center;
  }

  .rail-item {
    justify-content: center;
    padding: 12px;
  }

  .kpi-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .finance-page .kpi-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-grid,
  .work-page,
  .work-hero,
  .workbench-hero,
  .workbench-mail-workspace,
  .work-signal-strip,
  .work-mail-manager-grid,
  .work-mail-admin-grid,
  .mail-hygiene-toolbar,
  .work-mail-grid,
  .work-slack-grid,
  .work-ai-grid,
  .gmail-config-layout,
  .gmail-config-bulk-actions,
  .gmail-add-account-fields,
  .gmail-config-fields,
  .mail-rule-form,
  .mail-rule-fields,
  .work-mail-manage-stats,
  .priority-person-form,
  .work-mail-load-summary,
  .work-action-form,
  .reply-composer,
  .work-runtime-settings-grid {
    grid-template-columns: 1fr;
  }

  .workbench-page,
  .workbench-mail-workspace {
    grid-template-columns: 1fr;
  }

  .workbench-page .workbench-actions-panel,
  .workbench-page .workbench-mail-panel,
  .workbench-page .workbench-focus-panel {
    grid-column: 1;
  }

  .daily-priority-list,
  .company-focus-strip,
  .daily-priority-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .company-focus-metrics,
  .company-focus-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .audit-page {
    grid-template-columns: 1fr;
  }

  .annual-grid {
    grid-template-columns: 1fr;
  }

  .chart-panel,
  .entity-panel,
  .scenario-panel,
  .contribution-panel,
  .performance-panel,
  .watch-panel,
  .trend-panel,
  .equity-panel,
  .work-focus-panel,
  .work-actions-panel,
  .work-mail-panel,
  .work-mail-load-panel,
  .work-slack-panel,
  .work-automation-panel,
  .workbench-actions-panel,
  .workbench-mail-panel,
  .workbench-focus-panel,
  .workbench-slack-panel,
  .workbench-automation-panel,
  .workbench-signals-panel,
  .workbench-board-panel,
  .work-action-composer-panel,
  .audit-type-panel,
  .audit-entity-panel,
  .audit-issue-panel {
    grid-column: 1;
  }
}

@media (max-width: 760px) {
  .app-shell {
    display: block;
  }

  .side-rail {
    position: static;
    width: 100%;
    height: auto;
    flex-direction: row;
    justify-content: space-between;
    overflow-x: auto;
  }

  .rail-nav {
    display: flex;
    margin-top: 0;
  }

  .domain-switch {
    display: flex;
    flex: 0 0 auto;
    width: auto;
    margin-top: 0;
  }

  .domain-button {
    min-width: 74px;
    padding: 0 10px;
  }

  .brand {
    flex: 0 0 auto;
  }

  .workspace {
    padding: 12px;
  }

  .workspace-domain-bar {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
  }

  .workspace-domain-switch {
    width: 100%;
    min-width: 0;
  }

  .workspace-domain-tools {
    flex-wrap: wrap;
  }

  /* De rail schuift als menu over de pagina in plaats van als strook erboven
     te blijven staan. Zo kost de navigatie geen hoogte meer, en is er ruimte
     om de secties mét label te tonen. */
  .btn.nav-toggle {
    display: grid;
    flex: 0 0 auto;
  }

  .workspace-domain-bar {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
  }

  .workspace-domain-heading {
    flex: 1 1 auto;
    min-width: 0;
  }

  .workspace-domain-tools {
    flex: 1 0 100%;
  }

  /* De pagina eronder mag niet meescrollen zolang het menu open staat. */
  body.nav-open {
    overflow: hidden;
  }

  .nav-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 30;
    background: rgba(36, 33, 36, 0.45);
  }

  .side-rail {
    position: fixed;
    z-index: 31;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(84vw, 320px);
    height: 100%;
    flex-direction: column;
    justify-content: flex-start;
    gap: 14px;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 18px 14px;
    transform: translateX(-100%);
    /* Dicht staat het menu niet alleen uit beeld maar ook uit de tabvolgorde;
       anders belandt een toetsenbordgebruiker in een paneel dat hij niet ziet.
       De vertraging op visibility laat het uitschuiven eerst afmaken. */
    visibility: hidden;
    transition: transform 0.18s ease-out, visibility 0s linear 0.18s;
  }

  body.nav-open .side-rail {
    transform: translateX(0);
    visibility: visible;
    transition: transform 0.18s ease-out, visibility 0s;
  }

  .rail-nav {
    flex-direction: column;
    gap: 2px;
    width: 100%;
  }

  /* In het menu is er wel ruimte voor de namen van de secties. */
  .rail-item {
    justify-content: flex-start;
    gap: 10px;
    width: 100%;
    padding: 11px 12px;
  }

  .rail-item span {
    display: block;
  }

  .rail-domain-slot:not(:empty) {
    width: 100%;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(218, 217, 217, 0.22);
  }

  /* In het menu staan de domeinen als blokje van twee bij twee; naast elkaar
     passen ze niet in de breedte van het paneel. De opmaak eromheen is op een
     lichte achtergrond gemaakt, dus kleur en rand moeten hier omgekeerd. */
  .rail-domain-slot .workspace-domain-switch {
    display: grid;
    /* .domain-switch vult standaard kolommen; hier moeten de knoppen juist
       doorlopen naar een tweede regel. */
    grid-auto-flow: row;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
    width: 100%;
    min-width: 0;
    margin-top: 0;
    border-color: rgba(218, 217, 217, 0.22);
    background: rgba(218, 217, 217, 0.08);
  }

  .rail-domain-slot .workspace-domain-switch .domain-button {
    min-width: 0;
    padding: 0 8px;
  }

  .rail-domain-slot .workspace-domain-switch .domain-button:not(.is-active) {
    color: var(--rail-muted);
  }

  .rail-domain-slot .workspace-domain-switch .domain-button:not(.is-active):hover {
    color: #fff;
  }

  .rail-footer {
    display: block;
    margin-top: auto;
  }

  .brand {
    flex: 0 0 auto;
    width: 100%;
  }


  .topbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
  }

  h1 {
    font-size: 34px;
    line-height: 0.96;
  }

  .topbar-context p {
    font-size: 14px;
  }

  .topbar-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    overflow: visible;
    padding-bottom: 0;
  }

  .select-shell,
  .select-shell select,
  .topbar-actions form,
  .account-button,
  .icon-button {
    width: 100%;
    min-width: 0;
  }

  .icon-button,
  .account-button {
    margin-top: 0;
  }

  .dashboard-grid,
  .work-page {
    gap: 12px;
  }

  .cash-panel {
    order: 0;
  }

  .kpi-row {
    order: 1;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .watch-panel,
  .performance-panel,
  .trend-panel {
    order: 2;
  }

  .panel {
    padding: 14px;
  }

  .panel-heading {
    gap: 10px;
    margin-bottom: 14px;
  }

  .cash-panel .panel-heading {
    flex-direction: column;
  }

  .cash-panel .panel-heading .text-button {
    width: 100%;
  }

  .kpi-card {
    min-height: 106px;
    padding: 12px;
  }

  .kpi-card strong {
    margin-top: 14px;
    font-size: 23px;
    white-space: normal;
  }

  .cash-total {
    padding: 12px;
  }

  .cash-total.is-primary strong {
    font-size: 32px;
  }

  .cash-balances {
    grid-template-columns: 1fr;
  }

  .cash-balance {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .cash-balance > div:last-child {
    width: 100%;
    text-align: left;
  }

  .cash-balance > div:last-child strong {
    font-size: 22px;
    white-space: normal;
  }

  .status-strip,
  .kpi-row,
  .annual-card-header,
  .work-hero,
  .workbench-hero,
  .workbench-mail-workspace,
  .work-signal-strip,
  .work-mail-grid,
  .work-mail-manager-grid,
  .work-mail-admin-grid,
  .mail-hygiene-toolbar,
  .work-slack-grid,
  .work-ai-grid,
  .gmail-config-layout,
  .gmail-config-bulk-actions,
  .gmail-add-account-fields,
  .gmail-config-fields,
  .mail-rule-form,
  .mail-rule-fields,
  .work-mail-manage-stats,
  .priority-person-form,
  .work-action-form,
  .reply-composer,
  .work-runtime-settings-grid,
  .work-board-preview,
  .work-board-full,
  .work-action-status,
  .work-archive-grid,
  .performance-totals,
  .equity-totals,
  .open-item-totals,
  .private-current-totals,
  .convenant-totals,
  .convenant-bars,
  .audit-totals,
  .scenario-totals,
  .security-totals,
  .security-passkey,
  .trend-grid,
  .watch-grid,
  .audit-type-list,
  .audit-issue-grid,
  .cash-summary,
  .pl-summary,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .kpi-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .finance-page .kpi-row {
    grid-template-columns: 1fr;
  }

  .scenario-form {
    grid-template-columns: 1fr;
  }

  .mail-reader-navigation,
  .recurring-mail-group {
    grid-template-columns: 1fr;
  }

  .mail-reader-navigation span,
  .recurring-mail-actions {
    text-align: left;
    justify-content: flex-start;
  }

  .workspace {
    padding: 10px;
  }

  .work-mail-reader-panel {
    position: static;
    max-height: none;
    overflow: visible;
  }

  .work-mail-main .priority-mail-list {
    max-height: none;
  }

  .work-mail-manager-hero {
    grid-template-columns: 1fr;
  }

  .work-page,
  .workbench-page,
  .workbench-hero,
  .workbench-mail-workspace,
  .work-signal-strip,
  .work-mail-manager-grid,
  .work-mail-manager-hero,
  .work-mail-manage-stats,
  .gmail-config-layout,
  .work-board-preview,
  .work-board-full,
  .reply-composer {
    grid-template-columns: 1fr;
  }

  .daily-priority-list,
  .company-focus-strip,
  .company-focus-metrics,
  .action-focus-summary,
  .daily-priority-list,
  .company-focus-strip,
  .company-focus-metrics,
  .action-focus-summary,
  .daily-priority-item {
    grid-template-columns: 1fr;
  }

  .daily-priority-actions {
    justify-content: stretch;
  }

  .daily-priority-actions .account-button,
  .daily-priority-actions .text-button {
    flex: 1 1 auto;
  }

  .login-shell {
    grid-template-columns: 1fr;
  }

  .login-brand {
    min-height: 260px;
  }
}

@media (max-width: 1100px) {
  body[data-section="invoices"] .app-shell {
    grid-template-columns: 82px minmax(0, 1fr);
  }

  body[data-section="invoices"] .side-rail {
    padding: 20px 14px;
  }

  body[data-section="invoices"] .brand-logo {
    width: 42px;
  }

  body[data-section="invoices"] .rail-item {
    justify-content: center;
    padding: 10px;
  }

  body[data-section="invoices"] .finance-invoice-workspace {
    grid-template-columns: minmax(250px, 310px) minmax(0, 1fr);
  }

  body[data-section="invoices"] .finance-invoice-edit-form,
  body[data-section="invoices"] .finance-invoice-map-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  body[data-section="invoices"] .app-shell {
    display: block;
    height: auto;
    min-height: 100vh;
  }

  body[data-section="invoices"] .side-rail {
    padding: 10px;
  }

  body[data-section="invoices"] .workspace {
    height: auto;
    min-height: 100vh;
    grid-template-rows: auto auto 0 auto;
    overflow: visible;
    padding: 8px;
  }

  body[data-section="invoices"] .workspace-domain-bar {
    gap: 6px;
  }

  body[data-section="invoices"] .topbar,
  body[data-section="invoices"] .topbar-actions {
    min-height: 0;
  }

  body[data-section="invoices"] .finance-invoices-page,
  body[data-section="invoices"] .finance-invoice-panel {
    height: auto;
    overflow: visible;
  }

  body[data-section="invoices"] .finance-invoice-panel {
    display: grid;
    grid-template-rows: auto;
  }

  body[data-section="invoices"] .finance-invoice-panel .panel-heading {
    align-items: stretch;
  }

  body[data-section="invoices"] .finance-control-card {
    grid-template-columns: 1fr;
  }

  body[data-section="invoices"] .finance-invoice-stats,
  body[data-section="invoices"] .finance-control-values {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body[data-section="invoices"] .finance-invoice-workspace {
    grid-template-columns: 1fr;
    height: auto;
  }

  body[data-section="invoices"] .finance-invoice-sidebar {
    height: min(48vh, 480px);
  }

  body[data-section="invoices"] .finance-invoice-detail {
    height: auto;
    max-height: none;
    overflow: visible;
  }

}
