/* Scoped cockpit system. Legacy screens continue to use their existing palette. */
html[data-bookscribe-cockpit-page],
.cockpit-frame,
[data-cockpit-theme-root],
.cockpit-sidebar,
.cockpit-surface,
.cockpit-library-dialog,
.cockpit-editor-dialog,
.cockpit-editor-popover {
  --cockpit-canvas: #f4f5f7;
  --cockpit-surface: #ffffff;
  --cockpit-surface-subtle: #fcfcfd;
  --cockpit-surface-accent: #fbfbfe;
  --cockpit-fill: #f3f4f6;
  --cockpit-hairline: #eef0f3;
  --cockpit-border: #e5e7eb;
  --cockpit-border-strong: #d1d5db;
  --cockpit-accent: #4f46e5;
  --cockpit-accent-hover: #3730a3;
  --cockpit-accent-fill-hover: #3730a3;
  --cockpit-accent-text: #4f46e5;
  --cockpit-accent-strong-text: #3730a3;
  --cockpit-accent-tint: #eef2ff;
  --cockpit-accent-tint-strong: #e0e7ff;
  --cockpit-accent-border: #c7d2fe;
  --cockpit-text: #111827;
  --cockpit-body: #1f2937;
  --cockpit-secondary: #374151;
  --cockpit-tertiary: #4b5563;
  --cockpit-muted: #6b7280;
  /* Mock value #9ca3af was ~2.5:1 on white; this meets 4.5:1 on cards and the
     sidebar while staying a shade lighter than --cockpit-muted (CRF-34). */
  --cockpit-faint: #6d7480;
  --cockpit-success: #16a34a;
  --cockpit-success-text: #15803d;
  --cockpit-success-bg: #dcfce7;
  --cockpit-danger: #b91c1c;
  --cockpit-danger-bg: #fee2e2;
  --cockpit-warning: #92400e;
  --cockpit-warning-bg: #fef3c7;
  --cockpit-track-edge: #d1d5db;
  --cockpit-shadow-card:
    0 1px 2px rgba(17, 24, 39, 0.07), 0 10px 30px -6px rgba(17, 24, 39, 0.14);
  --cockpit-shadow-small:
    0 1px 1px rgba(17, 24, 39, 0.05), 0 2px 4px -1px rgba(17, 24, 39, 0.07);
  --cockpit-font-ui:
    'Hanken Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --cockpit-font-prose: Newsreader, Georgia, serif;
  --cockpit-font-mono: ui-monospace, Menlo, Monaco, Consolas, monospace;
  color: var(--cockpit-text);
  font-family: var(--cockpit-font-ui);
}
/* global.css puts Syne on body and h1-h6. Beat those type selectors on
   cockpit pages while staying below any cockpit class rule. */
html:where([data-bookscribe-cockpit-page]) body,
html:where([data-bookscribe-cockpit-page]) :is(h1, h2, h3, h4, h5, h6) {
  font-family: var(--cockpit-font-ui);
}
html[data-bookscribe-cockpit-page][data-cockpit-theme='dark'],
.cockpit-frame[data-cockpit-theme='dark'],
[data-cockpit-theme-root][data-cockpit-theme='dark'],
.cockpit-frame[data-cockpit-theme='dark'] .cockpit-sidebar,
[data-cockpit-theme-root][data-cockpit-theme='dark'] .cockpit-sidebar,
html[data-bookscribe-cockpit-page][data-cockpit-theme='dark']
  [data-cockpit-theme-root],
html[data-bookscribe-cockpit-page][data-cockpit-theme='dark'] .cockpit-frame,
html[data-bookscribe-cockpit-page][data-cockpit-theme='dark'] .cockpit-sidebar,
html[data-bookscribe-cockpit-page][data-cockpit-theme='dark']
  .cockpit-library-dialog,
