/* 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: 14px;
  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: 12px; 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: 12px;
  font-weight: 500;
  line-height: 1.4;
}
.form-help, .auth-footnote { margin: 0; color: var(--ink-faint); font-size: 12px; }
.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: 12px; }

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: 16px;
  font-weight: 760;
  letter-spacing: -0.02em;
}

.brand-kicker {
  color: var(--sidebar-muted);
  font-size: 9px;
  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: 17px;
  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: 15px;
  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: 10px;
  font-weight: 760;
  letter-spacing: 0.095em;
  text-transform: uppercase;
}

.sidebar nav,
.nav-list {
  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: 11px;
  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: 12px;
}

.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: 12px;
  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;
}

/* 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;
  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: 10px;
  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: 13px;
}

.page-actions {
  display: flex;
  flex: 0 0 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: 9px;
  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: 15px;
  font-weight: 720;
  letter-spacing: -0.015em;
}

.section-heading p,
.card-header p {
  margin: 3px 0 0;
  color: var(--ink-soft);
  font-size: 12px;
}

.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: 12px;
  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: 11px;
}

.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: 11px;
}

.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: 11px;
}

.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: 10px;
  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: 10px;
  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: 10px;
  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: 10px;
  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: 10px;
  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: 11px;
}

.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: 12px;
}

.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: 14px;
}

.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: 11px;
}

.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: 11px;
}

.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: 12px;
}

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

.series-change-summary h3 {
  margin: 0;
  color: var(--ink);
  font-size: 13px;
}

.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: 12px;
}

.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: 11px;
  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: 11px;
}

.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: #fff;
  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: 12px;
  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: #fff;
  color: #415166;
}

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

.button-danger {
  border-color: #e6b9bc;
  background: #fff;
  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: 11px;
}

.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: 16px;
  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: 13px;
  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: 10px;
  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: 10px;
  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: 12px;
  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: 12px;
  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: 11px;
  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: 12px;
  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: 10px;
  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: 11px;
  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: 10px;
  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: 11px;
  font-weight: 760;
  letter-spacing: 0.045em;
  text-transform: uppercase;
}

.calendar-legend-option {
  min-height: 26px;
  color: var(--ink-soft);
  font-size: 11px;
  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: 10px;
  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: 11px;
  font-weight: 690;
}

.feed-week-day > header strong { color: var(--ink); font-size: 15px; }
.feed-week-events { display: grid; gap: 6px; padding: 8px; }
.feed-week-empty { margin: 6px 2px; color: var(--ink-faint); font-size: 11px; }

.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: 11px; }
.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: 11px; }
.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: 11px;
  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: 11px;
  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: 12px;
}

.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: 12px;
}

.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: 12px; }
.meeting-request-draft-copy small,
.meeting-request-response small { color: var(--ink-faint); font-size: 11px; }

.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: 12px; }
.notification small { color: var(--ink-faint); font-size: 11px; }
.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: 13px; line-height: 1.4; }
.meeting-request-overlay-copy small { color: var(--ink-soft); font-size: 11px; }

.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: 14px;
  font-weight: 760;
}
.notification-entry-summary-copy p {
  margin: 4px 0 3px;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.4;
}
.notification-entry-summary-copy small { color: var(--ink-faint); font-size: 11px; }

.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: 13px;
  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: 13px;
  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: 12px;
  line-height: 1.38;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.in-app-notification-overlay-copy small {
  color: var(--ink-faint);
  font-size: 11px;
}

.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: 10px;
  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: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.week-day-header {
  color: var(--ink-soft);
  font-size: 10px;
  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: 12px;
  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: 10px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.week-time--all-day {
  min-height: 40px;
  background: var(--surface-muted);
  font-size: 9px;
  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: 10px;
  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: 11px;
  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: 11px;
}

.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: 11px;
  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: 11px;
  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: 11px;
}

.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: 12px;
  font-weight: 690;
}

.field-hint {
  color: var(--ink-faint);
  font-size: 11px;
}

.field-note {
  margin: 0;
  color: var(--ink-soft);
  font-size: 12px;
  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: 12px;
  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: 14px;
}

.planning-detail h5 {
  color: var(--ink-soft);
  font-size: 11px;
  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: 10px;
  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: 10px;
  font-weight: 700;
  letter-spacing: 0.035em;
  text-transform: uppercase;
}

.planning-detail-grid dd {
  min-width: 0;
  margin: 0;
  color: var(--ink);
  font-size: 12px;
  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: 12px;
  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: 11px;
  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: 12px;
}

.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: 12px;
  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: 12px;
}

.planning-entity-main p {
  margin: 3px 0 0;
  color: var(--ink-soft);
  font-size: 11px;
}

.planning-entity-main small {
  margin-top: 3px;
  color: var(--ink-faint);
  font-size: 10px;
}

.check-field {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 30px;
  color: #435266;
  font-size: 12px;
  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: 11px;
}

.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: 18px;
  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);
}

.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: 19px;
}

.empty-state h2,
.empty-state h3 {
  margin: 6px 0 0;
  color: var(--ink);
  font-size: 15px;
}

.empty-state p {
  max-width: 390px;
  margin: 0;
  font-size: 12px;
}

.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: 12px;
}

.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: #fff;
  box-shadow: var(--shadow);
  color: var(--ink);
  font-size: 12px;
  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: 10px;
  font-weight: 760;
  letter-spacing: 0.055em;
  text-transform: uppercase;
  white-space: nowrap;
}

.table td {
  color: #35455a;
  font-size: 12px;
}

.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: 11px;
  font-weight: 760;
  text-transform: uppercase;
}

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

.avatar-sm { width: 24px; height: 24px; font-size: 9px; }
.avatar-lg { width: 40px; height: 40px; font-size: 13px; }

.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: 12px;
  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: 13px;
  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: 11px;
  white-space: nowrap;
}

.daily-section-toggle {
  min-height: 28px;
  padding: 4px 8px;
  color: var(--ink-soft);
  font-size: 11px;
}

.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;
  width: 10px;
  overflow: hidden;
  color: #a9b7c2;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  letter-spacing: -2px;
  line-height: 1;
  user-select: none;
}

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

.daily-task-check {
  appearance: none;
  flex: 0 0 17px;
  width: 17px;
  height: 17px;
  margin: 0;
  border: 1.5px solid #91a4b3;
  border-radius: 4px;
  background: #fff;
  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: 13px;
  line-height: 1.35;
}

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

.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: 10px;
  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: 11px; font-weight: 700; white-space: nowrap; }
.daily-overdue-complete {
  flex: 0 0 auto;
  min-height: 28px;
  padding: 4px 8px;
  font-size: 11px;
}
.daily-task .priority-pill,
.daily-task .recurring-pill { flex: 0 0 auto; font-size: 9px; }

.daily-details-toggle {
  flex: 0 0 auto;
  min-height: 27px;
  padding: 4px 6px;
  color: var(--ink-faint);
  font-size: 10px;
  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: 10px; }
.daily-task-options .input,
.daily-task-options .select { min-height: 31px; padding: 5px 7px; font-size: 11px; }
.daily-task-options .full-width { grid-column: 1 / -1; }
.daily-task-options .textarea { min-height: 55px; padding: 6px 7px; font-size: 11px; }
.daily-task-options .check-field { align-self: end; min-height: 31px; font-size: 10px; }

.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: #fff;
}

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

.daily-auto-visibility-notice {
  margin: 0;
  font-size: 11px;
}

.daily-child-hint {
  grid-column: 1 / -1;
  color: var(--ink-faint);
  font-size: 10px;
}

.daily-empty {
  margin: 7px 7px 9px;
  color: var(--ink-faint);
  font-size: 12px;
}

.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: 18px; 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: 12px;
}

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

/* 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 {
  max-width: 1640px;
}

.dashboard-page {
  gap: 18px;
}

.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: 11px;
  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: 10px;
  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: 14px;
}

.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: #3c5163;
  font-size: 12px;
  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: 10px;
  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: 12px;
}

.dashboard-task-panel .series-summary-meta {
  gap: 5px;
  margin-top: 4px;
  font-size: 10px;
}

.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: 10px;
}

.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: center;
  gap: 8px;
  padding: 10px 14px 13px;
  border-top: 1px solid var(--line);
  background: #fbfcfd;
}

.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: 13px;
}

.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: 10px;
}

.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: 8px;
}

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

.dashboard-calendar-preview .event {
  min-height: 20px;
  padding: 3px 4px;
  font-size: 9px;
  line-height: 1.18;
  white-space: nowrap;
}

.dashboard-calendar-preview .more-events {
  padding: 1px 3px;
  font-size: 9px;
}

.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: 12px;
  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: 11px;
}

.personal-calendar-filter-toggle {
  justify-self: start;
  min-height: 32px;
  padding: 6px 9px;
  color: var(--ink-soft);
  font-size: 11px;
}

/* 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: 14px;
}

.dashboard-task-group-count {
  color: var(--ink-faint);
  font-size: 10px;
  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: 10px;
}

.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: 12px;
  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: 10px;
  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: 12px; }
.dashboard-calendar-item-main span { margin-top: 2px; color: var(--ink-soft); font-size: 10px; }
.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: 9px;
  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: 12px;
  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: 11px;
}

.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: 12px;
  font-weight: 700;
}

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

.brighthr-unclassified-status {
  color: #815712;
  font-size: 11px;
  line-height: 1.35;
}

.brighthr-masked-url {
  overflow-wrap: anywhere;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 10px;
}

.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: 13px;
}

.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: 11px;
}

.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: 13px; }
.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: 12px;
  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: 24px; }
  .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; }
  .personal-calendar-filters { grid-template-columns: 1fr; }
  .dashboard-calendar-preview .day-cell { min-height: 84px; }
}

/* 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;
}

.calendar-page .event {
  min-height: 28px;
  padding: 5px 7px;
  font-size: 11px;
  line-height: 1.3;
}

.calendar-page .calendar-event-title {
  font-size: 11px;
  font-weight: 760;
}

.calendar-page .calendar-event-meta {
  font-size: 10px;
  line-height: 1.25;
}

.calendar-page .feed-week-day > header strong,
.calendar-page .calendar-weekday {
  font-size: 13px;
}

.calendar-page .day-cell {
  min-height: 142px;
}

.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: 12px;
  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: 12px;
}

.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: 15px;
}

.task-finder-hint,
.task-finder-status {
  min-height: 18px;
  margin: -2px 0 0;
  font-size: 12px;
}

.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: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-finder-result-main small {
  color: var(--ink-soft);
  font-size: 11px;
}

.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)); }
}

@media (max-width: 640px) {
  .calendar-page .calendar { min-height: auto; }
  .team-calendar-filter-summary { align-items: flex-start; }
  .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; }
  .nav-link { flex: 0 0 auto; min-height: 35px; padding: 7px 9px; font-size: 12px; }
  .nav-link .nav-count { display: none; }
  .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: 13px; }
  .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: 14px; }
  .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: 24px; }
  .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: 14px; }
  .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: 10px; }
  .weekday, .calendar-weekday { padding: 8px 2px; font-size: 8px; }
  .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: 9px; 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: 9px; line-height: 1.18; white-space: nowrap; }
  .event.event--auto-visible::first-letter { font-size: inherit; }
  .more-events { padding: 0 3px; font-size: 9px; }
  .week-grid-wrap { border-radius: 0; }
  .week-event { min-height: 22px; padding: 3px 4px; font-size: 9px; }
  .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: 12px; }
  .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: 11px;
}

.calendar-page .calendar-event-kind {
  font-size: 11px;
}

.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; }

.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: 12px; }
  .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: 12px;
}

.people-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(285px, 1fr));
  gap: 12px;
}

.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-name { min-width: 0; }
.people-card-name h2,
.people-person-summary h2 {
  margin: 0;
  color: var(--ink);
  font-size: 16px;
  letter-spacing: -0.02em;
}

.people-card-name p,
.people-person-summary p {
  margin: 4px 0 0;
  color: var(--ink-soft);
  font-size: 12px;
}

.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: 10px;
  font-weight: 740;
  line-height: 1.15;
  text-align: right;
}

.people-status-icon { font-size: 12px; 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-health,
.people-card-next {
  margin: 0;
  color: var(--ink-soft);
  font-size: 12px;
}

.people-card-health {
  padding: 8px 9px;
  border-left: 3px solid var(--amber);
  background: var(--amber-soft);
  color: var(--wp-warning-ink);
}

.people-card-next {
  display: grid;
  gap: 2px;
  padding-top: 2px;
}

.people-card-next > span {
  color: var(--ink-faint);
  font-size: 10px;
  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-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: 14px;
  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: 12px;
  font-weight: 760;
}

.people-schedule-lane {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.people-schedule-lane-label {
  color: var(--ink-soft);
  font-size: 10px;
  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: 12px;
  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: 11px;
  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 {
  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: 13px; 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: 13px; }
.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;
}
[data-chat-connection-notice]:empty,
.chat-rich-media-draft-queue:empty,
.chat-attachment-queue:empty { display: none; }
.chat-layout {
  display: grid;
  grid-template-columns: minmax(255px, 0.36fr) 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: 18px; }
.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: 13px; }
.chat-search-results { display: grid; gap: 5px; padding: 0 10px 10px; border-bottom: 1px solid var(--line); }
.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: 12px; }
.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: 11px;
  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: 11px;
  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: 12px; 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: 12px;
}
.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: 11px; }
.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: 12px;
}
.chat-history-status {
  justify-self: center;
  margin: 0 0 2px;
  color: var(--ink-soft);
  font-size: 12px;
  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: 12px;
  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: 12px; }
.chat-message-header strong { color: var(--ink); font-size: 13px; }
.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: 12px; }
.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: 13px; }
.chat-attachment-copy small { color: var(--ink-soft); font-size: 11px; 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: 13px; }
.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: 13px; }
.chat-attachment-draft-copy small { overflow: hidden; color: var(--ink-soft); font-size: 11px; 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: 0;
  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(--wp-brand-border);
  border-radius: var(--radius-sm);
  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: 16px; }
.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: 22px; line-height: 1; }
.chat-media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
.chat-media-choice {
  display: grid;
  min-width: 0;
  gap: 6px;
  padding: 6px;
  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: 3 / 2; border-radius: 7px; 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: 11px; font-weight: 750; letter-spacing: .04em; text-transform: uppercase; }
.chat-media-choice-label { display: -webkit-box; overflow: hidden; min-height: 31px; color: var(--ink-soft); font-size: 11px; line-height: 1.35; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.chat-media-picker-status,
.chat-media-external-help { margin: 0; color: var(--ink-soft); font-size: 12px; }
.chat-media-external-tools { display: grid; min-width: 0; gap: 8px; padding: 10px; border: 1px solid var(--wp-brand-border); border-radius: var(--radius-sm); background: var(--brand-soft); }
.chat-media-provider-heading { color: var(--brand-dark); font-size: 13px; }
.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: 7px; padding: 8px; border: 1px solid var(--wp-brand-border); border-radius: var(--radius-sm); 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: 12px; }
.chat-media-provider-count { color: var(--ink-soft); font-size: 11px; 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: 11px; 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: 12px; }
.chat-rich-media-draft-copy small { color: var(--ink-soft); font-size: 11px; }
.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: 11px; 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: 12px; }
.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: 16px; 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: 13px; }
.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: 13px;
}
.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: 11px; text-transform: uppercase; letter-spacing: .04em; }
.quick-note-status { min-height: 20px; margin: 0; color: var(--ink-soft); font-size: 13px; }
.collaboration-task-picker { display: grid; gap: 7px; }
.collaboration-task-picker > label { color: var(--ink); font-size: 13px; 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: 13px; }
.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: 16px; }
.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: 12px; }
.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: 13px; }
.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: 12px; }
.task-collaboration-activity h4 { margin: 0 0 9px; font-size: 14px; }

/* 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: 19px; }
.hr-profile-summary > div > p { margin: 5px 0 0; color: var(--ink-soft); }
.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: 11px; font-weight: 720; text-transform: uppercase; letter-spacing: .055em; }
.hr-key-value-list dd { margin: 0; color: var(--ink); font-size: 13px; }
.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: 14px; }
.hr-action-row-copy p,
.hr-document-row-copy p,
.hr-person-row p { margin: 3px 0 0; color: var(--ink-soft); font-size: 12px; 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: 11px; }
.hr-status-pill { flex: 0 0 auto; white-space: nowrap; }
.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: 12px; }
.hr-insight-context span { display: inline-flex; gap: 5px; }

/* 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: minmax(320px, 25%) 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: min(100%, 980px);
    justify-self: start;
  }

  .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: minmax(360px, 23%) 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: min(100%, 1040px);
  }

  .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-action-row-actions,
  .hr-document-row-actions { justify-content: flex-start; }
}

@media (max-width: 430px) {
  .hr-key-value-list { grid-template-columns: 1fr; }
}

@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: 24px; }
  .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: 13.5px;
  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, #fff 0%, var(--surface-raised) 100%);
}

.card-header h2,
.card-header h3,
.section-heading h2 { font-size: 16px; }

.metric-card,
.dashboard-summary-button {
  background: linear-gradient(145deg, #fff 0%, #fdfbf9 100%);
}

.dashboard-summary-button:hover:not(:disabled) {
  border-color: var(--wp-brand-border);
  background: linear-gradient(145deg, #fff 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: 12px;
}

.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: 13px; }
.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), #fff);
  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: 12px;
  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,
  .dashboard-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: 13px; }
  .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: 11px; }
  .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; }

/* 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: 13px;
  font-weight: 760;
  letter-spacing: -0.01em;
}

.holiday-request-group-header p {
  margin-top: 3px;
  color: var(--ink-soft);
  font-size: 12px;
  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: 12px;
  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: 13px;
  font-weight: 700;
}

.holiday-request-archive > 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), #fff);
}

.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: 11px;
  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: 12px;
  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: 12px;
  line-height: 1.45;
}

.holiday-request-message strong,
.holiday-request-note strong {
  color: var(--ink);
  font-size: 11px;
  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: 13px;
  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: 11px;
  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: 12px;
  line-height: 1.45;
}

.holiday-duration-hint {
  min-height: 18px;
  margin: -5px 0 0;
  color: var(--ink-soft);
  font-size: 12px;
  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: 13px;
  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: 13px;
}

.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: 12px;
  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: 12px;
  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: 12px;
  font-weight: 650;
  line-height: 1.45;
}

.holiday-review-authority {
  margin: 0;
  font-size: 12px;
  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: 12px;
  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, #fff, var(--red-soft));
}

.staffing-cover-row--at-risk,
.staffing-cover-row--warning {
  border-color: var(--warning-border);
  background: linear-gradient(145deg, #fff, 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);
}

@media (max-width: 640px) {
  .holiday-request-row,
  .staffing-cover-row,
  .staffing-rule-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; }
}

/* 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: 10px;
  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: 9px; }
  .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: 9px;
  font-weight: 710;
  line-height: 1;
  opacity: 0.72;
  white-space: nowrap;
}
