:root {
  --ink: #14202b;
  --muted: #667481;
  --line: #d9e0e6;
  --panel: #ffffff;
  --panel-strong: #eaf1f4;
  --surface: #f4f7f9;
  --nav: #101820;
  --accent: #2f8f83;
  --accent-strong: #176f66;
  --warning: #c57b27;
  --danger: #b33a3a;
  --blue: #2f6f9f;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--surface);
  font-family: Arial, Helvetica, sans-serif;
  -webkit-text-size-adjust: 100%;
}

button,
input,
select {
  font: inherit;
  max-width: 100%;
}

button {
  min-height: 42px;
  border: 0;
  border-radius: 6px;
  padding: 0 14px;
  color: #ffffff;
  background: var(--accent);
  cursor: pointer;
}

img {
  max-width: 100%;
}

button:hover {
  background: var(--accent-strong);
}

.is-hidden {
  display: none !important;
}

.login-screen {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(rgba(16, 24, 32, 0.78), rgba(16, 24, 32, 0.72)),
    url("assets/femme-vise-plateforme.png") center/cover;
}

.login-panel {
  width: min(460px, 100%);
  padding: 34px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  color: #ffffff;
  background: rgba(16, 24, 32, 0.82);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.32);
}

.product-mark,
.eyebrow {
  margin: 0 0 8px;
  color: #9ed8d1;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.login-panel h1 {
  margin: 0;
  font-size: clamp(30px, 6vw, 48px);
  line-height: 1.02;
}

.login-copy {
  color: #d8e2e7;
}

.login-form {
  display: grid;
  gap: 10px;
  margin-top: 24px;
}

label {
  display: grid;
  gap: 7px;
  color: inherit;
  font-weight: 700;
}

input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
  color: var(--ink);
  background: #ffffff;
}

select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
  color: var(--ink);
  background: #ffffff;
}

.login-error {
  min-height: 18px;
  margin: 0;
  color: #ffd2d2;
  font-size: 14px;
}

.app-shell {
  display: grid;
  min-height: 100vh;
  grid-template-columns: 260px 1fr;
}

.sidebar {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 22px;
  color: #ffffff;
  background: var(--nav);
  isolation: isolate;
}

.app-shell[data-active-view="room"] .sidebar,
.app-shell[data-active-view="champ"] .sidebar,
.app-shell[data-active-view="writing"] .sidebar,
.app-shell[data-active-view="muster"] .sidebar {
  background: transparent;
}

.app-shell[data-active-view="room"] .sidebar::before,
.app-shell[data-active-view="champ"] .sidebar::before,
.app-shell[data-active-view="writing"] .sidebar::before,
.app-shell[data-active-view="muster"] .sidebar::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  z-index: 0;
  width: 260px;
  height: 100vh;
  pointer-events: none;
}

.app-shell[data-active-view="room"] .sidebar::before {
  background:
    linear-gradient(rgba(7, 17, 30, 0.42), rgba(7, 17, 30, 0.68)),
    url("assets/cover-appli3.png") center 32% / cover no-repeat,
    var(--nav);
}

.app-shell[data-active-view="champ"] .sidebar::before {
  background:
    linear-gradient(rgba(7, 17, 30, 0.42), rgba(7, 17, 30, 0.68)),
    url("assets/sidebar-champ.png") center 32% / cover no-repeat,
    var(--nav);
}

.app-shell[data-active-view="writing"] .sidebar::before {
  background:
    linear-gradient(rgba(7, 17, 30, 0.45), rgba(7, 17, 30, 0.72)),
    url("assets/sidebar-writing.png") 58% center / cover no-repeat,
    var(--nav);
}

.app-shell[data-active-view="muster"] .sidebar::before {
  background:
    linear-gradient(rgba(7, 17, 30, 0.42), rgba(7, 17, 30, 0.68)),
    url("assets/sidebar-muster.png") center 32% / cover no-repeat,
    var(--nav);
}

.sidebar-scroll-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 22px;
  min-height: calc(100vh - 44px);
  transform: translateY(var(--sidebar-scroll-offset, 0px));
  will-change: transform;
}

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

.brand-logo {
  width: 44px;
  height: 44px;
  border-radius: 6px;
  object-fit: cover;
  background: transparent;
}

.brand {
  overflow: visible;
}

.brand small {
  display: block;
  margin-top: 3px;
  color: #b7c6cf;
}

.brand-site {
  display: inline-block;
  margin-left: 6px;
  color: #9ed8d1;
  font-size: 0.82em;
}

.main-nav {
  display: grid;
  gap: 8px;
}

.nav-item,
.secondary-action {
  width: 100%;
  color: #dce8ee;
  background: transparent;
  text-align: left;
}

.nav-item {
  border: 1px solid transparent;
  padding: 0 12px;
}

.nav-item:hover,
.nav-item.is-active {
  border-color: rgba(158, 216, 209, 0.45);
  background: rgba(158, 216, 209, 0.14);
}

.secondary-action {
  margin-top: auto;
  border: 1px solid rgba(255, 255, 255, 0.18);
  text-align: center;
}

.workspace {
  min-width: 0;
  padding: 26px;
}

.topbar,
.section-heading,
.operations-band,
.surfer-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar {
  margin-bottom: 24px;
}

.app-shell[data-active-view="room"] .topbar,
.app-shell[data-active-view="writing"] .topbar,
.app-shell[data-active-view="events"] .topbar {
  display: none;
}

.topbar h2,
.section-heading h3,
.operations-band h3,
.surfer-card h3 {
  margin: 0;
}

.status-strip {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #29a36a;
}

.view {
  display: none;
}

.view.is-active {
  display: block;
}

.metrics-grid,
.platform-grid {
  display: grid;
  gap: 14px;
}

