@font-face {
  font-family: "Univers LT Std";
  src: url("./assets/fonts/UniversLTStd-Light.otf") format("opentype");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Univers LT Std";
  src: url("./assets/fonts/UniversLTStd-Bold.otf") format("opentype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Glypha LT Std";
  src: url("./assets/fonts/GlyphaLTStd.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Rail Alphabet";
  src: url("./assets/fonts/RailAlphabet2SIGNBETA-Medium.ttf") format("truetype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  --gwr-green: #053525;
  --gwr-green-deep: #03291d;
  --gwr-slate-grey: #525761;
  --accent-green: #3aaa35;
  --colour-teal: #009688;
  --colour-yellow: #ffe800;
  --colour-orange: #ffa400;
  --colour-red: #e1251b;
  --white: #ffffff;
  --black: #000000;
  --grey-a: #8e9090;
  --grey-b: #e0ded8;
  --grey-c: #f7f5ef;
  --page-background: #f7f5ef;
  --surface-subtle: #f3f0e8;
  --gwr-green-20: #ced7d3;
  --accent-green-20: #d7eed7;
  --teal-20: #cceae7;
  --yellow-20: #fff8bf;
  --orange-20: #ffe6bf;
  --red-20: #f8d0cd;
  --focus-ring: #f69143;
  --shadow-soft: none;
  --radius-xl: 16px;
  --radius-lg: 12px;
  --radius-md: 10px;
  --radius-sm: 8px;
  --font-sans: "Univers LT Std", "Avenir Next", sans-serif;
  --font-display: "Glypha LT Std", Georgia, serif;
  --font-rail: "Rail Alphabet", "Univers LT Std", sans-serif;
  --transition-fast: 140ms ease;
  --transition-standard: 220ms ease;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--page-background);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--black);
  font-family: var(--font-sans);
  font-weight: 300;
  background: var(--page-background);
}

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

button {
  border: 0;
  padding: 0;
  color: inherit;
  background: transparent;
  cursor: pointer;
}

img {
  display: block;
  max-width: 100%;
}

h1,
h2,
h3,
h4,
h5,
h6,
p,
ul {
  margin: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

input,
select,
textarea {
  width: 100%;
  padding: 0.85rem 0.95rem;
  border: 1px solid var(--grey-b);
  border-radius: var(--radius-md);
  background: var(--white);
  color: var(--black);
  transition:
    border-color var(--transition-fast),
    background var(--transition-fast);
}

textarea {
  min-height: 6.5rem;
  resize: vertical;
}

input[readonly] {
  background: var(--grey-c);
  color: rgba(0, 0, 0, 0.72);
}

input:hover,
select:hover,
textarea:hover {
  border-color: rgba(5, 53, 37, 0.35);
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible,
button:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 3px;
}

.noscript-message {
  margin: 2rem;
  padding: 1rem 1.25rem;
  border-radius: 1rem;
  background: var(--orange-20);
  border: 1px solid rgba(246, 145, 67, 0.25);
}

.app-shell {
  min-height: 100vh;
}

.app-shell--modal {
  height: 100vh;
  overflow: hidden;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  color: var(--gwr-green);
  background: var(--white);
  border-bottom: 1px solid var(--grey-b);
  box-shadow: none;
}

.site-header__frame {
  width: min(100%, 110rem);
  margin: 0 auto;
  padding:
    calc(0.9rem + env(safe-area-inset-top))
    calc(1.15rem + env(safe-area-inset-right))
    0.95rem
    calc(1.15rem + env(safe-area-inset-left));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.site-header__brand {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-width: 0;
}

.site-header__brand img {
  display: block;
  width: auto;
  height: clamp(1.95rem, 3vw, 2.35rem);
}

.site-header__copy {
  display: flex;
  align-items: center;
  min-height: clamp(1.75rem, 3vw, 2.2rem);
  min-width: 0;
}

.site-header__eyebrow,
.eyebrow,
.meta-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.site-header__title {
  display: block;
  font-size: clamp(1.05rem, 1.8vw, 1.25rem);
  font-family: var(--font-display);
  line-height: 1;
  transform: translateY(0.06rem);
}

.site-header__subtitle {
  color: rgba(0, 0, 0, 0.6);
  font-size: 0.92rem;
  line-height: 1.2;
}

.site-header__meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 0.65rem;
}

.site-header__meta--user {
  display: contents;
}

.site-header__meta--user .status-pill {
  grid-area: status;
  width: 100%;
}

.status-pill,
.utility-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 2.35rem;
  padding: 0.55rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--grey-b);
  background: var(--white);
}

