.cms-app {
	--cms-accent: #b5212b;
	--cms-accent-ink: #fff;
	--cms-ink: #1d1d1f;
	--cms-muted: #6b6b70;
	--cms-line: #e4e4e7;
	--cms-card: #fff;
	--cms-soft: #f6f6f7;
	--cms-note: #fff8e1;
	color: var(--cms-ink);
	font-size: 16px;
	line-height: 1.45;
	max-width: 820px;
	margin-left: auto;  /* Centered on wide pages; no effect in narrow columns. */
	margin-right: auto;
	transition: opacity .15s;
}
/* Full-width page layouts with no side margins: keep a gutter on phones. */
@media (max-width: 860px) {
	.cms-app:not(.cms-public) { padding-left: 12px; padding-right: 12px; }
}
.cms-app.is-loading { opacity: .55; pointer-events: none; }
.cms-app *, .cms-app *::before, .cms-app *::after { box-sizing: border-box; }

/* Toolbar */
.cms-toolbar { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 16px; padding-bottom: 16px; margin-bottom: 8px; border-bottom: 2px solid var(--cms-ink); }
.cms-pick { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1 1 280px; }
.cms-label { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--cms-muted); }
.cms-app .cms-select { font-size: 18px; font-weight: 700; padding: 8px 36px 8px 12px; border: 1px solid #c9c9ce; border-radius: 8px; background-color: var(--cms-card); color: var(--cms-ink); max-width: 100%; width: 100%; height: auto; min-height: 44px; }
.cms-dates { font-size: 14px; color: var(--cms-muted); }
.cms-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* Buttons */
.cms-app .cms-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 8px 16px; border: 1px solid var(--cms-accent); border-radius: 8px; background: var(--cms-accent); color: var(--cms-accent-ink); font: inherit; font-size: 15px; font-weight: 600; line-height: 1.2; cursor: pointer; text-decoration: none; }
.cms-app .cms-btn:hover { filter: brightness(.92); }
.cms-app .cms-btn-ghost { background: transparent; color: var(--cms-accent); }
.cms-app .cms-btn-ghost:hover { background: rgba(181, 33, 43, .07); filter: none; }
.cms-app .cms-btn-sm { min-height: 34px; padding: 5px 12px; font-size: 14px; }
.cms-app .cms-link { background: none; border: 0; padding: 4px 2px; font: inherit; font-size: 14px; color: var(--cms-accent); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.cms-app .cms-link.cms-danger { color: #8f1d1d; }
.cms-app button:focus-visible, .cms-app select:focus-visible, .cms-app input:focus-visible, .cms-app textarea:focus-visible, .cms-app summary:focus-visible { outline: 3px solid rgba(181, 33, 43, .35); outline-offset: 2px; }

/* Days */
.cms-day { margin-top: 24px; }
.cms-app .cms-day-title { font-size: 20px; margin: 0 0 10px; padding: 0; }
.cms-sub, .cms-none { color: var(--cms-muted); font-size: 14px; margin: -4px 0 10px; }
.cms-none { margin: 0; padding: 12px 14px; background: var(--cms-soft); border-radius: 8px; }
.cms-app .cms-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }

/* Item */
.cms-app .cms-item { display: grid; grid-template-columns: 96px 1fr auto; gap: 4px 14px; align-items: start; margin: 0; padding: 12px 14px; background: var(--cms-card); border: 1px solid var(--cms-line); border-left: 4px solid var(--cms-accent); border-radius: 8px; }
.cms-type-group { border-left-color: #55565b !important; }
.cms-type-personal { border-left-color: #2f6f62 !important; background: #f7fbfa !important; }
.cms-type-added { border-left-color: #8a8a90 !important; border-left-style: dashed !important; background: #fbfbfc !important; }
.cms-tba .cms-item { border-left-style: dashed; }
.cms-item.is-hidden { opacity: .75; border-left-color: #b9b9be !important; }
.cms-time { font-weight: 700; font-size: 15px; display: flex; flex-direction: column; }
.cms-time-end { font-weight: 400; color: var(--cms-muted); font-size: 14px; }
.cms-time-tba { color: var(--cms-muted); letter-spacing: .04em; }
.cms-body { min-width: 0; }
.cms-title-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.cms-title { font-weight: 600; overflow-wrap: anywhere; }
.cms-tag { font-size: 12px; font-weight: 600; padding: 1px 8px; border-radius: 999px; background: var(--cms-soft); color: var(--cms-muted); }
.cms-tag-mine { background: #e3f1ee; color: #2f6f62; }
.cms-tag-qty { background: #fbe9ea; color: var(--cms-accent); }
.cms-meta { font-size: 14px; color: var(--cms-muted); margin-top: 2px; overflow-wrap: anywhere; }
.cms-details { font-size: 14px; margin-top: 4px; white-space: pre-line; }
.cms-note { font-size: 14px; margin-top: 8px; padding: 6px 10px; background: var(--cms-note); border-radius: 6px; white-space: pre-line; overflow-wrap: anywhere; }
.cms-item-actions { display: flex; gap: 10px; white-space: nowrap; }

/* Note editor & form */
.cms-note-editor { margin-top: 8px; }
.cms-app .cms-note-editor textarea { width: 100%; font: inherit; font-size: 15px; padding: 8px 10px; border: 1px solid #c9c9ce; border-radius: 6px; min-height: 64px; }
.cms-row-btns { display: flex; align-items: center; gap: 12px; margin-top: 8px; }
.cms-form { margin: 16px 0 0; padding: 16px; background: var(--cms-soft); border: 1px solid var(--cms-line); border-radius: 10px; }
.cms-app .cms-form-title { font-size: 18px; margin: 0 0 12px; }
.cms-form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.cms-field { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 600; color: var(--cms-muted); margin: 0; }
.cms-field-wide { grid-column: 1 / -1; }
.cms-app .cms-field input, .cms-app .cms-field select { font: inherit; font-size: 16px; font-weight: 400; color: var(--cms-ink); padding: 8px 10px; min-height: 42px; border: 1px solid #c9c9ce; border-radius: 6px; background: #fff; width: 100%; margin: 0; }

/* Tags: not purchased + availability */
.cms-tag-notbought { background: #eeeef1; color: #4a4a50; }
.cms-tag-bought { background: #e3f1ee; color: #2f6f62; white-space: nowrap; }
.cms-avail-low { background: #fff1d6; color: #8a5300; }
.cms-avail-soldout { background: #fbe9ea; color: #8f1d1d; }
.cms-avail-notyet, .cms-avail-ended, .cms-avail-soon { background: #eef1f6; color: #3e4a5c; }
.cms-app .cms-soldout { color: var(--cms-accent); text-decoration: none; }
.cms-app a.cms-soldout:hover { text-decoration: underline; text-underline-offset: 2px; }
.cms-soon { display: inline-block; font-size: .85em; font-weight: 700; color: #3e4a5c; background: #eef1f6; border-radius: 999px; padding: .35em .8em; white-space: nowrap; }

/* Category chips */
.cms-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.cms-app .cms-chip { font: inherit; font-size: 14px; font-weight: 600; min-height: 36px; padding: 6px 14px; border-radius: 999px; border: 1px solid #c9c9ce; background: var(--cms-card); color: var(--cms-ink); cursor: pointer; }
.cms-app .cms-chip.is-on { background: var(--cms-accent); border-color: var(--cms-accent); color: var(--cms-accent-ink); }

/* Add-an-event picker */
.cms-picker { margin: 16px 0 0; padding: 16px; background: var(--cms-soft); border: 1px solid var(--cms-line); border-radius: 10px; }
.cms-picker-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.cms-picker-head .cms-form-title { margin: 0; }
.cms-picker .cms-sub { margin: 6px 0 10px; }
.cms-app .cms-picker input[type=search] { width: 100%; font: inherit; font-size: 16px; padding: 8px 12px; min-height: 42px; border: 1px solid #c9c9ce; border-radius: 8px; background: #fff; margin: 0; }
.cms-app .cms-picker-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; max-height: 460px; overflow: auto; }
.cms-app .cms-picker-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0; padding: 10px 12px; background: #fff; border: 1px solid var(--cms-line); border-radius: 8px; }

/* Public schedule */
.cms-public .cms-item { grid-template-columns: 96px 1fr auto; }
.cms-public .cms-item-actions a { white-space: nowrap; }
.cms-public-empty { padding: 16px; background: var(--cms-soft); border-radius: 8px; color: var(--cms-muted); }

/* Link guest orders */
.cms-guest { margin-top: 28px; padding: 14px 16px; border: 1px dashed #c9c9ce; border-radius: 10px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.cms-guest p { margin: 0; font-size: 15px; }

/* Hidden + misc */
.cms-hidden { margin-top: 28px; border-top: 1px solid var(--cms-line); padding-top: 12px; }
.cms-hidden summary { cursor: pointer; font-weight: 600; color: var(--cms-muted); margin-bottom: 10px; }
.cms-banner { margin: 12px 0 0; padding: 10px 14px; background: #eef4fb; border: 1px solid #c8dbf0; border-radius: 8px; font-size: 14px; }
.cms-empty, .cms-msg { padding: 24px; background: var(--cms-soft); border-radius: 10px; text-align: center; margin-top: 16px; }
.cms-toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 99999; background: #1d1d1f; color: #fff; padding: 10px 18px; border-radius: 8px; font-size: 15px; box-shadow: 0 6px 24px rgba(0,0,0,.2); transition: opacity .4s; max-width: calc(100vw - 32px); }
.cms-toast.is-error { background: #8f1d1d; }
.cms-toast.is-gone { opacity: 0; }

@media (max-width: 600px) {
	.cms-app .cms-item { grid-template-columns: 1fr; }
	.cms-time { flex-direction: row; gap: 6px; align-items: baseline; }
	.cms-item-actions { margin-top: 4px; }
	.cms-form-grid { grid-template-columns: 1fr 1fr; }
	.cms-form-grid .cms-field:nth-child(2) { grid-column: 1 / -1; }
	.cms-actions { width: 100%; }
	.cms-actions .cms-btn { flex: 1 1 auto; }
	.cms-app .cms-picker-row { flex-direction: column; align-items: stretch; }
	.cms-public .cms-item { grid-template-columns: 1fr; }
}

@media print {
	.cms-actions, .cms-item-actions, .cms-hidden, .cms-form, .cms-picker, .cms-chips, .cms-banner, .cms-toast { display: none !important; }
	.cms-app .cms-select { border: 0; padding: 0; font-size: 22px; appearance: none; -webkit-appearance: none; background: none; }
	.cms-app .cms-item { break-inside: avoid; border: 1px solid #999; border-left-width: 4px; }
	.cms-day { break-inside: auto; }
}
.cms-app .cms-public-title { font-size: 24px; margin: 0; }
.cms-public .cms-toolbar { align-items: center; }
.cms-app .cms-cta { padding: 10px 18px; font-size: 15px; white-space: nowrap; }
@media (max-width: 600px) { .cms-app .cms-cta { width: 100%; white-space: normal; text-align: center; } }