[data-theme='dark'] .cockpit-editor-dialog,
[data-theme='dark'] .cockpit-editor-popover,
.cockpit-editor-dialog[data-cockpit-theme='dark'],
.cockpit-editor-popover[data-cockpit-theme='dark'] {
  --cockpit-canvas: #0c0d10;
  --cockpit-surface: #181b21;
  --cockpit-surface-subtle: #1c2027;
  --cockpit-surface-accent: #1c2027;
  --cockpit-fill: #212530;
  --cockpit-hairline: #23262e;
  --cockpit-border: #3a4250;
  --cockpit-border-strong: #4a5464;
  --cockpit-accent: #4f46e5;
  --cockpit-accent-hover: #b7bcff;
  --cockpit-accent-fill-hover: #4338ca;
  --cockpit-accent-text: #a5b4fc;
  --cockpit-accent-strong-text: #b7bcff;
  --cockpit-accent-tint: rgba(99, 102, 241, 0.16);
  --cockpit-accent-tint-strong: rgba(99, 102, 241, 0.26);
  --cockpit-accent-border: rgba(129, 140, 248, 0.4);
  --cockpit-text: #eef0f3;
  --cockpit-body: #d6dae1;
  --cockpit-secondary: #b8bfc9;
  --cockpit-tertiary: #a3aab5;
  --cockpit-muted: #8b929e;
  --cockpit-faint: #858c98; /* >= 5:1 on dark surfaces (CRF-34) */
  --cockpit-success: #34d399;
  --cockpit-success-text: #6ee7a8;
  --cockpit-success-bg: rgba(34, 197, 94, 0.2);
  --cockpit-danger: #fca5a5;
  --cockpit-danger-bg: rgba(239, 68, 68, 0.2);
  --cockpit-warning: #fbbf24;
  --cockpit-warning-bg: rgba(251, 191, 36, 0.2);
  --cockpit-track-edge: #3a4250;
  --cockpit-shadow-card: 0 10px 30px rgba(0, 0, 0, 0.55);
  --cockpit-shadow-small: 0 1px 2px rgba(0, 0, 0, 0.24);
}
/* Toasts are portaled beside the cockpit frame, so they need the page theme. */
html[data-bookscribe-cockpit-page] [data-bookscribe-toast] {
  border-color: var(--cockpit-border-strong);
  background: var(--cockpit-surface);
  color: var(--cockpit-text);
  box-shadow: var(--cockpit-shadow-card);
  font-family: var(--cockpit-font-ui);
}
html[data-bookscribe-cockpit-page]
  [data-bookscribe-toast][data-bookscribe-toast-variant='destructive'] {
  border-color: color-mix(in srgb, var(--cockpit-danger) 52%, transparent);
  /* The dark danger tint is translucent; lay it over the solid surface so the
     page behind doesn't show through the toast. */
  background: linear-gradient(var(--cockpit-danger-bg), var(--cockpit-danger-bg))
    var(--cockpit-surface);
  color: var(--cockpit-danger);
}
html[data-bookscribe-cockpit-page] [data-bookscribe-toast] [toast-close] {
  color: var(--cockpit-muted);
}
html[data-bookscribe-cockpit-page] [data-bookscribe-toast] [toast-close]:hover {
  background: var(--cockpit-fill);
  color: var(--cockpit-text);
}
html[data-bookscribe-cockpit-page]
  [data-bookscribe-toast]
  [data-bookscribe-toast-action] {
  border-color: var(--cockpit-border-strong);
  color: inherit;
}
html[data-bookscribe-cockpit-page]
  [data-bookscribe-toast]
  [data-bookscribe-toast-action]:hover {
  background: var(--cockpit-fill);
  color: var(--cockpit-text);
}
html[data-bookscribe-cockpit-page]
  [data-bookscribe-toast]
  [data-bookscribe-toast-action]:focus-visible {
  outline: 2px solid var(--cockpit-accent-border);
  outline-offset: 2px;
}
.cockpit-frame {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  min-height: 100dvh;
  background: var(--cockpit-canvas);
}
.cockpit-frame__main {
  min-width: 0;
}
.cockpit-frame__content {
  min-width: 0;
}
.cockpit-sidebar {
  display: flex;
  position: sticky;
  top: 0;
  z-index: 10;
  width: 250px;
  height: 100dvh;
  flex-direction: column;
  border-right: 1px solid var(--cockpit-border);
  background: var(--cockpit-surface-subtle);
  color: var(--cockpit-text);
}
.cockpit-sidebar button,
.cockpit-book-tabs button {
  font: inherit;
}
.cockpit-sidebar button:not(:disabled),
.cockpit-book-tabs button:not(:disabled) {
  cursor: pointer;
}
.cockpit-sidebar__brand-row {
  display: flex;
  height: 64px;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px 0 16px;
  border-bottom: 1px solid var(--cockpit-hairline);
}
.cockpit-sidebar__brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--cockpit-text);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-decoration: none;
}
.cockpit-sidebar__close-button,
.cockpit-sidebar__drawer-trigger {
  display: none;
  border: 1px solid var(--cockpit-border);
  border-radius: 9px;
  background: var(--cockpit-surface);
  color: var(--cockpit-secondary);
}
.cockpit-sidebar__global-nav {
  display: grid;
  gap: 2px;
  padding: 13px 10px 11px;
}
.cockpit-sidebar__help {
  padding: 10px;
  border-top: 1px solid var(--cockpit-hairline);
}
.cockpit-home-announcement {
  margin: 20px 30px 0;
}
.cockpit-nav-row,
.cockpit-document-row,
.cockpit-sidebar__new-chapter {
  display: flex;
  width: 100%;
  align-items: center;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--cockpit-secondary);
  text-align: left;
  transition:
    background 150ms ease,
    border-color 150ms ease,
    color 150ms ease;
}
.cockpit-nav-row {
  min-height: 36px;
  gap: 10px;
  padding: 0 9px;
  font-size: 13.5px;
}
.cockpit-nav-row span:not(.cockpit-count-badge) {
  flex: 1;
}
.cockpit-nav-row:hover:not(:disabled),
.cockpit-document-row:hover:not(:disabled) {
  background: var(--cockpit-fill);
}
.cockpit-nav-row[aria-current='page'],
.cockpit-document-row[aria-current='page'] {
  border-color: var(--cockpit-accent-border);
  background: var(--cockpit-accent-tint);
  color: var(--cockpit-accent-text);
  font-weight: 600;
}
.cockpit-nav-row:disabled,
.cockpit-document-row:disabled,
.cockpit-sidebar__new-chapter:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}
.cockpit-count-badge {
  display: inline-grid;
  min-width: 18px;
  height: 18px;
  place-items: center;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--cockpit-fill);
  color: var(--cockpit-muted);
  font-family: var(--cockpit-font-mono);
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
}
.cockpit-nav-row[aria-current='page'] .cockpit-count-badge {
  background: var(--cockpit-accent-tint-strong);
  color: var(--cockpit-accent-text);
}
.cockpit-nav-row .cockpit-count-badge--review {
  flex-shrink: 0;
  min-width: 22px;
  height: 22px;
  margin-left: auto;
  background: var(--cockpit-accent-tint-strong);
  color: var(--cockpit-accent-text);
  font-size: 11px;
}
.cockpit-sidebar__book-scope {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
  padding: 7px 10px 10px;
  border-top: 1px solid var(--cockpit-hairline);
}
.cockpit-book-switcher {
  display: flex;
  width: 100%;
  min-height: 54px;
  align-items: center;
  gap: 9px;
  padding: 7px 8px;
  border: 1px solid var(--cockpit-border);
  border-radius: 11px;
  background: var(--cockpit-surface);
  color: var(--cockpit-text);
  text-align: left;
  box-shadow: var(--cockpit-shadow-small);
}
.cockpit-book-switcher:hover {
  border-color: var(--cockpit-accent-border);
  background: var(--cockpit-surface-accent);
}
.cockpit-book-switcher__icon {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 9px;
  background: var(--cockpit-accent-tint);
  color: var(--cockpit-accent-text);
}
.cockpit-book-switcher__copy {
  display: grid;
  min-width: 0;
  flex: 1;
  gap: 2px;
}
.cockpit-book-switcher__eyebrow,
.cockpit-sidebar__group-heading > span:first-child {
  color: var(--cockpit-faint);
  font-family: var(--cockpit-font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}
.cockpit-book-switcher__title {
  overflow: hidden;
  color: var(--cockpit-secondary);
  font-size: 13px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cockpit-sidebar__document-nav {
  min-height: 0;
  flex: 1;
  overflow-y: auto;
  padding: 16px 0 4px;
  scrollbar-color: var(--cockpit-border-strong) transparent;
  scrollbar-width: thin;
}
.cockpit-sidebar__group {
  margin-bottom: 17px;
}
.cockpit-sidebar__group-heading {
  display: flex;
  min-height: 20px;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px 6px;
}
.cockpit-sidebar__group-hint {
  color: var(--cockpit-faint);
  font-size: 11.5px;
}
.cockpit-sidebar__rows {
  display: grid;
  gap: 2px;
}
.cockpit-sidebar__chapter-filter {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 32px;
  margin: 0 0 6px;
  padding: 0 9px;
  border: 1px solid var(--cockpit-border);
  border-radius: 9px;
  background: var(--cockpit-surface);
  color: var(--cockpit-muted);
}
.cockpit-sidebar__chapter-filter:focus-within {
  border-color: var(--cockpit-accent-border);
}
.cockpit-sidebar__chapter-filter input {
  width: 100%;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--cockpit-text);
  font: inherit;
  font-size: 12.5px;
}
.cockpit-sidebar__chapter-filter input::-moz-placeholder {
  color: var(--cockpit-muted);
}
.cockpit-sidebar__chapter-filter input::placeholder {
  color: var(--cockpit-muted);
}
.cockpit-sidebar__no-matches {
  margin: 8px;
  color: var(--cockpit-faint);
  font-size: 11.5px;
  line-height: 1.45;
}
/* Chapter reorder: the row being dragged fades; the drop target shows an
   accent line where the chapter will land. */
.cockpit-document-row.is-dragging {
  opacity: 0.45;
}
.cockpit-document-row.is-drop-target {
  box-shadow: inset 0 2px 0 var(--cockpit-accent);
}
.cockpit-document-row[draggable='true'] {
  cursor: grab;
}
.cockpit-document-row {
  min-height: 45px;
  gap: 9px;
  padding: 6px 8px;
}
.cockpit-document-row__number {
  display: inline-grid;
  width: 25px;
  height: 25px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 7px;
  background: var(--cockpit-fill);
  color: var(--cockpit-muted);
  font-family: var(--cockpit-font-mono);
  font-size: 10px;
  font-weight: 700;
}
.cockpit-document-row[aria-current='page'] .cockpit-document-row__number {
  background: var(--cockpit-accent-tint-strong);
  color: var(--cockpit-accent-text);
}
.cockpit-document-row__copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}
.cockpit-document-row__title {
  overflow: hidden;
  color: inherit;
  font-size: 13.5px;
  line-height: 1.22;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cockpit-document-row__meta {
  overflow: hidden;
  color: var(--cockpit-muted);
  font-size: 11.5px;
  font-weight: 400;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cockpit-document-row--staging {
  min-height: 57px;
  border-color: var(--cockpit-accent-border);
  background: var(--cockpit-accent-tint);
}
.cockpit-document-row--staging:hover:not(:disabled) {
  background: var(--cockpit-accent-tint-strong);
}
.cockpit-document-row--staging > svg {
  flex: 0 0 auto;
  color: var(--cockpit-accent-text);
}
.cockpit-sidebar__new-chapter {
  min-height: 32px;
  justify-content: center;
  gap: 6px;
  margin: 0 0 6px;
  color: var(--cockpit-accent-text);
  font-size: 12.5px;
  font-weight: 600;
}
.cockpit-sidebar__new-chapter:hover:not(:disabled) {
  border-color: var(--cockpit-accent-border);
  background: var(--cockpit-accent-tint);
}
/* After the last chapter and pinned to the bottom of the scrolling list, so
   it is always reachable, including when the last chapter is open. */
.cockpit-sidebar__new-chapter--end {
  position: sticky;
  bottom: 0;
  z-index: 1;
  margin: 6px 0 0;
  border-color: var(--cockpit-border);
  background: var(--cockpit-surface-subtle);
}
.cockpit-sidebar__footer {
  padding: 10px;
  border-top: 1px solid var(--cockpit-hairline);
}
.cockpit-account-control {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--cockpit-border);
  border-radius: 11px;
  background: var(--cockpit-surface);
  color: var(--cockpit-secondary);
  text-align: left;
}
.cockpit-account-control:hover {
  border-color: var(--cockpit-accent-border);
  background: var(--cockpit-accent-tint);
}
.cockpit-account-control__avatar {
  display: grid;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 999px;
  background: var(--cockpit-fill);
  color: var(--cockpit-tertiary);
  font-size: 10px;
  font-weight: 700;
}
.cockpit-account-control__copy {
  display: grid;
  min-width: 0;
  flex: 1;
  gap: 1px;
  font-size: 13px;
  font-weight: 600;
}
.cockpit-account-control__copy small {
  overflow: hidden;
  color: var(--cockpit-muted);
  font-size: 11px;
  font-weight: 400;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cockpit-account-control__gear {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid var(--cockpit-border-strong);
  border-radius: 9px;
  color: var(--cockpit-tertiary);
}
/* Account and authoring settings are portalled, so each surface carries its own
   cockpit theme root instead of inheriting application-wide color variables. */
.cockpit-account-popover,
.cockpit-settings-dialog {
  color: var(--cockpit-text);
  font-family: var(--cockpit-font-ui);
}
.cockpit-account-scrim {
  position: fixed;
  z-index: 49;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background:
    radial-gradient(circle at 9% 82%, rgba(79, 70, 229, 0.2), transparent 30%),
    rgba(14, 17, 23, 0.3);
  backdrop-filter: blur(3px) saturate(0.85);
  cursor: default;
}
.cockpit-account-popover {
  z-index: 50;
  width: 286px;
  padding: 8px;
  border-color: var(--cockpit-border);
  border-radius: 14px;
  background: color-mix(in srgb, var(--cockpit-surface) 96%, transparent);
  box-shadow: var(--cockpit-shadow-card);
}
.cockpit-account-popover__kicker {
  margin: 5px 9px 0;
  color: var(--cockpit-faint);
  font-family: var(--cockpit-font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.13em;
}
.cockpit-account-popover__identity {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 9px 12px;
}
.cockpit-account-popover__avatar {
  display: grid;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 999px;
  background: var(--cockpit-accent-tint);
  color: var(--cockpit-accent-strong-text);
  font-size: 11px;
  font-weight: 800;
}
.cockpit-account-popover__identity > span:last-child {
  display: grid;
  min-width: 0;
  gap: 2px;
}
.cockpit-account-popover__identity strong {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cockpit-account-popover__identity small {
  overflow: hidden;
  color: var(--cockpit-muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cockpit-account-popover__plan {
  width: -moz-max-content;
  width: max-content;
  margin-top: 2px;
  padding: 2px 5px;
  border-radius: 999px;
  background: var(--cockpit-accent-tint);
  color: var(--cockpit-accent-strong-text);
  font-family: var(--cockpit-font-mono);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
}
.cockpit-account-popover__save-state {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 4px 5px;
  padding: 6px 8px;
  border-radius: 7px;
  background: var(--cockpit-surface-subtle);
  color: var(--cockpit-muted);
  font-size: 10.5px;
}
.cockpit-account-popover__save-state span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--cockpit-success);
  box-shadow: 0 0 0 3px
    color-mix(in srgb, var(--cockpit-success) 14%, transparent);
}
.cockpit-account-popover__menu {
  display: grid;
  gap: 2px;
  padding: 6px 0;
  border-top: 1px solid var(--cockpit-hairline);
  border-bottom: 1px solid var(--cockpit-hairline);
}
.cockpit-account-popover__menu a,
.cockpit-account-popover__menu button,
.cockpit-account-popover__sign-out {
  display: grid;
  width: 100%;
  min-height: 38px;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  padding: 8px 9px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--cockpit-secondary);
  font: inherit;
  font-size: 12.5px;
  text-align: left;
  text-decoration: none;
}
.cockpit-account-popover__menu a:hover,
.cockpit-account-popover__menu button:hover,
.cockpit-account-popover__sign-out:hover:not(:disabled) {
  background: var(--cockpit-accent-tint);
  color: var(--cockpit-accent-strong-text);
}
.cockpit-account-popover__menu button:disabled {
  cursor: wait;
  opacity: 0.55;
}
.cockpit-account-popover__menu kbd {
  color: var(--cockpit-faint);
  font-family: var(--cockpit-font-mono);
  font-size: 10px;
}
.cockpit-account-popover__menu a:focus-visible,
.cockpit-account-popover__menu button:focus-visible,
.cockpit-account-popover__sign-out:focus-visible,
.cockpit-theme-picker button:focus-visible,
.cockpit-settings-dialog button:focus-visible,
.cockpit-settings-dialog input:focus-visible {
  outline: 2px solid var(--cockpit-accent-text);
  outline-offset: 2px;
}
.cockpit-theme-picker {
  min-width: 0;
  margin: 0;
  padding: 12px 0;
  border: 0;
}
.cockpit-theme-picker legend {
  padding: 0 9px 7px;
  color: var(--cockpit-muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.cockpit-theme-picker > div {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  padding: 0 4px;
}
.cockpit-theme-picker button {
  display: inline-flex;
  min-height: 35px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--cockpit-border);
  border-radius: 8px;
  background: var(--cockpit-surface-subtle);
  color: var(--cockpit-muted);
  font: inherit;
  font-size: 12px;
}
.cockpit-theme-picker button.is-selected {
  border-color: var(--cockpit-accent-border);
  background: var(--cockpit-accent-tint);
  color: var(--cockpit-accent-strong-text);
  font-weight: 700;
}
.cockpit-theme-picker:disabled {
  opacity: 0.65;
}
.cockpit-account-popover__sign-out {
  grid-template-columns: 20px 1fr;
  margin-top: 2px;
  color: var(--cockpit-danger);
}
.cockpit-account-popover__sign-out:disabled {
  cursor: wait;
  opacity: 0.65;
}
.cockpit-account-popover__load-error {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0 4px 7px;
  padding: 7px 8px;
  border-radius: 8px;
  background: var(--cockpit-warning-bg);
  color: var(--cockpit-warning);
  font-size: 10.5px;
}
.cockpit-account-popover__load-error button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 5px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 700;
}
.cockpit-account-popover__load-error button:hover {
  background: color-mix(in srgb, currentColor 10%, transparent);
}
.cockpit-settings-overlay {
  background: rgba(10, 13, 20, 0.56);
  backdrop-filter: blur(4px);
}
.cockpit-settings-dialog {
  display: flex;
  width: min(760px, calc(100vw - 32px));
  max-width: 760px;
  max-height: min(860px, calc(100dvh - 32px));
  flex-direction: column;
  gap: 0;
  padding: 0;
  overflow: hidden;
  border-color: var(--cockpit-border);
  border-radius: 17px;
  background: var(--cockpit-surface);
  box-shadow: var(--cockpit-shadow-card);
}
.cockpit-settings-dialog > [data-slot='dialog-header'] {
  gap: 5px;
  padding: 25px 28px 19px;
  border-bottom: 1px solid var(--cockpit-hairline);
}
.cockpit-settings-dialog [data-slot='dialog-title'] {
  color: var(--cockpit-text);
  font-size: 22px;
  letter-spacing: -0.025em;
}
.cockpit-settings-dialog [data-slot='dialog-description'] {
  color: var(--cockpit-muted);
}
.cockpit-settings-dialog > button[data-slot='dialog-close'] {
  color: var(--cockpit-muted);
}
.cockpit-settings-tabs {
  display: flex;
  gap: 22px;
  padding: 0 28px;
  border-bottom: 1px solid var(--cockpit-hairline);
}
.cockpit-settings-tabs button {
  position: relative;
  padding: 13px 0 12px;
  border: 0;
  background: transparent;
  color: var(--cockpit-muted);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.cockpit-settings-tabs button::after {
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 2px;
  background: transparent;
  content: '';
}
.cockpit-settings-tabs button.is-active {
  color: var(--cockpit-accent-strong-text);
  font-weight: 700;
}
.cockpit-settings-tabs button.is-active::after {
  background: var(--cockpit-accent);
}
.cockpit-settings-dialog__body {
  display: grid;
  min-height: 0;
  gap: 0;
  overflow-y: auto;
}
.cockpit-settings-dialog__body > section {
  padding: 21px 28px 24px;
  border-bottom: 1px solid var(--cockpit-hairline);
}
.cockpit-settings-dialog__body fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}
.cockpit-settings-dialog__body legend {
  margin-bottom: 7px;
  color: var(--cockpit-tertiary);
  font-size: 11px;
  font-weight: 700;
}
.cockpit-settings-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
.cockpit-settings-section-heading h3,
.cockpit-settings-section-heading p {
  margin: 0;
}
.cockpit-settings-section-heading h3 {
  color: var(--cockpit-text);
  font-size: 14px;
}
.cockpit-settings-section-heading p {
  margin-top: 3px;
  color: var(--cockpit-muted);
  font-size: 11.5px;
  line-height: 1.45;
}
.cockpit-settings-font-sample {
  display: grid;
  width: 44px;
  height: 36px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--cockpit-border);
  border-radius: 9px;
  background: var(--cockpit-surface-subtle);
  color: var(--cockpit-secondary);
  font-family: var(--cockpit-font-prose);
  font-size: 20px;
}
.cockpit-settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 17px 14px;
}
.cockpit-settings-grid fieldset > div,
.cockpit-settings-page-sizes {
  display: grid;
  gap: 5px;
}
.cockpit-settings-grid fieldset:nth-child(2) > div,
.cockpit-settings-grid fieldset:nth-child(3) > div {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.cockpit-settings-grid fieldset:nth-child(4) > div,
.cockpit-settings-page-sizes {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.cockpit-settings-choice {
  display: flex;
  min-height: 38px;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 7px;
  padding: 8px 10px;
  border: 1px solid var(--cockpit-border);
  border-radius: 9px;
  background: var(--cockpit-surface-subtle);
  color: var(--cockpit-secondary);
  font: inherit;
  font-size: 12px;
  text-align: left;
  cursor: pointer;
}
.cockpit-settings-choice:hover {
  border-color: var(--cockpit-accent-border);
}
.cockpit-settings-choice[data-selected='true'] {
  border-color: var(--cockpit-accent-border);
  background: var(--cockpit-accent-tint);
  color: var(--cockpit-accent-strong-text);
  font-weight: 700;
}
.cockpit-settings-choice:has(input:focus-visible) {
  outline: 2px solid var(--cockpit-accent-text);
  outline-offset: 2px;
}
.cockpit-settings-choice > span {
  display: grid;
  min-width: 0;
  gap: 1px;
}
.cockpit-settings-choice small {
  color: var(--cockpit-muted);
  font-size: 10px;
  font-weight: 400;
}
.cockpit-settings-toggle-list {
  display: grid;
  gap: 7px;
}
.cockpit-settings-toggle-row {
  display: grid;
  min-height: 54px;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 9px 11px;
  border: 1px solid var(--cockpit-border);
  border-radius: 10px;
  background: var(--cockpit-surface-subtle);
  cursor: pointer;
}
.cockpit-settings-toggle-row > span:first-child {
  display: grid;
  gap: 2px;
}
.cockpit-settings-toggle-row strong {
  color: var(--cockpit-secondary);
  font-size: 12.5px;
}
.cockpit-settings-toggle-row small {
  color: var(--cockpit-muted);
  font-size: 10.5px;
  line-height: 1.35;
}
.cockpit-settings-toggle-row input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.cockpit-settings-switch {
  position: relative;
  width: 35px;
  height: 20px;
  border-radius: 999px;
  background: var(--cockpit-border-strong);
  transition: background 150ms ease;
}
.cockpit-settings-switch::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.24);
  content: '';
  transition: transform 150ms ease;
}
.cockpit-settings-toggle-row input:checked + .cockpit-settings-switch {
  background: var(--cockpit-accent);
}
.cockpit-settings-toggle-row input:checked + .cockpit-settings-switch::after {
  transform: translateX(15px);
}
.cockpit-settings-toggle-row:has(input:focus-visible) {
  outline: 2px solid var(--cockpit-accent-text);
  outline-offset: 2px;
}
.cockpit-settings-empty-state {
  display: grid;
  gap: 5px;
  padding: 18px;
  border: 1px dashed var(--cockpit-border-strong);
  border-radius: 11px;
  background: var(--cockpit-surface-subtle);
}
.cockpit-settings-empty-state strong {
  color: var(--cockpit-secondary);
  font-size: 13px;
}
.cockpit-settings-empty-state span {
  max-width: 520px;
  color: var(--cockpit-muted);
  font-size: 11.5px;
  line-height: 1.5;
}
.cockpit-settings-dialog > [data-slot='dialog-footer'] {
  flex-direction: row;
  justify-content: flex-end;
  padding: 16px 28px;
  background: var(--cockpit-surface-subtle);
}
.cockpit-settings-button {
  min-height: 38px;
  padding: 8px 15px;
  border: 1px solid var(--cockpit-border);
  border-radius: 9px;
  font: inherit;
  font-size: 12.5px;
  font-weight: 700;
}
.cockpit-settings-button--secondary {
  background: var(--cockpit-surface);
  color: var(--cockpit-secondary);
}
.cockpit-settings-button--primary {
  border-color: var(--cockpit-accent);
  background: var(--cockpit-accent);
  color: white;
}
.cockpit-settings-button--primary:hover:not(:disabled) {
  border-color: var(--cockpit-accent-fill-hover);
  background: var(--cockpit-accent-fill-hover);
}
.cockpit-settings-button:disabled {
  cursor: wait;
  opacity: 0.6;
}
.cockpit-book-tabs {
  min-width: 0;
  border-bottom: 1px solid var(--cockpit-border);
  background: var(--cockpit-surface);
}
/* The strip is the scroll container: it must stay as wide as the nav (not
   its content) or it can never scroll, and the nav clips the last tabs. */
.cockpit-book-tabs__scroll {
  display: flex;
  min-width: 0;
  max-width: 100%;
  gap: 24px;
  overflow-x: auto;
  padding: 0 30px;
  scrollbar-width: none;
}
.cockpit-book-tabs__scroll::-webkit-scrollbar {
  display: none;
}
.cockpit-book-tabs__tab {
  display: inline-flex;
  height: 48px;
  align-items: center;
  gap: 6px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--cockpit-muted);
  font-size: 13.5px;
  font-weight: 400;
  white-space: nowrap;
  flex-shrink: 0;
}
.cockpit-book-tabs__tab:hover:not(:disabled) {
  color: var(--cockpit-secondary);
}
.cockpit-book-tabs__tab[aria-current='page'] {
  border-color: var(--cockpit-accent);
  color: var(--cockpit-accent-text);
  font-weight: 600;
}
.cockpit-book-tabs__tab:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}
.cockpit-book-context-header {
  display: grid;
  gap: 6px;
  padding: 20px 30px 14px;
  background: var(--cockpit-surface);
  color: var(--cockpit-text);
}
.cockpit-book-context-header__breadcrumbs {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--cockpit-muted);
  font-size: 11px;
}
.cockpit-book-context-header__breadcrumbs a {
  color: var(--cockpit-accent-text);
  text-decoration: none;
}
.cockpit-book-context-header h1 {
  margin: 0;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.015em;
}
.cockpit-staging-workspace__rail {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}
.cockpit-dashboard-surface {
  background: var(--cockpit-surface) !important;
  color: var(--cockpit-text) !important;
}
.cockpit-dashboard-loading-card {
  border-color: var(--cockpit-border);
  background: var(--cockpit-surface);
  color: var(--cockpit-secondary);
}
.cockpit-dashboard-loading-card [role='status'] {
  color: var(--cockpit-accent-text);
}
.cockpit-library-dialog {
  border-color: var(--cockpit-border);
  background: var(--cockpit-surface);
  color: var(--cockpit-text);
}
.cockpit-library-dialog :where(input, button[role='combobox']) {
  border-color: var(--cockpit-border-strong);
  background: var(--cockpit-surface-subtle);
  color: var(--cockpit-text);
}
html[data-bookscribe-cockpit-page] [data-slot='select-content'] {
  border-color: var(--cockpit-border-strong);
  background: var(--cockpit-surface);
  color: var(--cockpit-text);
}
html[data-bookscribe-cockpit-page] [data-slot='select-item'][data-highlighted] {
  background: var(--cockpit-accent-tint);
  color: var(--cockpit-text);
}
.cockpit-frame[data-cockpit-theme='dark']
  .cockpit-dashboard-surface
  :where(.bg-white) {
  background-color: var(--cockpit-surface) !important;
}
.cockpit-frame[data-cockpit-theme='dark']
  .cockpit-dashboard-surface
  :where(.bg-slate-100, .bg-slate-200) {
  background-color: var(--cockpit-fill) !important;
}
.cockpit-frame[data-cockpit-theme='dark']
  .cockpit-dashboard-surface
  :where(.border-slate-300) {
  border-color: var(--cockpit-border-strong) !important;
}
.cockpit-frame[data-cockpit-theme='dark']
  .cockpit-dashboard-surface
  :where(.text-slate-950, .text-slate-900) {
  color: var(--cockpit-text) !important;
}
.cockpit-frame[data-cockpit-theme='dark']
  .cockpit-dashboard-surface
  :where(
    .text-slate-800,
    .text-slate-700,
    .text-slate-600,
    .text-gray-700,
    .text-gray-600
  ) {
  color: var(--cockpit-secondary) !important;
}
.cockpit-frame[data-cockpit-theme='dark']
  .cockpit-dashboard-surface
  :where(.text-slate-500, .text-slate-400) {
  color: var(--cockpit-muted) !important;
}
.cockpit-frame[data-cockpit-theme='dark']
  .cockpit-dashboard-surface
  :where(.text-purple-700, .text-purple-800) {
  color: var(--cockpit-accent-text) !important;
}
.cockpit-frame[data-cockpit-theme='dark']
  .cockpit-dashboard-surface
  :where(.border-gray-300) {
  border-color: var(--cockpit-border-strong) !important;
}
/* Staging (mock 5e): accent banner above the prose; placement and source
   cards pinned at the top of the editor rail. */
