:root {
  --ink: #17140d;
  --muted: #6d6658;
  --surface: #ffffff;
  --line: #e3dac7;
  --brand: #0b0b09;
  --brand-2: #8f4d20;
  --accent: #ffe05c;
  --soft: #f7f1de;
  --blue: #315f7d;
  color-scheme: light;
  font-family: "Myriad Pro", Myriad, "Segoe UI", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(255, 224, 92, .12), transparent 320px),
    #f7f4ea;
  color: var(--ink);
}

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

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

.app-shell {
  width: min(100%, 980px);
  margin: 0 auto;
  padding: 18px clamp(14px, 3vw, 28px) 36px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  animation: rise-in .5s ease both;
}

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

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

.brand-logo {
  width: 58px;
  height: 58px;
  object-fit: contain;
  border-radius: 8px;
  background: #0b0b09;
}

.topbar h1,
.section h2,
.hero-panel h2 {
  margin: 0;
  letter-spacing: 0;
}

.topbar h1 {
  font-size: clamp(1.35rem, 4vw, 2rem);
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--brand-2);
  font-size: .78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.icon-button {
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--brand);
  font-size: 1.6rem;
  font-weight: 700;
}

.admin-button,
.primary-button,
.secondary-button,
.danger-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 14px;
  font-weight: 850;
  cursor: pointer;
}

.admin-button,
.primary-button {
  background: var(--brand);
  color: #fff;
}

.secondary-button {
  background: var(--surface);
  color: var(--brand);
}

.danger-button {
  background: #fff4ef;
  color: #8f2f20;
  border-color: #e9b7a7;
}

.logout-button {
  min-height: 40px;
}

.hero-panel {
  min-height: 260px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 36px;
  padding: clamp(22px, 5vw, 42px);
  border-radius: 8px;
  background:
    linear-gradient(120deg, rgba(11, 11, 9, .94), rgba(37, 31, 17, .74)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1200' height='700' viewBox='0 0 1200 700'%3E%3Crect width='1200' height='700' fill='%23f0e3bb'/%3E%3Ccircle cx='870' cy='150' r='150' fill='%23ffe05c' opacity='.8'/%3E%3Cpath d='M0 540c120-80 218-111 294-95 94 19 141 92 260 69 138-26 175-155 332-138 113 12 196 91 314 78v246H0z' fill='%230b0b09' opacity='.88'/%3E%3Cpath d='M0 440c132-89 260-131 384-127 172 5 213 101 360 86 136-15 199-113 456-80v381H0z' fill='%2317140d' opacity='.5'/%3E%3C/svg%3E") center/cover;
  color: #fff;
  animation: rise-in .55s ease both;
}

.hero-panel .status-strip a {
  animation: pill-in .5s ease both;
}

.hero-panel .status-strip a:nth-child(2) {
  animation-delay: .08s;
}

.hero-panel .status-strip a:nth-child(3) {
  animation-delay: .14s;
}

.hero-panel h2 {
  max-width: 620px;
  font-size: clamp(2rem, 8vw, 4.4rem);
  line-height: 1;
}

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

.login-panel {
  min-height: 520px;
}

.login-form {
  display: grid;
  gap: 12px;
  width: min(100%, 420px);
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 8px;
  background: rgba(255, 255, 255, .94);
  color: var(--ink);
  padding: 16px;
}

.login-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-weight: 750;
}

.login-form input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 13px 14px;
}

.login-status {
  min-height: 1.4em;
  margin: 0;
  color: #8f2f20;
  font-weight: 750;
}

.status-strip,
.quick-nav,
.legend,
.contact-actions,
.inline-nav,
.category-tabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.status-strip a,
.quick-nav a,
.category-tabs a {
  border-radius: 8px;
  background: rgba(255, 255, 255, .9);
  color: var(--ink);
  padding: 10px 12px;
  font-weight: 750;
}

.status-strip a {
  background: rgba(255, 224, 92, .94);
}

.quick-nav {
  position: sticky;
  top: 0;
  z-index: 4;
  margin: 14px -4px 22px;
  padding: 8px 4px;
  background: rgba(247, 244, 234, .92);
  backdrop-filter: blur(14px);
  overflow-x: auto;
  flex-wrap: nowrap;
  animation: nav-settle .46s ease both;
}