.status-pill--active {
  border-color: var(--colour-red);
  background: var(--colour-red);
  color: var(--white);
}

.status-pill--inactive {
  color: rgba(0, 0, 0, 0.72);
}

.utility-pill {
  color: rgba(0, 0, 0, 0.72);
}

.status-pill__dot {
  display: inline-block;
  flex: 0 0 auto;
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 999px;
  background: currentColor;
  animation: status-pill-pulse 1.2s ease-out infinite;
}

.status-pill__main {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  line-height: 1;
  min-width: 0;
}

.status-pill__label {
  display: inline-flex;
  align-items: center;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  line-height: 1;
  text-transform: uppercase;
}

.status-pill__tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 1.9rem;
  padding: 0.28rem 0.72rem;
  border-radius: 999px;
  border: 1px solid currentColor;
  font-size: 0.82rem;
  line-height: 1;
  white-space: nowrap;
}

.status-pill__tag--inactive {
  color: rgba(5, 53, 37, 0.82);
}

.utility-pill--identity {
  display: grid;
  align-items: start;
  gap: 0.08rem;
  min-height: auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.utility-pill--identity strong {
  color: var(--gwr-green);
  font-size: 0.96rem;
}

.utility-pill--identity span {
  font-size: 0.88rem;
  line-height: 1.25;
}

.header-session {
  grid-area: session;
  display: grid;
  gap: 0.12rem;
  padding: 0.8rem 1rem;
  border: 1px solid var(--grey-b);
  border-radius: 1.4rem;
  background: var(--white);
}

.header-session--compact {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--gwr-green);
  font-size: 1rem;
  line-height: 1.4;
}

.header-session__name {
  color: var(--gwr-green);
  font-family: var(--font-display);
  font-size: 1.25rem;
  line-height: 1.05;
}

.header-session__summary {
  color: rgba(0, 0, 0, 0.68);
  font-size: 0.94rem;
  line-height: 1.4;
}

.header-link {
  grid-area: actions;
  display: inline-flex;
  align-items: center;
  justify-self: end;
  min-height: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: rgba(0, 0, 0, 0.62);
  font-weight: 700;
  line-height: 1;
  transform: translateY(0.06rem);
}

.header-link:hover {
  color: var(--gwr-green);
  text-decoration: underline;
  background: transparent;
}

.page-shell {
  width: min(100%, 110rem);
  margin: 0 auto;
  padding:
    0.8rem
    calc(0.85rem + env(safe-area-inset-right))
    calc(1.2rem + env(safe-area-inset-bottom))
    calc(0.85rem + env(safe-area-inset-left));
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.85rem;
}

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

.app-shell[data-role="user"] .site-header__frame,
.app-shell[data-role="user"] .page-shell {
  width: min(100%, 42rem);
}

.app-shell[data-role="user"] .site-header {
  border-bottom: 0;
}

.app-shell[data-role="user"] .site-header__frame {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "brand actions"
    "session session"
    "status status";
  align-items: center;
  row-gap: 0.55rem;
  padding:
    calc(0.9rem + env(safe-area-inset-top))
    0
    0
    0;
}

.app-shell[data-role="user"] .site-header__brand {
  grid-area: brand;
  padding-left: calc(1rem + env(safe-area-inset-left));
}