.cockpit-staging-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 12px;
  margin: 0 0 16px;
  padding: 11px 16px;
  border: 1px solid var(--cockpit-accent-border);
  border-radius: 11px;
  background: var(--cockpit-accent-tint);
  color: var(--cockpit-secondary);
  font-size: 13.5px;
}
.cockpit-staging-banner strong {
  color: var(--cockpit-accent-text);
  font-weight: 600;
}
/* Outranks `.cockpit-editor-commandbar__title span` (the green "Saved" label). */
.cockpit-editor-commandbar__title .cockpit-not-in-chapter-pill,
.cockpit-not-in-chapter-pill {
  align-self: center;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--cockpit-accent-tint);
  color: var(--cockpit-accent-text);
  font-family: var(--cockpit-font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.cockpit-staging-rail {
  display: grid;
  gap: 12px;
  margin: 14px 14px 4px;
}
.cockpit-staging-rail > * {
  min-width: 0;
}
.cockpit-staging-rail-card h2 {
  margin: 0;
  color: var(--cockpit-text);
  font-size: 15px;
  font-weight: 700;
}
.cockpit-staging-rail-card p {
  margin: 0;
  color: var(--cockpit-secondary);
  font-size: 13px;
}
.cockpit-staging-append {
  display: flex;
  gap: 8px;
}
.cockpit-staging-append select {
  flex: 1 1 auto;
  min-width: 0;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--cockpit-border-strong);
  border-radius: 10px;
  background: var(--cockpit-surface);
  color: var(--cockpit-text);
  font-size: 13px;
}
.cockpit-staging-append-selection {
  justify-self: start;
}
.cockpit-staging-source-player {
  display: grid;
  gap: 8px;
}
.cockpit-staging-source-player__buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
/* Recording player (RecordingAudio): full-width scrubber, controls below. */
.recording-audio {
  display: grid;
  gap: 6px;
  width: 100%;
  min-width: 0;
}
.recording-audio__scrubber {
  width: 100%;
  height: 20px;
  margin: 0;
  background: transparent;
  cursor: pointer;
  accent-color: var(--cockpit-accent);
  -webkit-appearance: none;
     -moz-appearance: none;
          appearance: none;
}
.recording-audio__scrubber::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(
    to right,
    var(--cockpit-accent) var(--recording-progress, 0%),
    var(--cockpit-border-strong) var(--recording-progress, 0%)
  );
}
.recording-audio__scrubber::-webkit-slider-thumb {
  width: 14px;
  height: 14px;
  margin-top: -4px;
  border: 2px solid var(--cockpit-surface);
  border-radius: 999px;
  background: var(--cockpit-accent);
  -webkit-appearance: none;
          appearance: none;
}
.recording-audio__scrubber::-moz-range-track {
  height: 6px;
  border-radius: 999px;
  background: var(--cockpit-border-strong);
}
.recording-audio__scrubber::-moz-range-progress {
  height: 6px;
  border-radius: 999px;
  background: var(--cockpit-accent);
}
.recording-audio__scrubber::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border: 2px solid var(--cockpit-surface);
  border-radius: 999px;
  background: var(--cockpit-accent);
}
.recording-audio__scrubber:disabled {
  cursor: default;
  opacity: 0.5;
}
.recording-audio__scrubber:focus-visible {
  outline: 2px solid var(--cockpit-accent-text);
  outline-offset: 2px;
}
.recording-audio__controls {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}
.recording-audio__controls button {
  display: inline-grid;
  min-width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--cockpit-body);
  font-size: 12px;
  font-weight: 600;
}
.recording-audio__controls button:hover:not(:disabled) {
  background: var(--cockpit-fill);
}
.recording-audio__controls button:disabled {
  opacity: 0.45;
}
.recording-audio__controls .recording-audio__play {
  min-width: 34px;
  height: 34px;
  border-radius: 999px;
  background: var(--cockpit-accent);
  color: #fff;
}
.recording-audio__controls .recording-audio__play:hover:not(:disabled) {
  background: var(--cockpit-accent-fill-hover);
}
.recording-audio__time {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  color: var(--cockpit-muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}
.recording-audio__controls .recording-audio__speed {
  border-color: var(--cockpit-border);
  padding: 0 6px;
}
.cockpit-staging-source-player small {
  overflow: hidden;
  color: var(--cockpit-muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cockpit-staging-source-player > button {
  justify-self: start;
}
/* The label includes a character count and can outgrow the narrow rail:
   wrap it instead of clipping at the card's edge. */
.cockpit-staging-rail-card .cockpit-staging-append-selection {
  max-width: 100%;
  height: auto;
  min-height: 32px;
  padding-block: 6px;
  white-space: normal;
  text-align: left;
  line-height: 1.35;
}
.cockpit-staging-rail-footnote {
  margin: 0;
  color: var(--cockpit-muted);
  font-size: 12px;
  line-height: 1.45;
}
/* On phones the rail becomes a dialog; placement must stay on the page. */
.cockpit-editor-rail-lead--inline {
  margin: 0 0 12px;
}
.cockpit-staging-rail-card {
  display: grid;
  /* Let long chapter names in the select shrink instead of widening the card. */
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  padding: 16px;
  border: 1px solid var(--cockpit-border);
  border-radius: 13px;
  background: var(--cockpit-surface);
  box-shadow: var(--cockpit-shadow-small);
}
.cockpit-staging-rail-card__kicker {
  color: var(--cockpit-accent-text);
  font-family: var(--cockpit-font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.13em;
}
.cockpit-staging-rail-card strong {
  color: var(--cockpit-text);
  font-size: 13px;
}
.cockpit-staging-rail-card .cockpit-staging-rail-card__refining-note {
  margin: 0;
  padding: 7px 9px;
  border-radius: 8px;
  background: var(--cockpit-warning-bg);
  color: var(--cockpit-warning);
  font-size: 12px;
  line-height: 1.4;
}
.cockpit-staging-rail-card small {
  color: var(--cockpit-muted);
  font-size: 11px;
  line-height: 1.45;
}
.cockpit-staging-rail-card__actions,
.cockpit-staging-placement-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.cockpit-staging-placement-actions select {
  min-width: min(100%, 230px);
  flex: 1 1 230px;
}
.cockpit-surface :focus-visible,
.cockpit-workbench :focus-visible,
.cockpit-sidebar :focus-visible,
.cockpit-book-tabs :focus-visible {
  outline: 2px solid var(--cockpit-accent-text);
  outline-offset: 2px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
@media (max-width: 900px) {
  .cockpit-frame {
    display: block;
  }
  .cockpit-sidebar__drawer-trigger {
    display: inline-grid;
    position: fixed;
    z-index: 8;
    top: 12px;
    left: 12px;
    width: 38px;
    height: 38px;
    place-items: center;
    box-shadow: var(--cockpit-shadow-small);
  }
  .cockpit-sidebar {
    position: fixed;
    z-index: 10;
    top: 0;
    left: 0;
    width: min(85vw, 330px);
    max-width: 330px;
    transform: translateX(-105%);
    transition: transform 180ms ease-out;
    box-shadow: var(--cockpit-shadow-card);
  }
  .cockpit-sidebar.is-open {
    transform: translateX(0);
  }
  .cockpit-sidebar__close-button {
    display: inline-grid;
    width: 32px;
    height: 32px;
    place-items: center;
  }
  .cockpit-sidebar__scrim {
    display: block;
    position: fixed;
    z-index: 9;
    inset: 0;
    border: 0;
    background: rgba(17, 24, 39, 0.34);
    backdrop-filter: blur(2px);
  }
  .cockpit-frame__main {
    min-height: 100dvh;
  }
  .cockpit-book-tabs__scroll {
    padding-left: 62px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .cockpit-sidebar,
  .cockpit-nav-row,
  .cockpit-document-row {
    transition: none;
  }
}
/* Cockpit page surfaces */
.cockpit-surface {
  min-height: 100dvh;
  padding: 34px clamp(20px, 4vw, 56px) 64px;
  background: var(--cockpit-canvas);
  color: var(--cockpit-text);
}
.cockpit-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  max-width: 1180px;
  margin: 0 auto 28px;
}
.cockpit-page-header--overview {
  margin-bottom: 42px;
}
.cockpit-page-logo {
  display: block;
  width: auto;
  height: 24px;
  max-width: 170px;
  margin-bottom: 18px;
  -o-object-fit: contain;
     object-fit: contain;
  -o-object-position: left center;
     object-position: left center;
}
.cockpit-eyebrow {
  margin: 0 0 7px;
  color: var(--cockpit-faint);
  font-family: var(--cockpit-font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}
.cockpit-page-title {
  margin: 0;
  color: var(--cockpit-text);
  font-family: var(--cockpit-font-ui);
  font-size: 25px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.15;
}
.cockpit-page-subtitle {
  max-width: 620px;
  margin: 10px 0 0;
  color: var(--cockpit-muted);
  font-size: 14px;
  line-height: 1.5;
}
.cockpit-primary-button {
  border-color: var(--cockpit-accent);
  background: var(--cockpit-accent);
  color: white;
  box-shadow: 0 5px 14px rgba(79, 70, 229, 0.22);
}
.cockpit-primary-button:hover {
  border-color: var(--cockpit-accent-fill-hover);
  background: var(--cockpit-accent-fill-hover);
}
.cockpit-action-cluster {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}
.cockpit-filter-panel,
.cockpit-book-card,
.cockpit-chapter-card,
.cockpit-audio-card {
  border: 1px solid var(--cockpit-border);
  border-radius: 14px;
  background: var(--cockpit-surface);
  box-shadow: var(--cockpit-shadow-small);
}
.cockpit-filter-panel {
  display: grid;
  grid-template-columns: minmax(190px, 0.8fr) 2fr;
  align-items: center;
  gap: 24px;
  max-width: 1180px;
  margin: 0 auto 34px;
  padding: 18px 20px;
}
.cockpit-filter-heading {
  display: flex;
  align-items: center;
  gap: 11px;
}
.cockpit-filter-heading h2,
.cockpit-filter-heading p {
  margin: 0;
}
.cockpit-filter-heading h2 {
  color: var(--cockpit-secondary);
  font-size: 13px;
  font-weight: 700;
}
.cockpit-filter-heading p {
  margin-top: 3px;
  color: var(--cockpit-muted);
  font-size: 11.5px;
}
.cockpit-filter-icon,
.cockpit-empty-icon {
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--cockpit-accent-tint);
  color: var(--cockpit-accent-text);
}
.cockpit-filter-icon {
  width: 33px;
  height: 33px;
}
.cockpit-filter-controls {
  display: grid;
  grid-template-columns:
    minmax(180px, 1.5fr) minmax(125px, 1fr) minmax(100px, 0.8fr)
    auto;
  align-items: center;
  gap: 8px;
}
.cockpit-field {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
  color: var(--cockpit-muted);
}
.cockpit-field input,
.cockpit-field button {
  min-height: 36px;
  border-color: var(--cockpit-border);
  background: var(--cockpit-surface-subtle);
  color: var(--cockpit-text);
}
.cockpit-field input::-moz-placeholder {
  color: var(--cockpit-muted);
  opacity: 0.9;
}
.cockpit-field input::placeholder {
  color: var(--cockpit-muted);
  opacity: 0.9;
}
.cockpit-field--search {
  position: relative;
}
.cockpit-field--search svg {
  position: absolute;
  left: 10px;
  z-index: 1;
}
.cockpit-field--search input {
  padding-left: 31px;
}
.cockpit-filter-actions {
  display: flex;
  gap: 4px;
}
.cockpit-section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  max-width: 1180px;
  margin: 0 auto 14px;
}
.cockpit-section-heading h2 {
  margin: 0;
  color: var(--cockpit-text);
  font-size: 18px;
  letter-spacing: -0.02em;
}
.cockpit-section-heading span {
  color: var(--cockpit-muted);
  font-size: 12px;
}
.cockpit-muted-label {
  color: var(--cockpit-muted);
  font-size: 11px;
}
.cockpit-library-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
  max-width: 1180px;
  margin: 0 auto;
}
.cockpit-book-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  overflow: hidden;
}
.cockpit-book-card__main {
  display: flex;
  min-width: 0;
  gap: 13px;
  padding: 18px 18px 13px;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
}
.cockpit-book-card__main:hover .cockpit-book-card__title {
  color: var(--cockpit-accent-text);
}
.cockpit-book-card__cover {
  display: grid;
  width: 48px;
  height: 62px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 7px 9px 9px 7px;
  background: linear-gradient(145deg, var(--cockpit-accent), #7c3aed);
  color: white;
  box-shadow: inset -5px 0 rgba(0, 0, 0, 0.12);
}
.cockpit-book-card__copy {
  display: grid;
  min-width: 0;
  gap: 6px;
}
.cockpit-book-card__title {
  overflow: hidden;
  color: var(--cockpit-text);
  font-size: 15px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cockpit-book-card__description {
  display: -webkit-box;
  overflow: hidden;
  color: var(--cockpit-muted);
  font-size: 12px;
  line-height: 1.4;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.cockpit-book-card__tags,
.cockpit-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.cockpit-book-card__tags span,
.cockpit-tags span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-radius: 999px;
  background: var(--cockpit-accent-tint);
  color: var(--cockpit-accent-strong-text);
  font-size: 10px;
  font-weight: 600;
  padding: 3px 7px;
}
.cockpit-book-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px 18px;
  border-top: 1px solid var(--cockpit-hairline);
  color: var(--cockpit-muted);
  font-size: 11px;
}
.cockpit-book-card__meta span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.cockpit-book-card__actions {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 9px 12px;
  border-top: 1px solid var(--cockpit-hairline);
}
.cockpit-book-card__actions button:first-child {
  margin-right: auto;
}
.cockpit-danger-button {
  color: var(--cockpit-danger) !important;
}
.cockpit-loading-state {
  display: grid;
  min-height: 260px;
  place-items: center;
  color: var(--cockpit-accent-text);
}
.cockpit-empty-state {
  display: grid;
  max-width: 560px;
  margin: 32px auto;
  padding: 42px 24px;
  place-items: center;
  border: 1px dashed var(--cockpit-border-strong);
  border-radius: 15px;
  background: var(--cockpit-surface-subtle);
  text-align: center;
}
.cockpit-empty-state--compact {
  max-width: none;
  margin: 0 auto;
  padding: 28px;
}
.cockpit-empty-icon {
  width: 48px;
  height: 48px;
  margin-bottom: 13px;
}
.cockpit-empty-state h2,
.cockpit-empty-state h3,
.cockpit-empty-state p {
  margin: 0;
}
.cockpit-empty-state h2,
.cockpit-empty-state h3 {
  color: var(--cockpit-text);
  font-size: 16px;
}
.cockpit-empty-state p {
  margin: 7px 0 17px;
  color: var(--cockpit-muted);
  font-size: 13px;
}
.cockpit-pagination {
  display: flex;
  max-width: 1180px;
  align-items: center;
  justify-content: flex-end;
  gap: 15px;
  margin: 18px auto 0;
  color: var(--cockpit-muted);
  font-size: 11px;
}
.cockpit-pagination label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.cockpit-pagination select {
  border: 1px solid var(--cockpit-border);
  border-radius: 6px;
  background: var(--cockpit-surface);
  color: var(--cockpit-text);
  padding: 3px 5px;
}
.cockpit-pagination__buttons {
  display: flex;
  align-items: center;
  gap: 3px;
}
.cockpit-pagination__buttons > button:not(.inline-flex) {
  width: 27px;
  height: 27px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--cockpit-muted);
}
.cockpit-pagination__buttons > button.is-active {
  background: var(--cockpit-accent);
  color: #fff;
}
.cockpit-breadcrumbs {
  display: flex;
  max-width: 1180px;
  align-items: center;
  gap: 5px;
  margin: 0 auto 26px;
  color: var(--cockpit-muted);
  font-size: 12px;
}
.cockpit-breadcrumbs a {
  color: var(--cockpit-accent-text);
  text-decoration: none;
}
.cockpit-overview-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  margin-top: 14px;
  color: var(--cockpit-muted);
  font-size: 12px;
}
.cockpit-overview-meta span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.cockpit-tags {
  margin-top: 12px;
}
.cockpit-chapter-list {
  display: grid;
  max-width: 1180px;
  gap: 9px;
  margin: 0 auto;
}
.cockpit-chapter-card {
  display: flex;
  min-height: 72px;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  transition:
    border-color 150ms ease,
    box-shadow 150ms ease,
    transform 150ms ease;
}
.cockpit-chapter-card.is-dragged {
  border-color: var(--cockpit-accent-border);
  box-shadow: 0 8px 22px rgba(79, 70, 229, 0.16);
  transform: translateY(-1px);
}
.cockpit-chapter-card__drag {
  display: grid;
  width: 28px;
  height: 34px;
  place-items: center;
  border: 0;
  background: transparent;
  color: var(--cockpit-faint);
  cursor: grab;
}
.cockpit-chapter-card__main {
  display: flex;
  min-width: 0;
  flex: 1;
  align-items: center;
  gap: 11px;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
}
.cockpit-chapter-card__number {
  display: grid;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 10px;
  background: var(--cockpit-accent-tint);
  color: var(--cockpit-accent-text);
  font-family: var(--cockpit-font-mono);
  font-size: 12px;
  font-weight: 700;
}
.cockpit-chapter-card__copy {
  display: grid;
  min-width: 0;
  gap: 4px;
}
.cockpit-chapter-card__copy strong {
  overflow: hidden;
  color: var(--cockpit-text);
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cockpit-chapter-card__copy small {
  color: var(--cockpit-muted);
  font-size: 11px;
}
.cockpit-chapter-card__actions {
  display: flex;
  gap: 2px;
}
.cockpit-audio-toolbar {
  display: flex;
  max-width: 1180px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 auto 15px;
}
.cockpit-segmented-control {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--cockpit-border);
  border-radius: 9px;
  background: var(--cockpit-fill);
}
.cockpit-segmented-control button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--cockpit-muted);
  font: inherit;
  font-size: 12px;
  padding: 7px 11px;
}
.cockpit-segmented-control button.is-active {
  background: var(--cockpit-surface);
  color: var(--cockpit-accent-text);
  box-shadow: var(--cockpit-shadow-small);
  font-weight: 700;
}
.cockpit-audio-toolbar__hint {
  color: var(--cockpit-muted);
  font-size: 11px;
}
.cockpit-upload-panel {
  max-width: 1180px;
  margin: 0 auto 18px;
  padding: 16px;
  border: 1px solid var(--cockpit-border);
  border-radius: 13px;
  background: var(--cockpit-surface-subtle);
}
.cockpit-upload-panel h2 {
  color: var(--cockpit-text) !important;
  font-size: 14px !important;
}
/* The selection bar sits above the list and sticks to the top while you
   scroll, on --cockpit-surface with the card shadow. Under the list it was
   usually off-screen, so rows pointing to it were confusing (alpha, 9/28). */
