:root {
  --bgs-blue: #004ea0;
  --bgs-red: #e31933;
  --ink: #142033;
  --text: #27364b;
  --muted: #66758a;
  --line: #dfe6ef;
  --soft-line: #edf1f6;
  --page: #f6f8fb;
  --surface: #ffffff;
  --surface-alt: #f9fbfd;
  --blue-soft: #eaf3ff;
  --red-soft: #fff0f2;
  --green: #1b7f5c;
  --green-soft: #eaf8f1;
  --amber: #a55f00;
  --amber-soft: #fff5df;
  --danger: #b42318;
  --danger-soft: #fff2f0;
  --shadow: 0 18px 45px rgba(15, 37, 67, 0.09);
  --radius: 8px;
  --font: "Segoe UI", Arial, sans-serif;
  --bgs-topbar-height: 88px;
}

* {
  box-sizing: border-box;
  scrollbar-color: rgba(0, 78, 160, 0.52) rgba(223, 230, 239, 0.58);
  scrollbar-width: thin;
}

html {
  max-width: 100%;
  overflow-x: clip;
  scrollbar-gutter: stable;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: rgba(223, 230, 239, 0.58);
  border-radius: 999px;
}

::-webkit-scrollbar-thumb {
  min-height: 44px;
  background: linear-gradient(180deg, rgba(0, 78, 160, 0.78), rgba(0, 78, 160, 0.5));
  border: 2px solid rgba(246, 248, 251, 0.95);
  border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--bgs-blue);
}

body {
  margin: 0;
  max-width: 100%;
  overflow-x: clip;
  background: var(--page);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
}

body > header:not(.topbar),
header[role="banner"]:not(.topbar),
.navbar,
.navbar-static-top,
.siteHeader,
footer.footer {
  display: none !important;
}

.wrapper-body,
.page-copy,
.xrm-editable-html,
.xrm-attribute-value,
.container,
.container-fluid {
  width: 100% !important;
  max-width: none !important;
  padding-right: 0 !important;
  padding-left: 0 !important;
}

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

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -42px;
  z-index: 100;
  padding: 8px 12px;
  background: var(--ink);
  color: #fff;
  border-radius: 6px;
  text-decoration: none;
}

.skip-link:focus {
  top: 12px;
}

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(220px, auto) minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  min-height: 78px;
  width: 100%;
  max-width: 100%;
  padding: 12px clamp(14px, 2.5vw, 24px);
  overflow: hidden;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.brand-lockup img {
  width: 146px;
  height: 52px;
  object-fit: contain;
}

.brand-lockup img.image-failed {
  display: none;
}

.brand-lockup p,
.brand-lockup h1 {
  margin: 0;
}

.brand-lockup p {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.brand-lockup h1 {
  color: var(--bgs-blue);
  font-size: 22px;
  line-height: 1.05;
}

.role-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  min-width: 0;
  overflow: visible;
  scrollbar-width: thin;
}

.topbar-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
}

.account-menu {
  min-width: 0;
}

.notification-button {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  min-width: 42px;
  padding: 0;
  color: var(--bgs-blue);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.notification-button:hover,
.notification-button:focus-visible,
.notification-button[aria-expanded="true"] {
  background: var(--blue-soft);
  border-color: #b8d6f9;
  outline: none;
}

.notification-button svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.notification-count {
  position: absolute;
  top: -6px;
  right: -6px;
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  color: #fff;
  background: var(--bgs-red);
  border: 2px solid #fff;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
}

.notification-count[hidden],
#notificationDrawerMount[hidden] {
  display: none;
}

.notification-drawer {
  position: fixed;
  top: calc(var(--bgs-topbar-height, 88px) + 12px);
  right: clamp(12px, 2vw, 24px);
  z-index: 60;
  display: grid;
  gap: 10px;
  width: min(390px, calc(100vw - 24px));
  max-height: calc(100vh - var(--bgs-topbar-height, 88px) - 28px);
  overflow: auto;
  padding: 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 24px 60px rgba(15, 37, 67, 0.18);
}

.notification-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.notification-drawer-header h3,
.notification-item h4 {
  margin: 0;
  color: var(--ink);
}

.notification-close {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.notification-close:hover,
.notification-close:focus-visible {
  color: var(--bgs-blue);
  background: var(--blue-soft);
  border-color: #b8d6f9;
  outline: none;
}

.notification-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  padding: 12px;
  background: var(--surface-alt);
  border: 1px solid var(--soft-line);
  border-radius: 8px;
}

.notification-item p {
  margin: 3px 0 0;
  color: var(--muted);
}

.notification-dot {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  color: #fff;
  background: var(--bgs-blue);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.notification-empty {
  padding: 12px;
  color: var(--muted);
  background: var(--surface-alt);
  border: 1px dashed var(--line);
  border-radius: 8px;
}

.account-chip {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  max-width: min(100%, 460px);
  padding: 7px 8px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(15, 37, 67, 0.08);
}

.account-chip-public {
  grid-template-columns: minmax(0, 1fr) auto;
}

.account-copy {
  min-width: 0;
}

.account-copy strong,
.account-copy span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-copy strong {
  color: var(--ink);
  font-size: 14px;
  line-height: 1.1;
}

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

.account-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.account-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--bgs-blue);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
  background: #fff;
  cursor: pointer;
}