.quick-nav a {
  border: 1px solid var(--line);
  white-space: nowrap;
}

.category-tabs {
  position: sticky;
  top: 0;
  z-index: 3;
  margin: 12px -4px 18px;
  padding: 8px 4px;
  background: rgba(247, 244, 234, .92);
  backdrop-filter: blur(14px);
  overflow-x: auto;
  flex-wrap: nowrap;
}

.category-tabs a {
  border: 1px solid var(--line);
  white-space: nowrap;
}

.section {
  padding: 18px 0 12px;
  animation: section-in .55s ease both;
  animation-timeline: view();
  animation-range: entry 0% cover 22%;
}

.compact-hero {
  min-height: 190px;
}

.section-heading {
  margin-bottom: 12px;
}

.section h2 {
  font-size: 1.45rem;
}

.timeline,
.knowledge-list,
.news-grid,
.message-panel,
.contact-list,
.asset-grid {
  display: grid;
  gap: 10px;
}

.timeline article,
.knowledge-item,
.info-card,
.map-panel,
.news-card,
.message-panel article,
.contact-card,
.asset-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.timeline article,
.knowledge-item,
.info-card,
.map-panel,
.news-card,
.message-panel article,
.contact-card,
.asset-card,
.checklist-panel,
.expand-panel {
  animation: card-rise .48s cubic-bezier(.2, .72, .2, 1) both;
  animation-timeline: view();
  animation-range: entry 0% cover 18%;
}

.news-grid > :nth-child(2n),
.asset-grid > :nth-child(2n),
.contact-list > :nth-child(2n),
.knowledge-list > :nth-child(2n),
.message-panel > :nth-child(2n),
.timeline > :nth-child(2n),
.card-grid > :nth-child(2n) {
  animation-name: card-rise-soft;
}

.news-grid > :nth-child(3n),
.asset-grid > :nth-child(3n),
.contact-list > :nth-child(3n),
.knowledge-list > :nth-child(3n),
.message-panel > :nth-child(3n),
.timeline > :nth-child(3n),
.card-grid > :nth-child(3n) {
  animation-name: card-rise-late;
}

.timeline article:hover,
.knowledge-item:hover,
.info-card:hover,
.map-panel:hover,
.news-card:hover,
.message-panel article:hover,
.contact-card:hover,
.asset-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(23, 20, 13, .08);
  border-color: rgba(143, 77, 32, .34);
}

.timeline article {
  display: grid;
  grid-template-columns: minmax(64px, 112px) minmax(0, 1fr);
  gap: 14px;
  padding: 14px;
}

.timeline article > time,
.timeline article > div {
  min-width: 0;
}

.timeline article > time {
  hyphens: auto;
  overflow-wrap: anywhere;
  white-space: pre-line;
  word-break: break-word;
}

.timeline article.today-event {
  border-color: rgba(46, 125, 91, .7);
  border-left-width: 5px;
  background: #f4fbf6;
  box-shadow: 0 12px 26px rgba(46, 125, 91, .1);
}

.today-badge {
  display: inline-flex;
  width: fit-content;
  margin-bottom: 6px;
  border-radius: 8px;
  background: #2e7d5b;
  color: #fff;
  padding: 4px 8px;
  font-size: .75rem;
  font-weight: 850;
}

.news-grid {
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}

.news-card,
.message-panel article,
.contact-card,
.asset-card {
  padding: 14px;
}

.asset-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin-top: 12px;
}

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

.section-subheading {
  margin-top: 18px;
}

.section-subheading h3 {
  margin: 0;
  font-size: 1.1rem;
}

.asset-card {
  display: grid;
  gap: 12px;
  overflow: hidden;
}

.content-image {
  width: 100%;
  max-height: 260px;
  object-fit: cover;
  border-radius: 8px;
  background: var(--soft);
}

.image-open-link {
  display: block;
  border-radius: 8px;
}

.image-open-link:focus-visible {
  outline: 3px solid rgba(143, 77, 32, .28);
  outline-offset: 3px;
}

