/* The studio inherits the workbench palette across its shadow root. */
.workspace-shell,dialog {
  --surface:var(--bu-canvas);--well:var(--bu-panel);--control:var(--bu-layer);--hover:var(--bu-hover);
  --line:var(--bu-border);--field-line:var(--bu-outline);--ink:var(--bu-ink);--muted:var(--bu-secondary);--subtle:var(--bu-muted);
  --accent:var(--bu-ink);--focus:var(--bu-focus);--on-selected:var(--bu-ink);--radius:12px;
  color:var(--ink);font-family:var(--bu-font);font-variant-numeric:tabular-nums;
}
.workspace-shell {
  inline-size:min(100%,48rem);margin:0 auto;padding:0 clamp(.75rem,3.5vw,2rem) 3rem;
  display:grid;grid-template-columns:minmax(0,1fr);align-content:start;row-gap:1.15rem;
}
.workspace-shell:has(> #dashboard) {inline-size:min(100%,78rem);padding-inline:clamp(1rem,4vw,3rem)}
.panel-head {display:contents}
.panel-heading {grid-column:1/-1;min-height:72px;display:flex;align-items:center;justify-content:center;
  gap:.4rem 1.15rem;flex-wrap:wrap;border-bottom:1px solid var(--line)}
.panel-heading .workspace-find {margin-inline-start:0}
.panel-heading .workspace-switch {font-size:1rem;line-height:1.3;font-weight:650;letter-spacing:0}
.workspace-switch a[aria-current]::after {background:var(--bu-focus);height:2px}
.panel-heading h1 {margin:0;font-size:clamp(1rem,1.5vw,1.2rem);font-weight:610;color:var(--ink);letter-spacing:-.015em}
.panel-heading h1::before,.panel-heading h1::after {content:none}
.calendar-tools {display:flex;align-items:center;justify-content:center;gap:.75rem}
.calendar-tabs {width:min(100%,30rem);grid-template-columns:repeat(4,minmax(0,1fr));gap:2px;padding:4px;background:var(--well);border:1px solid var(--line);border-radius:12px;
  --lb-tab-surface:var(--bu-selected);--lb-tab-shadow:inset 0 1px 0 #ffffff09;--lb-tab-radius:10px}
.calendar-tabs button {display:flex;align-items:center;justify-content:center;gap:.4rem;font-weight:500;font-size:.875rem;white-space:nowrap;padding:.4rem .25rem;border-radius:8px;min-height:36px}
.calendar-tabs button svg {display:block;width:16px;height:16px;flex:none;fill:none;stroke:currentColor;stroke-width:1.65;stroke-linecap:round;stroke-linejoin:round}
.calendar-tabs button[aria-current=page] {background:var(--bu-selected);color:var(--ink)}
.calendar-tabs[data-lb-ready] button:is([aria-current=page],:hover) {background:transparent}
@media (hover:hover) {
  .calendar-tabs[data-lb-ready] button:hover {color:var(--ink)}
  .calendar-tabs[data-lb-ready]:has(button:hover) button[aria-current=page]:not(:hover) {color:var(--muted)}
}
.workspace-shell > :is(#notice,#auth,#retry,#dashboard) {min-width:0}
.workspace-shell > #retry {justify-self:center}
#auth,#notice {text-align:center}
#notice {border-left:3px solid var(--on-selected);background:var(--well);color:var(--on-selected);border-radius:5px;padding:.65rem .85rem;margin:0 0 .9rem}
#notice[data-error=true] {border-color:var(--bad);color:var(--bad)}
#notice:empty,.warning:empty {display:none}
button:not(.blister-trigger):not(.primary),.button {border-radius:8px}
.button {display:inline-flex;align-items:center;justify-content:center;gap:.4rem;min-height:2.6rem;padding:.45rem .85rem;
  color:var(--ink);background:var(--control);border:1px solid var(--line);font-weight:600;font-size:.875rem;text-decoration:none}
.button:hover {background:var(--hover)}.open-public {flex:none;white-space:nowrap;color:var(--muted)}
.open-public span {color:var(--on-selected)}
:is(#dashboard,#editor,#copy-link) :is(input:not([type=checkbox],[type=color]),textarea,select){
  min-width:0;border-radius:8px;border:1px solid var(--field-line);background:var(--surface);color:var(--ink);padding:.65rem .74rem}
input:read-only:not([type=color]) {color:var(--muted)}
button.primary {background:var(--bu-accent);color:#0b203e;border:1px solid transparent;border-radius:9px;font-weight:600}
button.primary:hover:not(:disabled) {background:color-mix(in srgb,var(--bu-accent) 85%,white);color:#0b203e}
.paper,.published-shows,.settings-block {
  padding:clamp(1rem,1.7vw,1.35rem);min-width:0;border:1px solid var(--line);background:var(--well);border-radius:var(--radius)}
.paper h2,.settings-block h2 {font-size:1rem;font-weight:600;color:var(--ink);letter-spacing:-.015em;line-height:1.4;margin:0}
.heading,.actions,.link-actions {display:flex;align-items:center;gap:.65rem;flex-wrap:wrap}
.heading,.actions {justify-content:center}.actions {margin-top:1.1rem}
.link-row {justify-content:space-between}.link-actions {justify-content:center}
.columns {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:1rem;align-items:start}
.paper > h2,.settings-block h2,.published-shows > summary,.paper > .hint,.empty,
#input-form > label,#stage > .changes,.history-day,#confirmation,#copy-link {text-align:center}
#input-form {max-width:33rem;margin-inline:auto}
#input-form > label[for=business] {border-top:1px solid var(--line);margin:1.1rem 0 .65rem;padding-top:.85rem}
#source {width:100%;resize:vertical;margin-top:1rem;line-height:1.65;min-height:11rem}
#business {display:block;width:100%;max-width:14rem;margin-inline:auto}
label {margin:.8rem 0 .33rem}label small {color:var(--subtle);font-size:.76rem;margin-inline-start:.3rem}
.hint,.paper .hint,.empty {color:var(--muted);font-size:.86rem;line-height:1.65}
.paper .hint {background:transparent;border:0;padding:0;margin:.4rem 0 1.1rem}
.empty {margin:.85rem 0 .1rem;padding:1rem;background:var(--surface);border-radius:8px}
.tag {font-size:.75rem;padding:.12rem .45rem;border:1px solid var(--line);border-radius:6px;color:var(--muted);background:var(--control)}
.changes {font-size:.82rem;color:var(--muted);margin:.75rem 0}
.issues {background:var(--honey-well);color:var(--warn);font-size:.875rem;padding:.65rem 1rem .65rem 1.65rem;margin:.75rem 0;border-radius:8px}
.issues.error,.warning,.danger {color:var(--bad)}
.draft-toolbar {display:flex;align-items:center;justify-content:space-between;gap:.6rem;flex-wrap:wrap;padding:.8rem 0;margin-top:.5rem}
.change-counts,.row-meta,.row-actions {display:flex;align-items:center;gap:.65rem;flex-wrap:wrap}
.change-counts {font-size:.8rem;color:var(--muted)}
.change-counts b {color:var(--ink);font-weight:600}
.draft-day + .draft-day {margin-top:1.1rem}
.draft-day h3 {margin:0;padding:.5rem .65rem;background:var(--control);border-radius:6px;color:var(--muted);font-size:.78rem;font-weight:550}
.schedule-row {border-bottom:1px solid var(--line);text-align:start;min-width:0;overflow-wrap:anywhere}
.schedule-row:last-child {border-bottom:0}
#stage,#published-items {container-type:inline-size}
.schedule-row:has(#editor:not([hidden])) {border-bottom-color:var(--field-line)}
.list-row {display:grid;grid-template-columns:minmax(0,1fr) auto;gap:.65rem;align-items:center;padding:.6rem .35rem;border-radius:8px}
.row-actions {gap:.15rem}
.row-actions button {background:transparent}
.row-actions .row-delete,#edit-delete {color:var(--bad)}
.row-meta {gap:.45rem}
.row-status {font-size:.72rem;color:var(--muted)}
.row-status::before {content:'·';margin-inline-end:.45rem}
.row-status[data-status=removed],.row-status[data-status=updated] {color:var(--warn)}
.schedule-row:has([data-undo]) .event-row-info strong {text-decoration:line-through;color:var(--muted)}
.row-changes {margin:0 .35rem .6rem;font-size:.82rem;color:var(--muted)}
.row-changes summary {width:fit-content;cursor:pointer}
.row-changes dl {display:grid;gap:.45rem;margin:.6rem 0 0}
.row-changes dl>div {display:grid;grid-template-columns:3rem minmax(0,1fr);gap:.5rem}
.row-changes dd {margin:0}
.row-changes :is(del,ins) {display:block;white-space:pre-line}
.row-changes ins {text-decoration:none;color:var(--ink)}
.inline-confirm {display:flex;align-items:center;justify-content:flex-end;flex-wrap:wrap;gap:.35rem;padding:.7rem;background:var(--control);border-radius:8px;margin:.25rem 0 .7rem}
.inline-confirm p {margin:0 auto 0 0;font-size:.86rem}
#stage #publish-error:empty {display:none}
#stage #publish-error {font-size:.85rem}
#editor {display:flow-root;text-align:start}
#editor[hidden]{display:none}
#editor[data-folding]{overflow:clip}
#edit-form {padding:1rem;margin:.25rem 0 .8rem;border:1px solid var(--field-line);border-radius:10px;background:var(--surface)}
#shows [data-show-motion=reveal]{animation:show-reveal var(--enter) var(--ease)}
#shows [data-show-motion=remove],#shows [data-show-motion=restore]{animation:show-row-feedback var(--enter) var(--ease)}
#shows [data-show-motion=remove]{--row-shift:6px;--row-flash:var(--bad)}
#shows [data-show-motion=restore]{--row-shift:-6px;--row-flash:var(--bu-accent)}
@keyframes show-reveal {from{opacity:0;transform:translateY(-6px)}to{opacity:1;transform:none}}
@keyframes show-row-feedback {
  from{transform:translateX(var(--row-shift));background-color:color-mix(in srgb,var(--row-flash) 17%,transparent)}
  to{transform:none}
}
#editor .heading {justify-content:flex-start}
#edit-form label {display:block}
#edit-form :is(input,textarea,select) {width:100%}
#edit-form .actions {justify-content:flex-end}
#edit-delete {margin-inline-end:auto}
.list-row:is(:hover,:focus-within),.link-row:focus-within,.history-row:focus-within {background:var(--bu-hover)}
.event-row-info {display:grid;gap:.18rem;min-width:0}
.event-row-info strong {font-size:.93rem;line-height:1.4}
@container(min-width:33rem) {
  .schedule-row .event-row-info {grid-template-columns:8rem minmax(0,1fr);gap:.16rem .65rem;align-items:center}
  .schedule-row .row-info {grid-row:1 / span 2}
  .schedule-row .row-meta {grid-column:2}
}
.row-info,time {font-size:.76rem;color:var(--muted);font-variant-numeric:tabular-nums}
.event-category,.link-row strong {display:inline-flex;align-items:center;gap:.43rem}.event-category {font-size:.75rem;color:var(--muted)}
.category-mark {width:.5rem;height:.5rem;background:var(--cat);border-radius:50%;flex:none}
.list-row button,.history-row button,.link-actions :is(a,button) {font-size:.82rem;min-height:2.38rem;padding-inline:.65rem}
.published-shows {width:min(100%,52rem);margin-inline:auto}
.published-shows > summary {color:var(--ink);list-style-position:inside;font-size:.96rem}
#lookup-form {display:flex;align-items:end;justify-content:center;flex-wrap:wrap;gap:1rem;margin:.9rem 0 1rem}#lookup-form label {margin-top:0}
#links .link-row strong {font-weight:550}
.link-row {display:flex;align-items:center;gap:.65rem;flex-wrap:wrap;border-top:1px solid var(--line);padding:.75rem 0}
.link-row:last-child {padding-bottom:0}.link-row strong {font-size:.9rem;color:var(--ink)}.link-actions {gap:.3rem}
.link-actions .danger,.history-row .danger {background:transparent;color:var(--muted)}
.link-actions .danger:hover,.history-row .danger:hover {color:var(--bad);background:var(--control)}
.feed-heading,.feed-controls {display:flex;align-items:center;gap:.65rem}
.feed-heading {justify-content:space-between;flex-wrap:wrap}
.feed-heading button,.feed-controls button {min-height:2.35rem;padding:.4rem .8rem}
.feed-card > .hint {text-align:start;margin-top:.55rem}
.feed-label {display:grid;gap:.2rem;min-width:0;overflow-wrap:anywhere}
.feed-label small {font-size:.78rem;color:var(--muted)}
#feed-form {padding:.85rem;margin:0 0 .85rem;background:var(--surface);border:1px solid var(--line);border-radius:10px}
#feed-form h3 {margin:0;font-size:.92rem}
#feed-form label {display:block;margin:.7rem 0 .3rem}
#feed-form input {width:100%}
#feed-form #feed-color {width:2rem;height:1.8rem;min-height:0;padding:1px;vertical-align:middle;cursor:pointer}
#feed-form .hint {margin:.35rem 0 .7rem;text-align:start}
.feed-controls {justify-content:flex-end}
.history-day {margin:1.2rem 0 .4rem;font-size:.86rem;color:var(--muted)}
.history-row {display:grid;grid-template-columns:3.2rem minmax(0,1fr) auto;align-items:start;gap:.8rem;border-top:1px solid var(--line);padding:.85rem 0}
.history-row time {padding-top:.18rem;color:var(--on-selected)}.history-row strong,.history-row small {display:block}
.history-row small {margin-top:.15rem;color:var(--muted);font-size:.8rem}
#history .paper {width:min(100%,52rem);margin-inline:auto}.history-row{position:relative;padding-inline-start:1rem}
.history-row::before {content:"";position:absolute;top:1.22rem;left:0;width:5px;height:5px;border-radius:50%;background:var(--subtle)}
.history-toolbar,.history-filter,.history-rollback {display:flex;align-items:center;gap:.5rem;flex-wrap:wrap}
.history-toolbar {justify-content:space-between;gap:.8rem}
.history-toolbar h2 {margin:0}.history-filter {padding:.2rem;border-radius:.65rem;background:var(--control);gap:.15rem}
.history-filter button,.history-info {background:transparent}
.history-filter button {font-size:.82rem;min-height:2rem;padding:.3rem .65rem}
.history-filter button[aria-pressed="true"] {background:var(--bu-hover);color:var(--text);box-shadow:0 0 0 1px var(--line)}
.history-filter {--lb-tab-surface:var(--bu-hover);--lb-tab-shadow:inset 0 0 0 1px var(--line)}
.history-filter[data-lb-ready] button[aria-pressed="true"] {background:transparent;box-shadow:none;color:var(--ink)}
#history .history-day {text-align:left;margin:1.65rem 0 .35rem}
#history .history-row {padding:.5rem 0;align-items:center}
#history .history-row::before {display:none}
#history .history-info {display:flex;align-items:center;justify-content:space-between;gap:.75rem;text-align:left;overflow-wrap:anywhere}
.history-info[aria-expanded="true"]>span:last-child {transform:rotate(180deg)}
.history-info>span:last-child {transition:transform var(--enter) var(--ease)}
.history-info[aria-busy="true"] small::after {content:" · 正在读取…"}
.history-fold {display:grid;grid-template-rows:1fr;opacity:1;transition:grid-template-rows var(--enter) var(--ease),opacity var(--quick) ease-out}
.history-fold[inert] {grid-template-rows:0fr;opacity:0}
.history-clip {min-height:0;overflow:hidden}
.history-row time,.history-item-time {font-variant-numeric:tabular-nums}
.history-row time {font-size:.82rem}
.history-body {padding:.45rem 1rem .85rem;border-inline-start:2px solid var(--line);margin:.25rem 0 .75rem 1rem;text-align:left}
.history-body h4 {margin:.65rem 0 .25rem;color:var(--muted);font-size:.8rem}
.history-event,.history-source {margin:0;padding:0;background:transparent;border:0}
.history-event summary {display:flex;align-items:baseline;gap:.65rem;cursor:pointer;padding:.55rem .2rem;border-bottom:1px solid var(--line)}
.history-event summary strong {flex:1;min-width:0;overflow-wrap:anywhere}
.history-event small,.history-item-time {color:var(--muted);font-size:.8rem}
.history-item-time {min-width:8.5rem}
.history-event p,.history-source pre {white-space:pre-wrap;overflow-wrap:anywhere;font:inherit;margin:.45rem 0}
.history-before {padding:.5rem .7rem;margin:.4rem 0;border-inline-start:2px solid var(--line)}
.history-body .history-source summary {margin-top:.6rem;cursor:pointer}
.history-source pre {max-height:20rem;overflow:auto;padding:.65rem;border-radius:.4rem;background:var(--control)}
@supports (interpolate-size:allow-keywords) {
  :is(.history-event,.history-source,.program-row details)::details-content {interpolate-size:allow-keywords;block-size:0;overflow:hidden;opacity:0;
    transition:block-size var(--enter) var(--ease),opacity var(--quick) ease-out,content-visibility var(--enter) allow-discrete}
  :is(.history-event,.history-source,.program-row details)[open]::details-content {block-size:auto;opacity:1}
}
.history-more {display:block;margin:1rem auto 0}
.history-rollback {justify-content:flex-end;margin-bottom:.8rem;font-size:.86rem}
.history-issue {color:var(--warning);margin:.6rem 0}
@media(max-width:38rem){
  .history-toolbar h2 {flex:1 0 100%;text-align:left}
  .history-body {margin-left:.2rem;padding-left:.6rem;padding-right:.1rem}
  .history-event summary {display:grid;grid-template-columns:minmax(0,1fr) auto;gap:.15rem .55rem}
  .history-item-time {grid-column:1/-1}.history-event summary strong {grid-column:1}
}
dialog {box-sizing:border-box;width:min(37rem,calc(100% - 2rem));max-height:90dvh;margin:auto;
  overflow:auto;overscroll-behavior:contain;border:1px solid var(--field-line);border-radius:16px;padding:clamp(1rem,3vw,1.6rem);background:var(--bu-layer);box-shadow:var(--bu-shadow)}
dialog[open] {animation:studio-dialog var(--quick) var(--ease)}
dialog::backdrop {background:rgb(0 0 0 / .38)}
@keyframes studio-dialog {from {opacity:0;filter:blur(3px);transform:translateY(4px) scale(.99)} to {opacity:1;filter:none;transform:none}}
dialog h2 {font-size:1.15rem}.close {min-width:2.65rem;padding:.1rem;line-height:1;font-size:1.35rem}
#confirmation,#copy-link {width:min(24.5rem,calc(100% - 2rem))}
#confirmation p {margin:.65rem 0;color:var(--muted);line-height:1.65}
.duo {display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:0 .9rem}
.duo>* {min-width:0}dialog :is(input,textarea,select) {width:100%}
#edit-form>.actions {padding-top:.8rem;border-top:1px solid var(--line)}
@media(min-width:62rem){
  #shows .columns {grid-template-columns:minmax(0,.82fr) minmax(0,1.18fr)}
}
@media(max-width:48rem){
  .columns {grid-template-columns:minmax(0,1fr)}
}
@media(max-width:40rem){
  .panel-heading {min-height:64px;column-gap:.3rem}.panel-heading h1{font-size:1rem}
  .calendar-tabs button {font-size:.87rem;min-height:44px}
  .calendar-tabs button svg {display:none}
  .calendar-tools {flex-wrap:wrap;gap:.5rem}
  .list-row,.history-row {gap:.4rem}
  .row-actions button {padding-inline:.4rem}
  .duo {grid-template-columns:minmax(0,1fr)}
  .link-actions {flex-wrap:wrap;justify-content:flex-start}
  .history-row {grid-template-columns:2.65rem minmax(0,1fr) auto}
}