.metrics-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 26px;
}

.metric-block,
.platform-block,
.surfer-card,
.operations-band,
.table-wrap,
.assignment-item,
.muster-counter,
.muster-panel,
.timeline-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.champ-search-box {
  position: relative;
  width: min(560px, 42vw);
  min-width: 320px;
}

.champ-search-box label {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.champ-search-box input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  background: var(--panel);
}

.champ-search-result {
  position: absolute;
  z-index: 8;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  display: grid;
  gap: 6px;
  max-height: 280px;
  overflow-y: auto;
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 18px 45px rgba(20, 32, 43, 0.18);
}

.champ-search-result:empty {
  display: none;
}

.champ-search-result button,
.champ-search-result p {
  display: grid;
  gap: 3px;
  min-height: auto;
  margin: 0;
  border-radius: 0;
  padding: 10px 12px;
  color: var(--ink);
  text-align: left;
  background: var(--panel);
}

.champ-search-result button:hover {
  background: var(--panel-strong);
}

.champ-search-result span {
  color: var(--muted);
  font-size: 13px;
}

.metric-block {
  padding: 18px;
}

.metric-block span,
.platform-meta,
.assignment-item span,
.timeline-item span {
  color: var(--muted);
  font-size: 13px;
}

.metric-block strong {
  display: block;
  margin-top: 6px;
  font-size: 30px;
}

.platform-grid {
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  margin: 14px 0 22px;
}

.surfer-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(240px, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.platform-block {
  display: grid;
  gap: 12px;
  padding: 18px;
  cursor: pointer;
  transition: border-color 0.18s ease, transform 0.18s ease;
}

.surfer-card {
  padding: 18px;
  cursor: pointer;
  transition: border-color 0.18s ease, transform 0.18s ease;
}

.platform-block:hover,
.platform-block:focus-visible,
.surfer-card:hover,
.surfer-card:focus-visible {
  border-color: var(--accent);
  transform: translateY(-1px);
  outline: none;
}

.platform-title {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.platform-title h4 {
  margin: 0;
  font-size: 20px;
}

.platform-name-input,
.surfer-name-input {
  min-height: 38px;
  border-color: transparent;
  padding: 6px 0;
  font-size: 20px;
  font-weight: 800;
}

.platform-name-input:focus,
.surfer-name-input:focus {
  border-color: var(--accent);
  padding: 6px 10px;
}

.platform-count {
  color: var(--accent-strong);
  font-size: 28px;
  font-weight: 800;
}

.platform-meta {
  display: grid;
  gap: 5px;
}

.platform-meta small {
  color: var(--accent-strong);
  font-weight: 700;
}

.champ-details {
  margin: -4px 0 22px;
}

.champ-details:empty {
  display: none;
}

.champ-details > div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
}

.champ-details-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 16px;
}

.champ-details-head span,
.champ-details-head p,
.champ-person-row span,
.champ-person-row small {
  color: var(--muted);
}

.champ-details-head h4 {
  margin: 4px 0;
  font-size: 24px;
}

.champ-details-head p {
  margin: 0;
}

.champ-details-head strong {
  color: var(--accent-strong);
  font-size: 34px;
}

.champ-people-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 8px;
  max-height: 260px;
  overflow-y: auto;
  padding: 0 16px 16px;
}

.champ-person-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 3px;
  min-width: 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  padding: 10px;
  cursor: pointer;
}

.champ-person-main {
  display: grid;
  min-width: 0;
}

.champ-person-main strong,
.champ-person-main span,
.champ-person-main small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.champ-person-row button {
  min-height: 36px;
  padding: 0 10px;
  background: #1b2a3a;
  font-size: 13px;
  font-weight: 700;
}

.champ-person-row:hover,
.champ-person-row:focus-visible {
  outline: 2px solid rgba(47, 143, 131, 0.45);
  background: #ffffff;
}

.champ-pax-overlay {
  position: fixed;
  inset: 0;
  z-index: 58;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(7, 17, 30, 0.68);
}

.champ-pax-card {
  display: grid;
  gap: 14px;
  width: min(760px, 100%);
  border-radius: 8px;
  padding: 18px;
  color: var(--ink);
  background: #ffffff;
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.32);
}

.champ-pax-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.champ-pax-head span {
  color: var(--accent-strong);
  font-weight: 800;
  text-transform: uppercase;
}

.champ-pax-head h4 {
  margin: 4px 0 0;
  font-size: 28px;
}

.champ-pax-head button {
  min-width: 36px;
  min-height: 36px;
  padding: 0;
  background: #1b2a3a;
}

.champ-pax-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 22px;
  align-items: start;
}

.champ-pax-info {
  display: grid;
  gap: 12px;
}

.champ-pax-info p {
  margin: 0;
  color: var(--muted);
}

.champ-pax-info dl {
  display: grid;
  gap: 8px;
  margin: 0;
}

.champ-pax-info dl div {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 10px;
}

.champ-pax-info dt {
  color: var(--muted);
  font-weight: 700;
}

.champ-pax-info dd {
  margin: 0;
  font-weight: 800;
}

.champ-shift-control {
  max-width: 260px;
}

.operations-band {
  padding: 18px;
}

.operations-band p {
  margin: 6px 0 0;
  color: var(--muted);
}

.manifest-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.boat-count {
  display: grid;
  gap: 4px;
  min-width: 210px;
  text-align: right;
}

.boat-count span,
.boat-count small {
  color: var(--muted);
}

.boat-count strong,
.surfer-fixed-count {
  color: var(--accent-strong);
  font-size: 34px;
}

.surfer-fixed-count {
  min-width: 56px;
  text-align: right;
}

