body.app-body {
  position: relative;
  isolation: isolate;
}

.app-body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 12% 10%, rgba(19, 91, 236, 0.11), transparent 24%),
    radial-gradient(circle at 88% 16%, rgba(94, 140, 255, 0.09), transparent 22%);
}

.page-shell {
  position: relative;
  z-index: 1;
  width: min(var(--content-width), calc(100vw - 72px));
  margin: 0 auto;
  padding: 24px 0 48px;
}

.page-shell.is-wide {
  box-sizing: border-box;
  width: 100vw;
  max-width: none;
  margin: 0;
  padding-right: 16px;
  padding-left: 16px;
}

.page-shell.is-piece-view {
  width: 100vw;
  max-width: none;
  margin: 0;
  padding: 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 18px;
  margin-bottom: 8px;
  min-height: 60px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-pill {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 8px 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--line-soft);
  color: var(--text-base);
  min-width: 0;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
  max-width: min(100%, 340px);
}

.user-pill strong,
.user-pill span {
  display: block;
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-pill strong {
  font-size: 14px;
}

.user-pill span {
  font-size: 12px;
  color: var(--text-muted);
}

.app-layout {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 32px;
  margin-top: 24px;
}

.app-layout.is-single-pane {
  grid-template-columns: 1fr;
  gap: 0;
  margin-top: 0;
}

.app-sidebar,
.app-main {
  min-width: 0;
}

.app-sidebar-card,
.surface-card {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-xl);
  background: var(--bg-panel);
  box-shadow: var(--shadow-md);
}

.app-sidebar-card {
  padding: 24px;
  position: sticky;
  top: 24px;
}

.nav-section-title {
  margin: 0 0 14px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.nav-list {
  display: grid;
  gap: 10px;
}

.nav-link {
  display: grid;
  gap: 6px;
  padding: 16px 18px;
  border-radius: 18px;
  text-decoration: none;
  border: 1px solid transparent;
  color: var(--text-base);
  transition: transform 140ms ease, border-color 140ms ease, background-color 140ms ease;
}

.nav-link:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.84);
  border-color: var(--line-soft);
}

.nav-link.is-active {
  background: linear-gradient(180deg, rgba(19, 91, 236, 0.14), rgba(19, 91, 236, 0.08));
  border-color: rgba(19, 91, 236, 0.2);
  color: var(--accent);
}

.nav-link strong {
  font-size: 17px;
}

.nav-link span {
  font-size: 14px;
  line-height: 1.4;
  color: var(--text-muted);
}

.nav-link.is-active span {
  color: rgba(19, 91, 236, 0.85);
}

.app-main {
  display: grid;
  gap: 20px;
}

.app-main.is-full-width {
  gap: 0;
}

.hero-card {
  padding: 28px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero-title {
  margin: 0;
  font-size: clamp(32px, 4.8vw, 52px);
  line-height: 1.02;
  letter-spacing: -0.03em;
}

.hero-text {
  margin: 16px 0 0;
  max-width: 64ch;
  color: var(--text-base);
  font-size: 17px;
  line-height: 1.6;
}

.hero-actions,
.inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
}

.button,
.ghost-button,
.subtle-button {
  appearance: none;
  border: 0;
  border-radius: 14px;
  padding: 13px 18px;
  cursor: pointer;
  text-decoration: none;
  transition: transform 140ms ease, filter 140ms ease, background-color 140ms ease, border-color 140ms ease;
}

.button {
  background: linear-gradient(135deg, var(--accent), #4f86ff);
  color: #fff;
  box-shadow: 0 14px 30px rgba(19, 91, 236, 0.24);
  font-weight: 700;
}

.button:hover,
.ghost-button:hover,
.subtle-button:hover {
  transform: translateY(-1px);
  filter: brightness(1.02);
}

.button:disabled,
.ghost-button:disabled,
.subtle-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  filter: none;
}

.ghost-button {
  background: var(--bg-panel-strong);
  border: 1px solid var(--line-base);
  color: var(--text-strong);
  font-weight: 600;
}

.subtle-button {
  background: rgba(19, 91, 236, 0.08);
  color: var(--accent);
  font-weight: 700;
}

.text-button {
  appearance: none;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--accent);
  font-weight: 700;
  cursor: pointer;
}

.grid-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.feature-card,
.placeholder-card {
  padding: 22px;
}

.feature-card h3,
.placeholder-card h3 {
  margin: 0 0 8px;
  font-size: 20px;
}

.feature-card p,
.placeholder-card p,
.muted-copy {
  margin: 0;
  color: var(--text-muted);
  line-height: 1.55;
}

.stack {
  display: grid;
  gap: 18px;
}

.panel {
  padding: 22px;
}

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.panel-title {
  margin: 0;
  font-size: 21px;
}

.panel-subtitle {
  margin: 6px 0 0;
  color: var(--text-muted);
  line-height: 1.5;
}

.label {
  display: grid;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-base);
}

.field,
.textarea,
.select {
  width: 100%;
  border-radius: 14px;
  border: 1px solid var(--line-base);
  background: #fff;
  color: var(--text-strong);
  padding: 14px 15px;
  outline: none;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

input[list].field {
  background: #fff;
}

.textarea {
  min-height: 112px;
  resize: vertical;
}

.field:focus,
.textarea:focus,
.select:focus {
  border-color: rgba(19, 91, 236, 0.42);
  box-shadow: 0 0 0 4px rgba(19, 91, 236, 0.12);
}

.split-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 999px;
  background: var(--bg-accent-soft);
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
}

.status-note {
  padding: 14px 16px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.5;
}

.status-note.is-success {
  background: var(--success-soft);
  color: var(--success);
}

.status-note.is-warning {
  background: var(--warning-soft);
  color: var(--warning);
}

.status-note.is-danger {
  background: var(--danger-soft);
  color: var(--danger);
}

.empty-state {
  padding: 34px 22px;
  border: 1px dashed var(--line-base);
  border-radius: 20px;
  text-align: center;
  color: var(--text-muted);
}

.toolbar-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.toolbar-row > .label {
  flex: 1 1 260px;
}

.toolbar-row > .label.is-compact {
  flex: 0 1 220px;
}

.list-stack {
  display: grid;
  gap: 12px;
}

.list-item-card {
  padding: 18px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--line-soft);
}