.cockpit-selection-dock {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  max-width: 1180px;
  align-items: center;
  justify-content: space-between;
  gap: 10px 14px;
  margin: 0 auto 10px;
  padding: 10px 12px 10px 16px;
  border: 1px solid var(--cockpit-border-strong);
  border-radius: 12px;
  background: var(--cockpit-surface);
  color: var(--cockpit-secondary);
  font-size: 12.5px;
  font-weight: 600;
  box-shadow: var(--cockpit-shadow-card);
}
.cockpit-selection-dock__count strong {
  color: var(--cockpit-text);
}
.cockpit-selection-dock__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.cockpit-selection-dock__divider {
  width: 1px;
  height: 22px;
  background: var(--cockpit-border);
}
.cockpit-audio-list {
  display: grid;
  max-width: 1180px;
  gap: 8px;
  margin: 0 auto;
}
.cockpit-audio-card {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 11px;
  padding: 13px 14px;
}
.cockpit-audio-card.is-selected {
  border-color: var(--cockpit-accent-border);
  background: var(--cockpit-surface-accent);
}
.cockpit-audio-card__select {
  display: grid;
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  place-items: center;
  cursor: pointer;
}
.cockpit-audio-card__select input {
  position: absolute;
  opacity: 0;
}
.cockpit-audio-card__select span {
  display: block;
  width: 15px;
  height: 15px;
  border: 1px solid var(--cockpit-border-strong);
  border-radius: 4px;
  background: var(--cockpit-surface);
}
.cockpit-audio-card__select input:checked + span {
  border-color: var(--cockpit-accent);
  background: var(--cockpit-accent);
  box-shadow: inset 0 0 0 3px var(--cockpit-surface);
}
.cockpit-audio-card__icon {
  display: grid;
  width: 37px;
  height: 37px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 10px;
  background: var(--cockpit-accent-tint);
  color: var(--cockpit-accent-text);
}
.cockpit-audio-card__main {
  min-width: 0;
  flex: 1;
}
.cockpit-audio-card__title-row {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 9px;
}
.cockpit-audio-card__title-row h2 {
  overflow: hidden;
  margin: 0;
  color: var(--cockpit-text);
  font-size: 17px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cockpit-audio-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 5px;
  color: var(--cockpit-muted);
  font-size: 11px;
}
.cockpit-audio-card__meta span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.cockpit-status {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 5px;
  border-radius: 999px;
  padding: 3px 7px;
  background: var(--cockpit-fill);
  color: var(--cockpit-muted);
  font-size: 10px;
  font-weight: 600;
}
.cockpit-status__dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}
.cockpit-status.is-ready {
  background: var(--cockpit-success-bg);
  color: var(--cockpit-success-text);
}
.cockpit-status.is-working {
  background: var(--cockpit-accent-tint);
  color: var(--cockpit-accent-text);
}
/* Work the author still owes. Green is reserved for finished states. */
.cockpit-status.is-attention {
  background: var(--cockpit-warning-bg);
  color: var(--cockpit-warning);
}
.cockpit-status.is-danger {
  background: var(--cockpit-danger-bg);
  color: var(--cockpit-danger);
}
.cockpit-audio-card__actions {
  display: flex;
  flex: 0 0 auto;
  gap: 2px;
}
.cockpit-audio-card__play {
  display: grid;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--cockpit-border);
  border-radius: 8px;
  background: var(--cockpit-surface);
  color: var(--cockpit-accent-text);
}
.cockpit-book-picker-overlay {
  position: fixed;
  z-index: 40;
  inset: 0;
  display: grid;
  place-items: start center;
  padding-top: 90px;
  background: rgba(17, 24, 39, 0.35);
  backdrop-filter: blur(3px);
}
.cockpit-book-picker {
  width: min(92vw, 400px);
  border: 1px solid var(--cockpit-border);
  border-radius: 15px;
  background: var(--cockpit-surface);
  box-shadow: var(--cockpit-shadow-card);
  color: var(--cockpit-text);
}
.cockpit-book-picker__header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  padding: 17px 18px 12px;
  border-bottom: 1px solid var(--cockpit-hairline);
}
.cockpit-book-picker__header h2 {
  margin: 0;
  font-size: 18px;
}
.cockpit-book-picker__list {
  display: grid;
  gap: 4px;
  padding: 10px;
}
.cockpit-book-picker__list button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--cockpit-secondary);
  font: inherit;
  padding: 11px 12px;
  text-align: left;
}
.cockpit-book-picker__list button:hover,
.cockpit-book-picker__list button.is-active {
  border-color: var(--cockpit-accent-border);
  background: var(--cockpit-accent-tint);
  color: var(--cockpit-accent-text);
}
.cockpit-book-picker__list small {
  color: var(--cockpit-muted);
  font-size: 11px;
}
@media (max-width: 980px) {
  .cockpit-filter-panel {
    grid-template-columns: 1fr;
  }
  .cockpit-filter-controls {
    grid-template-columns: 1.5fr 1fr 1fr;
  }
  .cockpit-filter-actions {
    grid-column: 1 / -1;
  }
  .cockpit-page-header--overview {
    display: block;
  }
  .cockpit-page-header--overview .cockpit-action-cluster {
    justify-content: flex-start;
    margin-top: 20px;
  }
}
@media (max-width: 680px) {
  .cockpit-surface {
    padding: 66px 14px 40px;
  }
  .cockpit-page-header {
    display: block;
  }
  .cockpit-page-header .cockpit-action-cluster {
    justify-content: flex-start;
    margin-top: 18px;
  }
  .cockpit-filter-controls {
    grid-template-columns: 1fr;
  }
  .cockpit-filter-actions {
    grid-column: auto;
  }
  .cockpit-pagination {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }
  .cockpit-chapter-card {
    align-items: flex-start;
  }
  .cockpit-chapter-card__actions {
    flex-direction: column;
  }
  .cockpit-audio-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }
  .cockpit-audio-card {
    align-items: flex-start;
  }
  .cockpit-audio-card__title-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
  }
  .cockpit-audio-card__actions {
    flex-wrap: wrap;
  }
  .cockpit-audio-card__play {
    display: none;
  }
  .cockpit-account-popover {
    width: min(286px, calc(100vw - 24px));
  }
  .cockpit-settings-dialog {
    width: calc(100vw - 20px);
    max-height: calc(100dvh - 20px);
  }
  .cockpit-settings-dialog > [data-slot='dialog-header'],
  .cockpit-settings-dialog__body > section,
  .cockpit-settings-dialog > [data-slot='dialog-footer'] {
    padding-left: 18px;
    padding-right: 18px;
  }
  .cockpit-settings-grid {
    grid-template-columns: 1fr;
  }
}
/* High-fidelity cockpit page compositions */
.cockpit-frame__main,
.cockpit-frame__content,
.cockpit-surface {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
.cockpit-frame__main,
.cockpit-frame__content {
  overflow-x: clip;
  background: var(--cockpit-canvas);
}
.cockpit-surface {
  overflow-x: clip;
}
/* Library */
.cockpit-library {
  padding: 0 30px 40px;
}
.cockpit-library .cockpit-page-header {
  max-width: none;
  margin: 0 -30px 20px;
  padding: 20px 30px;
  border-bottom: 1px solid var(--cockpit-hairline);
}
.cockpit-library .cockpit-page-subtitle {
  margin-top: 3px;
  font-size: 13.5px;
}
.cockpit-library .cockpit-filter-panel {
  display: grid;
  grid-template-columns:
    minmax(220px, 290px) minmax(130px, 160px) minmax(120px, 150px)
    auto minmax(70px, 1fr);
  max-width: none;
  margin: 0 0 16px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  gap: 10px;
}
.cockpit-library .cockpit-field input,
.cockpit-library .cockpit-field button {
  min-height: 40px;
  border-color: var(--cockpit-border-strong);
  border-radius: 10px;
  background: var(--cockpit-surface);
}
.cockpit-library .cockpit-filter-actions {
  gap: 8px;
}
.cockpit-library .cockpit-filter-actions button {
  min-height: 40px;
  padding-inline: 15px;
}
.cockpit-library-view-toggle {
  display: inline-flex;
  justify-self: end;
  padding: 3px;
  border-radius: 10px;
  background: var(--cockpit-fill);
}
.cockpit-library-view-toggle button {
  display: grid;
  width: 38px;
  height: 34px;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--cockpit-muted);
}
.cockpit-library-view-toggle button.is-active {
  background: var(--cockpit-surface);
  color: var(--cockpit-text);
  box-shadow: var(--cockpit-shadow-small);
}
.cockpit-library .cockpit-library-grid {
  max-width: none;
  margin: 0;
}
.cockpit-library-grid.is-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.cockpit-library-grid.is-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
}
.cockpit-library .cockpit-book-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 160px;
  min-height: 144px;
  overflow: visible;
  box-shadow: none;
}
.cockpit-library .cockpit-book-card[data-current='true'] {
  border-color: var(--cockpit-accent-border);
  background: var(--cockpit-surface-accent);
}
.cockpit-library .cockpit-book-card__main {
  gap: 18px;
  padding: 20px 22px;
}
.cockpit-library .cockpit-book-card__cover {
  width: 42px;
  height: 42px;
  border-radius: 11px;
  background: var(--cockpit-accent-tint);
  color: var(--cockpit-accent-text);
  box-shadow: none;
}
.cockpit-library .cockpit-book-card__copy {
  gap: 7px;
}
.cockpit-library .cockpit-book-card__title {
  overflow: visible;
  font-size: 19px;
  white-space: normal;
}
.cockpit-current-book-pill {
  display: inline-flex;
  margin-left: 10px;
  border-radius: 999px;
  background: var(--cockpit-accent-tint);
  color: var(--cockpit-accent-strong-text);
  font-family: var(--cockpit-font-mono);
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  vertical-align: middle;
}
.cockpit-library .cockpit-book-card__description {
  font-size: 14px;
}
.cockpit-book-card__meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin-top: 5px;
  color: var(--cockpit-muted);
  font-size: 12.5px;
}
.cockpit-library .cockpit-book-card__actions {
  position: relative;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  padding: 20px 22px 20px 0;
  border: 0;
}
.cockpit-library-grid.is-list .cockpit-book-card {
  grid-template-columns: minmax(0, 1fr) auto;
  min-height: 96px;
}
.cockpit-library-grid.is-list .cockpit-book-card__main {
  gap: 16px;
  padding: 16px 20px;
}
.cockpit-library-grid.is-list .cockpit-book-card__title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.cockpit-library-grid.is-list .cockpit-book-card__description {
  display: -webkit-box;
  max-width: 62ch;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
  font-size: 14px;
}
.cockpit-library-grid.is-list .cockpit-book-card__meta-row {
  margin-top: 0;
}
.cockpit-library-grid.is-list .cockpit-book-card__actions {
  flex-direction: row;
  align-items: center;
  gap: 6px;
  padding: 16px 18px 16px 0;
}
.cockpit-library-grid.is-list .cockpit-book-card__more {
  position: static;
}
.cockpit-library .cockpit-book-card__actions > button {
  width: 100%;
  min-height: 36px;
  margin: 0;
}
.cockpit-library-grid.is-list .cockpit-book-card__actions > button {
  width: auto;
  min-width: 120px;
  flex: 0 0 auto;
}
.cockpit-book-card__more,
.cockpit-overview-actions-menu,
.cockpit-chapter-more {
  position: relative;
}
.cockpit-book-card__more summary,
.cockpit-overview-actions-menu summary,
.cockpit-chapter-more summary {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid var(--cockpit-border);
  border-radius: 8px;
  background: var(--cockpit-surface);
  color: var(--cockpit-muted);
  cursor: pointer;
  list-style: none;
}
.cockpit-book-card__more summary {
  margin-left: auto;
}
.cockpit-book-card__more summary::-webkit-details-marker,
.cockpit-overview-actions-menu summary::-webkit-details-marker,
.cockpit-chapter-more summary::-webkit-details-marker {
  display: none;
}
.cockpit-book-card__more > div,
.cockpit-overview-actions-menu > div,
.cockpit-chapter-more > div {
  position: absolute;
  z-index: 25;
  top: calc(100% + 6px);
  right: 0;
  display: grid;
  width: 180px;
  padding: 6px;
  border: 1px solid var(--cockpit-border);
  border-radius: 10px;
  background: var(--cockpit-surface);
  box-shadow: var(--cockpit-shadow-card);
}
.cockpit-book-card__more > div button,
.cockpit-overview-actions-menu > div button,
.cockpit-chapter-more > div button {
  display: flex;
  min-height: 34px;
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--cockpit-secondary);
  text-align: left;
}
.cockpit-book-card__more > div button:hover,
.cockpit-overview-actions-menu > div button:hover,
.cockpit-chapter-more > div button:hover {
  background: var(--cockpit-fill);
}
.cockpit-library .cockpit-pagination {
  max-width: none;
}
/* Audio inbox */
.cockpit-audio-inbox {
  padding: 0 30px 40px;
}
.cockpit-audio-inbox .cockpit-page-header {
  max-width: none;
  margin: 0 -30px 20px;
  padding: 20px 30px;
  border-bottom: 1px solid var(--cockpit-hairline);
}
.cockpit-audio-inbox .cockpit-page-subtitle {
  max-width: none;
  margin-top: 4px;
  font-size: 13.5px;
}
.cockpit-audio-inbox .cockpit-page-header > button {
  min-width: 106px;
  min-height: 38px;
}
.cockpit-audio-inbox .cockpit-upload-panel {
  max-width: none;
  margin: 0 0 22px;
  padding: 0;
  border: 0;
  background: transparent;
}
.cockpit-audio-dropzone {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) minmax(190px, 220px) auto;
  align-items: center;
  gap: 18px;
  min-height: 82px;
  padding: 14px 24px;
  border: 1.5px dashed var(--cockpit-accent-border);
  border-radius: 13px;
  background: var(--cockpit-surface-subtle);
  color: var(--cockpit-text);
  transition:
    border-color 150ms ease,
    background 150ms ease;
}
.cockpit-audio-dropzone.is-dragging {
  border-color: var(--cockpit-accent);
  background: var(--cockpit-accent-tint);
}
[data-cockpit-theme-root] .audio-recorder {
  border-color: var(--cockpit-border);
  background: var(--cockpit-surface);
  color: var(--cockpit-text);
}
[data-cockpit-theme-root] .audio-recorder__waveform,
[data-cockpit-theme-root] .audio-recorder__filename {
  border-color: var(--cockpit-border-strong);
  background: var(--cockpit-surface-subtle);
  color: var(--cockpit-text);
}
.audio-recorder__live-waveform {
  display: block;
  width: 100%;
  height: 72px;
  color: #818cf8;
}
[data-cockpit-theme-root] .audio-recorder__live-waveform {
  color: var(--cockpit-accent);
}
[data-cockpit-theme-root] .cockpit-recording-upload-failure {
  border-color: color-mix(
    in srgb,
    var(--cockpit-warning) 42%,
    transparent
  ) !important;
  background: var(--cockpit-warning-bg) !important;
  color: var(--cockpit-warning) !important;
}
[data-cockpit-theme-root] .cockpit-recording-upload-failure :where(h3, p, svg) {
  color: var(--cockpit-warning) !important;
}
[data-cockpit-theme-root]
  .cockpit-recording-upload-failure
  button:not(.bg-indigo-600) {
  border-color: color-mix(
    in srgb,
    var(--cockpit-warning) 42%,
    transparent
  ) !important;
  background: var(--cockpit-surface) !important;
  color: var(--cockpit-warning) !important;
}
[data-cockpit-theme-root]
  .cockpit-recording-upload-failure
  button:hover:not(:disabled) {
  background: var(--cockpit-fill) !important;
}
.cockpit-audio-dropzone__icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 999px;
  background: var(--cockpit-accent-tint);
  color: var(--cockpit-accent-text);
}
.cockpit-audio-dropzone__copy {
  display: grid;
  gap: 4px;
}
.cockpit-audio-dropzone__copy strong {
  color: var(--cockpit-text);
  font-size: 14px;
}
.cockpit-audio-dropzone__copy small {
  color: var(--cockpit-muted);
  font-size: 12.5px;
}
.cockpit-audio-dropzone select,
.cockpit-audio-dropzone > button {
  min-height: 36px;
  border: 1px solid var(--cockpit-border-strong);
  border-radius: 10px;
  background: var(--cockpit-surface);
  color: var(--cockpit-secondary);
  font: inherit;
  font-size: 13px;
}
.cockpit-audio-dropzone select {
  min-width: 0;
  padding: 0 12px;
}
.cockpit-audio-dropzone__progress {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: auto minmax(160px, 1fr);
  align-items: center;
  gap: 12px;
}
.cockpit-audio-dropzone__progress > div {
  display: grid;
}
.cockpit-audio-dropzone__progress span {
  color: var(--cockpit-muted);
  font-size: 12px;
}
.cockpit-audio-dropzone__progress-track {
  grid-column: 1 / -1;
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--cockpit-fill);
  box-shadow: inset 0 0 0 1px var(--cockpit-track-edge);
}
.cockpit-audio-dropzone__progress-track > span {
  display: block;
  height: 100%;
  background: var(--cockpit-accent);
}
.cockpit-audio-files-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}
.cockpit-audio-files-heading > div:first-child {
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.cockpit-audio-files-heading h2 {
  margin: 0;
  font-size: 16px;
}
.cockpit-audio-files-heading span {
  color: var(--cockpit-muted);
  font-size: 12.5px;
}
.cockpit-audio-filters {
  display: flex;
  gap: 6px;
}
.cockpit-audio-filters button {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--cockpit-border);
  border-radius: 9px;
  background: transparent;
  color: var(--cockpit-secondary);
  font: inherit;
  font-size: 12.5px;
}
.cockpit-audio-filters button.is-active {
  border-color: var(--cockpit-accent);
  background: var(--cockpit-accent-tint);
  color: var(--cockpit-accent-text);
  font-weight: 600;
}
.cockpit-audio-inbox .cockpit-audio-list,
.cockpit-audio-inbox .cockpit-selection-dock {
  max-width: none;
}
.cockpit-audio-inbox .cockpit-audio-list {
  gap: 10px;
}
.cockpit-audio-inbox .cockpit-audio-card {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  min-height: 104px;
  padding: 16px 18px;
  box-shadow: none;
}
.cockpit-audio-inbox .cockpit-audio-card__main {
  /* Move actions below the details before the filename becomes a sliver. */
  flex: 1 1 20rem;
}
.cockpit-audio-inbox .cockpit-audio-card__title-row {
  flex-direction: row;
  align-items: center;
}
.cockpit-audio-inbox .cockpit-audio-card__title-row h2 {
  min-width: 0;
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
}
.cockpit-audio-inbox .cockpit-audio-card__actions {
  flex: 0 1 auto;
  flex-wrap: wrap;
  min-width: 0;
  max-width: 100%;
  align-items: center;
  gap: 8px;
}
.cockpit-audio-card__title-row {
  flex-wrap: wrap;
}
.cockpit-audio-card__book {
  color: var(--cockpit-muted);
  font-size: 12.5px;
}
.cockpit-audio-card__progress {
  width: min(320px, 100%);
  height: 5px;
  margin-top: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--cockpit-fill);
  box-shadow: inset 0 0 0 1px var(--cockpit-track-edge);
}
.cockpit-audio-card__progress span {
  display: block;
  width: 45%;
  height: 100%;
  background: var(--cockpit-accent);
  animation: cockpit-progress-indeterminate 1.4s ease-in-out infinite;
}
@keyframes cockpit-progress-indeterminate {
  from {
    transform: translateX(-110%);
  }
  to {
    transform: translateX(225%);
  }
}
@media (prefers-reduced-motion: reduce) {
  .cockpit-audio-card__progress span {
    width: 100%;
    animation: none;
    opacity: 0.65;
  }
}
/* Manuscript editor */
.cockpit-editor-root {
  --cockpit-editor-font-family:
    Newsreader, Charter, 'Bitstream Charter', 'Sitka Text', Cambria, Georgia, serif;
  min-width: 0;
  background: var(--cockpit-canvas);
  color: var(--cockpit-text);
}
/* Chapter deletion is an existing command; expose it beside each row rather
   than requiring the legacy editor's hidden navigation controls. */