.account-link:hover,
.account-link:focus-visible {
  background: var(--blue-soft);
  border-color: #b8d6f9;
  outline: none;
}

.account-link.danger-link {
  background: var(--bgs-red);
  border-color: var(--bgs-red);
  color: #fff;
}

.account-link.danger-link:hover,
.account-link.danger-link:focus-visible {
  background: #bd1429;
  border-color: #bd1429;
}

.role-tab,
.ghost-button,
.primary-button,
.danger-button,
.success-button,
.icon-button {
  border: 1px solid transparent;
  border-radius: 6px;
  font-weight: 700;
  letter-spacing: 0;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.role-tab {
  min-width: max-content;
  padding: 10px 12px;
  background: transparent;
  color: var(--muted);
}

.role-tab:hover,
.role-tab:focus-visible {
  background: var(--blue-soft);
  color: var(--bgs-blue);
  outline: none;
}

.role-tab.active {
  background: var(--bgs-blue);
  color: #fff;
}

.live-role-mode .reset-button,
.live-role-mode .role-nav,
.live-role-mode .role-tab[hidden] {
  display: none;
}

.ghost-button,
.primary-button,
.danger-button,
.success-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 9px 12px;
  white-space: nowrap;
}

.ghost-button {
  background: #fff;
  color: var(--bgs-blue);
  border-color: var(--line);
}

.ghost-button:hover,
.ghost-button:focus-visible {
  background: var(--blue-soft);
  border-color: #b8d6f9;
  outline: none;
}

.primary-button {
  background: var(--bgs-blue);
  color: #fff;
}

.primary-button:hover,
.primary-button:focus-visible {
  background: #003d7d;
  outline: none;
}

.success-button {
  background: var(--green);
  color: #fff;
}

.success-button:hover,
.success-button:focus-visible {
  background: #126748;
  outline: none;
}

.danger-button {
  background: var(--bgs-red);
  color: #fff;
}

.danger-button:hover,
.danger-button:focus-visible {
  background: #bd1429;
  outline: none;
}

.app-shell {
  width: calc(100% - 32px);
  max-width: none;
  margin: calc(var(--bgs-topbar-height, 88px) + 24px) 16px 46px;
  overflow: visible;
}

.app-shell, .workspace, .content-stack {
  min-width: 0;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(250px, 292px) minmax(0, 1fr);
  gap: 18px;
  min-width: 0;
  max-width: 100%;
}

.workspace.sidebar-collapsed {
  grid-template-columns: 78px minmax(0, 1fr);
}

.workspace.single-panel {
  grid-template-columns: minmax(0, 1fr);
}

.workspace.single-panel .content-stack {
  width: 100%;
}

.portal-gate .hero-card {
  min-height: 360px;
}

.portal-gate .hero-card h2 {
  max-width: 100%;
  word-break: normal;
  overflow-wrap: normal;
}

.pilot-auth-screen .hero-card {
  min-height: 260px;
}

.pilot-auth-groups {
  display: grid;
  gap: 22px;
}

.pilot-auth-group {
  display: grid;
  gap: 12px;
}

.pilot-auth-group h4 {
  margin: 0;
  color: var(--bgs-blue);
  font-size: 15px;
}

.pilot-profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}

.pilot-profile-card {
  display: flex;
  gap: 14px;
  align-items: center;
  width: 100%;
  min-width: 0;
  padding: 14px;
  color: inherit;
  text-align: left;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.pilot-profile-card span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.pilot-profile-card strong,
.pilot-profile-card em,
.pilot-profile-card small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pilot-profile-card strong {
  color: var(--ink);
  font-size: 16px;
}

.pilot-profile-card em {
  color: var(--text);
  font-style: normal;
  font-weight: 700;
}

.pilot-profile-card small {
  color: var(--muted);
  font-size: 12px;
}

.side-rail,
.panel,
.metric-card,
.record-card,
.timeline-card,
.table-wrap {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.side-rail {
  align-self: start;
  position: sticky;
  top: calc(var(--bgs-topbar-height, 88px) + 16px);
  z-index: 12;
  min-width: 0;
  max-height: calc(100vh - var(--bgs-topbar-height, 88px) - 32px);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
}

.side-rail-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: calc(100% - 20px);
  min-height: 36px;
  margin: 10px;
  padding: 7px 9px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--bgs-blue);
  font-size: 13px;
  font-weight: 900;
}

.side-rail-toggle:hover,
.side-rail-toggle:focus-visible {
  background: var(--blue-soft);
  border-color: #b8d6f9;
  outline: none;
}

.workspace.sidebar-collapsed .side-rail-toggle {
  justify-content: center;
  width: 44px;
  margin: 10px auto;
  padding: 7px;
}

.workspace.sidebar-collapsed .side-rail-toggle-label {
  display: none;
}