.person-chip,
.role-pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border-radius: 6px;
  padding: 0 10px;
  color: #17413d;
  background: #dff3ef;
  font-size: 13px;
  font-weight: 700;
}

.data-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr)) auto;
  gap: 12px;
  align-items: end;
  margin: 16px 0 18px;
}

.writing-layout {
  display: grid;
  grid-template-columns: minmax(320px, 0.85fr) minmax(420px, 1.15fr);
  gap: 12px;
  margin: 16px 0 12px;
}

.writing-panel {
  display: grid;
  align-content: start;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 14px;
}

.writing-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.writing-panel-head span {
  font-size: 22px;
  font-weight: 800;
}

.manifest-date-filter {
  width: min(420px, 42vw);
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.manifest-date-filter input {
  min-height: 44px;
  border-radius: 8px;
  font-size: 16px;
}

.writing-panel-head button.is-active {
  background: var(--blue);
}

#activateBoardingRfid {
  background: var(--danger);
}

#activateBoardingRfid:hover {
  background: #8d2f2f;
}

#activateBoardingRfid.is-rfid-active {
  background: var(--accent);
}

#activateBoardingRfid.is-rfid-active:hover {
  background: var(--accent-strong);
}

.writing-panel-head input {
  min-height: 36px;
  max-width: 150px;
}

.writing-manifest-panel {
  grid-column: 1 / -1;
}

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

.manifest-column {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 8px;
  min-width: 0;
  height: 280px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
  padding: 12px;
  overflow-y: scroll;
  scrollbar-gutter: stable;
}

.manifest-column h3 {
  margin: 0;
  font-size: 18px;
}

.manifest-passenger-panel {
  grid-column: 1 / -1;
}

.landing-panel {
  grid-column: 1 / -1;
  max-width: 760px;
}

.passenger-browser {
  display: grid;
  grid-template-columns: minmax(240px, 0.8fr) minmax(280px, 1.2fr);
  gap: 10px;
}

.writing-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.writing-manifest-list,
.writing-passenger-list {
  display: grid;
  gap: 8px;
  max-height: 260px;
  overflow-y: auto;
}

.manifest-column .writing-manifest-list {
  align-content: start;
  max-height: none;
  overflow: visible;
}

.manifest-passenger-panel .writing-passenger-list {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  max-height: 310px;
}

.writing-manifest-card,
.writing-passenger-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 4px;
  width: 100%;
  min-height: 54px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  padding: 10px;
  color: var(--ink);
  text-align: left;
}

.writing-manifest-card {
  grid-template-columns: 1fr;
}

.writing-passenger-card {
  cursor: pointer;
}

.writing-passenger-card span,
.writing-passenger-card strong {
  display: block;
}

.passenger-edit-button {
  min-height: 30px;
  border-radius: 6px;
  padding: 0 9px;
  background: #1b2a3a;
  font-size: 12px;
}

.passenger-edit-button:hover {
  background: var(--blue);
}

.writing-manifest-card.is-active,
.writing-passenger-card.is-active {
  border-color: var(--accent-strong);
  background: #dff3ef;
}

.writing-profile {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr) 150px;
  align-items: center;
  gap: 14px;
  min-height: 150px;
  border-radius: 8px;
  background: var(--panel-strong);
  padding: 10px;
}

.landing-panel .writing-profile {
  grid-template-columns: 74px minmax(0, 1fr);
  min-height: 94px;
}

.writing-profile-avatar img,
.writing-photo-placeholder {
  width: 74px;
  height: 74px;
  border-radius: 8px;
  object-fit: cover;
  background: #dff3ef;
}

.writing-photo-placeholder {
  display: grid;
  place-items: center;
  color: #17413d;
  font-weight: 800;
}

.identity-photo-panel {
  display: grid;
  gap: 8px;
  justify-items: stretch;
  align-self: stretch;
}

.identity-photo-frame,
.identity-photo-empty {
  display: grid;
  width: 132px;
  aspect-ratio: 1 / 1;
  place-items: center;
  justify-self: end;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  background: #ffffff;
  font-weight: 800;
  overflow: hidden;
}

.identity-photo-frame img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  background: #f6f8f9;
}

.identity-photo-actions {
  display: grid;
  gap: 6px;
}

.identity-photo-actions button,
.identity-upload-button {
  position: relative;
  display: grid;
  min-height: 32px;
  place-items: center;
  border: 0;
  border-radius: 6px;
  padding: 0 8px;
  color: #ffffff;
  background: var(--accent);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  overflow: hidden;
}

.identity-upload-button input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.writing-camera-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(7, 17, 30, 0.72);
}

.writing-camera-modal {
  display: grid;
  gap: 12px;
  width: min(560px, 100%);
  border-radius: 8px;
  padding: 14px;
  color: var(--ink);
  background: #ffffff;
}

.writing-camera-head,
.writing-camera-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.writing-camera-head button {
  min-width: 34px;
  min-height: 34px;
  padding: 0;
  background: #1b2a3a;
}

.writing-camera-modal video {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 8px;
  background: #07111e;
  object-fit: cover;
}

.writing-camera-actions {
  justify-content: flex-end;
}

.writing-camera-actions button:first-child {
  background: var(--danger);
}

.writing-edit-overlay {
  position: fixed;
  inset: 0;
  z-index: 62;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(7, 17, 30, 0.68);
}

.writing-edit-modal {
  display: grid;
  gap: 12px;
  width: min(520px, 100%);
  border-radius: 8px;
  padding: 16px;
  color: var(--ink);
  background: #ffffff;
}

.writing-edit-head,
.writing-edit-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.writing-edit-head button {
  min-width: 34px;
  min-height: 34px;
  padding: 0;
  background: #1b2a3a;
}