.cockpit-document-entry { position: relative; }
.cockpit-document-entry > .cockpit-document-row { width: 100%; padding-right: 38px; }
.cockpit-document-delete {
  position: absolute;
  top: 50%;
  right: 4px;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 32px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--cockpit-muted);
}
.cockpit-document-delete:hover:not(:disabled) { color: var(--cockpit-danger); background: var(--cockpit-danger-bg); }
.cockpit-document-delete:disabled { opacity: 0.5; }
.cockpit-editor-contextbar {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 5px;
  padding: 12px 30px 8px;
  background: var(--cockpit-surface);
  color: var(--cockpit-muted);
  font-size: 11px;
  white-space: nowrap;
}
.cockpit-editor-contextbar a {
  color: var(--cockpit-accent-text);
  text-decoration: none;
}
.cockpit-editor-contextbar span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* Mock 5c order: title + actions, then the book tabs, then the format bar.
   The left column wrapper is flattened so its title and format rows can sit
   either side of the tabs. */
.cockpit-editor-commandbar {
  flex: 0 0 auto;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    'title actions'
    'tabs tabs'
    'format format';
  align-items: center;
  box-shadow: inset 0 -1px 0 var(--cockpit-hairline);
}
.cockpit-editor-commandbar__main {
  display: contents !important;
}
.cockpit-editor-commandbar__main > .cockpit-editor-commandbar__title {
  grid-area: title;
  min-width: 0;
}
.cockpit-editor-commandbar__main > .cockpit-editor-commandbar__formatting {
  grid-area: format;
}
.cockpit-editor-commandbar__actions {
  grid-area: actions;
}
.cockpit-editor-commandbar__tabs {
  grid-area: tabs;
  min-width: 0;
  margin: 0 -16px;
}
.cockpit-editor-commandbar__tabs .cockpit-book-tabs__scroll {
  padding: 0 16px;
}
.cockpit-editor-commandbar__formatting {
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.cockpit-editor-commandbar__formatting::-webkit-scrollbar {
  display: none;
}
.cockpit-editor-commandbar__actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}
.cockpit-editor-commandbar__title {
  display: flex;
  align-items: center;
  gap: 9px;
}
/* Staging header: "Staged content" and its pill never break mid-phrase. The
   title column is sized to them (never narrower than the heading) and the
   actions take the rest and wrap, so a wide action row can't slide over the
   title. When space is tight the pill drops below the heading. */