.persona-card {
  padding: 20px;
  background: linear-gradient(180deg, #ffffff 0%, #f3f8ff 100%);
  border-bottom: 1px solid var(--line);
}

.avatar-line {
  display: flex;
  align-items: center;
  gap: 12px;
}

.avatar,
.avatar-lg,
.avatar-xl {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  border-radius: 50%;
  overflow: hidden;
  background: var(--blue-soft);
  color: var(--bgs-blue);
  font-weight: 800;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px var(--line);
}

.avatar img,
.avatar-lg img,
.avatar-xl img {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 50%;
  object-fit: cover;
}

.avatar::before,
.avatar-lg::before,
.avatar-xl::before,
.avatar-fallback::before {
  content: attr(data-initials);
  display: none;
}

.avatar.image-failed::before,
.avatar-lg.image-failed::before,
.avatar-xl.image-failed::before,
.avatar-fallback::before {
  display: inline-flex;
}

.avatar {
  width: 46px;
  height: 46px;
  font-size: 13px;
}

.avatar-lg {
  width: 72px;
  height: 72px;
  font-size: 18px;
}

.avatar-xl {
  width: 112px;
  height: 112px;
  font-size: 28px;
}

.persona-card h2,
.hero-card h2,
.panel h3,
.record-card h3,
.metric-card h3 {
  margin: 0;
  color: var(--ink);
}

.persona-card h2 {
  font-size: 19px;
}

.persona-card p {
  margin: 3px 0 0;
  color: var(--muted);
}

.workspace.sidebar-collapsed .persona-card {
  padding: 10px;
}

.workspace.sidebar-collapsed .persona-card .avatar-line {
  justify-content: center;
}

.workspace.sidebar-collapsed .persona-card .avatar-line > div,
.workspace.sidebar-collapsed .persona-card > p {
  display: none;
}

.side-nav {
  display: grid;
  gap: 2px;
  padding: 10px;
}

.side-nav .nav-item {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 11px 10px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--text);
  font-weight: 700;
  text-align: left;
}

.nav-icon {
  display: inline-grid;
  place-items: center;
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  color: currentColor;
}

.nav-icon-svg {
  display: block;
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-item-label {
  min-width: 0;
}

.side-nav .nav-item.active,
.side-nav .nav-item:hover,
.side-nav .nav-item:focus-visible {
  background: var(--blue-soft);
  border-color: #cce3ff;
  color: var(--bgs-blue);
  outline: none;
}

.workspace.sidebar-collapsed .side-nav {
  gap: 8px;
  padding: 10px;
}

.workspace.sidebar-collapsed .side-nav .nav-item {
  justify-content: center;
  min-height: 44px;
  padding: 8px 6px;
  text-align: center;
}

.workspace.sidebar-collapsed .nav-item-label {
  display: none;
}

.workspace.sidebar-collapsed .nav-icon {
  display: inline-grid;
}

.content-stack {
  display: grid;
  gap: 18px;
  min-width: 0;
  max-width: 100%;
}

.hero-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, auto);
  gap: 18px;
  align-items: center;
  min-height: 176px;
  max-width: 100%;
  padding: 24px;
  background: #f6f9fc;
  background-image: none;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.hero-card-no-media {
  grid-template-columns: 1fr;
}

.hero-card h2 {
  font-size: clamp(26px, 3vw, 36px);
  line-height: 1.22;
  max-width: 700px;
}

.hero-card p {
  max-width: 720px;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 16px;
}

.hero-actions,
.button-row,
.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.hero-actions {
  margin-top: 18px;
}

form.panel .form-actions {
  position: sticky;
  bottom: 0;
  z-index: 2;
  margin: 12px -2px -2px;
  padding: 10px 2px 2px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.72), #ffffff 45%);
}

.hero-media {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  max-width: 160px;
  min-width: 0;
  overflow: hidden;
}

.hero-media .avatar-lg:nth-child(2) {
  margin-left: -26px;
}

.hero-media .avatar-lg:nth-child(3) {
  margin-left: -26px;
}

.grid-2,
.grid-3,
.grid-4 {
  display: grid;
  gap: 14px;
}

.grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr));
}

.grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid-4 {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
}

.booking-flow-grid {
  align-items: start;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
}

.panel {
  padding: 18px;
}

.panel,
.record-card,
.metric-card,
.timeline-card,
.table-wrap,
.calendar-board {
  min-width: 0;
  max-width: 100%;
}

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

.panel-header p,
.record-card p,
.metric-card p,
.timeline-card p {
  margin: 4px 0 0;
  color: var(--muted);
}

.panel-header h3 {
  font-size: 19px;
}

.record-card,
.metric-card,
.timeline-card {
  padding: 15px;
}

.persona-card h2,
.hero-card h2,
.panel h3,
.record-card h3,
.metric-card h3,
.account-copy strong,
.account-copy span {
  overflow-wrap: anywhere;
}

.record-card {
  display: grid;
  gap: 12px;
}

button.record-card,
button.slot-row,
button.calendar-event {
  width: 100%;
  color: inherit;
  font: inherit;
  text-align: left;
}

.click-card {
  cursor: pointer;
}

.click-card:hover,
.click-card:focus-visible {
  border-color: #b8d6f9;
  box-shadow: 0 0 0 3px rgba(0, 78, 160, 0.1), var(--shadow);
  outline: none;
}

.read-only-card {
  cursor: default;
}

.record-card.selected {
  border-color: var(--bgs-blue);
  box-shadow: 0 0 0 3px rgba(0, 78, 160, 0.12), var(--shadow);
}

.record-card.soft-disabled {
  background: var(--surface-alt);
}

.decision-note {
  padding: 10px 12px;
  color: var(--muted);
  background: var(--surface-alt);
  border: 1px solid var(--soft-line);
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
}

