:root {
  color-scheme: light;
  --page: #eef2f7;
  --ink: #12243d;
  --muted: #51647c;
  --line: #dce4ee;
  --brand: #215c9d;
  --nav: #132641;
  --white: #fff;
  font-family: Inter, "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 14px;
  color: var(--ink);
  background: var(--page);
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; display: grid; grid-template-columns: 238px minmax(0, 1fr); }
button, input, select, textarea { font: inherit; }
button, select { cursor: pointer; }
button { color: inherit; }
button:disabled { cursor: default; opacity: .46; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, summary:focus-visible {
  outline: 3px solid #71a9eb;
  outline-offset: 2px;
}
[hidden] { display: none !important; }
h1, h2, h3, p { margin: 0; }
.sidebar {
  background: var(--nav);
  color: #edf4ff;
  padding: 26px 17px 20px;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark { display: block; width: 52px; height: auto; flex: none; }
.brand-name { display: grid; gap: 4px; }
.brand-name strong { font-size: 18px; line-height: 1.08; letter-spacing: -.035em; }
.brand-name span { font-size: 10px; font-weight: 650; line-height: 1.2; letter-spacing: .14em; text-transform: uppercase; }
.sidebar .brand { padding-bottom: 22px; }
.sidebar .brand-mark { filter: drop-shadow(0 0 1px #a6c2e7a8); }
.sidebar .brand-name span { color: #ebbd9d; }
.sidebar-body { flex: 1; }
.side-section { padding: 19px 0 17px; border-top: 1px solid #ffffff18; }
.side-action {
  width: 100%; text-align: left; display: flex; gap: 9px; align-items: center;
  color: #e7f0ff; background: transparent; border: 1px solid transparent;
  padding: 9px 4px; margin-top: 4px; font-size: 13px; border-radius: 7px;
}
.side-action:hover { background: #ffffff10; }
.side-action > span:first-child { color: #a6c5ed; width: 16px; flex: none; }
.side-action #open-obs { margin-top: 0; }
.screen-icon { height: 12px; border: 1px solid currentColor; border-radius: 2px; position: relative; }
.screen-icon::after { content: ""; position: absolute; bottom: -4px; left: 4px; right: 4px; border-bottom: 1px solid currentColor; }
.side-status { display: flex; align-items: start; gap: 9px; padding: 16px 4px 0; border-top: 1px solid #ffffff18; font-size: 12px; }
.side-status > span { display: block; width: 8px; height: 8px; margin-top: 5px; border-radius: 50%; background: #85dab1; flex: none; }
.side-status strong, .side-status small { display: block; }
.side-status small { color: #b0c3d9; margin-top: 4px; line-height: 1.4; }
.side-footer { padding: 10px 4px 0; font-size: 12px; }
.side-footer a { color: #c5d5e8; text-underline-offset: 2px; }
.main { padding: 33px 32px 54px; width: 100%; max-width: 1760px; margin: 0 auto; }
.page-header { display: flex; justify-content: space-between; align-items: end; gap: 24px; margin: 0 0 24px; }
.current-status { color: var(--brand); font-size: 13px; font-weight: 700; margin-bottom: 7px; }
h1 { font-size: clamp(26px, 2.48vw, 40px); letter-spacing: -.045em; line-height: 1.07; overflow-wrap: anywhere; }
.subheading { margin-top: 7px; font-size: 13px; color: var(--muted); }
.subheading:empty { display: none; }
.header-actions { display: flex; flex-wrap: wrap; gap: 9px; justify-content: end; flex: none; }
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 38px; padding: 8px 13px; border: 1px solid #cfd9e6;
  border-radius: 8px; background: white; color: var(--ink); font-weight: 650;
  text-decoration: none; line-height: 1.25;
}
.button:hover:not(:disabled) { background: #f0f5fb; border-color: #adbed3; }
.button.primary { background: var(--brand); border-color: var(--brand); color: white; }
.button.primary:hover:not(:disabled) { background: #164e86; border-color: #164e86; }
.button.small { min-height: 31px; padding: 5px 9px; font-size: 12px; }
.button.subtle { background: transparent; border-color: transparent; color: var(--brand); }
.button.danger { color: #993749; }
.workspace { display: grid; grid-template-columns: minmax(390px, 1.6fr) minmax(350px, 1fr); gap: 19px; align-items: start; }
.panel { background: white; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; box-shadow: 0 4px 18px #18335608; min-width: 0; }
.panel-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 17px 18px 15px; }
.panel-top h2, .dialog h2 { font-size: 17px; font-weight: 700; letter-spacing: -.02em; }
.panel-top p { color: var(--muted); font-size: 12px; margin-top: 3px; line-height: 1.45; }
.switch { padding: 3px; display: flex; flex: none; gap: 2px; background: #edf2f8; border-radius: 8px; }
.switch button, .tabs button {
  appearance: none; border: 0; color: var(--muted); background: transparent;
  font-weight: 650; font-size: 12px; padding: 7px 9px;
}
.switch button[aria-pressed=true] { color: var(--brand); background: white; border-radius: 6px; box-shadow: 0 1px 4px #243e621c; }
.preview-wrap { margin: 0 17px; }
.preview-wrap .scene-host { border-radius: 10px; }
.transport { display: flex; align-items: center; gap: 13px; padding: 13px 17px; border-bottom: 1px solid var(--line); }
.transport-buttons { display: flex; gap: 4px; align-items: center; flex: none; }
.icon-button {
  border: 0; border-radius: 7px; background: #edf2f8; color: var(--ink);
  width: 30px; height: 30px; display: inline-grid; place-items: center;
  padding: 0; line-height: 1; font-size: 20px;
}
.icon-button:hover { background: #e1ebf7; }
.icon-button.play { color: white; background: var(--brand); font-size: 11px; }
.progress-track { flex: 1; overflow: hidden; background: #e5edf7; height: 5px; border-radius: 5px; }
.progress-track span { height: 100%; width: 0; display: block; background: #4a84bf; }
.time { flex: none; font-size: 12px; font-variant-numeric: tabular-nums; color: var(--muted); }
.playlist { padding: 15px 17px 17px; }
.playlist h3, .fields h3 { font-size: 13px; margin: 0 0 9px; }
.slide-list { display: flex; flex-wrap: wrap; gap: 6px; }
.slide-list button {
  max-width: 200px; padding: 5px 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  border: 1px solid #d8e2ee; border-radius: 6px; background: #fff; color: var(--muted); font-size: 11px;
}
.slide-list button[aria-current=true] { color: #1b568f; border-color: #b8d0ec; background: #eaf3fd; font-weight: 650; }
.saved-banner { border-top: 1px solid var(--line); padding: 12px 17px; color: var(--muted); font-size: 12px; background: #f8fafd; line-height: 1.5; }
.saved-banner strong { color: var(--ink); }
.tabs { display: flex; flex-wrap: wrap; gap: 2px; padding: 0 8px; border-bottom: 1px solid var(--line); }
.tabs button { border-bottom: 2px solid transparent; margin-bottom: -1px; padding: 9px 4px; }
.tabs button[aria-pressed=true] { color: var(--brand); border-color: #3976b8; }
.fields { padding: 17px; display: grid; gap: 14px; }
.field { display: grid; gap: 5px; min-width: 0; }
.field > span { font-size: 12px; font-weight: 650; }
.field input:not([type=color]):not([type=checkbox]):not([type=file]), .field textarea, .field select, .source-row input {
  width: 100%; min-width: 0; border: 1px solid #ced9e6; border-radius: 7px; padding: 8px 9px;
  color: var(--ink); background: #fff; min-height: 37px;
}
.field textarea { resize: vertical; line-height: 1.4; }
.field input[type=file] { max-width: 100%; font-size: 12px; }
.field input[type=color] {
  width: 100%; height: 36px; border: 1px solid #ced9e6; border-radius: 7px;
  padding: 3px; background: #fff; cursor: pointer;
}
.field input[type=checkbox] { margin: 0; align-self: center; accent-color: var(--brand); }
.field .check-line { display: flex; gap: 8px; font-weight: 600; }
.field input::placeholder, .field textarea::placeholder { color: #677990; opacity: 1; }
.field-pair, .field-colors { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.field-colors { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-details { border: 1px solid var(--line); border-radius: 9px; }
.form-details > summary { cursor: pointer; color: var(--ink); font-weight: 650; padding: 10px; font-size: 12px; }
.form-details > div { display: grid; gap: 12px; padding: 0 10px 11px; }
.item-list { display: grid; gap: 9px; }
.item-label { overflow-wrap: anywhere; }
.item-bar { display: flex; justify-content: space-between; gap: 6px; align-items: center; }
.item-actions { display: flex; gap: 7px; align-items: center; flex-wrap: wrap; }
.help { color: var(--muted); font-size: 12px; line-height: 1.5; }
.hint {
  padding: 10px 11px; border: 1px solid #cfdef0; border-radius: 8px;
  color: #284b72; background: #f1f7fe; font-size: 12px; line-height: 1.5;
}
.order-list { display: grid; gap: 5px; }
.order-row { display: grid; grid-template-columns: 1fr auto auto; gap: 5px; align-items: center; }
.order-row > label { display: flex; align-items: center; gap: 7px; }
.sequence-list { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.sequence-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) repeat(3, auto);
  align-items: center;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 4px 5px 4px 8px;
}
.sequence-list li span { overflow-wrap: anywhere; }
.fields .card-collection-heading { margin: 5px 0 0; padding-top: 14px; border-top: 1px solid var(--line); }
.image-file { display: grid; gap: 7px; }
.image-file img { max-width: 112px; max-height: 72px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); }
.dialog {
  width: min(650px, calc(100vw - 28px)); max-height: calc(100vh - 40px); padding: 0;
  border: 1px solid var(--line); border-radius: 15px; color: var(--ink); box-shadow: 0 20px 75px #07152861;
}
.dialog::backdrop { background: #10223d85; }
.dialog-top { display: flex; justify-content: space-between; align-items: center; padding: 15px 18px; border-bottom: 1px solid var(--line); }
.dialog-body { display: grid; gap: 17px; padding: 18px; }
.dialog-section { display: grid; gap: 10px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.dialog-section:last-child { padding-bottom: 0; border: 0; }
.source-row { display: grid; grid-template-columns: 76px minmax(0, 1fr) auto; align-items: center; gap: 8px; }
.source-row input { font-size: 12px; }
.toast {
  position: fixed; z-index: 5; right: 22px; bottom: 20px; width: min(390px, calc(100vw - 44px));
  border-radius: 10px; padding: 12px 15px; color: white; background: #193e69; box-shadow: 0 8px 25px #142b4d43;
}
.toast[data-kind=error] { background: #852a3b; }
@media(max-width: 1160px) {
  body { grid-template-columns: 198px minmax(0, 1fr); }
  .sidebar { padding-inline: 13px; }
  .main { padding-inline: 21px; }
  .workspace { grid-template-columns: minmax(325px, 1.35fr) minmax(310px, 1fr); gap: 13px; }
}
@media(max-width: 920px) {
  .workspace { grid-template-columns: 1fr; }
  .header-actions { flex: 0 1 auto; }
}
@media(max-width: 650px) {
  body { display: block; }
  .sidebar { position: static; height: auto; padding: 14px; }
  .sidebar .brand { padding-bottom: 10px; }
  .sidebar-body { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .side-section { padding: 9px 0 0; }
  .side-section.connections { padding-top: 9px; }
  .side-status { display: none; }
  .main { padding: 18px 12px 30px; }
  .page-header { align-items: start; flex-direction: column; gap: 13px; }
  .header-actions { justify-content: start; }
}

#account-email { color: #b8cce4; overflow-wrap: anywhere; }
#members-link { text-decoration: none; }

.calendar-dialog { width: min(720px, calc(100vw - 28px)); }
.service-views { justify-self: start; }
.service-view, #service-list { display: grid; gap: 17px; }
#service-list h3 { font-size: 14px; margin: 0 0 6px; }
.calendar-entry strong, .calendar-entry small { overflow-wrap: anywhere; }
.month-nav { display: flex; align-items: center; justify-content: space-between; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; }
.calendar-grid > span { padding: 4px; color: var(--muted); font-size: 12px; text-align: center; }
.calendar-grid button { min-width: 0; min-height: 44px; text-align: left; align-self: stretch; padding: 5px; border: 1px solid var(--line); background: white; color: var(--ink); border-radius: 6px; }
.calendar-grid button[aria-pressed=true] { border: 2px solid var(--brand); background: #edf4fd; }
.calendar-grid button[aria-current=date] strong { text-decoration: underline; }
.calendar-grid button small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--brand); }
#calendar-events { display: grid; gap: 5px; }
.calendar-new-event { display: flex; flex-wrap: wrap; align-items: end; gap: 8px; }
.calendar-new-event .field, .calendar-entry .field { min-width: 0; max-width: 100%; }
.calendar-entry { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); padding: 6px 0; }
#service-list .calendar-entry { display: grid; grid-template-columns: minmax(0, 1fr) max-content; }
.calendar-entry div { display: grid; gap: 3px; }
.calendar-entry small { color: var(--muted); }
#sunday-series { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 10px; align-items: end; }
#sunday-series button { grid-column: 1 / -1; justify-self: start; }
#sunday-series label:has(select[name=preset]) { grid-column: span 2; }
@media(max-width: 490px) { #sunday-series { grid-template-columns: 1fr 1fr; } #sunday-series label:first-child { grid-column: 1 / -1; } }

#endpoint-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; }
#endpoint-legend span { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; }
#endpoint-legend span::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--endpoint-color); border: 1px solid #182d4629; }
.calendar-grid button small, .calendar-entry { border-left: 4px solid var(--endpoint-color); padding-left: 4px; }
.calendar-grid button small { margin-top: 3px; color: var(--ink); }
.calendar-entry { padding-left: 8px; }
#endpoint-urls { display: grid; gap: 6px; }

#tour-dialog {
  position: fixed; inset: 0; margin: 0; width: 100%; height: 100%;
  max-width: none; max-height: none; padding: 0; border: 0; overflow: hidden;
  background: transparent; color: var(--ink);
}
#tour-dialog::backdrop { background: transparent; }
html:has(#tour-dialog[open]) { overflow: hidden; }
#tour-highlight {
  position: absolute; border: 3px solid #87c7ff; border-radius: 8px;
  box-shadow: 0 0 0 200vmax #0a172dbd; cursor: pointer;
}
.tour-card {
  position: absolute; width: min(350px, calc(100% - 20px)); max-height: calc(100% - 20px);
  overflow: auto; padding: 18px; border-radius: 12px; border: 1px solid var(--line);
  background: white; box-shadow: 0 12px 48px #07152852;
}
.tour-card h2 { margin: 4px 0 8px; font-size: 19px; }
#tour-text { line-height: 1.5; }
.tour-actions { margin-top: 16px; display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
#tour-skip { margin-right: auto; }