.cockpit-editor-commandbar:has(.cockpit-editor-commandbar__title--staging) {
  grid-template-columns:
    minmax(min-content, max-content)
    minmax(min-content, 1fr);
}
.cockpit-editor-commandbar__title--staging {
  flex-wrap: wrap;
  row-gap: 4px;
}
.cockpit-editor-commandbar__title--staging h1,
.cockpit-editor-commandbar__title--staging .cockpit-not-in-chapter-pill {
  flex-shrink: 0;
  white-space: nowrap;
}
.cockpit-editor-commandbar__breadcrumb {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--cockpit-muted);
  font-size: 11px;
}
.cockpit-editor-commandbar__title h1 {
  margin: 0;
  color: var(--cockpit-text);
  font-family: var(--cockpit-font-ui);
  font-size: 25px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.2;
}
.cockpit-editor-commandbar__title-trigger {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
  padding: 2px 4px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  cursor: text;
  text-align: left;
}
.cockpit-editor-commandbar__title-trigger:focus-visible {
  outline: 2px solid var(--cockpit-accent);
  outline-offset: 2px;
}
.cockpit-editor-commandbar__title-trigger svg {
  flex: 0 0 auto;
  color: var(--cockpit-muted);
  opacity: 0;
  transition: opacity 120ms ease;
}
.cockpit-editor-commandbar__title-trigger:hover svg,
.cockpit-editor-commandbar__title-trigger:focus-visible svg {
  opacity: 1;
}
.cockpit-editor-commandbar__title-edit {
  display: inline-flex;
  width: clamp(220px, 38vw, 560px);
  max-width: 100%;
  align-items: center;
  gap: 6px;
}
.cockpit-editor-commandbar__title-edit input {
  min-width: 0;
  flex: 1;
  padding: 4px 8px;
  border: 1px solid var(--cockpit-accent);
  border-radius: 7px;
  outline: none;
  background: var(--cockpit-surface-subtle);
  color: var(--cockpit-text);
  font-family: var(--cockpit-font-ui);
  font-size: 25px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.2;
}
.cockpit-editor-commandbar__title-edit input:focus {
  box-shadow: 0 0 0 2px var(--cockpit-accent-tint);
}
.cockpit-editor-commandbar__title-edit button {
  display: inline-grid;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  place-items: center;
  padding: 0;
  border: 1px solid var(--cockpit-border-strong);
  border-radius: 7px;
  background: var(--cockpit-surface-subtle);
}
.cockpit-editor-commandbar__title span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-radius: 999px;
  background: var(--cockpit-success-bg);
  color: var(--cockpit-success-text);
  font-size: 10px;
  font-weight: 750;
  padding: 3px 7px;
}
.cockpit-editor-commandbar button {
  color: var(--cockpit-body);
}
.cockpit-editor-commandbar button:hover:not(:disabled) {
  background: var(--cockpit-fill) !important;
}
.cockpit-editor-commandbar .cockpit-editor-save-button {
  border: 1px solid var(--cockpit-accent);
  background: var(--cockpit-accent);
  color: #fff;
}
.cockpit-editor-commandbar .cockpit-editor-dictate-button {
  border-color: var(--cockpit-border-strong);
  background: var(--cockpit-surface-subtle);
}
.cockpit-editor-highlight-control {
  display: inline-flex;
}
.cockpit-editor-highlight-button {
  position: relative;
}
.cockpit-editor-highlight-button::after {
  content: '';
  position: absolute;
  right: 5px;
  bottom: 2px;
  left: 5px;
  height: 2px;
  border-radius: 99px;
  background: var(--cockpit-highlight-color);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--cockpit-text) 12%, transparent);
}
.cockpit-editor-highlight-palette {
  display: flex;
  width: auto;
  gap: 8px;
  border-color: var(--cockpit-border-strong);
  background: var(--cockpit-surface);
  padding: 8px;
  color: var(--cockpit-text);
}
.cockpit-editor-highlight-palette button {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid var(--cockpit-border-strong);
  border-radius: 7px;
  background: transparent;
  cursor: pointer;
}
.cockpit-editor-highlight-palette button:hover,
.cockpit-editor-highlight-palette button:focus-visible,
.cockpit-editor-highlight-palette button.is-selected {
  border-color: var(--cockpit-accent-text);
  outline: none;
  box-shadow: 0 0 0 2px var(--cockpit-accent-tint-strong);
}
.cockpit-editor-highlight-palette button span {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  background: var(--highlight-swatch);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, #fff 22%, transparent);
}
/*
 * Highlights created before theme-aware presets were introduced retain their
 * light palette as inline styles. Adapt those stored colors at render time so
 * older manuscripts remain legible in dark mode without rewriting user data.
 */
html[data-cockpit-theme='dark']
  [data-testid='editor-main']
  span[style*='background-color: rgb(253, 230, 138)'] {
  background-color: #713f12 !important;
}
html[data-cockpit-theme='dark']
  [data-testid='editor-main']
  span[style*='background-color: rgb(187, 247, 208)'] {
  background-color: #166534 !important;
}
html[data-cockpit-theme='dark']
  [data-testid='editor-main']
  span[style*='background-color: rgb(191, 219, 254)'] {
  background-color: #1e40af !important;
}
html[data-cockpit-theme='dark']
  [data-testid='editor-main']
  span[style*='background-color: rgb(251, 207, 232)'] {
  background-color: #9d174d !important;
}
html[data-cockpit-theme='dark']
  [data-testid='editor-main']
  span[style*='background-color: rgb(221, 214, 254)'] {
  background-color: #5b21b6 !important;
}
.cockpit-editor-commandbar .cockpit-editor-save-button:hover:not(:disabled) {
  background: var(--cockpit-accent-fill-hover) !important;
  color: #fff;
}
.cockpit-editor-workspace {
  min-width: 0;
  scrollbar-color: var(--cockpit-border-strong) transparent;
}
.cockpit-editor-document {
  max-width: 1760px;
  margin: 0 auto;
}
.cockpit-editor-chapter {
  color: var(--cockpit-body);
}
.cockpit-editor-chapter-meta {
  display: none !important;
}
.cockpit-editor-host,
.cockpit-editor-root .loro-editor {
  background: transparent;
  color: var(--cockpit-body);
}
.cockpit-editor-root .loro-editor [data-testid='editor-main'] {
  color: var(--cockpit-body);
  font-family: var(--cockpit-editor-font-family);
  font-size: var(--cockpit-editor-font-size, 18px);
  line-height: var(--cockpit-editor-line-height, 1.75);
}
.cockpit-editor-root
  .loro-editor
  :where(
    [data-section-type='heading1'],
    [data-section-type='heading2'],
    [data-section-type='heading3']
  )
  [contenteditable='true'] {
  color: var(--cockpit-text);
  font-family: var(--cockpit-editor-font-family);
  letter-spacing: -0.015em;
  line-height: 1.2;
}
.cockpit-editor-root
  .loro-editor
  [data-section-type='paragraph']
  [contenteditable='true']
  p {
  margin-block: 0;
}
.cockpit-editor-root
  .loro-editor
  [data-section-type='paragraph']
  [contenteditable]
  > h1,
.cockpit-editor-root
  .loro-editor
  [data-section-type='paragraph']
  [contenteditable]
  > h2 {
  color: var(--cockpit-text);
  font-family: var(--cockpit-editor-font-family);
  font-weight: 750;
  letter-spacing: -0.02em;
  line-height: 1.25;
  text-indent: 0;
}
.cockpit-editor-root
  .loro-editor
  [data-section-type='paragraph']
  [contenteditable]
  > h1 {
  margin: 1.1em 0 0.45em;
  font-size: 1.55em;
}
.cockpit-editor-root
  .loro-editor
  [data-section-type='paragraph']
  [contenteditable]
  > h2 {
  margin: 1em 0 0.4em;
  font-size: 1.25em;
}
.cockpit-editor-root[data-cockpit-paragraph-style='indent_0_3in']
  .loro-editor
  [data-section-type='paragraph']
  [contenteditable='true']
  p {
  text-indent: 0.3in;
}
.cockpit-editor-root[data-cockpit-paragraph-style='block_spacing']
  .loro-editor
  [data-section-type='paragraph']
  [contenteditable='true']
  p {
  margin-bottom: 0.8em;
  text-indent: 0;
}
.cockpit-editor-root .loro-editor [contenteditable='true'] {
  color: var(--cockpit-body);
  caret-color: var(--cockpit-text);
}
.cockpit-editor-root
  .loro-editor
  button:not(.bg-primary):not(.bg-green-600):not(.bg-red-600):not(.bg-red-500) {
  color: var(--cockpit-secondary);
}
.cockpit-editor-root
  .loro-editor
  button:not(.bg-primary):not(.bg-green-600):not(.bg-red-600):not(
    .bg-red-500
  ):hover:not(:disabled) {
  background: var(--cockpit-fill);
  color: var(--cockpit-text);
}
.cockpit-editor-root .loro-editor button.bg-primary {
  background: var(--cockpit-accent) !important;
  color: #fff !important;
}
.cockpit-editor-root .loro-editor button.bg-green-600 {
  background: #16a34a !important;
  color: #fff !important;
}
.cockpit-editor-root .loro-editor button.bg-green-600:hover:not(:disabled) {
  background: #15803d !important;
}
.cockpit-editor-root .loro-editor button:is(.bg-red-500, .bg-red-600) {
  background: #dc2626 !important;
  color: #fff !important;
}
.cockpit-editor-root
  .loro-editor
  button:is(.bg-red-500, .bg-red-600):hover:not(:disabled) {
  background: #b91c1c !important;
}
.cockpit-editor-root .loro-editor button.bg-white {
  border-color: var(--cockpit-border-strong) !important;
  background: var(--cockpit-surface-subtle) !important;
  color: var(--cockpit-body) !important;
}
.cockpit-editor-root :where(.bg-white, .bg-gray-50, .bg-slate-50) {
  background: var(--cockpit-surface-subtle) !important;
}
.cockpit-editor-root
  :where(
    .text-gray-800,
    .text-gray-700,
    .text-gray-600,
    .text-slate-800,
    .text-slate-700,
    .text-slate-600
  ) {
  color: var(--cockpit-secondary) !important;
}
.cockpit-editor-root :where(.text-gray-500, .text-slate-500) {
  color: var(--cockpit-muted) !important;
}
.cockpit-editor-root
  :where(.border-gray-100, .border-gray-200, .border-gray-300) {
  border-color: var(--cockpit-border) !important;
}
.cockpit-editor-root .cockpit-staging-refining-card,
.cockpit-editor-root .cockpit-staging-destination {
  border-color: var(--cockpit-border-strong) !important;
  background: var(--cockpit-surface-subtle) !important;
  color: var(--cockpit-body) !important;
}
.cockpit-editor-root .cockpit-staging-refining-card span {
  color: var(--cockpit-muted);
}
.cockpit-editor-root .cockpit-staging-selection-count {
  color: var(--cockpit-accent-text) !important;
}
.cockpit-editor-root [data-selection-entity-menu] {
  border-color: var(--cockpit-border) !important;
  background: var(--cockpit-surface-subtle) !important;
  color: var(--cockpit-body);
}
.cockpit-editor-root [data-selection-entity-menu] button:hover {
  background: var(--cockpit-fill) !important;
}
.cockpit-editor-root [data-selection-entity-menu] .text-indigo-700 {
  color: var(--cockpit-accent-text) !important;
}
/* These stay !important: they override shadcn/Tailwind utility classes on
   portalled dialogs. The values are tokens so both themes follow. */
.cockpit-editor-dialog,
.cockpit-editor-popover {
  border-color: var(--cockpit-border-strong) !important;
  background: var(--cockpit-surface) !important;
  color: var(--cockpit-text) !important;
}
.cockpit-editor-dialog .text-muted-foreground,
.cockpit-editor-popover .text-muted-foreground {
  color: var(--cockpit-muted) !important;
}
[data-theme='dark'] .cockpit-editor-dialog :where(input, textarea, select),
[data-theme='dark'] .cockpit-editor-popover,
.cockpit-editor-dialog[data-cockpit-theme='dark']
  :where(input, textarea, select),
.cockpit-editor-popover[data-cockpit-theme='dark'] {
  border-color: var(--cockpit-border-strong) !important;
  background: var(--cockpit-surface-subtle) !important;
  color: var(--cockpit-text) !important;
}
[data-theme='dark'] .cockpit-editor-dialog button:not(.bg-red-600),
.cockpit-editor-dialog[data-cockpit-theme='dark'] button:not(.bg-red-600) {
  border-color: var(--cockpit-border-strong);
  color: var(--cockpit-body);
}
[data-theme='dark'] .cockpit-editor-dialog button:hover:not(:disabled),
.cockpit-editor-dialog[data-cockpit-theme='dark'] button:hover:not(:disabled) {
  background: var(--cockpit-fill);
  color: var(--cockpit-text);
}
[data-theme='dark'] .cockpit-editor-dialog button.cockpit-primary-button,
.cockpit-editor-dialog[data-cockpit-theme='dark'] button.cockpit-primary-button {
  border-color: var(--cockpit-accent);
  background: var(--cockpit-accent);
  color: #fff;
}
[data-theme='dark']
  .cockpit-editor-dialog
  button.cockpit-primary-button:hover:not(:disabled),
.cockpit-editor-dialog[data-cockpit-theme='dark']
  button.cockpit-primary-button:hover:not(:disabled) {
  background: var(--cockpit-accent-fill-hover);
  color: #fff;
}
/* The dialog is a one-column grid whose children default to their min-content
   width, so a wide button row stretched the column past the dialog's edge and
   the text overflowed with it. Pin the column to the dialog and let the
   buttons wrap. */