.cross-check-request-panel {
  display: grid;
  gap: 12px;
  padding: 13px;
  background: #f8fbff;
  border: 1px solid #cfe0f4;
  border-radius: 8px;
}

.record-topline {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.record-title {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 12px;
}

.record-title h3 {
  font-size: 17px;
  line-height: 1.2;
}

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

.meta {
  padding: 10px;
  background: var(--surface-alt);
  border: 1px solid var(--soft-line);
  border-radius: 6px;
}

.meta span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.meta strong {
  display: block;
  margin-top: 2px;
  color: var(--ink);
}

.pill,
.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  width: max-content;
  max-width: 100%;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}

.pill {
  background: var(--blue-soft);
  color: var(--bgs-blue);
}

.status-pill.confirmed,
.status-pill.booked,
.status-pill.completed,
.status-pill.accepted,
.status-pill.approved,
.status-pill.ready,
.status-pill.open,
.status-pill.available,
.status-pill.selected,
.status-pill.assigned {
  background: var(--green-soft);
  color: var(--green);
}

.status-pill.new,
.status-pill.pending,
.status-pill.offered,
.status-pill.offer-sent {
  background: var(--amber-soft);
  color: var(--amber);
}

.status-pill.closed,
.status-pill.declined,
.status-pill.cancelled,
.status-pill.blocked,
.status-pill.at-risk {
  background: var(--danger-soft);
  color: var(--danger);
}

.status-pill.filled {
  background: var(--blue-soft);
  color: var(--bgs-blue);
}

.status-pill.my-booking {
  background: var(--blue-soft);
  color: var(--bgs-blue);
}

.status-pill.unavailable {
  background: var(--danger-soft);
  color: var(--danger);
}

.slot-list,
.timeline-list,
.booking-list,
.evidence-list {
  display: grid;
  gap: 10px;
}

.slot-row {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  background: var(--surface-alt);
  border: 1px solid var(--soft-line);
  border-radius: 8px;
}

.slot-row.selected {
  border-color: var(--bgs-blue);
  background: var(--blue-soft);
}

.compact-slot-list .slot-row {
  grid-template-columns: 70px minmax(0, 1fr);
}

.compact-slot-list .button-row {
  grid-column: 1 / -1;
}

.parent-slot-row {
  grid-template-columns: 72px minmax(0, 1fr) auto;
}

.slot-action-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 10px;
  color: var(--bgs-blue);
  background: #fff;
  border: 1px solid #b8d6f9;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 900;
}

.read-only-card .slot-action-chip {
  display: none;
}

.slot-time {
  color: var(--ink);
  font-size: 19px;
  font-weight: 800;
}

.slot-row h4,
.timeline-card h4 {
  margin: 0;
  color: var(--ink);
  font-size: 15px;
}

.slot-row p {
  margin: 3px 0 0;
  color: var(--muted);
}

.parent-interview-panel {
  display: grid;
  gap: 16px;
}

.parent-interview-day {
  display: grid;
  gap: 10px;
}

.parent-interview-date {
  color: var(--bgs-blue);
  font-size: 17px;
  font-weight: 900;
}

.parent-interview-list {
  display: grid;
  gap: 10px;
}

.parent-interview-card {
  box-shadow: none;
}

.parent-interview-main {
  display: grid;
  grid-template-columns: 128px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
}

.parent-interview-time {
  color: var(--ink);
  font-size: 17px;
  font-weight: 900;
  white-space: nowrap;
}

.parent-interview-student {
  display: flex;
  gap: 12px;
  align-items: center;
  min-width: 0;
}

.parent-interview-student h3,
.parent-interview-student p {
  margin: 0;
}

.parent-interview-student p {
  color: var(--muted);
}

.cancelled-by {
  margin-top: 3px !important;
  color: var(--danger) !important;
  font-weight: 700;
}

.parent-interview-actions {
  justify-content: flex-end;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 12px;
}

.field {
  display: grid;
  gap: 5px;
}

.field.full {
  grid-column: 1 / -1;
}

.field label {
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 40px;
  padding: 9px 10px;
  background: #fff;
  color: var(--text);
  border: 1px solid #cdd7e4;
  border-radius: 6px;
}

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

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--bgs-blue);
  outline: 3px solid rgba(0, 78, 160, 0.13);
}

.metric-card h3 {
  color: var(--bgs-blue);
  font-size: 32px;
  line-height: 1;
}

.metric-card[data-action] {
  display: grid;
  width: 100%;
  text-align: left;
  background: var(--surface);
  border-color: var(--soft-line);
  box-shadow: none;
}

.metric-card[data-action]:hover,
.metric-card[data-action]:focus-visible {
  border-color: #b8d6f9;
  box-shadow: 0 0 0 3px rgba(0, 78, 160, 0.12), var(--shadow);
  outline: none;
  transform: translateY(-1px);
}

.metric-card strong {
  display: block;
  margin-top: 8px;
  color: var(--ink);
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

th,
td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--soft-line);
  text-align: left;
  vertical-align: top;
}