.app-shell[data-role="user"] .status-pill {
  width: 100%;
  justify-content: space-between;
  min-height: 3rem;
  padding:
    0.9rem
    calc(1rem + env(safe-area-inset-right))
    0.9rem
    calc(1rem + env(safe-area-inset-left));
  border-radius: 0;
  border: 0;
}

.app-shell[data-role="user"] .header-session {
  padding:
    0
    calc(1rem + env(safe-area-inset-right))
    0
    calc(1rem + env(safe-area-inset-left));
  border: 0;
  border-radius: 0;
  background: transparent;
}

.app-shell[data-role="user"] .header-link {
  align-self: center;
  padding-right: calc(1rem + env(safe-area-inset-right));
}

.app-shell[data-role="user"] .page-shell {
  padding-top: 0.9rem;
  grid-template-columns: minmax(0, 1fr);
}

.app-shell[data-role="user"] .main-column {
  gap: 0.85rem;
}

.app-shell[data-role="user"] .section-card {
  padding: 1rem;
}

.app-shell[data-role="user"] .overview-row,
.app-shell[data-role="user"] .overview-meta,
.app-shell[data-role="user"] .overview-meta--paired,
.app-shell[data-role="user"] .detail-grid,
.app-shell[data-role="user"] .field-grid,
.app-shell[data-role="user"] .crew-action-card__meta {
  grid-template-columns: minmax(0, 1fr);
}

.app-shell[data-role="user"] .section-title--page {
  font-size: clamp(1.85rem, 8vw, 2.45rem);
}

.app-shell[data-role="user"] .crew-action-card__title {
  font-size: clamp(2.2rem, 10vw, 2.95rem);
}

.app-shell[data-role="user"] .status-pill--crew {
  align-items: center;
}

.app-shell[data-role="user"] .button-row {
  flex-direction: column;
}

.app-shell[data-role="user"] .button {
  width: 100%;
}

.app-shell[data-role="user"] .crew-modal__close.button {
  width: auto;
}

.app-shell[data-role="user"] .timeline-header {
  align-items: start;
  flex-direction: column;
}

.app-shell[data-role="user"] .toast-region {
  left: 1rem;
  right: 1rem;
  width: auto;
}

.page-shell--login {
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
}

.sidebar {
  position: relative;
}

.sidebar__inner {
  position: sticky;
  top: 5.9rem;
  display: grid;
  gap: 1rem;
}

.main-column {
  display: grid;
  gap: 0.85rem;
  min-width: 0;
}

.card,
.hero-card,
.metric-card,
.record-card,
.sidebar-card,
.audit-card,
.empty-state,
.section-card {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-xl);
  border: 1px solid var(--grey-b);
  background: var(--white);
  box-shadow: var(--shadow-soft);
}

.card,
.sidebar-card,
.audit-card,
.empty-state,
.section-card {
  padding: clamp(1rem, 2vw, 1.25rem);
}

.hero-card {
  padding: clamp(1.15rem, 2.4vw, 1.55rem);
}

.hero-card::after {
  content: none;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(18rem, 0.9fr);
  gap: 1rem;
  align-items: start;
}

.hero-copy {
  display: grid;
  gap: 0.8rem;
}

.hero-title {
  max-width: none;
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 3vw, 2.4rem);
  line-height: 1.02;
  color: var(--gwr-green);
}

.hero-summary {
  max-width: 42rem;
  color: rgba(0, 0, 0, 0.78);
  font-size: 1.02rem;
  line-height: 1.7;
}

.hero-actions,
.button-row,
.segment-row,
.metric-grid,
.record-actions,
.detail-tags,
.export-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.hero-panel {
  display: grid;
  gap: 0.8rem;
  padding: 1rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--grey-b);
  background: var(--grey-c);
}

.hero-panel__list {
  display: grid;
  gap: 0.75rem;
}

.hero-panel__item {
  display: grid;
  gap: 0.15rem;
}

