:root {
  color-scheme: light;
  /* Delta Hotels navy (#2a3692), taken from the brand wordmark. */
  --color-bg: #f2f4f8;
  --color-surface: #ffffff;
  --color-surface-sunken: rgba(255, 255, 255, 0.55);
  --color-primary: #2a3692;
  --color-primary-dark: #1f2971;
  --color-primary-text: #2a3692;
  --color-on-primary: #ffffff;
  --color-text: #1a1c26;
  --color-muted: #5b5f6d;
  --color-error: #b3261e;
  --color-border: #d2d6e2;
  --color-border-soft: #e1e4ee;
  --color-divider: #ebeef4;
  --color-warn-bg: #fdf1de;
  --color-warn-border: #e3ac3f;
  --color-warn-text: #8a5a00;
  --color-warn-text-soft: #6b4a12;
  --color-accent-bg: #ebedf8;
  --color-ok-bg: #e6f4ea;
  --color-ok-text: #1e7a34;
  --color-allergy-bg: #fbe9e7;

  --color-phase-setup: #d98f2b;
  --color-phase-strip: #3f8fa0;
  --color-neutral-bg: #ebedf2;
  --color-neutral-text: #5b5f6d;
  --color-inactive: #c5c9d6;
  --overlay-on-primary: rgba(255, 255, 255, 0.15);
  --shadow-card: 0 1px 2px rgba(42, 54, 146, 0.05), 0 6px 16px rgba(42, 54, 146, 0.08);
  --shadow-raised: 0 2px 4px rgba(42, 54, 146, 0.07), 0 14px 34px rgba(42, 54, 146, 0.14);
  --shadow-block: 0 1px 3px rgba(42, 54, 146, 0.07), 0 4px 14px rgba(42, 54, 146, 0.09);
  --shadow-fab: 0 6px 18px rgba(42, 54, 146, 0.4);
  --shadow-fab-secondary: 0 4px 12px rgba(0, 0, 0, 0.15);
  --radius: 14px;
  --tap-min: 56px;
  --content-max: 640px;
  --content-wide: 640px;
  --content-full: 640px;

  --page-width: var(--content-max);

  --rail-w: 0px;
  --tabbar-h: 0px;

  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
}

body.page-wide { --page-width: var(--content-wide); }
body.page-full { --page-width: var(--content-full); }

@media (max-width: 760px) {
  :root { --tabbar-h: 62px; }
}

@media (min-width: 1024px) {
  :root {
    --rail-w: 248px;
    --content-max: 780px;
    --content-wide: 1180px;
    --content-full: 1800px;
  }

  :root[data-rail="collapsed"] { --rail-w: 64px; }
}

@media (min-width: 1500px) {
  :root { --content-wide: 1360px; }
}

@media (min-width: 700px) and (max-width: 1023px) {
  :root {
    --content-wide: 900px;
    --content-full: 1400px;
  }
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --color-bg: #13151f;
    --color-surface: #1b1e2c;
    --color-surface-sunken: #171926;
    --color-primary: #4c5fc7;
    --color-primary-dark: #39469e;
    --color-primary-text: #8fa0ff;
    --color-on-primary: #ffffff;
    --color-text: #e8e9ef;
    --color-muted: #a4a7ba;
    --color-error: #ff7b6e;
    --color-border: #383d52;
    --color-border-soft: #2f3448;
    --color-divider: #272b3c;
    --color-warn-bg: #3a2f18;
    --color-warn-border: #8a6a24;
    --color-warn-text: #f0c778;
    --color-warn-text-soft: #d9b878;
    --color-accent-bg: #232840;
    --color-ok-bg: #1d3324;
    --color-ok-text: #74c98d;
    --color-allergy-bg: #3b201e;
    --color-neutral-bg: #282c3c;
    --color-neutral-text: #9a9db0;
    --color-inactive: #454a5f;
    --overlay-on-primary: rgba(255, 255, 255, 0.16);
    --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.35), 0 6px 16px rgba(0, 0, 0, 0.4);
    --shadow-raised: 0 2px 4px rgba(0, 0, 0, 0.4), 0 14px 34px rgba(0, 0, 0, 0.5);
    --shadow-block: 0 1px 3px rgba(0, 0, 0, 0.4), 0 4px 14px rgba(0, 0, 0, 0.45);
    --shadow-fab: 0 6px 18px rgba(0, 0, 0, 0.6);
    --shadow-fab-secondary: 0 4px 12px rgba(0, 0, 0, 0.5);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --color-bg: #13151f;
  --color-surface: #1b1e2c;
  --color-surface-sunken: #171926;
  --color-primary: #4c5fc7;
  --color-primary-dark: #39469e;
  --color-primary-text: #8fa0ff;
  --color-on-primary: #ffffff;
  --color-text: #e8e9ef;
  --color-muted: #a4a7ba;
  --color-error: #ff7b6e;
  --color-border: #383d52;
  --color-border-soft: #2f3448;
  --color-divider: #272b3c;
  --color-warn-bg: #3a2f18;
  --color-warn-border: #8a6a24;
  --color-warn-text: #f0c778;
  --color-warn-text-soft: #d9b878;
  --color-accent-bg: #232840;
  --color-ok-bg: #1d3324;
  --color-ok-text: #74c98d;
  --color-allergy-bg: #3b201e;
  --color-neutral-bg: #282c3c;
  --color-neutral-text: #9a9db0;
  --color-inactive: #454a5f;
  --overlay-on-primary: rgba(255, 255, 255, 0.16);
  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.35), 0 6px 16px rgba(0, 0, 0, 0.4);
  --shadow-raised: 0 2px 4px rgba(0, 0, 0, 0.4), 0 14px 34px rgba(0, 0, 0, 0.5);
  --shadow-block: 0 1px 3px rgba(0, 0, 0, 0.4), 0 4px 14px rgba(0, 0, 0, 0.45);
  --shadow-fab: 0 6px 18px rgba(0, 0, 0, 0.6);
  --shadow-fab-secondary: 0 4px 12px rgba(0, 0, 0, 0.5);
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  touch-action: manipulation;
}

body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI Variable Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 18px;
  line-height: 1.4;
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

.screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.card {
  width: 100%;
  max-width: 420px;
  background: var(--color-surface);
  border: 1px solid var(--color-border-soft);
  border-radius: var(--radius);
  box-shadow: var(--shadow-raised);
  padding: 36px 28px;
}

.brand {
  text-align: center;
  margin-bottom: 24px;
}

.brand img {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  box-shadow: var(--shadow-raised);
}

.brand h1 {
  font-size: 23px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 16px 0 0;
  color: var(--color-primary-text);
}

label {
  display: block;
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
  margin-top: 20px;
}

label:first-of-type {
  margin-top: 0;
}

input[type="text"],
input[type="search"],
input[type="password"],
input[type="date"],
input[type="time"],
input[type="number"] {
  width: 100%;
  min-height: var(--tap-min);
  font-size: 17px;
  padding: 12px 16px;
  border: 2px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-bg);
  color: var(--color-text);
  transition: border-color 0.15s ease;
}

.password-field { position: relative; display: block; }
.password-field > input { padding-right: 54px; }
.password-reveal {
  position: absolute; top: 50%; right: 6px; transform: translateY(-50%);
  display: flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; min-height: 0; margin: 0; padding: 0;
  background: none; border: none; border-radius: 10px; color: var(--color-muted); cursor: pointer;
}
.password-reveal:hover, .password-reveal:focus-visible { color: var(--color-primary-text); background: var(--color-accent-bg); }
.password-reveal:active { transform: translateY(-50%); }

input[type="file"] {
  width: 100%;
  min-height: var(--tap-min);
  font-size: 15px;
  padding: 12px 12px;
  border: 2px dashed var(--color-border);
  border-radius: var(--radius);
  background: var(--color-bg);
  color: var(--color-text);
}

input:focus {
  outline: 3px solid var(--color-primary-text);
  outline-offset: 1px;
}

button:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--color-primary-text);
  outline-offset: 2px;
}
.top-bar button:focus-visible,
.top-bar a:focus-visible {
  outline: 3px solid var(--color-on-primary);
  outline-offset: 2px;
}

button, .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: var(--tap-min);
  font-size: 20px;
  font-weight: 700;
  border: none;
  border-radius: var(--radius);
  background: var(--color-primary);
  color: var(--color-on-primary);
  cursor: pointer;
  margin-top: 28px;
  padding: 12px 16px;
  transition: background-color 0.15s ease, transform 0.08s ease;
}

button:active, .btn:active {
  background: var(--color-primary-dark);
  transform: scale(0.985);
}

button:disabled, .btn:disabled {
  opacity: 0.6;
  cursor: default;
}

button.secondary {
  background: transparent;
  color: var(--color-primary-text);
  border: 2px solid var(--color-primary-text);
  margin-top: 16px;
}

.error {
  color: var(--color-error);
  font-weight: 600;
  margin-top: 16px;
  min-height: 24px;
}
.error:empty { margin: 0; min-height: 0; }

.success {
  color: var(--color-primary-text);
  font-weight: 600;
  margin-top: 16px;
}

.top-bar {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: var(--color-primary);
  color: var(--color-on-primary);
}

.top-bar h1 {
  font-size: 18px;
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* On a phone the icons leave a booking's name a hundred pixels: two lines of it beat "Congrès an…". */
@media (max-width: 600px) {
  .top-bar h1 {
    white-space: normal; line-height: 1.2; overflow-wrap: anywhere;
    display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2;
  }
}

.top-bar button {
  width: auto;
  min-height: 44px;
  margin: 0;
  background: var(--overlay-on-primary);
  padding: 8px 16px;
  font-size: 16px;
}

.top-bar-right {
  display: flex; align-items: center; gap: 6px; flex-shrink: 0;
}

#top-nav {
  display: flex; align-items: center; gap: 6px; flex-shrink: 0;
}

/* Print and Edit say so beside their icon wherever there's room; on a phone the icon stays alone. */
.top-bar .top-action {
  width: auto; min-width: 34px; padding: 0 12px 0 9px; gap: 6px;
  font-size: 14px; font-weight: 700; text-decoration: none; white-space: nowrap;
}
@media (max-width: 760px) {
  .top-bar .top-action { padding: 0; width: 34px; }
  .top-action-label { display: none; }
}

#batch-progress {
  font-size: 13px; font-weight: 700; opacity: 0.85;
}