th {
  background: var(--surface-alt);
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

td {
  color: var(--text);
}

.empty-state {
  padding: 22px;
  background: var(--surface-alt);
  border: 1px dashed #cbd6e3;
  border-radius: 8px;
  color: var(--muted);
}

.alert {
  padding: 13px 14px;
  border-radius: 8px;
  border: 1px solid;
}

.alert.good {
  background: var(--green-soft);
  border-color: #b8e7d0;
  color: #105e42;
}

.alert.warn {
  background: var(--amber-soft);
  border-color: #f1d28c;
  color: #7c4c00;
}

.alert.bad {
  background: var(--danger-soft);
  border-color: #f3beb8;
  color: #8a1a12;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 50;
  max-width: min(420px, calc(100vw - 32px));
  padding: 13px 14px;
  background: var(--ink);
  color: #fff;
  border-radius: 8px;
  box-shadow: 0 18px 42px rgba(20, 32, 51, 0.2);
  transform: translateY(120%);
  opacity: 0;
  transition: transform 180ms ease, opacity 180ms ease;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.event-log {
  max-height: 360px;
  overflow: auto;
}

.event-log li {
  margin-bottom: 10px;
}

.event-log strong {
  color: var(--ink);
}

.calendar-board {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(220px, 1fr);
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 6px;
  scrollbar-width: thin;
}

.calendar-day {
  min-height: 260px;
  padding: 12px;
  background: var(--surface-alt);
  border: 1px solid var(--soft-line);
  border-radius: 8px;
}

.calendar-day-header {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.calendar-day-header strong {
  color: var(--ink);
  font-size: 15px;
}

.calendar-day-header span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.calendar-events {
  display: grid;
  gap: 9px;
  margin-top: 10px;
}

.calendar-event {
  display: grid;
  gap: 7px;
  padding: 11px;
  background: #fff;
  border: 1px solid var(--line);
  border-left: 4px solid var(--bgs-blue);
  border-radius: 8px;
}

.calendar-event.blocked,
.calendar-event.closed,
.calendar-event.cancelled,
.calendar-event.at-risk {
  border-left-color: var(--bgs-red);
}

.calendar-event.confirmed,
.calendar-event.booked,
.calendar-event.completed,
.calendar-event.accepted,
.calendar-event.approved,
.calendar-event.ready,
.calendar-event.open {
  border-left-color: var(--green);
}

.calendar-event.new,
.calendar-event.pending {
  border-left-color: var(--amber);
}

.calendar-event-time {
  color: var(--bgs-blue);
  font-size: 13px;
  font-weight: 900;
}

.calendar-event h4 {
  margin: 0;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.25;
}

.calendar-event p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.calendar-event-footer {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}

.schedule-student-photo {
  display: inline-flex;
  align-items: center;
  min-width: 0;
}

.schedule-student-photo .avatar-lg {
  width: 56px;
  height: 56px;
  font-size: 16px;
}

.schedule-empty-photo {
  width: 1px;
  min-height: 1px;
}

.inline-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.inline-filters label {
  display: grid;
  gap: 5px;
}

.inline-filters span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.inline-filters select {
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-weight: 800;
}

.inline-filters select:focus {
  border-color: #b8d6f9;
  box-shadow: 0 0 0 3px rgba(0, 78, 160, 0.12);
  outline: none;
}

.table-person {
  display: inline-flex;
  gap: 10px;
  align-items: center;
}

.table-person .avatar {
  width: 38px;
  height: 38px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(20, 32, 51, 0.42);
}

.detail-modal {
  display: grid;
  gap: 14px;
  width: min(720px, calc(100vw - 32px));
  max-height: calc(100vh - 36px);
  overflow: auto;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 28px 80px rgba(15, 37, 67, 0.26);
}

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

.modal-header h3 {
  margin: 0;
  color: var(--ink);
  font-size: 22px;
}

.modal-header p {
  margin: 4px 0 0;
  color: var(--muted);
}

.modal-actions {
  justify-content: flex-end;
}

.hr-metric-grid,
.hr-flow-strip,
.hr-board-layout,
.hr-matching-layout,
.hr-kanban,
.communication-grid,
.rules-grid,
.check-summary {
  display: grid;
  min-width: 0;
  max-width: 100%;
}

.hr-metric-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr));
  gap: 12px;
}

.hr-metric-card {
  display: grid;
  min-width: 0;
  min-height: 118px;
  padding: 16px;
  text-align: left;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 12px 30px rgba(15, 37, 67, 0.06);
}

.hr-metric-card:hover,
.hr-metric-card:focus-visible {
  border-color: #b8d6f9;
  box-shadow: 0 0 0 3px rgba(0, 78, 160, 0.12), var(--shadow);
  outline: none;
  transform: translateY(-1px);
}

.hr-metric-card strong,
.hr-metric-card span,
.hr-metric-card em {
  display: block;
  min-width: 0;
}

.hr-metric-card strong {
  color: var(--bgs-blue);
  font-size: 32px;
  line-height: 1.18;
}

.hr-metric-card span {
  margin-top: 10px;
  color: var(--ink);
  font-weight: 900;
}

.hr-metric-card em {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
}

.hr-metric-card.warning strong {
  color: var(--amber);
}

.hr-metric-card.danger strong {
  color: var(--bgs-red);
}