.hero-panel__item strong,
.section-title,
.metric-number,
.record-name,
.status-banner__title {
  color: var(--gwr-green);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.9rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--grey-b);
  background: var(--white);
  color: var(--gwr-green);
  font-weight: 700;
  transition:
    border-color var(--transition-fast),
    background var(--transition-fast);
}

.button:hover {
  border-color: rgba(5, 53, 37, 0.45);
  background: var(--grey-c);
}

.button--primary {
  border-color: var(--gwr-green);
  background: var(--gwr-green);
  color: var(--white);
}

.button--primary:hover {
  border-color: var(--gwr-green-deep);
  background: var(--gwr-green-deep);
}

.button--soft {
  background: var(--grey-c);
}

.button--soft:hover {
  background: var(--surface-subtle);
}

.button--warning {
  border-color: rgba(246, 79, 95, 0.32);
  color: #9d2130;
  background: rgba(254, 220, 224, 0.85);
}

.button--warning:hover {
  border-color: var(--colour-red);
  background: var(--red-20);
}

.button--attention {
  border-color: rgba(255, 164, 0, 0.6);
  background: var(--colour-yellow);
  color: var(--black);
}

.button--attention:hover {
  border-color: var(--colour-orange);
  background: var(--colour-orange);
}

.button--urgent {
  border-color: var(--colour-red);
  background: var(--colour-red);
  color: var(--white);
}

.button--urgent:hover {
  border-color: #bf1f17;
  background: #bf1f17;
}

.button--large {
  min-height: 3.35rem;
  padding: 0.9rem 1.25rem;
  font-size: 1rem;
}

.button--header {
  min-height: 2.35rem;
  padding: 0.5rem 0.85rem;
}

.button--full {
  width: 100%;
}

.button[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.section-card {
  display: grid;
  gap: 1rem;
}

.section-heading {
  display: grid;
  gap: 0.35rem;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 2vw, 1.7rem);
  line-height: 1.05;
}

.section-copy,
.meta-copy {
  color: rgba(0, 0, 0, 0.72);
  line-height: 1.6;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  align-items: center;
}

.login-card {
  margin-bottom: 0;
}

.login-grid,
.demo-account-grid {
  display: grid;
  gap: 1rem;
}

.login-grid {
  grid-template-columns: minmax(0, 1.1fr) minmax(20rem, 0.9fr);
}

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

.sidebar-card {
  display: grid;
  gap: 1rem;
}

.sidebar-card__header {
  display: grid;
  gap: 0.35rem;
}

.session-user {
  display: grid;
  gap: 0.35rem;
  padding: 0.95rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--grey-b);
  background: var(--white);
  color: var(--black);
}

.session-user__name {
  font-family: var(--font-display);
  font-size: 1.4rem;
  line-height: 1.05;
}

.session-user__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.role-chip,
.tag,
.filter-chip,
.record-pill,
.timeline-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 1.95rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--grey-b);
  background: var(--grey-c);
  color: var(--gwr-green);
  font-size: 0.94rem;
}

.role-chip--control,
.filter-chip--active {
  background: var(--gwr-green-20);
}

.role-chip--admin {
  background: var(--orange-20);
}

.persona-list,
.process-list,
.summary-list,
.audit-list,
.check-list,
.guidance-list {
  display: grid;
  gap: 0.75rem;
}

.persona-button {
  display: grid;
  gap: 0.2rem;
  width: 100%;
  padding: 0.85rem 0.95rem;
  border-radius: 1.1rem;
  border: 1px solid rgba(82, 87, 97, 0.14);
  background: rgba(247, 245, 239, 0.8);
  text-align: left;
  transition:
    background var(--transition-fast),
    border-color var(--transition-fast),
    transform var(--transition-fast);
}

.persona-button:hover {
  transform: translateY(-1px);
  border-color: rgba(5, 53, 37, 0.35);
}

.persona-button--active {
  border-color: rgba(5, 53, 37, 0.45);
  background: rgba(206, 215, 211, 0.56);
}

.persona-button__top {
  display: flex;
  justify-content: space-between;
  gap: 0.65rem;
  align-items: center;
}