.list-item-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.list-item-title {
  margin: 0;
  font-size: 19px;
}

.list-item-copy {
  margin: 6px 0 0;
  color: var(--text-muted);
  line-height: 1.5;
}

.list-item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.library-index-wrap {
  margin-top: 14px;
}

.library-index-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.library-index-button {
  appearance: none;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.84);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.library-index-button.is-active {
  border-color: rgba(19, 91, 236, 0.18);
  background: rgba(19, 91, 236, 0.08);
  color: var(--accent);
}

.library-index-button.is-active:hover {
  border-color: rgba(19, 91, 236, 0.26);
  color: var(--accent);
}

.library-index-button:disabled {
  opacity: 0.34;
  cursor: default;
}

.library-sections {
  display: grid;
  gap: 10px;
}

.library-list-stack {
  border-top: 1px solid rgba(148, 163, 184, 0.18);
  background: transparent;
}

.library-section {
  display: grid;
  gap: 0;
}

.library-section-header {
  position: sticky;
  top: 12px;
  z-index: 2;
  display: block;
  width: 100%;
  padding: 9px 14px;
  background: rgba(243, 245, 248, 0.95);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.04);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
}

.meta-pill.is-favorite {
  background: rgba(19, 91, 236, 0.1);
  color: var(--accent);
}

.meta-pill.is-success {
  background: var(--success-soft);
  color: var(--success);
}

.meta-pill.is-warning {
  background: var(--warning-soft);
  color: var(--warning);
}

.meta-pill.is-danger {
  background: var(--danger-soft);
  color: var(--danger);
}

.library-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 13px 14px;
  background: transparent;
}

.library-row + .library-row {
  border-top: 1px solid rgba(148, 163, 184, 0.18);
}

.library-row-main {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.library-row-open {
  appearance: none;
  border: 0;
  padding: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.library-row-open:hover .library-row-title {
  color: var(--accent);
}

.library-row-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.library-row-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.library-row-title {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.25;
}

.library-inline-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #dc2626;
  font-size: 14px;
  line-height: 1;
}

.library-status-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.04);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 800;
}

.library-status-icon.is-success {
  background: var(--success-soft);
  color: var(--success);
}

.library-status-icon.is-warning {
  background: var(--warning-soft);
  color: var(--warning);
}

.library-status-icon.is-danger {
  background: var(--danger-soft);
  color: var(--danger);
}

.library-row-subtitle {
  margin: 0;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.35;
}

.library-row-notes {
  margin: 0;
  color: var(--text-muted);
  line-height: 1.45;
}

.library-row-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.library-row-action {
  appearance: none;
  border: 0;
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--accent);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.library-row-action-icon {
  width: 18px;
  height: 18px;
  display: block;
}

.library-row-action.is-danger {
  color: var(--danger);
}

.ghost-button.is-danger,
.button.is-danger,
.subtle-button.is-danger {
  border-color: rgba(220, 38, 38, 0.22);
  color: var(--danger);
}

.button.is-danger {
  background: rgba(220, 38, 38, 0.1);
}

.library-dialog-overlay {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 28px;
}

.library-dialog-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(15, 23, 42, 0.48);
  cursor: pointer;
}

.library-dialog {
  position: relative;
  z-index: 1;
  width: min(840px, calc(100vw - 40px));
  max-height: calc(100vh - 40px);
  overflow: auto;
  padding: 24px;
  border-radius: 28px;
  border: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 26px 80px rgba(15, 23, 42, 0.22);
}

.replacement-handling-dialog {
  width: min(620px, calc(100vw - 40px));
}

.replacement-handling-dialog h2 {
  margin: 0 0 8px;
}

.replacement-handling-options {
  display: grid;
  gap: 10px;
  margin: 22px 0;
  padding: 0;
  border: 0;
}

.replacement-handling-options label {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: start;
  padding: 14px;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  cursor: pointer;
}

.replacement-handling-options span,
.replacement-handling-scope {
  display: grid;
  gap: 5px;
}

.replacement-handling-options small {
  color: var(--text-muted);
}

.replacement-handling-actions {
  justify-content: flex-end;
  margin-top: 22px;
}

.library-flat-panel {
  border-radius: 18px;
  box-shadow: none;
}

.library-flat-panel .toolbar-row {
  padding: 0;
}

.library-flat-panel .field,
.library-flat-panel .select {
  border-radius: 10px;
  background: rgba(243, 245, 248, 0.95);
}

.piece-page {
  display: grid;
  gap: 0;
}

.piece-viewer-panel {
  padding: 0;
  overflow: hidden;
  min-height: 100vh;
  border-radius: 0;
  border-left: 0;
  border-right: 0;
}

.piece-loading-state,
.piece-stage-message {
  display: grid;
  place-items: center;
  min-height: 260px;
  color: var(--text-muted);
  font-size: 15px;
  text-align: center;
}

.piece-viewer-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 322px;
  min-height: 100vh;
}

.piece-viewer-layout.is-sidebar-collapsed {
  grid-template-columns: minmax(0, 1fr);
}

.piece-viewer-main {
  min-width: 0;
  height: 100vh;
  overflow: hidden;
  border-right: 1px solid rgba(148, 163, 184, 0.16);
  background: #fff;
  position: relative;
}

.piece-viewer-layout.is-sidebar-collapsed .piece-viewer-main {
  border-right: 0;
}

.piece-stage {
  position: relative;
  display: block;
  min-width: 0;
  overflow: auto;
  height: 100vh;
  min-height: 100vh;
  padding: 0;
  background: #fff;
}

.piece-stage.is-paging {
  overflow-x: hidden;
  overflow-y: auto;
}

.piece-canvas-shell {
  width: 100%;
  min-height: 100vh;
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 18px;
  padding: 84px 18px 24px;
}

.piece-stage.is-width .piece-canvas-shell {
  justify-items: stretch;
}

.piece-stage.is-height .piece-canvas-shell {
  justify-items: center;
}

.piece-stage.is-paging .piece-canvas-shell {
  min-height: 100%;
  padding-bottom: 20px;
  align-content: start;
}

.piece-canvas-frame {
  display: inline-block;
  vertical-align: top;
  background: #fff;
}

.piece-rendered-page {
  display: block;
  width: 100%;
}

.piece-stage.is-width .piece-rendered-page {
  width: 100%;
}

