#gam-app {
  min-height: 100vh;
  box-sizing: border-box;
  max-width: 1500px;
  margin: auto;
  padding: 24px;
  font-size: 15px;
  line-height: 1.5;
}

.gam-header { display: block; margin-bottom: 14px; }
.gam-header-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 18px;
  margin-bottom: 12px;
}
.gam-header h1 { justify-self: start; margin: 0; font-size: 23px; font-weight: 700; line-height: 1.2; }
.gam-calendar-toolbar { display: flex; justify-self: center; justify-content: center; align-items: center; gap: 7px; white-space: nowrap; }
.gam-calendar-toolbar h2 { min-width: 150px; margin: 0; text-align: center; font-size: 16px; font-weight: 500; line-height: 1.35; text-transform: capitalize; }
.gam-calendar-toolbar button {
  display: inline-flex; align-items: center; justify-content: center;
  width: auto; min-width: 24px; height: 22px; padding: 0 6px;
  border: 0; border-radius: 6px; cursor: pointer;
  background: #1f4f7a; color: #fff; font-size: 17px; line-height: 1;
}
.gam-calendar-toolbar .gam-current-month { min-width: auto; padding: 0 8px; background: #536b82; font-size: 12px; font-weight: 600; white-space: nowrap; }
.gam-calendar-toolbar .gam-current-month:hover,
.gam-calendar-toolbar .gam-current-month:focus-visible { background: #465d73; }
.gam-user-manual {
  justify-self: end; display: inline-flex; align-items: center; justify-content: center;
  height: 26px; padding: 0 10px; border: 1px solid #8292a4; border-radius: 6px;
  background: #fff; color: #465d73; font-size: 12px; font-weight: 600; line-height: 1;
  text-decoration: none; white-space: nowrap;
}
.gam-user-manual:hover, .gam-user-manual:focus-visible { background: #f1f5f9; color: #1f4f7a; text-decoration: none; }

/* Context row: equal label widths and equal value widths in every responsive layout. */
.gam-context {
  --gam-context-label-width: 96px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px 14px;
  width: 100%;
  font-size: 15px;
  line-height: 1.4;
}
.gam-context-pair {
  display: grid;
  grid-template-columns: var(--gam-context-label-width) minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.gam-context-label { font-weight: 400; color: #344054; white-space: nowrap; }
.gam-context-value { min-width: 0; overflow-wrap: anywhere; font-weight: 700; color: #1f2937; }
.gam-context select { width: 100%; max-width: 100%; padding: 5px 9px; border: 1px solid #cbd5e1; border-radius: 7px; background: #fff; font: inherit; font-weight: 600; }

.gam-weekdays, .gam-calendar { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.gam-weekdays span { padding: 7px 4px; text-align: center; font-size: 15px; font-weight: 700; line-height: 1.35; }
.gam-calendar { border-top: 1px solid #d8dee8; border-left: 1px solid #d8dee8; background: #fff; }
.gam-day {
  display: flex; flex-direction: column;
  height: 126px; min-width: 0; padding: 6px;
  box-sizing: border-box; overflow: hidden;
  border-right: 1px solid #d8dee8; border-bottom: 1px solid #d8dee8;
}
.gam-day.other { background: #f1f5f9; color: #94a3b8; }
.gam-date { flex: 0 0 auto; margin-bottom: 4px; font-size: 14px; font-weight: 700; line-height: 1.25; }
.gam-events { flex: 1 1 auto; min-height: 0; overflow: hidden; }
.gam-event-chip {
  display: block; width: 100%; margin: 3px 0; padding: 5px 6px;
  border: 0; border-radius: 5px; cursor: pointer;
  color: #fff; text-align: left; font-size: 12px; line-height: 1.25;
  overflow-wrap: anywhere;
}
.gam-event-chip small { font-size: .92em; }
.gam-event-chip.booked { background: #2e7d32; }
.gam-event-chip.registered { background: #b3261e; }
.gam-more-events {
  display: block; width: 100%; margin: 3px 0 0; padding: 3px 5px;
  border: 1px solid #aeb9c6; border-radius: 5px; cursor: pointer;
  background: #f8fafc; color: #344054; text-align: left; font-size: 11px; font-weight: 700; line-height: 1.2;
}
.gam-day-overlay {
  position: fixed; z-index: 10020; box-sizing: border-box; overflow-y: auto; overscroll-behavior: contain;
  padding: 6px; border: 1px solid #8292a4; border-radius: 7px; background: #fff;
  box-shadow: 0 16px 42px rgba(15, 23, 42, .28);
}
.gam-day-overlay .gam-event-chip { font-size: 12px; }

.gam-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin: 8px 0 0; color: #475569; font-size: 14px; line-height: 1.35; }
.gam-legend span { display: inline-flex; align-items: center; gap: 5px; }
.gam-legend i { display: block; flex: 0 0 8px; width: 8px; height: 8px; border-radius: 50%; }
.gam-legend .green { background: #2e7d32; }
.gam-legend .red { background: #b3261e; }

.gam-actions { display: flex; flex-direction: column; align-items: stretch; gap: 8px; margin-top: 14px; padding-top: 14px; border-top: 1px solid #d8dee8; }
.gam-action-row { display: flex; align-items: center; justify-content: flex-start; gap: 8px; width: 100%; }
.gam-actions button,
.gam-dialog-actions button,
.gam-operation button {
  box-sizing: border-box; padding: 8px 13px; border: 0; border-radius: 8px;
  cursor: pointer; background: #1f4f7a; color: #fff; font-size: 15px; line-height: 1.35;
}
.gam-actions button { flex: 0 0 var(--gam-action-width, 208px); width: var(--gam-action-width, 208px); padding-left: 8px; padding-right: 8px; white-space: nowrap; transition: background-color .15s ease; }
.gam-actions .gam-action-book { background: #4f78a1; }
.gam-actions .gam-action-book:hover, .gam-actions .gam-action-book:focus-visible { background: #456b90; }
.gam-actions .gam-action-manage { background: #365f87; }
.gam-actions .gam-action-manage:hover, .gam-actions .gam-action-manage:focus-visible { background: #2f5478; }
.gam-actions .gam-action-group { background: #557763; }
.gam-actions .gam-action-group:hover, .gam-actions .gam-action-group:focus-visible { background: #496955; }
.gam-actions .gam-action-report { background: #626c78; }
.gam-actions .gam-action-report:hover, .gam-actions .gam-action-report:focus-visible { background: #555f6b; }
.gam-actions .gam-action-logout { margin-left: auto; background: #7a4d4d; }
.gam-actions .gam-action-logout:hover, .gam-actions .gam-action-logout:focus-visible { background: #693f3f; }

.gam-empty { padding: 40px; border-radius: 10px; background: #fff; text-align: center; }
html.gam-modal-open, body.gam-modal-open { overflow: hidden !important; }
dialog {
  box-sizing: border-box;
  width: min(760px, 92vw); max-width: 92vw; max-height: 92vh;
  padding: 20px; overflow-y: auto; overscroll-behavior: contain;
  border: 0; border-radius: 12px; background: #fff;
  box-shadow: 0 18px 70px rgba(0, 0, 0, .28);
  color: #1f2937; font-size: 15px; line-height: 1.45;
}
dialog::backdrop { background: rgba(15, 23, 42, .45); }
dialog h3 { margin: 0 0 12px; font-size: 24px; line-height: 1.2; font-weight: 500; }
dialog h4 { font-size: 17px; line-height: 1.3; }
#gam-login { width: min(440px, 92vw); }
#gam-login form { width: 100%; }
dialog label { display: block; margin: 12px 0; font-weight: 600; }
dialog input, dialog textarea, dialog select {
  display: block; width: 100%; box-sizing: border-box;
  margin-top: 5px; padding: 9px;
  border: 1px solid #cbd5e1; border-radius: 7px; background: #fff; color: #1f2937;
  font: inherit;
}
dialog textarea { min-height: 84px; resize: vertical; }
.gam-dialog-actions {
  position: sticky; bottom: -20px; z-index: 2;
  display: flex; justify-content: flex-end; gap: 8px;
  margin-top: 18px; padding: 10px 0 0; background: #fff;
}
.gam-dialog-actions button:first-child { background: #64748b; }
.gam-error { min-height: 20px; color: #b42318; }
.gam-toast { position: fixed; z-index: 10050; bottom: 20px; left: 50%; transform: translateX(-50%); padding: 10px 16px; border-radius: 8px; background: #111827; color: #fff; }
.gam-operation-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.gam-grid-full { grid-column: 1 / -1; }
.gam-res-item { margin: 8px 0; padding: 10px; border: 1px solid #cbd5e1; border-radius: 8px; background: #fff; }
.gam-res-item h4 { margin: 0 0 6px; }
.gam-inline-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.gam-res-filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
.gam-res-filters label { margin: 0; }
.gam-datetime-field { min-width: 0; }
.gam-datetime-control { position: relative; display: block; }
.gam-datetime-display { cursor: pointer; background: #fff !important; }
.gam-datetime-picker {
  position: absolute; z-index: 20; top: calc(100% + 5px); left: 0;
  display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 8px;
  width: 100%; min-width: 0; box-sizing: border-box; padding: 10px;
  border: 1px solid #aeb9c6; border-radius: 9px; background: #fff;
  box-shadow: 0 12px 32px rgba(15, 23, 42, .22);
}
.gam-datetime-picker[hidden] { display: none !important; }
.gam-datetime-picker.gam-picker-up { top: auto; bottom: calc(100% + 5px); }
.gam-datetime-picker input { margin-top: 0; }
.gam-datetime-confirm {
  grid-column: 1 / -1; width: 100%; margin-top: 0 !important; padding: 7px 8px !important;
  border: 1px solid #8fa1b3 !important; border-radius: 7px !important;
  background: #eef3f8 !important; color: #344054 !important; font-size: 13px !important; font-weight: 600;
}

/* Public application home and Google OAuth privacy/terms pages. */
.gam-public-page { box-sizing: border-box; max-width: 1050px; margin: 0 auto; padding: 32px 24px 48px; color: #1f2937; }
.gam-public-hero { margin-bottom: 20px; padding: 26px 28px; border: 1px solid #d8dee8; border-radius: 12px; background: #fff; text-align: center; }
.gam-public-hero h1 { margin: 0 0 8px; font-size: 30px; font-weight: 700; line-height: 1.2; }
.gam-public-hero p { max-width: 760px; margin: 0 auto; color: #667085; font-size: 15px; line-height: 1.55; }
.gam-public-section { margin: 0 0 20px; padding: 24px 28px; border: 1px solid #d8dee8; border-radius: 12px; background: #fff; }
.gam-public-section h2 { margin: 0 0 14px; text-align: center; font-size: 21px; font-weight: 700; line-height: 1.25; }
.gam-public-section p { margin: 0 0 12px; color: #475467; font-size: 15px; line-height: 1.65; }
.gam-public-section p:last-child { margin-bottom: 0; }
.gam-public-section ul { margin: 6px 0 14px; padding-left: 24px; color: #475467; font-size: 15px; line-height: 1.6; }
.gam-public-section li { margin: 5px 0; }
.gam-public-section code { padding: 1px 4px; border-radius: 4px; background: #f8fafc; color: #344054; font-family: inherit; font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.gam-public-back { margin-top: 6px !important; font-size: 14px !important; }
.gam-public-back a, .gam-public-links a { text-decoration: none; }
.gam-public-back a:hover, .gam-public-back a:focus, .gam-public-links a:hover, .gam-public-links a:focus { text-decoration: none; }
.gam-public-links { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 18px; margin: 4px 0 0; text-align: center; }
.gam-public-links a { color: #53667a; font-size: 14px; font-weight: 500; }
.gam-public-links a:hover, .gam-public-links a:focus { color: #1f4f7a; }
.gam-public-page a { color: #1f4f7a; }

.gam-activation-card { box-sizing: border-box; max-width: 620px; margin: 48px auto; padding: 32px; border: 1px solid #d8dee8; border-radius: 12px; background: #fff; box-shadow: 0 8px 28px rgba(15, 23, 42, .08); }
.gam-activation-header { margin-bottom: 24px; text-align: center; }
.gam-activation-header h1 { margin: 0; font-size: 30px; }
.gam-activation-header h2 { margin: 8px 0 0; color: #475569; font-size: 20px; font-weight: 600; }
.gam-activation-message { padding: 14px 16px; border: 1px solid currentColor; border-radius: 8px; background: #fff7f7; text-align: center; font-weight: 600; }
.gam-activation-form-wrap { max-width: 420px; margin: 20px auto 0; }
.gam-activation-form-wrap label { display: block; margin: 12px 0; font-weight: 600; }
.gam-activation-form-wrap input { display: block; width: 100%; box-sizing: border-box; margin-top: 5px; padding: 9px; border: 1px solid #cbd5e1; border-radius: 7px; background: #fff; }
.gam-activation-form-wrap button { padding: 10px 16px; border: 0; border-radius: 8px; cursor: pointer; background: #1f4f7a; color: #fff; }
.gam-activation-form-wrap form { margin-top: 16px; }

@media (max-width: 1000px) and (min-width: 621px) {
  .gam-context { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gam-context-pair:first-child { grid-column: 1 / -1; width: calc((100% - 14px) / 2); justify-self: center; }
}

@media (max-width: 700px) {
  #gam-app { padding: 10px; }
  .gam-header-top { grid-template-columns: minmax(0, 1fr) auto; gap: 9px 10px; margin-bottom: 9px; }
  .gam-header h1 { font-size: 21px; }
  .gam-user-manual { height: 24px; padding: 0 8px; font-size: 11px; }
  .gam-calendar-toolbar { grid-column: 1 / -1; justify-self: center; gap: 5px; }
  .gam-calendar-toolbar h2 { min-width: 116px; font-size: 14px; }
  .gam-calendar-toolbar button { min-width: 22px; height: 20px; padding: 0 5px; font-size: 16px; }
  .gam-calendar-toolbar .gam-current-month { min-width: auto; padding: 0 6px; font-size: 11px; }
  .gam-day { height: 96px; padding: 4px; }
  .gam-date { font-size: 13px; }
  .gam-event-chip { padding: 4px; font-size: 10px; }
  .gam-more-events { padding: 2px 4px; font-size: 10px; }
  .gam-weekdays span { padding: 6px 2px; font-size: 14px; }
  .gam-actions button { padding: 7px 10px; font-size: 14px; }
  .gam-legend { gap: 12px; font-size: 13px; }
  .gam-operation-grid { grid-template-columns: 1fr; }
  .gam-res-filters { grid-template-columns: 1fr; }
  dialog { padding: 16px; }
  .gam-dialog-actions { bottom: -16px; }
  .gam-public-page { padding: 18px 10px 32px; }
  .gam-public-hero, .gam-public-section { padding: 20px 18px; }
  .gam-public-hero h1 { font-size: 27px; }
  .gam-public-section h2 { font-size: 20px; }
  .gam-public-links { gap: 12px; }
  .gam-activation-card { margin: 18px auto; padding: 22px; }
  .gam-activation-header h1 { font-size: 26px; }
  .gam-activation-header h2 { font-size: 18px; }
}

@media (max-width: 620px) {
  .gam-context { --gam-context-label-width: 96px; grid-template-columns: minmax(0, 1fr); gap: 3px; font-size: 14px; }
  .gam-context-pair, .gam-context-pair:first-child { grid-column: auto; width: 100%; justify-self: stretch; }
}

@media (max-width: 240px) {
  .gam-actions button { flex-basis: 100%; width: 100%; }
}