.persona-button__name {
  font-weight: 700;
}

.persona-button__meta {
  color: rgba(0, 0, 0, 0.68);
  font-size: 0.94rem;
}

.status-banner {
  display: grid;
  gap: 0.55rem;
  padding: 1rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--grey-b);
  background: var(--white);
}

.status-banner--active {
  background: var(--accent-green-20);
}

.status-banner--inactive {
  background: var(--orange-20);
}

.section-card--priority {
  border-color: rgba(225, 37, 27, 0.2);
}

.section-card--notification {
  border-color: rgba(255, 164, 0, 0.55);
  background: #fffdf4;
}

.section-card--form {
  border-color: rgba(5, 53, 37, 0.16);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 2.25fr) minmax(18rem, 0.62fr);
  align-items: start;
  gap: 0.7rem;
}

.stack {
  display: grid;
  gap: 0.85rem;
}

.board-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem;
}

.board-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.metric-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 1.65rem;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--grey-b);
  background: var(--grey-c);
  color: var(--gwr-green);
}

.metric-chip__label {
  font-size: 0.73rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(0, 0, 0, 0.58);
}

.metric-chip__value {
  font-size: 0.9rem;
  line-height: 1;
}

.segment-row {
  gap: 0.45rem;
}

.segment-row--filters {
  gap: 0.3rem;
}

.filter-chip {
  border: 1px solid var(--grey-b);
  background: var(--white);
  flex: 0 0 auto;
  min-height: 1.55rem;
  padding: 0.12rem 0.45rem;
  font-size: 0.74rem;
  transition:
    border-color var(--transition-fast),
    background var(--transition-fast);
}

.filter-chip:hover {
  background: var(--grey-c);
}

.filter-chip--active {
  border-color: rgba(0, 150, 136, 0.3);
  color: var(--gwr-green);
}

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

.record-card {
  padding: 0.8rem;
  display: grid;
  gap: 0.75rem;
}

.record-card--priority {
  border-color: rgba(55, 170, 50, 0.26);
}

.record-card__header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1rem;
}

.record-card__identity {
  display: grid;
  gap: 0.3rem;
}

.record-name {
  font-family: var(--font-display);
  font-size: 1.5rem;
  line-height: 1.02;
}

.record-rank {
  min-width: 2.2rem;
  min-height: 2.2rem;
  border-radius: 0.95rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(55, 170, 50, 0.14);
  color: var(--gwr-green);
  font-weight: 700;
}

.record-meta-grid,
.detail-grid,
.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}

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

.meta-card,
.detail-card {
  display: grid;
  gap: 0.2rem;
  padding: 0.7rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--grey-b);
  background: var(--grey-c);
}

.meta-label {
  color: rgba(0, 0, 0, 0.52);
}

.meta-value,
.detail-value {
  line-height: 1.45;
}

.record-pill {
  background: rgba(206, 215, 211, 0.56);
  font-size: 0.92rem;
}

.record-pill--allocated {
  background: rgba(215, 238, 215, 0.78);
}

.record-pill--break {
  background: rgba(254, 248, 225, 0.96);
}

.record-pill--attention {
  background: rgba(254, 220, 224, 0.9);
  color: #9d2130;
}

.detail-tags {
  gap: 0.55rem;
}

.tag--headcode {
  font-family: var(--font-rail);
  font-size: 1rem;
  letter-spacing: 0.05em;
}

.tag--soft {
  background: rgba(247, 245, 239, 0.94);
}

.inline-form {
  display: grid;
  gap: 0.8rem;
  padding: 0.8rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--grey-b);
  background: var(--white);
}

.crew-modal {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding:
    calc(0.75rem + env(safe-area-inset-top))
    calc(0.75rem + env(safe-area-inset-right))
    calc(0.75rem + env(safe-area-inset-bottom))
    calc(0.75rem + env(safe-area-inset-left));
  background: rgba(5, 53, 37, 0.18);
}