.drive {
  max-width: var(--content-wide); display: grid; grid-template-columns: 232px minmax(0, 1fr); gap: 24px; align-items: start;
}
.drive-side { display: flex; flex-direction: column; gap: 14px; position: sticky; top: 76px; }
.drive-new {
  display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; margin: 0; padding: 0 20px;
  border: 0; border-radius: 999px; background: var(--color-primary); color: var(--color-on-primary);
  font-size: 15px; font-weight: 700; cursor: pointer; box-shadow: var(--shadow-card);
}
.drive-new:hover { background: var(--color-primary-dark); }
.drive-folders { display: flex; flex-direction: column; gap: 2px; }
.drive-folder {
  display: flex; align-items: center; justify-content: flex-start; gap: 12px; width: 100%; min-height: 44px; margin: 0; padding: 0 14px; border: 0;
  border-radius: 999px; background: transparent; color: var(--color-text); font-size: 14px; font-weight: 600; text-align: left; cursor: pointer;
}
.drive-folder:hover { background: var(--color-accent-bg); }
.drive-folder.is-active { background: var(--color-accent-bg); color: var(--color-primary-text); font-weight: 700; }
.drive-ico { display: flex; flex-shrink: 0; }
.drive-main {
  position: relative; min-height: 420px; background: var(--color-surface); border-radius: var(--radius);
  box-shadow: var(--shadow-card); padding: 20px 8px 12px;
}
.drive-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 16px 14px; flex-wrap: wrap; }
.drive-head h2 { margin: 0; font-size: 22px; }
.drive-head .muted-note { margin: 4px 0 0; }
.drive-search {
  width: 260px; max-width: 100%; min-height: 40px; padding: 0 16px; border: 1px solid var(--color-border);
  border-radius: 999px; background: var(--color-bg); color: var(--color-text); font-size: 14px;
}
.drive-progress {
  display: flex; flex-direction: column; gap: 8px; margin: 0 16px 12px; padding: 12px 16px; border-radius: 12px;
  background: var(--color-accent-bg); font-size: 14px;
}
.drive-progress.is-error { background: var(--color-allergy-bg); color: var(--color-error); }
.drive-bar { height: 6px; border-radius: 999px; background: var(--color-border); overflow: hidden; }
.drive-bar-fill { display: block; height: 100%; width: 0; background: var(--color-primary); transition: width 0.15s ease; }
.drive-row {
  display: grid; grid-template-columns: minmax(0, 1fr) 150px 170px 80px 96px; align-items: center; gap: 12px;
  min-height: 56px; padding: 6px 16px; border-top: 1px solid var(--color-divider);
}
.drive-row:not(.drive-row-head):hover { background: var(--color-accent-bg); }
.drive-row-head {
  min-height: 36px; border-top: 0; border-bottom: 1px solid var(--color-border); color: var(--color-muted);
  font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
}
.drive-cell { color: var(--color-muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drive-size { text-align: right; }
.drive-main-cell { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.drive-name { display: flex; align-items: center; gap: 12px; min-width: 0; color: var(--color-text) !important; text-decoration: none; font-weight: 600; }
.drive-name:hover .drive-name-text { text-decoration: underline; }
.drive-name-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drive-meta { display: none; color: var(--color-muted); font-size: 12px; padding-left: 48px; }
.drive-tile {
  flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px;
  border-radius: 8px; color: #fff; font-size: 10px; font-weight: 800; letter-spacing: 0.02em; background: #6b7280;
}
.drive-tile-pdf { background: #d93025; }
.drive-tile-img { background: #a142f4; }
.drive-tile-doc { background: #1a73e8; }
.drive-tile-sheet { background: #188038; }
.drive-tile-slide { background: #e37400; }
.drive-tile-zip { background: #8a6d3b; }
.drive-tile-web { background: #0b8a8a; }
.drive-tile-media { background: #d01884; }
.drive-acts { display: flex; justify-content: flex-end; gap: 2px; }
.drive-act svg, .drive-ico svg { width: 22px; height: 22px; flex-shrink: 0; }
.drive-act {
  display: inline-flex; align-items: center; justify-content: center; flex: 0 0 44px; width: 44px; height: 44px; min-height: 0; padding: 0; margin: 0; border: 0;
  border-radius: 50%; background: transparent; color: var(--color-muted); cursor: pointer;
}
.drive-act:hover { background: var(--color-border-soft); color: var(--color-primary-text); }
.drive-act.is-danger:hover { color: var(--color-error); }
.drive-empty {
  display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 64px 16px; text-align: center;
  color: var(--color-muted);
}
.drive-empty strong { color: var(--color-text); font-size: 17px; }
.drive-empty-art { color: var(--color-inactive); }
.drive-limit { padding: 12px 16px 0; margin: 0; font-size: 12px; }
.drive-drop {
  position: absolute; inset: 0; z-index: 5; display: flex; align-items: center; justify-content: center; pointer-events: none;
  border: 3px dashed var(--color-primary); border-radius: var(--radius); background: var(--color-accent-bg); opacity: 0.94;
  color: var(--color-primary-text); font-size: 20px; font-weight: 800;
}
@media (max-width: 900px) {
  .drive { grid-template-columns: minmax(0, 1fr); gap: 14px; width: 100%; }
  .drive > * { min-width: 0; max-width: 100%; }
  .drive-side { position: static; flex-direction: row; align-items: center; flex-wrap: wrap; }
  .drive-new { flex: 1 1 100%; }
  .drive-folders {
    flex-direction: row; overflow-x: auto; flex: 1 1 100%; min-width: 0; gap: 8px;
    padding: 2px 2px 8px; scrollbar-width: none;
  }
  .drive-folders::-webkit-scrollbar { display: none; }
  .drive-folder { flex: 0 0 auto; width: auto; white-space: nowrap; background: var(--color-surface); box-shadow: var(--shadow-card); }
  .drive-row { grid-template-columns: minmax(0, 1fr) auto; }
  .drive-row-head, .drive-cell { display: none; }
  .drive-meta { display: block; }
  .drive-search { width: 100%; }
}

.pill-btn {
  min-height: 40px !important; padding: 6px 14px !important; font-size: 14px !important;
  font-weight: 700; border-radius: 999px;
}

main {
  width: 100%;
  max-width: var(--page-width);
  margin: 0 auto;
  padding: 24px;
}

.hidden {
  display: none !important;
}

.review-banner {
  /* Lined up with the content below it, and never touching the screen's edges on a phone. */
  display: block; width: calc(100% - 40px); max-width: calc(var(--page-width) - 40px);
  margin: 16px auto 0; padding: 14px 20px;
  background: var(--color-warn-bg); border: 2px solid var(--color-warn-border); color: var(--color-warn-text);
  border-radius: var(--radius); font-size: 14px; font-weight: 700; text-decoration: none;
}

.review-banner.is-urgent {
  background: var(--color-allergy-bg); border-color: var(--color-error);
  color: var(--color-error);
}
.urgency-badge {
  display: inline-block; margin-left: 6px; padding: 2px 8px;
  border-radius: 999px; font-size: 11px; font-weight: 700;
}
.urgency-imminent { background: var(--color-error); color: #ffffff; }
.urgency-past { background: var(--color-neutral-bg); color: var(--color-neutral-text); }
.queue-card.is-urgent { border: 2px solid var(--color-error); }

.week-nav {
  display: flex; align-items: center; gap: 4px; padding: 16px 8px 4px;
  max-width: var(--page-width); margin: 0 auto;
}
.week-nav-btn {
  flex-shrink: 0; width: 40px; height: 40px; min-height: 0; margin-top: 0;
  border-radius: 50%; background: var(--color-surface); border: 2px solid var(--color-border-soft);
  color: var(--color-primary-text); display: flex; align-items: center; justify-content: center;
  padding: 0;
}

.week-nav-btn.selected {
  background: var(--color-primary); border-color: var(--color-primary); color: var(--color-on-primary);
}
.days {
  display: flex; gap: 8px; padding: 0 4px; overflow-x: auto; flex: 1;
  justify-content: space-between;
}

.days.days-scrollable {
  mask-image: linear-gradient(to right, black calc(100% - 16px), transparent);
  -webkit-mask-image: linear-gradient(to right, black calc(100% - 16px), transparent);
}
.daychip {
  flex-shrink: 0; width: 46px; min-height: 0; margin: 0; padding: 8px 0; border-radius: 12px;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  background: var(--color-surface); border: 2px solid var(--color-border-soft); cursor: pointer;
  color: var(--color-text); font: inherit;
  text-decoration: none;
}
.daychip:active { background: var(--color-accent-bg); }
.daychip .dow { font-size: 11px; color: var(--color-muted); font-weight: 600; text-transform: uppercase; }
.daychip .num { font-size: 16px; font-weight: 700; color: var(--color-text); }
.daychip .load { font-size: 11px; font-weight: 700; line-height: 12px; min-height: 12px; color: var(--color-muted); }
.daychip.has-events .load { color: var(--color-primary-text); }
.daychip.today:not(.selected) { border-color: var(--color-primary-text); }
.daychip.today:not(.selected) .num { color: var(--color-primary-text); }
.daychip.selected { background: var(--color-primary); border-color: var(--color-primary); }
.daychip.selected .dow, .daychip.selected .num { color: var(--color-on-primary); }

.heading-row {
  display: flex; align-items: baseline; justify-content: space-between;
  padding: 14px 20px 6px; max-width: var(--page-width); margin: 0 auto;
}
.heading-row h2 { margin: 0; font-size: 19px; color: var(--color-text); }
.heading-row h2::first-letter { text-transform: uppercase; }
.heading-row .count { font-size: 13px; color: var(--color-muted); font-weight: 600; }
.heading-row-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
/* The floor plan's two outward links wrap as a pair, not one per line. */
.heading-row-links { display: flex; align-items: center; gap: 10px; }
.today-btn {
  width: auto; margin: 0; background: var(--color-surface); color: var(--color-primary-text);
  border: 2px solid var(--color-primary-text);
}

.bulk-delete-btn {
  width: auto; margin: 0; background: var(--color-surface); color: var(--color-error);
  border: 2px solid var(--color-error);
}

.calendar-main {
  max-width: var(--page-width); margin: 0 auto; padding: 8px 20px 100px;
}

.empty-state {
  color: var(--color-muted); font-size: 15px; text-align: center; padding: 40px 0;
}
.gone-state, .detail-main.is-grid.is-packed > .gone-state { max-width: 420px; margin: 24px auto; }
.gone-state .btn-secondary-full { display: block; margin-top: 16px; text-decoration: none; text-align: center; }

.view-toggle {
  display: flex; gap: 6px; max-width: var(--page-width); margin: 12px auto 0; padding: 0 20px;
}
.view-toggle-btn {
  flex: 1; min-height: 40px; margin: 0; font-size: 14px; font-weight: 700;
  background: var(--color-surface); color: var(--color-primary-text);
  border: 2px solid var(--color-border-soft); border-radius: 999px; padding: 8px 12px;
}
.page-tabs { overflow-x: auto; scrollbar-width: none; }
.page-tabs::-webkit-scrollbar { display: none; }
.page-tabs.fade-end { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 36px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 36px), transparent); }
.page-tabs.fade-start { -webkit-mask-image: linear-gradient(to left, #000 calc(100% - 36px), transparent); mask-image: linear-gradient(to left, #000 calc(100% - 36px), transparent); }
.page-tabs.fade-start.fade-end {
  -webkit-mask-image: linear-gradient(to right, transparent, #000 36px, #000 calc(100% - 36px), transparent);
  mask-image: linear-gradient(to right, transparent, #000 36px, #000 calc(100% - 36px), transparent);
}
.page-tabs .view-toggle-btn { flex: 1 0 auto; white-space: nowrap; }
@media (min-width: 761px) {
  .page-tabs { max-width: var(--content-max); }
  .page-tabs .view-toggle-btn { flex: 1 1 0; }
}
.view-toggle-btn.selected {
  background: var(--color-primary); color: var(--color-on-primary); border-color: var(--color-primary);
}

a.view-toggle-btn {
  display: flex; align-items: center; justify-content: center; text-decoration: none;
}

.week-groups { display: flex; flex-direction: column; }
.week-day-group {
  background: var(--color-surface); border-radius: var(--radius); padding: 14px 16px;
  box-shadow: var(--shadow-card); margin-bottom: 12px; scroll-margin-top: 84px;
}
.week-day-header {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  font-weight: 700; font-size: 15px; margin-bottom: 8px;
  color: inherit; text-decoration: none;
}
.week-day-name { display: inline-flex; align-items: baseline; flex-wrap: wrap; gap: 0 6px; font: inherit; color: inherit; }
button.week-day-toggle {
  background: none; border: 0; padding: 4px 0; margin: 0; min-height: 0; width: auto;
  cursor: pointer; text-align: left; box-shadow: none;
}
button.week-day-toggle::before {
  content: "›"; display: inline-block; margin-right: 2px; font-weight: 800; transition: transform 0.15s;
}
button.week-day-toggle[aria-expanded="true"]::before { transform: rotate(90deg); }
.today-tag { background: var(--color-primary); color: var(--color-on-primary); }
.week-day-work { margin: 0 0 6px; font-size: 13px; font-weight: 700; color: var(--color-primary-text); }
.week-day-group.is-today { border-left: 5px solid var(--color-primary-text); }
.week-day-group.is-collapsed { padding: 10px 16px; box-shadow: none; background: var(--color-surface-sunken); }
.week-day-group.is-collapsed .week-day-header { margin-bottom: 0; font-weight: 600; color: var(--color-muted); }
.week-day-group.is-collapsed .week-row, .week-day-group.is-collapsed .week-day-work { display: none; }
.week-work {
  display: flex; flex-wrap: wrap; gap: 8px; padding: 2px 20px 8px;
  max-width: var(--page-width); margin: 0 auto;
}
.week-work-tile { display: inline-flex; align-items: baseline; gap: 6px; padding: 6px 12px; border-radius: 10px; font-size: 13px; font-weight: 700; }
.week-work-tile strong { font-size: 18px; }
.week-day-plan {
  flex-shrink: 0; font-size: 13px; font-weight: 700; white-space: nowrap;
  color: var(--color-primary-text); text-decoration: none; padding: 4px 0;
}
.week-day-plan:hover { text-decoration: underline; }
.week-day-group.is-flashed { animation: day-flash 1.4s ease-out; }
@keyframes day-flash {
  0% { box-shadow: 0 0 0 3px var(--color-primary-text); }
  100% { box-shadow: var(--shadow-card); }
}
@media (prefers-reduced-motion: reduce) {
  .week-day-group.is-flashed { animation: none; }
}
.week-day-count { font-size: 12px; font-weight: 600; color: var(--color-muted); text-transform: none; }
.week-day-empty { font-size: 13px; color: var(--color-muted); margin: 0; }

.week-day-group.is-empty { padding: 10px 16px; box-shadow: none; background: var(--color-surface-sunken); }
.week-day-group.is-empty .week-day-header { margin-bottom: 0; font-weight: 600; color: var(--color-muted); }
.week-row {
  display: flex; align-items: center; gap: 10px; padding: 8px 0;
  text-decoration: none; color: inherit; border-top: 1px solid var(--color-divider);
}
.week-row:first-of-type { border-top: none; }
.week-row-time { display: flex; flex-direction: column; font-size: 13px; font-weight: 700; color: var(--color-primary-text); flex-shrink: 0; width: 56px; }
.week-row-end { font-size: 12px; font-weight: 600; color: var(--color-muted); }
.week-row-body { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
.week-row-title {
  font-size: 14px; font-weight: 700; color: var(--color-text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.week-row-sub { font-size: 12px; color: var(--color-muted); }
.week-row-work { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 3px; }
.work-tag {
  font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 6px;
  background: var(--color-neutral-bg); color: var(--color-neutral-text);
}
.work-full { background: var(--color-primary); color: var(--color-on-primary); }
.work-reset { background: var(--color-warn-bg); color: var(--color-warn-text); box-shadow: inset 0 0 0 1px var(--color-warn-border); }
.work-ready, .work-stays { background: var(--color-ok-bg); color: var(--color-ok-text); }
.work-setup_day { background: var(--color-accent-bg); color: var(--color-primary-text); box-shadow: inset 0 0 0 1px var(--color-primary-text); }
.week-row.no-action { opacity: 0.6; }
.week-row .no-action-tag { background: var(--color-neutral-bg); color: var(--color-neutral-text); }

.tag {
  font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 999px;
}
.pending-tag { background: var(--color-warn-bg); color: var(--color-warn-text); }

.fab {
  position: fixed; right: 20px; bottom: 24px; width: 58px; height: 58px;
  border-radius: 50%; background: var(--color-primary); color: var(--color-on-primary);
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-fab); border: none; text-decoration: none;
}
.fab-secondary {
  bottom: 96px; width: 50px; height: 50px;
  background: var(--color-surface); color: var(--color-primary-text);
  border: 2px solid var(--color-primary-text); box-shadow: var(--shadow-fab-secondary);
}
/* A button that only shows a "+" or a page icon asks people to guess; these say what they do. */
.fab.fab-labelled {
  width: auto; height: 52px; padding: 0 20px 0 16px; gap: 8px; border-radius: 999px;
  font-size: 15px; font-weight: 700; white-space: nowrap;
}
.fab-secondary.fab-labelled { height: 44px; padding: 0 16px 0 12px; font-size: 14px; }
.calendar-toolbar {
  display: flex; align-items: center; gap: 12px;
  max-width: var(--page-width); margin: 12px auto 0; padding: 0 20px;
}
.calendar-toolbar .view-toggle { flex: 1; min-width: 0; margin: 0; padding: 0; }
.calendar-actions { display: flex; gap: 8px; flex-shrink: 0; }

/* From a tablet up there is room for the two actions beside the view switch, where they never
   sit on top of a booking. A phone keeps the one that matters under the thumb. */
@media (min-width: 761px) {
  .calendar-actions .fab.fab-labelled {
    position: static; height: 40px; padding: 0 16px 0 12px;
    font-size: 14px; box-shadow: none;
  }
  .calendar-actions .fab-secondary.fab-labelled { border-width: 2px; }
}
@media (max-width: 760px) {
  .calendar-actions .fab-secondary { display: none; }
  body.has-fabs .calendar-main { padding-bottom: 110px; }
}

.quiet-danger-btn {
  display: block; width: auto; min-height: 40px; margin: 8px auto 0; padding: 6px 12px;
  background: none; border: none; color: var(--color-muted);
  font-size: 13px; font-weight: 600; text-decoration: underline;
}
.quiet-danger-btn:hover { color: var(--color-error); }
.quiet-danger-btn:active { background: none; color: var(--color-error); }

.back-link {
  width: 34px; height: 34px; border-radius: 10px; background: var(--overlay-on-primary); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; color: var(--color-on-primary);
}
.info-bar {
  max-width: var(--page-width); margin: 0 auto; padding: 14px 20px 4px;
  display: flex; flex-direction: column; gap: 4px;
}
.info-line { font-size: 14px; color: var(--color-muted); }
.info-line::first-letter { text-transform: uppercase; }
.detail-main {
  max-width: var(--page-width); margin: 0 auto; padding: 8px 20px 40px;
  display: flex; flex-direction: column; gap: 14px;
}
.detail-main:has(+ .detail-main) { padding-bottom: 6px; }
.section-card {
  background: var(--color-surface); border-radius: var(--radius); padding: 18px;
  border: 1px solid var(--color-border-soft);
  box-shadow: var(--shadow-card);
}

.section-card h3 { margin: 0 0 12px; font-size: 18px; color: var(--color-text); }
.section-card a { color: var(--color-primary-text); }
.section-card p { margin: 0 0 8px; font-size: 15px; color: var(--color-text); white-space: pre-line; overflow-wrap: anywhere; }
.section-card p:last-child { margin-bottom: 0; }
.section-card p.muted-note { color: var(--color-muted); font-size: 14px; }
select + .muted-note, input + .muted-note, textarea + .muted-note { margin-top: 6px; }
.allergy-card { background: var(--color-allergy-bg); border: 2px solid var(--color-error); }
.allergy-card h3 { color: var(--color-error); }
.item-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.item-row { display: flex; justify-content: space-between; gap: 12px; font-size: 15px; }
.item-row > span:first-child { min-width: 0; overflow-wrap: anywhere; }
.item-row .qty { color: var(--color-muted); flex-shrink: 0; }
.item-row .price { color: var(--color-muted); font-weight: 600; flex-shrink: 0; }
.item-row-editable { flex-wrap: wrap; align-items: center; }

.item-move-select {
  flex-shrink: 0; width: auto; min-height: 38px; margin-left: auto;
  font-size: 12px; font-weight: 600; color: var(--color-primary-text);
  background-color: var(--color-surface-sunken); border: 2px solid var(--color-primary-text);
  border-radius: 8px; padding: 6px 26px 6px 10px;
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23888' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
}
.item-move-select:disabled { opacity: 0.5; }

.item-delete-btn {
  width: 28px; height: 28px; min-height: 0; margin: 0; padding: 0; flex-shrink: 0;
  border-radius: 50%; border: 1.5px solid var(--color-error);
  background: transparent; color: var(--color-error);
  font-size: 16px; line-height: 1;
}
.item-delete-btn:disabled { opacity: 0.5; }

.add-item-form-wrap { margin-top: 12px; }
.add-item-form-summary {
  cursor: pointer; list-style: none; padding: 10px 0 4px;
  font-weight: 700; font-size: 14px; color: var(--color-primary-text);
  display: flex; align-items: center; gap: 8px; min-height: 40px;
}
.add-item-form-summary::-webkit-details-marker { display: none; }
.add-item-form-summary::before { content: "+"; font-size: 16px; font-weight: 800; line-height: 1; }
.add-item-form-wrap[open] .add-item-form-summary::before { content: "–"; }
.add-item-form-wrap.is-list > .add-item-form-summary::before { content: "▸"; font-size: 13px; }
.add-item-form-wrap.is-list[open] > .add-item-form-summary::before { content: "▾"; }

.add-item-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding-bottom: 8px; }
.add-item-form select, .add-item-form input {
  font-size: 14px; padding: 8px 10px; border-radius: 8px;
  border: 2px solid var(--color-border); background: var(--color-surface-sunken);
  color: var(--color-text); font-family: inherit;
}
.add-item-form input[type="text"] { flex: 1 1 160px; min-width: 120px; }
.add-item-form input[type="number"] { width: 76px; }
.add-item-form .error { flex-basis: 100%; }
.add-item-form .error:empty { min-height: 0; margin: 0; }
.add-item-form button[type="submit"] {
  width: auto; min-height: 40px; margin: 0; padding: 8px 18px;
  font-size: 14px; border-radius: 999px; flex-shrink: 0;
}
.shift-list { display: flex; flex-direction: column; gap: 8px; }
.shift-row { display: flex; align-items: center; gap: 12px; font-size: 15px; flex-wrap: wrap; }
.shift-row.is-roster, .shift-row.is-now { display: grid; align-items: center; gap: 4px 12px; }
.shift-row.is-roster { grid-template-columns: auto minmax(0, 1fr) auto; }
.shift-row.is-now { grid-template-columns: minmax(0, 1fr) auto auto; }
.shift-time {
  font-variant-numeric: tabular-nums; font-weight: 600; color: var(--color-primary-text);
  flex-shrink: 0;
}
.shift-name { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.shift-note { font-size: 13px; color: var(--color-muted); flex-basis: 100%; grid-column: 1 / -1; }
.shift-team { font-size: 12px; font-weight: 700; color: var(--color-neutral-text); background: var(--color-neutral-bg); border-radius: 999px; padding: 2px 10px; }

.failed-file-row {
  display: flex; flex-direction: column; gap: 2px; padding: 8px 0; border-top: 1px solid var(--color-divider);
}
.failed-file-row:first-child { border-top: none; }
.failed-file-name { font-weight: 700; font-size: 14px; }
.failed-file-reason { font-size: 13px; color: var(--color-muted); }

.bulk-delete-row {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 8px 0; border-top: 1px solid var(--color-divider); font-size: 14px;
}
.bulk-delete-row:first-child { border-top: none; }
.bulk-delete-row-title { font-weight: 700; min-width: 0; overflow-wrap: anywhere; }
.bulk-delete-row-count { color: var(--color-muted); flex-shrink: 0; }
#published-section { margin-top: 12px; padding-top: 12px; border-top: 2px solid var(--color-divider); }

.user-row-head {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px 12px;
}
.user-row-who { display: flex; flex-direction: column; min-width: 0; }
.user-row-head .user-manage-btn { grid-column: 2; grid-row: 1; }
.user-row-head .user-row-tags { grid-column: 1 / -1; grid-row: 2; }
@media (min-width: 700px) {
  .user-row-head { grid-template-columns: minmax(0, 1fr) auto auto; }
  .user-row-head .user-row-tags { grid-column: 2; grid-row: 1; justify-content: flex-end; }
  .user-row-head .user-manage-btn { grid-column: 3; }
}
.user-row-who strong { overflow-wrap: anywhere; }
.user-row-login { font-size: 13px; color: var(--color-muted); }
.user-row-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.user-manage-btn {
  width: auto; min-height: 38px; margin: 0; padding: 6px 16px;
  font-size: 14px; border-radius: 999px;
  background: var(--color-surface); color: var(--color-primary-text); border: 2px solid var(--color-primary-text);
}
.user-manage-btn:active { background: var(--color-accent-bg); }
.user-row.is-open .user-manage-btn { background: var(--color-primary); color: var(--color-on-primary); border-color: var(--color-primary); }
.user-row { padding: 14px 18px; }
.user-row + .user-row { margin-top: 10px; }
.user-manage { margin-top: 12px; border-top: 1px solid var(--color-divider); }
.user-manage-section { padding: 14px 0; border-bottom: 1px solid var(--color-divider); }
.user-manage-section:last-child { border-bottom: none; padding-bottom: 2px; }
.user-manage-section h4 { margin: 0 0 6px; font-size: 15px; }
.user-manage-section .btn-secondary-full,
.user-manage-section .btn-danger-full,
.user-manage-section .btn-primary-full { margin-top: 10px; }
.user-manage-section .user-edit-form { margin-top: 0; padding: 0; background: none; }
.user-manage-section.user-2fa { margin: 0; }
.create-account { padding: 0; margin-bottom: 20px; }
.create-account-summary {
  cursor: pointer; list-style: none; padding: 16px 18px; min-height: 52px;
  display: flex; align-items: center; gap: 10px;
  font-size: 16px; font-weight: 700; color: var(--color-primary-text);
}
.create-account-summary::-webkit-details-marker { display: none; }
.create-account-summary::before { content: "+"; font-size: 20px; font-weight: 800; line-height: 1; }
.create-account[open] .create-account-summary::before { content: "–"; }
.create-account > form { padding: 0 18px 18px; }
.users-toolbar { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 8px 2px 8px; }
.users-toolbar h3 { margin: 0; font-size: 15px; }
input[type="search"].users-filter { margin-bottom: 12px; }

.user-row label { font-size: 14px; margin-top: 14px; color: var(--color-muted); }
.user-row .muted-note { font-size: 13px; margin: 6px 0 0; }

.row-message { margin-top: 16px; min-height: 24px; font-weight: 600; }
.row-message.error { color: var(--color-error); }
.row-message.success { color: var(--color-primary-text); }
.row-message:empty { margin: 0; min-height: 0; }
.user-edit-form {
  background: var(--color-bg); border-radius: var(--radius); padding: 14px;
  margin-top: 10px;
}
.user-edit-form label:first-child { margin-top: 0; }

.theme-toggle { display: flex; gap: 8px; flex-wrap: wrap; }
.theme-option {
  width: auto; flex: 1 1 0; min-width: 0; min-height: 48px; margin-top: 0; white-space: nowrap;
  font-size: 15px; background: var(--color-surface); color: var(--color-primary-text);
  border: 2px solid var(--color-border-soft); border-radius: 999px; padding: 8px 10px;
}
.theme-toggle + .muted-note { margin-top: 10px; }

.forced-notice {
  margin: 0 0 14px; padding: 14px 16px; border-radius: var(--radius);
  background: var(--color-accent-bg); border-left: 4px solid var(--color-primary);
  color: var(--color-text); font-size: 15px; font-weight: 600; line-height: 1.4;
}

.profile-identity { display: flex; align-items: center; gap: 14px; margin: 0; }
.profile-avatar {
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  width: 52px; height: 52px; border-radius: 999px;
  background: var(--color-accent-bg); color: var(--color-primary-text); font-size: 19px; font-weight: 800;
}
.profile-who { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.profile-who strong { font-size: 18px; color: var(--color-text); overflow-wrap: anywhere; }
.profile-who span { font-size: 14px; color: var(--color-muted); overflow-wrap: anywhere; }
.theme-option.selected {
  background: var(--color-primary); color: var(--color-on-primary);
  border-color: var(--color-primary);
}
.sessions-line { margin-top: 16px; }

.filter-bar select, .filter-bar input { margin-bottom: 4px; }
/* One card holding the day's lines, not a card per line: a morning of logins was three screens. */
.log-list { padding: 4px 18px 10px; }
.log-day {
  margin: 0; padding: 14px 0 6px; font-size: 13px; font-weight: 700; letter-spacing: 0.03em;
  text-transform: uppercase; color: var(--color-muted);
}
.log-day::first-letter { text-transform: uppercase; }
.log-row {
  display: flex; gap: 14px; align-items: baseline;
  padding: 9px 0; border-top: 1px solid var(--color-divider);
}
.log-day + .log-row { border-top: none; }
.log-row-time {
  flex-shrink: 0; width: 64px; font-size: 13px; color: var(--color-primary-text); font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.log-row-body { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 6px; row-gap: 2px; }
.log-row-ip { flex-basis: 100%; font-size: 11px; color: var(--color-muted); }
.log-row-action { font-weight: 700; font-size: 15px; color: var(--color-text); }
.log-row-actor { font-size: 13px; color: var(--color-primary-text); font-weight: 600; }
.log-row-actor::before { content: "· "; color: var(--color-muted); font-weight: 400; }
.log-row-target { font-size: 13px; color: var(--color-muted); overflow-wrap: anywhere; }
.log-row-target::before { content: "· "; }
.log-row-detail { flex-basis: 100%; margin: 2px 0 0; font-size: 13px; color: var(--color-muted); white-space: pre-line; }
.role-tag { background: var(--color-accent-bg); color: var(--color-primary-text); }
.active-tag { background: var(--color-ok-bg); color: var(--color-ok-text); }
.muted-note { color: var(--color-muted); font-size: 14px; }
.plan-flag {
  display: inline-block; background: var(--color-warn-bg); color: var(--color-warn-text); border: 1px solid var(--color-warn-border);
  border-radius: 999px; padding: 3px 10px; font-size: 12px; font-weight: 700; margin-bottom: 8px;
}
.plan-upload { margin-top: 16px; }

.file-drop-input {
  position: absolute !important; width: 1px !important; height: 1px !important; min-height: 0 !important;
  padding: 0 !important; margin: 0 !important; border: 0 !important; opacity: 0; overflow: hidden;
}
label.file-drop {
  display: flex; align-items: center; gap: 14px; margin: 0; padding: 18px 16px; cursor: pointer;
  border: 2px dashed var(--color-border); border-radius: var(--radius); background: var(--color-bg);
  font-weight: 400; color: var(--color-text); transition: border-color 0.15s ease, background-color 0.15s ease;
}
label.file-drop + .muted-note { margin-top: 8px; }
label.file-drop:hover, label.file-drop.is-over { border-color: var(--color-primary-text); background: var(--color-accent-bg); }
.file-drop-input:focus-visible + label.file-drop { outline: 3px solid var(--color-primary-text); outline-offset: 2px; }
.file-drop.has-file { border-style: solid; border-color: var(--color-primary-text); }
.file-drop-icon { display: flex; flex-shrink: 0; color: var(--color-primary-text); }
.file-drop-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.file-drop-text strong { font-size: 16px; color: var(--color-primary-text); }
.file-drop-text > span { font-size: 13px; color: var(--color-muted); }
.file-drop-text .file-drop-chosen { font-size: 14px; font-weight: 700; color: var(--color-text); overflow-wrap: anywhere; }
.file-drop-chosen:empty { display: none; }
.plan-upload label { margin-top: 0; font-size: 14px; }
.plan-upload p:empty { display: none; }
.plan-file-link {
  display: flex; align-items: center; gap: 8px; margin-top: 4px;
  background: var(--color-bg); border-radius: 10px; padding: 12px 14px;
  color: var(--color-primary-text); font-weight: 600; font-size: 14px; text-decoration: none;
}

.form-main {
  max-width: var(--page-width); margin: 0 auto; padding: 16px 20px 60px;
}

/* Which fields a form can't be saved without, said before saving rather than after. */
.marks-required label:has(+ input[required])::after,
.marks-required label:has(+ select[required])::after,
.marks-required .form-row label:has(+ input[required])::after { content: " *"; color: var(--color-error); }
.required-legend { margin: 0 0 10px; text-align: right; }
.section-card select + h3, .session-block select + h3 { margin-top: 22px; }
.form-main .section-card {
  margin-bottom: 16px;
}
select, textarea {
  width: 100%; min-height: var(--tap-min); font-size: 17px;
  padding: 12px 16px; border: 2px solid var(--color-border); border-radius: var(--radius);
  background: var(--color-bg); color: var(--color-text); font-family: inherit;
}
textarea { min-height: 80px; resize: vertical; }

.form-row {
  display: flex; gap: 12px; flex-wrap: wrap;
}

.form-row > * { flex: 1 1 190px; min-width: 0; }

.form-row > label { margin-top: 0; }
.form-row + .form-row { margin-top: 20px; }

input[type="date"], input[type="time"], input[type="number"], select { min-width: 0; }
.btn-secondary-full {
  width: 100%; background: transparent; color: var(--color-primary-text); border: 2px solid var(--color-border);
  border-radius: var(--radius); padding: 14px; font-size: 16px; font-weight: 700; margin-top: 8px;
}
.btn-secondary-full:hover { background: var(--color-accent-bg); }
.btn-danger-full {
  width: 100%; background: transparent; color: var(--color-error); border: 2px solid var(--color-error);
  border-radius: var(--radius); padding: 14px; font-size: 16px; font-weight: 700; margin-top: 12px;
}

.queue-card {
  display: block; text-decoration: none; color: inherit; margin-bottom: 12px;
}
.queue-card h3 { margin: 8px 0 4px; font-size: 17px; color: var(--color-text); }
.status-banner {
  max-width: var(--page-width); margin: 14px auto 0; background: var(--color-warn-bg); border: 2px solid var(--color-warn-border);
  border-radius: var(--radius); padding: 12px 14px; display: flex; gap: 10px; align-items: flex-start;
}
.status-banner svg { color: var(--color-warn-text); flex-shrink: 0; margin-top: 1px; }
.status-banner-title { font-size: 14px; font-weight: 700; color: var(--color-warn-text); margin: 0 0 2px; }
.status-banner-sub { font-size: 12.5px; color: var(--color-warn-text-soft); margin: 0; }
.source-line {
  max-width: var(--page-width); margin: 10px auto 0; padding: 0 20px;
  font-size: 12.5px; color: var(--color-muted);
}
.pdf-toggle-row { max-width: var(--page-width); margin: 10px auto 0; padding: 0 20px; }
.pdf-viewer { max-width: var(--page-width); margin: 10px auto; padding: 0 20px; }
.pdf-viewer iframe {
  width: 100%; height: 75vh; border: 1px solid var(--color-divider); border-radius: 8px;
  background: var(--color-surface);
}
.beo-toggle-row {
  max-width: var(--page-width); margin: 10px auto 0; padding: 0 20px;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.beo-toggle-row .pill-btn { width: auto; margin: 0; flex: 0 0 auto; }
.beo-upload { position: relative; display: inline-flex; }
.beo-upload-label {
  cursor: pointer; font-size: 14px; font-weight: 700; color: var(--color-primary-text);
  text-decoration: underline; min-height: 40px; display: inline-flex; align-items: center;
}
.beo-upload-input { position: absolute; inset: 0; opacity: 0; width: 100%; cursor: pointer; }
.beo-filename { font-size: 12.5px; color: var(--color-muted); overflow-wrap: anywhere; }

.beo-panel {
  position: fixed; inset: 0; z-index: 60;
  display: flex; flex-direction: column;
  background: var(--color-surface);
}
.beo-panel-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 14px; border-bottom: 1px solid var(--color-divider);
  color: var(--color-text); font-size: 14px;
}
.beo-close {
  width: auto; margin: 0; min-height: 40px; padding: 0 14px;
  font-size: 22px; line-height: 1; background: none; border: none;
  color: var(--color-text); cursor: pointer;
}
.beo-panel iframe { flex: 1; width: 100%; border: none; background: var(--color-surface); }

@media (min-width: 1100px) {
  body.beo-open { padding-right: 46vw; }
  .beo-panel { left: auto; width: 46vw; border-left: 1px solid var(--color-divider); }
}

.session-group-heading {
  display: flex; align-items: center; justify-content: space-between;
  margin: 20px 0 4px;
}
.session-group-heading h2 { margin: 0; font-size: 16px; color: var(--color-text); }
.session-group-heading h2::first-letter { text-transform: uppercase; }

.session-group-heading a {
  font-size: 13px; font-weight: 700; flex-shrink: 0; text-decoration: none;
  color: var(--color-primary-text); background: var(--color-surface);
  border: 2px solid var(--color-border-soft); padding: 8px 12px; margin-left: 10px; border-radius: 999px;
}
.actions {
  max-width: var(--page-width); margin: 0 auto; padding: 8px 20px 32px;
}
.btn-primary-full {
  width: 100%; background: var(--color-primary); color: var(--color-on-primary); border: none;
  border-radius: var(--radius); padding: 16px; font-size: 17px; font-weight: 700;
}
.session-block-head {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px;
}
.remove-session-btn, .remove-item-btn {
  width: auto; min-height: 40px; margin-top: 0; background: transparent; color: var(--color-error);
  border: 2px solid var(--color-error); font-size: 14px; padding: 6px 12px;
}
.time-warning { margin: 8px 0 0; color: var(--color-warn-text); font-weight: 600; }
.muted-note.is-unsaved { color: var(--color-warn-text); font-weight: 600; }
.actions .publish-error { margin: 0 0 12px; }
.actions .publish-error:empty { margin: 0; }
.plan-note-wrap { margin-top: 4px; }
.line-items-container { display: flex; flex-direction: column; gap: 12px; margin-top: 8px; }
.line-item-row {
  background: var(--color-bg); border-radius: var(--radius); padding: 14px;
  display: flex; flex-direction: column; gap: 10px;
}
.line-item-row label { margin-top: 0; font-size: 13px; }
.checkbox-row {
  display: flex; align-items: center; gap: 12px; min-height: var(--tap-min);
  margin-top: 20px; padding: 10px 0;
}
.checkbox-row input[type="checkbox"] {
  width: 30px; height: 30px; flex-shrink: 0; accent-color: var(--color-primary-text);
}

.checkbox-row label {
  margin: 0; font-weight: 600; font-size: 16px;
  display: flex; align-items: center; align-self: stretch;
  min-height: var(--tap-min); cursor: pointer;
}

.print-header {
  display: none;
}
@media print {

  :root:root {
    color-scheme: light;
    --color-bg: #f2f4f8;
    --color-surface: #ffffff;
    --color-surface-sunken: #ffffff;
    --color-primary: #2a3692;
    --color-primary-text: #2a3692;
    --color-text: #1a1c26;
    --color-muted: #5b5f6d;
    --color-error: #b3261e;
    --color-border: #d2d6e2;
    --color-border-soft: #e1e4ee;
    --color-divider: #ebeef4;
    --color-warn-bg: #fdf1de;
    --color-warn-border: #e3ac3f;
    --color-warn-text: #8a5a00;
    --color-warn-text-soft: #6b4a12;
    --color-accent-bg: #ebedf8;
    --color-ok-bg: #e6f4ea;
    --color-ok-text: #1e7a34;
    --color-allergy-bg: #fbe9e7;
    --color-neutral-bg: #ebedf2;
    --color-neutral-text: #5b5f6d;
    --color-inactive: #c5c9d6;
  }
  .top-bar, .fab, .fab-secondary, .review-banner, .week-nav,
  #edit-link, #print-btn, #info-bar {
    display: none !important;
  }
  .print-header {
    display: block;
    padding: 0 0 12px;
    margin: 0 0 16px;
    border-bottom: 2px solid var(--color-primary);
  }
  .print-header .brand-line {
    font-size: 13px; font-weight: 700; color: var(--color-primary);
    text-transform: uppercase; letter-spacing: 0.04em; margin: 0 0 4px;
  }
  .print-header h1 {
    font-size: 22px; margin: 0 0 4px; color: var(--color-text);
  }
  .print-header .print-meta {
    font-size: 13px; color: var(--color-muted); margin: 0;
  }
  body {
    background: #fff;
  }
  .info-bar, .detail-main {
    margin: 0; max-width: none; padding: 0;
  }
  .section-card {
    box-shadow: none; border: 1px solid #ddd; break-inside: avoid;
  }
  .allergy-card {
    -webkit-print-color-adjust: exact; print-color-adjust: exact;
  }
  .tag, .plan-flag, .pending-tag {
    -webkit-print-color-adjust: exact; print-color-adjust: exact;
  }

  body.print-no-price .price {
    display: none;
  }
}

.issues-card { background: var(--color-allergy-bg); border: 2px solid var(--color-error); }
.issues-card h3 { color: var(--color-error); }
.issue-row { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 10px; }
.issue-row:last-child { margin-bottom: 0; }
.issue-row p { margin: 0 0 2px; }
.issue-fix {
  width: auto; margin: 2px 0 0; min-height: 36px; padding: 4px 0;
  font-size: 14px; font-weight: 700; background: none; border: none;
  color: var(--color-primary-text); text-decoration: underline; text-underline-offset: 3px;
}
.issue-marker {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  margin-top: 1px;
}
.issue-error { background: var(--color-error); }

.issue-warning { background: var(--color-muted); }

.issue-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  background: var(--color-error);
  color: #fff;
}

/* Whose slice of the day this is. Said as a label, since a bare "Salle" beside the bell read as a button. */
.day-role {
  flex-shrink: 0; margin: 0 4px; padding: 4px 10px; border-radius: 999px;
  background: var(--overlay-on-primary); font-size: 13px; font-weight: 700;
}
.day-role:empty { display: none; }
.day-tally {
  max-width: var(--page-width); margin: 0 auto; padding: 0 20px 4px;
  font-size: 13px; font-weight: 600; color: var(--color-muted);
}
.day-tally:empty { display: none; }

.day-group-header {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 700; color: var(--color-muted);
  text-transform: uppercase; letter-spacing: 0.04em;
  margin-top: 6px;
}
.day-group-header:first-child { margin-top: 0; }
.day-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.day-dot-warn { background: var(--color-warn-border); }
.day-dot-now { background: var(--color-error); }
.day-dot-next { background: var(--color-primary-text); }
.day-dot-done { background: var(--color-inactive); }

.day-card-notes { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; cursor: default; }
.day-card-notes.is-brief { gap: 2px; cursor: inherit; }
.day-note-brief {
  margin: 0; padding-left: 10px; border-left: 3px solid var(--color-warn-border);
  font-size: 13px; color: var(--color-warn-text-soft);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.day-card {
  display: flex; gap: 14px; text-decoration: none; color: inherit;
  border-left: 5px solid var(--color-border);
}
.day-card-now { border-left-color: var(--color-error); }
.day-card-next { border-left-color: var(--color-primary-text); }
.day-card-unscheduled { border-left-color: var(--color-warn-border); }
.day-card-done { opacity: 0.62; }

.day-time { flex: 0 0 auto; width: 72px; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.day-when { font-size: 18px; font-weight: 800; line-height: 1.1; color: var(--color-text); white-space: nowrap; }
.day-until { font-size: 13px; font-weight: 600; color: var(--color-muted); white-space: nowrap; }
.day-until::before { content: "→ "; }
.day-until.is-label { text-align: right; white-space: normal; color: var(--color-warn-text); }
.day-until.is-label::before { content: none; }
.day-count {
  margin-top: 6px; font-size: 11px; font-weight: 700; text-align: right; line-height: 1.2;
  color: var(--color-primary-text);
}
.day-count.is-now { color: var(--color-error); }

.day-card-body { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 4px; }
.day-card-body h3 { margin: 0; font-size: 19px; color: var(--color-text); overflow-wrap: anywhere; }
.day-card-body .muted-note { margin: 0; overflow-wrap: anywhere; }

.day-action {
  align-self: flex-start; padding: 3px 10px; border-radius: 6px;
  font-size: 12px; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase;
  background: var(--color-neutral-bg); color: var(--color-neutral-text);
}
.day-action.is-full { background: var(--color-primary); color: var(--color-on-primary); }
.day-action.is-reset { background: var(--color-warn-bg); color: var(--color-warn-text); box-shadow: inset 0 0 0 1px var(--color-warn-border); }
.day-action.is-day { background: var(--color-accent-bg); color: var(--color-primary-text); box-shadow: inset 0 0 0 1px var(--color-primary-text); }
.day-action.is-service { background: var(--color-accent-bg); color: var(--color-primary-text); }

.day-hint { margin: 0; font-size: 14px; font-weight: 600; color: var(--color-text); }

.day-flags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.day-flag {
  padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700;
  background: var(--color-neutral-bg); color: var(--color-neutral-text);
}
.day-flag.is-warn { background: var(--color-warn-bg); color: var(--color-warn-text); box-shadow: inset 0 0 0 1px var(--color-warn-border); }

.day-facts { margin: 6px 0 0; padding: 8px 0 0; border-top: 1px solid var(--color-divider); display: flex; flex-direction: column; gap: 3px; }
.day-fact { display: flex; gap: 10px; font-size: 14px; }
.day-fact dt { flex: 0 0 auto; min-width: 104px; color: var(--color-muted); }
.day-fact dd { margin: 0; min-width: 0; overflow-wrap: anywhere; color: var(--color-text); }
.day-fact dd.is-strong { font-weight: 800; }
.day-fact dd.is-muted { color: var(--color-muted); font-style: italic; }

.day-items { margin: 4px 0 0; font-size: 13px; color: var(--color-muted); }
.day-handoff { margin: 2px 0 0; font-size: 13px; color: var(--color-muted); }
.day-from { margin: 2px 0 0; font-size: 13px; color: var(--color-muted); }

.day-scope { margin-bottom: 4px; }
.day-scope.hidden { display: none; }

button.day-group-toggle {
  width: 100%; margin: 6px 0 0; padding: 6px 0; min-height: 44px;
  background: none; border: 0; text-align: left; cursor: pointer;
}
.day-group-chevron { margin-left: auto; font-size: 12px; }
.day-dot-ready { background: var(--color-ok-text); }

.day-ready { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; padding: 12px 16px; }
.day-ready h3 { margin: 0 0 2px; font-size: 16px; }
.day-ready .work-tag { flex: 0 0 auto; }

.config-card > summary {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;

  list-style: none;
}
.config-card > summary::-webkit-details-marker { display: none; }
.config-card > summary::after {
  content: "";
  margin-left: auto;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--color-muted);
  border-bottom: 2px solid var(--color-muted);
  transform: rotate(45deg);
  transition: transform 0.15s;
}
.config-card[open] > summary::after { transform: rotate(-135deg); }
.config-card > summary h3 { margin: 0; }
.config-card h4 { margin: 14px 0 2px; font-size: 15px; }

.work-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.work-row label { flex: 1; margin: 0; }
.work-row select { flex: 0 1 auto; width: auto; min-width: 120px; max-width: 60%; margin: 0; text-overflow: ellipsis; }

.work-source { margin-top: -4px; margin-bottom: 10px; }


.work-defaults-banner {
  background: var(--color-warn-bg); border: 2px solid var(--color-warn-border);
  border-radius: var(--radius); padding: 10px 14px; margin-bottom: 14px;
}
.work-defaults-heading { margin: 0; font-size: 13px; font-weight: 700; color: var(--color-warn-text); }
.work-defaults-list { margin: 6px 0 0; padding-left: 20px; }
.work-defaults-list li { font-size: 13px; color: var(--color-warn-text-soft); margin-bottom: 2px; }
.work-defaults-list li:last-child { margin-bottom: 0; }

:root { --floorplan-width: 1000px; }
@media (min-width: 1500px) {
  :root { --floorplan-width: clamp(1000px, calc((100vh - 260px) * 1.46 + 40px), 1600px); }
}
body[data-tour-page="floorPlan"], body[data-tour-page="maintenance"] { --page-width: var(--floorplan-width); }
.floorplan-main {
  max-width: var(--floorplan-width); margin: 0 auto; padding: 8px 20px 100px;
  display: flex; flex-direction: column; gap: 14px;
}
.floorplan-legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; color: var(--color-muted); }
.floorplan-legend-item { display: flex; align-items: center; gap: 6px; }
.floorplan-legend-swatch { width: 14px; height: 14px; border-radius: 4px; flex-shrink: 0; border: 1px solid var(--color-border); }
.floorplan-legend-swatch.state-free { background: transparent; }
.floorplan-legend-swatch.state-has-sessions { background: transparent; border: 2px dashed var(--color-primary-text); }
.floorplan-legend-swatch.state-occupied { background: var(--color-primary); border: 2px solid var(--color-primary-text); opacity: 0.85; }
.floorplan-legend-swatch.state-setup { background: var(--color-phase-setup); opacity: 0.7; }
.floorplan-legend-swatch.state-strip { background: var(--color-phase-strip); opacity: 0.7; }
.floorplan-legend-phases { display: contents; }
.floorplan-legend-swatch.state-conflict { background: var(--color-error); opacity: 0.65; }
.floorplan-legend-swatch.state-tight { background: transparent; border: 2px dashed var(--color-warn-border); }
.floorplan-image-wrap {
  position: relative; width: 100%; line-height: 0;
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-card);
}
.floorplan-image { display: block; width: 100%; height: auto; }
.floorplan-hotspot {
  position: absolute; margin-top: 0; min-height: 0; min-width: 0; width: auto;
  border: none; border-radius: 2px; padding: 0; cursor: pointer;
  background: var(--color-primary); opacity: 0;
  outline: 2px solid transparent; outline-offset: -2px;
  transition: opacity 0.15s, outline-color 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.floorplan-hotspot:hover, .floorplan-hotspot:focus-visible {
  outline-color: var(--color-on-primary);
}
/* Booked today but not at this hour: an outline only, so it never competes with what is happening now. */
.floorplan-hotspot[data-state="has-sessions"] {
  opacity: 1; background: color-mix(in srgb, var(--color-primary) 7%, transparent);
  outline: 2px dashed color-mix(in srgb, var(--color-primary-text) 70%, transparent); outline-offset: -3px;
}
/* Busy right now: a solid fill with a solid edge. */
.floorplan-hotspot[data-state="occupied"] { opacity: 0.78; outline: 3px solid var(--color-primary-text); outline-offset: -3px; }

.floorplan-hotspot[data-state="setup"] { background: var(--color-phase-setup); opacity: 0.7; }
.floorplan-hotspot[data-state="strip"] { background: var(--color-phase-strip); opacity: 0.7; }

.floorplan-hotspot[data-state="conflict"] { background: var(--color-error); opacity: 0.65; }
.floorplan-hotspot.is-selected {
  outline: 3px solid var(--color-warn-border); outline-offset: -3px;
}
.floorplan-hotspot.is-selected[data-state="free"] {
  opacity: 1; background: transparent;
}
.floorplan-hotspot.is-selected[data-state="conflict"] {
  background: var(--color-error); opacity: 0.45;
  outline-color: var(--color-error);
}

.floorplan-unmapped {
  background: var(--color-surface); border-radius: var(--radius);
  box-shadow: var(--shadow-card); padding: 14px 16px;
}
.floorplan-unmapped h3 { margin: 0 0 8px; font-size: 14px; }

.floorplan-detail {
  background: var(--color-surface); border-radius: var(--radius);
  box-shadow: var(--shadow-card); padding: 16px 18px;
}
.floorplan-detail-prompt { color: var(--color-muted); font-size: 14px; margin: 0; }
.floorplan-detail-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 10px;
}
.floorplan-detail-head h3 { margin: 0; font-size: 17px; }
.floorplan-detail-area { font-size: 12px; color: var(--color-muted); flex-shrink: 0; }
.floorplan-detail-free { font-size: 14px; color: var(--color-muted); margin: 0; }
.floorplan-conflict {
  background: var(--color-allergy-bg); border: 2px solid var(--color-error);
  border-radius: var(--radius); padding: 10px 12px;
}
.floorplan-conflict h4 { margin: 0 0 4px; font-size: 13px; color: var(--color-error); }
.floorplan-conflict p { margin: 0 0 2px; font-size: 13px; }
.floorplan-conflict p:last-child { margin-bottom: 0; }
.floorplan-conflict-banner {
  margin: 0; padding: 10px 12px; border-radius: var(--radius);
  background: var(--color-allergy-bg); border: 2px solid var(--color-error);
  color: var(--color-error); font-size: 13px; font-weight: 700;
}
.floorplan-sessions { display: flex; flex-direction: column; gap: 8px; }
.floorplan-session {
  display: flex; flex-direction: column; gap: 2px; padding: 10px 12px;
  border-radius: 10px; background: var(--color-surface-sunken);
  text-decoration: none; color: inherit;
}
.floorplan-session.is-now {
  background: var(--color-primary); color: var(--color-on-primary);
}
.floorplan-session.is-now .floorplan-session-time { color: var(--color-on-primary); }
.floorplan-session-time { font-size: 11px; font-weight: 700; color: var(--color-primary-text); }
.floorplan-session-title {
  font-size: 14px; font-weight: 700;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.floorplan-session-sub { font-size: 12px; opacity: 0.8; }
.floorplan-session .tag { align-self: flex-start; margin-top: 2px; }

.floorplan-session.is-conflict { outline: 2px solid var(--color-error); outline-offset: -2px; }
.floorplan-session .conflict-tag { background: var(--color-error); color: #ffffff; }
.floorplan-session.no-action { opacity: 0.6; }
.floorplan-session.no-action .no-action-tag { background: var(--color-neutral-bg); color: var(--color-neutral-text); }
.floorplan-session.is-now.no-action .no-action-tag { background: var(--overlay-on-primary); color: var(--color-on-primary); }

.daylist-section { padding-bottom: 6px; }
.daylist-section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 10px; margin-bottom: 10px;
}
.daylist-section-head h3 { margin: 0; }
.daylist-section-total { font-size: 12px; color: var(--color-muted); flex-shrink: 0; }

.daylist-item { border-top: 1px solid var(--color-divider); }
.daylist-item:first-of-type { border-top: none; }
.daylist-item-head {
  display: flex; align-items: baseline; gap: 10px;
  padding: 9px 0; cursor: pointer; list-style: none;
}
.daylist-item-head::-webkit-details-marker { display: none; }
.daylist-qty {
  font-size: 19px; font-weight: 700; color: var(--color-primary-text);
  min-width: 2.4em; text-align: right; flex-shrink: 0; font-variant-numeric: tabular-nums;
}
.daylist-desc { flex: 1; font-size: 15px; }
.daylist-count { font-size: 11px; color: var(--color-muted); flex-shrink: 0; }
.daylist-item[open] .daylist-count { color: var(--color-primary-text); }

.daylist-breakdown {
  display: flex; flex-direction: column; gap: 2px;
  padding: 2px 0 10px 2.4em; margin-left: 10px;
  border-left: 2px solid var(--color-border-soft);
}
.daylist-ref {
  display: flex; align-items: baseline; gap: 8px; padding: 5px 8px;
  border-radius: 6px; text-decoration: none; color: inherit; font-size: 13px;
}
.daylist-ref:hover { background: var(--color-accent-bg); }
.daylist-ref-qty {
  font-weight: 700; min-width: 2em; text-align: right;
  color: var(--color-primary-text); font-variant-numeric: tabular-nums;
}
.daylist-ref-room { font-weight: 600; }
.daylist-ref-title { flex: 1; color: var(--color-muted); }
.daylist-ref-time { color: var(--color-muted); font-size: 12px; flex-shrink: 0; }

.daylist-booking {
  display: flex; align-items: center; gap: 12px; padding: 9px 0;
  border-top: 1px solid var(--color-divider);
  text-decoration: none; color: inherit;
}
.daylist-booking:first-of-type { border-top: none; }
.daylist-booking-time {
  font-size: 12px; font-weight: 700; color: var(--color-primary-text);
  min-width: 6.5em; flex-shrink: 0; font-variant-numeric: tabular-nums;
}
.daylist-booking-body { flex: 1; display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.daylist-booking-title { font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
.daylist-booking-room { font-size: 12px; color: var(--color-muted); }
.daylist-booking-note { font-size: 12px; color: var(--color-primary-text); }
.daylist-booking-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.daylist-covers-n {
  flex-shrink: 0; font-size: 19px; font-weight: 700; color: var(--color-primary-text);
  font-variant-numeric: tabular-nums;
}
.daylist-booking .implied-tag { background: var(--color-warn-bg); color: var(--color-warn-text); }
.daylist-booking .allergy-tag { background: var(--color-error); color: #ffffff; }

.daylist-hour-bucket + .daylist-hour-bucket { margin-top: 14px; }
.daylist-hour-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 10px; padding-bottom: 6px;
}
.daylist-hour-label { font-size: 13px; font-weight: 600; color: var(--color-primary-text); }
.daylist-hour-total { font-size: 12px; color: var(--color-muted); }

.shortage-banner { background: var(--color-allergy-bg); border: 2px solid var(--color-error); }
.shortage-banner h3 { color: var(--color-error); margin-top: 0; }
.shortage-banner p:last-child { margin-bottom: 0; }

.prep-card { display: flex; flex-direction: column; gap: 10px; text-decoration: none; color: inherit; border-left: 5px solid var(--color-primary-text); }
.prep-head { display: flex; gap: 14px; align-items: flex-start; }
.prep-time { flex: 0 0 auto; width: 72px; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.prep-time-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--color-muted); }
.prep-when { font-size: 18px; font-weight: 800; line-height: 1.1; color: var(--color-text); white-space: nowrap; }
.prep-until { font-size: 13px; font-weight: 600; color: var(--color-muted); white-space: nowrap; }
.prep-until::before { content: "→ "; }
.prep-title { min-width: 0; flex: 1; }
.prep-title h3 { margin: 0; font-size: 19px; color: var(--color-text); overflow-wrap: anywhere; }
.prep-title .muted-note { margin: 2px 0 0; overflow-wrap: anywhere; }
.prep-work { display: flex; flex-wrap: wrap; gap: 6px; }
.prep-work .work-tag, .prep-work .tag { font-size: 12px; padding: 3px 10px; }
.prep-work .implied-tag { background: var(--color-warn-bg); color: var(--color-warn-text); }
.prep-work .read-tag { background: var(--color-neutral-bg); color: var(--color-neutral-text); }
.prep-card .day-facts { margin-top: 0; padding-top: 0; border-top: 0; }
.prep-block { padding-top: 8px; border-top: 1px solid var(--color-divider); }
.prep-block h4 { margin: 0 0 4px; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; color: var(--color-muted); }
.prep-block h4 .tag { margin-left: 8px; text-transform: none; letter-spacing: 0; font-weight: 600; background: var(--color-neutral-bg); color: var(--color-neutral-text); }
.prep-lines { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 2px; font-size: 15px; }
.prep-lines strong { color: var(--color-primary-text); }
.prep-note { margin: 0 0 4px; font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.prep-note:last-child { margin-bottom: 0; }
.day-group-header.prep-day { margin-top: 10px; }

/* Merging look-alike imports and publishing the clean ones: panels above the queue, at its width. */
.review-actions {
  max-width: var(--page-width); margin: 0 auto; padding: 8px 20px 6px;
  display: flex; flex-direction: column; gap: 14px;
}
.review-actions:not(:has(.section-card:not(.hidden))) { display: none; }
#merge-candidates-list { display: flex; flex-direction: column; gap: 14px; }
#merge-candidates-list:empty { display: none; }
.review-actions h2 { margin: 0 0 6px; font-size: 18px; color: var(--color-text); }
.review-actions .btn-primary-full { margin-top: 14px; }
@media (min-width: 700px) {
  .review-actions .btn-primary-full { width: auto; padding-left: 28px; padding-right: 28px; }
}
#publish-clean-result:empty { display: none; }
#publish-clean-list { max-height: 320px; overflow-y: auto; }
.publish-clean-item { margin-top: 10px; align-items: flex-start; }
.publish-clean-item:first-child { margin-top: 0; }
.publish-clean-item span { font-size: 14px; font-weight: 400; padding-top: 2px; }

@media (max-width: 420px) {
  .daylist-ref { flex-wrap: wrap; }
  .daylist-ref-title { flex-basis: 100%; }
}

@media print {
  .daylist-breakdown { border-left-color: #ccc; }
  .daylist-item, .daylist-booking, .prep-card { break-inside: avoid; }
}

.floorplan-scrub {
  background: var(--color-surface); border-radius: var(--radius);
  padding: 10px 14px 6px; box-shadow: var(--shadow-card);
}
.floorplan-scrub-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.floorplan-scrub-label {
  font-size: 20px; font-weight: 700; color: var(--color-primary-text);
  font-variant-numeric: tabular-nums; white-space: nowrap;
}

.floorplan-scrub-head .pill-btn { margin: 0; width: auto; flex: 0 0 auto; }
.floorplan-scrub-track { display: flex; align-items: center; gap: 10px; }
.floorplan-scrub-bound {
  font-size: 11px; color: var(--color-muted); flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}
.floorplan-scrub-track input[type="range"] {
  flex: 1; margin: 0; min-height: 0; width: auto; height: 8px; border-radius: 999px;
  -webkit-appearance: none; appearance: none; cursor: pointer;
  background: var(--color-divider);

  box-sizing: content-box; padding: 16px 0; background-clip: content-box;
}

.floorplan-scrub-track input[type="range"]::-webkit-slider-runnable-track {
  height: 8px; border-radius: 999px; background: transparent;
}
.floorplan-scrub-track input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; margin-top: -7px;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--color-primary); border: 3px solid var(--color-surface);
  box-shadow: var(--shadow-block);
}
.floorplan-scrub-track input[type="range"]::-moz-range-track {
  height: 8px; border-radius: 999px; background: var(--color-divider);
}
.floorplan-scrub-track input[type="range"]::-moz-range-progress {
  height: 8px; border-radius: 999px; background: var(--color-primary);
}
.floorplan-scrub-track input[type="range"]::-moz-range-thumb {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--color-primary); border: 3px solid var(--color-surface);
  box-shadow: var(--shadow-block);
}
.floorplan-scrub-track input[type="range"]:focus-visible::-webkit-slider-thumb {
  outline: 2px solid var(--color-primary-text); outline-offset: 2px;
}
.floorplan-scrub-track input[type="range"]:focus-visible::-moz-range-thumb {
  outline: 2px solid var(--color-primary-text); outline-offset: 2px;
}

.floorplan-session.is-other-day { opacity: 0.75; border-style: dashed; }
.floorplan-session .other-day-tag { background: var(--color-neutral-bg); color: var(--color-neutral-text); }
.floorplan-session .phase-tag { background: var(--color-warn-bg); color: var(--color-warn-text); }

#top-nav.nav-menu-btn, #top-nav .nav-menu-btn {
  width: 40px; height: 40px; padding: 0; min-height: 0;
}

.nav-overlay {
  position: fixed; inset: 0; background: rgba(0, 0, 0, 0.45); z-index: 60;
}

.nav-panel {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(320px, 88vw);
  background: var(--color-surface); color: var(--color-text); z-index: 61;
  box-shadow: var(--shadow-raised); display: flex; flex-direction: column;
  overflow-y: auto;
}

.nav-overlay.hidden, .nav-panel.hidden { display: none; }

body.nav-open { overflow: hidden; }

.nav-panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px; background: var(--color-primary); color: var(--color-on-primary);
  position: sticky; top: 0;
}

.nav-panel-title { font-weight: 800; font-size: 18px; }

.nav-panel-close {
  width: 36px; height: 36px; padding: 0; min-height: 0; margin: 0;
  border-radius: 10px; background: var(--overlay-on-primary); color: var(--color-on-primary);
  display: flex; align-items: center; justify-content: center; border: none;
}

.nav-panel-list { display: flex; flex-direction: column; padding: 8px 0 24px; }

.nav-panel-link {
  display: flex; align-items: center; gap: 14px; padding: 14px 18px;
  text-decoration: none; color: var(--color-text); font-size: 16px; font-weight: 600;
  background: none; border: none; width: 100%; text-align: left; min-height: 0; margin: 0;
  justify-content: flex-start; font-family: inherit; line-height: inherit; border-radius: 0;
}
button.nav-panel-link:active { background: var(--color-accent-bg); transform: none; }

.nav-panel-link svg { flex-shrink: 0; color: var(--color-primary-text); }

.nav-panel-link:hover, .nav-panel-link:focus-visible {
  background: var(--color-accent-bg);
}

.nav-panel-link.is-active {
  background: var(--color-accent-bg); color: var(--color-primary-text); font-weight: 800;
}
.nav-panel-link.is-active svg { color: var(--color-primary-text); }

.nav-panel-section-label {
  padding: 14px 18px 4px; font-size: 12px; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.04em; color: var(--color-muted);
}

.nav-panel-divider { height: 1px; background: var(--color-divider); margin: 8px 0; }

.nav-panel-value { margin-left: auto; font-size: 13px; font-weight: 700; color: var(--color-muted); }

.nav-panel-logout { color: var(--color-error); }
.nav-panel-logout svg { color: var(--color-error); }

/* "Help is here" on a screen not toured yet: a soft halo, not a red dot. A red dot is the bell's
   language for "unread", and a help button wearing one read as a message nobody could find. */
.tour-nudge { position: relative; animation: tour-halo 2.4s ease-in-out infinite; }
@keyframes tour-halo {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.55); }
  50% { box-shadow: 0 0 0 6px rgba(255, 255, 255, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .tour-nudge { animation: none; box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.6); }
}

.help-body { overflow-y: auto; padding: 6px; }
.help-action {
  display: flex; align-items: flex-start; justify-content: flex-start; gap: 12px; width: 100%; margin: 0; min-height: 0;
  padding: 10px; border-radius: 10px; background: none; color: var(--color-text);
  text-align: left; font-size: 14px; font-weight: 400;
}
.help-action:hover, .help-action:focus-visible { background: var(--color-accent-bg); }
.help-action:active { background: var(--color-accent-bg); transform: none; }
.help-action-icon { display: flex; flex-shrink: 0; padding-top: 1px; color: var(--color-primary-text); }
.help-action-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.help-action-text strong { font-size: 15px; }
.help-action-text span { font-size: 13px; color: var(--color-muted); }
.help-keys-block { margin: 6px 4px 0; padding: 12px 6px 6px; border-top: 1px solid var(--color-divider); }
.help-keys-title {
  margin: 0 0 8px; font-size: 12px; font-weight: 700; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--color-muted);
}
.help-keys { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; align-items: center; margin: 0; font-size: 13px; }
.help-keys dt { white-space: nowrap; }
.help-keys dd { margin: 0; }
kbd {
  font-family: inherit; font-size: 11px; font-weight: 700; padding: 2px 6px; border-radius: 5px;
  background: var(--color-neutral-bg); color: var(--color-neutral-text); border: 1px solid var(--color-border-soft);
}

.tour-overlay {
  position: fixed; inset: 0; background: transparent; z-index: 70;
}
.tour-overlay.hidden { display: none; }

.tour-spotlight {
  position: fixed; z-index: 71; pointer-events: none; border-radius: 10px;
  outline: 3px solid #ffb100; outline-offset: 0;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.55);
  transition: top 0.12s ease, left 0.12s ease, width 0.12s ease, height 0.12s ease;
}
.tour-spotlight.is-centered {
  top: 50%; left: 50%; width: 0; height: 0; outline: none;
}
.tour-spotlight.hidden { display: none; }

.tour-card {
  position: fixed; z-index: 72; width: min(340px, calc(100vw - 24px));
  background: var(--color-surface); color: var(--color-text);
  border-radius: var(--radius); box-shadow: var(--shadow-raised);
  padding: 18px; display: flex; flex-direction: column; gap: 8px;
}
.tour-card.hidden { display: none; }

.tour-counter { font-size: 12px; font-weight: 800; color: var(--color-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.tour-card h3 { margin: 0; font-size: 18px; color: var(--color-primary-text); }
.tour-card p { margin: 0; font-size: 15px; color: var(--color-text); }

.tour-card-actions {
  display: flex; flex-wrap: wrap-reverse; align-items: center; justify-content: space-between;
  gap: 8px 10px; margin-top: 8px;
}

.tour-nav-group { display: flex; align-items: center; gap: 8px; margin-left: auto; }

.tour-card .tour-btn-skip, .tour-card .tour-btn-prev, .tour-card .tour-btn-next {
  width: auto; min-height: 40px; height: 40px; margin: 0; padding: 0 16px; font-size: 14px; line-height: 1;
  white-space: nowrap;
}
.tour-card .tour-btn-skip {
  padding: 0 6px; margin-left: -6px; background: none; border: none; color: var(--color-muted);
  font-weight: 700; text-decoration: underline; text-underline-offset: 3px;
}
.tour-card .tour-btn-skip:hover, .tour-card .tour-btn-skip:focus-visible { color: var(--color-text); background: none; }

.tour-card.is-guided { width: min(390px, calc(100vw - 24px)); }
.tour-progress { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.tour-dots { display: flex; gap: 5px; flex-shrink: 0; }
.tour-dot { width: 7px; height: 7px; border-radius: 999px; background: var(--color-border-soft); }
.tour-dot.is-done { background: var(--color-primary-text); opacity: 0.45; }
.tour-dot.is-current { width: 18px; background: var(--color-primary-text); }
.tour-card.is-welcome { width: min(420px, calc(100vw - 24px)); padding: 24px; gap: 10px; text-align: center; }
.tour-card.is-welcome .tour-progress { justify-content: center; }
.tour-card.is-welcome h3 { font-size: 22px; }
.tour-welcome-badge {
  display: flex; align-items: center; justify-content: center; align-self: center;
  width: 72px; height: 72px; margin: 4px 0 2px; border-radius: 20px; background: var(--color-accent-bg);
}
.tour-card.is-welcome .tour-card-actions { flex-direction: column-reverse; align-items: stretch; flex-wrap: nowrap; }
.tour-card.is-welcome .tour-nav-group { margin-left: 0; }
.tour-card.is-welcome .tour-nav-group .tour-btn-next { flex: 1; height: 46px; font-size: 15px; }
.tour-card.is-welcome .tour-btn-skip { align-self: center; margin-left: 0; }

.floorplan-hotspot.is-tight {
  outline: 2px dashed var(--color-warn-border);
  outline-offset: -2px;
  opacity: 0.45;
}
.floorplan-hotspot.is-tight[data-state="free"] { opacity: 1; background: transparent; }
.floorplan-hotspot.is-selected.is-tight { outline-style: solid; }
.floorplan-tight-banner {
  margin: 0; padding: 10px 12px; border-radius: var(--radius);
  background: var(--color-warn-bg); border: 2px solid var(--color-warn-border);
  color: var(--color-warn-text); font-size: 13px; font-weight: 700;
}
.floorplan-tight {
  background: var(--color-warn-bg); border: 2px solid var(--color-warn-border);
  border-radius: var(--radius); padding: 10px 12px;
}
.floorplan-tight h4 { margin: 0 0 4px; font-size: 13px; color: var(--color-warn-text); }
.floorplan-tight p { margin: 0 0 2px; font-size: 13px; color: var(--color-warn-text-soft); }
.floorplan-tight p:last-child { margin-bottom: 0; }
.floorplan-session.is-tight { outline: 2px dashed var(--color-warn-border); outline-offset: -2px; }
.floorplan-session .tight-tag { background: var(--color-warn-bg); color: var(--color-warn-text); }

.board-body { margin: 0; background: var(--color-bg); }
.board {
  height: 100vh; overflow: hidden; padding: 16px 20px;
  display: flex; flex-direction: column; gap: 16px;
}
.board-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.board-head-left h1 { margin: 0; font-size: clamp(22px, 2.6vw, 38px); }
.board-sub { margin: 4px 0 0; color: var(--color-muted); font-size: clamp(13px, 1.1vw, 18px); }
.board-clock {
  font-size: clamp(38px, 6vw, 86px); font-weight: 700; line-height: 1;
  color: var(--color-primary-text); font-variant-numeric: tabular-nums;
}
.board-body-grid {
  flex: 1; min-height: 0;
  display: grid; grid-template-columns: minmax(0, 3fr) minmax(280px, 2fr); gap: 18px;
}
.board-map { display: flex; flex-direction: column; gap: 10px; min-width: 0; min-height: 0; }
.board-map .floorplan-image-wrap {
  background: var(--color-surface);
  aspect-ratio: 2200 / 1506;
  width: auto; max-width: 100%; max-height: 100%;
  margin: 0 auto; align-self: center;
}
.board-map .floorplan-image { height: 100%; width: 100%; }
.board-legend { display: flex; flex-wrap: wrap; gap: 16px; font-size: clamp(12px, 1vw, 16px); color: var(--color-muted); }
.board-side { display: flex; flex-direction: column; gap: 14px; min-width: 0; min-height: 0; overflow: hidden; }
.board-side section {
  background: var(--color-surface); border-radius: var(--radius);
  padding: 14px 16px; box-shadow: var(--shadow-card);
}
.board-side h2 {
  margin: 0 0 10px; font-size: clamp(14px, 1.2vw, 19px);
  text-transform: uppercase; letter-spacing: 0.06em; color: var(--color-muted);
}
.board-row {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 6px; margin: 0 -6px; border-top: 1px solid var(--color-divider);
  border-radius: 8px; text-decoration: none; color: inherit;
}
.board-row:first-of-type { border-top: none; }
.board-row:hover, .board-row:focus-visible {
  background: var(--color-accent-bg);
  outline: 2px solid var(--color-primary-text); outline-offset: -2px;
}
.board-row-body { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.board-row-title { font-size: clamp(15px, 1.3vw, 21px); font-weight: 600; }
.board-row-room { font-size: clamp(12px, 1vw, 16px); color: var(--color-muted); }
.board-row-time {
  font-size: clamp(13px, 1.1vw, 18px); font-weight: 700;
  color: var(--color-primary-text); flex-shrink: 0; font-variant-numeric: tabular-nums;
}
.board-row-at { min-width: 4.5em; }
.board-row-state {
  flex-shrink: 0; min-width: 7.5em; padding: 4px 10px; border-radius: 999px;
  font-size: clamp(11px, 0.9vw, 14px); font-weight: 700; text-align: center;
}
.board-row.state-occupied .board-row-state { background: var(--color-primary); color: var(--color-on-primary); }
.board-row.state-setup .board-row-state { background: var(--color-phase-setup); color: #1c1c1c; }
.board-row.state-strip .board-row-state { background: var(--color-phase-strip); color: #ffffff; }
.board-empty { margin: 0; color: var(--color-muted); font-size: clamp(13px, 1.1vw, 17px); }
body.kiosk-idle, body.kiosk-idle * { cursor: none; }
.board-stale {
  margin: 0; padding: 10px 14px; border-radius: var(--radius);
  background: var(--color-warn-bg); border: 2px solid var(--color-warn-border);
  color: var(--color-warn-text); font-weight: 700; text-align: center;
}

@media (max-width: 900px) {
  .board { height: auto; overflow: visible; }
  .board-body-grid { grid-template-columns: 1fr; }
}

.board-link {
  text-decoration: none; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  background: var(--color-surface); color: var(--color-primary-text);
  border: 1.5px solid var(--color-border);
}
.board-link:hover { background: var(--color-accent-bg); }

.find-form { display: flex; flex-direction: column; gap: 14px; }
label.field { margin: 0; }
label.field > span:first-child { display: block; margin-bottom: 8px; }
.find-form .form-row + .form-row, .report-form .form-row + .form-row { margin-top: 0; }
.find-form .form-row, .report-form .form-row { row-gap: 14px; }
.find-section {
  margin: 18px 0 8px; font-size: 13px; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--color-muted);
}
.find-section:first-child { margin-top: 6px; }
.find-option {
  background: var(--color-surface); border-radius: var(--radius);
  padding: 12px 14px; margin-bottom: 8px; box-shadow: var(--shadow-card);
  border-left: 4px solid var(--color-ok-text);
}
.find-option.is-tight { border-left-color: var(--color-warn-border); }
.find-option.is-taken { border-left-color: var(--color-inactive); opacity: 0.85; }
.find-option-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.find-option-head h3 { margin: 0; font-size: 16px; }
.find-badge {
  flex-shrink: 0; padding: 3px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 700;
}
.find-badge.is-free { background: var(--color-ok-bg); color: var(--color-ok-text); }
.find-badge.is-tight { background: var(--color-warn-bg); color: var(--color-warn-text); }
.find-badge.is-taken { background: var(--color-neutral-bg); color: var(--color-neutral-text); }
.find-facts { margin: 4px 0 0; font-size: 12px; color: var(--color-muted); }
.find-why { margin: 6px 0 0; font-size: 13px; font-weight: 600; color: var(--color-primary-text); }
.find-blocking {
  display: flex; gap: 10px; align-items: baseline; margin-top: 6px;
  padding: 6px 8px; border-radius: 6px; background: var(--color-surface-sunken);
  text-decoration: none; color: inherit; font-size: 13px;
}
.find-blocking:hover { background: var(--color-accent-bg); }
.find-blocking-time {
  font-weight: 700; color: var(--color-primary-text);
  flex-shrink: 0; font-variant-numeric: tabular-nums;
}
.find-blocking-title { color: var(--color-muted); }

.find-fold { margin-top: 10px; }
.find-fold summary { cursor: pointer; list-style: none; padding: 6px 0; }
.find-fold summary::-webkit-details-marker { display: none; }
.find-fold summary::after { content: " ▾"; }
.find-fold[open] summary::after { content: " ▴"; }

.report-main { width: 100%; max-width: 780px; margin: 0 auto; padding: 8px 20px 100px; }
.report-form { display: flex; flex-direction: column; gap: 14px; }
.report-presets { display: flex; flex-wrap: wrap; gap: 8px; }
.report-presets .pill-btn {
  margin: 0; width: auto; background: var(--color-surface); color: var(--color-primary-text);
  border: 2px solid var(--color-border);
}
.report-stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px;
  max-width: var(--page-width); margin: 14px auto; padding: 0 20px;
}
.report-main .report-stats { max-width: none; margin: 14px 0; padding: 0; }
.report-stat {
  background: var(--color-surface); border-radius: var(--radius);
  padding: 12px 14px; box-shadow: var(--shadow-card);
  display: flex; flex-direction: column; gap: 2px;
}
.report-stat-value {
  font-size: 22px; font-weight: 700; color: var(--color-primary-text);
  font-variant-numeric: tabular-nums;
}
.report-stat-label { font-size: 12px; color: var(--color-muted); }
.report-room { padding: 10px 0; border-top: 1px solid var(--color-divider); }
.report-room:first-of-type { border-top: none; }
.report-room-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.report-room-name { font-size: 15px; font-weight: 600; }
.report-room-revenue {
  font-size: 15px; font-weight: 700; color: var(--color-primary-text);
  flex-shrink: 0; font-variant-numeric: tabular-nums;
}
.report-bar { height: 6px; border-radius: 999px; background: var(--color-divider); margin: 6px 0; overflow: hidden; }
.report-bar-fill { height: 100%; background: var(--color-primary); border-radius: 999px; }
.report-room-facts { margin: 2px 0 0; font-size: 12px; color: var(--color-muted); }
.report-note {
  margin: 0 0 12px; padding: 10px 12px; border-radius: var(--radius);
  background: var(--color-warn-bg); border: 2px solid var(--color-warn-border);
  color: var(--color-warn-text-soft); font-size: 13px;
}

.floorplan-week {
  display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px;
}
.weekmap-day {
  width: auto; margin: 0; min-height: 0; padding: 8px 6px;
  background: var(--color-surface); border: 2px solid transparent;
  border-radius: var(--radius); box-shadow: var(--shadow-card);
  display: flex; flex-direction: column; gap: 6px; cursor: pointer;
}
.weekmap-day.is-selected { border-color: var(--color-primary); }
.weekmap-head { display: flex; align-items: baseline; justify-content: center; gap: 4px; }
.weekmap-dow { font-size: 10px; color: var(--color-muted); text-transform: uppercase; }
.weekmap-num { font-size: 15px; font-weight: 700; color: var(--color-text); }
.weekmap-plan {
  position: relative; width: 100%; aspect-ratio: 2200 / 1506;
  background: var(--color-divider); border-radius: 3px; overflow: hidden;
}
.weekmap-room { position: absolute; border-radius: 1px; }
.weekmap-room[data-state="free"] { background: transparent; }
.weekmap-room[data-state="has-sessions"] { background: var(--color-primary); opacity: 0.75; }
.weekmap-room[data-state="conflict"] { background: var(--color-error); opacity: 0.9; }
.weekmap-load { height: 4px; border-radius: 999px; background: var(--color-divider); overflow: hidden; }
.weekmap-load-fill { display: block; height: 100%; background: var(--color-primary); }
.weekmap-count { font-size: 10px; color: var(--color-muted); text-align: center; }

@media (max-width: 640px) {
  .floorplan-week { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .weekmap-count { display: none; }
}

.offline-banner {
  margin: 0 20px 8px; padding: 9px 12px; border-radius: var(--radius);
  background: var(--color-warn-bg); border: 2px solid var(--color-warn-border);
  color: var(--color-warn-text); font-size: 13px; font-weight: 700; text-align: center;
}

.contact-card { border-left: 4px solid var(--color-primary); }
.contact-call a { font-size: 18px; font-weight: 700; }
.floorplan-plan-link {
  align-self: flex-start; margin-top: 4px; font-size: 12px; font-weight: 700;
  text-decoration: underline; color: inherit;
}

.changes-card { border-left: 4px solid var(--color-warn-border); }
.change-row {
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
  padding: 6px 0; border-top: 1px solid var(--color-divider);
}
.change-row:first-of-type { border-top: none; }
.change-field { font-size: 13px; font-weight: 700; min-width: 6em; }
.change-values { flex: 1; font-size: 14px; font-variant-numeric: tabular-nums; }
.change-when { font-size: 11px; color: var(--color-muted); flex-shrink: 0; }

.revision-list { max-width: var(--page-width); margin: 0 auto; padding: 16px 20px 0; }
.revision-list:empty { display: none; }
.revision-intro, .revision-card { margin-bottom: 12px; }
.revision-intro h2 { margin: 0 0 6px; font-size: 18px; }
.revision-card { border-left: 4px solid var(--color-warn-border); }
.revision-card.is-urgent { border: 2px solid var(--color-error); }
.revision-card h3 { margin: 8px 0 4px; font-size: 17px; }
.revision-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.revision-head .plan-flag, .revision-head .urgency-badge { margin: 0; }
.revision-section { margin-top: 14px; }
.revision-section h4 { margin: 0 0 4px; font-size: 14px; }
.revision-section.is-added h4 { color: var(--color-ok-text); }
.revision-section.is-removed h4 { color: var(--color-error); }
.revision-section > p { margin: 0; font-size: 14px; }
.revision-item { font-size: 14px; padding: 2px 0; }
.revision-item.is-added { color: var(--color-ok-text); }
.revision-item.is-removed { color: var(--color-muted); text-decoration: line-through; }
.revision-edited { color: var(--color-warn-text); }
.revision-note-label { font-size: 11px; font-weight: 700; color: var(--color-muted); }
.revision-note-text { white-space: pre-wrap; margin: 2px 0 8px; font-size: 13px; }
.revision-links { margin: 14px 0 0; font-size: 14px; }

.status-tag { flex-shrink: 0; }
.status-tag.is-provisional { background: var(--color-warn-bg); color: var(--color-warn-text); }
.status-tag.is-cancelled { background: var(--color-neutral-bg); color: var(--color-neutral-text); }
.is-cancelled-booking { opacity: 0.6; }
.is-cancelled-booking .week-row-title { text-decoration: line-through; }

.signs-controls { max-width: var(--page-width); margin: 0 auto; padding: 0 20px 12px; }
.signs-controls .view-toggle { margin-bottom: 10px; }
.signs-main { max-width: var(--page-width); margin: 0 auto; padding: 0 20px 100px; }

.door-card {
  background: #ffffff; color: #1c1c1c; border: 2px solid #2a3692;
  border-radius: var(--radius); padding: 34px 28px; margin-bottom: 16px;
  text-align: center; display: flex; flex-direction: column; gap: 10px;
}
.door-card-date { margin: 0; font-size: 14px; color: #5a5a5a; }
.door-card-date::first-letter, .lobby-date::first-letter { text-transform: uppercase; }
.door-card-room { margin: 0; font-size: 38px; font-weight: 700; color: #2a3692; line-height: 1.1; }
.door-card-title { margin: 0; font-size: 24px; font-weight: 600; }
.door-card-time { margin: 0; font-size: 20px; font-variant-numeric: tabular-nums; }
.door-card-mark {
  margin: 14px 0 0; font-size: 12px; letter-spacing: 0.3em;
  text-transform: uppercase; color: #5a5a5a;
}

.lobby-board {
  background: #ffffff; color: #1c1c1c; border: 2px solid #2a3692;
  border-radius: var(--radius); padding: 28px;
}
.lobby-title { margin: 0; font-size: 30px; color: #2a3692; text-align: center; }
.lobby-date {
  margin: 4px 0 20px; text-align: center; color: #5a5a5a; font-size: 15px;
}
.lobby-empty { text-align: center; color: #5a5a5a; }
.lobby-row {
  display: flex; align-items: baseline; gap: 16px;
  padding: 12px 0; border-top: 1px solid #d2d6e2;
}
.lobby-row:first-of-type { border-top: none; }
.lobby-row-title { flex: 1; font-size: 20px; font-weight: 600; }
.lobby-row-room { font-size: 18px; color: #2a3692; font-weight: 700; }
.lobby-row-time {
  font-size: 16px; min-width: 9em; text-align: right;
  font-variant-numeric: tabular-nums;
}

@media print {
  .no-print { display: none !important; }
  .signs-main { max-width: none; padding: 0; }
  .door-card { break-after: page; border-width: 3px; margin: 0; min-height: 60vh; justify-content: center; }
  .door-card:last-child { break-after: auto; }
  .lobby-board { border: none; padding: 0; }
  .lobby-row { break-inside: avoid; }
}

.signs-pending { color: var(--color-warn-text); font-weight: 600; }

.page-intro { max-width: var(--page-width); margin: 14px auto 10px; padding: 0 20px; }
.page-intro .pill-btn { width: auto; margin: 0; text-decoration: none; }
.load-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.load-head h3 { margin: 0; }
.load-total {
  font-size: 20px; font-weight: 700; color: var(--color-primary-text);
  font-variant-numeric: tabular-nums;
}
.load-peak { margin: 10px 0; }
.load-peak-line { margin: 0 0 6px; font-size: 14px; font-weight: 600; }
.load-span {
  display: flex; gap: 10px; align-items: baseline; padding: 4px 0;
  font-size: 12px; color: var(--color-muted);
}
.load-span-time { font-variant-numeric: tabular-nums; min-width: 9em; flex-shrink: 0; }
.load-span-room { font-weight: 600; color: var(--color-text); flex: 1; }
.load-people {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--color-divider);
}
.load-people-label {
  display: flex; align-items: center; gap: 8px; flex-shrink: 0;
  font-size: 13px; font-weight: 600; white-space: nowrap;
}

.load-people input[type="number"].load-people-input {
  width: 4.5em; flex: 0 0 auto; margin: 0; min-height: 38px; text-align: center;
  font-variant-numeric: tabular-nums;
}
.load-verdict { font-size: 13px; color: var(--color-muted); }
.load-verdict.is-short { color: var(--color-error); font-weight: 700; }
.load-verdict.is-ok { color: var(--color-ok-text); font-weight: 600; }

body.has-shell {
  padding-left: calc(var(--rail-w) + var(--safe-left));
  padding-right: var(--safe-right);
  padding-bottom: calc(var(--tabbar-h) + var(--safe-bottom));
}

.top-bar {
  padding-top: calc(16px + var(--safe-top));
  position: sticky; top: 0; z-index: 20;
}

.fab { bottom: calc(24px + var(--tabbar-h) + var(--safe-bottom)); right: calc(20px + var(--safe-right)); }
.fab-secondary { bottom: calc(96px + var(--tabbar-h) + var(--safe-bottom)); }
.fab-secondary.fab-labelled { bottom: calc(88px + var(--tabbar-h) + var(--safe-bottom)); }

.nav-rail {
  position: fixed; left: 0; top: 0; bottom: 0; width: var(--rail-w);
  display: none; flex-direction: column;
  background: var(--color-surface); border-right: 1px solid var(--color-border);
  padding: 0 0 12px; z-index: 30; overflow-y: auto;
}

@media (min-width: 1024px) {
  .nav-rail { display: flex; }

  #nav-menu-btn, #nav-search-btn { display: none; }
}

.nav-rail-head {
  display: flex; align-items: center; gap: 4px;
  padding: 14px 10px 10px;
}
.nav-rail-brand {
  display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1;
  padding: 4px 6px; text-decoration: none;
  color: var(--color-primary-text); font-size: 17px; font-weight: 700;
}
.nav-rail-brand span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-rail-toggle {
  flex-shrink: 0; width: 34px; height: 34px; min-height: 0; margin: 0; padding: 0;
  border-radius: 9px; background: transparent; color: var(--color-muted);
  display: flex; align-items: center; justify-content: center;
}
.nav-rail-toggle:active { background: var(--color-accent-bg); }

.nav-rail-search {
  display: flex; align-items: center; gap: 8px; width: auto;
  margin: 0 12px 10px; padding: 9px 12px; min-height: 42px;
  background: var(--color-surface-sunken); border: 1.5px solid var(--color-border);
  border-radius: 10px; color: var(--color-muted);
  font-size: 14px; font-weight: 600; text-align: left;
}
.nav-rail-search > span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-rail-search:active { background: var(--color-accent-bg); }
.nav-rail-kbd {
  flex-shrink: 0; font-size: 11px; font-weight: 700; font-family: inherit;
  padding: 2px 6px; border-radius: 5px;
  background: var(--color-neutral-bg); color: var(--color-neutral-text);
}

.nav-rail .nav-panel-list { flex: 1; padding: 0 8px; }
.nav-rail .nav-panel-link {
  padding: 9px 12px; border-radius: 9px; font-size: 15px; gap: 12px;
}
.nav-rail .nav-panel-section-label { padding: 12px 12px 4px; }
.nav-rail .nav-panel-divider { margin: 8px 12px; }

.nav-rail-foot {
  border-top: 1px solid var(--color-divider); padding: 10px 8px 0; margin-top: 8px;
}
.nav-rail-who { padding: 4px 12px 8px; display: flex; flex-direction: column; }
.nav-rail-name {
  font-size: 14px; font-weight: 700;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.nav-rail-role { font-size: 12px; color: var(--color-muted); }

.tab-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: none;
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  padding: 0 var(--safe-right) var(--safe-bottom) var(--safe-left);
}

@media (max-width: 760px) {
  .tab-bar { display: flex; }
}

.tab-item {
  position: relative;
  flex: 1; min-width: 0; width: auto; margin: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; padding: 8px 2px; min-height: var(--tabbar-h);
  background: transparent; border: none; border-radius: 0;
  color: var(--color-muted); text-decoration: none;
  font-size: 16px; font-weight: 600;
}
.tab-item:active { background: var(--color-accent-bg); }
.tab-label {
  font-size: 10px; font-weight: 700; line-height: 1.1; text-align: center;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tab-item.is-active { color: var(--color-primary-text); }
.tab-item.is-active .tab-label { font-weight: 800; }

.tab-item.is-active::before {
  content: ""; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 28px; height: 3px;
  border-radius: 0 0 3px 3px; background: var(--color-primary-text);
}

.search-overlay {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(0, 0, 0, 0.45);
  display: flex; align-items: flex-start; justify-content: center;
  padding: max(24px, var(--safe-top)) 16px 24px;
}
.search-overlay.hidden { display: none; }

.search-panel {
  width: 100%; max-width: 620px; max-height: min(70vh, 640px);
  display: flex; flex-direction: column;
  background: var(--color-surface); border-radius: var(--radius);
  box-shadow: var(--shadow-raised); overflow: hidden;
}

.search-head {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-bottom: 1px solid var(--color-divider);
}
.search-head-icon { display: flex; color: var(--color-muted); flex-shrink: 0; }

input.search-input {
  flex: 1; min-width: 0; width: auto; min-height: 44px; margin: 0;
  border: none; background: transparent; font-size: 18px; font-weight: 600;
  color: var(--color-text); padding: 0; border-radius: 0;
}
.search-input:focus { outline: none; }
.search-close {
  width: 36px; height: 36px; min-height: 0; flex-shrink: 0; margin: 0; padding: 0;
  border-radius: 9px; background: var(--color-neutral-bg); color: var(--color-text);
}

.search-status {
  margin: 0; padding: 10px 16px; font-size: 13px; color: var(--color-muted);
  border-bottom: 1px solid var(--color-divider);
}
.search-results { overflow-y: auto; padding: 6px; }

.search-hit {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 10px; border-radius: 10px;
  text-decoration: none; color: inherit;
}
.search-hit + .search-hit { border-top: 1px solid var(--color-divider); }
.search-hit.is-cursor { background: var(--color-accent-bg); }
.search-hit-when {
  flex-shrink: 0; width: 88px; display: flex; flex-direction: column;
  font-variant-numeric: tabular-nums;
}
.search-hit-date { font-size: 13px; font-weight: 700; color: var(--color-primary-text); }
.search-hit-time { font-size: 12px; color: var(--color-muted); }
.search-hit-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.search-hit-title {
  font-size: 15px; font-weight: 700;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.search-hit-sub {
  font-size: 13px; color: var(--color-muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

@media (min-width: 1024px) and (pointer: fine) {
  :root { --tap-min: 44px; }
  body { font-size: 16px; }
  button, .btn { font-size: 16px; margin-top: 20px; }
  input[type="text"], input[type="search"], input[type="password"], input[type="date"],
  input[type="time"], input[type="number"], select, textarea { font-size: 16px; }
  .top-bar { padding-top: 12px; padding-bottom: 12px; }
  .top-bar h1 { font-size: 17px; }
}

@media (hover: hover) {
  .search-hit:hover { background: var(--color-accent-bg); }
  .nav-rail-search:hover { border-color: var(--color-primary-text); color: var(--color-text); }
  .week-row:hover, .daylist-ref:hover, .queue-card:hover,
  .day-card:hover, .day-ready:hover {
    background: var(--color-accent-bg);
  }
  .tab-item:hover { color: var(--color-primary-text); }
  .fab:hover { background: var(--color-primary-dark); }
}

@media print {
  .nav-rail, .tab-bar, .search-overlay { display: none !important; }
  body.has-shell { padding: 0 !important; }
  .top-bar { position: static; }
}

@media (min-width: 700px) {
  .view-toggle { justify-content: flex-start; }
  .view-toggle-btn { flex: 0 1 190px; }
  .week-nav { justify-content: flex-start; gap: 10px; }
  .days { flex: 0 1 auto; justify-content: flex-start; gap: 10px; }
  .daychip { width: 56px; }
  .heading-row h2 { font-size: 22px; }
}

@media (min-width: 700px) {
  .detail-main.is-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    align-items: start;
  }

  .detail-main.is-grid > .allergy-card,
  .detail-main.is-grid > .issues-card,
  .detail-main.is-grid > .changes-card,
  .detail-main.is-grid > .floorplan-conflict-banner,
  .detail-main.is-grid > .floorplan-tight-banner,
  .detail-main.is-grid > .offline-banner,
  .detail-main.is-grid > .empty-state,
  .detail-main.is-grid > .contact-card,
  .detail-main.is-grid > .state-card,
  .detail-main.is-grid > .notes-card,
  .detail-main.is-grid > .shortage-banner,

  .detail-main.is-grid > .day-group-header,
  .detail-main.is-grid > .session-group-heading,
  .detail-main.is-grid > .daylist-section-head,
  .detail-main.is-grid > .muted-note {
    grid-column: 1 / -1;
  }
}

@media (min-width: 700px) {
  .detail-main.is-grid.is-packed {
    display: block;
    column-width: 360px;
    column-gap: 14px;
  }

  .detail-main.is-grid.is-packed > * {
    break-inside: avoid;
    margin: 0 0 14px;
  }

  .detail-main.is-grid.is-packed > .allergy-card,
  .detail-main.is-grid.is-packed > .issues-card,
  .detail-main.is-grid.is-packed > .changes-card,
  .detail-main.is-grid.is-packed > .notes-card,
  .detail-main.is-grid.is-packed > .floorplan-conflict-banner,
  .detail-main.is-grid.is-packed > .floorplan-tight-banner,
  .detail-main.is-grid.is-packed > .offline-banner,
  .detail-main.is-grid.is-packed > .empty-state,
  .detail-main.is-grid.is-packed > .contact-card,
  .detail-main.is-grid.is-packed > .state-card,
  .detail-main.is-grid.is-packed > .shortage-banner,
  .detail-main.is-grid.is-packed > .day-group-header,
  .detail-main.is-grid.is-packed > .session-group-heading,
  .detail-main.is-grid.is-packed > .muted-note {
    column-span: all;
  }
}

@media (max-width: 760px) {

  #nav-menu-btn { display: none; }
}

@media (max-width: 560px) {
  .heading-row { flex-wrap: wrap; row-gap: 8px; }
  .heading-row h2 { flex: 1 1 auto; min-width: 0; }
  .heading-row-right { margin-left: auto; flex-shrink: 1; flex-wrap: wrap; justify-content: flex-end; row-gap: 8px; min-width: 0; }
  .top-bar { padding-left: 12px; padding-right: 12px; gap: 6px; }
  .top-bar h1 { font-size: 16px; }

  /* No room for the role on phones; the title matters more. */
  .day-role { display: none; }
}

.skeleton-card {
  background: var(--color-surface); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow-card);
  display: flex; flex-direction: column; gap: 10px;
}
.skeleton-line {
  display: block; height: 12px; border-radius: 6px;
  background: var(--color-divider);
  animation: skeleton-pulse 1.4s ease-in-out infinite;
}
.skeleton-line-title { height: 16px; width: 45%; background: var(--color-border-soft); }
.skeleton-line-short { width: 60%; }

@keyframes skeleton-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

@media (prefers-reduced-motion: reduce) {
  .skeleton-line { animation: none; }
}

.state-card {
  background: var(--color-surface); border-radius: var(--radius);
  padding: 24px 20px; box-shadow: var(--shadow-card);
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  text-align: center;
}
.state-message { margin: 0; font-size: 15px; color: var(--color-muted); }
.state-error { border: 2px solid var(--color-error); }
.state-error .state-message { color: var(--color-error); font-weight: 600; }
.state-retry {
  width: auto; min-height: 44px; margin: 0; padding: 10px 24px;
  font-size: 15px; background: var(--color-surface);
  color: var(--color-primary-text); border: 2px solid var(--color-primary-text);
}

.search-hit.no-action { opacity: 0.6; }
.search-hit.no-action .search-hit-date { color: var(--color-muted); }
.search-hit .no-action-tag { background: var(--color-neutral-bg); color: var(--color-neutral-text); flex-shrink: 0; }

.floorplan-rooms { display: none; flex-direction: column; gap: 6px; }
.floorplan-rooms h3 {
  margin: 4px 0 2px; font-size: 13px; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.04em; color: var(--color-muted);
}
.floorplan-room-row {
  display: flex; align-items: center; gap: 12px; width: 100%; margin: 0;
  min-height: 52px; padding: 8px 14px; text-align: left;
  background: var(--color-surface); color: inherit;
  border: 1.5px solid var(--color-border); border-radius: var(--radius);
  box-shadow: none; font-size: inherit; font-weight: inherit;
}
.floorplan-room-row:active { background: var(--color-accent-bg); }
.floorplan-room-row.is-selected {
  border-color: var(--color-primary-text); background: var(--color-accent-bg);
}
.floorplan-room-row .floorplan-legend-swatch { flex-shrink: 0; }

@media (max-width: 760px), (pointer: coarse) {
  .floorplan-rooms:not(.hidden) { display: flex; }
}
@media (hover: hover) {
  .floorplan-room-row:hover { background: var(--color-accent-bg); }
}

.section-card a[href^="tel:"] {
  display: inline-flex; align-items: center; min-height: 40px;
  padding: 4px 12px; margin: -2px 0; border-radius: 10px;
  background: var(--color-accent-bg); color: var(--color-primary-text);
  font-weight: 700; text-decoration: none;
}
@media (hover: hover) {
  .section-card a[href^="tel:"]:hover { background: var(--color-ok-bg); }
}

:root[data-rail="collapsed"] .nav-rail {
  align-items: stretch;
}
:root[data-rail="collapsed"] .nav-rail-head {
  flex-direction: column; gap: 6px; padding: 12px 6px 8px;
}
:root[data-rail="collapsed"] .nav-rail-brand {
  flex: 0 0 auto; justify-content: center; padding: 4px;
}
:root[data-rail="collapsed"] .nav-rail-brand span { display: none; }

:root[data-rail="collapsed"] .nav-rail-search {
  margin: 0 10px 8px; padding: 0; justify-content: center;
  height: 42px; min-height: 42px;
}
:root[data-rail="collapsed"] .nav-rail-search > span,
:root[data-rail="collapsed"] .nav-rail-kbd { display: none; }

:root[data-rail="collapsed"] .nav-rail .nav-panel-list { padding: 0 10px; }
:root[data-rail="collapsed"] .nav-rail .nav-panel-link {
  justify-content: center; padding: 11px 0; gap: 0;
}
:root[data-rail="collapsed"] .nav-rail .nav-panel-link > span:not(.count-badge),
:root[data-rail="collapsed"] .nav-rail .nav-panel-value { display: none; }
/* Folded to icons, a count still shows: it sits on the icon's corner rather than going with the words. */
:root[data-rail="collapsed"] .nav-rail .nav-panel-link > .count-badge {
  position: absolute; top: 2px; right: 6px; margin: 0; min-width: 18px; height: 18px; font-size: 11px;
}

:root[data-rail="collapsed"] .nav-rail .nav-panel-section-label { display: none; }
:root[data-rail="collapsed"] .nav-rail .nav-panel-divider { margin: 8px 6px; }

:root[data-rail="collapsed"] .nav-rail-foot { padding: 8px 10px 0; }
:root[data-rail="collapsed"] .nav-rail-who { display: none; }

.notes-card { border-left: 4px solid var(--color-warn-border); }

.note-list { display: flex; flex-direction: column; gap: 10px; margin: 12px 0 18px; }

.note {
  background: var(--color-warn-bg);
  border: 1px solid var(--color-warn-border);
  border-radius: 10px; padding: 12px 14px;
  display: flex; flex-direction: column; gap: 6px;
}

.note-must-read { border-width: 2px; box-shadow: var(--shadow-card); }

.note-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.note-author { font-size: 13px; font-weight: 800; color: var(--color-warn-text); }
.note-when { font-size: 11px; color: var(--color-warn-text-soft); flex-shrink: 0; }

.note-body {
  margin: 0; font-size: 15px; color: var(--color-text);
  white-space: pre-line; overflow-wrap: anywhere;
}

.note-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.note-audience { background: var(--color-neutral-bg); color: var(--color-neutral-text); }

.note-audience.is-targeted { background: var(--color-accent-bg); color: var(--color-primary-text); }

.note-required { background: var(--color-error); color: var(--color-surface); }

.note-acks { display: flex; flex-direction: column; gap: 2px; }
.note-ack, .note-ack-none, .note-ack-done {
  font-size: 11px; color: var(--color-warn-text-soft);
}
.note-ack-done { font-weight: 700; }

.note-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 2px; }
.note-ack-btn {
  width: auto; margin: 0; min-height: 40px; padding: 8px 18px;
  font-size: 14px; border-radius: 999px;
}
.note-link-btn {
  width: auto; margin: 0; min-height: 36px; padding: 4px 2px;
  font-size: 13px; font-weight: 700; background: none; border: none;
  color: var(--color-primary-text); text-decoration: underline; text-underline-offset: 3px;
}
.note-link-btn:active { background: none; transform: none; }
.note-link-btn.note-delete { margin-left: auto; color: var(--color-muted); font-weight: 600; }
.note-link-btn.note-delete:hover { color: var(--color-error); }
.note-reply-wrap { display: contents; }
.note-reply-wrap .note-reply-form { flex-basis: 100%; }

.note-form-wrap { margin-top: 4px; }
.note-form-summary {
  cursor: pointer; list-style: none; padding: 12px 0 4px;
  font-weight: 700; font-size: 15px; color: var(--color-primary-text);
  display: flex; align-items: center; gap: 8px; min-height: 44px;
}
.note-form-summary::-webkit-details-marker { display: none; }
.note-form-summary::before {
  content: "+"; font-size: 18px; font-weight: 800; line-height: 1;
}
.note-form-wrap[open] .note-form-summary::before { content: "–"; }

.note-form { display: flex; flex-direction: column; }
.note-form textarea {
  width: 100%; font-size: 16px; padding: 10px 12px; border-radius: 10px;
  border: 2px solid var(--color-border); background: var(--color-surface-sunken);
  color: var(--color-text); font-family: inherit; resize: vertical;
}
.note-form .error:empty { min-height: 0; margin: 0; }

.mustread-overlay {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(0, 0, 0, 0.6);
  display: flex; align-items: center; justify-content: center;
  padding: max(20px, var(--safe-top)) 16px max(20px, var(--safe-bottom));
}
.mustread-overlay.hidden { display: none; }
body.mustread-open { overflow: hidden; }

.mustread-panel {
  width: 100%; max-width: 480px; max-height: 90vh; overflow-y: auto;
  background: var(--color-warn-bg);
  border: 3px solid var(--color-warn-border); border-radius: var(--radius);
  box-shadow: var(--shadow-raised);
  padding: 22px 20px;
  display: flex; flex-direction: column; gap: 12px;
}

.mustread-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.mustread-title { margin: 0; font-size: 19px; color: var(--color-warn-text); }
.mustread-counter {
  font-size: 13px; font-weight: 700; color: var(--color-warn-text-soft);
  font-variant-numeric: tabular-nums; flex-shrink: 0;
}

.mustread-body { display: flex; flex-direction: column; gap: 8px; }
.mustread-where { margin: 0; font-size: 13px; font-weight: 700; color: var(--color-warn-text-soft); }
.mustread-booking { margin: 0; font-size: 17px; font-weight: 800; color: var(--color-text); }
.mustread-text {
  margin: 0; padding: 14px; border-radius: 10px;
  background: var(--color-surface); color: var(--color-text);
  font-size: 17px; line-height: 1.45; white-space: pre-line; overflow-wrap: anywhere;
}
.mustread-from { margin: 0; font-size: 12px; color: var(--color-warn-text-soft); }
.mustread-open {
  align-self: flex-start; font-size: 14px; font-weight: 700;
  color: var(--color-primary-text);
}

.mustread-panel .error:empty { min-height: 0; margin: 0; }
.mustread-ack { margin: 0; min-height: var(--tap-min); }

.report-stat.is-warn { box-shadow: inset 0 0 0 2px var(--color-warn-border), var(--shadow-card); }
.report-stat.is-error { box-shadow: inset 0 0 0 2px var(--color-error), var(--shadow-card); }
.report-stat.is-error .report-stat-value { color: var(--color-error); }
.overview-stat-sub { font-weight: 600; }

@media (min-width: 700px) {
  #overview-body.is-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .detail-main.is-grid > .overview-alerts,
  .detail-main.is-grid > .overview-week { grid-column: 1 / -1; }
}

.schedule-card-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
}
.schedule-card-head h3 { margin: 0; }
.schedule-card-count { font-size: 13px; font-weight: 600; color: var(--color-muted); flex-shrink: 0; }

.shift-repeat { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin: 10px 0 4px; }
.shift-repeat-label { font-size: 14px; font-weight: 600; color: var(--color-muted); }
.shift-repeat .shift-repeat-btn {
  width: auto; margin: 0; background: var(--color-surface); color: var(--color-primary-text);
  border: 2px solid var(--color-border-soft);
}
.shift-repeat .shift-repeat-btn:hover { border-color: var(--color-primary-text); }
.shift-repeat .error { flex-basis: 100%; margin: 0; }
/* Adding shifts: who, then hours, then an optional note, in one calm panel. */
.shift-form {
  display: grid; gap: 18px; margin: 6px 0 4px; padding: 16px;
  background: var(--color-bg); border: 1px solid var(--color-border-soft); border-radius: var(--radius);
}
.shift-form label { margin: 0; }
.shift-form input[type="text"], .shift-form input[type="search"], .shift-form input[type="time"] {
  min-height: 46px; padding: 10px 14px; font-size: 16px; border-radius: 12px; background: var(--color-surface);
}
.shift-form p.shift-form-for { margin: 0; font-size: 15px; font-weight: 700; color: var(--color-text); }
.shift-form-for::first-letter { text-transform: uppercase; }
.shift-step { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.shift-step-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 28px; }
.shift-form p.shift-step-title {
  margin: 0; font-size: 12px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--color-muted);
}
.shift-step-head .note-link-btn { min-height: 28px; padding: 2px 0; }
.shift-people { display: flex; flex-wrap: wrap; gap: 8px; }
.shift-person { position: relative; display: inline-flex; max-width: 100%; cursor: pointer; font-weight: 600; }
.shift-person input {
  position: absolute; inset: 0; width: 100%; height: 100%; min-height: 0; margin: 0; opacity: 0; cursor: pointer;
}
.shift-person-face {
  display: inline-flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; min-height: 42px; max-width: 100%;
  padding: 7px 14px 7px 10px; border: 2px solid var(--color-border); border-radius: 999px;
  background: var(--color-surface); color: var(--color-text); font-size: 15px; line-height: 1.2;
  transition: background-color 0.12s ease, border-color 0.12s ease;
}
.shift-person:hover .shift-person-face { border-color: var(--color-primary-text); }
.shift-person-tick { width: 20px; height: 20px; flex-shrink: 0; color: var(--color-muted); }
.shift-person-tick .tick { opacity: 0; }
.shift-person-already { font-size: 12px; font-weight: 600; color: var(--color-muted); }
.shift-person input:checked + .shift-person-face {
  background: var(--color-primary); border-color: var(--color-primary); color: var(--color-on-primary);
}
.shift-person input:checked + .shift-person-face .shift-person-tick { color: inherit; }
.shift-person input:checked + .shift-person-face .tick { opacity: 1; }
.shift-person input:checked + .shift-person-face .shift-person-already { color: inherit; opacity: 0.85; }
.shift-person input:focus-visible + .shift-person-face { outline: 3px solid var(--color-primary-text); outline-offset: 2px; }
.shift-new-toggle { align-self: flex-start; }
.shift-new { display: flex; flex-direction: column; gap: 6px; }
.shift-new label { font-size: 14px; }
.shift-form .shift-new p.muted-note { margin: 0; font-size: 13px; }

.shift-presets { display: flex; flex-wrap: wrap; gap: 8px; }
.shift-preset {
  width: auto; margin: 0; min-height: 40px; padding: 6px 14px; border-radius: 999px;
  border: 2px solid var(--color-border-soft); background: var(--color-surface); color: var(--color-primary-text);
  font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums;
}
.shift-preset:hover { border-color: var(--color-primary-text); }
.shift-preset:active { background: var(--color-accent-bg); }
.shift-preset.is-active { background: var(--color-accent-bg); border-color: var(--color-primary-text); }
.shift-times { display: flex; align-items: flex-end; gap: 10px; }
.shift-time-field { display: flex; flex-direction: column; gap: 4px; flex: 1 1 0; max-width: 190px; min-width: 0; }
.shift-time-field label, .shift-note-field label { font-size: 13px; font-weight: 700; color: var(--color-muted); }
.shift-time-field input { font-variant-numeric: tabular-nums; }
.shift-times-arrow { padding-bottom: 12px; color: var(--color-muted); font-weight: 700; }
.shift-form p.shift-length { margin: -2px 0 0; min-height: 20px; font-size: 14px; font-weight: 700; color: var(--color-primary-text); }
.shift-note-field { display: flex; flex-direction: column; gap: 4px; }

.shift-form-footer { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.shift-submit {
  width: auto; margin: 0; min-height: 48px; padding: 0 24px; border-radius: 999px; font-size: 16px;
}
.shift-form-footer p.error { margin: 0; min-height: 0; flex: 1 1 200px; font-size: 14px; color: var(--color-error); }
.shift-form-footer p.error:empty { display: none; }
.shift-form-footer p.shift-form-notice { margin: 0; flex-basis: 100%; font-size: 14px; font-weight: 700; }
.shift-form-footer p.shift-form-notice.is-ok { color: var(--color-ok-text); }
.shift-form-footer p.shift-form-notice.is-warn { color: var(--color-warn-text); }

@media (min-width: 900px) {
  .shift-form {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    grid-template-areas: "for for" "who when" "who nights" "who note" "who footer";
    grid-template-rows: auto auto auto auto 1fr;
    column-gap: 36px; padding: 20px 22px;
  }
  .shift-date-field { grid-area: for; }
  .shift-nights { grid-area: nights; }
  .shift-who { grid-area: who; }
  .shift-when { grid-area: when; }
  .shift-note-field { grid-area: note; }
  .shift-form-footer { grid-area: footer; align-self: start; }
}
@media (max-width: 420px) {
  .shift-form { padding: 14px 12px; }
  .shift-submit { width: 100%; }
  .shift-preset { padding: 6px 10px; font-size: 13px; }
}

.who-list { display: flex; flex-direction: column; margin-top: 4px; }
.who-row { padding: 10px 0; border-top: 1px solid var(--color-divider); }
.who-row:first-child { border-top: none; }
.who-line { display: flex; align-items: center; gap: 4px 12px; flex-wrap: wrap; }
.who-name { flex: 1 1 0; min-width: 110px; font-size: 17px; font-weight: 700; overflow-wrap: anywhere; }
.who-hours { font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--color-primary-text); white-space: nowrap; }
.who-note { margin: 2px 0 0; font-size: 14px; color: var(--color-muted); }
.who-track {
  position: relative; height: 10px; margin-top: 8px; border-radius: 6px; overflow: hidden;
  background-color: var(--color-accent-bg);
  background-image: linear-gradient(to right, var(--color-divider) 1px, transparent 1px);
  background-size: calc(100% / var(--hours, 1)) 100%;
}
.who-bar { position: absolute; top: 0; bottom: 0; border-radius: 6px; background: var(--color-primary-text); }
.who-now { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: #f5a623; }
.who-ruler { position: relative; height: 18px; margin-top: 8px; font-size: 12px; color: var(--color-muted); }
.who-ruler span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.who-ruler .is-first { transform: none; }
.who-ruler .is-last { transform: translateX(-100%); }
.schedule-card:not(.is-editing) .who-line .item-delete-btn { display: none; }
@media (min-width: 900px) {
  #schedule-body { display: grid; grid-template-columns: repeat(auto-fit, minmax(440px, 1fr)); gap: 16px; align-items: start; }
  #schedule-body > .schedule-card { margin: 0; }
}
.now-team { margin: 10px 0 4px; font-size: 13px; text-transform: uppercase; color: var(--color-muted); }
.schedule-manage { margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--color-divider); }
.schedule-manage-summary, .schedule-load-summary { cursor: pointer; font-weight: 700; color: var(--color-primary-text); min-height: 40px; display: flex; align-items: center; gap: 10px; }
.schedule-load { margin-top: 10px; }
.team-load { margin-top: 10px; }
.team-load h4 { margin: 0; font-size: 14px; color: var(--color-muted); font-weight: 700; }
.load-people-hint { flex: 1 1 14em; font-size: 12px; color: var(--color-muted); }
.load-people-input::placeholder { color: var(--color-muted); opacity: 1; }
.team-load .error:empty { min-height: 0; margin: 0; }

.overview-alert {
  display: block; text-decoration: none; color: inherit;
  padding: 10px 12px; margin-top: 8px;
  border-radius: 10px; border-left: 4px solid var(--color-border);
  background: var(--color-surface-sunken);
}
.overview-alert:hover { background: var(--color-accent-bg); }
.overview-alert.is-error { border-left-color: var(--color-error); background: var(--color-allergy-bg); }
.overview-alert.is-warning { border-left-color: var(--color-warn-border); background: var(--color-warn-bg); }
.overview-alert-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; }
.overview-alert-title { font-size: 15px; font-weight: 700; color: var(--color-text); }
.overview-alert-when {
  font-size: 12px; color: var(--color-muted); margin-left: auto; flex-shrink: 0;
}
.overview-alert-body {
  margin: 4px 0 0; font-size: 13px; color: var(--color-text);
  white-space: normal; overflow-wrap: anywhere;
}
.overview-sev { flex-shrink: 0; background: var(--color-neutral-bg); color: var(--color-neutral-text); }
.overview-alert.is-error .overview-sev { background: var(--color-error); color: #ffffff; }
.overview-alert.is-warning .overview-sev { background: var(--color-warn-border); color: #1c1c1c; }
.overview-clear {
  margin: 8px 0 0; padding: 14px; border-radius: 10px;
  background: var(--color-ok-bg); color: var(--color-ok-text);
  font-size: 15px; font-weight: 600;
}

.overview-day-list { display: flex; flex-direction: column; }
.overview-day-row {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 0; border-top: 1px solid var(--color-divider);
  text-decoration: none; color: inherit;
}
.overview-day-row:first-child { border-top: none; }
.overview-day-row.is-done { opacity: 0.55; }
.overview-day-time {
  display: flex; flex-direction: column; width: 58px; flex-shrink: 0;
  font-size: 13px; font-weight: 700; color: var(--color-primary-text);
  font-variant-numeric: tabular-nums;
}
.overview-day-end { font-weight: 600; color: var(--color-muted); }
.overview-day-body { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
.overview-day-head { display: flex; align-items: baseline; gap: 6px; min-width: 0; }
.overview-day-title {
  font-size: 15px; font-weight: 600; color: var(--color-text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.overview-day-sub { font-size: 12px; color: var(--color-muted); overflow-wrap: anywhere; }
.overview-state {
  flex-shrink: 0; font-size: 11px; font-weight: 700; padding: 3px 9px;
  border-radius: 999px; background: var(--color-neutral-bg); color: var(--color-neutral-text);
}
.overview-state.is-setup { background: var(--color-phase-setup); color: #1c1c1c; }
.overview-state.is-on { background: var(--color-primary); color: var(--color-on-primary); }
.overview-state.is-strip { background: var(--color-phase-strip); color: #ffffff; }

.overview-team { padding: 10px 0; border-top: 1px solid var(--color-divider); }
.overview-team:first-of-type { border-top: none; }
.overview-team-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.overview-team-name { font-size: 15px; font-weight: 700; }
.overview-team-roster { font-size: 13px; font-weight: 600; color: var(--color-primary-text); flex-shrink: 0; }
.overview-team-window, .overview-team-load, .overview-team-verdict {
  display: block; font-size: 12px; color: var(--color-muted); margin-top: 2px;
}
.overview-team-load { color: var(--color-primary-text); }
.overview-team-verdict.is-short { color: var(--color-error); font-weight: 700; }
.overview-team-verdict.is-ok { color: var(--color-ok-text); font-weight: 600; }

.overview-week-strip { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.overview-week-day {
  width: auto; margin: 0; min-height: 0; padding: 8px 4px;
  background: var(--color-surface-sunken); border: 2px solid transparent;
  border-radius: 10px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 4px;
}
.overview-week-day.is-selected { border-color: var(--color-primary); }
.overview-week-day.is-today .overview-week-num { color: var(--color-primary-text); }
.overview-week-dow { font-size: 10px; text-transform: uppercase; color: var(--color-muted); }
.overview-week-num { font-size: 15px; font-weight: 700; color: var(--color-text); }
.overview-week-bar {
  width: 100%; height: 40px; display: flex; align-items: flex-end;
  background: var(--color-divider); border-radius: 4px; overflow: hidden;
}
.overview-week-bar-fill { display: block; width: 100%; background: var(--color-primary); }
.overview-week-count {
  font-size: 11px; color: var(--color-muted); font-variant-numeric: tabular-nums;
}
.overview-week-flag {
  font-size: 10px; font-weight: 700; padding: 1px 7px; border-radius: 999px;
}
.overview-week-flag.is-conflict { background: var(--color-error); color: #ffffff; }
.overview-week-flag.is-pending { background: var(--color-warn-bg); color: var(--color-warn-text); }

.overview-activity-list { display: flex; flex-direction: column; }
.overview-activity-row {
  display: flex; gap: 10px; padding: 7px 0;
  border-top: 1px solid var(--color-divider);
}
.overview-activity-row:first-child { border-top: none; }
.overview-activity-time {
  font-size: 11px; color: var(--color-muted); width: 104px; flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}
.overview-activity-body { display: flex; flex-direction: column; min-width: 0; }
.overview-activity-action { font-size: 13px; font-weight: 600; color: var(--color-text); }
.overview-activity-who { font-size: 12px; color: var(--color-muted); overflow-wrap: anywhere; }
.overview-more { display: inline-block; margin-top: 10px; font-size: 13px; font-weight: 600; }

.overview-sys-row {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  padding: 6px 0; border-top: 1px solid var(--color-divider); font-size: 13px;
}
.overview-sys-row:first-of-type { border-top: none; }
.overview-sys-label { color: var(--color-muted); }
/* Sub-notes can be a sentence long: let them wrap instead of widening the page. */
.overview-sys-value {
  font-weight: 700; font-variant-numeric: tabular-nums;
  min-width: 0; text-align: right; overflow-wrap: anywhere;
}
.overview-sys-sub { font-weight: 500; color: var(--color-muted); font-size: 12px; }

@media (max-width: 560px) {
  .overview-week-strip { gap: 4px; }
  .overview-week-bar { height: 28px; }
  .overview-alert-when { margin-left: 0; }

  .overview-activity-row { flex-direction: column; gap: 0; }
  .overview-activity-time { width: auto; }
}

.duration-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: end; }
.duration-pair input { width: 100%; box-sizing: border-box; }
.config-exceptions { margin-top: 20px; }
.config-exceptions-summary { cursor: pointer; font-weight: 600; padding: 10px 0; }

.flash-toast {
  position: fixed; z-index: 920; left: calc(50% + var(--rail-w) / 2); transform: translateX(-50%);
  bottom: calc(20px + var(--tabbar-h) + var(--safe-bottom));
  width: max-content; max-width: min(480px, calc(100vw - 32px)); padding: 12px 18px; border-radius: 12px;
  background: var(--color-text); color: var(--color-bg); font-size: 15px; font-weight: 600; line-height: 1.35;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.3); animation: flash-in 0.2s ease-out;
  transition: opacity 0.4s ease;
}
body.has-fabs .flash-toast { bottom: calc(96px + var(--tabbar-h) + var(--safe-bottom)); }
.flash-toast.is-leaving { opacity: 0; }
@keyframes flash-in { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }
@media (prefers-reduced-motion: reduce) { .flash-toast { animation: none; transition: none; } }
@media print { .flash-toast { display: none; } }

.install-banner {
  position: fixed; left: 12px; right: 12px; z-index: 900;
  bottom: calc(76px + env(safe-area-inset-bottom));
  display: flex; align-items: center; gap: 10px; padding: 12px 14px;
  background: var(--color-primary); color: #fff; border-radius: 14px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
}
.install-banner-text { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 2px; font-size: 14px; line-height: 1.3; }

.install-banner-btn {
  flex: 0 0 auto; width: auto; margin: 0; min-height: 40px; padding: 0 16px; border: 0; border-radius: 10px;
  background: #fff; color: var(--color-primary); font-weight: 700; font-size: 15px;
}
.install-banner-close {
  flex: 0 0 auto; width: 36px; min-height: 36px; height: 36px; margin: 0; padding: 0; border: 0; background: transparent;
  color: #fff; font-size: 26px; line-height: 1;
}
@media (min-width: 900px) {
  .install-banner { max-width: 480px; left: auto; bottom: 20px; }
}
@media print { .install-banner { display: none; } }

.sign-editable { outline: 1px dashed transparent; outline-offset: 3px; border-radius: 4px; }
.sign-editable:hover, .sign-editable:focus { outline-color: var(--color-primary); }
.sign-editable:focus { background: var(--color-accent-bg); }
.sign-fix-btn {
  width: auto; align-self: center; margin-top: 10px; min-height: 36px; padding: 0 14px;
  border: 1px solid var(--color-border); border-radius: 10px;
  background: transparent; color: var(--color-primary-text); font-size: 14px;
}
@media print {
  .sign-editable { outline: none; background: none; }
  .sign-fix-btn { display: none; }
}

.unmatched-row { display: flex; gap: 8px; align-items: stretch; margin: 6px 0 14px; }
.unmatched-row select, .unmatched-row input { flex: 1 1 auto; min-width: 0; margin: 0; }
.unmatched-row button { flex: 0 0 auto; width: auto; padding: 0 16px; margin: 0; }

.update-bar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center; gap: 12px;
  padding: calc(8px + env(safe-area-inset-top)) 12px 8px;
  background: #b7791f; color: #fff; font-size: 14px; font-weight: 600;
}
.update-bar button {
  width: auto; min-height: 34px; margin: 0; padding: 0 14px; border: 0; border-radius: 8px;
  background: #fff; color: #7a4f10; font-size: 14px; font-weight: 700;
}
@media print { .update-bar { display: none; } }

.user-locked { display: flex; flex-direction: column; gap: 8px; margin: 8px 0 12px; padding: 10px 12px;
  border: 1px solid #b7791f; border-radius: 10px; background: rgba(183, 121, 31, 0.12); }
.locked-tag { align-self: flex-start; background: #b7791f; color: #fff; }

.proc-search-row { position: sticky; top: 0; z-index: 5; padding: 8px 0; background: var(--color-bg); }
.proc-search { width: 100%; box-sizing: border-box; min-height: 44px; margin: 0; }
.proc-category { margin: 18px 0 6px; font-size: 15px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--color-muted); }
.proc-card { padding: 0; }
.proc-summary { cursor: pointer; list-style: none; padding: 14px 16px; }
.proc-summary::-webkit-details-marker { display: none; }
.proc-title { font-weight: 700; font-size: 17px; }
.proc-content { padding: 0 16px 14px; }
.proc-body p { margin: 0 0 10px; line-height: 1.5; }
.proc-list { margin: 0 0 10px; padding-left: 22px; line-height: 1.55; }
.proc-list li { margin-bottom: 6px; }
.proc-subheading { margin: 14px 0 6px; font-size: 15px; }
.proc-chip {
  display: inline-block; margin: 0 2px; padding: 2px 10px; min-height: 30px;
  border: 1px dashed var(--color-primary); border-radius: 8px;
  background: var(--color-accent-bg); color: inherit; font: inherit; font-weight: 600; cursor: pointer; width: auto;
}
.proc-chip.is-copied { background: var(--color-primary); color: #fff; border-style: solid; }
.proc-meta { margin-top: 12px; }
.proc-form label { display: block; margin: 12px 0 4px; font-weight: 600; }
.proc-form input[type=text], .proc-form textarea { width: 100%; box-sizing: border-box; }
.proc-audience { margin: 14px 0 0; border: 1px solid var(--color-border); border-radius: 10px; padding: 8px 12px; }
.proc-audience-row { display: block; margin: 6px 0; font-weight: 400; }
.proc-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }

.maint-time {
  display: flex; align-items: center; gap: 10px; padding: 4px 20px 10px;
  max-width: 1000px; margin: 0 auto;
}
.maint-time label { margin: 0; font-weight: 600; }
.maint-time input[type=time] { width: auto; margin: 0; min-height: 44px; }
.maint-time .pill-btn { width: auto; margin: 0; font-size: 14px; }
.maint-state { font-weight: 700; margin: 4px 0 10px; }
.maint-rentals { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.maint-rental { padding: 10px 12px; border: 1px solid var(--color-border); border-radius: 10px; }
.maint-rental p { margin: 2px 0; }
.maint-rental-main { font-weight: 700; font-size: 17px; }
.maint-notes-heading { margin: 16px 0 6px; font-size: 15px; }
.maint-note { padding: 10px 12px; margin-bottom: 8px; border-left: 4px solid #b7791f; background: rgba(183, 121, 31, 0.1); border-radius: 6px; }
.maint-note-body { margin: 0 0 4px; line-height: 1.4; }
.maint-note-remove { width: auto; margin: 6px 0 0; font-size: 14px; min-height: 36px; padding: 0 12px; }
.maint-note-dot { flex: 0 0 auto; min-width: 22px; padding: 1px 6px; border-radius: 11px; background: #b7791f; color: #fff; font-size: 13px; font-weight: 700; text-align: center; }
.maint-form textarea { width: 100%; box-sizing: border-box; }
.maint-form label { display: block; margin: 10px 0 4px; font-weight: 600; }

/* Maintenance map: one distinct hue per state plus a pattern, so the plan
   still reads on a tablet in glare or dim light (the plan itself is drawn in
   light blue, so shades of navy disappear into it). Green = free now,
   red = rented, striped orange = setup, striped purple = teardown. */
.maint-view .state-free, .maint-view .floorplan-hotspot[data-state="free"],
.maint-view .state-has-sessions, .maint-view .floorplan-hotspot[data-state="has-sessions"] { --maint-rgb: 23, 122, 66; }
.maint-view .state-occupied, .maint-view .floorplan-hotspot[data-state="occupied"] { --maint-rgb: 193, 18, 31; }
.maint-view .state-setup, .maint-view .floorplan-hotspot[data-state="setup"] { --maint-rgb: 240, 140, 0; }
.maint-view .state-strip, .maint-view .floorplan-hotspot[data-state="strip"] { --maint-rgb: 125, 60, 152; }

.maint-view .floorplan-hotspot,
.maint-view .floorplan-legend-swatch {
  opacity: 1; box-sizing: border-box;
  border: 3px solid rgb(var(--maint-rgb)); background: rgba(var(--maint-rgb), 0.3);
}
.maint-view .floorplan-hotspot[data-state="has-sessions"],
.maint-view .floorplan-legend-swatch.state-has-sessions {
  border-style: dashed; background: rgba(var(--maint-rgb), 0.12);
}
.maint-view .floorplan-hotspot[data-state="occupied"],
.maint-view .floorplan-legend-swatch.state-occupied { background: rgba(var(--maint-rgb), 0.55); }
.maint-view .floorplan-hotspot[data-state="setup"],
.maint-view .floorplan-legend-swatch.state-setup {
  background: repeating-linear-gradient(45deg,
    rgba(var(--maint-rgb), 0.7) 0 5px, rgba(var(--maint-rgb), 0.2) 5px 10px);
}
.maint-view .floorplan-hotspot[data-state="strip"],
.maint-view .floorplan-legend-swatch.state-strip {
  background: repeating-linear-gradient(-45deg,
    rgba(var(--maint-rgb), 0.65) 0 5px, rgba(var(--maint-rgb), 0.18) 5px 10px);
}
.maint-view .floorplan-hotspot.is-selected {
  z-index: 1; outline: 3px solid #111111; outline-offset: 1px;
  box-shadow: 0 0 0 5px #ffffff;
}

.maint-view .floorplan-legend { gap: 10px 18px; font-size: 14px; font-weight: 600; color: var(--color-text); }
.maint-view .floorplan-legend-swatch { width: 22px; height: 22px; border-radius: 5px; }
.maint-view .floorplan-room-row .floorplan-legend-swatch { width: 28px; height: 28px; border-radius: 6px; }

.maint-view .maint-state {
  display: inline-block; padding: 4px 12px; border-radius: 999px;
  border: 2px solid transparent;
}
.maint-view .state-text-free { background: #177a42; color: #ffffff; }
.maint-view .state-text-has-sessions { border: 2px dashed var(--color-ok-text); color: var(--color-text); }
.maint-view .state-text-occupied { background: #c1121f; color: #ffffff; }
.maint-view .state-text-setup { background: #f08c00; color: #1c1c1c; }
.maint-view .state-text-strip { background: #7d3c98; color: #ffffff; }
.room-notes-block { margin: 8px 16px 12px; padding: 10px 14px; border-left: 4px solid #b7791f; background: rgba(183, 121, 31, 0.12); border-radius: 8px; }
.room-notes-block h3 { margin: 0 0 6px; font-size: 14px; letter-spacing: 0.04em; text-transform: uppercase; }
.room-notes-row { margin: 4px 0; line-height: 1.4; }

.twofa-qr { display: block; width: 220px; height: 220px; margin: 10px auto; padding: 10px; background: #fff; border-radius: 10px; }
.twofa-open { display: block; text-align: center; margin: 6px 0 12px; font-weight: 700; }
.twofa-key { font-family: ui-monospace, Consolas, monospace; font-size: 18px; letter-spacing: 0.06em; word-break: break-all; text-align: center; margin: 4px 0 10px; }
.twofa-copy { width: auto; margin: 4px 0 10px; font-size: 14px; min-height: 40px; padding: 0 16px; }
.twofa-confirm input { width: 100%; box-sizing: border-box; margin-bottom: 8px; }
.twofa-confirm .btn-primary-full, .twofa-confirm .btn-secondary-full, .twofa-confirm .btn-danger-full { margin-top: 8px; }
.twofa-codes { list-style: none; margin: 10px 0; padding: 12px; columns: 2; column-gap: 20px; font-family: ui-monospace, Consolas, monospace; font-size: 17px; border: 1px dashed var(--color-primary); border-radius: 10px; }
.twofa-codes li { margin: 4px 0; }
.twofa-subheading { margin: 16px 0 4px; font-size: 15px; font-weight: 700; }
.webauthn-section .item-row { margin: 6px 0; }
.user-2fa { display: flex; flex-direction: column; gap: 8px; margin: 8px 0 12px; }
.user-2fa .tag { align-self: flex-start; }
#totp-form.hidden { display: none; }

.twofa-app { margin: 4px 0; padding: 8px 10px; border-left: 3px solid var(--color-primary); background: var(--color-accent-bg); border-radius: 6px; }
.user-2fa-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

.search-group { padding: 10px 14px 4px; font-size: 12px; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; color: var(--color-muted); }
.search-hit-procedure .search-hit-when { align-items: center; justify-content: center; color: var(--color-primary-text); }
.search-hit-asked { color: var(--color-primary-text); font-weight: 600; }

.repeat-row { display: flex; align-items: center; gap: 10px; margin: 8px 0; }
.repeat-row select, .repeat-row input { margin: 0; width: auto; min-height: 44px; }
.repeat-row input { width: 80px; }
.repeat-more { font-weight: 600; }
.repeat-result { margin-top: 10px; }
.repeat-dates { margin: 6px 0; padding-left: 20px; }
.repeat-dates li { margin: 4px 0; }

.push-kinds { margin: 12px 0; padding: 8px 12px; border: 1px solid var(--color-border); border-radius: 10px; }
.push-kinds legend { padding: 0 6px; font-weight: 700; }
.push-kind-row { display: flex; align-items: flex-start; gap: 10px; margin: 10px 0; font-weight: 400; }
.push-kind-row input { flex: 0 0 auto; width: 22px; height: 22px; margin: 2px 0 0; }

.client-page { max-width: 560px; margin: 0 auto; padding: calc(24px + var(--safe-top)) 20px 40px; display: flex; flex-direction: column; gap: 16px; }
.client-head { display: flex; align-items: center; gap: 14px; }
.client-head h1 { margin: 0; font-size: 22px; }
.client-head p { margin: 2px 0 0; }
#client-body { display: flex; flex-direction: column; gap: 12px; }
.client-date { font-size: 17px; font-weight: 800; }
.client-time { font-size: 16px; }
.client-room { font-size: 16px; font-weight: 700; color: var(--color-primary-text); }

.share-body { display: flex; flex-direction: column; gap: 10px; padding-top: 8px; }
.share-body p { margin: 0; }
.share-output { display: flex; flex-direction: column; gap: 8px; }
.share-output input { margin: 0; min-height: 44px; width: 100%; box-sizing: border-box; }
.share-actions { display: flex; flex-direction: column; gap: 8px; }

.trash-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--color-border-soft); }
.trash-row:first-child { border-top: none; }
.trash-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.trash-info span { overflow-wrap: anywhere; }
.trash-title { font-weight: 700; }
.trash-restored { display: block; padding: 8px 0 12px; font-weight: 700; color: var(--color-primary-text); }

.log-row-warning { border-left: 4px solid var(--color-error); padding-left: 10px; margin-left: -14px; }
.log-row-warning .log-row-action { color: var(--color-error); }
.log-row-warning .log-row-detail { font-size: 15px; font-weight: 600; color: var(--color-text); }
.log-row-warning .log-row-unknown { font-size: 13px; font-weight: 400; font-style: italic; color: var(--color-muted); }

.calfeed-output { display: flex; flex-direction: column; gap: 8px; margin: 8px 0; }
.calfeed-output input { margin: 0; min-height: 44px; width: 100%; box-sizing: border-box; }
.calfeed-output a { display: flex; align-items: center; justify-content: center; text-decoration: none; }
.change-revert { margin: 0 0 0 auto; width: auto; flex: 0 0 auto; }
.section-card > .add-item-form-wrap:only-child { margin-top: 0; }
.section-card > .add-item-form-wrap:only-child > .add-item-form-summary { padding: 0; min-height: 32px; }

body > .offline-banner,
body > .room-notes-block,
body > .floorplan-conflict-banner,
body > .floorplan-tight-banner {
  width: calc(100% - 40px);
  max-width: calc(var(--page-width) - 40px);
  box-sizing: border-box;
  margin-left: auto; margin-right: auto;
}
body > .floorplan-conflict-banner,
body > .floorplan-tight-banner { margin-bottom: 8px; }
body[data-tour-page="floorPlan"] > .offline-banner,
body[data-tour-page="floorPlan"] > .room-notes-block,
body[data-tour-page="floorPlan"] > .floorplan-conflict-banner,
body[data-tour-page="floorPlan"] > .floorplan-tight-banner { max-width: calc(var(--floorplan-width) - 40px); }

a[href="/messages.html"], a[href="/review-queue.html"], .notif-btn { position: relative; }
.count-badge {
  position: absolute; top: -2px; right: -2px;
  min-width: 18px; height: 18px; padding: 0 5px; box-sizing: border-box;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 999px; background: var(--color-error); color: #ffffff;
  font-size: 11px; font-weight: 800; line-height: 1;
  pointer-events: none;
}
.count-badge.is-inline { position: static; margin-left: auto; flex-shrink: 0; }
.nav-panel-link > .count-badge { position: static; margin-left: auto; flex-shrink: 0; min-width: 20px; height: 20px; font-size: 12px; }

.notif-panel {
  position: fixed; z-index: 70;
  top: calc(64px + var(--safe-top, 0px)); right: 12px;
  width: min(400px, calc(100vw - 24px)); max-height: min(70vh, 560px);
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--color-surface); color: var(--color-text);
  border: 1px solid var(--color-divider); border-radius: var(--radius); box-shadow: 0 8px 28px rgba(0, 0, 0, 0.28);
}
.notif-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 14px; border-bottom: 1px solid var(--color-divider);
}
.notif-mark-all {
  width: auto; margin: 0; min-height: 36px; padding: 0 12px; font-size: 13px;
  background: none; border: none; color: var(--color-primary-text); text-decoration: underline; cursor: pointer;
}
.notif-mark-all:disabled { opacity: 0.4; cursor: default; text-decoration: none; }
.notif-list { overflow-y: auto; }
.notif-empty { margin: 0; padding: 22px 16px; text-align: center; font-size: 14px; color: var(--color-muted); }
.notif-item {
  display: flex; flex-direction: column; gap: 2px; padding: 11px 14px;
  border-bottom: 1px solid var(--color-divider); color: var(--color-text); text-decoration: none;
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: var(--color-accent-bg); }
.notif-item.is-unread { border-left: 4px solid var(--color-primary); padding-left: 10px; }
.notif-item.is-unread .notif-item-title { font-weight: 800; }
.notif-item-title { font-size: 14px; font-weight: 600; }
.notif-item-body { font-size: 13px; overflow-wrap: anywhere; }
.notif-item-when { font-size: 11px; color: var(--color-muted); }

.note-replies { margin: 10px 0 0 6px; padding-left: 12px; border-left: 2px solid var(--color-divider); display: flex; flex-direction: column; gap: 8px; }
.note-reply-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.note-reply-body { margin: 2px 0 0; font-size: 14px; white-space: pre-line; overflow-wrap: anywhere; }
.note-reply-delete {
  width: auto; min-height: 28px; margin: 0 0 0 auto; padding: 0 8px; font-size: 12px; font-weight: 600;
  background: none; border: none; color: var(--color-muted); text-decoration: underline; cursor: pointer;
}
.note-reply-form { margin: 10px 0 0; display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; }
.note-reply-form textarea { flex: 1 1 200px; min-height: 40px; font-size: 14px; resize: vertical; }
.note-reply-send { width: auto; margin: 0; min-height: 40px; padding: 0 16px; font-size: 14px; }
.note-reply-form .error { flex-basis: 100%; margin: 0; }
.note-reply-form .error:empty { display: none; }

.msg-main {
  max-width: var(--page-width); margin: 0 auto; padding: 14px 20px 40px;
  display: grid; grid-template-columns: minmax(280px, 360px) minmax(0, 1fr); gap: 0; align-items: stretch;
  background: var(--color-surface); border-radius: var(--radius); box-shadow: var(--shadow-card); overflow: hidden;
}
.msg-list-pane, .msg-thread-pane { background: none; box-shadow: none; padding: 14px; min-width: 0; }
.msg-list-pane { border-right: 1px solid var(--color-divider); overflow-y: auto; }
.msg-new-btn { width: 100%; margin: 0 0 12px; }
.msg-picker { margin-bottom: 10px; }
.msg-picker input { width: 100%; margin: 0 0 8px; }
.msg-people, .msg-conversations { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.msg-people { max-height: 260px; overflow-y: auto; }
.msg-conversation, .msg-person {
  width: 100%; margin: 0; min-height: 0; padding: 10px; text-align: left; display: flex; flex-direction: row; gap: 12px;
  align-items: center; justify-content: flex-start;
  font-size: 14px; font-weight: 400; background: none; color: var(--color-text);
  border: 1px solid transparent; border-radius: 12px; cursor: pointer;
}
.msg-conversation:hover, .msg-person:hover { background: var(--color-accent-bg); }
.msg-conversation.is-selected { background: var(--color-accent-bg); border-color: var(--color-divider); }
.msg-conversation-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
.msg-conversation-top, .msg-conversation-bottom { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.msg-conversation-name { font-size: 15px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-conversation-when { font-size: 12px; color: var(--color-muted); flex: 0 0 auto; }
.msg-conversation-role { font-size: 11px; color: var(--color-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.msg-conversation-preview { font-size: 13px; color: var(--color-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }
.msg-conversation.is-unread .msg-conversation-name, .msg-conversation.is-unread .msg-conversation-preview { font-weight: 700; color: var(--color-text); }
.msg-conversation.is-unread .msg-conversation-when { color: var(--color-primary-text); font-weight: 700; }
.msg-avatar {
  flex: 0 0 auto; width: 40px; height: 40px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; letter-spacing: 0.02em; color: hsl(var(--avatar-hue, 220) 55% 28%);
  background: hsl(var(--avatar-hue, 220) 65% 86%);
}
.msg-avatar.is-large { width: 44px; height: 44px; font-size: 15px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .msg-avatar { color: hsl(var(--avatar-hue, 220) 70% 88%); background: hsl(var(--avatar-hue, 220) 40% 30%); } }
:root[data-theme="dark"] .msg-avatar { color: hsl(var(--avatar-hue, 220) 70% 88%); background: hsl(var(--avatar-hue, 220) 40% 30%); }
.msg-placeholder { margin: 80px 0; text-align: center; font-size: 15px; }
.msg-thread-wrap { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.msg-thread-head { display: flex; align-items: center; gap: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--color-divider); font-size: 17px; }
.msg-with { display: flex; align-items: center; gap: 12px; min-width: 0; }
.msg-with-text { display: flex; flex-direction: column; min-width: 0; }
.msg-back { display: none; }
.msg-thread {
  flex: 1 1 auto; min-height: 240px; overflow-y: auto; padding: 14px 6px; display: flex; flex-direction: column; gap: 6px;
}
.msg-day { align-self: center; margin: 10px 0 4px; padding: 3px 12px; border-radius: 999px; background: var(--color-accent-bg); color: var(--color-muted); font-size: 12px; font-weight: 600; }
.msg-bubble {
  max-width: min(72%, 620px); align-self: flex-start; padding: 9px 14px 6px; border-radius: 16px 16px 16px 4px;
  background: var(--color-accent-bg); color: var(--color-text);
}
.msg-bubble.is-mine { align-self: flex-end; border-radius: 16px 16px 4px 16px; background: var(--color-primary); color: var(--color-on-primary); }
.msg-bubble-body { margin: 0; font-size: 15px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg-bubble-when { display: block; margin-top: 3px; font-size: 11px; opacity: 0.7; text-align: right; }
.msg-form { display: flex; gap: 8px; align-items: flex-end; padding-top: 12px; border-top: 1px solid var(--color-divider); }
.msg-form textarea { flex: 1; min-height: 46px; max-height: 140px; font-size: 16px; resize: none; margin: 0; border-radius: 14px; }
.msg-send { width: auto; margin: 0; min-height: 46px; padding: 0 22px; font-size: 15px; border-radius: 14px; }
#msg-error:empty { display: none; }

@media (min-width: 761px) {
  .msg-main { height: calc(100vh - 64px - 34px); min-height: 460px; padding: 0; margin-top: 14px; }
  .msg-list-pane, .msg-thread-pane { padding: 16px; }
  .msg-thread-pane { display: flex; flex-direction: column; min-height: 0; }
  .msg-thread-wrap { flex: 1; }
}

@media (max-width: 760px) {
  .msg-main { grid-template-columns: 1fr; padding: 10px 12px 90px; background: none; box-shadow: none; border-radius: 0; }
  .msg-list-pane, .msg-thread-pane { background: var(--color-surface); border-radius: var(--radius); box-shadow: var(--shadow-card); border-right: 0; }
  .msg-main .msg-thread-pane { display: none; }
  .msg-main.has-thread .msg-list-pane { display: none; }
  .msg-main.has-thread .msg-thread-pane { display: block; }
  .msg-back { display: inline-flex; }
  .msg-thread { height: calc(var(--vvh, 100vh) - 300px); min-height: 120px; flex: none; }
}
.msg-thread-head .msg-back {
  width: 36px; min-height: 36px; margin: 0; padding: 0; border-radius: 10px;
  background: var(--color-accent-bg); color: var(--color-text);
}
.imp-main .muted-note { margin-bottom: 12px; }
.imp-toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.imp-toolbar .pill-btn { width: auto; margin: 0; }
.imp-weeks, .imp-names { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.imp-weeks { max-height: 420px; overflow-y: auto; }
.imp-week { padding: 8px 0; border-top: 1px solid var(--color-divider); }
.imp-week:first-child { border-top: none; }
.imp-week.is-done { opacity: 0.6; }
.imp-week-label { display: flex; align-items: center; gap: 12px; cursor: pointer; margin: 0; }
.imp-week-label input { width: 22px; height: 22px; margin: 0; flex-shrink: 0; }
.imp-week-text { display: flex; flex-direction: column; gap: 1px; }
.imp-week-meta { font-size: 12.5px; color: var(--color-muted); }
.imp-issues { margin: 6px 0 0 34px; font-size: 13px; }
.imp-issues summary { cursor: pointer; font-weight: 700; }
.imp-issues summary.is-error, .imp-issues li.is-error { color: var(--color-error); }
.imp-issues summary.is-warn, .imp-issues li.is-warn { color: var(--color-warn-text); }
.imp-issues ul { margin: 4px 0 0; padding-left: 18px; }
.imp-name { padding: 10px 0; border-top: 1px solid var(--color-divider); display: flex; flex-direction: column; gap: 6px; }
.imp-name:first-child { border-top: none; }
.imp-name-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.imp-recognized { margin-top: 10px; font-size: 14px; }
.imp-recognized summary { cursor: pointer; font-weight: 700; color: var(--color-primary-text); }
.imp-summary { font-weight: 700; margin: 12px 0; }
#imp-blocked:empty, #imp-error:empty, #imp-commit-error:empty { display: none; }
#imp-done-link { width: auto; display: inline-flex; padding: 0 22px; text-decoration: none; }
.heating-steps, .heating-safety { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; font-size: 15px; }
#heating-open { width: auto; padding: 0 24px; margin-top: 4px; }
#heating-error:empty { display: none; }
.zones-list { display: flex; flex-direction: column; }
.zone-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 0; border-top: 1px solid var(--border, rgba(255,255,255,.12)); }
.zone-row:first-child { border-top: 0; }
.zone-name { flex: 1 1 200px; }
.zone-now, .zone-target { min-width: 110px; }
.zone-tag { font-weight: 400; opacity: .7; border: 1px solid currentColor; border-radius: 8px; padding: 0 6px; }
.zone-btn { width: 44px; margin: 0; padding: 0; }
#zones-error:empty { display: none; }

.heating-embed { max-width: var(--page-width); margin: 0 auto 16px; }
.heating-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0 0 8px; }
.heating-toolbar .pill-btn { width: auto; margin: 0; }
.heating-embed .muted-note { margin: 0 0 8px; }
.heating-frame {
  display: block; width: 100%; height: calc(100vh - 170px); height: calc(100dvh - 170px); min-height: 420px;
  border: 1px solid var(--color-divider); border-radius: 12px; background: #ffffff;
}
#heating-frame-error:empty { display: none; }
@media (max-width: 760px) {
  .heating-frame { height: calc(100vh - 250px); height: calc(100dvh - 250px); }
}

.tk-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin: 0 0 10px; }
.tk-new { width: auto; margin: 0; padding: 0 20px; text-decoration: none; }
.tk-export {
  width: auto; margin: 0; padding: 0 18px; text-decoration: none;
  background: var(--color-surface); color: var(--color-primary-text); border: 2px solid var(--color-border);
}
.tk-filters { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 12px; }
.tk-filters select, .tk-filters input { flex: 1 1 160px; margin: 0; min-height: 44px; min-width: 0; }
.tk-filters #tk-group { flex: 1 1 190px; }
.tk-filters #tk-search { flex: 1 1 100%; }
@media (min-width: 1024px) {
  .tk-filters #tk-search { flex: 2 1 300px; }
}
.tk-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.tk-item {
  display: block; padding: 12px 14px; background: var(--color-surface); border-radius: var(--radius);
  box-shadow: var(--shadow-card); text-decoration: none; color: var(--color-text);
}
.tk-item:hover { background: var(--color-accent-bg); }
.tk-item-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tk-number { font-size: 12px; font-weight: 800; color: var(--color-muted); letter-spacing: 0.02em; }
.tk-title { flex: 1 1 200px; font-size: 15px; overflow-wrap: anywhere; }
.tk-item-meta { margin-top: 4px; font-size: 13px; color: var(--color-muted); overflow-wrap: anywhere; }
.tk-item-foot { margin-top: 6px; display: flex; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--color-muted); }
.tk-status.is-open { background: var(--color-warn-bg); color: var(--color-warn-text); }
.tk-status.is-in_progress { background: var(--color-accent-bg); color: var(--color-primary-text); }
.tk-severity.is-critical { background: var(--color-error); color: #fff; font-weight: 700; }
.tk-severity.is-high { background: var(--color-warn-bg); color: var(--color-warn-text); font-weight: 700; }
.tk-severity.is-low { background: var(--color-surface-sunken); color: var(--color-muted); }
.tk-status.is-resolved { background: var(--color-ok-bg); color: var(--color-ok-text); }
#tk-blocked:empty, #tk-error:empty { display: none; }

.tk-columns { display: grid; grid-template-columns: minmax(0, 3fr) minmax(280px, 2fr); gap: 16px; align-items: start; }
.tk-column { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.tk-column .section-card { margin-bottom: 0; }
@media (max-width: 900px) { .tk-columns { grid-template-columns: 1fr; } }
.tk-head-top { display: flex; align-items: center; gap: 10px; }
.tk-head-title { margin: 6px 0 12px; font-size: 20px; overflow-wrap: anywhere; }
.tk-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px 16px; }
.tk-fact-label { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--color-muted); }
.tk-fact-value { font-weight: 600; overflow-wrap: anywhere; }
.tk-inline-btn { width: auto; margin: 14px 0 0; }
.tk-description { white-space: pre-wrap; overflow-wrap: anywhere; margin: 0; }
.tk-sub { margin-top: 16px; }
.tk-gallery { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.tk-photo img { display: block; width: 110px; height: 110px; object-fit: cover; border-radius: 10px; border: 1px solid var(--color-divider); }
.tk-timeline-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.tk-event { margin: 0; font-size: 13px; color: var(--color-muted); }
.tk-event-meta { font-size: 12px; opacity: 0.85; }
.tk-comment { padding: 10px 12px; border-radius: 12px; background: var(--color-accent-bg); }
.tk-comment.is-mine { border-left: 4px solid var(--color-primary); }
.tk-comment-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.tk-comment-body { margin: 4px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 15px; }
.tk-comment-form { display: flex; flex-direction: column; gap: 8px; }
.tk-comment-form textarea { margin: 0; }
.tk-comment-send { width: auto; align-self: flex-start; margin: 0; min-height: 44px; padding: 0 22px; font-size: 15px; }

.tk-photo-add { position: relative; display: inline-flex; width: auto; margin: 0 0 8px; overflow: hidden; cursor: pointer; }
.tk-photo-add.is-disabled { opacity: 0.45; pointer-events: none; }
.tk-photo-input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; font-size: 0; }
.tk-previews { display: flex; flex-wrap: wrap; gap: 10px; }
.tk-preview { position: relative; }
.tk-preview img { display: block; width: 84px; height: 84px; object-fit: cover; border-radius: 10px; }
.tk-preview-remove {
  position: absolute; top: -7px; right: -7px; width: 24px; min-height: 24px; height: 24px; padding: 0; margin: 0;
  border-radius: 50%; font-size: 16px; line-height: 1; background: var(--color-error); color: #ffffff;
}
.tk-photo-note { margin: 6px 0 0; }

.tk-control { display: flex; flex-direction: column; gap: 4px; margin: 0 0 12px; }
.tk-control-label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--color-muted); }
.tk-control select, .tk-control input { margin: 0; }
.tk-actions { display: flex; flex-direction: column; gap: 8px; margin: 4px 0 14px; }
.tk-actions button { margin: 0; }
.tk-ref-row { display: flex; gap: 8px; }
.tk-ref-row input { flex: 1; min-width: 0; }
.tk-ref-row .pill-btn { width: auto; margin: 0; }

/* Permissions screen: team defaults above, per-account overrides below. */
.perm-card { padding-top: 0; padding-bottom: 0; }
.perm-card[open] { padding-bottom: 14px; }
.perm-summary {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  padding: 16px 0; cursor: pointer; list-style: none; min-height: var(--tap-min);
}
.perm-summary::-webkit-details-marker { display: none; }
.perm-summary-main { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.perm-summary-title { font-size: 17px; font-weight: 700; color: var(--color-text); }
.perm-summary-note {
  font-size: 12.5px; font-weight: 600; color: var(--color-muted); white-space: nowrap;
}
.perm-summary::after {
  content: ""; width: 9px; height: 9px; flex-shrink: 0; margin-left: 2px;
  border-right: 2px solid var(--color-muted); border-bottom: 2px solid var(--color-muted);
  transform: rotate(45deg) translate(-2px, -2px); transition: transform 0.15s ease;
}
.perm-card[open] > .perm-summary::after { transform: rotate(-135deg) translate(-2px, -2px); }
.perm-card[open] > .perm-summary { border-bottom: 1px solid var(--color-divider); }
.perm-card .checkbox-row { margin-top: 12px; }

.perm-account-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0; }
.perm-account-name { font-size: 13px; color: var(--color-muted); font-weight: 600; }
.perm-account-meta .tag { background: var(--color-divider); color: var(--color-muted); }
.perm-account-off { background: var(--color-warn-bg); color: var(--color-warn-text); }

.perm-account-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 10px 0; border-top: 1px solid var(--color-divider); min-height: var(--tap-min);
}
.perm-account-label { margin: 0; font-weight: 600; font-size: 15px; flex: 1 1 200px; }
.perm-account-select { margin: 0; width: auto; flex: 0 1 260px; min-width: 200px; }

@media (max-width: 520px) {
  .perm-account-row { flex-direction: column; align-items: stretch; gap: 6px; }
  .perm-account-label { flex: 0 0 auto; }
  .perm-account-select { flex: 0 0 auto; width: 100%; min-width: 0; }
}

.tk-danger {
  margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--color-divider);
}
.tk-danger-title { margin: 0 0 4px; font-size: 14px; font-weight: 700; color: var(--color-error); }
.tk-danger .muted-note { margin: 0; }
.tk-time-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.tk-time-head h3 { margin: 0; }
.tk-time-head .pill-btn { width: auto; margin: 0; text-decoration: none; }
.tk-time-table { width: 100%; border-collapse: collapse; font-size: 14px; margin-top: 8px; }
.tk-time-table td { padding: 7px 4px; border-top: 1px solid var(--color-divider); vertical-align: top; }
.tk-time-date { white-space: nowrap; color: var(--color-muted); }
.tk-time-min { font-weight: 700; white-space: nowrap; text-align: right; }
.tk-time-total { font-weight: 800; text-align: right; margin: 8px 0 12px; }
.tk-time-form { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.tk-time-form input { margin: 0; }
.tk-time-duration { display: flex; align-items: center; gap: 6px; }
.tk-time-duration input { width: 80px; }
.tk-time-form .pill-btn { width: auto; align-self: flex-start; margin: 0; }

.wo-main { max-width: 860px; margin: 0 auto; padding: 16px 20px 60px; }
.wo-controls { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin: 0 0 12px; }
.wo-controls button { width: auto; margin: 0; padding: 0 24px; }
.wo-photos-toggle { margin: 0; }
.wo-page { background: #ffffff; color: #1c1c1c; padding: 34px 38px; border-radius: var(--radius); box-shadow: var(--shadow-card); }
.wo-brand { margin: 0; font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; color: #2a3692; }
.wo-title { margin: 2px 0 4px; font-size: 26px; }
.wo-reference { margin: 0; font-size: 15px; font-weight: 700; }
.wo-info { width: 100%; border-collapse: collapse; margin: 16px 0; }
.wo-info th { text-align: left; width: 30%; padding: 5px 8px; background: #eceef5; border: 1px solid #d2d6e2; font-size: 13px; }
.wo-info td { padding: 5px 8px; border: 1px solid #d2d6e2; font-size: 14px; overflow-wrap: anywhere; }
.wo-page h3 { margin: 20px 0 6px; font-size: 14px; text-transform: uppercase; letter-spacing: 0.05em; color: #2a3692; }
.wo-page .muted-note { color: #5a5a5a; }
.wo-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.wo-table th, .wo-table td { border: 1px solid #d2d6e2; padding: 6px 8px; text-align: left; vertical-align: top; }
.wo-table th { background: #eceef5; font-size: 13px; }
.wo-num { text-align: right !important; white-space: nowrap; }
.wo-total td { font-weight: 800; background: #eceef5; }
.wo-people { width: auto; min-width: 50%; }
.wo-description { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.wo-photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.wo-photos img { display: block; width: 100%; height: 150px; object-fit: cover; border: 1px solid #d2d6e2; }
.wo-signs { display: flex; gap: 44px; margin-top: 46px; break-inside: avoid; }
.wo-sign { flex: 1; }
.wo-sign-line { border-bottom: 1px solid #1c1c1c; height: 34px; }
.wo-sign-date { width: 45%; }
.wo-sign-label { margin-top: 3px; font-size: 12px; color: #555555; }
.wo-foot { margin: 28px 0 0; font-size: 11px; color: #777777; }
#wo-blocked:empty { display: none; }
@media print {
  body.work-order-page, body.work-order-page.has-shell { background: #ffffff !important; padding: 0 !important; margin: 0 !important; }
  body.work-order-page #nav-rail, body.work-order-page #tab-bar, body.work-order-page .nav-rail { display: none !important; }
  .wo-main { max-width: none; padding: 0; }
  .wo-page { box-shadow: none; border-radius: 0; padding: 0; }
  .wo-table tr, .wo-info tr { break-inside: avoid; }
}

.tg-group.is-inactive { opacity: 0.75; }
.tg-head { display: flex; align-items: center; gap: 8px; }
.tg-head input { flex: 1; margin: 0; font-weight: 700; }
.tg-group > input { margin-top: 8px; }
.tg-save { width: auto; margin: 8px 0 4px; }
.tg-sub { margin: 16px 0 6px; font-size: 14px; }
.tg-people { list-style: none; margin: 8px 0 12px; padding: 0; max-height: 260px; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.tg-people li { display: flex; align-items: center; gap: 10px; padding: 4px 2px; }
.tg-people input[type="checkbox"] { width: 22px; height: 22px; margin: 0; flex-shrink: 0; }
.tg-people label { margin: 0; font-size: 15px; flex: 1; }
.tg-role { font-size: 11px; color: var(--color-muted); text-transform: uppercase; }
#tg-error:empty { display: none; }

.section-card a.btn.pill-btn, .tk-new, .tk-time-head .pill-btn { color: var(--color-on-primary); }
.tk-comment-head strong { font-size: 15px; }
.tk-event > span:first-child { font-size: 14px; }

.tk-toolbar .view-toggle { flex: 1 1 100%; min-width: 0; padding: 0; margin: 0; }
.tk-toolbar .view-toggle-btn { flex: 1 1 0; min-width: 0; padding-left: 8px; padding-right: 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@media (max-width: 560px) {
  .tk-filters #tk-group { flex: 1 1 100%; }

  .tk-toolbar .tk-new, .tk-toolbar .tk-export { flex: 1 1 0; width: auto; text-align: center; }

  .tk-ref-row { flex-direction: column; }
  .tk-ref-row .pill-btn { width: 100%; }
}

.shake-feedback-overlay, .prompt-overlay {
  position: fixed; inset: 0; background: rgba(0, 0, 0, 0.5);
  display: flex; align-items: center; justify-content: center;
  padding: 20px; z-index: 1000;
}
.shake-feedback-dialog, .prompt-dialog {
  width: 100%; max-width: 420px; max-height: 90vh; overflow-y: auto;
  background: var(--color-surface); border: 1px solid var(--color-border-soft);
  border-radius: var(--radius); box-shadow: var(--shadow-raised); padding: 28px 24px;
}
.shake-feedback-dialog h2, .prompt-dialog h2 { margin: 0 0 6px; font-size: 20px; color: var(--color-primary-text); }
.shake-feedback-dialog .error:empty, .prompt-dialog .error:empty { display: none; }
.shake-feedback-dialog .btn-primary-full { margin-top: 8px; }
.prompt-dialog .btn-primary-full { margin-top: 16px; }
.prompt-never, .prompt-never:active {
  display: block; width: 100%; min-height: 44px; margin: 8px 0 0; padding: 8px;
  background: none; border: 0; color: var(--color-muted); font-size: 14px; font-weight: 600; text-decoration: underline;
}
.shake-feedback-kind-row { display: flex; gap: 16px; margin: 16px 0 4px; }
.shake-feedback-kind-option {
  display: flex; align-items: center; gap: 6px; font-weight: 600;
  min-height: 0; margin: 0;
}
.shake-feedback-kind-option input { width: auto; min-height: 0; }
.shake-feedback-photos { margin: 12px 0; }

.notepad-overlay {
  position: fixed; inset: 0; z-index: 950; background: rgba(0, 0, 0, 0.4);
  display: flex; justify-content: flex-end;
}
.notepad-overlay.hidden { display: none; }
body.notepad-open { overflow: hidden; }
.notepad-sheet {
  width: min(400px, 100vw); height: 100%; display: flex; flex-direction: column;
  background: var(--color-surface); color: var(--color-text); box-shadow: var(--shadow-raised);
  animation: notepad-in-side 0.18s ease-out;
}
.notepad-header {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 18px; padding-top: max(16px, env(safe-area-inset-top));
  background: var(--color-primary); color: var(--color-on-primary);
}
.notepad-header h2 { margin: 0; font-size: 18px; font-weight: 800; }
.notepad-close {
  width: 36px; height: 36px; min-height: 0; margin: 0; padding: 0; flex: none;
  border-radius: 10px; background: var(--overlay-on-primary); color: var(--color-on-primary);
}
.notepad-add { display: flex; gap: 8px; align-items: flex-end; padding: 14px 16px 6px; }
.notepad-add textarea {
  flex: 1; min-height: 48px; max-height: 160px; resize: none; padding: 11px 14px; font-size: 16px; line-height: 1.35;
}
.notepad-add-btn { width: auto; min-height: 48px; margin: 0; padding: 0 18px; font-size: 16px; flex: none; }
.notepad-sheet > .error { margin: 4px 16px 0; }
.notepad-sheet > .error:empty { display: none; }
.notepad-list { list-style: none; margin: 0; padding: 6px 8px 12px; overflow-y: auto; flex: 1; overscroll-behavior: contain; }
.notepad-list .skeleton-card { margin: 8px; }
.notepad-empty { padding: 28px 16px; text-align: center; color: var(--color-muted); font-size: 15px; line-height: 1.5; }
.notepad-item {
  display: flex; align-items: flex-start; gap: 4px; padding: 2px 0;
  border-bottom: 1px solid var(--color-divider);
}
.notepad-item:last-child { border-bottom: none; }
.notepad-item input[type="checkbox"] {
  width: 22px; height: 22px; margin: 13px 8px 0 10px; flex: none; accent-color: var(--color-primary); cursor: pointer;
}
.notepad-text {
  flex: 1; min-width: 0; width: auto; min-height: 48px; margin: 0; padding: 12px 6px; justify-content: flex-start;
  background: none; color: var(--color-text); font-size: 16px; font-weight: 500; line-height: 1.4;
  text-align: left; white-space: pre-wrap; overflow-wrap: anywhere; border-radius: 8px; cursor: text;
}
.notepad-text:active { background: var(--color-accent-bg); transform: none; }
.notepad-item.done .notepad-text { color: var(--color-muted); text-decoration: line-through; }
.notepad-editor {
  flex: 1; min-height: 48px; margin: 4px 0; padding: 10px 12px; resize: none; font-size: 16px; line-height: 1.4;
}
.notepad-remove {
  width: 40px; height: 40px; min-height: 0; margin: 4px 4px 0 0; padding: 0; flex: none;
  background: none; color: var(--color-muted); border-radius: 10px; opacity: 0.7;
}
.notepad-remove:hover, .notepad-remove:focus-visible { opacity: 1; background: var(--color-accent-bg); }
.notepad-remove:active { background: var(--color-accent-bg); }
.notepad-footer { padding: 10px 16px; padding-bottom: max(10px, env(safe-area-inset-bottom)); border-top: 1px solid var(--color-divider); }
.notepad-footer.hidden { display: none; }
.notepad-clear {
  width: 100%; min-height: 44px; margin: 0; font-size: 15px;
  background: transparent; color: var(--color-primary-text); border: 2px solid var(--color-border);
}
.notepad-clear:active { background: var(--color-accent-bg); }

@media (max-width: 600px) {
  .notepad-overlay { align-items: flex-end; }
  .notepad-sheet {
    width: 100%; height: auto; max-height: 85vh; max-height: 85dvh;
    border-radius: 18px 18px 0 0; overflow: hidden; animation-name: notepad-in-up;
  }
  .notepad-header { padding-top: 16px; }
  .notepad-list { min-height: 120px; }
}

@keyframes notepad-in-side { from { transform: translateX(24px); opacity: 0; } }
@keyframes notepad-in-up { from { transform: translateY(32px); opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  .notepad-sheet { animation: none; }
}

.viewer-main { padding: 16px; overflow-x: auto; }
.viewer-page, .viewer-image { display: block; max-width: none; margin: 0 auto 16px; background: #ffffff; box-shadow: var(--shadow-card); }
.viewer-page { border-radius: 4px; }
.viewer-image { border-radius: 8px; }
.viewer-body .top-bar-right .back-link:disabled { opacity: 0.4; }
.viewer-body .top-bar-right .back-link { width: 44px; height: 44px; padding: 0; justify-content: center; }

.sw-screen {
  --sw-bg: #f2f4f8; --sw-surface: #ffffff; --sw-text: #1a1c26; --sw-muted: #5b5f6d;
  --sw-primary: #2a3692; --sw-primary-text: #2a3692; --sw-on-primary: #ffffff; --sw-divider: #ebeef4;
  --sw-chip-bg: #ebedf2; --sw-chip-text: #3d4150; --sw-now-bg: #e6f4ea; --sw-now-text: #1e7a34;
  --sw-shadow: 0 1px 2px rgba(42, 54, 146, 0.05), 0 6px 16px rgba(42, 54, 146, 0.08);
  container-type: size; display: grid; box-sizing: border-box; overflow: hidden;
  grid-template-columns: repeat(12, minmax(0, 1fr)); grid-template-rows: repeat(8, minmax(0, 1fr));
  gap: 1.6cqh; padding: 2cqh; background: var(--sw-bg); color: var(--sw-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI Variable Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
.sw-screen[data-screen-theme="dark"] {
  --sw-bg: #13151f; --sw-surface: #1b1e2c; --sw-text: #e8e9ef; --sw-muted: #a4a7ba;
  --sw-primary: #4c5fc7; --sw-primary-text: #8fa0ff; --sw-on-primary: #ffffff; --sw-divider: #272b3c;
  --sw-chip-bg: #282c3c; --sw-chip-text: #c3c6d6; --sw-now-bg: #1d3324; --sw-now-text: #74c98d;
  --sw-shadow: 0 1px 2px rgba(0, 0, 0, 0.35), 0 6px 16px rgba(0, 0, 0, 0.4);
}
.sw {
  min-width: 0; min-height: 0; overflow: hidden; display: flex; flex-direction: column;
  background: var(--sw-surface); border-radius: 1.6cqh; box-shadow: var(--sw-shadow);
  padding: 2cqh 2.4cqh; font-size: 2.4cqh; line-height: 1.3;
}
.sw-heading {
  margin: 0 0 1.2cqh; font-size: 1.9cqh; font-weight: 800; letter-spacing: 0.05em;
  text-transform: uppercase; color: var(--sw-muted);
}
.sw-empty { margin: 0; color: var(--sw-muted); }
.sw-clock { container-type: size; background: none; box-shadow: none; padding: 0 0.6cqh; justify-content: center; }
.sw-clock-inner { display: flex; align-items: baseline; justify-content: space-between; gap: 4cqw; }
.sw-clock-time {
  order: 2; font-size: min(78cqh, 16cqw); font-weight: 800; line-height: 1;
  color: var(--sw-primary-text); font-variant-numeric: tabular-nums;
}
.sw-clock-date { font-size: min(36cqh, 5.5cqw); font-weight: 800; }
.sw-clock-date::first-letter { text-transform: uppercase; }
.sw-floorplan { container-type: size; padding: 1.2cqh; align-items: center; justify-content: center; }
.sw-floorplan-map { position: relative; width: min(100cqw, 146cqh); aspect-ratio: 2200 / 1506; line-height: 0; }
.sw-floorplan-image { width: 100%; height: 100%; display: block; }
.sw-here { position: absolute; width: 0; height: 0; z-index: 2; }
.sw-here-dot {
  position: absolute; left: -1.1cqh; top: -1.1cqh; width: 2.2cqh; height: 2.2cqh; border-radius: 50%;
  background: #e5484d; border: 0.35cqh solid #fff; box-shadow: 0 0 0 0 rgba(229, 72, 77, 0.7); animation: sw-here-pulse 1.8s ease-out infinite;
}
.sw-here-label {
  position: absolute; left: 0; bottom: 1.8cqh; transform: translateX(-50%); white-space: nowrap; line-height: 1.2;
  padding: 0.5cqh 1.2cqh; border-radius: 999px; background: #e5484d; color: #fff; font-size: 2cqh; font-weight: 800;
}
@keyframes sw-here-pulse { 70% { box-shadow: 0 0 0 1.8cqh rgba(229, 72, 77, 0); } 100% { box-shadow: 0 0 0 0 rgba(229, 72, 77, 0); } }
.sw-floorplan-spot { position: absolute; border-radius: 2px; background: var(--sw-primary); opacity: 0.6; }
.sw-scroll { flex: 1; min-height: 0; overflow: hidden; position: relative; }
.sw-scroll.has-more { mask-image: linear-gradient(to bottom, #000 calc(100% - 4cqh), transparent); }
.sw-row {
  display: flex; align-items: center; gap: 1.6cqh; padding: 1.1cqh 0;
  border-top: 1px solid var(--sw-divider);
}
.sw-row:first-child { border-top: none; }
.sw-row-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.3cqh; }
.sw-row-title { font-weight: 700; overflow-wrap: anywhere; }
.sw-row-sub { font-size: 1.9cqh; color: var(--sw-muted); }
.sw-row-time { flex-shrink: 0; font-weight: 800; color: var(--sw-primary-text); font-variant-numeric: tabular-nums; }
.sw-row.is-past { opacity: 0.45; }
.sw-now-tag {
  align-self: flex-start; margin-top: 0.4cqh; padding: 0.2cqh 1cqh; border-radius: 999px;
  font-size: 1.6cqh; font-weight: 800; background: var(--sw-now-bg); color: var(--sw-now-text);
}
.sw-chips { display: flex; flex-wrap: wrap; gap: 1cqh; align-content: flex-start; }
.sw-chip {
  padding: 0.6cqh 1.4cqh; border-radius: 999px; font-size: 1.9cqh; font-weight: 700;
  background: var(--sw-chip-bg); color: var(--sw-chip-text);
}
.sw-photo { padding: 0; }
.sw-photo-image { width: 100%; height: 100%; display: block; object-fit: cover; object-position: 60% 40%; }
.sw-message { container-type: size; justify-content: center; background: var(--sw-primary); color: var(--sw-on-primary); }
.sw-message-text { margin: 0; font-weight: 800; white-space: pre-line; overflow-wrap: anywhere; line-height: 1.2; }
.sw-message-text.is-s { font-size: min(16cqh, 4cqw); }
.sw-message-text.is-m { font-size: min(24cqh, 6cqw); }
.sw-message-text.is-l { font-size: min(34cqh, 9cqw); }

/* TVs and cast receivers crop the picture edges (overscan), so everything sits inside a safe margin. */
.screen-body {
  --screen-safe-x: 3.5vw; --screen-safe-y: 4vh; --screen-brand-h: 8vh;
  margin: 0; height: 100vh; height: 100dvh; overflow: hidden; background: #13151f;
  box-sizing: border-box; padding: var(--screen-safe-y) var(--screen-safe-x);
  display: flex; flex-direction: column;
}
.screen-body[data-screen-theme="light"] { background: #f2f4f8; }
.screen-body .sw-screen { flex: 1; min-height: 0; width: 100%; height: auto; }
.screen-brand {
  flex: none; height: var(--screen-brand-h); display: none; align-items: center; justify-content: space-between;
  padding: 0 1vh 1.2vh; box-sizing: border-box;
}
.screen-brand.is-ready { display: flex; }
.screen-brand img { height: 100%; width: auto; max-width: 40vw; object-fit: contain; }
.screen-notice {
  position: fixed; left: 50%; bottom: 3vh; transform: translateX(-50%); margin: 0;
  padding: 1.2vh 2.4vh; border-radius: 1.2vh; font-size: 2.2vh; font-weight: 700;
  background: #fdf1de; border: 2px solid #e3ac3f; color: #8a5a00;
}
.screen-identify {
  position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; text-align: center;
  padding: 6vh; background: rgba(42, 54, 146, 0.94); color: #ffffff; font-size: 12vh; font-weight: 800; z-index: 10;
}
.screen-notice.hidden, .screen-identify.hidden { display: none; }

.screens-main {
  max-width: var(--page-width); margin: 0 auto; padding: 16px 20px 60px;
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; align-items: start;
}
@media (min-width: 1100px) {
  .screens-main { grid-template-columns: 320px minmax(0, 1fr); }
  .screens-main:has(> .screen-editor.hidden) { grid-template-columns: minmax(0, 640px); justify-content: center; }
}
.screens-list-wrap > .muted-note { margin: 0 0 12px; }
.screens-list { display: flex; flex-direction: column; gap: 12px; }
.screen-card { padding: 14px 16px; }
.screen-card.is-editing { border-color: var(--color-primary); box-shadow: 0 0 0 2px var(--color-primary); }
.screen-card-head { display: flex; align-items: center; gap: 10px; }
.screen-card-head h3 { margin: 0; font-size: 17px; overflow-wrap: anywhere; }
.screen-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--color-inactive); }
.screen-dot.is-online { background: var(--color-ok-text); box-shadow: 0 0 0 4px var(--color-ok-bg); }
.section-card p.screen-card-status { margin: 6px 0 2px; font-size: 14px; font-weight: 600; }
.screen-card-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.screen-card-action {
  width: auto; margin: 0; background: var(--color-surface); color: var(--color-primary-text);
  border: 2px solid var(--color-border);
}
.screen-card-action.is-main { background: var(--color-primary); color: var(--color-on-primary); border-color: var(--color-primary); }
.screen-card-action.is-danger { color: var(--color-error); }
.screens-add { display: flex; gap: 8px; margin-top: 14px; }
.screens-add input { flex: 1; min-width: 0; min-height: 44px; }
.screens-add .pill-btn { width: auto; margin: 0; flex: none; }
.screens-link {
  margin-top: 14px; padding: 14px; border-radius: var(--radius);
  background: var(--color-accent-bg); display: flex; flex-direction: column; gap: 8px;
}
.screens-link.hidden { display: none; }
.screens-link .muted-note { margin: 0; }
.screens-link-row { display: flex; gap: 8px; }
.screens-link-field { flex: 1; min-width: 0; min-height: 44px; font-size: 14px; }
.screens-link-row .pill-btn { width: auto; margin: 0; }

.screen-editor { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.screen-editor.hidden { display: none; }
.screen-editor-head { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.screen-editor-head input { flex: 1 1 220px; min-width: 0; min-height: 44px; font-weight: 700; }
.screen-editor-head select { width: auto; min-height: 44px; }
.screen-editor-theme { display: flex; gap: 6px; flex: none; }
.screen-editor-theme .theme-option { flex: none; min-width: 84px; min-height: 44px; }
.screen-palette { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.screen-palette-label { font-size: 14px; font-weight: 700; color: var(--color-muted); margin-right: 4px; }
.screen-palette-btn {
  width: auto; margin: 0; background: var(--color-surface); color: var(--color-primary-text);
  border: 2px solid var(--color-border);
}
.screen-canvas {
  position: relative; width: 100%; aspect-ratio: 16 / 9; container-type: size;
  border-radius: 12px; overflow: hidden; box-shadow: var(--shadow-raised); user-select: none;
}
.screen-canvas .sw-screen { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.screen-overlay {
  position: absolute; inset: 0; display: grid; gap: 1.6cqh; padding: 2cqh;
  grid-template-columns: repeat(12, minmax(0, 1fr)); grid-template-rows: repeat(8, minmax(0, 1fr));
}
.screen-box {
  position: relative; min-width: 0; min-height: 0; border-radius: 1.6cqh; cursor: grab; touch-action: none;
  outline: 2px dashed rgba(76, 95, 199, 0.5); outline-offset: -2px;
}
.screen-box:hover { background: rgba(76, 95, 199, 0.07); }
.screen-box:focus-visible { outline: 3px solid var(--color-primary-text); }
.screen-box.is-selected { outline: 3px solid var(--color-primary); background: rgba(76, 95, 199, 0.1); }
.screen-box.is-moving { cursor: grabbing; background: rgba(76, 95, 199, 0.16); }
.screen-box-label {
  position: absolute; left: 6px; top: 6px; max-width: calc(100% - 44px); overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 700;
  background: var(--color-primary); color: var(--color-on-primary); opacity: 0; transition: opacity 0.15s;
}
.screen-box:hover .screen-box-label, .screen-box.is-selected .screen-box-label { opacity: 1; }
.screen-box-remove {
  position: absolute; top: 4px; right: 4px; width: 28px; height: 28px; min-height: 0; margin: 0; padding: 0;
  border-radius: 50%; background: var(--color-error); color: #ffffff; display: none;
}
.screen-box-resize {
  position: absolute; right: 0; bottom: 0; width: 22px; height: 22px; cursor: nwse-resize; touch-action: none;
  background: linear-gradient(135deg, transparent 50%, var(--color-primary) 50%); border-radius: 0 0 1.6cqh 0; display: none;
}
.screen-box.is-selected .screen-box-remove { display: flex; }
.screen-box.is-selected .screen-box-resize { display: block; }
@media (pointer: coarse) {
  .screen-box-resize { width: 34px; height: 34px; }
}
.screen-options {
  padding: 14px; border: 1px solid var(--color-border-soft); border-radius: var(--radius);
  display: flex; flex-direction: column; gap: 12px;
}
.screen-options h3 { margin: 0; font-size: 16px; }
.screen-options .muted-note { margin: 0; }
.screen-option { margin: 0; }
.screen-option span { display: block; margin-bottom: 6px; }
.screen-option textarea { min-height: 70px; }
.screen-option-check { margin: 0; }
.screen-options .btn-danger-full { margin-top: 0; }
.screen-editor-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.screen-editor-actions button { flex: 1 1 200px; margin-top: 0; }
#editor-status:empty, #screens-info:empty { display: none; }
.sw-screen { max-width: none; margin: 0; }
.sw-screen p { margin: 0; font-size: inherit; color: inherit; white-space: normal; }
.sw-screen .sw-empty { color: var(--sw-muted); }
.sw-screen .sw-message-text { white-space: pre-line; }

/* Menu groups: a header that folds its links away, remembered per device. */
.nav-group-section { display: flex; flex-direction: column; }
.nav-group-section + .nav-group-section { border-top: 1px solid var(--color-divider); margin-top: 4px; padding-top: 4px; }
.nav-group-toggle {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  width: 100%; min-height: 0; margin: 0; padding: 12px 18px 6px;
  background: none; border: none; border-radius: 0; color: var(--color-muted);
  font-family: inherit; font-size: 12px; font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.04em; text-align: left; cursor: pointer;
}
.nav-group-toggle:hover, .nav-group-toggle:focus-visible { color: var(--color-text); }
.nav-group-toggle:active { transform: none; }
.nav-group-chevron { flex-shrink: 0; transition: transform 0.15s ease; }
.nav-group-toggle[aria-expanded="false"] .nav-group-chevron { transform: rotate(-90deg); }
.nav-group { display: flex; flex-direction: column; }
.nav-group[hidden] { display: none; }
.nav-rail .nav-group-toggle { padding: 10px 12px 4px; border-radius: 8px; }
.nav-rail .nav-group-section + .nav-group-section { margin: 4px 0 0; }

/* Icons-only rail: no room for headers, so every group shows and a line stands between them. */
:root[data-rail="collapsed"] .nav-rail .nav-group-toggle { display: none; }
:root[data-rail="collapsed"] .nav-rail .nav-group[hidden] { display: flex; }

@media (prefers-reduced-motion: reduce) {
  .nav-group-chevron { transition: none; }
}

/* Teams and access. */
.team-intro { max-width: var(--page-width); margin: 0 0 14px; }
.team-card .perm-summary-note { white-space: normal; text-align: right; }
.team-leader-tag { background: var(--color-accent-bg) !important; color: var(--color-primary-text) !important; }
.team-body { display: flex; flex-direction: column; gap: 6px; padding-top: 12px; }
.team-shortcuts { display: flex; gap: 8px; flex-wrap: wrap; }
.team-shortcuts .pill-btn {
  display: inline-flex; align-items: center; text-decoration: none;
  border: 2px solid var(--color-border); color: var(--color-primary-text); background: transparent;
}
.team-section { padding-top: 14px; margin-top: 8px; border-top: 1px solid var(--color-divider); }
.team-section-title { margin: 0 0 4px; font-size: 16px; color: var(--color-text); }
.team-access-group { margin-top: 12px; }
.team-access-group-title {
  font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--color-muted); margin-bottom: 2px;
}
.team-access-row {
  display: flex; align-items: flex-start; gap: 14px; padding: 10px 0;
  border-top: 1px solid var(--color-divider);
}
.team-access-row:first-of-type { border-top: none; }
.team-access-text { flex: 1; min-width: 0; }
.team-access-text label { margin: 0; font-weight: 700; font-size: 15px; cursor: pointer; }
.team-access-text .muted-note { margin: 2px 0 0; font-size: 13px; }
.team-switch:disabled + .team-access-text label { cursor: default; color: var(--color-muted); }

/* A switch rather than a box: each one saves the moment it flips. */
.team-switch {
  appearance: none; -webkit-appearance: none; flex-shrink: 0; margin: 2px 0 0;
  width: 46px; height: 28px; border-radius: 999px; position: relative; cursor: pointer;
  background: var(--color-inactive); transition: background 0.15s ease; min-height: 0; padding: 0; border: none;
}
.team-switch::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25); transition: transform 0.15s ease;
}
.team-switch:checked { background: var(--color-primary-text); }
.team-switch:checked::after { transform: translateX(18px); }
.team-switch:focus-visible { outline: 3px solid var(--color-primary-text); outline-offset: 2px; }
.team-switch:disabled { opacity: 0.45; cursor: not-allowed; }

.team-chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0; }
.team-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 8px 6px 12px;
  border-radius: 999px; background: var(--color-accent-bg); color: var(--color-primary-text);
  font-weight: 700; font-size: 14px;
}
.team-chip-remove {
  width: 24px; height: 24px; min-height: 0; margin: 0; padding: 0; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; color: inherit; border: none;
}
.team-chip-remove:hover { background: var(--overlay-on-primary); }
.team-inline-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: stretch; }
.team-inline-form select { flex: 1 1 220px; margin: 0; }
.team-inline-btn { flex: 0 0 auto; width: auto; margin: 0; padding: 12px 16px; }

.team-account { padding: 12px 0; border-top: 1px solid var(--color-divider); }
.team-account:first-of-type { border-top: none; }
.team-account-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.team-account-who { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; min-width: 0; }
.team-account-buttons { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.team-account-actions, .team-account-access { margin-top: 8px; }
.team-link-btn { display: block; text-align: center; text-decoration: none; box-sizing: border-box; }

@media (prefers-reduced-motion: reduce) {
  .team-switch, .team-switch::after { transition: none; }
}

/* In the page for password managers and screen-reader order, out of sight. */
.visually-hidden {
  position: absolute !important; width: 1px !important; height: 1px !important; min-height: 0 !important;
  padding: 0 !important; margin: -1px !important; overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important;
}

.floorheat-badge {
  position: absolute; transform: translate(calc(-100% - 1px), 1px); z-index: 2;
  margin: 0; min-height: 0; min-width: 0; width: auto; padding: 0 3px;
  font-size: clamp(7px, 1.6vw, 11px); font-weight: 700; line-height: 1.3;
  border-radius: 8px; border: 1.5px solid var(--color-primary);
  background: var(--color-surface); color: var(--color-text); pointer-events: none;
}
.floorheat-badge[data-gap="warm"] { border-color: var(--color-error); }
.floorheat-badge[data-gap="cold"] { border-color: #2b7fd6; }
.floorheat-badge.is-selected { outline: 3px solid var(--color-warn-border); }
@media (max-width: 600px) {
  .floorheat-badge {
    width: 9px; height: 9px; padding: 0; border-radius: 50%; font-size: 0; line-height: 0;
    background: var(--color-primary); border: 1.5px solid var(--color-surface);
  }
  .floorheat-badge[data-gap="warm"] { background: var(--color-error); }
  .floorheat-badge[data-gap="cold"] { background: #2b7fd6; }
}
.floorheat-panel {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px;
  background: var(--color-surface); border-radius: var(--radius);
  box-shadow: var(--shadow-card); padding: 12px 16px;
}
.floorheat-panel .zone-btn { margin: 0; }
.floorheat-error { flex-basis: 100%; margin: 0; color: var(--color-error); }
.floorheat-error:empty { display: none; }
.floorheat-panel.hidden { display: none; }
.desired-temp-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.desired-temp-row input { width: 90px; }
@media (pointer: coarse) {
  .team-chip-remove, .item-delete-btn { min-width: 40px; min-height: 40px; }
  .proc-chip, .find-blocking, .week-day-plan, .note-link-btn { min-height: 40px; display: inline-flex; align-items: center; }
  .find-blocking { display: flex; }
  .overview-more, .overview-team-roster, .overview-team-load { display: inline-flex; align-items: center; min-height: 40px; }
}

.day-changed {
  margin: 0; font-size: 13px; font-weight: 700; color: var(--color-warn-text);
  background: var(--color-warn-bg); border-radius: 8px; padding: 3px 8px; align-self: flex-start; width: fit-content;
}

.overview-sys-row.is-warning .overview-sys-sub { color: var(--color-error); font-weight: 700; }

.handover-card { border-left: 4px solid var(--color-primary); }
.handover-facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0 0 10px; }
.handover-facts dt { color: var(--color-muted); font-size: 14px; }
.handover-facts dd { margin: 0; font-weight: 700; overflow-wrap: anywhere; }
.handover-password { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: 19px; letter-spacing: 0.02em; }
.handover-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.handover-actions > button { flex: 1 1 160px; margin: 0; }
.password-generate { margin-top: 8px; }
.request-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 10px 0; border-top: 1px solid var(--color-divider); }
.request-row:first-of-type { border-top: 0; }
.request-row .request-who { flex: 1 1 200px; display: flex; flex-direction: column; min-width: 0; }
.request-row .request-who span { font-size: 13px; color: var(--color-muted); }
.request-row button { width: auto; margin: 0; min-height: 40px; padding: 0 16px; }

.sheet-main { max-width: 760px; margin: 0 auto; padding: 16px 20px 60px; }
.sheet-controls { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.sheet-controls .theme-toggle { flex: 0 1 280px; }
.sheet-controls .btn-primary-full { width: auto; margin: 0; padding: 0 24px; }
.welcome-sheet {
  background: #ffffff; color: #1c1c1c; border: 2px solid #2a3692; border-radius: var(--radius);
  padding: 28px; display: flex; flex-direction: column; gap: 18px;
}
.sheet-head { display: flex; align-items: center; gap: 16px; }
.sheet-head h2 { margin: 0; font-size: 26px; color: #2a3692; }
.sheet-head p { margin: 2px 0 0; font-size: 17px; }
.sheet-body { display: flex; flex-wrap: wrap; gap: 22px; align-items: flex-start; }
.sheet-text { flex: 1 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.sheet-facts { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; margin: 0; font-size: 16px; }
.sheet-facts dt { color: #555; }
.sheet-facts dd { margin: 0; font-weight: 700; overflow-wrap: anywhere; }
.sheet-mono { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; }
.sheet-secret { font-size: 22px; letter-spacing: 0.02em; background: #f2f3f9; border-radius: 8px; padding: 2px 10px; width: fit-content; }
.sheet-steps { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 6px; font-size: 16px; }
.sheet-qr { flex: 0 0 auto; width: 190px; }
.sheet-qr svg { width: 100%; height: auto; display: block; }
.sheet-foot { margin: 0; font-size: 14px; color: #555; border-top: 1px dashed #999; padding-top: 12px; }
@media print {
  body { background: #ffffff; }
  .sheet-main { padding: 0; max-width: none; }
  .welcome-sheet { break-inside: avoid; }
}

.link-button {
  width: auto; min-height: 44px; margin: 6px auto 0; padding: 0 12px; display: block;
  background: none; border: none; color: var(--color-primary-text); font-size: 15px; font-weight: 700;
  text-decoration: underline; text-underline-offset: 3px; cursor: pointer;
}
.link-button:hover, .link-button:focus-visible { background: none; color: var(--color-text); }

.floorplan-hotspot[data-state="closed"] {
  background: repeating-linear-gradient(45deg, var(--color-muted) 0 6px, transparent 6px 12px);
  opacity: 0.6;
}
.floorplan-legend-swatch.state-closed {
  background: repeating-linear-gradient(45deg, var(--color-muted) 0 3px, transparent 3px 6px);
}
.floorplan-closed {
  margin: 0 0 10px; padding: 10px 12px; border-radius: var(--radius);
  border: 2px solid var(--color-muted); background: transparent;
}
.floorplan-closed h4 { margin: 0 0 4px; font-size: 14px; }
.floorplan-closed p { margin: 0 0 4px; font-size: 14px; }
.maint-note.is-closure { border-left-color: var(--color-error); background: rgba(192, 57, 43, 0.1); }
.maint-note-closed { margin: 0 0 4px; font-weight: 700; font-size: 14px; }

.daylist-dietary { margin: 0 0 8px; padding: 8px 10px; border-left: 4px solid var(--color-error); background: rgba(192, 57, 43, 0.08); border-radius: 6px; }
.daylist-dietary-line { margin: 0; font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
.daylist-dietary-see { margin: 4px 0 0; font-size: 13px; font-weight: 700; }
.daylist-dietary .read-tag { margin-left: 8px; font-size: 11px; }

.push-daily-hour { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0 0 10px 34px; font-size: 14px; }
.push-daily-hour select { width: auto; max-width: 100%; min-height: 40px; }

.wn-card {
  position: fixed; right: 16px; bottom: 16px; z-index: 900; width: min(420px, calc(100vw - 32px));
  max-height: min(70vh, 560px); display: flex; flex-direction: column; box-sizing: border-box;
  background: var(--color-surface); color: var(--color-text); border: 1px solid var(--color-border);
  border-radius: 14px; padding: 16px; box-shadow: 0 12px 36px rgba(0, 0, 0, 0.25);
}
.wn-card h3 { margin: 0 0 10px; font-size: 18px; }
.wn-list { list-style: none; margin: 0 0 14px; padding: 0; display: flex; flex-direction: column; gap: 12px; overflow-y: auto; min-height: 0; flex: 1 1 auto; }
.wn-release { font-size: 12px; font-weight: 700; text-transform: uppercase; color: var(--color-muted); }
.wn-line { display: flex; flex-direction: column; gap: 2px; font-size: 14px; line-height: 1.4; overflow-wrap: anywhere; }
.wn-see { align-self: flex-start; font-weight: 700; padding: 6px 0; color: var(--color-primary-text); }
.wn-ok { margin: 0; flex: 0 0 auto; }
@media (max-width: 600px) {
  .wn-card { left: 0; right: 0; bottom: 0; width: auto; border-radius: 16px 16px 0 0; padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
}
.daylist-section-head { flex-wrap: wrap; gap: 4px 8px; }
.daylist-section-head .read-tag { font-size: 11px; font-weight: 600; background: var(--color-warn-bg); color: var(--color-warn-text); border-radius: 999px; padding: 2px 8px; }
.load-staffing { margin: 6px 0 0; font-size: 14px; font-weight: 600; }
.load-staffing.is-short { color: var(--color-error); }

.clients-main { display: flex; flex-direction: column; gap: 14px; padding: 16px; max-width: 900px; margin: 0 auto; box-sizing: border-box; }
.client-row { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; text-align: left; padding: 10px 12px; margin-top: 8px; border: 1px solid var(--color-border); border-radius: 10px; background: var(--color-surface); color: var(--color-text); min-height: var(--tap-min); }
.client-row:hover, .client-row:focus-visible { border-color: var(--color-primary-text); }
.client-top { margin: 10px 0 0; }
.client-top h4 { margin: 0 0 2px; font-size: 13px; text-transform: uppercase; color: var(--color-muted); }
.client-top p { margin: 0; overflow-wrap: anywhere; }
.client-events-heading { margin: 6px 0 0; }
.client-event-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.client-event-head h4 { margin: 0; }
.client-session { display: block; padding: 8px 0; border-top: 1px solid var(--color-divider); font-size: 14px; overflow-wrap: anywhere; }
.client-rebook { margin-top: 10px; }
.client-rebook summary { cursor: pointer; font-weight: 700; color: var(--color-primary-text); min-height: 40px; display: flex; align-items: center; }
.client-page-link { display: inline-block; margin-top: 6px; font-weight: 700; color: var(--color-primary-text); padding: 8px 0; }

.room-main { display: flex; flex-direction: column; gap: 14px; padding: 16px; max-width: 700px; margin: 0 auto; box-sizing: border-box; }
.room-session { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 10px 0; border-top: 1px solid var(--color-divider); color: var(--color-text); overflow-wrap: anywhere; }
.room-closed { margin: 0 0 4px; font-weight: 700; color: var(--color-error); }
.room-note { margin: 8px 0 0; padding: 8px 10px; border-left: 4px solid #b7791f; background: rgba(183, 121, 31, 0.1); border-radius: 6px; }
.room-report { text-align: center; text-decoration: none; display: flex; align-items: center; justify-content: center; }
.room-qr-image { display: block; background: #ffffff; padding: 8px; border-radius: 8px; max-width: 100%; height: auto; }
.room-sheet { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.room-sheet-card { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px; border: 2px dashed var(--color-border); border-radius: 12px; text-align: center; break-inside: avoid; }
@media print { .room-sheet { grid-template-columns: repeat(3, 1fr); } .room-sheet-card { border-color: #000; } }
.room-sheet-link { display: inline-block; margin-top: 8px; font-weight: 700; color: var(--color-primary-text); }
.actuals-form { margin-top: 10px; }
.client-actuals-heading { margin: 12px 0 2px; font-size: 13px; text-transform: uppercase; color: var(--color-muted); }
.drive-expires { color: var(--color-warn-text); font-weight: 600; }
.drive-trash { margin-top: 18px; padding: 12px; border: 1px dashed var(--color-border); border-radius: 12px; }
.drive-trash-row { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; padding: 8px 0; border-top: 1px solid var(--color-divider); }
.drive-restore { width: auto; min-height: 36px; padding: 0 14px; margin-left: auto; }
.floorheat-status { flex-basis: 100%; margin: 0; font-size: 13px; color: var(--color-muted); }
.floorheat-status:empty { display: none; }
.floorheat-target.is-pending { opacity: 0.6; }
.floorheat-panel .zone-btn { min-height: 44px; min-width: 48px; }

.is-viewing-as .top-bar { box-shadow: inset 0 -4px 0 #f5a623; }
.is-viewing-as body { padding-bottom: 150px; }
.view-as-text { flex: 1 1 100%; text-align: center; }
.view-as-bar {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(76px + env(safe-area-inset-bottom));
  z-index: 1100; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: center;
  width: calc(100vw - 24px); max-width: 460px; padding: 10px 12px; border-radius: 20px;
  background: #f5a623; color: #1b1b1b; font-weight: 700; font-size: 14px; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}
@media (min-width: 900px) { .view-as-bar { bottom: 16px; } }
.view-as-btn {
  min-height: 36px; padding: 0 14px; border-radius: 999px; border: 2px solid #1b1b1b; background: transparent;
  color: #1b1b1b; font-weight: 700; font-size: 13px; width: auto; margin: 0;
}
.view-as-btn.is-primary { background: #1b1b1b; color: #ffffff; }
.view-as-dialog { max-width: 460px; }
.view-as-list { max-height: 50vh; overflow-y: auto; margin: 10px 0; }
.view-as-team { margin: 12px 0 4px; font-size: 12px; text-transform: uppercase; color: var(--color-muted); }
.view-as-row {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; text-align: left; min-height: 48px;
  padding: 8px 12px; margin-bottom: 6px; border: 1px solid var(--color-border); border-radius: 10px;
  background: var(--color-surface); color: var(--color-text);
}
.view-as-row:hover, .view-as-row:focus-visible { border-color: var(--color-primary-text); }
.tool-group { margin: 0 0 18px; }
.tool-group h3 { margin: 0 0 6px; font-size: 16px; }
.tool-intro { margin: 0 0 14px; }
.tool-row { padding: 10px 0; border-top: 1px solid var(--color-divider); }
.tool-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tool-name { font-weight: 700; font-size: 15px; color: var(--color-primary-text); overflow-wrap: anywhere; }
.tool-how { margin: 2px 0 0; font-size: 14px; line-height: 1.4; }
.tool-about { margin: 4px 0 2px; font-size: 14px; line-height: 1.4; }
.tool-command { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tool-command code { flex: 1 1 260px; min-width: 0; padding: 6px 10px; border-radius: 8px; background: var(--color-accent-bg); font-size: 13px; overflow-wrap: anywhere; }
.tool-copy { width: auto; margin: 0; min-height: 36px; padding: 0 14px; }

/* Dark mode: recolor the white floor plan instead of blinding people with it. */
.sw-screen[data-screen-theme="dark"] .sw-floorplan-image { filter: invert(0.9) hue-rotate(180deg) brightness(0.95); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .floorplan-image { filter: invert(0.9) hue-rotate(180deg) brightness(0.95); }
}
:root[data-theme="dark"] .floorplan-image { filter: invert(0.9) hue-rotate(180deg) brightness(0.95); }

.here-picker { position: relative; margin: 10px 0 6px; line-height: 0; cursor: crosshair; touch-action: none; user-select: none; border-radius: var(--radius); overflow: hidden; }
.here-picker img { width: 100%; height: auto; display: block; }
.here-picker-dot {
  position: absolute; width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%;
  background: #e5484d; border: 3px solid #fff; box-shadow: 0 0 0 2px rgba(229, 72, 77, 0.5), 0 1px 4px rgba(0, 0, 0, 0.5); pointer-events: none;
}
.shift-nights { display: flex; flex-direction: column; gap: 6px; }
.shift-nights-title { margin: 0; font-size: 14px; font-weight: 600; }
.shift-new textarea { min-height: 64px; resize: vertical; }
.reimport-list { display: flex; flex-direction: column; gap: 14px; margin: 12px 0; }
.reimport-item { padding: 12px; border: 1px solid var(--color-divider); border-radius: var(--radius); display: flex; flex-direction: column; gap: 6px; }
.reimport-item p { margin: 0; }
.reimport-existing { font-size: 14px; }
.reimport-question { font-weight: 600; margin-top: 4px !important; }
.reimport-choices { display: flex; flex-direction: column; gap: 6px; }
.shift-date-field { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.shift-date-field label { font-weight: 600; font-size: 14px; }
.shift-date-field input { width: auto; margin: 0; }
.shift-date-name { font-size: 14px; color: var(--color-muted); }
.shift-form input[type="date"], .shift-form textarea {
  min-height: 46px; padding: 10px 14px; font-size: 16px; border-radius: 12px; background: var(--color-surface);
}
.shift-nights > summary { cursor: pointer; font-size: 14px; font-weight: 600; color: var(--color-primary-text); }
.shift-nights[open] > summary { margin-bottom: 8px; }
.shift-step-head { flex-wrap: wrap; }

.planner-link { display: inline-flex; width: auto; margin: 0 0 10px; }
.planner-main { display: flex; flex-direction: column; gap: 16px; padding-bottom: 120px; }
.planner-days { display: flex; flex-wrap: wrap; gap: 12px; align-items: stretch; }
.planner-day, .planner-paste, .planner-names {
  background: var(--color-surface); border-radius: var(--radius); box-shadow: var(--shadow-card); padding: 14px;
}
.planner-day { flex: 1 1 240px; max-width: 360px; display: flex; flex-direction: column; gap: 8px; }
.planner-day-head { display: flex; align-items: center; gap: 10px; }
.planner-day-count { flex: 1; font-size: 13px; color: var(--color-muted); font-weight: 600; }
.planner-day input[type="date"], .planner-day input[type="time"], .planner-day input[type="text"], .planner-paste textarea, .planner-tools input {
  min-height: 44px; padding: 8px 12px; font-size: 16px; border-radius: 12px; background: var(--color-surface); margin: 0;
}
.planner-day-name { margin: 0; }
.planner-day-name::first-letter { text-transform: uppercase; }
.planner-add-day {
  flex: 0 0 auto; align-self: center; width: auto; margin: 0; padding: 12px 18px; border-radius: 999px;
  border: 2px dashed var(--color-border-soft); background: none; color: var(--color-primary-text); font-weight: 700;
}
.planner-tools { display: flex; gap: 12px; align-items: center; margin-bottom: 8px; }
.planner-tools input { flex: 1; min-width: 0; }
.planner-row { display: grid; align-items: center; gap: 8px; padding: 2px 0; border-top: 1px solid var(--color-divider); }
.planner-row-head {
  position: sticky; top: 64px; z-index: 2; background: var(--color-surface); border-top: none; padding: 8px 0;
  font-size: 12px; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; color: var(--color-muted);
}
.planner-cell-head { text-align: center; }
.planner-name { font-weight: 600; font-size: 15px; overflow-wrap: anywhere; padding: 6px 0; }
.planner-cell { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 46px; margin: 0; cursor: pointer; }
.planner-cell input { width: 26px; height: 26px; min-height: 0; margin: 0; cursor: pointer; }
.planner-cell.is-already { opacity: 0.55; cursor: default; }
.planner-already { font-size: 10px; color: var(--color-muted); }
.planner-paste { display: flex; flex-direction: column; gap: 8px; }
.planner-paste p { margin: 0; }
.planner-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: var(--color-surface); border-top: 1px solid var(--color-divider);
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.08);
}
.planner-summary { flex: 1 1 200px; font-weight: 700; font-variant-numeric: tabular-nums; }
.planner-bar .shift-submit:disabled { opacity: 0.5; }
.planner-message { flex-basis: 100%; margin: 0; font-size: 14px; font-weight: 700; }
.planner-message:empty { display: none; }
.planner-message.is-ok { color: var(--color-ok-text); }
.planner-message.is-error { color: var(--color-error); }
@media (min-width: 900px) { .planner-bar { left: 64px; } }
@media (max-width: 760px) {
  .planner-bar { bottom: calc(64px + var(--safe-bottom, 0px)); padding-bottom: 12px; }
  .planner-main { padding-bottom: 190px; }
}
#my-shift-body { max-width: 900px; margin-left: auto; margin-right: auto; }

#my-shift-body > .mine-card { margin-bottom: 14px; }
.mine-card { padding: 16px 18px 12px; }
.mine-card.is-today { box-shadow: var(--shadow-card), inset 4px 0 0 var(--color-primary); }
.mine-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 4px; }
.mine-head h3 { margin: 0; flex: 1; }
.mine-head h3::first-letter { text-transform: uppercase; }
.mine-today { font-size: 12px; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; color: var(--color-primary-text); }
.mine-count { font-size: 13px; font-weight: 600; color: var(--color-muted); }
.mine-row {
  display: grid; grid-template-columns: minmax(96px, 168px) minmax(0, 1fr) 118px; align-items: center; gap: 4px 14px;
  padding: 7px 0; border-top: 1px solid var(--color-divider);
}
.mine-row.mine-ruler { border-top: none; padding: 4px 0 2px; }
.mine-row.mine-ruler .who-ruler { margin: 0; height: 16px; }
.mine-who { display: flex; flex-direction: column; min-width: 0; }
.mine-name { font-size: 15px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mine-team { font-size: 12px; color: var(--color-muted); }
.mine-row .who-track { margin: 0; height: 12px; }
.mine-row .who-bar { background: var(--color-primary); }
.mine-hours { font-size: 14px; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; color: var(--color-primary-text); white-space: nowrap; }
.mine-note { grid-column: 1 / -1; font-size: 13px; color: var(--color-muted); }
@media (max-width: 560px) {
  .mine-row { grid-template-columns: minmax(0, 1fr) auto; }
  .mine-row.mine-ruler { grid-template-columns: 1fr; }
  .mine-row.mine-ruler > span { display: none; }
  .mine-row .who-track { grid-column: 1 / -1; grid-row: 2; }
  .mine-hours { grid-row: 1; grid-column: 2; }
}

.planner-row { justify-content: start; }
.planner-row:not(.planner-row-head) { transition: background-color 0.1s; border-radius: 8px; }
.planner-row:not(.planner-row-head):hover { background: var(--color-accent-bg); }
.planner-row.is-picked .planner-name { color: var(--color-primary-text); }
.planner-row.is-picked:not(:hover) { background: color-mix(in srgb, var(--color-primary) 9%, transparent); }
.planner-cell input { accent-color: var(--color-primary); }
.planner-cell-head { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.planner-head-count { font-size: 15px; font-weight: 800; letter-spacing: 0; color: var(--color-primary-text); }
.planner-same-hours { align-self: flex-start; font-size: 13px; }
.planner-tools { flex-wrap: wrap; }
.planner-bar {
  position: sticky; left: auto; right: auto; bottom: 0; border: 1px solid var(--color-divider); border-radius: var(--radius);
  padding: 12px 16px;
}
.planner-main { padding-bottom: 24px; }
@media (min-width: 900px) { .planner-bar { left: auto; } }
@media (max-width: 760px) {
  .planner-bar { bottom: calc(64px + var(--safe-bottom, 0px)); padding-bottom: 12px; }
  .planner-main { padding-bottom: 100px; }
}

.pe-main {
  box-sizing: border-box; width: 100%; max-width: var(--page-width); margin: 0 auto;
  height: calc(100vh - var(--pe-top, 64px) - var(--tabbar-h) - var(--safe-bottom));
  height: calc(100dvh - var(--pe-top, 64px) - var(--tabbar-h) - var(--safe-bottom));
  min-height: 380px; padding: 8px 10px 10px;
  display: flex; flex-direction: column; gap: 8px;
}
.pe-notice { margin: 0; flex: 0 0 auto; }
.pe-auto-banner { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; flex: 0 0 auto; margin: 0; padding: 8px 12px; background: var(--color-accent-bg); border: 1px solid var(--color-border); border-radius: 10px; }
.pe-auto-text { flex: 1 1 220px; font-size: 14px; font-weight: 600; }
.pe-auto-banner.hidden { display: none; }
.pe-actions { position: relative; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; flex: 0 0 auto; }
.pe-cluster { display: inline-flex; align-items: center; gap: 4px; }
.pe-spacer { flex: 1 1 0; }
.pe-readonly { padding: 4px 10px; border-radius: 999px; background: var(--color-neutral-bg); color: var(--color-neutral-text); font-size: 13px; font-weight: 700; }
.pe-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; flex: 0 0 auto;
  width: auto; min-height: 40px; margin: 0; padding: 6px 12px;
  font-size: 14px; font-weight: 700; line-height: 1.1;
  background: var(--color-surface); color: var(--color-text);
  border: 1px solid var(--color-border); border-radius: 10px; cursor: pointer; transition: none;
}
.pe-btn:active { background: var(--color-accent-bg); transform: none; }
.pe-btn:disabled { opacity: 0.4; cursor: default; }
.pe-btn.pe-primary { background: var(--color-primary); color: var(--color-on-primary); border-color: var(--color-primary); }
.pe-btn.pe-primary:active { background: var(--color-primary-dark); }
.pe-btn.pe-primary:disabled { opacity: 0.5; }
.pe-btn.pe-ibtn { min-width: 40px; padding: 6px; font-size: 20px; }
.pe-btn.pe-small { min-height: 32px; padding: 4px 10px; font-size: 13px; }
.pe-btn.pe-danger { color: var(--color-error); border-color: var(--color-error); }
.pe-btn.pe-active { background: var(--color-primary); color: var(--color-on-primary); border-color: var(--color-primary); }
.pe-ico { width: 20px; height: 20px; flex: 0 0 auto; }
.pe-wide-only { display: none; }
.pe-zoom-label { display: none; min-width: 44px; text-align: center; font-size: 13px; font-weight: 700; color: var(--color-muted); }

.pe-view > summary { list-style: none; }
.pe-view > summary::-webkit-details-marker { display: none; }
.pe-view[open] > summary { background: var(--color-accent-bg); }
.pe-pop {
  position: absolute; top: calc(100% + 6px); right: 0; z-index: 25; width: min(300px, 100%); box-sizing: border-box;
  padding: 12px; display: flex; flex-direction: column; gap: 10px; max-height: 62vh; overflow-y: auto; overscroll-behavior: contain;
  background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 12px; box-shadow: var(--shadow-card);
}
@media (min-width: 700px) {
  .pe-view { position: relative; }
  .pe-pop { left: 0; right: auto; width: 300px; }
}
.pe-pop > .pe-btn { width: 100%; }
.pe-pop .pe-field { flex-direction: column; align-items: stretch; gap: 4px; }
.pe-pop input[type="range"] { width: 100%; margin: 0; }
.pe-check { display: flex; align-items: center; gap: 10px; min-height: 36px; font-size: 14px; font-weight: 600; cursor: pointer; }
.pe-check input { width: 20px; height: 20px; margin: 0; flex: 0 0 auto; }
.pe-gen input.pe-size[type="number"] { min-height: 40px; padding: 6px 8px; font-size: 15px; border-width: 1px; border-radius: 8px; background: var(--color-surface); }
.pe-gen-note { margin: 0; font-size: 13px; line-height: 1.35; color: var(--color-muted); }
.pe-size { width: 100%; box-sizing: border-box; min-height: 40px; padding: 6px 8px; font-size: 15px; border: 1px solid var(--color-border); border-radius: 8px; background: var(--color-surface); color: inherit; }

.pe-work { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; gap: 8px; }
.pe-board {
  position: relative; order: 1; flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; overflow: hidden;
  border: 1px solid var(--color-border); border-radius: 12px; background: var(--color-surface-sunken);
}
.pe-canvas { flex: 1 1 auto; min-height: 0; display: flex; overflow: auto; padding: 8px; scrollbar-gutter: stable; overscroll-behavior: contain; }
.pe-svg { display: block; flex: none; margin: auto; touch-action: none; user-select: none; background: #ffffff; box-shadow: 0 1px 6px rgba(0, 0, 0, 0.2); }
.pe-totals { flex: 0 0 auto; margin: 0; padding: 6px 12px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; border-top: 1px solid var(--color-divider); background: var(--color-surface); font-size: 13px; color: var(--color-muted); }
.pe-totals-text { flex: 0 1 auto; }
.pe-main .pe-chip { display: inline-flex; align-items: center; width: auto; min-height: 24px; margin: 0; padding: 2px 10px; border: 0; border-radius: 999px; font-size: 12px; font-weight: 700; line-height: 1.2; background: var(--color-accent-bg); color: var(--color-primary-text); }
.pe-main .pe-chip.is-warn { background: var(--color-warn-bg); color: var(--color-warn-text); box-shadow: inset 0 0 0 1px var(--color-warn-border); }
.pe-main .pe-chip-btn { background: var(--color-allergy-bg); color: var(--color-error); box-shadow: inset 0 0 0 1px var(--color-error); cursor: pointer; }
.pe-main .pe-chip.hidden { display: none; }
.pe-print-head { display: none; }
.pe-status {
  position: absolute; top: 10px; right: 14px; z-index: 3; margin: 0; padding: 4px 12px; border-radius: 999px; pointer-events: none;
  font-size: 13px; font-weight: 700; background: var(--color-warn-bg); color: var(--color-warn-text); box-shadow: var(--shadow-card);
}
.pe-hint {
  position: absolute; top: 10px; left: 50%; transform: translateX(-50%); z-index: 4; max-width: calc(100% - 24px); width: max-content;
  display: flex; align-items: center; gap: 10px; padding: 8px 10px 8px 14px; border-radius: 12px; box-sizing: border-box;
  background: var(--color-primary); color: var(--color-on-primary); font-size: 14px; font-weight: 600; box-shadow: var(--shadow-card);
}
.pe-hint .pe-btn { background: transparent; color: inherit; border-color: currentColor; }
.pe-btn.pe-fab { position: absolute; left: 12px; bottom: 46px; z-index: 4; min-height: 44px; padding: 8px 16px; border-radius: 999px; box-shadow: var(--shadow-card); }
.pe-main.palette-open .pe-fab { display: none; }

.pe-palette, .pe-inspector {
  order: 2; flex: 0 0 auto; max-height: 44vh; overflow-y: auto; box-sizing: border-box; padding: 10px;
  background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 12px; box-shadow: 0 -4px 14px rgba(0, 0, 0, 0.1);
}
.pe-palette { display: none; }
.pe-main.palette-open .pe-palette { display: block; }
.pe-main.palette-open .pe-inspector, .pe-inspector.is-idle { display: none; }
.pe-side-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.pe-side-title { margin: 0; font-size: 15px; font-weight: 800; }
.pe-group-title { margin: 10px 0 6px; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; color: var(--color-muted); }
.pe-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 6px; }
.pe-btn.pe-tile { flex-direction: column; gap: 4px; width: 100%; min-height: 62px; padding: 6px 4px; font-size: 12px; font-weight: 600; }
.pe-tile-name { line-height: 1.15; text-align: center; overflow-wrap: anywhere; }
.pe-tile-icon { width: 52px; height: 36px; display: block; }
.pe-tile-icon .pe-text { font-size: 17px; }
.pe-dot { fill: #ffffff; stroke-width: 1; }
.pe-buffet .pe-dot { stroke: #1e7a49; }
.pe-speaker .pe-dot, .pe-projector .pe-dot { stroke: #3b47a3; }
.pe-line { fill: none; stroke-width: 1.8; stroke-linecap: round; }
.pe-fridge .pe-line { stroke: #1b6f8f; }
.pe-microphone .pe-line { stroke: #3b47a3; }

.pe-selected { display: flex; flex-direction: column; gap: 8px; }
.pe-sel-head { display: flex; align-items: center; gap: 8px; }
.pe-sel-icon .pe-tile-icon { width: 40px; height: 28px; }
.pe-sel-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; }
.pe-label-input {
  width: 100%; box-sizing: border-box; min-height: 44px; margin: 0; padding: 8px 12px; font-size: 16px;
  border: 1px solid var(--color-border); border-radius: 10px; background: var(--color-surface); color: inherit;
}
.pe-quick { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.pe-sel-actions { display: flex; gap: 6px; margin-left: auto; }
.pe-field { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px 10px; }
.pe-field-label { font-size: 13px; font-weight: 700; color: var(--color-muted); }
.pe-field-body { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pe-stepper { display: inline-flex; align-items: center; gap: 4px; }
.pe-value { min-width: 36px; text-align: center; font-size: 15px; }
.pe-value-wide { min-width: 64px; }
.pe-swatches { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.pe-main .pe-swatch {
  flex: 0 0 auto; width: 28px; height: 28px; min-height: 0; margin: 0; padding: 0; border-radius: 50%; cursor: pointer;
  border: 2px solid var(--color-surface); box-shadow: 0 0 0 1px var(--color-border);
}
.pe-main .pe-swatch[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--color-primary-text); }
.pe-color { width: 36px; height: 32px; padding: 0; border: 1px solid var(--color-border); border-radius: 8px; background: transparent; cursor: pointer; }
.pe-style { padding-top: 4px; border-top: 1px solid var(--color-divider); }
.pe-style > summary { min-height: 32px; display: flex; align-items: center; font-size: 13px; font-weight: 700; color: var(--color-muted); cursor: pointer; }
.pe-style[open] > summary { margin-bottom: 6px; }
.pe-style .pe-field + .pe-field { margin-top: 10px; }
.pe-idle-body { margin: 4px 0 0; font-size: 14px; color: var(--color-muted); }
.pe-keys { margin: 0; display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 8px 12px; font-size: 13px; }
.pe-keys dt { display: flex; gap: 3px; }
.pe-keys dd { margin: 0; color: var(--color-muted); }
.pe-keys kbd {
  padding: 1px 6px; font: inherit; font-size: 12px; font-weight: 700; background: var(--color-surface-sunken);
  border: 1px solid var(--color-border); border-bottom-width: 2px; border-radius: 5px;
}

@media (min-width: 600px) {
  .pe-zoom-label { display: inline-block; }
}
@media (min-width: 700px) {
  .pe-wide-only { display: inline; }
}
@media (min-width: 900px) {
  .pe-phone-only, .pe-btn.pe-fab { display: none; }
  .pe-work { display: grid; grid-template-columns: 232px minmax(0, 1fr) 280px; grid-template-rows: minmax(0, 1fr); gap: 10px; }
  .pe-work.is-readonly { grid-template-columns: minmax(0, 1fr); }
  .pe-palette, .pe-main.palette-open .pe-palette, .pe-inspector, .pe-main.palette-open .pe-inspector, .pe-inspector.is-idle {
    display: block; max-height: none; min-height: 0; padding: 12px; box-shadow: none;
  }
  .pe-palette { order: 0; }
  .pe-inspector { order: 2; }
  .pe-tiles { grid-template-columns: repeat(2, 1fr); }
  .pe-sel-actions { flex-direction: column; width: 100%; margin-left: 0; }
  .pe-sel-actions .pe-btn { justify-content: flex-start; }
  .pe-quick { flex-direction: column; align-items: stretch; }
  .pe-main { padding-top: 10px; }
}

.pe-paper { fill: #ffffff; }
.pe-obj { cursor: grab; }
.pe-shape { fill: #e6e9f7; stroke: #2a3692; stroke-width: 1.5; }
.pe-hit { fill: transparent; }
.pe-chair-shape { fill: #cfd5ee; stroke: #2a3692; stroke-width: 1; }
.pe-bar .pe-shape { fill: #d3bfa9; stroke: #5e4332; }
.pe-service_table .pe-shape, .pe-buffet .pe-shape { fill: #cfeedd; stroke: #1e7a49; }
.pe-stage .pe-shape { fill: #d9d2c5; stroke: #5a4a30; }
.pe-dance_floor .pe-shape { fill: #f3dcf0; stroke: #8a2a7d; stroke-dasharray: 6 4; }
.pe-podium .pe-shape { fill: #dddddd; stroke: #444444; }
.pe-speaker .pe-shape, .pe-microphone .pe-shape, .pe-projector .pe-shape, .pe-screen .pe-shape { fill: #d8dcf5; stroke: #3b47a3; }
.pe-fridge .pe-shape { fill: #d4ecf5; stroke: #1b6f8f; }
.pe-text { fill: #1b1e2c; pointer-events: none; }
.pe-selection { fill: none; stroke: var(--color-primary); stroke-width: 1.5; stroke-dasharray: 5 3; }
.pe-handle { fill: var(--color-primary); stroke: #ffffff; stroke-width: 1.5; cursor: pointer; }
.plan-editor-link { margin: 12px 0; text-decoration: none; }
@media (max-width: 600px) {
  .planner-row { gap: 4px; }
  .planner-cell-head { font-size: 11px; }
  .planner-name { font-size: 14px; }
}
.floorplan-image-wrap[data-plan-theme="light"] .floorplan-image { filter: none; }
.floorplan-image-wrap[data-plan-theme="dark"] .floorplan-image { filter: invert(0.9) hue-rotate(180deg) brightness(0.95); }
.tight-ok-btn { width: auto; margin: 8px 0 0 12px; min-height: 34px; padding: 0 14px; cursor: pointer; }

.pe-svg.pe-drawing { cursor: crosshair; }
.pe-text-out { fill: #1b1e2c; font-weight: 600; paint-order: stroke; stroke: #ffffff; stroke-width: 3px; stroke-linejoin: round; }
.pe-hit-line { stroke: transparent; stroke-width: 18; stroke-linecap: round; }
.pe-arrow-line { stroke-width: 3; stroke-linecap: round; fill: none; }
.pe-arrow-head { stroke: none; }
.pe-obj.pe-arrow { cursor: grab; }
.pe-lib-list { display: grid; gap: 8px; margin: 12px 0; }
.pe-lib-item { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; text-align: left; }
.pe-svg.pe-selecting, .pe-svg.pe-measuring { cursor: crosshair; }
.pe-ruler-line { stroke: #c0392b; stroke-linecap: round; }
.pe-ruler-end { fill: #c0392b; stroke: #fff; }
.pe-ruler-tag { fill: #fff; stroke: #c0392b; }
.pe-ruler-text { fill: #1b1e2c; font-weight: 700; }
.pe-svg.pe-panning, .pe-svg.pe-panning .pe-obj { cursor: grab; }
.pe-marquee { fill: rgba(42, 54, 146, 0.12); stroke: var(--color-primary); stroke-width: 1.5; stroke-dasharray: 5 3; }
.pe-problem .pe-shape { stroke: #c0392b; stroke-width: 3; }
.pe-problem .pe-chair-shape { fill: #f6c9c3; stroke: #c0392b; }

@media print {
  .pe-actions, .pe-palette, .pe-inspector, .pe-notice, .pe-auto-banner, .pe-status, .pe-hint, .pe-fab, .pe-totals { display: none !important; }
  .pe-main { height: auto; min-height: 0; max-width: none; padding: 0; display: block; }
  .pe-work, .pe-work.is-readonly { display: block; }
  .pe-board { display: block; overflow: visible; border: 0; border-radius: 0; background: #ffffff; }
  .pe-canvas { display: block; overflow: visible; padding: 0; }
  .pe-svg { display: block; width: auto !important; max-width: 100%; height: auto; max-height: 9in; margin: 0 auto; box-shadow: none; }
  .pe-print-head { display: block; margin: 0 0 12px; padding: 0 0 8px; border-bottom: 2px solid var(--color-primary); }
  .pe-print-head h1 { margin: 0 0 4px; font-size: 22px; color: var(--color-text); }
  .pe-print-head p { margin: 0; font-size: 13px; color: var(--color-muted); }
}

.restart-banner { position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 5000; padding: 12px 16px; border-radius: 12px; background: #2d3566; color: #fff; text-align: center; font-weight: 600; box-shadow: 0 6px 24px rgba(0, 0, 0, .35); }

.rp-intro-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.rp-intro-row p { margin: 0; flex: 1 1 260px; }
.rp-room-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.rp-room-title { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.rp-room-head h3 { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.rp-plan { padding: 10px 0; border-top: 1px solid var(--color-divider); }
.rp-plan-head { display: flex; flex-direction: column; gap: 2px; margin-bottom: 8px; }
.rp-plan-name { font-weight: 700; font-size: 16px; overflow-wrap: anywhere; }
.rp-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.rp-btn, .section-card a.rp-btn {
  display: inline-flex; align-items: center; justify-content: center; width: auto; min-height: 40px; margin: 0; padding: 6px 14px;
  border: 2px solid var(--color-border); border-radius: 999px; background: transparent; color: var(--color-primary-text);
  font-size: 14px; font-weight: 700; text-decoration: none; cursor: pointer;
}
.rp-btn:hover, .rp-btn:focus-visible { border-color: var(--color-primary-text); background: var(--color-accent-bg); }
.rp-btn:active { transform: none; background: var(--color-accent-bg); }
.rp-btn-primary, .section-card a.rp-btn-primary { background: var(--color-primary); border-color: var(--color-primary); color: var(--color-on-primary); }
.rp-btn-primary:hover, .rp-btn-primary:focus-visible, .rp-btn-primary:active { background: var(--color-primary-dark); border-color: var(--color-primary-dark); }
.rp-btn-danger { color: var(--color-error); }
.rp-btn:disabled { opacity: 0.5; cursor: default; }
.rp-dialog-wide { max-width: 520px; }
.rp-attach-list { max-height: 50vh; overflow-y: auto; margin: 10px 0; }
.rp-event { border: 1px solid var(--color-border); border-radius: 10px; margin-bottom: 8px; padding: 6px 10px; }
.rp-event-head { display: flex; align-items: center; gap: 10px; padding: 4px 0; min-height: 40px; }
.rp-event-name { display: flex; flex-direction: column; min-width: 0; overflow-wrap: anywhere; }
.rp-session { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-height: 44px; margin: 0; padding: 4px 0 4px 6px; border-top: 1px solid var(--color-divider); font-size: 15px; font-weight: 400; cursor: pointer; }
.rp-session-text { display: flex; flex-direction: column; flex: 1 1 140px; min-width: 0; }
.rp-event-head input[type="checkbox"], .rp-session input[type="checkbox"] { width: 22px; height: 22px; min-height: 0; margin: 0; flex: none; }
.rp-flag { margin: 0; }
.rp-form .field { margin-bottom: 8px; }
.rp-more { border: 1px solid var(--color-border); border-radius: 10px; margin: 0 0 8px; padding: 6px 10px 8px; min-width: 0; }
.rp-more legend { font-weight: 700; padding: 0 4px; }
.rp-more p { margin: 0 0 6px; }
.rp-more-list { max-height: 180px; overflow-y: auto; }
.rp-more-room { display: flex; align-items: center; gap: 10px; min-height: 40px; margin: 0; font-size: 15px; font-weight: 400; cursor: pointer; }
.rp-more-room input[type="checkbox"] { width: 22px; height: 22px; min-height: 0; margin: 0; flex: none; }
.rp-more-room.is-off { opacity: 0.45; cursor: default; }
.rp-joined { font-size: 13px; color: var(--color-primary-text); }

.iq-main { max-width: 900px; }
.iq-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 10px; }
.iq-toolbar .view-toggle { flex: 1 1 auto; min-width: 0; overflow-x: auto; }
.iq-toolbar .view-toggle-btn { white-space: nowrap; }
#iq-search { width: 100%; margin-bottom: 12px; }
.iq-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0 14px; }
.iq-grid > div { min-width: 0; }
.iq-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.iq-actions > button { flex: 1 1 140px; margin: 0; }
.iq-delete { color: var(--color-error); }
.iq-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.iq-card { margin: 0; }
.iq-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.iq-card-title { display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-start; gap: 2px; flex: 1 1 auto; width: auto; min-width: 0; min-height: 0; margin: 0; padding: 0; border: 0; border-radius: 0; background: none; color: var(--color-text); font: inherit; text-align: left; cursor: pointer; overflow-wrap: anywhere; }
.iq-card-title:active { background: none; transform: none; }
#iq-new, #cat-new, .iq-book { width: auto; }
.iq-card-title strong { font-size: 16px; }
.iq-card-title span { font-size: 14px; color: var(--color-muted); }
.section-card p.iq-facts { margin: 6px 0 2px; font-size: 14px; }
.iq-card-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin-top: 8px; font-size: 14px; }
.iq-follow-up { font-weight: 600; }
.iq-follow-up.is-overdue { color: var(--color-error); }
.iq-book { margin-left: auto; }
.iq-stage { flex: none; background: var(--color-neutral-bg); color: var(--color-neutral-text); }
.iq-stage.is-proposal { background: var(--color-warn-bg); color: var(--color-warn-text); }
.iq-stage.is-won { background: var(--color-ok-bg); color: var(--color-ok-text); }
.iq-stage.is-lost { background: var(--color-surface-sunken); color: var(--color-muted); }
.cat-price { flex: none; font-weight: 700; white-space: nowrap; }
.cat-group { margin: 18px 0 8px; font-size: 16px; color: var(--color-muted); }
#cat-settings input:disabled { opacity: 1; color: var(--color-text); }
.pr-card-link { text-decoration: none; }
.pr-status.is-sent { background: var(--color-warn-bg); color: var(--color-warn-text); }
.pr-status.is-accepted { background: var(--color-ok-bg); color: var(--color-ok-text); }
.pr-status.is-declined, .pr-status.is-cancelled { background: var(--color-surface-sunken); color: var(--color-muted); }
.pe-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.pe-actions .pill-btn { width: auto; }
.pe-secondary { background: transparent !important; color: var(--color-primary-text) !important; border: 2px solid var(--color-primary-text); }
.pe-line { border: 1px solid var(--color-border); border-radius: 10px; padding: 10px; margin-bottom: 10px; }
.pe-line-main { display: flex; gap: 8px; align-items: center; }
.pe-line-main input { flex: 1 1 auto; min-width: 0; }
.pe-line-remove { flex: none; width: 40px; min-height: 40px; padding: 0; font-size: 22px; background: transparent; color: var(--color-error); border: 1px solid var(--color-border); }
.pe-line .pl-details { margin-top: 6px; }
.pe-line-figures { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 6px 10px; align-items: end; margin-top: 6px; }
.pe-line-figures label { display: flex; flex-direction: column; gap: 2px; margin: 0; font-size: 13px; }
.pe-line-figures .pe-check { flex-direction: row; align-items: center; gap: 8px; min-height: 44px; font-size: 14px; }
.pe-line-figures .pe-check input { width: 20px; height: 20px; min-height: 0; margin: 0; }
.pe-line .pl-amount { grid-column: 1 / -1; text-align: right; font-size: 16px; }
.pe-add { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 4px 0 12px; }
.pe-add select { flex: 1 1 240px; min-width: 0; margin: 0; }
.pe-add .pill-btn { width: auto; }
.pe-totals, .doc-totals { display: grid; grid-template-columns: 1fr auto; gap: 4px 16px; margin: 8px 0 0 auto; max-width: 360px; }
.pe-totals dt, .doc-totals dt { margin: 0; }
.pe-totals dd, .doc-totals dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.pe-totals .is-total, .doc-totals .is-total { font-weight: 800; font-size: 17px; border-top: 1px solid var(--color-border); padding-top: 4px; }
body.doc-page { background: #fff; color: #111; }
.doc-toolbar { display: flex; justify-content: flex-end; max-width: 820px; margin: 16px auto 0; padding: 0 16px; }
.doc-toolbar .pill-btn { width: auto; }
.doc { max-width: 820px; margin: 0 auto; padding: 24px 16px 48px; color: #111; font-size: 14px; line-height: 1.45; }
.doc p { margin: 0 0 2px; white-space: pre-line; overflow-wrap: anywhere; }
.doc-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; border-bottom: 2px solid #2a3692; padding-bottom: 14px; }
.doc-venue p:first-child { font-size: 18px; font-weight: 800; color: #2a3692; }
.doc-meta { text-align: right; }
.doc-meta h1 { margin: 0 0 4px; font-size: 22px; color: #2a3692; }
.doc-parties { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin: 18px 0; }
.doc-parties div p:first-child { font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; color: #555; }
.doc-parties div p:nth-child(2) { font-weight: 700; }
.doc-message { margin: 0 0 16px !important; }
.doc-lines { width: 100%; border-collapse: collapse; margin: 8px 0 12px; }
.doc-lines th { text-align: left; font-size: 12px; text-transform: uppercase; color: #555; border-bottom: 1px solid #999; padding: 6px 4px; }
.doc-lines td { vertical-align: top; border-bottom: 1px solid #ddd; padding: 8px 4px; }
.doc-lines th:not(:first-child), .doc-num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.doc-details { color: #444; font-size: 13px; }
.doc .doc-totals { color: #111; }
.doc .doc-totals .is-total { border-top-color: #111; }
.doc-terms { margin-top: 24px; page-break-inside: avoid; }
.doc-terms h2 { font-size: 15px; margin: 0 0 6px; }
.doc-footer { margin-top: 28px; padding-top: 8px; border-top: 1px solid #ddd; font-size: 12px; color: #555; }
@media print {
  .doc-toolbar, #doc-error { display: none; }
  .doc { padding: 0; max-width: none; }
  @page { margin: 16mm; }
}

.pe-link { border-top: 1px solid var(--color-divider); margin-top: 12px; padding-top: 10px; }
.pe-link h4 { margin: 0 0 6px; font-size: 15px; }
.pe-link-url { display: flex; gap: 8px; align-items: center; margin: 6px 0; }
.pe-link-url input { flex: 1 1 auto; min-width: 0; margin: 0; font-size: 14px; }
.pe-link-url .pill-btn { width: auto; flex: none; }
.pe-link > a.pill-btn { width: auto; }
.pe-signed { background: var(--color-ok-bg); color: var(--color-ok-text); border-radius: 10px; padding: 8px 10px; margin: 8px 0 0; }
.portal-answer { max-width: 820px; margin: 16px auto 0; padding: 0 16px; }
.portal-status { border: 1px solid #c9cde8; background: #f4f5fc; border-radius: 12px; padding: 12px 14px; }
.portal-status p { margin: 4px 0 0; }
.portal-status.is-done { background: #e6f4ea; border-color: #a8d5b5; }
.portal-status.is-warning { background: #fff6e0; border-color: #f0d38a; }
.portal-form { margin-top: 14px; border: 1px solid #ddd; border-radius: 12px; padding: 14px; background: #fff; color: #111; }
.portal-form h2 { margin: 0 0 6px; font-size: 18px; }
.portal-form p { margin: 0 0 10px; }
.portal-decline { margin-top: 14px; }
.portal-decline summary { cursor: pointer; color: #555; }
.portal-print { width: auto; margin-top: 12px; }
.doc-signature { margin-top: 24px; padding: 10px 12px; border: 1px solid #a8d5b5; border-radius: 8px; page-break-inside: avoid; }
.doc-signature h2 { font-size: 15px; margin: 0 0 6px; }
@media print {
  .portal-answer { display: none; }
}
.doc-section { font-size: 15px; margin: 18px 0 4px; }
.doc-schedule th:not(:first-child) { text-align: left; }
.doc-schedule th:nth-child(4) { text-align: right; }
#pe-add-session { width: auto; }

.sales-flow { margin: 0 0 14px; }
.sales-flow ol { list-style: none; display: flex; gap: 12px; margin: 0; padding: 0; }
.sales-flow-step { flex: 1 1 0; min-width: 0; position: relative; }
.sales-flow-step a { display: flex; flex-direction: column; gap: 2px; min-height: 56px; padding: 8px 10px; border: 1px solid var(--color-border); border-radius: 12px; background: var(--color-surface); color: var(--color-text); text-decoration: none; }
.sales-flow-step + .sales-flow-step::before { content: "\203A"; position: absolute; left: -7px; top: 50%; transform: translate(-50%, -50%); color: var(--color-muted); font-size: 22px; line-height: 1; }
.sales-flow-step.is-current a { background: var(--color-primary); border-color: var(--color-primary); color: var(--color-on-primary); }
.sales-flow-name { font-weight: 700; font-size: 14px; overflow-wrap: anywhere; }
.sales-flow-count { font-size: 12px; opacity: 0.85; }
.sales-flow-hint { margin: 8px 2px 0; font-size: 14px; color: var(--color-muted); }
.iq-toolbar .view-toggle { scrollbar-width: none; }
.iq-toolbar .view-toggle::-webkit-scrollbar { display: none; }
.iq-skip { order: 2; font-size: 14px; color: var(--color-primary-text); }
.iq-book { order: 3; }
.pe-steps { list-style: none; display: flex; gap: 6px; margin: 8px 0 4px; padding: 0; }
.pe-step { flex: 1 1 0; text-align: center; font-size: 13px; font-weight: 600; padding: 6px 4px; border-radius: 999px; background: var(--color-surface-sunken); color: var(--color-muted); }
.pe-step.is-done { background: var(--color-ok-bg); color: var(--color-ok-text); }
.pe-step.is-current { background: var(--color-primary); color: var(--color-on-primary); }
.pe-step.is-current.is-accepted { background: var(--color-ok-bg); color: var(--color-ok-text); }
.pe-step.is-current.is-declined, .pe-step.is-current.is-cancelled { background: var(--color-warn-bg); color: var(--color-warn-text); }
.pe-trail { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 6px 0 0; font-size: 14px; }
.pe-more { margin-top: 10px; }
.pe-more summary { display: flex; align-items: center; min-height: 36px; cursor: pointer; color: var(--color-primary-text); font-weight: 600; }
.pe-more .pe-actions { margin-top: 4px; }
.pe-bar { position: sticky; bottom: calc(var(--tabbar-h) + var(--safe-bottom)); z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; padding: 10px 14px; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 14px; box-shadow: 0 -4px 14px rgba(0, 0, 0, 0.08); }
.pe-bar-sum { display: flex; flex-direction: column; min-width: 0; }
.pe-bar-sum span { font-size: 12px; color: var(--color-muted); }
.pe-bar-sum strong { font-size: 18px; }
.pe-bar-sum small { color: var(--color-muted); font-size: 12px; }
.pe-bar button { width: auto; flex: none; min-height: 44px; padding: 0 24px; font-size: 16px; }
.pe-line-core { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px 10px; align-items: end; margin-top: 8px; }
.pe-line-core label { display: flex; flex-direction: column; gap: 2px; margin: 0; font-size: 13px; }
.pe-line .pe-line-core .pl-amount { grid-column: auto; align-self: center; white-space: nowrap; }
.pe-line-more { margin-top: 6px; }
.pe-line-more summary { display: flex; align-items: center; min-height: 36px; cursor: pointer; color: var(--color-primary-text); font-size: 14px; }
.pe-line-more .pl-details { margin: 6px 0; }
.cat-settings-box { margin-bottom: 12px; }
.cat-settings-box summary { cursor: pointer; font-weight: 700; min-height: 36px; display: flex; align-items: center; }
.cat-settings-box form { margin-top: 10px; }
.portal-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin: 12px 0 0; }
.portal-fact { background: #fff; border: 1px solid #ddd; border-radius: 12px; padding: 10px 12px; }
.portal-fact dt { margin: 0; font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; color: #555; }
.portal-fact dd { margin: 2px 0 0; font-size: 20px; font-weight: 800; color: #111; }
.portal-accept { margin-top: 18px; padding-bottom: 28px; }
.portal-jump { position: sticky; bottom: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 12px; max-width: 820px; margin: 0 auto; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: #fff; border-top: 1px solid #ddd; box-shadow: 0 -4px 14px rgba(0, 0, 0, 0.08); }
.portal-jump.is-away { display: none; }
.portal-jump-sum { display: flex; flex-direction: column; color: #111; }
.portal-jump-sum span { font-size: 12px; color: #555; }
.portal-jump-sum strong { font-size: 18px; }
.portal-jump .pill-btn { width: auto; flex: none; }
@media print {
  .portal-jump, .portal-accept { display: none; }
}
.cat-settings-box summary, .pe-more summary, .pe-line-more summary, .portal-decline summary { list-style: none; }
.cat-settings-box summary::-webkit-details-marker, .pe-more summary::-webkit-details-marker, .pe-line-more summary::-webkit-details-marker { display: none; }
.cat-settings-box summary::after, .pe-more summary::after, .pe-line-more summary::after { content: ""; flex: none; width: 8px; height: 8px; margin-left: auto; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg) translateY(-2px); transition: transform 0.15s; }
.cat-settings-box[open] > summary::after, .pe-more[open] > summary::after, .pe-line-more[open] > summary::after { transform: rotate(225deg); }
.pe-more summary, .pe-line-more summary { gap: 8px; }
.pe-actions a.btn, .iq-card-foot a.btn, .pe-link > a.btn, .portal-jump a.btn { text-decoration: none; }

.pe-pay.hidden { display: none; }
.portal-pay { margin-top: 12px; }
.portal-pay.hidden { display: none; }
.portal-pay button { width: 100%; }
.portal-pay p { margin: 4px 0 8px; }
.portal-pay-note { font-size: 13px; color: #555; }

.more-box { margin-top: 8px; }
.more-box summary { display: flex; align-items: center; gap: 8px; min-height: 36px; cursor: pointer; color: var(--color-primary-text); font-weight: 600; list-style: none; }
.more-box summary::-webkit-details-marker { display: none; }
.more-box summary::after { content: ""; flex: none; width: 8px; height: 8px; margin-left: auto; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg) translateY(-2px); transition: transform 0.15s; }
.more-box[open] > summary::after { transform: rotate(225deg); }