.writing-edit-modal form {
  display: grid;
  gap: 10px;
}

.writing-edit-modal input {
  color: var(--ink);
  background: #ffffff;
  caret-color: var(--accent-strong);
}

.writing-edit-actions {
  justify-content: flex-end;
}

.writing-edit-actions button:first-child {
  background: var(--danger);
}

.writing-status {
  min-height: 24px;
  margin: 8px 0 12px;
  color: var(--accent-strong);
  font-weight: 800;
}

.photo-capture input {
  padding: 8px;
}

.table-wrap {
  overflow-x: auto;
  max-height: 520px;
  overflow-y: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

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

th {
  color: var(--muted);
  font-size: 13px;
  text-transform: uppercase;
}

.assignment-list {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.assignment-item {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 14px;
}

.assignment-item strong {
  display: block;
}

.assignment-item input {
  min-height: 38px;
}

.muster-target-band {
  display: grid;
  grid-template-columns: minmax(180px, 0.32fr) minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 10px;
}

.muster-target-band span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.muster-target-band strong {
  display: block;
  margin-top: 3px;
}

.muster-installation-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 42px;
  align-items: center;
}

.muster-installation-tabs button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  border: 1px solid var(--line);
  background: #20323d;
  color: #ffffff;
  font-weight: 800;
}

.muster-installation-tabs button.is-selected {
  background: var(--danger);
  color: white;
}

.muster-installation-tabs button.is-active-site {
  outline: 3px solid rgba(47, 143, 131, 0.4);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.35);
}

.muster-installation-tabs span {
  min-width: 24px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  color: inherit;
  padding: 2px 6px;
  text-align: center;
}

.muster-empty-tabs {
  color: var(--muted);
  font-weight: 800;
}

.muster-layout {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  min-height: calc(100vh - 180px);
}

.muster-counter-stack {
  position: sticky;
  top: 18px;
  display: grid;
  gap: 12px;
}

.muster-counter {
  display: grid;
  min-height: 140px;
  place-items: center;
  padding: 18px;
  text-align: center;
}

.muster-exercise-card {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 14px;
}

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

.muster-exercise-card strong {
  color: var(--accent-strong);
  font-size: 32px;
}

.muster-exercise-card button {
  width: 100%;
}

.muster-counter span {
  color: var(--muted);
  font-weight: 700;
}

.muster-counter strong {
  font-size: 58px;
}

.muster-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  max-height: calc(100vh - 180px);
  padding: 20px;
  overflow: hidden;
}

.muster-panel h3 {
  margin-top: 0;
}

.muster-panel ul {
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 0;
  margin: 0;
  padding: 0 8px 0 0;
  overflow-y: auto;
  list-style: none;
}

.muster-panel li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.7);
  padding: 10px 12px;
}

.muster-panel li strong,
.muster-panel li span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.muster-panel li span {
  color: var(--accent-strong);
  font-weight: 800;
}

.muster-message {
  min-height: 24px;
  color: var(--accent-strong);
  font-weight: 800;
}

.muster-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

#resetMusterButton {
  background: var(--danger);
}

.timeline {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.event-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.event-toolbar button {
  background: var(--panel-strong);
}

.event-toolbar button.is-active {
  background: var(--accent);
}

.anomaly-form {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(180px, 0.8fr) minmax(240px, 1.4fr) auto;
  gap: 8px;
  align-items: end;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 12px;
}

.anomaly-form label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.anomaly-form input,
.anomaly-form select {
  min-height: 38px;
}

.timeline-item.is-clickable {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: border-color 0.18s ease, transform 0.18s ease;
}

.timeline-item.is-clickable:hover,
.timeline-item.is-clickable:focus-visible {
  border-color: var(--accent);
  outline: none;
  transform: translateY(-1px);
}

.timeline-item {
  padding: 16px;
}

.timeline-item-main {
  min-width: 0;
}

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

.timeline-print-button {
  min-height: 34px;
  padding: 0 12px;
  background: #1b2a3a;
  font-size: 13px;
  font-weight: 800;
}

.timeline-print-button:hover {
  background: var(--blue);
}

.anomaly-note {
  display: grid;
  gap: 3px;
  margin-top: 10px;
  border-left: 4px solid var(--danger);
  border-radius: 6px;
  background: rgba(179, 38, 30, 0.08);
  padding: 10px;
}

.anomaly-note span,
.anomaly-note small {
  color: var(--muted);
}

.anomaly-note strong {
  color: var(--danger);
}

.event-report-panel:empty {
  display: none;
}

.exercise-report {
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
  padding: 18px;
}

.exercise-report-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}

.exercise-report-head span,
.exercise-report-head p,
.exercise-report-grid span {
  color: var(--muted);
}

.exercise-report-head h3 {
  margin: 4px 0;
}

.exercise-report-head p {
  margin: 0;
}

.exercise-report-head strong {
  color: var(--accent-strong);
  font-size: 34px;
}

.exercise-report-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 8px;
  max-height: 300px;
  overflow-y: auto;
}

.exercise-site-report-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
}

.exercise-site-report-grid section {
  display: grid;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
  padding: 10px;
}

.exercise-site-report-grid strong {
  color: var(--accent-strong);
}

.exercise-site-report-grid span,
.exercise-site-report-grid small {
  color: var(--muted);
}

.exercise-report h4 {
  margin: 14px 0 6px;
}

.muster-report-actions {
  display: flex;
  justify-content: flex-end;
  margin: 10px 0;
}

.exercise-report-grid div {
  display: grid;
  gap: 3px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  padding: 10px;
}

.exercise-report-grid strong,
.exercise-report-grid span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.paxroom-app {
  display: grid;
  gap: 8px;
  min-height: 720px;
  padding: 10px;
  border-radius: 8px;
  color: #ffffff;
  background: #0b1b2d;
}

