@import url('https://fonts.googleapis.com/css2?family=Indie+Flower&family=Lexend:wght@300;400;500;600;700&display=swap');

:root {
  --bg: #f4f4f1;
  --ink: #151515;
  --muted: #666;
  --line: #1f1f1f;
  --butler: #efa0a2;
  --nursery: #f7ca98;
  --admin: #b8adde;
  --ta: #9dbceb;
  --panel: #fff;
  --accent: #0d4fa3;
  --danger: #b64040;
  --radius: 28px;
  font-family: 'Lexend', Arial, Helvetica, sans-serif;
  --schedule-width: 1536px;
  --votm-width: 255px;
  --need-column-width: 245px;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; color: var(--ink); background: var(--bg); }
body, button, input, textarea, select { font-family: 'Lexend', Arial, Helvetica, sans-serif; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  height: 48px;
  padding: 10px 18px;
  background: #111;
  color: white;
}
.topbar .brand { font-weight: 600; letter-spacing: .01em; }
.topbar a { color: white; text-decoration: none; }
.topbar .pill { border: 1px solid #666; border-radius: 999px; padding: 6px 12px; font-size: 13px; }

.display-shell {
  width: 100vw;
  height: 100vh;
  background: #000;
  overflow: hidden;
  position: relative;
}
#schedule {
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--schedule-width, 1536px);
  height: 840px;
  transform: translate(-50%, -50%) scale(var(--schedule-scale, 1));
  transform-origin: center center;
}
.schedule-frame {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--votm-width, 255px) var(--need-column-width, 245px);
  width: var(--schedule-width, 1536px);
  height: 840px;
  min-height: 840px;
  background: white;
  border: 1px solid #333;
  overflow: hidden;
}

.schedule-main { min-width: 0; height: 840px; }
.schedule-header {
  display: grid;
  grid-template-columns: minmax(0, calc(56.5% - 20px)) minmax(0, calc(43.5% + 20px));
  height: 110px;
  background: #d5d5d5;
  border-bottom: 2px solid var(--line);
  overflow: hidden;
}
.schedule-date,
.schedule-notes {
  min-width: 0;
  height: 110px;
  padding: 20px 28px;
  display: flex;
  align-items: center;
  overflow: hidden;
}
.schedule-date {
  position: relative;
  border-right: 2px solid var(--line);
  font-size: clamp(23px, 2.05vw, 32px);
  font-weight: 400;
  white-space: nowrap;
}
.schedule-notes {
  gap: 10px;
  font-weight: 400;
  align-items: stretch;
}
.notes-label {
  flex: 0 0 auto;
  align-self: center;
  font-size: clamp(23px, 2.05vw, 32px);
  font-weight: 400;
  white-space: nowrap;
}
.notes-body {
  min-width: 0;
  flex: 1 1 auto;
  align-self: stretch;
  display: flex;
  align-items: center;
  overflow: hidden;
  padding: 2px 0;
  font-family: 'Indie Flower', cursive;
  font-size: 23px;
  line-height: 1.15;
  font-weight: 700;
}

.role-grid {
  display: grid;
  grid-template-columns: 1.55fr .8fr 1.5fr;
  gap: 10px;
  padding: 16px 16px 12px;
  overflow: visible;
}
.role-column { min-width: 0; overflow: visible; }
.role-title {
  font-size: clamp(22px, 1.9vw, 31px);
  margin: 0 0 14px 12px;
  font-weight: 400;
  line-height: 1.1;
}
.role-right-group {
  min-width: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 10px;
  align-content: start;
  overflow: visible;
}
.role-right-group > .role-column { min-width: 0; }