.piece-stage.is-height .piece-rendered-page {
  width: auto;
}

.piece-rendered-page-track {
  display: inline-flex;
  align-items: flex-start;
  gap: 14px;
}

.piece-stage.is-width .piece-rendered-page-track {
  width: 100%;
  justify-content: center;
}

.piece-rendered-page-frame {
  display: inline-block;
  vertical-align: top;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.08);
}

.piece-pdf-canvas {
  display: block;
  background: #fff;
}

.piece-floating-toolbar {
  position: sticky;
  top: 14px;
  left: 18px;
  right: 18px;
  z-index: 4;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  opacity: 1;
  pointer-events: auto;
}

.piece-floating-toolbar.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.piece-floating-toolbar-right {
  display: flex;
  gap: 10px;
}

.piece-floating-button {
  appearance: none;
  width: 52px;
  height: 52px;
  border: 0;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(92, 92, 92, 0.86);
  color: #fff;
  font-size: 22px;
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.22);
}

.piece-display-menu {
  position: absolute;
  top: 62px;
  right: 0;
  width: min(292px, calc(100vw - 64px));
  padding: 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(148, 163, 184, 0.2);
  box-shadow: 0 22px 48px rgba(15, 23, 42, 0.24);
}

.piece-display-menu-item {
  appearance: none;
  width: 100%;
  border: 0;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 12px;
  border-radius: 12px;
  color: var(--text-strong);
  font-size: 17px;
  text-align: left;
  cursor: pointer;
}

.piece-display-menu-item.is-selected {
  background: rgba(15, 23, 42, 0.05);
}

.piece-display-menu-item.is-disabled {
  opacity: 0.38;
  cursor: default;
}

.piece-display-menu-item strong {
  color: #94627d;
}

.piece-display-menu-divider {
  height: 1px;
  background: rgba(148, 163, 184, 0.25);
  margin: 4px 0;
}

.piece-page-arrow-rail {
  position: sticky;
  top: calc(50vh - 26px);
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  margin-top: -8px;
  pointer-events: none;
}

.piece-page-arrow {
  width: 52px;
  height: 52px;
  border: 0;
  border-radius: 50%;
  background: rgba(196, 224, 255, 0.82);
  color: #234a87;
  font-size: 30px;
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.16);
  backdrop-filter: blur(10px);
  pointer-events: auto;
}

.piece-page-arrow-placeholder {
  width: 52px;
  height: 52px;
  display: block;
}

.piece-page-pill {
  position: absolute;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  z-index: 3;
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(30, 41, 59, 0.78);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
}

.piece-sidebar {
  display: grid;
  align-content: start;
  gap: 0;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  background: rgba(255, 255, 255, 0.98);
}

.piece-viewer-layout.is-sidebar-collapsed .piece-sidebar {
  display: none;
}

.piece-side-section + .piece-side-section {
  border-top: 1px solid rgba(148, 163, 184, 0.16);
}

.piece-side-section {
  display: grid;
  gap: 14px;
  padding: 22px 18px;
}

.piece-side-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.piece-side-header h3 {
  margin: 0;
  font-size: 22px;
}

.piece-side-header span {
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 700;
}

.piece-side-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.piece-part-list {
  display: grid;
  gap: 8px;
  padding: 6px 0 0;
}

.piece-part-drop-hint {
  padding: 12px 14px;
  border: 1px dashed rgba(148, 163, 184, 0.28);
  border-radius: 12px;
  color: var(--text-muted);
  font-size: 13px;
  text-align: center;
}

.piece-part-list.is-drop-active {
  outline: 2px dashed rgba(19, 91, 236, 0.34);
  outline-offset: 8px;
  border-radius: 18px;
}

.piece-part-insert-slot {
  position: relative;
  display: grid;
  place-items: center;
  height: 14px;
  margin: -2px 0;
  pointer-events: auto;
}

.piece-part-insert-line {
  width: 100%;
  height: 2px;
  border-radius: 999px;
  background: transparent;
  transition: background 160ms ease, transform 160ms ease;
}

.piece-part-insert-label {
  position: absolute;
  top: 50%;
  left: 14px;
  transform: translateY(-50%);
  padding: 2px 8px;
  border-radius: 999px;
  background: transparent;
  color: transparent;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.01em;
  pointer-events: none;
  transition: background 160ms ease, color 160ms ease;
}

.piece-part-insert-slot.is-active .piece-part-insert-line {
  background: rgba(19, 91, 236, 0.48);
  transform: scaleY(1.5);
}

.piece-part-insert-slot.is-active.is-file .piece-part-insert-line {
  background: rgba(16, 185, 129, 0.5);
}

.piece-part-insert-slot.is-active .piece-part-insert-label {
  background: rgba(255, 255, 255, 0.96);
  color: var(--text-base);
}

.piece-part-button {
  appearance: none;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 12px;
  background: transparent;
  color: var(--text-base);
  text-align: left;
  padding: 12px 14px;
  cursor: grab;
}

.piece-part-button-row,
.piece-part-rename-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.piece-part-rename-row {
  grid-template-columns: minmax(0, 1fr) auto auto;
}

.piece-part-select-button {
  display: block;
  min-width: 0;
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  text-align: left;
}

.piece-part-edit-button,
.piece-part-rename-row .icon-button {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--text-muted);
  cursor: pointer;
}

.piece-part-edit-button:hover,
.piece-part-rename-row .icon-button:hover {
  color: var(--accent);
  border-color: rgba(19, 91, 236, 0.22);
}

.piece-part-edit-button svg {
  width: 17px;
  height: 17px;
}

.piece-part-rename-row .icon-button.is-confirm {
  color: var(--accent);
}

.piece-part-rename-field {
  min-height: 38px;
  padding: 8px 10px;
  border-radius: 10px;
}

.piece-part-button.is-active {
  border-color: rgba(19, 91, 236, 0.25);
  background: rgba(19, 91, 236, 0.1);
}

.piece-part-button.is-replace-target {
  border-color: rgba(19, 91, 236, 0.42);
  background: rgba(19, 91, 236, 0.14);
  box-shadow: 0 0 0 3px rgba(19, 91, 236, 0.12);
}

.piece-part-button.is-dragging {
  opacity: 0.44;
  cursor: grabbing;
}

.piece-part-button-name,
.piece-part-button-meta {
  display: block;
}