.crew-modal__backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: transparent;
}

.crew-modal__panel {
  position: relative;
  z-index: 1;
  width: min(100%, 42rem);
  max-height: calc(100vh - 1.5rem - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 0.85rem;
  overflow: hidden;
  padding: 1rem;
  border: 1px solid var(--grey-b);
  border-radius: 1.4rem;
  background: var(--white);
}

.crew-modal__header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 0.9rem;
}

.crew-modal__close {
  flex: 0 0 auto;
}

.crew-modal__body {
  min-height: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: calc(0.5rem + env(safe-area-inset-bottom));
}

.crew-modal .inline-form {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.field {
  display: grid;
  gap: 0.4rem;
}

.field label,
.checkbox-field span {
  font-weight: 700;
}

.field small,
.help-text {
  color: rgba(0, 0, 0, 0.58);
  line-height: 1.45;
}

.checkbox-field {
  display: flex;
  gap: 0.75rem;
  align-items: start;
  padding: 0.9rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--grey-b);
  background: var(--grey-c);
}

.checkbox-field input {
  width: auto;
  margin-top: 0.2rem;
}

.timeline-list {
  display: grid;
  gap: 0.85rem;
}

.timeline-item {
  display: grid;
  gap: 0.25rem;
  padding: 0.85rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--grey-b);
  background: var(--grey-c);
}

.timeline-header {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: center;
}

.timeline-chip {
  background: rgba(255, 255, 255, 0.72);
}

.empty-state {
  display: grid;
  gap: 0.65rem;
  place-items: start;
}

.empty-state strong {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--gwr-green);
}

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

.app-footer-note {
  color: rgba(0, 0, 0, 0.56);
  font-size: 0.92rem;
  line-height: 1.55;
}

.toast-region {
  position: fixed;
  right: 1rem;
  bottom: calc(1rem + env(safe-area-inset-bottom));
  z-index: 60;
  display: grid;
  gap: 0.75rem;
  width: min(22rem, calc(100vw - 2rem));
}

.toast {
  padding: 0.95rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--grey-b);
  background: var(--white);
  box-shadow: 0 1rem 2.5rem rgba(5, 53, 37, 0.16);
}

.toast--success {
  border-color: rgba(55, 170, 50, 0.28);
}

.toast--warning {
  border-color: rgba(246, 79, 95, 0.28);
}

.toast__title {
  font-weight: 700;
  color: var(--gwr-green);
}

.toast__copy {
  margin-top: 0.25rem;
  color: rgba(0, 0, 0, 0.72);
}

.page-shell--login {
  width: min(100%, 34rem);
}

.login-panel {
  gap: 1.25rem;
}

.overview-card {
  padding: 1rem 1.15rem;
}

.overview-card__action {
  display: grid;
  gap: 0.7rem;
  margin-top: 0.2rem;
}

.overview-card__action-copy {
  display: grid;
  gap: 0.2rem;
}

.overview-card__action-copy strong {
  color: var(--gwr-green);
  line-height: 1.45;
}

.overview-card__action-copy span {
  color: rgba(0, 0, 0, 0.58);
  font-size: 0.92rem;
  line-height: 1.45;
}

.overview-row {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(16rem, 0.95fr);
  gap: 1rem;
  align-items: start;
}

.overview-copy {
  display: grid;
  gap: 0.5rem;
}

.overview-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

.overview-meta--paired {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.section-title--page {
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  line-height: 1.02;
}

.crew-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(18rem, 1fr);
  gap: 1rem;
}

.crew-stack {
  display: grid;
  gap: 1rem;
}

.incident-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.incident-kicker--active {
  color: var(--black);
}

.incident-kicker--inactive {
  color: rgba(0, 0, 0, 0.6);
}

.incident-kicker__dot {
  flex: 0 0 auto;
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 999px;
  background: var(--colour-red);
}

.detail-card--cause {
  border-color: rgba(255, 164, 0, 0.36);
  background: var(--yellow-20);
}