.room-workspace {
  display: grid;
  grid-template-areas:
    "settings"
    "plan";
  grid-template-columns: 1fr;
  gap: 10px;
  align-items: stretch;
}

.room-plan-panel {
  grid-area: plan;
  min-width: 0;
}

.room-settings-panel {
  grid-area: settings;
  position: relative;
  display: grid;
  gap: 8px;
  min-width: 0;
  border: 1px solid #1f3954;
  border-radius: 8px;
  background: #07111e;
  padding: 8px;
}

.room-settings-body {
  display: grid;
  grid-template-columns: minmax(220px, 0.9fr) minmax(260px, 0.9fr) minmax(260px, 1fr) minmax(560px, 1.9fr);
  align-content: start;
  align-items: start;
  gap: 8px;
  min-height: 0;
  overflow: visible;
  padding-bottom: 0;
}

.room-settings-close {
  flex: 0 0 auto;
  width: 30px;
  min-width: 30px;
  min-height: 30px;
  border: 1px solid rgba(200, 211, 223, 0.22);
  border-radius: 6px;
  padding: 0;
  background: rgba(27, 42, 58, 0.72);
  color: #c8d3df;
  font-size: 20px;
  line-height: 1;
  opacity: 0.76;
}

.room-settings-close:hover {
  background: rgba(47, 111, 159, 0.82);
  color: #ffffff;
  opacity: 1;
}

@media (max-width: 1450px) {
  .room-settings-body {
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  }
}

.paxroom-app.is-settings-collapsed .room-workspace {
  grid-template-columns: 1fr;
}

.paxroom-app.is-settings-collapsed .room-settings-panel {
  min-height: 46px;
  padding: 6px;
  align-content: center;
}

.paxroom-app.is-settings-collapsed .room-settings-body {
  display: none;
}

.paxroom-app.is-settings-collapsed .room-settings-close {
  width: auto;
  min-height: 32px;
  padding: 0 10px;
  justify-self: start;
  font-size: 13px;
  background: rgba(27, 42, 58, 0.72);
}

.paxroom-app.is-settings-hidden .room-settings-panel {
  display: none;
}

.paxroom-app.is-settings-hidden .room-workspace {
  grid-template-areas: "plan";
}

.room-hero,
.room-camp-bar,
.room-stats,
.cabin-form,
.room-floor-tabs,
.room-toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.room-floor-control {
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.room-floor-control .room-floor-tabs,
.room-floor-control .room-toolbar {
  flex-wrap: wrap;
  min-width: 0;
}

.room-floor-control .room-toolbar {
  overflow-x: visible;
}

.cabin-form {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: minmax(260px, 1fr) minmax(130px, 180px) minmax(90px, 120px) minmax(260px, 1fr);
  margin: 0;
  align-items: end;
  min-width: 0;
}

.cabin-form label {
  font-size: 12px;
  gap: 4px;
  min-width: 0;
}

.room-floor-tabs,
.room-toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.room-hero {
  display: grid;
  grid-template-columns: minmax(300px, auto) minmax(180px, 270px) minmax(0, auto);
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid #1f3954;
  border-radius: 8px;
  background: #07111e;
}

.room-context {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex-wrap: nowrap;
}

.room-status-strip {
  min-height: 32px;
  border-color: #1f3954;
  background: #102033;
  color: #ffffff;
}

.room-hero h3 {
  margin: 0;
  font-size: 20px;
  line-height: 1.1;
}

.room-hero .eyebrow {
  margin-bottom: 3px;
  font-size: 11px;
}

.room-hero .role-pill {
  min-height: 24px;
  margin-top: 5px;
  padding: 0 8px;
  font-size: 12px;
  flex: 0 0 auto;
}

.room-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
}

.room-search-box {
  min-width: 0;
}

.room-search-box input {
  width: 100%;
  max-width: 270px;
  min-height: 36px;
  border-color: #1f3954;
  color: #ffffff;
  background: #102033;
  font-size: 16px;
}

.room-search-box input::placeholder {
  color: #9fb4c4;
}

.room-history-filter {
  margin: 0 0 10px;
  color: #d8e2e7;
  font-weight: 800;
}

.room-history-profile {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.9fr);
  gap: 18px;
  margin-bottom: 12px;
  border: 1px solid #24445f;
  border-radius: 8px;
  padding: 18px;
  color: #ffffff;
  background: #102033;
}

.room-history-profile span {
  color: #9ed8d1;
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}

.room-history-profile h3 {
  margin: 5px 0;
  font-size: 26px;
}

.room-history-profile p {
  margin: 0;
  color: #b7c6cf;
}

.room-history-profile dl {
  display: grid;
  gap: 8px;
  margin: 0;
}

.room-history-profile dl div {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  gap: 10px;
}

.room-history-profile dt {
  color: #8fa5b4;
  font-weight: 800;
}

.room-history-profile dd {
  margin: 0;
  font-weight: 900;
}

.room-history-move {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 14px;
  border: 1px solid #1f3954;
  border-radius: 8px;
  padding: 12px;
  color: #ffffff;
  background: #102033;
}

.room-history-date {
  display: grid;
  align-content: center;
  gap: 4px;
  border-right: 1px solid #24445f;
  color: #9ed8d1;
}

.room-history-date span,
.room-history-move span,
.room-history-move small {
  color: #b7c6cf;
}

.room-history-move p {
  margin: 4px 0;
}

.room-actions button,
.room-floor-tabs button,
.room-camp-list button,
.room-toolbar button {
  min-height: 32px;
  padding: 0 9px;
  background: #1b2a3a;
}

.room-actions button {
  min-width: 0;
  padding: 0 10px;
  font-size: 15px;
}

