.forms-content .sp-calendar {
  --sp-sage: var(--ui-success);
  --sp-sage-bg: var(--ui-success-bg);
  --sp-blue: var(--ui-info);
  --sp-blue-bg: var(--ui-info-bg);
  padding: clamp(14px, 2vw, 26px);
  min-width: 0;
}
.sp-calendar .ico, .sp-individual > summary .ico {
  width: 17px; height: 17px; flex: none; stroke-width: 1.8;
}
.sp-head, .sp-controls, .sp-period, .sp-editor-head, .sp-agenda-title, .sp-editor-actions {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px;
}
.sp-calendar h1, .sp-calendar .sp-editor-head h3, .sp-individual > summary {
  display: flex; align-items: center; gap: 9px;
}
.sp-head h1 .ico { width: 23px; height: 23px; color: var(--ui-muted); }
.sp-calendar .sp-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font: inherit; font-weight: 630; font-size: 13px; line-height: 1.2; min-height: 39px;
  border: 1px solid var(--ui-line); border-radius: 7px; background: var(--ui-surface);
  color: var(--ui-text); padding: 7px 11px; cursor: pointer;
}
.sp-calendar .sp-btn:hover { background: var(--ui-soft); }
.sp-calendar .sp-btn:focus-visible { outline: 2px solid var(--ui-focus); outline-offset: 2px; }
.sp-calendar .sp-primary {
  color: var(--ui-on-fill, white); background: var(--ui-fill); border-color: var(--ui-fill); min-height: 42px;
}
.sp-calendar .sp-primary:hover { background: var(--ui-fill-hover); }
.sp-controls { margin: 18px 0; }
.sp-segment { display: inline-flex; align-items: center; padding: 3px; background: var(--ui-soft); border-radius: 8px; }
.sp-segment .sp-btn { border: 0; box-shadow: none; min-height: 33px; border-radius: 5px; background: transparent; color: var(--ui-muted); }
.sp-segment .sp-btn[aria-pressed=true] { background: var(--ui-surface); box-shadow: 0 1px 3px rgb(0 0 0 / .13); color: var(--ui-text); }
.sp-calendar .sp-place { display: flex; align-items: center; gap: 5px; color: var(--ui-muted); }
.os-time .sp-place select { width: auto; max-width: 180px; min-height: 35px; font-size: 13px; }
.sp-period { justify-content: start; padding-top: 14px; padding-bottom: 12px; border-top: 1px solid var(--ui-line); }
.sp-period strong { font-size: clamp(16px, 2vw, 21px); letter-spacing: -.028em; font-variant-numeric: tabular-nums; }
.sp-nav { display: flex; align-items: center; gap: 2px; }
.sp-nav .sp-btn, .sp-calendar .sp-quiet { min-width: 37px; min-height: 37px; border: 0; padding: 4px 8px; }
.sp-prev .ico { transform: rotate(180deg); }
.sp-views { margin-left: auto; }
.sp-grid { border: 1px solid var(--ui-line); border-radius: 9px; overflow: hidden; }
.sp-weeknames, .sp-days { display: grid; grid-template-columns: repeat(7,minmax(0,1fr)); }
.sp-weeknames { background: var(--ui-soft); }
.sp-weeknames span { padding: 6px 2px; color: var(--ui-muted); text-align: center; font-size: 12px; font-weight: 650; }
.sp-days { gap: 1px; background: var(--ui-line); }
.sp-cell { display: flex; flex-direction: column; min-width: 0; background: var(--ui-surface); }
.sp-calendar .sp-date { width: 100%; position: relative; display: flex; align-items: center; background: transparent; border: 0; border-radius: 0; min-height: 48px; padding: 7px; }
.sp-calendar .sp-date[aria-pressed=true] { background: var(--ui-tint); }
.sp-number { display: grid; place-items: center; min-width: 29px; height: 29px; padding-inline: 2px; border-radius: 50%; font-size: 15px; }
.sp-today .sp-number { outline: 1px solid var(--ui-accent); }
.sp-date[aria-pressed=true] .sp-number { background: var(--ui-fill); color: var(--ui-on-fill,white); }
.sp-out .sp-number { color: var(--ui-muted); font-weight: normal; opacity: .75; }
.sp-dots { position: absolute; display: flex; gap: 2px; bottom: 3px; left: 50%; transform: translateX(-50%); }
.sp-dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--sp-sage); }
.sp-dots .sp-dot-kitchen { background: var(--sp-blue); }
.sp-count { position: absolute; inset: 5px 5px auto auto; color: var(--ui-muted); font-size: 10px; font-variant-numeric: tabular-nums; }
.sp-week .sp-count { display: none; }
.sp-cell-events { display: flex; align-items: stretch; flex-direction: column; gap: 4px; min-height: 105px; padding: 4px; }
.sp-calendar .sp-event {
  width: 100%; display: grid; justify-content: start; gap: 3px; text-align: left;
  border: 0; border-inline-start: 3px solid var(--event-ink); border-radius: 6px;
  color: var(--ui-text); background: var(--event-bg); padding: 7px; overflow-wrap: anywhere;
}
.sp-calendar button.sp-event:hover { background: color-mix(in srgb, var(--event-ink) 13%, var(--event-bg)); }
.sp-event.sp-bar { --event-ink: var(--sp-sage); --event-bg: var(--sp-sage-bg); }
.sp-event.sp-kitchen { --event-ink: var(--sp-blue); --event-bg: var(--sp-blue-bg); }
.sp-event strong { font-size: 13px; }
.sp-event .sp-time, .sp-event small { color: var(--event-ink); font-size: 11px; font-weight: 650; }
.sp-calendar .sp-slot-add, .sp-calendar .sp-last { background: transparent; border: 0; font-size: 12px; color: var(--ui-accent); }
.sp-cell-events .sp-slot-add { margin-top: auto; align-self: center; }
.sp-slot-add .ico { width: 14px; height: 14px; }
.sp-calendar .sp-agenda { margin-top: 14px; padding: 11px 0 0; }
.sp-calendar:has(.sp-week) .sp-agenda:not(.sp-agenda-open) { display: none; }
.sp-calendar .sp-agenda-title { margin-bottom: 8px; }
.sp-agenda-title h3::first-letter { text-transform: uppercase; }
.sp-agenda-list { display: grid; gap: 6px; }
.sp-agenda-list .sp-event { grid-template-columns: 6.6rem minmax(0,1fr) auto; justify-content: stretch; align-items: center; gap: 8px; min-height: 46px; }
.sp-agenda-list .sp-time { font-size: 12px; }
.sp-empty { color: var(--ui-muted); padding: 8px 0; font-size: 14px; }
.sp-calendar .sp-last { margin-top: 7px; }
.sp-editor { border: 1px solid var(--ui-accent-line); background: var(--ui-tint); border-radius: 10px; padding: 14px; margin: 4px 0 14px; }
.sp-fields { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,140px),1fr)); align-items: start; gap: 10px; margin: 12px 0; }
.sp-fields [data-sp-mode]:has(input[type=hidden]) { display: none; }
.sp-editor-actions { justify-content: start; margin-top: 10px; }
.sp-calendar .sp-cancel { color: var(--ui-error); background: var(--ui-surface); }
.sp-individual { border-top: 1px solid var(--ui-line); }
.sp-individual > summary { width: fit-content; cursor: pointer; min-height: 48px; font-weight: 650; }
.sp-individual > summary::after { content: '⌄'; color: var(--ui-muted); }
.sp-individual[open] > summary::after { transform: rotate(180deg); }
@media(max-width: 900px) {
  .sp-cell-events { display: none; }
  .sp-calendar:has(.sp-week) .sp-agenda:not(.sp-agenda-open) { display: block; }
  .sp-week .sp-count { display: inline; }
}
@media(max-width: 580px) {
  .sp-head h1 { font-size: 20px; }
  .sp-head h1 .ico { width: 20px; height: 20px; }
  .sp-controls { margin: 14px 0; }
  .sp-head, .sp-controls, .sp-period { gap: 6px; }
  .sp-controls .sp-place .ico { display: none; }
  .sp-controls .sp-place select { max-width: 130px; }
  .sp-period strong { flex: 1; }
  .sp-period .sp-views { margin: 1px 0 0; }
  .sp-period { display: grid; grid-template-columns: 1fr auto; }
  .sp-period .sp-views { justify-self: start; }
  .sp-nav { justify-self: end; }
  .sp-calendar .sp-date { padding-inline: 1px; }
  .sp-count { top: 2px; right: 2px; font-size: 9px; }
  .sp-fields { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .sp-agenda-list .sp-event { grid-template-columns: 6rem 1fr; }
  .sp-agenda-list .sp-event small { grid-column: 2; }
  .sp-date .sp-number { font-size: 14px; min-width: 26px; height: 26px; }
}
.sp-calendar .sp-type {
  display:inline-flex;align-items:center;justify-content:center;gap:4px;width:max-content;max-width:100%;
  padding:3px 6px;border-radius:6px;font-size:11px;font-weight:700;line-height:1.15;
}
.sp-type-practice {color:#365575;background:#e5edf7}
.sp-type-dpp {color:#6a3b08;background:#fae6bf}
html[data-theme=dark] .sp-type-practice {color:#cadaef;background:#2d4059}
html[data-theme=dark] .sp-type-dpp {color:#ffe2ab;background:#543c20}
.sp-calendar .sp-type .ico {width:13px;height:13px;stroke-width:2}
.sp-date-types {display:flex;flex-wrap:wrap;justify-content:center;gap:2px}
.sp-calendar .sp-date:has(.sp-date-types) {flex-direction:column;justify-content:center;gap:3px;padding:4px 2px;min-height:51px}
.sp-date-types .sp-type {font-size:10px;line-height:1.2;padding:2px 4px}
.sp-date-types .sp-type .ico {display:none}
.sp-agenda-list .sp-event:has(.sp-type) {grid-template-columns:6.6rem minmax(0,1fr) auto auto}
.sp-fields [data-sp-mode]:has(.sp-kinds){grid-column:1/-1}
.sp-kinds {display:flex;align-items:stretch;gap:8px;border:0;margin:0;padding:0}
.sp-kinds legend {font:inherit;font-weight:600;margin:0 0 6px;padding:0}
.sp-kinds label {cursor:pointer;position:relative;min-width:0}
.sp-kinds input {position:absolute!important;opacity:0;inset:0;margin:0}
.sp-kinds label .sp-type {min-height:42px;padding:8px 12px;font-size:13px;border:1px solid var(--ui-control-line);color:var(--ui-muted);background:var(--ui-surface)}
.sp-kinds input:checked+.sp-type {box-shadow:inset 0 0 0 1px currentColor;border-color:currentColor}
.sp-kinds input:checked+.sp-type-practice {color:#365575;background:#e5edf7}
.sp-kinds input:checked+.sp-type-dpp {color:#6a3b08;background:#fae6bf}
.sp-kinds input:focus-visible+.sp-type {outline:2px solid var(--ui-focus);outline-offset:2px}
@media (min-width:901px){.sp-week .sp-date-types{display:none}}
@media (max-width:580px){
  .sp-date-types {flex-direction:column}
  .sp-date-types .sp-type {font-size:9px;padding:1px 2px}
  .sp-agenda-list .sp-event:has(.sp-type){grid-template-columns:5.6rem minmax(0,1fr)}
  .sp-agenda-list .sp-time{grid-row:1/3}
  .sp-agenda-list .sp-event .sp-type{grid-column:2}
}
.sp-calendar .sp-pending{display:inline-flex;align-items:center;gap:4px;color:var(--ui-muted);font-size:11px;font-weight:650}
.sp-pending .ico{width:13px;height:13px}