.detail-card--neutral {
  border-color: var(--grey-b);
  background: var(--grey-c);
}

.detail-card--timing {
  border-color: rgba(225, 37, 27, 0.22);
  background: var(--red-20);
}

.crew-action-card {
  display: grid;
  gap: 0.9rem;
  padding: 1rem;
  border: 1px solid var(--grey-b);
  border-radius: var(--radius-lg);
  background: var(--white);
}

.crew-action-card--urgent {
  border-color: rgba(225, 37, 27, 0.36);
  background: var(--red-20);
}

.crew-action-card--checked,
.crew-action-card--allocated {
  border-color: rgba(58, 170, 53, 0.3);
  background: var(--accent-green-20);
}

.crew-action-card--inactive {
  background: var(--white);
}

.crew-action-card__badge {
  display: inline-flex;
  width: fit-content;
  min-height: 1.9rem;
  align-items: center;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  border: 1px solid currentColor;
  color: var(--gwr-green);
  font-size: 0.84rem;
  font-weight: 700;
}

.crew-action-card--urgent .crew-action-card__badge {
  color: var(--colour-red);
}

.crew-action-card--checked .crew-action-card__badge,
.crew-action-card--allocated .crew-action-card__badge {
  color: var(--accent-green);
}

.crew-action-card__title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 2.7rem);
  line-height: 0.98;
  color: var(--gwr-green);
}

.crew-action-card__meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.notification-state {
  display: grid;
  gap: 0.7rem;
  padding: 0.95rem;
  border: 1px solid var(--grey-b);
  border-radius: var(--radius-lg);
}

.notification-state--enabled {
  border-color: rgba(58, 170, 53, 0.3);
  background: var(--accent-green-20);
}

.notification-state--prompt {
  border-color: rgba(255, 164, 0, 0.42);
  background: var(--yellow-20);
}

.notification-state--blocked {
  border-color: rgba(255, 164, 0, 0.42);
  background: var(--orange-20);
}

.notification-state--priority {
  gap: 0.85rem;
  padding: 1.05rem;
  border-width: 2px;
}

.notification-state__eyebrow {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  min-height: 1.8rem;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  border: 1px solid currentColor;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  line-height: 1;
  text-transform: uppercase;
}

.notification-state--priority strong {
  color: var(--gwr-green);
  font-family: var(--font-display);
  font-size: clamp(1.45rem, 6vw, 1.8rem);
  line-height: 1.02;
}

.notification-state--prompt .notification-state__eyebrow {
  color: #8a5c00;
}

.notification-state--blocked .notification-state__eyebrow {
  color: #8d4700;
}

.board-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--grey-b);
  border-radius: var(--radius-lg);
  background: var(--white);
}

.board-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 56rem;
}

.board-table th,
.board-table td {
  padding: 0.55rem 0.5rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--grey-b);
}

.board-table th {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(0, 0, 0, 0.58);
  background: var(--grey-c);
}

.board-table__row--priority td {
  background: #f3f8f2;
}

.board-table__expanded td {
  background: var(--white);
}

.table-cell__title {
  font-weight: 700;
  color: var(--gwr-green);
}

.table-cell__meta {
  margin-top: 0.2rem;
  color: rgba(0, 0, 0, 0.62);
  line-height: 1.45;
}

.table-chip {
  display: inline-flex;
  align-items: center;
  min-height: 1.9rem;
  padding: 0.25rem 0.65rem;
  border: 1px solid var(--grey-b);
  border-radius: 999px;
  background: var(--grey-c);
  color: var(--gwr-green);
  font-size: 0.92rem;
}

.table-chip--warning {
  background: var(--yellow-20);
}

.table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.app-shell[data-role="control"] .site-header__frame,
.app-shell[data-role="control"] .page-shell,
.app-shell[data-role="admin"] .site-header__frame,
.app-shell[data-role="admin"] .page-shell {
  width: min(100%, 124rem);
}