.room-settings-open {
  display: none;
}

.room-settings-open.is-visible {
  display: inline-flex;
  align-items: center;
}

.room-floor-tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  border-radius: 6px;
  background: #132235;
}

.room-floor-tooltip {
  position: absolute;
  z-index: 14;
  top: calc(100% + 8px);
  left: 50%;
  display: none;
  min-width: 160px;
  transform: translateX(-50%);
  border: 1px solid #24445f;
  border-radius: 8px;
  padding: 10px;
  color: #d8e6ee;
  background: #0b1827;
  box-shadow: 0 16px 35px rgba(0, 0, 0, 0.36);
}

.room-floor-tooltip strong,
.room-floor-tooltip span {
  display: block;
  white-space: nowrap;
}

.room-floor-tooltip strong {
  color: #9ed8d1;
  margin-bottom: 5px;
}

.room-floor-tab:hover .room-floor-tooltip,
.room-floor-tab:focus-within .room-floor-tooltip,
.room-floor-tab.is-hovered .room-floor-tooltip {
  display: block;
}

.room-floor-tab > button[data-room-floor] {
  border-radius: 6px 0 0 6px;
}

.room-floor-tab .room-floor-delete {
  min-width: 30px;
  padding: 0;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0 6px 6px 0;
  color: #d8e2e7;
  background: #172638;
  font-size: 14px;
}

.room-floor-tab .room-floor-delete:hover {
  background: var(--danger);
}

.room-floor-tab .room-floor-delete:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.room-toolbar label {
  display: inline-flex;
  align-items: center;
  width: auto;
  min-width: 58px;
  font-size: 0;
  color: #dce8ee;
}

.room-toolbar input {
  width: 58px;
  min-height: 32px;
}

.room-toolbar .room-muted {
  display: none;
}

.room-actions button.is-active,
.room-floor-tabs button.is-active,
.room-camp-list button.is-active,
.room-toolbar button.is-active {
  background: var(--blue);
}

.room-camp-bar,
.cabin-form {
  padding: 6px;
  border: 1px solid #1f3954;
  border-radius: 8px;
  background: #102033;
}

.room-camp-bar {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-width: 0;
}

.room-camp-bar label,
.room-camp-list {
  grid-column: 1 / -1;
}

.room-camp-bar label,
.cabin-form label {
  color: #dce8ee;
}

.cabin-form label {
  min-width: 0;
}

.room-camp-bar label {
  min-width: 0;
  font-size: 0;
}

.room-camp-bar input {
  font-size: 15px;
}

.room-camp-bar input,
.cabin-form input,
.cabin-form select {
  min-height: 32px;
  padding: 6px 9px;
}

.cabin-form input,
.cabin-form select {
  min-height: 48px;
}

.room-camp-bar button,
.cabin-form button {
  min-height: 32px;
  padding: 0 10px;
}

.cabin-form button[type="submit"] {
  width: 100%;
  min-height: 48px;
  white-space: nowrap;
}

.room-camp-list {
  display: flex;
  gap: 6px;
  flex-wrap: nowrap;
  overflow-x: auto;
}

.camp-token {
  display: inline-flex;
  align-items: center;
}

.camp-token button:first-child {
  border-radius: 6px 0 0 6px;
}

.camp-delete {
  min-width: 30px;
  border-left: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 0 6px 6px 0;
  background: var(--danger) !important;
}

.room-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  min-width: 0;
}

.room-stats div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 38px;
  padding: 6px 10px;
  border: 1px solid #1f3954;
  border-radius: 8px;
  background: #102033;
}

.room-dirty-stat {
  position: relative;
}

.print-cleaning-button {
  min-height: 28px;
  border-radius: 6px;
  padding: 0 8px;
  background: #2ea0ff;
  color: white;
  font-size: 11px;
  font-weight: 800;
}

.print-cleaning-button:disabled {
  opacity: 0.38;
  cursor: not-allowed;
}

.room-stats span {
  display: inline;
  color: #c8d3df;
  font-size: 12px;
}

.room-stats strong {
  display: inline-block;
  margin-top: 0;
  font-size: 22px;
  line-height: 1;
}

.print-area {
  display: none;
}

.event-print-area {
  display: none;
}

.room-content {
  height: min(82vh, 900px);
  min-height: 640px;
  padding: 10px;
  border: 1px solid #1f3954;
  border-radius: 8px;
  background: #07111e;
  overflow: auto;
}

.room-plan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 14px;
}

.room-plan-surface {
  position: relative;
  min-width: 100%;
  min-height: 600px;
  overflow: visible;
  border: 1px solid #1f3954;
  border-radius: 8px;
  background:
    linear-gradient(rgba(46, 160, 255, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(46, 160, 255, 0.08) 1px, transparent 1px),
    #0b1b2d;
  background-size: 40px 40px;
}

.cabin-card {
  position: absolute;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 240px;
  max-width: 520px;
  max-height: 520px;
  padding: 12px;
  border: 2px solid #1f7a3a;
  border-radius: 8px;
  background: #102033;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.28);
  touch-action: none;
  transform-origin: top left;
  overflow: hidden;
}

.cabin-card.is-search-highlight {
  outline: 3px solid #ffd34d;
  box-shadow: 0 0 0 6px rgba(255, 211, 77, 0.22), 0 18px 40px rgba(0, 0, 0, 0.35);
}

.resize-handle {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 20px;
  height: 20px;
  border-left: 2px solid rgba(255, 255, 255, 0.42);
  border-top: 2px solid rgba(255, 255, 255, 0.42);
  border-radius: 6px 0 6px 0;
  cursor: nwse-resize;
  background: rgba(46, 160, 255, 0.34);
}

.resize-handle-inline {
  display: grid;
  min-width: 30px;
  min-height: 30px;
  place-items: center;
  border-radius: 6px;
  color: #ffffff;
  background: #2f6f9f;
  cursor: nwse-resize;
  user-select: none;
}

.cabin-card:not(.is-placeable) .resize-handle {
  display: none;
}

.cabin-card.is-full {
  border-color: #b3261e;
}

.cabin-card.has-dirty {
  border-color: #d08b16;
}

.cabin-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  padding: 4px;
  border-radius: 6px;
}