.piece-part-button-name {
  font-size: 15px;
  font-weight: 700;
}

.piece-part-button-meta {
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 12px;
}

.piece-inline-form {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 14px;
  background: rgba(243, 245, 248, 0.75);
}

.piece-dropzone {
  display: grid;
  gap: 6px;
  padding: 16px;
  border: 1px dashed rgba(19, 91, 236, 0.28);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--text-muted);
}

.piece-dropzone strong {
  color: var(--text-strong);
}

.piece-dropzone.is-active {
  border-color: rgba(19, 91, 236, 0.58);
  background: rgba(19, 91, 236, 0.08);
}

.piece-draft-list {
  display: grid;
  gap: 10px;
}

.piece-draft-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.88);
}

.piece-draft-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--text-muted);
  font-size: 13px;
}

.piece-inline-form-actions,
.piece-inline-form-submit {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.piece-inline-file-name {
  color: var(--text-muted);
  font-size: 13px;
}

.piece-inline-progress {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
}

.piece-inline-spinner {
  width: 15px;
  height: 15px;
  border-radius: 999px;
  border: 2px solid rgba(19, 91, 236, 0.18);
  border-top-color: rgba(19, 91, 236, 0.88);
  animation: piece-inline-spin 0.8s linear infinite;
}

@keyframes piece-inline-spin {
  to {
    transform: rotate(360deg);
  }
}

.piece-media-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 14px;
  background: rgba(243, 245, 248, 0.72);
}

.piece-media-card strong,
.piece-media-card p {
  margin: 0;
}

.piece-media-card p,
.piece-empty-copy {
  color: var(--text-muted);
  line-height: 1.45;
}

.piece-media-card-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.library-title-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.library-title-count {
  color: var(--text-muted);
  font-size: 15px;
  font-weight: 600;
}

.library-dialog.is-compact {
  width: min(560px, calc(100vw - 40px));
}

.login-wrap {
  position: relative;
  z-index: 1;
  width: min(1120px, calc(100vw - 32px));
  margin: 0 auto;
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(360px, 440px);
  gap: 28px;
  align-items: center;
  padding: 24px 0;
}

.login-showcase,
.login-card {
  border: 1px solid var(--line-soft);
  border-radius: 32px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow-lg);
}

.login-showcase {
  padding: 34px;
  min-height: 720px;
  display: grid;
  align-content: space-between;
  overflow: hidden;
}

.login-card {
  padding: 28px;
}

.hero-preview {
  margin-top: 26px;
  padding: 22px;
  border-radius: 28px;
  background:
    radial-gradient(circle at top right, rgba(19, 91, 236, 0.12), transparent 30%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(237, 242, 249, 0.94));
  border: 1px solid rgba(148, 163, 184, 0.18);
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 20px;
}

.metric {
  padding: 16px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.16);
}

.metric strong,
.metric span {
  display: block;
}

.metric strong {
  font-size: 24px;
}

.metric span {
  margin-top: 6px;
  color: var(--text-muted);
  font-size: 13px;
}

.form-stack {
  display: grid;
  gap: 14px;
}

.login-brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
}

.login-brand img {
  width: 52px;
  height: 52px;
  border-radius: 14px;
}

.helper-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.text-link {
  border: 0;
  padding: 0;
  background: none;
  color: var(--accent);
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
}

.ghost-button.is-danger,
.subtle-button.is-danger {
  color: #c53030;
  border: 1px solid rgba(197, 48, 48, 0.16);
  background: rgba(255, 255, 255, 0.94);
}

.ensemble-list,
.ensemble-member-list,
.ensemble-managed-list,
.ensemble-summary-stack,
.ensemble-setlist-list,
.ensemble-setlist-entry-list,
.ensemble-selection-list {
  display: grid;
  gap: 14px;
}

.ensemble-overview-title,
.ensemble-dashboard-identity,
.ensemble-row-title-wrap {
  display: flex;
  align-items: center;
  min-width: 0;
}

.ensemble-overview-title {
  gap: 16px;
}

.ensemble-app-logo {
  width: 54px;
  height: 54px;
  flex: 0 0 auto;
  border-radius: 15px;
  object-fit: cover;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.12);
}

.ensemble-dashboard-identity {
  gap: 20px;
}

.ensemble-dashboard-logo {
  width: 72px;
  height: 72px;
  flex: 0 0 auto;
  border-radius: 20px;
  object-fit: cover;
  background: rgba(246, 248, 252, 0.9);
  box-shadow: 0 18px 34px rgba(15, 23, 42, 0.12);
}

.ensemble-row-title-wrap {
  gap: 13px;
}

.ensemble-row-logo {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border-radius: 11px;
  object-fit: cover;
  box-shadow: 0 10px 18px rgba(15, 23, 42, 0.1);
}

.ensemble-row,
.ensemble-member-row,
.ensemble-managed-row,
.ensemble-setlist-row,
.ensemble-entry-row {
  width: 100%;
  border: 1px solid var(--line-soft);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.94);
  text-align: left;
}

.ensemble-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  padding: 18px 20px;
  cursor: pointer;
}

.ensemble-row-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-base);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ensemble-row-meta,
.ensemble-managed-copy span,
.ensemble-managed-copy small,
.ensemble-member-copy span,
.ensemble-mini-row span,
.ensemble-static-role {
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.45;
}

.ensemble-row-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
}

.ensemble-row-side {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ensemble-inline-badge {
  display: inline-flex;
  align-items: center;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(19, 91, 236, 0.1);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
}

.ensemble-chevron {
  font-size: 24px;
  color: var(--text-faint);
}

.ensemble-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.ensemble-header-panel {
  padding: 32px;
}

.ensemble-dashboard-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: start;
}

.ensemble-dashboard-title {
  min-width: 0;
}

.ensemble-dashboard-title .panel-title {
  font-size: clamp(44px, 4vw, 66px);
  line-height: 1.02;
}

.ensemble-role-line {
  margin: 12px 0 0;
  color: var(--text-muted);
  font-size: 18px;
  font-weight: 650;
}

.ensemble-role-line strong {
  color: var(--text-base);
  font-weight: 800;
}

.ensemble-dashboard-action-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  margin-top: 22px;
  padding-top: 22px;
  border-top: 1px solid rgba(148, 163, 184, 0.16);
}