.asset-card .content-image {
  aspect-ratio: 16 / 10;
  max-height: none;
}

.image-only-card {
  padding: 0;
}

.image-only-card .content-image {
  border-radius: 8px;
  display: block;
}

.admin-preview .image-only-card {
  padding: 10px;
}

.file-link {
  display: inline-flex;
  width: fit-content;
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  padding: 10px 12px;
  font-weight: 850;
}

.news-card.priority {
  border-color: rgba(199, 81, 54, .38);
  background: #fff9e8;
}

.badge {
  display: inline-flex;
  margin-bottom: 10px;
  border-radius: 8px;
  background: var(--soft);
  color: var(--brand);
  padding: 5px 8px;
  font-size: .76rem;
  font-weight: 850;
}

.priority .badge {
  background: #fff1a8;
  color: var(--brand-2);
}

.message-panel article span {
  color: var(--muted);
  font-size: .82rem;
  font-weight: 750;
}

time {
  color: var(--brand);
  font-weight: 850;
}

h3,
p {
  margin-top: 0;
}

.timeline h3,
.info-card h3,
.knowledge-item h3,
.news-card h3,
.message-panel h3,
.contact-card h3 {
  margin-bottom: 4px;
  font-size: 1rem;
}

.timeline p,
.info-card p,
.knowledge-item p,
.news-card p,
.message-panel p,
.contact-card p,
.section-intro {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.45;
}

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

.info-card {
  min-height: 158px;
  text-align: left;
  padding: 16px;
  cursor: pointer;
}

.info-card:focus-visible,
.info-card:hover {
  border-color: var(--brand);
  outline: 3px solid rgba(23, 79, 71, .14);
}

.card-icon {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  margin-bottom: 18px;
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  font-weight: 900;
}

.search-box {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
  color: var(--muted);
  font-weight: 750;
}

.search-box input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px 14px;
  background: #fff;
  color: var(--ink);
}

.suggestion-form {
  display: grid;
  gap: 12px;
}

.suggestion-form label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-weight: 800;
}

.suggestion-form textarea {
  width: 100%;
  min-height: 150px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 13px 14px;
}

.suggestion-form .primary-button {
  width: fit-content;
}

.form-status {
  min-height: 1.4em;
  margin: 0;
  color: var(--muted);
  font-weight: 800;
}

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

.suggestion-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 14px;
}

.knowledge-item {
  padding: 14px;
}

.knowledge-category {
  padding: 8px 0 18px;
  scroll-margin-top: 82px;
}

.knowledge-sections {
  display: grid;
  gap: 10px;
}

.more-link {
  display: inline-flex;
  width: fit-content;
  margin-top: 12px;
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  padding: 12px 14px;
  font-weight: 850;
}

.empty-state {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 18px;
  color: var(--muted);
}

.section-intro {
  max-width: 720px;
  margin-bottom: 12px;
}

.inline-nav a {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 10px 12px;
  font-weight: 800;
}

.onboarding-detail {
  scroll-margin-top: 72px;
}

.map-panel {
  padding: 12px;
}

.floor-map {
  position: relative;
  min-height: 320px;
  border-radius: 8px;
  overflow: hidden;
  background:
    linear-gradient(90deg, transparent 49%, rgba(20, 33, 31, .08) 50%, transparent 51%),
    linear-gradient(0deg, transparent 49%, rgba(20, 33, 31, .08) 50%, transparent 51%),
    var(--soft);
  background-size: 70px 70px;
  border: 1px solid var(--line);
}

.room,
.marker {
  position: absolute;
  display: grid;
  place-items: center;
  border-radius: 8px;
  font-size: .82rem;
  font-weight: 850;
}

.room {
  border: 2px solid #92a6a0;
  background: rgba(255, 255, 255, .78);
  color: var(--ink);
}

.room-a {
  left: 7%;
  top: 12%;
  width: 34%;
  height: 30%;
}

.room-b {
  right: 7%;
  top: 12%;
  width: 42%;
  height: 30%;
}

.room-c {
  left: 12%;
  right: 12%;
  bottom: 12%;
  height: 30%;
}

.marker {
  padding: 8px 10px;
  color: #fff;
}