.shift-card {
  position: relative;
  height: 211px;
  border-radius: var(--radius);
  padding: 10px 14px 12px;
  margin-bottom: 10px;
  overflow: visible;
}
.shift-card.butler { background: var(--butler); }
.shift-card.nursery { background: var(--nursery); }
.shift-card.admin { background: var(--admin); }
.shift-card.ta { background: var(--ta); }
.shift-title {
  font-weight: 600;
  font-size: 16px;
  border-bottom: 2px solid var(--line);
  padding-bottom: 8px;
  margin-bottom: 8px;
  white-space: nowrap;
}
.shift-title span { font-weight: 400; }
.vol-list {
  margin: 0;
  padding: 0 0 0 14px;
  list-style: none;
  font-size: 17px;
  line-height: 1.34;
}
.shift-card.butler .vol-list.butler-overflow {
  display: grid;
  grid-auto-flow: column;
  grid-template-rows: repeat(6, min-content);
  grid-auto-columns: minmax(0, 1fr);
  column-gap: 16px;
  padding-right: 2px;
}
.vol {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}
.vol .code { font-weight: 600; }
.vol.absent { text-decoration: line-through; text-decoration-color: #111; text-decoration-thickness: 2.5px; text-decoration-skip-ink: none; opacity: .86; }
.vol.added::before { content: "✚ "; font-weight: 700; }

.checkin-feather {
  display: inline-block;
  margin-left: 2px;
  font-weight: 400;
  text-decoration: none;
}

.training-badge {
  position: absolute;
  top: -38px;
  right: -16px;
  z-index: 30;
  width: 174px;
  height: 38px;
  padding: 3px 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: #b9d9ff;
  border: 2px solid #111;
  border-radius: 13px;
  transform: rotate(5deg);
  transform-origin: center;
  font-size: 13px;
  line-height: 1.25;
  font-weight: 400;
  pointer-events: none;
  box-shadow: 0 1px 2px rgba(0,0,0,.08);
}

.legend-area {
  grid-column: 1 / 3;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 146px;
  gap: 12px;
  align-items: stretch;
  padding: 2px 4px 0 10px;
  min-height: 220px;
}
.legend {
  font-size: 15px;
  line-height: 1.27;
  padding-top: 3px;
}
.legend-line {
  white-space: nowrap;
  margin: 0;
}
.legend-gap { height: 14px; }
.legend-pair { display: flex; gap: 22px; white-space: nowrap; }
.legend-pair + .legend-pair { margin-top: 4px; }
.legend-logo-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100%;
  padding: 0;
  transform: translateY(-48px);
}
.logo-image {
  display: block;
  width: 136px;
  height: auto;
}