.cockpit-editor-dialog {
  grid-template-columns: minmax(0, 1fr);
}
.cockpit-editor-dialog > * {
  min-width: 0;
}
.cockpit-editor-dialog [data-slot='dialog-footer'] {
  flex-wrap: wrap;
}
.cockpit-discard-dialog__item {
  overflow-wrap: anywhere;
  border: 1px solid var(--cockpit-border);
  border-radius: 8px;
  background: var(--cockpit-surface-subtle);
  color: var(--cockpit-text);
  font-size: 14px;
  font-weight: 600;
  padding: 10px 12px;
}
[data-theme='dark'] .cockpit-editor-dialog button.bg-red-600,
.cockpit-editor-dialog[data-cockpit-theme='dark'] button.bg-red-600 {
  background: #dc2626 !important;
  color: #fff !important;
}
.cockpit-editor-root .loro-editor .bg-blue-50 {
  border-color: var(--cockpit-accent-border) !important;
  background: var(--cockpit-accent-tint) !important;
}
.cockpit-editor-root .loro-editor .text-blue-700,
.cockpit-editor-root .loro-editor .text-blue-800 {
  color: var(--cockpit-accent-text) !important;
}
.cockpit-editor-root .loro-editor--cockpit {
  padding: 0;
}
.cockpit-editor-review-toolbar {
  min-height: 46px;
  padding: 7px 16px;
  border-color: var(--cockpit-border) !important;
  background: var(--cockpit-surface-subtle);
}
.cockpit-editor-review-toolbar button {
  border-color: var(--cockpit-border-strong) !important;
}
.cockpit-editor-review-count {
  color: var(--cockpit-muted);
  font-family: var(--cockpit-font-mono);
  font-size: 10px;
  white-space: nowrap;
}
.cockpit-editor-stage {
  display: grid;
  min-height: 0;
  flex: 1;
  grid-template-columns: minmax(0, 1fr) clamp(230px, 24vw, 300px);
}
.cockpit-editor-stage > [data-testid='editor-main'] {
  min-width: 0;
  max-width: 1360px;
  margin: 0 auto;
  padding: 38px 32px 80px !important;
}
.cockpit-editor-review-rail {
  position: sticky;
  top: 0;
  align-self: start;
  height: clamp(320px, calc(100dvh - 220px), 720px);
  min-width: 0;
  overflow-x: hidden;
  overflow-y: auto;
  border-left: 1px solid var(--cockpit-border);
  background: var(--cockpit-surface);
  color: var(--cockpit-body);
}
.cockpit-editor-review-tabs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 3px;
  margin: 14px 14px 0;
  padding: 3px;
  border: 1px solid var(--cockpit-border);
  border-radius: 9px;
  background: var(--cockpit-fill);
}
.cockpit-editor-review-tabs button {
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--cockpit-muted);
  font: inherit;
  font-size: 11px;
  font-weight: 650;
  padding: 7px 8px;
}
.cockpit-editor-review-tabs button.is-active {
  background: var(--cockpit-surface);
  color: var(--cockpit-accent-text);
  box-shadow: var(--cockpit-shadow-small);
}
.cockpit-editor-review-panel,
.cockpit-editor-feed,
.cockpit-editor-history-list {
  display: grid;
  gap: 12px;
  padding: 16px 14px;
}
.cockpit-editor-review-heading > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--cockpit-text);
  font-size: 12px;
  font-weight: 750;
}
.cockpit-editor-review-heading strong {
  color: var(--cockpit-accent-text);
  font-family: var(--cockpit-font-mono);
  font-size: 10px;
}
.cockpit-editor-review-heading small {
  display: block;
  margin-top: 5px;
  color: var(--cockpit-muted);
  font-size: 10px;
}
.cockpit-editor-suggestion-card {
  overflow: hidden;
  border: 1px solid var(--cockpit-accent-border);
  border-radius: 12px;
  background: var(--cockpit-surface-subtle);
}
.cockpit-editor-suggestion-card__label {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 11px 12px;
  border-bottom: 1px solid var(--cockpit-border);
  color: var(--cockpit-text);
  font-size: 11px;
  font-weight: 700;
}
.cockpit-editor-suggestion-card__label svg {
  color: var(--cockpit-accent-text);
}
.cockpit-editor-suggestion-card p {
  margin: 10px 12px;
  border-radius: 7px;
  color: var(--cockpit-body);
  font-family: var(--cockpit-font-prose);
  font-size: 12px;
  line-height: 1.45;
  padding: 8px 9px;
}
.cockpit-editor-suggestion-card__old {
  background: var(--cockpit-danger-bg);
  text-decoration: line-through;
  text-decoration-color: var(--cockpit-danger);
}
.cockpit-editor-suggestion-card__anchor {
  border-left: 3px solid var(--cockpit-accent);
  background: var(--cockpit-accent-tint);
  text-decoration: none;
}
.cockpit-editor-suggestion-card__new {
  background: var(--cockpit-success-bg);
}
.cockpit-editor-suggestion-card__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  padding: 10px 12px 12px;
}
.cockpit-editor-suggestion-card__actions button,
.cockpit-editor-accept-all {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 32px;
  border: 1px solid var(--cockpit-border-strong);
  border-radius: 8px;
  background: var(--cockpit-surface);
  color: var(--cockpit-body);
  font: inherit;
  font-size: 10px;
  font-weight: 700;
}
.cockpit-editor-suggestion-card__actions button.is-accept,
.cockpit-editor-accept-all {
  border-color: var(--cockpit-accent);
  background: var(--cockpit-accent);
  color: #fff !important;
}
.cockpit-editor-review-empty {
  display: grid;
  justify-items: center;
  gap: 5px;
  padding: 30px 20px;
  border: 1px dashed var(--cockpit-border-strong);
  border-radius: 11px;
  color: var(--cockpit-muted);
  text-align: center;
}
.cockpit-editor-review-empty strong {
  color: var(--cockpit-secondary);
  font-size: 12px;
}
.cockpit-editor-review-empty span {
  font-size: 10px;
  line-height: 1.45;
}
.cockpit-editor-up-next {
  display: grid;
  gap: 4px;
}
.cockpit-editor-up-next > strong {
  margin-bottom: 3px;
  color: var(--cockpit-muted);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.cockpit-editor-up-next button {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--cockpit-muted);
  font: inherit;
  font-size: 10px;
  padding: 7px 8px;
  text-align: left;
}
.cockpit-editor-up-next button.is-active,
.cockpit-editor-up-next button:hover {
  border-color: var(--cockpit-accent-border);
  background: var(--cockpit-accent-tint);
  color: var(--cockpit-accent-text);
}
.cockpit-editor-up-next button span {
  display: grid;
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 6px;
  background: var(--cockpit-fill);
  font-family: var(--cockpit-font-mono);
}
.cockpit-editor-feed article,
.cockpit-editor-history-list button {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  gap: 9px;
  border: 1px solid var(--cockpit-border);
  border-radius: 9px;
  background: var(--cockpit-surface-subtle);
  color: var(--cockpit-body);
  font: inherit;
  padding: 10px;
  text-align: left;
}
.cockpit-editor-feed article > div,
.cockpit-editor-history-list button > span {
  display: grid;
  min-width: 0;
  gap: 3px;
}
.cockpit-editor-feed strong,
.cockpit-editor-history-list strong {
  color: var(--cockpit-secondary);
  font-size: 10px;
  text-transform: capitalize;
}
.cockpit-editor-history-list strong {
  text-transform: none;
  overflow-wrap: anywhere;
}
.cockpit-editor-feed span,
.cockpit-editor-history-list small {
  color: var(--cockpit-muted);
  font-size: 10px;
}
.cockpit-editor-history-list button.is-active {
  border-color: var(--cockpit-accent-border);
  background: var(--cockpit-accent-tint);
}
.cockpit-editor-history-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}
.cockpit-editor-history-actions button {
  align-items: center;
  justify-content: center;
  border-color: var(--cockpit-border-strong);
  background: var(--cockpit-surface);
  font-size: 10px;
  font-weight: 700;
}
.cockpit-editor-history-list button:disabled {
  cursor: not-allowed;
  opacity: 0.65;
}
.cockpit-editor-history-list button.is-loading {
  cursor: wait;
}
.cockpit-editor-history-notice {
  position: sticky;
  top: 0;
  z-index: 2;
  margin: 0;
  border: 1px solid var(--cockpit-accent-border);
  border-radius: 8px;
  background: var(--cockpit-surface);
  color: var(--cockpit-body);
  font-size: 10px;
  line-height: 1.45;
  padding: 9px 10px;
  box-shadow: var(--cockpit-shadow-small);
}
@media (max-width: 760px) {
  .cockpit-editor-document {
    padding: 18px 16px !important;
  }

  .cockpit-editor-root .loro-editor {
    padding-inline: 0;
  }

  .cockpit-editor-root .loro-editor [data-testid='editor-main'] {
    padding-left: 16px;
    font-size: 17px;
  }
}
/* Author home workbench (cockpit + alternative-dashboard flags only). */
.cockpit-workbench {
  min-height: 100%;
  padding: 34px 36px 44px;
  background: var(--cockpit-canvas);
  color: var(--cockpit-text);
}
.cockpit-workbench__header,
.cockpit-workbench__week-heading,
.cockpit-workbench__section-heading,
.cockpit-workbench__actions,
.cockpit-workbench__resume-actions,
.cockpit-workbench__footer,
.cockpit-workbench__week-heading > div {
  display: flex;
  align-items: center;
}
.cockpit-workbench__header {
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}
.cockpit-workbench__header p,
.cockpit-workbench__resume > p,
.cockpit-workbench__section-heading,
.cockpit-workbench__week-heading span,
.cockpit-workbench__footer > span {
  margin: 0;
  color: var(--cockpit-muted);
  font-family: var(--cockpit-font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}
.cockpit-workbench__header h1 {
  margin: 4px 0 0;
  font-family: var(--cockpit-font-prose);
  font-size: clamp(34px, 4vw, 49px);
  font-weight: 650;
  letter-spacing: -0.035em;
  line-height: 1.05;
}
.cockpit-workbench__actions,
.cockpit-workbench__resume-actions {
  gap: 10px;
}
.cockpit-workbench__actions button,
.cockpit-workbench__resume-actions button,
.cockpit-workbench__loading button,
.cockpit-goals-dialog button {
  min-height: 42px;
  border-color: var(--cockpit-border-strong);
  background: var(--cockpit-surface);
  color: var(--cockpit-text);
  box-shadow: none;
}
.cockpit-workbench__resume-actions button:first-child,
.cockpit-goals-dialog button[type='submit'] {
  border-color: var(--cockpit-accent);
  background: var(--cockpit-accent);
  color: #fff;
}
.cockpit-workbench__actions button:last-child {
  border-color: var(--cockpit-accent-border);
  background: var(--cockpit-accent-tint);
  color: var(--cockpit-accent-strong-text);
}
.cockpit-workbench__actions button:hover,
.cockpit-workbench__resume-actions button:hover,
.cockpit-goals-dialog button:hover {
  background: var(--cockpit-fill);
  color: var(--cockpit-text);
}
.cockpit-workbench__resume-actions button:first-child:hover,
.cockpit-goals-dialog button[type='submit']:hover {
  background: var(--cockpit-accent-fill-hover);
  color: #fff;
}
.cockpit-workbench__actions button:last-child:hover {
  border-color: var(--cockpit-accent);
  background: var(--cockpit-accent-tint-strong);
  color: var(--cockpit-accent-strong-text);
}
.cockpit-workbench__top-grid,
.cockpit-workbench__lower-grid {
  display: grid;
  gap: 22px;
}
.cockpit-workbench__top-grid {
  grid-template-columns: minmax(0, 1.55fr) minmax(340px, 1fr);
}
.cockpit-workbench__resume,
.cockpit-workbench__attention,
.cockpit-workbench__panel,
.cockpit-workbench__footer {
  border: 1px solid var(--cockpit-border);
  border-radius: 14px;
  background: var(--cockpit-surface-subtle);
}
.cockpit-workbench__resume {
  min-height: 310px;
  padding: 34px 36px;
  border-color: var(--cockpit-accent-border);
  background:
    linear-gradient(135deg, var(--cockpit-accent-tint), transparent 65%),
    var(--cockpit-surface-subtle);
}
.cockpit-workbench__resume h2 {
  margin: 18px 0 8px;
  font-family: var(--cockpit-font-ui);
  font-size: clamp(24px, 2.2vw, 32px);
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.2;
}
.cockpit-workbench__resume-meta,
.cockpit-workbench__resume blockquote,
.cockpit-workbench__metric > span,
.cockpit-workbench__metric > small,
.cockpit-workbench__attention small,
.cockpit-workbench__recent small,
.cockpit-workbench__week-heading small,
.cockpit-workbench__footer small {
  color: var(--cockpit-muted);
}
.cockpit-workbench__resume blockquote {
  max-width: 760px;
  margin: 24px 0 28px;
  font-family: var(--cockpit-font-prose);
  font-size: 18px;
  line-height: 1.55;
}
.cockpit-workbench__attention {
  padding: 28px 26px;
}
.cockpit-workbench__section-heading {
  justify-content: space-between;
  min-height: 28px;
}
.cockpit-workbench__section-heading b {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 99px;
  background: var(--cockpit-warning-bg);
  color: var(--cockpit-warning);
  font-family: var(--cockpit-font-ui);
  font-size: 13px;
  letter-spacing: 0;
}
.cockpit-workbench__attention > a {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-height: 74px;
  margin-top: 14px;
  padding: 14px 16px;
  border: 1px solid var(--cockpit-border);
  border-radius: 11px;
  color: var(--cockpit-text);
  text-decoration: none;
}
.cockpit-workbench__attention > a:hover {
  border-color: var(--cockpit-accent-border);
  background: var(--cockpit-accent-tint);
}
.cockpit-workbench__attention > a > i {
  color: var(--cockpit-accent-text);
  font-style: normal;
}
.cockpit-workbench__attention > a > span {
  display: grid;
  gap: 3px;
  min-width: 0;
}
.cockpit-workbench__attention strong,
.cockpit-workbench__attention small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cockpit-workbench__attention em {
  color: var(--cockpit-accent-text);
  font-size: 13px;
  font-style: normal;
  font-weight: 650;
}
.cockpit-workbench__week {
  margin-top: 22px;
  padding: 26px 36px 30px;
}
.cockpit-workbench__week-heading {
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}
.cockpit-workbench__week-heading > div {
  gap: 16px;
}
.cockpit-workbench__week-heading b {
  border-radius: 99px;
  padding: 4px 12px;
  background: var(--cockpit-warning-bg);
  color: var(--cockpit-warning);
  font-size: 12px;
}
.cockpit-workbench__week-heading button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  background: transparent;
  color: var(--cockpit-accent-text);
  font-size: 12px;
  font-weight: 650;
}
.cockpit-workbench__week-grid {
  display: grid;
  grid-template-columns: 1.55fr 1fr 1fr 1fr;
}
.cockpit-workbench__metric {
  min-width: 0;
  padding: 4px 30px;
  border-left: 1px solid var(--cockpit-border);
}
.cockpit-workbench__metric:first-child {
  padding-left: 0;
  border-left: 0;
}
.cockpit-workbench__metric:last-child {
  padding-right: 0;
}
.cockpit-workbench__metric {
  display: grid;
  align-content: start;
  gap: 10px;
}
.cockpit-workbench__metric strong {
  font-size: clamp(27px, 2.5vw, 38px);
  line-height: 1;
}
.cockpit-workbench__metric--hero strong {
  font-size: clamp(34px, 3.2vw, 48px);
}
.cockpit-workbench__metric strong small {
  color: var(--cockpit-muted);
  font-size: 13px;
  font-weight: 500;
}
.cockpit-workbench__metric > small.is-positive {
  color: var(--cockpit-success-text);
}
.cockpit-workbench__progress {
  height: 7px;
  overflow: hidden;
  border-radius: 99px;
  background: var(--cockpit-fill);
  box-shadow: inset 0 0 0 1px var(--cockpit-track-edge);
}
.cockpit-workbench__progress i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--cockpit-accent);
}
.cockpit-workbench__progress i[data-met='true'] {
  background: var(--cockpit-success);
}
.cockpit-workbench__bars {
  display: flex;
  align-items: end;
  gap: 5px;
  height: 36px;
}
.cockpit-workbench__bars > span {
  position: relative;
  flex: 1;
  min-width: 5px;
  height: 100%;
  border-radius: 3px;
  background: repeating-linear-gradient(
    to bottom,
    var(--cockpit-track-edge) 0 1px,
    transparent 1px 4px
  );
}
.cockpit-workbench__bars i {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  border-radius: 3px 3px 1px 1px;
  background: var(--cockpit-accent);
}
.cockpit-workbench__bars i[data-negative='true'] {
  background: var(--cockpit-danger);
}
.cockpit-workbench__bar-days {
  display: flex;
  gap: 5px;
  margin-top: 6px;
}
.cockpit-workbench__bar-days span {
  flex: 1;
  min-width: 5px;
  color: var(--cockpit-faint);
  font-family: var(--cockpit-font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-align: center;
}
.cockpit-workbench__bar-days span[data-current='true'] {
  color: var(--cockpit-accent-text);
}
.cockpit-workbench__lower-grid {
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 1fr);
  margin-top: 22px;
}
.cockpit-workbench__activity,
.cockpit-workbench__recent {
  min-height: 270px;
  padding: 28px 34px;
}
.cockpit-workbench__legend {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--cockpit-muted);
  font-family: var(--cockpit-font-ui);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}