.extinguisher {
  left: 42%;
  top: 47%;
  background: var(--brand-2);
}

.exit {
  right: 8%;
  bottom: 8%;
  background: #2e7d5b;
}

.escape-line {
  position: absolute;
  left: 26%;
  top: 54%;
  width: 53%;
  height: 8px;
  border-radius: 999px;
  background: repeating-linear-gradient(90deg, #2e7d5b 0 22px, transparent 22px 34px);
  transform: rotate(16deg);
}

.legend {
  margin-top: 10px;
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-weight: 750;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.red {
  background: var(--brand-2);
}

.green {
  background: #2e7d5b;
}

.blue {
  background: var(--blue);
}

.contact-card {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 12px;
}

.contact-group {
  display: grid;
  gap: 8px;
}

.contact-group + .contact-group {
  margin-top: 8px;
}

.contact-group summary {
  border-radius: 8px;
  background: var(--surface);
  color: var(--brand-2);
  cursor: pointer;
  font-size: .92rem;
  font-weight: 900;
  padding: 14px 16px;
  text-transform: uppercase;
}

.contact-group[open] summary {
  background: #fff9e8;
}

.contact-card .contact-actions {
  grid-column: 1 / -1;
}

.avatar {
  width: 58px;
  height: 58px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--soft);
}

.contact-actions a {
  flex: 1 1 120px;
  border-radius: 8px;
  padding: 14px 16px;
  background: var(--brand);
  color: #fff;
  text-align: center;
  font-weight: 850;
}

.internal-number,
.external-number {
  flex: 1 1 120px;
  border-radius: 8px;
  padding: 14px 16px;
  background: var(--soft);
  color: var(--ink);
  text-align: center;
  font-weight: 850;
}

.external-number {
  background: var(--blue);
  color: #fff;
}

.mail-link {
  background: #2e7d5b;
}

.quick-nav a,
.inline-nav a,
.category-tabs a,
.more-link,
.contact-actions a,
.status-strip a,
.icon-button,
.admin-button,
.primary-button,
.secondary-button,
.danger-button {
  transition: transform .16s ease, filter .16s ease, box-shadow .16s ease;
}

.quick-nav a:hover,
.inline-nav a:hover,
.category-tabs a:hover,
.more-link:hover,
.contact-actions a:hover,
.status-strip a:hover,
.icon-button:hover,
.admin-button:hover,
.primary-button:hover,
.secondary-button:hover,
.danger-button:hover {
  transform: translateY(-1px);
  filter: brightness(1.03);
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pill-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes nav-settle {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes section-in {
  from {
    opacity: .3;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes card-rise {
  from {
    opacity: 0;
    transform: translateY(18px) scale(.985);
    filter: saturate(.92);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: saturate(1);
  }
}

@keyframes card-rise-soft {
  from {
    opacity: 0;
    transform: translateY(14px) scale(.99);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes card-rise-late {
  from {
    opacity: 0;
    transform: translateY(22px) scale(.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@supports not (animation-timeline: view()) {
  .section,
  .timeline article,
  .knowledge-item,
  .info-card,
  .map-panel,
  .news-card,
  .message-panel article,
  .contact-card,
  .asset-card,
  .checklist-panel,
  .expand-panel {
    animation: rise-in .42s ease both;
  }
}

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

dialog {
  width: min(92vw, 560px);
  border: 0;
  border-radius: 8px;
  padding: 24px;
  box-shadow: 0 24px 70px rgba(20, 33, 31, .26);
}

dialog::backdrop {
  background: rgba(20, 33, 31, .48);
}

.consent-dialog {
  width: min(92vw, 620px);
}

.consent-dialog h2 {
  margin-top: 0;
  font-size: clamp(1.7rem, 6vw, 2.6rem);
  line-height: 1.05;
}

.consent-dialog p:not(.eyebrow) {
  color: var(--muted);
  line-height: 1.5;
}

.consent-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 18px;
}

.dialog-close {
  float: right;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.slide-list {
  display: grid;
  gap: 10px;
  padding: 0;
  list-style: none;
}

.slide-list li {
  border-left: 4px solid var(--accent);
  padding: 10px 12px;
  background: var(--soft);
}

.checklist-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 14px;
}

.checklist-panel summary {
  cursor: pointer;
  font-weight: 850;
}

.checklist {
  display: grid;
  gap: 10px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.checklist label {
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 8px;
  background: var(--soft);
  padding: 10px 12px;
  font-weight: 750;
}

.checklist input {
  width: 18px;
  height: 18px;
  accent-color: var(--brand);
}

.expand-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 12px;
}

.expand-panel summary {
  cursor: pointer;
  color: var(--brand);
  font-weight: 850;
}

.expanded-list {
  margin-top: 12px;
}

.admin-shell {
  display: grid;
  gap: 12px;
}

.admin-toolbar {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr) auto auto;
  gap: 10px;
  align-items: end;
}

.admin-toolbar label,
.editor-fields label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-weight: 750;
}

.admin-toolbar select,
.editor-fields input,
.editor-fields textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 12px 13px;
}

.editor-fields {
  display: grid;
  gap: 12px;
}

.editor-fields textarea {
  min-height: 110px;
  resize: vertical;
  line-height: 1.4;
}

.toggle-field {
  grid-template-columns: auto 1fr;
  align-items: center;
  width: fit-content;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 10px 12px;
}

.toggle-field input {
  width: 18px;
  height: 18px;
  accent-color: var(--brand);
}

.upload-input {
  background: var(--soft) !important;
}

.admin-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.save-status {
  color: var(--muted);
  font-weight: 750;
}

.admin-preview .hero-panel,
.admin-preview .section {
  animation: none;
}

.admin-preview .section-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: 10px;
  align-items: start;
}

.admin-preview .section-heading .eyebrow,
.admin-preview .section-heading h2 {
  grid-column: 1;
}

.section-toggle-button {
  grid-column: 2;
  grid-row: 1 / span 2;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--brand);
  cursor: pointer;
  font-size: 1.25rem;
  font-weight: 900;
  line-height: 1;
}

.admin-preview .section.admin-section-collapsed > :not(.section-heading) {
  display: none !important;
}

.admin-preview .section.admin-section-collapsed {
  padding-bottom: 8px;
}

.admin-url-field {
  display: grid;
  gap: 6px;
  max-width: 560px;
  color: rgba(255, 255, 255, .86);
  font-weight: 800;
}

.admin-url-field input {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, .28);
  border-radius: 8px;
  background: rgba(255, 255, 255, .94);
  color: var(--ink);
  padding: 12px 13px;
}

.admin-savebar {
  position: sticky;
  top: 0;
  z-index: 8;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 -4px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .94);
  padding: 10px;
  backdrop-filter: blur(14px);
  box-shadow: 0 12px 28px rgba(23, 20, 13, .08);
}

.editable-field {
  min-width: 24px;
  outline: 0;
  border-radius: 6px;
  transition: background .16s ease, box-shadow .16s ease;
}

.editable-field:hover {
  background: rgba(255, 224, 92, .18);
  box-shadow: 0 0 0 3px rgba(255, 224, 92, .18);
}

.editable-field:focus {
  background: #fffbea;
  box-shadow: 0 0 0 3px rgba(143, 77, 32, .22);
}

.admin-card-tools {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  margin: -4px -4px 8px;
  flex-wrap: wrap;
}

.admin-preview .timeline .admin-card-tools {
  grid-column: 1 / -1;
  margin-bottom: 0;
}

.admin-preview .timeline article > time {
  grid-column: 1;
}

.admin-preview .timeline article > div {
  grid-column: 2;
}

.mini-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
  color: var(--ink);
  padding: 6px 9px;
  font-size: .78rem;
  font-weight: 850;
  cursor: pointer;
  overflow: hidden;
}

.mini-button input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.danger-mini {
  background: #fff4ef;
  color: #8f2f20;
  border-color: #e9b7a7;
}

.add-row-button {
  margin-top: 10px;
}

.upload-placeholder {
  display: grid;
  place-items: center;
  min-height: 120px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: var(--soft);
  color: var(--muted);
  font-weight: 750;
  text-align: center;
  padding: 12px;
}

.admin-meta {
  margin-top: 10px;
  font-size: .86rem;
}

.admin-contact-fields span {
  flex: 1 1 120px;
  border-radius: 8px;
  padding: 14px 16px;
  background: var(--brand);
  color: #fff;
  text-align: center;
  font-weight: 850;
}

.admin-contact-fields span:nth-child(2) {
  background: var(--soft);
  color: var(--ink);
}

.admin-contact-fields span:nth-child(3) {
  background: var(--blue);
  color: #fff;
}

.admin-contact-fields span:nth-child(4) {
  background: #2e7d5b;
}

.admin-access-section {
  padding: 0;
}

.admin-access-section summary {
  display: grid;
  gap: 4px;
  cursor: pointer;
  padding: 18px;
}

.admin-access-section .access-list {
  padding: 0 18px 18px;
}

.section-summary-title {
  font-size: 1.45rem;
  font-weight: 900;
}

.admin-select-field {
  display: grid;
  gap: 5px;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 850;
}

.admin-select-field select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 9px 10px;
  font-weight: 800;
}

