/* Work-Place — framework-free application styles */

:root {
  color-scheme: light;
  /* Work-Place foundations are semantic rather than department or feature
     specific, so the same calm system works across tasks, calendars, People,
     meetings and administration. */
  --wp-brand-red: #D2233C;
  --wp-action-red: #AE1730;
  --wp-action-red-hover: #8D1025;
  --wp-brand-soft: #FBEAED;
  --wp-brand-soft-hover: #F7DDE2;
  --wp-brand-border: #E2C4CB;
  --wp-canvas: #F8F7F4;
  --wp-canvas-tint: #F0EEEA;
  --wp-surface: #FFFFFF;
  --wp-surface-raised: #FCFBF9;
  --wp-surface-hover: #F5F1ED;
  --wp-ink: #171717;
  --wp-ink-soft: #53514E;
  --wp-ink-faint: #6D6964;
  --wp-line: #E5E1DC;
  --wp-line-strong: #C9C2B9;
  --wp-success: #2F6A50;
  --wp-success-soft: #EAF4EE;
  --wp-success-border: #B9D7C5;
  --wp-success-ink: #275D46;
  --wp-warning: #99600E;
  --wp-warning-soft: #FFF3DE;
  --wp-warning-ink: #75480A;
  --wp-danger: #B4233A;
  --wp-danger-soft: #FCECEF;
  --wp-danger-ink: #842038;
  --wp-info: #2C5E81;
  --wp-info-soft: #EAF2F7;
  --wp-info-border: #BDCFDC;
  --wp-busy: #4C5B66;
  --wp-busy-soft: #EEF1F3;
  --wp-busy-border: #C9D2D7;
  --wp-busy-ink: #3E4B54;
  --wp-absence: #4D5C59;
  --wp-absence-soft: #EDF2F0;
  --wp-absence-border: #C9D5D0;
  --wp-absence-ink: #405853;
  --wp-holiday: #665882;
  --wp-holiday-soft: #F3EFF8;
  --wp-holiday-border: #D7CEE5;
  --wp-holiday-ink: #57466E;
  --wp-overlay: rgb(23 23 23 / 56%);
  --wp-focus: #8D1025;
  --wp-focus-ring: 0 0 0 3px rgb(174 23 48 / 30%);
  --wp-shadow-sm: 0 1px 2px rgb(23 23 23 / 7%);
  --wp-shadow: 0 10px 24px rgb(23 23 23 / 10%);
  --wp-shadow-lg: 0 20px 48px rgb(23 23 23 / 17%);
  --wp-space-1: 4px;
  --wp-space-2: 8px;
  --wp-space-3: 12px;
  --wp-space-4: 16px;
  --wp-space-6: 24px;
  --wp-space-8: 32px;
  --wp-space-12: 48px;
  --wp-radius-sm: 10px;
  --wp-radius: 12px;
  --wp-radius-lg: 16px;

  /* Existing selectors consume these compatibility aliases.  This keeps the
     change safe across the whole current application while retiring the former
     teal/evergreen/gold visual direction from rendered surfaces. */
  --canvas: var(--wp-canvas);
  --canvas-tint: var(--wp-canvas-tint);
  --surface: var(--wp-surface);
  --surface-muted: var(--wp-canvas-tint);
  --surface-raised: var(--wp-surface-raised);
  --surface-hover: var(--wp-surface-hover);
  --ink: var(--wp-ink);
  --ink-soft: var(--wp-ink-soft);
  --ink-faint: var(--wp-ink-faint);
  --line: var(--wp-line);
  --line-strong: var(--wp-line-strong);
  --brand: var(--wp-action-red);
  --brand-dark: var(--wp-action-red-hover);
  --brand-soft: var(--wp-brand-soft);
  --blue: var(--wp-info);
  --blue-soft: var(--wp-info-soft);
  --violet: var(--wp-holiday);
  --violet-soft: var(--wp-holiday-soft);
  --amber: var(--wp-warning);
  --amber-soft: var(--wp-warning-soft);
  --red: var(--wp-danger);
  --red-soft: var(--wp-danger-soft);
  --green: var(--wp-success);
  --green-soft: var(--wp-success-soft);
  --sidebar: #171717;
  --sidebar-raised: #262626;
  --sidebar-text: #FFFDF9;
  --sidebar-muted: #CCC5BD;
  --sidebar-hover: rgb(255 255 255 / 8%);
  --sidebar-selected: rgb(210 35 60 / 18%);
  /* Compatibility aliases for established priority selectors; neither is a
     product accent any more. */
  --accent-gold: var(--wp-warning);
  --accent-terracotta: var(--wp-brand-red);
  --overlay: var(--wp-overlay);
  --absence: var(--wp-absence);
  --absence-soft: var(--wp-absence-soft);
  --holiday: var(--wp-holiday);
  --holiday-soft: var(--wp-holiday-soft);
  --danger-border: #E7B8C0;
  --warning-border: #E7C98E;
  --calendar-today: #FDEFF1;
  --focus-outline: var(--wp-focus);
  --focus-ring: var(--wp-focus-ring);
  --shadow-sm: var(--wp-shadow-sm);
  --shadow: var(--wp-shadow);
  --shadow-lg: var(--wp-shadow-lg);
  --radius-sm: var(--wp-radius-sm);
  /* A handful of newer collaboration surfaces use the medium alias.  Keep it
     explicit so their border-radius declarations never fall back to square. */
  --radius-md: var(--wp-radius);
  --radius: var(--wp-radius);
  --radius-lg: var(--wp-radius-lg);
  --danger: var(--red);
  --sidebar-width: 252px;
  --content-width: 1600px;
  font-family: "Segoe UI Variable", "Segoe UI", Inter, system-ui, -apple-system,
    BlinkMacSystemFont, sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

/* Author display rules (notably `.button { display:inline-flex }`) otherwise
   override the browser's hidden treatment. Keep every semantic hidden state
   out of both the visual layout and keyboard flow. */
[hidden] { display: none !important; }

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--canvas);
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-size: max(var(--wp-min-text, 0px), calc(14px * var(--wp-text-scale, 1)));
  line-height: 1.45;
}

/* First-run and sign-in screens intentionally share the same calm visual
   language as the planner, while remaining usable before JavaScript loads. */
.auth-shell {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 32px 20px;
  background: var(--canvas);
}

.auth-card {
  width: min(100%, 450px);
  padding: 34px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

.auth-card.wide { width: min(100%, 540px); }
.auth-card h1 { margin: 4px 0 10px; font-size: clamp(25px, 3vw, 32px); letter-spacing: -0.035em; }
.auth-card .muted { margin: 0 0 24px; }
.auth-card form { display: grid; gap: 15px; }
.auth-card label { display: grid; gap: 6px; color: var(--ink-soft); font-size: max(var(--wp-min-text, 0px), calc(12px * var(--wp-text-scale, 1))); font-weight: 690; }
.auth-card input {
  width: 100%;
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-raised);
  color: var(--ink);
}
.auth-card input:focus { border-color: var(--brand); outline: 0; box-shadow: var(--focus-ring); }
.auth-card .remember-device {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  column-gap: 9px;
  row-gap: 3px;
  align-items: start;
  cursor: pointer;
}
.auth-card .remember-device input {
  width: 18px;
  min-height: 18px;
  margin: 1px 0 0;
  padding: 0;
  accent-color: var(--brand);
}
.auth-card .remember-device span { line-height: 1.35; }
.auth-card .remember-device small {
  grid-column: 2;
  color: var(--ink-faint);
  font-size: max(var(--wp-min-text, 0px), calc(12px * var(--wp-text-scale, 1)));
  font-weight: 500;
  line-height: 1.4;
}
.form-help, .auth-footnote { margin: 0; color: var(--ink-faint); font-size: max(var(--wp-min-text, 0px), calc(12px * var(--wp-text-scale, 1))); }
.auth-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; }
.form-error { margin: 0; padding: 9px 11px; border-radius: var(--radius-sm); color: #8f2630; background: var(--red-soft); font-size: max(var(--wp-min-text, 0px), calc(12px * var(--wp-text-scale, 1))); }

button,
input,
select,
textarea {
  font: inherit;
}

button,
select {
  cursor: pointer;
}

button:disabled,
input:disabled,
select:disabled,
textarea:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

a {
  color: var(--brand-dark);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

::selection {
  background: #cce8e6;
  color: var(--ink);
}

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

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100dvh;
  overflow-y: auto;
  padding: 22px 14px 16px;
  background: var(--sidebar);
  color: var(--sidebar-text);
  border-right: 1px solid rgb(255 255 255 / 8%);
}

.brand-lockup {
  display: flex;
  align-items: center;
  padding: 4px 10px 22px;
  color: #fff;
  line-height: 1.15;
}

.brand-lockup-image {
  display: block;
  width: min(100%, 182px);
  height: auto;
  max-height: 38px;
  object-fit: contain;
  object-position: left center;
}

.brand-mark-image {
  display: none;
  width: 30px;
  height: 30px;
  object-fit: contain;
}

.brand-lockup:hover,
.brand-lockup:focus-visible {
  color: #fff;
  text-decoration: none;
}

.brand-lockup strong {
  font-size: max(var(--wp-min-text, 0px), calc(16px * var(--wp-text-scale, 1)));
  font-weight: 760;
  letter-spacing: -0.02em;
}

.brand-kicker {
  color: var(--sidebar-muted);
  font-size: max(var(--wp-min-text, 0px), calc(9px * var(--wp-text-scale, 1)));
  font-weight: 760;
  letter-spacing: 0.1em;
}

.brand,
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 10px 22px;
  color: #fff;
  font-size: max(var(--wp-min-text, 0px), calc(17px * var(--wp-text-scale, 1)));
  font-weight: 760;
  letter-spacing: -0.02em;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  border-radius: 9px;
  background: var(--surface-raised);
  color: var(--brand);
  font-size: max(var(--wp-min-text, 0px), calc(15px * var(--wp-text-scale, 1)));
  font-weight: 800;
  box-shadow: inset 0 1px rgb(255 255 255 / 32%);
}

.sidebar-section {
  margin: 15px 10px 7px;
  color: var(--sidebar-muted);
  font-size: max(var(--wp-min-text, 0px), calc(10px * var(--wp-text-scale, 1)));
  font-weight: 760;
  letter-spacing: 0.095em;
  text-transform: uppercase;
}

.sidebar nav,
.nav-list {
  display: grid;
  gap: 3px;
}

.navigation-group {
  display: grid;
  gap: 4px;
}

.navigation-group + .navigation-group {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgb(255 255 255 / 9%);
}

.navigation-group-label {
  margin: 0 10px 2px;
  color: var(--sidebar-muted);
  font-size: max(var(--wp-min-text, 0px), calc(9px * var(--wp-text-scale, 1)));
  font-weight: 760;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.navigation-group-links {
  display: grid;
  gap: 3px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 39px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: #E6E2DC;
  font-weight: 600;
  line-height: 1.2;
  transition: background-color 150ms ease, color 150ms ease, border-color 150ms ease;
}

.nav-link:hover {
  background: var(--sidebar-hover);
  color: #fff;
  text-decoration: none;
}

.nav-link.active,
.nav-link[aria-current="page"] {
  border-color: rgb(210 35 60 / 42%);
  background: var(--sidebar-selected);
  color: var(--sidebar-text);
}

.nav-link .nav-icon {
  display: inline-grid;
  flex: 0 0 18px;
  place-items: center;
  width: 18px;
  color: #D3CDC6;
  text-align: center;
}

.nav-link .nav-count {
  min-width: 20px;
  margin-left: auto;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgb(255 255 255 / 10%);
  color: var(--sidebar-text);
  font-size: max(var(--wp-min-text, 0px), calc(11px * var(--wp-text-scale, 1)));
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.sidebar-footer {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: auto;
  padding: 17px 8px 3px;
  border-top: 1px solid rgb(255 255 255 / 9%);
  color: var(--sidebar-text);
}

.sidebar-footer small {
  display: block;
  margin-top: 1px;
  color: var(--sidebar-muted);
}

.main-panel,
.app-main {
  min-width: 0;
}

.app-main {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
}

.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  align-items: center;
  min-height: 70px;
  gap: 16px;
  padding: 12px clamp(20px, 3.2vw, 48px);
  border-bottom: 1px solid var(--line);
  background: rgb(255 255 255 / 92%);
  backdrop-filter: blur(13px);
}

.topbar-title {
  min-width: 0;
}

.topbar-title h1,
.page-title {
  margin: 0;
  color: var(--ink);
  font-size: clamp(20px, 2.2vw, 26px);
  font-weight: 730;
  letter-spacing: -0.035em;
  line-height: 1.12;
}

.topbar-title p,
.page-subtitle {
  margin: 4px 0 0;
  color: var(--ink-soft);
  font-size: max(var(--wp-min-text, 0px), calc(12px * var(--wp-text-scale, 1)));
}

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

.topbar-context {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  min-width: 0;
  color: var(--ink-soft);
  font-size: max(var(--wp-min-text, 0px), calc(12px * var(--wp-text-scale, 1)));
  font-weight: 650;
}

.live-uk-clock {
  display: inline-block;
  min-width: 25ch;
  color: var(--brand-dark);
  font-size: clamp(14px, 1.15vw, 16px);
  font-variant-numeric: tabular-nums;
  font-weight: 760;
  letter-spacing: 0.035em;
  line-height: 1;
  text-align: left;
  white-space: nowrap;
}

.content {
  position: relative;
  width: min(100%, var(--content-width));
  height: 100%;
  min-height: 0;
  margin: 0 auto;
  padding: clamp(20px, 3vw, 38px) clamp(20px, 3.2vw, 48px) 48px;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.background-refresh-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  margin: 0 0 14px;
  padding: 10px 12px;
  border: 1px solid var(--warning-border);
  border-radius: 9px;
  background: var(--amber-soft);
  box-shadow: 0 4px 14px rgb(45 34 12 / 7%);
}

.background-refresh-banner[hidden] { display: none; }

.background-refresh-banner > div {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.background-refresh-banner strong { color: var(--ink); font-size: max(var(--wp-min-text, 0px), calc(12px * var(--wp-text-scale, 1))); }
.background-refresh-banner span { color: var(--ink-soft); font-size: max(var(--wp-min-text, 0px), calc(11px * var(--wp-text-scale, 1))); line-height: 1.4; }
.background-refresh-banner small { color: var(--ink-faint); font-size: max(var(--wp-min-text, 0px), calc(10px * var(--wp-text-scale, 1))); overflow-wrap: anywhere; }
.background-refresh-banner .button { flex: 0 0 auto; }

/* Chat is an application workspace, so it should fill the available main
   column instead of inheriting the centred reading measure used by document
   pages.  Its own panes still retain their deliberately bounded scroll areas. */
.content--chat-workspace {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: 100%;
  margin-inline: 0;
  overflow: hidden;
}

.page-stack {
  display: grid;
  min-width: 0;
  gap: 20px;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.page-header > div:first-child { min-width: 0; }

.page-header h1 {
  margin: 3px 0 0;
  color: var(--ink);
  font-size: clamp(24px, 2.8vw, 32px);
  font-weight: 760;
  letter-spacing: -0.04em;
  line-height: 1.12;
  scroll-margin-top: 16px;
}

.eyebrow {
  margin: 0;
  color: var(--brand-dark);
  font-size: max(var(--wp-min-text, 0px), calc(10px * var(--wp-text-scale, 1)));
  font-weight: 790;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.page-description {
  max-width: 760px;
  margin: 8px 0 0;
  color: var(--ink-soft);
  font-size: max(var(--wp-min-text, 0px), calc(13px * var(--wp-text-scale, 1)));
}

.page-actions {
  display: flex;
  flex: 0 1 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.role-badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 3px 7px;
  border: 1px solid rgb(255 255 255 / 20%);
  border-radius: 999px;
  background: rgb(255 255 255 / 8%);
  color: var(--sidebar-text);
  font-size: max(var(--wp-min-text, 0px), calc(9px * var(--wp-text-scale, 1)));
  font-weight: 760;
  letter-spacing: 0.035em;
  white-space: nowrap;
}

.page-heading,
.section-heading,
.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.page-heading {
  margin-bottom: 22px;
}

.section-heading {
  margin: 28px 0 12px;
}

.section-heading h2,
.card-header h2,
.card-header h3 {
  margin: 0;
  color: var(--ink);
  font-size: max(var(--wp-min-text, 0px), calc(15px * var(--wp-text-scale, 1)));
  font-weight: 720;
  letter-spacing: -0.015em;
}

.section-heading p,
.card-header p {
  margin: 3px 0 0;
  color: var(--ink-soft);
  font-size: max(var(--wp-min-text, 0px), calc(12px * var(--wp-text-scale, 1)));
}

.card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.card-header {
  min-height: 58px;
  padding: 17px 19px;
  border-bottom: 1px solid var(--line);
}

.card-body {
  padding: 18px 19px;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 19px;
  border-top: 1px solid var(--line);
  background: var(--surface-muted);
  border-radius: 0 0 var(--radius) var(--radius);
}

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

.metric-card {
  position: relative;
  min-width: 0;
  padding: 17px 18px 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.metric-card::after {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 3px;
  background: var(--brand);
  content: "";
  opacity: 0;
}

.metric-card.accent-brand::after,
.metric-card:first-child::after {
  opacity: 1;
}

.metric-card.accent-amber::after { background: var(--amber); opacity: 1; }
.metric-card.accent-red::after { background: var(--red); opacity: 1; }
.metric-card.accent-green::after { background: var(--green); opacity: 1; }
.metric-card.accent-blue::after { background: var(--blue); opacity: 1; }

.metric-label {
  display: block;
  color: var(--ink-soft);
  font-size: max(var(--wp-min-text, 0px), calc(12px * var(--wp-text-scale, 1)));
  font-weight: 650;
}

.metric-value {
  display: block;
  margin-top: 7px;
  color: var(--ink);
  font-size: clamp(24px, 2.5vw, 31px);
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.045em;
  line-height: 1;
}

.metric-detail,
.metric-trend {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 10px;
  color: var(--ink-soft);
  font-size: max(var(--wp-min-text, 0px), calc(11px * var(--wp-text-scale, 1)));
}

.metric-trend.positive { color: var(--green); }
.metric-trend.negative { color: var(--red); }

.layout-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(280px, 0.8fr);
  gap: 18px;
}

.stack {
  display: grid;
  gap: 18px;
}

.task-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.task-list--series-grouped {
  display: grid;
}

.series-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px 18px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: #f9fbfc;
}

.series-summary:last-child {
  border-bottom: 0;
}

.series-summary-main {
  min-width: 0;
}

.series-summary-title {
  display: block;
  overflow: hidden;
  color: var(--ink);
  font-weight: 730;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.series-summary-meta,
.series-summary-actions {
  display: flex;
  align-items: center;
  gap: 7px;
}

.series-summary-meta {
  flex-wrap: wrap;
  margin-top: 6px;
  color: var(--ink-soft);
  font-size: max(var(--wp-min-text, 0px), calc(11px * var(--wp-text-scale, 1)));
}

.series-summary-meta > span:not(.recurring-pill) + span:not(.recurring-pill)::before {
  margin-right: 7px;
  color: var(--ink-faint);
  content: '·';
}

.series-summary-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.series-occurrences {
  grid-column: 1 / -1;
  margin: 0 -18px -14px;
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.series-occurrences[hidden] {
  display: none;
}

.series-occurrences .task-row {
  min-height: 62px;
  padding-right: 22px;
  padding-left: 22px;
  background: var(--surface);
}

.task-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 69px;
  padding: 11px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  transition: background-color 150ms ease;
}

.task-row--compact {
  grid-template-columns: minmax(0, 1fr) auto;
}

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

.task-row:hover {
  background: #fbfcfd;
}

.task-row.is-important {
  box-shadow: inset 3px 0 0 var(--amber);
}

.task-row--high {
  box-shadow: inset 4px 0 0 var(--amber);
}

.task-row--critical {
  border-left: 4px solid var(--red);
  background: var(--red-soft);
  box-shadow: inset 4px 0 0 var(--red), 0 0 0 1px rgb(180 35 58 / 10%);
}

.task-row.is-blocked {
  background: #fffafa;
  box-shadow: inset 3px 0 0 var(--red);
}

.task-row.is-overdue {
  background: #fff9f9;
  box-shadow: inset 3px 0 0 var(--red);
}

.task-row.is-completed,
.task-row[data-status="completed"] {
  background: var(--surface-muted);
}

.task-row.is-completed .task-title,
.task-row[data-status="completed"] .task-title {
  color: var(--ink-faint);
  text-decoration: line-through;
}

.task-check {
  width: 19px;
  height: 19px;
  margin: 0 1px 0 0;
  accent-color: var(--brand);
}

.task-main {
  min-width: 0;
}

.task-title {
  display: block;
  overflow: hidden;
  color: var(--ink);
  font-weight: 680;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-meta,
.task-meta span {
  display: flex;
  align-items: center;
  gap: 6px;
}

.task-meta {
  flex-wrap: wrap;
  margin-top: 4px;
  color: var(--ink-soft);
  font-size: max(var(--wp-min-text, 0px), calc(11px * var(--wp-text-scale, 1)));
}

.task-actions,
.task-state {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
}

.status-pill,
.priority-pill,
.visibility-pill,
.access-pill,
.tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 22px;
  gap: 4px;
  padding: 3px 8px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: max(var(--wp-min-text, 0px), calc(10px * var(--wp-text-scale, 1)));
  font-weight: 730;
  letter-spacing: 0.015em;
  line-height: 1.1;
  white-space: nowrap;
}

.status-pill,
.status-open,
.status-pending,
[data-status="open"] .status-pill,
[data-status="pending"] .status-pill {
  border-color: var(--wp-info-border);
  background: var(--blue-soft);
  color: var(--blue);
}

.status-in-progress,
.status-active,
[data-status="in-progress"] .status-pill,
[data-status="active"] .status-pill {
  border-color: var(--wp-info-border);
  background: var(--blue-soft);
  color: var(--blue);
}

.status-blocked,
.is-blocked .status-pill,
[data-status="blocked"] .status-pill {
  border-color: var(--danger-border);
  background: var(--red-soft);
  color: var(--wp-danger-ink);
}

.status-completed,
.status-done,
.is-completed .status-pill,
[data-status="completed"] .status-pill,
[data-status="done"] .status-pill {
  border-color: var(--wp-success-border);
  background: var(--green-soft);
  color: var(--wp-success-ink);
}

.status-overdue,
.is-overdue .status-pill,
[data-status="overdue"] .status-pill {
  border-color: var(--danger-border);
  background: var(--red-soft);
  color: var(--wp-danger-ink);
}

.priority-pill {
  border-color: var(--line);
  background: var(--surface-muted);
  color: var(--ink-soft);
}

.priority-high,
.priority-urgent,
.is-important .priority-pill,
[data-priority="high"] .priority-pill,
[data-priority="urgent"] .priority-pill {
  border-color: var(--warning-border);
  background: var(--amber-soft);
  color: var(--wp-warning-ink);
}

.priority-critical,
[data-priority="critical"] .priority-pill {
  border-color: var(--danger-border);
  background: var(--red-soft);
  color: var(--wp-danger-ink);
}

.priority-low,
[data-priority="low"] .priority-pill {
  border-color: var(--line);
  background: var(--surface-muted);
  color: var(--ink-soft);
}

.auto-visible-pill {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 3px 8px;
  border: 1px solid var(--wp-brand-border);
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-size: max(var(--wp-min-text, 0px), calc(10px * var(--wp-text-scale, 1)));
  font-weight: 760;
  letter-spacing: 0.01em;
  line-height: 1.1;
  white-space: nowrap;
}

.owner-unavailable-pill {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 3px 8px;
  border: 1px solid var(--warning-border);
  border-radius: 999px;
  background: var(--amber-soft);
  color: var(--wp-warning-ink);
  font-size: max(var(--wp-min-text, 0px), calc(10px * var(--wp-text-scale, 1)));
  font-weight: 760;
  letter-spacing: 0.01em;
  line-height: 1.1;
  white-space: nowrap;
}

.owner-unavailable-notice {
  border-color: var(--warning-border);
  background: var(--amber-soft);
  color: var(--wp-warning-ink);
}

.recurring-pill {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 3px 8px;
  border: 1px solid var(--wp-holiday-border);
  border-radius: 999px;
  background: var(--holiday-soft);
  color: var(--wp-holiday-ink);
  font-size: max(var(--wp-min-text, 0px), calc(10px * var(--wp-text-scale, 1)));
  font-weight: 740;
  letter-spacing: 0.01em;
  line-height: 1.1;
  white-space: nowrap;
}

.department-chip {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  max-width: 170px;
  gap: 5px;
  padding: 3px 8px;
  overflow: hidden;
  border: 1px solid #d2dce7;
  border-radius: 999px;
  background: #f8fafc;
  color: #34495f;
  font-size: max(var(--wp-min-text, 0px), calc(10px * var(--wp-text-scale, 1)));
  font-weight: 720;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.department-chip i {
  display: block;
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
}

.task-row-main {
  min-width: 0;
}

.task-title-button {
  display: block;
  max-width: 100%;
  overflow: hidden;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  line-height: 1.3;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-title-button:hover {
  color: var(--brand-dark);
  text-decoration: underline;
}

.task-row-meta,
.task-row-tags,
.recurrence-detail {
  display: flex;
  align-items: center;
  gap: 6px;
}

.task-row-meta {
  flex-wrap: wrap;
  margin-top: 4px;
  color: var(--ink-soft);
  font-size: max(var(--wp-min-text, 0px), calc(11px * var(--wp-text-scale, 1)));
}

.task-row-tags {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.task-series-action {
  justify-self: end;
  white-space: nowrap;
}

.recurrence-detail {
  flex-wrap: wrap;
  margin: 0;
  color: var(--ink-soft);
  font-size: max(var(--wp-min-text, 0px), calc(12px * var(--wp-text-scale, 1)));
}

.series-manager-actions {
  flex-wrap: wrap;
  justify-content: flex-start;
}

.series-preview,
.series-danger-zone {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-muted);
}

.series-preview-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.series-preview h3,
.series-danger-zone h3 {
  margin: 0;
  font-size: max(var(--wp-min-text, 0px), calc(14px * var(--wp-text-scale, 1)));
}

.series-preview-list {
  max-height: 220px;
  overflow: auto;
}

.series-danger-zone {
  border-color: #edc2c5;
  background: #fff7f7;
}

.series-danger-zone p {
  margin: 0;
  color: #774348;
}

.series-stop-button {
  justify-self: start;
  font-weight: 700;
}

.modal-action-error {
  margin: 0;
}

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

.related-task {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-muted);
}

.related-task strong,
.related-task span {
  display: block;
}

.related-task span {
  margin-top: 3px;
  color: var(--ink-soft);
  font-size: max(var(--wp-min-text, 0px), calc(11px * var(--wp-text-scale, 1)));
}

.related-task.is-completed {
  opacity: 0.72;
}

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

.related-task-complete {
  min-height: 30px;
  padding: 5px 9px;
  font-size: max(var(--wp-min-text, 0px), calc(11px * var(--wp-text-scale, 1)));
}

.series-change-list {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.series-change-list li {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-muted);
  color: var(--ink-soft);
  font-size: max(var(--wp-min-text, 0px), calc(12px * var(--wp-text-scale, 1)));
}

.series-change-summary {
  display: grid;
  gap: 8px;
}

.series-change-summary h3 {
  margin: 0;
  color: var(--ink);
  font-size: max(var(--wp-min-text, 0px), calc(13px * var(--wp-text-scale, 1)));
}

.series-change-list strong {
  color: var(--ink);
}

.visibility-pill,
.access-pill {
  border-color: var(--line);
  background: var(--surface-muted);
  color: var(--ink-soft);
}

.visibility-private,
.private .visibility-pill,
.private.access-pill,
[data-visibility="private"] .visibility-pill,
[data-visibility="private"].event {
  border-color: var(--wp-holiday-border);
  background: var(--violet-soft);
  color: var(--wp-holiday-ink);
}

.visibility-team,
.team .visibility-pill,
.team.access-pill,
[data-visibility="team"] .visibility-pill,
[data-visibility="team"].event {
  border-color: var(--wp-brand-border);
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.visibility-manager-only,
.manager-only .visibility-pill,
.manager-only.access-pill,
[data-visibility="manager-only"] .visibility-pill,
[data-visibility="manager-only"].event {
  border-color: #f0d4a9;
  background: var(--amber-soft);
  color: #875409;
}

.due-date,
.deadline {
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}

.due-date.is-overdue,
.is-overdue .due-date,
.deadline.is-overdue,
.is-overdue .deadline {
  color: var(--red);
  font-weight: 700;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
  margin-bottom: 16px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.calendar-filter-bar {
  margin-bottom: 0;
}

.calendar-filter-bar .select {
  min-width: 155px;
}

.department-filter-select {
  min-width: 155px;
  max-height: 78px;
  font-size: max(var(--wp-min-text, 0px), calc(12px * var(--wp-text-scale, 1)));
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 7px;
}

.filter-spacer {
  flex: 1 1 12px;
}

.active-filter-row,
.active-filter-chips {
  display: flex;
  align-items: center;
  gap: 7px;
}

.active-filter-row {
  flex-wrap: wrap;
  margin: -7px 0 2px;
}

.active-filter-label {
  color: var(--ink-soft);
  font-size: max(var(--wp-min-text, 0px), calc(11px * var(--wp-text-scale, 1)));
  font-weight: 700;
}

.active-filter-chips {
  flex-wrap: wrap;
}

.filter-chip {
  min-height: 29px;
  padding: 5px 9px;
  border-color: #c8d7e6;
  background: #f3f7fa;
  color: #405b73;
  font-size: max(var(--wp-min-text, 0px), calc(11px * var(--wp-text-scale, 1)));
}

.filter-chip:hover:not(:disabled) {
  border-color: #9eb5c9;
  background: #e9f1f6;
}

.input,
.select,
.textarea,
.filter-bar input,
.filter-bar select,
.form-control {
  width: 100%;
  min-height: 37px;
  padding: 8px 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  outline: none;
  background: var(--surface);
  color: var(--ink);
  line-height: 1.2;
  transition: border-color 150ms ease, box-shadow 150ms ease, background-color 150ms ease;
}

.input::placeholder,
.textarea::placeholder,
.filter-bar input::placeholder {
  color: #98a5b4;
}

.input:hover,
.select:hover,
.textarea:hover,
.filter-bar input:hover,
.filter-bar select:hover,
.form-control:hover {
  border-color: #aebdca;
}

.input:focus,
.select:focus,
.textarea:focus,
.filter-bar input:focus,
.filter-bar select:focus,
.form-control:focus {
  border-color: var(--brand);
  box-shadow: var(--focus-ring);
}

.textarea {
  min-height: 100px;
  resize: vertical;
}

.search-field {
  position: relative;
  flex: 1 1 210px;
  max-width: 390px;
}

.search-field input {
  padding-left: 34px;
}

.search-field .search-icon {
  position: absolute;
  top: 50%;
  left: 11px;
  color: var(--ink-faint);
  pointer-events: none;
  transform: translateY(-50%);
}

.button,
button.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 37px;
  gap: 7px;
  padding: 8px 12px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: #eef3f6;
  color: #314255;
  font-size: max(var(--wp-min-text, 0px), calc(12px * var(--wp-text-scale, 1)));
  font-weight: 700;
  line-height: 1.1;
  text-align: center;
  transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease,
    box-shadow 150ms ease, transform 150ms ease;
}

.button:hover:not(:disabled),
button.button:hover:not(:disabled) {
  background: #e2ebef;
  text-decoration: none;
}

.button:active:not(:disabled),
button.button:active:not(:disabled) {
  transform: translateY(1px);
}

.button-primary,
.button.primary {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
  box-shadow: 0 1px 2px rgb(13 77 80 / 20%);
}

.button-primary:hover:not(:disabled),
.button.primary:hover:not(:disabled) {
  border-color: var(--brand-dark);
  background: var(--brand-dark);
  color: #fff;
}

.button-secondary,
.button-outline {
  border-color: var(--line-strong);
  background: var(--surface);
  color: #415166;
}

.button-secondary:hover:not(:disabled),
.button-outline:hover:not(:disabled) {
  border-color: #a7b9c6;
  background: #f7fafb;
}

.button-danger {
  border-color: #e6b9bc;
  background: var(--surface);
  color: #a23e46;
}

.button-danger:hover:not(:disabled) {
  border-color: var(--red);
  background: var(--red-soft);
}

.button-ghost {
  background: transparent;
  color: var(--ink-soft);
}

.button-ghost:hover:not(:disabled) {
  background: #edf2f5;
  color: var(--ink);
}

.button-sm {
  min-height: 30px;
  padding: 6px 9px;
  font-size: max(var(--wp-min-text, 0px), calc(11px * var(--wp-text-scale, 1)));
}

.button-icon {
  width: 37px;
  padding: 0;
}

.button-icon.button-sm {
  width: 30px;
}

.calendar {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.calendar-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 17px;
  border-bottom: 1px solid var(--line);
}

.calendar-toolbar h2,
.calendar-toolbar h3 {
  margin: 0;
  font-size: max(var(--wp-min-text, 0px), calc(16px * var(--wp-text-scale, 1)));
  font-weight: 720;
  letter-spacing: -0.02em;
}

.calendar-toolbar-actions,
.calendar-navigation {
  display: flex;
  align-items: center;
  gap: 6px;
}

.month-grid {
  display: block;
}

.calendar-grid-row {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

/* The Day Briefing is a real row in the Month grid, rather than a modal or a
   floating tooltip. It therefore remains visually attached to the week that
   supplied the selected date. */
.calendar-day-briefing-row {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  border-bottom: 1px solid var(--line);
  background: var(--surface-muted);
}

.calendar-day-briefing-row[hidden] { display: none; }

/* Week and Day views have no month-week row to expand beneath, so they use
   one normal-flow outlet immediately after the interactive date surface. */
.calendar-day-briefing-outlet { min-width: 0; }
.calendar-day-briefing-outlet[hidden] { display: none; }
.calendar-day-briefing-outlet:not([hidden]) { padding: 12px; border-top: 1px solid var(--line); background: #f8fbfa; }

.calendar-day-briefing-cell {
  grid-column: 1 / -1;
  min-width: 0;
}

.calendar-day-briefing-panel {
  display: grid;
  gap: 13px;
  padding: 16px 18px 18px;
  border-top: 2px solid var(--brand);
  background: var(--surface);
}

.calendar-day-briefing-panel:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: -3px;
  box-shadow: var(--focus-ring);
}

.calendar-day-briefing-header,
.calendar-day-briefing-heading,
.calendar-day-briefing-tabs,
.calendar-day-briefing-item,
.calendar-day-briefing-item-main,
.calendar-day-briefing-item-tags {
  display: flex;
  align-items: center;
}

.calendar-day-briefing-header {
  justify-content: space-between;
  gap: 12px;
}

.calendar-day-briefing-heading {
  min-width: 0;
  gap: 9px;
}

.calendar-day-briefing-heading h3,
.calendar-day-briefing-overview h4,
.calendar-day-briefing-section h4,
.calendar-day-briefing-why h4 {
  margin: 0;
  color: var(--ink);
  font-size: max(var(--wp-min-text, 0px), calc(13px * var(--wp-text-scale, 1)));
  font-weight: 760;
  letter-spacing: 0.025em;
}

.calendar-day-briefing-status {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  min-height: 23px;
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--ink-soft);
  font-size: max(var(--wp-min-text, 0px), calc(10px * var(--wp-text-scale, 1)));
  font-weight: 720;
}

.calendar-day-briefing-tabs {
  flex-wrap: wrap;
  gap: 6px;
  padding-bottom: 2px;
  border-bottom: 1px solid var(--line);
}

.calendar-day-briefing-tabs .button {
  min-height: 28px;
  padding: 5px 8px;
  font-size: max(var(--wp-min-text, 0px), calc(10px * var(--wp-text-scale, 1)));
  white-space: nowrap;
}

.calendar-day-briefing-content,
.calendar-day-briefing-overview,
.calendar-day-briefing-section,
.calendar-day-briefing-why,
.calendar-day-briefing-list {
  display: grid;
  gap: 8px;
}

.calendar-day-briefing-overview {
  padding: 10px 12px;
  border: 1px solid var(--wp-brand-border);
  border-radius: var(--radius-sm);
  background: var(--brand-soft);
}

.calendar-day-briefing-overview p,
.calendar-day-briefing-empty,
.calendar-day-briefing-loading {
  margin: 0;
  color: var(--ink-soft);
  font-size: max(var(--wp-min-text, 0px), calc(12px * var(--wp-text-scale, 1)));
  line-height: 1.5;
}

.calendar-day-briefing-list {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.calendar-day-briefing-item {
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  padding: 9px 11px;
  border-bottom: 1px solid var(--line);
}

.calendar-day-briefing-item:last-child { border-bottom: 0; }

.calendar-day-briefing-item--availability { box-shadow: inset 4px 0 0 var(--wp-busy); }
.calendar-day-briefing-item--high { box-shadow: inset 4px 0 0 var(--amber); }
.calendar-day-briefing-item--critical { box-shadow: inset 4px 0 0 var(--red); }

.calendar-day-briefing-item-main {
  min-width: 0;
  align-items: flex-start;
  flex-direction: column;
  gap: 3px;
}

.calendar-day-briefing-item-title {
  max-width: 100%;
  overflow: hidden;
  color: var(--ink);
  font-size: max(var(--wp-min-text, 0px), calc(12px * var(--wp-text-scale, 1)));
  font-weight: 720;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

button.calendar-day-briefing-item-title {
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

button.calendar-day-briefing-item-title:hover { color: var(--brand); text-decoration: underline; }
button.calendar-day-briefing-item-title:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; box-shadow: var(--focus-ring); }

.calendar-day-briefing-item-meta {
  overflow: hidden;
  max-width: 100%;
  color: var(--ink-soft);
  font-size: max(var(--wp-min-text, 0px), calc(11px * var(--wp-text-scale, 1)));
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-day-briefing-item-tags {
  flex: 0 0 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 5px;
}

.calendar-day-briefing-why {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-muted);
}

.calendar-day-briefing-why ul {
  display: grid;
  gap: 4px;
  margin: 0;
  padding-left: 18px;
  color: var(--ink-soft);
  font-size: max(var(--wp-min-text, 0px), calc(12px * var(--wp-text-scale, 1)));
  line-height: 1.45;
}

.calendar-day-briefing-error {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
}

.calendar-day-briefing-error p { margin: 0; }

.weekday,
.calendar-weekday {
  padding: 10px 8px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--surface-muted);
  color: var(--ink-soft);
  font-size: max(var(--wp-min-text, 0px), calc(10px * var(--wp-text-scale, 1)));
  font-weight: 760;
  letter-spacing: 0.055em;
  text-align: center;
  text-transform: uppercase;
}

.weekday:nth-child(7n),
.calendar-weekday:nth-child(7n) {
  border-right: 0;
}

.day-cell {
  position: relative;
  min-width: 0;
  min-height: 128px;
  padding: 8px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  transition: background-color 150ms ease;
}

.day-cell:nth-child(7n) {
  border-right: 0;
}

.day-cell:hover {
  background: #fbfdfd;
}

.day-cell.other-month,
.day-cell.is-outside {
  background: #fafbfd;
}

.day-cell.other-month .day-number,
.day-cell.is-outside .day-number {
  color: #a8b3bf;
}

.day-cell.is-weekend {
  background: #fbfcfd;
}

.day-cell.is-today {
  background: var(--calendar-today);
}

.day-cell.is-day-briefing-selected {
  z-index: 2;
  background: var(--brand-soft);
  box-shadow: inset 0 0 0 2px var(--brand);
}

.day-cell:focus-visible {
  z-index: 3;
  outline: 2px solid var(--brand);
  outline-offset: -3px;
  box-shadow: var(--focus-ring);
}

.day-number {
  display: inline-grid;
  place-items: center;
  min-width: 23px;
  height: 23px;
  border-radius: 999px;
  color: var(--ink-soft);
  font-size: max(var(--wp-min-text, 0px), calc(11px * var(--wp-text-scale, 1)));
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.day-number-button {
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.day-number-button:hover {
  background: var(--surface-muted);
}

.day-number-button:focus-visible,
.more-events:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.is-today .day-number {
  background: var(--brand);
  color: #fff;
}

.day-events {
  display: grid;
  gap: 4px;
  margin-top: 7px;
}

.event {
  display: block;
  overflow: hidden;
  padding: 4px 6px;
  border: 1px solid var(--wp-brand-border);
  border-left: 3px solid var(--brand);
  border-radius: 5px;
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-size: max(var(--wp-min-text, 0px), calc(10px * var(--wp-text-scale, 1)));
  font-weight: 670;
  line-height: 1.25;
  text-overflow: clip;
  white-space: pre-line;
}

.event:hover {
  filter: brightness(0.98);
  text-decoration: none;
}

.event--task-block::before {
  margin-right: 3px;
  color: currentColor;
  content: '◷';
}

.event--availability {
  border-color: #cdd5e5;
  border-left-color: var(--violet);
  background: var(--violet-soft);
  color: #60458e;
}

.event--meeting {
  border-color: var(--wp-busy-border);
  border-left-color: var(--wp-busy);
  background: var(--wp-busy-soft);
  color: var(--wp-busy-ink);
}

.event--meeting::before {
  margin-right: 3px;
  color: currentColor;
  content: '◌';
}

.event--meeting-busy {
  border-left-color: var(--wp-busy);
  background: var(--wp-busy-soft);
  color: var(--wp-busy-ink);
}

.event--availability-out-of-office {
  border-left-color: var(--red);
  background: #fff3f3;
  color: #8c3a42;
}

.event--availability-free {
  border-left-color: var(--green);
  background: var(--green-soft);
  color: #276b49;
}

/* BrightHR availability is deliberately neutral and read-only. It must never
   resemble an editable task or reveal an absence category. */
.event--approved-absence {
  border-color: var(--wp-absence-border);
  border-left-color: var(--absence);
  background: var(--absence-soft);
  color: var(--wp-absence-ink);
}

.event--bank-holiday {
  border-color: #d9d2ec;
  border-left-color: #7c6fb0;
  background: #f7f5fc;
  color: #554a7f;
  font-weight: 650;
}

.event.is-dragging { opacity: 0.5; }
.calendar-drop-target { outline: 2px dashed var(--brand); outline-offset: -3px; background-color: var(--brand-soft) !important; }

.calendar-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 13px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.calendar-legend-title {
  color: var(--ink-soft);
  font-size: max(var(--wp-min-text, 0px), calc(11px * var(--wp-text-scale, 1)));
  font-weight: 760;
  letter-spacing: 0.045em;
  text-transform: uppercase;
}

.calendar-legend-option {
  min-height: 26px;
  color: var(--ink-soft);
  font-size: max(var(--wp-min-text, 0px), calc(11px * var(--wp-text-scale, 1)));
  font-weight: 600;
}

.calendar-legend-option input { width: 14px; height: 14px; }

.calendar-event-kind {
  display: inline-flex;
  align-items: center;
  align-self: center;
  padding: 3px 6px;
  border: 1px solid #d2dbe7;
  border-radius: 999px;
  background: #f6f8fb;
  color: #607085;
  font-size: max(var(--wp-min-text, 0px), calc(10px * var(--wp-text-scale, 1)));
  font-weight: 680;
  white-space: nowrap;
}

.day-agenda-item--availability,
.agenda-item--availability { box-shadow: inset 4px 0 0 var(--violet); }

.feed-week-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.feed-week-grid {
  display: block;
  min-width: 1015px;
}

.feed-week-grid--5 {
  min-width: 725px;
}

.feed-week-row {
  display: grid;
  grid-template-columns: repeat(7, minmax(145px, 1fr));
}

.feed-week-grid--5 .feed-week-row {
  grid-template-columns: repeat(5, minmax(145px, 1fr));
}

.feed-week-day {
  min-height: 360px;
  border-right: 1px solid var(--line);
  background: var(--surface);
}

.feed-week-day:last-child { border-right: 0; }
.feed-week-day.is-today { background: #fbfefe; }
.feed-week-day.is-day-briefing-selected,
.feed-day.is-day-briefing-selected { background: var(--brand-soft); box-shadow: inset 0 0 0 2px var(--brand); }
.feed-week-day:focus-visible,
.feed-day:focus-visible { position: relative; z-index: 2; outline: 2px solid var(--brand); outline-offset: -2px; box-shadow: var(--focus-ring); }

.feed-week-day > header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  min-height: 47px;
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: max(var(--wp-min-text, 0px), calc(11px * var(--wp-text-scale, 1)));
  font-weight: 690;
}

.feed-week-day > header strong { color: var(--ink); font-size: max(var(--wp-min-text, 0px), calc(15px * var(--wp-text-scale, 1))); }
.feed-week-events { display: grid; gap: 6px; padding: 8px; }
.feed-week-empty { margin: 6px 2px; color: var(--ink-faint); font-size: max(var(--wp-min-text, 0px), calc(11px * var(--wp-text-scale, 1))); }

.feed-day-wrap { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.feed-day-grid { display: grid; min-width: 0; }
.feed-day { min-height: 420px; background: var(--surface-raised); }
.feed-day.is-today { background: var(--calendar-today); }
.feed-day-heading { display: flex; align-items: baseline; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--line); font-weight: 700; color: var(--ink); }
.feed-day-events { display: grid; gap: 8px; padding: 12px; }

.calendar-block-list { display: grid; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-sm); }

.calendar-block-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 52px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

.calendar-block-row:last-child { border-bottom: 0; }
.calendar-block-row strong, .calendar-block-row small { display: block; }
.calendar-block-row small { margin-top: 2px; color: var(--ink-soft); font-size: max(var(--wp-min-text, 0px), calc(11px * var(--wp-text-scale, 1))); }
.calendar-block-actions { display: inline-flex; flex: 0 0 auto; gap: 6px; }

/* Meeting availability is deliberately compact: it is a private booking
   preference, not work to be mistaken for a task or absence. */
.event.event--meeting-availability {
  border-color: var(--wp-success-border);
  border-left-color: var(--green);
  background: var(--green-soft);
  color: var(--wp-success-ink);
}

.availability-bulk-editor { min-width: 0; }
.availability-bulk-groups { display: grid; gap: 12px; }

.availability-bulk-group {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-raised);
}

.availability-bulk-group.has-error { border-color: var(--danger-border); }

.availability-bulk-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-muted);
}

.availability-bulk-group-header strong,
.availability-bulk-group-header small { display: block; }
.availability-bulk-group-header small { margin-top: 2px; color: var(--ink-soft); font-size: max(var(--wp-min-text, 0px), calc(11px * var(--wp-text-scale, 1))); }
.availability-bulk-group-fields { padding: 12px; }
.availability-bulk-group-fields .task-label-picker { margin-top: 0; }

.availability-bulk-quick-actions,
.availability-bulk-date-controls,
.availability-bulk-date-chips,
.availability-bulk-windows,
.availability-bulk-review-summary,
.availability-bulk-review {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: end;
}

.availability-bulk-quick-actions { margin-top: 9px; }

.availability-bulk-date-controls {
  align-items: end;
  padding: 2px 0;
}

.availability-bulk-date-controls .field { flex: 1 1 154px; }
.availability-bulk-range-controls { padding-top: 8px; border-top: 1px solid var(--line); }

.availability-bulk-date-chips { align-items: center; padding-top: 9px; }

.availability-bulk-date-chip {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  min-height: 30px;
  padding: 3px 4px 3px 9px;
  border: 1px solid var(--wp-success-border);
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--wp-success-ink);
  font-size: max(var(--wp-min-text, 0px), calc(11px * var(--wp-text-scale, 1)));
  font-weight: 680;
}

.availability-bulk-date-chip .button { min-height: 22px; padding: 2px 6px; }

.availability-bulk-time-ranges { display: grid; gap: 9px; }
.availability-bulk-windows { display: grid; align-items: stretch; }

.availability-bulk-window {
  display: flex;
  align-items: end;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.meeting-availability-window-fields {
  display: grid;
  flex: 1 1 auto;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.availability-bulk-group-summary {
  margin: 0;
  padding: 9px 12px;
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: max(var(--wp-min-text, 0px), calc(11px * var(--wp-text-scale, 1)));
  line-height: 1.4;
}

.availability-bulk-group-error { margin: 0 12px 12px; }

.availability-bulk-review-summary {
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--wp-success-border);
  border-radius: var(--radius-sm);
  background: var(--green-soft);
  color: var(--wp-success-ink);
  font-size: max(var(--wp-min-text, 0px), calc(12px * var(--wp-text-scale, 1)));
}

.availability-bulk-review-summary strong { color: inherit; }
.availability-bulk-review { display: grid; }

.availability-bulk-review-row {
  display: grid;
  gap: 3px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-muted);
  color: var(--ink-soft);
  font-size: max(var(--wp-min-text, 0px), calc(12px * var(--wp-text-scale, 1)));
}

.availability-bulk-review-row strong { color: var(--ink); }

.meeting-slot-results { grid-column: 1 / -1; }
.meeting-slot-list { margin-top: 8px; }

/* Flexible meeting requests intentionally reuse the ordinary meeting language,
   while remaining distinct from a booked meeting until a recipient confirms a
   server-checked slot. */
.meeting-request-summary { line-height: 1.5; }
.meeting-request-detail,
.meeting-request-slot-chooser,
.meeting-request-confirmation { min-width: 0; }

.meeting-request-slot-results {
  display: grid;
  gap: 9px;
  min-width: 0;
}

.meeting-request-slot-list {
  align-items: stretch;
  max-height: 290px;
  overflow: auto;
  padding: 2px;
}

.meeting-request-slot-list .button {
  min-height: 34px;
  text-align: left;
  white-space: normal;
}

.meeting-request-draft-list,
.meeting-request-response-list {
  display: grid;
  gap: 9px;
  margin: 0;
  padding: 0;
}

.meeting-request-draft,
.meeting-request-response {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-muted);
}

.meeting-request-draft-copy { min-width: 0; }
.meeting-request-draft-copy strong,
.meeting-request-draft-copy small { display: block; }
.meeting-request-draft-copy p,
.meeting-request-response p { margin: 4px 0; color: var(--ink-soft); font-size: max(var(--wp-min-text, 0px), calc(12px * var(--wp-text-scale, 1))); }
.meeting-request-draft-copy small,
.meeting-request-response small { color: var(--ink-faint); font-size: max(var(--wp-min-text, 0px), calc(11px * var(--wp-text-scale, 1))); }

.meeting-request-responses {
  display: grid;
  gap: 8px;
  padding-top: 2px;
}

.meeting-request-responses h4 { margin: 0; }
.meeting-request-response {
  display: grid;
  justify-content: start;
  gap: 2px;
  list-style: none;
}

@media (max-width: 620px) {
  .meeting-request-draft { align-items: stretch; flex-direction: column; }
  .meeting-request-draft .button { align-self: flex-start; }
}

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

.notification {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-raised);
}

.notification > div { min-width: 0; }
.notification strong,
.notification small { display: block; }
.notification p { margin: 4px 0; color: var(--ink-soft); font-size: max(var(--wp-min-text, 0px), calc(12px * var(--wp-text-scale, 1))); }
.notification small { color: var(--ink-faint); font-size: max(var(--wp-min-text, 0px), calc(11px * var(--wp-text-scale, 1))); }
.notification.unread { border-left: 4px solid var(--brand); }
.notification.read { opacity: 0.82; }

.notification--meeting-request {
  border-left-color: var(--brand);
  background: var(--brand-soft);
}

/* This is deliberately not a modal: it is a quiet, keyboard-reachable ping
   that never interrupts someone already in another Planner dialog. */
.meeting-request-overlay {
  position: fixed;
  z-index: 150;
  top: 82px;
  right: 20px;
  display: grid;
  gap: 12px;
  width: min(390px, calc(100vw - 40px));
  padding: 14px;
  border: 1px solid var(--wp-brand-border);
  border-left: 4px solid var(--brand);
  border-radius: var(--radius);
  background: var(--surface-raised);
  box-shadow: var(--shadow-lg);
  color: var(--ink);
  animation: meeting-request-overlay-enter 180ms ease-out;
}

.meeting-request-overlay-copy strong { color: var(--brand-dark); }
.meeting-request-overlay-copy p { margin: 5px 0 4px; font-size: max(var(--wp-min-text, 0px), calc(13px * var(--wp-text-scale, 1))); line-height: 1.4; }
.meeting-request-overlay-copy small { color: var(--ink-soft); font-size: max(var(--wp-min-text, 0px), calc(11px * var(--wp-text-scale, 1))); }

.meeting-request-overlay-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
}

.meeting-request-overlay-actions .button { min-height: 32px; }

/* A count-only reminder for people returning to Work-Place. It deliberately
   contains no notification preview and is not a modal or an OS notification. */
.notification-entry-summary {
  position: fixed;
  z-index: 155;
  top: var(--notification-entry-summary-top, 82px);
  right: 20px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 8px 11px;
  width: min(400px, calc(100vw - 40px));
  padding: 13px;
  border: 1px solid var(--wp-brand-border);
  border-left: 4px solid var(--brand);
  border-radius: var(--radius);
  background: var(--surface-raised);
  box-shadow: var(--shadow-lg);
  color: var(--ink);
  animation: notification-entry-summary-enter 180ms ease-out;
}

.notification-entry-summary:focus-visible {
  outline: none;
  box-shadow: var(--shadow-lg), var(--wp-focus-ring);
}

.notification-entry-summary-mark {
  display: grid;
  grid-row: 1 / span 2;
  width: 42px;
  height: 42px;
  overflow: hidden;
  place-items: center;
  border: 1px solid var(--wp-brand-border);
  border-radius: 50%;
  background: var(--brand-soft);
}

.notification-entry-summary-mark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.notification-entry-summary-copy { min-width: 0; }
.notification-entry-summary-copy strong {
  display: block;
  color: var(--brand-dark);
  font-size: max(var(--wp-min-text, 0px), calc(14px * var(--wp-text-scale, 1)));
  font-weight: 760;
}
.notification-entry-summary-copy p {
  margin: 4px 0 3px;
  color: var(--ink);
  font-size: max(var(--wp-min-text, 0px), calc(13px * var(--wp-text-scale, 1)));
  line-height: 1.4;
}
.notification-entry-summary-copy small { color: var(--ink-faint); font-size: max(var(--wp-min-text, 0px), calc(11px * var(--wp-text-scale, 1))); }

.notification-entry-summary-actions {
  display: flex;
  grid-column: 2;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
}

.notification-entry-summary-actions .button { min-height: 32px; }
.notification-topbar-button { white-space: nowrap; }

/* Incoming Work-Place alerts are lightweight, in-app cards rather than system
   notifications. They deliberately stay separate from ordinary form toasts and
   the specialised meeting-request choice card. */
.in-app-notification-tray {
  position: fixed;
  z-index: 160;
  top: var(--in-app-notification-top, 82px);
  right: 20px;
  display: grid;
  gap: 10px;
  width: min(400px, calc(100vw - 40px));
  pointer-events: none;
}

.in-app-notification-overlay {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 8px 11px;
  min-width: 0;
  padding: 13px;
  border: 1px solid var(--wp-brand-border);
  border-left: 4px solid var(--brand);
  border-radius: var(--radius);
  background: var(--surface-raised);
  box-shadow: var(--shadow-lg);
  color: var(--ink);
  cursor: pointer;
  pointer-events: auto;
  animation: in-app-notification-overlay-enter 180ms ease-out;
}

.in-app-notification-overlay:focus-visible {
  outline: none;
  box-shadow: var(--shadow-lg), var(--wp-focus-ring);
}

.in-app-notification-overlay-mark {
  display: grid;
  grid-row: 1 / span 2;
  width: 42px;
  height: 42px;
  overflow: hidden;
  place-items: center;
  border: 1px solid var(--wp-brand-border);
  border-radius: 50%;
  background: var(--brand-soft);
}

.in-app-notification-overlay-mark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.in-app-notification-overlay-mark.is-initials {
  color: var(--brand-dark);
  font-size: max(var(--wp-min-text, 0px), calc(13px * var(--wp-text-scale, 1)));
  font-weight: 800;
  letter-spacing: 0.04em;
}

.in-app-notification-overlay-copy { min-width: 0; }
.in-app-notification-overlay-copy strong {
  display: block;
  overflow: hidden;
  color: var(--brand-dark);
  font-size: max(var(--wp-min-text, 0px), calc(13px * var(--wp-text-scale, 1)));
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.in-app-notification-overlay-copy p {
  display: -webkit-box;
  margin: 3px 0 3px;
  overflow: hidden;
  color: var(--ink);
  font-size: max(var(--wp-min-text, 0px), calc(12px * var(--wp-text-scale, 1)));
  line-height: 1.38;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.in-app-notification-overlay-copy small {
  color: var(--ink-faint);
  font-size: max(var(--wp-min-text, 0px), calc(11px * var(--wp-text-scale, 1)));
}

.in-app-notification-overlay-actions {
  display: flex;
  grid-column: 2;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
}

.in-app-notification-overlay-actions .button { min-height: 32px; }
.private-member-row { gap: 12px; }
.private-member-row .check-field { flex: 1 1 auto; }
.private-member-role { margin: 0; min-width: 130px; }
.private-member-role label { display: none; }

.event--deadline,
.event.deadline,
[data-kind="deadline"].event {
  border-color: #f0d2a2;
  border-left-color: var(--amber);
  background: var(--amber-soft);
  color: #855105;
}

.event--important,
.event.important,
.event.is-important {
  border-color: #efc4c6;
  border-left-color: var(--red);
  background: var(--red-soft);
  color: #91363e;
}

.event--auto-visible,
.event--high {
  border-left-width: 5px;
  border-left-color: var(--amber);
  background: #fff8e9;
  color: #7d5008;
}

.event--critical {
  border: 2px solid var(--red);
  border-left: 6px solid var(--wp-danger-ink);
  background: var(--red-soft);
  box-shadow: inset 0 0 0 1px rgb(180 35 58 / 10%);
  color: var(--wp-danger-ink);
  font-weight: 800;
}

.event--blocked,
.event.blocked,
[data-status="blocked"].event {
  border-color: #ebc6c8;
  border-left-color: var(--red);
  background: #fff4f4;
  color: #963a41;
  text-decoration: line-through;
}

.event--completed,
.event.completed,
[data-status="completed"].event {
  border-color: #c5e1d0;
  border-left-color: var(--green);
  background: var(--green-soft);
  color: #246b48;
  opacity: 0.82;
}

.event--critical.event--completed {
  border-color: #b95a62;
  border-left-color: #9d323d;
  background: #fff4f4;
  color: #87353d;
  opacity: 0.94;
}

.more-events {
  display: block;
  width: 100%;
  border: 0;
  background: transparent;
  cursor: pointer;
  text-align: left;
  padding: 1px 5px;
  color: var(--brand-dark);
  font-size: max(var(--wp-min-text, 0px), calc(10px * var(--wp-text-scale, 1)));
  font-weight: 700;
}

.week-grid-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.calendar .week-grid-wrap {
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.week-grid {
  display: grid;
  grid-template-columns: 64px repeat(7, minmax(132px, 1fr));
  min-width: 980px;
  isolation: isolate;
}

.week-corner,
.week-day-header {
  position: sticky;
  z-index: 4;
  top: 0;
  min-height: 51px;
  padding: 9px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--surface-muted);
}

.week-corner {
  display: grid;
  place-items: end;
  color: var(--ink-faint);
  font-size: max(var(--wp-min-text, 0px), calc(10px * var(--wp-text-scale, 1)));
  font-weight: 700;
  text-transform: uppercase;
}

.week-day-header {
  color: var(--ink-soft);
  font-size: max(var(--wp-min-text, 0px), calc(10px * var(--wp-text-scale, 1)));
  font-weight: 740;
  letter-spacing: 0.045em;
  text-align: center;
  text-transform: uppercase;
}

.week-day-header strong {
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  margin: 4px auto 0;
  border-radius: 999px;
  color: var(--ink);
  font-size: max(var(--wp-min-text, 0px), calc(12px * var(--wp-text-scale, 1)));
  letter-spacing: 0;
}

.week-day-header.is-today strong {
  background: var(--brand);
  color: #fff;
}

.week-time {
  min-height: 55px;
  padding: 7px 9px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: var(--ink-faint);
  font-size: max(var(--wp-min-text, 0px), calc(10px * var(--wp-text-scale, 1)));
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.week-time--all-day {
  min-height: 40px;
  background: var(--surface-muted);
  font-size: max(var(--wp-min-text, 0px), calc(9px * var(--wp-text-scale, 1)));
  font-weight: 700;
  text-transform: uppercase;
}

.week-all-day-cell {
  display: grid;
  align-content: start;
  gap: 3px;
  min-height: 40px;
  padding: 4px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.week-all-day-event {
  min-height: 22px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.week-slot {
  position: relative;
  min-height: 55px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background-image: linear-gradient(to bottom, transparent 50%, rgb(220 228 236 / 58%) 50%);
  background-size: 100% 55px;
}

.week-slot:hover {
  background-color: #fbfdfd;
}

.week-event {
  position: relative;
  z-index: 3;
  align-self: start;
  justify-self: stretch;
  overflow: hidden;
  height: var(--week-event-height, 26px);
  min-height: 22px;
  margin-top: var(--week-event-offset, 0);
  margin-right: calc(4px + var(--week-event-right, 0%));
  margin-left: calc(4px + var(--week-event-left, 0%));
  padding: 4px 6px;
  border-left: 3px solid var(--brand);
  border-radius: 5px;
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-size: max(var(--wp-min-text, 0px), calc(10px * var(--wp-text-scale, 1)));
  font-weight: 680;
  line-height: 1.2;
  text-align: left;
  white-space: normal;
}

.week-event.private,
.week-event[data-visibility="private"] {
  border-left-color: var(--violet);
  background: var(--violet-soft);
  color: #654497;
}

.week-event.deadline,
.week-event[data-kind="deadline"] {
  border-left-color: var(--amber);
  background: var(--amber-soft);
  color: #875309;
}

.day-agenda-modal {
  display: grid;
  gap: 12px;
}

.day-agenda-list {
  display: grid;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.day-agenda-item {
  display: grid;
  grid-template-columns: minmax(92px, 0.55fr) minmax(0, 1.45fr) auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 11px 12px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

.day-agenda-item:last-child {
  border-bottom: 0;
}

.day-agenda-item:hover {
  background: var(--surface-muted);
}

.day-agenda-item:focus-visible {
  position: relative;
  z-index: 1;
  outline: 2px solid var(--brand);
  outline-offset: -2px;
}

.day-agenda-item--high {
  box-shadow: inset 4px 0 0 var(--amber);
}

.day-agenda-item--critical {
  background: var(--red-soft);
  box-shadow: inset 4px 0 0 var(--red);
}

.day-agenda-time {
  color: var(--ink-soft);
  font-size: max(var(--wp-min-text, 0px), calc(11px * var(--wp-text-scale, 1)));
  font-variant-numeric: tabular-nums;
}

.day-agenda-main {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.day-agenda-main strong,
.day-agenda-main span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.day-agenda-main span {
  color: var(--ink-soft);
  font-size: max(var(--wp-min-text, 0px), calc(11px * var(--wp-text-scale, 1)));
}

.agenda {
  display: grid;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.agenda-day {
  padding: 11px 17px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-muted);
  color: var(--ink-soft);
  font-size: max(var(--wp-min-text, 0px), calc(11px * var(--wp-text-scale, 1)));
  font-weight: 760;
  letter-spacing: 0.045em;
  text-transform: uppercase;
}

.agenda-day.is-today {
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.agenda-item {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) auto;
  align-items: center;
  gap: 13px;
  min-height: 66px;
  padding: 10px 17px;
  border-bottom: 1px solid var(--line);
}

.agenda-item:last-child {
  border-bottom: 0;
}

.agenda-item--high {
  box-shadow: inset 4px 0 0 var(--amber);
}

.agenda-item--critical {
  border-left: 4px solid var(--red);
  background: var(--red-soft);
  box-shadow: inset 4px 0 0 var(--red);
}

.agenda-time {
  color: var(--ink-soft);
  font-size: max(var(--wp-min-text, 0px), calc(11px * var(--wp-text-scale, 1)));
  font-variant-numeric: tabular-nums;
}

.agenda-title {
  display: block;
  font-weight: 690;
}

.agenda-detail {
  display: block;
  margin-top: 3px;
  color: var(--ink-soft);
  font-size: max(var(--wp-min-text, 0px), calc(11px * var(--wp-text-scale, 1)));
}

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

.form-grid .span-2,
.form-grid .full-width {
  grid-column: 1 / -1;
}

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

.field label,
.field-label {
  color: #435266;
  font-size: max(var(--wp-min-text, 0px), calc(12px * var(--wp-text-scale, 1)));
  font-weight: 690;
}

.field-hint {
  color: var(--ink-faint);
  font-size: max(var(--wp-min-text, 0px), calc(11px * var(--wp-text-scale, 1)));
}

.field-note {
  margin: 0;
  color: var(--ink-soft);
  font-size: max(var(--wp-min-text, 0px), calc(12px * var(--wp-text-scale, 1)));
  line-height: 1.45;
}

.recurrence-fields,
.recurrence-daily-schedule,
.weekday-picker,
.planning-fields {
  min-width: 0;
  margin: 2px 0 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-muted);
}

.recurrence-fields > legend,
.recurrence-daily-schedule > legend,
.weekday-picker > legend,
.planning-fields > legend {
  padding: 0 5px;
  color: #435266;
  font-size: max(var(--wp-min-text, 0px), calc(12px * var(--wp-text-scale, 1)));
  font-weight: 730;
}

.recurrence-daily-schedule {
  margin-top: 2px;
  background: #f8fbfc;
}

.weekday-picker {
  display: grid;
  gap: 9px;
}

.weekday-options {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.multi-select {
  min-height: 112px;
  padding: 5px;
}

.multi-select option {
  padding: 4px 6px;
}

.planning-detail {
  display: grid;
  gap: 13px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-muted);
}

.planning-detail-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.planning-detail h4,
.planning-detail h5 {
  margin: 0;
}

.planning-detail h4 {
  font-size: max(var(--wp-min-text, 0px), calc(14px * var(--wp-text-scale, 1)));
}

.planning-detail h5 {
  color: var(--ink-soft);
  font-size: max(var(--wp-min-text, 0px), calc(11px * var(--wp-text-scale, 1)));
  letter-spacing: 0.035em;
  text-transform: uppercase;
}

.planning-access {
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-size: max(var(--wp-min-text, 0px), calc(10px * var(--wp-text-scale, 1)));
  font-weight: 720;
}

.planning-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin: 0;
}

.planning-detail-grid > div {
  min-width: 0;
  padding: 8px 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.planning-detail-grid dt {
  margin: 0 0 3px;
  color: var(--ink-faint);
  font-size: max(var(--wp-min-text, 0px), calc(10px * var(--wp-text-scale, 1)));
  font-weight: 700;
  letter-spacing: 0.035em;
  text-transform: uppercase;
}

.planning-detail-grid dd {
  min-width: 0;
  margin: 0;
  color: var(--ink);
  font-size: max(var(--wp-min-text, 0px), calc(12px * var(--wp-text-scale, 1)));
  font-weight: 650;
  overflow-wrap: anywhere;
}

.planning-workstream {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.planning-workstream i,
.planning-colour-swatch {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.planning-parent-link {
  min-height: 0;
  padding: 0;
  color: var(--brand-dark);
  font-size: max(var(--wp-min-text, 0px), calc(12px * var(--wp-text-scale, 1)));
  font-weight: 700;
  text-align: left;
}

.planning-detail-section {
  display: grid;
  gap: 7px;
}

.planning-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.planning-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 25px;
  padding: 3px 8px;
  border: 1px solid #cfdce5;
  border-radius: 999px;
  background: #f5f8fa;
  color: #35485b;
  font-size: max(var(--wp-min-text, 0px), calc(11px * var(--wp-text-scale, 1)));
  font-weight: 680;
}

.planning-chip i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--planning-colour, #4A6A7C);
}

.planning-chip--person {
  border-color: #d2dce7;
  background: #f4f7fa;
}

.planning-empty {
  margin: 0;
  font-size: max(var(--wp-min-text, 0px), calc(12px * var(--wp-text-scale, 1)));
}

.planning-meeting-detail {
  display: grid;
  gap: 6px;
  padding: 10px 11px;
  border-left: 3px solid #7b63a8;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: #f7f4fb;
}

.planning-meeting-detail p {
  margin: 0;
  color: #4f426a;
  font-size: max(var(--wp-min-text, 0px), calc(12px * var(--wp-text-scale, 1)));
  white-space: pre-wrap;
}

.planning-entity-list {
  display: grid;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.planning-entity {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px 11px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.planning-entity:last-child {
  border-bottom: 0;
}

.planning-entity.is-inactive {
  background: var(--surface-muted);
  opacity: 0.7;
}

.planning-entity-main {
  min-width: 0;
}

.planning-entity-main strong,
.planning-entity-main p,
.planning-entity-main small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.planning-entity-main strong {
  font-size: max(var(--wp-min-text, 0px), calc(12px * var(--wp-text-scale, 1)));
}

.planning-entity-main p {
  margin: 3px 0 0;
  color: var(--ink-soft);
  font-size: max(var(--wp-min-text, 0px), calc(11px * var(--wp-text-scale, 1)));
}

.planning-entity-main small {
  margin-top: 3px;
  color: var(--ink-faint);
  font-size: max(var(--wp-min-text, 0px), calc(10px * var(--wp-text-scale, 1)));
}

.check-field {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 30px;
  color: #435266;
  font-size: max(var(--wp-min-text, 0px), calc(12px * var(--wp-text-scale, 1)));
  font-weight: 620;
}

.check-field input {
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: var(--brand);
}

.is-locked .select {
  border-color: var(--wp-info-border);
  background: var(--blue-soft);
  color: var(--blue);
}

.auto-visibility-notice {
  margin: 0;
  border-color: var(--wp-brand-border);
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.field-error,
.input-error {
  color: var(--red);
  font-size: max(var(--wp-min-text, 0px), calc(11px * var(--wp-text-scale, 1)));
}

.input-error,
.field.has-error .input,
.field.has-error .select,
.field.has-error .textarea {
  border-color: #d9858a;
}

.modal {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  /* Neutral charcoal scrim: it keeps the dialog legible without tinting the
     underlying planner views turquoise. */
  background: var(--overlay);
}

.modal.is-open,
.modal[open] {
  display: flex;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: transparent;
  cursor: default;
}

.modal-dialog,
.modal-card {
  position: relative;
  width: min(100%, 760px);
  max-height: min(800px, calc(100dvh - 40px));
  overflow: auto;
  border: 1px solid rgb(255 255 255 / 70%);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  animation: modal-enter 180ms ease-out;
}

.modal-close-button {
  flex: 0 0 auto;
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 21px 16px;
  border-bottom: 1px solid var(--line);
}

.modal-header h2,
.modal-header h3 {
  margin: 0;
  font-size: max(var(--wp-min-text, 0px), calc(18px * var(--wp-text-scale, 1)));
  letter-spacing: -0.02em;
}

.modal-body {
  padding: 20px 21px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 21px;
  border-top: 1px solid var(--line);
  background: var(--surface-muted);
}

.task-authority-cover {
  position: absolute;
  z-index: 4;
  inset: 0;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 8px;
  min-height: 150px;
  padding: 24px;
  background: var(--surface);
  color: var(--ink-soft);
  text-align: center;
}

.task-authority-cover strong { color: var(--ink); }
.task-authority-cover small { color: var(--ink-faint); overflow-wrap: anywhere; }

.empty-state {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 48px 24px;
  color: var(--ink-soft);
  text-align: center;
}

.empty-state-icon {
  display: grid;
  place-items: center;
  width: 43px;
  height: 43px;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: max(var(--wp-min-text, 0px), calc(19px * var(--wp-text-scale, 1)));
}

.empty-state h2,
.empty-state h3 {
  margin: 6px 0 0;
  color: var(--ink);
  font-size: max(var(--wp-min-text, 0px), calc(15px * var(--wp-text-scale, 1)));
}

.empty-state p {
  max-width: 390px;
  margin: 0;
  font-size: max(var(--wp-min-text, 0px), calc(12px * var(--wp-text-scale, 1)));
}

.notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 13px;
  border: 1px solid var(--wp-brand-border);
  border-radius: var(--radius-sm);
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-size: max(var(--wp-min-text, 0px), calc(12px * var(--wp-text-scale, 1)));
}

.notice strong {
  color: inherit;
}

.notice-info { border-color: #c9dcef; background: #f0f6fc; color: #3b6387; }
.notice-warning { border-color: #efd5a8; background: #fff8e9; color: #87560d; }
.notice-danger { border-color: #edc2c5; background: #fff4f4; color: #9c3e46; }
.notice-success { border-color: #bde1ca; background: #f0faf4; color: #276c49; }

.toast-container {
  position: fixed;
  z-index: 200;
  right: 20px;
  bottom: 20px;
  display: grid;
  gap: 9px;
  width: min(380px, calc(100vw - 40px));
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--brand);
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: var(--shadow);
  color: var(--ink);
  font-size: max(var(--wp-min-text, 0px), calc(12px * var(--wp-text-scale, 1)));
  animation: toast-enter 200ms ease-out;
}

.toast-success { border-left-color: var(--green); }
.toast-warning { border-left-color: var(--amber); }
.toast-error,
.toast-danger { border-left-color: var(--red); }

.toast-title {
  display: block;
  margin-bottom: 2px;
  font-weight: 730;
}

.toast p {
  margin: 0;
  color: var(--ink-soft);
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
  text-align: left;
}

.table th,
.table td {
  padding: 12px 15px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

.table th {
  background: var(--surface-muted);
  color: var(--ink-soft);
  font-size: max(var(--wp-min-text, 0px), calc(10px * var(--wp-text-scale, 1)));
  font-weight: 760;
  letter-spacing: 0.055em;
  text-transform: uppercase;
  white-space: nowrap;
}

.table td {
  color: #35455a;
  font-size: max(var(--wp-min-text, 0px), calc(12px * var(--wp-text-scale, 1)));
}

.table tbody tr {
  transition: background-color 140ms ease;
}

.table tbody tr:hover {
  background: #fbfcfd;
}

.table tbody tr:last-child td {
  border-bottom: 0;
}

.table .numeric {
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.table .primary-cell {
  color: var(--ink);
  font-weight: 680;
}

.avatar {
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  width: 30px;
  height: 30px;
  overflow: hidden;
  border: 1px solid rgb(23 111 115 / 16%);
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-size: max(var(--wp-min-text, 0px), calc(11px * var(--wp-text-scale, 1)));
  font-weight: 760;
  text-transform: uppercase;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-sm { width: 24px; height: 24px; font-size: max(var(--wp-min-text, 0px), calc(9px * var(--wp-text-scale, 1))); }
.avatar-lg { width: 40px; height: 40px; font-size: max(var(--wp-min-text, 0px), calc(13px * var(--wp-text-scale, 1))); }

.avatar-group {
  display: flex;
  align-items: center;
  padding-left: 3px;
}

.avatar-group .avatar {
  margin-left: -3px;
  border: 2px solid var(--surface);
}

.muted { color: var(--ink-soft); }
.subtle { color: var(--ink-faint); }
.text-danger { color: var(--red); }
.text-success { color: var(--green); }
.text-warning { color: var(--amber); }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* OneNote-style Daily Tasks: intentionally light, direct, and roomy enough for
   a normal laptop screen. Task titles are real inputs so a click is all that is
   needed to start typing. */
.daily-page {
  gap: 18px;
  max-width: 1540px;
}

.daily-page .page-header {
  margin-bottom: 0;
}

.daily-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 34px;
  padding: 2px 2px 0;
}

.daily-toolbar .check-field {
  min-height: 28px;
}

.daily-save-state {
  display: inline-flex;
  align-items: center;
  min-width: 60px;
  color: var(--ink-faint);
  font-size: max(var(--wp-min-text, 0px), calc(12px * var(--wp-text-scale, 1)));
  font-weight: 650;
  text-align: right;
}

.daily-save-state::before {
  width: 7px;
  height: 7px;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--line-strong);
  content: '';
}

.daily-save-state.is-saving { color: var(--ink-soft); }
.daily-save-state.is-saving::before { background: var(--brand); animation: daily-saving-pulse 850ms ease-in-out infinite; }
.daily-save-state.is-saved::before { background: var(--green); }
.daily-save-state.is-error { color: #9c3e46; }
.daily-save-state.is-error::before { background: var(--red); }

.daily-sections {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 16px;
}

.daily-section {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: border-color 140ms ease, box-shadow 140ms ease, background-color 140ms ease;
}

.daily-section:hover { border-color: var(--line-strong); }
.daily-section.daily-section-drop-target { border-color: var(--brand); background: var(--brand-soft); box-shadow: var(--focus-ring); }

.daily-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 52px;
  gap: 12px;
  padding: 12px 14px 9px 16px;
  border-bottom: 1px solid #edf1f5;
}

.daily-section-header h2 {
  margin: 0;
  color: #34485b;
  font-size: max(var(--wp-min-text, 0px), calc(13px * var(--wp-text-scale, 1)));
  font-weight: 780;
  letter-spacing: 0.01em;
}

.daily-section-actions {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.daily-completed-count {
  color: var(--ink-faint);
  font-size: max(var(--wp-min-text, 0px), calc(11px * var(--wp-text-scale, 1)));
  white-space: nowrap;
}

.daily-section-toggle {
  min-height: 28px;
  padding: 4px 8px;
  color: var(--ink-soft);
  font-size: max(var(--wp-min-text, 0px), calc(11px * var(--wp-text-scale, 1)));
}

.daily-section-body { padding: 5px 10px 10px; }
.daily-section-body[hidden] { display: none; }
.daily-task-list { display: grid; gap: 1px; }

.daily-task-branch { min-width: 0; padding-left: calc(var(--daily-depth, 0) * 24px); }
.daily-task-children { display: grid; gap: 1px; }

.daily-task {
  position: relative;
  min-width: 0;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  transition: background-color 120ms ease, border-color 120ms ease, opacity 120ms ease;
}

.daily-task:hover,
.daily-task:focus-within { border-color: var(--line-strong); background: var(--surface-hover); }
.daily-task.daily-drop-target { border-color: var(--brand); background: var(--brand-soft); }
.daily-task.is-dragging { opacity: 0.48; }
.daily-task.is-completed { opacity: 0.56; }
.daily-task.is-completed .daily-task-title { color: var(--ink-soft); text-decoration: line-through; }
.daily-task.is-blocked { border-left: 3px solid var(--amber); }

.daily-task-main {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 7px;
  min-height: 37px;
  padding: 4px 5px;
}

.daily-drag-handle {
  flex: 0 0 auto;
  display: inline-grid;
  width: 18px;
  height: 24px;
  place-items: center;
  color: #788896;
  cursor: grab;
  font-family: "Segoe UI Symbol", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: max(var(--wp-min-text, 0px), calc(17px * var(--wp-text-scale, 1)));
  letter-spacing: 0;
  line-height: 1;
  user-select: none;
}

.daily-task.is-dragging .daily-drag-handle { cursor: grabbing; }

.daily-task:hover .daily-drag-handle,
.daily-task:focus-within .daily-drag-handle { color: var(--ink-soft); }

.dashboard-manual-order-hint {
  color: var(--ink-soft);
  font-size: max(var(--wp-min-text, 0px), calc(12px * var(--wp-text-scale, 1)));
}

.daily-task-check {
  appearance: none;
  flex: 0 0 17px;
  width: 17px;
  height: 17px;
  margin: 0;
  border: 1.5px solid #91a4b3;
  border-radius: 4px;
  background: var(--surface);
  cursor: pointer;
}

.daily-task-check:checked {
  border-color: var(--green);
  background: var(--green);
  box-shadow: inset 0 0 0 3px #fff;
}

.daily-task-check:focus-visible { outline: none; box-shadow: var(--focus-ring); }

.daily-task-check:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

.daily-task-title {
  min-width: 0;
  flex: 1 1 auto;
  height: 29px;
  padding: 3px 2px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: var(--ink);
  font-size: max(var(--wp-min-text, 0px), calc(13px * var(--wp-text-scale, 1)));
  line-height: 1.35;
}

.daily-task-title:hover { background: #f6f9fb; }
.daily-task-title:focus { border-color: #aec8d4; outline: 0; background: var(--surface); box-shadow: 0 0 0 2px rgb(23 111 115 / 11%); }

.daily-task-title-readonly {
  overflow: hidden;
  border: 0;
  background: transparent;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}

.daily-readonly-mark {
  flex: 0 0 auto;
  padding: 2px 5px;
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--ink-faint);
  font-size: max(var(--wp-min-text, 0px), calc(9px * var(--wp-text-scale, 1)));
  font-weight: 720;
  white-space: nowrap;
}

.daily-task.is-readonly .daily-drag-handle { display: none; }

.daily-date-chip {
  flex: 0 0 auto;
  max-width: 125px;
  overflow: hidden;
  padding: 3px 5px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--ink-soft);
  font-size: max(var(--wp-min-text, 0px), calc(10px * var(--wp-text-scale, 1)));
  line-height: 1.2;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.daily-date-chip:hover { background: var(--surface-muted); color: var(--brand-dark); }
.daily-overdue-label { flex: 0 0 auto; color: var(--danger, #a33); font-size: max(var(--wp-min-text, 0px), calc(11px * var(--wp-text-scale, 1))); font-weight: 700; white-space: nowrap; }
.daily-subtask-context {
  flex: 0 0 auto;
  padding: 2px 5px;
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--ink-soft);
  font-size: max(var(--wp-min-text, 0px), calc(9px * var(--wp-text-scale, 1)));
  font-weight: 700;
  white-space: nowrap;
}
.daily-overdue-complete {
  flex: 0 0 auto;
  min-height: 28px;
  padding: 4px 8px;
  font-size: max(var(--wp-min-text, 0px), calc(11px * var(--wp-text-scale, 1)));
}
.daily-task .priority-pill,
.daily-task .recurring-pill { flex: 0 0 auto; font-size: max(var(--wp-min-text, 0px), calc(9px * var(--wp-text-scale, 1))); }

.daily-details-toggle {
  flex: 0 0 auto;
  min-height: 27px;
  padding: 4px 6px;
  color: var(--ink-faint);
  font-size: max(var(--wp-min-text, 0px), calc(10px * var(--wp-text-scale, 1)));
  opacity: 0;
}

.daily-task:hover .daily-details-toggle,
.daily-task:focus-within .daily-details-toggle { opacity: 1; }

.daily-task-options {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin: 0 5px 7px 29px;
  padding: 10px;
  border: 1px solid #e0e8ee;
  border-radius: 8px;
  background: #f8fbfc;
}

.daily-task-options .field { min-width: 0; }
.daily-task-options .field label { margin-bottom: 3px; font-size: max(var(--wp-min-text, 0px), calc(10px * var(--wp-text-scale, 1))); }
.daily-task-options .input,
.daily-task-options .select { min-height: 31px; padding: 5px 7px; font-size: max(var(--wp-min-text, 0px), calc(11px * var(--wp-text-scale, 1))); }
.daily-task-options .full-width { grid-column: 1 / -1; }
.daily-task-options .textarea { min-height: 55px; padding: 6px 7px; font-size: max(var(--wp-min-text, 0px), calc(11px * var(--wp-text-scale, 1))); }
.daily-task-options .check-field { align-self: end; min-height: 31px; font-size: max(var(--wp-min-text, 0px), calc(10px * var(--wp-text-scale, 1))); }

.daily-recurrence-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 34px;
  padding: 6px 8px;
  border: 1px solid #d8e4ed;
  border-radius: 7px;
  background: var(--surface);
}

.daily-recurrence-frequency {
  min-width: 0;
  overflow: hidden;
  color: var(--ink-soft);
  font-size: max(var(--wp-min-text, 0px), calc(11px * var(--wp-text-scale, 1)));
  font-weight: 680;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.daily-auto-visibility-notice {
  margin: 0;
  font-size: max(var(--wp-min-text, 0px), calc(11px * var(--wp-text-scale, 1)));
}

.daily-child-hint {
  grid-column: 1 / -1;
  color: var(--ink-faint);
  font-size: max(var(--wp-min-text, 0px), calc(10px * var(--wp-text-scale, 1)));
}

.daily-task-relations {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 9px;
  min-width: 0;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-raised);
  font-size: max(var(--wp-min-text, 0px), calc(10px * var(--wp-text-scale, 1)));
}

.daily-task-relation-links { display: flex; flex-wrap: wrap; gap: 5px; min-width: 0; }

.daily-task-relation-more {
  display: flex;
  align-items: center;
  flex: 1 1 100%;
  justify-content: space-between;
  gap: 8px;
  color: var(--ink-soft);
}

.daily-empty {
  margin: 7px 7px 9px;
  color: var(--ink-faint);
  font-size: max(var(--wp-min-text, 0px), calc(12px * var(--wp-text-scale, 1)));
}

.daily-new-task {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 35px;
  margin: 4px 4px 0;
  padding: 3px 6px;
  border: 1px solid transparent;
  border-radius: 7px;
  color: #7e91a0;
}

.daily-new-task:focus-within { border-color: var(--line-strong); background: var(--surface-hover); }
.daily-new-task > span { color: var(--ink-faint); font-size: max(var(--wp-min-text, 0px), calc(18px * var(--wp-text-scale, 1))); font-weight: 300; }

.daily-new-input {
  width: 100%;
  min-width: 0;
  height: 27px;
  padding: 3px 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: max(var(--wp-min-text, 0px), calc(12px * var(--wp-text-scale, 1)));
}

.daily-new-input::placeholder { color: var(--ink-faint); }

.daily-quick-add-field {
  display: grid;
  flex: 1 1 220px;
  min-width: 0;
}

.daily-quick-add-message {
  min-height: 0;
  color: var(--ink-faint);
  font-size: max(var(--wp-min-text, 0px), calc(10px * var(--wp-text-scale, 1)));
  line-height: 1.35;
}

.daily-quick-add-message:empty { display: none; }
.daily-quick-add-message.is-saving { color: var(--ink-soft); }
.daily-quick-add-message.is-error { color: var(--danger, #9b2c2c); }

.daily-new-task.has-error {
  border-color: var(--danger, #b33a3a);
  background: var(--red-soft, #fff4f4);
}

.daily-quick-add-submit,
.daily-quick-add-retry { flex: 0 0 auto; }

.daily-task-options-state {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  color: var(--ink-soft);
  font-size: max(var(--wp-min-text, 0px), calc(11px * var(--wp-text-scale, 1)));
}

.daily-task-options-state.is-error {
  border-color: var(--danger, #b33a3a);
  background: var(--red-soft, #fff4f4);
}

.daily-edit-conflict {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  margin: 0 5px 7px 29px;
  padding: 9px 10px;
  border: 1px solid var(--amber, #b7791f);
  border-radius: 8px;
  background: #fff8e8;
}

.daily-edit-conflict-copy { display: grid; min-width: 0; gap: 2px; font-size: max(var(--wp-min-text, 0px), calc(11px * var(--wp-text-scale, 1))); }
.daily-edit-conflict-copy span { color: var(--ink-soft); }
.daily-edit-conflict-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 5px; }

/* Personal dashboard and calendar: use the available desktop width without
   turning a daily planning view into a wall of cards.  The selectors are
   deliberately scoped so All Tasks and Team Calendar retain their layouts. */
.dashboard-page,
.personal-calendar {
  width: min(100%, 1920px);
  max-width: none;
}

.dashboard-page {
  gap: 18px;
  margin-inline: auto;
}

.dashboard-page .page-header {
  margin-bottom: 0;
}

.dashboard-summary {
  min-width: 0;
}

.dashboard-summary-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 11px;
}

.dashboard-summary-button {
  display: grid;
  align-content: start;
  justify-items: start;
  min-width: 0;
  min-height: 92px;
  gap: 5px;
  padding: 13px 14px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
  font: inherit;
  text-align: left;
  transition: border-color 140ms ease, box-shadow 140ms ease, background-color 140ms ease, transform 140ms ease;
}

.dashboard-summary-button:hover:not(:disabled) {
  border-color: #b9cad6;
  background: #fbfdfd;
  box-shadow: 0 4px 13px rgb(23 33 47 / 8%);
  transform: translateY(-1px);
}

.dashboard-summary-button:focus-visible {
  outline: none;
  border-color: var(--brand);
  box-shadow: var(--focus-ring);
}

.dashboard-summary-label,
.dashboard-summary-button > span:first-child {
  color: var(--ink-soft);
  font-size: max(var(--wp-min-text, 0px), calc(11px * var(--wp-text-scale, 1)));
  font-weight: 730;
  line-height: 1.25;
}

.dashboard-summary-count,
.dashboard-summary-button > strong {
  color: var(--ink);
  font-size: clamp(24px, 2.2vw, 30px);
  font-variant-numeric: tabular-nums;
  font-weight: 770;
  letter-spacing: -0.045em;
  line-height: 1;
}

.dashboard-summary-detail,
.dashboard-summary-button > small,
.dashboard-summary-button .metric-sub {
  min-width: 0;
  margin-top: auto;
  overflow: hidden;
  color: var(--ink-faint);
  font-size: max(var(--wp-min-text, 0px), calc(10px * var(--wp-text-scale, 1)));
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-summary-button.is-overdue,
.dashboard-summary-button[data-summary="overdue"] {
  border-top: 3px solid var(--red);
}

.dashboard-summary-button.is-today,
.dashboard-summary-button[data-summary="today"] {
  border-top: 3px solid var(--blue);
}

.dashboard-summary-button.is-high-priority,
.dashboard-summary-button[data-summary="high-critical"] {
  border-top: 3px solid var(--amber);
}

.dashboard-summary-button.is-completed,
.dashboard-summary-button[data-summary="completed"] {
  border-top: 3px solid var(--green);
}

.dashboard-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.28fr) minmax(390px, 0.92fr);
  align-items: start;
  gap: 18px;
}

.dashboard-task-panel,
.dashboard-calendar-panel {
  min-width: 0;
}

.dashboard-task-panel {
  overflow: hidden;
}

.dashboard-task-panel .card-header,
.dashboard-calendar-panel .card-header {
  min-height: 52px;
  padding: 13px 15px;
}

.dashboard-task-panel .card-header h2,
.dashboard-calendar-panel .card-header h2 {
  font-size: max(var(--wp-min-text, 0px), calc(14px * var(--wp-text-scale, 1)));
}

.dashboard-task-group {
  min-width: 0;
  border-bottom: 1px solid var(--line);
}

.dashboard-task-group:last-of-type {
  border-bottom: 0;
}

/* Empty personal sections should confirm that there is nothing to do without
   turning a clean Dashboard into three full-height blank cards. */
.dashboard-task-group > .empty-state {
  min-height: 72px;
  padding: 18px 14px;
}

.dashboard-task-group > header,
.dashboard-task-group-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  min-height: 35px;
  padding: 10px 14px 6px;
  color: var(--ink-soft);
}

.dashboard-task-group > header h2,
.dashboard-task-group > header h3,
.dashboard-task-group-header h2,
.dashboard-task-group-header h3 {
  margin: 0;
  color: var(--ink);
  font-size: max(var(--wp-min-text, 0px), calc(12px * var(--wp-text-scale, 1)));
  font-weight: 780;
  letter-spacing: 0.025em;
  text-transform: uppercase;
}

.dashboard-task-group > header small,
.dashboard-task-group-header small {
  color: var(--ink-faint);
  font-size: max(var(--wp-min-text, 0px), calc(10px * var(--wp-text-scale, 1)));
  font-variant-numeric: tabular-nums;
}

.dashboard-task-panel .task-row {
  min-height: 56px;
  padding: 8px 14px;
}

.dashboard-task-panel .task-row--compact {
  gap: 9px;
}

.dashboard-task-panel .task-row-meta {
  margin-top: 3px;
}

.dashboard-task-panel .task-row-tags {
  gap: 4px;
}

.dashboard-task-panel .task-row-tags .status-pill {
  display: none;
}

.dashboard-task-panel .series-summary {
  gap: 8px 12px;
  padding: 10px 14px;
  background: #f8fafc;
}

.dashboard-task-panel .series-summary-title {
  font-size: max(var(--wp-min-text, 0px), calc(12px * var(--wp-text-scale, 1)));
}

.dashboard-task-panel .series-summary-meta {
  gap: 5px;
  margin-top: 4px;
  font-size: max(var(--wp-min-text, 0px), calc(10px * var(--wp-text-scale, 1)));
}

.dashboard-task-panel .series-summary-meta > span:not(.recurring-pill) + span:not(.recurring-pill)::before {
  margin-right: 5px;
}

.dashboard-task-panel .series-summary-actions {
  gap: 4px;
}

.dashboard-task-panel .series-summary-actions .button {
  min-height: 27px;
  padding: 4px 7px;
  font-size: max(var(--wp-min-text, 0px), calc(10px * var(--wp-text-scale, 1)));
}

.dashboard-task-panel .series-occurrences {
  max-height: 330px;
  overflow: auto;
  margin: 0 -14px -10px;
}

.dashboard-task-panel .series-occurrences .task-row {
  min-height: 52px;
  padding-right: 14px;
  padding-left: 14px;
}

.dashboard-quick-add {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 14px 13px;
  border-top: 1px solid var(--line);
  background: #fbfcfd;
}

.dashboard-quick-add .daily-new-task {
  flex: 1 1 520px;
  min-width: 0;
  margin: 0;
  padding: 2px 5px;
}

.dashboard-quick-add > .daily-save-state { margin-top: 8px; }

.dashboard-task-filters {
  display: grid;
  gap: 9px;
  padding: 12px 14px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--surface-raised, #fff);
}

.dashboard-task-filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 138px), 1fr));
  gap: 8px;
  min-width: 0;
}

.dashboard-task-filter { min-width: 0; }
.dashboard-task-filter label { margin-bottom: 4px; color: var(--ink-soft); font-size: max(var(--wp-min-text, 0px), calc(10px * var(--wp-text-scale, 1))); font-weight: 720; }
.dashboard-task-filter .select { width: 100%; min-width: 0; min-height: 34px; font-size: max(var(--wp-min-text, 0px), calc(11px * var(--wp-text-scale, 1))); }

.dashboard-task-filter-state,
.dashboard-task-results-state {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 7px 12px;
  min-width: 0;
  color: var(--ink-soft);
  font-size: max(var(--wp-min-text, 0px), calc(11px * var(--wp-text-scale, 1)));
}

.dashboard-task-results-state {
  padding: 10px 14px 4px;
}

.dashboard-task-results-state span { color: var(--ink-faint); }
.dashboard-filtered-results,
.dashboard-default-task-groups { min-width: 0; }

.my-work-task-content { display: grid; min-width: 0; gap: 10px; padding: 12px 14px 14px; }

.my-work-task-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
}

.my-work-task-summary > div {
  display: grid;
  min-width: 0;
  gap: 2px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
}

.my-work-task-summary strong { font-size: max(var(--wp-min-text, 0px), calc(18px * var(--wp-text-scale, 1))); font-variant-numeric: tabular-nums; }
.my-work-task-summary span { color: var(--ink-soft); font-size: max(var(--wp-min-text, 0px), calc(10px * var(--wp-text-scale, 1))); }
.my-work-task-list { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }

.dashboard-quick-add .input,
.dashboard-quick-add input {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 34px;
}

.dashboard-quick-add .button {
  flex: 0 0 auto;
  min-height: 34px;
}

.dashboard-calendar-panel {
  overflow: hidden;
}

.dashboard-calendar-preview {
  min-width: 0;
}

.dashboard-calendar-preview .calendar {
  border-width: 0;
  border-radius: 0;
  box-shadow: none;
}

.dashboard-calendar-preview .calendar-toolbar {
  min-height: 51px;
  padding: 10px 12px;
}

.dashboard-calendar-preview .calendar-toolbar h2,
.dashboard-calendar-preview .calendar-toolbar h3 {
  font-size: max(var(--wp-min-text, 0px), calc(13px * var(--wp-text-scale, 1)));
}

.dashboard-calendar-preview .calendar-toolbar-actions,
.dashboard-calendar-preview .calendar-navigation {
  gap: 3px;
}

.dashboard-calendar-preview .calendar-toolbar .button {
  min-height: 29px;
  padding: 5px 7px;
  font-size: max(var(--wp-min-text, 0px), calc(10px * var(--wp-text-scale, 1)));
}

.dashboard-calendar-preview .calendar-toolbar .button-icon {
  width: 29px;
  padding: 0;
}

.dashboard-calendar-preview .day-cell {
  min-height: 96px;
  padding: 5px;
}

.dashboard-calendar-preview .weekday,
.dashboard-calendar-preview .calendar-weekday {
  padding: 7px 3px;
  font-size: max(var(--wp-min-text, 0px), calc(8px * var(--wp-text-scale, 1)));
}

.dashboard-calendar-preview .day-events {
  gap: 3px;
  margin-top: 4px;
}

.dashboard-calendar-preview .event {
  min-height: 20px;
  padding: 3px 4px;
  font-size: max(var(--wp-min-text, 0px), calc(9px * var(--wp-text-scale, 1)));
  line-height: 1.18;
  white-space: nowrap;
}

.dashboard-calendar-preview .more-events {
  padding: 1px 3px;
  font-size: max(var(--wp-min-text, 0px), calc(9px * var(--wp-text-scale, 1)));
}

.personal-calendar {
  gap: 15px;
}

.personal-calendar-filter-controls {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.personal-calendar-filter-summary {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 10px;
  min-height: 38px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-raised);
  box-shadow: var(--shadow-sm);
}

.personal-calendar-filter-copy {
  min-width: 0;
  flex: 1 1 250px;
  color: var(--ink-soft);
  font-size: max(var(--wp-min-text, 0px), calc(12px * var(--wp-text-scale, 1)));
  line-height: 1.35;
}

.personal-calendar-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr)) auto;
  align-items: end;
  gap: 8px;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-muted);
}

.personal-calendar-filters[hidden] {
  display: none;
}

.personal-calendar-filters .field,
.personal-calendar-filters .check-field {
  min-width: 0;
  margin: 0;
}

.personal-calendar-filters .input,
.personal-calendar-filters .select {
  min-height: 33px;
  padding: 6px 8px;
  font-size: max(var(--wp-min-text, 0px), calc(11px * var(--wp-text-scale, 1)));
}

.personal-calendar-filter-toggle {
  justify-self: start;
  min-height: 32px;
  padding: 6px 9px;
  color: var(--ink-soft);
  font-size: max(var(--wp-min-text, 0px), calc(11px * var(--wp-text-scale, 1)));
}

/* The neutral charcoal scrim deliberately avoids colouring the planner while
   retaining clear contrast and a predictable click target behind the dialog. */
.modal {
  isolation: isolate;
  background: var(--overlay);
}

.modal-backdrop {
  background: transparent;
}

.modal-dialog,
.modal-card {
  outline: none;
}

/* Compact dashboard surfaces use their outer card classes, not the content
   panels inside them. */
.dashboard-task-card .card-header,
.dashboard-calendar-card .card-header {
  min-height: 52px;
  padding: 13px 15px;
}

.dashboard-task-card .card-header h2,
.dashboard-calendar-card .card-header h2 {
  font-size: max(var(--wp-min-text, 0px), calc(14px * var(--wp-text-scale, 1)));
}

.dashboard-task-group-count {
  color: var(--ink-faint);
  font-size: max(var(--wp-min-text, 0px), calc(10px * var(--wp-text-scale, 1)));
  font-variant-numeric: tabular-nums;
}

.dashboard-summary-button.is-selected,
.dashboard-summary-button[aria-pressed="true"] {
  border-color: var(--brand);
  background: var(--brand-soft);
  box-shadow: inset 0 0 0 2px rgb(174 23 48 / 18%), var(--shadow-sm);
}

.dashboard-summary-button[data-summary="due-week"] {
  border-top: 3px solid var(--violet);
}

.dashboard-calendar-preview-content {
  display: grid;
  gap: 8px;
  padding: 12px 14px 14px;
}

.dashboard-calendar-layer-toggle {
  display: flex;
  justify-content: flex-end;
  min-height: 30px;
  margin: 9px 14px -3px;
  color: var(--ink-soft);
  font-size: max(var(--wp-min-text, 0px), calc(10px * var(--wp-text-scale, 1)));
}

.dashboard-calendar-layer-toggle input {
  width: 13px;
  height: 13px;
}

.dashboard-calendar-layer-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.dashboard-calendar-preview-heading {
  margin: 0;
  color: var(--ink-soft);
  font-size: max(var(--wp-min-text, 0px), calc(12px * var(--wp-text-scale, 1)));
  font-weight: 700;
}

.dashboard-calendar-list {
  display: grid;
  gap: 6px;
}

.dashboard-calendar-item {
  display: grid;
  grid-template-columns: 55px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  width: 100%;
  min-height: 48px;
  padding: 8px 9px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--brand);
  border-radius: var(--radius-sm);
  background: var(--surface-muted);
  color: var(--ink);
  text-align: left;
}

.dashboard-calendar-item:hover {
  border-color: var(--line-strong);
  background: var(--surface-hover);
}

.dashboard-calendar-item.is-deadline { border-left-color: var(--amber); }
.dashboard-calendar-item.is-personal-event { border-left-color: var(--violet); }
.dashboard-calendar-item.is-priority { border-left-color: var(--red); }
.dashboard-calendar-item.is-bank-holiday { border-left-color: #7c6fb0; background: #f8f6fd; }
.dashboard-calendar-item.is-approved-absence { border-left-color: var(--absence); background: var(--absence-soft); }
.dashboard-calendar-item.is-owner-unavailable { border-right: 3px solid var(--amber); background: var(--amber-soft); }

.dashboard-calendar-item-time,
.dashboard-calendar-item-kind {
  color: var(--ink-faint);
  font-size: max(var(--wp-min-text, 0px), calc(10px * var(--wp-text-scale, 1)));
  font-variant-numeric: tabular-nums;
}

.dashboard-calendar-item-main {
  min-width: 0;
}

.dashboard-calendar-item-main strong,
.dashboard-calendar-item-main span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-calendar-item-main strong { font-size: max(var(--wp-min-text, 0px), calc(12px * var(--wp-text-scale, 1))); }
.dashboard-calendar-item-main span { margin-top: 2px; color: var(--ink-soft); font-size: max(var(--wp-min-text, 0px), calc(10px * var(--wp-text-scale, 1))); }
.dashboard-calendar-more { justify-self: start; }

.dashboard-completed-toggle {
  display: flex;
  justify-content: flex-end;
  padding: 0 14px 8px;
  border-top: 1px solid var(--line);
  background: #fbfcfd;
}

/* Team task blocks carry enough planning detail to be understood without a
   tooltip. Availability remains intentionally summary-only. */
.event--with-meta {
  display: grid;
  gap: 2px;
  width: 100%;
  text-align: left;
  white-space: normal !important;
}

.event--with-meta.event--task-block::before { content: none; }

.calendar-event-title {
  overflow: hidden;
  font-size: inherit;
  font-weight: 760;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-event-title::before { margin-right: 3px; content: '◦'; }

.calendar-event-meta {
  overflow: hidden;
  color: inherit;
  font-size: max(var(--wp-min-text, 0px), calc(9px * var(--wp-text-scale, 1)));
  font-weight: 570;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
  opacity: 0.9;
}

.calendar-event-meta--status { font-weight: 680; }
.calendar-event-meta--warning { color: #815712; font-weight: 760; }

.event--owner-unavailable {
  border-right: 3px solid var(--amber);
  background: var(--amber-soft);
}

.task-label-picker {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 11px 12px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-muted);
}

.task-label-picker legend {
  padding: 0 4px;
  color: var(--ink-soft);
  font-size: max(var(--wp-min-text, 0px), calc(12px * var(--wp-text-scale, 1)));
  font-weight: 700;
}

.task-label-options {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.task-label-options .check-field {
  min-height: 29px;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-size: max(var(--wp-min-text, 0px), calc(11px * var(--wp-text-scale, 1)));
}

.department-settings-list {
  display: grid;
  gap: 7px;
}

.department-settings-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-muted);
}

.department-settings-row .muted { flex: 1; }
.department-settings-row.is-archived { opacity: 0.7; }

.brighthr-feed-card {
  gap: 12px;
}

.brighthr-feed-connection {
  gap: 9px;
}

.brighthr-status {
  display: grid;
  gap: 4px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-muted);
}

.brighthr-status-indicator {
  color: var(--ink-soft);
  font-size: max(var(--wp-min-text, 0px), calc(12px * var(--wp-text-scale, 1)));
  font-weight: 700;
}

.brighthr-status-indicator.is-connected { color: #276b49; }
.brighthr-status-indicator.is-warning { color: #8a5c19; }

.brighthr-unclassified-status {
  color: #815712;
  font-size: max(var(--wp-min-text, 0px), calc(11px * var(--wp-text-scale, 1)));
  line-height: 1.35;
}

.brighthr-masked-url {
  overflow-wrap: anywhere;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: max(var(--wp-min-text, 0px), calc(10px * var(--wp-text-scale, 1)));
}

.brighthr-feed-actions {
  align-items: center;
  gap: 7px;
}

.brighthr-feed-feedback.is-success {
  border-color: #a9d6b9;
  background: #edf9f1;
  color: #276b49;
}

.brighthr-unmatched-section {
  display: grid;
  gap: 7px;
  padding-top: 11px;
  border-top: 1px solid var(--line);
}

.brighthr-unmatched-section h3 {
  margin: 0;
  font-size: max(var(--wp-min-text, 0px), calc(13px * var(--wp-text-scale, 1)));
}

.brighthr-unmatched-list {
  display: grid;
  gap: 7px;
}

.brighthr-unmatched-row {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(180px, 0.9fr) auto;
  align-items: end;
  gap: 8px;
  padding: 8px 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-muted);
}

.brighthr-unmatched-row strong,
.brighthr-unmatched-row .muted {
  display: block;
}

.brighthr-unmatched-row .muted {
  margin-top: 2px;
  font-size: max(var(--wp-min-text, 0px), calc(11px * var(--wp-text-scale, 1)));
}

.brighthr-unmatched-row .field {
  min-width: 0;
}

@media (max-width: 680px) {
  .brighthr-unmatched-row { grid-template-columns: 1fr; }
  .brighthr-feed-actions { align-items: stretch; }
}

.task-label-options .check-field:has(input:checked) {
  border-color: var(--wp-brand-border);
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.task-label-options .check-field input:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.related-task-pagination {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.related-task-pagination-status {
  margin: 0;
}

.task-detail-children {
  display: grid;
  gap: 7px;
  padding-top: 2px;
}

.task-detail-children h4 { margin: 0; font-size: max(var(--wp-min-text, 0px), calc(13px * var(--wp-text-scale, 1))); }
.task-detail-child-list { display: grid; gap: 6px; }

.task-detail-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 8px 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-muted);
  color: var(--ink);
  font-size: max(var(--wp-min-text, 0px), calc(12px * var(--wp-text-scale, 1)));
  text-align: left;
}

.task-detail-child:hover { border-color: var(--line-strong); background: var(--surface-hover); }

/* The app creates .toast-tray; retain the older container selector for
   compatibility while ensuring Undo remains visible and usable. */
.toast-tray,
.toast-container {
  position: fixed;
  z-index: 200;
  right: 20px;
  bottom: 20px;
  display: grid;
  gap: 9px;
  width: min(380px, calc(100vw - 40px));
}

.toast-message { min-width: 0; flex: 1 1 auto; }
.toast-action { flex: 0 0 auto; align-self: center; }
.toast-close { flex: 0 0 auto; align-self: flex-start; min-width: 28px; min-height: 28px; padding: 2px 5px; }

/* -------------------------------------------------------------------------
   Work-Place shared visual system

   This presentation-only layer intentionally reuses the existing component
   selectors. It gives every current and future department one calm visual
   language without changing routes, data, or interaction logic.
   ------------------------------------------------------------------------- */

html,
body {
  background: var(--canvas);
  color: var(--ink);
}

::selection {
  background: var(--brand-soft);
  color: var(--ink);
}

.auth-shell {
  background: var(--canvas);
}

.auth-card {
  border-color: var(--line);
  background: var(--surface-raised);
  box-shadow: var(--shadow-lg);
}

.auth-card label,
.field label,
.field-label,
.check-field {
  color: var(--ink-soft);
}

a {
  color: var(--brand-dark);
  text-underline-offset: 2px;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--focus-outline);
  outline-offset: 2px;
  box-shadow: var(--focus-ring);
}

.app-shell {
  background: var(--canvas);
}

.sidebar {
  background: var(--sidebar);
  color: var(--sidebar-text);
  border-right-color: rgb(255 252 248 / 12%);
  box-shadow: 7px 0 24px rgb(31 45 39 / 12%);
}

.brand-lockup,
.brand,
.sidebar-brand,
.brand-lockup:hover,
.brand-lockup:focus-visible {
  color: var(--sidebar-text);
}

.brand-kicker,
.sidebar-section,
.sidebar-footer small {
  color: var(--sidebar-muted);
}

.brand-mark {
  background: var(--surface-raised);
  color: var(--brand);
  box-shadow: inset 0 1px rgb(255 252 248 / 34%);
}

.nav-link {
  color: #E6E2DC;
  border-radius: 10px;
}

.nav-link .nav-icon {
  color: #D3CDC6;
}

.nav-link .nav-count {
  background: rgb(255 252 248 / 11%);
  color: var(--sidebar-text);
}

.nav-link:hover {
  background: var(--sidebar-hover);
  color: #fffdf9;
}

.nav-link.active,
.nav-link[aria-current="page"] {
  border-color: rgb(210 35 60 / 42%);
  background: var(--sidebar-selected);
  color: #fffdf9;
  box-shadow: inset 3px 0 0 var(--wp-brand-red);
}

.nav-link.active .nav-icon,
.nav-link[aria-current="page"] .nav-icon {
  color: #FFD5DC;
}

.sidebar-footer {
  border-top-color: rgb(255 252 248 / 13%);
  color: var(--sidebar-text);
}

.topbar {
  border-bottom-color: var(--line);
  background: rgb(255 252 248 / 93%);
  box-shadow: 0 1px 0 rgb(91 72 49 / 4%);
}

.topbar-title h1,
.page-title,
.page-header h1 {
  color: var(--ink);
  font-weight: 740;
}

.topbar-title p,
.page-subtitle,
.page-description,
.topbar-context {
  color: var(--ink-soft);
}

.eyebrow {
  color: var(--brand);
}

.card,
.metric-card,
.calendar,
.agenda,
.table-wrap,
.calendar-legend,
.feed-week-wrap,
.week-grid-wrap {
  border-color: var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.card-header,
.calendar-toolbar {
  border-bottom-color: var(--line);
}

.card-footer {
  border-top-color: var(--line);
  background: var(--surface-muted);
}

.metric-card {
  background: var(--surface-raised);
}

.metric-card::after {
  background: var(--brand);
}

.metric-card.accent-amber::after { background: var(--accent-gold); }
.metric-card.accent-red::after { background: var(--accent-terracotta); }
.metric-card.accent-green::after { background: var(--green); }

.filter-bar,
.personal-calendar-filters,
.task-label-picker {
  border-color: var(--line);
  background: var(--surface-raised);
  box-shadow: var(--shadow-sm);
}

.input,
.select,
.textarea,
.filter-bar input,
.filter-bar select,
.form-control,
.auth-card input {
  border-color: var(--line-strong);
  background: var(--surface-raised);
  color: var(--ink);
}

.input:hover,
.select:hover,
.textarea:hover,
.filter-bar input:hover,
.filter-bar select:hover,
.form-control:hover {
  border-color: #bcae9e;
}

.input:focus,
.select:focus,
.textarea:focus,
.filter-bar input:focus,
.filter-bar select:focus,
.form-control:focus,
.auth-card input:focus {
  border-color: var(--brand);
  box-shadow: var(--focus-ring);
}

.button,
button.button {
  border-color: transparent;
  background: #ede7df;
  color: #40504a;
}

.button:hover:not(:disabled),
button.button:hover:not(:disabled) {
  background: #e4dbd0;
  color: var(--ink);
}

.button-primary,
.button.primary {
  border-color: var(--brand);
  background: var(--brand);
  color: #fffdf9;
  box-shadow: 0 1px 2px rgb(22 63 59 / 24%);
}

.button-primary:hover:not(:disabled),
.button.primary:hover:not(:disabled) {
  border-color: var(--brand-dark);
  background: var(--brand-dark);
  color: #fffdf9;
}

.button-secondary,
.button-outline {
  border-color: var(--line-strong);
  background: var(--surface-raised);
  color: #40504a;
}

.button-secondary:hover:not(:disabled),
.button-outline:hover:not(:disabled) {
  border-color: #bcae9e;
  background: var(--surface-hover);
}

.button-danger {
  border-color: #dca9a2;
  background: var(--surface-raised);
  color: #8d352e;
}

.button-danger:hover:not(:disabled) {
  border-color: var(--red);
  background: var(--red-soft);
}

.button-ghost {
  color: var(--ink-soft);
}

.button-ghost:hover:not(:disabled) {
  background: var(--surface-muted);
  color: var(--ink);
}

.series-summary,
.dashboard-task-panel .series-summary {
  border-bottom-color: var(--line);
  background: var(--surface-muted);
}

.series-occurrences,
.series-occurrences .task-row {
  background: var(--surface-raised);
}

.task-row {
  border-bottom-color: var(--line);
  background: var(--surface-raised);
}

.task-row:hover {
  background: var(--surface-hover);
}

.task-row.is-important,
.task-row--high {
  box-shadow: inset 4px 0 0 var(--accent-gold);
}

.task-row--critical {
  border-left-color: var(--red);
  background: #fff5f3;
  box-shadow: inset 4px 0 0 var(--red), 0 0 0 1px rgb(170 77 67 / 9%);
}

.task-row.is-blocked,
.task-row.is-overdue {
  background: #fff8f6;
  box-shadow: inset 3px 0 0 var(--red);
}

.task-row.is-completed,
.task-row[data-status="completed"] {
  background: var(--surface-muted);
}

.task-check,
.check-field input {
  accent-color: var(--brand);
}

.task-title-button:hover {
  color: var(--brand-dark);
}

.status-pill,
.priority-pill,
.visibility-pill,
.access-pill,
.tag,
.recurring-pill,
.auto-visible-pill,
.owner-unavailable-pill,
.department-chip {
  border-color: var(--line-strong);
  background: var(--surface-muted);
  color: var(--ink-soft);
}

.status-in-progress,
.status-active,
[data-status="in-progress"] .status-pill,
[data-status="active"] .status-pill {
  border-color: var(--wp-info-border);
  background: var(--blue-soft);
  color: var(--blue);
}

.status-completed,
.status-done,
.is-completed .status-pill,
[data-status="completed"] .status-pill,
[data-status="done"] .status-pill {
  border-color: var(--wp-success-border);
  background: var(--green-soft);
  color: var(--wp-success-ink);
}

.status-blocked,
.is-blocked .status-pill,
[data-status="blocked"] .status-pill,
.status-overdue,
.is-overdue .status-pill,
[data-status="overdue"] .status-pill,
.priority-critical,
[data-priority="critical"] .priority-pill {
  border-color: var(--danger-border);
  background: var(--red-soft);
  color: var(--wp-danger-ink);
}

.priority-high,
.priority-urgent,
.is-important .priority-pill,
[data-priority="high"] .priority-pill,
[data-priority="urgent"] .priority-pill,
.owner-unavailable-pill {
  border-color: var(--warning-border);
  background: var(--amber-soft);
  color: var(--wp-warning-ink);
}

.auto-visible-pill {
  border-color: var(--wp-brand-border);
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.recurring-pill {
  border-color: var(--wp-holiday-border);
  background: var(--violet-soft);
  color: var(--wp-holiday-ink);
}

.department-chip {
  max-width: min(200px, 40vw);
}

.calendar-toolbar {
  background: var(--surface-raised);
}

.weekday,
.calendar-weekday,
.week-corner,
.week-day-header,
.week-time--all-day,
.agenda-day {
  border-color: var(--line);
  background: var(--surface-muted);
  color: var(--ink-soft);
}

.day-cell,
.feed-week-day,
.week-all-day-cell {
  border-color: var(--line);
  background: var(--surface-raised);
}

.day-cell:hover,
.week-slot:hover {
  background-color: var(--surface-hover);
}

.day-cell.other-month,
.day-cell.is-outside,
.day-cell.is-weekend {
  background: #faf7f2;
}

.day-cell.other-month .day-number,
.day-cell.is-outside .day-number {
  color: #a59c91;
}

.day-cell.is-today,
.feed-week-day.is-today {
  background: var(--calendar-today);
}

.is-today .day-number,
.week-day-header.is-today strong {
  background: var(--brand);
  color: #fffdf9;
}

.day-number-button:hover {
  background: var(--surface-muted);
}

.event,
.week-event {
  border-color: var(--wp-brand-border);
  border-left-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.event:hover,
.week-event:hover {
  filter: none;
  background: var(--wp-brand-soft-hover);
}

.event--availability,
.week-event.private,
.week-event[data-visibility="private"] {
  border-color: var(--wp-holiday-border);
  border-left-color: var(--violet);
  background: var(--violet-soft);
  color: var(--wp-holiday-ink);
}

.event--availability-out-of-office {
  border-color: var(--danger-border);
  border-left-color: var(--red);
  background: var(--red-soft);
  color: #86362f;
}

.event--availability-free {
  border-color: #bfd7c6;
  border-left-color: var(--green);
  background: var(--green-soft);
  color: #2f6449;
}

/* Approved BrightHR blocks remain generic, distinct, and deliberately less
   prominent than a user's tasks. */
.event--approved-absence,
.dashboard-calendar-item.is-approved-absence {
  border-color: #c5d1cc;
  border-left-color: var(--absence);
  background: var(--absence-soft);
  color: #415854;
}

.event--bank-holiday,
.dashboard-calendar-item.is-bank-holiday {
  border-color: #d8cedf;
  border-left-color: var(--holiday);
  background: var(--holiday-soft);
  color: #594c67;
}

.event--deadline,
.event.deadline,
[data-kind="deadline"].event,
.week-event.deadline,
.week-event[data-kind="deadline"] {
  border-color: var(--warning-border);
  border-left-color: var(--accent-gold);
  background: var(--amber-soft);
  color: #745018;
}

.event--important,
.event.important,
.event.is-important {
  border-color: #e1b9b2;
  border-left-color: var(--accent-terracotta);
  background: #fbedeb;
  color: #813f35;
}

.event--auto-visible,
.event--high {
  border-color: var(--warning-border);
  border-left-color: var(--accent-gold);
  background: var(--amber-soft);
  color: #745018;
}

.event--critical {
  border-color: var(--red);
  border-left-color: #92362e;
  background: #fff2f0;
  box-shadow: inset 0 0 0 1px rgb(170 77 67 / 10%);
  color: #7e2f29;
}

.event--blocked,
.event.blocked,
[data-status="blocked"].event {
  border-color: var(--danger-border);
  border-left-color: var(--red);
  background: var(--red-soft);
  color: #86362f;
}

.event--completed,
.event.completed,
[data-status="completed"].event {
  border-color: #bfd7c6;
  border-left-color: var(--green);
  background: var(--green-soft);
  color: #2f6449;
}

.calendar-drop-target,
.daily-task.daily-drop-target,
.daily-section.daily-section-drop-target {
  outline-color: var(--brand);
  background-color: var(--brand-soft) !important;
}

.calendar-event-kind,
.calendar-legend-option {
  border-color: var(--line);
  background: var(--surface-muted);
  color: var(--ink-soft);
}

.week-slot {
  border-color: var(--line);
  background-image: linear-gradient(to bottom, transparent 50%, rgb(225 217 208 / 65%) 50%);
}

.week-time,
.week-corner {
  border-color: var(--line);
  color: var(--ink-faint);
}

.agenda-item,
.day-agenda-item,
.calendar-block-row,
.planning-entity {
  border-color: var(--line);
  background: var(--surface-raised);
}

.agenda-item:hover,
.day-agenda-item:hover,
.dashboard-calendar-item:hover {
  background: var(--surface-hover);
}

.agenda-day.is-today {
  background: var(--calendar-today);
  color: var(--brand-dark);
}

.agenda-item--high,
.day-agenda-item--high {
  box-shadow: inset 4px 0 0 var(--accent-gold);
}

.agenda-item--critical,
.day-agenda-item--critical {
  border-left-color: var(--red);
  background: #fff5f3;
  box-shadow: inset 4px 0 0 var(--red);
}

.dashboard-summary-button {
  border-color: var(--line);
  background: var(--surface-raised);
  box-shadow: var(--shadow-sm);
}

.dashboard-summary-button:hover:not(:disabled) {
  border-color: #c7b9aa;
  background: var(--surface-hover);
  box-shadow: var(--shadow);
}

.dashboard-summary-button[data-summary="today"] {
  border-top-color: var(--brand);
}

.dashboard-summary-button[data-summary="high-critical"] {
  border-top-color: var(--accent-gold);
}

.dashboard-quick-add,
.dashboard-completed-toggle {
  border-color: var(--line);
  background: var(--surface-muted);
}

.dashboard-task-group > header h2,
.dashboard-task-group > header h3,
.dashboard-task-group-header h2,
.dashboard-task-group-header h3,
.daily-section-header h2 {
  color: #40514b;
}

.dashboard-calendar-item {
  border-color: var(--line);
  border-left-color: var(--brand);
  background: var(--surface-muted);
  color: var(--ink);
}

.dashboard-calendar-item.is-deadline { border-left-color: var(--accent-gold); }
.dashboard-calendar-item.is-personal-event { border-left-color: var(--violet); }
.dashboard-calendar-item.is-priority { border-left-color: var(--accent-terracotta); }
.dashboard-calendar-item.is-owner-unavailable,
.event--owner-unavailable {
  border-right-color: var(--accent-gold);
  background: #fff8ec;
}

.daily-section {
  border-color: var(--line);
  background: var(--surface-raised);
  box-shadow: var(--shadow-sm);
}

.daily-section:hover {
  border-color: #c7b9aa;
}

.daily-section-header {
  border-bottom-color: var(--line);
}

.daily-task:hover,
.daily-task:focus-within {
  border-color: #ddd1c4;
  background: var(--surface-hover);
}

.daily-task.is-blocked {
  border-left-color: var(--accent-gold);
}

.daily-drag-handle,
.daily-new-task,
.daily-new-input::placeholder {
  color: var(--ink-faint);
}

.daily-task:hover .daily-drag-handle,
.daily-task:focus-within .daily-drag-handle {
  color: var(--ink-soft);
}

.daily-task-check {
  border-color: #9fa89f;
  background: var(--surface-raised);
}

.daily-task-check:checked {
  border-color: var(--green);
  background: var(--green);
  box-shadow: inset 0 0 0 3px var(--surface-raised);
}

.daily-task-title:hover,
.daily-date-chip:hover {
  background: var(--surface-muted);
}

.daily-task-title:focus {
  border-color: var(--brand);
  background: var(--surface-raised);
  box-shadow: var(--focus-ring);
}

.daily-task-options,
.daily-recurrence-summary,
.recurrence-fields,
.recurrence-daily-schedule,
.weekday-picker,
.planning-fields,
.planning-detail {
  border-color: var(--line);
  background: var(--surface-muted);
}

.planning-detail {
  border-color: var(--line);
  background: var(--surface-muted);
}

.planning-detail-grid > div,
.planning-entity-list,
.calendar-block-list,
.day-agenda-list {
  border-color: var(--line);
  background: var(--surface-raised);
}

.planning-detail-grid > div {
  background: var(--surface-raised);
}

.planning-access {
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.planning-chip,
.planning-chip--person {
  border-color: var(--line-strong);
  background: var(--surface-raised);
  color: var(--ink-soft);
}

.series-preview,
.series-danger-zone,
.related-task,
.department-settings-row,
.brighthr-status,
.brighthr-unmatched-row,
.task-detail-child {
  border-color: var(--line);
  background: var(--surface-muted);
}

.series-danger-zone {
  border-color: var(--danger-border);
  background: var(--red-soft);
}

.series-danger-zone p {
  color: var(--wp-danger-ink);
}

.brighthr-status-indicator.is-connected,
.brighthr-feed-feedback.is-success {
  color: var(--wp-success-ink);
}

.brighthr-status-indicator.is-warning,
.brighthr-unclassified-status {
  color: var(--wp-warning-ink);
}

.modal {
  background: var(--overlay);
}

.modal-dialog,
.modal-card {
  border-color: var(--line);
  background: var(--surface-raised);
  box-shadow: var(--shadow-lg);
}

.modal-header {
  border-bottom-color: var(--line);
}

.modal-footer {
  border-top-color: var(--line);
  background: var(--surface-muted);
}

.empty-state-icon {
  background: var(--brand-soft);
  color: var(--brand);
}

.notice {
  border-color: var(--wp-brand-border);
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.notice-info {
  border-color: var(--wp-info-border);
  background: var(--blue-soft);
  color: var(--blue);
}

.notice-warning,
.owner-unavailable-notice {
  border-color: var(--warning-border);
  background: var(--amber-soft);
  color: var(--wp-warning-ink);
}

.notice-danger {
  border-color: var(--danger-border);
  background: var(--red-soft);
  color: var(--wp-danger-ink);
}

.notice-success {
  border-color: var(--wp-success-border);
  background: var(--green-soft);
  color: var(--wp-success-ink);
}

.toast {
  border-color: var(--line);
  border-left-color: var(--brand);
  background: var(--surface-raised);
  box-shadow: var(--shadow);
}

.toast-success { border-left-color: var(--green); }
.toast-warning { border-left-color: var(--amber); }
.toast-error,
.toast-danger { border-left-color: var(--red); }

.table th {
  background: var(--surface-muted);
  color: var(--ink-soft);
}

.table td {
  color: var(--ink-soft);
}

.table tbody tr:hover {
  background: var(--surface-hover);
}

@media (max-width: 1200px) {
  .dashboard-summary-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .dashboard-layout { grid-template-columns: minmax(0, 1.12fr) minmax(350px, 0.88fr); }
}

@media (max-width: 980px) {
  .dashboard-layout { grid-template-columns: 1fr; }
  .dashboard-calendar-preview .day-cell { min-height: 112px; }
}

@media (max-width: 640px) {
  .dashboard-page,
  .personal-calendar { gap: 12px; }
  .dashboard-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .dashboard-summary-button { min-height: 78px; padding: 10px 11px; }
  .dashboard-summary-count,
  .dashboard-summary-button > strong { font-size: max(var(--wp-min-text, 0px), calc(24px * var(--wp-text-scale, 1))); }
  .dashboard-summary-detail,
  .dashboard-summary-button > small,
  .dashboard-summary-button .metric-sub { display: none; }
  .dashboard-task-card .card-header,
  .dashboard-calendar-card .card-header { padding: 11px 12px; }
  .dashboard-task-group > header,
  .dashboard-task-group-header { padding: 9px 11px 5px; }
  .dashboard-task-panel .task-row { min-height: 52px; padding: 8px 11px; }
  .dashboard-task-panel .task-row-tags .priority-pill,
  .dashboard-task-panel .task-row-tags .recurring-pill { display: none; }
  .dashboard-task-panel .series-summary { grid-template-columns: minmax(0, 1fr); padding: 10px 11px; }
  .dashboard-task-panel .series-summary-actions { justify-content: flex-start; }
  .dashboard-task-panel .series-occurrences { margin-right: -11px; margin-left: -11px; }
  .dashboard-quick-add { padding: 9px 11px 11px; }
  .dashboard-quick-add .daily-new-task { flex-basis: 100%; }
  .dashboard-task-filters { padding: 10px 11px; }
  .dashboard-task-filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .my-work-task-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .background-refresh-banner { align-items: flex-start; flex-direction: column; margin-bottom: 10px; }
  .daily-edit-conflict,
  .daily-task-options-state { grid-template-columns: minmax(0, 1fr); }
  .daily-edit-conflict-actions { justify-content: flex-start; }
  .personal-calendar-filters { grid-template-columns: 1fr; }
  .dashboard-calendar-preview .day-cell { min-height: 84px; }
}

@media (max-width: 420px) {
  .dashboard-task-filter-grid { grid-template-columns: minmax(0, 1fr); }
  .daily-new-task { flex-wrap: wrap; }
  .daily-quick-add-field { flex-basis: calc(100% - 26px); }
  .daily-quick-add-submit,
  .daily-quick-add-retry { margin-left: 26px; }
}

/* Focused everyday-workspace refinements. The planner already has a warm
   token system; these rules give its primary dashboard and calendars the
   breathing room and readable hierarchy they need on real wide displays. */
.calendar-page {
  width: min(100%, 1640px);
  max-width: none;
}

.calendar-page .calendar {
  min-height: 620px;
}

/* Team Calendar is a compact planning board. Its staff preview already owns
   the useful height inside each date cell, so a generic calendar minimum was
   only adding an empty white band below short work-week and Agenda views. */
.calendar-page .calendar.calendar-feed--team { min-height: 0; }

.calendar-page .event {
  min-height: 28px;
  padding: 5px 7px;
  font-size: max(var(--wp-min-text, 0px), calc(11px * var(--wp-text-scale, 1)));
  line-height: 1.3;
}

.calendar-page .calendar-event-title {
  font-size: max(var(--wp-min-text, 0px), calc(11px * var(--wp-text-scale, 1)));
  font-weight: 760;
}

.calendar-page .calendar-event-meta {
  font-size: max(var(--wp-min-text, 0px), calc(10px * var(--wp-text-scale, 1)));
  line-height: 1.25;
}

.calendar-page .feed-week-day > header strong,
.calendar-page .calendar-weekday {
  font-size: max(var(--wp-min-text, 0px), calc(13px * var(--wp-text-scale, 1)));
}

.calendar-page .day-cell {
  min-height: 142px;
}

/* The Team Calendar is a planning surface rather than a personal diary. It
   earns a denser month cell without changing the more private My Calendar. */
.calendar-page .calendar-feed--team .day-cell { min-height: 126px; }
.calendar-page .calendar-feed--team .feed-week-day { min-height: 184px; }

.calendar-page .calendar-feed--team .event {
  min-height: 24px;
  padding: 3px 6px;
  font-size: max(var(--wp-min-text, 0px), calc(10px * var(--wp-text-scale, 1)));
}

.calendar-feed--team {
  position: relative;
  overflow: visible;
  isolation: isolate;
}

.team-calendar-staff-layer-toggle {
  flex: 0 0 auto;
  /* Reserve the longest Staff label from first paint. Updating its text must
     not move the month title, Agenda button, weekday columns, or grid. */
  inline-size: 164px;
  min-inline-size: 164px;
  box-sizing: border-box;
  justify-content: center;
  border-color: var(--wp-brand-border);
  color: var(--brand-dark);
  font-weight: 740;
  white-space: nowrap;
}

.team-calendar-staff-layer-toggle[aria-pressed="true"] {
  border-color: var(--brand);
  background: var(--brand-soft);
  box-shadow: inset 0 0 0 1px var(--wp-brand-border);
}

/* The legend is an informational companion to the one Staff control. It is
   not another filter or mode: all legend entries come from the single
   server-authorised range projection currently on screen. */
.team-calendar-toolbar-control-area {
  display: grid;
  min-width: 0;
  justify-items: end;
  gap: 6px;
}

.team-calendar-toolbar-control-area .calendar-toolbar-actions { justify-content: flex-end; }

.team-calendar-staff-department-legend {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
  max-inline-size: min(42vw, 440px);
  gap: 5px 7px;
  color: var(--ink-soft);
  font-size: max(var(--wp-min-text, 0px), calc(10px * var(--wp-text-scale, 1)));
  line-height: 1.2;
}

.team-calendar-staff-department-legend-label {
  flex: 0 0 auto;
  color: var(--ink-soft);
  font-weight: 720;
}

.team-calendar-staff-department-legend-items {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 4px 7px;
}

.team-calendar-staff-department-legend-item,
.team-calendar-availability-department-label,
.team-calendar-availability-department-heading {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  gap: 5px;
}

.team-calendar-staff-department-legend-item {
  max-width: 150px;
  overflow: hidden;
  color: var(--ink-soft);
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* A range-level safety cue only: it reports that the redacted availability
   snapshot needs review without crowding every date cell or exposing source
   diagnostics. */
.team-calendar-staff-source-health {
  flex: 0 0 auto;
  padding: 3px 6px;
  border: 1px solid var(--wp-busy-border);
  border-radius: 999px;
  background: var(--wp-busy-soft);
  color: var(--wp-busy);
  font-size: max(var(--wp-min-text, 0px), calc(10px * var(--wp-text-scale, 1)));
  font-weight: 720;
  line-height: 1.2;
  white-space: nowrap;
}

.team-calendar-department-swatch {
  width: 9px;
  height: 9px;
  flex: 0 0 9px;
  box-sizing: border-box;
  border: 1px solid rgb(23 23 23 / 32%);
  border-radius: 999px;
  background: var(--team-calendar-department-colour, #707780);
}

/* The Team Calendar receives one bounded staff projection per visible period.
   Every cell uses only that safe snapshot and then measures its real leftover
   geometry. It never inserts full names as text rows or guesses a fixed avatar
   limit. */
.team-calendar-staff-preview {
  display: grid;
  min-width: 0;
  gap: 4px;
  max-height: 0;
  overflow: hidden;
}

.team-calendar-staff-preview[hidden] { display: none; }

/* Preview content is clipped while capacity is calculated. Once an already
   fitted avatar is hovered or keyboard-focused, allow its tiny name/status
   tooltip to rise above neighbouring calendar cells without changing layout. */
.team-calendar-staff-preview:hover,
.team-calendar-staff-preview:focus-within {
  position: relative;
  z-index: 4;
  overflow: visible;
}

.team-calendar-staff-preview-heading {
  width: 100%;
  min-width: 0;
  /* A Month column at a common 1024px desktop width can be too narrow for
     “22 people scheduled” on one line. Keep the complete truthful heading by
     deliberately allowing two compact lines; the measured avatar layout then
     uses only the remaining real height rather than clipping the count. */
  min-height: 30px;
  overflow: hidden;
  padding: 3px 5px;
  border: 1px solid var(--wp-busy-border);
  border-radius: 6px;
  background: var(--wp-busy-soft);
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-size: max(var(--wp-min-text, 0px), calc(10px * var(--wp-text-scale, 1)));
  font-weight: 740;
  line-height: 1.25;
  text-align: left;
  white-space: normal;
  overflow-wrap: normal;
}

.team-calendar-staff-preview-heading--scheduled {
  border-color: var(--wp-brand-border);
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.team-calendar-staff-preview.is-roster-open .team-calendar-staff-preview-heading {
  border-color: var(--brand);
  box-shadow: inset 0 0 0 1px var(--wp-brand-border);
}

.team-calendar-staff-preview-heading:hover,
.team-calendar-staff-preview-heading:focus-visible,
.team-calendar-staff-avatar:hover,
.team-calendar-staff-avatar:focus-visible {
  border-color: var(--brand);
  outline: none;
}

.team-calendar-staff-preview-heading:focus-visible,
.team-calendar-staff-avatar:focus-visible { box-shadow: var(--focus-ring); }

.team-calendar-staff-avatar-stack {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  gap: 3px;
  align-content: flex-start;
}

.team-calendar-staff-avatar-wrap {
  position: relative;
  display: inline-grid;
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  overflow: visible;
}

/* The neutral dark fill preserves 7:1+ contrast for white initials. A thin,
   configuration-derived department ring is easier to scan than a solid
   colour block and remains visible when a permitted profile photo is used. */
.team-calendar-staff-avatar {
  position: relative;
  display: inline-grid;
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  place-items: center;
  overflow: visible;
  padding: 0;
  border: 2px solid var(--team-calendar-department-colour, #707780);
  border-radius: 999px;
  background: #263746;
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-size: max(var(--wp-min-text, 0px), calc(9px * var(--wp-text-scale, 1)));
  font-weight: 800;
  line-height: 1;
}

.team-calendar-staff-avatar--absence { box-shadow: inset 0 -2px 0 var(--wp-busy); }
.team-calendar-staff-avatar--scheduled { box-shadow: inset 0 -2px 0 var(--brand); }

/* Partial approved absence stays in both Staff layers. The discreet muted
   violet marker has its own small, focusable target: hovering it reveals only
   server-calculated remaining working times, never an absence reason or
   provider detail. The 24px avatar geometry is unchanged. */
.team-calendar-staff-avatar-partial-indicator {
  position: absolute;
  z-index: 4;
  right: -3px;
  bottom: -3px;
  display: grid;
  width: 12px;
  height: 12px;
  place-items: center;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}

.team-calendar-staff-avatar-partial-indicator::before {
  width: 7px;
  height: 7px;
  box-sizing: border-box;
  border: 1px solid var(--surface);
  border-radius: 50%;
  background: #74618b;
  box-shadow: 0 0 0 1px rgb(38 55 70 / 26%);
  content: '';
}

@media (prefers-contrast: more) {
  .team-calendar-staff-avatar-partial-indicator::before {
    border-color: #263746;
    background: #bfa7d7;
  }
}

.team-calendar-staff-avatar-initials { pointer-events: none; }

.team-calendar-staff-avatar-image {
  position: absolute;
  inset: 2px;
  width: calc(100% - 4px);
  height: calc(100% - 4px);
  object-fit: cover;
  background: var(--surface-muted);
  border-radius: inherit;
}

.team-calendar-staff-avatar[data-tooltip]::after {
  position: absolute;
  z-index: 2;
  bottom: calc(100% + 5px);
  left: 50%;
  width: max-content;
  max-width: 180px;
  padding: 4px 6px;
  border-radius: 4px;
  background: var(--ink);
  color: var(--surface);
  content: attr(data-tooltip);
  font-size: max(var(--wp-min-text, 0px), calc(10px * var(--wp-text-scale, 1)));
  font-weight: 650;
  line-height: 1.25;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 4px);
  transition: opacity 120ms ease, transform 120ms ease;
  white-space: nowrap;
}

.team-calendar-staff-avatar[data-tooltip]:hover::after,
.team-calendar-staff-avatar[data-tooltip]:focus-visible::after {
  opacity: 1;
  transform: translate(-50%, 0);
}

.team-calendar-staff-avatar-partial-indicator:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 1px;
}

.team-calendar-staff-avatar-partial-indicator[data-tooltip]::after {
  position: absolute;
  z-index: 8;
  right: 0;
  bottom: calc(100% + 4px);
  width: max-content;
  max-width: min(280px, calc(100vw - 32px));
  padding: 5px 7px;
  border-radius: 4px;
  background: var(--ink);
  color: var(--surface);
  content: attr(data-tooltip);
  font: inherit;
  font-size: max(var(--wp-min-text, 0px), calc(10px * var(--wp-text-scale, 1)));
  font-weight: 650;
  line-height: 1.3;
  opacity: 0;
  pointer-events: none;
  text-align: left;
  transform: translateY(4px);
  transition: opacity 120ms ease, transform 120ms ease;
  white-space: normal;
}

.team-calendar-staff-avatar-partial-indicator[data-tooltip]:hover::after,
.team-calendar-staff-avatar-partial-indicator[data-tooltip]:focus-visible::after {
  opacity: 1;
  transform: translateY(0);
}

.team-calendar-staff-avatar-count {
  border-color: var(--wp-busy-border);
  background: var(--surface-muted);
  color: var(--ink);
  font-size: max(var(--wp-min-text, 0px), calc(9px * var(--wp-text-scale, 1)));
}

.team-calendar-staff-preview--agenda {
  max-height: none;
  overflow: visible;
  margin: 0 0 8px;
}

.team-calendar-agenda { display: grid; gap: 12px; }

.team-calendar-agenda-day {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-raised);
}

.team-calendar-agenda-date { margin: 0 0 7px; color: var(--ink); font-size: max(var(--wp-min-text, 0px), calc(13px * var(--wp-text-scale, 1))); }
.team-calendar-agenda-events { display: grid; gap: 1px; }

/* A roster belongs to its source date. The outlet has no normal-flow height,
   so opening it never moves the month grid or creates a second dashboard. */
.team-calendar-availability-popover-outlet[hidden] { display: none; }

.team-calendar-availability-popover {
  position: absolute;
  z-index: 30;
  left: var(--team-calendar-availability-popover-left, 8px);
  top: var(--team-calendar-availability-popover-top, 8px);
  width: var(--team-calendar-availability-popover-width, min(460px, calc(100% - 16px)));
  max-width: calc(100% - 16px);
  max-height: min(620px, calc(100dvh - 24px));
  display: grid;
  gap: 10px;
  box-sizing: border-box;
  overflow: auto;
  padding: 12px;
  border: 1px solid var(--wp-brand-border);
  border-top: 3px solid var(--brand);
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: 0 16px 34px rgb(23 23 23 / 18%);
}

.team-calendar-availability-popover:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.team-calendar-availability-popover-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 14px;
}

.team-calendar-availability-popover-heading h3,
.team-calendar-availability-popover-heading p,
.team-calendar-availability-view-heading h3,
.team-calendar-availability-view-heading p,
.team-calendar-availability-reason-group h4,
.team-calendar-availability-loading,
.team-calendar-availability-empty,
.work-schedule-mode-help,
.work-schedule-help,
.work-schedule-save-status {
  margin: 0;
}

.team-calendar-availability-popover-heading h3 {
  font-size: max(var(--wp-min-text, 0px), calc(14px * var(--wp-text-scale, 1)));
}

.team-calendar-availability-popover-heading > div > p,
.team-calendar-availability-view-heading p {
  margin-top: 3px;
  color: var(--ink-soft);
  font-size: max(var(--wp-min-text, 0px), calc(12px * var(--wp-text-scale, 1)));
}

.team-calendar-operating-day-context {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-muted);
}

.team-calendar-operating-day-context-item {
  display: flex;
  min-width: 0;
  gap: 5px;
  margin: 0;
  color: var(--ink-soft);
  font-size: max(var(--wp-min-text, 0px), calc(12px * var(--wp-text-scale, 1)));
  line-height: 1.35;
}

.team-calendar-operating-day-context-item strong {
  flex: 0 0 auto;
  color: var(--ink);
}

.team-calendar-operating-day-context-item span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.team-calendar-operating-day-context-item.is-warning { color: var(--wp-busy); }

.team-calendar-availability-counts {
  padding: 5px 9px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-size: max(var(--wp-min-text, 0px), calc(12px * var(--wp-text-scale, 1)));
  font-weight: 750;
}

.team-calendar-availability-view,
.team-calendar-availability-loading,
.team-calendar-availability-error {
  padding: 0;
}

.team-calendar-availability-view-heading {
  margin-bottom: 12px;
}

.team-calendar-availability-view-heading h3 {
  font-size: max(var(--wp-min-text, 0px), calc(15px * var(--wp-text-scale, 1)));
}

.team-calendar-availability-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 8px;
}

.team-calendar-availability-person {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 5px 12px;
  min-width: 0;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-raised);
}

.team-calendar-availability-person-main {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.team-calendar-availability-person-main strong {
  color: var(--ink);
  font-size: max(var(--wp-min-text, 0px), calc(13px * var(--wp-text-scale, 1)));
  line-height: 1.3;
  overflow-wrap: anywhere;
  white-space: normal;
}

.team-calendar-availability-department-label {
  color: var(--ink-soft);
  font-size: max(var(--wp-min-text, 0px), calc(11px * var(--wp-text-scale, 1)));
  line-height: 1.3;
}

.team-calendar-availability-department-label .team-calendar-department-swatch {
  width: 8px;
  height: 8px;
  flex-basis: 8px;
}

.team-calendar-availability-status,
.team-calendar-availability-hours,
.team-calendar-availability-reason,
.team-calendar-availability-operating-status {
  color: var(--ink-soft);
  font-size: max(var(--wp-min-text, 0px), calc(11px * var(--wp-text-scale, 1)));
  line-height: 1.3;
}

.team-calendar-availability-operating-status {
  color: var(--brand-dark);
  font-weight: 720;
}

.team-calendar-availability-hours {
  font-variant-numeric: tabular-nums;
  font-weight: 690;
  white-space: nowrap;
}

.team-calendar-availability-reason {
  grid-column: 1 / -1;
  color: var(--brand-dark);
  font-weight: 720;
}

.team-calendar-availability-reason-groups {
  display: grid;
  gap: 12px;
}

.team-calendar-availability-department-groups {
  display: grid;
  gap: 7px;
}

.team-calendar-availability-department-group {
  display: grid;
  gap: 7px;
  padding: 8px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--team-calendar-department-colour, #707780);
  border-radius: 6px;
  background: var(--surface-raised);
}

.team-calendar-availability-department-heading {
  margin: 0;
  color: var(--ink);
  font-size: max(var(--wp-min-text, 0px), calc(12px * var(--wp-text-scale, 1)));
  line-height: 1.25;
}

.team-calendar-availability-expected-groups,
.team-calendar-availability-roster-group {
  display: grid;
  gap: 8px;
}

.team-calendar-availability-roster-group h4 {
  margin: 0;
  color: var(--ink);
  font-size: max(var(--wp-min-text, 0px), calc(13px * var(--wp-text-scale, 1)));
}

.team-calendar-availability-reason-group {
  display: grid;
  gap: 8px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-muted);
}

.team-calendar-availability-reason-group h4 {
  color: var(--ink);
  font-size: max(var(--wp-min-text, 0px), calc(13px * var(--wp-text-scale, 1)));
}

.team-calendar-availability-reason-group--approved-absence {
  border-left: 4px solid var(--wp-busy);
  background: var(--wp-busy-soft);
}

.team-calendar-availability-conflicts {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  padding: 11px;
  border: 1px solid var(--wp-busy);
  border-left-width: 4px;
  border-radius: var(--radius-sm);
  background: var(--wp-busy-soft);
}

.team-calendar-availability-conflicts h4,
.team-calendar-availability-conflicts p {
  margin: 0;
}

.team-calendar-availability-conflicts h4 {
  color: var(--ink);
  font-size: max(var(--wp-min-text, 0px), calc(13px * var(--wp-text-scale, 1)));
}

.team-calendar-availability-conflicts p {
  color: var(--ink-soft);
  font-size: max(var(--wp-min-text, 0px), calc(12px * var(--wp-text-scale, 1)));
}

.team-calendar-availability-empty {
  color: var(--ink-soft);
  font-size: max(var(--wp-min-text, 0px), calc(12px * var(--wp-text-scale, 1)));
}

.team-calendar-availability-error {
  margin: 0;
}

.work-schedule-editor {
  min-width: 0;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-muted);
}

.work-schedule-editor > legend,
.work-schedule-weekdays > legend {
  padding: 0 5px;
  color: var(--ink);
  font-size: max(var(--wp-min-text, 0px), calc(13px * var(--wp-text-scale, 1)));
  font-weight: 750;
}

.work-schedule-help {
  margin-bottom: 10px;
}

.work-schedule-editor-grid {
  display: grid;
  grid-template-columns: minmax(190px, 0.8fr) minmax(260px, 1.2fr);
  gap: 10px 14px;
}

.work-schedule-hours {
  display: grid;
  grid-template-columns: repeat(2, minmax(110px, 1fr));
  gap: 10px;
}

.work-schedule-weekdays,
.work-schedule-mode-help {
  grid-column: 1 / -1;
}

.work-schedule-weekdays {
  min-width: 0;
  padding: 9px 10px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.work-schedule-weekday-options {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px 13px;
}

.work-schedule-mode-help {
  margin: 0;
  color: var(--ink-soft);
  font-size: max(var(--wp-min-text, 0px), calc(12px * var(--wp-text-scale, 1)));
  line-height: 1.4;
}

.work-schedule-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 11px;
}

.work-schedule-save-status {
  min-width: 0;
  flex: 1 1 auto;
  color: var(--ink-soft);
  font-size: max(var(--wp-min-text, 0px), calc(12px * var(--wp-text-scale, 1)));
}

.team-calendar-filter-controls {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.team-calendar-filter-summary {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px 12px;
  min-height: 46px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-raised);
  box-shadow: var(--shadow-sm);
}

.team-calendar-filter-copy {
  min-width: 0;
  flex: 1 1 360px;
  color: var(--ink-soft);
  font-size: max(var(--wp-min-text, 0px), calc(12px * var(--wp-text-scale, 1)));
  line-height: 1.35;
}

.team-calendar-filter-drawer {
  display: grid;
  gap: 13px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.team-calendar-filter-drawer[hidden] {
  display: none;
}

.team-calendar-filter-fields {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 9px;
}

.team-calendar-filter-fields .department-filter-select {
  min-height: 82px;
}

.team-calendar-layer-fields {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 14px;
  padding-top: 11px;
  border-top: 1px solid var(--line);
}

.team-calendar-layer-fields strong {
  color: var(--brand-dark);
  font-size: max(var(--wp-min-text, 0px), calc(12px * var(--wp-text-scale, 1)));
}

.team-calendar-filter-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.task-finder {
  min-width: min(620px, 78vw);
}

.task-finder-input {
  min-height: 42px;
  font-size: max(var(--wp-min-text, 0px), calc(15px * var(--wp-text-scale, 1)));
}

.task-finder-hint,
.task-finder-status {
  min-height: 18px;
  margin: -2px 0 0;
  font-size: max(var(--wp-min-text, 0px), calc(12px * var(--wp-text-scale, 1)));
}

.task-finder-results {
  display: grid;
  gap: 7px;
  max-height: min(48vh, 430px);
  overflow: auto;
}

.task-finder-result {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 58px;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-muted);
  color: var(--ink);
  text-align: left;
}

.task-finder-result:hover,
.task-finder-result:focus-visible {
  border-color: var(--brand);
  background: var(--brand-soft);
}

.task-finder-result-main {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.task-finder-result-main strong {
  overflow: hidden;
  font-size: max(var(--wp-min-text, 0px), calc(13px * var(--wp-text-scale, 1)));
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-finder-result-main small {
  color: var(--ink-soft);
  font-size: max(var(--wp-min-text, 0px), calc(11px * var(--wp-text-scale, 1)));
}

.task-finder-result-tags {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 4px;
}

@media (max-width: 980px) {
  .calendar-page .calendar { min-height: 520px; }
  .team-calendar-filter-fields { grid-template-columns: repeat(2, minmax(150px, 1fr)); }
  .work-schedule-editor-grid { grid-template-columns: 1fr; }
  .work-schedule-hours,
  .work-schedule-weekdays,
  .work-schedule-mode-help { grid-column: 1; }
}

@media (max-width: 640px) {
  .calendar-page .calendar { min-height: auto; }
  .team-calendar-filter-summary { align-items: flex-start; }
  .team-calendar-availability-person,
  .work-schedule-hours { grid-template-columns: 1fr; }
  .team-calendar-availability-popover {
    position: fixed;
    right: 12px;
    bottom: 12px;
    left: 12px;
    top: auto;
    width: auto;
    max-width: none;
    max-height: min(72dvh, 620px);
  }
  .team-calendar-availability-popover-heading { align-items: flex-start; flex-direction: column; }
  .team-calendar-operating-day-context { display: grid; }
  .team-calendar-operating-day-context-item { align-items: baseline; }
  .team-calendar-availability-list { grid-template-columns: 1fr; }
  .team-calendar-availability-hours,
  .team-calendar-availability-reason { grid-column: 1; }
  .work-schedule-actions { align-items: stretch; flex-direction: column; }
  .work-schedule-actions .button { width: 100%; }
  .team-calendar-filter-fields { grid-template-columns: 1fr; }
  .team-calendar-filter-actions { justify-content: stretch; }
  .team-calendar-filter-actions .button { flex: 1 1 0; }
  .task-finder { min-width: 0; }
  .task-finder-result { align-items: flex-start; flex-direction: column; }
  .task-finder-result-tags { justify-content: flex-start; }
}

@keyframes daily-saving-pulse {
  0%, 100% { opacity: 0.45; transform: scale(0.86); }
  50% { opacity: 1; transform: scale(1); }
}

@keyframes modal-enter {
  from { opacity: 0; transform: translateY(8px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toast-enter {
  from { opacity: 0; transform: translateX(12px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes meeting-request-overlay-enter {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes in-app-notification-overlay-enter {
  from { opacity: 0; transform: translateY(-8px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes notification-entry-summary-enter {
  from { opacity: 0; transform: translateY(-8px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .meeting-request-overlay,
  .in-app-notification-overlay,
  .notification-entry-summary { animation: none; }
}

@media (max-width: 1080px) {
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .layout-grid { grid-template-columns: 1fr; }
  .day-cell { min-height: 112px; }
  .daily-task-options { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 820px) {
  .app-shell { display: block; height: auto; min-height: 100vh; overflow: visible; }

  .app-main { display: block; height: auto; overflow: visible; }

  .sidebar {
    position: sticky;
    z-index: 30;
    top: 0;
    display: flex;
    flex-direction: row;
    align-items: center;
    width: 100%;
    height: auto;
    min-height: 58px;
    padding: 8px 12px;
    overflow: visible;
  }

  .sidebar-brand,
  .brand,
  .brand-lockup { flex: 0 0 142px; width: 142px; padding: 0 10px 0 0; }
  .brand-lockup .brand-lockup-image { width: 132px; max-height: 30px; }
  .brand-mark { width: 28px; height: 28px; }
  .sidebar-section,
  .sidebar-footer { display: none; }
  .sidebar nav,
  .nav-list { display: flex; min-width: 0; gap: 2px; overflow-x: auto; }
  .navigation-group,
  .navigation-group-links { display: contents; }
  .navigation-group + .navigation-group { margin-top: 0; padding-top: 0; border-top: 0; }
  .navigation-group-label { display: none; }
  .nav-link { flex: 0 0 auto; min-height: 35px; padding: 7px 9px; font-size: max(var(--wp-min-text, 0px), calc(12px * var(--wp-text-scale, 1))); }
  .nav-link .nav-count {
    display: inline-grid;
    flex: 0 0 auto;
    place-items: center;
    min-width: 18px;
    margin-left: 0;
    padding: 1px 5px;
    border: 1px solid rgb(255 255 255 / 16%);
    background: rgb(210 35 60 / 30%);
    color: var(--sidebar-text);
    font-size: max(var(--wp-min-text, 0px), calc(10px * var(--wp-text-scale, 1)));
  }
  .topbar { position: relative; min-height: 64px; }
  .content,
  .content--chat-workspace { height: auto; overflow: visible; padding-bottom: 34px; }
  .daily-sections { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .brand-lockup { flex-basis: 36px; width: 36px; padding-right: 8px; }
  .brand-lockup .brand-lockup-image { display: none; }
  .brand-lockup .brand-mark-image { display: block; width: 30px; height: 30px; }

  body { font-size: max(var(--wp-min-text, 0px), calc(13px * var(--wp-text-scale, 1))); }
  .topbar { align-items: flex-start; flex-wrap: wrap; gap: 10px; padding: 13px 16px; }
  .topbar-title p { display: none; }
  .topbar-context { flex: 1 1 100%; }
  .topbar-actions { width: 100%; flex: 1 1 100%; flex-wrap: wrap; gap: 5px; margin-left: 0; }
  .topbar-actions .button:not(.button-icon) { padding-right: 9px; padding-left: 9px; }
  .live-uk-clock { min-width: 0; font-size: max(var(--wp-min-text, 0px), calc(14px * var(--wp-text-scale, 1))); }
  .content { padding: 18px 14px 30px; }
  .page-stack { gap: 16px; }
  .page-header { flex-direction: column; gap: 12px; }
  .page-actions { justify-content: flex-start; }
  .page-heading { align-items: flex-start; margin-bottom: 16px; }
  .page-heading .button { flex: 0 0 auto; }
  .metric-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .metric-card { padding: 14px; }
  .metric-value { font-size: max(var(--wp-min-text, 0px), calc(24px * var(--wp-text-scale, 1))); }
  .card-header, .card-body { padding-right: 14px; padding-left: 14px; }
  .card-footer { padding-right: 14px; padding-left: 14px; }
  .filter-bar { align-items: stretch; padding: 9px; }
  .filter-group { flex: 1 1 100%; }
  .filter-group .select, .filter-group select { flex: 1 1 0; }
  .filter-spacer { display: none; }
  .task-row { grid-template-columns: auto minmax(0, 1fr); gap: 10px; padding: 11px 13px; }
  .task-actions, .task-state { grid-column: 2; justify-content: flex-start; }
  .task-title { white-space: normal; }
  .task-row { grid-template-columns: minmax(0, 1fr); }
  .task-row-tags { justify-content: flex-start; }
  .series-summary { grid-template-columns: minmax(0, 1fr); padding: 13px; }
  .series-summary-actions { justify-content: flex-start; }
  .series-occurrences { margin: 0 -13px -13px; }
  .series-occurrences .task-row { padding-right: 13px; padding-left: 13px; }
  .task-title-button { white-space: normal; }
  .related-task { grid-template-columns: minmax(0, 1fr); }
  .related-task .task-row-tags { justify-content: flex-start; }
  .calendar-toolbar { align-items: flex-start; flex-wrap: wrap; padding: 12px; }
  .calendar-toolbar h2 { flex: 1 1 150px; font-size: max(var(--wp-min-text, 0px), calc(14px * var(--wp-text-scale, 1))); }
  .calendar-toolbar-actions { order: 3; width: 100%; padding-top: 3px; overflow-x: auto; }
  .calendar-toolbar-actions .button:not(.button-icon) { display: inline-flex; flex: 0 0 auto; min-height: 31px; padding: 6px 9px; font-size: max(var(--wp-min-text, 0px), calc(10px * var(--wp-text-scale, 1))); }
  .team-calendar-toolbar-control-area { order: 3; width: 100%; justify-items: stretch; }
  .team-calendar-toolbar-control-area .calendar-toolbar-actions { order: initial; width: 100%; }
  .team-calendar-staff-department-legend { justify-content: flex-start; max-inline-size: 100%; }
  .team-calendar-staff-department-legend-items { justify-content: flex-start; }
  .weekday, .calendar-weekday { padding: 8px 2px; font-size: max(var(--wp-min-text, 0px), calc(8px * var(--wp-text-scale, 1))); }
  .day-cell { min-height: 84px; padding: 5px 3px; }
  .day-events { gap: 2px; margin-top: 4px; }
  .event { min-height: 22px; padding: 3px 4px; border-left-width: 3px; font-size: max(var(--wp-min-text, 0px), calc(9px * var(--wp-text-scale, 1))); line-height: 1.18; text-overflow: ellipsis; white-space: nowrap; }
  .event::first-letter { font-size: inherit; }
  .event.event--auto-visible { min-height: 22px; padding: 3px 4px; border-left-width: 4px; font-size: max(var(--wp-min-text, 0px), calc(9px * var(--wp-text-scale, 1))); line-height: 1.18; white-space: nowrap; }
  .event.event--auto-visible::first-letter { font-size: inherit; }
  .more-events { padding: 0 3px; font-size: max(var(--wp-min-text, 0px), calc(9px * var(--wp-text-scale, 1))); }
  .week-grid-wrap { border-radius: 0; }
  .week-event { min-height: 22px; padding: 3px 4px; font-size: max(var(--wp-min-text, 0px), calc(9px * var(--wp-text-scale, 1))); }
  .day-agenda-item { grid-template-columns: minmax(0, 1fr); gap: 5px; }
  .day-agenda-item .task-row-tags { justify-content: flex-start; }
  .agenda-item { grid-template-columns: 54px minmax(0, 1fr); gap: 9px; padding: 10px 13px; }
  .agenda-item > :last-child:not(.agenda-main) { grid-column: 2; justify-self: start; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .span-2, .form-grid .full-width { grid-column: auto; }
  .planning-detail-grid { grid-template-columns: 1fr; }
  .planning-detail-heading { align-items: flex-start; }
  .planning-entity { grid-template-columns: auto minmax(0, 1fr); }
  .planning-entity .button { grid-column: 2; justify-self: start; }
  .daily-page { gap: 14px; }
  .daily-toolbar { padding: 0; }
  .daily-section-header { min-height: 48px; padding: 10px 11px 8px 13px; }
  .daily-section-body { padding: 4px 6px 7px; }
  .daily-task-branch { padding-left: calc(var(--daily-depth, 0) * 17px); }
  .daily-task-main { gap: 5px; min-height: 35px; padding: 3px; }
  .daily-drag-handle { display: none; }
  .daily-date-chip { display: none; }
  .daily-task .priority-pill,
  .daily-task .recurring-pill { display: none; }
  .daily-details-toggle { opacity: 1; }
  .daily-task-options { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-left: 3px; }
  .daily-task-options .check-field { grid-column: 1 / -1; }
  .modal { align-items: flex-end; padding: 0; }
  .modal-dialog, .modal-card { width: 100%; max-height: 92dvh; border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
  .modal-header, .modal-body, .modal-footer { padding-right: 16px; padding-left: 16px; }
  .toast-container { right: 12px; bottom: 12px; width: calc(100vw - 24px); }
  .meeting-request-overlay {
    top: auto;
    right: 12px;
    bottom: 12px;
    width: min(420px, calc(100vw - 24px));
  }
  .notification-entry-summary {
    top: var(--notification-entry-summary-top, 76px);
    right: 12px;
    width: min(400px, calc(100vw - 24px));
  }
  .notification-entry-summary-mark { width: 38px; height: 38px; }
  .in-app-notification-tray {
    top: 76px;
    right: 12px;
    width: min(400px, calc(100vw - 24px));
  }
  .in-app-notification-overlay { grid-template-columns: 38px minmax(0, 1fr); }
  .in-app-notification-overlay-mark { width: 38px; height: 38px; }
  .notification { align-items: flex-start; flex-direction: column; }
  .meeting-request-overlay-actions .button { flex: 1 1 auto; }
}

@media (max-width: 420px) {
  .brand > :not(.brand-mark), .sidebar-brand > :not(.brand-mark), .brand-lockup > :not(.brand-mark-image) { display: none; }
  .metric-grid { grid-template-columns: 1fr; }
  .topbar-actions .button { min-height: 34px; font-size: max(var(--wp-min-text, 0px), calc(12px * var(--wp-text-scale, 1))); }
  .page-heading { gap: 8px; }
  .page-heading .button { min-height: 34px; }
}

/* Filters stay compact on normal Windows laptop and desktop widths instead
   of turning a task or team-calendar view into a tall control wall. */
@media (min-width: 1081px) {
  .filter-bar {
    display: grid;
    grid-template-columns: minmax(200px, 1.35fr) repeat(4, minmax(125px, 0.85fr));
    align-items: end;
  }

  .filter-bar > .input {
    grid-column: span 2;
    min-width: 0;
  }

  .filter-bar > .select {
    min-width: 0;
  }

  .filter-bar > .department-filter-select {
    grid-column: span 2;
    min-width: 0;
  }

  .filter-bar > .check-field {
    grid-column: span 2;
    align-self: center;
    min-width: 0;
  }

  .filter-bar > .button {
    align-self: center;
    justify-self: start;
  }
}

@media (min-width: 641px) and (max-width: 1080px) {
  .filter-bar {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: end;
  }

  .filter-bar > .input { grid-column: 1 / -1; }
  .filter-bar > .department-filter-select { grid-column: span 2; min-width: 0; }
  .filter-bar > .check-field { align-self: center; }
  .filter-bar > .button { align-self: center; justify-self: start; }
}

@media (max-width: 640px) {
  .filter-bar {
    display: grid;
    grid-template-columns: 1fr;
  }

  .filter-bar > .input,
  .filter-bar > .department-filter-select,
  .filter-bar > .check-field {
    grid-column: auto;
  }
}

/* Small operational labels are read many times a day. Keep the existing warm
   hierarchy, but give the smallest copy a contrast-safe foreground and enough
   room to remain legible at normal Windows scaling. */
.subtle,
.feed-week-empty,
.calendar-event-meta,
.calendar-event-kind,
.dashboard-calendar-item-main span {
  color: var(--ink-soft);
}

.calendar-page .calendar-event-meta,
.dashboard-calendar-item-main span {
  font-size: max(var(--wp-min-text, 0px), calc(11px * var(--wp-text-scale, 1)));
}

.calendar-page .calendar-event-kind {
  font-size: max(var(--wp-min-text, 0px), calc(11px * var(--wp-text-scale, 1)));
}

.load-failure {
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
}

.load-failure-copy { min-width: 0; }
.load-failure-copy strong { display: block; }
.load-failure-copy p { margin: 3px 0 0; }
.calendar-unavailable .load-failure { margin: 16px; }
.settings-loading-state { display: grid; gap: 4px; min-height: 76px; align-content: center; padding: 15px 18px; color: var(--ink-soft); }
.settings-loading-state strong { color: var(--ink); font-size: max(var(--wp-min-text, 0px), calc(13px * var(--wp-text-scale, 1))); }
.settings-loading-state p { margin: 0; font-size: max(var(--wp-min-text, 0px), calc(12px * var(--wp-text-scale, 1))); line-height: 1.45; }

.page-header h1[data-page-heading]:focus {
  outline: 0;
  box-shadow: none;
}

@media (max-width: 640px) {
  .load-failure { align-items: flex-start; flex-direction: column; }

  /* The Month grid is intentionally compact on a phone. Keep the same Day
     Briefing content available as a focusable bottom sheet instead of forcing
     a seven-column row to become unreadably narrow. */
  .calendar-day-briefing-row:not([hidden]) {
    position: fixed;
    inset: auto 0 0;
    z-index: 45;
    display: block;
    max-height: min(78dvh, 640px);
    overflow-y: auto;
    border-top: 1px solid var(--line);
    box-shadow: 0 -12px 28px rgb(22 63 59 / 18%);
  }

  .calendar-day-briefing-outlet:not([hidden]) {
    position: fixed;
    inset: auto 0 0;
    z-index: 45;
    display: block;
    max-height: min(78dvh, 640px);
    overflow-y: auto;
    border-top: 1px solid var(--line);
    box-shadow: 0 -12px 28px rgb(22 63 59 / 18%);
  }

  .calendar-day-briefing-panel {
    gap: 11px;
    padding: 14px 14px calc(16px + env(safe-area-inset-bottom));
    border-top-width: 3px;
  }

  .calendar-day-briefing-header { align-items: flex-start; }
  .calendar-day-briefing-heading { align-items: flex-start; flex-direction: column; gap: 5px; }
  .calendar-day-briefing-heading h3 { font-size: max(var(--wp-min-text, 0px), calc(12px * var(--wp-text-scale, 1))); }
  .calendar-day-briefing-tabs { flex-wrap: nowrap; overflow-x: auto; }
  .calendar-day-briefing-tabs .button { flex: 0 0 auto; }
  .calendar-day-briefing-item { align-items: flex-start; flex-direction: column; gap: 7px; }
  .calendar-day-briefing-item-tags { justify-content: flex-start; }
  .calendar-day-briefing-error { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 640px) {
  .availability-bulk-group-header,
  .availability-bulk-window { align-items: stretch; flex-direction: column; }
  .availability-bulk-group-header .button,
  .availability-bulk-window > .button { align-self: flex-start; }
  .meeting-availability-window-fields { grid-template-columns: 1fr; }
  .availability-bulk-date-controls { align-items: stretch; }
  .availability-bulk-date-controls .button { width: 100%; }
  .availability-bulk-review-summary { align-items: flex-start; flex-direction: column; }
}

/* People is deliberately a compact discovery and availability surface. It is
   not a second task directory or an exposed colleague calendar: cards show
   only neutral status, effective meeting windows, and read-only unavailable
   ranges. */
.people-page,
.people-schedule-page { gap: 18px; }

.people-filter-form {
  display: grid;
  grid-template-columns: minmax(220px, 1.4fr) minmax(180px, 0.9fr) minmax(170px, 0.78fr) auto;
  align-items: end;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.people-filter-form .field { min-width: 0; }

.people-filter-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  padding-bottom: 1px;
}

.people-results-status {
  margin: -4px 0 0;
  color: var(--ink-soft);
  font-size: max(var(--wp-min-text, 0px), calc(12px * var(--wp-text-scale, 1)));
}

.people-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: 12px;
}

/* A people card carries a status plus working actions. Keep the directory
   comfortably scannable on wide displays instead of stretching it into many
   narrow, repetitive columns. */
.people-page {
  width: min(100%, 1840px);
  justify-self: center;
}

.people-card {
  display: grid;
  min-width: 0;
  gap: 13px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.people-card-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.people-card-identity {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 10px;
}

.people-avatar {
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid rgb(23 23 23 / 12%);
  border-radius: 50%;
  background: var(--surface-muted);
  color: var(--brand-dark);
  font-size: max(var(--wp-min-text, 0px), calc(12px * var(--wp-text-scale, 1)));
  font-weight: 780;
  letter-spacing: .02em;
}

.people-card-name { min-width: 0; }
.people-card-name h2,
.people-person-summary h2 {
  margin: 0;
  color: var(--ink);
  font-size: max(var(--wp-min-text, 0px), calc(16px * var(--wp-text-scale, 1)));
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}

.people-card-name p,
.people-person-summary p {
  margin: 4px 0 0;
  color: var(--ink-soft);
  font-size: max(var(--wp-min-text, 0px), calc(12px * var(--wp-text-scale, 1)));
  overflow-wrap: anywhere;
}

.people-card-role { margin-bottom: 5px !important; }

.people-department-labels {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  min-width: 0;
}

.workforce-department-label > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.people-status {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 5px;
  min-height: 25px;
  max-width: 54%;
  padding: 4px 8px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--ink-soft);
  font-size: max(var(--wp-min-text, 0px), calc(10px * var(--wp-text-scale, 1)));
  font-weight: 740;
  line-height: 1.15;
  text-align: right;
}

.people-status-icon { font-size: max(var(--wp-min-text, 0px), calc(12px * var(--wp-text-scale, 1))); line-height: 1; }
.people-status--available { border-color: var(--wp-success-border); background: var(--green-soft); color: var(--wp-success-ink); }
.people-status--busy { border-color: var(--wp-busy-border); background: var(--wp-busy-soft); color: var(--wp-busy-ink); }
.people-status--unavailable { border-color: var(--wp-absence-border); background: var(--absence-soft); color: var(--wp-absence-ink); }
.people-status--outside,
.people-status--none { background: var(--surface-muted); color: var(--ink-soft); }
.people-status--unknown { border-color: var(--warning-border); background: var(--amber-soft); color: var(--wp-warning-ink); }

.people-card-next {
  margin: 0;
  color: var(--ink-soft);
  font-size: max(var(--wp-min-text, 0px), calc(12px * var(--wp-text-scale, 1)));
}

.people-health-summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: baseline;
  gap: 5px 10px;
  margin: -2px 0 0;
  padding: 10px 12px;
  border: 1px solid var(--warning-border);
  border-left: 3px solid var(--wp-warning);
  border-radius: var(--radius-sm);
  background: linear-gradient(90deg, var(--amber-soft), var(--surface-raised) 62%);
  color: var(--wp-warning-ink);
  font-size: max(var(--wp-min-text, 0px), calc(12px * var(--wp-text-scale, 1)));
  line-height: 1.45;
}

.people-health-summary strong { color: var(--wp-warning-ink); font-weight: 760; }
.people-health-summary span { min-width: 0; }

.people-card-next {
  display: grid;
  gap: 2px;
  padding-top: 2px;
}

.people-card-next > span {
  color: var(--ink-faint);
  font-size: max(var(--wp-min-text, 0px), calc(10px * var(--wp-text-scale, 1)));
  font-weight: 750;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.people-card-next strong { color: var(--ink); font-weight: 690; }
.people-card-next--empty { min-height: 34px; color: var(--ink-faint); }

.people-card-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  padding-top: 2px;
}

.people-card-actions .button { min-width: 0; }

@media (min-width: 2100px) {
  .people-list { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}

.people-person-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.people-person-summary-note {
  max-width: 560px;
  padding-left: 14px;
  border-left: 3px solid var(--brand);
}

.people-health-notice { max-width: 560px; margin: 0; }

.people-schedule {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.people-schedule-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 61px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-raised);
}

.people-schedule-toolbar h2 {
  min-width: 0;
  margin: 0;
  color: var(--ink);
  font-size: max(var(--wp-min-text, 0px), calc(14px * var(--wp-text-scale, 1)));
  font-weight: 720;
  text-align: center;
}

.people-schedule-mode-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 5px;
}

.people-schedule-days {
  display: grid;
  gap: 0;
  overflow-x: auto;
  background: var(--line);
}

.people-schedule-days--week {
  grid-template-columns: repeat(7, minmax(164px, 1fr));
}

.people-schedule-days--day { grid-template-columns: minmax(0, 1fr); }

.people-schedule-day {
  display: grid;
  min-width: 0;
  min-height: 260px;
  align-content: start;
  gap: 10px;
  padding: 13px;
  background: var(--surface);
}

.people-schedule-day-header {
  padding-bottom: 9px;
  border-bottom: 1px solid var(--line);
}

.people-schedule-day-header h3 {
  margin: 0;
  color: var(--ink);
  font-size: max(var(--wp-min-text, 0px), calc(12px * var(--wp-text-scale, 1)));
  font-weight: 760;
}

.people-schedule-lane {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.people-schedule-lane-label {
  color: var(--ink-soft);
  font-size: max(var(--wp-min-text, 0px), calc(10px * var(--wp-text-scale, 1)));
  font-weight: 760;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.people-schedule-windows {
  display: grid;
  gap: 6px;
}

.people-schedule-window {
  display: block;
  min-width: 0;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-left-width: 4px;
  border-radius: var(--radius-sm);
  color: var(--ink);
  font-size: max(var(--wp-min-text, 0px), calc(12px * var(--wp-text-scale, 1)));
  font-variant-numeric: tabular-nums;
  font-weight: 690;
}

.people-schedule-window--available {
  border-color: var(--wp-success-border);
  border-left-color: var(--green);
  background: var(--green-soft);
  color: var(--wp-success-ink);
}

.people-schedule-window--unavailable {
  border-color: var(--wp-absence-border);
  border-left-color: var(--absence);
  background: var(--absence-soft);
  color: var(--wp-absence-ink);
}

.people-schedule-empty {
  min-height: 34px;
  margin: 0;
  color: var(--ink-faint);
  font-size: max(var(--wp-min-text, 0px), calc(11px * var(--wp-text-scale, 1)));
  line-height: 1.35;
}

@media (max-width: 980px) {
  .people-filter-form { grid-template-columns: minmax(180px, 1.2fr) minmax(160px, 1fr) minmax(150px, 0.8fr); }
  .people-filter-actions { grid-column: 1 / -1; }
}

@media (max-width: 640px) {
  .people-filter-form { grid-template-columns: 1fr; padding: 12px; }
  .people-filter-actions { grid-column: auto; }
  .people-filter-actions .button { flex: 1 1 0; }
  .people-list { grid-template-columns: 1fr; }
  .people-card-heading,
  .people-person-summary { align-items: flex-start; flex-direction: column; }
  .people-status { max-width: 100%; }
  .people-schedule-toolbar { align-items: flex-start; flex-wrap: wrap; }
  .people-schedule-toolbar h2 { flex: 1 1 100%; order: 3; text-align: left; }
  .people-schedule-mode-actions { margin-left: auto; }
  .people-schedule-days--week { grid-template-columns: 1fr; }
  .people-schedule-day { min-height: 0; }
  .people-person-summary-note { padding-left: 11px; }
}

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

/* -------------------------------------------------------------------------
   Work-Place visual-system refinement

   This final compatibility layer deliberately targets existing selectors so
   the rebrand stays visual only: routes, permissions, calendar semantics and
   data are untouched.  Red identifies Work-Place actions and selection; it is
   never used as an all-purpose status or page backdrop.
   ------------------------------------------------------------------------- */

:root {
  scrollbar-color: var(--line-strong) var(--canvas);
}

html,
body,
.app-shell {
  background: var(--canvas);
  color: var(--ink);
}

::selection {
  background: var(--brand-soft);
  color: var(--ink);
}

a {
  color: var(--brand-dark);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.16em;
}

a:hover { color: var(--brand); }

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--focus-outline);
  outline-offset: 2px;
  box-shadow: var(--focus-ring);
}

.sidebar {
  /* The shared red focus token is too close to this dark surface. Keep the
     keyboard indicator visibly distinct without changing the Work-Place
     brand treatment used elsewhere. */
  --focus-outline: #FFD08A;
  --focus-ring: 0 0 0 3px rgb(255 208 138 / 42%);
  background: var(--sidebar);
  border-right-color: rgb(255 255 255 / 10%);
  box-shadow: 6px 0 22px rgb(23 23 23 / 12%);
}

.brand-lockup,
.brand,
.sidebar-brand {
  color: var(--sidebar-text);
}

.brand-lockup strong,
.brand strong,
.sidebar-brand strong {
  color: var(--sidebar-text);
  font-weight: 760;
}

.brand-kicker,
.sidebar-section,
.sidebar-footer small {
  color: var(--sidebar-muted);
}

/* Supports the approved compact mark when the shared shell supplies it,
   without changing the legacy text fallback before that asset loads. */
.brand-mark,
.work-place-mark {
  overflow: hidden;
  background: var(--surface-raised);
  color: var(--brand);
  box-shadow: none;
}

.brand-mark img,
.work-place-mark img,
.brand-lockup img,
.sidebar-brand img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.brand-lockup .brand-lockup-image {
  width: min(100%, 182px);
  height: auto;
  max-height: 38px;
  object-position: left center;
}

.brand-lockup .brand-mark-image {
  display: none;
  width: 30px;
  height: 30px;
}

.auth-brand-lockup {
  display: flex;
  align-items: center;
  min-height: 76px;
  margin: -10px -10px 24px;
  padding: 16px 20px;
  border-radius: calc(var(--radius-lg) - 4px);
  background: var(--sidebar);
}

.auth-brand-lockup img {
  display: block;
  width: min(100%, 260px);
  height: auto;
  max-height: 68px;
  object-fit: contain;
  object-position: left center;
}

@media (max-width: 820px) {
  .brand-lockup { flex: 0 0 142px; width: 142px; padding: 0 10px 0 0; }
  .brand-lockup .brand-lockup-image { width: 132px; max-height: 30px; }
}

@media (max-width: 640px) {
  .brand-lockup { flex-basis: 36px; width: 36px; padding-right: 8px; }
  .brand-lockup .brand-lockup-image { display: none; }
  .brand-lockup .brand-mark-image { display: block; width: 30px; height: 30px; }
}

.role-badge {
  border-color: rgb(255 255 255 / 20%);
  background: rgb(255 255 255 / 8%);
  color: var(--sidebar-text);
}

.nav-link {
  min-height: 42px;
  color: #E6E2DC;
  transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease;
}

.nav-link .nav-icon { color: #D3CDC6; }
.nav-link .nav-count { background: rgb(255 255 255 / 10%); color: var(--sidebar-text); }

.nav-link:hover {
  background: var(--sidebar-hover);
  color: var(--sidebar-text);
}

.nav-link.active,
.nav-link[aria-current="page"] {
  border-color: rgb(210 35 60 / 42%);
  background: var(--sidebar-selected);
  color: var(--sidebar-text);
  box-shadow: inset 3px 0 0 var(--wp-brand-red);
}

.nav-link.active .nav-icon,
.nav-link[aria-current="page"] .nav-icon { color: #FFD5DC; }

.topbar {
  min-height: 72px;
  border-bottom-color: var(--line);
  background: rgb(252 251 249 / 96%);
  box-shadow: 0 1px 0 rgb(23 23 23 / 4%);
}

.live-uk-clock,
.eyebrow { color: var(--brand-dark); }

.content { padding-bottom: var(--wp-space-12); }
.page-stack { gap: var(--wp-space-6); }

.card,
.metric-card,
.calendar,
.agenda,
.table-wrap,
.calendar-legend,
.feed-week-wrap,
.week-grid-wrap,
.people-card,
.people-schedule,
.people-person-summary {
  border-color: var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.card-header,
.calendar-toolbar,
.people-schedule-toolbar {
  background: var(--surface-raised);
  border-color: var(--line);
}

.card-footer,
.modal-footer,
.table th {
  background: var(--surface-muted);
  border-color: var(--line);
}

.input,
.select,
.textarea,
.filter-bar input,
.filter-bar select,
.form-control,
.auth-card input {
  min-height: 42px;
  padding: 10px 12px;
  border-color: var(--line-strong);
  background: var(--surface-raised);
  color: var(--ink);
}

.textarea { min-height: 108px; }

.input::placeholder,
.textarea::placeholder,
.filter-bar input::placeholder { color: var(--ink-faint); opacity: 1; }

.input:hover,
.select:hover,
.textarea:hover,
.filter-bar input:hover,
.filter-bar select:hover,
.form-control:hover { border-color: #AAA198; }

.input:focus,
.select:focus,
.textarea:focus,
.filter-bar input:focus,
.filter-bar select:focus,
.form-control:focus,
.auth-card input:focus {
  border-color: var(--brand);
  box-shadow: var(--focus-ring);
}

.button,
button.button {
  min-height: 40px;
  padding: 9px 13px;
  border-color: var(--line-strong);
  background: var(--surface-raised);
  color: var(--ink);
  box-shadow: none;
}

.button:hover:not(:disabled),
button.button:hover:not(:disabled) {
  border-color: #AAA198;
  background: var(--surface-hover);
  color: var(--ink);
}

.button-primary,
.button.primary {
  border-color: var(--brand);
  background: var(--brand);
  color: #FFFFFF;
  box-shadow: 0 1px 2px rgb(141 16 37 / 24%);
}

.button-primary:hover:not(:disabled),
.button.primary:hover:not(:disabled) {
  border-color: var(--brand-dark);
  background: var(--brand-dark);
  color: #FFFFFF;
}

.button-secondary,
.button-outline {
  border-color: var(--line-strong);
  background: var(--surface-raised);
  color: var(--ink);
}

.button-danger {
  border-color: var(--danger-border);
  background: var(--surface-raised);
  color: var(--red);
}

.button-danger:hover:not(:disabled) {
  border-color: var(--red);
  background: var(--red-soft);
}

.button-ghost { color: var(--ink-soft); }
.button-ghost:hover:not(:disabled) { background: var(--surface-muted); color: var(--ink); }

.metric-card::after { background-color: var(--brand); }
.dashboard-summary-button[data-summary="today"] { border-top-color: var(--brand); }

.metric-card.accent-amber::after { background-color: var(--amber); }
.dashboard-summary-button[data-summary="high-critical"] { border-top-color: var(--amber); }

.metric-card.accent-red::after { background-color: var(--red); }

.task-row.is-important,
.task-row--high,
.agenda-item--high,
.day-agenda-item--high { box-shadow: inset 4px 0 0 var(--amber); }

.task-row--critical,
.agenda-item--critical,
.day-agenda-item--critical {
  border-left-color: var(--red);
  background: var(--red-soft);
  box-shadow: inset 4px 0 0 var(--red);
}

.task-row.is-blocked,
.task-row.is-overdue {
  background: var(--red-soft);
  box-shadow: inset 3px 0 0 var(--red);
}

.status-in-progress,
.status-active,
[data-status="in-progress"] .status-pill,
[data-status="active"] .status-pill {
  border-color: var(--wp-info-border);
  background: var(--blue-soft);
  color: var(--blue);
}

.status-completed,
.status-done,
.is-completed .status-pill,
[data-status="completed"] .status-pill,
[data-status="done"] .status-pill {
  border-color: var(--wp-success-border);
  background: var(--green-soft);
  color: var(--green);
}

.priority-high,
.priority-urgent,
.is-important .priority-pill,
[data-priority="high"] .priority-pill,
[data-priority="urgent"] .priority-pill,
.owner-unavailable-pill {
  border-color: var(--warning-border);
  background: var(--amber-soft);
  color: var(--wp-warning-ink);
}

.calendar-day-briefing-outlet:not([hidden]),
.day-cell.is-day-briefing-selected,
.feed-week-day.is-day-briefing-selected,
.feed-day.is-day-briefing-selected {
  background: var(--brand-soft);
}

.day-cell.is-day-briefing-selected,
.feed-week-day.is-day-briefing-selected,
.feed-day.is-day-briefing-selected { box-shadow: inset 0 0 0 2px var(--brand); }

.event,
.week-event {
  border-radius: var(--radius-sm);
  border-color: var(--wp-brand-border);
  border-left-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.event:hover,
.week-event:hover { background: var(--wp-brand-soft-hover); }

.event--meeting,
.week-event.event--meeting {
  border-color: var(--wp-busy-border);
  border-left-color: var(--wp-busy);
  background: var(--wp-busy-soft);
  color: var(--wp-busy-ink);
}

.event--meeting-busy {
  border-color: var(--wp-busy-border);
  border-left-color: var(--wp-busy);
  background: var(--wp-busy-soft);
  color: var(--wp-busy-ink);
}

.event--meeting-availability,
.event.event--meeting-availability,
.event--availability-free {
  border-color: var(--wp-success-border);
  border-left-color: var(--green);
  background: var(--green-soft);
  color: var(--wp-success-ink);
}

/* Unavailable, absence and holiday blocks remain neutral/read-only.  They
   must not resemble bookable availability or disclose restricted details. */
.event--availability-out-of-office,
.event--approved-absence,
.dashboard-calendar-item.is-approved-absence {
  border-color: var(--wp-absence-border);
  border-left-color: var(--absence);
  background: var(--absence-soft);
  color: var(--wp-absence-ink);
}

.event--bank-holiday,
.dashboard-calendar-item.is-bank-holiday {
  border-color: var(--wp-holiday-border);
  border-left-color: var(--holiday);
  background: var(--holiday-soft);
  color: var(--wp-holiday-ink);
}

.event--deadline,
.event.deadline,
[data-kind="deadline"].event,
.week-event.deadline,
.week-event[data-kind="deadline"] {
  border-left-color: var(--amber);
  background: var(--amber-soft);
  color: var(--wp-warning-ink);
}

.event--important,
.event.important,
.event.is-important { border-left-color: var(--amber); background: var(--amber-soft); color: var(--wp-warning-ink); }

.event--critical,
.event--blocked,
.event.blocked,
[data-status="blocked"].event {
  border-left-color: var(--red);
  background: var(--red-soft);
  color: var(--wp-danger-ink);
}

.event--completed,
.event.completed,
[data-status="completed"].event {
  border-left-color: var(--green);
  background: var(--green-soft);
  color: var(--wp-success-ink);
}

.people-status--available,
.people-schedule-window--available {
  border-color: var(--wp-success-border);
  border-left-color: var(--green);
  background: var(--green-soft);
  color: var(--wp-success-ink);
}

.people-status--busy { border-color: var(--wp-busy-border); background: var(--wp-busy-soft); color: var(--wp-busy-ink); }

.people-status--unavailable,
.people-schedule-window--unavailable {
  border-color: var(--wp-absence-border);
  border-left-color: var(--absence);
  background: var(--absence-soft);
  color: var(--wp-absence-ink);
}

.modal {
  background: var(--overlay);
}

.modal-dialog,
.modal-card {
  border-color: var(--line);
  background: var(--surface-raised);
  box-shadow: var(--shadow-lg);
}

.toast {
  border-color: var(--line);
  border-left-color: var(--brand);
  background: var(--surface-raised);
}

.notification--meeting-request,
.meeting-request-overlay {
  border-color: var(--wp-brand-border);
  border-left-color: var(--brand);
  background: var(--surface-raised);
}

@media (max-width: 640px) {
  .topbar {
    min-height: 64px;
    padding: 12px 16px;
    background: var(--surface-raised);
  }

  .button:not(.button-sm),
  button.button:not(.button-sm),
  .input,
  .select,
  .form-control,
  .filter-bar input,
  .filter-bar select,
  .auth-card input { min-height: 44px; }

  .button-icon:not(.button-sm) { width: 44px; }
  .card-header { min-height: 60px; padding: 16px; }
  .card-body { padding-right: 16px; padding-left: 16px; }
  .page-header h1 { font-size: clamp(24px, 8vw, 30px); }
  .live-uk-clock { font-size: max(var(--wp-min-text, 0px), calc(13px * var(--wp-text-scale, 1))); letter-spacing: 0.02em; }
}

@media (prefers-contrast: more) {
  :root { --line: #A8A19A; --line-strong: #716B65; }
  .button,
  .input,
  .select,
  .textarea,
  .form-control { border-width: 2px; }
  .nav-link.active,
  .nav-link[aria-current="page"] { box-shadow: inset 4px 0 0 var(--wp-brand-red); }
}

/* Chat and Notes: restrained collaboration surfaces that reuse the existing
   Work-Place palette, button, focus, and card system. */
.dashboard-collaboration-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-raised);
}
.dashboard-collaboration-summary-copy { display: grid; gap: 3px; min-width: 0; }
.dashboard-collaboration-summary-copy strong { color: var(--ink); }
.dashboard-collaboration-summary-copy span { color: var(--ink-soft); font-size: max(var(--wp-min-text, 0px), calc(13px * var(--wp-text-scale, 1))); }
.dashboard-collaboration-summary-actions { display: flex; flex-wrap: wrap; gap: 7px; justify-content: flex-end; }

.chat-page {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  width: 100%;
  max-width: 2320px;
  min-width: 0;
  min-height: 0;
  height: 100%;
  justify-self: center;
}

/* The application shell gives Chat the remaining main-panel track. Explicit
   stretch/min-height rules keep that track definite for the two-pane surface,
   rather than leaving a tall unused area below short conversation lists. */
.content--chat-workspace > .chat-page {
  align-self: stretch;
  min-height: 0;
}

.content--chat-workspace > .chat-page > .chat-layout { min-height: 0; }
[data-chat-connection-notice]:empty,
.chat-rich-media-draft-queue:empty,
.chat-attachment-queue:empty { display: none; }
.chat-layout {
  display: grid;
  grid-template-columns: clamp(260px, 22vw, 340px) minmax(0, 1fr);
  block-size: 100%;
  min-block-size: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface-raised);
}
.chat-list-pane {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-block-size: 0;
  overflow: hidden;
  border-right: 1px solid var(--line);
  background: var(--surface-muted);
}
.chat-list-header,
.chat-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}
.chat-list-header h2,
.chat-detail-header h2 { margin: 0; font-size: max(var(--wp-min-text, 0px), calc(18px * var(--wp-text-scale, 1))); }
.chat-detail-header .eyebrow { margin: 0 0 3px; }
.chat-search-form { display: flex; gap: 7px; padding: 12px; border-bottom: 1px solid var(--line); }
.chat-search-form .input { min-width: 0; flex: 1; }
.chat-search-message { margin: 0; padding: 0 12px 10px; color: var(--ink-soft); font-size: max(var(--wp-min-text, 0px), calc(13px * var(--wp-text-scale, 1))); }
.chat-search-results { display: grid; gap: 5px; padding: 0 10px 10px; border-bottom: 1px solid var(--line); }
.chat-search-results { max-height: min(360px, 40dvh); overflow-y: auto; min-height: 0; overscroll-behavior: contain; }
.chat-message.chat-search-match { outline: 2px solid var(--brand); outline-offset: 3px; background: var(--brand-soft); }
.chat-search-result {
  display: grid;
  gap: 3px;
  width: 100%;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-raised);
  color: var(--ink);
  text-align: left;
}
.chat-search-result span { color: var(--ink-soft); font-size: max(var(--wp-min-text, 0px), calc(12px * var(--wp-text-scale, 1))); }
.chat-conversation-scroll {
  flex: 1 1 auto;
  min-block-size: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}
.chat-conversation-list { display: grid; gap: 3px; padding: 8px; }
.chat-conversation-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
  width: 100%;
  padding: 10px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--ink);
  text-align: left;
}
.chat-conversation-row:hover { border-color: var(--line); background: var(--surface-raised); }
.chat-conversation-row.is-selected { border-color: var(--wp-brand-border); background: var(--brand-soft); }
.chat-conversation-row.is-unread strong { font-weight: 780; }
.chat-conversation-row-main { display: grid; min-width: 0; gap: 3px; }
.chat-conversation-row-main strong,
.chat-conversation-row-main small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-conversation-row-main small { color: var(--ink-soft); }
.chat-conversation-row-tags { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 4px; }
.chat-subtle-tag,
.note-visibility-label,
.chat-edited-label,
.chat-message-reply,
.chat-reference-unavailable {
  display: inline-flex;
  align-items: center;
  min-height: 21px;
  padding: 2px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-soft);
  font-size: max(var(--wp-min-text, 0px), calc(11px * var(--wp-text-scale, 1)));
  font-weight: 700;
}
.chat-unread-count {
  display: inline-grid;
  min-width: 21px;
  height: 21px;
  padding: 0 5px;
  place-items: center;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font-size: max(var(--wp-min-text, 0px), calc(11px * var(--wp-text-scale, 1)));
  font-weight: 800;
}
.chat-task-discussions { padding: 8px 8px 12px; border-top: 1px solid var(--line); }
.chat-task-discussions h3 { margin: 5px 7px 6px; color: var(--ink-soft); font-size: max(var(--wp-min-text, 0px), calc(12px * var(--wp-text-scale, 1))); text-transform: uppercase; letter-spacing: .06em; }
.collaboration-connection-status {
  width: fit-content;
  margin: -6px 0 2px;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-muted);
  color: var(--ink-soft);
  font-size: max(var(--wp-min-text, 0px), calc(12px * var(--wp-text-scale, 1)));
}
.chat-detail {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-block-size: 0;
  overflow: hidden;
  background: var(--surface-raised);
}
.chat-detail-empty { display: grid; min-block-size: 0; place-items: center; padding: 24px; }
.chat-load-state { max-width: 760px; }
.chat-load-notice {
  display: grid;
  gap: 7px;
  max-width: 700px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-raised);
  color: var(--ink-soft);
}
.chat-load-notice strong { color: var(--ink); }
.chat-load-notice p { margin: 0; line-height: 1.5; }
.chat-load-notice--error { border-left: 4px solid var(--amber); }
.chat-load-reference { color: var(--ink-faint); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: max(var(--wp-min-text, 0px), calc(11px * var(--wp-text-scale, 1))); }
.chat-access-removed { align-content: center; justify-items: center; gap: 9px; color: var(--ink-soft); text-align: center; }
.chat-access-removed strong { color: var(--ink); }
.chat-access-removed p { max-width: 430px; margin: 0; }
.chat-load-detail-error { align-content: center; justify-items: center; gap: 9px; color: var(--ink-soft); text-align: center; }
.chat-load-detail-error strong { color: var(--ink); }
.chat-load-detail-error p { max-width: 430px; margin: 0; }
.chat-detail-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.chat-mobile-back { display: none; }
.chat-message-list {
  display: grid;
  align-content: start;
  gap: 10px;
  flex: 1 1 auto;
  min-block-size: 0;
  min-height: 0;
  padding: 18px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}
.chat-history-load-more {
  justify-self: center;
  min-height: 31px;
  margin: 0 0 2px;
  padding-inline: 12px;
  border-color: var(--line);
  background: var(--surface-raised);
  box-shadow: var(--shadow-sm);
  font-size: max(var(--wp-min-text, 0px), calc(12px * var(--wp-text-scale, 1)));
}
.chat-history-status {
  justify-self: center;
  margin: 0 0 2px;
  color: var(--ink-soft);
  font-size: max(var(--wp-min-text, 0px), calc(12px * var(--wp-text-scale, 1)));
  text-align: center;
}
.chat-new-messages-control {
  /* The control is created beside history controls, but grid ordering places
     it after the conversation so it can remain a small bottom-edge prompt
     while someone is reading earlier messages. */
  position: sticky;
  z-index: 3;
  bottom: 8px;
  order: 2;
  justify-self: center;
  min-height: 32px;
  margin: 6px 0 0;
  padding-inline: 13px;
  border-color: var(--wp-brand-border);
  background: var(--surface-raised);
  box-shadow: var(--shadow-sm);
  color: var(--brand-dark);
  font-size: max(var(--wp-min-text, 0px), calc(12px * var(--wp-text-scale, 1)));
  font-weight: 720;
}
/* `.button` deliberately supplies `display: inline-flex`, which overrides
   the browser's default `[hidden]` declaration.  Keep a zero-unseen cue
   genuinely out of sight (and out of the message-list layout) until a
   remote arrival occurs while the reader is away from the latest message. */
.chat-new-messages-control[hidden] { display: none; }
.chat-thread { display: grid; gap: 8px; min-width: 0; }
.chat-thread-replies { display: grid; gap: 8px; margin-left: 20px; padding-left: 12px; border-left: 2px solid var(--line); }
.chat-thread-replies .chat-message.is-reply { margin-left: 0; }
.chat-message {
  position: relative;
  display: grid;
  justify-self: start;
  max-width: min(720px, 94%);
  gap: 7px;
  margin-top: 16px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-muted);
}
.chat-message.is-reply { margin-left: 24px; border-left: 3px solid var(--brand); }
.chat-message.is-removed { background: var(--surface-raised); color: var(--ink-soft); }
.chat-message-header { display: flex; align-items: baseline; flex-wrap: wrap; gap: 7px; color: var(--ink-soft); font-size: max(var(--wp-min-text, 0px), calc(12px * var(--wp-text-scale, 1))); }
.chat-message-header strong { color: var(--ink); font-size: max(var(--wp-min-text, 0px), calc(13px * var(--wp-text-scale, 1))); }
.chat-message-removed { margin: 0; color: var(--ink-soft); font-style: italic; }
.collaboration-body { min-width: 0; color: var(--ink); overflow-wrap: anywhere; }
.collaboration-body p { margin: 0 0 8px; white-space: pre-wrap; }
.collaboration-body p:last-child { margin-bottom: 0; }
.collaboration-body a { color: var(--brand-dark); text-decoration: underline; text-underline-offset: 2px; }
.chat-message-reaction-summary { display: flex; flex-wrap: wrap; gap: 5px; }
.chat-reaction { min-height: 28px; padding: 3px 7px; font-size: max(var(--wp-min-text, 0px), calc(12px * var(--wp-text-scale, 1))); }
.chat-reaction.is-mine { border-color: var(--wp-brand-border); background: var(--brand-soft); }
.chat-message-action-rail {
  position: absolute;
  z-index: 4;
  top: -16px;
  right: 10px;
  display: flex;
  align-items: center;
  gap: 3px;
  max-width: calc(100% - 12px);
  min-height: 32px;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-raised);
  box-shadow: var(--shadow-sm);
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity 120ms ease-out, transform 120ms ease-out;
}
.chat-message-quick-reactions { display: flex; align-items: center; gap: 2px; min-width: 0; }
.chat-reaction-quick,
.chat-message-more-options {
  min-width: 28px;
  min-height: 28px;
  padding: 2px 5px;
  border-radius: 999px;
}
.chat-reaction-quick.is-mine,
.chat-message-menu-reaction.is-mine { border-color: var(--wp-brand-border); background: var(--brand-soft); }
.chat-message-more-options { letter-spacing: .08em; font-weight: 800; line-height: 1; }
.chat-message:hover .chat-message-action-rail,
.chat-message:focus-within .chat-message-action-rail,
.chat-message.is-menu-open .chat-message-action-rail {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
.chat-message-action-menu {
  position: fixed;
  z-index: 260;
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  width: max-content;
  min-width: 154px;
  max-width: calc(100vw - 16px);
  padding: 5px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-raised);
  box-shadow: var(--shadow-lg);
}
.chat-message-menu-item {
  display: flex;
  flex: 1 0 100%;
  justify-content: flex-start;
  min-height: 32px;
  text-align: left;
}
.chat-message-menu-item-danger { color: var(--red); }
.chat-message-menu-item-danger:hover:not(:disabled) { background: var(--red-soft); }
.chat-message-menu-reaction {
  flex: 0 0 29px;
  width: 29px;
  min-height: 29px;
  padding: 2px;
  border-radius: 999px;
}
.chat-message-menu-separator {
  flex: 1 0 100%;
  height: 1px;
  margin: 2px 0;
  background: var(--line);
}
.chat-task-reference { justify-self: start; }
.chat-attachment-list { display: grid; gap: 6px; width: min(420px, 100%); }
.chat-attachment-card {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-raised);
  color: var(--ink);
  text-decoration: none;
}
.chat-attachment-card:hover,
.chat-attachment-card:focus-visible { border-color: var(--wp-brand-border); background: var(--brand-soft); outline: none; }
.chat-attachment-icon { display: grid; flex: 0 0 26px; width: 26px; height: 26px; place-items: center; border-radius: 50%; background: var(--brand-soft); color: var(--brand-dark); font-weight: 850; }
.chat-attachment-copy { display: grid; min-width: 0; gap: 1px; }
.chat-attachment-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: max(var(--wp-min-text, 0px), calc(13px * var(--wp-text-scale, 1))); }
.chat-attachment-copy small { color: var(--ink-soft); font-size: max(var(--wp-min-text, 0px), calc(11px * var(--wp-text-scale, 1))); text-transform: capitalize; }
.chat-composer {
  position: relative;
  z-index: 5;
  flex: 0 0 auto;
  display: grid;
  gap: 9px;
  overflow: visible;
  padding: 14px 16px;
  border-top: 1px solid var(--line);
  background: var(--surface-raised);
}
.chat-composer .field { margin: 0; }
.chat-composer .textarea { min-height: 92px; }
.chat-composer-footer { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.chat-composer-status { flex: 1; min-width: 0; margin: 0; color: var(--ink-soft); font-size: max(var(--wp-min-text, 0px), calc(13px * var(--wp-text-scale, 1))); }
.chat-attachment-composer { display: grid; min-width: 0; gap: 7px; }
.chat-attachment-toolbar-shell { position: relative; min-width: 0; }
.chat-attachment-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.chat-attachment-queue {
  display: grid;
  max-block-size: min(22dvh, 160px);
  gap: 6px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}
.chat-attachment-draft { display: grid; grid-template-columns: minmax(0, 1fr) minmax(84px, 130px) auto; align-items: center; gap: 8px; padding: 7px 9px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-muted); }
.chat-attachment-draft.is-ready { border-color: var(--wp-success-border); background: var(--green-soft); }
.chat-attachment-draft.is-failed { border-color: var(--red); background: var(--red-soft); }
.chat-attachment-draft-copy { display: grid; min-width: 0; gap: 1px; }
.chat-attachment-draft-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: max(var(--wp-min-text, 0px), calc(13px * var(--wp-text-scale, 1))); }
.chat-attachment-draft-copy small { overflow: hidden; color: var(--ink-soft); font-size: max(var(--wp-min-text, 0px), calc(11px * var(--wp-text-scale, 1))); text-overflow: ellipsis; white-space: nowrap; }
.chat-attachment-progress { width: 100%; height: 7px; accent-color: var(--brand); }
.chat-attachment-draft-actions { display: flex; justify-content: flex-end; gap: 4px; }
.chat-composer.is-file-drop-target { outline: 2px dashed var(--brand); outline-offset: -5px; background: var(--brand-soft); }
.chat-composer-media-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }
.chat-composer-media-control { min-height: 32px; white-space: nowrap; }
.chat-composer-media-control[aria-expanded="true"] { border-color: var(--wp-brand-border); background: var(--brand-soft); color: var(--brand-dark); }
.chat-composer-media-panel {
  position: absolute;
  z-index: 12;
  inset-inline-start: 12px;
  width: min(440px, calc(100% - 24px));
  bottom: calc(100% + 8px);
  max-block-size: min(420px, var(--chat-media-panel-available, 420px));
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  padding: 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  background: var(--surface-raised);
  box-shadow: var(--shadow-lg);
}
.chat-composer-media-panel.is-viewport-sheet {
  position: fixed;
  inset-inline: auto;
  left: var(--chat-media-panel-sheet-left, 8px);
  top: var(--chat-media-panel-sheet-top, 8px);
  bottom: auto;
  width: var(--chat-media-panel-sheet-width, calc(100vw - 16px));
  max-block-size: min(280px, var(--chat-media-panel-available, 160px));
}
.collaboration-access-revalidation {
  position: fixed;
  z-index: 1000;
  inset: 0;
  display: grid;
  min-width: 0;
  min-height: 100%;
  place-items: center;
  padding: 24px;
  overflow: auto;
  background: var(--surface);
}
.collaboration-access-revalidation-card {
  display: grid;
  width: min(100%, 520px);
  gap: 9px;
  padding: 22px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  background: var(--surface-raised);
  box-shadow: var(--shadow-lg);
  color: var(--ink-soft);
}
.collaboration-access-revalidation-card strong { color: var(--ink); font-size: max(var(--wp-min-text, 0px), calc(16px * var(--wp-text-scale, 1))); }
.collaboration-access-revalidation-card p { margin: 0; line-height: 1.5; }
.chat-media-picker { display: grid; gap: 9px; min-width: 0; }
.chat-media-search { width: 100%; }
.chat-media-categories { display: flex; flex-wrap: wrap; gap: 5px; }
.chat-media-category.is-selected { border-color: var(--wp-brand-border); background: var(--brand-soft); color: var(--brand-dark); }
.chat-emoji-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(42px, 1fr)); gap: 5px; }
.chat-emoji-option { display: grid; min-height: 42px; place-items: center; padding: 4px; border-radius: var(--radius-sm); font-size: max(var(--wp-min-text, 0px), calc(22px * var(--wp-text-scale, 1))); line-height: 1; }
.chat-media-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.chat-media-choice {
  display: grid;
  min-width: 0;
  gap: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-raised);
  color: var(--ink);
  text-align: left;
}
.chat-media-choice:hover,
.chat-media-choice:focus-visible { border-color: var(--wp-brand-border); background: var(--brand-soft); outline: none; }
.chat-media-picker-preview { display: block; width: 100%; aspect-ratio: 1; border-radius: 8px; object-fit: contain; background: var(--surface-muted); }
.chat-media-picker-preview-static,
.chat-rich-media-draft-preview-static { display: grid; place-items: center; color: var(--brand-dark); font-size: max(var(--wp-min-text, 0px), calc(11px * var(--wp-text-scale, 1))); font-weight: 750; letter-spacing: .04em; text-transform: uppercase; }
.chat-media-choice-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.chat-media-picker-status,
.chat-media-external-help { margin: 0; color: var(--ink-soft); font-size: max(var(--wp-min-text, 0px), calc(12px * var(--wp-text-scale, 1))); }
.chat-media-external-tools { display: grid; min-width: 0; gap: 10px; padding: 0 0 12px; border-bottom: 1px solid var(--line); background: var(--surface-raised); }
.chat-media-provider-heading { color: var(--brand-dark); font-size: max(var(--wp-min-text, 0px), calc(13px * var(--wp-text-scale, 1))); }
.chat-media-provider-tabs { display: flex; flex-wrap: wrap; gap: 5px; }
.chat-media-provider-tab.is-selected,
.chat-media-provider-tab[aria-selected="true"] { border-color: var(--wp-brand-border); background: var(--surface-raised); color: var(--brand-dark); }
.chat-media-provider-results { display: grid; min-width: 0; gap: 10px; }
.chat-media-provider-results:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.chat-media-provider-section { display: grid; min-width: 0; gap: 8px; padding: 0; background: var(--surface-raised); }
.chat-media-provider-section-heading,
.chat-media-provider-footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; }
.chat-media-provider-section-heading strong { color: var(--brand-dark); font-size: max(var(--wp-min-text, 0px), calc(12px * var(--wp-text-scale, 1))); }
.chat-media-provider-count { color: var(--ink-soft); font-size: max(var(--wp-min-text, 0px), calc(11px * var(--wp-text-scale, 1))); white-space: nowrap; }
.chat-media-provider-footer .chat-media-picker-status { min-width: 0; }
.chat-media-provider-attribution { flex: 0 0 auto; color: var(--brand-dark); font-size: max(var(--wp-min-text, 0px), calc(11px * var(--wp-text-scale, 1))); font-weight: 650; }
.chat-media-provider-grid { min-width: 0; }
.chat-media-provider-more { justify-self: start; }
.chat-media-provider-choice { border-color: var(--wp-brand-border); }
.chat-media-provider-choice:hover,
.chat-media-provider-choice:focus-visible { background: var(--brand-soft); }
.chat-rich-media-draft-queue { display: grid; gap: 6px; }
.chat-rich-media-draft { display: grid; grid-template-columns: 62px minmax(0, 1fr) auto; align-items: center; gap: 9px; padding: 7px 9px; border: 1px solid var(--wp-brand-border); border-radius: var(--radius-sm); background: var(--brand-soft); }
.chat-rich-media-draft-preview { display: block; width: 62px; height: 42px; border-radius: 6px; object-fit: cover; background: var(--surface-raised); }
.chat-rich-media-draft-copy { display: grid; min-width: 0; gap: 2px; }
.chat-rich-media-draft-copy strong,
.chat-rich-media-draft-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-rich-media-draft-copy strong { color: var(--brand-dark); font-size: max(var(--wp-min-text, 0px), calc(12px * var(--wp-text-scale, 1))); }
.chat-rich-media-draft-copy small { color: var(--ink-soft); font-size: max(var(--wp-min-text, 0px), calc(11px * var(--wp-text-scale, 1))); }
.chat-rich-media { display: grid; width: min(360px, 100%); min-width: 0; gap: 5px; margin: 0; }
.chat-rich-media-viewport {
  display: grid;
  width: 100%;
  max-height: min(340px, 48dvh);
  aspect-ratio: 16 / 9;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-muted);
}
.chat-rich-media--sticker .chat-rich-media-viewport { width: min(240px, 100%); aspect-ratio: 1; }
.chat-rich-media-image { display: block; width: 100%; height: 100%; min-height: 0; border: 0; background: transparent; object-fit: contain; }
.chat-rich-media figcaption { color: var(--ink-soft); font-size: max(var(--wp-min-text, 0px), calc(11px * var(--wp-text-scale, 1))); line-height: 1.35; }
.chat-rich-media-fallback,
.chat-rich-media-unavailable { display: block; margin: 0; padding: 9px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-muted); color: var(--ink-soft); font-size: max(var(--wp-min-text, 0px), calc(12px * var(--wp-text-scale, 1))); }
.chat-rich-media-fallback a { color: var(--brand-dark); font-weight: 650; }
.chat-rich-media-viewport > .chat-rich-media-fallback { display: grid; width: 100%; height: 100%; place-content: center; gap: 8px; border: 0; text-align: center; }
.chat-rich-media-fallback-actions { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px; }
.chat-rich-media.is-loading .chat-rich-media-viewport { background: linear-gradient(110deg, var(--surface-muted), var(--surface-raised), var(--surface-muted)); }
.chat-rich-media.is-offscreen { content-visibility: auto; contain-intrinsic-size: 360px 210px; }
.chat-message-more-reactions { min-width: 28px; min-height: 28px; padding: 2px 5px; border-radius: 999px; font-size: max(var(--wp-min-text, 0px), calc(16px * var(--wp-text-scale, 1))); line-height: 1; }
@media (prefers-reduced-motion: reduce) {
  .chat-message-action-rail { transition: none; }
  .chat-rich-media-image,
  .chat-media-picker-preview { animation: none !important; }
}
.chat-mention-details { color: var(--ink-soft); font-size: max(var(--wp-min-text, 0px), calc(13px * var(--wp-text-scale, 1))); }
.chat-mention-details summary { cursor: pointer; font-weight: 650; }
.chat-mention-details .select { width: 100%; margin-top: 7px; }
.chat-reply-banner,
.shared-note-composer-label,
.quick-note-privacy {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
  padding: 9px 11px;
  border: 1px solid var(--wp-brand-border);
  border-radius: var(--radius-sm);
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-size: max(var(--wp-min-text, 0px), calc(13px * var(--wp-text-scale, 1)));
}
.chat-starter-actions { display: grid; gap: 8px; }
.chat-member-select { width: 100%; min-height: 130px; }

.quick-note-form { max-width: 720px; }
.quick-note-privacy { align-items: flex-start; }
.quick-note-privacy strong { display: inline-flex; padding: 2px 7px; border-radius: 999px; background: var(--surface-raised); color: var(--brand-dark); font-size: max(var(--wp-min-text, 0px), calc(11px * var(--wp-text-scale, 1))); text-transform: uppercase; letter-spacing: .04em; }
.quick-note-status { min-height: 20px; margin: 0; color: var(--ink-soft); font-size: max(var(--wp-min-text, 0px), calc(13px * var(--wp-text-scale, 1))); }
.collaboration-task-picker { display: grid; gap: 7px; }
.collaboration-task-picker > label { color: var(--ink); font-size: max(var(--wp-min-text, 0px), calc(13px * var(--wp-text-scale, 1))); font-weight: 690; }
.collaboration-task-selection { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; min-height: 20px; margin: 0; color: var(--ink-soft); font-size: max(var(--wp-min-text, 0px), calc(13px * var(--wp-text-scale, 1))); }
.collaboration-task-results {
  display: grid;
  max-block-size: min(22dvh, 160px);
  gap: 5px;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.collaboration-task-result {
  display: grid;
  gap: 2px;
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-muted);
  color: var(--ink);
  text-align: left;
}
.collaboration-task-result small { color: var(--ink-soft); }

.notes-tabs,
.task-collaboration-tabs { display: flex; flex-wrap: wrap; gap: 7px; }
.notes-list { display: grid; gap: 10px; }
.note-card {
  display: grid;
  gap: 10px;
  padding: 15px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--ink-faint);
  border-radius: var(--radius-md);
  background: var(--surface-raised);
}
.note-card.is-private { border-left-color: var(--brand); }
.note-card.is-shared { border-left-color: var(--green); }
.note-card.is-removed { border-left-color: var(--ink-faint); background: var(--surface-muted); }
.note-card-header { display: flex; justify-content: space-between; gap: 12px; }
.note-card-header h2 { margin: 4px 0 0; font-size: max(var(--wp-min-text, 0px), calc(16px * var(--wp-text-scale, 1))); }
.note-card.is-private .note-visibility-label { border-color: var(--wp-brand-border); color: var(--brand-dark); background: var(--brand-soft); }
.note-card.is-shared .note-visibility-label { border-color: var(--wp-success-border); color: var(--green); background: var(--green-soft); }
.note-removed-copy { margin: 0; color: var(--ink-soft); font-style: italic; }
.note-card-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--ink-soft); font-size: max(var(--wp-min-text, 0px), calc(12px * var(--wp-text-scale, 1))); }
.shared-note-label { border-color: var(--wp-success-border); background: var(--green-soft); color: var(--green); }
.note-editor .quick-note-privacy { margin: 0; }

.task-collaboration-panel { min-width: min(820px, 100%); }
.task-collaboration-tabs { padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.task-collaboration-view { display: grid; gap: 13px; padding-top: 14px; }
.task-collaboration-help { margin: 0; color: var(--ink-soft); font-size: max(var(--wp-min-text, 0px), calc(13px * var(--wp-text-scale, 1))); }
.task-collaboration-view > .chat-message-list { max-height: min(430px, 48dvh); padding: 0; }
.task-collaboration-view > .chat-composer { padding: 0; border-top: 0; }
.task-private-note-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.task-notes-list { max-height: min(390px, 44dvh); overflow: auto; padding-right: 2px; }
.task-shared-note-composer { border: 1px solid var(--line); border-radius: var(--radius-md); }
.shared-note-composer-label { align-items: flex-start; }
.shared-note-composer-label span { color: var(--ink-soft); font-size: max(var(--wp-min-text, 0px), calc(12px * var(--wp-text-scale, 1))); }
.task-collaboration-activity h4 { margin: 0 0 9px; font-size: max(var(--wp-min-text, 0px), calc(14px * var(--wp-text-scale, 1))); }

/* HR remains a compact extension of the established Work-Place surfaces.
   These classes carry no confidential data themselves; the server decides
   which rows reach each page before this presentation layer sees them. */
.hr-page { max-width: var(--content-width); }
.hr-my-work { width: 100%; max-width: 1800px; justify-self: start; }
.hr-my-work-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  align-items: start;
  gap: 18px;
}
.hr-my-work-card { min-width: 0; }
.hr-my-work-card > .hr-action-list,
.hr-my-work-card > .hr-document-list { padding: 16px 18px; }
.hr-my-work-card > .empty-state { min-height: 116px; margin: 0; padding: 26px 18px; }
.hr-metric-grid { grid-template-columns: repeat(auto-fit, minmax(155px, 1fr)); }
.hr-profile-summary,
.hr-insight-context {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding: 18px 19px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-raised);
}
.hr-profile-summary h2 { margin: 0; font-size: max(var(--wp-min-text, 0px), calc(19px * var(--wp-text-scale, 1))); }
.hr-profile-summary > div > p { margin: 5px 0 0; color: var(--ink-soft); }
.hr-profile-summary--identity { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; }
.hr-profile-summary-identity { display: flex; align-items: center; min-width: 0; gap: 11px; }
.hr-profile-avatar,
.hr-employee-avatar {
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--wp-brand-border);
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-size: max(var(--wp-min-text, 0px), calc(13px * var(--wp-text-scale, 1)));
  font-weight: 790;
  letter-spacing: .025em;
}
.hr-profile-summary-actions { justify-self: end; }
.hr-key-value-list { display: grid; grid-template-columns: repeat(3, minmax(120px, 1fr)); gap: 10px 18px; margin: 0; }
.hr-key-value-list div { display: grid; gap: 3px; }
.hr-key-value-list dt { color: var(--ink-faint); font-size: max(var(--wp-min-text, 0px), calc(11px * var(--wp-text-scale, 1))); font-weight: 720; text-transform: uppercase; letter-spacing: .055em; }
.hr-key-value-list dd { margin: 0; color: var(--ink); font-size: max(var(--wp-min-text, 0px), calc(13px * var(--wp-text-scale, 1))); }
.hr-action-list,
.hr-document-list,
.hr-person-list { display: grid; gap: 9px; }
.hr-action-row,
.hr-document-row,
.hr-person-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}
.hr-action-row:first-child,
.hr-document-row:first-child,
.hr-person-row:first-child { padding-top: 0; }
.hr-action-row:last-child,
.hr-document-row:last-child,
.hr-person-row:last-child { padding-bottom: 0; border-bottom: 0; }
.hr-action-row-copy,
.hr-document-row-copy { min-width: 0; }
.hr-action-row-copy strong,
.hr-document-row-copy strong,
.hr-person-row strong { display: block; color: var(--ink); font-size: max(var(--wp-min-text, 0px), calc(14px * var(--wp-text-scale, 1))); }
.hr-action-row-copy p,
.hr-document-row-copy p,
.hr-person-row p { margin: 3px 0 0; color: var(--ink-soft); font-size: max(var(--wp-min-text, 0px), calc(12px * var(--wp-text-scale, 1))); line-height: 1.45; }
.hr-action-row-meta,
.hr-document-row-actions,
.hr-action-row-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 7px; }
.hr-action-row-meta { margin-top: 8px; justify-content: flex-start; color: var(--ink-faint); font-size: max(var(--wp-min-text, 0px), calc(11px * var(--wp-text-scale, 1))); }
.hr-status-pill { flex: 0 0 auto; white-space: nowrap; }
.hr-all-clear {
  margin: 0;
  padding: 12px 14px;
  border: 1px solid var(--wp-success-border);
  border-radius: var(--radius-sm);
  background: var(--green-soft);
  color: var(--wp-success-ink);
  font-size: max(var(--wp-min-text, 0px), calc(13px * var(--wp-text-scale, 1)));
  line-height: 1.45;
}
.hr-employee-profile { width: 100%; max-width: 1260px; justify-self: start; }
.hr-employee-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(300px, .9fr);
  align-items: center;
  gap: 20px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-raised);
  box-shadow: var(--shadow-sm);
}
.hr-employee-identity { display: flex; align-items: center; min-width: 0; gap: 14px; }
.hr-employee-avatar { width: 54px; height: 54px; font-size: max(var(--wp-min-text, 0px), calc(16px * var(--wp-text-scale, 1))); }
.hr-employee-identity h2 { margin: 0; color: var(--ink); font-size: clamp(21px, 2.1vw, 27px); letter-spacing: -.035em; }
.hr-employee-identity p { margin: 4px 0 0; color: var(--ink-soft); font-size: max(var(--wp-min-text, 0px), calc(13px * var(--wp-text-scale, 1))); line-height: 1.45; }
.hr-employee-statuses { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
.hr-fact-label { padding: 4px 7px; border: 1px solid var(--line); border-radius: 999px; color: var(--ink-soft); font-size: max(var(--wp-min-text, 0px), calc(11px * var(--wp-text-scale, 1))); font-weight: 650; }
.hr-employee-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 14px; margin: 0; }
.hr-employee-facts div { display: grid; gap: 3px; }
.hr-employee-facts dt { color: var(--ink-faint); font-size: max(var(--wp-min-text, 0px), calc(10px * var(--wp-text-scale, 1))); font-weight: 760; letter-spacing: .06em; text-transform: uppercase; }
.hr-employee-facts dd { margin: 0; color: var(--ink); font-size: max(var(--wp-min-text, 0px), calc(13px * var(--wp-text-scale, 1))); line-height: 1.35; }
.hr-profile-attention {
  padding: 13px 15px;
  border: 1px solid var(--warning-border);
  border-left: 3px solid var(--amber);
  border-radius: var(--radius-sm);
  background: var(--amber-soft);
  color: var(--wp-warning-ink);
}
.hr-profile-attention strong { display: block; font-size: max(var(--wp-min-text, 0px), calc(13px * var(--wp-text-scale, 1))); }
.hr-profile-attention ul { display: grid; gap: 4px; margin: 7px 0 0; padding-left: 18px; font-size: max(var(--wp-min-text, 0px), calc(12px * var(--wp-text-scale, 1))); line-height: 1.45; }
.hr-employment-list { display: grid; gap: 0; padding: 2px 18px; }
.hr-employment-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}
.hr-employment-row:last-child { border-bottom: 0; }
.hr-employment-row strong { display: block; color: var(--ink); font-size: max(var(--wp-min-text, 0px), calc(14px * var(--wp-text-scale, 1))); }
.hr-employment-row p { margin: 4px 0 0; color: var(--ink-soft); font-size: max(var(--wp-min-text, 0px), calc(12px * var(--wp-text-scale, 1))); line-height: 1.45; }
.hr-profile-organisation { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; }
.hr-profile-organisation-section { min-width: 0; padding: 16px 18px; }
.hr-profile-organisation-section + .hr-profile-organisation-section { border-left: 1px solid var(--line); }
.hr-profile-organisation-section h3 { margin: 0 0 10px; color: var(--ink); font-size: max(var(--wp-min-text, 0px), calc(13px * var(--wp-text-scale, 1))); }
.hr-profile-organisation-section > p { margin: 0; color: var(--ink-soft); font-size: max(var(--wp-min-text, 0px), calc(13px * var(--wp-text-scale, 1))); line-height: 1.45; }
.hr-source-health { display: grid; gap: 10px; }
.hr-source-health p { margin: 0; }
.hr-source-health > div { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.hr-insight-context { gap: 10px 18px; padding-block: 12px; color: var(--ink-soft); font-size: max(var(--wp-min-text, 0px), calc(12px * var(--wp-text-scale, 1))); }
.hr-insight-context span { display: inline-flex; gap: 5px; }
.hr-workspace-attention-list { display: grid; gap: 0; padding: 2px 18px; }
.hr-workspace-attention-group { padding: 14px 0; border-bottom: 1px solid var(--line); }
.hr-workspace-attention-group:first-child { padding-top: 10px; }
.hr-workspace-attention-group:last-child { padding-bottom: 10px; border-bottom: 0; }
.hr-workspace-attention-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.hr-workspace-attention-copy { display: grid; min-width: 0; gap: 2px; }
.hr-workspace-attention-heading h3 { margin: 0; color: var(--ink); font-size: max(var(--wp-min-text, 0px), calc(13px * var(--wp-text-scale, 1))); }
.hr-workspace-attention-detail { color: var(--ink-soft); font-size: max(var(--wp-min-text, 0px), calc(11px * var(--wp-text-scale, 1))); line-height: 1.35; }
.hr-workspace-attention-count,
.hr-workspace-disclosure-count {
  flex: 0 0 auto;
  min-width: 22px;
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--ink-soft);
  font-size: max(var(--wp-min-text, 0px), calc(11px * var(--wp-text-scale, 1)));
  font-variant-numeric: tabular-nums;
  text-align: center;
}
.hr-workspace-disclosures { display: grid; }
.hr-workspace-disclosure { border-bottom: 1px solid var(--line); }
.hr-workspace-disclosure:last-child { border-bottom: 0; }
.hr-workspace-disclosure summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 52px;
  padding: 11px 18px;
  color: var(--ink);
  font-size: max(var(--wp-min-text, 0px), calc(13px * var(--wp-text-scale, 1)));
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}
.hr-workspace-disclosure summary::-webkit-details-marker { display: none; }
.hr-workspace-disclosure summary::before { content: '›'; margin-right: 2px; color: var(--ink-faint); font-size: max(var(--wp-min-text, 0px), calc(18px * var(--wp-text-scale, 1))); transition: transform 140ms ease; }
.hr-workspace-disclosure[open] summary::before { transform: rotate(90deg); }
.hr-workspace-disclosure summary > span:first-child { margin-right: auto; }
.hr-workspace-disclosure-content { display: grid; gap: 10px; padding: 0 18px 16px; }
.hr-workspace-disclosure-content > .muted { margin: 0; font-size: max(var(--wp-min-text, 0px), calc(12px * var(--wp-text-scale, 1))); line-height: 1.45; }

/* The staff library deliberately remains lightweight: a clear, read-only
   list of published company material rather than another HR administration
   surface. It uses the normal content width and collapses without shifting
   the shared navigation or header. */
.company-documents-page {
  width: min(100%, 1120px);
  max-width: min(var(--content-width), 1120px);
  margin-inline: auto;
}
.company-documents-intro,
.company-documents-load-state,
.company-documents-management-notice {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-raised);
  color: var(--ink-soft);
  font-size: max(var(--wp-min-text, 0px), calc(13px * var(--wp-text-scale, 1)));
  line-height: 1.45;
}
.company-documents-intro strong,
.company-documents-load-state strong { color: var(--ink); }
.company-documents-management-notice {
  border-color: var(--wp-brand-border);
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-weight: 650;
}
.company-documents-filter-bar {
  display: grid;
  gap: 8px;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-raised);
}
.company-documents-filter-form {
  display: grid;
  grid-template-columns: minmax(220px, 1.6fr) minmax(164px, .8fr) auto;
  align-items: end;
  gap: 10px;
}
.company-documents-filter-form .field { min-width: 0; }
.company-documents-filter-actions,
.company-documents-pagination-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
}
.company-documents-filter-actions { padding-bottom: 1px; }
.company-documents-filter-summary {
  margin: 0;
  color: var(--ink-soft);
  font-size: max(var(--wp-min-text, 0px), calc(12px * var(--wp-text-scale, 1)));
  line-height: 1.4;
}
.company-documents-library-body { display: grid; min-width: 0; }
.company-documents-list { display: grid; padding: 2px 18px; }
.company-documents-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 18px 2px;
  border-top: 1px solid var(--line);
}
.company-documents-pagination-status {
  color: var(--ink-soft);
  font-size: max(var(--wp-min-text, 0px), calc(12px * var(--wp-text-scale, 1)));
  font-variant-numeric: tabular-nums;
}
.company-document-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
}
.company-document-row:last-child { border-bottom: 0; }
.company-document-row-copy { min-width: 0; }
.company-document-row-copy strong {
  display: block;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: max(var(--wp-min-text, 0px), calc(14px * var(--wp-text-scale, 1)));
}
.company-document-row-copy p {
  margin: 4px 0 0;
  color: var(--ink-soft);
  font-size: max(var(--wp-min-text, 0px), calc(12px * var(--wp-text-scale, 1)));
  line-height: 1.45;
}
.company-document-preview-note {
  margin: 5px 0 0;
  color: var(--ink-faint);
  font-size: max(var(--wp-min-text, 0px), calc(12px * var(--wp-text-scale, 1)));
  line-height: 1.4;
}
.company-document-row-actions {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}
.company-document-unavailable { color: var(--ink-faint); font-size: max(var(--wp-min-text, 0px), calc(12px * var(--wp-text-scale, 1))); }
.company-document-preview-dialog { width: min(100%, 1120px); max-height: min(900px, calc(100dvh - 32px)); }
.company-document-preview-dialog .modal-body { padding: 16px 20px 20px; overflow: hidden; }
.company-document-preview { display: grid; gap: 12px; }
.company-document-preview-context {
  margin: 0;
  color: var(--ink-soft);
  font-size: max(var(--wp-min-text, 0px), calc(13px * var(--wp-text-scale, 1)));
  line-height: 1.45;
}
.company-document-pdf-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.company-document-pdf-page-label { color: var(--ink); padding-inline: 8px; font-variant-numeric: tabular-nums; }
.company-document-pdf-status { margin: 0; color: var(--ink-soft); font-size: max(var(--wp-min-text, 0px), calc(13px * var(--wp-text-scale, 1))); line-height: 1.4; }
.company-document-pdf-dialog {
  display: flex; flex-direction: column; height: min(900px, calc(100dvh - 40px)); overflow: hidden;
}
.company-document-pdf-dialog .modal-header,
.company-document-pdf-dialog .modal-footer { flex: 0 0 auto; }
.company-document-pdf-dialog .modal-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
.company-document-pdf-preview { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.company-document-pdf-viewport {
  flex: 1 1 auto; min-width: 0; min-height: 160px; overflow: auto; overscroll-behavior: contain;
  padding: 16px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-muted);
}
.company-document-pdf-viewport:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.company-document-pdf-page-host { display: flex; justify-content: safe center; min-width: min-content; }
.company-document-pdf-page-host canvas { flex: 0 0 auto; display: block; background: white; box-shadow: 0 2px 12px rgb(0 0 0 / .16); }
.company-document-pdf-text { flex: 0 0 auto; color: var(--ink); }
.company-document-pdf-text summary { cursor: pointer; padding-block: 6px; }
.company-document-pdf-page-text { max-height: 200px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; font-family: inherit; line-height: 1.5; user-select: text; }
.company-document-preview-frame {
  display: block;
  width: 100%;
  height: min(68dvh, 720px);
  min-height: 360px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-muted);
}
.company-document-docx-preview-status {
  margin: 0;
  color: var(--ink-soft);
  font-size: max(var(--wp-min-text, 0px), calc(13px * var(--wp-text-scale, 1)));
  line-height: 1.45;
}
.company-document-docx-preview-actions { display: flex; justify-content: flex-start; }
.company-document-docx-preview-surface {
  min-height: 360px;
  max-height: min(68dvh, 720px);
  overflow: auto;
  overscroll-behavior: contain;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-muted);
  color: var(--ink);
  outline: none;
}
.company-document-docx-preview-surface:focus-visible {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

/* A very wide display should feel like a workspace, not a narrow page sat in
   the middle of a large empty canvas. Keep prose and message bubbles capped
   for comfortable reading, while allowing boards, calendars and the Chat
   workspace itself to use the available horizontal and vertical room. */
@media (min-width: 1800px) {
  :root {
    /* Fill a very wide desktop without trapping the whole workspace inside
       the old 3400px ceiling. Individual reading surfaces below remain
       deliberately bounded, so the extra room is useful board/calendar
       space rather than excessively long message lines. */
    --content-width: clamp(1600px, 94vw, 4400px);
  }

  .content {
    padding-inline: clamp(32px, 3vw, 80px);
  }

  .chat-layout { grid-template-columns: 320px minmax(0, 1fr); }

  .chat-list-header,
  .chat-detail-header {
    padding: 18px 20px;
  }

  .chat-message-list {
    /* Keep the readable message column anchored to the conversation edge.
       Centre alignment makes a wide Chat look detached from its header and
       composer, whereas the start edge matches the normal desktop layout. */
    justify-items: stretch;
    padding: 22px clamp(24px, 2vw, 40px);
  }

  .chat-message-list > .chat-thread {
    width: 100%;
    justify-self: stretch;
  }

  .chat-composer {
    padding: 16px clamp(20px, 1.8vw, 32px);
  }

  .chat-message {
    max-width: min(820px, 76%);
  }
}

@media (min-width: 2600px) {
  .chat-layout {
    grid-template-columns: 340px minmax(0, 1fr);
  }

  .chat-list-header,
  .chat-detail-header {
    padding: 20px 24px;
  }

  .chat-message-list {
    padding-inline: clamp(32px, 2.4vw, 56px);
  }

  .chat-message-list > .chat-thread {
    width: 100%;
  }

  .chat-composer {
    padding-inline: clamp(28px, 2.2vw, 48px);
  }

  .chat-message {
    max-width: min(880px, 72%);
  }
}

@media (max-width: 760px) {
  .hr-profile-summary,
  .hr-action-row,
  .hr-document-row,
  .hr-person-row { align-items: flex-start; flex-direction: column; }
  .hr-key-value-list { width: 100%; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hr-profile-summary--identity { grid-template-columns: 1fr; }
  .hr-profile-summary-actions { justify-self: start; }
  .hr-employee-hero { grid-template-columns: 1fr; padding: 18px; }
  .hr-employee-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hr-employment-row { align-items: flex-start; flex-direction: column; }
  .hr-profile-organisation { grid-template-columns: 1fr; }
  .hr-profile-organisation-section + .hr-profile-organisation-section { border-top: 1px solid var(--line); border-left: 0; }
  .hr-workspace-attention-list { padding-inline: 14px; }
  .hr-workspace-disclosure summary { padding-inline: 14px; }
  .hr-workspace-disclosure-content { padding-right: 14px; padding-left: 14px; }
  .hr-action-row-actions,
  .hr-document-row-actions { justify-content: flex-start; }
  .company-documents-list { padding-inline: 14px; }
  .company-documents-filter-form { grid-template-columns: 1fr 1fr; }
  .company-documents-filter-actions { grid-column: 1 / -1; }
  .company-document-row { grid-template-columns: 1fr; align-items: flex-start; gap: 10px; }
  .company-document-row-actions { justify-content: flex-start; }
  .company-document-preview-dialog { max-height: 92dvh; }
  .company-document-preview-dialog .modal-body { padding: 14px 16px 18px; }
  .company-document-preview-frame { height: min(62dvh, 620px); min-height: 300px; }
  .company-document-docx-preview-surface { min-height: 300px; max-height: min(62dvh, 620px); padding: 14px; }
}

@media (max-width: 430px) {
  .hr-key-value-list { grid-template-columns: 1fr; }
  .hr-employee-facts { grid-template-columns: 1fr; }
  .company-documents-filter-form { grid-template-columns: 1fr; }
  .company-documents-filter-actions { grid-column: auto; }
  .company-documents-pagination { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 820px) {
  .dashboard-collaboration-summary { align-items: flex-start; flex-direction: column; }
  .dashboard-collaboration-summary-actions { justify-content: flex-start; }
  .chat-page { height: auto; grid-template-rows: auto; }
  .chat-layout {
    grid-template-columns: 1fr;
    block-size: clamp(500px, 72dvh, 650px);
    min-block-size: 0;
  }
  .chat-composer-media-panel { max-block-size: min(320px, var(--chat-media-panel-available, 320px)); }
  .chat-list-pane { min-block-size: 0; border-right: 0; }
  .chat-layout.has-active-conversation .chat-list-pane { display: none; }
  .chat-detail { min-block-size: 0; }
  .chat-mobile-back { display: inline-flex; }
  .task-collaboration-panel { min-width: 0; }
}

@media (max-width: 640px) {
  .chat-layout { block-size: clamp(620px, 92dvh, 720px); }
  .chat-list-header,
  .chat-detail-header,
  .chat-message-list,
  .chat-composer { gap: 6px; padding: 10px 13px; }
  .chat-composer .textarea { min-height: 64px; max-height: 96px; }
  .chat-composer-media-panel { max-block-size: min(280px, var(--chat-media-panel-available, 280px)); }
  .chat-attachment-queue { max-block-size: min(18dvh, 96px); }
  .collaboration-task-results { max-block-size: min(16dvh, 96px); }
  .chat-detail-header { align-items: flex-start; flex-direction: column; }
  .chat-detail-actions { justify-content: flex-start; }
  .chat-message { max-width: 100%; }
  .chat-message.is-reply { margin-left: 9px; }
  .chat-thread-replies { margin-left: 8px; padding-left: 8px; }
  .chat-composer-footer,
  .note-card-meta,
  .task-private-note-header { align-items: flex-start; flex-direction: column; }
  .chat-composer-footer .button { align-self: flex-end; }
  .chat-composer-footer > .field-help { display: none; }
  .chat-attachment-draft { grid-template-columns: minmax(0, 1fr) auto; }
  .chat-attachment-progress { grid-column: 1 / -1; grid-row: 2; }
  .note-card-header { align-items: flex-start; flex-direction: column; }
}

/* A normal laptop should retain a useful transcript, not devote most of the
   Chat pane to a closed composer. All controls remain present: only passive
   heading copy and the visible textarea label are compacted, while the two
   optional disclosure controls share one row. */
@media (max-height: 900px) and (min-width: 821px) {
  .content--chat-workspace { padding-block: 14px 16px; }
  .chat-page { gap: 10px; }
  .chat-page > .page-header .eyebrow,
  .chat-page > .page-header .page-description { display: none; }
  .chat-page > .page-header h1 { margin: 0; font-size: max(var(--wp-min-text, 0px), calc(24px * var(--wp-text-scale, 1))); }
  .chat-page .chat-list-header,
  .chat-page .chat-detail-header { padding: 10px 14px; }
  .chat-page .chat-composer {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 5px 10px;
    padding: 8px 12px;
  }
  .chat-page .chat-composer > .chat-composer-media-panel,
  .chat-page .chat-composer > .chat-reply-banner,
  .chat-page .chat-composer > .field,
  .chat-page .chat-composer > .chat-rich-media-draft-queue,
  .chat-page .chat-composer > .chat-attachment-composer,
  .chat-page .chat-composer > .chat-composer-footer { grid-column: 1 / -1; }
  .chat-page .chat-composer > .field > label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }
  .chat-page .chat-composer .textarea { min-height: 54px; max-height: 72px; }
  .chat-page .chat-composer > .chat-mention-details { min-width: 0; }
  .chat-page .chat-composer > .chat-mention-details summary {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .chat-page .chat-attachment-toolbar,
  .chat-page .chat-composer-footer { gap: 6px; }
}

@media (hover: none), (pointer: coarse), (max-width: 560px) {
  .chat-message { margin-top: 0; padding-right: 46px; }
  .chat-message-action-rail {
    top: 7px;
    right: 7px;
    max-width: none;
    min-height: 30px;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    opacity: 1;
    pointer-events: auto;
    transform: none;
  }
  .chat-message-quick-reactions { display: none; }
  /* Leave one compact rail control in the narrow/touch layout. The full
     reaction picker remains available from its labelled three-dot menu. */
  .chat-message-more-reactions { display: none; }
  .chat-message-more-options {
    min-width: 30px;
    min-height: 30px;
    border: 1px solid var(--line);
    background: var(--surface-raised);
  }
}

@media print {
  body { background: #fff; }
  .sidebar, .topbar-actions, .filter-bar, .button, .toast-container, .modal, .meeting-request-overlay, .in-app-notification-tray, .notification-entry-summary { display: none !important; }
  .app-shell { display: block; }
  .topbar { position: static; padding: 0 0 16px; background: #fff; }
  .content { width: 100%; max-width: none; padding: 0; }
  .card, .metric-card, .calendar, .agenda, .table-wrap { box-shadow: none; }
}

/* -------------------------------------------------------------------------
   Work-Place finishing polish — presentation only

   This intentionally small final layer unifies the existing visual system
   rather than introducing another theme.  It keeps operational surfaces calm,
   makes hierarchy easier to scan, and leaves every route, control and data
   behaviour exactly as it is.
   ------------------------------------------------------------------------- */

:root {
  --wp-shadow-surface: 0 1px 2px rgb(23 23 23 / 5%), 0 4px 12px rgb(23 23 23 / 3%);
  --wp-shadow-float: 0 14px 34px rgb(23 23 23 / 12%), 0 2px 6px rgb(23 23 23 / 6%);
}

.app-shell {
  background:
    radial-gradient(1000px 500px at 100% -120px, rgb(210 35 60 / 4%), transparent 68%),
    linear-gradient(180deg, #fcfbf9 0, var(--canvas) 260px);
}

/* Keyboard users can move past the persistent navigation without disturbing
   the compact visual shell for pointer users. */
.skip-link {
  position: fixed;
  z-index: 500;
  top: 12px;
  left: 12px;
  padding: 10px 13px;
  border: 1px solid var(--brand-dark);
  border-radius: var(--radius-sm);
  background: var(--sidebar);
  box-shadow: var(--wp-shadow-float);
  color: #fff;
  font-weight: 720;
  text-decoration: none;
  transform: translateY(-160%);
  transition: transform 150ms ease-out;
}

.skip-link:focus-visible {
  color: #fff;
  outline: 2px solid #fff;
  outline-offset: 2px;
  transform: translateY(0);
}

.sidebar {
  border-right-color: rgb(255 255 255 / 9%);
  box-shadow: 1px 0 0 rgb(23 23 23 / 18%);
}

.brand-lockup {
  margin-bottom: 3px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgb(255 255 255 / 8%);
}

.sidebar nav,
.nav-list { gap: 4px; }

.sidebar-section { margin-top: 18px; }

.nav-link {
  min-height: 42px;
  padding-inline: 11px;
  border-radius: 11px;
}

.nav-link.active,
.nav-link[aria-current="page"] {
  background: linear-gradient(90deg, rgb(210 35 60 / 23%), rgb(210 35 60 / 10%));
  box-shadow: inset 3px 0 0 var(--wp-brand-red), 0 1px 0 rgb(255 255 255 / 4%);
}

.topbar {
  background: rgb(252 251 249 / 94%);
  box-shadow: 0 1px 0 rgb(23 23 23 / 6%), 0 8px 20px rgb(23 23 23 / 2%);
  backdrop-filter: blur(16px) saturate(112%);
}

.live-uk-clock {
  color: var(--brand-dark);
  font-weight: 780;
}

.content {
  padding-top: clamp(24px, 3vw, 42px);
}

.page-stack { gap: clamp(20px, 2vw, 28px); }

.page-header {
  gap: clamp(18px, 2.4vw, 32px);
  padding: 2px 0;
}

.page-description {
  max-width: 70ch;
  font-size: max(var(--wp-min-text, 0px), calc(13.5px * var(--wp-text-scale, 1)));
  line-height: 1.55;
}

.page-actions { gap: 9px; }

/* One restrained elevation for ordinary application surfaces; only overlays
   and explicitly interactive summaries receive a larger lift. */
.card,
.metric-card,
.calendar,
.agenda,
.table-wrap,
.people-card,
.people-schedule,
.people-person-summary,
.dashboard-collaboration-summary {
  border-color: rgb(23 23 23 / 11%);
  box-shadow: var(--wp-shadow-surface);
}

.filter-bar,
.calendar-legend,
.team-calendar-filter-summary {
  border-color: rgb(23 23 23 / 10%);
  box-shadow: none;
}

.card-header,
.calendar-toolbar,
.people-schedule-toolbar {
  background: linear-gradient(180deg, var(--surface) 0%, var(--surface-raised) 100%);
}

.card-header h2,
.card-header h3,
.section-heading h2 { font-size: max(var(--wp-min-text, 0px), calc(16px * var(--wp-text-scale, 1))); }

.metric-card,
.dashboard-summary-button {
  background: linear-gradient(145deg, var(--surface) 0%, #fdfbf9 100%);
}

.dashboard-summary-button:hover:not(:disabled) {
  border-color: var(--wp-brand-border);
  background: linear-gradient(145deg, var(--surface) 0%, var(--brand-soft) 180%);
  box-shadow: 0 8px 20px rgb(23 23 23 / 8%);
}

.button-primary,
.button.primary {
  transition: background-color 150ms ease, border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.button-primary:hover:not(:disabled),
.button.primary:hover:not(:disabled) {
  box-shadow: 0 5px 13px rgb(141 16 37 / 22%);
  transform: translateY(-1px);
}

.button-primary:active:not(:disabled),
.button.primary:active:not(:disabled) { transform: translateY(0); }

.filter-chip {
  border-color: var(--wp-brand-border);
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-size: max(var(--wp-min-text, 0px), calc(12px * var(--wp-text-scale, 1)));
}

.filter-chip:hover:not(:disabled) {
  border-color: var(--brand);
  background: var(--wp-brand-soft-hover);
}

.table th,
.table td { padding-block: 13px; }
.table td { color: var(--ink-soft); font-size: max(var(--wp-min-text, 0px), calc(13px * var(--wp-text-scale, 1))); }
.table tbody tr:hover { background: #fcf9f7; }

.empty-state {
  margin: 4px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--surface-raised), var(--surface));
}

.calendar-day-briefing-outlet:not([hidden]) { background: var(--surface-muted); }

.daily-task-title:hover { background: var(--surface-hover); }
.daily-task-title:focus {
  border-color: var(--brand);
  background: var(--surface-raised);
  box-shadow: var(--focus-ring);
}

/* A contained, readable Chat surface: thread gap owns vertical rhythm, and
   messages no longer stack an additional 16px margin on top of it. */
.chat-layout {
  border-color: rgb(23 23 23 / 13%);
  box-shadow: var(--wp-shadow-surface);
}

.chat-list-pane { background: linear-gradient(180deg, #faf8f6, var(--surface-muted)); }

.chat-list-header,
.chat-detail-header { background: rgb(255 255 255 / 72%); }

.chat-conversation-row { border-radius: 9px; }
.chat-conversation-row.is-selected { box-shadow: inset 3px 0 0 var(--brand); }

.chat-message-list { gap: 12px; }
.chat-thread { gap: 10px; }
.chat-message {
  margin-top: 0;
  border-color: rgb(23 23 23 / 10%);
  background: var(--surface-raised);
  box-shadow: 0 1px 2px rgb(23 23 23 / 4%);
}

.chat-message:hover { border-color: var(--line-strong); }

.chat-composer {
  background: linear-gradient(180deg, var(--surface-raised), var(--surface));
  box-shadow: 0 -1px 0 rgb(23 23 23 / 5%);
}

.chat-message-action-menu,
.modal-dialog,
.modal-card,
.toast { box-shadow: var(--wp-shadow-float); }

.dashboard-overdue-help {
  margin: -2px 0 8px;
  color: var(--ink-soft);
  font-size: max(var(--wp-min-text, 0px), calc(12px * var(--wp-text-scale, 1)));
  line-height: 1.45;
}

.dashboard-inline-checklist .daily-overdue-complete { margin-left: 2px; }

@media (min-width: 641px) and (max-width: 820px) {
  .topbar {
    min-height: auto;
    flex-wrap: wrap;
    row-gap: 9px;
  }

  .topbar-context { flex: 1 1 100%; }
  .topbar-actions {
    width: 100%;
    margin-left: 0;
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 2px;
  }
}

@media (min-width: 1800px) {
  :root { --sidebar-width: clamp(252px, 14vw, 296px); }

  .topbar { padding-inline: clamp(32px, 3vw, 80px); }

  .calendar-page,
  .personal-calendar {
    width: 100%;
    max-width: none;
  }

  .chat-layout { grid-template-columns: clamp(320px, 22vw, 440px) minmax(0, 1fr); }
}

@media (min-width: 2600px) {
  .chat-layout { grid-template-columns: clamp(360px, 18vw, 500px) minmax(0, 1fr); }
}

@media (max-width: 640px) {
  .content { padding-top: 20px; }
  .page-description { font-size: max(var(--wp-min-text, 0px), calc(13px * var(--wp-text-scale, 1))); }
  .empty-state { margin: 0; padding: 36px 18px; }
  .calendar-day-briefing-row:not([hidden]),
  .calendar-day-briefing-outlet:not([hidden]) { box-shadow: 0 -14px 34px rgb(23 23 23 / 16%); }
  .calendar-page .event { min-height: 30px; font-size: max(var(--wp-min-text, 0px), calc(11px * var(--wp-text-scale, 1))); }
  .daily-overdue-complete,
  .related-task-complete { min-height: 32px; }
  .related-task { grid-template-columns: minmax(0, 1fr); }
  .related-task-actions { justify-content: flex-start; }
}

/* Holiday requests and staffing cover are deliberately separate from the
   confirmed-absence calendar treatment. These surfaces use calm, compact
   planning states and do not expose a leave reason, source details, or any
   provider metadata. */
.holiday-request-list,
.staffing-cover-list,
.staffing-rules-card { gap: 12px; }

/* A clear cover board should confirm a quiet day without making an empty
   state compete visually with actual staffing risks. */
.staffing-cover-page .staffing-cover-list > .empty-state {
  min-height: 0;
  margin: 0;
  padding: 24px 18px;
}

.staffing-cover-page .staffing-cover-list > .notice { margin: 0; }

/* Request lists are grouped by the next action, rather than making someone
   scan a flat history of different states.  The treatment stays deliberately
   quiet: colour is a secondary cue, while the heading states the purpose. */
.holiday-request-groups {
  display: grid;
  gap: 14px;
}

.holiday-request-group {
  display: grid;
  gap: 10px;
  padding: 13px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--wp-info-border);
  border-radius: var(--radius);
  background: var(--surface-muted);
}

.holiday-request-group--action {
  border-color: var(--warning-border);
  border-left-color: var(--wp-warning);
  background: linear-gradient(135deg, var(--amber-soft), var(--surface-raised) 56%);
}

.holiday-request-group--progress {
  border-color: var(--wp-info-border);
  border-left-color: var(--wp-info);
  background: linear-gradient(135deg, var(--wp-info-soft), var(--surface-raised) 56%);
}

.holiday-request-group--settled {
  border-left-color: var(--wp-success);
  background: linear-gradient(135deg, var(--wp-success-soft), var(--surface-raised) 56%);
}

.holiday-request-group-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.holiday-request-group-header h3,
.holiday-request-group-header p {
  margin: 0;
}

.holiday-request-group-header h3 {
  color: var(--ink);
  font-size: max(var(--wp-min-text, 0px), calc(13px * var(--wp-text-scale, 1)));
  font-weight: 760;
  letter-spacing: -0.01em;
}

.holiday-request-group-header p {
  margin-top: 3px;
  color: var(--ink-soft);
  font-size: max(var(--wp-min-text, 0px), calc(12px * var(--wp-text-scale, 1)));
  line-height: 1.4;
}

.holiday-request-group-count {
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  min-width: 25px;
  height: 25px;
  padding: 0 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-raised);
  color: var(--ink-soft);
  font-size: max(var(--wp-min-text, 0px), calc(12px * var(--wp-text-scale, 1)));
  font-weight: 760;
  font-variant-numeric: tabular-nums;
}

.staffing-weekday-picker,
.staffing-recipient-picker {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-muted);
}

.staffing-recipient-options {
  display: grid;
  gap: 7px;
}

.staffing-recipient-options .check-field {
  min-height: 32px;
  padding: 5px 7px;
  border-radius: var(--radius-sm);
}

.holiday-request-rows,
.staffing-cover-rows,
.staffing-rule-list {
  display: grid;
  gap: 9px;
}

.holiday-request-archive {
  display: grid;
  gap: 10px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-muted);
}

.holiday-request-archive > summary {
  cursor: pointer;
  color: var(--ink);
  font-size: max(var(--wp-min-text, 0px), calc(13px * var(--wp-text-scale, 1)));
  font-weight: 700;
}

.holiday-request-archive > p { margin: 0; }

/* An empty personal-request section should not compete with calendar work.
   Its explanation remains available, while the clear Book holiday action is
   still in the card header. */
.holiday-request-empty-summary {
  display: grid;
  gap: 9px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-muted);
}

.holiday-request-empty-summary > summary {
  cursor: pointer;
  color: var(--ink);
  font-size: max(var(--wp-min-text, 0px), calc(13px * var(--wp-text-scale, 1)));
  font-weight: 700;
}

.holiday-request-empty-summary-copy {
  display: grid;
  gap: 8px;
}

.holiday-request-empty-summary-copy > p { margin: 0; }

.holiday-request-row,
.staffing-cover-row,
.staffing-rule-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(145deg, var(--surface-raised), var(--surface));
}

.holiday-request-row--archived {
  background: var(--surface-raised);
  opacity: .82;
}

.holiday-request-main,
.staffing-cover-main,
.staffing-rule-row > div {
  display: grid;
  min-width: 0;
  gap: 5px;
}

.holiday-request-details {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px 7px;
  min-width: 0;
}

.holiday-request-detail {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 2px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--ink-soft);
  font-size: max(var(--wp-min-text, 0px), calc(11px * var(--wp-text-scale, 1)));
  font-weight: 650;
  line-height: 1.3;
}

.holiday-request-details--review .holiday-request-detail:first-child {
  border-color: var(--wp-info-border);
  background: var(--wp-info-soft);
  color: var(--wp-info);
}

.holiday-request-next-step {
  display: block;
  color: var(--ink-soft);
  font-size: max(var(--wp-min-text, 0px), calc(12px * var(--wp-text-scale, 1)));
  line-height: 1.45;
}

.holiday-request-message,
.holiday-request-note {
  display: grid;
  gap: 2px;
  margin: 2px 0 0;
  padding: 8px 9px;
  border-left: 3px solid var(--wp-info-border);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--wp-info-soft);
  color: var(--ink-soft);
  font-size: max(var(--wp-min-text, 0px), calc(12px * var(--wp-text-scale, 1)));
  line-height: 1.45;
}

.holiday-request-message strong,
.holiday-request-note strong {
  color: var(--ink);
  font-size: max(var(--wp-min-text, 0px), calc(11px * var(--wp-text-scale, 1)));
  font-weight: 760;
}

.holiday-request-details--review .holiday-request-note {
  flex: 1 0 100%;
  margin-top: 2px;
}

.holiday-request-heading,
.staffing-cover-heading {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.holiday-request-range,
.holiday-request-department,
.holiday-request-days,
.staffing-cover-date,
.staffing-cover-count,
.staffing-cover-partial,
.staffing-rule-row span {
  color: var(--ink-soft);
  font-size: max(var(--wp-min-text, 0px), calc(13px * var(--wp-text-scale, 1)));
  line-height: 1.4;
}

.holiday-request-actions {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
}

.holiday-request-status,
.staffing-severity {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border: 1px solid var(--wp-info-border);
  border-radius: 999px;
  background: var(--wp-info-soft);
  color: var(--wp-info);
  font-size: max(var(--wp-min-text, 0px), calc(11px * var(--wp-text-scale, 1)));
  font-weight: 700;
  letter-spacing: .01em;
  line-height: 1.2;
}

.holiday-request-status--approved-awaiting-brighthr-confirmation,
.holiday-request-status--awaiting-brighthr-confirmation {
  border-color: var(--wp-holiday-border);
  background: var(--wp-holiday-soft);
  color: var(--wp-holiday-ink);
}

.holiday-request-status--declined,
.holiday-request-status--cancelled,
.holiday-request-status--withdrawn {
  border-color: var(--danger-border);
  background: var(--red-soft);
  color: var(--wp-danger-ink);
}

.holiday-request-status--confirmed {
  border-color: var(--wp-success-border);
  background: var(--wp-success-soft);
  color: var(--wp-success-ink);
}

.holiday-request-authority-notice {
  margin: 3px 0 0;
  color: var(--wp-holiday-ink);
  font-size: max(var(--wp-min-text, 0px), calc(12px * var(--wp-text-scale, 1)));
  line-height: 1.45;
}

.holiday-duration-hint {
  min-height: 18px;
  margin: -5px 0 0;
  color: var(--ink-soft);
  font-size: max(var(--wp-min-text, 0px), calc(12px * var(--wp-text-scale, 1)));
  line-height: 1.45;
}

.holiday-request-form .holiday-request-authority {
  margin: 0;
}

.holiday-time-range {
  display: grid;
  grid-column: span 2;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.holiday-time-range[hidden] { display: none; }

.holiday-cover-preview {
  display: grid;
  gap: 4px;
  padding: 11px 12px;
  border: 1px solid var(--wp-success-border);
  border-radius: var(--radius-sm);
  background: var(--wp-success-soft);
  color: var(--wp-success-ink);
  font-size: max(var(--wp-min-text, 0px), calc(13px * var(--wp-text-scale, 1)));
  line-height: 1.4;
}

.holiday-cover-preview.is-at_risk,
.holiday-cover-preview.is-warning {
  border-color: var(--warning-border);
  background: var(--amber-soft);
  color: var(--wp-warning-ink);
}

.holiday-cover-preview.is-critical {
  border-color: var(--danger-border);
  background: var(--red-soft);
  color: var(--wp-danger-ink);
}

.holiday-review-summary {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-muted);
  color: var(--ink-soft);
  font-size: max(var(--wp-min-text, 0px), calc(13px * var(--wp-text-scale, 1)));
}

.holiday-review-summary strong { color: var(--ink); }

/* A manager review is a decision, not a tall form.  Keep the request and its
   cover impact alongside the action on wide displays, while retaining the
   familiar bottom-sheet layout on phones. */
.modal-dialog.holiday-review-dialog {
  width: min(100%, 1040px);
  max-height: min(900px, calc(100dvh - 48px));
}

.holiday-decision-layout {
  display: grid;
  grid-template-columns: minmax(260px, .92fr) minmax(320px, 1.08fr);
  align-items: start;
  gap: 16px;
}

.holiday-decision-context,
.holiday-decision-pane {
  display: grid;
  min-width: 0;
  gap: 12px;
}

.holiday-decision-context {
  align-content: start;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-muted);
}

.holiday-decision-context .holiday-review-summary {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.holiday-decision-context .holiday-request-details {
  align-items: flex-start;
}

.holiday-decision-pane {
  align-content: start;
}

.holiday-decision-pane > .field,
.holiday-decision-pane > .holiday-decision-notes,
.holiday-decision-pane > .holiday-override-panel,
.holiday-decision-pane > .holiday-decision-hint,
.holiday-decision-pane > .holiday-review-authority {
  margin: 0;
}

.holiday-decision-hint {
  margin: 0;
  padding: 9px 10px;
  border-left: 3px solid var(--wp-info-border);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--wp-info-soft);
  color: var(--wp-info);
  font-size: max(var(--wp-min-text, 0px), calc(12px * var(--wp-text-scale, 1)));
  line-height: 1.45;
}

.holiday-decision-notes {
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-muted);
}

.holiday-decision-notes > summary {
  cursor: pointer;
  color: var(--ink);
  font-size: max(var(--wp-min-text, 0px), calc(12px * var(--wp-text-scale, 1)));
  font-weight: 720;
}

.holiday-decision-notes[open] > summary { margin-bottom: 10px; }

.holiday-decision-notes .field { margin: 0; }

.holiday-override-panel {
  display: grid;
  gap: 8px;
  padding: 11px;
  border: 1px solid var(--danger-border);
  border-left: 4px solid var(--danger);
  border-radius: var(--radius-sm);
  background: var(--red-soft);
}

.holiday-override-panel[hidden] { display: none; }

.holiday-override-guidance {
  margin: 0;
  color: var(--wp-danger-ink);
  font-size: max(var(--wp-min-text, 0px), calc(12px * var(--wp-text-scale, 1)));
  font-weight: 650;
  line-height: 1.45;
}

.holiday-review-authority {
  margin: 0;
  font-size: max(var(--wp-min-text, 0px), calc(12px * var(--wp-text-scale, 1)));
  line-height: 1.45;
}

.holiday-review-summary-heading,
.holiday-decision-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.holiday-decision-actions {
  width: 100%;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.holiday-decision-employee-message[hidden],
.holiday-decision-error[hidden] { display: none; }

.holiday-decision-error {
  margin: 0;
  padding: 9px 10px;
  border-left: 3px solid var(--danger);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--red-soft);
  color: var(--wp-danger-ink);
  font-size: max(var(--wp-min-text, 0px), calc(12px * var(--wp-text-scale, 1)));
  font-weight: 650;
  line-height: 1.45;
}

.holiday-review-card {
  width: min(100%, 1160px);
  justify-self: start;
}

/* On an ultrawide monitor, a single pending-review row should not turn into a
   long, low-information strip across the page.  This condition targets only
   the reviewer card, leaving the cover dashboard and personal request list
   free to use the available workspace. */
@supports selector(.card:has(.holiday-request-row--review)) {
  .staffing-cover-page > .card:has(.holiday-request-row--review) {
    width: min(100%, 1160px);
    justify-self: start;
  }
}

@media (max-width: 820px) {
  .holiday-decision-layout { grid-template-columns: minmax(0, 1fr); }
  .holiday-decision-context { padding: 12px; }
}

.staffing-tabs {
  display: inline-flex;
  align-self: flex-start;
  max-width: 100%;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-raised);
  box-shadow: var(--shadow-sm);
}

.staffing-tab {
  min-height: 32px;
  border-radius: 999px;
}

.staffing-tab.is-active,
.staffing-tab[aria-selected="true"] {
  border-color: var(--wp-brand-border);
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-weight: 700;
}

.staffing-cover-row--critical {
  border-color: var(--danger-border);
  background: linear-gradient(145deg, var(--surface), var(--red-soft));
}

.staffing-cover-row--at-risk,
.staffing-cover-row--warning {
  border-color: var(--warning-border);
  background: linear-gradient(145deg, var(--surface), var(--amber-soft));
}

.staffing-cover-row--covered,
.staffing-cover-row--healthy,
.staffing-cover-row--ok {
  border-color: var(--wp-success-border);
}

.staffing-cover-row--critical .staffing-severity {
  border-color: var(--danger-border);
  background: var(--red-soft);
  color: var(--wp-danger-ink);
}

.staffing-cover-row--at-risk .staffing-severity,
.staffing-cover-row--warning .staffing-severity {
  border-color: var(--warning-border);
  background: var(--amber-soft);
  color: var(--wp-warning-ink);
}

.staffing-cover-row--covered .staffing-severity,
.staffing-cover-row--healthy .staffing-severity,
.staffing-cover-row--ok .staffing-severity {
  border-color: var(--wp-success-border);
  background: var(--wp-success-soft);
  color: var(--wp-success-ink);
}

/* Functional coverage groups sit directly beneath department cover. They use
   the same calm operational grammar without turning a safe capacity summary
   into a second HR or absence roster. */
.staffing-coverage-groups-list,
.staffing-coverage-group-rows,
.staffing-coverage-detail,
.staffing-coverage-history,
.staffing-coverage-history-rows {
  display: grid;
  gap: 10px;
}

.staffing-coverage-groups-list > .notice { margin: 0; }

.staffing-coverage-group-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 15px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--wp-info-border);
  border-radius: var(--radius);
  background: linear-gradient(145deg, var(--surface-raised), var(--surface-muted));
}

.staffing-coverage-group-row--covered { border-left-color: var(--wp-success); }
.staffing-coverage-group-row--at-risk { border-color: var(--warning-border); border-left-color: var(--wp-warning); background: linear-gradient(145deg, var(--surface-raised), var(--amber-soft)); }
.staffing-coverage-group-row--critical { border-color: var(--danger-border); border-left-color: var(--danger); background: linear-gradient(145deg, var(--surface-raised), var(--red-soft)); }
.staffing-coverage-group-row--unknown,
.staffing-coverage-group-row--not-scheduled { border-left-color: var(--line-strong); background: var(--surface-muted); }

.staffing-coverage-group-main {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.staffing-coverage-group-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.staffing-coverage-group-heading strong {
  color: var(--ink);
  font-size: max(var(--wp-min-text, 0px), calc(14px * var(--wp-text-scale, 1)));
  letter-spacing: -0.01em;
}

.staffing-coverage-group-department,
.staffing-coverage-group-purpose,
.staffing-coverage-group-count,
.staffing-coverage-group-window,
.staffing-coverage-group-partial {
  overflow-wrap: anywhere;
  color: var(--ink-soft);
  font-size: max(var(--wp-min-text, 0px), calc(12px * var(--wp-text-scale, 1)));
  line-height: 1.42;
}

.staffing-coverage-group-department { color: var(--brand-dark); font-weight: 710; }
.staffing-coverage-group-count { color: var(--ink); font-weight: 670; }
.staffing-coverage-group-partial { color: var(--wp-info); }

.staffing-coverage-group-actions {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
}

.staffing-coverage-detail-dialog,
.staffing-coverage-group-dialog,
.staffing-coverage-history-dialog {
  width: min(100%, 920px);
}

.staffing-coverage-detail-summary {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--wp-info-border);
  border-radius: var(--radius-sm);
  background: var(--surface-muted);
}

.staffing-coverage-detail-summary > div { display: grid; min-width: 0; gap: 3px; }
.staffing-coverage-detail-summary strong { color: var(--ink); font-size: max(var(--wp-min-text, 0px), calc(13px * var(--wp-text-scale, 1))); }
.staffing-coverage-detail-summary span { color: var(--ink-soft); font-size: max(var(--wp-min-text, 0px), calc(12px * var(--wp-text-scale, 1))); line-height: 1.4; }
.staffing-coverage-detail-summary.is-covered { border-left-color: var(--wp-success); background: var(--wp-success-soft); }
.staffing-coverage-detail-summary.is-at_risk { border-color: var(--warning-border); border-left-color: var(--wp-warning); background: var(--amber-soft); }
.staffing-coverage-detail-summary.is-critical { border-color: var(--danger-border); border-left-color: var(--danger); background: var(--red-soft); }

.staffing-coverage-detail-counts {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.staffing-coverage-detail-counts > span {
  display: inline-flex;
  min-height: 25px;
  align-items: center;
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--ink-soft);
  font-size: max(var(--wp-min-text, 0px), calc(11px * var(--wp-text-scale, 1)));
  font-weight: 680;
}

.staffing-coverage-member-rows { display: grid; gap: 7px; }

.staffing-coverage-member-row {
  display: grid;
  grid-template-columns: minmax(150px, .9fr) minmax(180px, 1.15fr) minmax(130px, .65fr);
  align-items: center;
  gap: 12px;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-raised);
}

.staffing-coverage-member-row strong { min-width: 0; overflow-wrap: anywhere; color: var(--ink); font-size: max(var(--wp-min-text, 0px), calc(13px * var(--wp-text-scale, 1))); }
.staffing-coverage-member-row span { min-width: 0; overflow-wrap: anywhere; color: var(--ink-soft); font-size: max(var(--wp-min-text, 0px), calc(12px * var(--wp-text-scale, 1))); line-height: 1.35; }
.staffing-coverage-member-row--unavailable { border-left: 3px solid var(--danger); }
.staffing-coverage-member-row--partial-available { border-left: 3px solid var(--wp-warning); }
.staffing-coverage-member-row--scheduled-available { border-left: 3px solid var(--wp-success); }
.staffing-coverage-member-row--unknown { border-left: 3px solid var(--wp-info); }

.staffing-coverage-group-people-picker { gap: 10px; }
.staffing-coverage-group-people-outlet { display: grid; gap: 9px; }

.staffing-coverage-person-choice {
  display: grid;
  gap: 9px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-raised);
}

.staffing-coverage-person-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 5px 12px;
}

.staffing-coverage-person-heading strong { color: var(--ink); font-size: max(var(--wp-min-text, 0px), calc(13px * var(--wp-text-scale, 1))); }
.staffing-coverage-person-heading span { color: var(--ink-soft); font-size: max(var(--wp-min-text, 0px), calc(11px * var(--wp-text-scale, 1))); font-weight: 680; }
.staffing-coverage-person-controls { display: flex; flex-wrap: wrap; gap: 7px 12px; }
.staffing-coverage-person-controls .check-field { min-height: 28px; }

.staffing-coverage-member-fields {
  display: grid;
  grid-template-columns: minmax(120px, .65fr) minmax(150px, 1fr) minmax(150px, 1fr);
  gap: 9px;
  padding-top: 9px;
  border-top: 1px solid var(--line);
}

.staffing-coverage-member-fields[hidden] { display: none; }
.staffing-coverage-member-fields .field { margin: 0; }
.staffing-coverage-member-fields .field label { font-size: max(var(--wp-min-text, 0px), calc(11px * var(--wp-text-scale, 1))); }

.staffing-coverage-history-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-muted);
}

.staffing-coverage-history-row > div { display: grid; min-width: 0; gap: 3px; }
.staffing-coverage-history-row strong { color: var(--ink); font-size: max(var(--wp-min-text, 0px), calc(13px * var(--wp-text-scale, 1))); }
.staffing-coverage-history-row span { overflow-wrap: anywhere; color: var(--ink-soft); font-size: max(var(--wp-min-text, 0px), calc(12px * var(--wp-text-scale, 1))); line-height: 1.4; }

@media (max-width: 640px) {
  .holiday-request-row,
  .staffing-cover-row,
  .staffing-rule-row,
  .staffing-coverage-group-row,
  .staffing-coverage-history-row {
    display: grid;
    gap: 10px;
  }

  .holiday-request-actions { justify-content: flex-start; }

  .holiday-time-range {
    grid-column: auto;
    grid-template-columns: minmax(0, 1fr);
  }

  .staffing-tabs {
    width: 100%;
    overflow-x: auto;
  }

  .staffing-tab { flex: 1 0 auto; }

  .staffing-coverage-group-actions { justify-content: flex-start; }
  .staffing-coverage-detail-summary { display: grid; }
  .staffing-coverage-member-row,
  .staffing-coverage-member-fields { grid-template-columns: minmax(0, 1fr); }
}

/* A bank holiday is a property of the whole operating day, not a second card
   competing with the day's work. The date carries the one compact label while
   the full cell uses the established read-only holiday colour. */
.day-cell.is-bank-holiday-day,
.feed-week-day.is-bank-holiday-day,
.feed-day.is-bank-holiday-day {
  border-color: var(--wp-holiday-border);
  background: var(--wp-holiday-soft);
  box-shadow: inset 0 3px 0 var(--wp-holiday);
}

.day-cell.is-bank-holiday-day:hover,
.feed-week-day.is-bank-holiday-day:hover,
.feed-day.is-bank-holiday-day:hover { background: #eee9f5; }

/* Keep the user-visible selection ring without replacing the semantic holiday
   treatment underneath it. */
.day-cell.is-bank-holiday-day.is-day-briefing-selected,
.feed-week-day.is-bank-holiday-day.is-day-briefing-selected,
.feed-day.is-bank-holiday-day.is-day-briefing-selected {
  background: var(--wp-holiday-soft);
  box-shadow: inset 0 0 0 2px var(--brand), inset 0 3px 0 var(--wp-holiday);
}

.calendar-date-heading {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  gap: 4px;
}

.calendar-bank-holiday-label {
  min-width: 0;
  color: var(--wp-holiday-ink);
  font-size: max(var(--wp-min-text, 0px), calc(10px * var(--wp-text-scale, 1)));
  font-weight: 720;
  line-height: 1.25;
}

.day-cell .calendar-date-heading {
  max-width: 100%;
  flex-wrap: wrap;
}

.feed-week-day > header.is-bank-holiday-heading {
  align-items: flex-start;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  min-height: 60px;
}

.feed-day-heading.is-bank-holiday-heading { align-items: flex-start; flex-wrap: wrap; }

@media (max-width: 640px) {
  .calendar-bank-holiday-label { font-size: max(var(--wp-min-text, 0px), calc(9px * var(--wp-text-scale, 1))); }
  .feed-week-day > header.is-bank-holiday-heading { min-height: 56px; }
}

/* Calendar day cards are scan surfaces. Keep the coloured type cue and exact
   overflow count, but remove the repeated card chrome and multi-line task
   metadata that made one operating day read like a wall of text. The full
   context remains in the accessible button label, tooltip and event details. */
.calendar-page .day-events,
.calendar-page .feed-week-events,
.calendar-page .feed-day-events { gap: 3px; }

.calendar-page .feed-week-events { padding: 7px; }
.calendar-page .feed-day-events { padding: 10px 12px; }

.calendar-page .event {
  min-height: 26px;
  padding: 4px 6px;
  border-width: 0 0 0 3px;
  border-radius: 4px;
  box-shadow: none;
}

.calendar-page .event--compact {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 6px;
  width: 100%;
  text-align: left;
  white-space: nowrap !important;
}

.calendar-page .event--compact.event--task-block::before { content: none; }

.calendar-page .event--compact .calendar-event-title {
  display: block;
  overflow: hidden;
  font-size: inherit;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-page .event--compact .calendar-event-title::before { content: none; }

.calendar-page .calendar-event-compact-indicator {
  flex: 0 0 auto;
  color: currentColor;
  font-size: max(var(--wp-min-text, 0px), calc(9px * var(--wp-text-scale, 1)));
  font-weight: 710;
  line-height: 1;
  opacity: 0.72;
  white-space: nowrap;
}

/* Focused work, not dashboard chrome. Keep these rules together so the
   default capture/list surface and its optional controls share one rhythm. */
.dashboard-page { gap: 14px; }
.dashboard-page .page-header .eyebrow { display: none; }
.dashboard-page .page-description { margin-top: 5px; }
/* Summary-card composition is owned by workspace-ui.css. */
.dashboard-all-clear {
  margin: 0;
  padding: 11px 13px;
  border: 1px solid var(--wp-success-border);
  border-radius: var(--radius-sm);
  background: var(--green-soft);
  color: var(--wp-success-ink);
  font-size: max(var(--wp-min-text, 0px), calc(13px * var(--wp-text-scale, 1)));
  line-height: 1.45;
}
.dashboard-page .dashboard-quick-add { align-items: center; flex-wrap: nowrap; padding: 9px 12px; }
.dashboard-page .dashboard-quick-add .daily-new-task { flex-basis: auto; }
.dashboard-page .dashboard-quick-add > .daily-save-state { flex: 0 0 auto; margin: 0; }
.dashboard-task-filter-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; min-width: 0; }
.dashboard-task-filter-toolbar .button { min-height: 38px; }
.dashboard-task-sort { display: flex; align-items: center; gap: 7px; margin-left: auto; }
.dashboard-task-sort label { margin: 0; font-size: max(var(--wp-min-text, 0px), calc(11px * var(--wp-text-scale, 1))); }
.dashboard-task-sort .select { width: 148px; min-height: 38px; }
.dashboard-task-filter-drawer { display: grid; gap: 10px; padding-top: 4px; }
.dashboard-task-filter-drawer[hidden] { display: none; }
.dashboard-task-filter-scope { margin: 0; font-size: max(var(--wp-min-text, 0px), calc(11px * var(--wp-text-scale, 1))); color: var(--ink-soft); }
.dashboard-page .dashboard-collaboration-summary { padding: 10px 12px; box-shadow: none; }

/* The calendar's minimum-width week belongs to its own scroll viewport.
   Never constrain the whole page, or clip the independently positioned
   exact-date staff roster with overflow:hidden on the Team Calendar. */
.calendar-page,
.calendar-page > *,
.calendar-page .calendar,
.calendar-page .feed-week-wrap,
.calendar-page .calendar-toolbar { min-width: 0; max-width: 100%; }
.calendar-page .calendar,
.calendar-page .feed-week-wrap { width: 100%; }
.calendar-page .feed-week-wrap { overflow-x: auto; overscroll-behavior-x: contain; }
.calendar-page .calendar-toolbar { flex-wrap: wrap; }
.calendar-page .calendar-toolbar h2 { flex: 1 1 210px; min-width: 0; overflow-wrap: anywhere; }
.calendar-page .calendar-toolbar-actions { flex-wrap: wrap; min-width: 0; max-width: 100%; }
.calendar-page .team-calendar-toolbar-control-area { flex: 1 1 470px; max-width: 100%; }
.calendar-page .calendar-toolbar-actions .button { white-space: nowrap; }

@media (max-width: 640px) {
  .dashboard-page { gap: 12px; }
  .dashboard-page .dashboard-quick-add { flex-wrap: wrap; }
  .dashboard-page .dashboard-quick-add > .daily-save-state { font-size: max(var(--wp-min-text, 0px), calc(10px * var(--wp-text-scale, 1))); }
  .dashboard-task-filter-toolbar { gap: 6px; }
  .dashboard-task-filter-toolbar .button { min-height: 44px; }
  .dashboard-task-sort { flex: 1 1 100%; margin-left: 0; }
  .dashboard-task-sort .select { width: auto; flex: 1; min-height: 44px; }
  .calendar-page .calendar-toolbar { gap: 10px; }
  .calendar-page .calendar-toolbar h2 { flex-basis: 100%; order: -1; }
  .calendar-page .calendar-toolbar-actions { overflow: visible; padding-top: 0; }
  .calendar-page .calendar-toolbar-actions .button:not(.button-icon) { min-height: 44px; padding: 8px 10px; font-size: max(var(--wp-min-text, 0px), calc(11px * var(--wp-text-scale, 1))); }
  .calendar-page .team-calendar-toolbar-control-area { flex-basis: 100%; width: 100%; }
  .calendar-page .team-calendar-toolbar-control-area .calendar-toolbar-actions { justify-content: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
}

/* Expenses & VAT is a narrow, factual ledger surface. Keep its table in its
   own horizontal viewport at compact widths so amounts and column headings
   never collapse into one another or force the application shell wider. */
.expenses-page { min-width: 0; }
.expenses-ledger-notice {
  display: grid;
  gap: 3px;
  margin: 0;
  border-color: rgb(45 112 84 / 24%);
  background: #f2f8f5;
  color: #285943;
}
.expenses-ledger-notice strong { color: #174631; }
.expenses-ledger-notice span { color: #426753; font-size: max(var(--wp-min-text, 0px), calc(12px * var(--wp-text-scale, 1))); line-height: 1.45; }
.expenses-metric-grid { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.expenses-ledger-card-body { display: grid; gap: 12px; }
.expenses-card-intro,
.expenses-evidence-note,
.expenses-entry-reference { margin: 0; color: var(--ink-soft); font-size: max(var(--wp-min-text, 0px), calc(12px * var(--wp-text-scale, 1))); line-height: 1.45; }
.expenses-filter-bar {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-muted);
}
.expenses-filter-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr)) auto auto;
  align-items: end;
  gap: 10px;
}
.expenses-filter-form .field { min-width: 0; }
.expenses-filter-form .check-field { min-height: 38px; align-self: end; }
.expenses-filter-actions,
.expenses-pagination-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
}
.expenses-filter-actions { padding-bottom: 1px; }
.expenses-filter-error { grid-column: 1 / -1; margin: 0; }
.expenses-filter-error[hidden] { display: none; }
.expenses-filter-summary {
  margin: 0;
  color: var(--ink-soft);
  font-size: max(var(--wp-min-text, 0px), calc(12px * var(--wp-text-scale, 1)));
  line-height: 1.4;
}
.expenses-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 2px;
}
.expenses-pagination-status {
  color: var(--ink-soft);
  font-size: max(var(--wp-min-text, 0px), calc(12px * var(--wp-text-scale, 1)));
  font-variant-numeric: tabular-nums;
}
.expenses-table-wrap { max-width: 100%; overscroll-behavior-x: contain; }
.expenses-table { min-width: 920px; }
.expenses-supplier { display: block; color: var(--ink); font-weight: 700; }
.expenses-description { display: block; max-width: 290px; margin-top: 3px; overflow: hidden; color: var(--ink-soft); font-size: max(var(--wp-min-text, 0px), calc(11px * var(--wp-text-scale, 1))); line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.expenses-evidence {
  display: inline-flex;
  align-items: center;
  max-width: 172px;
  min-height: 24px;
  padding: 3px 7px;
  border: 1px solid rgb(49 95 76 / 16%);
  border-radius: 999px;
  background: #f2f8f5;
  color: #35634d;
  font-size: max(var(--wp-min-text, 0px), calc(10px * var(--wp-text-scale, 1)));
  font-weight: 690;
  line-height: 1.2;
}
.expenses-actions-cell { min-width: 205px; }
.expenses-entry-actions { display: flex; flex-wrap: wrap; gap: 5px; }
.expenses-entry-actions .button { min-height: 30px; padding: 5px 8px; }
.expenses-organisation-section { display: grid; min-width: 0; gap: 14px; }
.expenses-section-heading { margin: 0; padding: 13px 15px; border-radius: var(--radius-sm); }
.expenses-section-heading h2 { margin: 0; }
.expenses-section-heading .muted { margin: 4px 0 0; }
.expenses-dialog .modal-body { overflow-x: hidden; }
.expenses-form-notice { margin: 0; }
.expenses-form-error[hidden] { display: none; }
.expenses-form .field-hint { margin: 0; }
.expenses-void-form > p:first-child { margin: 0; color: var(--ink); line-height: 1.45; }
.expenses-entry-detail { display: grid; gap: 16px; }
.expenses-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin: 0;
}
.expenses-detail-grid > div {
  min-width: 0;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-muted);
}
.expenses-detail-grid dt {
  margin: 0 0 4px;
  color: var(--ink-faint);
  font-size: max(var(--wp-min-text, 0px), calc(10px * var(--wp-text-scale, 1)));
  font-weight: 720;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.expenses-detail-grid dd { margin: 0; overflow-wrap: anywhere; color: var(--ink); font-size: max(var(--wp-min-text, 0px), calc(13px * var(--wp-text-scale, 1))); font-weight: 650; }
.expenses-detail-copy { display: grid; gap: 5px; }
.expenses-detail-copy h3 { margin: 0; color: var(--ink); font-size: max(var(--wp-min-text, 0px), calc(13px * var(--wp-text-scale, 1))); }
.expenses-detail-copy p { margin: 0; color: var(--ink-soft); font-size: max(var(--wp-min-text, 0px), calc(13px * var(--wp-text-scale, 1))); line-height: 1.5; white-space: pre-wrap; }
.expenses-history-list { display: grid; gap: 7px; margin: 0; padding: 0; list-style: none; }
.expenses-history-list li { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-muted); }
.expenses-history-list strong { color: var(--ink); font-size: max(var(--wp-min-text, 0px), calc(12px * var(--wp-text-scale, 1))); }
.expenses-history-list span { flex: 0 0 auto; color: var(--ink-faint); font-size: max(var(--wp-min-text, 0px), calc(11px * var(--wp-text-scale, 1))); }

@media (max-width: 980px) {
  .expenses-filter-form { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .expenses-filter-form .check-field { grid-column: 1 / span 2; }
  .expenses-filter-actions { grid-column: 3; }
}

@media (max-width: 640px) {
  .expenses-page .page-header { gap: 12px; }
  .expenses-page .page-actions { width: 100%; justify-content: flex-start; }
  .expenses-page .page-actions .button { flex: 1 1 auto; }
  .expenses-table { min-width: 860px; }
  .expenses-actions-cell { min-width: 186px; }
  .expenses-filter-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .expenses-filter-form .check-field,
  .expenses-filter-actions,
  .expenses-filter-error { grid-column: 1 / -1; }
  .expenses-pagination { align-items: flex-start; flex-direction: column; }
  .expenses-detail-grid { grid-template-columns: 1fr; }
  .expenses-history-list li { align-items: flex-start; flex-direction: column; gap: 3px; }
}

@media (max-width: 430px) {
  .expenses-filter-form { grid-template-columns: 1fr; }
  .expenses-filter-form .check-field,
  .expenses-filter-actions,
  .expenses-filter-error { grid-column: auto; }
}

/* Preserve the supplied lockup. The original artwork includes intentionally
   charcoal symbol detail; a clipped, soft-warm keyline makes that detail
   readable on the dark sidebar without turning the white/red wordmark into a
   luminous outlined sticker or putting a plate behind it. */
.brand-lockup { position: relative; }
.brand-lockup-art {
  position: relative;
  display: block;
  flex: 0 1 auto;
  width: min(100%, 182px);
}
.brand-lockup-image { filter: none; }
.brand-lockup .brand-lockup-image {
  display: block;
  width: min(100%, 182px);
  height: auto;
  max-height: 38px;
  filter: none;
}
.brand-lockup .brand-symbol-keyline {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  clip-path: inset(0 77% 0 0);
  pointer-events: none;
  object-fit: contain;
  object-position: left center;
}
.brand-symbol-keyline,
.brand-mark-image {
  filter:
    drop-shadow(.6px 0 0 #ded9d2)
    drop-shadow(-.6px 0 0 #ded9d2)
    drop-shadow(0 .6px 0 #ded9d2)
    drop-shadow(0 -.6px 0 #ded9d2);
}

@media (max-width: 820px) {
  .brand-lockup-art { width: 132px; }
}

@media (prefers-contrast: more) {
  .brand-symbol-keyline,
  .brand-mark-image {
    filter:
      drop-shadow(1px 0 0 #fff)
      drop-shadow(-1px 0 0 #fff)
      drop-shadow(0 1px 0 #fff)
      drop-shadow(0 -1px 0 #fff);
  }
}

@media (max-width: 640px) { .brand-lockup-art { display: none; } }

/* Invoice Intelligence keeps document intake, extraction progress, and the
   resulting review values distinct. The quiet card treatment makes the next
   safe action obvious without implying that an invoice has already posted. */
.invoice-intelligence-page { min-width: 0; }
.invoice-intelligence-notice { margin: 0; }
.invoice-intelligence-notice > div { display: grid; gap: 3px; }
.invoice-intelligence-notice p { margin: 0; line-height: 1.45; }
.invoice-intelligence-upload { display: grid; gap: 13px; }
.invoice-intelligence-picker {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 13px;
  padding: 15px;
  border: 1px dashed #bdcbd5;
  border-radius: var(--radius-sm);
  background: #f8fafb;
}
.invoice-intelligence-picker-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid #d5e1e8;
  border-radius: 11px;
  background: var(--surface);
  color: var(--brand);
  font-size: max(var(--wp-min-text, 0px), calc(20px * var(--wp-text-scale, 1)));
  font-weight: 760;
}
.invoice-intelligence-picker-copy { min-width: 0; }
.invoice-intelligence-picker-copy strong { display: block; color: var(--ink); font-size: max(var(--wp-min-text, 0px), calc(13px * var(--wp-text-scale, 1))); }
.invoice-intelligence-picker-copy p,
.invoice-intelligence-upload-note { margin: 4px 0 0; color: var(--ink-soft); font-size: max(var(--wp-min-text, 0px), calc(12px * var(--wp-text-scale, 1))); line-height: 1.45; }
.invoice-intelligence-picker-actions,
.invoice-intelligence-upload-actions,
.invoice-intelligence-item-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.invoice-intelligence-picker-actions { justify-content: flex-end; }
.invoice-intelligence-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.invoice-intelligence-selected {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 5px 8px;
  padding: 10px 11px;
  border: 1px solid #c8dcd1;
  border-radius: var(--radius-sm);
  background: #f4faf6;
}
.invoice-intelligence-selected strong { min-width: 0; overflow-wrap: anywhere; color: #254d3b; font-size: max(var(--wp-min-text, 0px), calc(12px * var(--wp-text-scale, 1))); }
.invoice-intelligence-selected span { color: #527563; font-size: max(var(--wp-min-text, 0px), calc(11px * var(--wp-text-scale, 1))); }
.invoice-intelligence-upload-status {
  margin: 0;
  color: #356183;
  font-size: max(var(--wp-min-text, 0px), calc(12px * var(--wp-text-scale, 1)));
  font-weight: 650;
}
.invoice-intelligence-upload-error[hidden],
.invoice-intelligence-form-error[hidden] { display: none; }
.invoice-intelligence-upload-note { margin: 0; }
.invoice-intelligence-list {
  display: grid;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
.invoice-intelligence-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  padding: 12px 13px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.invoice-intelligence-item:last-child { border-bottom: 0; }
.invoice-intelligence-item-copy { min-width: 0; }
.invoice-intelligence-item-copy strong,
.invoice-intelligence-item-copy p {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.invoice-intelligence-item-copy strong { color: var(--ink); font-size: max(var(--wp-min-text, 0px), calc(12px * var(--wp-text-scale, 1))); }
.invoice-intelligence-item-copy p { margin: 3px 0 0; color: var(--ink-soft); font-size: max(var(--wp-min-text, 0px), calc(11px * var(--wp-text-scale, 1))); }
.invoice-intelligence-item-actions { justify-content: flex-end; }
.invoice-intelligence-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 25px;
  padding: 3px 8px;
  border: 1px solid #d5dde3;
  border-radius: 999px;
  background: #f6f8fa;
  color: #556574;
  font-size: max(var(--wp-min-text, 0px), calc(10px * var(--wp-text-scale, 1)));
  font-weight: 720;
  line-height: 1.2;
  text-align: center;
  white-space: nowrap;
}
.invoice-intelligence-status--info { border-color: #c9ddec; background: #f0f6fc; color: #3b6387; }
.invoice-intelligence-status--review { border-color: #e3d3b3; background: #fff8e9; color: #87560d; }
.invoice-intelligence-status--danger { border-color: #edc2c5; background: #fff4f4; color: #9c3e46; }
.invoice-intelligence-status--success { border-color: #bde1ca; background: #f0faf4; color: #276c49; }
.invoice-intelligence-review { display: grid; gap: 15px; }
.invoice-intelligence-review-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}
.invoice-intelligence-review-facts > div {
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-muted);
}
.invoice-intelligence-review-facts dt {
  margin: 0 0 4px;
  color: var(--ink-faint);
  font-size: max(var(--wp-min-text, 0px), calc(10px * var(--wp-text-scale, 1)));
  font-weight: 720;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.invoice-intelligence-review-facts dd { margin: 0; overflow-wrap: anywhere; color: var(--ink); font-size: max(var(--wp-min-text, 0px), calc(12px * var(--wp-text-scale, 1))); font-weight: 650; }
.invoice-intelligence-reviewed-values {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}
.invoice-intelligence-reviewed-values > div {
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-muted);
}
.invoice-intelligence-reviewed-values dt {
  margin: 0 0 4px;
  color: var(--ink-faint);
  font-size: max(var(--wp-min-text, 0px), calc(10px * var(--wp-text-scale, 1)));
  font-weight: 720;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.invoice-intelligence-reviewed-values dd { margin: 0; overflow-wrap: anywhere; color: var(--ink); font-size: max(var(--wp-min-text, 0px), calc(12px * var(--wp-text-scale, 1))); font-weight: 650; }
.invoice-intelligence-processing {
  display: grid;
  gap: 5px;
  padding: 13px;
  border-left: 3px solid #78a5c8;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: #f0f6fc;
}
.invoice-intelligence-processing strong { color: #315f82; font-size: max(var(--wp-min-text, 0px), calc(13px * var(--wp-text-scale, 1))); }
.invoice-intelligence-processing p { margin: 0; color: #486e8a; font-size: max(var(--wp-min-text, 0px), calc(12px * var(--wp-text-scale, 1))); line-height: 1.45; }
.invoice-intelligence-failure > div { display: grid; gap: 3px; }
.invoice-intelligence-failure p { margin: 0; line-height: 1.45; }
.invoice-intelligence-warnings {
  display: grid;
  gap: 7px;
  padding: 12px 13px;
  border: 1px solid #efd5a8;
  border-radius: var(--radius-sm);
  background: #fff8e9;
  color: #87560d;
}
.invoice-intelligence-warnings strong { font-size: max(var(--wp-min-text, 0px), calc(12px * var(--wp-text-scale, 1))); }
.invoice-intelligence-warnings ul { display: grid; gap: 4px; margin: 0; padding-left: 18px; }
.invoice-intelligence-warnings li { font-size: max(var(--wp-min-text, 0px), calc(12px * var(--wp-text-scale, 1))); line-height: 1.4; }
.invoice-intelligence-review-form { margin: 0; }
.invoice-intelligence-review-notice { margin: 0; }
.invoice-intelligence-unavailable-action { margin: 0; }

@media (max-width: 640px) {
  .invoice-intelligence-page .page-actions { width: 100%; justify-content: flex-start; }
  .invoice-intelligence-page .page-actions .button { flex: 1 1 auto; }
  .invoice-intelligence-picker { grid-template-columns: auto minmax(0, 1fr); }
  .invoice-intelligence-picker-actions { grid-column: 1 / -1; justify-content: flex-start; }
  .invoice-intelligence-picker-actions .button { flex: 1 1 auto; }
  .invoice-intelligence-item { grid-template-columns: minmax(0, 1fr) auto; }
  .invoice-intelligence-item-actions { grid-column: 1 / -1; justify-content: flex-start; }
  .invoice-intelligence-review-facts { grid-template-columns: 1fr; }
  .invoice-intelligence-reviewed-values { grid-template-columns: 1fr; }
}

/* Safe, text-first department treatment shared by People and the published
   structure. A swatch is supplementary; a server-supplied exact name remains
   the accessible identifier. */
.workforce-department-label {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  gap: 5px;
}
.workforce-department-label > span:last-child { min-width: 0; overflow-wrap: anywhere; }
.workforce-department-swatch {
  display: inline-block;
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--team-calendar-department-colour, var(--line-strong));
  box-shadow: inset 0 0 0 1px rgb(19 31 45 / 9%);
}

/* Published Company structure. The ranked board uses the available desktop
   width and height: card rows form clear branches, and orthogonal connector
   paths make each manager-to-report route traceable. */
.company-structure-page { gap: 16px; }

.company-structure-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 15px 17px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--brand);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.company-structure-summary > div:first-child { display: grid; min-width: 0; gap: 3px; }
.company-structure-summary-label {
  color: var(--brand-dark);
  font-size: max(var(--wp-min-text, 0px), calc(10px * var(--wp-text-scale, 1)));
  font-weight: 790;
  letter-spacing: .09em;
  text-transform: uppercase;
}
.company-structure-summary strong { color: var(--ink); font-size: max(var(--wp-min-text, 0px), calc(16px * var(--wp-text-scale, 1))); letter-spacing: -.015em; }
.company-structure-summary p { margin: 0; color: var(--ink-soft); font-size: max(var(--wp-min-text, 0px), calc(12px * var(--wp-text-scale, 1))); line-height: 1.4; }

.company-structure-counts {
  display: flex;
  flex: 0 0 auto;
  align-items: stretch;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-muted);
}
.company-structure-counts > span {
  display: grid;
  min-width: 78px;
  gap: 1px;
  padding: 8px 11px;
  text-align: center;
}
.company-structure-counts > span + span { border-left: 1px solid var(--line); }
.company-structure-counts strong { color: var(--ink); font-size: max(var(--wp-min-text, 0px), calc(17px * var(--wp-text-scale, 1))); font-variant-numeric: tabular-nums; }
.company-structure-counts small { color: var(--ink-soft); font-size: max(var(--wp-min-text, 0px), calc(10px * var(--wp-text-scale, 1))); font-weight: 680; }

/* Exploration controls stay outside the canvas so search and filtering never
   compete with panning. They operate only on the already-published snapshot. */
.company-structure-explorer {
  display: grid;
  grid-template-columns: minmax(210px, .76fr) minmax(0, 1.55fr);
  gap: 12px 18px;
  align-items: end;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface-raised) 82%, var(--surface));
  box-shadow: var(--shadow-sm);
}
.company-structure-explorer-copy { display: grid; gap: 3px; min-width: 0; }
.company-structure-explorer-copy strong { color: var(--ink); font-size: max(var(--wp-min-text, 0px), calc(13px * var(--wp-text-scale, 1))); }
.company-structure-explorer-copy p,
.company-structure-search-empty { margin: 0; color: var(--ink-soft); font-size: max(var(--wp-min-text, 0px), calc(11px * var(--wp-text-scale, 1))); line-height: 1.42; }
.company-structure-explorer-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}
.company-structure-explorer-field { display: grid; min-width: min(100%, 184px); gap: 4px; color: var(--ink-soft); font-size: max(var(--wp-min-text, 0px), calc(10px * var(--wp-text-scale, 1))); font-weight: 760; }
.company-structure-search-input { min-width: min(100%, 238px); }
.company-structure-department-filter { min-width: min(100%, 174px); }
.company-structure-search-results {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding-top: 2px;
}
.company-structure-search-result {
  max-width: min(100%, 290px);
  min-height: 30px;
  padding: 7px 11px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: max(var(--wp-min-text, 0px), calc(11px * var(--wp-text-scale, 1)));
  font-weight: 680;
  line-height: 1.2;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}
.company-structure-search-result:hover { border-color: color-mix(in srgb, var(--brand) 54%, var(--line-strong)); color: var(--brand-dark); }
.company-structure-search-result:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 45%, transparent); outline-offset: 2px; }
.company-structure-search-empty { grid-column: 1 / -1; }

.company-structure-viewport {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.company-structure-viewport:focus-visible,
.company-structure-viewport:focus-within {
  outline: 3px solid color-mix(in srgb, var(--brand) 45%, transparent);
  outline-offset: 3px;
}
.company-structure-tree-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 15px 17px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-raised);
}
.company-structure-tree-header h2 { margin: 0; color: var(--ink); font-size: max(var(--wp-min-text, 0px), calc(15px * var(--wp-text-scale, 1))); letter-spacing: -.015em; }
.company-structure-tree-header p { margin: 4px 0 0; color: var(--ink-soft); font-size: max(var(--wp-min-text, 0px), calc(12px * var(--wp-text-scale, 1))); line-height: 1.4; }
.company-structure-tree-header .company-structure-legend {
  max-width: 240px;
  margin: 0;
  color: var(--ink-faint);
  font-size: max(var(--wp-min-text, 0px), calc(11px * var(--wp-text-scale, 1)));
  text-align: right;
}

.company-structure-chart-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  padding: 11px 17px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface-raised) 78%, var(--surface));
}
.company-structure-chart-controls {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  gap: 7px;
}
.company-structure-chart-controls .button { min-height: 31px; }
.company-structure-export { position: relative; }
.company-structure-export > summary { list-style: none; cursor: pointer; }
.company-structure-export > summary::-webkit-details-marker { display: none; }
.company-structure-export > summary::after { content: ' ▾'; margin-left: 5px; }
.company-structure-export-menu {
  position: absolute; z-index: 20; top: calc(100% + 6px); right: 0;
  display: grid; gap: 4px; min-width: 195px; padding: 8px;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface-raised); box-shadow: 0 8px 24px #0002;
}
.company-structure-export-menu .button { justify-content: flex-start; white-space: nowrap; }
.company-structure-export-status { max-width: 280px; margin: 6px 0 0; font-size: max(var(--wp-min-text, 0px), calc(12px * var(--wp-text-scale, 1))); line-height: 1.5; }
.company-structure-export > summary:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
.company-structure-chart-controls .button:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--brand) 45%, transparent);
  outline-offset: 2px;
}
.company-structure-chart-help,
.company-structure-zoom-status {
  margin: 0;
  color: var(--ink-soft);
  font-size: max(var(--wp-min-text, 0px), calc(11px * var(--wp-text-scale, 1)));
  line-height: 1.4;
}
.company-structure-chart-help { flex: 1 1 260px; }
.company-structure-zoom-status {
  flex: 1 1 280px;
  max-width: 390px;
  color: var(--ink-faint);
  text-align: right;
}

.company-structure-chart-scroll {
  max-width: 100%;
  height: clamp(720px, calc(100dvh - 160px), 1080px);
  min-height: 720px;
  max-height: 1080px;
  overflow-x: auto;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable both-edges;
  -webkit-overflow-scrolling: touch;
  background:
    linear-gradient(var(--surface), var(--surface)) padding-box,
    linear-gradient(90deg, color-mix(in srgb, var(--line) 70%, transparent), transparent 22%, transparent 78%, color-mix(in srgb, var(--line) 70%, transparent)) border-box;
}
.company-structure-chart-scroll:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--brand) 45%, transparent);
  outline-offset: -3px;
}
.company-structure-chart-viewport {
  position: relative;
  min-width: 100%;
  min-height: 100%;
  cursor: grab;
  touch-action: pan-x pan-y pinch-zoom;
}
.company-structure-chart-viewport.is-panning {
  cursor: grabbing;
  user-select: none;
}
.company-structure-chart-viewport.is-panning * { user-select: none; }
.company-structure-chart-canvas {
  position: relative;
  transform-origin: top left;
  will-change: transform;
}
.company-structure-chart-viewport.is-chart-ready .company-structure-chart-canvas {
  position: absolute;
  top: 0;
}
.company-structure-chart-viewport.is-chart-ready {
  /* CSS transforms can otherwise retain the unscaled canvas in the parent
     scroll range. Clipping to the explicit scaled stage keeps pan and fit
     geometry truthful, so centring never lands in empty space. */
  overflow: hidden;
}

.company-structure-tree,
.company-structure-rank {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* The semantic source-order ranks become a measured, branch-aware board on
   desktop. Shorter branches finish naturally; only a dense terminal team
   continues into local rows below its actual manager. */
.company-structure-tree {
  position: relative;
  display: grid;
  align-content: start;
  box-sizing: border-box;
  width: max(100%, 2520px);
  min-width: 2520px;
  min-height: clamp(760px, calc(100dvh - 160px), 1040px);
  row-gap: 40px;
  column-gap: 0;
  padding: 42px 44px clamp(132px, 14dvh, 168px);
}
.company-structure-chart--two-dimensional { isolation: isolate; }
.company-structure-connector-layer {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: visible;
  pointer-events: none;
}
.company-structure-connector-path {
  fill: none;
  stroke: color-mix(in srgb, var(--brand-dark) 38%, var(--line-strong));
  stroke-width: 1.5;
  opacity: .78;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}
.company-structure-connector--branch-trunk { opacity: .7; }
.company-structure-connector--branch-bus { opacity: .58; }
.company-structure-connector--branch-drop { opacity: .66; }
.company-structure-rank {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(var(--company-structure-rank-size), minmax(0, 1fr));
  align-items: start;
  gap: 16px;
  min-width: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}
.company-structure-rank.is-company-structure-branch-positioned {
  /* Rank wrappers keep the accessible source order. On desktop they share a
     zero-height origin while each card receives a branch-specific position. */
  position: absolute;
  z-index: 1;
  display: block;
  height: 0;
}
.company-structure-rank-node {
  display: grid;
  min-width: 0;
  justify-items: center;
}
.company-structure-rank--level-1 .company-structure-card { width: 240px; }

.company-structure-card {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: start;
  box-sizing: border-box;
  width: 240px;
  min-width: 240px;
  min-height: 108px;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: 0 3px 8px rgb(19 31 45 / 5%);
}
.company-structure-card--person { border-top: 3px solid var(--brand); }
.company-structure-card--vacancy {
  border: 1px dashed #aa8b55;
  border-top: 3px dashed #aa8b55;
  background: #fffaf0;
}
.company-structure-card--context { background: color-mix(in srgb, var(--surface-muted) 54%, var(--surface)); opacity: .82; }
.company-structure-card--match {
  border-color: color-mix(in srgb, var(--brand) 68%, var(--line-strong));
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand) 15%, transparent), 0 4px 12px rgb(19 31 45 / 8%);
}
.company-structure-card--focused,
.company-structure-selected {
  outline: 3px solid color-mix(in srgb, var(--brand) 44%, transparent);
  outline-offset: 3px;
}
.company-structure-avatar {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid rgb(23 23 23 / 12%);
  border-radius: 50%;
  background: var(--brand-dark);
  color: #fff;
  font-size: max(var(--wp-min-text, 0px), calc(11px * var(--wp-text-scale, 1)));
  font-weight: 790;
  letter-spacing: .02em;
}
.company-structure-avatar--vacancy {
  border-color: #c7ad7c;
  background: #f7ead0;
  color: #72572b;
  font-size: max(var(--wp-min-text, 0px), calc(19px * var(--wp-text-scale, 1)));
  font-weight: 500;
}
.company-structure-card-copy { display: grid; min-width: 0; align-content: start; gap: 3px; }
.company-structure-card h3 { margin: 0; overflow-wrap: anywhere; color: var(--ink); font-size: max(var(--wp-min-text, 0px), calc(12px * var(--wp-text-scale, 1))); line-height: 1.22; }
.company-structure-title,
.company-structure-department { margin: 0; overflow-wrap: anywhere; line-height: 1.35; }
.company-structure-title { color: var(--ink-soft); font-size: max(var(--wp-min-text, 0px), calc(10px * var(--wp-text-scale, 1))); }
/* The general People label intentionally ellipsises in a compact directory
   card. A published reporting card has a different job: department context
   must remain complete, so let its text use a second line instead of clipping
   a truthful department name such as Customer Services. */
.company-structure-department {
  display: flex;
  width: 100%;
  align-items: flex-start;
  color: var(--ink-faint);
  font-size: max(var(--wp-min-text, 0px), calc(9px * var(--wp-text-scale, 1)));
  font-weight: 720;
}
.company-structure-department > .workforce-department-swatch { margin-top: .35em; }
.company-structure-department > span:last-child {
  min-width: 0;
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  overflow-wrap: anywhere;
}
.company-structure-reports-to {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 3px 5px;
  margin: 4px 0 0;
  padding-top: 5px;
  border-top: 1px solid color-mix(in srgb, var(--line-strong) 82%, transparent);
  color: var(--ink-soft);
  font-size: max(var(--wp-min-text, 0px), calc(9px * var(--wp-text-scale, 1)));
  line-height: 1.3;
}
.company-structure-reports-to-label { color: var(--ink-faint); font-weight: 720; }
.company-structure-reports-to-name { color: var(--ink); font-weight: 760; }
.company-structure-vacancy-label {
  grid-column: 2;
  justify-self: start;
  align-self: start;
  padding: 3px 5px;
  border: 1px solid #d8c294;
  border-radius: 999px;
  color: #72572b;
  font-size: max(var(--wp-min-text, 0px), calc(9px * var(--wp-text-scale, 1)));
  font-weight: 780;
  line-height: 1.15;
  white-space: nowrap;
}

@media (max-width: 980px) {
  .company-structure-summary { align-items: flex-start; flex-direction: column; }
  .company-structure-counts { align-self: stretch; width: 100%; }
  .company-structure-counts > span { flex: 1 1 0; }
  .company-structure-explorer { grid-template-columns: 1fr; }
  .company-structure-explorer-controls { justify-content: flex-start; }
  .company-structure-chart-scroll { min-height: 560px; max-height: 820px; }
  .company-structure-tree { padding-inline: 28px; }
}

@media (max-width: 760px) {
  .company-structure-chart-toolbar { align-items: flex-start; flex-direction: column; }
  .company-structure-zoom-status { max-width: none; text-align: left; }
  .company-structure-explorer { padding: 13px; }
  .company-structure-explorer-controls { align-items: stretch; width: 100%; }
  .company-structure-explorer-field,
  .company-structure-search-input,
  .company-structure-department-filter { width: 100%; min-width: 0; }
  .company-structure-explorer-controls .button { flex: 1 1 auto; }
  .company-structure-chart-scroll {
    height: auto;
    min-height: 0;
    max-height: none;
    overflow-x: visible;
    overflow-y: visible;
    scrollbar-gutter: auto;
  }
  .company-structure-chart-viewport {
    cursor: auto;
    touch-action: pan-y;
  }
  .company-structure-chart-viewport.is-panning { cursor: auto; }
  .company-structure-chart-canvas,
  .company-structure-chart-viewport.is-chart-ready .company-structure-chart-canvas {
    position: relative;
    transform: none !important;
  }
  .company-structure-tree {
    display: block;
    width: 100%;
    min-width: 0;
    padding: 20px 16px 26px;
  }
  .company-structure-connector-layer { display: none; }
  .company-structure-rank {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
    min-width: 0;
    gap: 10px;
  }
  .company-structure-rank + .company-structure-rank {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--line);
  }
  .company-structure-card,
  .company-structure-rank--level-1 .company-structure-card { width: 100%; min-width: 0; }
  .company-structure-reports-to { padding-top: 5px; }
}

@media (max-width: 640px) {
  .company-structure-summary,
  .company-structure-tree-header { padding: 13px; }
  .company-structure-tree-header { align-items: flex-start; flex-direction: column; }
  .company-structure-tree-header .company-structure-legend { max-width: none; text-align: left; }
  .company-structure-tree { padding: 16px 12px 22px; }
  .company-structure-card { grid-template-columns: 36px minmax(0, 1fr); min-height: 0; padding: 11px; }
  .company-structure-avatar { width: 36px; height: 36px; }
  .company-structure-vacancy-label { grid-column: 2; justify-self: start; }
  .company-structure-reports-to { font-size: max(var(--wp-min-text, 0px), calc(9px * var(--wp-text-scale, 1))); }
}

/* Runway: a deliberately calm, print-like absence board. The UI keeps the
   hierarchy spatial rather than forcing managers to scan a dense data table.
   It is a workspace surface, not a narrow reading column: wide displays use
   the available room while the board remains centred on ultra-wide screens. */
.runway-page {
  width: min(100%, 1920px);
  max-width: none;
  margin-inline: auto;
  gap: clamp(24px, 2vw, 36px);
}
.runway-board {
  display: grid;
  gap: clamp(18px, 1.6vw, 28px);
  padding-bottom: clamp(32px, 4vw, 64px);
}
.runway-filter-bar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: clamp(16px, 2vw, 28px);
  padding: clamp(16px, 1.8vw, 22px) clamp(18px, 2vw, 28px);
  border: 1px solid color-mix(in srgb, var(--brand) 16%, var(--line));
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--brand) 4%, var(--surface));
}
.runway-filter-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}
.runway-filter-copy strong {
  color: var(--ink);
  font-size: max(var(--wp-min-text, 0px), calc(14px * var(--wp-text-scale, 1)));
}
.runway-filter-copy span {
  color: var(--ink-soft);
  font-size: max(var(--wp-min-text, 0px), calc(12px * var(--wp-text-scale, 1)));
  line-height: 1.45;
}
.runway-filter-bar .field {
  flex: 0 1 290px;
  min-width: min(100%, 220px);
  margin: 0;
}
.runway-day {
  overflow: clip;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: 0 5px 16px rgb(18 31 43 / 4%);
}
.runway-day-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(16px, 2vw, 26px);
  padding: clamp(17px, 1.8vw, 24px) clamp(20px, 2.2vw, 32px);
  border-bottom: 1px solid color-mix(in srgb, var(--brand) 18%, var(--line));
  background: color-mix(in srgb, var(--brand) 7%, var(--surface));
}
.runway-day h2 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(18px, 1.6vw, 22px);
  line-height: 1.25;
}
.runway-day-count {
  flex: 0 0 auto;
  color: var(--brand-dark);
  font-size: max(var(--wp-min-text, 0px), calc(12px * var(--wp-text-scale, 1)));
  font-weight: 760;
  white-space: nowrap;
}
.runway-departments {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 330px), 1fr));
  gap: clamp(14px, 1.4vw, 22px);
  padding: clamp(18px, 2vw, 28px) clamp(20px, 2.2vw, 32px) clamp(20px, 2.2vw, 32px);
}
.runway-department {
  min-width: 0;
  padding: 17px 18px 18px;
  border: 1px solid color-mix(in srgb, var(--line) 85%, var(--brand) 15%);
  border-top: 3px solid color-mix(in srgb, var(--brand) 72%, var(--line));
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--surface) 96%, var(--brand) 4%);
}
.runway-department h3,
.runway-subgroup h4 {
  margin: 0;
  overflow-wrap: anywhere;
}
.runway-department h3 {
  color: var(--ink);
  font-size: max(var(--wp-min-text, 0px), calc(15px * var(--wp-text-scale, 1)));
  line-height: 1.3;
}
.runway-subgroup {
  margin-top: 16px;
  padding: 14px 0 0 16px;
  border-top: 1px solid var(--line);
  border-left: 2px solid color-mix(in srgb, var(--brand) 38%, var(--line));
}
.runway-subgroup h4 {
  color: var(--ink-soft);
  font-size: max(var(--wp-min-text, 0px), calc(12px * var(--wp-text-scale, 1)));
  font-weight: 780;
  letter-spacing: .01em;
}
.runway-people {
  display: grid;
  gap: 8px;
  margin: 13px 0 0;
  padding: 0;
  list-style: none;
}
.runway-person {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: var(--ink);
  font-size: max(var(--wp-min-text, 0px), calc(14px * var(--wp-text-scale, 1)));
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.runway-person-avatar {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  border-radius: 50%;
  color: var(--brand-dark);
  background: color-mix(in srgb, var(--brand) 11%, var(--surface));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--brand) 22%, var(--line));
  font-size: max(var(--wp-min-text, 0px), calc(9px * var(--wp-text-scale, 1)));
  font-weight: 800;
  letter-spacing: .02em;
}
.runway-person-name {
  min-width: 0;
  overflow-wrap: anywhere;
}
.runway-person-status {
  margin-left: auto;
  padding: 2px 7px;
  border: 1px solid color-mix(in srgb, var(--brand) 28%, var(--line));
  border-radius: 999px;
  color: var(--brand-dark);
  background: color-mix(in srgb, var(--brand) 6%, var(--surface));
  font-size: max(var(--wp-min-text, 0px), calc(10px * var(--wp-text-scale, 1)));
  font-weight: 760;
  white-space: nowrap;
}
.runway-date-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 14px 18px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
.runway-date-toolbar .field { margin: 0; }
.runway-date-toolbar strong { font-size: max(var(--wp-min-text, 0px), calc(13px * var(--wp-text-scale, 1))); margin-left: auto; }
.staffing-editor-stage { padding: 14px; border: 1px solid var(--line); border-radius: 8px; }
.staffing-editor-stage summary { font-weight: 750; cursor: pointer; margin-bottom: 12px; }
.staffing-editor-stage .form-grid { align-items: start; }
.staffing-editor-stage input:not([type="checkbox"]) { height: 42px; min-height: 42px; flex: 0 0 auto; }
.staffing-editor-stage textarea { min-height: 70px; height: 70px; }
.staffing-coverage-group-dialog { display: flex; flex-direction: column; max-height: calc(100dvh - 40px); overflow: hidden; }
.staffing-coverage-group-dialog .modal-body { min-height: 0; overflow-y: auto; }
.staffing-coverage-group-dialog .modal-header,
.staffing-coverage-group-dialog .modal-footer { flex-shrink: 0; }
.staffing-planning-days { display: grid; grid-template-columns: repeat(auto-fit, minmax(145px, 1fr)); gap: 8px; }
.staffing-planning-day { white-space: normal; min-height: 55px; }
.staffing-planning-day.is-critical { border-color: #b61b3b; background: #fcebf0; }
.staffing-planning-day.is-at_risk { border-color: #b98126; background: #fff5df; }
.staffing-planning-day.is-unknown { border-style: dashed; background: var(--surface-soft); }
.runway-person-status[data-tooltip] { position: relative; cursor: help; }
.runway-person-status[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  right: 0;
  bottom: calc(100% + 8px);
  width: min(280px, 65vw);
  padding: 10px 12px;
  border-radius: 8px;
  background: #20272e;
  color: #f5f3ef;
  white-space: normal;
  line-height: 1.5;
  box-shadow: 0 4px 14px #0002;
  z-index: 20;
  visibility: hidden;
  pointer-events: none;
}
.runway-person-status[data-tooltip]:hover::after,
.runway-person-status[data-tooltip]:focus-visible::after { visibility: visible; }
.runway-person-status--partial {
  border-color: color-mix(in srgb, #a46900 38%, var(--line));
  color: #76540c;
  background: #fff8e9;
}
.runway-clear {
  margin: 0;
  padding: 17px 20px 19px;
  color: var(--ink-soft);
  font-size: max(var(--wp-min-text, 0px), calc(13px * var(--wp-text-scale, 1)));
}

@media (max-width: 680px) {
  .runway-page { gap: 20px; }
  .runway-filter-bar { align-items: stretch; flex-direction: column; padding: 14px 15px; }
  .runway-filter-bar .field { width: 100%; min-width: 0; }
  .runway-day-heading { align-items: flex-start; flex-direction: column; padding: 14px 15px; }
  .runway-day-count { white-space: normal; }
  .runway-departments { grid-template-columns: minmax(0, 1fr); gap: 10px; padding: 14px 15px 16px; }
  .runway-department { padding: 13px; }
  .runway-person-status { margin-left: 0; }
  .runway-person { align-items: flex-start; flex-wrap: wrap; }
}

/* Annual leave: quiet operational totals, with HR configuration kept in dialogs. */
.leave-page { width: min(100%, 1440px); margin-inline: auto; }
.leave-summary { padding: 22px 24px; background: var(--surface, #fff); border: 1px solid #dedbd6; border-radius: 14px; }
.leave-heading, .leave-footnote, .leave-employee, .leave-admin-actions, .leave-year-control { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.leave-heading h2 { font-size: max(var(--wp-min-text, 0px), calc(18px * var(--wp-text-scale, 1))); margin: 0 0 4px; }
.leave-heading p, .leave-footnote, .leave-employee p { margin: 0; font-size: max(var(--wp-min-text, 0px), calc(12px * var(--wp-text-scale, 1))); color: #62645f; }
.leave-metrics { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; margin: 24px 0; }
.leave-metric { display: flex; flex-direction: column; gap: 6px; padding-left: 16px; border-left: 2px solid #e6dedf; }
.leave-metric:first-child { border-left-color: #ad1734; }
.leave-metric span { color: #575954; font-size: max(var(--wp-min-text, 0px), calc(12px * var(--wp-text-scale, 1))); }
.leave-metric strong { font-size: clamp(16px, 1.5vw, 23px); line-height: 1.3; overflow-wrap: anywhere; }
.leave-metrics--compact { margin: 18px 0; }
.leave-footnote { border-top: 1px solid #e8e5e0; padding-top: 12px; }
.leave-warning { background: #fcf4e3; color: #6b4812; padding: 10px 12px; border-radius: 7px; font-size: max(var(--wp-min-text, 0px), calc(13px * var(--wp-text-scale, 1))); line-height: 1.5; }
.leave-preview { background: #f6f5f2; border: 1px solid #e0dcd5; border-radius: 10px; padding: 16px; }
.leave-preview h3 { font-size: max(var(--wp-min-text, 0px), calc(15px * var(--wp-text-scale, 1))); margin: 0 0 12px; }
.leave-preview-year + .leave-preview-year { margin-top: 16px; padding-top: 12px; border-top: 1px solid #ddd8d1; }
.leave-preview-values { display: grid; grid-template-columns: repeat(auto-fit, minmax(145px, 1fr)); gap: 12px 18px; margin: 12px 0; }
.leave-preview-values dt { font-size: max(var(--wp-min-text, 0px), calc(12px * var(--wp-text-scale, 1))); color: #5a5d58; }
.leave-preview-values dd { margin: 4px 0 0; font-weight: 650; overflow-wrap: anywhere; }
.leave-preview .muted, .leave-form .muted, .leave-detail p { font-size: max(var(--wp-min-text, 0px), calc(13px * var(--wp-text-scale, 1))); line-height: 1.6; }
.leave-roster { border: 1px solid #e4e0da; border-radius: 10px; overflow: hidden; }
.leave-employee { padding: 16px 18px; background: var(--surface); }
.leave-employee + .leave-employee { border-top: 1px solid #ece8e3; }
.leave-employee h3 { margin: 0 0 4px; font-size: max(var(--wp-min-text, 0px), calc(14px * var(--wp-text-scale, 1))); }
.leave-employee-totals { display: flex; gap: 14px; flex-wrap: wrap; font-size: max(var(--wp-min-text, 0px), calc(13px * var(--wp-text-scale, 1))); }
.leave-admin-actions { justify-content: flex-start; }
.leave-admin-panel { padding: 20px; }
.leave-admin-panel > p { margin: 0; line-height: 1.6; }
.leave-year-control { justify-content: flex-start; align-items: flex-end; }
.leave-year-control .field { max-width: 140px; }
.modal-dialog.leave-dialog { width: min(960px, calc(100vw - 32px)); max-width: 960px; }
.leave-detail, .leave-detail .stack { gap: 12px; }
.leave-detail p, .leave-detail h3 { margin: 0; line-height: 1.55; }
.leave-detail .leave-metrics { margin: 6px 0; }
.leave-detail > section { padding-top: 10px; }

/* People and access: reporting is visible without opening a second page. */
.people-admin-page { width: 100%; max-width: 1440px; margin-inline: auto; }
.people-admin-overview { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.people-admin-stat { display: grid; gap: 3px; padding: 16px 18px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.people-admin-stat strong { color: var(--brand); font-size: clamp(22px, 2vw, 29px); line-height: 1.1; }
.people-admin-stat span { color: var(--ink-soft); font-size: max(var(--wp-min-text, 0px), calc(12px * var(--wp-text-scale, 1))); font-weight: 650; }
.people-admin-directory { display: grid; gap: 14px; min-width: 0; }
.people-admin-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.people-admin-toolbar .input { flex: 1 1 300px; min-width: 190px; }
.people-admin-toolbar .select { flex: 0 1 250px; min-width: 190px; }
.people-admin-result-count { margin: 0 2px 0 auto; color: var(--ink-soft); font-size: max(var(--wp-min-text, 0px), calc(12px * var(--wp-text-scale, 1))); }
.people-admin-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: stretch; }
.people-admin-list > .empty-state { grid-column: 1 / -1; }
.people-admin-card { display: flex; flex-direction: column; gap: 14px; min-width: 0;
  padding: 17px 18px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); box-shadow: var(--shadow-sm); }
.people-admin-card-head { display: flex; align-items: flex-start; gap: 11px; min-width: 0; }
.people-admin-avatar { display: grid; place-items: center; flex: 0 0 40px; width: 40px; height: 40px;
  border-radius: 50%; background: var(--brand-soft); color: var(--brand-dark); font-size: max(var(--wp-min-text, 0px), calc(13px * var(--wp-text-scale, 1))); font-weight: 750; }
.people-admin-identity { display: grid; gap: 3px; min-width: 0; flex: 1 1 auto; }
.people-admin-identity strong { color: var(--ink); font-size: max(var(--wp-min-text, 0px), calc(15px * var(--wp-text-scale, 1))); line-height: 1.3; overflow-wrap: anywhere; }
.people-admin-identity > span { color: var(--ink-soft); font-size: max(var(--wp-min-text, 0px), calc(12px * var(--wp-text-scale, 1))); line-height: 1.4; overflow-wrap: anywhere; }
.people-admin-badges { display: flex; justify-content: flex-end; align-content: flex-start; flex-wrap: wrap; gap: 5px; max-width: 170px; }
.people-admin-badge { display: inline-flex; align-items: center; min-height: 23px; padding: 3px 7px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--surface-raised);
  color: var(--ink-soft); font-size: max(var(--wp-min-text, 0px), calc(10px * var(--wp-text-scale, 1))); font-weight: 700; white-space: nowrap; }
.people-admin-badge.is-active { border-color: var(--wp-success-border); background: var(--wp-success-soft); color: var(--wp-success-ink); }
.people-admin-badge.is-login-active { border-color: var(--wp-info-border); background: var(--wp-info-soft); color: var(--wp-info); }
.people-admin-details { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px 14px; margin: 0; }
.people-admin-details > div { min-width: 0; }
.people-admin-details dt { margin-bottom: 3px; color: var(--ink-faint); font-size: max(var(--wp-min-text, 0px), calc(10px * var(--wp-text-scale, 1))); font-weight: 700;
  letter-spacing: .05em; text-transform: uppercase; }
.people-admin-details dd { margin: 0; color: var(--ink); font-size: max(var(--wp-min-text, 0px), calc(12px * var(--wp-text-scale, 1))); line-height: 1.4; overflow-wrap: anywhere; }
.people-admin-team { padding: 9px 11px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface-raised); }
.people-admin-team summary { color: var(--brand); font-size: max(var(--wp-min-text, 0px), calc(12px * var(--wp-text-scale, 1))); font-weight: 700; cursor: pointer; }
.people-admin-team summary:focus-visible { outline: 2px solid var(--wp-focus); outline-offset: 3px; }
.people-admin-team ul { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px 12px;
  margin: 9px 0 0; padding-left: 18px; color: var(--ink-soft); font-size: max(var(--wp-min-text, 0px), calc(11px * var(--wp-text-scale, 1))); line-height: 1.4; }
.people-admin-team li { overflow-wrap: anywhere; }
.people-admin-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  margin-top: auto; padding-top: 11px; border-top: 1px solid var(--line); }
.people-admin-account-detail { min-width: 0; color: var(--ink-soft); font-size: max(var(--wp-min-text, 0px), calc(11px * var(--wp-text-scale, 1))); overflow-wrap: anywhere; }
.people-admin-card-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-left: auto; }
.people-admin-position-summary { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 13px 15px; border: 1px solid var(--wp-info-border); border-radius: var(--radius-sm); background: var(--wp-info-soft); }
.people-admin-position-summary-text { display: grid; gap: 4px; min-width: 0; }
.people-admin-position-summary-text strong { font-size: max(var(--wp-min-text, 0px), calc(13px * var(--wp-text-scale, 1))); }
.people-admin-position-summary-text span { color: var(--ink-soft); font-size: max(var(--wp-min-text, 0px), calc(12px * var(--wp-text-scale, 1))); line-height: 1.45; }
.people-admin-access-form [hidden] { display: none !important; }

/* Administrator-only workforce editor; chart geometry is unchanged. */
.company-structure-admin { display: grid; gap: 12px; min-width: min(640px, 100%); }
.company-structure-admin-list { display: grid; gap: 6px; max-height: min(52dvh, 510px); overflow: auto; }
.company-structure-admin-row { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface, #fff); }
.company-structure-admin-row > div { display: grid; gap: 2px; min-width: 0; }
.company-structure-admin-row strong { font-size: max(var(--wp-min-text, 0px), calc(13px * var(--wp-text-scale, 1))); }
.company-structure-admin-row span, .company-structure-admin-row small { color: var(--ink-soft); font-size: max(var(--wp-min-text, 0px), calc(11px * var(--wp-text-scale, 1))); overflow-wrap: anywhere; }
.modal-dialog.company-structure-editor-dialog { width: min(860px, calc(100vw - 32px)); max-width: 860px; }
.company-structure-person-form { display: grid; gap: 16px; min-width: 0; }
.company-structure-form-intro { margin: 0; color: var(--ink-soft); font-size: max(var(--wp-min-text, 0px), calc(13px * var(--wp-text-scale, 1))); line-height: 1.5; }
.company-structure-form-section { min-width: 0; margin: 0; padding: 15px; border: 1px solid var(--line);
  border-radius: var(--radius-sm); background: var(--surface-raised); }
.company-structure-form-section legend { padding: 0 6px; color: var(--ink); font-size: max(var(--wp-min-text, 0px), calc(13px * var(--wp-text-scale, 1))); font-weight: 750; }
.company-structure-form-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.company-structure-form-fields > * { min-width: 0; }
.company-structure-form-fields > [hidden] { display: none !important; }
.company-structure-form-section .form-help { margin: 10px 0 0; }
.company-structure-position-preview { margin: 0; line-height: 1.5; }
.company-structure-account-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.company-structure-form-fields > .company-structure-account-fields { grid-column: 1 / -1; }
.company-structure-account-fields > [hidden] { display: none !important; }
@media (max-width: 1100px) {
  .people-admin-list { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 650px) {
  .people-admin-overview { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .people-admin-overview > :last-child { grid-column: 1 / -1; }
  .people-admin-result-count { margin-left: 2px; width: 100%; }
  .people-admin-card { padding: 14px; }
  .people-admin-card-head { flex-wrap: wrap; }
  .people-admin-badges { justify-content: flex-start; max-width: none; width: 100%; padding-left: 51px; }
  .people-admin-details { grid-template-columns: minmax(0, 1fr); }
  .people-admin-team ul { grid-template-columns: minmax(0, 1fr); }
  .people-admin-card-foot, .people-admin-position-summary { align-items: flex-start; flex-direction: column; }
  .people-admin-card-actions { margin-left: 0; }
  .company-structure-admin-row { align-items: flex-start; }
  .company-structure-form-fields, .company-structure-account-fields { grid-template-columns: minmax(0, 1fr); }
  .company-structure-form-fields > .company-structure-account-fields { grid-column: auto; }
}
.leave-dialog .modal-body { overflow-x: hidden; }
.leave-form { min-width: 0; }
.leave-form .check-field { grid-column: 1 / -1; align-items: flex-start; }
.leave-segment { min-width: 0; padding: 16px; border: 1px solid #dcd8d1; border-radius: 9px; }
.leave-segment legend { padding-inline: 6px; font-weight: 650; }
.leave-week-pattern { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.leave-table-wrap { max-width: 100%; overflow-x: auto; }
.leave-table { width: 100%; border-collapse: collapse; font-size: max(var(--wp-min-text, 0px), calc(13px * var(--wp-text-scale, 1))); text-align: left; }
.leave-table th { background: #f4f2ee; font-weight: 650; }
.leave-table th, .leave-table td { padding: 10px 12px; border-bottom: 1px solid #e3dfd9; }
.leave-policy-version { border: 1px solid #e2ddd6; padding: 14px; border-radius: 8px; }
.leave-policy-version summary { font-weight: 650; cursor: pointer; }
/* October refinement: bounded reading pages, focused collaboration and HR
   work areas. Calendars and the organogram retain their full canvas widths. */
.content.content--reading { width: min(100%, 1700px); }
.page-navigation-status { position: absolute; z-index: 20; bottom: -34px; right: 20px; padding: 7px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-raised); color: var(--ink-soft); font-size: max(var(--wp-min-text, 0px), calc(12px * var(--wp-text-scale, 1))); box-shadow: var(--shadow-sm); }
.page-header > .page-actions { max-width: 58%; min-width: 0; }
.hr-workspace, .hr-insights { width: 100%; max-width: 1480px; justify-self: center; }
.hr-workspace-scope { margin: -8px 0 0; color: var(--ink-soft); font-size: max(var(--wp-min-text, 0px), calc(12px * var(--wp-text-scale, 1))); line-height: 1.5; }
.hr-workspace-tools { position: relative; }
.hr-workspace-tools > summary { cursor: pointer; list-style: none; }
.hr-workspace-tools > summary::-webkit-details-marker { display: none; }
.hr-workspace-tools-menu { position: absolute; right: 0; top: calc(100% + 8px); z-index: 25; display: grid; gap: 6px; width: 250px; max-width: calc(100vw - 32px); padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-raised); box-shadow: var(--shadow-lg); }
.hr-workspace-tools-menu .button { justify-content: flex-start; white-space: normal; text-align: left; }
.hr-workspace-tabs { display: flex; flex-wrap: wrap; gap: 5px; padding: 6px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-muted); }
.hr-workspace-tab { min-height: 40px; padding-inline: 18px; border-color: transparent; }
.hr-workspace-tab[aria-selected="true"] { color: var(--brand-dark); border-color: var(--wp-brand-border); background: var(--surface-raised); box-shadow: var(--shadow-sm); }
.hr-workspace-area, .hr-review-area { min-width: 0; }
.hr-review-area .hr-metric-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.hr-workspace-list { display: grid; gap: 16px; padding: 16px 18px; }
.hr-list-filters { display: flex; flex-wrap: wrap; gap: 10px; }
.hr-list-filters .input { flex: 1 1 240px; max-width: 420px; }
.hr-list-filters .select { flex: 0 1 240px; }
.hr-workspace-disclosure-content .hr-workspace-list { padding: 0; }
.hr-workspace-list .hr-action-row { padding: 15px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-raised); }
.hr-workspace-list .hr-action-row-copy strong { font-size: max(var(--wp-min-text, 0px), calc(14px * var(--wp-text-scale, 1))); }
.hr-resolution-hint { max-width: 32ch; margin: 0; color: var(--ink-soft); font-size: max(var(--wp-min-text, 0px), calc(12px * var(--wp-text-scale, 1))); line-height: 1.5; }
.hr-list-pagination { display: flex; justify-content: flex-end; align-items: center; flex-wrap: wrap; gap: 8px; padding-top: 4px; }
.hr-list-pagination > span { margin-right: auto; }
.hr-workspace-disclosure { border: 1px solid var(--line); border-radius: 10px; background: var(--surface-raised); }
.hr-workspace-disclosure summary { min-height: 60px; padding: 15px 18px; }
.hr-workspace-disclosures { padding: 16px; gap: 10px; }
.hr-workspace .metric-card { min-height: 116px; padding: 18px; }
.hr-workspace .metric-value { font-size: max(var(--wp-min-text, 0px), calc(30px * var(--wp-text-scale, 1))); }
.hr-insight-context { display: flex; flex-wrap: wrap; padding: 14px 18px; background: var(--surface-muted); border: 1px solid var(--line); border-radius: 10px; line-height: 1.5; }
.hr-insight-groups { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; align-items: start; }
.hr-insight-group h2 { margin: 0 0 12px; font-size: max(var(--wp-min-text, 0px), calc(16px * var(--wp-text-scale, 1))); }
.hr-insight-metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.hr-insight-metrics .metric-card { min-height: 122px; padding: 16px; }
.hr-insight-metrics .metric-label { min-height: 34px; font-size: max(var(--wp-min-text, 0px), calc(12px * var(--wp-text-scale, 1))); line-height: 1.4; }
.hr-insight-next-step { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 18px; padding: 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-raised); }
.hr-insight-next-step p { margin: 5px 0 0; color: var(--ink-soft); font-size: max(var(--wp-min-text, 0px), calc(13px * var(--wp-text-scale, 1))); }
.chat-page { max-width: none; gap: 14px; }
.chat-page > .page-header .page-description { max-width: 65ch; }
.chat-layout { box-shadow: var(--wp-shadow-surface); }
.chat-conversation-row { justify-content: flex-start; min-height: 74px; padding: 12px; gap: 12px; }
.chat-conversation-row-main { flex: 1; }
.chat-person-avatar, .chat-message-avatar { display: inline-grid; place-items: center; flex: 0 0 auto; width: 38px; height: 38px; border-radius: 50%; background: #e9e5df; color: #504940; font-size: max(var(--wp-min-text, 0px), calc(12px * var(--wp-text-scale, 1))); font-weight: 760; }
.chat-conversation-row.is-selected .chat-person-avatar { background: var(--brand); color: #fff; }
.chat-message-avatar { width: 26px; height: 26px; font-size: max(var(--wp-min-text, 0px), calc(10px * var(--wp-text-scale, 1))); }
.chat-message-list { gap: 8px; padding: 20px 24px; background: #fbfaf8; }
.chat-message { margin-top: 8px; padding: 12px 15px; border-radius: 14px; background: var(--surface-raised); max-width: min(680px, 92%); }
.chat-message.is-own { justify-self: end; background: #f8edf0; border-color: #ecd6dc; }
.chat-message-header { align-items: center; font-size: max(var(--wp-min-text, 0px), calc(11px * var(--wp-text-scale, 1))); gap: 7px; }
.chat-thread:has(> .chat-message.is-own) { justify-items: end; }
.chat-composer { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 14px; padding: 12px 18px; }
.chat-composer > .chat-reply-banner, .chat-composer > .field, .chat-composer > .chat-rich-media-draft-queue, .chat-composer > .chat-attachment-composer, .chat-composer > .chat-composer-footer { grid-column: 1 / -1; }
.chat-composer > .field > label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.chat-composer .textarea { min-height: 66px; max-height: 140px; padding: 12px 14px; border-radius: 10px; resize: vertical; }
.chat-composer .textarea { height: 66px; }
.chat-composer-footer { gap: 10px; flex-direction: row; align-items: center; }
.chat-composer-status:empty { display: none; }
.chat-composer-footer .field-help { margin-right: auto; }
.chat-composer .chat-attachment-toolbar > .field-help { margin-left: auto; font-size: max(var(--wp-min-text, 0px), calc(11px * var(--wp-text-scale, 1))); }
.chat-picker-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 0 10px; }
.chat-picker-header strong { font-size: max(var(--wp-min-text, 0px), calc(14px * var(--wp-text-scale, 1))); }
.chat-media-picker-preview { min-height: 0; }
.chat-media-choice { position: relative; overflow: hidden; min-height: 88px; }
.chat-media-choice:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.chat-media-categories { flex-wrap: nowrap; overflow-x: auto; padding-block: 2px 5px; }
.chat-media-category { flex: 0 0 auto; }
.chat-media-provider-heading { display: none; }
.chat-emoji-grid { grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); gap: 5px; }
.chat-rich-media { width: min(320px, 100%); }
.chat-rich-media-viewport { border: 0; background: #f0eeeb; border-radius: 10px; }
.chat-rich-media figcaption { max-width: 40ch; }
.chat-conversation-loading { align-content: center; gap: 8px; color: var(--ink-soft); text-align: center; }
.chat-conversation-loading p { margin: 0; font-size: max(var(--wp-min-text, 0px), calc(13px * var(--wp-text-scale, 1))); }

/* Message rows span the conversation; only individual bubbles have a reading
   measure. The composer stays in the same track while tools overlay history. */
.chat-message-list > .chat-thread { width: 100%; justify-self: stretch; }
.chat-message-list { --chat-edge: clamp(14px, 1.4vw, 24px); padding-inline: var(--chat-edge); }
.chat-thread { gap: 8px; }
.chat-message { margin-top: 6px; }
.chat-composer { flex: 0 0 auto; }
.chat-composer-media-panel { display: flex; flex-direction: column; overflow: hidden; }
.chat-composer-media-panel[hidden] { display: none; }
.chat-composer-media-panel > .chat-picker-header { flex: 0 0 auto; }
.chat-picker-header .button { min-height: 28px; padding: 5px 9px; font-size: max(var(--wp-min-text, 0px), calc(12px * var(--wp-text-scale, 1))); }
.chat-composer-media-panel .chat-media-search { min-height: 36px; height: 36px; padding: 7px 10px; }
.chat-composer-media-panel .chat-media-category, .chat-composer-media-panel .chat-media-provider-tab { min-height: 28px; padding: 5px 8px; font-size: max(var(--wp-min-text, 0px), calc(11px * var(--wp-text-scale, 1))); }
.chat-composer-media-panel .chat-media-categories { scrollbar-width: thin; }
.chat-detail-actions .chat-mobile-back { display: none; }
.chat-media-picker { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.chat-media-picker > .chat-media-search,
.chat-media-picker > .chat-media-categories,
.chat-media-picker > .chat-media-external-tools { flex: 0 0 auto; }
.chat-media-external-tools > .chat-media-picker-status { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.chat-picker-scroll { min-height: 0; max-height: 320px; flex: 1 1 auto; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; overflow-anchor: none; scrollbar-gutter: stable; padding: 3px 4px 4px 2px; }
.chat-picker-scroll:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
.chat-picker-scroll .chat-media-provider-results { outline: none; }
.chat-picker-sentinel { display: block; height: 1px; }
.chat-picker-sentinel[hidden], .chat-media-provider-section[hidden],
.chat-media-provider-section > button[hidden] { display: none; }
.chat-local-media-content { display: grid; gap: 9px; }
.chat-local-media-disclosure { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 10px; }
.chat-local-media-disclosure summary { cursor: pointer; color: var(--ink-soft); font-size: max(var(--wp-min-text, 0px), calc(12px * var(--wp-text-scale, 1))); font-weight: 650; }
.chat-local-media-disclosure[open] summary { margin-bottom: 10px; }
.chat-media-provider-footer { align-items: flex-start; padding-block: 4px; }
.chat-emoji-picker .chat-picker-scroll > .chat-media-picker-status { padding-block: 8px 4px; }
.modal-body > .chat-emoji-picker { max-height: min(480px, 60dvh); }
.chat-composer > .chat-mention-details { position: static; }
.chat-composer > .chat-mention-details > .chat-composer-disclosure-content { position: absolute; z-index: 11; bottom: calc(100% + 8px); left: 12px; width: min(440px, calc(100% - 24px)); max-height: min(300px, var(--chat-disclosure-available, 40dvh)); overflow: auto; padding: 14px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface-raised); box-shadow: var(--shadow-lg); }
@media (max-width: 820px) {
  .app-shell:has(.content--chat-workspace) { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); height: 100dvh; min-height: 0; overflow: hidden; }
  .app-shell:has(.content--chat-workspace) > .sidebar { min-width: 0; }
  .app-main:has(.content--chat-workspace) { display: grid; grid-template-rows: auto minmax(0, 1fr); height: 100%; min-width: 0; min-height: 0; overflow: hidden; }
  .content--chat-workspace { height: 100%; min-height: 0; overflow: hidden; padding: 14px 16px 16px; }
  .chat-page { height: 100%; grid-template-rows: auto auto minmax(0, 1fr); gap: 10px; }
  .chat-page > .page-header .eyebrow, .chat-page > .page-header .page-description { display: none; }
  .chat-layout { block-size: 100%; }
  .chat-detail-header { flex-direction: row; align-items: center; gap: 8px; }
  .chat-detail-actions { gap: 4px; }
  .chat-detail-actions .chat-mobile-back { display: inline-flex; }
  .chat-detail-header h2 { font-size: max(var(--wp-min-text, 0px), calc(16px * var(--wp-text-scale, 1))); }
  .chat-composer { padding: 10px 12px; }
  .chat-composer-footer { align-items: center; flex-direction: row; }
}
@media (max-height: 700px) {
  .content.content--chat-workspace { padding-block: 12px; }
  .chat-page { gap: 8px; }
  .chat-page > .page-header .eyebrow, .chat-page > .page-header .page-description { display: none; }
  .chat-page .chat-detail-header .eyebrow { display: none; }
  .chat-page .chat-composer .textarea { height: 54px; min-height: 54px; max-height: 72px; padding-block: 8px; }
  .chat-page .chat-composer .chat-attachment-toolbar > .field-help { display: none; }
  .chat-page .chat-composer-footer .button { min-height: 36px; padding-block: 7px; }
  .chat-page .chat-composer-footer > .field-help { font-size: max(var(--wp-min-text, 0px), calc(11px * var(--wp-text-scale, 1))); }
}
@media (min-width: 821px) and (max-width: 1100px) {
  .chat-layout { grid-template-columns: 240px minmax(0, 1fr); }
  .chat-list-header { padding-inline: 12px; }
  .chat-list-header h2 { font-size: max(var(--wp-min-text, 0px), calc(16px * var(--wp-text-scale, 1))); }
}
@media (max-width: 1100px) {
  .hr-insight-groups { grid-template-columns: 1fr; }
  .hr-insight-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hr-review-area .hr-metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .page-header { flex-wrap: wrap; }
  .page-header > .page-actions { max-width: 100%; justify-content: flex-start; }
  .hr-insight-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hr-workspace-tab { padding-inline: 12px; }
  .hr-workspace-list { padding: 12px; }
  .hr-workspace-list .hr-action-row { align-items: flex-start; flex-direction: column; }
  .chat-composer .chat-attachment-toolbar > .field-help { display: none; }
  .chat-message-list { padding: 14px; }
  .chat-media-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media(max-width: 700px) {
  .leave-summary { padding: 16px; }
  .leave-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 10px; }
  .leave-employee { align-items: flex-start; }
  .leave-employee-totals { width: 100%; flex-direction: column; gap: 5px; }
  .leave-week-pattern { grid-template-columns: 1fr; }
}