.hr-flow-strip {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.hr-flow-strip article {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  min-width: 0;
  padding: 15px;
  background: #fff;
  border-right: 1px solid var(--soft-line);
}

.hr-flow-strip article:last-child {
  border-right: 0;
}

.hr-flow-strip span {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  color: #fff;
  background: var(--bgs-blue);
  border-radius: 50%;
  font-weight: 900;
}

.hr-flow-strip strong,
.hr-flow-strip p {
  display: block;
  margin: 0;
}

.hr-flow-strip p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

.hr-timeline,
.risk-list,
.reason-stack,
.candidate-list,
.rule-checks {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.hr-timeline-row {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-width: 0;
  min-height: 76px;
  padding: 13px;
  background: #fff;
  border: 1px solid var(--soft-line);
  border-left: 5px solid var(--bgs-blue);
  border-radius: var(--radius);
}

.hr-timeline-row.pending,
.hr-timeline-row.new {
  border-left-color: var(--amber);
}

.hr-timeline-row.confirmed,
.hr-timeline-row.filled {
  border-left-color: var(--green);
}

.hr-timeline-row.blocked,
.hr-timeline-row.at-risk,
.hr-timeline-row.declined,
.hr-timeline-row.cancelled {
  border-left-color: var(--bgs-red);
}

.hr-timeline-row time {
  color: var(--bgs-blue);
  font-weight: 900;
}

.hr-timeline-row span,
.risk-item span,
.offer-card span,
.offer-card em,
.reason-stack span {
  display: block;
  color: var(--muted);
}

.risk-item {
  min-width: 0;
  padding: 14px;
  background: var(--surface-alt);
  border: 1px solid var(--soft-line);
  border-radius: var(--radius);
}

.risk-item.high {
  background: var(--danger-soft);
  border-color: #ffd2d8;
}

.risk-item.medium {
  background: var(--amber-soft);
  border-color: #ffe1a8;
}

.risk-item button {
  margin-top: 10px;
}

.hr-board-layout {
  grid-template-columns: 1fr;
  gap: 18px;
  align-items: start;
}

.filter-panel {
  display: grid;
  gap: 10px;
}

.board-filter-bar {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.filter-stack {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: 8px;
}

.filter-chip {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 2px 10px;
  align-items: center;
  min-width: 0;
  padding: 10px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--soft-line);
  border-radius: 8px;
  cursor: pointer;
}

.filter-chip:hover,
.filter-chip:focus-within {
  border-color: #b8d6f9;
  box-shadow: 0 0 0 3px rgba(0, 78, 160, 0.1);
}

.filter-chip.active {
  background: var(--blue-soft);
  border-color: #bfdcff;
}

.filter-chip input {
  grid-row: 1 / 3;
  width: 18px;
  min-width: 18px;
  height: 18px;
  min-height: 18px;
  padding: 0;
  accent-color: var(--bgs-blue);
}

.filter-chip span,
.filter-chip em,
.filter-chip strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.filter-chip span {
  color: var(--ink);
  font-weight: 900;
}

.filter-chip em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 700;
}

.filter-chip strong {
  grid-column: 3;
  grid-row: 1 / 3;
  min-width: 30px;
  padding: 5px 7px;
  text-align: center;
  color: var(--bgs-blue);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
}

.filter-panel input[type="checkbox"],
.rule-card input[type="checkbox"] {
  width: 18px;
  min-width: 18px;
  height: 18px;
  min-height: 18px;
  padding: 0;
  accent-color: var(--bgs-blue);
}

.hr-matching-layout {
  grid-template-columns: minmax(min(100%, 230px), 0.72fr) minmax(min(100%, 330px), 1fr) minmax(min(100%, 300px), 0.92fr);
  gap: 18px;
  align-items: start;
}

.need-picker,
.candidate-panel,
.reason-panel {
  align-self: start;
}

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

.need-picker-list .need-picker-item,
.candidate-row {
  width: 100%;
  min-width: 0;
  padding: 13px;
  text-align: left;
  background: #fff;
  border: 1px solid var(--soft-line);
  border-radius: var(--radius);
}

.need-picker-list .need-picker-item.active,
.candidate-row.selected {
  background: var(--blue-soft);
  border-color: #bfdcff;
  box-shadow: 0 0 0 2px rgba(0, 78, 160, 0.1);
}

.need-picker-list .need-picker-item strong,
.need-picker-list .need-picker-item span,
.need-picker-list .need-picker-item em,
.candidate-row strong,
.candidate-row span,
.candidate-row b,
.candidate-row em {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.need-picker-list .need-picker-item span,
.need-picker-list .need-picker-item em {
  color: var(--muted);
  font-style: normal;
}

.check-summary {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 14px 0;
}

.check-summary span,
.reason-stack div,
.rule-check {
  min-width: 0;
  padding: 12px;
  background: var(--surface-alt);
  border: 1px solid var(--soft-line);
  border-radius: var(--radius);
}

.check-summary strong {
  display: block;
  color: var(--bgs-blue);
  font-size: 24px;
  line-height: 1.18;
}

.candidate-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
}

.candidate-row.blocked {
  background: var(--danger-soft);
}

.candidate-row.partial {
  background: var(--amber-soft);
}

.candidate-row b {
  color: var(--bgs-blue);
}

.candidate-row em,
.hr-timeline-row b {
  width: max-content;
  max-width: 100%;
  padding: 5px 8px;
  color: var(--bgs-blue);
  background: var(--blue-soft);
  border-radius: 999px;
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
}

.rule-check {
  border-left: 5px solid var(--green);
}

.rule-check.warn {
  background: var(--amber-soft);
  border-left-color: var(--amber);
}

.rule-check strong,
.rule-check span {
  display: block;
}

.rule-check span {
  margin-top: 4px;
}

.guardrail-note {
  margin: 14px 0 0;
  padding: 12px 14px;
  color: var(--danger);
  background: var(--danger-soft);
  border: 1px solid #ffd2d8;
  border-radius: var(--radius);
  font-weight: 800;
}

.decision-actions {
  margin-top: 14px;
}

.rule-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0;
  padding: 14px;
  background: var(--surface-alt);
  border: 1px solid var(--soft-line);
  border-radius: var(--radius);
}