.admin-topic-card {
  cursor: default;
}

.admin-topic-card .slide-list {
  margin-top: 12px;
}

.admin-topic-card .slide-list li {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
}

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

.access-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 12px 14px;
}

.access-row span {
  display: grid;
  gap: 2px;
}

.access-row small {
  color: var(--muted);
}

.access-row input {
  width: 22px;
  height: 22px;
  accent-color: var(--brand);
}

.admin-expand-panel {
  margin-top: 10px;
}

.entry-callout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  margin-bottom: 16px;
  border: 1px solid rgba(143, 77, 32, .22);
  border-radius: 8px;
  background: #fff9e8;
  padding: 16px;
  animation: rise-in .45s ease both;
}

.entry-callout h2 {
  margin: 0 0 4px;
  font-size: clamp(1.35rem, 4vw, 2rem);
}

.entry-callout p:not(.eyebrow) {
  margin: 0;
  color: var(--muted);
  line-height: 1.4;
}

.scanner-shell {
  width: min(100%, 1120px);
}

.scanner-hero {
  min-height: 220px;
}

.scanner-statusbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.scanner-statusbar span {
  border-radius: 8px;
  background: rgba(255, 224, 92, .94);
  color: var(--ink);
  padding: 10px 12px;
  font-weight: 850;
}

