/* Spirit Night (src/spirit.js), on the M3 theme (docs/theme.md). Tokens only,
   except the store colors on the calendar. It sits in the same fixed overlay
   as the Handbook and Today (.hb in styles.css). */
body.sp-open { overflow: hidden; }
.sp { gap: var(--m3-space-4); max-width: 1040px; }
.sp .m3-card { display: flex; flex-direction: column; gap: var(--m3-space-3); min-width: 0; }
.sp a.m3-btn { text-decoration: none; }
.sp-fold > summary { cursor: pointer; }

.sp-req { display: flex; flex-direction: column; gap: var(--m3-space-3); padding-top: var(--m3-space-4);
  border-top: 1px solid var(--md-sys-color-outline-variant); transition: background .25s; }
.sp-req.is-flash { background: var(--md-sys-color-secondary-container); }
.sp-req-top { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--m3-space-3); }
.sp-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: var(--m3-space-2) var(--m3-space-5, 20px); margin: 0; }
.sp-meta dt { font: var(--md-sys-typescale-label-small); color: var(--md-sys-color-on-surface-variant); }
.sp-meta dd { margin: 0; overflow-wrap: anywhere; font: var(--md-sys-typescale-body-medium); }
.sp-note { margin: 0; padding: var(--m3-space-3); white-space: pre-wrap; overflow-wrap: anywhere;
  border-radius: var(--md-sys-shape-corner-small); background: var(--md-sys-color-surface-container);
  font: var(--md-sys-typescale-body-medium); }
.sp-acts { display: flex; flex-wrap: wrap; gap: var(--m3-space-2); }

/* calendar */
.sp-calhead { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: var(--m3-space-2); }
.sp-legend { display: flex; flex-wrap: wrap; gap: var(--m3-space-2) var(--m3-space-4);
  font: var(--md-sys-typescale-body-small); color: var(--md-sys-color-on-surface-variant); }
.sp-legend span { display: inline-flex; align-items: center; gap: 6px; }
.sp-legend i { width: 12px; height: 12px; border-radius: 3px; flex: none; }
.sp-legend i.is-done { box-shadow: inset 0 0 0 2px var(--md-sys-color-outline); }
.sp-cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr));
  border: 1px solid var(--md-sys-color-outline-variant); border-radius: var(--md-sys-shape-corner-small); overflow: hidden; }
.sp-dow { padding: 6px 2px; text-align: center; font: var(--md-sys-typescale-label-small);
  color: var(--md-sys-color-on-surface-variant); background: var(--md-sys-color-surface-container); }
.sp-day { min-height: 88px; min-width: 0; padding: 4px; display: flex; flex-direction: column; gap: 3px;
  border-top: 1px solid var(--md-sys-color-outline-variant); border-left: 1px solid var(--md-sys-color-outline-variant); }
.sp-day:nth-child(7n + 1) { border-left: 0; }
.sp-day.is-out { opacity: .45; background: var(--md-sys-color-surface-container); }
.sp-day.is-blocked { background: repeating-linear-gradient(45deg, transparent 0 6px, var(--md-sys-color-surface-container-high) 6px 12px); }
.sp-n { align-self: flex-start; padding: 1px 6px; border-radius: 999px;
  font: var(--md-sys-typescale-label-small); color: var(--md-sys-color-on-surface-variant); }
.sp-day.is-today .sp-n { background: var(--md-sys-color-primary); color: var(--md-sys-color-on-primary); }
.sp-ev { display: block; width: 100%; padding: 3px 5px; border: 1px solid var(--c); border-radius: 4px; cursor: pointer;
  background: var(--c); color: #fff; font: 600 11px/1.25 system-ui, sans-serif; text-align: left;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-ev.is-done { background: transparent; color: var(--md-sys-color-on-surface); border-width: 2px; }
.sp-bo { font: var(--md-sys-typescale-label-small); color: var(--md-sys-color-on-surface-variant); }
@media (max-width: 700px) {
  .sp-day { min-height: 58px; padding: 2px; }
  /* A phone column can't hold a school's name: show the store color as a bar. */
  .sp-ev { height: 10px; padding: 0; font-size: 0; }
  .sp-bo { font-size: 9px; }
}

/* owner forms */
.sp-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--m3-space-3); align-items: start; }
.sp-dows { display: flex; flex-wrap: wrap; gap: var(--m3-space-2); }
.sp-dows label, .sp-tick { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font: var(--md-sys-typescale-body-medium); }
.sp-dows label { padding: 6px 10px; border-radius: var(--md-sys-shape-corner-small); background: var(--md-sys-color-surface-container); }
.sp-dows input, .sp-tick input { accent-color: var(--md-sys-color-primary); width: 18px; height: 18px; min-height: 0; flex: none; margin: 0; }
.sp-save { flex-wrap: wrap; gap: var(--m3-space-4); align-items: center; }
.sp-probe h3 { margin: 0 0 4px; }
.sp-codes { display: flex; flex-wrap: wrap; gap: 6px; }
.sp-codes code { padding: 2px 6px; border-radius: 4px; background: var(--md-sys-color-surface-container); font-size: 13px; }

/* dialogs */
.sp-dialog-form { display: contents; }
.sp-wk h3 { margin: 0 0 6px; }
.sp-opts { display: flex; flex-wrap: wrap; gap: var(--m3-space-2); }
.sp-warn { margin: 0; padding: var(--m3-space-3); border-radius: var(--md-sys-shape-corner-small);
  background: color-mix(in srgb, var(--md-sys-color-warning) 16%, transparent); color: var(--md-sys-color-on-surface); }
.sp-cats { margin: 0; padding-left: 18px; }
.sp-up { cursor: pointer; }