.rule-preview strong {
  flex-basis: 100%;
}

.pill.success {
  color: var(--green);
  background: var(--green-soft);
}

.pill.warn {
  color: var(--amber);
  background: var(--amber-soft);
}

.hr-kanban {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: 14px;
}

.offer-card {
  display: grid;
  gap: 10px;
  min-width: 0;
  margin-top: 12px;
  padding: 14px;
  background: var(--surface-alt);
  border: 1px solid var(--soft-line);
  border-left: 5px solid var(--bgs-blue);
  border-radius: var(--radius);
}

.offer-card.warning,
.offer-card.partial {
  border-left-color: var(--amber);
}

.offer-card.success,
.offer-card.eligible {
  background: var(--green-soft);
  border-left-color: var(--green);
}

.offer-card.danger,
.offer-card.blocked {
  background: var(--danger-soft);
  border-left-color: var(--bgs-red);
}

.offer-card strong,
.offer-card span,
.offer-card em {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.offer-card em {
  font-style: normal;
  font-weight: 800;
}

.profile-workspace-grid {
  display: grid;
  grid-template-columns: minmax(180px, 240px) minmax(0, 1fr);
  gap: 18px;
  align-items: stretch;
}

.profile-photo-card,
.detail-box,
.mini-row {
  min-width: 0;
  border: 1px solid var(--soft-line);
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
}

.profile-photo-card {
  display: grid;
  gap: 10px;
  place-items: center;
  padding: 18px;
  text-align: center;
}

.profile-photo-card strong,
.profile-photo-card span {
  display: block;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.profile-photo-card span {
  color: var(--muted);
  font-weight: 700;
}

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

.detail-box {
  display: grid;
  gap: 6px;
  padding: 14px;
}

.detail-box span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.detail-box strong {
  overflow-wrap: anywhere;
}

.list-stack {
  display: grid;
  gap: 10px;
}

.mini-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
}

.mini-row > span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.communication-panel {
  margin-top: 2px;
}

.communication-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: 12px;
}

.communication-grid div {
  min-width: 0;
  padding: 14px;
  background: var(--surface-alt);
  border: 1px solid var(--soft-line);
  border-radius: var(--radius);
}

.communication-grid strong,
.communication-grid span,
.communication-grid em {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.communication-grid em {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
  font-weight: 800;
}

.rules-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 14px;
}

.rule-card {
  display: grid;
  gap: 12px;
}

.rule-card.locked {
  border-top: 4px solid var(--bgs-blue);
}

.rule-card.danger {
  background: var(--danger-soft);
}

.rule-card label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-weight: 800;
}

.rule-card .check-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 10px;
  color: var(--ink);
  background: var(--surface-alt);
  border: 1px solid var(--soft-line);
  border-radius: 8px;
}

.rule-card .check-row span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.rule-card .range-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 12px;
  align-items: center;
  padding: 10px;
  background: var(--surface-alt);
  border: 1px solid var(--soft-line);
  border-radius: 8px;
}

.rule-card .range-field span {
  color: var(--ink);
}

.rule-card .range-field em {
  justify-self: end;
  width: max-content;
  min-width: 36px;
  padding: 3px 7px;
  text-align: center;
  color: var(--bgs-blue);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-style: normal;
  font-weight: 900;
}

.rule-card input[type="range"] {
  grid-column: 1 / -1;
  width: 100%;
  padding: 0;
  accent-color: var(--bgs-blue);
}

.rule-card input:disabled,
.rule-card select:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.danger-zone {
  background: var(--danger-soft);
  border-color: #ffd2d8;
}

.mobile-only {
  display: none;
}