.app-shell[data-role="control"] .section-card,
.app-shell[data-role="control"] .audit-card,
.app-shell[data-role="control"] .empty-state,
.app-shell[data-role="admin"] .section-card,
.app-shell[data-role="admin"] .audit-card,
.app-shell[data-role="admin"] .empty-state {
  padding: 0.72rem;
}

.app-shell[data-role="control"] .section-card,
.app-shell[data-role="control"] .audit-card,
.app-shell[data-role="admin"] .section-card,
.app-shell[data-role="admin"] .audit-card {
  gap: 0.6rem;
}

.app-shell[data-role="control"] .table-actions .button,
.app-shell[data-role="admin"] .table-actions .button {
  min-height: 2rem;
  padding: 0.42rem 0.6rem;
  font-size: 0.82rem;
}

.app-shell[data-role="control"] .section-heading,
.app-shell[data-role="admin"] .section-heading {
  gap: 0.2rem;
}

.app-shell[data-role="control"] .section-title,
.app-shell[data-role="admin"] .section-title {
  line-height: 1.05;
}

.section-card--board {
  gap: 0.55rem;
}

.empty-state--compact {
  padding: 0.7rem;
  min-height: 0;
}

.app-shell[data-role="user"] .crew-modal {
  padding: 0;
  align-items: stretch;
}

.app-shell[data-role="user"] .crew-modal__panel {
  width: 100%;
  height: 100dvh;
  max-height: 100dvh;
  border-radius: 0;
  border-left: 0;
  border-right: 0;
  border-bottom: 0;
  padding:
    calc(0.9rem + env(safe-area-inset-top))
    calc(1rem + env(safe-area-inset-right))
    0
    calc(1rem + env(safe-area-inset-left));
}

.app-shell[data-role="user"] .crew-modal__body {
  padding-bottom: calc(1rem + env(safe-area-inset-bottom));
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 1080px) {
  .page-shell,
  .dashboard-grid,
  .split-grid,
  .login-grid,
  .demo-account-grid,
  .overview-row,
  .overview-meta,
  .crew-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .crew-action-card__meta {
    grid-template-columns: minmax(0, 1fr);
  }

  .sidebar__inner {
    position: static;
  }

  .app-shell[data-role="user"] .sidebar {
    order: 2;
  }

  .app-shell[data-role="user"] .main-column {
    order: 1;
  }
}

@media (min-width: 760px) {
  .crew-modal {
    align-items: center;
  }

  .app-shell[data-role="user"] .detail-grid,
  .app-shell[data-role="user"] .field-grid,
  .app-shell[data-role="user"] .crew-action-card__meta,
  .app-shell[data-role="user"] .overview-meta--paired {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@keyframes status-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(225, 37, 27, 0.28);
  }

  100% {
    box-shadow: 0 0 0 0.5rem rgba(225, 37, 27, 0);
  }
}

@keyframes status-pill-pulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.45);
  }

  70% {
    transform: scale(1.08);
    box-shadow: 0 0 0 0.55rem rgba(255, 255, 255, 0);
  }

  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0);
  }
}

@media (max-width: 780px) {
  .site-header__frame,
  .record-card__header,
  .timeline-header {
    align-items: start;
  }

  .site-header__frame,
  .site-header__meta,
  .record-card__header,
  .record-actions {
    flex-direction: column;
  }

  .record-meta-grid,
  .detail-grid,
  .field-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .button,
  .filter-chip {
    width: 100%;
  }

  .segment-row,
  .button-row,
  .record-actions,
  .detail-tags,
  .export-actions,
  .metric-grid,
  .table-actions {
    flex-direction: column;
  }
}

@media (min-width: 1200px) {
  .app-shell[data-role="control"] .record-meta-grid,
  .app-shell[data-role="admin"] .record-meta-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .app-shell[data-role="control"] .dashboard-grid,
  .app-shell[data-role="admin"] .dashboard-grid {
    grid-template-columns: minmax(0, 1.55fr) minmax(22rem, 0.9fr);
  }
}

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