.scanner-grid,
.summary-grid {
  display: grid;
  gap: 12px;
}

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

.scanner-card,
.summary-card,
.order-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 14px;
}

.scanner-card h3,
.order-card h3 {
  margin-bottom: 10px;
}

.choice-row,
.scan-actions,
.import-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.choice-button {
  flex: 1 1 160px;
  min-height: 58px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
  color: var(--ink);
  cursor: pointer;
  font-weight: 900;
}

.choice-button.selected {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

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

.form-grid label,
.exception-form label,
.scan-input-label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-weight: 800;
}

.form-grid input,
.form-grid select,
.exception-form textarea,
.scan-input-label input,
.checklist-import,
.entrance-list-panel input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 13px 14px;
}

.full-button {
  width: 100%;
}

.scan-panel {
  display: grid;
  gap: 12px;
}

.compact-scan-section .scan-panel {
  gap: 8px;
  padding: 12px;
}

.compact-scan-section .scan-input-label input {
  min-height: 48px;
  font-size: 1rem;
}

.scan-input-label input {
  min-height: 64px;
  font-size: 1.25rem;
  font-weight: 850;
  letter-spacing: .02em;
}

.camera-panel {
  display: grid;
  gap: 8px;
}

.camera-panel video {
  width: 100%;
  max-height: 360px;
  border-radius: 8px;
  background: #000;
  object-fit: cover;
}

.scan-result {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
  padding: 14px;
}

.scan-result h3 {
  margin-bottom: 8px;
}

.scan-result.good {
  border-color: rgba(46, 125, 91, .45);
  background: #f0faf3;
}

.scan-result.warn {
  border-color: rgba(207, 145, 26, .45);
  background: #fff8df;
}

.scan-result.bad {
  border-color: rgba(143, 47, 32, .45);
  background: #fff2ed;
}

.result-note {
  color: #8f4d20;
  font-weight: 800;
}