.cabin-card.is-placeable .cabin-head {
  cursor: grab;
  background: rgba(46, 160, 255, 0.14);
}

.cabin-card.is-placeable .cabin-head:active {
  cursor: grabbing;
}

.cabin-scale-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 4px;
  border-radius: 6px;
  background: rgba(7, 17, 30, 0.48);
}

.cabin-scale-controls button {
  min-height: 30px;
  min-width: 36px;
  padding: 0 7px;
  background: #1b2a3a;
}

.dimension-popover {
  position: fixed;
  z-index: 40;
  display: none;
  padding: 8px 10px;
  border-radius: 6px;
  color: #ffffff;
  background: rgba(7, 17, 30, 0.94);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
  font-weight: 800;
  pointer-events: none;
}

.dimension-popover.is-visible {
  display: block;
}

.cabin-scale-controls span {
  color: #c8d3df;
  font-size: 12px;
  font-weight: 700;
}

.cabin-head strong {
  font-size: 18px;
}

.cabin-head span,
.room-muted {
  color: #c8d3df;
  font-size: 13px;
}

.bed-list {
  display: grid;
  flex: 1 1 auto;
  align-content: start;
  gap: 7px;
  min-height: 0;
  overflow-y: scroll;
  scrollbar-gutter: stable;
  padding-right: 8px;
}

.cabin-card > button[data-room-action="edit-cabin"] {
  flex: 0 0 auto;
}

.bed-list::-webkit-scrollbar {
  width: 12px;
}

.bed-list::-webkit-scrollbar-track {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
}

.bed-list::-webkit-scrollbar-thumb {
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  background: #c8d3df;
}

.bed-list::-webkit-scrollbar-thumb:hover {
  background: #ffffff;
}

.bed-row {
  display: grid;
  gap: 6px;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 6px;
  color: #ffffff;
}

.bed-row.free {
  background: #1f7a3a;
}

.bed-row.occupied {
  background: #b3261e;
}

.bed-row.occupied[data-room-pax-card] {
  cursor: pointer;
}

.bed-row.occupied[data-room-pax-card]:hover,
.bed-row.occupied[data-room-pax-card]:focus-visible {
  outline: 2px solid #ffffff;
  box-shadow: 0 0 0 4px rgba(179, 38, 30, 0.35);
}

.bed-row.dirty {
  background: #d08b16;
}

.bed-row.reserved {
  background: #2ea0ff;
}

.bed-row.blocked {
  background: #4b5563;
}

.bed-row strong,
.bed-row span {
  overflow-wrap: anywhere;
}

.bed-controls {
  display: flex;
  gap: 6px;
  flex-wrap: nowrap;
  min-width: 0;
}

.bed-controls button {
  min-height: 32px;
  flex: 1 1 0;
  min-width: 0;
  padding: 0 6px;
  background: rgba(7, 17, 30, 0.72);
  font-size: 11px;
  white-space: nowrap;
}

.room-list,
.room-history {
  display: grid;
  gap: 10px;
}

.room-cleaning-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  border: 1px solid #1f3954;
  border-radius: 8px;
  padding: 14px;
  color: #ffffff;
  background: #102033;
}

.room-cleaning-head span {
  display: block;
  color: #9ed8d1;
  font-weight: 900;
  text-transform: uppercase;
}

.room-cleaning-head strong {
  font-size: 24px;
}

.room-cleaning-head button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.room-list-item {
  padding: 12px;
  border: 1px solid #1f3954;
  border-radius: 8px;
  background: #102033;
}

.room-dialog {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(7, 17, 30, 0.72);
}

.room-modal {
  width: min(560px, 100%);
  max-height: 88vh;
  overflow-y: auto;
  padding: 18px;
  border: 2px solid #2ea0ff;
  border-radius: 8px;
  color: var(--ink);
  background: #ffffff;
}

.room-modal h3 {
  margin-top: 0;
}

.room-error {
  min-height: 20px;
  margin: 0 0 10px;
  color: var(--danger);
  font-weight: 800;
}

.room-modal form,
.room-modal .modal-actions {
  display: grid;
  gap: 10px;
}

.term-editor {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px;
  align-items: center;
}

.term-editor button {
  min-height: 36px;
  padding: 0 10px;
}

.room-modal .modal-actions {
  grid-template-columns: 1fr 1fr;
  margin-top: 12px;
}

.room-modal .modal-actions button:first-child,
.danger-button {
  background: var(--danger);
}

.switch-pick {
  border-color: #2ea0ff;
}

.room-switch-board {
  width: min(920px, calc(100% - 32px));
  margin: 54px auto;
  border: 1px solid #24445f;
  border-radius: 8px;
  overflow: hidden;
  color: #ffffff;
  background: #0d1b2b;
  box-shadow: 0 22px 55px rgba(0, 0, 0, 0.28);
}

.room-switch-title {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  align-items: center;
  color: #ffffff;
  background: #132841;
}

.room-switch-title span {
  display: grid;
  min-height: 78px;
  place-items: center;
  border-right: 1px solid #24445f;
  color: #9ed8d1;
  font-weight: 900;
  text-transform: uppercase;
}