.feature-column {
  border-left: 2px solid var(--line);
  display: flex;
  flex-direction: column;
  background: white;
}
.votm { padding: 7px 9px 6px; border-bottom: 2px solid var(--line); height: 480px; flex: 0 0 480px; overflow: hidden; }
.votm h2 { margin: 0; font-size: 24px; text-align: center; font-weight: 400; line-height: 1.03; }
.script { font-family: 'Lexend', Arial, Helvetica, sans-serif; }
.votm .month { font-size: 23px; text-align: center; margin: 5px 0; color: #d11; }
.photo-stage { position: relative; width: 100%; height: 162px; margin: 0 auto 2px; }
.photo-stage img.main-photo {
  width: 82%; height: 82%; object-fit: cover; border-radius: 18px;
  border: 5px solid #1762be; position: absolute; right: 3%; bottom: 1%; background: #eee;
}
.photo-stage img.secondary-photo {
  width: 48%; height: 33%; object-fit: cover; border-radius: 16px;
  border: 5px solid #e4b719; position: absolute; left: 2%; top: 2%; background: #eee; z-index: 2;
}
.callout {
  position: absolute; left: 0; bottom: 17%; width: 66%; transform: rotate(-9deg);
  background: #d4a400; color: white; padding: 9px 11px; font-size: 10px; line-height: 1.15; z-index: 3;
  clip-path: polygon(0 10%, 15% 18%, 7% 0, 28% 13%, 35% 0, 46% 13%, 56% 0, 68% 14%, 83% 3%, 78% 20%, 100% 20%, 85% 36%, 100% 49%, 80% 52%, 94% 70%, 73% 67%, 80% 92%, 60% 77%, 55% 100%, 44% 79%, 32% 98%, 29% 75%, 9% 91%, 16% 67%, 0 69%, 14% 51%, 0 38%, 17% 33%);
}
.votm .person { text-align: center; color: #135acf; font-size: 20px; margin: 0 0 3px; }
.votm-details { font-size: 12.5px; line-height: 1.14; }
.votm-details .script { color: #e22; }
.votm.votm-slide-mode { padding: 0; background: #fff; position: relative; overflow: hidden; }
.votm-slide-frame {
  position: absolute;
  display: block;
  left: -6px;
  top: -6px;
  width: calc(100% + 12px);
  height: calc(100% + 86px);
  border: 0;
  background: white;
}

.birthdays { padding: 8px 12px 10px; flex: 1; min-height: 310px; overflow: hidden; }
.birthday-image {
  display: block;
  width: 78%;
  height: auto;
  margin: 0 auto 10px;
}
.birthday-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  font-family: 'Indie Flower', cursive;
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 4px;
  line-height: 1.24;
}
.birthday-name { color: #e22929; margin-left: 8px; max-width: 162px; }
.birthday-name.long { white-space: normal; padding-left: 10px; text-indent: -10px; line-height: 1.25; }
.birthday-date { color: #194bd1; margin-right: 8px; text-align: right; flex: 0 0 auto; }
.birthday-date.with-long-name { align-self: center; }

.need-column {
  position: relative;
  background: #050505;
  color: white;
  padding: 11px 10px 122px;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.need-column h2 {
  width: 100%;
  font-size: 19px;
  line-height: 1.05;
  font-weight: 600;
  margin: 0 0 12px;
  padding: 0 4px;
  letter-spacing: -0.015em;
  text-decoration: underline;
  white-space: nowrap;
  text-align: center;
}
.need-list {
  display: flex;
  margin-top: 12px;
  flex-direction: column;
  flex: 0 0 auto;
}
.need-day {
  height: 92px;
  flex: 0 0 92px;
  overflow: hidden;
}
.need-date {
  font-size: 16px;
  text-decoration: underline;
  margin-bottom: 4px;
}
.need-shifts {
  padding-left: 12px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px 6px;
}
.need-chip {
  min-width: 0;
  border: 0;
  border-radius: 7px;
  padding: 3px 4px;
  font-size: 12px;
  line-height: 1.15;
  font-weight: 600;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #111;
}
.need-chip.butler { background: var(--butler); }
.need-chip.nursery { background: var(--nursery); }
.need-chip.admin { background: var(--admin); }
.need-chip.ta { background: var(--ta); }
.need-spacer { flex: 1; min-height: 4px; }
.qr-card {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 22px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 88px;
  gap: 2px;
  align-items: end;
  min-height: 92px;
}
.qr-text {
  font-family: "Comic Sans MS", "Bradley Hand", cursive;
  font-size: 13px;
  line-height: 1.06;
  align-self: end;
  justify-self: start;
  max-width: 120px;
  padding: 0 0 2px 0;
}
.qr-arrow {
  position: absolute;
  width: 43px;
  height: 43px;
  object-fit: contain;
  left: 82px;
  top: -15px;
  transform: rotate(30deg);
  transform-origin: center;
}
.qr-crop {
  position: relative;
  width: 88px;
  height: 88px;
  overflow: hidden;
  border: 2px solid white;
  background: white;
}
.qr-image {
  position: absolute;
  left: -5%;
  top: -5%;
  width: 110%;
  height: 110%;
  object-fit: cover;
  display: block;
  background: white;
}

.admin-auth-gate {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: #eeeeeb;
}
.admin-auth-card {
  width: min(430px, 100%);
  background: white;
  border: 1px solid #d2d2cf;
  border-radius: 18px;
  padding: 28px;
  box-shadow: 0 4px 18px rgba(0,0,0,.08);
  text-align: center;
}
.admin-auth-card h1 { margin: 0 0 10px; font-size: 26px; }
.admin-auth-card p { margin: 0 0 18px; color: #555; line-height: 1.45; }
.admin-auth-email { font-weight: 600; color: #111; }
.admin-auth-status { min-height: 20px; margin-top: 12px; font-size: 13px; color: #9b2c2c; }
.admin-signin-button {
  border: 1px solid #bbb;
  background: #fff;
  padding: 10px 16px;
  border-radius: 999px;
  font-weight: 600;
}
.admin-signin-button:hover { background: #f5f5f5; }
.admin-top-actions { display: flex; align-items: center; gap: 10px; }
.admin-signout { background: transparent; color: white; border: 1px solid #666; }

/* Admin */
.admin-page { background: #eeeeeb; min-height: 100vh; }
.admin-wrap { display: grid; grid-template-columns: 430px minmax(0, 1fr); gap: 18px; padding: 18px; }
.admin-panel {
  background: white;
  border: 1px solid #d2d2cf;
  border-radius: 18px;
  padding: 18px;
  box-shadow: 0 4px 18px rgba(0,0,0,.06);
  height: calc(100vh - 84px);
  overflow: auto;
}
.admin-panel h1 { margin: 0 0 4px; font-size: 25px; }
.admin-panel .sub { color: var(--muted); font-size: 14px; margin-bottom: 8px; }
.prototype-banner {
  background: #fff4cc;
  border: 1px solid #e6c95c;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 13px;
  margin-bottom: 18px;
}
.admin-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 16px; }
.admin-tabs button { border: 1px solid #c8c8c8; background: #f5f5f5; padding: 8px 10px; border-radius: 999px; }
.admin-tabs button.active { background: #111; color: white; }
.section { display: none; }
.section.active { display: block; }
.field { margin-bottom: 14px; }
.field label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 13px; }
.field input, .field textarea, .field select {
  width: 100%;
  border: 1px solid #bbb;
  border-radius: 10px;
  padding: 10px;
  background: white;
}
.field textarea { min-height: 90px; resize: vertical; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.primary { background: #111; color: white; border: 0; border-radius: 10px; padding: 10px 14px; font-weight: 600; }
.secondary { background: white; color: #111; border: 1px solid #aaa; border-radius: 10px; padding: 10px 14px; }
.danger { color: var(--danger); }
.dropzone {
  border: 2px dashed #9aa4b3;
  border-radius: 14px;
  padding: 18px;
  text-align: center;
  background: #f8fbff;
  color: #445;
  margin-bottom: 12px;
}
.dropzone:focus { outline: 3px solid #b6d4fe; }
.note-admin-row {
  border: 1px solid #ddd;
  border-radius: 14px;
  padding: 12px;
  margin-bottom: 10px;
  background: #fafafa;
}
.note-admin-row textarea { min-height: 74px; }
.note-date-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; align-items: end; }
.note-date-row button { height: 40px; }
.preview-wrap {
  min-width: 0;
  height: calc(100vh - 84px);
  overflow: auto;
  background: #222;
  border-radius: 18px;
  padding: 14px;
  box-shadow: 0 4px 18px rgba(0,0,0,.14);
}
.preview-toolbar { display: flex; justify-content: space-between; color: white; font-size: 13px; margin: 0 4px 10px; }
.preview-stage { transform-origin: top left; width: 1440px; min-height: 900px; }
.preview-stage .schedule-frame { min-height: 860px; }
.keyboard-help { color: #aaa; font-size: 12px; margin-top: 5px; }



/* V20 Apps Script staff-login gate */
.admin-auth-setup { margin: 6px 0 14px; text-align: left; }
.admin-auth-setup .field { margin-bottom: 10px; }
.admin-auth-setup input { width: 100%; }
.admin-auth-help { margin-top: 8px; color: #777; font-size: 12px; text-align: center; }
.admin-auth-link {
  display: block;
  margin: 10px auto 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #666;
  text-decoration: underline;
  font-size: 12px;
}
.admin-auth-link:hover { color: #111; }