.ensemble-dashboard-action-bar .button,
.ensemble-dashboard-action-bar .ghost-button {
  min-height: 48px;
  padding-inline: 22px;
  font-size: 16px;
}

.ensemble-dashboard-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
  margin-top: 30px;
}

.ensemble-dashboard-metric {
  padding: 22px 20px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 16px;
  background: rgba(246, 248, 252, 0.78);
}

.ensemble-dashboard-metric strong,
.ensemble-dashboard-metric span {
  display: block;
}

.ensemble-dashboard-metric strong {
  color: var(--text-base);
  font-size: 36px;
  line-height: 1;
}

.ensemble-dashboard-metric span {
  margin-top: 10px;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
}

.ensemble-task-panel {
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.09);
}

.ensemble-task-list {
  display: grid;
  gap: 10px;
}

.ensemble-task-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.95);
}

.ensemble-task-row.is-warning {
  border-color: rgba(245, 158, 11, 0.28);
  background: rgba(255, 251, 235, 0.72);
}

.ensemble-task-row.is-danger {
  border-color: rgba(220, 38, 38, 0.24);
  background: rgba(254, 242, 242, 0.78);
}

.ensemble-task-row.is-accent {
  border-color: rgba(19, 91, 236, 0.2);
  background: rgba(239, 246, 255, 0.76);
}

.ensemble-task-marker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.07);
  color: var(--text-base);
  font-size: 15px;
  font-weight: 900;
}

.ensemble-task-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.ensemble-task-copy strong {
  color: var(--text-base);
  font-size: 17px;
  line-height: 1.3;
}

.ensemble-task-copy span {
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.35;
}

.ensemble-ready-state {
  display: grid;
  gap: 6px;
  padding: 16px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 14px;
  background: rgba(246, 248, 252, 0.8);
}

.ensemble-ready-state span {
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.45;
}

.ensemble-dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(420px, 100%), 1fr));
  gap: 20px;
}

.ensemble-dashboard-panel {
  align-content: start;
}

.ensemble-dashboard-panel .panel-header {
  align-items: start;
}

.ensemble-dashboard-panel .inline-actions {
  margin-top: 0;
}

.ensemble-compact-list {
  display: grid;
  gap: 9px;
}

.ensemble-compact-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 12px 13px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 12px;
  background: rgba(246, 248, 252, 0.82);
  color: inherit;
  text-decoration: none;
}

.ensemble-compact-row span {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.ensemble-compact-row strong {
  overflow: hidden;
  color: var(--text-base);
  font-size: 16px;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ensemble-compact-row small,
.ensemble-compact-row em {
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.35;
}

.ensemble-compact-row em {
  font-style: normal;
  font-weight: 700;
  white-space: nowrap;
}

.ensemble-voice-summary {
  display: grid;
  gap: 4px;
  margin-bottom: 12px;
  padding: 14px;
  border: 1px solid rgba(19, 91, 236, 0.14);
  border-radius: 14px;
  background: rgba(239, 246, 255, 0.72);
}

.ensemble-voice-summary strong {
  color: var(--accent);
  font-size: 28px;
  line-height: 1;
}

.ensemble-voice-summary span {
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 700;
}

.empty-state.is-compact {
  padding: 16px;
  text-align: left;
}

.ensemble-management-panel {
  box-shadow: none;
}

.notenwart-list-toolbar {
  display: flex;
  align-items: end;
  gap: 12px;
  margin-bottom: 18px;
}

.notenwart-search-label {
  width: min(420px, 100%);
}

.notenwart-list-footer {
  display: flex;
  justify-content: center;
  margin-top: 18px;
}

.ensemble-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 20px;
}

.ensemble-member-row,
.ensemble-managed-row,
.ensemble-setlist-row,
.ensemble-entry-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  padding: 16px 18px;
}

.ensemble-member-copy,
.ensemble-managed-copy,
.ensemble-setlist-copy,
.ensemble-entry-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.ensemble-member-copy strong,
.ensemble-managed-copy strong,
.ensemble-setlist-copy strong,
.ensemble-entry-copy strong,
.ensemble-mini-row strong {
  font-size: 16px;
  line-height: 1.35;
}

.ensemble-managed-title-link {
  color: var(--text-base);
  font-size: 15px;
  font-weight: 800;
  line-height: 1.35;
  text-decoration: none;
}

.ensemble-managed-title-link:hover {
  color: var(--accent);
}

.button.is-small,
.ghost-button.is-small {
  min-height: 38px;
  height: auto;
  padding: 9px 12px;
  border-radius: 12px;
  font-size: 13px;
}

.ensemble-member-copy small {
  color: var(--text-faint);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.ensemble-member-parts {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 2px;
}

.ensemble-member-part-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 6px 9px 6px 10px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 999px;
  background: rgba(246, 248, 252, 0.9);
  color: var(--text-base);
  font-size: 13px;
  font-weight: 750;
  line-height: 1.2;
}

.ensemble-member-part-chip button {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border: 0;
  border-radius: 999px;
  background: rgba(220, 38, 38, 0.1);
  color: #dc2626;
  font: inherit;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
}

.ensemble-member-no-part {
  color: var(--text-faint);
  font-size: 13px;
  font-weight: 700;
}

.ensemble-setlist-copy span,
.ensemble-entry-copy span,
.ensemble-entry-copy small {
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1.45;
}

.ensemble-entry-copy small {
  font-size: 12px;
}

.ensemble-member-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.ensemble-role-select {
  min-width: 170px;
}

.ensemble-member-part-select {
  display: grid;
  gap: 5px;
  min-width: 190px;
}

.ensemble-member-part-select span {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 800;
}

.ensemble-remove-member {
  width: 40px;
  height: 40px;
  color: #c53030;
}

.ensemble-mini-section {
  border-top: 1px solid var(--line-soft);
  padding-top: 16px;
}

.ensemble-mini-section:first-child {
  border-top: 0;
  padding-top: 0;
}

.ensemble-mini-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.ensemble-mini-head h4 {
  margin: 0;
  font-size: 16px;
}

.ensemble-mini-head span {
  color: var(--text-faint);
  font-size: 13px;
  font-weight: 700;
}

.ensemble-mini-list {
  display: grid;
  gap: 10px;
}

.ensemble-mini-row {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(246, 248, 252, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.12);
}