.room-switch-title strong {
  padding: 0 24px;
  font-size: 24px;
  text-align: center;
}

.room-switch-table {
  display: grid;
  grid-template-columns: 1fr 1.25fr 1fr;
  border-top: 1px solid #24445f;
}

.room-switch-cell {
  position: relative;
  min-height: 62px;
  border-right: 1px solid #24445f;
  border-bottom: 1px solid #24445f;
  padding: 10px;
  background: #102033;
}

.room-switch-cell:nth-child(3n) {
  border-right: 0;
}

.room-switch-head {
  display: grid;
  place-items: center;
  color: #d8e6ee;
  background: #162c44;
  font-weight: 900;
}

.room-switch-cell input {
  height: 100%;
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 4px;
  color: #ffffff;
  background: #0b1827;
  font-weight: 800;
  text-align: center;
}

.room-switch-cell input:focus {
  border-color: #2ea0ff;
  outline: none;
  background: #10243a;
}

.room-switch-suggestions {
  position: absolute;
  z-index: 6;
  top: calc(100% - 6px);
  left: 10px;
  right: 10px;
  display: none;
  max-height: 220px;
  overflow-y: auto;
  border: 1px solid #24445f;
  border-radius: 6px;
  background: #0b1827;
  box-shadow: 0 16px 35px rgba(0, 0, 0, 0.3);
}

.room-switch-suggestions.is-visible {
  display: grid;
}

.room-switch-suggestions button {
  min-height: 34px;
  border-radius: 0;
  padding: 7px 10px;
  color: #ffffff;
  background: transparent;
  text-align: left;
  font-size: 13px;
}

.room-switch-suggestions button:hover {
  background: #17314d;
}

.room-switch-room {
  display: grid;
  place-items: center;
  color: #8fa5b4;
  font-weight: 900;
  text-align: center;
}

.room-switch-room.is-found {
  color: #9ed8d1;
}

.room-switch-message {
  margin: 0;
  padding: 12px 18px;
  color: #b7c6cf;
  background: #0b1827;
  font-weight: 700;
}

.room-switch-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 18px 18px;
}

.room-switch-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }

  .app-shell[data-active-view="room"] .sidebar::before,
  .app-shell[data-active-view="champ"] .sidebar::before,
  .app-shell[data-active-view="writing"] .sidebar::before,
  .app-shell[data-active-view="muster"] .sidebar::before {
    position: absolute;
    width: 100%;
    height: 100%;
  }

  .sidebar-scroll-content {
    min-height: auto;
    transform: none;
  }

  .topbar {
    align-items: stretch;
    flex-wrap: wrap;
  }

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

  .metrics-grid,
  .platform-grid,
  .surfer-grid,
  .champ-people-list,
  .exercise-report-grid,
  .anomaly-form,
  .muster-target-band,
  .room-stats,
  .data-form,
  .writing-layout,
  .manifest-chooser,
  .passenger-browser,
  .writing-panel-head,
  .event-toolbar,
  .room-camp-bar,
  .cabin-form,
  .muster-layout {
    grid-template-columns: 1fr;
  }

  .champ-search-box {
    width: 100%;
    min-width: min(320px, 100%);
  }

  .manifest-date-filter {
    width: 100%;
    margin-left: 0;
  }

  .room-actions,
  .room-toolbar,
  .room-floor-tabs {
    flex-wrap: wrap;
  }

  .room-content {
    min-height: 560px;
  }

  .muster-counter-stack {
    position: static;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .assignment-item {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .workspace,
  .sidebar,
  .login-panel {
    padding: 18px;
  }

  .topbar,
  .section-heading,
  .operations-band,
  .surfer-card,
  .room-hero {
    align-items: stretch;
    flex-direction: column;
  }

  .champ-search-box {
    width: 100%;
    min-width: 0;
  }

  .main-nav {
    grid-template-columns: 1fr;
  }

  .metrics-grid,
  .muster-counter-stack,
  .room-stats {
    grid-template-columns: 1fr;
  }

  .status-strip,
  .room-actions button,
  .event-toolbar button {
    width: 100%;
  }

  .room-content {
    height: 72vh;
    min-height: 420px;
  }

  .room-modal {
    width: min(100%, 520px);
  }

  .manifest-list {
    justify-content: flex-start;
  }
}

@media print {
  body * {
    visibility: hidden;
  }

  #printArea,
  #printArea *,
  #eventPrintArea,
  #eventPrintArea * {
    visibility: visible;
  }

  #printArea,
  #eventPrintArea {
    display: block;
    position: absolute;
    inset: 0;
    padding: 18mm;
    color: #000;
    background: #fff;
  }

  .print-cleaning-list h1 {
    margin: 0 0 6mm;
    font-size: 20pt;
  }

  .print-cleaning-list p {
    margin: 0 0 6mm;
    font-size: 10pt;
  }

  .print-cleaning-list table {
    width: 100%;
    border-collapse: collapse;
    font-size: 10pt;
  }

  .print-cleaning-list th,
  .print-cleaning-list td {
    border: 1px solid #222;
    padding: 5px 7px;
    text-align: left;
  }

  .print-cleaning-list th {
    background: #e8eef3;
  }

  .event-print-document h1 {
    margin: 0 0 6mm;
    font-size: 20pt;
  }

  .event-print-document p {
    margin: 0 0 6mm;
    font-size: 10pt;
  }

  .event-print-document table {
    width: 100%;
    border-collapse: collapse;
    font-size: 9pt;
  }

  .event-print-document th,
  .event-print-document td {
    border: 1px solid #222;
    padding: 5px 7px;
    text-align: left;
    vertical-align: top;
  }

  .event-print-document th {
    background: #e8eef3;
  }

  .print-signature {
    margin-top: 12mm;
  }
}
