:root {
  --workbook-motion-ease: cubic-bezier(.2, .68, .28, 1);
}

html[data-workbook-transition] { view-transition-name: none; }
html[data-workbook-transition] .studio-header { view-transition-name: studio-chrome; }
html[data-workbook-transition] .workbook-motion-title { view-transition-name: workbook-title; }
html[data-workbook-transition='outgoing'] .workbook-motion-content { view-transition-name: workbook-outgoing-page; }

::view-transition { pointer-events: none; }
::view-transition-group(studio-chrome),
::view-transition-group(workbook-title),
::view-transition-group(workbook-outgoing-page) { animation: none; }
::view-transition-old(studio-chrome), ::view-transition-new(studio-chrome) { animation: none; }
::view-transition-old(studio-chrome) { opacity: 0; }
::view-transition-old(workbook-title) { animation: workbook-fade-out 145ms var(--workbook-motion-ease) both; }
::view-transition-new(workbook-title) { animation: workbook-fade-in 200ms var(--workbook-motion-ease) both; }
::view-transition-old(workbook-outgoing-page) { animation: workbook-exit 170ms var(--workbook-motion-ease) both; }

@keyframes workbook-exit {
  from { opacity: 1; transform: none; }
  to { opacity: 0; transform: translateX(var(--workbook-exit-x, 0px)); }
}
@keyframes workbook-fade-out { to { opacity: 0; } }
@keyframes workbook-fade-in { from { opacity: 0; } }
@keyframes studio-menu-enter {
  from { opacity: .65; transform: translateY(-4px); }
  to { opacity: 1; transform: none; }
}
:is(.art-add-menu, .board-card-menu):not([open]) > :is(div, form) { display: none; }
:is(.art-add-menu, .board-card-menu)[open] > :is(div, form) {
  animation: studio-menu-enter 190ms var(--workbook-motion-ease) both;
}

.workbook-sidebar #nav { position: relative; isolation: isolate; }
.workbook-sidebar #nav button { position: relative; }
.workbook-active-marker {
  position: absolute;
  z-index: -1;
  border: 1px solid var(--wine);
  border-radius: var(--nav-button-radius);
  background: var(--wine);
  box-shadow: inset 3px 0 #d69a81, 0 2px 4px #51354d28;
  pointer-events: none;
}
.workbook-sidebar #nav:has(.workbook-active-marker) button.active {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}
.progress i { transform-origin: left center; }
.progress-count { font-variant-numeric: tabular-nums; }

.writing-entry-icons { display: inline-flex; align-items: center; gap: 8px; }

select:not([multiple], [size]) {
  appearance: none;
  padding-inline-end: 30px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='m4 6 4 4 4-4' fill='none' stroke='%2351404b' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-position: right 9px center;
  background-size: 16px;
  background-repeat: no-repeat;
}
@media (forced-colors: active) {
  select:not([multiple], [size]) { appearance: auto; background-image: none; }
}

body:has(.workbook-motion-content) :is(.workbook-sidebar, main) :is(button, a),
.workbook-motion-content :is(.macro-card, .planning-card, .profile-study) {
  transition: transform 190ms var(--workbook-motion-ease), opacity 190ms var(--workbook-motion-ease);
}
@media (hover: hover) {
  body:not(:has(input:focus, textarea:focus, [contenteditable=true]:focus)) .workbook-motion-content
    :is(.writing-entry:not(.writing-entry-note), .macro-card:not(.macro-card-dragged), .planning-card, .profile-study):hover {
    transform: translateY(-2px);
  }
  .workbook-motion-content :is(.writing-entry:not(.writing-entry-note), .planning-card, .profile-study):hover { box-shadow: 0 4px 12px #49344422; }
}
body:has(.workbook-motion-content) :is(.workbook-sidebar, main) button:active:not(:disabled, .macro-handle) { transform: translateY(1px); }
body:has(.workbook-motion-content) dialog.focus-writing-dialog[data-workbook-draft][open] { animation: none; }

@media (prefers-reduced-motion: reduce) {
  :is(.art-add-menu, .board-card-menu)[open] > :is(div, form) { animation: workbook-fade-in 100ms ease-out both; }
  ::view-transition-old(workbook-outgoing-page), ::view-transition-old(workbook-title) { animation: workbook-fade-out 100ms ease-out both; }
  ::view-transition-new(workbook-title) { animation: workbook-fade-in 110ms ease-out both; }
  body:has(.workbook-motion-content) :is(.workbook-sidebar, main) :is(button, a),
  .workbook-motion-content :is(.macro-card, .planning-card, .profile-study) { transition: opacity 100ms ease-out; }
  body:has(.workbook-motion-content) :is(.workbook-sidebar, main) button:active:not(:disabled, .macro-handle),
  body:not(:has(input:focus, textarea:focus, [contenteditable=true]:focus)) .workbook-motion-content
    :is(.writing-entry:not(.writing-entry-note), .macro-card:not(.macro-card-dragged), .planning-card, .profile-study):hover { transform: none; }
}

.studio-disclosure { min-width: 0; color: var(--wine-dark); }
.studio-disclosure > summary { min-height: 44px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; width: fit-content; max-width: 100%; background: var(--paper); font-weight: 650; }
.studio-disclosure[open] > summary { border-color: var(--control); margin-bottom: 12px; }
.workbook-fields > .studio-disclosure { margin-block-start: 18px; }
.workbook-related .studio-disclosure { position: relative; }
.workbook-related .studio-disclosure > button { position: absolute; top: calc(100% - 4px); inset-inline-end: 0; z-index: 3; white-space: nowrap; }
.studio-disclosure .planning-stack, .studio-disclosure .rhythm-template { margin-bottom: 14px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