.ensemble-dialog {
  width: min(720px, calc(100vw - 28px));
}

.ensemble-invite-dialog {
  width: min(620px, calc(100vw - 28px));
}

.ensemble-invite-layout {
  display: grid;
  grid-template-columns: minmax(220px, 0.9fr) minmax(0, 1fr);
  gap: 22px;
  align-items: center;
}

.ensemble-invite-qr {
  display: grid;
  place-items: center;
  padding: 16px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 22px;
  background: #fff;
}

.ensemble-invite-qr-svg {
  width: min(260px, 100%);
  height: auto;
  shape-rendering: crispEdges;
}

.ensemble-invite-copy {
  display: grid;
  gap: 12px;
}

.ensemble-invite-copy span {
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 800;
}

.ensemble-invite-copy strong {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 12px 14px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 14px;
  background: rgba(246, 248, 252, 0.9);
  color: var(--text-base);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 20px;
  letter-spacing: 0.03em;
}

.ensemble-selection-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: flex-start;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(246, 248, 252, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.12);
}

.ensemble-selection-row.is-button {
  width: 100%;
  cursor: pointer;
  text-align: left;
}

.ensemble-selection-row.is-button:disabled {
  cursor: default;
  opacity: 0.6;
}

.ensemble-selection-row span {
  display: grid;
  gap: 4px;
}

.ensemble-selection-row strong {
  font-size: 15px;
}

.ensemble-selection-row small {
  color: var(--text-muted);
  font-size: 13px;
}

.ensemble-divider-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 12px;
  align-items: center;
  color: var(--accent);
  padding: 10px 4px 2px;
}

.ensemble-divider-row span {
  display: block;
  height: 1px;
  background: rgba(19, 91, 236, 0.28);
}

.ensemble-locked-panel {
  padding: 24px;
}

.voice-management-head {
  display: block;
}

.voice-management-head-meta {
  display: block;
  margin-top: 6px;
}

.voice-management-head-meta .panel-subtitle {
  margin-top: 0;
}

.voice-management-toolbar {
  margin-top: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.voice-management-title-filter {
  flex: 1 1 420px;
  min-width: min(100%, 360px);
  display: flex;
  align-items: center;
  gap: 10px;
}

.voice-management-title-filter-input {
  min-height: 52px;
  border-radius: 16px;
  font-weight: 600;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 249, 255, 0.98));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.voice-management-filter-wrap {
  flex: 1 1 360px;
  min-width: min(100%, 340px);
}

.voice-management-filter-select {
  min-height: 52px;
  border-radius: 16px;
  padding-right: 44px;
  font-weight: 600;
  color: var(--text-base);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 249, 255, 0.98));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.voice-management-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.voice-management-toolbar .subtle-button.is-active {
  background: rgba(19, 91, 236, 0.12);
  color: var(--accent);
}

.voice-management-toolbar .subtle-button,
.voice-management-toolbar .button {
  min-height: 52px;
}

.voice-management-draft-bar {
  margin-top: 14px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  padding: 12px 14px;
  border: 1px solid rgba(19, 91, 236, 0.24);
  border-radius: 8px;
  background: rgba(19, 91, 236, 0.08);
}

.voice-management-draft-bar span {
  color: var(--text-strong);
  font-size: 13px;
  font-weight: 700;
}

.voice-management-draft-bar .button,
.voice-management-draft-bar .subtle-button {
  min-height: 40px;
}

.voice-management-pagination {
  display: flex;
  justify-content: flex-end;
  margin-top: 16px;
}

.voice-management-pagination-top {
  margin-top: 14px;
}

.voice-management-pagination-bottom {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid rgba(148, 163, 184, 0.16);
}

.voice-management-pagination-controls {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 8px;
  border: 1px solid rgba(99, 122, 167, 0.18);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(243, 247, 255, 0.96));
  box-shadow:
    0 10px 24px rgba(29, 44, 84, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.voice-management-pagination-controls.is-loading {
  opacity: 0.88;
}

.voice-management-pagination-controls .subtle-button {
  min-height: 40px;
  min-width: 92px;
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(19, 91, 236, 0.08);
  color: var(--accent);
  font-weight: 700;
}

.voice-management-pagination-label {
  color: var(--text-strong);
  font-size: 13px;
  font-weight: 600;
  min-width: 128px;
  text-align: center;
  letter-spacing: 0.01em;
}

.voice-management-panel {
  overflow: hidden;
}

.voice-management-table-wrap {
  width: 100%;
  max-height: calc(100vh - 300px);
  overflow: auto;
  border: 1px solid var(--line-soft);
  border-radius: 18px;
  background: #fff;
  position: relative;
}

.voice-management-table {
  width: max-content;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 14px;
}

.voice-management-table th,
.voice-management-table td {
  min-width: 150px;
  max-width: 260px;
  padding: 13px 14px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
  border-right: 1px solid rgba(148, 163, 184, 0.12);
  text-align: left;
  vertical-align: top;
  white-space: normal;
}

.voice-management-table th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: rgba(246, 248, 252, 0.98);
  color: var(--text-strong);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.voice-management-table th:first-child,
.voice-management-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
  min-width: 260px;
  background: #fff;
  box-shadow: 1px 0 0 rgba(148, 163, 184, 0.12);
}

.voice-management-table th:first-child {
  z-index: 4;
  background: rgba(246, 248, 252, 0.98);
}

.voice-management-table th:nth-child(2),
.voice-management-table td:nth-child(2) {
  min-width: 168px;
}

.voice-management-table th:nth-child(2) {
  background: rgba(246, 248, 252, 0.98);
}

.voice-column-title,
.voice-column-edit {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.voice-column-edit {
  flex-wrap: wrap;
}

.voice-column-edit-button,
.voice-column-action {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  padding: 0;
}

.voice-column-input {
  width: 140px;
  border: 1px solid var(--line-base);
  border-radius: 8px;
  padding: 6px 8px;
  font: inherit;
  letter-spacing: 0;
  text-transform: none;
}

.voice-column-action {
  font-size: 11px;
}

.voice-management-table td:first-child {
  display: table-cell;
}

.voice-management-table td:first-child strong,
.voice-management-table td:first-child span {
  display: block;
}

.voice-management-table td:first-child span {
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 12px;
}

.voice-management-cell.is-drop-target {
  background: rgba(255, 255, 255, 0.96);
}

.voice-management-cell.is-drop-target:hover {
  background: rgba(234, 240, 255, 0.6);
}

.voice-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: flex-start;
}

