:root {
  color-scheme: light;
  --bg: #f5f7f4;
  --panel: #ffffff;
  --text: #18221d;
  --muted: #66736b;
  --line: #dbe3dc;
  --royal: #123a9f;
  --royal-dark: #08246f;
  --gold: #f0c85a;
  --gold-light: #fff0a8;
  --brand: #123a9f;
  --brand-dark: #08246f;
  --shadow: 0 18px 45px rgba(24, 34, 29, 0.10);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--text);
  background: var(--bg);
}

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

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 22px clamp(18px, 5vw, 56px);
  color: var(--gold);
  background: var(--royal);
  border-bottom: 1px solid rgba(240, 200, 90, 0.35);
  box-shadow: 0 16px 40px rgba(8, 36, 111, 0.18);
}

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

.logo-mark {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 156px;
  height: 96px;
}

.logo-mark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 8px 13px rgba(0, 0, 0, 0.35));
}

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

.brand-name {
  margin: 0 0 3px;
  color: var(--gold);
  font-family: Georgia, 'Times New Roman', serif;
  font-size: clamp(30px, 4vw, 50px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.28), 0 0 18px rgba(240, 200, 90, 0.22);
}

.app-header h1,
.panel h2 {
  margin: 0;
}

.app-header h1 {
  color: var(--gold-light);
  font-size: clamp(18px, 2vw, 24px);
  font-weight: 700;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--brand);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
}

.date-pill,
.ghost-button {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  min-height: 36px;
  border: 0;
  border-radius: 8px;
  padding: 0 12px;
  color: var(--gold);
  background: var(--royal-dark);
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 8px 18px rgba(8, 36, 111, 0.22);
}

.ghost-button:hover {
  color: var(--gold-light);
  background: #061b56;
}

.hidden {
  display: none !important;
}

.app-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 28px auto 48px;
}

.panel {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.privacy-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  margin-bottom: 22px;
  border-color: rgba(240, 200, 90, 0.55);
  background: #fffdf3;
}

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

.secondary-button {
  margin-top: 12px;
  color: var(--royal);
  background: #ffffff;
  border: 1px solid var(--line);
}

.status-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  margin-bottom: 22px;
}

.muted {
  margin: 10px 0 0;
  color: var(--muted);
}

.month-reminder {
  margin: 14px 0 0;
  padding: 12px 14px;
  border: 1px solid rgba(240, 200, 90, 0.55);
  border-radius: 8px;
  color: #6b5416;
  background: #fff8dd;
  font-weight: 700;
}

.app-menu {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
  margin: 0 0 22px;
}

.menu-button {
  min-height: 48px;
  border: 1px solid var(--line);
  color: var(--royal);
  background: #ffffff;
  font-weight: 700;
}

.menu-button.active {
  color: var(--gold);
  background: var(--royal);
  box-shadow: 0 10px 24px rgba(8, 36, 111, 0.18);
}

.menu-page {
  display: block;
}

.highlight-panel {
  border-color: rgba(18, 58, 159, 0.24);
}

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

.wide {
  grid-column: 1 / -1;
}

.primary-button,
button {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  padding: 0 16px;
  color: var(--gold);
  background: var(--royal);
  cursor: pointer;
}

button:hover,
.file-button:hover {
  color: var(--gold-light);
  background: var(--royal-dark);
}

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

.login-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
  align-items: center;
  gap: 22px;
}

.login-form {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 10px;
}

.time-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.time-form label,
.admin-form {
  display: grid;
  gap: 7px;
  color: var(--muted);
}

.wide-field {
  grid-column: span 2;
}

.time-form button {
  align-self: end;
}

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

.event-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.event-list span {
  display: grid;
  gap: 4px;
}

.event-list small {
  color: var(--muted);
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
  margin-top: 18px;
}

.admin-form h3,
#adminPanel h3 {
  margin: 0;
}

.stack-list,
.admin-table {
  display: grid;
  gap: 10px;
  margin: 14px 0;
}

.stack-list div,
.admin-table div {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

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

.stack-list small {
  color: var(--muted);
}

.row-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.row-actions button {
  min-height: 34px;
  padding: 0 10px;
}

.admin-table div {
  grid-template-columns: 180px 1fr;
}

.admin-table small {
  grid-column: 1 / -1;
  color: var(--muted);
}

.booking-table {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.booking-table div {
  display: grid;
  grid-template-columns: 110px 1fr 1fr 140px;
  gap: 10px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.booking-table small {
  grid-column: 1 / -1;
  color: var(--muted);
}

.editable-booking-table div {
  grid-template-columns: 110px 1fr 140px auto;
}

.booking-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.booking-actions button {
  min-height: 34px;
  padding: 0 10px;
}

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

.camera-layout {
  display: grid;
  grid-template-columns: minmax(280px, 460px) 1fr;
  gap: 18px;
  margin-top: 18px;
}

.camera-box {
  overflow: hidden;
  aspect-ratio: 4 / 3;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eef1f0;
}

.camera-box video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.camera-actions {
  display: grid;
  align-content: start;
  gap: 10px;
}

.file-button {
  display: grid;
  place-items: center;
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  padding: 0 16px;
  color: var(--gold);
  background: var(--royal);
  cursor: pointer;
}

.file-button input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
  pointer-events: none;
}

.photo-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.photo-list figure {
  margin: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.photo-list img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 6px;
}

.photo-list figcaption {
  margin: 8px 0;
  color: var(--muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.photo-list button {
  width: 100%;
  min-height: 34px;
}

code {
  display: inline-block;
  width: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 2px 6px;
  color: var(--royal-dark);
  background: #f4f6fb;
}

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

.task-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.task-list button {
  min-height: 32px;
  padding: 0 10px;
  color: var(--gold);
  background: var(--royal);
}

.inline-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  color: var(--text);
  background: #ffffff;
}

textarea {
  resize: vertical;
}

.info-list {
  display: grid;
  gap: 14px;
  margin: 18px 0 0;
}

.info-list div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.info-list div:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

dt {
  color: var(--muted);
}

dd {
  margin: 0;
  font-weight: 700;
  text-align: right;
}

.message-form {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.message-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
}

.saved-message {
  min-height: 24px;
  margin: 14px 0 0;
  color: var(--brand-dark);
  font-weight: 700;
}

.first-aid-steps,
.plain-list {
  margin: 0;
  padding-left: 22px;
}

.first-aid-steps li,
.plain-list li {
  margin: 0 0 10px;
  line-height: 1.45;
}

.contact-list dd {
  overflow-wrap: anywhere;
}

@media (max-width: 720px) {
  .app-header,
  .status-panel {
    align-items: flex-start;
    flex-direction: column;
  }

  .brand-lockup {
    gap: 14px;
  }

  .logo-mark {
    width: 112px;
    height: 68px;
  }

  .brand-name {
    font-size: clamp(25px, 8vw, 38px);
  }

  .header-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    width: 100%;
    gap: 10px;
  }

  .date-pill,
  .primary-button {
    width: 100%;
    text-align: center;
  }

  .ghost-button {
    width: auto;
    min-width: 118px;
    white-space: nowrap;
  }

  .privacy-panel,
  .consent-actions,
  .app-menu,
  .login-panel,
  .login-form,
  .time-form,
  .admin-grid,
  .booking-table div,
  .camera-layout,
  .grid,
  .inline-form {
    grid-template-columns: 1fr;
  }
}


@media (max-width: 420px) {
  .header-actions {
    grid-template-columns: 1fr;
  }

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