.file-upload-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--brand);
  padding: 10px 14px;
  cursor: pointer;
  font-weight: 850;
  overflow: hidden;
}

.file-upload-button input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.checklist-import {
  margin-top: 12px;
  min-height: 150px;
  resize: vertical;
}

.testdata-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.testdata-links a {
  border-radius: 8px;
  background: var(--soft);
  color: var(--brand);
  padding: 7px 9px;
  font-weight: 850;
}

.list-heading-action {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
}

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

.order-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.order-card .ticket-group {
  grid-column: 1 / -1;
}

.ticket-group {
  display: grid;
  gap: 8px;
  margin: 10px 0;
}

.ticket-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
}

.ticket-row span {
  font-weight: 900;
  overflow-wrap: anywhere;
}

.ticket-row small {
  color: var(--muted);
}

.ticket-row .mini-button {
  grid-column: 2;
  grid-row: 1 / span 2;
}

.ticket-row.active {
  border-color: var(--brand-2);
  background: #fff9e8;
}

.ticket-row.checked {
  opacity: .68;
  background: #f1f4ef;
}

.summary-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  margin-bottom: 12px;
}

.summary-card {
  display: grid;
  gap: 4px;
  min-height: 92px;
}

.summary-card span {
  color: var(--muted);
  font-size: .8rem;
  font-weight: 850;
  text-transform: uppercase;
}

.summary-card strong {
  font-size: clamp(1.55rem, 5vw, 2.2rem);
}

.scan-log {
  display: grid;
  gap: 8px;
}

.scan-log article {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 10px;
  border-top: 1px solid var(--line);
  padding-top: 8px;
}

.scan-log span {
  color: var(--brand-2);
  font-weight: 900;
}

.scan-log p {
  margin: 0;
  color: var(--muted);
}

.start-entry-button {
  flex: 1 1 220px;
  min-height: 58px;
  font-size: 1.05rem;
}

.capacity-line {
  border-radius: 8px;
  background: rgba(255, 255, 255, .72);
  padding: 10px 12px;
  color: var(--ink);
  font-weight: 900;
}

.recent-scans {
  display: grid;
  gap: 6px;
  margin: 12px 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, .72);
  padding: 10px 12px;
}

.recent-scans strong {
  color: var(--brand);
}

.recent-scans span {
  color: var(--muted);
  font-size: .9rem;
  font-weight: 800;
}

.result-tool-actions {
  margin-top: 10px;
}

.scan-result h3 {
  font-size: clamp(1.45rem, 6vw, 2.5rem);
  line-height: 1.05;
}

.scan-result.good {
  border: 5px solid #237a47;
  background: #eafaef;
}

.scan-result.warn {
  border: 5px solid #d88712;
  background: #fff3cf;
}

.scan-result.bad {
  border: 7px solid #b90000;
  background: #ffe8e8;
}

.scan-result.bad h3 {
  color: #b90000;
  font-weight: 950;
  text-transform: uppercase;
}

.period-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 12px;
}

.period-summary-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff9e8;
  padding: 14px;
}

.period-summary-card span {
  display: block;
  color: var(--muted);
  font-size: .8rem;
  font-weight: 850;
  text-transform: uppercase;
}

.period-summary-card strong {
  font-size: clamp(1.35rem, 5vw, 2rem);
}

.scanner-overlay {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(112px, 18vw);
  background: #050504;
  color: #fff;
}

.scanner-overlay[hidden] {
  display: none;
}

.scanner-overlay-video {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
}

.scanner-overlay-video video {
  width: 100%;
  height: 100%;
  min-height: 100vh;
  object-fit: cover;
  background: #000;
}

.scanner-reticle {
  position: absolute;
  inset: 22% 14%;
  border: 4px solid rgba(255, 224, 92, .92);
  border-radius: 18px;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, .18);
  pointer-events: none;
}

#overlayCameraStatus {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 14px;
  margin: 0;
  border-radius: 8px;
  background: rgba(0, 0, 0, .66);
  color: #fff;
  padding: 12px 14px;
  font-weight: 900;
}

.scanner-overlay-actions {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 12px;
  background: rgba(11, 11, 9, .96);
  box-shadow: -16px 0 40px rgba(0, 0, 0, .28);
}