.voice-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 5px 7px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 9px;
  background: rgba(246, 248, 252, 0.92);
  color: var(--text-strong);
  cursor: grab;
  line-height: 1.35;
}

.voice-chip.has-share-status {
  border-color: rgba(22, 163, 74, 0.34);
  background: rgba(240, 253, 244, 0.94);
}

.voice-chip.has-share-status:hover::after,
.voice-chip.has-share-status:focus-within::after {
  content: attr(data-share-tooltip);
  position: absolute;
  left: 0;
  bottom: calc(100% + 8px);
  z-index: 35;
  width: max-content;
  max-width: min(360px, 70vw);
  padding: 10px 12px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.96);
  color: #fff;
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.22);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.45;
  pointer-events: none;
  white-space: pre-line;
}

.voice-chip-share-indicator {
  min-width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(22, 163, 74, 0.14);
  color: #15803d;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}

.voice-chip:active {
  cursor: grabbing;
}

.voice-chip.is-editing {
  cursor: default;
  background: #fff;
}

.voice-chip-edit,
.voice-chip-delete,
.voice-chip-remove,
.voice-chip-action {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  padding: 0;
}

.voice-chip-delete {
  color: #dc2626;
  font-size: 14px;
  line-height: 1;
}

.voice-chip-remove {
  color: #dc2626;
  font-size: 15px;
  line-height: 1;
}

.voice-chip-action {
  font-size: 12px;
}

.voice-chip-input {
  width: min(180px, 52vw);
  border: 1px solid var(--line-base);
  border-radius: 8px;
  padding: 6px 8px;
  font: inherit;
}

.voice-management-table tr:last-child td {
  border-bottom: 0;
}

.voice-rename-overlay {
  position: fixed;
  inset: 0;
  z-index: 85;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.36);
}

.voice-rename-dialog {
  width: min(560px, calc(100vw - 48px));
  border: 1px solid var(--line-soft);
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 28px 80px rgba(15, 23, 42, 0.24);
  padding: 22px;
}

.voice-rename-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

.voice-rename-head strong,
.voice-rename-head span {
  display: block;
}

.voice-rename-head span {
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 13px;
}

.voice-rename-dialog p {
  margin: 0;
  color: var(--text-base);
  font-size: 16px;
  line-height: 1.55;
}

.voice-rename-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.voice-preview-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.38);
}

.voice-preview-dialog {
  width: min(920px, calc(100vw - 48px));
  max-height: calc(100vh - 48px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  border: 1px solid var(--line-soft);
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 28px 80px rgba(15, 23, 42, 0.24);
  overflow: hidden;
}

.voice-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line-soft);
}

.voice-preview-head strong,
.voice-preview-head span {
  display: block;
}

.voice-preview-head span {
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 13px;
}

.voice-preview-canvas-wrap {
  min-height: 0;
  overflow: auto;
  padding: 18px;
  background: #eef1f7;
  text-align: center;
}

.voice-preview-canvas-wrap canvas {
  max-width: 100%;
  background: #fff;
  box-shadow: 0 14px 36px rgba(15, 23, 42, 0.16);
}

.voice-preview-status {
  margin: 0;
  padding: 12px 18px;
  color: var(--text-muted);
  font-size: 13px;
}

.library-action-delete svg {
  width: 18px;
  height: 18px;
  display: block;
}

@media (max-width: 1120px) {
  .ensemble-detail-grid {
    grid-template-columns: 1fr;
  }
}

.notenwart-control-page {
  overflow: visible;
}

.notenwart-control-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 420px);
  gap: 22px;
  align-items: start;
}

.notenwart-preview-panel,
.notenwart-control-box {
  border: 1px solid var(--line-soft);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 18px 44px rgba(31, 42, 68, 0.08);
}

.notenwart-preview-panel {
  min-width: 0;
  padding: 22px;
}

.notenwart-control-sidebar {
  display: grid;
  gap: 16px;
  position: sticky;
  top: 24px;
}

.notenwart-control-box {
  padding: 18px;
}

.notenwart-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.notenwart-preview-stage {
  display: grid;
  min-height: 520px;
  place-items: center;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(231, 236, 251, 0.72), rgba(255, 255, 255, 0.9));
  overflow: auto;
  padding: 18px;
}

.notenwart-preview-canvas {
  display: block;
  max-width: 100%;
  height: auto;
  background: #fff;
  box-shadow: 0 14px 34px rgba(31, 42, 68, 0.18);
}

.notenwart-preview-status {
  margin: 12px 0 0;
  color: var(--text-muted);
  font-size: 13px;
  text-align: center;
}

.notenwart-part-list {
  display: grid;
  gap: 10px;
}

.notenwart-part-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 9px;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.92);
}

.notenwart-part-row.is-active {
  border-color: rgba(63, 99, 255, 0.28);
  background: rgba(233, 237, 255, 0.72);
}

.notenwart-part-row.has-pending-replacement {
  border-color: rgba(37, 99, 235, 0.38);
  background: rgba(239, 246, 255, 0.86);
}

.notenwart-part-row.has-pending-deletion {
  border-color: rgba(220, 38, 38, 0.34);
  background: rgba(254, 242, 242, 0.9);
}

.notenwart-part-select {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  border: 0;
  background: transparent;
  color: var(--text-base);
  cursor: pointer;
  padding: 0;
  text-align: left;
}

.notenwart-part-select strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notenwart-part-select span {
  flex: 0 0 auto;
  color: var(--text-muted);
  font-size: 12px;
}

.notenwart-pending-replacement {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(37, 99, 235, 0.08);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
}

.notenwart-pending-replacement span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notenwart-pending-replacement.is-danger {
  background: rgba(220, 38, 38, 0.08);
  color: var(--danger);
}

.notenwart-part-name-wrap {
  position: relative;
  display: block;
}

.notenwart-part-name-field {
  min-height: 42px;
  padding: 10px 12px;
  border-radius: 12px;
}

.notenwart-part-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.notenwart-part-actions input[type="file"],
.notenwart-add-button input[type="file"] {
  display: none;
}