@media (max-width: 1280px) {
  .hero-card {
    grid-template-columns: 1fr;
  }

  .hero-media {
    display: none;
  }

  .hr-metric-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .hr-flow-strip,
  .hr-kanban,
  .communication-grid,
  .rules-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hr-matching-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1080px) {
  .topbar {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .role-nav {
    justify-content: flex-start;
  }

  .reset-button {
    justify-self: start;
  }

  .topbar-actions {
    justify-content: flex-start;
    width: 100%;
  }

  .account-menu {
    max-width: 100%;
  }

  .workspace {
    grid-template-columns: 1fr;
  }

  .workspace.sidebar-collapsed {
    grid-template-columns: 1fr;
  }

  .side-rail {
    position: sticky;
    top: calc(var(--bgs-topbar-height, 88px) + 8px);
    max-height: none;
    overflow-x: auto;
    overflow-y: hidden;
  }

  .side-rail-toggle {
    display: none;
  }

  .side-nav {
    display: flex;
    overflow-x: auto;
  }

  .side-nav .nav-item {
    width: auto;
    min-width: max-content;
  }

  .workspace.sidebar-collapsed .persona-card .avatar-line > div,
  .workspace.sidebar-collapsed .persona-card > p {
    display: block;
  }

  .workspace.sidebar-collapsed .nav-item-label {
    display: inline;
  }

  .workspace.sidebar-collapsed .nav-icon {
    display: inline-grid;
  }

  .grid-4,
  .grid-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hr-board-layout {
    grid-template-columns: 1fr;
  }

  .filter-panel {
    display: grid;
  }

  .profile-workspace-grid,
  .detail-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 740px) {
  .topbar {
    min-height: 0;
    padding: 12px;
  }

  .role-nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    overflow: visible;
    scrollbar-width: none;
  }

  .role-nav::-webkit-scrollbar {
    display: none;
  }

  .role-tab {
    min-width: 0;
    width: 100%;
    padding: 9px 8px;
    line-height: 1.15;
    white-space: normal;
  }

  .side-rail {
    box-shadow: 0 8px 24px rgba(15, 37, 67, 0.06);
    border-radius: 10px;
  }

  .persona-card {
    display: none;
  }

  .side-nav {
    display: flex;
    overflow-x: auto;
    padding: 8px;
    gap: 6px;
    scrollbar-width: none;
  }

  .side-nav::-webkit-scrollbar {
    height: 0;
  }

  .side-nav .nav-item {
    flex: 0 0 clamp(112px, 34vw, 154px);
    width: clamp(112px, 34vw, 154px);
    min-width: 0;
    justify-content: center;
    text-align: center;
    white-space: normal;
    line-height: 1.15;
  }

  .reset-button {
    width: 100%;
  }

  .topbar-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .account-chip {
    grid-template-columns: auto minmax(0, 1fr);
    max-width: 100%;
  }

  .account-actions {
    grid-column: 1 / -1;
    justify-content: stretch;
  }

  .account-actions .account-link {
    flex: 1 1 0;
  }

  .live-role-mode .topbar {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    min-height: 58px;
    padding: 8px 10px;
    overflow: visible;
  }

  .live-role-mode .brand-lockup {
    justify-content: flex-start;
    gap: 8px;
  }

  .live-role-mode .brand-lockup p {
    display: none;
  }

  .live-role-mode .topbar-actions {
    display: flex;
    gap: 6px;
    justify-content: flex-end;
    width: auto;
  }

  .live-role-mode .notification-button {
    width: 36px;
    height: 36px;
    min-width: 36px;
  }

  .live-role-mode .account-chip {
    display: flex;
    gap: 0;
    padding: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
  }

  .live-role-mode .account-chip .avatar-wrap,
  .live-role-mode .account-copy {
    display: none;
  }

  .live-role-mode .account-actions {
    grid-column: auto;
    flex-wrap: nowrap;
    gap: 6px;
  }

  .live-role-mode .account-actions .account-link {
    flex: 0 0 auto;
    min-height: 34px;
    padding: 0 8px;
    font-size: 12px;
  }

  .brand-lockup img {
    width: 104px;
    height: 38px;
  }

  .brand-lockup h1 {
    font-size: 20px;
  }

  .app-shell {
    width: calc(100% - 20px);
    max-width: calc(100vw - 20px);
    margin-top: calc(var(--bgs-topbar-height, 88px) + 12px);
  }

  .hero-card {
    grid-template-columns: 1fr;
    padding: 18px;
  }

  .hero-media {
    justify-content: flex-start;
  }

  .grid-4,
  .grid-3,
  .grid-2,
  .form-grid,
  .hr-metric-grid,
  .hr-flow-strip,
  .hr-kanban,
  .communication-grid,
  .rules-grid,
  .check-summary {
    grid-template-columns: 1fr;
  }

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

  .hr-timeline-row,
  .candidate-row {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .hr-timeline-row b,
  .candidate-row b,
  .candidate-row em {
    grid-column: 2;
  }

  .hr-flow-strip article {
    border-right: 0;
    border-bottom: 1px solid var(--soft-line);
  }

  .hr-flow-strip article:last-child {
    border-bottom: 0;
  }

  .calendar-board {
    grid-auto-flow: row;
    grid-auto-columns: unset;
    grid-template-columns: 1fr;
    overflow-x: visible;
  }

  .table-wrap {
    overflow: visible;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .table-wrap table,
  .table-wrap tbody,
  .table-wrap tr,
  .table-wrap td {
    display: block;
    width: 100%;
    min-width: 0;
  }

  .table-wrap thead {
    display: none;
  }

  .table-wrap tbody {
    display: grid;
    gap: 10px;
  }

  .table-wrap tr {
    background: var(--surface);
    border: 1px solid var(--soft-line);
    border-radius: var(--radius);
    overflow: hidden;
  }

  .table-wrap td {
    display: grid;
    grid-template-columns: minmax(82px, 0.4fr) minmax(0, 1fr);
    gap: 12px;
    align-items: start;
    padding: 11px 12px;
    border-bottom: 1px solid var(--soft-line);
    overflow-wrap: anywhere;
  }

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

  .table-wrap td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0;
    text-transform: uppercase;
  }

  .table-wrap td:not([data-label])::before {
    content: "";
    display: none;
  }

  .panel-header,
  .record-topline {
    display: grid;
  }

  .meta-grid {
    grid-template-columns: 1fr;
  }

  .ghost-button,
  .primary-button,
  .danger-button,
  .success-button {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