.scanner-overlay-actions button {
  min-height: 58px;
}

.scanner-overlay-actions .danger-button {
  margin-top: auto;
}

.scan-page {
  min-height: 100vh;
  overflow: hidden;
  background: #050504;
}

.scan-stage {
  position: fixed;
  inset: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(94px, 16vw);
  background: #050504;
  color: #fff;
}

.scan-camera-stage,
.scan-result-stage {
  position: relative;
  min-height: 100vh;
  overflow: auto;
}

.scan-camera-stage[hidden],
.scan-result-stage[hidden] {
  display: none;
}

.scan-camera-stage video {
  width: 100%;
  height: 100%;
  min-height: 100vh;
  object-fit: cover;
  background: #000;
}

.scan-topline {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.scan-topline span,
.scan-runtime-summary {
  border-radius: 8px;
  background: rgba(0, 0, 0, .66);
  color: #fff;
  padding: 9px 11px;
  font-weight: 900;
}

.scan-side-actions {
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 10px;
  background: rgba(11, 11, 9, .96);
  box-shadow: -16px 0 40px rgba(0, 0, 0, .28);
}

.scan-side-actions .secondary-button,
.scan-side-actions .danger-button {
  min-height: 56px;
  padding: 8px;
  text-align: center;
}

.scan-side-actions .danger-button {
  margin-top: auto;
}

.scan-full-result {
  min-height: 100%;
  border-radius: 0;
  padding: clamp(18px, 4vw, 38px);
}

.scan-full-result h1 {
  margin: 0 0 16px;
  font-size: clamp(2rem, 10vw, 5rem);
  line-height: .95;
}

.scan-full-result p {
  font-size: clamp(1.05rem, 4vw, 1.55rem);
}

.scan-big-action {
  width: 100%;
  min-height: 62px;
  margin-top: 10px;
  font-size: 1.05rem;
}

.scan-manual-panel {
  position: fixed;
  left: 12px;
  right: calc(minmax(94px, 16vw) + 12px);
  bottom: 12px;
  z-index: 32;
  display: grid;
  gap: 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, .96);
  color: var(--ink);
  padding: 12px;
}

.scan-manual-panel[hidden] {
  display: none;
}

.scan-manual-panel label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-weight: 850;
}

.scan-manual-panel input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px 14px;
  font-size: 1.1rem;
  font-weight: 900;
}

@media (max-width: 560px) {
  .app-shell {
    padding-bottom: 22px;
  }

  .topbar {
    align-items: flex-start;
  }

  .topbar-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .topbar-actions .admin-button,
  .topbar-actions .secondary-button {
    min-height: 38px;
    padding: 8px 10px;
  }

  .timeline article {
    grid-template-columns: minmax(54px, 86px) minmax(0, 1fr);
  }

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

  .hero-panel {
    min-height: 230px;
  }

  .brand-logo {
    width: 50px;
    height: 50px;
  }

  .admin-toolbar {
    grid-template-columns: 1fr;
  }

  .admin-savebar {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-savebar .primary-button {
    width: 100%;
  }

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

  .entry-callout {
    grid-template-columns: 1fr;
  }

  .entry-callout .primary-button {
    width: 100%;
  }

  .two-columns,
  .form-grid,
  .summary-grid,
  .period-summary-grid {
    grid-template-columns: 1fr;
  }

  .scanner-overlay {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) auto;
  }

  .scanner-overlay-actions {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    align-content: stretch;
  }

  .scanner-overlay-actions button {
    min-height: 52px;
    padding: 8px;
    font-size: .82rem;
  }

  .scanner-reticle {
    inset: 28% 8%;
  }

  .scan-stage {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) auto;
  }

  .scan-side-actions {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    align-content: stretch;
  }

  .scan-side-actions .secondary-button,
  .scan-side-actions .danger-button {
    min-height: 50px;
    padding: 7px 4px;
    font-size: .76rem;
  }

  .scan-manual-panel {
    right: 12px;
    bottom: 68px;
  }

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

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

  .ticket-row .mini-button {
    grid-column: auto;
    grid-row: auto;
  }
}