.notenwart-replace-drop {
  border-style: dashed;
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.notenwart-replace-drop.is-drop-target {
  border-color: rgba(63, 99, 255, 0.72);
  background: rgba(63, 99, 255, 0.12);
  color: var(--accent);
  transform: translateY(-1px);
}

.notenwart-add-button {
  display: flex;
  justify-content: center;
  margin-top: 12px;
  padding: 14px 16px;
  border: 1px dashed rgba(63, 99, 255, 0.34);
  border-radius: 16px;
  background: rgba(238, 242, 255, 0.7);
  color: var(--accent);
  cursor: pointer;
  font-weight: 800;
  text-align: center;
}

.notenwart-metadata-grid {
  display: grid;
  gap: 12px;
}

@media (max-width: 1120px) {
  .login-wrap {
    grid-template-columns: 1fr;
  }

  .login-showcase {
    min-height: auto;
  }

  .app-layout {
    grid-template-columns: 1fr;
  }

  .app-sidebar-card {
    position: static;
  }

  .ensemble-header-panel {
    padding: 26px;
  }

  .ensemble-dashboard-title .panel-title {
    font-size: clamp(38px, 7vw, 54px);
  }

  .notenwart-control-layout {
    grid-template-columns: 1fr;
  }

  .notenwart-control-sidebar {
    position: static;
  }

  .grid-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .page-shell.is-piece-view {
    width: 100vw;
    padding: 0;
  }

  .page-shell {
    width: min(var(--content-width), calc(100vw - 20px));
    padding-top: 14px;
  }

  .page-shell.is-wide {
    width: 100vw;
    max-width: none;
    margin: 0;
    padding-right: 10px;
    padding-left: 10px;
  }

  .topbar {
    justify-content: stretch;
  }

  .topbar-actions {
    width: 100%;
    justify-content: flex-end;
    flex-wrap: wrap;
  }

  .hero-card,
  .panel,
  .feature-card,
  .placeholder-card {
    padding: 18px;
  }

  .app-layout {
    gap: 18px;
    margin-top: 16px;
  }

  .app-sidebar-card {
    padding: 18px;
  }

  .nav-link {
    padding: 14px 15px;
  }

  .nav-link strong {
    font-size: 16px;
  }

  .nav-link span {
    font-size: 13px;
  }

  .ensemble-header-panel {
    padding: 20px;
  }

  .ensemble-dashboard-title .panel-title {
    font-size: 36px;
  }

  .ensemble-role-line {
    font-size: 16px;
  }

  .ensemble-dashboard-action-bar .button,
  .ensemble-dashboard-action-bar .ghost-button {
    width: 100%;
    justify-content: center;
  }

  .grid-cards,
  .split-grid,
  .metric-grid,
  .ensemble-detail-grid,
  .ensemble-dashboard-grid,
  .ensemble-dashboard-metrics {
    grid-template-columns: 1fr;
  }

  .ensemble-header-row,
  .ensemble-dashboard-head,
  .ensemble-row,
  .ensemble-member-row,
  .ensemble-managed-row,
  .ensemble-setlist-row,
  .ensemble-entry-row,
  .ensemble-task-row,
  .ensemble-compact-row {
    grid-template-columns: 1fr;
  }

  .ensemble-row-side,
  .ensemble-member-actions,
  .ensemble-dashboard-action-bar {
    justify-content: flex-start;
  }

  .ensemble-invite-layout {
    grid-template-columns: 1fr;
  }

  .ensemble-overview-title {
    align-items: flex-start;
  }

  .ensemble-dashboard-identity {
    align-items: flex-start;
  }

  .ensemble-dashboard-logo {
    width: 58px;
    height: 58px;
    border-radius: 17px;
  }

  .ensemble-task-row .ghost-button,
  .ensemble-compact-row em {
    justify-self: start;
  }

  .ensemble-role-select {
    min-width: 0;
    width: 100%;
  }

  .ensemble-member-part-select {
    width: 100%;
  }

  .notenwart-section-head {
    align-items: stretch;
    flex-direction: column;
  }

  .notenwart-preview-panel,
  .notenwart-control-box {
    border-radius: 18px;
  }

  .notenwart-preview-stage {
    min-height: 360px;
    padding: 12px;
  }

  .list-item-head {
    flex-direction: column;
  }

  .library-dialog {
    padding: 18px;
  }

  .library-row {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 16px;
  }

  .library-row-head,
  .library-row-actions {
    align-items: flex-start;
    justify-content: flex-start;
    flex-direction: column;
  }

  .library-row-status {
    justify-content: flex-start;
  }

  .voice-management-toolbar {
    align-items: stretch;
  }

  .voice-management-head-meta {
    display: block;
  }

  .voice-management-title-filter,
  .voice-management-filter-wrap,
  .voice-management-toolbar-actions {
    width: 100%;
  }

  .voice-management-title-filter {
    flex-direction: column;
    align-items: stretch;
  }

  .voice-management-toolbar-actions {
    justify-content: space-between;
  }

  .voice-management-pagination {
    justify-content: stretch;
  }

  .voice-management-pagination-controls {
    width: 100%;
    border-radius: 22px;
  }

  .piece-inline-form-actions,
  .piece-inline-form-submit {
    flex-direction: column;
    align-items: flex-start;
  }

  .piece-viewer-layout {
    grid-template-columns: 1fr;
  }

  .piece-viewer-main {
    border-right: 0;
    border-bottom: 1px solid rgba(148, 163, 184, 0.16);
    height: auto;
  }

  .piece-stage {
    min-height: 58vh;
    height: 58vh;
  }

  .piece-canvas-shell {
    min-height: 62vh;
    padding: 72px 12px 18px;
  }

  .piece-sidebar {
    height: auto;
    max-height: none;
  }

  .piece-floating-toolbar {
    top: 12px;
    left: 12px;
    right: 12px;
  }

  .piece-floating-button {
    width: 46px;
    height: 46px;
    font-size: 20px;
  }

  .piece-display-menu {
    top: 56px;
    width: min(272px, calc(100vw - 48px));
  }

  .piece-page-arrow {
    width: 46px;
    height: 46px;
  }

  .piece-page-arrow-placeholder {
    width: 46px;
    height: 46px;
  }

  .piece-page-arrow-rail {
    top: calc(50vh - 23px);
    padding: 0 12px;
  }

  .login-showcase,
  .login-card {
    border-radius: 26px;
    padding: 20px;
  }
}