.cockpit-workbench__legend i,
.cockpit-workbench__heatmap i {
  display: block;
  border-radius: 3px;
  background: var(--cockpit-fill);
}
.cockpit-workbench__legend i {
  width: 13px;
  height: 13px;
}
.cockpit-workbench__activity-chart {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  -moz-column-gap: 8px;
       column-gap: 8px;
  margin-top: 28px;
}
.cockpit-workbench__weekdays {
  display: grid;
  grid-template-rows: repeat(7, 13px);
  gap: 5px;
  color: var(--cockpit-muted);
  font-family: var(--cockpit-font-ui);
  font-size: 10px;
  line-height: 13px;
}
.cockpit-workbench__heatmap {
  display: grid;
  grid-auto-flow: column;
  grid-template-rows: repeat(7, 13px);
  grid-auto-columns: 13px;
  gap: 5px;
  overflow-x: auto;
  padding-bottom: 4px;
}
.cockpit-workbench__months {
  grid-column: 2;
  display: grid;
  grid-template-columns: repeat(12, 13px);
  gap: 5px;
  min-width: 211px;
  margin-top: 8px;
  color: var(--cockpit-muted);
  font-family: var(--cockpit-font-ui);
  font-size: 10px;
  line-height: 1;
}
.cockpit-workbench__heatmap i[data-level='1'],
.cockpit-workbench__legend i[data-level='1'] {
  background: color-mix(
    in srgb,
    var(--cockpit-accent) 24%,
    var(--cockpit-fill)
  );
}
.cockpit-workbench__heatmap i[data-level='2'],
.cockpit-workbench__legend i[data-level='2'] {
  background: color-mix(
    in srgb,
    var(--cockpit-accent) 48%,
    var(--cockpit-fill)
  );
}
.cockpit-workbench__heatmap i[data-level='3'],
.cockpit-workbench__legend i[data-level='3'] {
  background: color-mix(
    in srgb,
    var(--cockpit-accent) 72%,
    var(--cockpit-fill)
  );
}
.cockpit-workbench__heatmap i[data-level='4'],
.cockpit-workbench__legend i[data-level='4'] {
  background: var(--cockpit-accent);
}
.cockpit-workbench__recent > a {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  margin-top: 18px;
  color: var(--cockpit-text);
  text-decoration: none;
}
.cockpit-workbench__recent > a > i {
  width: 8px;
  height: 8px;
  margin-top: 7px;
  border-radius: 99px;
  background: var(--cockpit-faint);
}
.cockpit-workbench__recent > a > i[data-kind='transcript_placed'] {
  background: var(--cockpit-accent);
}
.cockpit-workbench__recent > a > i[data-kind='recording_added'] {
  background: var(--cockpit-success);
}
.cockpit-workbench__recent > a > span {
  display: grid;
  gap: 2px;
}
.cockpit-workbench__footer {
  gap: 30px;
  margin-top: 22px;
  padding: 18px 26px;
}
.cockpit-workbench__footer a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--cockpit-accent-text);
  text-decoration: none;
}
.cockpit-workbench__footer small {
  margin-left: auto;
}
.cockpit-workbench__empty {
  display: grid;
  justify-items: start;
  gap: 8px;
  margin-top: 46px;
  color: var(--cockpit-muted);
}
.cockpit-workbench__empty strong {
  color: var(--cockpit-text);
}
.cockpit-workbench__empty--compact {
  margin-top: 28px;
}
.cockpit-workbench__loading {
  display: flex;
  min-height: 65vh;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: var(--cockpit-canvas);
  color: var(--cockpit-secondary);
}
.cockpit-workbench__upload-host > .w-full > .cockpit-audio-dropzone {
  display: none;
}
.cockpit-workbench__upload-host > .w-full > :not(.cockpit-audio-dropzone) {
  margin-top: 22px;
}
.cockpit-workbench__upload-host--top > .w-full > :not(.cockpit-audio-dropzone) {
  margin: 0 0 22px;
}
.cockpit-goals-dialog {
  border-color: var(--cockpit-border);
  background: var(--cockpit-surface);
  color: var(--cockpit-text);
  font-family: var(--cockpit-font-ui);
}
.cockpit-goals-dialog [data-slot='dialog-description'],
.cockpit-goals-dialog__status {
  color: var(--cockpit-muted);
}
.cockpit-goals-dialog__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-top: 24px;
}
.cockpit-goals-dialog__grid label {
  display: grid;
  gap: 7px;
  color: var(--cockpit-secondary);
  font-size: 13px;
  font-weight: 650;
}
.cockpit-goals-dialog__grid small {
  color: var(--cockpit-muted);
  font-size: 11.5px;
  font-weight: 400;
}
.cockpit-goals-dialog__grid input,
.cockpit-goals-dialog__grid select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--cockpit-border-strong);
  border-radius: 8px;
  padding: 0 11px;
  background: var(--cockpit-surface-subtle);
  color: var(--cockpit-text);
}
.cockpit-goals-dialog__error {
  margin: 16px 0 0;
  color: var(--cockpit-danger);
  font-size: 13px;
}
@media (max-width: 1180px) {
  .cockpit-workbench__top-grid,
  .cockpit-workbench__lower-grid {
    grid-template-columns: 1fr;
  }
  .cockpit-workbench__week-grid {
    grid-template-columns: 1fr 1fr;
    row-gap: 28px;
  }
  .cockpit-workbench__metric:nth-child(3) {
    padding-left: 0;
    border-left: 0;
  }
}
@media (max-width: 760px) {
  .cockpit-workbench {
    padding: 66px 14px 34px;
  }
  .cockpit-workbench__header,
  .cockpit-workbench__week-heading,
  .cockpit-workbench__footer {
    align-items: flex-start;
    flex-direction: column;
  }
  .cockpit-workbench__actions {
    width: 100%;
    flex-wrap: wrap;
  }
  .cockpit-workbench__actions button {
    flex: 1;
  }
  .cockpit-workbench__resume,
  .cockpit-workbench__attention,
  .cockpit-workbench__week,
  .cockpit-workbench__activity,
  .cockpit-workbench__recent {
    padding: 24px 20px;
  }
  .cockpit-workbench__week-grid,
  .cockpit-goals-dialog__grid {
    grid-template-columns: 1fr;
  }
  .cockpit-workbench__metric,
  .cockpit-workbench__metric:nth-child(n) {
    padding: 18px 0 0;
    border-top: 1px solid var(--cockpit-border);
    border-left: 0;
  }
  .cockpit-workbench__metric:first-child {
    padding-top: 0;
    border-top: 0;
  }
  .cockpit-workbench__footer small {
    margin-left: 0;
  }
}
/* Book overview */
.cockpit-overview {
  padding: 0 0 40px;
}
.cockpit-overview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 20px 30px 14px;
}
.cockpit-overview-header .cockpit-breadcrumbs {
  margin: 0 0 6px;
}
.cockpit-overview > .cockpit-book-tabs .cockpit-book-tabs__scroll {
  padding-inline: 30px;
}
.cockpit-overview-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 20px;
  padding: 22px 30px 0;
}
.cockpit-overview-main {
  min-width: 0;
}
.cockpit-overview-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.cockpit-overview-stats article,
.cockpit-overview-chapters,
.cockpit-overview-rail > section {
  border: 1px solid var(--cockpit-border);
  border-radius: 14px;
  background: var(--cockpit-surface);
}
.cockpit-overview-stats article {
  display: grid;
  gap: 5px;
  min-height: 104px;
  align-content: center;
  padding: 16px 18px;
}
.cockpit-overview-stats article > span,
.cockpit-overview-stats article > small {
  color: var(--cockpit-muted);
}
.cockpit-overview-stats article > span {
  font-size: 12.5px;
}
.cockpit-overview-stats article > strong {
  font-size: 26px;
  line-height: 1.05;
}
.cockpit-overview-stats article > small {
  font-size: 11.5px;
}
/* No overflow clipping here: it hid the chapter "…" menus below the card.
   The last row rounds its own corners instead. */
.cockpit-overview-chapters > div > article:last-child {
  border-bottom-left-radius: 13px;
  border-bottom-right-radius: 13px;
}
.cockpit-overview-chapters > header {
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 20px;
  border-bottom: 1px solid var(--cockpit-hairline);
}
.cockpit-overview-chapters > header > div {
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.cockpit-overview-chapters h2 {
  margin: 0;
  font-size: 15px;
}
.cockpit-overview-chapters header span {
  color: var(--cockpit-muted);
  font-size: 12px;
}
.cockpit-overview-chapters > div > article {
  display: flex;
  min-height: 66px;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  border-bottom: 1px solid var(--cockpit-hairline);
}
.cockpit-overview-chapters > div > article.is-dragged {
  background: var(--cockpit-accent-tint);
}
.cockpit-overview-chapter-drag {
  display: grid;
  width: 26px;
  height: 32px;
  flex: none;
  place-items: center;
  border: 0;
  background: transparent;
  color: var(--cockpit-faint);
}
.cockpit-overview-chapter-copy {
  display: grid;
  min-width: 0;
  flex: 1;
  gap: 4px;
  border: 0;
  background: transparent;
  color: var(--cockpit-text);
  text-align: left;
}
.cockpit-overview-chapter-copy strong {
  overflow: hidden;
  font-size: 14.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cockpit-overview-chapter-copy strong span {
  color: var(--cockpit-muted);
  font-weight: 400;
}
.cockpit-overview-chapter-copy small {
  color: var(--cockpit-muted);
  font-size: 12px;
}
.cockpit-review-pill {
  border-radius: 999px;
  background: var(--cockpit-accent-tint);
  color: var(--cockpit-accent-strong-text);
  font-family: var(--cockpit-font-mono);
  font-size: 10px;
  font-weight: 700;
  padding: 4px 9px;
}
.cockpit-overview-chapters__more {
  padding: 12px 20px;
  color: var(--cockpit-muted);
  font-size: 12.5px;
}
.cockpit-overview-rail {
  display: grid;
  align-content: start;
  gap: 12px;
}
.cockpit-overview-rail > section {
  padding: 18px 20px;
}
.cockpit-overview-rail h2 {
  margin: 0 0 14px;
  font-size: 15px;
}
.cockpit-week-bars {
  display: flex;
  height: 76px;
  align-items: end;
  gap: 7px;
}
.cockpit-week-bars span {
  flex: 1;
  border-radius: 4px 4px 2px 2px;
  background: var(--cockpit-accent-tint-strong);
}
.cockpit-week-bars span:last-child {
  background: var(--cockpit-accent);
}
.cockpit-week-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  color: var(--cockpit-muted);
  font-size: 11px;
}
.cockpit-canon-prompt {
  border-color: var(--cockpit-accent-border) !important;
  background: var(--cockpit-surface-accent) !important;
}
.cockpit-canon-prompt p,
.cockpit-recent-history p {
  margin: 0 0 12px;
  color: var(--cockpit-muted);
  font-size: 12.5px;
  line-height: 1.5;
}
.cockpit-canon-prompt a {
  color: var(--cockpit-accent-text);
  font-size: 12.5px;
  text-decoration: none;
}
.cockpit-recent-history {
  display: grid;
  gap: 4px;
}
.cockpit-recent-history button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 0;
  border: 0;
  background: transparent;
  color: var(--cockpit-secondary);
  text-align: left;
}
.cockpit-recent-history b {
  border-radius: 5px;
  background: var(--cockpit-accent-tint);
  color: var(--cockpit-accent-text);
  font-family: var(--cockpit-font-mono);
  font-size: 10px;
  padding: 2px 5px;
}
.cockpit-recent-history em {
  color: var(--cockpit-accent-text);
  font-size: 11.5px;
  font-style: normal;
}
@media (max-width: 1100px) {
  .cockpit-library .cockpit-filter-panel {
    grid-template-columns: minmax(220px, 1.5fr) 1fr 1fr auto;
  }
  .cockpit-library-view-toggle {
    grid-column: 1 / -1;
  }
  .cockpit-overview-layout {
    grid-template-columns: 1fr;
  }
  .cockpit-overview-rail {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 760px) {
  .cockpit-library,
  .cockpit-audio-inbox {
    padding: 66px 14px 40px;
  }
  .cockpit-home-announcement {
    margin: 66px 14px 0;
  }
  .cockpit-library .cockpit-page-header,
  .cockpit-audio-inbox .cockpit-page-header {
    margin: -66px -14px 18px;
    padding: 66px 14px 16px;
  }
  .cockpit-library .cockpit-filter-panel,
  .cockpit-audio-dropzone,
  .cockpit-overview-stats,
  .cockpit-overview-rail {
    grid-template-columns: 1fr;
  }
  .cockpit-library-view-toggle {
    justify-self: start;
  }
  .cockpit-library .cockpit-book-card {
    grid-template-columns: 1fr;
  }
  .cockpit-library .cockpit-book-card__actions {
    flex-direction: row;
    padding: 0 18px 16px;
  }
  .cockpit-library-grid.is-list .cockpit-book-card__actions > button {
    width: auto;
    min-width: 0;
    flex: 1 1 0;
  }
  .cockpit-audio-dropzone {
    justify-items: start;
  }
  .cockpit-audio-dropzone select {
    width: 100%;
  }
  .cockpit-audio-files-heading,
  .cockpit-overview-header {
    align-items: flex-start;
    flex-direction: column;
  }
  .cockpit-audio-files-heading > div:first-child {
    align-items: flex-start;
    flex-direction: column;
  }
  .cockpit-audio-inbox .cockpit-audio-card__main,
  .cockpit-audio-inbox .cockpit-audio-card__actions {
    flex-basis: 100%;
  }
  .cockpit-overview-header {
    padding-top: 66px;
  }
  .cockpit-overview-layout {
    padding-inline: 14px;
  }
  .cockpit-overview > .cockpit-book-tabs .cockpit-book-tabs__scroll {
    padding-inline: 14px;
  }
  .cockpit-review-pill {
    display: none;
  }
}
/* Honour reduced motion across cockpit pages, including portalled popovers
   and dialogs, Home animations and hover transitions. */
@media (prefers-reduced-motion: reduce) {
  html[data-bookscribe-cockpit-page] *,
  html[data-bookscribe-cockpit-page] *::before,
  html[data-bookscribe-cockpit-page] *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
/* Scrollbars (handoff spec): thin, 8px WebKit thumb on a transparent track,
   inset by a 2px transparent border, darkening on hover. Zero specificity (:where) so component rules that
   hide a scrollbar still win. */
:where(html[data-bookscribe-cockpit-page]) * {
  scrollbar-color: var(--cockpit-border-strong) transparent;
  scrollbar-width: thin;
}
:where(html[data-bookscribe-cockpit-page]) ::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
:where(html[data-bookscribe-cockpit-page]) ::-webkit-scrollbar-track {
  background: transparent;
}
:where(html[data-bookscribe-cockpit-page]) ::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background: var(--cockpit-border-strong);
  background-clip: content-box;
}
:where(html[data-bookscribe-cockpit-page]) ::-webkit-scrollbar-thumb:hover {
  background: var(--cockpit-faint);
  background-clip: content-box;
}
/* Import transcript (cockpit): the shared dialog's light-only utilities follow
   the workspace tokens. */
.import-transcript-dialog :is(.text-gray-500, .text-gray-700) {
  color: var(--cockpit-muted) !important;
}
.import-transcript-dialog :is(.border, .divide-y > *) {
  border-color: var(--cockpit-border) !important;
}
.import-transcript-dialog .hover\:bg-gray-50:hover {
  background: var(--cockpit-fill) !important;
}
.import-transcript-dialog .bg-indigo-50 {
  border-color: var(--cockpit-accent) !important;
  background: var(--cockpit-accent-tint) !important;
  color: var(--cockpit-text) !important;
}
