:root {
  color-scheme: light;
  --bg: #f1f2ed;
  --surface: #fbf8f1;
  --surface-2: #e9e6dc;
  --surface-3: #dceee9;
  --text: #1f1b18;
  --muted: #635a55;
  --line: #d9cfc8;
  --accent: #0f918a;
  --accent-2: #d24f76;
  --accent-3: #c77d24;
  --accent-4: #7f70cf;
  --info: #1d4ed8;
  --danger: #b91c1c;
  --ok: #0f7a39;
  --warn: #9a5f00;
  --space-xs: clamp(6px, 0.45vw, 8px);
  --space-sm: clamp(8px, 0.65vw, 12px);
  --space-md: clamp(12px, 0.95vw, 16px);
  --space-lg: clamp(16px, 1.35vw, 24px);
  --content-pad: clamp(12px, 1.35vw, 28px);
  --content-gap: clamp(12px, 1vw, 18px);
  --content-standard-max: 1440px;
  --content-wide-max: 1680px;
  --content-max: var(--content-standard-max);
  --topbar-max: var(--content-wide-max);
  --sidebar-width: clamp(224px, 15.5vw, 252px);
  --role-super-admin: #9a5f00;
  --role-admin: #be123c;
  --role-curator: #6d28d9;
  --role-dubber: #15803d;
  --role-sound: #047d95;
  --role-translator: #a55608;
  --role-editor: #be185d;
  --role-releaser: #0369a1;
  --role-music: #0f766e;
  --role-music-sound: #be123c;
  --role-vocalist: #7c3aed;
  --role-lyricist: #a16207;
  --role-video: #1d4ed8;
  --role-tune: #047857;
  --role-beta: #c2410c;
  --brand-logo-url: url("/assets/brand/kazoku-logo-light.png");
  --focus: 0 0 0 3px rgba(8, 127, 115, 0.22);
  --shadow: 0 18px 48px rgba(38, 31, 22, 0.1);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #151412;
  --surface: #211c1b;
  --surface-2: #2d2524;
  --surface-3: #183431;
  --text: #fbf5ef;
  --muted: #c0b4ad;
  --line: #433833;
  --accent: #34d7cf;
  --accent-2: #ff7da1;
  --accent-3: #ffd166;
  --accent-4: #b7a2ff;
  --info: #38bdf8;
  --danger: #f87171;
  --ok: #4ade80;
  --warn: #facc15;
  --role-super-admin: #facc15;
  --role-admin: #f43f5e;
  --role-curator: #a78bfa;
  --role-dubber: #22c55e;
  --role-sound: #06b6d4;
  --role-translator: #f59e0b;
  --role-editor: #ec4899;
  --role-releaser: #38bdf8;
  --role-music: #2dd4bf;
  --role-music-sound: #fb7185;
  --role-vocalist: #a78bfa;
  --role-lyricist: #fbbf24;
  --role-video: #60a5fa;
  --role-tune: #34d399;
  --role-beta: #f97316;
  --brand-logo-url: url("/assets/brand/kazoku-logo-dark.png");
  --shadow: 0 20px 56px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  font-size: 15px;
  line-height: 1.45;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 10%, transparent), transparent 28%),
    linear-gradient(315deg, color-mix(in srgb, var(--accent-3) 12%, transparent), transparent 32%),
    var(--bg);
  color: var(--text);
}

button,
input,
select,
textarea {
  font: inherit;
  line-height: 1.25;
  max-width: 100%;
  min-width: 0;
}

button {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  max-width: 100%;
  min-width: 44px;
  min-height: 36px;
  overflow: hidden;
  overflow-wrap: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
  word-break: normal;
  transition: border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

button:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.56;
  transform: none;
}

button.is-instant-press,
.is-instant-press {
  transform: translateY(0) scale(0.985);
}

button.is-pending-action {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  border-color: color-mix(in srgb, var(--accent) 54%, var(--line));
  background:
    linear-gradient(110deg, color-mix(in srgb, var(--accent) 18%, transparent), transparent 42%, color-mix(in srgb, #fff 12%, transparent) 52%, transparent 62%),
    color-mix(in srgb, var(--surface-3) 68%, var(--surface));
  background-size: 220% 100%;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 18%, transparent), 0 10px 20px color-mix(in srgb, var(--accent) 12%, transparent);
  opacity: 1;
  animation: ui-pending-sheen 1.1s ease-in-out infinite;
}

.ui-action-spinner {
  width: 13px;
  height: 13px;
  flex: 0 0 auto;
  border: 2px solid color-mix(in srgb, currentColor 24%, transparent);
  border-top-color: currentColor;
  border-radius: 999px;
  animation: ui-action-spin 0.72s linear infinite;
}

.is-action-complete {
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--ok) 28%, transparent);
}

.is-action-failed {
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--danger) 34%, transparent);
}

button:focus,
input:focus,
select:focus,
textarea:focus {
  outline: none;
  box-shadow: var(--focus);
}

.submission-source-modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 20px;
  background: color-mix(in srgb, #151412 58%, transparent);
  backdrop-filter: blur(5px);
}

.submission-source-dialog {
  width: min(520px, calc(100vw - 28px));
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--line));
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.32);
}

.submission-source-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.submission-source-head strong {
  display: block;
  font-size: 18px;
  line-height: 1.2;
}

.submission-source-head p {
  margin: 6px 0 0;
  color: var(--muted);
}

.submission-source-close {
  width: 34px;
  min-width: 34px;
  min-height: 34px;
  padding: 0;
  border-radius: 999px;
  font-size: 22px;
  line-height: 1;
}

.submission-source-modes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.submission-source-mode {
  position: relative;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  cursor: pointer;
  line-height: 1.2;
}

.submission-source-mode input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.submission-source-mode:has(input:checked) {
  border-color: color-mix(in srgb, var(--accent) 68%, var(--line));
  background: color-mix(in srgb, var(--accent) 16%, var(--surface));
  color: var(--accent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 18%, transparent);
}

.submission-source-input {
  width: 100%;
  min-height: 98px;
  padding: 11px 12px;
  border: 1px solid color-mix(in srgb, var(--accent) 36%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 86%, #fff 14%);
  color: var(--text);
  resize: vertical;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, #fff 18%, transparent);
}

[data-theme="dark"] .submission-source-input {
  background: color-mix(in srgb, var(--surface-2) 90%, #000 10%);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, #fff 7%, transparent);
}

.submission-source-input::placeholder {
  color: color-mix(in srgb, var(--muted) 82%, transparent);
}

.submission-source-error {
  margin: -4px 0 0;
  color: var(--danger);
  font-weight: 700;
}

.submission-source-actions {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 8px;
}

.submission-source-actions button {
  min-height: 38px;
}

@media (max-width: 560px) {
  .submission-source-modal {
    padding: 12px;
    align-items: end;
  }

  .submission-source-actions {
    grid-template-columns: 1fr 1fr;
  }

  .submission-source-actions span {
    display: none;
  }

  .submission-source-actions button {
    width: 100%;
  }

  .submission-source-actions [data-submission-paste] {
    grid-column: 1 / -1;
  }
}

.app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
}

.brand-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  align-items: start;
  position: relative;
  min-height: 116px;
  padding: 10px;
  border: 1px solid color-mix(in srgb, var(--accent) 24%, var(--line));
  border-radius: 16px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 11%, transparent), transparent 54%),
    linear-gradient(180deg, color-mix(in srgb, #fff 22%, transparent), transparent),
    color-mix(in srgb, var(--surface) 90%, var(--surface-3));
  box-shadow:
    0 16px 34px color-mix(in srgb, var(--accent) 10%, transparent),
    0 1px 0 color-mix(in srgb, #fff 36%, transparent) inset;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: var(--space-lg);
  border-right: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--surface) 92%, var(--accent) 8%), var(--surface) 42%),
    var(--surface);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  box-shadow: 12px 0 34px rgba(49, 37, 25, 0.06);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--accent) 48%, var(--line)) transparent;
}

.sidebar::-webkit-scrollbar {
  width: 8px;
}

.sidebar::-webkit-scrollbar-track {
  background: transparent;
  margin-block: 10px;
}

.sidebar::-webkit-scrollbar-thumb {
  min-height: 52px;
  border: 2px solid transparent;
  border-radius: 999px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--accent) 62%, var(--surface)), color-mix(in srgb, var(--accent-3) 36%, var(--line)))
    content-box;
}

.sidebar::-webkit-scrollbar-thumb:hover {
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--accent) 82%, var(--surface)), color-mix(in srgb, var(--accent-3) 48%, var(--accent)))
    content-box;
}

.sidebar-collapse-toggle {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  min-height: 32px;
  padding: 0;
  border-radius: 11px;
  border-color: color-mix(in srgb, var(--accent) 28%, var(--line));
  background: color-mix(in srgb, var(--surface) 74%, var(--accent) 8%);
  color: var(--text);
  box-shadow: 0 1px 0 color-mix(in srgb, #fff 34%, transparent) inset;
}

.sidebar-collapse-toggle:hover,
.sidebar-collapse-toggle:focus-visible {
  border-color: color-mix(in srgb, var(--accent) 58%, var(--line));
  background: color-mix(in srgb, var(--accent) 14%, var(--surface));
}

.brand {
  display: grid;
  gap: 3px 10px;
  min-width: 0;
}

.brand-row .brand {
  grid-template-columns: 1fr;
  align-items: start;
  justify-items: start;
  row-gap: 4px;
  width: 100%;
}

.brand strong {
  min-width: 0;
  font-size: 16px;
  letter-spacing: 0;
  line-height: 1.12;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-row .brand strong {
  max-width: 100%;
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
}

.brand::before {
  content: "";
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background-image: var(--brand-logo-url);
  background-position: center;
  background-repeat: no-repeat;
  background-size: 92% 92%;
  background-color: color-mix(in srgb, var(--surface) 76%, var(--accent) 8%);
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--accent) 28%, transparent) inset,
    0 12px 28px color-mix(in srgb, var(--accent) 18%, transparent);
  grid-row: span 2;
  overflow: hidden;
}

.brand-row .brand::before {
  grid-row: auto;
  margin-bottom: 3px;
}

.brand {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  column-gap: 10px;
}

.brand span,
.userbox span,
.muted {
  color: var(--muted);
}

.brand span {
  min-width: 0;
  font-size: 13px;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-row .brand span {
  max-width: 100%;
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
}

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

.nav-group {
  display: grid;
  gap: 5px;
}

.nav-favorites {
  padding: 8px;
  border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--line));
  border-radius: 8px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 10%, transparent), transparent 62%),
    color-mix(in srgb, var(--surface-2) 76%, transparent);
}

.nav-favorites-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  margin-bottom: 7px;
}

.nav-favorites-head > span {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: color-mix(in srgb, var(--accent) 78%, var(--text));
  font-size: 11px;
  font-weight: 900;
  line-height: 1.1;
  text-transform: uppercase;
}

.nav-favorites-head svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}

.nav-favorites-edit {
  width: auto !important;
  min-width: 0 !important;
  min-height: 28px !important;
  padding: 3px 8px !important;
  border-radius: 999px !important;
  font-size: 11px;
}

.nav-favorites-empty {
  min-height: 34px;
  display: grid;
  place-items: center;
  border: 1px dashed color-mix(in srgb, var(--accent) 28%, var(--line));
  border-radius: 7px;
  color: var(--muted);
  font-size: 12px;
}

.nav-group-toggle {
  min-height: 28px;
  padding: 0 4px;
  border: 0;
  background: transparent;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-transform: uppercase;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.2;
  gap: 6px;
}

.nav-group-toggle span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-group-toggle:hover {
  transform: none;
  color: var(--accent);
}

.nav-chevron {
  width: 20px;
  height: 20px;
  display: inline-grid;
  place-items: center;
  transition: transform 0.16s ease;
}

.nav-group.collapsed .nav-chevron {
  transform: rotate(-90deg);
}

.nav-group-items {
  display: grid;
  gap: 5px;
}

.nav-group.collapsed .nav-group-items {
  display: none;
}

.nav button {
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  gap: 9px;
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  border-color: color-mix(in srgb, var(--line) 72%, transparent);
}

.nav .nav-group-toggle {
  min-height: 28px;
  padding: 0 4px;
  border: 0;
  background: transparent;
  display: flex;
}

.nav-item-row {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 5px;
}

.nav-item-row:has(.nav-favorite-toggle) {
  grid-template-columns: minmax(0, 1fr) 36px;
}

.nav-item-row .nav-view-button {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
}

.nav-favorite-toggle {
  width: 36px !important;
  min-width: 36px !important;
  min-height: 36px !important;
  padding: 0 !important;
  display: inline-grid !important;
  grid-template-columns: 1fr !important;
  place-items: center;
  color: color-mix(in srgb, var(--muted) 88%, var(--accent));
  font-size: 16px;
  line-height: 1;
  text-align: center !important;
}

.nav-favorite-items .nav-item-row[draggable="true"] {
  cursor: grab;
}

.nav-favorite-items .nav-item-row[draggable="true"] .nav-view-button {
  cursor: grab;
}

.nav-favorite-items .nav-item-row.dragging {
  opacity: 0.62;
}

.nav-favorite-items .nav-item-row.drag-over .nav-view-button {
  border-color: var(--accent);
  box-shadow: inset 3px 0 0 var(--accent);
}

.nav-favorite-toggle.selected {
  border-color: color-mix(in srgb, var(--accent-3) 58%, var(--line));
  background: color-mix(in srgb, var(--accent-3) 18%, var(--surface));
  color: color-mix(in srgb, var(--accent-3) 82%, var(--text));
}

.nav button.active {
  background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 22%, var(--surface)), color-mix(in srgb, var(--surface) 88%, var(--accent) 4%));
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: inset 3px 0 0 var(--accent), 0 6px 18px color-mix(in srgb, var(--accent) 8%, transparent);
}

.nav .nav-icon {
  width: 18px;
  height: 18px;
  display: inline-grid;
  place-items: center;
  color: currentColor;
}

.nav-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-badge {
  min-width: 22px;
  height: 22px;
  padding: 2px 7px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent-3) 22%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--accent-3) 56%, var(--line));
  color: color-mix(in srgb, var(--accent-3) 72%, var(--text));
  font-size: 12px;
  font-weight: 750;
  text-align: center;
  box-shadow: 0 1px 0 color-mix(in srgb, #fff 42%, transparent) inset;
}

@media (min-width: 981px) {
  .app.sidebar-collapsed {
    grid-template-columns: 72px minmax(0, 1fr);
  }

.sidebar.collapsed {
  width: 72px;
  padding: 12px 8px;
  gap: 12px;
  align-items: center;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: thin;
}

.sidebar.collapsed::-webkit-scrollbar {
  width: 6px;
}

.sidebar.collapsed::-webkit-scrollbar-thumb {
  border-width: 1px;
  min-height: 44px;
}

  .sidebar.collapsed .brand-row {
    grid-template-columns: 1fr;
    gap: 8px;
    justify-items: center;
    min-height: auto;
    width: 100%;
    padding: 8px 0;
    border-color: transparent;
    background: transparent;
    box-shadow: none;
  }

  .sidebar.collapsed .brand {
    grid-template-columns: 1fr;
    justify-items: center;
    width: 100%;
    margin-inline: auto;
  }

  .sidebar.collapsed .brand strong,
  .sidebar.collapsed .brand span,
  .sidebar.collapsed .nav-group-toggle,
  .sidebar.collapsed .nav-label,
  .sidebar.collapsed .userbox {
    display: none;
  }

  .sidebar.collapsed .brand::before {
    grid-row: auto;
    width: 42px;
    height: 42px;
  }

  .sidebar.collapsed .sidebar-collapse-toggle {
    position: static;
    width: 42px;
    min-height: 30px;
    margin-inline: auto;
    border-radius: 999px;
  }

.sidebar.collapsed .nav,
.sidebar.collapsed .nav-group,
.sidebar.collapsed .nav-group-items {
  width: 100%;
  justify-items: center;
  overflow: visible;
}

.sidebar.collapsed .nav {
  display: grid;
  justify-content: center;
  justify-items: center;
  padding-inline: 0;
}

.sidebar.collapsed .nav-group {
  display: grid;
  justify-content: center;
  justify-items: center;
}

.sidebar.collapsed .nav-group.collapsed .nav-group-items {
  display: grid;
}

.sidebar.collapsed .nav button {
  width: 42px;
  min-height: 42px;
  padding: 0;
  justify-content: center;
  overflow: visible;
  position: relative;
  justify-self: center;
  margin-inline: auto;
}

.sidebar.collapsed .nav-group-items button {
  position: relative;
  grid-template-columns: 1fr;
}

.sidebar.collapsed .nav-favorites {
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
}

.sidebar.collapsed .nav-favorites-head,
.sidebar.collapsed .nav-favorite-toggle,
.sidebar.collapsed .nav-favorites-empty {
  display: none !important;
}

.sidebar.collapsed .nav-item-row {
  width: 100%;
  grid-template-columns: 1fr;
  justify-items: center;
}

.sidebar.collapsed .nav .nav-icon {
  margin: auto;
}

.sidebar.collapsed .nav-badge {
  position: absolute;
  top: -6px;
  right: -3px;
  transform: none;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  font-size: 11px;
  line-height: 1.2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1.2;
  white-space: nowrap;
}
}

.userbox {
  margin-top: 8px;
  display: grid;
  gap: 8px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.main {
  min-width: 0;
  width: 100%;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 3;
  min-height: 66px;
  padding: 12px max(var(--content-pad), calc((100% - var(--topbar-max)) / 2 + var(--content-pad)));
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(14px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 16px;
  align-items: center;
}

.topbar > div {
  min-width: 0;
}

.topbar h1 {
  margin: 0;
  font-size: 23px;
  overflow-wrap: break-word;
  word-break: normal;
}

.topbar p {
  margin: 3px 0 0;
  color: var(--muted);
  overflow-wrap: break-word;
  word-break: normal;
}

.toolbar {
  display: grid;
  grid-template-columns: auto minmax(220px, 300px) auto auto auto;
  gap: 8px;
  justify-content: flex-end;
  align-items: center;
  min-width: 0;
}

.toolbar > * {
  min-width: 0;
}

.deadline-clock {
  --clock-a: #27d7ca;
  --clock-b: #54f0bd;
  --clock-c: #f5c542;
  --clock-glow: color-mix(in srgb, var(--clock-a) 26%, transparent);
  position: relative;
  isolation: isolate;
  overflow: hidden;
  width: clamp(178px, 14vw, 230px);
  min-height: 58px;
  padding: 9px 12px 11px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  border: 1px solid color-mix(in srgb, var(--clock-a) 34%, var(--line));
  border-radius: 16px;
  background:
    radial-gradient(circle at 16% 18%, color-mix(in srgb, var(--clock-b) 22%, transparent), transparent 34%),
    linear-gradient(135deg, color-mix(in srgb, var(--clock-a) 12%, var(--surface)), color-mix(in srgb, var(--surface-2) 88%, #101715));
  box-shadow:
    0 18px 38px color-mix(in srgb, #000 10%, transparent),
    0 0 34px var(--clock-glow),
    inset 0 1px 0 color-mix(in srgb, #fff 20%, transparent);
}

.deadline-clock::before {
  content: "";
  position: absolute;
  inset: -50% auto auto -12%;
  width: 46%;
  height: 180%;
  transform: rotate(18deg);
  background: linear-gradient(90deg, transparent, color-mix(in srgb, #fff 18%, transparent), transparent);
  opacity: 0.66;
  pointer-events: none;
  animation: deadline-clock-sheen 5.6s ease-in-out infinite;
}

.deadline-clock::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(120deg, color-mix(in srgb, var(--clock-a) 16%, transparent), transparent 46%),
    radial-gradient(circle at 86% 78%, color-mix(in srgb, var(--clock-c) 15%, transparent), transparent 34%);
  opacity: 0.86;
}

.deadline-clock[data-mode="pause"] {
  --clock-a: #8f7dff;
  --clock-b: #64d8ff;
  --clock-c: #f0d7ff;
  --clock-glow: color-mix(in srgb, var(--clock-a) 30%, transparent);
  border-color: color-mix(in srgb, var(--clock-a) 42%, var(--line));
  background:
    radial-gradient(circle at 18% 20%, color-mix(in srgb, var(--clock-b) 18%, transparent), transparent 35%),
    linear-gradient(135deg, color-mix(in srgb, #111827 86%, var(--clock-a) 14%), color-mix(in srgb, var(--surface) 74%, #0c0f20));
}

.deadline-clock-orb {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background:
    radial-gradient(circle at 32% 28%, color-mix(in srgb, #fff 78%, transparent), transparent 18%),
    radial-gradient(circle at 50% 50%, var(--clock-c), var(--clock-a) 58%, color-mix(in srgb, var(--clock-a) 36%, #000));
  box-shadow:
    0 0 22px color-mix(in srgb, var(--clock-a) 42%, transparent),
    inset 0 1px 1px color-mix(in srgb, #fff 42%, transparent);
}

.deadline-clock[data-mode="active"] .deadline-clock-orb::before,
.deadline-clock[data-mode="active"] .deadline-clock-orb::after {
  content: "";
  position: absolute;
  inset: -5px;
  border-radius: inherit;
  border: 1px solid color-mix(in srgb, var(--clock-c) 34%, transparent);
  opacity: 0.7;
}

.deadline-clock[data-mode="active"] .deadline-clock-orb::after {
  inset: -9px;
  opacity: 0.32;
}

.deadline-clock[data-mode="pause"] .deadline-clock-orb {
  background:
    radial-gradient(circle at 68% 32%, color-mix(in srgb, #101827 92%, transparent) 0 34%, transparent 35%),
    radial-gradient(circle at 38% 42%, color-mix(in srgb, #fff 78%, var(--clock-c)), var(--clock-a) 58%, color-mix(in srgb, #0c1020 80%, var(--clock-a)));
}

.deadline-clock-body {
  min-width: 0;
  display: grid;
  gap: 1px;
}

.deadline-clock-eyebrow {
  color: color-mix(in srgb, var(--clock-b) 84%, var(--text));
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  white-space: nowrap;
}

.deadline-clock-time {
  display: flex;
  align-items: baseline;
  gap: 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-weight: 900;
  font-size: clamp(24px, 2vw, 32px);
  line-height: 0.96;
  color: color-mix(in srgb, var(--text) 94%, #fff);
  text-shadow: 0 0 18px color-mix(in srgb, var(--clock-a) 34%, transparent);
  font-variant-numeric: tabular-nums;
}

.deadline-clock-time small {
  min-width: 2ch;
  color: color-mix(in srgb, var(--clock-b) 82%, var(--muted));
  font-size: 12px;
  line-height: 1;
}

.deadline-clock-caption {
  display: flex;
  gap: 5px;
  align-items: center;
  min-width: 0;
  color: color-mix(in srgb, var(--text) 80%, var(--muted));
  font-size: 11px;
  white-space: nowrap;
}

.deadline-clock-caption span {
  font-weight: 800;
}

.deadline-clock-caption em {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--muted);
  font-style: normal;
}

.deadline-clock-phase {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 6px;
  height: 3px;
  overflow: hidden;
  border-radius: 999px;
  background: color-mix(in srgb, var(--line) 72%, transparent);
}

.deadline-clock-phase::after {
  content: "";
  display: block;
  width: var(--phase);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--clock-a), var(--clock-b), var(--clock-c));
  box-shadow: 0 0 14px color-mix(in srgb, var(--clock-a) 46%, transparent);
  transition: width 0.35s ease;
}

@keyframes deadline-clock-sheen {
  0%,
  72% {
    transform: translateX(-150%) rotate(18deg);
  }
  100% {
    transform: translateX(360%) rotate(18deg);
  }
}

.searchbox {
  width: min(300px, 28vw);
  min-width: min(240px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.searchbox input {
  grid-column: 1 / -1;
  grid-row: 1;
  min-height: 40px;
  padding: 0 42px 0 38px;
  border-color: color-mix(in srgb, var(--line) 76%, transparent);
  background:
    linear-gradient(180deg, color-mix(in srgb, #fff 7%, transparent), transparent),
    color-mix(in srgb, var(--surface) 82%, transparent);
  box-shadow: inset 0 1px 0 color-mix(in srgb, #fff 22%, transparent);
}

.searchbox::before {
  content: "⌕";
  grid-column: 1;
  grid-row: 1;
  z-index: 1;
  width: 32px;
  text-align: center;
  color: color-mix(in srgb, var(--muted) 78%, transparent);
  font-size: 18px;
  pointer-events: none;
}

.searchbox .icon-btn {
  grid-column: 2;
  grid-row: 1;
  width: 32px;
  min-height: 30px;
  margin-right: 3px;
  border: 0;
  font-size: 20px;
}

.search-count {
  min-height: 28px;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: color-mix(in srgb, var(--accent) 9%, var(--surface));
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.department-toggle {
  display: inline-flex;
  padding: 4px;
  border: 1px solid color-mix(in srgb, var(--accent) 24%, var(--line));
  border-radius: 14px;
  background:
    linear-gradient(180deg, color-mix(in srgb, #fff 10%, transparent), transparent),
    color-mix(in srgb, var(--surface-2) 72%, transparent);
  box-shadow:
    inset 0 1px 0 color-mix(in srgb, #fff 24%, transparent),
    0 10px 26px color-mix(in srgb, #000 6%, transparent);
}

.department-toggle button {
  min-width: 54px;
  min-height: 38px;
  padding: 0 16px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: color-mix(in srgb, var(--text) 88%, var(--muted));
  transition: background 0.16s ease, color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.department-toggle button.active {
  background:
    linear-gradient(180deg, color-mix(in srgb, #fff 22%, transparent), transparent),
    var(--accent);
  color: color-mix(in srgb, var(--surface) 92%, #fff);
  box-shadow:
    0 8px 18px color-mix(in srgb, var(--accent) 22%, transparent),
    inset 0 1px 0 color-mix(in srgb, #fff 34%, transparent);
}

.department-toggle button:not(.active):hover {
  background: color-mix(in srgb, var(--accent) 9%, transparent);
  color: var(--text);
}

.toolbar-action {
  min-height: 40px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-radius: 11px;
  border-color: color-mix(in srgb, var(--line) 76%, transparent);
  background:
    linear-gradient(180deg, color-mix(in srgb, #fff 9%, transparent), transparent),
    color-mix(in srgb, var(--surface) 80%, transparent);
  color: var(--text);
  box-shadow:
    inset 0 1px 0 color-mix(in srgb, #fff 20%, transparent),
    0 8px 18px color-mix(in srgb, #000 4%, transparent);
}

.toolbar-action:hover {
  border-color: color-mix(in srgb, var(--accent) 48%, var(--line));
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--accent) 14%, transparent), transparent),
    color-mix(in srgb, var(--surface) 82%, var(--accent) 6%);
}

.toolbar-action-icon {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: color-mix(in srgb, var(--accent) 86%, var(--text));
  font-size: 14px;
  line-height: 1;
}

.toolbar-action-theme .toolbar-action-icon {
  background: color-mix(in srgb, var(--accent-4) 15%, transparent);
  color: color-mix(in srgb, var(--accent-4) 86%, var(--text));
}

.content {
  --content-max: var(--content-standard-max);
  width: min(100%, var(--content-max));
  margin: 0 auto;
  padding: var(--content-lg-pad, 20px) var(--content-pad) clamp(28px, 2vw, 40px);
  display: grid;
  gap: var(--content-gap);
}

.content-dashboard,
.content-reports,
.content-settings,
.content-team,
.content-materials,
.content-notifications,
.content-search,
.content-exchange {
  --content-max: var(--content-standard-max);
}

.content-titles,
.content-title-archive,
.content-title-analytics,
.content-episodes,
.content-episode-archive,
.content-signups,
.content-distribution,
.content-tasks,
.content-production,
.content-voice,
.content-translation,
.content-fixes,
.content-publications,
.content-release-guides,
.content-tutorial,
.content-wishlist,
.content-music,
.content-lyrics,
.content-beta-review,
.content-lyrics-library,
.content-youtube,
.content-kazoku-applications {
  --content-max: var(--content-wide-max);
}

.band {
  display: grid;
  gap: var(--space-md);
}

.grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--content-gap);
}

.span-3 { grid-column: span 3; }
.span-4 { grid-column: span 4; }
.span-5 { grid-column: span 5; }
.span-6 { grid-column: span 6; }
.span-7 { grid-column: span 7; }
.span-8 { grid-column: span 8; }
.span-12 { grid-column: span 12; }

.card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--surface) 94%, var(--accent) 6%), var(--surface) 46%),
    var(--surface);
  min-width: 0;
  box-shadow: var(--shadow);
}

.card-header {
  min-height: 52px;
  padding: var(--space-md);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 82%, transparent);
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--accent) 9%, transparent), transparent 34%),
    color-mix(in srgb, var(--surface-2) 42%, transparent);
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.card-header > * {
  min-width: 0;
}

.card-header h2,
.card-header h3 {
  margin: 0;
  font-size: 16px;
}

.card-body {
  padding: var(--space-md);
}

.card-body.two-column {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(320px, 1.1fr);
  gap: 16px;
  align-items: start;
}

.kv-list {
  display: grid;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.kv-row {
  display: grid;
  grid-template-columns: minmax(110px, 0.7fr) minmax(0, 1fr);
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

.kv-row:last-child {
  border-bottom: 0;
}

.kv-row span {
  color: var(--muted);
}

.kv-row strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.metric {
  padding: 16px;
  display: grid;
  gap: 8px;
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--surface-3) 34%, transparent), transparent 72%),
    var(--surface);
}

.metric::after {
  content: "";
  position: absolute;
  inset: auto 14px 12px auto;
  width: 42px;
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2), var(--accent-3));
}

.metric strong {
  font-size: 28px;
  color: color-mix(in srgb, var(--accent) 82%, var(--text));
}

.metric span {
  color: var(--muted);
}

.title-workspace {
  display: grid;
  gap: 14px;
}

.titles-page {
  display: grid;
  gap: 14px;
}

.title-mobile-nav {
  display: none;
}

.title-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 18%, var(--surface)), transparent 62%),
    linear-gradient(315deg, color-mix(in srgb, var(--accent-2) 12%, transparent), transparent 58%),
    var(--surface);
  box-shadow: var(--shadow);
}

.title-hero h2 {
  margin: 4px 0 6px;
  font-size: 28px;
}

.title-hero p {
  margin: 0;
  color: var(--muted);
}

.kicker {
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.title-meta {
  min-width: 132px;
  display: grid;
  justify-items: end;
  gap: 6px;
}

.title-meta strong {
  font-size: 30px;
  color: var(--accent-2);
}

.title-meta span {
  color: var(--muted);
}

.title-meta small {
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

.title-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 1px 6px;
}

.title-tabs button {
  flex: 0 0 auto;
  padding: 0 12px;
  background: color-mix(in srgb, var(--surface) 78%, transparent);
}

.title-tabs button.active {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 14%, var(--surface));
  color: var(--accent);
  box-shadow: inset 0 -3px 0 var(--accent);
}

.title-pronunciation-card .card-header {
  align-items: center;
  min-height: 50px;
  padding: 8px 14px;
}

.title-pronunciation-card .card-body {
  padding: 10px 14px;
}

.title-pronunciation-title {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
}

.title-pronunciation-title span {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.title-pronunciation-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 380px);
  gap: 12px;
  align-items: stretch;
}

.title-pronunciation-preview,
.title-pronunciation-editor {
  min-width: 0;
  border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 88%, var(--accent) 6%);
}

.title-pronunciation-preview {
  display: grid;
  gap: 7px;
  padding: 8px 10px;
}

.title-pronunciation-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.title-pronunciation-meta span {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border: 1px solid color-mix(in srgb, var(--accent) 26%, transparent);
  border-radius: 999px;
  color: color-mix(in srgb, var(--muted) 86%, var(--accent));
  font-size: 12px;
  line-height: 1;
}

.title-pronunciation-chips {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 6px;
  max-height: none;
  overflow: visible;
  padding-right: 0;
}

.title-pronunciation-chip {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-height: 24px;
  padding: 2px 8px;
  border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--line));
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface-2) 80%, var(--accent) 9%);
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.15;
  overflow: visible;
  overflow-wrap: anywhere;
  text-overflow: clip;
  white-space: normal;
}

.title-pronunciation-mark {
  color: var(--accent-3);
  font-weight: 900;
  text-shadow: 0 0 12px color-mix(in srgb, var(--accent-3) 32%, transparent);
}

.title-pronunciation-empty {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  color: var(--muted);
}

.title-pronunciation-editor {
  display: block;
  padding: 8px;
}

.title-pronunciation-card textarea {
  min-height: 58px;
  resize: vertical;
}

.title-pronunciation-mini {
  min-width: 0;
  display: grid;
  gap: 7px;
  padding: 9px 10px;
  border: 1px solid color-mix(in srgb, var(--accent) 24%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-2) 64%, var(--accent) 5%);
}

.title-pronunciation-mini-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.title-pronunciation-mini-head strong {
  font-size: 13px;
}

.title-pronunciation-mini-head span,
.title-pronunciation-more {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.title-pronunciation-mini-full .title-pronunciation-chips {
  max-height: none;
  overflow: visible;
}

.title-pronunciation-mini-full .title-pronunciation-chip {
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
}

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

.timeline-row {
  display: grid;
  grid-template-columns: minmax(130px, 180px) minmax(0, 1fr);
  gap: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--surface-3) 45%, transparent), transparent 72%),
    var(--surface);
}

.timeline-head {
  display: grid;
  align-content: start;
  gap: 4px;
}

.timeline-head strong {
  font-size: 18px;
  color: var(--accent);
}

.timeline-head span,
.timeline-stage small {
  color: var(--muted);
}

.timeline-track {
  display: grid;
  grid-template-columns: repeat(6, minmax(110px, 1fr));
  gap: 8px;
}

.timeline-stage {
  min-height: 78px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  display: grid;
  align-content: start;
  gap: 6px;
  position: relative;
  overflow: hidden;
}

.timeline-stage::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--accent);
}

.timeline-stage.done::before {
  background: var(--ok);
}

.timeline-stage.blocked::before {
  background: var(--danger);
}

.timeline-stage > span {
  font-weight: 750;
}

.timeline-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.timeline-list-v2 .timeline-track {
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
}

.timeline-stage.partial::before,
.timeline-stage.current::before {
  background: var(--warn);
}

.timeline-stage.current {
  border-color: color-mix(in srgb, var(--warn) 58%, var(--line));
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--warn) 12%, transparent), transparent 70%),
    var(--surface);
}

.timeline-stage.skipped {
  opacity: 0.68;
}

.timeline-stage em {
  color: var(--danger);
  font-style: normal;
  font-size: 12px;
  line-height: 1.3;
}

.timeline-head small {
  color: var(--muted);
  font-size: 12px;
}

.personal-work-center,
.application-funnel,
.release-readiness-panel {
  overflow: hidden;
}

.personal-work-grid,
.application-funnel-grid,
.release-readiness-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.personal-today-panel {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid color-mix(in srgb, var(--accent) 32%, var(--line));
  border-radius: 8px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 13%, transparent), transparent 62%),
    color-mix(in srgb, var(--surface-2) 54%, transparent);
}

.personal-today-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.personal-today-head strong {
  font-size: 16px;
}

.personal-today-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.personal-today-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.personal-today-action {
  position: relative;
  min-width: 0;
  display: grid;
  gap: 4px;
  align-content: start;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 80%, transparent);
  color: var(--text);
  text-align: left;
  box-shadow: none;
  overflow: hidden;
}

.personal-today-action::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--accent);
}

.personal-today-action:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--accent) 58%, var(--line));
  background: color-mix(in srgb, var(--accent) 8%, var(--surface));
}

.personal-today-action span,
.personal-today-action small {
  min-width: 0;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.personal-today-action strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.personal-today-danger::before {
  background: var(--danger);
}

.personal-today-warn::before {
  background: var(--warn);
}

.personal-today-info::before {
  background: var(--accent);
}

.personal-work-card,
.application-funnel-card {
  min-width: 0;
  min-height: 92px;
  display: grid;
  align-content: start;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  text-align: left;
  box-shadow: none;
}

.personal-work-card:hover,
.application-funnel-card:hover,
.application-funnel-card.active {
  transform: none;
  border-color: color-mix(in srgb, var(--accent) 58%, var(--line));
  background: color-mix(in srgb, var(--accent) 9%, var(--surface));
}

.personal-work-card strong,
.application-funnel-card strong {
  font-size: 28px;
  line-height: 1;
}

.personal-work-card span,
.application-funnel-card span {
  color: var(--muted);
  font-weight: 800;
}

.personal-work-card small,
.application-funnel-card small {
  color: var(--muted);
}

.personal-work-danger {
  border-color: color-mix(in srgb, var(--danger) 54%, var(--line));
}

.personal-work-warn {
  border-color: color-mix(in srgb, var(--warn) 54%, var(--line));
}

.personal-work-info {
  border-color: color-mix(in srgb, var(--accent) 54%, var(--line));
}

.personal-work-next {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.personal-work-item {
  min-width: 0;
  display: grid;
  gap: 3px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-2) 44%, transparent);
  color: var(--text);
  text-align: left;
  box-shadow: none;
}

.personal-work-item:hover {
  transform: none;
  border-color: color-mix(in srgb, var(--accent) 60%, var(--line));
}

.personal-work-item span {
  min-width: 0;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.application-role-watch {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.application-role-watch span,
.wishlist-duplicate-hint span {
  display: inline-flex;
  gap: 5px;
  align-items: center;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface-2) 52%, transparent);
  color: var(--muted);
  font-size: 12px;
}

.wishlist-duplicate-hint {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
  margin-top: 7px;
}

.wishlist-duplicate-hint strong {
  color: var(--warn);
  font-size: 12px;
}

.release-readiness-card {
  min-width: 0;
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  background: var(--surface);
}

.release-readiness-card > div:first-child {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
}

.release-readiness-card.ready {
  border-left-color: var(--ok);
}

.release-readiness-card.in-release {
  border-left-color: var(--accent);
}

.release-readiness-card.blocked {
  border-left-color: var(--danger);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--danger) 10%, transparent), transparent 72%),
    var(--surface);
}

.release-readiness-card p {
  margin: 0;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.notification-actions {
  gap: 6px;
}

.deploy-version-panel .system-status-metric strong {
  overflow-wrap: anywhere;
}

.assignment-groups {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.assignment-group {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 8px;
}

.assignment-group h4 {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.assignment-chip {
  min-height: 46px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-3) 26%, var(--surface));
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
}

.assignment-chip .pill {
  min-width: 72px;
  justify-content: center;
  text-align: center;
}

.assignment-chip span {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.assignment-chip small {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.distribution-page {
  display: grid;
  width: 100%;
  max-width: min(1240px, 100%);
  margin-inline: auto;
  gap: 14px;
}

.distribution-page .card,
.distribution-page .distribution-zone-card,
.distribution-page .distribution-setup-card,
.distribution-page .distribution-title-card {
  background: color-mix(in srgb, var(--surface) 95%, transparent);
  border-color: color-mix(in srgb, var(--line) 70%, transparent);
  box-shadow: 0 2px 12px color-mix(in srgb, #000 5%, transparent);
}

.distribution-page .card-header,
.distribution-page .distribution-title-head,
.distribution-page .distribution-self-panel,
.distribution-page .distribution-title-actions,
.distribution-page .distribution-card-signup summary,
.distribution-page .distribution-admin-filters {
  background: color-mix(in srgb, var(--surface-2) 48%, transparent);
  border-color: color-mix(in srgb, var(--line) 74%, transparent);
}

.distribution-page .card-header p,
.distribution-page .card-header small,
.distribution-page .distribution-title-main span,
.distribution-page .distribution-self-status span,
.distribution-page .distribution-admin-count,
.distribution-page .distribution-admin-empty {
  color: var(--muted);
}

.distribution-page .distribution-card-signup summary:hover,
.distribution-page .distribution-title-card:hover,
.distribution-page .distribution-role-column:hover,
.distribution-page .distribution-admin-table-wrap .data-table tr:hover td {
  background: color-mix(in srgb, var(--surface-3) 42%, var(--surface));
}

.distribution-page input,
.distribution-page select,
.distribution-page textarea {
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  border-color: color-mix(in srgb, var(--line) 74%, transparent);
  color: var(--text);
}

.distribution-page input:hover,
.distribution-page select:hover,
.distribution-page textarea:hover {
  border-color: color-mix(in srgb, var(--accent) 56%, var(--line));
  background: color-mix(in srgb, var(--surface) 99%, var(--surface-2));
}

.distribution-page select[multiple] option {
  background: color-mix(in srgb, var(--surface) 94%, var(--surface-2));
}

.distribution-page input:disabled,
.distribution-page select:disabled,
.distribution-page textarea:disabled {
  background: color-mix(in srgb, var(--surface-2) 82%, var(--surface));
  border-color: color-mix(in srgb, var(--line) 58%, transparent);
  color: color-mix(in srgb, var(--muted) 88%, transparent);
  cursor: not-allowed;
}

.distribution-page button:disabled,
.distribution-page .primary:disabled,
.distribution-page .ghost:disabled {
  opacity: 1;
  background: color-mix(in srgb, var(--surface-2) 72%, var(--surface));
  border-color: color-mix(in srgb, var(--line) 56%, transparent);
  color: color-mix(in srgb, var(--muted) 80%, transparent);
  box-shadow: none;
}

.distribution-page button:disabled:hover,
.distribution-page .primary:disabled:hover,
.distribution-page .ghost:disabled:hover {
  transform: none;
  background: color-mix(in srgb, var(--surface-2) 72%, var(--surface));
  border-color: color-mix(in srgb, var(--line) 56%, transparent);
}

.distribution-page .primary {
  color: #fff;
}

.distribution-page .danger {
  background: color-mix(in srgb, var(--danger) 8%, var(--surface));
  border-color: color-mix(in srgb, var(--danger) 68%, var(--line));
  color: var(--danger);
}

.distribution-page .danger:hover {
  background: color-mix(in srgb, var(--danger) 16%, var(--surface));
}

.distribution-page .distribution-admin-archive {
  border-left-width: 1px;
  border-right-width: 1px;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--danger) 14%, transparent);
  color: var(--danger);
}

.distribution-page .distribution-admin-archive::before {
  left: -5px;
  top: 4px;
  bottom: 4px;
  background: color-mix(in srgb, var(--danger) 52%, transparent);
}

.distribution-page .distribution-status-chip .pill,
.distribution-page .distribution-candidate-status .pill,
.distribution-page .distribution-admin-status-pill .pill {
  box-shadow: none;
  border-color: color-mix(in srgb, var(--pill-tone, var(--pill-color, currentColor)) 46%, var(--line));
  background: color-mix(in srgb, var(--pill-tone, var(--pill-color, currentColor)) 14%, var(--surface));
}

.distribution-page .distribution-limit {
  border-color: color-mix(in srgb, var(--line) 72%, transparent);
  background: color-mix(in srgb, var(--surface-2) 72%, transparent);
}

.distribution-page .distribution-limit-ok {
  background: color-mix(in srgb, var(--ok) 16%, var(--surface));
  border-color: color-mix(in srgb, var(--ok) 55%, var(--line));
  color: var(--ok);
}

.distribution-page .distribution-limit-warn {
  background: color-mix(in srgb, var(--warn) 20%, var(--surface));
  border-color: color-mix(in srgb, var(--warn) 62%, var(--line));
  color: var(--warn);
}

.distribution-page .distribution-limit-danger {
  background: color-mix(in srgb, var(--danger) 22%, var(--surface));
  border-color: color-mix(in srgb, var(--danger) 72%, var(--line));
  color: var(--danger);
}

.distribution-page .distribution-counter {
  background: color-mix(in srgb, var(--surface-2) 72%, var(--surface));
  border-color: color-mix(in srgb, var(--line) 74%, transparent);
}

.distribution-page .distribution-title-stats .distribution-counter {
  gap: 3px;
  padding: 3px 7px;
  font-size: 11px;
}

.distribution-page .distribution-title-stats .distribution-counter:first-of-type strong {
  color: var(--warn);
}

.distribution-page .distribution-title-stats .distribution-counter:last-of-type strong {
  color: var(--ok);
}

[data-theme="dark"] .distribution-page .card,
[data-theme="dark"] .distribution-page .distribution-zone-card,
[data-theme="dark"] .distribution-page .distribution-setup-card,
[data-theme="dark"] .distribution-page .distribution-title-card,
[data-theme="dark"] .distribution-page .distribution-role-column {
  border-color: color-mix(in srgb, var(--line) 62%, transparent);
  box-shadow: none;
}

[data-theme="dark"] .distribution-page .card,
[data-theme="dark"] .distribution-page .distribution-title-card,
[data-theme="dark"] .distribution-page .distribution-card-signup summary,
[data-theme="dark"] .distribution-page .distribution-admin-table-wrap .table-wrap {
  background: color-mix(in srgb, var(--surface) 88%, var(--surface-2));
}

[data-theme="dark"] .distribution-page .card-header,
[data-theme="dark"] .distribution-page .distribution-title-head,
[data-theme="dark"] .distribution-page .distribution-self-panel {
  background: color-mix(in srgb, var(--surface-2) 66%, transparent);
}

[data-theme="dark"] .distribution-page .card-header p,
[data-theme="dark"] .distribution-page .card-header small,
[data-theme="dark"] .distribution-page .distribution-title-main span,
[data-theme="dark"] .distribution-page .distribution-self-status span,
[data-theme="dark"] .distribution-page .distribution-admin-count,
[data-theme="dark"] .distribution-page .distribution-admin-empty {
  color: color-mix(in srgb, var(--muted) 92%, transparent);
}

[data-theme="dark"] .distribution-page input,
[data-theme="dark"] .distribution-page select,
[data-theme="dark"] .distribution-page textarea {
  border-color: color-mix(in srgb, var(--line) 68%, transparent);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  color: var(--text);
}

[data-theme="dark"] .distribution-page .distribution-admin-table-wrap .data-table tr:hover td {
  background: color-mix(in srgb, var(--surface-3) 24%, var(--surface));
}

[data-theme="dark"] .distribution-page .distribution-admin-table-wrap .data-table th {
  color: color-mix(in srgb, var(--muted) 88%, var(--text) 12%);
  border-bottom-color: color-mix(in srgb, var(--line) 58%, transparent);
}

[data-theme="dark"] .distribution-page .distribution-admin-table-wrap .data-table td {
  border-bottom-color: color-mix(in srgb, var(--line) 58%, transparent);
}

.distribution-page .distribution-admin-table-wrap .table-wrap {
  border: 1px solid color-mix(in srgb, var(--line) 74%, transparent);
  border-radius: 10px;
  overflow: hidden;
}

.distribution-page .distribution-admin-table-wrap .table-wrap {
  overflow-x: auto;
  overflow-y: visible;
  min-width: 0;
  width: 100%;
}

.distribution-page-header {
  padding: 4px 2px 0;
}

.distribution-page-title h1 {
  margin: 0 0 4px;
}

.distribution-page-title p {
  margin: 0;
  color: var(--muted);
}

.distribution-zones {
  display: grid;
  gap: 12px;
}

.distribution-zone {
  display: grid;
  gap: 8px;
}

.distribution-zone--admin .distribution-admin-stack {
  display: grid;
  gap: 8px;
}

.distribution-admin-filters {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr) auto auto;
  gap: 8px;
  align-items: end;
  width: 100%;
}

.distribution-admin-filter {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.distribution-admin-filter span {
  color: var(--muted);
  font-size: 11px;
}

.distribution-admin-filter select {
  width: 100%;
}

.distribution-admin-count {
  justify-self: end;
  white-space: nowrap;
  min-width: max-content;
  color: var(--muted);
}

.distribution-admin-toolbar {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.distribution-admin-toolbar button {
  min-height: 32px;
  padding-inline: 10px;
}

.distribution-admin-table-wrap {
  display: grid;
  gap: 8px;
}

.distribution-admin-table-wrap .table-wrap {
  overflow: auto;
  border-radius: 8px;
}

.distribution-admin-table-wrap .data-table {
  min-width: 1480px;
  table-layout: fixed;
}

.distribution-admin-title-with-select {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
}

.distribution-admin-title-with-select .row-check {
  margin: 0;
}

.distribution-admin-title-with-select > div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.distribution-admin-table-wrap .data-table th,
.distribution-admin-table-wrap .data-table td {
  padding: 7px 10px;
  line-height: 1.25;
  vertical-align: middle;
}

.distribution-admin-table-wrap .data-table th {
  white-space: nowrap;
}

.distribution-admin-table-wrap .data-table th:last-child {
  width: 176px;
}

.distribution-admin-table-wrap .data-table th:first-child {
  width: 42px;
}

.distribution-admin-table-wrap .data-table th:nth-child(2) {
  width: 230px;
}

.distribution-admin-table-wrap .data-table th:nth-child(3),
.distribution-admin-table-wrap .data-table th:nth-child(4) {
  width: 170px;
}

.distribution-admin-table-wrap .data-table th:nth-child(5),
.distribution-admin-table-wrap .data-table th:nth-child(6),
.distribution-admin-table-wrap .data-table th:nth-child(7) {
  width: 132px;
}

.distribution-admin-table-wrap .data-table th:nth-child(8) {
  width: 140px;
}

.distribution-admin-table-wrap .data-table th:nth-child(9) {
  width: 240px;
}

.distribution-admin-title {
  display: grid;
  gap: 4px;
  min-width: 0;
  align-content: center;
}

.distribution-admin-title strong,
.distribution-admin-title-link {
  display: block;
  min-width: 0;
  color: var(--text);
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.distribution-admin-title span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.2;
}

.distribution-title-shikimori,
.distribution-admin-title-link {
  display: block;
  min-width: 0;
  text-decoration: none;
}

.distribution-title-shikimori:hover,
.distribution-admin-title-link:hover {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.distribution-admin-empty {
  color: var(--muted);
  font-size: 11px;
  opacity: 0.8;
}

.distribution-admin-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}

.distribution-admin-chips .distribution-user-chip {
  min-height: 24px;
  padding: 2px 7px;
}

.distribution-admin-status-pill .pill {
  margin: 0;
  min-height: 22px;
}

.distribution-admin-row-actions {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
  justify-content: flex-end;
}

.distribution-admin-row-actions button {
  min-height: 28px;
  padding-inline: 9px;
  white-space: nowrap;
}

.distribution-admin-archive {
  position: relative;
  border-color: color-mix(in srgb, var(--danger) 75%, var(--line));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--danger) 12%, transparent);
}

.distribution-admin-archive::before {
  content: "";
  position: absolute;
  left: -6px;
  top: 3px;
  bottom: 3px;
  width: 1px;
  background: color-mix(in srgb, var(--danger) 45%, transparent);
}

.distribution-zone-card .card-header,
.distribution-setup-card .card-header {
  min-height: 44px;
  padding: 12px 14px;
}

.distribution-zone-card .card-body,
.distribution-setup-card .card-body {
  padding: 12px 14px;
}

.distribution-zone-card .card-header h2 {
  font-size: 15px;
}

.preference-panel {
  margin: 0;
}

.distribution-preference-actions {
  display: flex;
  justify-content: flex-end;
  min-width: 0;
}

.distribution-preference-body {
  display: grid;
  gap: 10px;
}

.distribution-load-header {
  align-items: center;
  gap: 14px;
}

.distribution-load-header > div:first-child {
  min-width: 0;
}

.distribution-load-header p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.distribution-load-panel .distribution-preference-actions {
  align-self: center;
}

.distribution-load-grid {
  display: grid;
  grid-template-columns: minmax(190px, 1.25fr) repeat(3, minmax(118px, 0.7fr)) repeat(3, minmax(138px, 0.75fr));
  gap: 10px;
  align-items: end;
}

.distribution-load-grid .field {
  min-width: 0;
}

.distribution-load-grid select,
.distribution-load-grid input {
  min-height: 40px;
}

.distribution-load-grid input[data-role-load-limit]::placeholder {
  color: color-mix(in srgb, var(--muted) 58%, transparent);
}

.distribution-load-note {
  min-height: 64px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-2) 56%, transparent);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  overflow-wrap: anywhere;
}

.distribution-load-note span,
.distribution-load-note small {
  color: var(--muted);
}

.distribution-load-note strong {
  margin: 2px 0;
  color: var(--text);
  font-size: 21px;
  line-height: 1;
}

.distribution-load-note-ok {
  border-color: color-mix(in srgb, var(--accent) 42%, var(--line));
  background: color-mix(in srgb, var(--accent) 10%, var(--surface-2));
}

.distribution-load-note-warn {
  border-color: color-mix(in srgb, var(--warn) 44%, var(--line));
  background: color-mix(in srgb, var(--warn) 12%, var(--surface-2));
}

.distribution-load-note-danger {
  border-color: color-mix(in srgb, var(--danger) 46%, var(--line));
  background: color-mix(in srgb, var(--danger) 12%, var(--surface-2));
}

.preference-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.distribution-signup-panel {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  align-items: end;
}

.distribution-signup-panel textarea {
  min-height: 44px;
  resize: vertical;
}

.distribution-signup-panel .muted {
  align-self: center;
}

.signups-details-card .card-header {
  align-items: flex-start;
}

.signups-details-card .card-header p {
  margin: 4px 0 0;
}

.signups-details-body {
  display: grid;
  gap: 12px;
}

.signups-details-help {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid color-mix(in srgb, var(--accent) 26%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent) 8%, var(--surface));
}

.signups-details-help span {
  color: var(--muted);
  line-height: 1.45;
}

.signups-details-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
  gap: 10px;
}

.signups-details-field textarea {
  min-height: 104px;
  resize: vertical;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.signups-details-roster-body {
  display: grid;
  gap: 8px;
}

.signups-details-row,
.signups-details-cardlet {
  min-width: 0;
  display: grid;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--accent) 18%, var(--line));
  border-radius: 9px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 7%, transparent), transparent 58%),
    color-mix(in srgb, var(--surface) 94%, transparent);
}

.signups-details-row.is-empty,
.signups-details-cardlet.is-empty {
  border-color: color-mix(in srgb, var(--line) 82%, transparent);
  background: color-mix(in srgb, var(--surface) 76%, transparent);
}

.signups-details-row-main,
.signups-details-cardlet-head {
  min-width: 0;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.signups-details-row .status-chip,
.signups-details-cardlet .status-chip,
.signups-details-roster .counter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  max-width: 100%;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.signups-details-row-main h3,
.signups-details-cardlet-head h3 {
  margin: 0 0 2px;
  font-size: 16px;
  overflow-wrap: anywhere;
}

.signups-details-row-main span,
.signups-details-cardlet-head span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.signups-details-row-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.signups-details-cardlet-body {
  display: grid;
  gap: 8px;
}

.signups-detail-preview,
.signups-detail-block {
  min-width: 0;
  display: grid;
  gap: 4px;
  padding: 8px 10px;
  border: 1px solid color-mix(in srgb, var(--line) 75%, transparent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-2) 52%, transparent);
}

.signups-detail-preview span,
.signups-detail-block span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .02em;
  text-transform: uppercase;
}

.signups-detail-preview p,
.signups-detail-block p {
  margin: 0;
  color: var(--text);
  line-height: 1.35;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.signups-detail-preview p {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  min-height: calc(1.35em * 2);
  overflow: hidden;
}

.signups-detail-block.is-empty p {
  color: var(--muted);
}

.signups-empty-roster {
  border: 1px dashed color-mix(in srgb, var(--line) 82%, transparent);
  border-radius: 9px;
  background: color-mix(in srgb, var(--surface) 72%, transparent);
}

.signups-empty-roster summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 42px;
  padding: 9px 12px;
  cursor: pointer;
  list-style: none;
}

.signups-empty-roster summary::-webkit-details-marker {
  display: none;
}

.signups-empty-roster summary span {
  color: var(--muted);
  font-size: 13px;
}

.signups-empty-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 0 12px 12px;
}

.signups-empty-chip {
  display: inline-grid;
  gap: 1px;
  max-width: 220px;
  padding: 7px 9px;
  border: 1px solid color-mix(in srgb, var(--line) 78%, transparent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-2) 44%, transparent);
}

.signups-empty-chip strong,
.signups-empty-chip small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.signups-empty-chip small {
  color: var(--muted);
}

.signups-details-note .card-body {
  display: grid;
  gap: 4px;
}

.signups-details-note span {
  color: var(--muted);
}

.signups-details-updated {
  margin: 0;
}

.status-chip-ok {
  color: var(--success);
}

.status-chip-muted {
  color: var(--muted);
}

.distribution-overview {
  overflow: hidden;
}

.distribution-title-list {
  display: grid;
  gap: 0;
  padding: 7px 10px 10px;
  margin: 0;
}

.distribution-title-list-head,
.distribution-title-list-row {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(138px, auto) minmax(240px, auto);
  gap: 12px;
  align-items: center;
}

.distribution-title-list-head {
  min-height: 28px;
  padding: 0 10px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.distribution-title-list-head span:last-child {
  text-align: right;
}

.distribution-title-list-row {
  min-height: 42px;
  padding: 7px 10px;
  border-top: 1px solid color-mix(in srgb, var(--line) 68%, transparent);
  background: transparent;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.distribution-title-list-row:hover {
  border-color: color-mix(in srgb, var(--accent) 34%, var(--line));
  background: color-mix(in srgb, var(--surface-2) 48%, transparent);
}

.distribution-title-list-main {
  min-width: 0;
  display: grid;
  gap: 1px;
}

.distribution-title-name-button {
  max-width: 100%;
  justify-self: start;
  min-width: 0;
  padding: 0;
  color: var(--text);
  text-align: left;
}

.distribution-title-name-button strong {
  display: block;
  min-width: 0;
  font-size: 13px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.distribution-title-name-button:hover {
  color: var(--accent);
}

.distribution-title-list-main > span {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.25;
}

.distribution-title-list-status,
.distribution-title-list-counts {
  min-width: 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
}

.distribution-title-list-status {
  justify-content: flex-start;
}

.distribution-title-list-status .pill {
  min-height: 23px;
  margin: 0;
  padding: 2px 7px;
  font-size: 11px;
}

.distribution-title-list-counts {
  justify-content: flex-end;
}

.distribution-title-list-counts span {
  min-height: 22px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
  padding: 2px 7px;
  border: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface-2) 40%, transparent);
  color: var(--muted);
  font-size: 11px;
  line-height: 1.2;
  white-space: nowrap;
}

.distribution-title-list-counts strong {
  color: var(--text);
  font-size: 11px;
  line-height: 1;
}

.distribution-title-card {
  min-width: 0;
  border: 1px solid color-mix(in srgb, var(--line) 78%, transparent);
  border-radius: 8px;
  background: var(--surface);
  overflow: hidden;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.distribution-title-card:hover {
  border-color: color-mix(in srgb, var(--accent) 50%, var(--line));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 25%, transparent);
}

.distribution-title-head {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 6px 12px;
  align-items: start;
  padding: 12px 12px 10px;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}

.distribution-title-card.collapsed .distribution-title-head {
  border-bottom: 0;
}

.distribution-title-toggle {
  width: 28px;
  min-height: 28px;
  padding: 0;
  margin-top: 1px;
  grid-row: 1 / span 2;
}

.distribution-title-main {
  min-width: 0;
  display: grid;
  gap: 3px;
  min-width: 0;
}

.distribution-title-main strong {
  font-size: 15px;
  line-height: 1.25;
  min-width: 0;
  overflow-wrap: anywhere;
}

.distribution-title-main > span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.2;
}

.distribution-title-stats {
  grid-column: 2;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.distribution-status-chip .pill,
.distribution-status-chip .status-chip,
.distribution-status-chip .muted {
  margin: 0;
}

.distribution-counter {
  min-width: 0;
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  min-height: 26px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface-2) 55%, var(--surface));
  color: var(--muted);
  font-size: 11px;
}

.distribution-counter strong {
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
}

.distribution-title-actions {
  flex: 1 1 100%;
  display: flex;
  gap: 7px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-start;
  padding-top: 2px;
  background: transparent;
  border: 0;
}

.distribution-title-select {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 30px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface-2) 55%, var(--surface));
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.distribution-title-select .row-check {
  width: 14px;
  height: 14px;
  margin: 0;
}

.distribution-title-actions button {
  min-height: 30px;
  padding: 0 10px;
  font-size: 12px;
  white-space: nowrap;
}

.distribution-self-panel {
  display: grid;
  grid-template-columns: minmax(190px, 0.75fr) minmax(280px, 1fr);
  gap: 10px;
  align-items: start;
  align-content: start;
  padding: 10px 12px;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 68%, transparent);
  background: color-mix(in srgb, var(--accent) 5%, transparent);
}

.distribution-self-status {
  min-width: 0;
  display: grid;
  gap: 4px;
  align-items: center;
}

.distribution-self-status strong {
  font-size: 13px;
}

.distribution-self-status-list {
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
}

.distribution-self-status span {
  color: var(--muted);
  font-size: 12px;
}

.distribution-self-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: start;
  justify-content: flex-start;
}

.distribution-self-actions .distribution-card-signup {
  flex: 0 1 390px;
}

.distribution-self-actions button {
  min-height: 30px;
  padding: 0 10px;
  white-space: nowrap;
}

.distribution-card-signup {
  min-width: 0;
  width: 100%;
  max-width: 100%;
}

.distribution-card-signup summary {
  min-height: 32px;
  padding: 6px 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  cursor: pointer;
  font-weight: 600;
  font-size: 12px;
  list-style: none;
  text-align: left;
}

.distribution-card-signup summary::after {
  content: "+";
  float: right;
  color: var(--muted);
  font-weight: 800;
}

.distribution-card-signup[open] summary::after {
  content: "-";
}

.distribution-card-signup-summary {
  min-height: 29px;
}

.distribution-card-signup summary::-webkit-details-marker {
  display: none;
}

.distribution-card-signup-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(140px, 1fr));
  gap: 6px;
  align-items: center;
  margin-top: 6px;
}

.distribution-card-signup-field {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.distribution-card-signup-field span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.2;
}

.distribution-card-signup-field select,
.distribution-card-signup-field textarea {
  width: 100%;
  min-width: 0;
}

.distribution-special-priority-note {
  display: block;
  line-height: 1.25;
}

.distribution-card-signup-comment,
.distribution-card-signup-form textarea,
.distribution-card-signup-form button {
  grid-column: 1 / -1;
}

.distribution-card-signup-form select,
.distribution-card-signup-form textarea {
  min-height: 32px;
}

.distribution-card-signup-form textarea {
  resize: vertical;
  min-height: 34px;
}

.distribution-card-signup-form button {
  min-height: 32px;
  font-weight: 600;
}

.distribution-overview .distribution-role-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr));
  gap: 9px;
  padding: 10px 12px 12px;
}

.distribution-role-column {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 7px;
  padding: 9px;
  border: 1px solid color-mix(in srgb, var(--line) 78%, transparent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-2) 38%, var(--surface));
}

.distribution-role-column h4 {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  line-height: 1.2;
}

.distribution-role-column h4 span {
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  padding: 1px 6px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface-2) 55%, var(--surface));
}

.distribution-candidate {
  min-width: 0;
  width: 100%;
  min-height: 58px;
  padding: 8px;
  border: 1px solid color-mix(in srgb, var(--line) 76%, transparent);
  border-radius: 7px;
  background: var(--surface);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: start;
  color: inherit;
  font: inherit;
  text-align: left;
}

.distribution-candidate.mine {
  border-color: color-mix(in srgb, var(--accent) 64%, var(--line));
  box-shadow: inset 3px 0 0 var(--accent);
}

.distribution-candidate.approved {
  background: color-mix(in srgb, var(--ok) 10%, var(--surface));
  border-color: color-mix(in srgb, var(--ok) 50%, var(--line));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ok) 30%, transparent);
}

.distribution-candidate.assigned {
  box-shadow: inset 3px 0 0 var(--ok);
}

.distribution-candidate.can-assign {
  cursor: pointer;
}

.distribution-candidate.can-assign:hover {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, var(--surface));
}

.distribution-candidate.can-remove:hover {
  border-color: var(--danger);
  background: color-mix(in srgb, var(--danger) 10%, var(--surface));
}

.distribution-candidate-main {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.distribution-candidate strong {
  font-size: 13px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.distribution-candidate span,
.distribution-candidate small,
.compact-line {
  color: var(--muted);
  font-size: 11px;
}

.distribution-candidate small {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.distribution-candidate-comment {
  margin: 2px 0 0;
  max-width: 100%;
  padding: 5px 7px;
  border: 1px solid color-mix(in srgb, var(--accent) 24%, var(--line));
  border-radius: 6px;
  background: color-mix(in srgb, var(--accent) 7%, var(--surface-2));
  color: var(--text);
  font-size: 11px;
  line-height: 1.35;
  overflow: hidden;
  overflow-wrap: anywhere;
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.distribution-candidate-comment span {
  display: block;
  margin-bottom: 2px;
  color: var(--accent);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.distribution-candidate-status {
  justify-self: end;
  align-self: start;
}

.distribution-candidate-status .pill {
  margin: 0;
}

@media (max-width: 760px) {
  .distribution-title-list {
    padding: 8px;
  }

  .distribution-title-list-head {
    display: none;
  }

  .distribution-title-list-row {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 4px 8px;
    min-height: 0;
    padding: 8px 4px;
  }

  .distribution-title-list-status {
    grid-column: 2;
    grid-row: 1;
    justify-content: flex-end;
  }

  .distribution-title-list-counts {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  .distribution-title-list-counts span {
    min-height: 20px;
    padding: 1px 6px;
    font-size: 10px;
  }

  .distribution-title-head {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .distribution-title-main {
    min-width: 0;
  }

  .distribution-title-stats {
    justify-content: flex-start;
    width: 100%;
  }

  .distribution-self-panel {
    grid-template-columns: 1fr;
  }

  .distribution-card-signup-form {
    grid-template-columns: 1fr;
  }

  .distribution-overview .distribution-role-grid {
    grid-template-columns: 1fr;
  }
}

.distribution-more {
  min-height: 28px;
  padding: 3px 8px;
  color: var(--muted);
  font-size: 12px;
}

.distribution-compact-warning {
  margin: 6px 8px 0;
  padding: 5px 8px;
  border: 1px dashed var(--line);
  border-radius: 7px;
  color: var(--muted);
  background: color-mix(in srgb, var(--warn) 8%, transparent);
  font-size: 12px;
}

.distribution-empty-roles {
  grid-column: 1 / -1;
  padding: 8px;
  border: 1px dashed var(--line);
  border-radius: 7px;
}

.distribution-wish-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

@media (max-width: 760px) {
  .distribution-page,
  .distribution-zones,
  .distribution-zone,
  .distribution-zone--admin .distribution-admin-stack {
    gap: 10px;
  }

  .distribution-page-title p {
    font-size: 13px;
  }

  .distribution-zone-card .card-header,
  .distribution-setup-card .card-header {
    min-height: 40px;
    padding: 10px 12px;
  }

  .distribution-zone-card .card-body,
  .distribution-setup-card .card-body {
    padding: 10px 12px;
  }

  .distribution-signup-panel {
    grid-template-columns: 1fr;
  }

  .distribution-load-grid {
    grid-template-columns: 1fr;
  }

  .distribution-load-header {
    align-items: stretch;
  }

  .distribution-load-panel .distribution-preference-actions,
  .distribution-load-panel .distribution-preference-actions button {
    width: 100%;
  }

  .distribution-load-note {
    min-height: 0;
    padding: 8px;
  }

  .distribution-title-head {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .distribution-title-stats {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  .distribution-self-panel,
  .distribution-card-signup-form {
    grid-template-columns: 1fr;
  }

  .distribution-card-signup {
    min-width: 0;
    width: 100%;
  }
}

.distribution-wish-tags span {
  max-width: 100%;
  padding: 2px 6px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
  color: var(--accent);
  font-size: 11px;
  line-height: 1.2;
}

.distribution-limit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  margin-left: 4px;
  padding: 1px 6px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: color-mix(in srgb, var(--surface-2) 82%, transparent);
  font-size: 11px;
  line-height: 1.35;
  white-space: nowrap;
}

.distribution-limit-ok {
  border-color: color-mix(in srgb, var(--ok) 45%, var(--line));
  color: var(--ok);
}

.distribution-limit-warn {
  border-color: color-mix(in srgb, var(--warn) 55%, var(--line));
  color: var(--warn);
  background: color-mix(in srgb, var(--warn) 12%, var(--surface));
}

.distribution-limit-danger {
  border-color: color-mix(in srgb, var(--danger) 55%, var(--line));
  color: var(--danger);
  background: color-mix(in srgb, var(--danger) 12%, var(--surface));
}

.distribution-user-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}

.distribution-user-chip {
  display: inline-flex;
  max-width: 100%;
  align-items: center;
  gap: 2px;
  padding: 3px 7px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 8%, var(--surface));
  border: 1px solid var(--line);
  white-space: nowrap;
}

.wish-badge {
  min-height: 34px;
  padding: 0 10px;
  border-radius: 999px;
}

.wish-badge.active {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 16%, var(--surface));
  color: var(--accent);
}

.compact-form {
  grid-template-columns: minmax(180px, 260px) minmax(0, 1fr);
}

@media (max-width: 760px) {
  .distribution-self-panel {
    grid-template-columns: 1fr;
  }

  .distribution-self-actions {
    justify-content: flex-start;
  }
}

.release-board {
  display: grid;
  gap: 12px;
}

.release-line {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 82%, var(--surface-3));
  overflow: hidden;
}

.release-line.overdue {
  border-color: color-mix(in srgb, var(--danger) 60%, var(--line));
}

.release-line.reupload,
.publication-episode-group.reupload {
  border-color: color-mix(in srgb, var(--warn) 64%, var(--line));
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--warn) 10%, transparent), transparent 68%),
    color-mix(in srgb, var(--surface) 88%, var(--warn) 12%);
}

.release-line-head {
  min-height: 58px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.release-line-head div:first-child {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.release-line-head span,
.release-progress span,
.platform-card small {
  color: var(--muted);
}

.release-progress {
  min-width: 76px;
  text-align: right;
  display: grid;
  gap: 2px;
}

.release-progress strong {
  color: var(--accent);
  font-size: 22px;
}

.platform-grid {
  padding: 12px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
}

.platform-card {
  min-height: 112px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--surface-3) 18%, transparent), transparent 60%),
    var(--surface);
  display: grid;
  align-content: start;
  gap: 8px;
}

.platform-card.done {
  border-color: color-mix(in srgb, var(--ok) 58%, var(--line));
}

.platform-card.overdue {
  border-color: var(--danger);
  background: color-mix(in srgb, var(--danger) 8%, var(--surface));
}

.platform-card button {
  justify-self: start;
  min-height: 30px;
}

.publication-item-actions {
  margin-top: auto;
  justify-content: flex-start;
}

.platform-card .publication-item-actions {
  display: flex;
}

.platform-link {
  color: var(--accent);
  font-weight: 850;
  text-decoration: none;
}

.platform-link:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.music-project-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  display: grid;
  gap: 12px;
}

.music-workspace {
  display: grid;
  grid-template-columns: minmax(220px, 320px) minmax(0, 1fr);
  gap: 14px;
}

.music-project-list {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 8px;
}

.music-list-item {
  min-height: 58px;
  padding: 9px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  text-align: left;
}

.music-list-item.active {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 13%, var(--surface));
}

.music-list-item span {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.music-list-item small {
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
}

.music-list-item b {
  color: var(--accent);
}

.music-project-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: start;
  flex-wrap: wrap;
}

.music-project-head h2 {
  margin: 3px 0;
}

.music-project-head p {
  margin: 0;
  color: var(--muted);
}

.music-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  color: var(--muted);
}

.music-role-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
  align-items: stretch;
}

.music-role-card {
  min-width: 0;
  min-height: 214px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-3) 22%, var(--surface));
  display: grid;
  grid-template-rows: minmax(44px, auto) minmax(24px, auto) minmax(22px, auto) auto 1fr;
  gap: 8px;
}

.music-role-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  min-height: 44px;
}

.music-role-title strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.music-role-card .pill {
  flex: 0 0 auto;
  justify-content: center;
}

.music-role-assignee,
.music-role-time {
  min-width: 0;
}

.music-role-actions {
  display: grid;
  gap: 6px;
  align-self: end;
}

.music-role-assignment {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
}

.music-role-replacement {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
}

.music-role-replacement.has-from {
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1fr) auto;
}

.music-role-replacement select,
.music-role-replacement input {
  width: 100%;
  min-width: 0;
  min-height: 34px;
}

.music-role-assignment select {
  width: 100%;
  min-width: 0;
  min-height: 34px;
}

.music-role-assignment select[multiple] {
  min-height: 86px;
  padding-block: 6px;
}

.music-role-assignment button,
.music-role-replacement button {
  white-space: nowrap;
}

.music-role-actions button {
  width: 100%;
}

.music-role-history {
  min-width: 0;
  max-height: 62px;
  overflow: auto;
  display: grid;
  gap: 2px;
  padding: 6px 8px;
  border-radius: 6px;
  background: color-mix(in srgb, var(--surface-2) 75%, transparent);
  color: var(--muted);
  font-size: 0.82rem;
}

.music-role-history span,
.music-role-history small {
  min-width: 0;
  overflow-wrap: anywhere;
}

.music-role-card.done {
  border-color: color-mix(in srgb, var(--ok) 55%, var(--line));
}

.music-role-card.review {
  border-color: color-mix(in srgb, var(--info) 58%, var(--line));
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--info) 10%, transparent), transparent 72%),
    color-mix(in srgb, var(--surface-3) 20%, var(--surface));
}

.music-role-card span,
.music-role-card small {
  color: var(--muted);
}

.info-text {
  color: var(--info);
}

.music-project-footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
}

.music-project-footer .muted {
  min-width: 0;
  overflow-wrap: anywhere;
}

.music-sound-card {
  gap: 14px;
}

.music-sound-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  color: var(--muted);
}

.music-sound-summary strong {
  color: var(--text);
}

.music-sound-submit {
  display: grid;
  grid-template-columns: minmax(220px, 1.1fr) minmax(170px, 1fr) minmax(170px, 1fr) minmax(170px, 0.9fr) auto;
  gap: 8px;
  align-items: end;
  padding: 10px;
  border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent) 8%, var(--surface));
}

.music-tune-submit {
  grid-template-columns: minmax(210px, 1.1fr) repeat(3, minmax(145px, 1fr)) minmax(145px, 0.85fr) auto;
}

.music-sound-submit > div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.music-sound-submit small {
  color: var(--muted);
}

.music-sound-file-input {
  display: grid;
  gap: 4px;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
}

.music-sound-file-input input {
  font-size: 13px;
}

.music-sound-submit input,
.music-sound-submit textarea {
  width: 100%;
  min-width: 0;
}

.music-sound-submit textarea {
  grid-column: 2 / span 3;
  min-height: 38px;
  resize: vertical;
}

.music-tune-submit textarea {
  grid-column: 2 / span 4;
}

.music-sound-version-list {
  display: grid;
  gap: 10px;
}

.music-sound-version {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-2) 58%, var(--surface));
}

.music-sound-version.needs-fixes {
  border-color: color-mix(in srgb, var(--danger) 45%, var(--line));
}

.music-sound-version.approved {
  border-color: color-mix(in srgb, var(--ok) 55%, var(--line));
}

.music-sound-version header,
.music-sound-demo-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  flex-wrap: wrap;
  min-width: 0;
}

.music-sound-version header > div,
.music-sound-demo-row span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.music-sound-version small {
  display: block;
  color: var(--muted);
}

.music-sound-audio {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid color-mix(in srgb, var(--accent) 38%, var(--line));
  border-radius: 8px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 13%, transparent), transparent 58%),
    color-mix(in srgb, var(--surface-2) 72%, var(--surface));
  box-shadow: inset 0 1px 0 color-mix(in srgb, var(--text) 7%, transparent);
  min-width: 0;
}

.music-sound-audio.is-active {
  border-color: color-mix(in srgb, var(--accent) 68%, var(--line));
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 18%, transparent), transparent 62%),
    color-mix(in srgb, var(--surface-2) 62%, var(--surface));
}

.kazoku-audio-player {
  position: relative;
  overflow: hidden;
}

.kazoku-audio-player::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: linear-gradient(180deg, var(--accent), var(--ok));
  opacity: 0.85;
}

.kazoku-audio-play {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid color-mix(in srgb, var(--accent) 52%, var(--line));
  background:
    radial-gradient(circle at 35% 28%, color-mix(in srgb, #fff 18%, transparent), transparent 36%),
    color-mix(in srgb, var(--accent) 18%, var(--surface));
  color: var(--text);
  box-shadow: 0 0 18px color-mix(in srgb, var(--accent) 16%, transparent);
  flex: 0 0 auto;
}

.kazoku-audio-play:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.kazoku-audio-icon {
  font-size: 15px;
  line-height: 1;
  margin-left: 2px;
}

.is-playing .kazoku-audio-icon {
  margin-left: 0;
}

.kazoku-audio-main {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.kazoku-audio-topline {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}

.kazoku-audio-topline strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kazoku-audio-label {
  flex: 0 0 auto;
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.kazoku-audio-controls {
  display: grid;
  grid-template-columns: auto minmax(90px, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.kazoku-audio-time {
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.kazoku-audio-range {
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background:
    linear-gradient(90deg, var(--accent) 0 var(--progress, 0%), color-mix(in srgb, var(--text) 16%, transparent) var(--progress, 0%) 100%);
  cursor: pointer;
}

.kazoku-audio-range:disabled {
  cursor: default;
  opacity: 0.62;
}

.kazoku-audio-range::-webkit-slider-thumb {
  appearance: none;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 2px solid color-mix(in srgb, var(--surface) 78%, #000);
  background: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent);
}

.kazoku-audio-range::-moz-range-thumb {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  border: 2px solid color-mix(in srgb, var(--surface) 78%, #000);
  background: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent);
}

.kazoku-audio-subtitle,
.kazoku-audio-error {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kazoku-audio-error {
  color: var(--danger);
}

.kazoku-audio-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  min-width: max-content;
}

.kazoku-floating-audio {
  position: fixed;
  right: clamp(12px, 2vw, 28px);
  bottom: clamp(12px, 2vw, 28px);
  z-index: 60;
  width: min(520px, calc(100vw - 24px));
  pointer-events: none;
}

.kazoku-floating-audio .kazoku-audio-player {
  pointer-events: auto;
  border-color: color-mix(in srgb, var(--accent) 70%, var(--line));
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 22%, transparent), transparent 62%),
    color-mix(in srgb, var(--surface) 94%, #000);
  box-shadow:
    0 18px 44px color-mix(in srgb, #000 34%, transparent),
    0 0 0 1px color-mix(in srgb, var(--accent) 18%, transparent);
}

.music-sound-audio-list {
  display: grid;
  gap: 8px;
}

.music-sound-audio > div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.music-sound-audio strong {
  color: var(--text);
}

.music-sound-audio audio {
  width: 100%;
  min-width: 0;
}

.music-sound-comments {
  display: grid;
  gap: 10px;
  padding: 10px;
  border: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-2) 42%, transparent);
}

.music-sound-comments-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.music-sound-comments-head strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.music-sound-comments-head span {
  flex: 0 0 auto;
  padding: 3px 8px;
  border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--line));
  border-radius: 999px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 850;
  line-height: 1.2;
}

.music-sound-comment-list {
  display: grid;
  gap: 8px;
}

.music-sound-comment {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid color-mix(in srgb, var(--line) 64%, transparent);
  border-radius: 7px;
  background: color-mix(in srgb, var(--surface) 78%, transparent);
}

.music-sound-comment-body {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.music-sound-comments p {
  margin: 0;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.music-sound-empty-note {
  display: grid;
  gap: 2px;
  padding: 10px;
  border: 1px dashed color-mix(in srgb, var(--accent) 34%, var(--line));
  border-radius: 8px;
  color: var(--muted);
  background: color-mix(in srgb, var(--accent) 5%, transparent);
}

.music-sound-empty-note strong {
  color: var(--text);
}

.music-sound-replies {
  display: grid;
  gap: 8px;
  margin-top: 8px;
  padding-left: 12px;
  border-left: 2px solid rgba(87, 214, 209, 0.35);
}

.music-sound-reply {
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(87, 214, 209, 0.08);
}

.music-sound-comment-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: end;
}

.music-sound-reply-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin-top: 8px;
  align-items: end;
}

.music-sound-comment-form textarea {
  min-height: 58px;
  max-height: 260px;
  resize: vertical;
}

.music-sound-reply-form textarea {
  min-height: 48px;
  max-height: 220px;
  resize: vertical;
}

.music-sound-comment-form textarea,
.music-sound-reply-form textarea {
  width: 100%;
  line-height: 1.38;
}

.music-sound-comment-form button,
.music-sound-reply-form button {
  min-height: 42px;
}

input.input-invalid,
select.input-invalid,
textarea.input-invalid {
  border-color: var(--danger) !important;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--danger) 8%, transparent), transparent),
    color-mix(in srgb, var(--surface) 92%, transparent) !important;
  box-shadow:
    0 0 0 3px color-mix(in srgb, var(--danger) 18%, transparent),
    var(--ui-inset) !important;
}

.lyric-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(14px, 1.4vw, 24px);
}

.lyric-workspace > .music-project-list {
  display: grid;
  grid-template-columns: minmax(360px, 520px) minmax(0, 1fr);
  gap: 10px;
  align-items: stretch;
  min-width: 0;
  position: static;
  top: auto;
  max-height: none;
  overflow: visible;
  padding: 12px;
  border: 1px solid color-mix(in srgb, var(--line) 82%, var(--accent) 18%);
  border-radius: 10px;
  background:
    linear-gradient(120deg, color-mix(in srgb, var(--accent) 10%, transparent), transparent 42%),
    color-mix(in srgb, var(--surface-2) 72%, var(--surface));
}

.lyric-text-create {
  display: grid;
  grid-template-columns: minmax(70px, auto) minmax(0, 1fr);
  gap: 8px 10px;
  align-content: center;
  min-width: 0;
}

.lyric-text-create > .split {
  grid-row: 1 / span 2;
  align-self: center;
  min-width: 70px;
}

.lyric-text-create .inline-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  min-width: 0;
}

.lyric-text-create button {
  white-space: nowrap;
}

.lyric-workspace > .music-project-list select {
  width: 100%;
}

.lyric-text-tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 10px;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
}

.lyric-workspace > .music-project-list .music-list-item {
  flex: 0 0 clamp(190px, 20vw, 290px);
  align-self: stretch;
}

@media (max-width: 980px) {
  .lyric-workspace > .music-project-list {
    grid-template-columns: minmax(0, 1fr);
  }

  .lyric-text-create {
    grid-template-columns: minmax(0, 1fr);
  }

  .lyric-text-create > .split {
    grid-row: auto;
  }
}

.lyric-empty {
  display: grid;
  gap: 12px;
}

.lyric-editor-card {
  min-width: 0;
  padding: clamp(14px, 1.35vw, 24px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  display: grid;
  gap: 14px;
}

.lyric-editor-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, auto);
  align-items: flex-start;
  gap: 14px;
}

.lyric-editor-title {
  min-width: 0;
}

.lyric-editor-head h2 {
  margin: 3px 0;
  overflow-wrap: anywhere;
}

.lyric-editor-head p {
  margin: 0;
  color: var(--muted);
}

.lyric-editor-actions {
  display: grid;
  gap: 8px;
  justify-items: end;
  align-content: start;
  min-width: 0;
}

.lyric-action-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
}

.lyric-submit-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto auto;
  width: min(560px, 100%);
}

.lyric-submit-row select {
  min-width: 0;
  width: 100%;
}

.lyric-title-link {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--accent) 64%, transparent);
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

.lyric-title-link:hover,
.lyric-title-link:focus-visible {
  color: color-mix(in srgb, var(--accent) 82%, var(--text));
}

.lyric-source-field {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 10px;
  border: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-2) 42%, transparent);
}

.lyric-source-field span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.lyric-source-field small {
  color: var(--muted);
  line-height: 1.35;
}

.lyric-assignee-control {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: wrap;
  width: min(360px, 100%);
}

.lyric-assignee-control span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.lyric-assignee-control select {
  min-width: min(220px, 100%);
}

.lyric-editor-layout {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.lyric-editor-card .lyric-editor-layout {
  grid-template-columns: minmax(0, 1fr);
}

.lyric-main,
.lyric-side {
  min-width: 0;
  display: grid;
  gap: 12px;
}

.lyric-editor-pair {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(250px, 1fr) minmax(220px, 0.82fr) minmax(320px, 1.18fr);
  gap: clamp(10px, 1vw, 18px);
  align-items: stretch;
}

.lyric-editor-box {
  min-width: 0;
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.lyric-editor {
  width: 100%;
  min-height: min(62vh, 720px);
  resize: vertical;
  padding: clamp(14px, 1vw, 20px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 94%, var(--accent) 6%);
  color: var(--text);
  line-height: 1.7;
  white-space: pre-wrap;
}

.lyric-workflow-hint {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 14px;
  padding: 10px 14px;
}

.lyric-workflow-hint strong {
  flex: 0 0 auto;
}

.lyric-workflow-hint span {
  flex: 1 1 360px;
  color: var(--muted);
}

.lyric-feedback-desk {
  grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr));
  align-items: start;
  gap: clamp(10px, 1vw, 16px);
  padding: clamp(12px, 1.2vw, 20px);
  border: 1px solid color-mix(in srgb, var(--line) 84%, var(--accent) 16%);
  border-radius: 12px;
  background:
    radial-gradient(circle at top right, color-mix(in srgb, var(--accent) 13%, transparent), transparent 34rem),
    color-mix(in srgb, var(--surface-2) 64%, var(--surface));
}

.lyric-feedback-desk .lyric-comment-form {
  align-self: stretch;
}

.lyric-feedback-head {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  align-items: end;
  justify-content: space-between;
  padding-bottom: 2px;
}

.lyric-feedback-head h3,
.lyric-feedback-head p {
  margin: 0;
}

.lyric-feedback-head h3 {
  margin-top: 3px;
  font-size: clamp(18px, 1.35vw, 24px);
}

.lyric-feedback-head p {
  flex: 1 1 390px;
  max-width: 720px;
  color: var(--muted);
  line-height: 1.45;
}

.lyric-feedback-desk > .lyric-comment-list {
  align-content: start;
  max-height: min(62vh, 720px);
  overflow: auto;
}

.lyric-feedback-desk > .lyric-chat-panel {
  min-height: 100%;
}

.lyric-editor-layout > .lyric-feedback-desk {
  grid-template-columns:
    minmax(220px, 0.9fr)
    minmax(280px, 1.18fr)
    minmax(320px, 1.5fr);
}

.lyric-editor-layout > .lyric-feedback-desk .lyric-comment-form,
.lyric-editor-layout > .lyric-feedback-desk .lyric-comment-list {
  min-width: 0;
  width: 100%;
}

@media (max-width: 760px) {
  .lyric-feedback-desk {
    grid-template-columns: minmax(0, 1fr);
  }

  .lyric-feedback-desk > .lyric-comment-list {
    max-height: none;
  }
}

.lyric-editor-original {
  min-height: min(62vh, 720px);
  background: color-mix(in srgb, var(--surface-2) 68%, var(--info) 8%);
}

.lyric-original-preview {
  min-width: 0;
  padding: 12px;
  border: 1px solid color-mix(in srgb, var(--info) 42%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, var(--info) 9%, var(--surface));
  display: grid;
  gap: 8px;
}

.lyric-original-preview pre {
  max-height: 260px;
  overflow: auto;
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: var(--text);
  font: inherit;
  line-height: 1.55;
}

.lyric-compare-grid {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(220px, 0.82fr) minmax(340px, 1.2fr);
  gap: 12px;
  align-items: stretch;
}

.lyric-compare-window {
  min-width: 0;
  height: clamp(360px, 48vh, 560px);
  overflow: auto;
  border: 1px solid color-mix(in srgb, var(--line) 82%, transparent);
  border-radius: 8px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--surface-2) 32%, transparent), transparent 72px),
    color-mix(in srgb, var(--surface) 84%, transparent);
  scrollbar-gutter: stable;
}

.lyric-compare-header,
.lyric-compare-window .lyric-compare-grid {
  min-width: min(1120px, 100%);
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(240px, 0.9fr) minmax(360px, 1.24fr) !important;
}

.lyric-compare-header {
  position: sticky;
  z-index: 3;
  top: 0;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--accent) 8%, transparent), transparent 46%),
    color-mix(in srgb, var(--surface) 94%, var(--surface-2));
  box-shadow: 0 6px 14px color-mix(in srgb, #000 8%, transparent);
}

.lyric-compare-head-cell {
  min-width: 0;
  padding: 7px 10px;
  display: flex;
  gap: 8px;
  justify-content: space-between;
  align-items: center;
  border-right: 1px solid color-mix(in srgb, var(--line) 62%, transparent);
  color: var(--muted);
  font-size: 12px;
}

.lyric-compare-head-cell:last-child {
  border-right: 0;
}

.lyric-compare-head-cell strong {
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lyric-compare-head-cell span {
  flex: 0 0 auto;
  color: var(--muted);
}

.lyric-compare-body {
  min-width: min(1120px, 100%);
}

.lyric-compare-window .lyric-compare-grid {
  gap: 0;
  align-items: stretch;
}

.lyric-compare-window .lyric-preview-shell {
  min-width: 0;
  padding: 8px;
  display: block;
  border-right: 1px solid color-mix(in srgb, var(--line) 58%, transparent);
}

.lyric-compare-window .lyric-preview-shell:last-child {
  border-right: 0;
}

.lyric-compare-window .lyric-preview {
  height: auto;
  max-height: none;
  overflow: visible;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  gap: 5px;
}

.lyric-compare-window .lyric-line {
  padding: 7px 9px;
  border-color: color-mix(in srgb, var(--line) 72%, transparent);
  border-radius: 6px;
}

.lyric-compare-window .lyric-line span {
  flex-basis: 30px;
}

.lyric-preview-shell {
  min-width: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 7px;
}

.lyric-preview-shell.original .lyric-preview {
  border-color: color-mix(in srgb, var(--info) 45%, var(--line));
  background: color-mix(in srgb, var(--info) 8%, var(--surface-2));
}

.lyric-compare-window .lyric-preview-shell.original .lyric-preview {
  border-color: transparent;
  background: transparent;
}

.lyric-preview-title {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
}

.lyric-preview-title strong {
  color: var(--text);
}

.lyric-save-state {
  min-height: 24px;
  color: var(--muted);
  font-size: 13px;
}

.lyric-save-state.error {
  color: var(--danger);
}

.lyric-preview {
  height: clamp(360px, 48vh, 560px);
  max-height: none;
  overflow: auto;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-2) 34%, transparent);
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: stretch;
}

.lyric-line {
  flex: 0 0 auto;
  min-height: 0;
  height: auto;
  padding: 8px 10px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  cursor: text;
  user-select: text;
  overflow: visible;
}

.lyric-line.is-reference {
  cursor: default;
  background: color-mix(in srgb, var(--surface) 82%, var(--info) 8%);
}

.lyric-line span {
  flex: 0 0 34px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.lyric-line p {
  flex: 1 1 auto;
  margin: 0;
  min-width: 0;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  overflow: visible;
}

.lyric-mark {
  padding: 1px 3px;
  border-radius: 4px;
  background: color-mix(in srgb, var(--info) 38%, transparent);
  color: var(--text);
}

.lyric-mark.note {
  background: color-mix(in srgb, var(--info) 42%, transparent);
  outline: 1px solid color-mix(in srgb, var(--info) 52%, transparent);
}

.lyric-mark.beta {
  background: color-mix(in srgb, var(--danger) 28%, transparent);
}

.lyric-mark.fixed {
  background: color-mix(in srgb, var(--ok) 30%, transparent);
  outline: 1px solid color-mix(in srgb, var(--ok) 55%, transparent);
}

.lyric-mark.accepted {
  background: color-mix(in srgb, var(--warn) 34%, transparent);
  outline: 1px solid color-mix(in srgb, var(--warn) 58%, transparent);
}

.lyric-line b {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  min-height: 24px;
  border-radius: 999px;
  color: var(--text);
  background: color-mix(in srgb, var(--accent) 20%, var(--surface));
}

.lyric-line.has-note {
  border-color: color-mix(in srgb, var(--info) 65%, var(--line));
  background: color-mix(in srgb, var(--info) 12%, var(--surface));
}

.lyric-line.has-beta {
  border-color: color-mix(in srgb, var(--danger) 68%, var(--line));
  background: color-mix(in srgb, var(--danger) 11%, var(--surface));
}

.lyric-line.has-fixed {
  border-color: color-mix(in srgb, var(--ok) 70%, var(--line));
  background: color-mix(in srgb, var(--ok) 13%, var(--surface));
}

.lyric-line.has-accepted {
  border-color: color-mix(in srgb, var(--warn) 68%, var(--line));
  background: color-mix(in srgb, var(--warn) 13%, var(--surface));
}

.lyric-comment-form {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-3) 28%, transparent);
  display: grid;
  gap: 8px;
}

.lyric-comment-form small {
  color: var(--muted);
  line-height: 1.35;
}

.lyric-comment-form input,
.lyric-comment-form textarea,
.lyric-comment-form button,
.music-project-list select {
  width: 100%;
}

.lyric-comment-form textarea {
  min-height: 88px;
  resize: vertical;
}

.lyric-comment-list {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-2) 26%, transparent);
  display: grid;
  gap: 8px;
}

.lyric-comment-list article {
  min-width: 0;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.lyric-comment-list span,
.lyric-comment-list small {
  color: var(--muted);
}

.lyric-comment-line-link {
  width: fit-content;
  max-width: 100%;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.lyric-comment-line-link span {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.lyric-comment-line-link:hover,
.lyric-comment-line-link:focus-visible {
  color: color-mix(in srgb, var(--accent) 78%, var(--text));
  outline: none;
}

.lyric-comment-source {
  display: block;
  overflow-wrap: anywhere;
}

.lyric-comment-list p {
  margin: 5px 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.lyric-comment-list a {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lyric-comment-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.lyric-comment-actions button {
  min-height: 30px;
  padding: 4px 8px;
  font-size: 12px;
}

.lyric-comment-actions.compact {
  margin-top: 5px;
}

.lyric-comment-thread {
  display: grid;
  gap: 7px;
}

.lyric-comment-thread.beta {
  border-color: color-mix(in srgb, var(--danger) 45%, var(--line));
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--danger) 9%, transparent), transparent 60%),
    var(--surface);
}

.lyric-comment-thread.fixed {
  border-color: color-mix(in srgb, var(--ok) 54%, var(--line));
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--ok) 12%, transparent), transparent 60%),
    var(--surface);
}

.lyric-comment-thread.accepted {
  border-color: color-mix(in srgb, var(--warn) 54%, var(--line));
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--warn) 13%, transparent), transparent 60%),
    var(--surface);
}

.lyric-line.is-jump-highlight {
  animation: lyric-line-jump 1.25s ease both;
}

@keyframes lyric-line-jump {
  0% {
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 42%, transparent);
    border-color: color-mix(in srgb, var(--accent) 65%, var(--line));
  }
  45% {
    box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent) 18%, transparent);
    background: color-mix(in srgb, var(--accent) 16%, var(--surface));
  }
  100% {
    box-shadow: 0 0 0 0 transparent;
  }
}

.lyric-comment-replies {
  display: grid;
  gap: 6px;
  margin-top: 3px;
  padding-left: 10px;
  border-left: 2px solid color-mix(in srgb, var(--accent) 45%, var(--line));
}

.lyric-comment-reply {
  min-width: 0;
  padding: 8px 9px;
  border: 1px solid color-mix(in srgb, var(--line) 78%, var(--accent) 22%);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-2) 54%, transparent);
}

.lyric-comment-reply.mine {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--line));
  background: color-mix(in srgb, var(--accent) 10%, var(--surface));
}

.lyric-inline-reply {
  display: none;
  gap: 8px;
  padding: 8px;
  border: 1px solid color-mix(in srgb, var(--accent) 38%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent) 8%, var(--surface));
}

.lyric-inline-reply.open {
  display: grid;
}

.lyric-inline-reply textarea {
  width: 100%;
  min-height: 92px;
  max-height: 240px;
  resize: vertical;
  font-size: 13px;
  line-height: 1.45;
}

.lyric-inline-reply-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
}

@media (max-width: 620px) {
  .lyric-inline-reply-actions button {
    flex: 1 1 100%;
  }

  .lyric-chat-head {
    flex-wrap: wrap;
  }

  .lyric-chat-head button {
    width: 100%;
  }
}

.lyric-chat-panel {
  min-width: 0;
  padding: 12px;
  border: 1px solid color-mix(in srgb, var(--accent) 36%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent) 8%, var(--surface-2));
  display: grid;
  gap: 10px;
}

.lyric-chat-wide {
  grid-column: 1 / -1;
  width: 100%;
  border-radius: 10px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 10%, transparent), transparent 58%),
    color-mix(in srgb, var(--surface-2) 82%, var(--surface));
}

.lyric-chat-panel.is-pinned {
  position: sticky;
  bottom: 12px;
  z-index: 30;
  box-shadow:
    0 18px 44px color-mix(in srgb, #000 32%, transparent),
    0 1px 0 color-mix(in srgb, var(--accent) 28%, transparent) inset;
}

.lyric-chat-head {
  min-width: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.lyric-chat-head > div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.lyric-chat-head strong {
  color: var(--text);
}

.lyric-chat-head small {
  color: var(--muted);
  line-height: 1.35;
}

.lyric-chat-head button.active {
  border-color: color-mix(in srgb, var(--accent) 70%, var(--line));
  background: color-mix(in srgb, var(--accent) 18%, var(--surface));
}

.lyric-chat-messages {
  max-height: min(34vh, 340px);
  overflow: auto;
  display: grid;
  gap: 8px;
  padding-right: 3px;
}

.lyric-chat-messages article {
  min-width: 0;
  padding: 8px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.lyric-chat-messages article.mine {
  border-color: color-mix(in srgb, var(--accent) 46%, var(--line));
  background: color-mix(in srgb, var(--accent) 10%, var(--surface));
}

.lyric-chat-messages small {
  color: var(--muted);
}

.lyric-chat-messages p {
  margin: 4px 0 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.lyric-chat-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: stretch;
}

.lyric-chat-form textarea {
  min-height: 56px;
  max-height: 170px;
  resize: vertical;
  line-height: 1.45;
}

.lyric-chat-form button {
  min-height: 56px;
}

.lyric-library {
  display: grid;
  gap: 12px;
}

.lyric-library-item {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--success) 9%, transparent), transparent 64%),
    var(--surface);
  overflow: hidden;
}

.lyric-library-item[open] {
  border-color: color-mix(in srgb, var(--success) 42%, var(--line));
}

.lyric-library-item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  cursor: pointer;
  list-style: none;
}

.lyric-library-item summary::-webkit-details-marker {
  display: none;
}

.lyric-library-item summary > span:first-child {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.lyric-library-item summary strong,
.lyric-library-item summary small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lyric-library-item summary small,
.lyric-library-meta {
  color: var(--muted);
  font-size: 13px;
}

.lyric-library-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 14px 12px;
}

.lyric-library-meta span {
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface-2) 72%, transparent);
}

.lyric-library-preview {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 0 14px 14px;
}

.lyric-library-preview article {
  min-width: 0;
  display: grid;
  gap: 8px;
}

.lyric-library-preview pre {
  max-height: 300px;
  overflow: auto;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-2) 76%, transparent);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: var(--text);
  font: inherit;
  line-height: 1.55;
}

.lyric-library-item .inline-actions {
  padding: 0 14px 14px;
}

.compact-profile {
  gap: 12px;
}

.youtube-board {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
}

.youtube-column {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-2) 28%, transparent);
  display: grid;
  align-content: start;
  gap: 10px;
}

.youtube-card {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  display: grid;
  gap: 6px;
}

.youtube-card span,
.youtube-card small {
  color: var(--muted);
}

.compact-empty {
  min-height: 48px;
  padding: 10px;
}

.profile-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent-4) 12%, var(--surface)), transparent 64%),
    linear-gradient(315deg, color-mix(in srgb, var(--accent-3) 12%, transparent), transparent 70%),
    var(--surface);
  box-shadow: var(--shadow);
}

.profile-card .table-wrap table {
  min-width: 720px;
}

.profile-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.profile-head h2 {
  margin: 4px 0 4px;
  font-size: clamp(22px, 2vw, 26px);
}

.profile-head p {
  margin: 0;
  color: var(--muted);
}

.profile-status {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.profile-card-luxury {
  position: relative;
  overflow: hidden;
  padding: 14px;
  border-color: color-mix(in srgb, var(--accent) 26%, var(--line));
  background:
    radial-gradient(circle at 6% 0%, color-mix(in srgb, var(--accent) 20%, transparent), transparent 28%),
    linear-gradient(135deg, color-mix(in srgb, var(--surface-3) 72%, var(--accent) 9%), color-mix(in srgb, var(--surface) 90%, transparent) 58%),
    var(--surface);
}

.profile-card-luxury::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--accent) 34%, transparent), transparent 18%, transparent 78%, color-mix(in srgb, var(--accent-4) 18%, transparent));
  opacity: 0.26;
}

.profile-card-luxury > * {
  position: relative;
  z-index: 1;
}

.profile-hero {
  display: grid;
  grid-template-columns: 66px minmax(0, 1fr) minmax(230px, auto);
  gap: 14px;
  align-items: stretch;
  min-width: 0;
  padding: 14px;
  border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--line));
  border-radius: 8px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 13%, var(--surface-2)), color-mix(in srgb, var(--surface) 88%, transparent)),
    var(--surface);
  box-shadow: inset 0 1px 0 color-mix(in srgb, #fff 12%, transparent);
}

.profile-avatar {
  width: 66px;
  height: 66px;
  border: 1px solid color-mix(in srgb, var(--accent) 48%, var(--line));
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 30px;
  font-weight: 900;
  line-height: 1;
  background:
    radial-gradient(circle at 35% 28%, color-mix(in srgb, #fff 30%, transparent), transparent 25%),
    linear-gradient(145deg, color-mix(in srgb, var(--accent) 92%, #16746c), color-mix(in srgb, var(--accent-4) 82%, #6d5e24));
  box-shadow:
    0 14px 32px color-mix(in srgb, var(--accent) 24%, transparent),
    inset 0 1px 0 color-mix(in srgb, #fff 22%, transparent);
}

.profile-hero-main,
.profile-hero-aside,
.profile-hero-rating,
.profile-hero-meta,
.profile-hero-roles,
.profile-hero-badges {
  min-width: 0;
}

.profile-hero-main {
  display: grid;
  gap: 7px;
  align-content: center;
}

.profile-hero-main h2 {
  margin: 0;
  font-size: 26px;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.profile-hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.profile-hero-meta span {
  max-width: 100%;
  min-width: 0;
  padding: 3px 8px;
  border: 1px solid color-mix(in srgb, var(--line) 76%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 72%, transparent);
  color: var(--muted);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-hero-roles .role-pill-list,
.profile-hero-badges .operational-status-badges {
  max-width: 100%;
  justify-content: flex-start;
}

.profile-hero-aside {
  display: grid;
  gap: 8px;
  align-content: center;
  justify-items: end;
}

.profile-hero-rating {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.profile-hero-rating .rating-compact {
  max-width: 100%;
}

.profile-metrics-luxury {
  grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
}

.profile-metrics-luxury .profile-metric {
  min-height: 58px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 12%, var(--surface)), color-mix(in srgb, var(--surface-2) 74%, transparent)),
    var(--surface);
}

.profile-metrics-luxury .profile-metric strong {
  font-size: 22px;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.status-stack {
  display: inline-flex;
  max-width: 100%;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
}

.status-stack .pill {
  flex: 0 1 auto;
  min-width: 0;
}

.source-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.source-chip {
  display: inline-flex;
  max-width: 100%;
  min-width: 0;
  align-items: center;
  gap: 6px;
  padding: 3px 7px;
  border: 1px solid color-mix(in srgb, var(--accent) 36%, var(--line));
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 10%, var(--surface));
  font-size: 12px;
}

.source-chip strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.source-chip .mini-link {
  min-height: 0;
}

.user-inline-link {
  display: inline;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--accent);
  font: inherit;
  font-weight: 800;
  line-height: inherit;
  text-align: left;
  vertical-align: baseline;
  cursor: pointer;
}

.user-inline-link:hover,
.user-inline-link:focus-visible {
  color: var(--accent-2);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.distribution-user-link,
.source-chip .user-inline-link {
  color: inherit;
}

.source-chip .user-inline-link {
  display: inline-block;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.team-compact-list {
  display: grid;
  gap: 8px;
}

.team-compact-card {
  display: grid;
  grid-template-columns:
    minmax(160px, 0.95fr)
    minmax(210px, 1.35fr)
    minmax(140px, 0.78fr)
    minmax(130px, 0.72fr)
    minmax(190px, max-content);
  gap: 10px;
  align-items: stretch;
  min-width: 0;
  min-height: 82px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 88%, var(--surface-3));
  text-align: left;
}

.team-compact-card > * {
  align-self: stretch;
  justify-self: start;
  min-height: 100%;
}

.team-compact-card.selected {
  border-color: color-mix(in srgb, var(--accent) 70%, var(--line));
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
}

.team-compact-main {
  display: grid;
  gap: 3px;
  align-items: center;
  justify-items: start;
  min-width: 0;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  text-align: left;
  align-content: center;
}

.team-compact-main:hover {
  transform: none;
  color: var(--accent);
}

.team-compact-main strong,
.team-compact-main span,
.team-compact-meta span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.team-compact-meta-line {
  min-width: 0;
  display: grid;
  gap: 1px;
  justify-items: start;
  text-align: left;
}

.team-compact-nick,
.team-compact-contact {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.team-compact-nick.music {
  color: color-mix(in srgb, var(--accent-2) 76%, var(--muted));
}

.team-compact-contact {
  color: var(--muted);
  font-size: 11px;
}

.team-compact-main span,
.team-compact-meta {
  color: var(--muted);
}

.team-compact-roles,
.team-compact-status,
.team-compact-actions,
.team-compact-meta {
  min-width: 0;
  max-width: 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  align-content: center;
  justify-content: flex-start;
}

.team-compact-roles {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.team-compact-roles .role-pill-list {
  width: 100%;
  align-items: center;
  align-content: center;
  justify-content: flex-start;
}

.team-compact-roles .role-pill {
  max-width: 100%;
  white-space: nowrap;
}

.team-compact-meta,
.team-compact-status {
  justify-content: flex-start;
  text-align: left;
}

.team-compact-actions {
  justify-content: flex-end;
  align-items: center;
  justify-self: end;
  flex-wrap: wrap;
}

.team-compact-actions button {
  min-height: 30px;
  padding: 5px 8px;
  font-size: 13px;
}

.profile-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.profile-metric {
  min-height: 68px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 82%, var(--accent) 8%);
  display: grid;
  align-content: center;
  gap: 3px;
}

.profile-metric span {
  color: var(--muted);
  font-size: 13px;
}

.profile-metric strong {
  font-size: 24px;
  color: var(--accent-4);
}

.profile-layout {
  display: grid;
  grid-template-columns: minmax(260px, 0.85fr) minmax(360px, 1.35fr);
  gap: 12px;
  align-items: start;
}

.profile-panel {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-2) 30%, transparent);
}

.profile-columns {
  display: grid;
  grid-template-columns: minmax(260px, 0.8fr) minmax(0, 1.2fr);
  gap: 14px;
}

.profile-columns h3,
.profile-card h3 {
  margin: 0 0 10px;
  font-size: 15px;
}

.profile-info-list,
.profile-assignment-list,
.profile-activity-list {
  display: grid;
  gap: 8px;
}

.profile-info-row {
  display: grid;
  grid-template-columns: minmax(96px, 130px) minmax(0, 1fr);
  gap: 10px;
  align-items: baseline;
  padding: 8px 0;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 78%, transparent);
}

.profile-info-row:last-child {
  border-bottom: 0;
}

.profile-info-row span {
  color: var(--muted);
}

.profile-info-row strong,
.profile-assignment-row strong,
.profile-activity-item strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.profile-assignment-list {
  max-height: 260px;
  overflow: auto;
  padding-right: 4px;
}

.profile-assignment-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 9px 10px;
  border: 1px solid color-mix(in srgb, var(--line) 76%, transparent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 78%, transparent);
}

.profile-assignment-row > div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.profile-assignment-row span {
  color: var(--muted);
  overflow-wrap: anywhere;
}

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

.profile-section-head h3 {
  margin: 0;
}

.profile-section-head span {
  color: var(--muted);
  font-size: 12px;
}

.profile-activity-list {
  max-height: 340px;
  overflow: auto;
  padding-right: 4px;
}

.profile-activity-item {
  display: grid;
  grid-template-columns: minmax(86px, 120px) minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 9px 10px;
  border: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 76%, transparent);
}

.profile-activity-item > span {
  color: var(--accent);
  font-weight: 700;
}

.profile-activity-item > div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.profile-activity-item small {
  color: var(--muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.profile-activity-item time {
  color: var(--muted);
  white-space: nowrap;
  font-size: 13px;
}

.profile-role-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 8px;
}

.profile-role-stat {
  min-width: 0;
  padding: 10px;
  border: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 76%, transparent);
  display: grid;
  gap: 3px;
}

.profile-role-stat span,
.profile-role-stat small {
  color: var(--muted);
}

.profile-role-stat strong {
  color: var(--accent);
  font-size: 20px;
}

.rating-panel {
  border-color: color-mix(in srgb, var(--accent) 32%, var(--line));
}

.release-rating-panel {
  border-color: color-mix(in srgb, var(--ok) 30%, var(--line));
}

.rating-hero {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-2) 78%, var(--accent) 8%);
  min-width: 0;
}

.rating-hero > div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.rating-hero strong,
.rating-hero span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.rating-hero span,
.rating-role-card small,
.rating-compact small {
  color: var(--muted);
}

.rating-explainer {
  margin-top: 8px;
  border: 1px solid color-mix(in srgb, var(--line) 76%, transparent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 72%, transparent);
  overflow: hidden;
}

.rating-explainer summary {
  min-height: 38px;
  padding: 9px 11px;
  cursor: pointer;
  color: var(--accent);
  font-weight: 800;
  list-style-position: inside;
}

.rating-explainer summary:hover {
  background: color-mix(in srgb, var(--accent) 8%, transparent);
}

.rating-explainer-body {
  display: grid;
  gap: 8px;
  padding: 0 11px 11px;
  color: var(--text);
}

.rating-explainer-body p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.rating-explainer-body ul {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 5px;
}

.rating-explainer-body li {
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.rating-role-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.rating-role-card {
  display: grid;
  gap: 5px;
  align-content: start;
  padding: 9px;
  border: 1px solid color-mix(in srgb, var(--line) 74%, transparent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 78%, transparent);
  min-width: 0;
}

.rating-role-card > span {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  font-weight: 800;
}

.rating-role-card > strong {
  color: var(--accent-4);
  font-size: 22px;
}

.rating-history-block {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid color-mix(in srgb, var(--line) 74%, transparent);
}

.rating-history-list {
  display: grid;
  gap: 7px;
  max-height: 360px;
  overflow: auto;
  padding-right: 4px;
}

.rating-history-item {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(122px, max-content);
  gap: 12px;
  align-items: center;
  min-width: 0;
  padding: 9px 10px 9px 13px;
  border: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
  border-radius: 8px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--surface) 86%, transparent), color-mix(in srgb, var(--surface-2) 42%, transparent)),
    var(--surface);
  overflow: hidden;
}

.rating-history-item::before {
  content: "";
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: 0;
  width: 3px;
  border-radius: 0 999px 999px 0;
  background: color-mix(in srgb, var(--muted) 50%, transparent);
}

.rating-history-gain::before {
  background: linear-gradient(180deg, var(--ok), var(--accent));
}

.rating-history-loss::before {
  background: linear-gradient(180deg, var(--danger), color-mix(in srgb, var(--danger) 45%, var(--warn)));
}

.rating-history-active::before {
  background: linear-gradient(180deg, var(--warn), var(--accent-4));
}

.rating-history-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.rating-history-kind {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  min-width: 0;
  color: var(--accent);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.rating-history-kind b {
  padding: 1px 6px;
  border: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
  border-radius: 999px;
  color: var(--muted);
  background: color-mix(in srgb, var(--surface-2) 42%, transparent);
  font: inherit;
  text-transform: none;
}

.rating-history-copy strong,
.rating-history-copy small {
  min-width: 0;
  overflow-wrap: anywhere;
}

.rating-history-copy small {
  color: var(--muted);
  font-size: 12px;
}

.rating-history-points {
  display: grid;
  gap: 2px;
  justify-items: end;
  text-align: right;
  white-space: nowrap;
}

.rating-history-points strong {
  padding: 3px 8px;
  border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--line));
  border-radius: 999px;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 9%, var(--surface));
  font-size: 16px;
}

.rating-history-loss .rating-history-points strong {
  border-color: color-mix(in srgb, var(--danger) 48%, var(--line));
  color: var(--danger);
  background: color-mix(in srgb, var(--danger) 8%, var(--surface));
}

.rating-history-gain .rating-history-points strong {
  border-color: color-mix(in srgb, var(--ok) 44%, var(--line));
  color: var(--ok);
  background: color-mix(in srgb, var(--ok) 9%, var(--surface));
}

.rating-history-points span,
.rating-history-points time {
  color: var(--muted);
  font-size: 11px;
}

@media (max-width: 920px) {
  .profile-hero {
    grid-template-columns: 58px minmax(0, 1fr);
  }

  .profile-avatar {
    width: 58px;
    height: 58px;
    font-size: 26px;
  }

  .profile-hero-aside {
    grid-column: 1 / -1;
    justify-items: start;
  }

  .profile-hero-rating,
  .profile-status {
    justify-content: flex-start;
  }
}

@media (max-width: 620px) {
  .profile-hero {
    grid-template-columns: 1fr;
    padding: 12px;
  }

  .profile-avatar {
    width: 54px;
    height: 54px;
  }

  .profile-hero-main h2 {
    font-size: 23px;
  }

  .rating-history-item {
    grid-template-columns: 1fr;
  }

  .rating-history-points {
    justify-items: start;
    text-align: left;
    white-space: normal;
  }
}

.rating-compact {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}

.rating-compact .title-grade {
  min-width: 42px;
  min-height: 24px;
  padding: 1px 7px;
  font-size: 13px;
}

.rating-compact small {
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rating-compact-label {
  max-width: none;
  text-transform: uppercase;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0;
}

.achievements-page {
  align-items: start;
}

.achievement-hero .card-body {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.achievement-hero h2 {
  margin: 4px 0;
  font-size: 28px;
}

.achievement-hero-icons,
.achievement-favorite-row,
.profile-achievement-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.achievement-filters {
  margin-bottom: 12px;
}

.achievement-filters input {
  min-width: min(280px, 100%);
}

.achievement-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 10px;
}

.achievement-card {
  min-width: 0;
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 10px;
  padding: 10px;
  border: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 84%, var(--surface-3));
}

.achievement-card.earned {
  border-color: color-mix(in srgb, var(--accent) 32%, var(--line));
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 9%, transparent), transparent 62%),
    color-mix(in srgb, var(--surface) 88%, var(--surface-2));
}

.achievement-card.favorite {
  border-color: color-mix(in srgb, var(--ok) 42%, var(--accent));
}

.achievement-card-icon {
  display: grid;
  place-items: start center;
}

.achievement-card-body {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.achievement-card-meta,
.achievement-card-foot {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.achievement-card-meta span,
.achievement-card-foot small {
  color: var(--muted);
  font-size: 12px;
}

.achievement-card-meta strong {
  color: var(--accent);
  font-size: 12px;
  text-transform: uppercase;
}

.achievement-rarity {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 2px 7px;
  border: 1px solid color-mix(in srgb, var(--line) 60%, transparent);
  border-radius: 999px;
  color: var(--text);
  background: color-mix(in srgb, var(--surface-2) 82%, transparent);
  font-size: 11px;
  font-weight: 800;
}

.achievement-rarity-common {
  color: var(--muted);
}

.achievement-rarity-uncommon {
  border-color: color-mix(in srgb, #6fdc8c 48%, var(--line));
  background: color-mix(in srgb, #6fdc8c 12%, var(--surface));
}

.achievement-rarity-rare {
  border-color: color-mix(in srgb, #4fc3ff 52%, var(--line));
  background: color-mix(in srgb, #4fc3ff 14%, var(--surface));
}

.achievement-rarity-epic {
  border-color: color-mix(in srgb, #b16cff 58%, var(--line));
  background: color-mix(in srgb, #b16cff 16%, var(--surface));
}

.achievement-rarity-legendary {
  border-color: color-mix(in srgb, #ffc857 62%, var(--line));
  background: color-mix(in srgb, #ffc857 18%, var(--surface));
}

.achievement-rarity-mythic {
  border-color: color-mix(in srgb, #ff6fae 62%, var(--line));
  background: linear-gradient(135deg, color-mix(in srgb, #ff6fae 20%, var(--surface)), color-mix(in srgb, #71f7ff 12%, var(--surface)));
}

.achievement-card.locked .achievement-card-meta strong {
  color: var(--muted);
}

.achievement-card h3 {
  margin: 0;
  font-size: 15px;
  line-height: 1.25;
}

.achievement-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.achievement-card button,
.achievement-favorite-pill {
  min-height: 30px;
  padding: 5px 8px;
  font-size: 12px;
}

.achievement-progress {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: color-mix(in srgb, var(--line) 62%, transparent);
}

.achievement-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--ok));
}

.achievement-current-tier {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.achievement-current-tier span {
  font-weight: 800;
  color: var(--text);
}

.achievement-current-tier strong {
  color: var(--accent);
}

.achievement-tier-track {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}

.achievement-tier {
  min-width: 34px;
  display: grid;
  gap: 1px;
  justify-items: center;
  padding: 3px 5px;
  border: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
  border-radius: 7px;
  background: color-mix(in srgb, var(--surface-2) 68%, transparent);
  color: var(--muted);
  font-size: 10px;
}

.achievement-tier span {
  font-weight: 900;
  line-height: 1;
}

.achievement-tier strong {
  font-size: 11px;
  line-height: 1.1;
}

.achievement-tier.earned {
  border-color: color-mix(in srgb, var(--ok) 48%, var(--line));
  background: color-mix(in srgb, var(--ok) 13%, var(--surface));
  color: var(--ok);
}

.achievement-tier.next {
  border-color: color-mix(in srgb, var(--accent) 56%, var(--line));
  background: color-mix(in srgb, var(--accent) 14%, var(--surface));
  color: var(--accent);
}

.achievement-icon {
  width: 64px;
  height: 64px;
}

.achievement-icon-small {
  width: 38px;
  height: 38px;
}

.achievement-icon.locked {
  opacity: .58;
}

.achievement-prop {
  opacity: .95;
}

.achievement-favorite-pill,
.profile-achievement-chip {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid color-mix(in srgb, var(--accent) 26%, var(--line));
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 86%, var(--accent) 8%);
}

.achievement-favorite-pill span,
.profile-achievement-chip strong {
  min-width: 0;
  max-width: 210px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.achievement-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 10px 0;
}

.achievement-pagination span {
  min-width: 72px;
  text-align: center;
  color: var(--muted);
  font-weight: 800;
}

.profile-achievement-panel {
  display: grid;
  gap: 8px;
}

.profile-achievement-chip {
  padding: 5px 9px 5px 5px;
}

.achievement-history-panel {
  display: grid;
  gap: 9px;
}

.achievement-history-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.achievement-history-chip {
  min-width: 116px;
  display: grid;
  gap: 1px;
  padding: 7px 9px;
  border: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 88%, var(--surface-2));
}

.achievement-history-chip small {
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
  font-weight: 800;
}

.achievement-history-chip strong {
  color: var(--accent-4);
  font-size: 20px;
}

.achievement-history-chip span {
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
}

.achievement-history-editor {
  border: 1px solid color-mix(in srgb, var(--line) 68%, transparent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 90%, var(--surface-2));
}

.achievement-history-editor summary {
  cursor: pointer;
  padding: 8px 10px;
  font-weight: 800;
}

.achievement-history-editor form {
  display: grid;
  gap: 10px;
  padding: 0 10px 10px;
}

.achievement-history-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 8px;
}

.achievement-history-grid label,
.achievement-history-reason {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.achievement-history-grid label span,
.achievement-history-reason span {
  color: var(--muted);
  font-size: 12px;
}

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

.achievement-toast-stack {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 80;
  display: grid;
  gap: 8px;
  width: min(360px, calc(100vw - 28px));
  pointer-events: none;
}

.achievement-toast {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 94%, var(--accent) 5%);
  box-shadow: var(--shadow);
  animation: achievement-toast-in .22s ease-out;
}

.achievement-toast div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.achievement-toast span {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  font-weight: 800;
}

.achievement-toast strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

@keyframes achievement-toast-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.ui-toast-stack {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 110;
  display: grid;
  gap: 8px;
  width: min(360px, calc(100vw - 28px));
  pointer-events: none;
}

.ui-toast {
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--accent) 32%, var(--line));
  border-radius: 8px;
  background:
    linear-gradient(180deg, color-mix(in srgb, #fff 9%, transparent), transparent),
    color-mix(in srgb, var(--surface) 94%, var(--surface-3));
  box-shadow: var(--shadow);
  color: var(--text);
  font-weight: 750;
  animation: achievement-toast-in 0.2s ease-out;
}

.ui-toast-success {
  border-color: color-mix(in srgb, var(--ok) 42%, var(--line));
}

.ui-toast-error {
  border-color: color-mix(in srgb, var(--danger) 52%, var(--line));
  color: var(--danger);
}

.ui-toast.is-removing {
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.ui-optimistic-chip {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  align-items: center;
  gap: 6px;
  margin: 6px 0 0 6px;
  padding: 4px 8px;
  border: 1px solid color-mix(in srgb, var(--accent) 42%, var(--line));
  border-radius: 999px;
  background:
    linear-gradient(180deg, color-mix(in srgb, #fff 13%, transparent), transparent),
    color-mix(in srgb, var(--accent) 14%, var(--surface));
  color: var(--accent);
  font-size: 12px;
  font-weight: 850;
  line-height: 1.15;
  overflow-wrap: anywhere;
  vertical-align: middle;
}

.ui-optimistic-chip::before {
  content: "";
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: currentColor;
  box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 14%, transparent);
}

.is-action-pending:not(tr) {
  position: relative;
  border-color: color-mix(in srgb, var(--accent) 42%, var(--line)) !important;
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--accent) 18%, transparent),
    0 10px 26px color-mix(in srgb, var(--accent) 8%, transparent);
}

tr.is-action-pending td {
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--accent) 11%, transparent), transparent 72%),
    color-mix(in srgb, var(--surface-3) 58%, var(--surface));
}

@keyframes ui-action-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes ui-pending-sheen {
  0% {
    background-position: 0% 50%;
  }
  100% {
    background-position: 160% 50%;
  }
}

@media (prefers-reduced-motion: reduce) {
  button.is-pending-action,
  .ui-action-spinner,
  .ui-toast,
  .achievement-toast,
  .title-workspace .production-row,
  .title-workspace .production-stage,
  .title-workspace .production-grid,
  .title-workspace .workflow-panel,
  .title-workspace .episode-warning-panel,
  .title-workspace .episode-history-panel,
  .title-workspace .production-summary,
  .title-workspace .toggle-caret {
    animation: none;
    transition: none;
  }
}

@media (max-width: 760px) {
  .achievement-hero .card-body {
    display: grid;
    justify-content: stretch;
    align-items: start;
  }

  .achievement-grid {
    grid-template-columns: 1fr;
  }

  .achievement-card {
    grid-template-columns: 58px minmax(0, 1fr);
  }

  .achievement-icon {
    width: 52px;
    height: 52px;
  }

  .achievement-icon-small {
    width: 34px;
    height: 34px;
  }

  .achievement-card-foot {
    align-items: flex-start;
    flex-direction: column;
  }

  .achievement-toast-stack {
    right: 10px;
    bottom: 10px;
    width: calc(100vw - 20px);
  }
}

.production-team {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
}

.production-schedule-note {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-2) 72%, var(--accent) 10%);
}

.production-schedule-note strong {
  color: var(--accent);
}

.production-schedule-note span {
  min-width: 0;
}

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

.production-command {
  overflow: hidden;
}

.production-command-summary {
  width: 100%;
  min-height: 0;
  padding: 14px;
  border: 0;
  border-radius: 0;
  color: var(--muted);
  text-align: left;
  background: color-mix(in srgb, var(--surface-2) 26%, transparent);
  box-shadow: none;
}

.production-command-summary:hover {
  transform: none;
  border-color: transparent;
  background: color-mix(in srgb, var(--accent) 8%, var(--surface-2));
  color: var(--text);
}

.production-command.collapsed .card-header {
  border-bottom: 0;
}

.production-command .nav-badge {
  min-width: 26px;
  justify-content: center;
}

.section-toggle,
.production-title-toggle {
  min-width: 0;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  box-shadow: none;
  overflow: visible;
}

.section-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  text-align: left;
}

.section-toggle:hover,
.production-title-toggle:hover {
  transform: none;
  color: var(--accent);
  background: transparent;
  box-shadow: none;
}

.toggle-caret {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 13%, transparent);
  color: var(--accent);
  font-weight: 900;
  line-height: 1;
  flex: 0 0 auto;
}

.production-row {
  display: grid;
  grid-template-columns: minmax(150px, 190px) minmax(0, 1fr);
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-3) 22%, var(--surface));
  transition:
    border-color 0.2s ease,
    background 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.2s ease;
}

.production-row.released {
  border-color: color-mix(in srgb, var(--ok) 70%, var(--line));
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--ok) 14%, transparent), transparent 68%),
    color-mix(in srgb, var(--surface) 88%, var(--ok) 12%);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--ok) 22%, transparent), 0 14px 34px color-mix(in srgb, var(--ok) 10%, transparent);
}

.production-row.released .production-head strong {
  color: var(--ok);
}

.production-row.reupload {
  border-color: color-mix(in srgb, var(--warn) 70%, var(--line));
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--warn) 14%, transparent), transparent 68%),
    color-mix(in srgb, var(--surface) 88%, var(--warn) 12%);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--warn) 22%, transparent);
}

.production-row.reupload .production-head strong {
  color: var(--warn);
}

.production-row.collapsed {
  grid-template-columns: minmax(0, 1fr);
}

.production-row.collapsed .production-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  justify-items: start;
  text-align: left;
  animation: title-row-collapse-settle 0.2s ease both;
}

.production-row.collapsed .production-head .inline-actions {
  margin-left: auto;
}

.production-row.collapsed .production-grid,
.production-row.collapsed .workflow-panel,
.production-row.collapsed .episode-warning-panel,
.production-row.collapsed .episode-history-panel,
.production-row.collapsed .production-summary {
  display: none;
}

.release-ready-badge {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 3px 9px;
  border: 1px solid color-mix(in srgb, var(--ok) 62%, var(--line));
  border-radius: 999px;
  background: color-mix(in srgb, var(--ok) 16%, var(--surface));
  color: var(--ok);
  font-weight: 800;
  white-space: nowrap;
}

.release-reupload-badge {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 3px 9px;
  border: 1px solid color-mix(in srgb, var(--warn) 62%, var(--line));
  border-radius: 999px;
  background: color-mix(in srgb, var(--warn) 18%, var(--surface));
  color: var(--warn);
  font-weight: 800;
  white-space: nowrap;
}

.production-head {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 7px;
  text-align: center;
}

.production-title-toggle {
  display: grid;
  justify-items: center;
  gap: 7px;
  width: 100%;
  text-align: center;
  transition:
    color 0.18s ease,
    background 0.18s ease,
    box-shadow 0.18s ease;
}

.production-row.collapsed .production-title-toggle {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  text-align: left;
}

.production-title-toggle:focus-visible {
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  box-shadow: var(--focus);
}

.production-title-toggle:hover .toggle-caret,
.production-title-toggle:focus-visible .toggle-caret {
  background: color-mix(in srgb, var(--accent) 22%, transparent);
  color: var(--accent);
}

.title-workspace .toggle-caret {
  transition:
    transform 0.22s cubic-bezier(.2, .8, .2, 1),
    background 0.18s ease,
    color 0.18s ease,
    box-shadow 0.18s ease;
}

.title-workspace .production-row.collapsed .toggle-caret {
  transform: rotate(-90deg);
}

.title-workspace .production-row:not(.collapsed) .toggle-caret {
  transform: rotate(0deg);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 8%, transparent);
}

.title-workspace .production-row:not(.collapsed) .production-grid,
.title-workspace .production-row:not(.collapsed) .workflow-panel,
.title-workspace .production-row:not(.collapsed) .episode-warning-panel,
.title-workspace .production-row:not(.collapsed) .episode-history-panel,
.title-workspace .production-row:not(.collapsed) .production-summary {
  animation: title-panel-reveal 0.24s cubic-bezier(.2, .8, .2, 1) both;
  transform-origin: top center;
}

.title-workspace .production-row:not(.collapsed) .production-stage {
  animation: title-stage-rise 0.22s ease both;
}

.title-workspace .production-head .inline-actions button {
  transition:
    border-color 0.18s ease,
    background 0.18s ease,
    box-shadow 0.18s ease,
    color 0.18s ease,
    transform 0.18s ease;
}

.title-workspace .production-head .inline-actions button:hover {
  box-shadow: 0 8px 18px color-mix(in srgb, var(--accent) 12%, transparent);
}

.title-workspace .production-head .inline-actions button.is-action-complete {
  animation: title-action-confirm 0.44s ease both;
}

@keyframes title-panel-reveal {
  from {
    opacity: 0;
    transform: translateY(-6px) scaleY(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scaleY(1);
  }
}

@keyframes title-row-collapse-settle {
  from {
    opacity: 0.82;
    transform: translateY(-3px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes title-stage-rise {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes title-action-confirm {
  0% {
    transform: scale(1);
  }
  45% {
    transform: scale(1.025);
  }
  100% {
    transform: scale(1);
  }
}

.production-head strong {
  font-size: 18px;
  color: var(--accent);
}

.production-head span {
  color: var(--muted);
}

.production-head .pill {
  justify-content: center;
  min-width: min(100%, 148px);
}

.production-head .inline-actions {
  justify-content: center;
}

.production-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr));
  gap: 10px;
}

.production-stage {
  min-height: 104px;
  padding: 12px;
  border: 1px solid color-mix(in srgb, var(--line) 78%, transparent);
  border-radius: 8px;
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--surface-2) 38%, transparent), transparent 64%),
    color-mix(in srgb, var(--surface) 96%, transparent);
  display: grid;
  align-content: start;
  gap: 8px;
  border-left: 3px solid var(--accent);
  box-shadow: inset 0 1px 0 color-mix(in srgb, #fff 7%, transparent), 0 10px 22px color-mix(in srgb, #000 10%, transparent);
  overflow: hidden;
}

.production-stage > .split {
  align-items: start;
  gap: 10px;
}

.production-stage > .split strong {
  min-width: 0;
  font-size: 15px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.production-stage.done {
  border-left-color: var(--ok);
}

.production-stage.partial {
  border-left-color: var(--warn);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--warn) 10%, transparent), transparent 72%),
    var(--surface);
}

.production-stage.excused {
  border-left-color: var(--accent-4);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent-4) 12%, transparent), transparent 72%),
    var(--surface);
}

.production-stage.blocked {
  border-left-color: var(--danger);
}

.production-stage.overdue {
  border-color: color-mix(in srgb, var(--danger) 72%, var(--line));
  border-left-color: var(--danger);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--danger) 14%, transparent), transparent 72%),
    color-mix(in srgb, var(--surface) 92%, var(--danger) 8%);
  box-shadow: inset 4px 0 0 var(--danger), 0 0 0 1px color-mix(in srgb, var(--danger) 18%, transparent);
}

.production-stage.overdue .stage-timing-metric,
.production-stage.overdue .stage-timing-details {
  border-color: color-mix(in srgb, var(--danger) 44%, var(--line));
}

.stage-people {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.stage-actions {
  justify-content: flex-start;
}

.stage-person {
  display: inline-flex;
  min-height: 23px;
  align-items: center;
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--line) 82%, transparent);
  background: color-mix(in srgb, var(--surface-2) 48%, transparent);
  color: var(--muted);
  font-weight: 650;
}

.stage-person.done {
  border-color: color-mix(in srgb, var(--ok) 70%, var(--line));
  background: color-mix(in srgb, var(--ok) 18%, var(--surface));
  color: var(--ok);
}

.stage-person.partial {
  border-color: color-mix(in srgb, var(--warn) 70%, var(--line));
  background: color-mix(in srgb, var(--warn) 18%, var(--surface));
  color: var(--warn);
}

.stage-person.replacement,
.replacement-line {
  font-weight: 800;
}

.stage-person.replacement {
  color: var(--muted);
  border-style: dashed;
  border-color: color-mix(in srgb, var(--muted) 46%, var(--line));
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--muted) 10%, transparent), transparent 76%),
    color-mix(in srgb, var(--surface-2) 68%, transparent);
}

.stage-person.replacement.replacement-done {
  color: var(--accent-2);
  border-style: solid;
  border-color: color-mix(in srgb, var(--accent-2) 74%, var(--line));
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--accent-2) 18%, transparent), transparent 76%),
    color-mix(in srgb, var(--surface-2) 68%, transparent);
}

.replacement-line {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  align-items: center;
  padding: 2px 7px;
  color: var(--muted);
  border: 1px dashed color-mix(in srgb, var(--muted) 42%, var(--line));
  border-radius: 999px;
  background: color-mix(in srgb, var(--muted) 8%, transparent);
  line-height: 1.25;
}

.replacement-line.replacement-done {
  color: var(--accent-2);
  border-style: solid;
  border-color: color-mix(in srgb, var(--accent-2) 45%, var(--line));
  background: color-mix(in srgb, var(--accent-2) 10%, transparent);
}

.stage-person-more {
  min-width: 0;
  width: auto;
  color: var(--text);
  background: color-mix(in srgb, var(--accent) 11%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--accent) 55%, var(--line));
  border-radius: 999px;
  font: inherit;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  appearance: none;
  outline: none;
}

.stage-person-more:hover,
.stage-person-more:focus-visible {
  border-color: color-mix(in srgb, var(--accent) 75%, var(--line));
  background: color-mix(in srgb, var(--accent) 17%, var(--surface));
}

.replacement-notice {
  display: grid;
  gap: 4px;
  border-color: color-mix(in srgb, var(--accent-2) 50%, var(--line));
  background: color-mix(in srgb, var(--accent-2) 9%, var(--surface));
}

.compact-note,
.fix-compact {
  min-width: 0;
  max-width: 100%;
  display: grid;
  gap: 6px;
  padding: 6px;
  border: 1px solid color-mix(in srgb, var(--line) 84%, transparent);
  border-radius: 7px;
  background: color-mix(in srgb, var(--surface-2) 42%, transparent);
}

.compact-note summary,
.fix-compact-open,
.fix-compact.single .fix-compact-open {
  min-width: 0;
  width: 100%;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 7px;
  align-items: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
  list-style: none;
}

.compact-note summary::-webkit-details-marker,
.fix-compact summary::-webkit-details-marker {
  display: none;
}

.compact-note summary > span,
.fix-compact-open > span,
.fix-compact.single .fix-compact-open > span {
  padding: 3px 7px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--warn) 16%, var(--surface));
  color: var(--warn);
  font-size: 11px;
  font-weight: 850;
  white-space: nowrap;
}

.compact-note summary strong,
.fix-compact-open strong,
.fix-compact.single .fix-compact-open strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
  font-size: 12px;
}

.compact-note[open] summary strong {
  white-space: normal;
  overflow-wrap: anywhere;
}

.fix-compact-open:hover strong,
.fix-compact-open:focus-visible strong {
  color: var(--accent);
}

.fix-compact-open:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent) 72%, transparent);
  outline-offset: 3px;
}

.compact-note pre {
  max-height: 145px;
  overflow: auto;
  margin: 0;
  padding: 8px;
  border-radius: 6px;
  background: color-mix(in srgb, var(--surface) 84%, transparent);
  color: var(--text);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font: inherit;
  line-height: 1.45;
}

.fix-compact-scroll {
  max-height: 150px;
  overflow: auto;
  display: grid;
  gap: 6px;
  padding-right: 3px;
}

.fix-compact-item {
  min-width: 0;
  padding: 7px;
  border: 1px solid color-mix(in srgb, var(--line) 82%, transparent);
  border-radius: 7px;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
}

.fix-compact-item div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.fix-compact-item b {
  color: var(--accent);
}

.fix-compact-item span {
  color: var(--text);
  font-weight: 800;
}

.fix-compact-item p,
.fix-compact-item small {
  display: block;
  margin: 4px 0 0;
  color: var(--muted);
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.4;
}

.drawer.fix-details-layer {
  z-index: 75;
  place-items: center;
  padding: 14px;
  overflow: auto;
}

.people-overflow-layer {
  position: fixed;
  inset: 0;
  z-index: 78;
  background: rgba(0, 0, 0, 0.42);
  display: grid;
  place-items: center;
  padding: 16px;
  overflow: auto;
}

.people-overflow-panel {
  width: min(420px, calc(100vw - 28px));
  max-height: min(560px, calc(100vh - 28px));
  display: grid;
  grid-template-rows: auto 1fr;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.people-overflow-panel header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.people-overflow-panel h2 {
  margin: 0;
  font-size: 16px;
  line-height: 1.2;
}

.people-overflow-panel button[data-people-overflow-close] {
  padding: 2px 6px;
  min-height: auto;
}

.people-overflow-body {
  display: grid;
  gap: 8px;
  padding: 14px;
  overflow: auto;
}

.people-overflow-item {
  padding: 8px 10px;
  min-width: 0;
  display: grid;
  gap: 4px;
  border: 1px solid color-mix(in srgb, var(--line) 86%, transparent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-2) 42%, transparent);
}

.people-overflow-meta {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.people-overflow-empty {
  min-height: 90px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  border: 1px dashed var(--line);
  color: var(--muted);
}

.distribution-detail-layer {
  position: fixed;
  inset: 0;
  z-index: 79;
  display: grid;
  place-items: center;
  padding: 16px;
  overflow: auto;
  background: rgba(0, 0, 0, 0.46);
  backdrop-filter: blur(3px);
}

.distribution-detail-panel {
  width: min(980px, calc(100vw - 28px));
  max-height: min(820px, calc(100vh - 28px));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
}

.distribution-detail-head {
  min-width: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 15px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface-2) 58%, var(--surface));
}

.distribution-detail-heading {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.distribution-detail-heading h2,
.distribution-detail-heading p {
  margin: 0;
}

.distribution-detail-heading h2 {
  font-size: 18px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.distribution-detail-heading p {
  color: var(--muted);
  font-size: 12px;
}

.distribution-detail-head-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.distribution-detail-source {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  font-size: 12px;
}

.distribution-detail-source:hover {
  border-color: color-mix(in srgb, var(--accent) 56%, var(--line));
  color: var(--accent);
}

.distribution-detail-body {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 12px;
  overflow: auto;
}

.distribution-detail-section,
.distribution-self-panel-detail {
  min-width: 0;
  border: 1px solid color-mix(in srgb, var(--line) 78%, transparent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-2) 30%, var(--surface));
}

.distribution-detail-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
}

.distribution-detail-summary-main,
.distribution-detail-admin-actions {
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
}

.distribution-detail-admin-actions {
  justify-content: flex-end;
}

.distribution-detail-admin-actions button {
  min-height: 30px;
  padding-inline: 10px;
  font-size: 12px;
  white-space: nowrap;
}

.distribution-self-panel-detail {
  grid-template-columns: minmax(180px, 0.56fr) minmax(360px, 1fr);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 78%, transparent);
  background: color-mix(in srgb, var(--accent) 5%, var(--surface));
}

.distribution-self-panel-detail .distribution-self-actions {
  width: 100%;
}

.distribution-self-panel-detail .distribution-card-signup {
  flex: 1 1 100%;
}

.distribution-detail-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 10px 0;
}

.distribution-detail-section-head h3 {
  margin: 0;
  font-size: 14px;
  line-height: 1.2;
}

.distribution-detail-section-head span {
  color: var(--muted);
  font-size: 12px;
}

.distribution-detail-info {
  display: grid;
  gap: 9px;
  padding-bottom: 10px;
}

.distribution-detail-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr));
  gap: 8px;
  padding: 0 10px;
}

.distribution-detail-info-item {
  min-width: 0;
  display: grid;
  gap: 3px;
  padding: 8px;
  border: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 62%, transparent);
}

.distribution-detail-info-item span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.2;
}

.distribution-detail-info-item strong {
  min-width: 0;
  font-size: 12px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.distribution-detail-info-link {
  color: var(--accent);
  text-decoration: none;
}

.distribution-detail-info-link:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.distribution-detail-note {
  margin: 0 10px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.distribution-detail-panel .distribution-role-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
  gap: 9px;
  padding: 10px;
}

.user-preview-layer {
  position: fixed;
  inset: 0;
  z-index: 82;
  display: grid;
  place-items: center;
  padding: 18px;
  background: color-mix(in srgb, #000 48%, transparent);
  backdrop-filter: blur(5px);
  overflow: auto;
}

.user-preview-panel {
  position: relative;
  width: min(560px, calc(100vw - 28px));
  max-height: min(720px, calc(100vh - 28px));
  display: grid;
  gap: 14px;
  padding: 18px;
  overflow: auto;
  border: 1px solid color-mix(in srgb, var(--accent) 42%, var(--line));
  border-radius: 18px;
  background:
    radial-gradient(circle at 16% 0%, color-mix(in srgb, var(--accent) 20%, transparent), transparent 34%),
    linear-gradient(135deg, color-mix(in srgb, var(--surface-2) 78%, transparent), var(--surface));
  color: var(--text);
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.35);
}

.user-preview-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
}

.user-preview-head {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 14px;
  align-items: center;
  padding-right: 40px;
}

.user-preview-avatar {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  border: 2px solid color-mix(in srgb, var(--accent) 70%, #fff);
  border-radius: 20px;
  background: linear-gradient(145deg, color-mix(in srgb, var(--accent) 32%, var(--surface)), color-mix(in srgb, var(--accent-2) 22%, var(--surface)));
  color: var(--text);
  font-size: 28px;
  font-weight: 900;
  box-shadow: 0 0 24px color-mix(in srgb, var(--accent) 22%, transparent);
}

.user-preview-head h2 {
  margin: 2px 0 4px;
  font-size: 24px;
  line-height: 1.1;
}

.user-preview-head p {
  margin: 0;
  color: var(--muted);
}

.user-preview-pills,
.user-preview-roles,
.user-preview-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.user-preview-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

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

.user-preview-columns section {
  min-width: 0;
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface) 72%, transparent);
}

.user-preview-columns strong {
  font-size: 13px;
}

.user-preview-columns ul {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.user-preview-columns li {
  min-width: 0;
  display: grid;
  gap: 2px;
  padding: 7px 8px;
  border-radius: 9px;
  background: color-mix(in srgb, var(--surface-2) 50%, transparent);
}

.user-preview-columns li span,
.user-preview-columns li small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-preview-columns li small {
  color: var(--muted);
}

.user-preview-actions {
  justify-content: flex-end;
  padding-top: 2px;
}

@media (max-width: 720px) {
  .distribution-detail-layer {
    padding: 0;
  }

  .distribution-detail-panel {
    width: 100vw;
    min-height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
    border-inline: 0;
  }

  .distribution-detail-head,
  .distribution-detail-summary,
  .distribution-self-panel-detail {
    grid-template-columns: 1fr;
  }

  .distribution-detail-head {
    display: grid;
    padding: 12px;
  }

  .distribution-detail-head-actions,
  .distribution-detail-admin-actions {
    justify-content: flex-start;
  }

  .distribution-detail-body {
    padding: 10px;
  }

  .distribution-detail-panel .distribution-role-grid,
  .distribution-card-signup-form {
    grid-template-columns: 1fr;
  }

  .user-preview-panel {
    padding: 16px;
    border-radius: 14px;
  }

  .user-preview-head {
    grid-template-columns: 54px 1fr;
    gap: 12px;
  }

  .user-preview-avatar {
    width: 54px;
    height: 54px;
    border-radius: 16px;
    font-size: 24px;
  }

  .user-preview-stats,
  .user-preview-columns {
    grid-template-columns: 1fr;
  }

  .user-preview-actions {
    display: grid;
    grid-template-columns: 1fr;
  }
}

.fix-details-panel {
  width: min(760px, calc(100vw - 28px));
  max-height: min(760px, calc(100vh - 28px));
  display: grid;
  grid-template-rows: auto 1fr;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.fix-details-panel header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 13px;
  border-bottom: 1px solid var(--line);
}

.fix-details-panel h2,
.fix-details-panel p {
  margin: 0;
}

.fix-details-panel p {
  margin-top: 4px;
  color: var(--muted);
}

.fix-details-body {
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 10px 12px 12px;
  overflow: auto;
}

.fix-detail-item {
  display: grid;
  align-content: start;
  gap: 6px;
  padding: 8px 10px;
  border: 1px solid color-mix(in srgb, var(--line) 86%, transparent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-2) 58%, transparent);
}

.fix-detail-item header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  padding: 0;
  border: 0;
}

.fix-detail-number {
  padding: 4px 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 16%, var(--surface));
  color: var(--accent);
  font-weight: 850;
}

.fix-detail-row {
  display: grid;
  gap: 2px;
}

.fix-detail-row span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.fix-detail-row p {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.3;
}

.workflow-panel {
  grid-column: 1 / -1;
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.production-summary {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: color-mix(in srgb, var(--accent) 7%, var(--surface));
}

.title-audit-toggle.ok {
  border-color: color-mix(in srgb, var(--ok) 56%, var(--line));
  color: var(--ok);
  background: color-mix(in srgb, var(--ok) 10%, var(--surface));
}

.title-audit-toggle.warn {
  border-color: color-mix(in srgb, var(--warn) 62%, var(--line));
  color: var(--warn);
  background: color-mix(in srgb, var(--warn) 12%, var(--surface));
}

.title-audit-toggle.bad {
  border-color: color-mix(in srgb, var(--danger) 62%, var(--line));
  color: var(--danger);
  background: color-mix(in srgb, var(--danger) 10%, var(--surface));
}

.title-audit-panel {
  overflow: hidden;
}

.title-audit-panel.ok {
  border-color: color-mix(in srgb, var(--ok) 36%, var(--line));
}

.title-audit-panel.warn {
  border-color: color-mix(in srgb, var(--warn) 38%, var(--line));
}

.title-audit-panel.bad {
  border-color: color-mix(in srgb, var(--danger) 38%, var(--line));
}

.title-audit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(250px, 100%), 1fr));
  gap: 8px;
}

.title-audit-item {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 9px;
  align-items: start;
  padding: 9px;
  border: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-2) 38%, transparent);
}

.title-audit-item > span {
  width: 24px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 950;
}

.title-audit-item.ok > span {
  background: color-mix(in srgb, var(--ok) 14%, var(--surface));
  color: var(--ok);
}

.title-audit-item.warn > span {
  background: color-mix(in srgb, var(--warn) 16%, var(--surface));
  color: var(--warn);
}

.title-audit-item.bad > span {
  background: color-mix(in srgb, var(--danger) 14%, var(--surface));
  color: var(--danger);
}

.title-audit-item div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.title-audit-item strong,
.title-audit-item small {
  min-width: 0;
  overflow-wrap: anywhere;
}

.title-audit-item small {
  color: var(--muted);
  line-height: 1.35;
}

.episode-warning-panel,
.episode-history-panel {
  grid-column: 1 / -1;
  min-width: 0;
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-2) 48%, var(--surface));
}

.episode-warning-panel {
  display: grid;
  gap: 9px;
  padding: 10px;
}

.episode-warning-panel > strong {
  color: var(--accent);
}

.episode-warning-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.episode-warning {
  display: grid;
  gap: 2px;
  min-width: min(260px, 100%);
  max-width: 100%;
  padding: 8px 10px;
  border: 1px solid color-mix(in srgb, var(--accent) 38%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 78%, transparent);
}

.episode-warning b,
.episode-warning small {
  min-width: 0;
  overflow-wrap: anywhere;
}

.episode-warning small {
  color: var(--muted);
}

.episode-warning-danger {
  border-color: color-mix(in srgb, var(--danger) 62%, var(--line));
  background: color-mix(in srgb, var(--danger) 9%, var(--surface));
}

.episode-warning-warn {
  border-color: color-mix(in srgb, var(--warn) 62%, var(--line));
  background: color-mix(in srgb, var(--warn) 9%, var(--surface));
}

.episode-warning-ok {
  border-color: color-mix(in srgb, var(--ok) 58%, var(--line));
  background: color-mix(in srgb, var(--ok) 8%, var(--surface));
}

.episode-history-panel {
  overflow: hidden;
}

.episode-history-panel summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px;
  cursor: pointer;
}

.episode-history-panel summary span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.episode-history-panel summary strong,
.episode-history-panel summary b,
.episode-history-panel summary small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.episode-history-panel summary small {
  color: var(--muted);
}

.episode-history-list {
  display: grid;
  gap: 0;
  max-height: 340px;
  overflow: auto;
  border-top: 1px solid var(--line);
}

.episode-history-item {
  display: grid;
  grid-template-columns: minmax(120px, 150px) minmax(0, 1fr);
  gap: 10px;
  padding: 9px 10px;
  border-left: 3px solid color-mix(in srgb, var(--accent) 48%, var(--line));
  border-bottom: 1px solid color-mix(in srgb, var(--line) 64%, transparent);
}

.episode-history-item time {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.episode-history-item div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.episode-history-item strong,
.episode-history-item span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.episode-history-item span {
  color: var(--muted);
}

.episode-history-ok {
  border-left-color: var(--ok);
}

.episode-history-warn {
  border-left-color: var(--warn);
}

.episode-history-danger {
  border-left-color: var(--danger);
}

.episode-history-muted {
  border-left-color: var(--muted);
}

.workflow-card {
  display: grid;
  gap: 9px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-2) 55%, var(--surface));
}

.cast-workflow-panel {
  gap: 12px;
}

.cast-workflow-card {
  gap: 12px;
  padding: 12px;
  border-color: color-mix(in srgb, var(--line) 72%, transparent);
  background:
    radial-gradient(circle at 0 0, color-mix(in srgb, var(--accent) 11%, transparent), transparent 34%),
    linear-gradient(145deg, color-mix(in srgb, var(--surface-2) 48%, transparent), transparent 72%),
    color-mix(in srgb, var(--surface) 96%, transparent);
  box-shadow: inset 0 1px 0 color-mix(in srgb, #fff 7%, transparent), 0 12px 28px color-mix(in srgb, #000 12%, transparent);
}

.cast-workflow-head {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
}

.cast-workflow-head > div:first-child {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.cast-workflow-head strong {
  font-size: 18px;
  line-height: 1.15;
}

.cast-workflow-head small {
  color: var(--muted);
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.cast-workflow-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
}

.cast-workflow-status > span:last-child {
  min-height: 26px;
  min-width: 42px;
  display: inline-grid;
  place-items: center;
  padding: 2px 9px;
  border: 1px solid color-mix(in srgb, var(--accent) 44%, var(--line));
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
  color: var(--accent);
  font-weight: 900;
}

.cast-workflow-tools {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.cast-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.cast-filter-bar button,
.cast-density-toggle {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 850;
}

.cast-filter-bar button b {
  min-width: 20px;
  min-height: 20px;
  display: inline-grid;
  place-items: center;
  padding: 0 5px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface-2) 72%, transparent);
  color: var(--muted);
  font-size: 11px;
}

.cast-filter-bar button.active,
.cast-density-toggle.active {
  border-color: color-mix(in srgb, var(--accent) 72%, var(--line));
  background: color-mix(in srgb, var(--accent) 16%, var(--surface));
  color: var(--accent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 14%, transparent);
}

.cast-filter-bar button.active b {
  background: color-mix(in srgb, var(--accent) 24%, var(--surface));
  color: var(--accent);
}

.cast-progress {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface-2) 72%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--line) 55%, transparent);
}

.cast-progress span {
  display: block;
  width: var(--cast-progress, 0%);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--ok));
  box-shadow: 0 0 16px color-mix(in srgb, var(--accent) 36%, transparent);
  transition: width 220ms ease;
}

.cast-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(105px, 1fr));
  gap: 7px;
}

.cast-summary span {
  min-width: 0;
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 5px;
  padding: 7px 9px;
  border: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-2) 42%, transparent);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.cast-summary b {
  color: var(--accent);
  font-size: 17px;
  line-height: 1;
}

.cast-workflow-card.compact {
  gap: 9px;
}

.cast-workflow-card.compact .cast-summary {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.cast-workflow-card.compact .cast-summary span {
  padding-block: 5px;
}

.cast-workflow-card.compact .person-list {
  grid-template-columns: repeat(auto-fill, minmax(min(158px, 100%), 1fr));
}

.cast-workflow-card.compact .person-line {
  gap: 6px;
  padding: 8px;
}

.cast-workflow-card.compact .person-timing-blocks {
  display: none;
}

.cast-workflow-card.compact .person-card-top strong {
  font-size: 13px;
}

.cast-workflow-card.compact .person-state,
.cast-workflow-card.compact .person-chip,
.cast-workflow-card.compact .person-quick-meta .mini-link,
.cast-workflow-card.compact .person-quick-meta .ok-text {
  font-size: 10px;
}

.cast-workflow-card.compact .person-line .inline-actions {
  gap: 4px;
}

.cast-workflow-card.compact .person-line .inline-actions button {
  min-height: 25px;
  min-width: 58px;
  padding-inline: 7px;
  font-size: 11px;
}

.person-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(185px, 100%), 1fr));
  gap: 9px;
}

.person-line {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 10px;
  border: 1px solid color-mix(in srgb, var(--line) 78%, transparent);
  border-radius: 8px;
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--surface-2) 26%, transparent), transparent 72%),
    var(--surface);
  min-height: 0;
  min-width: 0;
  box-shadow: inset 3px 0 0 color-mix(in srgb, var(--accent) 60%, transparent);
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.person-line:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--accent) 42%, var(--line));
  box-shadow: inset 3px 0 0 var(--accent), 0 12px 24px color-mix(in srgb, #000 12%, transparent);
}

.person-line.done {
  border-color: color-mix(in srgb, var(--ok) 78%, var(--line));
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--ok) 14%, transparent), transparent 72%),
    color-mix(in srgb, var(--surface) 92%, var(--ok) 8%);
  box-shadow: inset 3px 0 0 var(--ok), 0 0 0 1px color-mix(in srgb, var(--ok) 18%, transparent);
}

.person-line.absent {
  border-color: color-mix(in srgb, var(--warn) 82%, var(--line));
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--warn) 16%, transparent), transparent 72%),
    color-mix(in srgb, var(--surface) 92%, var(--warn) 8%);
  box-shadow: inset 3px 0 0 var(--warn), 0 0 0 1px color-mix(in srgb, var(--warn) 20%, transparent);
}

.person-line.overdue {
  border-color: color-mix(in srgb, var(--danger) 74%, var(--line));
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--danger) 14%, transparent), transparent 72%),
    color-mix(in srgb, var(--surface) 92%, var(--danger) 8%);
  box-shadow: inset 3px 0 0 var(--danger), 0 0 0 1px color-mix(in srgb, var(--danger) 18%, transparent);
}

.person-line.excused {
  border-color: color-mix(in srgb, var(--accent-4) 68%, var(--line));
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent-4) 14%, transparent), transparent 72%),
    color-mix(in srgb, var(--surface) 92%, var(--accent-4) 8%);
  box-shadow: inset 3px 0 0 var(--accent-4), 0 0 0 1px color-mix(in srgb, var(--accent-4) 18%, transparent);
}

.person-line.active {
  border-color: color-mix(in srgb, var(--accent) 58%, var(--line));
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 10%, transparent), transparent 72%),
    var(--surface);
  box-shadow: inset 3px 0 0 var(--accent);
}

.person-line.blocked {
  border-color: color-mix(in srgb, var(--danger) 45%, var(--line));
  box-shadow: inset 3px 0 0 var(--warn);
}

.person-line.replacement {
  border-color: color-mix(in srgb, var(--muted) 38%, var(--line));
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--muted) 9%, transparent), transparent 70%),
    var(--surface);
  box-shadow: inset 3px 0 0 color-mix(in srgb, var(--muted) 64%, var(--line));
}

.person-line.replacement.replacement-done {
  border-color: color-mix(in srgb, var(--accent-2) 68%, var(--line));
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent-2) 10%, transparent), transparent 70%),
    var(--surface);
  box-shadow: inset 3px 0 0 color-mix(in srgb, var(--accent-2) 85%, var(--accent));
}

.person-main {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.person-card-top {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 5px;
}

.person-card-top strong {
  min-width: 0;
  font-size: 14px;
  line-height: 1.16;
  overflow-wrap: anywhere;
}

.person-line.done strong,
.person-line.done .person-state {
  color: var(--ok);
}

.person-line.absent strong,
.person-line.absent .person-state {
  color: var(--warn);
}

.person-line.overdue strong,
.person-line.overdue .person-state {
  color: var(--danger);
}

.person-line.excused strong,
.person-line.excused .person-state {
  color: var(--accent-4);
}

.person-line.replacement.replacement-done strong,
.person-line.replacement.replacement-done .person-state {
  color: var(--accent-2);
}

.person-line span,
.person-line small {
  color: var(--muted);
}

.person-state {
  width: fit-content;
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface-2) 44%, transparent);
  font-size: 12px;
  font-weight: 850;
  line-height: 1.15;
}

.person-line.done .person-state {
  border-color: color-mix(in srgb, var(--ok) 55%, var(--line));
  background: color-mix(in srgb, var(--ok) 14%, var(--surface));
}

.person-line.absent .person-state {
  border-color: color-mix(in srgb, var(--warn) 60%, var(--line));
  background: color-mix(in srgb, var(--warn) 14%, var(--surface));
}

.person-line.overdue .person-state,
.person-line.blocked .person-state {
  border-color: color-mix(in srgb, var(--danger) 46%, var(--line));
  background: color-mix(in srgb, var(--danger) 12%, var(--surface));
}

.person-line.excused .person-state {
  border-color: color-mix(in srgb, var(--accent-4) 50%, var(--line));
  background: color-mix(in srgb, var(--accent-4) 12%, var(--surface));
}

.person-quick-meta {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  gap: 5px;
}

.person-chip,
.person-quick-meta .mini-link,
.person-quick-meta .ok-text {
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border: 1px solid color-mix(in srgb, var(--line) 68%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface-2) 45%, transparent);
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.person-quick-meta .mini-link {
  border-color: color-mix(in srgb, var(--accent) 48%, var(--line));
  background: color-mix(in srgb, var(--accent) 10%, var(--surface));
  color: var(--accent);
}

.person-quick-meta .ok-text {
  border-color: color-mix(in srgb, var(--ok) 44%, var(--line));
  background: color-mix(in srgb, var(--ok) 10%, var(--surface));
  color: var(--ok);
}

.person-chip.deadline {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 44%, var(--line));
  background: color-mix(in srgb, var(--accent) 10%, var(--surface));
}

.person-chip.done {
  color: var(--ok);
  border-color: color-mix(in srgb, var(--ok) 44%, var(--line));
  background: color-mix(in srgb, var(--ok) 10%, var(--surface));
}

.person-chip.absent {
  color: var(--warn);
  border-color: color-mix(in srgb, var(--warn) 58%, var(--line));
  background: color-mix(in srgb, var(--warn) 14%, var(--surface));
}

.person-chip.fix {
  color: var(--warn);
  border-color: color-mix(in srgb, var(--warn) 50%, var(--line));
  background: color-mix(in srgb, var(--warn) 12%, var(--surface));
}

.person-chip.excused {
  color: var(--accent-4);
  border-color: color-mix(in srgb, var(--accent-4) 48%, var(--line));
  background: color-mix(in srgb, var(--accent-4) 11%, var(--surface));
}

.person-deadline-meter {
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface-2) 72%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--line) 52%, transparent);
}

.person-deadline-meter span {
  display: block;
  width: var(--deadline-progress, 0%);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-3));
  transition: width 220ms ease;
}

.person-deadline-meter.done span {
  background: linear-gradient(90deg, var(--ok), color-mix(in srgb, var(--ok) 70%, var(--accent)));
}

.person-deadline-meter.absent span,
.person-deadline-meter.warn span {
  background: linear-gradient(90deg, var(--warn), color-mix(in srgb, var(--warn) 70%, var(--accent-3)));
}

.person-deadline-meter.danger span {
  background: linear-gradient(90deg, var(--danger), color-mix(in srgb, var(--danger) 70%, var(--warn)));
}

.person-comments {
  min-width: 0;
  border: 1px solid color-mix(in srgb, var(--line) 66%, transparent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-2) 32%, transparent);
  overflow: hidden;
}

.person-comments summary {
  min-width: 0;
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  gap: 6px;
  align-items: center;
  padding: 6px 8px;
  cursor: pointer;
}

.person-comments summary span {
  color: var(--accent);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.person-comments summary b {
  min-width: 19px;
  min-height: 19px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 16%, var(--surface));
  color: var(--accent);
  font-size: 10px;
}

.person-comments summary strong {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.person-comment-list {
  display: grid;
  gap: 6px;
  padding: 0 8px 8px;
}

.person-comment-list p {
  display: grid;
  gap: 2px;
  margin: 0;
  color: var(--text);
  font-size: 12px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.person-comment-list p span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.person-timing {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-width: 100%;
  gap: 4px;
  line-height: 1.35;
}

.person-timing-blocks {
  display: grid;
  gap: 3px;
  max-width: 100%;
  padding-top: 2px;
}

.person-line .inline-actions {
  justify-content: start;
  margin-top: auto;
  align-items: flex-end;
  gap: 6px;
}

.person-line .inline-actions button {
  min-height: 28px;
  min-width: 70px;
  padding: 0 9px;
  font-size: 12px;
}

.person-timing-blocks .person-timing-line {
  display: block;
}

.person-voice-submit.danger {
  border-color: color-mix(in srgb, var(--danger) 85%, transparent);
  color: var(--danger);
  background: color-mix(in srgb, var(--danger) 10%, var(--surface));
}

.person-voice-submit.danger:hover {
  background: color-mix(in srgb, var(--danger) 16%, var(--surface));
}

.person-voice-submit.sound-self {
  border-color: color-mix(in srgb, var(--role-sound) 70%, transparent);
  color: var(--role-sound);
  background: color-mix(in srgb, var(--role-sound) 10%, var(--surface));
}

.person-voice-submit.sound-self:hover {
  background: color-mix(in srgb, var(--role-sound) 16%, var(--surface));
}

.person-timing-line {
  display: block;
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
  white-space: normal;
}

.person-line button {
  min-height: 30px;
  padding: 0 8px;
}

.mini-link {
  display: inline-flex;
  width: fit-content;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}

.sound-workspace {
  display: grid;
  gap: 12px;
}

.sound-workspace .filters {
  grid-template-columns: minmax(min(320px, 100%), 420px) minmax(0, 1fr);
  align-items: center;
}

#sound-title-filter.sound-title-filter {
  width: min(420px, 100%);
  min-width: min(280px, 100%);
  max-width: 100%;
  padding-inline-end: 42px;
  text-overflow: ellipsis;
}

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

.sound-work-row {
  display: grid;
  grid-template-columns: minmax(150px, 220px) minmax(0, 1fr) minmax(180px, auto);
  gap: 12px;
  align-items: start;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-2) 78%, transparent);
}

.sound-work-row > div:first-child,
.sound-work-actions {
  display: grid;
  gap: 6px;
}

.sound-file-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.sound-file-chip {
  min-width: 150px;
  max-width: 220px;
  display: grid;
  gap: 4px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.sound-file-chip.ready {
  border-color: color-mix(in srgb, var(--ok) 55%, var(--line));
}

.sound-file-chip a {
  color: var(--accent);
  font-weight: 800;
  text-decoration: none;
}

.fix-builder-layer {
  z-index: 70;
}

.fix-builder-panel {
  width: min(980px, calc(100vw - 28px));
  max-height: min(820px, calc(100vh - 28px));
  display: grid;
  grid-template-rows: auto 1fr auto;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.fix-builder-panel header,
.fix-builder-panel footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.fix-builder-panel footer {
  border-top: 1px solid var(--line);
  border-bottom: 0;
  justify-content: flex-end;
  padding-top: 10px;
  padding-bottom: 10px;
}

.fix-builder-panel footer > .muted {
  margin-right: auto;
  font-size: 12px;
}

.fix-builder-panel h2,
.fix-builder-panel h3,
.fix-builder-panel p {
  margin: 0;
}

.fix-builder-body {
  display: grid;
  gap: 10px;
  padding: 11px 12px;
  overflow: auto;
}

.fix-builder-grid {
  display: grid;
  grid-template-columns: minmax(240px, 0.9fr) minmax(280px, 1.1fr);
  gap: 10px;
}

.fix-builder-column {
  display: grid;
  gap: 6px;
  align-content: start;
}

.fix-builder-preview {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.fix-builder-preview pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: inherit;
}

.stage-line {
  font-size: 13px;
}

.stage-timing {
  display: grid;
  gap: 3px;
  font-size: 12px;
  line-height: 1.35;
  color: var(--muted);
}

.stage-timing span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.stage-timing b {
  color: var(--text);
}

.stage-timing-compact {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.stage-timing-brief {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 94px), 1fr));
  gap: 4px;
}

.stage-timing-metric {
  min-width: 0;
  display: grid;
  gap: 1px;
  padding: 4px 6px;
  border: 1px solid color-mix(in srgb, var(--line) 82%, transparent);
  border-radius: 6px;
  background: color-mix(in srgb, var(--surface-2) 50%, transparent);
  font-size: 11px;
  line-height: 1.28;
}

.stage-timing-metric b {
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  text-transform: uppercase;
}

.stage-timing-metric span {
  min-width: 0;
  color: var(--text);
  font-weight: 750;
  overflow-wrap: anywhere;
}

.stage-timing-details {
  min-width: 0;
  display: grid;
  gap: 5px;
  padding: 5px 6px;
  border: 1px solid color-mix(in srgb, var(--line) 84%, transparent);
  border-radius: 7px;
  background: color-mix(in srgb, var(--surface-2) 42%, transparent);
}

.stage-timing-details summary {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 6px;
  align-items: center;
  color: inherit;
  cursor: pointer;
  list-style: none;
}

.stage-timing-details summary::-webkit-details-marker {
  display: none;
}

.stage-timing-details summary > span {
  padding: 3px 7px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 14%, var(--surface));
  color: var(--accent);
  font-size: 11px;
  font-weight: 850;
  white-space: nowrap;
}

.stage-timing-details summary strong {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stage-timing-details[open] summary strong {
  overflow-wrap: anywhere;
  white-space: normal;
}

.stage-timing-detail-scroll {
  max-height: 152px;
  overflow: auto;
  display: grid;
  gap: 4px;
  padding-right: 2px;
}

.stage-timing-detail-row {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(72px, .8fr) minmax(0, 1.2fr);
  gap: 6px;
  padding: 5px 6px;
  border: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
  border-radius: 6px;
  background: color-mix(in srgb, var(--surface) 80%, transparent);
  font-size: 11px;
  line-height: 1.35;
}

.stage-timing-detail-row b,
.stage-timing-detail-row span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.stage-timing-detail-row b {
  color: var(--text);
}

.stage-timing-detail-row span {
  color: var(--muted);
}

.inline-note {
  display: inline-flex;
  margin-left: 8px;
  font-size: 12px;
}

.danger-text {
  color: var(--danger);
}

.warn-text {
  color: var(--warn);
}

.excused-text {
  color: var(--accent-4);
  font-weight: 800;
}

.project-excuse-button {
  border-color: color-mix(in srgb, var(--accent-4) 46%, var(--line));
  color: var(--accent-4);
}

.project-overdue-accept-button {
  border-color: color-mix(in srgb, var(--danger) 46%, var(--line));
  color: var(--danger);
}

.project-excuse-clear-button {
  border-color: color-mix(in srgb, var(--warn) 42%, var(--line));
  color: var(--warn);
}

.deadline-accepted-note {
  display: grid;
  gap: 2px;
  color: var(--danger);
  font-weight: 800;
}

.deadline-accepted-note small {
  color: var(--muted);
  font-weight: 600;
}

.stage-actions .deadline-accepted-note {
  flex-basis: 100%;
}

.deadline-accepted-inline {
  display: inline-grid;
  gap: 1px;
  align-items: center;
  padding: 6px 9px;
  border: 1px solid color-mix(in srgb, var(--danger) 40%, var(--line));
  border-radius: 999px;
  color: var(--danger);
  font-size: 12px;
  font-weight: 800;
}

.deadline-accepted-inline small {
  color: var(--muted);
  font-weight: 600;
}

.data-table tr.excused-row td {
  background: color-mix(in srgb, var(--accent-4) 10%, transparent);
}

.ok-text {
  color: var(--ok);
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  align-items: end;
}

.field,
.login-field {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.field label,
.login-field label {
  min-width: 0;
  overflow-wrap: anywhere;
}

.field input,
.field select,
.field textarea,
.login-field input {
  width: 100%;
}

.login-check {
  min-width: 0;
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--line) 78%, transparent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-2) 56%, transparent);
  color: var(--text);
  cursor: pointer;
}

.login-check input {
  width: 18px !important;
  height: 18px;
  margin: 1px 0 0;
  accent-color: var(--accent);
}

.login-check span {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.login-check strong {
  font-size: 13px;
  line-height: 1.25;
}

.login-check small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.password-label-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  min-width: 0;
}

.password-layout-badge {
  flex-shrink: 0;
  padding: 2px 7px;
  border: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
  border-radius: 999px;
  color: var(--muted);
  background: color-mix(in srgb, var(--surface-2) 64%, transparent);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.3;
}

.password-layout-badge[data-layout="ru"] {
  color: color-mix(in srgb, var(--accent-3) 82%, var(--text));
  border-color: color-mix(in srgb, var(--accent-3) 48%, var(--line));
}

.password-layout-badge[data-layout="en"] {
  color: color-mix(in srgb, var(--accent) 82%, var(--text));
  border-color: color-mix(in srgb, var(--accent) 48%, var(--line));
}

.password-input-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  align-items: stretch;
  min-width: 0;
}

.password-input-wrap input {
  min-height: 42px;
}

.password-visibility-toggle {
  width: auto;
  min-inline-size: 44px;
  min-height: 42px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  color: var(--text);
  border-color: color-mix(in srgb, var(--accent) 42%, var(--line));
  background: color-mix(in srgb, var(--surface-2) 88%, transparent);
  font-size: 12px;
  font-weight: 800;
}

.password-visibility-toggle:hover,
.password-visibility-toggle:focus-visible {
  color: var(--text);
  border-color: color-mix(in srgb, var(--accent) 70%, var(--line));
  background: color-mix(in srgb, var(--accent) 14%, var(--surface-2));
}

.password-visibility-toggle svg {
  flex: 0 0 auto;
}

.password-visibility-toggle span {
  display: inline-flex;
  align-items: center;
}

.password-visibility-toggle [data-password-toggle-text] {
  display: none;
}

@media (max-width: 560px) {
  .password-input-wrap {
    grid-template-columns: minmax(0, 1fr) 44px;
  }

  .password-visibility-toggle {
    min-inline-size: 44px;
    padding: 0;
  }
}

.notice.success {
  border-color: color-mix(in srgb, var(--ok) 70%, var(--line));
  color: color-mix(in srgb, var(--ok) 82%, var(--text));
  background: color-mix(in srgb, var(--ok) 12%, var(--surface));
}

.two-factor-card {
  grid-column: 1 / -1;
  margin-top: 16px;
  padding: 16px;
  border: 1px solid color-mix(in srgb, var(--accent) 26%, var(--line));
  border-radius: 10px;
  background:
    radial-gradient(circle at top right, color-mix(in srgb, var(--accent) 12%, transparent), transparent 34%),
    color-mix(in srgb, var(--surface-2) 70%, transparent);
  display: grid;
  gap: 12px;
}

.two-factor-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
}

.two-factor-head h3 {
  margin: 3px 0 4px;
}

.two-factor-head p {
  margin: 0;
}

.two-factor-actions {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(150px, 1fr) auto;
  gap: 8px;
  align-items: stretch;
}

.two-factor-setup,
.two-factor-recovery {
  display: grid;
  gap: 8px;
}

.two-factor-qr {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 10px;
  border: 1px solid color-mix(in srgb, var(--accent) 24%, var(--line));
  border-radius: 10px;
  background: color-mix(in srgb, var(--surface) 78%, transparent);
}

.two-factor-qr img {
  width: 132px;
  height: 132px;
  padding: 8px;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 10px 24px color-mix(in srgb, #000 20%, transparent);
}

.two-factor-qr span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

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

.copy-row code,
.recovery-code-grid code {
  display: block;
  padding: 8px 10px;
  border: 1px solid color-mix(in srgb, var(--accent) 24%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 78%, transparent);
  overflow-wrap: anywhere;
}

.recovery-code-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
}

.inline-link {
  color: var(--accent);
  font-weight: 800;
}

.status-pill {
  flex: 0 0 auto;
  padding: 5px 9px;
  border: 1px solid color-mix(in srgb, var(--line) 78%, transparent);
  border-radius: 999px;
  color: var(--muted);
  background: color-mix(in srgb, var(--surface) 74%, transparent);
  font-size: 12px;
  font-weight: 900;
}

.status-pill.success {
  color: color-mix(in srgb, var(--ok) 84%, var(--text));
  border-color: color-mix(in srgb, var(--ok) 52%, var(--line));
  background: color-mix(in srgb, var(--ok) 14%, var(--surface));
}

@media (max-width: 720px) {
  .two-factor-head,
  .copy-row,
  .two-factor-actions {
    grid-template-columns: 1fr;
  }

  .two-factor-head {
    display: grid;
  }

  .two-factor-qr {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }
}

.checkbox-field {
  align-content: start;
}

.title-no-translator {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  padding: 10px 12px;
  border: 1px dashed color-mix(in srgb, var(--accent) 42%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent) 8%, var(--surface));
}

.checkbox-field input {
  width: 18px;
  min-height: 18px;
}

.choice-list {
  display: grid;
  gap: 7px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
}

.choice-pill {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface-2) 55%, var(--surface));
  color: var(--text);
  cursor: pointer;
  overflow-wrap: anywhere;
}

.multi-combobox {
  position: relative;
}

.multi-combobox[open] {
  z-index: 60;
}

.multi-combobox summary {
  display: flex;
  align-items: center;
  min-height: 38px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  cursor: pointer;
  list-style: none;
}

.multi-combobox summary span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.multi-combobox summary::-webkit-details-marker {
  display: none;
}

.multi-combobox[open] summary {
  border-color: var(--accent);
}

.multi-options-panel {
  display: none;
}

.multi-combobox[open] .multi-options-panel {
  position: absolute;
  z-index: 80;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  display: grid;
  gap: 6px;
  max-height: min(320px, 48vh);
  max-height: var(--multi-panel-max-height, min(320px, 48vh));
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 96%, var(--surface-2));
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.34);
  overflow: hidden;
}

.multi-combobox .multi-search {
  position: static;
  width: 100%;
  margin: 0;
}

.multi-combobox .multi-clear {
  width: 100%;
  min-height: 30px;
  margin: 0;
}

.multi-combobox[open] .choice-list,
.multi-combobox[open] .role-choice-groups {
  max-height: 230px;
  max-height: var(--multi-list-max-height, 230px);
  overflow: auto;
  min-height: 0;
  overscroll-behavior: contain;
}

.multi-combobox[open] .role-choice-groups .choice-list {
  max-height: none;
  overflow: visible;
}

.is-hidden {
  display: none;
}

.publication-groups {
  display: grid;
  gap: 14px;
}

.release-center {
  display: grid;
  gap: 12px;
  min-width: 0;
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid color-mix(in srgb, var(--accent) 42%, var(--line));
  border-radius: 8px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 10%, transparent), transparent 64%),
    color-mix(in srgb, var(--surface-2) 68%, var(--surface));
}

.project-control .card {
  min-width: 0;
}

.control-hero .card-body {
  display: grid;
  gap: 10px;
}

.control-stage-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.control-stage-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  max-width: 100%;
  padding: 4px 9px;
  border: 1px solid color-mix(in srgb, var(--danger) 44%, var(--line));
  border-radius: 999px;
  background: color-mix(in srgb, var(--danger) 10%, var(--surface));
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.control-stage-chip strong {
  color: var(--danger);
}

.control-stage-chip small {
  color: var(--muted);
}

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

.control-mini-card {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-2) 58%, var(--surface));
}

.control-mini-card.warn {
  border-color: color-mix(in srgb, var(--warn) 46%, var(--line));
  background: color-mix(in srgb, var(--warn) 8%, var(--surface));
}

.control-mini-card.danger {
  border-color: color-mix(in srgb, var(--danger) 48%, var(--line));
  background: color-mix(in srgb, var(--danger) 8%, var(--surface));
}

.control-mini-card strong,
.control-mini-card span,
.control-mini-card small {
  min-width: 0;
  overflow-wrap: anywhere;
}

.release-center-standalone {
  margin-bottom: 0;
}

.release-analytics {
  display: grid;
  gap: 12px;
  min-width: 0;
  margin-bottom: 14px;
}

.release-analytics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(210px, 100%), 1fr));
  gap: 10px;
}

.release-analytics-card,
.release-platform-watchlist {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 78%, transparent);
}

.release-analytics-card {
  display: grid;
  gap: 4px;
}

.release-analytics-card span,
.release-analytics-card small {
  color: var(--muted);
}

.release-analytics-card strong {
  font-size: 28px;
  line-height: 1;
}

.release-analytics-danger {
  border-color: color-mix(in srgb, var(--danger) 58%, var(--line));
  background: color-mix(in srgb, var(--danger) 8%, var(--surface));
}

.release-analytics-warn {
  border-color: color-mix(in srgb, var(--warn) 58%, var(--line));
  background: color-mix(in srgb, var(--warn) 8%, var(--surface));
}

.release-analytics-ok {
  border-color: color-mix(in srgb, var(--ok) 44%, var(--line));
}

.release-platform-watchlist {
  display: grid;
  gap: 10px;
}

.release-platform-watchlist-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
  gap: 8px;
}

.release-platform-watchlist-grid span {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid color-mix(in srgb, var(--line) 74%, transparent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-2) 44%, transparent);
}

.release-platform-watchlist-grid strong,
.release-platform-watchlist-grid small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.release-platform-watchlist-grid small {
  color: var(--muted);
}

.release-center-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  min-width: 0;
}

.release-center-head h2 {
  margin: 0 0 4px;
  font-size: 18px;
}

.release-center-summary {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.release-center-summary span,
.release-center-state,
.release-center-platform {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 72%, transparent);
  font-size: 12px;
  font-weight: 700;
}

.release-center-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(360px, 100%), 1fr));
  gap: 10px;
  min-width: 0;
}

.release-center-card {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 12px;
  border: 1px solid color-mix(in srgb, var(--line) 78%, var(--accent));
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 80%, transparent);
}

.release-center-card.release-center-danger {
  border-color: color-mix(in srgb, var(--danger) 62%, var(--line));
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--danger) 11%, transparent), transparent 72%),
    var(--surface);
}

.release-center-card.release-center-warn {
  border-color: color-mix(in srgb, var(--warn) 62%, var(--line));
}

.release-center-card.release-center-ok {
  border-color: color-mix(in srgb, var(--ok) 46%, var(--line));
}

.release-center-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.release-center-card-head > div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.release-center-card-head .text-link-button {
  max-width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
}

.release-center-card-head strong,
.release-center-card-head span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.release-center-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.release-center-stat-grid span {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 8px;
  border: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-2) 48%, transparent);
}

.release-center-stat-grid strong,
.release-center-stat-grid small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.release-center-stat-grid small,
.release-center-hints {
  color: var(--muted);
}

.release-center-platforms,
.release-center-hints {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.release-center-timeline {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding-top: 2px;
}

.release-center-timeline span {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding-left: 8px;
  border-left: 2px solid color-mix(in srgb, var(--accent) 56%, var(--line));
}

.release-center-timeline strong,
.release-center-timeline small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.release-center-timeline small {
  color: var(--muted);
}

.release-center-platform-done {
  border-color: color-mix(in srgb, var(--ok) 58%, var(--line));
  color: var(--ok);
}

.release-center-platform-claimed {
  border-color: color-mix(in srgb, var(--accent) 58%, var(--line));
  color: var(--accent);
}

.release-center-platform-blocked {
  border-color: color-mix(in srgb, var(--danger) 58%, var(--line));
  color: var(--danger);
}

.release-center-hints span {
  min-width: 0;
  overflow-wrap: anywhere;
}

@media (max-width: 700px) {
  .release-center-head,
  .release-center-card-head {
    display: grid;
  }

  .release-center-summary {
    justify-content: flex-start;
  }

  .release-center-stat-grid {
    grid-template-columns: 1fr;
  }
}

.publication-title-group {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-2) 52%, transparent);
}

.publication-title-head,
.publication-episode-head {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.publication-title-head strong,
.publication-episode-head strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.publication-title-head {
  justify-content: space-between;
}

.publication-title-group.collapsed .publication-episode-list,
.publication-title-group.collapsed .archive-release-list,
.publication-episode-group.collapsed .publication-episode-body {
  display: none;
}

.release-archive-title {
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 10%, transparent), transparent 58%),
    color-mix(in srgb, var(--surface-2) 38%, var(--surface));
}

.release-archive-title.collapsed .archive-title-meta {
  display: none;
}

.archive-title-meta {
  min-width: 0;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.archive-release-card {
  display: grid;
  gap: 10px;
  padding: 11px;
  border: 1px solid color-mix(in srgb, var(--ok) 34%, var(--line));
  border-radius: 8px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--ok) 9%, transparent), transparent 70%),
    var(--surface);
}

.archive-release-card.collapsed .archive-release-body {
  display: none;
}

.archive-release-head {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
  min-width: 0;
}

.archive-release-head .text-link-button {
  min-width: 0;
  max-width: min(360px, 100%);
}

.archive-release-head strong {
  display: inline-block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.archive-line-group {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 9px;
  border: 1px solid color-mix(in srgb, var(--ok) 22%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 88%, var(--ok) 6%);
}

.archive-line-head {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
}

.archive-line-head strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.archive-line-head span {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.archive-platform-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 8px;
}

.archive-platform-chip {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 9px;
  border: 1px solid color-mix(in srgb, var(--ok) 28%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, var(--ok) 8%, var(--surface));
}

.archive-platform-chip strong,
.archive-platform-chip span,
.archive-platform-chip small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.archive-platform-chip small {
  color: var(--muted);
}

.voice-report-panel .card-body {
  display: grid;
  gap: 12px;
}

.production-workspace {
  align-items: start;
}

.production-hero {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(420px, .9fr);
  gap: 18px;
  padding: 18px;
  background:
    radial-gradient(circle at 88% 18%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 28%),
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 12%, var(--surface)), var(--surface) 64%);
}

.production-hero-copy {
  min-width: 0;
  display: grid;
  align-content: center;
  gap: 8px;
}

.production-hero-copy h2 {
  margin: 0;
  font-size: clamp(24px, 3vw, 34px);
}

.production-hero-copy p {
  margin: 0;
  max-width: 820px;
  color: var(--muted);
  line-height: 1.5;
}

.admin-work-scope-switch {
  width: fit-content;
  max-width: 100%;
  display: inline-grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  padding: 5px;
  border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--line));
  border-radius: 10px;
  background:
    linear-gradient(180deg, color-mix(in srgb, #fff 8%, transparent), transparent),
    color-mix(in srgb, var(--surface) 88%, var(--surface-2));
  box-shadow: 0 10px 24px color-mix(in srgb, #000 8%, transparent);
}

.admin-work-scope-switch > span {
  padding: 0 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
  white-space: nowrap;
}

.admin-work-scope-switch > div {
  min-width: 0;
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(82px, 1fr));
  gap: 4px;
}

.admin-work-scope-switch button {
  min-width: 0;
  min-height: 34px;
  justify-content: center;
  gap: 7px;
  padding: 6px 9px;
  border-radius: 8px;
  font-weight: 850;
}

.admin-work-scope-switch button b {
  min-width: 22px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  padding: 0 6px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--line) 58%, transparent);
  color: var(--text);
  font-size: 12px;
  line-height: 1;
}

.admin-work-scope-switch button.active {
  border-color: color-mix(in srgb, var(--accent) 72%, var(--line));
  background:
    linear-gradient(180deg, color-mix(in srgb, #fff 16%, transparent), transparent),
    color-mix(in srgb, var(--accent) 22%, var(--surface));
  color: var(--accent);
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--accent) 20%, transparent),
    0 8px 20px color-mix(in srgb, var(--accent) 12%, transparent);
}

.admin-work-scope-switch button.active b {
  background: color-mix(in srgb, var(--accent) 24%, var(--surface));
  color: var(--accent);
}

.production-hero-personal {
  grid-template-columns: minmax(0, 1fr) minmax(320px, .72fr);
}

.production-hero-personal .production-kpi-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(112px, 100%), 1fr));
}

.production-role-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, .72fr);
  gap: 14px;
  align-items: center;
  padding: 16px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--success) 9%, var(--surface)), var(--surface) 68%);
}

.production-role-hero h2,
.production-role-hero p {
  margin: 0;
}

.production-role-hero p {
  color: var(--muted);
  line-height: 1.45;
}

.production-role-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.production-kpi-grid {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
  gap: 8px;
}

.production-kpi {
  min-width: 0;
  display: grid;
  gap: 3px;
  padding: 10px;
  border: 1px solid color-mix(in srgb, var(--line) 82%, transparent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-2) 58%, transparent);
  overflow-wrap: anywhere;
}

.production-kpi span,
.production-kpi small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}

.production-kpi strong {
  font-size: 26px;
  line-height: 1;
}

.production-kpi.tone-cyan {
  border-color: color-mix(in srgb, var(--accent) 42%, var(--line));
}

.production-kpi.tone-green {
  border-color: color-mix(in srgb, var(--success) 42%, var(--line));
}

.production-kpi.tone-yellow {
  border-color: color-mix(in srgb, var(--warn) 50%, var(--line));
}

.production-kpi.tone-red {
  border-color: color-mix(in srgb, var(--danger) 48%, var(--line));
}

.production-lane .card-body,
.production-card-list,
.production-fix-grid {
  display: grid;
  gap: 10px;
}

.production-priority-list {
  max-height: min(50vh, 520px);
  overflow: auto;
}

.production-priority-item {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(240px, .9fr) minmax(210px, auto);
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--line) 76%, transparent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-2) 42%, transparent);
}

.production-priority-item.danger {
  border-color: color-mix(in srgb, var(--danger) 46%, var(--line));
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--danger) 10%, transparent), transparent 62%),
    color-mix(in srgb, var(--surface-2) 42%, transparent);
}

.production-priority-item > div,
.production-priority-meta,
.production-priority-actions {
  min-width: 0;
}

.production-priority-item strong,
.production-priority-item span {
  overflow-wrap: anywhere;
}

.production-priority-meta,
.production-priority-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.production-priority-actions {
  justify-content: flex-end;
}

.production-column .card-body {
  max-height: min(70vh, 760px);
  overflow: auto;
}

.production-card {
  min-width: 0;
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid color-mix(in srgb, var(--line) 78%, transparent);
  border-radius: 8px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 7%, transparent), transparent 58%),
    color-mix(in srgb, var(--surface) 92%, transparent);
}

.production-card-head {
  min-width: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.production-card-head > div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.production-card-head strong {
  font-size: 17px;
  overflow-wrap: anywhere;
}

.production-card-head small {
  color: var(--muted);
  line-height: 1.35;
}

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

.production-stage-grid > div {
  min-width: 0;
  display: grid;
  gap: 3px;
  padding: 9px;
  border: 1px solid color-mix(in srgb, var(--line) 68%, transparent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-2) 38%, transparent);
}

.production-stage-grid span,
.production-stage-grid small {
  color: var(--muted);
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.production-stage-grid strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.production-source-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.production-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.production-card-meta .danger,
.production-priority-actions .danger {
  color: var(--danger);
}

.production-card-meta .warn,
.production-priority-actions .warn {
  color: var(--warn);
}

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

.production-card-actions > .row-actions {
  display: contents;
}

.production-card-actions button,
.production-card-actions .row-actions button {
  min-height: 32px;
  padding: 6px 10px;
}

.production-person-lines {
  min-width: 0;
  display: grid;
  gap: 8px;
}

.production-person-lines .person-line {
  margin: 0;
}

.production-fix-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr));
}

.production-dispute-card {
  border-color: color-mix(in srgb, var(--danger) 44%, var(--line));
}

.production-fix-body {
  display: grid;
  gap: 6px;
}

.production-fix-body p {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.45;
}

.production-fix-body small {
  color: var(--muted);
}

.production-sound-board .card {
  box-shadow: none;
}

@media (max-width: 1180px) {
  .production-hero {
    grid-template-columns: 1fr;
  }

  .production-role-hero {
    grid-template-columns: 1fr;
  }

  .production-kpi-grid {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  }

  .production-role-stats {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  }

  .production-priority-item {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .production-priority-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 760px) {
  .production-hero {
    padding: 14px;
  }

  .admin-work-scope-switch {
    width: 100%;
    grid-template-columns: 1fr;
  }

  .admin-work-scope-switch > span {
    padding: 0 4px;
  }

  .production-column .card-body,
  .production-priority-list {
    max-height: none;
    overflow: visible;
  }

  .production-card-head,
  .production-card-actions {
    align-items: stretch;
  }

  .production-card-head {
    flex-direction: column;
  }

  .production-stage-grid {
    grid-template-columns: 1fr;
  }

.production-card-actions button,
  .production-card-actions .row-actions button,
  .production-priority-actions button {
    width: 100%;
  }
}

.tutorial-view {
  align-items: start;
  gap: 16px;
}

.tutorial-hero {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  gap: 16px;
  padding: clamp(18px, 2vw, 30px);
  border: 1px solid color-mix(in srgb, var(--accent) 34%, var(--line));
  border-radius: 8px;
  background:
    linear-gradient(120deg, color-mix(in srgb, var(--accent) 15%, transparent), transparent 44%),
    linear-gradient(135deg, color-mix(in srgb, var(--surface-3) 62%, var(--surface)), var(--surface) 66%),
    var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.tutorial-hero-copy {
  min-width: 0;
  display: grid;
  align-content: center;
  gap: 10px;
}

.tutorial-hero-copy h2 {
  margin: 0;
  font-size: clamp(30px, 3.2vw, 48px);
  line-height: 1.08;
}

.tutorial-hero-copy p {
  max-width: 860px;
  margin: 0;
  color: color-mix(in srgb, var(--text) 84%, var(--muted));
  line-height: 1.55;
}

.tutorial-hero-copy p strong {
  color: var(--text);
}

.tutorial-hero-actions,
.tutorial-feature footer,
.tutorial-scenario footer {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tutorial-link-button {
  gap: 7px;
}

.tutorial-link-button.primary {
  border-color: color-mix(in srgb, var(--accent) 66%, var(--line));
  background:
    linear-gradient(180deg, color-mix(in srgb, #fff 18%, transparent), transparent),
    color-mix(in srgb, var(--accent) 72%, var(--surface));
  color: var(--surface);
}

.tutorial-link-icon,
.tutorial-feature-icon,
.tutorial-scenario-icon {
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}

.tutorial-link-icon {
  width: 18px;
  height: 18px;
}

.tutorial-link-icon svg,
.tutorial-feature-icon svg,
.tutorial-scenario-icon svg,
.tutorial-chip svg {
  width: 100%;
  height: 100%;
}

.tutorial-link-button.primary .tutorial-link-icon {
  color: currentColor;
}

.tutorial-principles {
  min-width: 0;
  display: grid;
  gap: 8px;
}

.tutorial-principles article,
.tutorial-feature,
.tutorial-flow-step,
.tutorial-scenario,
.tutorial-role-card,
.tutorial-access-group,
.tutorial-rules article {
  min-width: 0;
  padding: 14px;
  border: 1px solid color-mix(in srgb, var(--line) 78%, transparent);
  border-radius: 8px;
  background:
    linear-gradient(180deg, color-mix(in srgb, #fff 5%, transparent), transparent),
    color-mix(in srgb, var(--surface-2) 46%, transparent);
}

.tutorial-principles article {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 4px 10px;
  align-content: start;
}

.tutorial-principles article span {
  grid-row: span 2;
  color: var(--accent);
  font-weight: 900;
  font-size: 18px;
}

.tutorial-principles strong,
.tutorial-rules strong,
.tutorial-role-card h3 {
  line-height: 1.25;
}

.tutorial-principles p,
.tutorial-feature p,
.tutorial-flow-step p,
.tutorial-scenario p,
.tutorial-role-card p,
.tutorial-rules span {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.tutorial-card .card-header {
  min-width: 0;
}

.tutorial-card .card-header p {
  max-width: 880px;
  margin: 4px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.tutorial-card .card-body {
  min-width: 0;
}

.tutorial-access-map {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(290px, 100%), 1fr));
  gap: 10px;
}

.tutorial-access-group {
  display: grid;
  align-content: start;
  gap: 10px;
}

.tutorial-access-group > span {
  color: var(--text);
  font-weight: 900;
}

.tutorial-flow {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(210px, 100%), 1fr));
  gap: 10px;
}

.tutorial-flow-step {
  display: grid;
  align-content: start;
  gap: 10px;
}

.tutorial-flow-step > strong {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  color: var(--surface);
  background: var(--accent);
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent) 14%, transparent);
}

.tutorial-flow-step > div {
  display: grid;
  gap: 8px;
}

.tutorial-flow-step > div > span {
  width: fit-content;
  padding: 3px 8px;
  border-radius: 999px;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.tutorial-flow-step h3,
.tutorial-feature h3,
.tutorial-scenario h3,
.tutorial-role-card h3 {
  margin: 0;
  font-size: 16px;
}

.tutorial-feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr));
  gap: 10px;
}

.tutorial-feature {
  display: grid;
  gap: 10px;
  align-content: start;
}

.tutorial-feature-head,
.tutorial-scenario header {
  min-width: 0;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.tutorial-feature-head > div,
.tutorial-scenario header > div {
  min-width: 0;
}

.tutorial-feature-icon,
.tutorial-scenario-icon {
  width: 38px;
  height: 38px;
  padding: 9px;
  border: 1px solid color-mix(in srgb, var(--accent) 34%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent) 10%, transparent);
}

.tutorial-check-list {
  margin: 0;
  padding: 0;
  color: var(--text);
  list-style: none;
  display: grid;
  gap: 7px;
}

.tutorial-check-list li {
  position: relative;
  min-width: 0;
  padding-left: 20px;
  line-height: 1.45;
}

.tutorial-check-list li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.68em;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 12%, transparent);
}

.tutorial-point-accent {
  margin-right: 4px;
  color: var(--accent);
}

.tutorial-point-accent.violet,
.tutorial-feature.violet .tutorial-point-accent,
.tutorial-flow-step.violet > div > span,
.tutorial-rules article.violet strong {
  color: var(--accent-2);
}

.tutorial-point-accent.cyan,
.tutorial-feature.cyan .tutorial-point-accent,
.tutorial-flow-step.cyan > div > span,
.tutorial-rules article.cyan strong {
  color: var(--accent);
}

.tutorial-point-accent.gold,
.tutorial-feature.gold .tutorial-point-accent,
.tutorial-flow-step.gold > div > span,
.tutorial-rules article.gold strong {
  color: var(--warn);
}

.tutorial-point-accent.danger,
.tutorial-feature.danger .tutorial-point-accent,
.tutorial-flow-step.danger > div > span,
.tutorial-rules article.danger strong {
  color: var(--danger);
}

.tutorial-scenarios {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr));
  gap: 10px;
}

.tutorial-scenario {
  display: grid;
  gap: 12px;
  align-content: start;
}

.tutorial-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tutorial-chip {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--line));
  border-radius: 999px;
  color: color-mix(in srgb, var(--text) 86%, var(--accent));
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  font-size: 12px;
  font-weight: 800;
}

.tutorial-chip svg {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
}

.tutorial-role-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
  gap: 10px;
}

.tutorial-role-card {
  display: grid;
  gap: 10px;
  align-content: start;
}

.tutorial-role-card p {
  margin: 6px 0 0;
}

.tutorial-rules {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
  gap: 10px;
}

.tutorial-rules article {
  display: grid;
  gap: 7px;
}

.tutorial-feature.accent,
.tutorial-flow-step.accent,
.tutorial-scenario.accent,
.tutorial-role-card:nth-child(4n + 1),
.tutorial-rules article.accent,
.tutorial-principles article.accent {
  border-color: color-mix(in srgb, var(--accent) 38%, var(--line));
}

.tutorial-feature.violet,
.tutorial-flow-step.violet,
.tutorial-scenario.violet,
.tutorial-role-card:nth-child(4n + 2),
.tutorial-rules article.violet,
.tutorial-principles article.violet {
  border-color: color-mix(in srgb, var(--accent-2) 36%, var(--line));
}

.tutorial-feature.cyan,
.tutorial-flow-step.cyan,
.tutorial-scenario.cyan,
.tutorial-role-card:nth-child(4n + 3),
.tutorial-rules article.cyan,
.tutorial-principles article.cyan {
  border-color: color-mix(in srgb, var(--accent) 32%, var(--line));
}

.tutorial-feature.gold,
.tutorial-flow-step.gold,
.tutorial-scenario.gold,
.tutorial-role-card:nth-child(4n),
.tutorial-rules article.gold {
  border-color: color-mix(in srgb, var(--warn) 34%, var(--line));
}

.tutorial-feature.danger,
.tutorial-flow-step.danger,
.tutorial-scenario.danger,
.tutorial-rules article.danger {
  border-color: color-mix(in srgb, var(--danger) 34%, var(--line));
}

.tutorial-flow-step.violet > strong {
  background: var(--accent-2);
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent-2) 14%, transparent);
}

.tutorial-flow-step.gold > strong {
  background: var(--warn);
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--warn) 14%, transparent);
}

.tutorial-flow-step.danger > strong {
  background: var(--danger);
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--danger) 14%, transparent);
}

.tutorial-access-note {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 4px 10px;
  border: 1px dashed color-mix(in srgb, var(--line) 82%, var(--muted));
  border-radius: 7px;
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 1180px) {
  .tutorial-hero {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .tutorial-hero {
    padding: 14px;
  }

  .tutorial-hero-actions button,
  .tutorial-feature footer button,
  .tutorial-flow-step button,
  .tutorial-scenario footer button {
    width: 100%;
  }

  .tutorial-feature-grid,
  .tutorial-scenarios,
  .tutorial-role-grid,
  .tutorial-access-map {
    grid-template-columns: 1fr;
  }
}

.voice-report-groups {
  display: grid;
  gap: 10px;
}

.voice-report-group {
  display: grid;
  gap: 8px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 78%, var(--surface-3));
  overflow: hidden;
}

.voice-report-head {
  display: grid;
  grid-template-columns: auto minmax(180px, 1fr) minmax(260px, 0.9fr);
  gap: 10px;
  align-items: center;
  min-width: 0;
  padding: 9px 10px;
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--accent) 12%, transparent), transparent 55%),
    color-mix(in srgb, var(--surface-2) 46%, transparent);
}

.voice-report-toggle {
  width: 30px;
  min-width: 30px;
  min-height: 30px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  color: var(--accent);
}

.voice-report-toggle span {
  display: block;
  font-size: 18px;
  line-height: 1;
}

.voice-report-title {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.voice-report-title .text-link-button,
.voice-report-title strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.voice-report-title small {
  min-width: 0;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.voice-report-summary {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
  flex-wrap: wrap;
}

.voice-report-summary > .muted {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.voice-report-summary .progress-block,
.voice-report-status .progress-block {
  min-width: 110px;
}

.voice-report-body {
  display: grid;
  gap: 6px;
  max-height: 430px;
  overflow: auto;
  padding: 8px;
  scrollbar-color: color-mix(in srgb, var(--accent) 44%, var(--line)) transparent;
}

.voice-report-group.collapsed .voice-report-body {
  display: none;
}

.voice-report-row {
  display: grid;
  grid-template-columns: minmax(160px, 1.1fr) minmax(170px, 1fr) minmax(110px, 0.65fr) minmax(150px, 0.85fr) minmax(190px, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-width: 0;
  padding: 8px 9px;
  border: 1px solid color-mix(in srgb, var(--line) 78%, transparent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 84%, transparent);
}

.voice-report-cell {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.voice-report-cell strong,
.voice-report-text,
.voice-report-cell > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.voice-report-text {
  white-space: nowrap;
}

.voice-report-episode span,
.voice-report-control span {
  font-size: 13px;
}

.voice-report-status {
  align-content: center;
}

.voice-report-control {
  line-height: 1.25;
}

.voice-report-actions {
  justify-content: flex-end;
}

@media (max-width: 1180px) {
  .voice-report-head {
    grid-template-columns: auto minmax(160px, 1fr);
  }

  .voice-report-summary {
    grid-column: 2;
    justify-content: flex-start;
  }

  .voice-report-row {
    grid-template-columns: minmax(160px, 1fr) minmax(180px, 1fr) minmax(110px, 0.7fr);
  }

  .voice-report-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
}

@media (max-width: 700px) {
  .voice-report-head,
  .voice-report-row {
    grid-template-columns: 1fr;
  }

  .voice-report-summary {
    grid-column: auto;
    justify-content: flex-start;
  }

  .voice-report-toggle {
    width: 100%;
  }

  .voice-report-body {
    max-height: none;
  }
}

.publication-episode-list {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.publication-episode-group {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 10px;
  border: 1px solid color-mix(in srgb, var(--line) 82%, var(--accent));
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 72%, transparent);
}

.publication-episode-head {
  flex-wrap: wrap;
  justify-content: flex-start;
}

.publication-episode-head span {
  color: var(--muted);
}

.publication-group-actions {
  margin-left: auto;
  justify-content: flex-end;
}

.release-guide-hero .card-body {
  padding-top: 0;
}

.release-guide-buttons {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.release-guide-button {
  justify-content: space-between;
  min-height: 58px;
  padding: 12px;
  border-color: color-mix(in srgb, var(--accent) 42%, var(--line));
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 15%, transparent), transparent 72%),
    var(--surface);
}

.release-guide-button strong,
.release-guide-button span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.release-guide-button span {
  color: var(--muted);
  font-size: 12px;
}

.release-guide-card .card-header {
  align-items: flex-start;
  gap: 12px;
}

.release-guide-card .card-header p {
  margin: 4px 0 0;
  color: var(--muted);
}

.release-guide-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.release-guide-stats span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface-2) 62%, transparent);
  color: var(--muted);
  font-size: 13px;
}

.release-guide-stats strong {
  color: var(--accent);
}

.release-guide-list {
  display: grid;
  gap: 8px;
  max-height: min(64vh, 720px);
  overflow: auto;
  padding-right: 4px;
}

.release-guide-entry {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 82%, var(--surface-2));
}

.release-guide-entry-main {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.release-guide-entry-main strong,
.release-guide-entry-main span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.release-guide-entry-main span {
  color: var(--muted);
  font-size: 13px;
}

.release-guide-actions {
  justify-content: flex-end;
  flex-wrap: nowrap;
}

.release-guide-builder textarea,
.release-template-builder textarea {
  resize: vertical;
}

.release-guide-builder label,
.release-template-builder label {
  display: grid;
  align-items: start;
}

.release-guide-builder .compact-form,
.release-template-builder .compact-form {
  grid-template-columns: repeat(2, minmax(220px, 1fr));
}

.release-template-builder .release-template-editor > .compact-form {
  grid-template-columns: minmax(220px, 1fr) minmax(180px, 0.8fr);
}

.release-template-builder [data-release-template-field="target"] {
  min-width: 160px;
}

.release-template-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  align-items: start;
}

.release-template-editor,
.release-template-preview-wrap {
  min-width: 0;
}

.release-template-preview-wrap {
  display: grid;
  gap: 10px;
}

.template-token-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.token-chip {
  min-height: 28px;
  padding: 5px 8px;
  font-size: 12px;
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 42%, var(--line));
  background: color-mix(in srgb, var(--accent) 8%, transparent);
}

.release-template-samples {
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-2) 54%, transparent);
}

.release-template-samples summary {
  padding: 10px 12px;
  cursor: pointer;
  font-weight: 800;
}

.release-template-samples .form-grid {
  padding: 0 12px 12px;
}

.release-template-preview {
  min-height: 460px;
  max-height: min(66vh, 760px);
  margin: 0;
  padding: 14px;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--line));
  border-radius: 8px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 8%, transparent), transparent 54%),
    color-mix(in srgb, var(--surface) 88%, var(--surface-2));
  color: var(--text);
  font: 500 14px/1.48 ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
}

.button-like {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: color-mix(in srgb, var(--surface) 75%, transparent);
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
}

.button-like:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.choice-pill input {
  width: 14px;
  min-height: 14px;
}

.choice-pill:has(input:checked) {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 15%, var(--surface));
}

.role-choice-groups {
  display: grid;
  gap: 10px;
}

.role-choice-group {
  display: grid;
  gap: 6px;
  padding: 8px;
  border: 1px solid color-mix(in srgb, var(--role-group-color, var(--accent)) 32%, var(--line));
  border-radius: 9px;
  background: color-mix(in srgb, var(--role-group-color, var(--accent)) 7%, var(--surface));
}

.role-choice-group-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  color: var(--text);
}

.role-choice-group-head strong {
  color: var(--role-group-color, var(--accent));
  font-size: 13px;
}

.role-choice-group-head span {
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

.role-choice-list {
  grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
  background: transparent;
  border: 0;
  padding: 0;
}

.role-choice-group-power,
.role-choice-power {
  --role-group-color: var(--danger);
}

.role-choice-group-management,
.role-choice-management {
  --role-group-color: var(--warn);
}

.role-choice-group-work,
.role-choice-work {
  --role-group-color: var(--ok);
}

.role-choice-group-limited,
.role-choice-limited {
  --role-group-color: var(--muted);
}

.role-choice {
  border-color: color-mix(in srgb, var(--role-group-color, var(--accent)) 35%, var(--line));
}

.role-choice:has(input:checked) {
  border-color: var(--role-group-color, var(--accent));
  background: color-mix(in srgb, var(--role-group-color, var(--accent)) 18%, var(--surface));
}

.role-choice:has(input:disabled) {
  opacity: 0.55;
  cursor: not-allowed;
}

label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.field-help {
  position: relative;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--line));
  background: color-mix(in srgb, var(--accent) 10%, var(--surface));
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  cursor: help;
}

.field-help::after {
  display: none;
}

.floating-tooltip {
  position: fixed;
  z-index: 140;
  max-width: min(300px, calc(100vw - 24px));
  padding: 9px 10px;
  border: 1px solid color-mix(in srgb, var(--accent) 38%, var(--line));
  border-radius: 7px;
  background:
    linear-gradient(180deg, color-mix(in srgb, #fff 8%, transparent), transparent),
    color-mix(in srgb, var(--surface) 96%, var(--surface-3));
  color: var(--text);
  box-shadow: 0 14px 34px color-mix(in srgb, #000 28%, transparent);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
  white-space: normal;
  overflow-wrap: anywhere;
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.12s ease, transform 0.12s ease;
}

.floating-tooltip.visible {
  opacity: 1;
  transform: translateY(0);
}

input,
select,
textarea {
  width: 100%;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 8px 10px;
  background: var(--surface);
  color: var(--text);
}

.row-check {
  width: 18px;
  min-height: 18px;
}

textarea {
  min-height: 72px;
  resize: vertical;
}

select[multiple] {
  min-height: 132px;
  padding: 6px;
}

select[multiple] option {
  padding: 6px;
  border-radius: 5px;
}

.filters input,
.filters select {
  width: 190px;
}

.primary {
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 68%, var(--accent-2)));
  border-color: color-mix(in srgb, var(--accent) 80%, #000 10%);
  color: #fff;
  padding: 0 12px;
  box-shadow: 0 8px 18px color-mix(in srgb, var(--accent) 22%, transparent);
}

.primary.warning {
  background: linear-gradient(135deg, var(--warn), color-mix(in srgb, var(--warn) 70%, #f97316));
  border-color: color-mix(in srgb, var(--warn) 82%, #000 10%);
  color: #1f1600;
  box-shadow: 0 8px 18px color-mix(in srgb, var(--warn) 22%, transparent);
}

.ghost {
  background: transparent;
}

.danger {
  border-color: var(--danger);
  color: var(--danger);
}

.danger:hover {
  background: color-mix(in srgb, var(--danger) 10%, var(--surface));
  border-color: var(--danger);
}

.row-actions {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.row-actions button {
  min-height: 30px;
  padding: 0 9px;
}

.title-analytics-list {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.title-analytics-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-2) 76%, transparent);
  min-width: 0;
  max-width: 100%;
  overflow: clip;
}

.title-analytics-card summary {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 64px;
  padding: 12px 14px;
  min-width: 0;
  cursor: pointer;
  list-style: none;
}

.title-analytics-card summary::-webkit-details-marker {
  display: none;
}

.title-analytics-card summary::before {
  content: "›";
  display: grid;
  place-items: center;
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  border: 1px solid color-mix(in srgb, var(--accent) 42%, var(--line));
  border-radius: 999px;
  color: var(--accent);
  font-weight: 800;
  transition: transform .16s ease;
}

.title-analytics-card[open] summary::before {
  transform: rotate(90deg);
}

.analytics-average-card {
  padding: 0;
  overflow: clip;
}

.analytics-average-card .table-wrap {
  border-top: 1px solid var(--line);
}

.analytics-average-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 58px;
  padding: 12px 14px;
  cursor: pointer;
  list-style: none;
}

.analytics-average-summary::-webkit-details-marker {
  display: none;
}

.analytics-average-summary::before {
  content: "›";
  display: grid;
  place-items: center;
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  border: 1px solid color-mix(in srgb, var(--accent) 42%, var(--line));
  border-radius: 999px;
  color: var(--accent);
  font-weight: 850;
  transition: transform .16s ease;
}

.analytics-average-card[open] .analytics-average-summary::before {
  transform: rotate(90deg);
}

.analytics-average-summary > span:first-child {
  display: grid;
  gap: 3px;
  margin-right: auto;
  min-width: 0;
}

.analytics-average-summary small {
  color: var(--muted);
}

.title-analytics-name {
  display: grid;
  gap: 3px;
  min-width: 0;
  margin-right: auto;
}

.title-analytics-name strong,
.title-analytics-name small,
.title-analytics-summary span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.title-analytics-name small {
  color: var(--muted);
}

.title-analytics-summary {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
}

.title-analytics-summary > span:not(.title-grade) {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 3px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 84%, transparent);
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.title-grade {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 54px;
  min-height: 34px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid currentColor;
  font-size: 18px;
  font-weight: 850;
  line-height: 1;
  box-shadow: 0 1px 0 color-mix(in srgb, #fff 46%, transparent) inset, 0 8px 20px color-mix(in srgb, currentColor 10%, transparent);
}

.title-grade small {
  font-size: 11px;
  line-height: 1;
  opacity: .9;
}

.release-grade {
  gap: 6px;
}

.release-grade .title-grade {
  min-width: 46px;
  min-height: 26px;
  padding: 2px 8px;
  font-size: 14px;
}

.grade-s {
  color: #8a4d05;
  background:
    linear-gradient(135deg, color-mix(in srgb, #facc15 36%, var(--surface)), color-mix(in srgb, var(--ok) 14%, var(--surface)));
  border-color: color-mix(in srgb, #8a4d05 70%, var(--line));
  box-shadow: 0 0 0 1px color-mix(in srgb, #facc15 30%, transparent), 0 10px 24px color-mix(in srgb, #facc15 16%, transparent);
}

.grade-legend {
  color: #fef3c7;
  background:
    linear-gradient(135deg, #8b5cf6 0%, #f59e0b 55%, #22c55e 100%);
  box-shadow: 0 0 0 1px color-mix(in srgb, #fef3c7 55%, transparent), 0 12px 30px color-mix(in srgb, #f59e0b 24%, transparent);
}

.grade-sss,
.grade-ss,
.grade-splus {
  color: #5b21b6;
  background:
    linear-gradient(135deg, color-mix(in srgb, #8b5cf6 25%, var(--surface)), color-mix(in srgb, #f59e0b 18%, var(--surface)));
  border-color: color-mix(in srgb, #7c3aed 54%, var(--line));
}

.grade-ss {
  color: #5b21b6;
}

.grade-splus {
  color: #075985;
  border-color: color-mix(in srgb, #0891b2 56%, var(--line));
}

.grade-a {
  color: var(--ok);
  background: color-mix(in srgb, var(--ok) 16%, var(--surface));
  border-color: color-mix(in srgb, var(--ok) 58%, var(--line));
}

.grade-b {
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 14%, var(--surface));
  border-color: color-mix(in srgb, var(--accent) 58%, var(--line));
}

.grade-c {
  color: var(--accent-2);
  background: color-mix(in srgb, var(--accent-2) 15%, var(--surface));
  border-color: color-mix(in srgb, var(--accent-2) 58%, var(--line));
}

.grade-d {
  color: var(--warn);
  background: color-mix(in srgb, var(--warn) 16%, var(--surface));
  border-color: color-mix(in srgb, var(--warn) 58%, var(--line));
}

.grade-f {
  color: var(--danger);
  background: color-mix(in srgb, var(--danger) 15%, var(--surface));
  border-color: color-mix(in srgb, var(--danger) 58%, var(--line));
}

.grade-x {
  color: #f8fafc;
  background: color-mix(in srgb, #111827 80%, var(--danger));
}

[data-theme="dark"] .title-grade {
  box-shadow: 0 8px 20px color-mix(in srgb, currentColor 10%, transparent);
}

[data-theme="dark"] .grade-s {
  color: #f7c948;
  background:
    linear-gradient(135deg, color-mix(in srgb, #f7c948 24%, var(--surface)), color-mix(in srgb, var(--accent) 16%, var(--surface)));
  border-color: currentColor;
}

[data-theme="dark"] .grade-sss,
[data-theme="dark"] .grade-ss,
[data-theme="dark"] .grade-splus {
  color: #fde68a;
  background:
    linear-gradient(135deg, color-mix(in srgb, #8b5cf6 28%, var(--surface)), color-mix(in srgb, #f59e0b 20%, var(--surface)));
}

[data-theme="dark"] .grade-ss {
  color: #c4b5fd;
}

[data-theme="dark"] .grade-splus {
  color: #67e8f9;
}

.title-analytics-body {
  border-top: 1px solid var(--line);
}

.title-analytics-body th:nth-child(3),
.title-analytics-body td:nth-child(3) {
  min-width: 180px;
}

.title-analytics-body th:nth-child(7),
.title-analytics-body td:nth-child(7) {
  min-width: 300px;
  max-width: 520px;
  white-space: normal;
}

.analytics-wide-metric {
  min-height: 96px;
}

.data-table tr.overdue-row td {
  background: color-mix(in srgb, var(--danger) 8%, transparent);
}

@media (max-width: 900px) {
  .title-analytics-card summary {
    align-items: flex-start;
    flex-direction: column;
  }

  .title-analytics-card summary::before {
    position: absolute;
  }

  .title-analytics-name {
    padding-left: 34px;
  }

  .title-analytics-summary {
    justify-content: flex-start;
    padding-left: 34px;
  }
}

.wishlist-people {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
  margin-bottom: 4px;
}

.wishlist-count {
  display: inline-flex;
  margin-top: 4px;
}

.wishlist-count-button {
  align-items: center;
  width: fit-content;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  cursor: pointer;
}

.wishlist-count-button:hover,
.wishlist-count-button:focus-visible {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.wishlist-person {
  display: inline-flex;
  align-items: center;
  max-width: 170px;
  min-height: 24px;
  padding: 2px 8px;
  border: 1px solid color-mix(in srgb, var(--accent) 36%, var(--line));
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 10%, var(--surface));
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 650;
}

.wishlist-person.self {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 62%, var(--line));
  background: color-mix(in srgb, var(--accent) 18%, var(--surface));
}

.wishlist-person-more {
  min-width: 0;
  width: auto;
  border-color: color-mix(in srgb, var(--muted) 72%, var(--line));
  color: var(--muted);
  background: color-mix(in srgb, var(--muted) 8%, var(--surface));
  border-radius: 999px;
  font: inherit;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  appearance: none;
  border-width: 1px;
  border-style: solid;
  padding: 2px 8px;
}

.wishlist-person-more:hover,
.wishlist-person-more:focus-visible {
  border-color: color-mix(in srgb, var(--muted) 96%, var(--line));
  color: var(--text);
  background: color-mix(in srgb, var(--muted) 16%, var(--surface));
}

.distribution-more {
  cursor: pointer;
}

.wishlist-no-people {
  display: inline-flex;
  min-height: 22px;
  line-height: 1.2;
}

.wishlist-table-wrap {
  overflow: auto;
  max-width: 100%;
}

.wishlist-table {
  min-width: 980px;
  table-layout: fixed;
}

.wishlist-table th,
.wishlist-table td {
  padding: 8px 10px;
  vertical-align: top;
}

.wishlist-table thead th {
  white-space: normal;
}

.wishlist-table th:nth-child(1) { width: 33%; min-width: 250px; }
.wishlist-table th:nth-child(2) { width: 10%; min-width: 110px; }
.wishlist-table th:nth-child(3) { width: 8%; min-width: 72px; }
.wishlist-table th:nth-child(4) { width: 16%; min-width: 150px; }
.wishlist-table th:nth-child(5) { width: 9%; min-width: 96px; }
.wishlist-table th:nth-child(6) { width: 11%; min-width: 124px; }
.wishlist-table th:nth-child(7) { width: 15%; min-width: 160px; }
.wishlist-table th:nth-child(8) { width: 12%; min-width: 140px; }
.wishlist-table td[data-actions],
.wishlist-table th:last-child {
  width: auto;
  min-width: 130px;
  white-space: normal;
}

.wishlist-title-main {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.wishlist-title-main,
.wishlist-title-main > * {
  min-width: 0;
}

.wishlist-title-main a,
.wishlist-title-main strong {
  display: inline-flex;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: normal;
  white-space: normal;
}

.wishlist-title-main a,
.wishlist-title-main strong {
  line-height: 1.25;
}

.wishlist-title-main strong,
.wishlist-title-main a {
  -webkit-line-clamp: 2;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.wishlist-title-link {
  color: var(--accent);
  text-decoration: none;
}

.wishlist-title-link:hover {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.wishlist-title-original {
  color: var(--muted);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wishlist-license,
.wishlist-comment {
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-height: 1.32;
}

.wishlist-license {
  -webkit-line-clamp: 1;
}

.wishlist-actions {
  justify-content: flex-start;
}

.wishlist-actions button {
  padding-inline: 9px;
  min-height: 29px;
}

.table-wrap {
  overflow: auto;
  max-width: 100%;
  scrollbar-color: color-mix(in srgb, var(--accent) 44%, var(--line)) transparent;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1040px;
}

.data-table {
  table-layout: auto;
}

.data-table th {
  min-width: clamp(92px, 8vw, 132px);
  white-space: normal;
  line-height: 1.25;
}

.data-table th,
.data-table td,
td {
  overflow-wrap: break-word;
  word-break: normal;
}

.data-table td > * {
  max-width: 100%;
}

.data-table td[data-actions],
.data-table th:last-child {
  width: 1%;
  white-space: nowrap;
}

.data-table tr.overdue-row {
  background: color-mix(in srgb, var(--danger) 9%, transparent);
}

.data-table tr.selected-row {
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}

.data-table tr.task-row-active td {
  background: color-mix(in srgb, var(--accent) 8%, transparent);
}

.data-table tr.task-row-overdue td {
  background: color-mix(in srgb, var(--danger) 10%, transparent);
}

.task-list-hint {
  margin: 0 0 10px;
}

th,
td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
  line-height: 1.35;
  overflow-wrap: break-word;
  word-break: normal;
}

th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  background: color-mix(in srgb, var(--surface-2) 48%, transparent);
}

tr:hover td {
  background: color-mix(in srgb, var(--surface-3) 55%, transparent);
}

.pill {
  --pill-tone: var(--pill-fg, var(--pill-color, currentColor));
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  min-height: 24px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--pill-tone) 48%, var(--line));
  background:
    linear-gradient(180deg, color-mix(in srgb, #fff 28%, transparent), transparent),
    color-mix(in srgb, var(--pill-tone) 14%, var(--surface));
  color: var(--pill-tone);
  box-shadow: 0 1px 0 color-mix(in srgb, #fff 42%, transparent) inset;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 650;
}

.pill-accepted,
.pill-done,
.pill-ongoing {
  --pill-fg: var(--ok);
}

.pill-in_work {
  --pill-fg: var(--warn);
}

.pill-review {
  --pill-fg: #036a91;
}

.pill-partial {
  --pill-fg: #7e22ce;
}

.pill-fixes,
.pill-overdue,
.pill-blocked {
  --pill-fg: var(--danger);
}

.pill-not_started,
.pill-cancelled,
.pill-draft {
  --pill-fg: #475569;
}

.pill-replacement,
.pill-distribution,
.pill-excused {
  --pill-fg: var(--accent-4);
}

.pill-signup,
.pill-frozen {
  --pill-fg: var(--info);
}

.pill-application-new {
  --pill-fg: var(--info);
}

.pill-application-review {
  --pill-fg: var(--warn);
}

.pill-application-accepted {
  --pill-fg: var(--ok);
}

.pill-application-rejected {
  --pill-fg: var(--danger);
}

.role-pill {
  flex: 0 1 auto;
  min-height: 22px;
  padding: 3px 8px;
  border-color: color-mix(in srgb, currentColor 48%, var(--line));
  background: color-mix(in srgb, currentColor 16%, var(--surface));
  line-height: 1.18;
  overflow: visible;
  white-space: normal;
  box-shadow: 0 1px 0 color-mix(in srgb, #fff 38%, transparent) inset;
}

.role-pill-list {
  display: inline-flex;
  max-width: 100%;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  vertical-align: middle;
  line-height: 1.2;
}

.text-link-button {
  width: auto;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent);
  text-align: left;
  box-shadow: none;
}

.text-link-button:hover {
  transform: none;
  color: var(--accent-2);
}

.profile-head p .role-pill-list,
.userbox > span .role-pill-list {
  display: flex;
  margin-top: 6px;
}

.role-super_admin { --role-pill-tone: var(--role-super-admin); color: var(--role-super-admin); }
.role-admin { --role-pill-tone: var(--role-admin); color: var(--role-admin); }
.role-kp_curator,
.role-km_curator,
.role-season_curator,
.role-title_curator { --role-pill-tone: var(--role-curator); color: var(--role-curator); }
.role-dubber { --role-pill-tone: var(--role-dubber); color: var(--role-dubber); }
.role-sound { --role-pill-tone: var(--role-sound); color: var(--role-sound); }
.role-translator { --role-pill-tone: var(--role-translator); color: var(--role-translator); }
.role-editor { --role-pill-tone: var(--role-editor); color: var(--role-editor); }
.role-releaser { --role-pill-tone: var(--role-releaser); color: var(--role-releaser); }
.role-music,
.role-music_releaser { --role-pill-tone: var(--role-music); color: var(--role-music); }
.role-music_sound_director { --role-pill-tone: var(--role-music-sound); color: var(--role-music-sound); }
.role-vocalist { --role-pill-tone: var(--role-vocalist); color: var(--role-vocalist); }
.role-lyricist { --role-pill-tone: var(--role-lyricist); color: var(--role-lyricist); }
.role-video_editor { --role-pill-tone: var(--role-video); color: var(--role-video); }
.role-tune_timer { --role-pill-tone: var(--role-tune); color: var(--role-tune); }
.role-beta { --role-pill-tone: var(--role-beta); color: var(--role-beta); }

.role-tone-power {
  --role-pill-tone: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 52%, var(--line));
  background: color-mix(in srgb, var(--danger) 15%, var(--surface));
}

.role-tone-management {
  --role-pill-tone: var(--warn);
  border-color: color-mix(in srgb, var(--warn) 52%, var(--line));
  background: color-mix(in srgb, var(--warn) 14%, var(--surface));
}

.role-tone-work {
  --role-pill-tone: var(--ok);
  border-color: color-mix(in srgb, var(--ok) 48%, var(--line));
  background: color-mix(in srgb, var(--ok) 12%, var(--surface));
}

.role-tone-limited {
  --role-pill-tone: var(--muted);
  border-color: color-mix(in srgb, var(--muted) 42%, var(--line));
  background: color-mix(in srgb, var(--muted) 10%, var(--surface));
}

.role-pill.role-super_admin { --role-pill-tone: var(--role-super-admin); }
.role-pill.role-admin { --role-pill-tone: var(--role-admin); }
.role-pill.role-kp_curator,
.role-pill.role-km_curator,
.role-pill.role-season_curator,
.role-pill.role-title_curator { --role-pill-tone: var(--role-curator); }
.role-pill.role-dubber { --role-pill-tone: var(--role-dubber); }
.role-pill.role-sound { --role-pill-tone: var(--role-sound); }
.role-pill.role-translator { --role-pill-tone: var(--role-translator); }
.role-pill.role-editor { --role-pill-tone: var(--role-editor); }
.role-pill.role-releaser { --role-pill-tone: var(--role-releaser); }
.role-pill.role-music,
.role-pill.role-music_releaser { --role-pill-tone: var(--role-music); }
.role-pill.role-music_sound_director { --role-pill-tone: var(--role-music-sound); }
.role-pill.role-vocalist { --role-pill-tone: var(--role-vocalist); }
.role-pill.role-lyricist { --role-pill-tone: var(--role-lyricist); }
.role-pill.role-video_editor { --role-pill-tone: var(--role-video); }
.role-pill.role-tune_timer { --role-pill-tone: var(--role-tune); }
.role-pill.role-beta { --role-pill-tone: var(--role-beta); }

.role-pill,
.pill.role-pill {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border-color: color-mix(in srgb, var(--role-pill-tone, currentColor) 66%, var(--line));
  background:
    linear-gradient(180deg, color-mix(in srgb, #fff 42%, transparent) 0%, transparent 38%),
    radial-gradient(110% 180% at 18% -36%, color-mix(in srgb, #fff 52%, transparent) 0 24%, transparent 56%),
    radial-gradient(95% 150% at 84% 120%, color-mix(in srgb, var(--role-pill-tone, currentColor) 34%, transparent) 0 36%, transparent 70%),
    linear-gradient(135deg,
      color-mix(in srgb, var(--role-pill-tone, currentColor) 36%, var(--surface)) 0%,
      color-mix(in srgb, var(--role-pill-tone, currentColor) 22%, var(--surface-2)) 48%,
      color-mix(in srgb, var(--role-pill-tone, currentColor) 44%, #050505 8%) 100%);
  color: color-mix(in srgb, var(--role-pill-tone, currentColor) 88%, var(--text));
  text-shadow:
    0 1px 0 color-mix(in srgb, var(--surface) 68%, transparent),
    0 0 10px color-mix(in srgb, var(--role-pill-tone, currentColor) 16%, transparent);
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--role-pill-tone, currentColor) 20%, transparent) inset,
    0 1px 0 color-mix(in srgb, #fff 56%, transparent) inset,
    0 -1px 0 color-mix(in srgb, #000 16%, transparent) inset,
    0 7px 18px color-mix(in srgb, var(--role-pill-tone, currentColor) 16%, transparent),
    0 2px 5px color-mix(in srgb, #000 10%, transparent);
  transition:
    transform 0.16s ease,
    border-color 0.16s ease,
    background-position 0.24s ease,
    box-shadow 0.16s ease,
    filter 0.16s ease;
}

.role-pill::before,
.pill.role-pill::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: inherit;
  background:
    linear-gradient(112deg,
      transparent 0 34%,
      color-mix(in srgb, #fff 58%, transparent) 44%,
      color-mix(in srgb, #fff 26%, transparent) 50%,
      transparent 62% 100%);
  opacity: 0;
  transform: translateX(-120%);
  pointer-events: none;
  mix-blend-mode: screen;
}

[data-theme="dark"] .role-pill,
[data-theme="dark"] .pill.role-pill {
  color: color-mix(in srgb, var(--role-pill-tone, currentColor) 72%, #fff);
  text-shadow: 0 1px 8px color-mix(in srgb, #000 42%, transparent);
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--role-pill-tone, currentColor) 26%, transparent) inset,
    0 1px 0 color-mix(in srgb, #fff 18%, transparent) inset,
    0 -1px 0 color-mix(in srgb, #000 42%, transparent) inset,
    0 8px 22px color-mix(in srgb, var(--role-pill-tone, currentColor) 22%, transparent),
    0 2px 7px color-mix(in srgb, #000 26%, transparent);
}

.role-pill:hover,
.pill.role-pill:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--role-pill-tone, currentColor) 82%, var(--line));
  filter: saturate(1.14) brightness(1.03);
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--role-pill-tone, currentColor) 28%, transparent) inset,
    0 1px 0 color-mix(in srgb, #fff 64%, transparent) inset,
    0 -1px 0 color-mix(in srgb, #000 18%, transparent) inset,
    0 10px 24px color-mix(in srgb, var(--role-pill-tone, currentColor) 26%, transparent),
    0 3px 8px color-mix(in srgb, #000 12%, transparent);
}

@media (prefers-reduced-motion: no-preference) {
  .role-pill:hover::before,
  .pill.role-pill:hover::before {
    animation: role-pill-sheen 0.9s ease;
  }

  .role-pill:active,
  .pill.role-pill:active {
    transform: translateY(0) scale(0.98);
  }
}

@keyframes role-pill-sheen {
  0% {
    opacity: 0;
    transform: translateX(-120%);
  }
  28% {
    opacity: 0.68;
  }
  100% {
    opacity: 0;
    transform: translateX(120%);
  }
}

.progress {
  width: 140px;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--line);
}

.progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-3));
}

.progress-block {
  min-width: 120px;
  display: grid;
  gap: 4px;
  align-content: start;
}

.progress-block .progress {
  width: min(160px, 100%);
}

.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 2px color-mix(in srgb, currentColor 18%, var(--surface));
  flex: 0 0 auto;
}

.split {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
  flex-wrap: wrap;
}

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

.task-group {
  display: grid;
  gap: 8px;
}

.task-group h3 {
  margin: 0;
  font-size: 15px;
  color: var(--accent);
}

.login-screen {
  position: relative;
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(340px, 470px);
  background:
    linear-gradient(128deg, color-mix(in srgb, var(--accent) 16%, transparent), transparent 42%),
    linear-gradient(312deg, color-mix(in srgb, var(--accent-2) 13%, transparent), transparent 40%),
    linear-gradient(180deg, color-mix(in srgb, var(--accent-4) 10%, transparent), transparent 32%),
    var(--bg);
  overflow: hidden;
}

.login-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(90deg, transparent 0 34px, color-mix(in srgb, var(--accent) 9%, transparent) 34px 35px),
    linear-gradient(135deg, transparent 0 72%, color-mix(in srgb, var(--accent-3) 13%, transparent) 72% 100%);
  opacity: 0.34;
}

.login-copy {
  position: relative;
  z-index: 1;
  padding: clamp(26px, 4vw, 54px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 16px;
  min-width: 0;
}

.login-hero-card {
  position: relative;
  min-height: min(76vh, 740px);
  border: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 26px 70px color-mix(in srgb, var(--accent) 18%, rgba(24, 20, 18, 0.18));
  background: var(--surface);
}

.login-art {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(20, 16, 14, 0.1), rgba(20, 16, 14, 0.1)),
    linear-gradient(180deg, transparent 48%, rgba(22, 17, 14, 0.54)),
    url("/assets/zoku/zoku-login-autumn.jpg") center / cover no-repeat;
  transform: scale(1.01);
}

.login-hero-text {
  position: absolute;
  left: clamp(18px, 4vw, 44px);
  right: clamp(18px, 18vw, 280px);
  bottom: clamp(18px, 4vw, 44px);
  max-width: 590px;
  padding: clamp(18px, 3vw, 28px);
  border: 1px solid color-mix(in srgb, white 58%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 78%, transparent);
  backdrop-filter: blur(14px) saturate(1.1);
  box-shadow: 0 16px 42px rgba(28, 20, 16, 0.16);
}

.login-copy h1 {
  margin: 0;
  font-size: 58px;
  line-height: 1.03;
  text-wrap: balance;
}

.login-copy p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 17px;
}

.login-kicker {
  display: inline-flex;
  width: fit-content;
  margin-bottom: 10px;
  padding: 4px 9px;
  border: 1px solid color-mix(in srgb, var(--accent) 42%, var(--line));
  border-radius: 999px;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 9%, var(--surface));
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.login-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.login-badges span {
  padding: 5px 10px;
  border-radius: 999px;
  color: var(--text);
  background: color-mix(in srgb, var(--accent-2) 12%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--accent-2) 28%, var(--line));
  font-size: 12px;
  font-weight: 800;
}

.login-panel {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  border-left: 1px solid var(--line);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--surface) 72%, var(--accent) 8%), var(--surface) 54%),
    var(--surface);
  padding: clamp(24px, 3vw, 38px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 18px;
}

.login-form-card {
  position: relative;
  display: grid;
  gap: 16px;
  width: min(100%, 390px);
  min-width: 0;
  margin-inline: auto;
  padding: clamp(20px, 4vw, 30px);
  border: 1px solid color-mix(in srgb, var(--line) 86%, var(--accent));
  border-radius: 8px;
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--accent) 8%, transparent), transparent 46%),
    var(--surface);
  box-shadow: var(--shadow);
}

.login-form-card::before {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px solid color-mix(in srgb, var(--accent-2) 20%, transparent);
  border-radius: 6px;
  pointer-events: none;
}

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

.login-2fa-account {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid color-mix(in srgb, var(--accent) 44%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent) 9%, var(--surface-2));
}

.login-2fa-account span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.login-2fa-account strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.application-open-button {
  width: 100%;
}

.application-public-screen {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(260px, 0.42fr) minmax(0, 1fr);
  background:
    linear-gradient(120deg, color-mix(in srgb, var(--accent) 12%, transparent), transparent 46%),
    linear-gradient(180deg, color-mix(in srgb, var(--surface-3) 44%, transparent), transparent 72%),
    var(--bg);
}

.application-public-intro {
  min-width: 0;
  padding: clamp(22px, 3vw, 44px);
  display: grid;
  align-content: center;
  gap: 18px;
  border-right: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(18, 15, 13, 0.22), rgba(18, 15, 13, 0.62)),
    url("/assets/zoku/zoku-login-autumn.jpg") center / cover no-repeat;
  color: #fff;
}

.application-public-intro .brand,
.application-public-intro .login-kicker,
.application-public-intro .button-like {
  background: color-mix(in srgb, var(--surface) 72%, transparent);
  color: var(--text);
  backdrop-filter: blur(10px);
}

.application-public-intro h1 {
  max-width: 620px;
  margin: 0;
  font-size: clamp(30px, 4vw, 54px);
  line-height: 1.05;
}

.application-public-intro p {
  max-width: 620px;
  margin: 0;
  color: color-mix(in srgb, #fff 84%, var(--muted));
  font-size: 16px;
  line-height: 1.55;
}

.application-public-login {
  width: fit-content;
}

.application-public-form {
  min-width: 0;
  padding: clamp(14px, 2vw, 28px);
  display: grid;
  align-items: center;
}

.application-modal-standalone {
  position: static;
  inset: auto;
  z-index: auto;
  padding: 0;
  overflow: visible;
  background: transparent;
  display: block;
}

.application-modal-standalone .application-dialog {
  width: min(1120px, 100%);
  max-height: none;
  min-height: min(860px, calc(100vh - clamp(28px, 4vw, 56px)));
  margin-inline: auto;
}

.application-login-link {
  align-self: flex-start;
}

@media (max-width: 980px) {
  .application-public-screen {
    grid-template-columns: 1fr;
  }

  .application-public-intro {
    min-height: 320px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    align-content: end;
  }

  .application-public-form {
    align-items: start;
  }

  .application-modal-standalone .application-dialog {
    min-height: auto;
  }
}

.application-modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  padding: 24px;
  overflow: auto;
  background: color-mix(in srgb, #151412 58%, transparent);
  display: grid;
  place-items: center;
}

.application-dialog {
  width: min(1040px, 100%);
  max-height: min(92vh, 980px);
  overflow: hidden;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 26px 80px rgba(0, 0, 0, 0.28);
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.application-modal-standalone {
  position: static;
  inset: auto;
  z-index: auto;
  padding: 0;
  overflow: visible;
  background: transparent;
  display: block;
}

.application-modal-standalone .application-dialog {
  width: min(1120px, 100%);
  max-height: none;
  min-height: min(860px, calc(100vh - clamp(28px, 4vw, 56px)));
  margin-inline: auto;
}

@media (max-width: 980px) {
  .application-modal-standalone .application-dialog {
    min-height: auto;
  }
}

.application-dialog-head {
  position: sticky;
  top: 0;
  z-index: 3;
  flex: 0 0 auto;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  min-height: 72px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: blur(2px);
}

.application-dialog-head > div {
  min-width: 0;
  display: grid;
  gap: 8px;
  align-content: start;
}

.application-dialog-head h2 {
  margin: 0;
  line-height: 1.08;
  font-size: 28px;
  overflow-wrap: anywhere;
}

.application-dialog-head p {
  margin: 6px 0 0;
  color: var(--muted);
}

.application-form,
.application-role-groups,
.application-questions {
  display: grid;
  gap: 14px;
}

.application-form {
  flex: 1 1 auto;
  overflow: auto;
  min-height: 0;
  padding: 6px 18px 14px;
  gap: 12px;
}

.application-honeypot {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.application-role-group {
  padding: 9px 10px;
  border: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-2) 46%, transparent);
}

.application-role-group h3,
.application-questions h3,
.application-detail-block h3 {
  margin: 0 0 9px;
  font-size: 14px;
  color: var(--accent);
}

.application-role-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.application-role-card {
  min-height: 30px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  cursor: pointer;
  white-space: normal;
  text-align: center;
  line-height: 1.2;
  max-width: 100%;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.application-role-card input[type="radio"] {
  display: none;
}

.application-role-card span {
  font-size: 13px;
}

.application-role-card.selected {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 16%, var(--surface));
  color: color-mix(in srgb, var(--accent) 78%, var(--text));
  font-weight: 750;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 38%, transparent);
}

.application-role-card:hover {
  border-color: color-mix(in srgb, var(--accent) 48%, var(--line));
  background: color-mix(in srgb, var(--accent) 8%, var(--surface));
}

.application-general-fields,
.compact-form-grid {
  gap: 10px;
}

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

.application-general-fields .field.wide,
.application-questions .field.wide,
.application-questions .form-grid .field {
  grid-column: 1 / -1;
}

.application-rules {
  padding: 10px;
  border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent) 8%, var(--surface));
  display: grid;
  gap: 6px;
  align-items: center;
}

.application-rules-row {
  display: inline-flex;
  align-items: flex-start;
  gap: 8px;
  flex-wrap: wrap;
  line-height: 1.22;
  font-size: 13px;
}

.application-rules-row input {
  margin-top: 1px;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.application-rules-link {
  color: color-mix(in srgb, var(--accent) 82%, var(--text));
  text-decoration: underline;
  text-underline-offset: 2px;
  white-space: nowrap;
  flex-shrink: 0;
}

.application-rules-hint {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
}

.application-rules-label {
  color: var(--text);
  display: inline;
}

.application-rules > * {
  min-width: 0;
}

.application-rules .field-error {
  margin-top: 2px;
}

.application-rules {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.application-rules .application-rules-row {
  justify-content: flex-start;
}

.application-rules .application-rules-hint {
  justify-self: end;
}

.application-rules input {
  margin-top: 2px;
}

.application-rules-row span,
.application-rules-label {
  color: var(--text);
}

.application-rules-link {
  width: auto;
  min-width: 0;
}

.application-rules + .application-dialog-actions {
  margin-top: 2px;
}

@media (max-width: 700px) {
  .application-rules {
    width: 100%;
  }

  .application-rules {
    display: grid;
  }
}

@media (max-width: 480px) {
  .application-rules-hint {
    font-size: 10px;
  }
}

.application-rules,
.application-dialog-actions {
  position: relative;
  z-index: 2;
}

@media (max-width: 700px) {
  .application-dialog-head,
  .application-dialog-actions,
  .application-rules {
    padding-left: 14px;
    padding-right: 14px;
  }
}

@media (max-width: 520px) {
  .application-dialog-head {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
  }

  .application-dialog-head .application-stepper {
    gap: 5px;
  }

  .application-dialog-head .application-stepper span {
    min-height: 22px;
    padding-inline: 7px;
    font-size: 11px;
  }
}

.application-dialog-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.application-dialog-actions {
  position: sticky;
  bottom: 0;
  z-index: 3;
  margin-top: auto;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  padding: 10px 0 0;
  border-top: 1px solid color-mix(in srgb, var(--line) 82%, transparent);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: blur(2px);
}

.application-dialog-head {
  min-height: 0;
}

.application-dialog-head h2 {
  font-size: 24px;
}

.application-form {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
}

.application-form-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  display: grid;
  gap: 12px;
  padding: 12px 18px 14px;
}

.application-stepper {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  min-width: 0;
  margin-top: 2px;
}

.application-stepper span {
  min-height: 24px;
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  padding: 0 9px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface-2) 72%, transparent);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
  white-space: normal;
}

.application-section {
  display: grid;
  gap: 10px;
  padding: 10px 0 2px;
  border-top: 1px solid color-mix(in srgb, var(--line) 62%, transparent);
}

.application-section:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.application-section-head {
  display: flex;
  gap: 9px;
  align-items: flex-start;
}

.application-section-head h3 {
  margin: 0;
  font-size: 15px;
  color: var(--text);
}

.application-section-head p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.application-step-number {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 18%, var(--surface));
  color: color-mix(in srgb, var(--accent) 82%, var(--text));
  font-size: 12px;
  font-weight: 900;
}

.application-role-groups {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
}

.application-role-group {
  padding: 8px;
  border-color: color-mix(in srgb, var(--line) 52%, transparent);
  background: color-mix(in srgb, var(--surface-2) 26%, transparent);
}

.application-role-group h3 {
  margin-bottom: 7px;
  font-size: 12px;
  letter-spacing: 0;
}

.application-role-list {
  gap: 6px;
}

.application-role-card {
  min-height: 28px;
  padding: 4px 10px;
  border-color: color-mix(in srgb, var(--line) 70%, transparent);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
}

.application-role-card span {
  font-size: 12px;
  line-height: 1.15;
}

.application-general-fields,
.compact-form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 12px;
}

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

.application-choice-option {
  display: inline-grid;
  gap: 6px;
  min-width: 0;
}

.application-choice-chip {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border: 1px solid color-mix(in srgb, var(--line) 68%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  cursor: pointer;
  font-size: 12px;
  font-weight: 750;
  line-height: 1.15;
  max-width: 100%;
}

.application-choice-chip input {
  width: 13px;
  min-width: 13px;
  height: 13px;
  margin: 0;
}

.application-choice-chip.selected,
.application-choice-chip:has(input:checked) {
  border-color: color-mix(in srgb, var(--accent) 56%, var(--line));
  background: color-mix(in srgb, var(--accent) 16%, var(--surface));
  color: color-mix(in srgb, var(--accent) 82%, var(--text));
}

.application-required-mark {
  margin-left: 4px;
  color: var(--danger);
  font-weight: 900;
}

.application-other-field {
  display: none;
  gap: 4px;
  min-width: min(220px, 100%);
  font-size: 12px;
}

.application-other-field.visible {
  display: grid;
}

.application-help,
.application-help-details {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.application-help-details summary {
  cursor: pointer;
  color: color-mix(in srgb, var(--accent) 78%, var(--text));
}

.application-help-details ul {
  margin: 6px 0 0;
  padding-left: 18px;
}

.application-attachment-panel {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px dashed color-mix(in srgb, var(--accent) 36%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent) 5%, var(--surface));
}

.application-attachment-panel.uploading {
  opacity: 0.78;
}

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

.application-attachment-actions > span,
.application-upload-status {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.application-file-picker {
  position: relative;
  overflow: hidden;
}

.application-file-picker input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
}

.application-file-picker.disabled {
  opacity: 0.55;
  pointer-events: none;
}

.application-attachment-list {
  display: grid;
  gap: 7px;
}

.application-attachment-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 8px 9px;
  border: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
}

.application-attachment-item strong,
.application-attachment-item span {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.application-attachment-item strong {
  color: var(--text);
  font-size: 13px;
}

.application-attachment-item span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.application-upload-error {
  margin: 0;
}

.application-form .field.invalid {
  padding: 0;
  margin: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.application-dialog-actions {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 10px 18px;
}

.application-action-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.application-rules {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  gap: 7px;
  align-items: center;
  padding: 0;
  border: 0;
  background: transparent;
  font-size: 12px;
  line-height: 1.35;
}

.application-rules input[type="checkbox"] {
  width: 16px;
  min-width: 16px;
  height: 16px;
  min-height: 16px;
  margin: 0;
  align-self: center;
}

.application-rules > span:not(.field-error) {
  align-self: center;
}

.application-rules .field-error {
  grid-column: 2;
  margin: 0;
}

.application-rules.invalid {
  color: var(--danger);
}

.application-detail-block article {
  display: grid;
  gap: 3px;
}

@media (max-width: 760px) {
  .application-modal {
    padding: 8px;
  }

  .application-dialog {
    max-height: 96vh;
  }

  .application-dialog-head {
    padding: 12px 14px;
  }

  .application-dialog-head h2 {
    font-size: 21px;
  }

  .application-form-scroll {
    padding: 10px 14px 12px;
  }

  .application-role-groups,
  .application-general-fields,
  .compact-form-grid {
    grid-template-columns: 1fr;
  }

  .application-dialog-actions {
    grid-template-columns: 1fr;
    padding: 10px 14px;
  }

  .application-action-buttons {
    justify-content: stretch;
  }

  .application-action-buttons button {
    flex: 1 1 140px;
  }
}

.application-admin-view .application-list-card .table-wrap {
  max-height: 68vh;
}

.application-admin-view tr.application-row-accepted {
  background: color-mix(in srgb, var(--ok) 9%, transparent);
}

.application-admin-view tr.application-row-rejected {
  background: color-mix(in srgb, var(--danger) 8%, transparent);
}

.application-admin-view tr.application-row-review {
  background: color-mix(in srgb, var(--warn) 7%, transparent);
}

.application-answer-link {
  display: inline-block;
  max-width: 100%;
  margin-top: 3px;
  color: var(--accent);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
  overflow-wrap: anywhere;
}

.application-filters label {
  min-width: min(240px, 100%);
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.application-detail-panel {
  display: grid;
  gap: 14px;
}

.application-detail-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.application-detail-head h2 {
  margin: 2px 0 4px;
  font-size: 22px;
}

.application-detail-head p {
  margin: 0;
  color: var(--muted);
}

.application-detail-grid,
.application-system-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 8px;
}

.application-detail-grid div,
.application-system-fields div {
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: color-mix(in srgb, var(--surface-2) 44%, transparent);
  min-width: 0;
}

.application-detail-grid span,
.application-system-fields span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.application-detail-grid strong,
.application-system-fields strong,
.application-detail-block p {
  overflow-wrap: anywhere;
}

.application-detail-block {
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.application-detail-block p {
  margin: 0;
}

.application-detail-block article {
  padding: 9px 0;
  border-top: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}

.application-detail-block article:first-of-type {
  border-top: 0;
}

.application-detail-block article p {
  margin-top: 5px;
  color: var(--muted);
}

.application-admin-attachment-list {
  display: grid;
  gap: 8px;
}

.application-admin-attachment {
  display: grid;
  gap: 3px;
  padding: 9px 10px;
  border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent) 6%, var(--surface));
  color: inherit;
  text-decoration: none;
  min-width: 0;
}

.application-admin-attachment strong,
.application-admin-attachment span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.application-admin-attachment span {
  color: var(--muted);
  font-size: 12px;
}

.application-admin-attachment:hover {
  border-color: color-mix(in srgb, var(--accent) 58%, var(--line));
  background: color-mix(in srgb, var(--accent) 11%, var(--surface));
}

.application-admin-box {
  padding: 12px;
  border: 1px solid color-mix(in srgb, var(--accent-3) 35%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent-3) 8%, var(--surface));
  display: grid;
  gap: 10px;
}

.application-admin-box label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.application-admin-view {
  align-items: start;
}

.application-funnel {
  border-color: color-mix(in srgb, var(--accent) 20%, var(--line));
  background:
    linear-gradient(115deg, color-mix(in srgb, var(--accent) 10%, var(--surface)) 0%, var(--surface) 48%, color-mix(in srgb, var(--warn) 6%, var(--surface)) 100%);
}

.application-funnel .card-header p,
.application-control-card .card-header p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.application-total-badge {
  flex: 0 0 auto;
  padding: 6px 10px;
  border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--line));
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 8%, var(--surface-2));
  color: var(--text);
  font-weight: 800;
}

.application-funnel-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.application-funnel-card {
  position: relative;
  min-height: 86px;
  padding: 14px 16px 13px;
  border-color: color-mix(in srgb, var(--accent) 18%, var(--line));
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--surface-2) 72%, transparent), color-mix(in srgb, var(--surface) 90%, transparent));
  overflow: hidden;
}

.application-funnel-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: color-mix(in srgb, var(--accent) 62%, transparent);
}

.application-funnel-review::before {
  background: color-mix(in srgb, var(--warn) 70%, transparent);
}

.application-funnel-accepted::before {
  background: color-mix(in srgb, var(--ok) 70%, transparent);
}

.application-funnel-rejected::before {
  background: color-mix(in srgb, var(--danger) 66%, transparent);
}

.application-funnel-card.active,
.application-funnel-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 34px color-mix(in srgb, var(--accent) 10%, transparent);
}

.application-funnel-card small {
  font-size: 11px;
  text-transform: uppercase;
}

.application-control-card {
  overflow: hidden;
}

.application-filters {
  display: grid;
  grid-template-columns: minmax(180px, .75fr) minmax(220px, .9fr) minmax(260px, 1.4fr) auto;
  align-items: end;
  gap: 12px;
}

.application-filters label {
  min-width: 0;
}

.application-workbench {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.application-list-card,
.application-detail-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--surface-2) 58%, transparent), color-mix(in srgb, var(--surface) 92%, transparent));
  box-shadow: 0 18px 38px color-mix(in srgb, #000 12%, transparent);
  overflow: hidden;
}

.application-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 8%, transparent), transparent 60%);
}

.application-list-head > div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.application-list-head strong {
  font-size: 18px;
}

.application-list-head > span {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.application-list-scroll {
  max-height: min(74vh, 820px);
  display: grid;
  gap: 8px;
  padding: 10px;
  overflow: auto;
  overscroll-behavior: contain;
}

.application-ticket {
  position: relative;
  min-width: 0;
  width: 100%;
  display: grid;
  grid-template-columns: 118px minmax(260px, 1fr) minmax(150px, 230px) minmax(190px, 280px);
  gap: 14px;
  align-items: center;
  padding: 13px 14px;
  border: 1px solid color-mix(in srgb, var(--line) 88%, transparent);
  border-radius: 8px;
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--surface-2) 74%, transparent), color-mix(in srgb, var(--surface) 95%, transparent));
  color: var(--text);
  text-align: left;
  box-shadow: none;
  overflow: hidden;
}

.application-ticket::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: color-mix(in srgb, var(--accent) 62%, transparent);
}

.application-ticket-review::before {
  background: color-mix(in srgb, var(--warn) 74%, transparent);
}

.application-ticket-accepted::before {
  background: color-mix(in srgb, var(--ok) 78%, transparent);
}

.application-ticket-rejected::before {
  background: color-mix(in srgb, var(--danger) 70%, transparent);
}

.application-ticket:hover,
.application-ticket.selected {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--accent) 52%, var(--line));
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--accent) 12%, var(--surface)), color-mix(in srgb, var(--surface) 95%, transparent));
}

.application-ticket.selected {
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 42%, transparent);
}

.application-ticket-glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(115deg, transparent 0%, color-mix(in srgb, #fff 8%, transparent) 46%, transparent 64%);
  opacity: 0;
  transform: translateX(-18%);
  transition: opacity .22s ease, transform .22s ease;
}

.application-ticket:hover .application-ticket-glow,
.application-ticket.selected .application-ticket-glow {
  opacity: .7;
  transform: translateX(0);
}

.application-ticket-date {
  color: var(--text);
  font-weight: 900;
  line-height: 1.35;
}

.application-ticket-main,
.application-ticket-status,
.application-ticket-side,
.application-ticket-head {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.application-ticket-head {
  align-items: center;
}

.application-ticket-head strong,
.application-ticket-role,
.application-ticket-comment,
.application-ticket-status,
.application-ticket-status .pill,
.application-ticket-side span,
.application-ticket-side small {
  min-width: 0;
  overflow-wrap: anywhere;
}

.application-ticket-head strong {
  font-size: 16px;
}

.application-ticket-role {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.application-ticket-comment {
  max-width: 100%;
  color: var(--text);
  line-height: 1.35;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.application-ticket-status {
  justify-items: center;
}

.application-ticket-status .pill {
  max-width: 100%;
  justify-content: center;
  white-space: normal;
  text-align: center;
}

.application-ticket-side {
  justify-items: end;
  text-align: right;
}

.application-ticket-side span {
  max-width: 100%;
  font-weight: 800;
}

.application-ticket-side small {
  max-width: 100%;
  color: var(--muted);
}

.application-detail-card {
  position: sticky;
  top: 12px;
  max-height: calc(100vh - 24px);
  overflow: auto;
}

.application-review-modal {
  position: fixed;
  z-index: 1200;
  inset: 0;
  display: grid;
  place-items: center;
  padding: clamp(12px, 3vw, 32px);
  background: color-mix(in srgb, #000 58%, transparent);
  backdrop-filter: blur(10px);
}

.application-review-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.application-review-backdrop:hover {
  transform: none;
  background: transparent;
}

.application-review-dialog {
  position: relative;
  z-index: 1;
  width: min(1120px, 100%);
  max-height: min(88vh, 940px);
  border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--line));
  border-radius: 8px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 9%, transparent), transparent 52%),
    var(--surface);
  box-shadow: 0 28px 80px color-mix(in srgb, #000 44%, transparent);
  overflow: auto;
  overscroll-behavior: contain;
}

.application-review-toolbar {
  position: sticky;
  z-index: 2;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--accent) 9%, var(--surface)), color-mix(in srgb, var(--surface) 94%, transparent));
  backdrop-filter: blur(12px);
}

.application-review-toolbar > div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.application-review-toolbar strong {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 18px;
}

.application-review-toolbar button {
  flex: 0 0 auto;
}

.application-review-dialog .application-detail-panel {
  padding: 16px;
}

.application-review-dialog .application-detail-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.application-review-dialog .application-admin-box {
  position: sticky;
  bottom: 0;
  margin-top: 4px;
  box-shadow: 0 -18px 34px color-mix(in srgb, #000 14%, transparent);
}

.application-detail-panel {
  padding: 14px;
}

.application-detail-hero {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 15px;
  border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--line));
  border-radius: 8px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 14%, transparent), transparent 58%),
    color-mix(in srgb, var(--surface-2) 54%, transparent);
  overflow: hidden;
}

.application-detail-hero::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: color-mix(in srgb, var(--accent) 68%, transparent);
}

.application-detail-review::before {
  background: color-mix(in srgb, var(--warn) 76%, transparent);
}

.application-detail-accepted::before {
  background: color-mix(in srgb, var(--ok) 78%, transparent);
}

.application-detail-rejected::before {
  background: color-mix(in srgb, var(--danger) 70%, transparent);
}

.application-detail-hero > div {
  min-width: 0;
}

.application-detail-hero h2 {
  margin: 3px 0 5px;
  font-size: 24px;
  line-height: 1.05;
  overflow-wrap: anywhere;
}

.application-detail-hero p {
  margin: 0;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.application-detail-grid,
.application-system-fields {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.application-detail-fact strong {
  line-height: 1.28;
}

.application-detail-note {
  padding: 12px;
  border: 1px solid color-mix(in srgb, var(--accent) 24%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent) 6%, var(--surface));
}

.application-detail-note span {
  display: block;
  margin-bottom: 6px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.application-detail-note p {
  margin: 0;
  color: var(--text);
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.application-detail-block h3 {
  color: var(--accent);
  font-size: 13px;
  letter-spacing: 0;
}

.application-detail-block article {
  display: grid;
  gap: 5px;
  padding: 11px 0;
}

.application-detail-block article strong {
  color: var(--text);
}

.application-admin-box {
  border-color: color-mix(in srgb, var(--accent) 36%, var(--line));
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 9%, transparent), transparent 65%),
    color-mix(in srgb, var(--surface-2) 54%, transparent);
}

.application-system-details {
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.application-system-details summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

@media (max-width: 1180px) {
  .application-workbench {
    grid-template-columns: 1fr;
  }

  .application-ticket {
    grid-template-columns: 104px minmax(0, 1fr) minmax(140px, 210px);
  }

  .application-ticket-main {
    grid-column: 2 / -1;
  }

  .application-ticket-status {
    grid-column: 2;
    grid-row: 2;
    justify-items: start;
  }

  .application-ticket-side {
    grid-column: 3;
    grid-row: 2;
  }

  .application-detail-card {
    position: static;
    max-height: none;
  }

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

  .application-review-dialog .application-detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .application-filters,
  .application-detail-grid,
  .application-system-fields {
    grid-template-columns: 1fr;
  }

  .application-ticket {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .application-ticket-main,
  .application-ticket-status,
  .application-ticket-side {
    grid-column: auto;
    grid-row: auto;
    justify-items: start;
    text-align: left;
  }

  .application-detail-hero,
  .application-list-head {
    flex-direction: column;
  }

  .application-review-modal {
    padding: 8px;
  }

  .application-review-dialog {
    max-height: calc(100dvh - 16px);
  }

  .application-review-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .application-review-toolbar button {
    width: 100%;
  }
}

.login-panel h2 {
  margin: 0;
  font-size: 30px;
}

.notice {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  min-width: 0;
  overflow-wrap: anywhere;
}

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

.notification-card {
  padding: 12px;
  border: 1px solid var(--line);
  border-left-width: 5px;
  border-radius: 8px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--surface-3) 18%, transparent), transparent 55%),
    var(--surface);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.notification-card.unread {
  box-shadow: 0 10px 24px color-mix(in srgb, var(--accent) 10%, transparent);
}

.notification-card.read {
  opacity: 0.74;
}

.notification-card.urgent {
  border-left-color: var(--danger);
  background: linear-gradient(135deg, color-mix(in srgb, var(--danger) 10%, var(--surface)), var(--surface) 58%);
}

.notification-card.warning {
  border-left-color: var(--warn);
  background: linear-gradient(135deg, color-mix(in srgb, var(--warn) 12%, var(--surface)), var(--surface) 58%);
}

.notification-card.action {
  border-left-color: var(--accent-2);
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent-2) 10%, var(--surface)), var(--surface) 58%);
}

.notification-card.success {
  border-left-color: var(--ok);
  background: linear-gradient(135deg, color-mix(in srgb, var(--ok) 10%, var(--surface)), var(--surface) 58%);
}

.notification-card.info {
  border-left-color: var(--info);
}

.notification-main {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.notification-main strong {
  overflow-wrap: anywhere;
}

.notification-main small {
  color: var(--muted);
}

.notification-title,
.notification-actions {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
}

.notification-tone {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.accent-panel {
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 16%, var(--surface)), var(--surface) 58%),
    var(--surface);
}

.danger-panel {
  border-color: color-mix(in srgb, var(--danger) 45%, var(--line));
  background: color-mix(in srgb, var(--danger) 5%, var(--surface));
}

.danger-panel button {
  border-color: color-mix(in srgb, var(--danger) 55%, var(--line));
  color: var(--danger);
}

.export-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr));
  gap: 10px;
}

.export-actions button {
  min-height: 54px;
  background: color-mix(in srgb, var(--accent-3) 10%, var(--surface));
}

.export-output {
  min-height: 150px;
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 13px;
}

.inline-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.notice.error {
  border-color: var(--danger);
  color: var(--danger);
}

.notice.success {
  border-color: var(--ok);
  color: var(--ok);
  background: color-mix(in srgb, var(--ok) 10%, var(--surface));
}

.drawer-error-summary {
  align-items: flex-start;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--danger) 12%, transparent), transparent 72%),
    color-mix(in srgb, var(--surface-2) 82%, transparent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--danger) 18%, transparent) inset;
}

.drawer-error-summary strong,
.drawer-error-summary span {
  display: block;
}

.drawer-error-summary span {
  margin-top: 4px;
  color: var(--text);
}

.field.invalid {
  position: relative;
  padding: 10px;
  margin: -10px;
  border: 1px solid color-mix(in srgb, var(--danger) 72%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, var(--danger) 9%, transparent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 12%, transparent);
}

.field.invalid label span:first-child {
  color: var(--danger);
}

.field.invalid input,
.field.invalid select,
.field.invalid textarea,
.field.invalid .multi-combobox summary {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 18%, transparent);
}

.field-error {
  margin-top: 6px;
  color: var(--danger);
  font-weight: 800;
  font-size: 12px;
  line-height: 1.35;
}

.drawer {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(0, 0, 0, 0.38);
  display: grid;
  place-items: stretch end;
}

.drawer-panel {
  --drawer-footer-space: 96px;
  --drawer-grid-pad-block: 16px;
  --multi-open-extra-space: 280px;
  width: min(620px, 100vw);
  height: 100vh;
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
  background: var(--surface);
  border-left: 1px solid var(--line);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.drawer-panel header,
.drawer-panel footer {
  padding: 16px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: blur(12px);
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.drawer-panel header {
  position: relative;
  z-index: 2;
}

.drawer-panel header h2 {
  margin: 0;
  font-size: 18px;
}

.drawer-panel footer {
  position: relative;
  z-index: 2;
  border-top: 1px solid var(--line);
  border-bottom: 0;
}

.form-grid {
  min-height: 0;
  overflow: auto;
  padding: 16px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-content: start;
}

.drawer-panel .form-grid {
  scroll-padding-block: var(--drawer-grid-pad-block, 16px) var(--drawer-footer-space, 96px);
}

.drawer-panel.has-open-multi-combobox .form-grid,
.drawer-panel:has(.multi-combobox[open]) .form-grid {
  padding-bottom: calc(var(--drawer-grid-pad-block, 16px) + var(--drawer-footer-space, 96px) + var(--multi-open-extra-space, 280px));
}

.form-grid .wide {
  grid-column: 1 / -1;
}

.empty {
  min-height: 156px;
  padding: 30px;
  color: var(--muted);
  text-align: center;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  border: 1px dashed color-mix(in srgb, var(--line) 72%, var(--accent));
  border-radius: 8px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 9%, transparent), transparent 58%),
    color-mix(in srgb, var(--surface-2) 46%, transparent);
}

.empty::before {
  content: "";
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background:
    linear-gradient(135deg, var(--accent), var(--accent-3));
  opacity: 0.82;
  box-shadow: 0 10px 22px color-mix(in srgb, var(--accent) 22%, transparent);
}

.empty strong {
  color: var(--text);
  font-size: 15px;
}

.empty span {
  max-width: 360px;
}

.mobile-menu {
  display: none;
}

@media (max-width: 1440px) and (min-width: 981px) {
  .app {
    --sidebar-width: clamp(220px, 17vw, 236px);
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  }

  .topbar {
    padding-left: 18px;
    padding-right: 18px;
    gap: 12px;
  }

  .toolbar {
    gap: 6px;
    grid-template-columns: auto minmax(190px, 240px) auto auto auto;
  }

  .deadline-clock {
    width: clamp(164px, 13vw, 202px);
    grid-template-columns: 32px minmax(0, 1fr);
    gap: 8px;
    padding-inline: 10px;
  }

  .deadline-clock-orb {
    width: 31px;
    height: 31px;
  }

  .deadline-clock-caption {
    font-size: 10px;
  }

  .searchbox {
    width: 220px;
    min-width: min(220px, 100%);
  }

  .department-toggle button {
    min-width: 48px;
    padding-inline: 12px;
  }

  .toolbar-action {
    width: 40px;
    padding-inline: 10px;
  }

  .toolbar-action-label {
    display: none;
  }

  .sidebar {
    padding: 14px;
  }

  .brand strong {
    font-size: 16px;
  }

  .nav button {
    padding-inline: 9px;
  }
}

@media (max-width: 980px) {
  .app {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 10;
    width: 280px;
    transform: translateX(-102%);
    transition: transform 0.18s ease;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-collapse-toggle {
    display: none;
  }

  .brand-row {
    position: sticky;
    top: -14px;
    z-index: 1;
    margin: -14px -14px 0;
    border-radius: 0 0 16px 16px;
    border-inline: 0;
    border-top: 0;
  }

  .mobile-menu {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
  }

  .topbar {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 10px;
    align-items: start;
  }

  .deadline-clock {
    grid-column: 1 / -1;
    width: 100%;
    max-width: 440px;
    justify-self: stretch;
  }

  .toolbar {
    width: 100%;
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: auto minmax(180px, 1fr) auto auto auto;
    justify-content: stretch;
    align-items: center;
  }

  .searchbox {
    min-width: 0;
    width: 100%;
  }

  .span-3,
  .span-4,
  .span-5,
  .span-6,
  .span-7,
  .span-8 {
    grid-column: span 6;
  }

  .application-list-card,
  .application-detail-card,
  .distribution-overview,
  .content-distribution .span-4,
  .content-distribution .span-8 {
    grid-column: span 12;
  }

  .profile-metrics,
  .profile-layout,
  .profile-columns,
  .music-workspace,
  .lyric-workspace,
  .lyric-editor-layout,
  .lyric-compare-grid,
  .lyric-library-preview,
  .production-team,
  .production-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .production-row {
    grid-template-columns: 1fr;
  }

  .team-compact-card {
    grid-template-columns: minmax(170px, 1fr) minmax(190px, 1fr) minmax(130px, 0.8fr);
  }

  .team-compact-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
}

@media (max-width: 860px) {
  .team-compact-card {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .team-compact-actions {
    justify-content: stretch;
  }

  .team-compact-actions button {
    flex: 1 1 140px;
  }

  .table-wrap {
    overflow: visible;
  }

  table.data-table,
  .profile-card .table-wrap table {
    min-width: 0;
    border-collapse: separate;
    border-spacing: 0 10px;
  }

  .data-table thead {
    display: none;
  }

  .data-table tbody,
  .data-table tr,
  .data-table td {
    display: block;
    width: 100%;
  }

  .data-table tr {
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background:
      linear-gradient(135deg, color-mix(in srgb, var(--surface-3) 34%, transparent), transparent 72%),
      var(--surface);
  }

  .data-table tr.task-row-active {
    border-color: color-mix(in srgb, var(--accent) 56%, var(--line));
    background:
      linear-gradient(135deg, color-mix(in srgb, var(--accent) 14%, transparent), transparent 72%),
      var(--surface);
  }

  .data-table tr.task-row-overdue {
    border-color: color-mix(in srgb, var(--danger) 62%, var(--line));
    background:
      linear-gradient(135deg, color-mix(in srgb, var(--danger) 13%, transparent), transparent 72%),
      var(--surface);
  }

  .data-table td {
    min-height: 34px;
    padding: 8px 0;
    border-bottom: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
  }

  .data-table td[data-label] {
    display: grid;
    grid-template-columns: minmax(78px, 30%) minmax(0, 1fr);
    gap: 10px;
    align-items: start;
  }

  .data-table td[data-label]::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 12px;
    font-weight: 750;
    text-transform: uppercase;
  }

  .data-table td:last-child {
    border-bottom: 0;
  }

  .data-table td:not([data-label]) {
    padding-top: 10px;
  }

  .data-table td[data-actions] {
    display: flex;
    width: 100%;
    white-space: normal;
    gap: 6px;
    flex-wrap: wrap;
    align-items: center;
    padding-top: 12px;
    margin-top: 2px;
    border-top: 1px solid color-mix(in srgb, var(--line) 66%, transparent);
    border-bottom: 0;
  }

  .data-table .row-actions {
    justify-content: flex-start;
  }

  .data-table td[data-actions] > .row-actions {
    display: contents;
  }

  .data-table td[data-actions] > button,
  .data-table td[data-actions] > .row-actions > button {
    flex: 1 1 128px;
  }

  .distribution-admin-filters {
    grid-template-columns: 1fr 1fr;
  }

  .distribution-admin-count {
    grid-column: 1 / -1;
    justify-self: start;
  }

  .distribution-admin-table-wrap .table-wrap {
    overflow: auto;
  }

  .distribution-admin-table-wrap .data-table,
  .distribution-admin-table-wrap .data-table thead,
  .distribution-admin-table-wrap .data-table tbody,
  .distribution-admin-table-wrap .data-table tr,
  .distribution-admin-table-wrap .data-table td,
  .distribution-admin-table-wrap .data-table th {
    display: revert !important;
  }

  .distribution-admin-table-wrap .data-table thead {
    display: table-header-group !important;
  }

  .distribution-admin-table-wrap .data-table tr {
    border: 0;
    border-radius: 0;
    box-shadow: none;
    padding: 0;
  }
}

@media (min-width: 1600px) {
  body {
    font-size: 16px;
  }

  .content {
    padding-left: 32px;
    padding-right: 32px;
  }

  .grid,
  .production-list,
  .music-workspace,
  .lyric-workspace {
    gap: 18px;
  }

  .lyric-editor-layout {
    grid-template-columns: minmax(0, 1fr) minmax(310px, 390px);
  }

  .lyric-preview {
    max-height: 460px;
  }
}

@media (max-width: 1480px) and (min-width: 981px) {
  .lyric-editor-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .lyric-side {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }
}

@media (max-width: 1180px) and (min-width: 981px) {
  .topbar {
    grid-template-columns: minmax(0, 1fr);
  }

  .toolbar {
    grid-template-columns: auto minmax(220px, 1fr) auto auto auto;
    justify-content: flex-start;
  }

  .production-row,
  .card-body.two-column,
  .lyric-workspace,
  .lyric-editor-layout,
  .lyric-editor-pair {
    grid-template-columns: 1fr;
  }

  .lyric-compare-grid {
    grid-template-columns: 1fr;
  }

  .lyric-library-preview {
    grid-template-columns: 1fr;
  }

  .music-workspace {
    grid-template-columns: minmax(190px, 280px) minmax(0, 1fr);
  }

  .application-list-card,
  .application-detail-card {
    grid-column: span 12;
  }

  .distribution-card-signup-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .distribution-card-signup-form button {
    grid-column: 1 / -1;
  }
}

@media (max-width: 1180px) and (min-width: 701px) {
  .login-copy h1 {
    font-size: 46px;
  }
}

@media (max-width: 560px) {
  .notification-card {
    grid-template-columns: 1fr;
  }

  .notification-actions {
    justify-content: flex-start;
  }

  .topbar {
    min-height: 0;
    padding-top: 10px;
    padding-bottom: 10px;
    gap: 8px;
  }

  .topbar h1 {
    font-size: 21px;
  }

  .topbar p {
    font-size: 14px;
  }

  .toolbar {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 6px;
  }

  .toolbar > button {
    width: 100%;
    min-height: 34px;
    padding-inline: 9px;
  }

  .department-toggle button {
    min-height: 28px;
    padding-inline: 10px;
  }

  .searchbox input {
    min-height: 34px;
  }
}

@media (max-width: 700px) {
  .login-screen {
    grid-template-columns: 1fr;
    overflow: auto;
  }

  .login-copy {
    padding: 18px;
    gap: 12px;
  }

  .login-hero-card {
    min-height: 56vh;
  }

  .login-art {
    background-position: 58% center;
  }

  .login-hero-text {
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: 12px;
    padding: 16px;
  }

  .login-copy h1 {
    font-size: 34px;
  }

  .login-panel {
    min-height: auto;
    border-left: 0;
    padding: 18px;
    overflow: hidden;
  }

  .login-form-card {
    width: min(100%, calc(100vw - 36px));
    padding: 18px;
  }

  .application-modal {
    padding: 0;
    place-items: stretch;
  }

  .application-dialog {
    width: 100%;
    min-height: 100vh;
    max-height: none;
    border-radius: 0;
  }

  .application-dialog-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
  }

  .application-form {
    padding-left: 14px;
    padding-right: 14px;
  }

  .application-role-list {
    display: flex;
    width: 100%;
    flex-wrap: wrap;
  }

  .application-detail-grid,
  .application-system-fields {
    grid-template-columns: 1fr;
  }

  .content,
  .topbar {
    padding-left: 14px;
    padding-right: 14px;
  }

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

  .span-3,
  .span-4,
  .span-5,
  .span-6,
  .span-7,
  .span-8,
  .span-12 {
    grid-column: 1;
  }

  .filters input,
  .filters select {
    width: 100%;
  }

  .export-actions {
    grid-template-columns: 1fr;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .title-hero {
    grid-template-columns: 1fr;
  }

  .title-meta {
    justify-items: start;
  }

  .timeline-row {
    grid-template-columns: 1fr;
  }

  .timeline-track {
    grid-template-columns: 1fr;
  }

  .profile-head {
    display: grid;
  }

  .profile-status {
    justify-content: flex-start;
  }

  .profile-metrics,
  .profile-layout,
  .profile-columns,
  .music-workspace,
  .lyric-workspace,
  .lyric-editor-layout,
  .lyric-editor-pair,
  .lyric-compare-grid,
  .lyric-library-preview,
  .production-team,
  .production-grid {
    grid-template-columns: 1fr;
  }

  .lyric-editor {
    min-height: 56vh;
  }

  .lyric-line {
    grid-template-columns: 28px minmax(0, 1fr);
  }

  .lyric-line b {
    grid-column: 2;
    justify-self: start;
  }

  .card-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .inline-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .searchbox,
  .toolbar .search-count {
    width: 100%;
  }

  .inline-actions button,
  .toolbar button,
  .filters input,
  .filters select {
    min-width: 44px;
  }
}

@media (hover: none) and (pointer: coarse) {
  button:hover {
    transform: none;
  }
}

@media (max-width: 640px) {
  html,
  body {
    overflow-x: hidden;
  }

  body {
    font-size: 14px;
    line-height: 1.5;
    background:
      linear-gradient(155deg, color-mix(in srgb, var(--accent) 12%, transparent), transparent 36%),
      linear-gradient(25deg, color-mix(in srgb, var(--accent-3) 10%, transparent), transparent 38%),
      var(--bg);
  }

  .app {
    display: block;
    min-width: 0;
  }

  .app:has(.sidebar.open)::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 8;
    background: rgba(0, 0, 0, 0.42);
    backdrop-filter: blur(2px);
  }

  .sidebar {
    width: min(86vw, 318px);
    padding: 14px;
    gap: 14px;
    border-right: 1px solid var(--line);
    box-shadow: 18px 0 46px rgba(0, 0, 0, 0.22);
  }

  .brand {
    position: static;
    margin: 0;
    padding: 0;
    background: none;
    border-bottom: 0;
  }

  .brand::before {
    width: 42px;
    height: 42px;
  }

  .brand strong {
    font-size: 16px;
  }

  .nav {
    gap: 8px;
  }

  .nav button {
    min-height: 40px;
    padding: 9px 10px;
  }

  .nav-group-items button {
    grid-template-columns: 18px minmax(0, 1fr) auto;
  }

  .userbox {
    margin-top: auto;
    padding-bottom: env(safe-area-inset-bottom);
  }

  .topbar {
    min-height: 0;
    padding: calc(10px + env(safe-area-inset-top)) 12px 10px;
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 8px 10px;
    align-items: center;
    box-shadow: 0 8px 24px rgba(33, 28, 26, 0.08);
  }

  .mobile-menu {
    width: 42px;
    min-height: 42px;
    border-radius: 8px;
    font-size: 20px;
  }

  .topbar h1 {
    font-size: 22px;
    line-height: 1.12;
  }

  .topbar p {
    margin-top: 2px;
    font-size: 13px;
    line-height: 1.25;
  }

  .toolbar {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: minmax(92px, 0.58fr) minmax(0, 1.42fr);
    gap: 7px;
    width: 100%;
  }

  .department-toggle {
    width: 100%;
    min-width: 0;
  }

  .department-toggle button {
    flex: 1 1 0;
    min-width: 44px;
    padding-inline: 8px;
  }

  .searchbox {
    min-width: 0;
    width: 100%;
  }

  .searchbox input {
    min-height: 38px;
    padding-left: 10px;
    padding-right: 34px;
    font-size: 14px;
  }

  .searchbox input::placeholder {
    color: color-mix(in srgb, var(--muted) 72%, transparent);
  }

  .toolbar .search-count {
    grid-column: 1 / -1;
    width: 100%;
  }

  .toolbar-action {
    width: 100%;
    min-height: 38px;
    padding-inline: 8px;
  }

  .toolbar-action-refresh {
    grid-column: 1;
  }

  .toolbar-action-theme {
    grid-column: 2;
  }

  .content {
    width: 100%;
    padding: 12px 12px calc(22px + env(safe-area-inset-bottom));
    gap: 12px;
  }

  .grid {
    gap: 10px;
  }

  .card {
    border-radius: 8px;
    box-shadow: 0 10px 28px rgba(37, 28, 20, 0.07);
  }

  .card-header {
    min-height: 0;
    padding: 12px;
    gap: 10px;
  }

  .card-header h2,
  .card-header h3 {
    font-size: 15px;
    line-height: 1.25;
  }

  .card-body {
    padding: 12px;
  }

  .card-body.two-column,
  .compact-form,
  .kv-row,
  .profile-layout,
  .profile-columns,
  .production-row,
  .timeline-row,
  .music-workspace,
  .lyric-workspace,
  .lyric-editor-layout,
  .lyric-editor-pair {
    grid-template-columns: 1fr;
  }

  .metric {
    min-height: 104px;
    padding: 14px;
  }

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

  .filters {
    display: grid;
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .filters input,
  .filters select,
  .filters button {
    width: 100%;
  }

  .table-wrap {
    overflow: visible;
  }

  table.data-table,
  .profile-card .table-wrap table {
    min-width: 0;
    border-spacing: 0 9px;
  }

  .data-table tr {
    padding: 10px;
    box-shadow: 0 8px 22px rgba(37, 28, 20, 0.06);
  }

  .data-table td {
    min-height: 0;
    padding: 8px 0;
    line-height: 1.35;
  }

  .data-table td[data-label] {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3px;
  }

  .data-table td[data-label]::before {
    font-size: 10.5px;
    line-height: 1.2;
    letter-spacing: 0;
    text-transform: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    overflow-wrap: normal;
    word-break: normal;
  }

  .data-table td[data-actions] {
    display: flex;
    gap: 7px;
    padding-top: 10px;
  }

  .data-table td[data-actions] > button,
  .data-table td[data-actions] > .row-actions > button {
    flex: 1 1 calc(50% - 7px);
    min-width: 116px;
  }

  .row-actions {
    width: 100%;
    gap: 7px;
  }

  .row-actions button {
    flex: 1 1 auto;
  }

  .release-guide-card .card-header {
    align-items: stretch;
  }

  .release-guide-card .card-header .inline-actions,
  .release-guide-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .release-guide-entry {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

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

  .release-template-preview {
    min-height: 320px;
  }

  .release-guide-entry-main span {
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .button-like {
    flex: 1 1 auto;
  }

  .pill {
    min-height: 23px;
    max-width: 100%;
    white-space: normal;
  }

  .role-pill-list {
    gap: 5px;
  }

  .role-pill {
    padding: 3px 7px;
    font-size: 12px;
  }

  .progress {
    width: min(100%, 150px);
  }

  .title-hero {
    padding: 15px;
    gap: 12px;
  }

  .title-hero h2 {
    font-size: 23px;
    line-height: 1.12;
  }

  .title-meta {
    min-width: 0;
    justify-items: start;
  }

  .title-meta strong {
    font-size: 25px;
  }

  .title-tabs {
    margin-inline: -12px;
    padding: 2px 12px 8px;
    gap: 7px;
    scrollbar-width: thin;
  }

  .title-tabs button {
    min-height: 36px;
    padding-inline: 11px;
  }

  .timeline-track,
  .production-grid,
  .production-team,
  .assignment-groups,
  .person-list,
  .music-role-grid,
  .platform-grid,
  .youtube-board,
  .profile-layout,
  .profile-metrics {
    grid-template-columns: 1fr;
  }

  .production-row {
    padding: 10px;
    gap: 10px;
  }

  .production-grid {
    gap: 7px;
  }

  .cast-workflow-card {
    padding: 10px;
  }

  .cast-workflow-tools {
    grid-template-columns: 1fr;
  }

  .cast-filter-bar button {
    flex: 1 1 118px;
  }

  .cast-density-toggle {
    width: 100%;
  }

  .cast-workflow-head {
    grid-template-columns: 1fr;
  }

  .cast-workflow-status {
    justify-content: flex-start;
  }

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

  .cast-workflow-card.compact .cast-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .person-timing {
    grid-template-columns: 1fr;
  }

  .episode-history-panel summary,
  .episode-history-item {
    grid-template-columns: 1fr;
  }

  .episode-history-panel summary {
    display: grid;
  }

  .sound-work-row,
  .fix-builder-grid {
    grid-template-columns: 1fr;
  }

  .sound-work-actions {
    justify-items: stretch;
  }

  .sound-file-chip {
    max-width: none;
    min-width: min(100%, 160px);
    flex: 1 1 160px;
  }

  .fix-builder-panel,
  .fix-details-panel {
    width: 100vw;
    max-height: 100vh;
    border-radius: 0;
  }

  .fix-builder-panel header,
  .fix-builder-panel footer,
  .fix-details-panel header {
    align-items: stretch;
    display: grid;
    grid-template-columns: 1fr;
  }

  .fix-builder-panel footer button {
    width: 100%;
  }

  .production-stage {
    min-height: 0;
    padding: 9px;
  }

  .stage-timing-detail-row {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .production-head .inline-actions {
    justify-content: center;
  }

  .person-line {
    gap: 7px;
  }

  .person-line .inline-actions button {
    flex: 1 1 118px;
  }

  .production-summary {
    display: grid;
    gap: 6px;
  }

  .release-line-head,
  .music-project-head,
  .profile-head {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .lyric-editor-head {
    grid-template-columns: minmax(0, 1fr);
  }

  .lyric-editor-actions {
    justify-items: stretch;
  }

  .lyric-action-row {
    justify-content: flex-start;
  }

  .lyric-submit-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .lyric-submit-row button,
  .lyric-assignee-control button {
    width: 100%;
  }

  .lyric-assignee-control {
    justify-content: flex-start;
    width: 100%;
  }

  .release-progress,
  .profile-status {
    justify-items: start;
    justify-content: start;
    text-align: left;
  }

  .platform-grid {
    padding: 10px;
  }

  .platform-card {
    min-height: 0;
  }

  .platform-card button {
    width: 100%;
  }

  .music-project-list {
    position: static;
  }

  .music-list-item {
    min-height: 54px;
  }

  .music-meta {
    gap: 6px;
    display: grid;
  }

  .music-role-card {
    min-height: 0;
  }

  .music-project-footer {
    grid-template-columns: 1fr;
  }

  .lyric-editor-card {
    padding: 12px;
  }

  .lyric-editor {
    min-height: 48vh;
    padding: 13px;
    line-height: 1.6;
    font-size: 15px;
  }

  .lyric-editor-original {
    min-height: 32vh;
  }

  .lyric-preview {
    max-height: 52vh;
    padding: 7px;
  }

  .lyric-line {
    grid-template-columns: 26px minmax(0, 1fr);
    gap: 8px;
    padding: 8px;
  }

  .lyric-line b {
    grid-column: 1 / -1;
    justify-self: start;
  }

  .lyric-comment-form,
  .lyric-comment-list,
  .lyric-original-preview {
    padding: 10px;
  }

  .profile-card {
    padding: 13px;
  }

  .profile-metric {
    min-height: 70px;
  }

  .profile-info-row,
  .profile-assignment-row,
  .profile-activity-item {
    grid-template-columns: 1fr;
    gap: 5px;
    align-items: start;
  }

  .profile-section-head {
    display: grid;
    gap: 4px;
    justify-content: start;
  }

  .profile-activity-item time {
    white-space: normal;
  }

  .kv-row {
    gap: 3px;
    padding: 9px 10px;
  }

  .kv-row span {
    font-size: 12px;
  }

  .empty {
    min-height: 118px;
    padding: 22px 14px;
  }

  .drawer {
    place-items: stretch;
  }

  .drawer-panel {
    --drawer-grid-pad-block: 12px;
    --multi-open-extra-space: min(46vh, 300px);
    width: 100vw;
    max-width: 100vw;
    border-left: 0;
  }

  .drawer-panel header,
  .drawer-panel footer {
    padding: 12px;
    gap: 8px;
  }

  .drawer-panel header h2 {
    font-size: 17px;
    line-height: 1.2;
  }

  .drawer-panel footer {
    display: grid;
    grid-template-columns: 1fr;
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
  }

  .drawer-panel footer .muted {
    order: 2;
    font-size: 12px;
  }

  .drawer-panel footer button {
    order: 1;
    width: 100%;
  }

  .form-grid {
    padding: 12px;
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .multi-combobox summary {
    min-height: 40px;
  }

  .multi-combobox[open] .choice-list,
  .multi-combobox[open] .role-choice-groups {
    max-height: min(44vh, 280px);
    max-height: var(--multi-list-max-height, min(44vh, 280px));
  }

  .multi-combobox[open] .role-choice-groups .choice-list {
    max-height: none;
  }

  .choice-pill {
    border-radius: 8px;
    padding: 8px 9px;
  }

  input,
  select,
  textarea,
  button {
    font-size: 14px;
  }
}

@media (max-width: 480px) {
  .content {
    padding-left: 10px;
    padding-right: 10px;
    gap: 10px;
  }

  .topbar {
    padding-left: 10px;
    padding-right: 10px;
  }

  .toolbar {
    grid-template-columns: 1fr;
  }

  .department-toggle,
  .searchbox,
  .toolbar > button {
    width: 100%;
  }

  .card-header,
  .application-dialog-head,
  .distribution-title-head {
    gap: 8px;
  }

  .distribution-title-main strong {
    white-space: normal;
  }

  .distribution-title-stats,
  .distribution-self-actions,
  .application-dialog-actions,
  .inline-actions {
    justify-content: stretch;
  }

  .distribution-title-stats > *,
  .distribution-self-actions button,
  .application-dialog-actions button,
  .inline-actions button {
    flex: 1 1 100%;
  }

  .data-table td[data-actions] > button,
  .data-table td[data-actions] > .row-actions > button,
  .row-actions button {
    flex-basis: 100%;
    width: 100%;
  }
}

@media (max-width: 380px) {
  .toolbar {
    grid-template-columns: 1fr;
  }

  .login-copy h1 {
    font-size: 30px;
  }

  .department-toggle {
    justify-self: stretch;
  }

  .toolbar-action-refresh,
  .toolbar-action-theme {
    grid-column: 1;
  }

  .data-table td[data-actions] > button,
  .data-table td[data-actions] > .row-actions > button,
  .inline-actions button,
  .row-actions button {
    flex-basis: 100%;
    width: 100%;
  }

  .topbar h1 {
    font-size: 20px;
  }

  .content {
    padding-inline: 10px;
  }

  .mobile-bottom-nav {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 4px;
    padding: 6px;
    border-radius: 16px;
  }

  .mobile-bottom-nav button {
    min-height: 46px;
    font-size: 9.8px;
  }

  .mobile-bottom-icon,
  .mobile-bottom-icon svg {
    width: 19px;
    height: 19px;
  }

  .action-center-card {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .action-center-card button {
    width: 100%;
  }
}

/* Visual stability guardrails: keep shared UI predictable across dense screens. */
.main,
.content,
.grid,
.band,
.card,
.card-body,
.card-header,
.table-wrap,
.filters,
.inline-actions,
.row-actions,
.toolbar,
.drawer-panel,
.application-dialog,
.application-detail-panel,
.distribution-title-card,
.distribution-role-column,
.notification-card,
.team-compact-card,
.production-row,
.release-line,
.music-project-card,
.lyric-editor-card,
.profile-card {
  min-width: 0;
}

button,
.button-like {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  max-width: 100%;
  min-inline-size: 44px;
  flex-shrink: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: normal;
  writing-mode: horizontal-tb;
  vertical-align: middle;
}

button > span,
button > strong,
.button-like > span,
.button-like > strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.text-link-button {
  min-inline-size: 0;
  min-height: 0;
  flex-shrink: 1;
  justify-content: flex-start;
  white-space: nowrap;
}

.nav button,
.team-compact-main,
.music-list-item,
.distribution-candidate,
.release-guide-button {
  text-align: left;
}

.release-guide-button {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
}

.inline-actions,
.row-actions,
.toolbar,
.application-dialog-actions,
.distribution-self-actions,
.notification-actions,
.publication-item-actions,
.release-guide-actions,
.team-compact-actions,
.voice-report-actions {
  max-width: 100%;
  min-width: 0;
  align-items: center;
}

.inline-actions button,
.row-actions button,
.toolbar > button,
.application-dialog-actions button,
.distribution-self-actions button,
.notification-actions button,
.publication-item-actions button,
.release-guide-actions button,
.team-compact-actions button,
.voice-report-actions button,
.data-table td[data-actions] button {
  min-inline-size: 44px;
  flex-shrink: 0;
}

.department-toggle {
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: thin;
}

.department-toggle button {
  flex: 0 0 auto;
}

.filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
  gap: var(--space-sm);
  align-items: end;
}

.filters > *,
.field,
.login-field,
.application-filters label,
.compact-form-grid > *,
.application-general-fields > *,
.form-grid > * {
  min-width: 0;
}

.filters button {
  width: fit-content;
  max-width: 100%;
  align-self: end;
}

.form-grid,
.application-general-fields,
.compact-form-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr));
}

input,
select,
textarea {
  min-width: 0;
  overflow-wrap: normal;
  word-break: normal;
}

textarea {
  max-height: min(44vh, 360px);
  overflow: auto;
}

textarea.lyric-editor {
  max-height: none;
}

select[multiple] {
  max-height: min(46vh, 360px);
}

.card-header {
  flex-wrap: wrap;
}

.card-header h2,
.card-header h3,
.title-hero h2,
.profile-head h2,
.application-detail-head h2 {
  overflow-wrap: break-word;
  word-break: normal;
}

.table-wrap {
  overflow-x: auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.data-table td > *,
td > *,
th > * {
  min-width: 0;
}

.data-table th,
.data-table td,
th,
td {
  overflow-wrap: break-word;
  word-break: normal;
}

.data-table td[data-actions],
.data-table th:last-child {
  min-width: 132px;
}

.tasks-table {
  min-width: 980px;
  table-layout: fixed;
}

.tasks-table th:nth-child(1),
.tasks-table td:nth-child(1) {
  width: 44px;
  min-width: 44px;
}

.tasks-table th:nth-child(2),
.tasks-table td:nth-child(2) {
  width: 112px;
}

.tasks-table th,
.tasks-table td {
  padding-inline: 8px;
}

.tasks-table th:nth-child(6),
.tasks-table td:nth-child(6) {
  width: 132px;
}

.tasks-table td[data-actions],
.tasks-table th:last-child {
  width: 146px;
  min-width: 146px;
  white-space: normal;
}

.tasks-table .task-comment-cell {
  overflow-wrap: anywhere;
  white-space: normal;
}

.tasks-table .pill {
  gap: 4px;
  justify-content: center;
  padding-inline: 5px;
  overflow: visible;
  text-align: center;
  text-overflow: clip;
  white-space: normal;
}

.tasks-table .pill:not(.role-pill)::before {
  width: 6px;
  height: 6px;
  box-shadow: 0 0 0 2px color-mix(in srgb, currentColor 14%, transparent);
}

.task-row-actions {
  display: flex;
  width: 100%;
  justify-content: flex-start;
}

.task-row-actions > .row-actions {
  display: contents;
}

.task-row-actions button {
  flex: 0 1 auto;
  min-width: 72px;
  min-inline-size: 0;
}

.task-row-actions .task-submit-button {
  max-width: 100%;
}

.task-row-actions .task-submit-blocked {
  color: var(--muted);
}

.signups-table {
  min-width: 1360px;
  table-layout: fixed;
}

.signups-table th:nth-child(1),
.signups-table .signup-bulk {
  width: 42px;
  min-width: 42px;
}

.signups-table th:nth-child(2),
.signups-table .signup-season {
  width: 118px;
}

.signups-table th:nth-child(3),
.signups-table .signup-title {
  width: 220px;
}

.signups-table th:nth-child(4),
.signups-table .signup-user {
  width: 140px;
}

.signups-table th:nth-child(5),
.signups-table .signup-profile {
  width: 240px;
}

.signups-table th:nth-child(6),
.signups-table .signup-role {
  width: 128px;
}

.signups-table th:nth-child(7),
.signups-table .signup-interest {
  width: 132px;
}

.signups-table th:nth-child(9),
.signups-table .signup-decision {
  width: 170px;
}

.signups-table th:nth-child(10),
.signups-table .signup-actions {
  width: 184px;
  min-width: 184px;
}

.signups-table .signup-decision .pill,
.signups-table .signup-interest .pill {
  justify-content: flex-start;
  white-space: normal;
}

.signups-table .signup-profile {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.signups-table .signup-actions {
  white-space: normal;
}

.signups-table .signup-actions,
.signups-table .signup-actions .row-actions {
  align-items: center;
  gap: 6px;
}

.signups-table .signup-actions > button,
.signups-table .signup-actions .row-actions > button {
  min-inline-size: 0;
  flex: 1 1 74px;
  padding-inline: 8px;
}

@media (max-width: 860px) {
  table.signups-table {
    min-width: 0;
    table-layout: auto;
  }

  .signups-table .signup-bulk {
    display: none;
  }

  .signups-table .signup-decision,
  .signups-table .signup-actions {
    width: 100%;
    min-width: 0;
  }

  .signups-table .signup-actions > button,
  .signups-table .signup-actions .row-actions > button {
    flex: 1 1 128px;
  }
}

@media (max-width: 560px) {
  .signups-table .signup-decision .pill,
  .signups-table .signup-interest .pill {
    width: fit-content;
  }

  .signups-table .signup-actions > button,
  .signups-table .signup-actions .row-actions > button {
    flex-basis: calc(50% - 7px);
  }
}

@media (max-width: 780px) {
  .title-pronunciation-body,
  .signups-details-grid,
  .signups-details-row-fields {
    grid-template-columns: 1fr;
  }

  .signups-empty-roster summary {
    align-items: flex-start;
    flex-direction: column;
  }

  .signups-details-field textarea {
    min-height: 92px;
  }

  .title-pronunciation-card textarea {
    min-height: 76px;
  }
}

.pill,
.nav-badge,
.distribution-limit,
.distribution-user-chip,
.wishlist-person,
.search-count {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  word-break: normal;
}

.notice,
.muted,
.compact-line,
.application-detail-block p,
.lyric-comment-list p,
.lyric-chat-messages p,
.release-template-preview,
.distribution-compact-warning {
  overflow-wrap: break-word;
  word-break: normal;
}

a,
pre,
code,
.release-template-preview,
.lyric-original-preview pre {
  overflow-wrap: anywhere;
}

.distribution-overview .distribution-role-grid,
.assignment-groups,
.person-list,
.music-role-grid,
.platform-grid,
.archive-platform-grid,
.release-guide-buttons,
.youtube-board,
.profile-metrics,
.rating-role-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(210px, 100%), 1fr));
}

.distribution-title-head {
  grid-template-columns: auto minmax(0, 1fr) minmax(min-content, auto);
}

.distribution-title-stats {
  max-width: 100%;
}

.distribution-candidate strong,
.distribution-candidate span,
.distribution-candidate small,
.team-compact-main strong,
.team-compact-main span,
.music-list-item strong,
.music-list-item span,
.music-list-item small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.distribution-page .distribution-title-head {
  grid-template-columns: auto minmax(260px, 1fr) minmax(360px, auto);
}

.distribution-page .distribution-title-toggle {
  grid-row: auto;
}

.distribution-page .distribution-title-stats {
  grid-column: 3;
  justify-content: flex-end;
}

.distribution-page .distribution-title-actions {
  flex: 1 1 100%;
  justify-content: flex-end;
  padding-top: 2px;
  background: transparent;
  border: 0;
}

.distribution-page .distribution-overview .distribution-role-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr));
}

.distribution-page .distribution-candidate {
  min-height: 58px;
}

.distribution-page .distribution-candidate-main span,
.distribution-page .distribution-candidate-main small {
  overflow: hidden;
  overflow-wrap: anywhere;
  text-overflow: ellipsis;
  white-space: normal;
}

.distribution-page .distribution-candidate-comment,
.distribution-page .distribution-candidate-comment span {
  overflow: hidden;
  text-overflow: clip;
  white-space: normal;
}

.distribution-page .distribution-candidate-comment {
  display: -webkit-box;
}

@media (max-width: 1040px) {
  .distribution-page .distribution-title-head {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .distribution-page .distribution-title-toggle {
    grid-row: 1 / span 2;
  }

  .distribution-page .distribution-title-stats {
    grid-column: 2;
    justify-content: flex-start;
  }

  .distribution-page .distribution-title-actions {
    justify-content: flex-start;
  }
}

.application-dialog,
.drawer-panel,
.fix-builder-panel,
.fix-details-panel,
.application-modal {
  max-width: 100dvw;
  overscroll-behavior: contain;
}

.application-dialog-head,
.application-detail-head,
.drawer-panel header,
.drawer-panel footer,
.fix-builder-panel header,
.fix-builder-panel footer {
  min-width: 0;
  flex-wrap: wrap;
}

@media (max-width: 860px) {
  .table-wrap {
    overflow-x: auto;
    overflow-y: visible;
  }

  .wishlist-table-wrap .wishlist-table,
  .wishlist-table-wrap .wishlist-table thead,
  .wishlist-table-wrap .wishlist-table tbody,
  .wishlist-table-wrap .wishlist-table tr,
  .wishlist-table-wrap .wishlist-table td,
  .wishlist-table-wrap .wishlist-table th {
    display: revert !important;
  }

  .wishlist-table-wrap .wishlist-table thead {
    display: table-header-group !important;
  }

  .wishlist-table-wrap .wishlist-table tr {
    border: 0;
    border-radius: 0;
    box-shadow: none;
    padding: 0;
  }

  .wishlist-table-wrap .wishlist-table .row-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .wishlist-table-wrap .wishlist-table td[data-label],
  .wishlist-table-wrap .wishlist-table th,
  .wishlist-table-wrap .wishlist-table td {
    display: table-cell !important;
  }

  .data-table td[data-actions],
  .data-table th:last-child {
    min-width: 0;
  }
}

@media (max-width: 640px) {
  .wishlist-table-wrap {
    overflow: visible;
  }

  .wishlist-table-wrap .wishlist-table,
  .wishlist-table-wrap .wishlist-table tbody {
    display: grid !important;
    min-width: 0;
    width: 100%;
  }

  .wishlist-table-wrap .wishlist-table thead {
    display: none !important;
  }

  .wishlist-table-wrap .wishlist-table tr {
    display: grid !important;
    gap: 9px;
    padding: 12px;
    border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--line));
    border-radius: 12px;
    background: var(--surface);
    box-shadow: 0 10px 26px rgba(37, 28, 20, 0.08);
  }

  .wishlist-table-wrap .wishlist-table tr + tr {
    margin-top: 10px;
  }

  .wishlist-table-wrap .wishlist-table td,
  .wishlist-table-wrap .wishlist-table th {
    display: grid !important;
    width: 100%;
    min-width: 0;
    padding: 0;
    border: 0;
    gap: 4px;
    background: transparent;
  }

  .wishlist-table-wrap .wishlist-table td[data-label]::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 10.5px;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
  }

  .wishlist-table-wrap .wishlist-title-main a,
  .wishlist-table-wrap .wishlist-title-main strong {
    -webkit-line-clamp: 3;
  }

  .wishlist-table-wrap .wishlist-people {
    margin-bottom: 0;
  }

  .wishlist-table-wrap .wishlist-actions {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .wishlist-table-wrap .wishlist-actions button {
    width: 100%;
    min-height: 38px;
  }
}

@media (max-width: 1180px) and (min-width: 981px) {
  .team-compact-card {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .team-compact-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
}

@media (max-width: 700px) {
  .filters,
  .form-grid,
  .application-general-fields,
  .compact-form-grid,
  .distribution-card-signup-form,
  .lyric-chat-form,
  .music-project-footer,
  .title-no-translator {
    grid-template-columns: 1fr;
  }

  .filters button,
  .inline-actions button,
  .row-actions button,
  .application-dialog-actions button,
  .distribution-self-actions button,
  .notification-actions button,
  .publication-item-actions button,
  .release-guide-actions button,
  .team-compact-actions button,
  .voice-report-actions button {
    width: 100%;
    flex: 1 1 100%;
  }

  .department-toggle button {
    flex: 1 0 auto;
  }

  .application-dialog-actions {
    padding-top: 10px;
    padding-bottom: 8px;
  }
}

@media (max-width: 480px) {
  button,
  .button-like {
    min-inline-size: 40px;
  }

  .data-table td[data-actions] > button,
  .data-table td[data-actions] > .row-actions > button,
  .row-actions button {
    min-inline-size: 100%;
  }
}
.lyric-review-sheet {
  margin-top: 18px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--border) 82%, var(--accent) 18%);
  border-radius: 18px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--panel) 94%, var(--accent) 6%), var(--panel)),
    radial-gradient(circle at 100% 0, color-mix(in srgb, var(--accent) 18%, transparent), transparent 42%);
}

.lyric-review-sheet > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 76px;
  padding: 18px 22px;
  cursor: pointer;
  list-style: none;
}

.lyric-review-sheet > summary::-webkit-details-marker {
  display: none;
}

.lyric-review-sheet > summary::after {
  content: "+";
  display: grid;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--border) 72%, var(--accent) 28%);
  border-radius: 999px;
  color: var(--accent);
  font: 700 24px/1 var(--font-title);
  transition: transform 180ms ease, background 180ms ease;
}

.lyric-review-sheet[open] > summary::after {
  content: "-";
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  transform: rotate(180deg);
}

.lyric-review-sheet > summary span {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.lyric-review-sheet > summary strong {
  color: var(--text);
  font-size: clamp(16px, 1.4vw, 20px);
}

.lyric-review-sheet > summary small {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.lyric-review-sheet > summary b {
  margin-left: auto;
  padding: 9px 13px;
  border: 1px solid color-mix(in srgb, var(--border) 78%, var(--accent) 22%);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 82%, var(--accent) 18%);
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 650;
  white-space: nowrap;
}

.lyric-review-sheet[open] > summary {
  border-bottom: 1px solid color-mix(in srgb, var(--border) 88%, var(--accent) 12%);
}

.lyric-review-sheet-body {
  display: grid;
  gap: 18px;
  padding: 18px;
}

.lyric-review-sheet[open] > .lyric-review-sheet-body {
  animation: none;
  transform: none;
}

.lyric-review-sheet-body .lyric-feedback-desk {
  margin-top: 0;
}

@media (min-width: 1180px) {
  .lyric-review-sheet[open] {
    width: 100%;
    max-width: 100%;
    margin-inline: 0;
    transform: none;
  }

  .lyric-review-sheet-body {
    grid-template-columns: minmax(0, 1fr);
    padding: 20px;
  }

  .lyric-review-sheet-body .lyric-compare-grid {
    min-width: 0;
  }

  .lyric-review-sheet-body .lyric-feedback-desk {
    position: fixed;
    z-index: 42;
    top: 82px;
    right: 16px;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    width: min(520px, calc(100vw - 32px));
    min-width: min(380px, calc(100vw - 32px));
    min-height: 0;
    max-height: calc(100vh - 108px);
    padding: 12px;
    overflow: auto;
    overscroll-behavior: contain;
    resize: none;
    box-shadow:
      0 24px 70px color-mix(in srgb, #000 52%, transparent),
      0 2px 0 color-mix(in srgb, var(--accent) 24%, transparent) inset;
  }

  .lyric-review-sheet-body .lyric-feedback-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .lyric-review-sheet-body .lyric-feedback-head {
    align-items: start;
  }
}

@media (min-width: 980px) {
  .lyric-review-sheet-body .lyric-feedback-head {
    position: relative;
    gap: 4px;
    margin: 0;
    padding-right: 76px;
    cursor: grab;
    touch-action: none;
    user-select: none;
  }

  .lyric-review-sheet-body .lyric-feedback-head h3 {
    margin: 1px 0 0;
    font-size: 17px;
    line-height: 1.15;
  }

  .lyric-review-sheet-body .lyric-feedback-head .kicker {
    font-size: 10px;
  }

  .lyric-review-sheet-body .lyric-feedback-head p {
    display: none;
  }

  .lyric-review-sheet-body .lyric-comment-form {
    display: grid;
    grid-template-columns: 70px minmax(0, 1fr);
    gap: 8px;
    min-width: 0;
    padding: 10px;
  }

  .lyric-review-sheet-body .lyric-comment-form strong,
  .lyric-review-sheet-body .lyric-comment-form small,
  .lyric-review-sheet-body .lyric-comment-form textarea,
  .lyric-review-sheet-body .lyric-comment-form [data-lyric-comment-source],
  .lyric-review-sheet-body .lyric-comment-form button {
    grid-column: 1 / -1;
  }

  .lyric-review-sheet-body .lyric-comment-form small {
    display: none;
  }

  .lyric-review-sheet-body .lyric-comment-form input,
  .lyric-review-sheet-body .lyric-comment-form textarea,
  .lyric-review-sheet-body .lyric-comment-form button {
    min-width: 0;
    margin: 0;
  }

  .lyric-review-sheet-body .lyric-comment-form textarea {
    min-height: 64px;
    resize: vertical;
  }

  .lyric-review-sheet-body .lyric-chat-messages,
  .lyric-review-sheet-body .lyric-comment-list {
    max-height: 260px;
    min-height: 0;
    overflow: auto;
  }

  .lyric-review-sheet-body .lyric-feedback-desk.is-floating-tool-dragging,
  .lyric-review-sheet-body .lyric-feedback-desk.is-floating-tool-resizing,
  .lyric-review-sheet-body .lyric-feedback-desk.is-floating-tool-dragging .lyric-feedback-head {
    cursor: grabbing;
  }

  .floating-tool-reset {
    position: absolute;
    top: 0;
    right: 0;
    min-height: 30px;
    padding: 5px 10px;
    border: 1px solid color-mix(in srgb, var(--border) 70%, var(--accent) 30%);
    border-radius: 999px;
    background: color-mix(in srgb, var(--surface) 86%, var(--accent) 14%);
    color: var(--text-soft);
    font: inherit;
    font-size: 12px;
    cursor: pointer;
  }

  .floating-tool-reset:hover {
    border-color: color-mix(in srgb, var(--accent) 60%, var(--border));
    color: var(--text);
  }

  .floating-tool-resize {
    position: absolute;
    z-index: 3;
    right: 0;
    bottom: 0;
    width: 32px;
    height: 32px;
    border: 0;
    border-top-left-radius: 14px;
    border-bottom-right-radius: inherit;
    background:
      linear-gradient(135deg, transparent 0 42%, color-mix(in srgb, var(--accent) 17%, var(--surface)) 43% 100%);
    color: color-mix(in srgb, var(--accent) 72%, var(--text));
    cursor: nwse-resize;
    opacity: .92;
    transition: background-color .18s ease, color .18s ease, opacity .18s ease;
  }

  .floating-tool-resize::before {
    content: "";
    position: absolute;
    right: 7px;
    bottom: 7px;
    width: 14px;
    height: 14px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    border-bottom-right-radius: 3px;
    opacity: .88;
    box-shadow:
      -5px 5px 0 -3px currentColor,
      -10px 10px 0 -8px currentColor;
  }

  .floating-tool-resize:hover,
  .floating-tool-resize:focus-visible {
    color: var(--accent);
    opacity: 1;
    outline: none;
    background:
      linear-gradient(135deg, transparent 0 38%, color-mix(in srgb, var(--accent) 26%, var(--surface)) 39% 100%);
  }
}

.lyric-tool-pocket {
  min-width: 0;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--border) 88%, var(--accent) 12%);
  border-radius: 13px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
}

.lyric-tool-pocket > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 38px;
  padding: 8px 10px;
  cursor: pointer;
  list-style: none;
  color: var(--text-soft);
  font-weight: 650;
}

.lyric-tool-pocket > summary::-webkit-details-marker {
  display: none;
}

.lyric-tool-pocket > summary::after {
  content: "+";
  color: var(--accent);
  font-size: 18px;
  line-height: 1;
}

.lyric-tool-pocket[open] > summary::after {
  content: "-";
}

.lyric-tool-pocket > summary b {
  margin-left: auto;
  padding: 3px 7px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  color: var(--text);
  font-size: 11px;
}

.lyric-tool-pocket > :not(summary) {
  margin: 0 8px 8px;
}

@media (max-width: 720px) {
  .lyric-review-sheet > summary {
    align-items: start;
    flex-wrap: wrap;
    gap: 12px;
    padding: 16px;
  }

  .lyric-review-sheet > summary b {
    order: 2;
    margin-left: 0;
  }

  .lyric-review-sheet > summary::after {
    margin-left: auto;
  }

  .lyric-review-sheet-body {
    padding: 12px;
  }
}

@media (max-width: 1179px) {
  .lyric-review-sheet-body .lyric-feedback-desk {
    position: static !important;
    left: auto !important;
    top: auto !important;
    right: auto !important;
    width: auto !important;
    height: auto !important;
    max-height: none;
    overflow: visible;
    grid-template-columns: minmax(0, 1fr);
    resize: none;
  }

  .lyric-review-sheet-body .floating-tool-reset,
  .lyric-review-sheet-body .floating-tool-resize {
    display: none;
  }
}

.translation-table-wrap .table-wrap {
  max-height: calc(100vh - 220px);
}

.translation-table-wrap .data-table {
  min-width: 1540px;
}

.translation-table-wrap .data-table th:nth-child(1),
.translation-table-wrap .data-table td:nth-child(1) {
  min-width: 180px;
}

.translation-table-wrap .data-table th:nth-child(6),
.translation-table-wrap .data-table td:nth-child(6) {
  min-width: 150px;
}

.translation-table-wrap .data-table th:nth-child(12),
.translation-table-wrap .data-table td:nth-child(12) {
  min-width: 260px;
  max-width: 360px;
  white-space: normal;
  overflow-wrap: anywhere;
}

.translation-table-wrap .data-table th:nth-child(13),
.translation-table-wrap .data-table td:nth-child(13) {
  min-width: 180px;
}

.translation-table-wrap .source-chip-list {
  min-width: 140px;
}

.translation-table-wrap .source-chip {
  max-width: 140px;
}

.system-status-grid .card-header p {
  margin: 4px 0 0;
  color: var(--muted);
}

.system-status-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.system-status-stack {
  display: grid;
  gap: 10px;
}

.system-status-metric {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 10px;
  border: 1px solid color-mix(in srgb, var(--line) 74%, transparent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-2) 48%, transparent);
}

.system-status-metric span,
.system-status-metric small {
  color: var(--muted);
}

.system-status-metric strong {
  overflow-wrap: anywhere;
}

.system-status-proxy-form {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid color-mix(in srgb, var(--accent) 38%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent) 7%, var(--surface-2));
}

.system-status-proxy-form label {
  display: grid;
  gap: 6px;
}

.system-status-proxy-form textarea {
  min-height: 54px;
  resize: vertical;
  font-family: inherit;
}

.system-status-proxy-form small {
  color: var(--muted);
}

.system-status-proxy-form .notice {
  margin: 0;
}

.system-status-flags,
.system-status-count {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.system-status-count {
  display: inline-flex;
  margin: 2px 6px 2px 0;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface-2) 56%, transparent);
  font-size: 12px;
}

.system-status-count.proxy-ok,
.system-status-count.proxy-active {
  border-color: color-mix(in srgb, var(--ok) 58%, var(--line));
  color: color-mix(in srgb, var(--ok) 84%, var(--text));
  background: color-mix(in srgb, var(--ok) 12%, var(--surface));
}

.system-status-count.proxy-fail,
.system-status-count.proxy-api {
  border-color: color-mix(in srgb, var(--danger) 58%, var(--line));
  color: color-mix(in srgb, var(--danger) 88%, var(--text));
  background: color-mix(in srgb, var(--danger) 10%, var(--surface));
}

.system-status-count.proxy-ready {
  border-color: color-mix(in srgb, var(--warn) 44%, var(--line));
  color: color-mix(in srgb, var(--warn) 80%, var(--text));
}

.system-status-counts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.system-status-error-list {
  display: grid;
  gap: 6px;
}

.system-status-error-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid color-mix(in srgb, var(--danger) 30%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, var(--danger) 7%, var(--surface));
}

.system-status-error-row span,
.system-status-error-row small {
  min-width: 0;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.template-preset-field {
  padding: 10px;
  border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent) 7%, var(--surface-2));
}

.title-history-note {
  margin-bottom: 10px;
}

.title-history-table td {
  vertical-align: top;
}

/* KM workflow layout: keeps Music role controls stable across desktop, laptop, tablet and phone widths. */
.music-workspace {
  grid-template-columns: minmax(220px, clamp(240px, 18vw, 340px)) minmax(0, 1fr);
  align-items: start;
}

.music-list-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  justify-content: stretch;
  align-items: center;
  gap: 8px;
}

.music-list-item > span {
  min-width: 0;
}

.music-list-item > .pill {
  justify-self: end;
  align-self: center;
  min-width: 72px;
  max-width: 92px;
  min-height: 30px;
  padding-inline: 9px;
  text-align: center;
}

.music-project-card,
.music-project-list,
.music-role-card {
  min-width: 0;
}

.music-project-card {
  overflow: hidden;
}

.music-role-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
}

.music-role-actions {
  min-width: 0;
}

.music-role-assignment,
.music-role-replacement {
  min-width: 0;
}

.team-compact-card {
  align-items: center;
}

.team-compact-card > * {
  align-self: center;
  min-height: 0;
}

.team-compact-roles {
  height: auto;
  max-height: 64px;
  overflow: auto;
  align-content: center;
}

.team-compact-roles .role-pill-list {
  max-height: 60px;
  overflow: auto;
  align-content: center;
}

.team-compact-status {
  align-content: center;
}

@media (max-width: 1280px) {
  .music-sound-submit {
    grid-template-columns: 1fr 1fr;
  }

  .music-sound-submit textarea {
    grid-column: 1 / -1;
  }
}

@media (min-width: 981px) {
  .music-project-list {
    position: sticky;
    top: 86px;
    max-height: calc(100dvh - 112px);
    overflow: auto;
    padding-right: 2px;
  }
}

@media (min-width: 1600px) {
  .music-workspace {
    grid-template-columns: minmax(260px, 360px) minmax(0, 1fr);
  }

  .music-role-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
  }
}

@media (max-width: 1280px) and (min-width: 981px) {
  .music-workspace {
    grid-template-columns: minmax(210px, 260px) minmax(0, 1fr);
  }

  .music-role-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr));
  }

  .music-role-assignment,
  .music-role-replacement,
  .music-role-replacement.has-from {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 980px) {
  .music-workspace {
    grid-template-columns: 1fr;
  }

  .music-project-list {
    position: static;
    max-height: none;
    overflow: visible;
    grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
  }

  .music-role-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr));
  }

  .music-sound-submit {
    grid-template-columns: 1fr;
  }

  .music-sound-submit textarea {
    grid-column: auto;
  }
}

@media (max-width: 700px) {
  .music-project-card {
    padding: 12px;
  }

  .music-project-head,
  .music-project-footer {
    grid-template-columns: 1fr;
  }

  .music-role-card {
    min-height: 0;
  }

  .music-role-assignment,
  .music-role-replacement,
  .music-role-replacement.has-from {
    grid-template-columns: 1fr;
  }

  .music-role-assignment button,
  .music-role-replacement button {
    width: 100%;
  }

  .music-sound-comment-form,
  .music-sound-reply-form {
    grid-template-columns: 1fr;
  }

  .music-sound-audio {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .kazoku-audio-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
    flex-wrap: wrap;
    min-width: 0;
  }

  .kazoku-floating-audio .music-sound-audio {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .music-role-title {
    min-height: 0;
  }
}

@media (max-width: 480px) {
  .kazoku-floating-audio {
    right: 8px;
    bottom: 8px;
    width: calc(100vw - 16px);
  }

  .kazoku-audio-controls {
    grid-template-columns: auto minmax(70px, 1fr) auto;
  }

  .kazoku-audio-topline {
    align-items: start;
    flex-direction: column;
    gap: 2px;
  }
}

/* Kazoku visual polish layer: shared surface, navigation and status language. */
:root {
  --radius-xs: 7px;
  --radius-sm: 9px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --surface-glass: color-mix(in srgb, var(--surface) 88%, transparent);
  --surface-raised: color-mix(in srgb, var(--surface) 92%, var(--surface-3));
  --line-soft: color-mix(in srgb, var(--line) 70%, transparent);
  --line-strong: color-mix(in srgb, var(--line) 84%, var(--accent) 16%);
  --shadow-soft: 0 12px 34px color-mix(in srgb, #000 9%, transparent);
  --shadow-raised: 0 18px 52px color-mix(in srgb, #000 13%, transparent);
  --glow-accent: 0 0 0 1px color-mix(in srgb, var(--accent) 30%, transparent), 0 12px 32px color-mix(in srgb, var(--accent) 13%, transparent);
}

[data-theme="dark"] {
  --surface-glass: color-mix(in srgb, var(--surface) 84%, transparent);
  --surface-raised: color-mix(in srgb, var(--surface) 88%, #000);
  --line-soft: color-mix(in srgb, var(--line) 68%, transparent);
  --line-strong: color-mix(in srgb, var(--line) 76%, var(--accent) 24%);
  --shadow-soft: 0 14px 38px color-mix(in srgb, #000 28%, transparent);
  --shadow-raised: 0 24px 64px color-mix(in srgb, #000 38%, transparent);
}

::selection {
  background: color-mix(in srgb, var(--accent) 32%, transparent);
  color: var(--text);
}

body {
  background:
    radial-gradient(circle at 8% 8%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 24%),
    radial-gradient(circle at 92% 0%, color-mix(in srgb, var(--accent-2) 10%, transparent), transparent 26%),
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 7%, transparent), transparent 34%),
    var(--bg);
}

.topbar {
  border-bottom-color: var(--line-soft);
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--accent) 9%, transparent), transparent 34%),
    var(--surface-glass);
  box-shadow: 0 10px 28px color-mix(in srgb, #000 7%, transparent);
}

.topbar h1 {
  letter-spacing: 0;
}

.topbar p {
  max-width: 78ch;
}

.sidebar {
  border-right-color: var(--line-soft);
  background:
    radial-gradient(circle at 24px 34px, color-mix(in srgb, var(--accent) 18%, transparent), transparent 98px),
    linear-gradient(180deg, color-mix(in srgb, var(--surface) 92%, var(--surface-3)), var(--surface) 48%),
    var(--surface);
}

.brand-row {
  border-color: color-mix(in srgb, var(--accent) 30%, var(--line));
  background:
    radial-gradient(circle at 26px 28px, color-mix(in srgb, var(--accent) 17%, transparent), transparent 68px),
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 12%, transparent), transparent 58%),
    linear-gradient(180deg, color-mix(in srgb, #fff 24%, transparent), transparent),
    color-mix(in srgb, var(--surface) 90%, var(--surface-3));
  box-shadow: var(--glow-accent);
}

.brand::before {
  background-size: 90% 90%;
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--accent) 38%, transparent) inset,
    0 0 0 5px color-mix(in srgb, var(--surface) 78%, transparent),
    0 14px 34px color-mix(in srgb, var(--accent) 20%, transparent);
}

.sidebar-collapse-toggle,
.nav button,
.search-count {
  border-radius: var(--radius-sm);
}

.nav button {
  position: relative;
  min-height: 39px;
  border-color: color-mix(in srgb, var(--line) 62%, transparent);
  background:
    linear-gradient(180deg, color-mix(in srgb, #fff 9%, transparent), transparent),
    color-mix(in srgb, var(--surface) 74%, transparent);
  transition: border-color 0.16s ease, background 0.16s ease, color 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
}

.nav button:hover {
  border-color: color-mix(in srgb, var(--accent) 56%, var(--line));
  background: color-mix(in srgb, var(--accent) 10%, var(--surface));
  box-shadow: 0 8px 18px color-mix(in srgb, var(--accent) 9%, transparent);
}

.nav button.active {
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--accent) 22%, var(--surface)), color-mix(in srgb, var(--surface) 88%, var(--accent) 5%));
  border-color: color-mix(in srgb, var(--accent) 78%, var(--line));
  color: color-mix(in srgb, var(--accent) 86%, var(--text));
  box-shadow:
    inset 3px 0 0 var(--accent),
    0 10px 24px color-mix(in srgb, var(--accent) 12%, transparent);
}

.sidebar.collapsed .nav button.active {
  box-shadow:
    inset 0 0 0 2px var(--accent),
    0 10px 24px color-mix(in srgb, var(--accent) 14%, transparent);
}

.nav-group-toggle {
  color: color-mix(in srgb, var(--muted) 90%, var(--accent));
}

.nav-group {
  gap: 7px;
}

.nav-group + .nav-group {
  margin-top: 5px;
}

.nav-group-toggle {
  position: relative;
  min-height: 28px;
  margin: 2px 0 1px;
  border-radius: 999px;
  color: color-mix(in srgb, var(--muted) 84%, var(--accent));
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--accent) 10%, transparent), transparent 72%);
  font-size: 10px;
  font-weight: 850;
}

.nav .nav-group-toggle {
  padding: 0 8px 0 28px;
  gap: 8px;
  height: auto;
  white-space: normal;
}

.nav-group-toggle::before {
  content: "";
  position: absolute;
  left: 10px;
  top: 50%;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 74%, var(--muted));
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 12%, transparent);
  transform: translateY(-50%);
}

.nav-group-toggle span:first-child {
  letter-spacing: 0.02em;
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  line-height: 1.16;
}

.nav-group-toggle .nav-chevron {
  flex: 0 0 auto;
  margin-left: auto;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 72%, transparent);
  color: color-mix(in srgb, var(--muted) 82%, var(--accent));
  font-size: 10px;
}

.nav-group-toggle:hover {
  color: color-mix(in srgb, var(--accent) 82%, var(--text));
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--accent) 16%, transparent), transparent 76%);
}

.nav-group-toggle:hover .nav-chevron {
  color: var(--accent);
}

.nav-group.collapsed .nav-group-toggle {
  opacity: 0.82;
}

.nav-favorites {
  border-color: color-mix(in srgb, var(--accent) 32%, var(--line-soft));
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 12%, transparent), transparent 62%),
    color-mix(in srgb, var(--surface) 86%, var(--surface-2));
}

.nav-item-row {
  min-width: 0;
}

.nav-item-row:has(.nav-favorite-toggle) .nav-view-button {
  min-width: 0;
}

.nav-favorite-toggle,
.nav-favorites-edit {
  box-shadow: var(--ui-inset);
}

.nav-favorite-toggle:hover,
.nav-favorites-edit:hover {
  transform: none;
}

.nav-favorite-toggle.selected {
  border-color: color-mix(in srgb, var(--accent-3) 62%, var(--line));
  background:
    linear-gradient(180deg, color-mix(in srgb, #fff 14%, transparent), transparent),
    color-mix(in srgb, var(--accent-3) 22%, var(--surface));
}

.sidebar.collapsed .nav-group + .nav-group {
  margin-top: 2px;
}

.nav-badge {
  background:
    linear-gradient(180deg, color-mix(in srgb, #fff 18%, transparent), transparent),
    color-mix(in srgb, var(--accent-3) 24%, var(--surface));
  box-shadow:
    0 1px 0 color-mix(in srgb, #fff 36%, transparent) inset,
    0 5px 12px color-mix(in srgb, var(--accent-3) 18%, transparent);
}

.card,
.drawer-panel,
.application-dialog,
.application-detail-panel,
.distribution-title-card,
.distribution-zone-card,
.distribution-setup-card,
.notification-card,
.team-compact-card,
.production-row,
.release-line,
.release-center-card,
.music-project-card,
.music-role-card,
.lyric-editor-card,
.profile-card,
.achievement-card,
.workflow-card,
.control-mini-card,
.platform-card,
.youtube-card,
.rating-role-card {
  border-color: var(--line-soft);
  border-radius: var(--radius-md);
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--surface) 94%, var(--accent) 5%), color-mix(in srgb, var(--surface) 92%, transparent) 58%),
    var(--surface);
  box-shadow: var(--shadow-soft);
}

.card-header,
.drawer-panel header,
.application-dialog-head {
  border-bottom-color: var(--line-soft);
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--accent) 10%, transparent), transparent 38%),
    color-mix(in srgb, var(--surface-2) 44%, transparent);
}

.card-header h2,
.card-header h3,
.drawer-panel header h2,
.application-dialog-head h2 {
  letter-spacing: 0;
}

.table-wrap {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  box-shadow: var(--shadow-soft);
}

.data-table th {
  color: color-mix(in srgb, var(--muted) 88%, var(--accent));
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--surface-2) 70%, transparent), color-mix(in srgb, var(--surface-2) 42%, transparent));
}

.data-table td,
td {
  border-bottom-color: color-mix(in srgb, var(--line) 72%, transparent);
}

tr:hover td {
  background: color-mix(in srgb, var(--accent) 7%, var(--surface-3));
}

input,
select,
textarea {
  border-color: color-mix(in srgb, var(--line) 78%, transparent);
  border-radius: var(--radius-sm);
  background:
    linear-gradient(180deg, color-mix(in srgb, #fff 7%, transparent), transparent),
    color-mix(in srgb, var(--surface) 90%, transparent);
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

input:hover,
select:hover,
textarea:hover {
  border-color: color-mix(in srgb, var(--accent) 38%, var(--line));
}

button,
.button-like {
  border-radius: var(--radius-sm);
}

.primary {
  box-shadow:
    0 9px 20px color-mix(in srgb, var(--accent) 22%, transparent),
    0 1px 0 color-mix(in srgb, #fff 34%, transparent) inset;
}

.danger {
  background: color-mix(in srgb, var(--danger) 4%, var(--surface));
}

.pill:not(.role-pill)::before {
  content: "";
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: currentColor;
  box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 14%, transparent);
}

.pill-application-accepted,
.pill-accepted,
.pill-done,
.pill-ongoing {
  background:
    linear-gradient(180deg, color-mix(in srgb, #fff 22%, transparent), transparent),
    color-mix(in srgb, var(--ok) 15%, var(--surface));
}

.pill-application-rejected,
.pill-overdue,
.pill-blocked,
.pill-fixes {
  background:
    linear-gradient(180deg, color-mix(in srgb, #fff 18%, transparent), transparent),
    color-mix(in srgb, var(--danger) 14%, var(--surface));
}

.pill-application-review,
.pill-in_work {
  background:
    linear-gradient(180deg, color-mix(in srgb, #fff 18%, transparent), transparent),
    color-mix(in srgb, var(--warn) 15%, var(--surface));
}

.application-dialog,
.drawer-panel {
  box-shadow: var(--shadow-raised);
}

.application-dialog-actions,
.drawer-panel footer {
  border-top-color: var(--line-soft);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--surface) 74%, transparent), var(--surface)),
    var(--surface);
}

.achievement-toast,
.notification-card.unread,
.music-role-card.review,
.release-center-card.release-center-warn,
.control-mini-card.warn {
  box-shadow:
    var(--shadow-soft),
    0 0 0 1px color-mix(in srgb, var(--accent-3) 28%, transparent);
}

.table-wrap,
.drawer-panel,
.application-dialog,
.lyric-comment-list,
.lyric-chat-messages,
.music-project-list,
.music-role-history,
.notification-list {
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--accent) 46%, var(--line)) transparent;
}

.table-wrap::-webkit-scrollbar,
.drawer-panel::-webkit-scrollbar,
.application-dialog::-webkit-scrollbar,
.lyric-comment-list::-webkit-scrollbar,
.lyric-chat-messages::-webkit-scrollbar,
.music-project-list::-webkit-scrollbar,
.music-role-history::-webkit-scrollbar,
.notification-list::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.table-wrap::-webkit-scrollbar-track,
.drawer-panel::-webkit-scrollbar-track,
.application-dialog::-webkit-scrollbar-track,
.lyric-comment-list::-webkit-scrollbar-track,
.lyric-chat-messages::-webkit-scrollbar-track,
.music-project-list::-webkit-scrollbar-track,
.music-role-history::-webkit-scrollbar-track,
.notification-list::-webkit-scrollbar-track {
  background: transparent;
}

.table-wrap::-webkit-scrollbar-thumb,
.drawer-panel::-webkit-scrollbar-thumb,
.application-dialog::-webkit-scrollbar-thumb,
.lyric-comment-list::-webkit-scrollbar-thumb,
.lyric-chat-messages::-webkit-scrollbar-thumb,
.music-project-list::-webkit-scrollbar-thumb,
.music-role-history::-webkit-scrollbar-thumb,
.notification-list::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--accent) 58%, var(--surface)), color-mix(in srgb, var(--accent-3) 34%, var(--line)))
    content-box;
}

@media (max-width: 700px) {
  .topbar {
    box-shadow: 0 8px 20px color-mix(in srgb, #000 8%, transparent);
  }

  .card,
  .table-wrap,
  .drawer-panel,
  .application-dialog,
  .music-project-card,
  .music-role-card,
  .lyric-editor-card,
  .achievement-card {
    border-radius: var(--radius-sm);
  }
}

/* Work hub upgrade: dashboard, collapsed navigation hints and richer profile signals. */
@media (min-width: 981px) {
  .sidebar.collapsed {
    overflow-x: visible;
  }
}

.sidebar.collapsed .nav button[aria-label]::after {
  content: attr(aria-label);
  position: absolute;
  z-index: 50;
  left: calc(100% + 10px);
  top: 50%;
  max-width: 220px;
  padding: 7px 10px;
  border: 1px solid color-mix(in srgb, var(--accent) 32%, var(--line));
  border-radius: 999px;
  background:
    linear-gradient(180deg, color-mix(in srgb, #fff 9%, transparent), transparent),
    color-mix(in srgb, var(--surface) 96%, var(--surface-3));
  color: var(--text);
  box-shadow: var(--shadow-soft);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.2;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translate(-4px, -50%);
  transition: opacity 0.14s ease, transform 0.14s ease;
}

.sidebar.collapsed .nav button[aria-label]:hover::after,
.sidebar.collapsed .nav button[aria-label]:focus-visible::after {
  opacity: 1;
  transform: translate(0, -50%);
}

.dashboard-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(420px, 0.95fr);
  gap: 18px;
  align-items: center;
  padding: clamp(16px, 1.7vw, 24px);
  overflow: hidden;
  position: relative;
}

.dashboard-hero::after {
  content: "";
  position: absolute;
  inset: auto -56px -72px auto;
  width: 210px;
  height: 210px;
  border-radius: 50%;
  background:
    radial-gradient(circle, color-mix(in srgb, var(--accent) 20%, transparent), transparent 64%);
  pointer-events: none;
}

.dashboard-hero h2 {
  margin: 4px 0 6px;
  font-size: clamp(24px, 2.3vw, 34px);
  line-height: 1.08;
}

.dashboard-hero p {
  max-width: 70ch;
  margin: 0;
  color: var(--muted);
}

.dashboard-hero-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  min-width: 0;
  position: relative;
  z-index: 1;
}

.dashboard-action-card {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 12px;
  border: 1px solid color-mix(in srgb, var(--line) 74%, transparent);
  border-radius: var(--radius-md);
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--surface) 88%, var(--accent) 8%), color-mix(in srgb, var(--surface) 92%, transparent)),
    var(--surface);
  box-shadow: 0 10px 24px color-mix(in srgb, #000 8%, transparent);
}

.dashboard-action-card div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.dashboard-action-card span,
.dashboard-action-card small {
  color: var(--muted);
  font-size: 12px;
}

.dashboard-action-card strong {
  color: var(--accent);
  font-size: clamp(24px, 2.3vw, 34px);
  line-height: 1;
}

.dashboard-action-card button {
  width: 100%;
  min-height: 32px;
}

.dashboard-action-card.is-active {
  border-color: color-mix(in srgb, var(--accent) 72%, var(--line));
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--accent) 32%, transparent),
    0 12px 28px color-mix(in srgb, var(--accent) 18%, transparent);
}

.dashboard-action-card.is-active button {
  border-color: color-mix(in srgb, var(--accent) 68%, var(--line));
  background: color-mix(in srgb, var(--accent) 20%, var(--surface));
  color: var(--text);
}

.dashboard-action-danger {
  border-color: color-mix(in srgb, var(--danger) 46%, var(--line));
  background: color-mix(in srgb, var(--danger) 9%, var(--surface));
}

.dashboard-action-danger strong {
  color: var(--danger);
}

.dashboard-action-warn {
  border-color: color-mix(in srgb, var(--warn) 46%, var(--line));
  background: color-mix(in srgb, var(--warn) 10%, var(--surface));
}

.dashboard-action-warn strong {
  color: var(--warn);
}

.dashboard-action-ok {
  border-color: color-mix(in srgb, var(--ok) 38%, var(--line));
  background: color-mix(in srgb, var(--ok) 8%, var(--surface));
}

.dashboard-action-ok strong {
  color: var(--ok);
}

.dashboard-quick-panel .card-header {
  min-height: 46px;
}

.dashboard-quick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr));
  gap: 8px;
  padding: 12px;
}

.dashboard-quick-action {
  min-width: 0;
  min-height: 56px;
  justify-content: flex-start;
  gap: 10px;
  padding: 9px 10px;
  border-color: color-mix(in srgb, var(--line) 68%, transparent);
  background:
    linear-gradient(180deg, color-mix(in srgb, #fff 8%, transparent), transparent),
    color-mix(in srgb, var(--surface) 84%, var(--surface-3));
  text-align: left;
}

.dashboard-quick-action:hover {
  border-color: color-mix(in srgb, var(--accent) 56%, var(--line));
  background: color-mix(in srgb, var(--accent) 10%, var(--surface));
}

.dashboard-quick-icon {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  display: inline-grid;
  place-items: center;
  border-radius: 9px;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 13%, var(--surface));
}

.dashboard-quick-action > span:last-child {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.dashboard-quick-action strong,
.dashboard-quick-action small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dashboard-quick-action small {
  color: var(--muted);
  font-size: 12px;
}

.dashboard-quick-primary {
  border-color: color-mix(in srgb, var(--accent) 58%, var(--line));
  background: color-mix(in srgb, var(--accent) 15%, var(--surface));
}

.dashboard-quick-warn {
  border-color: color-mix(in srgb, var(--warn) 46%, var(--line));
  background: color-mix(in srgb, var(--warn) 10%, var(--surface));
}

.dashboard-quick-info {
  border-color: color-mix(in srgb, var(--info) 42%, var(--line));
  background: color-mix(in srgb, var(--info) 9%, var(--surface));
}

.dashboard-decision-panel,
.dashboard-radar-panel {
  align-self: stretch;
}

.dashboard-decision-list,
.dashboard-radar-list {
  display: grid;
  gap: 8px;
  padding: 12px;
}

.dashboard-decision,
.dashboard-radar-item {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
}

.dashboard-decision div,
.dashboard-radar-item button {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.dashboard-decision span,
.dashboard-decision small,
.dashboard-radar-item span {
  color: var(--muted);
  font-size: 12px;
}

.dashboard-decision strong,
.dashboard-radar-item strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-decision button,
.dashboard-radar-item > button {
  min-height: 32px;
}

.dashboard-radar-item > button {
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  justify-content: flex-start;
  box-shadow: none;
  text-align: left;
}

.dashboard-radar-item > button:hover {
  transform: none;
  color: var(--accent);
}

.dashboard-radar-pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 5px;
}

.dashboard-decision-danger,
.dashboard-radar-danger {
  border-color: color-mix(in srgb, var(--danger) 42%, var(--line));
  background: color-mix(in srgb, var(--danger) 9%, var(--surface));
}

.dashboard-decision-danger strong,
.dashboard-radar-danger strong {
  color: var(--danger);
}

.dashboard-decision-warn,
.dashboard-radar-warn {
  border-color: color-mix(in srgb, var(--warn) 42%, var(--line));
  background: color-mix(in srgb, var(--warn) 9%, var(--surface));
}

.dashboard-decision-warn strong,
.dashboard-radar-warn strong {
  color: var(--warn);
}

.dashboard-decision-info {
  border-color: color-mix(in srgb, var(--info) 38%, var(--line));
  background: color-mix(in srgb, var(--info) 8%, var(--surface));
}

.dashboard-decision-info strong {
  color: var(--info);
}

.dashboard-radar-ok strong {
  color: var(--ok);
}

.dashboard-focus-card .table-wrap {
  border: 0;
  border-top: 1px solid var(--line-soft);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  box-shadow: none;
}

.dashboard-task-table-wrap,
.dashboard-audit-table-wrap,
.audit-table-wrap {
  overflow-x: hidden;
}

.dashboard-task-table,
.dashboard-audit-table,
.audit-table {
  min-width: 0;
  table-layout: fixed;
}

.dashboard-task-table th,
.dashboard-task-table td,
.dashboard-audit-table th,
.dashboard-audit-table td,
.audit-table th,
.audit-table td {
  padding: 10px 12px;
  line-height: 1.3;
}

.dashboard-task-table th:nth-child(1) { width: 44%; }
.dashboard-task-table th:nth-child(2) { width: 22%; }
.dashboard-task-table th:nth-child(3) { width: 22%; }

.dashboard-task-table td[data-actions],
.dashboard-task-table th:last-child {
  width: 86px;
  min-width: 86px;
}

.dashboard-audit-table th:nth-child(1) { width: 34%; }
.dashboard-audit-table th:nth-child(2) { width: 36%; }
.dashboard-audit-table th:nth-child(3) { width: 30%; }

.audit-table th:nth-child(1) { width: 18%; }
.audit-table th:nth-child(2) { width: 18%; }
.audit-table th:nth-child(3) { width: 30%; }
.audit-table th:nth-child(4) { width: 34%; }

.dashboard-task-inline-status {
  display: inline-flex;
  margin-left: 8px;
  vertical-align: middle;
}

.dashboard-task-table .pill {
  max-width: 100%;
}

.dashboard-task-row td:first-child strong {
  color: var(--text);
}

.dashboard-deadline {
  font-weight: 750;
}

.dashboard-deadline-danger {
  color: var(--danger);
}

.dashboard-deadline-warn {
  color: var(--warn);
}

.dashboard-deadline-ok {
  color: var(--ok);
}

.profile-signal-panel {
  display: grid;
  gap: 8px;
  min-width: 0;
}

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

.profile-signal-card {
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
  border-radius: var(--radius-sm);
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--surface) 90%, var(--accent) 6%), transparent),
    color-mix(in srgb, var(--surface) 90%, transparent);
  display: grid;
  gap: 3px;
}

.profile-signal-card span,
.profile-signal-card small {
  min-width: 0;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-signal-card strong {
  min-width: 0;
  color: var(--accent);
  font-size: 20px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-signal-ok strong {
  color: var(--ok);
}

.profile-signal-warn strong {
  color: var(--warn);
}

.profile-signal-danger strong {
  color: var(--danger);
}

.profile-signal-info strong {
  color: var(--info);
}

.profile-workload-bar {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: color-mix(in srgb, var(--line) 58%, transparent);
}

.profile-workload-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-3), var(--accent-2));
}

.deadline-duration-field input {
  font-weight: 700;
  letter-spacing: 0;
}

.deadline-duration-field small {
  display: block;
  margin-top: 6px;
  line-height: 1.35;
}

@media (max-width: 1180px) {
  .dashboard-hero {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .dashboard-hero-actions,
  .profile-signal-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-decision,
  .dashboard-radar-item {
    grid-template-columns: 1fr;
  }

  .dashboard-radar-pills {
    justify-content: flex-start;
  }
}

.mobile-bottom-nav {
  display: none;
}

.action-center-view {
  align-items: start;
}

.action-center-panel .card-header {
  align-items: center;
}

.action-center-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 10px;
}

.action-center-card {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid color-mix(in srgb, var(--line) 78%, transparent);
  border-radius: 12px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 7%, transparent), transparent 60%),
    color-mix(in srgb, var(--surface) 92%, transparent);
}

.action-center-card h3,
.action-center-card p {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
}

.action-center-card h3 {
  font-size: 16px;
  line-height: 1.18;
}

.action-center-card p,
.action-center-card small {
  color: var(--muted);
}

.action-center-kind {
  display: inline-flex;
  width: fit-content;
  margin-bottom: 5px;
  padding: 2px 7px;
  border-radius: 999px;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 11%, transparent);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.action-center-danger {
  border-color: color-mix(in srgb, var(--danger) 48%, var(--line));
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--danger) 14%, transparent), transparent 62%),
    color-mix(in srgb, var(--surface) 90%, transparent);
}

.action-center-warn {
  border-color: color-mix(in srgb, var(--warn) 48%, var(--line));
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--warn) 13%, transparent), transparent 62%),
    color-mix(in srgb, var(--surface) 90%, transparent);
}

.action-center-empty {
  min-height: 220px;
}

.lazy-view-shell .card-body {
  min-height: min(52dvh, 480px);
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 12px;
  text-align: center;
}

.lazy-view-pulse {
  width: 54px;
  height: 54px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--accent), var(--accent-3), var(--accent-2));
  box-shadow: 0 18px 38px color-mix(in srgb, var(--accent) 22%, transparent);
  animation: kazokuLazyPulse 1.1s ease-in-out infinite alternate;
}

.lazy-view-lines {
  width: min(360px, 100%);
  display: grid;
  gap: 8px;
}

.lazy-view-lines i {
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 22%, transparent), color-mix(in srgb, var(--surface-2) 92%, transparent), color-mix(in srgb, var(--accent) 16%, transparent));
}

.lazy-view-lines i:nth-child(2) {
  width: 78%;
  margin-inline: auto;
}

.lazy-view-lines i:nth-child(3) {
  width: 58%;
  margin-inline: auto;
}

@keyframes kazokuLazyPulse {
  from {
    transform: translateY(0) scale(0.96);
    filter: saturate(0.95);
  }
  to {
    transform: translateY(-4px) scale(1.02);
    filter: saturate(1.2);
  }
}

/* Mobile workspace pass: phones should read as stacked work cards, not squeezed desktop tables. */
@media (max-width: 760px) {
  :root {
    --content-pad: 12px;
    --content-gap: 12px;
  }

  html,
  body {
    max-width: 100%;
    overflow-x: hidden;
    overflow-x: clip;
    overscroll-behavior-x: none;
  }

  body {
    min-width: 0;
    font-size: 14px;
  }

  .login-screen {
    width: 100vw !important;
    max-width: 100vw !important;
    min-width: 0 !important;
    overflow-x: hidden !important;
  }

  .login-copy,
  .login-panel {
    width: 100vw !important;
    max-width: 100vw !important;
    min-width: 0 !important;
    padding-inline: 12px !important;
  }

  .login-hero-card {
    width: 100%;
    max-width: calc(100vw - 24px);
    margin-inline: auto;
    min-height: min(58svh, 520px);
  }

  .login-hero-text {
    left: 10px;
    right: auto;
    bottom: 10px;
    width: min(320px, calc(100vw - 58px));
    max-width: min(320px, calc(100vw - 58px));
    padding: 14px;
  }

  .login-copy h1 {
    font-size: clamp(29px, 8vw, 36px);
    overflow-wrap: anywhere;
  }

  .login-copy p {
    font-size: 15px;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .login-badges {
    gap: 6px;
  }

  .login-panel {
    padding-bottom: calc(16px + env(safe-area-inset-bottom));
    align-items: center;
  }

  .login-form-card {
    width: min(340px, calc(100vw - 46px));
    max-width: min(340px, calc(100vw - 46px));
    margin-inline: 0 auto;
  }

  .login-form-card .notice {
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .app {
    width: 100%;
    min-width: 0;
  }

  .main {
    width: 100%;
    min-width: 0;
  }

  .topbar {
    position: sticky;
    top: 0;
    z-index: 7;
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 8px 10px;
    padding: calc(8px + env(safe-area-inset-top)) 12px 9px;
    background: color-mix(in srgb, var(--surface) 94%, transparent);
  }

  .topbar h1 {
    font-size: clamp(18px, 5.4vw, 22px);
    line-height: 1.08;
  }

  .topbar p {
    display: -webkit-box;
    max-height: 2.6em;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    font-size: 12.5px;
  }

  .toolbar {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: minmax(104px, 0.58fr) minmax(0, 1.42fr);
    gap: 7px;
    width: 100%;
  }

  .department-toggle {
    width: 100%;
    overflow: hidden;
  }

  .department-toggle button {
    flex: 1 1 0;
    min-width: 0;
    min-height: 38px;
    padding-inline: 8px;
  }

  .searchbox {
    width: 100%;
    min-width: 0;
  }

  .searchbox input {
    min-height: 38px;
    padding-left: 32px;
    font-size: 14px;
  }

  .toolbar-action {
    width: 100%;
    min-width: 0;
    min-height: 38px;
    padding-inline: 8px;
  }

  .toolbar-action-label {
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .toolbar .search-count {
    grid-column: 1 / -1;
    width: 100%;
  }

  .content {
    width: 100%;
    padding: 12px 12px calc(96px + env(safe-area-inset-bottom));
    gap: 12px;
  }

  .mobile-bottom-nav {
    position: fixed;
    left: max(8px, env(safe-area-inset-left));
    right: max(8px, env(safe-area-inset-right));
    bottom: calc(8px + env(safe-area-inset-bottom));
    z-index: 34;
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 5px;
    padding: 7px;
    border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--line));
    border-radius: 18px;
    background:
      linear-gradient(180deg, color-mix(in srgb, #fff 10%, transparent), transparent),
      color-mix(in srgb, var(--surface) 92%, transparent);
    box-shadow:
      0 18px 44px color-mix(in srgb, #000 22%, transparent),
      inset 0 1px 0 color-mix(in srgb, #fff 22%, transparent);
    backdrop-filter: blur(18px) saturate(1.08);
  }

  .mobile-bottom-nav button {
    position: relative;
    min-width: 0;
    min-height: 48px;
    padding: 5px 3px;
    display: grid;
    justify-items: center;
    align-content: center;
    gap: 2px;
    border-radius: 13px;
    border-color: transparent;
    background: transparent;
    color: var(--muted);
    font-size: 10.5px;
    line-height: 1.05;
  }

  .mobile-bottom-nav button.active {
    color: var(--accent);
    border-color: color-mix(in srgb, var(--accent) 52%, var(--line));
    background: color-mix(in srgb, var(--accent) 15%, var(--surface));
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 16%, transparent);
  }

  .mobile-bottom-icon {
    width: 21px;
    height: 21px;
    display: inline-grid;
    place-items: center;
  }

  .mobile-bottom-icon svg {
    width: 20px;
    height: 20px;
  }

  .mobile-bottom-label {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 800;
  }

  .mobile-bottom-badge {
    position: absolute;
    top: -5px;
    right: -2px;
    min-width: 19px;
    height: 19px;
    padding: 0 5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    border: 1px solid color-mix(in srgb, var(--accent-3) 60%, var(--line));
    background: color-mix(in srgb, var(--accent-3) 26%, var(--surface));
    color: color-mix(in srgb, var(--accent-3) 78%, var(--text));
    font-size: 10px;
    font-weight: 850;
    line-height: 1;
  }

  .grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .span-3,
  .span-4,
  .span-5,
  .span-6,
  .span-7,
  .span-8,
  .span-12 {
    grid-column: 1 / -1;
  }

  .card,
  .card-body,
  .card-header,
  .section,
  .profile-card,
  .music-project-card,
  .lyric-editor-card,
  .achievement-card,
  .distribution-title-card,
  .distribution-zone-card,
  .production-row,
  .release-line,
  .notification-card {
    min-width: 0;
  }

  .card {
    border-radius: 12px;
    box-shadow: 0 10px 28px color-mix(in srgb, #000 9%, transparent);
  }

  .card-header {
    align-items: stretch;
    flex-direction: column;
    min-height: 0;
    padding: 12px;
  }

  .card-header .inline-actions,
  .inline-actions,
  .row-actions {
    width: 100%;
    justify-content: stretch;
    flex-wrap: wrap;
  }

  .inline-actions > *,
  .row-actions > * {
    flex: 1 1 min(160px, 100%);
  }

  .filters {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .filters > *,
  .filters input,
  .filters select,
  .filters button,
  input,
  select,
  textarea {
    width: 100%;
    min-width: 0;
  }

  textarea {
    min-height: 88px;
  }

  .table-wrap,
  .distribution-admin-table-wrap .table-wrap,
  .translation-table-wrap .table-wrap,
  .dashboard-task-table-wrap,
  .dashboard-audit-table-wrap,
  .audit-table-wrap,
  .wishlist-table-wrap,
  .signups-table-wrap {
    width: 100%;
    max-width: 100%;
    overflow: visible;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  .data-table,
  .distribution-admin-table-wrap .data-table,
  .translation-table-wrap .data-table,
  .dashboard-task-table,
  .dashboard-audit-table,
  .audit-table,
  .wishlist-table,
  .signups-table {
    display: grid !important;
    width: 100% !important;
    min-width: 0 !important;
    table-layout: auto !important;
    border-collapse: separate;
    border-spacing: 0;
  }

  .data-table thead,
  .distribution-admin-table-wrap .data-table thead,
  .translation-table-wrap .data-table thead,
  .wishlist-table thead,
  .signups-table thead {
    display: none !important;
  }

  .data-table tbody,
  .distribution-admin-table-wrap .data-table tbody,
  .translation-table-wrap .data-table tbody,
  .wishlist-table tbody,
  .signups-table tbody {
    display: grid !important;
    gap: 10px;
    width: 100%;
  }

  .data-table tr,
  .distribution-admin-table-wrap .data-table tr,
  .translation-table-wrap .data-table tr,
  .wishlist-table tr,
  .signups-table tr {
    display: grid !important;
    width: 100%;
    gap: 8px;
    margin: 0;
    padding: 12px;
    border: 1px solid color-mix(in srgb, var(--line) 82%, var(--accent) 18%);
    border-radius: 12px;
    background:
      linear-gradient(135deg, color-mix(in srgb, var(--accent) 8%, transparent), transparent 60%),
      var(--surface);
    box-shadow: 0 10px 24px color-mix(in srgb, #000 8%, transparent);
  }

  .data-table th,
  .data-table td,
  .distribution-admin-table-wrap .data-table th,
  .distribution-admin-table-wrap .data-table td,
  .translation-table-wrap .data-table th,
  .translation-table-wrap .data-table td,
  .wishlist-table th,
  .wishlist-table td,
  .signups-table th,
  .signups-table td {
    display: grid !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    white-space: normal !important;
    overflow-wrap: anywhere;
  }

  .data-table td[data-label],
  .distribution-admin-table-wrap .data-table td[data-label],
  .translation-table-wrap .data-table td[data-label],
  .wishlist-table td[data-label],
  .signups-table td[data-label] {
    grid-template-columns: 1fr;
    gap: 3px;
  }

  .data-table td[data-label]::before,
  .distribution-admin-table-wrap .data-table td[data-label]::before,
  .translation-table-wrap .data-table td[data-label]::before,
  .wishlist-table td[data-label]::before,
  .signups-table td[data-label]::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 10.5px;
    font-weight: 850;
    letter-spacing: 0;
    line-height: 1.15;
    text-transform: uppercase;
  }

  .data-table td[data-actions],
  .distribution-admin-table-wrap .data-table td[data-actions],
  .translation-table-wrap .data-table td[data-actions],
  .wishlist-table td[data-actions],
  .signups-table td[data-actions] {
    display: flex !important;
    flex-wrap: wrap;
    gap: 7px;
    padding-top: 6px !important;
  }

  .data-table td[data-actions] > button,
  .data-table td[data-actions] .row-actions > button,
  .data-table td[data-actions] > .row-actions,
  .wishlist-table .wishlist-actions button,
  .signups-table .signup-actions button {
    flex: 1 1 min(150px, 100%);
    min-width: 0;
  }

  .translation-table-wrap .source-chip,
  .translation-table-wrap .source-chip-list {
    max-width: 100%;
    min-width: 0;
  }

  .pill,
  .status-chip,
  .distribution-user-chip,
  .wishlist-person,
  .source-chip {
    max-width: 100%;
    white-space: normal;
  }

  .progress,
  .achievement-progress,
  .profile-workload-bar,
  .release-progress {
    width: 100%;
    min-width: 0;
  }

  .achievement-grid,
  .achievement-group-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .achievement-card {
    grid-template-columns: 54px minmax(0, 1fr);
    gap: 10px;
    padding: 12px;
  }

  .achievement-tier-track {
    grid-template-columns: repeat(auto-fit, minmax(34px, 1fr));
    gap: 5px;
  }

  .achievement-tier {
    min-width: 0;
    padding: 4px 3px;
  }

  .achievement-card-foot {
    align-items: stretch;
    display: grid;
    gap: 8px;
  }

  .achievement-card-foot button {
    width: 100%;
  }

  .distribution-page,
  .distribution-zones,
  .distribution-zone,
  .distribution-role-grid,
  .distribution-title-list,
  .distribution-load-grid,
  .distribution-card-signup-form,
  .distribution-title-head,
  .distribution-self-panel,
  .distribution-title-actions,
  .distribution-admin-filters,
  .distribution-admin-toolbar {
    grid-template-columns: 1fr !important;
  }

  .distribution-title-stats,
  .distribution-self-actions,
  .distribution-admin-row-actions {
    width: 100%;
    justify-content: stretch;
  }

  .distribution-title-stats > *,
  .distribution-self-actions > *,
  .distribution-admin-row-actions > * {
    flex: 1 1 min(150px, 100%);
  }

  .distribution-candidate {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  .production-row,
  .production-head,
  .production-summary,
  .production-grid,
  .production-team,
  .assignment-groups,
  .person-list,
  .release-line-head,
  .platform-grid,
  .voice-report-head,
  .voice-report-row,
  .sound-work-row,
  .fix-builder-grid {
    grid-template-columns: 1fr !important;
  }

  .person-line {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .person-line .inline-actions button {
    flex: 1 1 min(140px, 100%);
  }

  .music-workspace,
  .music-role-grid,
  .music-project-head,
  .music-project-footer,
  .music-role-assignment,
  .music-role-replacement,
  .music-role-replacement.has-from,
  .music-sound-submit,
  .music-sound-comment-form,
  .music-sound-reply-form,
  .music-sound-version header,
  .music-sound-demo-row {
    grid-template-columns: 1fr !important;
  }

  .music-project-list {
    position: static !important;
    display: flex !important;
    gap: 8px;
    max-height: none !important;
    margin-inline: -12px;
    padding: 0 12px 4px;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    scroll-snap-type: x proximity;
  }

  .music-list-item {
    flex: 0 0 min(78vw, 300px);
    scroll-snap-align: start;
  }

  .music-role-actions,
  .music-role-assignment,
  .music-role-replacement {
    width: 100%;
  }

  .music-role-actions button,
  .music-role-assignment button,
  .music-role-replacement button {
    flex: 1 1 min(140px, 100%);
  }

  .music-sound-card {
    gap: 12px;
    width: 100%;
    max-width: 100%;
  }

  .music-sound-workspace,
  .music-sound-workspace > *,
  .music-sound-version,
  .music-sound-comments,
  .music-sound-comment,
  .music-sound-comment-form,
  .music-sound-reply-form,
  .music-sound-audio,
  .music-sound-audio-list,
  .kazoku-audio-main,
  .kazoku-audio-controls {
    min-width: 0;
    max-width: 100%;
  }

  .music-sound-summary {
    display: grid;
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .music-sound-summary span {
    min-width: 0;
    padding: 7px 9px;
    border: 1px solid color-mix(in srgb, var(--line) 62%, transparent);
    border-radius: 8px;
    background: color-mix(in srgb, var(--surface-2) 58%, transparent);
    overflow-wrap: anywhere;
  }

  .music-sound-submit {
    gap: 10px;
    padding: 12px;
    border-radius: 10px;
  }

  .music-sound-submit input,
  .music-sound-submit textarea,
  .music-sound-file-input input {
    min-height: 44px;
    font-size: 16px;
  }

  .music-sound-submit textarea {
    min-height: 94px;
    max-height: 38dvh;
  }

  .music-sound-file-input {
    padding: 9px 10px;
    border: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
    border-radius: 8px;
    background: color-mix(in srgb, var(--surface) 72%, transparent);
  }

  .music-sound-version-list {
    gap: 12px;
  }

  .music-sound-version {
    gap: 12px;
    padding: 10px;
    border-radius: 10px;
    width: 100%;
    max-width: 100%;
  }

  .music-sound-version header {
    gap: 8px;
  }

  .music-sound-version header .profile-status {
    justify-self: start;
    align-items: flex-start;
  }

  .music-sound-demo-row {
    gap: 8px;
  }

  .music-sound-demo-row a {
    display: flex;
    min-height: 42px;
    width: 100%;
    align-items: center;
    justify-content: center;
    padding: 9px 10px;
    border: 1px solid color-mix(in srgb, var(--accent) 42%, var(--line));
    border-radius: 8px;
    background: color-mix(in srgb, var(--accent) 10%, var(--surface));
    color: var(--accent);
    font-weight: 850;
    text-decoration: none;
  }

  .music-sound-demo-row span {
    width: 100%;
  }

  .music-sound-comments {
    gap: 10px;
    padding: 10px;
    border-radius: 10px;
    width: 100%;
  }

  .music-sound-comments-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: flex-start;
  }

  .music-sound-comments-head span {
    white-space: nowrap;
  }

  .music-sound-comment {
    gap: 9px;
    padding: 10px;
    border-radius: 9px;
    max-width: 100%;
  }

  .music-sound-audio {
    grid-template-columns: 1fr !important;
  }

  .kazoku-audio-play {
    justify-self: start;
  }

  .kazoku-audio-topline {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }

  .kazoku-audio-topline strong,
  .kazoku-audio-subtitle,
  .kazoku-audio-error {
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .kazoku-audio-actions {
    grid-column: auto;
    justify-content: stretch;
    width: 100%;
  }

  .kazoku-audio-actions > * {
    flex: 1 1 min(130px, 100%);
  }

  .music-sound-comment p,
  .music-sound-reply p {
    font-size: 15px;
    line-height: 1.45;
  }

  .music-sound-replies {
    margin-top: 2px;
    padding-left: 0;
    border-left: 0;
  }

  .music-sound-reply {
    padding: 9px 10px 9px 12px;
    border-left: 3px solid color-mix(in srgb, var(--accent) 52%, transparent);
  }

  .music-sound-comment-form,
  .music-sound-reply-form {
    gap: 8px;
    padding: 10px;
    border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--line));
    border-radius: 10px;
    background: color-mix(in srgb, var(--surface-2) 58%, transparent);
  }

  .music-sound-comment-form textarea,
  .music-sound-reply-form textarea {
    min-height: 96px;
    max-height: 42dvh;
    font-size: 16px;
  }

  .music-sound-reply-form textarea {
    min-height: 76px;
  }

  .music-sound-comment-form button,
  .music-sound-reply-form button {
    width: 100%;
    min-height: 46px;
  }

  .lyric-workspace,
  .lyric-workspace > .music-project-list,
  .lyric-text-create,
  .lyric-editor-layout,
  .lyric-editor-pair,
  .lyric-compare-grid,
  .lyric-library-preview,
  .lyric-editor-head,
  .lyric-submit-row,
  .lyric-assignee-control,
  .lyric-feedback-desk,
  .lyric-review-sheet-body,
  .lyric-review-sheet-body .lyric-feedback-grid {
    grid-template-columns: 1fr !important;
  }

  .lyric-workspace > .music-project-list {
    display: grid !important;
    margin-inline: 0;
    padding: 10px;
    overflow: visible !important;
  }

  .lyric-text-tabs {
    margin-inline: -10px;
    padding-inline: 10px;
    overflow-x: auto;
  }

  .lyric-editor {
    min-height: 50dvh;
    font-size: 15px;
    line-height: 1.62;
  }

  .lyric-comment-form,
  .lyric-comment-list,
  .lyric-chat-panel,
  .lyric-original-preview {
    max-height: none;
  }

  .lyric-chat-form,
  .lyric-inline-reply,
  .lyric-comment-actions {
    grid-template-columns: 1fr !important;
  }

  .profile-head,
  .profile-layout,
  .profile-columns,
  .profile-metrics,
  .profile-signal-grid,
  .team-compact-card,
  .team-compact-actions,
  .system-status-grid,
  .system-status-metrics,
  .youtube-board,
  .release-guide-grid,
  .release-template-layout,
  .application-detail-grid,
  .application-system-fields,
  .application-general-fields,
  .application-role-groups,
  .compact-form-grid {
    grid-template-columns: 1fr !important;
  }

  .profile-status,
  .team-compact-actions {
    justify-content: flex-start;
  }

  .dashboard-hero,
  .dashboard-hero-actions,
  .dashboard-decision,
  .dashboard-radar-item {
    grid-template-columns: 1fr !important;
  }

  .dashboard-hero {
    padding: 14px;
  }

  .dashboard-hero h2 {
    font-size: clamp(25px, 8vw, 34px);
  }

  .application-modal,
  .drawer,
  .fix-builder-layer,
  .fix-details-layer,
  .people-overflow-layer,
  .user-preview-layer {
    padding: 0;
    place-items: stretch;
  }

  .drawer.fix-details-layer {
    padding: 0;
    place-items: stretch;
  }

  .application-dialog,
  .drawer-panel,
  .fix-builder-panel,
  .fix-details-panel,
  .people-overflow-panel,
  .user-preview-panel {
    width: 100vw;
    width: 100dvw;
    max-width: 100vw;
    max-width: 100dvw;
    max-height: 100vh;
    max-height: 100dvh;
    border-radius: 0;
  }

  .application-dialog,
  .drawer-panel {
    height: 100vh;
    height: 100dvh;
  }

  .application-form-scroll,
  .drawer-panel .form-grid {
    padding-inline: 12px;
  }

  .application-dialog-actions,
  .drawer-panel footer,
  .fix-builder-panel footer,
  .user-preview-actions {
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
  }

  .application-dialog-actions button,
  .drawer-panel footer button,
  .fix-builder-panel footer button,
  .user-preview-actions button {
    width: 100%;
  }

  .kazoku-floating-audio {
    right: 8px;
    bottom: calc(82px + env(safe-area-inset-bottom));
    left: 8px;
    width: auto;
  }

  .kazoku-floating-audio .music-sound-audio,
  .music-sound-audio {
    grid-template-columns: 40px minmax(0, 1fr) !important;
  }

  .kazoku-audio-actions,
  .music-sound-audio > a {
    grid-column: 1 / -1;
  }
}

@media (max-width: 480px) {
  .topbar {
    grid-template-columns: 40px minmax(0, 1fr);
    padding-inline: 10px;
  }

  .toolbar {
    grid-template-columns: 1fr 1fr;
  }

  .department-toggle,
  .searchbox,
  .toolbar .search-count {
    grid-column: 1 / -1;
  }

  .toolbar-action-refresh {
    grid-column: 1;
  }

  .toolbar-action-theme {
    grid-column: 2;
  }

  .toolbar-action-label {
    display: none;
  }

  .toolbar-action-icon {
    width: 24px;
    height: 24px;
  }

  .content {
    padding-inline: 10px;
  }

  .card-body,
  .card-header,
  .profile-card,
  .music-project-card,
  .lyric-editor-card,
  .production-row,
  .release-line,
  .notification-card,
  .achievement-card {
    padding: 10px;
  }

  .data-table tr,
  .distribution-admin-table-wrap .data-table tr,
  .translation-table-wrap .data-table tr,
  .wishlist-table tr,
  .signups-table tr {
    padding: 10px;
  }

  .achievement-card {
    grid-template-columns: 48px minmax(0, 1fr);
  }

  .achievement-icon {
    width: 48px;
    height: 48px;
  }

  .achievement-card h3 {
    font-size: 15px;
  }

  .achievement-tier-track {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .music-list-item {
    flex-basis: min(84vw, 290px);
  }

  button,
  .button-like {
    min-height: 38px;
  }
}

@media (max-width: 360px) {
  .mobile-bottom-label {
    display: none;
  }

  .mobile-bottom-nav button {
    min-height: 42px;
  }
}

/* Visual QA pass: soften the new skin without letting it eat compact UI. */
input[type="checkbox"],
input[type="radio"] {
  width: 16px;
  min-width: 16px;
  height: 16px;
  min-height: 16px;
  max-width: 16px;
  padding: 0;
  margin: 0;
  flex: 0 0 16px;
  border-radius: 4px;
  accent-color: var(--accent);
  box-shadow: none;
  vertical-align: middle;
}

input[type="radio"] {
  border-radius: 999px;
}

.row-check,
.data-table .row-check,
.distribution-admin-title-with-select .row-check {
  width: 18px;
  min-width: 18px;
  height: 18px;
  min-height: 18px;
  max-width: 18px;
  margin: 0;
  justify-self: center;
  align-self: center;
}

button,
.button-like,
.pill,
.status-pill,
.status-chip,
.source-chip,
.role-pill,
.nav-badge,
.search-count,
.distribution-counter,
.distribution-limit,
.distribution-user-chip,
.wishlist-person,
.achievement-tier,
.choice-pill,
.assignment-chip .pill,
.release-ready-badge,
.release-reupload-badge {
  line-height: 1.28;
}

.pill,
.status-pill,
.status-chip,
.source-chip,
.role-pill,
.nav-badge,
.search-count,
.distribution-counter,
.distribution-limit,
.distribution-user-chip,
.wishlist-person,
.achievement-tier,
.choice-pill,
.assignment-chip .pill {
  min-height: 26px;
  padding-block: 3px;
  overflow: visible;
}

/* Final public application polish: theme control, readable image overlay, and clean rounded edges. */
.application-public-brandbar {
  width: min(100%, 520px);
  display: flex;
  gap: 10px;
  align-items: flex-start;
  justify-content: space-between;
}

.application-public-intro .brand {
  width: 100%;
  padding: 9px 12px 9px 10px;
  border: 1px solid color-mix(in srgb, #fff 16%, transparent);
  border-radius: 8px;
  background: color-mix(in srgb, #18120f 78%, transparent);
  color: #fff;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(10px) saturate(1.08);
}

.application-public-intro .brand strong {
  color: #fff;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.38);
}

.application-public-intro .brand span {
  color: color-mix(in srgb, #fff 78%, transparent);
}

.application-public-intro .brand::before {
  background-color: color-mix(in srgb, #fff 92%, var(--accent) 8%);
}

.application-public-intro .login-kicker {
  border: 1px solid color-mix(in srgb, #fff 20%, transparent);
  background: color-mix(in srgb, #18120f 78%, transparent);
  color: #fff;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.42);
}

.application-public-intro h1,
.application-public-intro p {
  color: #fff;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.42);
}

.application-public-intro p {
  color: color-mix(in srgb, #fff 88%, transparent);
}

.application-public-login,
.application-public-theme-toggle {
  border-color: color-mix(in srgb, #fff 20%, transparent);
  background:
    linear-gradient(180deg, color-mix(in srgb, #fff 12%, transparent), transparent),
    color-mix(in srgb, #18120f 76%, transparent);
  color: #fff;
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(10px) saturate(1.08);
}

.application-public-login:hover,
.application-public-theme-toggle:hover {
  border-color: color-mix(in srgb, #fff 34%, var(--accent));
  background:
    linear-gradient(180deg, color-mix(in srgb, #fff 16%, transparent), transparent),
    color-mix(in srgb, var(--accent) 24%, #18120f 76%);
  color: #fff;
}

.application-public-theme-toggle {
  min-width: 0;
  min-height: 44px;
  flex: 0 0 auto;
  padding: 0 12px;
  border-radius: 999px;
}

.application-public-theme-toggle[aria-pressed="true"] {
  border-color: color-mix(in srgb, var(--accent) 56%, #fff 14%);
}

.application-theme-toggle-icon {
  width: 20px;
  height: 20px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: color-mix(in srgb, #fff 16%, transparent);
  line-height: 1;
}

.application-public-screen .application-modal-standalone .application-dialog {
  overflow: clip !important;
  border-radius: 16px;
  background-clip: padding-box;
}

.application-public-screen .application-dialog-head {
  border-radius: 16px 16px 0 0;
}

.application-public-screen .application-dialog-actions {
  border-radius: 0 0 16px 16px;
}

/* Titles list: keep the row hover unified and remove the nested button backing. */
.titles-table-wrap {
  border-color: color-mix(in srgb, var(--accent) 24%, var(--line));
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--accent) 4%, transparent), transparent 110px),
    color-mix(in srgb, var(--surface) 94%, transparent);
  box-shadow:
    0 16px 34px color-mix(in srgb, #000 8%, transparent),
    inset 0 1px 0 color-mix(in srgb, #fff 18%, transparent);
}

.titles-table {
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
}

.titles-table th:first-child,
.titles-table td:first-child {
  padding-left: 16px;
}

.titles-table th:last-child,
.titles-table td:last-child {
  padding-right: 16px;
}

.titles-table tbody tr {
  position: relative;
}

.titles-table tbody td {
  transition: background 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.titles-table tbody tr:hover td {
  background: color-mix(in srgb, var(--accent) 8%, var(--surface-3));
  border-bottom-color: color-mix(in srgb, var(--accent) 22%, var(--line));
}

.titles-table tbody tr:hover td:first-child {
  box-shadow: inset 4px 0 0 color-mix(in srgb, var(--accent) 70%, var(--line));
}

.titles-table tr.selected-row td,
.titles-table tr.selected-row:hover td {
  background: color-mix(in srgb, var(--accent) 12%, var(--surface-3));
  border-bottom-color: color-mix(in srgb, var(--accent) 28%, var(--line));
}

.titles-table tr.selected-row td:first-child {
  box-shadow: inset 4px 0 0 var(--accent);
}

.titles-table .text-link-button,
.titles-table .text-link-button:hover {
  min-inline-size: 0;
  padding: 0;
  border-color: transparent;
  background: transparent;
  color: var(--accent);
  box-shadow: none;
}

.titles-table .text-link-button:hover {
  color: color-mix(in srgb, var(--accent-2) 84%, var(--text));
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

/* Motion and containment layer for interactive work surfaces. */
@keyframes kazokuSurfaceIn {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.992);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes kazokuDrawerFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes kazokuDrawerSlideIn {
  from {
    opacity: 0.84;
    transform: translateX(28px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

button:not(:disabled):active,
.nav-view-button:not(:disabled):active,
.text-link-button:not(:disabled):active {
  transform: translateY(0) scale(0.985);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}

.primary:not(:disabled):hover,
button[data-save-preferences]:not(:disabled):hover,
button[data-publication-done]:not(:disabled):hover {
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--accent) 24%, transparent),
    0 10px 22px color-mix(in srgb, var(--accent) 16%, transparent);
}

.card,
.publication-title-group,
.archive-release-card,
.distribution-zone-card,
.distribution-setup-card,
.distribution-title-card {
  animation: none;
}

.app.view-motion .content .card,
.app.view-motion .content .publication-title-group,
.app.view-motion .content .archive-release-card,
.app.view-motion .content .distribution-zone-card,
.app.view-motion .content .distribution-setup-card,
.app.view-motion .content .distribution-title-card {
  animation: kazokuSurfaceIn 0.18s ease-out both;
}

.drawer,
.application-modal,
.fix-builder-layer,
.fix-details-layer,
.people-overflow-layer,
.user-preview-layer,
.distribution-detail-layer {
  animation: kazokuDrawerFadeIn 0.18s ease-out both;
}

.drawer-panel,
.application-dialog,
.fix-builder-panel,
.fix-details-panel,
.people-overflow-panel,
.user-preview-panel,
.distribution-detail-panel {
  animation: kazokuDrawerSlideIn 0.22s cubic-bezier(0.22, 0.82, 0.24, 1) both;
}

.nav-group-items {
  display: grid;
  max-height: var(--nav-group-height, 720px);
  opacity: 1;
  transform: translateY(0);
  overflow: hidden;
  will-change: max-height, opacity, transform;
  transition:
    max-height 0.26s cubic-bezier(0.22, 0.82, 0.24, 1),
    opacity 0.16s ease,
    transform 0.18s ease;
}

.nav-group.collapsed .nav-group-items {
  display: grid;
  max-height: 0;
  opacity: 0;
  transform: translateY(-4px);
  pointer-events: none;
}

details > summary {
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}

details[open] > summary {
  border-color: color-mix(in srgb, var(--accent) 36%, var(--line));
  box-shadow: inset 3px 0 0 color-mix(in srgb, var(--accent) 62%, transparent);
}

details[open] > *:not(summary) {
  animation: kazokuSurfaceIn 0.16s ease-out both;
}

.content-distribution,
.distribution-page,
.distribution-zones,
.distribution-zone,
.distribution-zone--admin,
.distribution-admin-stack,
.distribution-admin-table-wrap {
  min-width: 0;
  max-width: 100%;
}

.distribution-admin-filters {
  grid-template-columns: repeat(2, minmax(150px, 1fr)) minmax(130px, auto) minmax(96px, auto);
  overflow: hidden;
}

.distribution-admin-count {
  max-width: 100%;
  min-width: 0;
  justify-self: end;
  overflow: hidden;
  text-overflow: ellipsis;
}

.distribution-admin-table-wrap {
  overflow: hidden;
}

.distribution-admin-table-wrap .table-wrap {
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-gutter: stable;
  overscroll-behavior-x: contain;
}

.distribution-admin-table-wrap .data-table {
  width: max(1400px, 100%);
  min-width: 1400px;
}

.distribution-admin-table-wrap .data-table th:last-child {
  width: 158px;
}

.distribution-admin-table-wrap .data-table th:nth-child(2) {
  width: 220px;
}

.distribution-admin-table-wrap .data-table th:nth-child(3),
.distribution-admin-table-wrap .data-table th:nth-child(4) {
  width: 150px;
}

.distribution-admin-table-wrap .data-table th:nth-child(5),
.distribution-admin-table-wrap .data-table th:nth-child(7) {
  width: 124px;
}

.distribution-admin-table-wrap .data-table th:nth-child(6) {
  width: 148px;
}

.distribution-admin-table-wrap .data-table th:nth-child(8) {
  width: 168px;
}

.distribution-admin-table-wrap .data-table th:nth-child(9) {
  width: 210px;
}

.distribution-admin-table-wrap .data-table td {
  overflow: hidden;
}

.distribution-admin-chips,
.distribution-admin-status-pill,
.distribution-admin-status-pill .pill,
.distribution-admin-chips .distribution-user-chip {
  max-width: 100%;
  min-width: 0;
}

.distribution-admin-status-pill .pill {
  white-space: normal;
  overflow-wrap: anywhere;
}

.distribution-admin-chips .distribution-user-chip {
  display: inline-flex;
  align-items: center;
}

.distribution-admin-chips .distribution-user-link {
  display: inline-block;
  max-width: min(118px, 100%);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.publication-title-group .publication-episode-list,
.publication-title-group .archive-release-list,
.publication-episode-group .publication-episode-body,
.archive-release-card .archive-release-body {
  display: grid;
  max-height: 2400px;
  opacity: 1;
  overflow: hidden;
  transform: translateY(0);
  transition:
    max-height 0.24s cubic-bezier(0.22, 0.82, 0.24, 1),
    opacity 0.16s ease,
    transform 0.16s ease;
}

.publication-title-group.collapsed .publication-episode-list,
.publication-title-group.collapsed .archive-release-list,
.publication-episode-group.collapsed .publication-episode-body,
.archive-release-card.collapsed .archive-release-body {
  display: grid;
  max-height: 0;
  opacity: 0;
  transform: translateY(-4px);
  pointer-events: none;
}

@media (max-width: 900px) {
  .distribution-admin-filters {
    grid-template-columns: 1fr;
  }

  .distribution-admin-count {
    justify-self: start;
  }
}

@media (prefers-reduced-motion: reduce) {
  .card,
  .publication-title-group,
  .archive-release-card,
  .distribution-zone-card,
  .distribution-setup-card,
  .distribution-title-card,
  .drawer,
  .application-modal,
  .fix-builder-layer,
  .fix-details-layer,
  .people-overflow-layer,
  .user-preview-layer,
  .distribution-detail-layer,
  .drawer-panel,
  .application-dialog,
  .fix-builder-panel,
  .fix-details-panel,
  .people-overflow-panel,
  .user-preview-panel,
  .distribution-detail-panel,
  details[open] > *:not(summary) {
    animation: none !important;
  }

  .nav-group-items,
  .publication-title-group .publication-episode-list,
  .publication-title-group .archive-release-list,
  .publication-episode-group .publication-episode-body,
  .archive-release-card .archive-release-body,
  button {
    transition: none !important;
  }
}

/* Zoom resilience: roles must wrap and grow with content instead of clipping inside fixed-height lanes. */
.role-pill-list {
  min-width: 0;
  max-width: 100%;
  flex-wrap: wrap;
}

.role-pill,
.pill.role-pill {
  min-width: 0;
  max-width: 100%;
  overflow: visible;
  overflow-wrap: anywhere;
  text-overflow: clip;
  white-space: normal;
}

.team-compact-list {
  container-type: inline-size;
}

.team-compact-card {
  grid-template-columns:
    minmax(150px, 0.85fr)
    minmax(240px, 1.6fr)
    minmax(118px, 0.58fr)
    minmax(118px, 0.58fr)
    minmax(180px, max-content);
  align-items: start;
  overflow: visible;
}

.team-compact-card > * {
  align-self: start;
  height: auto;
  min-height: 0;
}

.team-compact-roles,
.team-compact-roles .role-pill-list {
  height: auto;
  max-height: none;
  overflow: visible;
  align-items: flex-start;
  align-content: flex-start;
}

.team-compact-roles {
  padding-block: 1px;
}

.team-compact-roles .role-pill {
  flex: 0 1 auto;
  max-width: 100%;
}

.team-compact-meta,
.team-compact-status {
  align-content: flex-start;
}

@container (max-width: 1080px) {
  .team-compact-card {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr) minmax(160px, auto);
  }

  .team-compact-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
}

@container (max-width: 760px) {
  .team-compact-card {
    grid-template-columns: 1fr;
  }

  .team-compact-actions {
    justify-content: stretch;
  }

  .team-compact-actions button {
    flex: 1 1 min(150px, 100%);
  }
}

/* Team cards: roles use a full-width lane so status/actions stay compact at any zoom. */
.team-compact-main {
  grid-area: team-main;
}

.team-compact-roles {
  grid-area: team-roles;
}

.team-compact-meta {
  grid-area: team-meta;
}

.team-compact-status {
  grid-area: team-status;
}

.team-compact-actions {
  grid-area: team-actions;
}

.team-compact-vacation {
  grid-area: team-vacation;
}

.team-compact-card {
  grid-template-columns:
    minmax(190px, 1.15fr)
    minmax(180px, 0.75fr)
    minmax(170px, max-content)
    minmax(230px, max-content);
  grid-template-areas:
    "team-main team-meta team-status team-actions"
    "team-roles team-roles team-roles team-roles";
  gap: 8px 12px;
  align-items: center;
}

.team-compact-card.has-vacation {
  grid-template-areas:
    "team-main team-meta team-status team-actions"
    "team-vacation team-vacation team-vacation team-vacation"
    "team-roles team-roles team-roles team-roles";
  row-gap: 5px;
}

.team-compact-roles {
  padding-top: 1px;
  width: 100%;
  justify-self: stretch;
  align-self: start;
}

.team-compact-roles .role-pill-list {
  gap: 4px;
}

.team-compact-meta {
  display: grid;
  grid-template-columns: minmax(54px, max-content) max-content minmax(0, 1fr);
  gap: 4px 6px;
  align-items: center;
  align-content: center;
  justify-content: start;
  min-height: 30px;
  line-height: 1;
}

.team-compact-meta > span {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  min-height: 24px;
  line-height: 1;
}

.team-compact-availability {
  justify-content: flex-start;
  color: var(--muted);
}

.team-compact-load,
.team-compact-rating {
  gap: 4px;
}

.team-compact-meta .distribution-limit {
  margin-left: 0;
}

.team-compact-meta .rating-compact,
.team-compact-status .status-stack {
  align-items: center;
  line-height: 1;
}

.team-compact-meta .rating-compact small {
  line-height: 1;
}

.team-compact-card.has-vacation .team-compact-meta {
  grid-template-columns: max-content minmax(0, 1fr);
}

.team-compact-card.has-vacation .team-compact-availability {
  display: none;
}

.team-compact-vacation {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  justify-self: end;
  max-width: min(340px, 100%);
  min-height: 24px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--danger) 42%, var(--line));
  background: color-mix(in srgb, var(--danger) 12%, var(--surface));
  color: var(--danger);
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.team-compact-status,
.team-compact-actions {
  min-height: 30px;
  align-content: center;
}

@container (max-width: 1280px) {
  .team-compact-card {
    grid-template-columns:
      minmax(180px, 1fr)
      minmax(170px, 0.8fr)
      minmax(165px, max-content)
      minmax(190px, max-content);
    grid-template-areas:
      "team-main team-meta team-status team-actions"
      "team-roles team-roles team-roles team-roles";
  }

  .team-compact-card.has-vacation {
    grid-template-areas:
      "team-main team-meta team-status team-actions"
      "team-vacation team-vacation team-vacation team-vacation"
      "team-roles team-roles team-roles team-roles";
  }
}

@container (max-width: 760px) {
  .team-compact-card {
    grid-template-columns: 1fr;
    grid-template-areas:
      "team-main"
      "team-roles"
      "team-meta"
      "team-status"
      "team-actions";
  }

  .team-compact-card.has-vacation {
    grid-template-areas:
      "team-main"
      "team-vacation"
      "team-roles"
      "team-meta"
      "team-status"
      "team-actions";
  }
}

/* Team cards: ratings now live beside the name, freeing the middle lane for status/action text. */
.team-compact-card {
  grid-template-columns:
    minmax(250px, 1.5fr)
    minmax(116px, max-content)
    minmax(240px, 1fr)
    minmax(250px, max-content);
}

.team-compact-main {
  overflow: visible;
  white-space: normal;
}

.team-compact-main-rating {
  display: flex;
  max-width: 100%;
  min-width: 0;
  flex-wrap: wrap;
  gap: 4px 6px;
  align-items: center;
  color: var(--muted);
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
}

.team-compact-main .team-compact-main-rating,
.team-compact-main-rating .rating-compact,
.team-compact-main-rating .title-grade {
  overflow: visible;
  text-overflow: clip;
}

.team-compact-main-rating .rating-compact {
  flex: 0 1 auto;
  max-width: 100%;
  min-width: 0;
  align-items: center;
  line-height: 1;
}

.team-compact-main-rating .rating-compact small {
  max-width: none;
  line-height: 1;
  overflow: visible;
  text-overflow: clip;
  white-space: nowrap;
}

.team-compact-main-rating .rating-compact .title-grade {
  flex: 0 0 auto;
  min-width: max-content;
}

.team-compact-meta {
  grid-template-columns: minmax(54px, max-content) max-content;
}

.team-compact-card.has-vacation .team-compact-meta {
  grid-template-columns: max-content;
}

.team-compact-status {
  justify-self: stretch;
}

.team-compact-status .status-stack,
.team-compact-status .pill {
  overflow: visible;
  text-overflow: clip;
  white-space: nowrap;
}

.team-compact-actions {
  justify-self: end;
}

.team-compact-actions button {
  min-inline-size: max-content;
}

@container (max-width: 1280px) {
  .team-compact-card {
    grid-template-columns:
      minmax(230px, 1.35fr)
      minmax(110px, max-content)
      minmax(220px, 1fr)
      minmax(210px, max-content);
  }
}

@container (max-width: 760px) {
  .team-compact-card {
    grid-template-columns: 1fr;
  }

  .team-compact-actions {
    justify-self: stretch;
    justify-content: stretch;
    flex-wrap: wrap;
  }

  .team-compact-actions button {
    flex: 1 1 min(150px, 100%);
    min-inline-size: 0;
  }
}

/* Motion polish: keep rerenders calm, animate only actual view entries and live menu state. */
.app {
  transition: grid-template-columns 0.24s cubic-bezier(0.22, 0.82, 0.24, 1);
}

.sidebar {
  transition:
    width 0.24s cubic-bezier(0.22, 0.82, 0.24, 1),
    padding 0.24s cubic-bezier(0.22, 0.82, 0.24, 1),
    box-shadow 0.2s ease,
    transform 0.2s ease;
}

.sidebar .brand-row,
.sidebar .brand,
.sidebar .userbox,
.sidebar .nav-group-toggle,
.sidebar .nav-label,
.sidebar .nav button {
  transition:
    opacity 0.18s ease,
    transform 0.2s cubic-bezier(0.22, 0.82, 0.24, 1),
    width 0.22s ease,
    padding 0.22s ease,
    background 0.16s ease,
    border-color 0.16s ease,
    box-shadow 0.16s ease,
    color 0.16s ease;
}

.nav-group-items > * {
  min-height: 0;
}

.nav-group.collapsed .nav-group-items {
  max-height: 0;
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
}

.sidebar.collapsed .nav-group.collapsed .nav-group-items {
  max-height: none;
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.card,
.publication-title-group,
.archive-release-card,
.distribution-zone-card,
.distribution-setup-card,
.distribution-title-card {
  animation: none;
}

.app.view-motion .content .card,
.app.view-motion .content .publication-title-group,
.app.view-motion .content .archive-release-card,
.app.view-motion .content .distribution-zone-card,
.app.view-motion .content .distribution-setup-card,
.app.view-motion .content .distribution-title-card {
  animation: kazokuSurfaceIn 0.18s ease-out both;
}

@media (prefers-reduced-motion: reduce) {
  .app,
  .sidebar,
  .sidebar .brand-row,
  .sidebar .brand,
  .sidebar .userbox,
  .sidebar .nav-group-toggle,
  .sidebar .nav-label,
  .sidebar .nav button,
  .nav-group-items {
    transition: none !important;
  }
}

/* Final load/pronunciation polish: keep workload counters readable at any zoom. */
.distribution-admin-chips {
  min-width: 0;
  max-width: 100%;
  overflow: visible;
}

.distribution-admin-chips .distribution-user-chip,
.distribution-user-chip {
  display: inline-grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  align-items: center;
  column-gap: 5px;
  min-width: 0;
  max-width: 100%;
  overflow: visible;
}

.distribution-admin-chips .distribution-user-chip {
  width: min(100%, 150px);
}

.distribution-user-chip .distribution-user-link {
  min-width: 0;
  max-width: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.distribution-user-chip .distribution-limit {
  min-width: 30px;
  max-width: max-content;
  margin-left: 0;
  padding-inline: 5px;
  overflow: visible;
  white-space: nowrap;
}

:root {
  --pronunciation-mark-color: #dc2626;
  --pronunciation-mark-glow: color-mix(in srgb, #dc2626 28%, transparent);
}

[data-theme="dark"] {
  --pronunciation-mark-color: #4ade80;
  --pronunciation-mark-glow: color-mix(in srgb, #22c55e 34%, transparent);
}

.title-pronunciation-mark {
  color: var(--pronunciation-mark-color);
  font-weight: 950;
  text-shadow: 0 0 10px var(--pronunciation-mark-glow);
}

/* Final distribution admin redesign: replace the wide control table with dense cards. */
.distribution-admin-panel {
  overflow: hidden;
}

.distribution-admin-panel-head {
  align-items: flex-start;
  gap: 12px;
}

.distribution-admin-panel-head > div:first-child {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.distribution-admin-panel-head p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.distribution-admin-panel-body {
  display: grid;
  gap: 8px;
}

.distribution-admin-panel .distribution-admin-filters {
  grid-template-columns: minmax(180px, 0.85fr) minmax(180px, 0.85fr) auto auto;
  padding: 7px 8px;
  border: 1px solid color-mix(in srgb, var(--line) 78%, transparent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-2) 34%, transparent);
  overflow: visible;
}

.distribution-admin-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.distribution-admin-summary span {
  min-width: 0;
  display: grid;
  gap: 2px;
  padding: 6px 8px;
  border: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-2) 38%, transparent);
}

.distribution-admin-summary strong {
  color: var(--accent);
  font-size: 17px;
  line-height: 1;
}

.distribution-admin-summary small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.distribution-admin-card-list {
  display: grid;
  gap: 6px;
}

.distribution-admin-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(154px, auto);
  gap: 8px;
  align-items: stretch;
  padding: 7px 8px;
  border: 1px solid color-mix(in srgb, var(--line) 82%, transparent);
  border-left: 3px solid color-mix(in srgb, var(--accent) 52%, var(--line));
  border-radius: 8px;
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--accent) 5%, transparent), transparent 44%),
    color-mix(in srgb, var(--surface) 92%, var(--surface-2));
}

.distribution-admin-card.confirmed {
  border-left-color: var(--ok);
}

.distribution-admin-card.virtual {
  border-left-style: dashed;
}

.distribution-admin-card-selects {
  min-width: 62px;
  display: grid;
  gap: 4px;
  align-content: start;
}

.distribution-admin-select-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 24px;
  padding: 3px 6px;
  border: 1px solid color-mix(in srgb, var(--line) 82%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface-2) 42%, transparent);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

.distribution-admin-select-pill .row-check {
  margin: 0;
}

.distribution-admin-card-main {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.distribution-admin-card-title {
  min-width: 0;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  justify-content: space-between;
}

.distribution-admin-detail-button {
  flex: 0 0 auto;
  min-height: 26px;
  padding-inline: 7px;
}

.distribution-admin-role-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(112px, 1fr));
  gap: 5px;
}

.distribution-admin-role-slot {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(76px, auto) minmax(0, 1fr);
  gap: 4px;
  align-items: center;
  align-content: start;
  padding: 5px 6px;
  border: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-2) 30%, transparent);
}

.distribution-admin-role-slot.is-empty {
  opacity: 0.72;
  background: color-mix(in srgb, var(--surface) 78%, transparent);
}

.distribution-admin-role-label {
  min-width: 0;
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: flex-start;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.distribution-admin-role-label span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.distribution-admin-role-label strong {
  display: none;
}

.distribution-admin-role-slot .distribution-admin-empty {
  min-height: 20px;
  display: inline-flex;
  align-items: center;
}

.distribution-admin-role-slot .distribution-admin-chips {
  min-width: 0;
}

.distribution-admin-role-slot .distribution-user-chip {
  width: auto;
  max-width: 100%;
}

.distribution-admin-comment {
  margin: 0;
  padding: 7px 9px;
  border: 1px solid color-mix(in srgb, var(--accent-3) 22%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent-3) 8%, transparent);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.distribution-admin-action-log {
  min-width: 0;
  display: grid;
  gap: 4px;
  padding: 7px 9px;
  border: 1px solid color-mix(in srgb, var(--line) 76%, transparent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-2) 34%, transparent);
}

.distribution-admin-action-log > span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 950;
  text-transform: uppercase;
}

.distribution-admin-action-log small {
  min-width: 0;
  display: block;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.distribution-admin-action-log strong {
  color: var(--text);
  margin-right: 4px;
}

.distribution-admin-card-side {
  min-width: 0;
  display: grid;
  gap: 6px;
  align-content: space-between;
  justify-items: end;
}

.distribution-admin-card-status {
  display: grid;
  gap: 3px;
  justify-items: end;
  text-align: right;
}

.distribution-admin-card-status > span:last-child {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.distribution-admin-card .distribution-admin-row-actions {
  display: grid;
  grid-template-columns: 1fr;
  justify-items: stretch;
}

.distribution-admin-card .distribution-admin-row-actions button {
  width: 100%;
  min-height: 26px;
  padding-inline: 7px;
}

/* Operational upgrade: typed search, problem center, recommendations and compact work cards. */
.searchbox {
  position: relative;
  display: grid;
  grid-template-columns: minmax(92px, auto) minmax(180px, 1fr) auto;
  align-items: center;
  gap: 6px;
}

.search-scope-select {
  min-width: 112px;
  min-height: 36px;
  padding: 0 28px 0 10px;
  border: 1px solid color-mix(in srgb, var(--line) 76%, transparent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-2) 56%, var(--surface));
  color: var(--text);
  font-weight: 800;
}

.searchbox input {
  min-width: 0;
}

.global-search-results {
  position: absolute;
  z-index: 60;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  display: grid;
  gap: 6px;
  min-width: min(520px, calc(100vw - 32px));
  max-height: min(520px, calc(100vh - 120px));
  overflow: auto;
  padding: 8px;
  border: 1px solid color-mix(in srgb, var(--accent) 38%, var(--line));
  border-radius: 10px;
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--accent) 10%, transparent), transparent 42%),
    color-mix(in srgb, var(--surface) 94%, var(--surface-2));
  box-shadow: 0 18px 42px color-mix(in srgb, #000 22%, transparent);
  animation: ops-panel-in 0.16s ease both;
}

.global-search-results-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2px 4px 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.global-search-results-head strong {
  color: var(--accent);
  font-size: 15px;
}

.global-search-result {
  width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(78px, auto) minmax(0, 1fr) auto;
  gap: 4px 8px;
  align-items: center;
  padding: 8px 9px;
  border: 1px solid color-mix(in srgb, var(--line) 78%, transparent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-2) 45%, transparent);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.global-search-result:hover,
.global-search-result:focus-visible {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--accent) 55%, var(--line));
  background: color-mix(in srgb, var(--accent) 10%, var(--surface-2));
}

.global-search-result span {
  color: var(--accent);
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
}

.global-search-result strong,
.global-search-result small,
.global-search-result em {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.global-search-result small {
  grid-column: 2 / 4;
  color: var(--muted);
}

.global-search-result em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
}

.global-search-empty {
  display: grid;
  gap: 3px;
  padding: 14px;
  color: var(--muted);
  text-align: center;
}

.dashboard-problem-panel .card-header {
  align-items: center;
}

.dashboard-problem-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
  padding: 0 12px 12px;
}

.dashboard-problem-card {
  min-width: 0;
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  padding: 10px;
  border: 1px solid color-mix(in srgb, var(--line) 76%, transparent);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--accent) 7%, transparent), transparent 55%),
    color-mix(in srgb, var(--surface-2) 38%, transparent);
  animation: ops-panel-in 0.18s ease both;
}

.dashboard-problem-card > div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.dashboard-problem-card span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
}

.dashboard-problem-card strong,
.dashboard-problem-card small {
  min-width: 0;
  overflow-wrap: anywhere;
}

.dashboard-problem-card small {
  color: var(--muted);
}

.dashboard-problem-danger {
  border-left-color: var(--danger);
}

.dashboard-problem-warn {
  border-left-color: var(--warn);
}

.dashboard-problem-info {
  border-left-color: var(--accent);
}

.compact-notice {
  margin: 0 12px 10px;
  padding: 8px 10px;
  font-size: 12px;
}

.title-ops-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin: 10px 0;
}

.title-ops-chip {
  min-width: 0;
  display: grid;
  gap: 2px;
  padding: 8px 9px;
  border: 1px solid color-mix(in srgb, var(--line) 75%, transparent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-2) 42%, transparent);
}

.title-ops-chip span,
.title-ops-chip small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.title-ops-chip span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
}

.title-ops-chip strong {
  color: var(--accent);
  font-size: 19px;
  line-height: 1.05;
}

.title-ops-chip small {
  color: var(--muted);
  font-size: 12px;
}

.title-ops-danger {
  border-color: color-mix(in srgb, var(--danger) 44%, var(--line));
}

.title-ops-warn {
  border-color: color-mix(in srgb, var(--warn) 44%, var(--line));
}

.title-ops-ok {
  border-color: color-mix(in srgb, var(--ok) 40%, var(--line));
}

.distribution-admin-recommendations {
  display: grid;
  gap: 5px;
  padding: 7px;
  border: 1px solid color-mix(in srgb, var(--accent) 24%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent) 7%, transparent);
}

.distribution-admin-recommendations > span {
  color: var(--accent);
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
}

.distribution-admin-recommendation-row {
  display: grid;
  grid-template-columns: minmax(86px, auto) minmax(0, 1fr);
  gap: 7px;
  align-items: center;
}

.distribution-admin-recommendation-row > strong {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

.distribution-admin-recommendation-row > div {
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.distribution-recommendation-chip {
  position: relative;
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  min-height: 26px;
  padding: 3px 7px;
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line));
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 82%, var(--accent) 7%);
  color: var(--text);
  font-weight: 850;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 8%, transparent) inset;
}

.distribution-recommendation-chip:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--accent) 70%, var(--line));
}

.distribution-recommendation-chip.is-signed {
  border-color: color-mix(in srgb, var(--ok) 62%, var(--accent));
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--ok) 24%, transparent), transparent 72%),
    color-mix(in srgb, var(--surface) 80%, var(--ok) 12%);
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--ok) 22%, transparent) inset,
    0 0 18px color-mix(in srgb, var(--ok) 13%, transparent);
}

.distribution-recommendation-chip.is-signed::before {
  content: "Записался";
  color: color-mix(in srgb, var(--ok) 86%, var(--text));
  font-size: 9px;
  font-weight: 950;
  text-transform: uppercase;
}

.distribution-recommendation-chip.is-option {
  opacity: 0.84;
  border-style: dashed;
}

.distribution-recommendation-chip.is-option:hover {
  opacity: 1;
}

.distribution-recommendation-chip strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.distribution-recommendation-rating {
  display: inline-flex;
  align-items: center;
  min-height: 18px;
  padding: 1px 5px;
  border: 1px solid color-mix(in srgb, var(--warn) 46%, var(--line));
  border-radius: 999px;
  background: color-mix(in srgb, var(--warn) 14%, var(--surface));
  color: color-mix(in srgb, var(--warn) 84%, var(--text));
  font-size: 10px;
  font-weight: 950;
  line-height: 1;
}

.distribution-recommendation-chip small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
}

.distribution-recommendation-reasons {
  flex-basis: 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  max-width: min(320px, 100%);
}

.distribution-recommendation-reasons em {
  padding: 1px 5px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  color: var(--muted);
  font-size: 9px;
  font-style: normal;
  font-weight: 850;
}

.distribution-recommendation-popover {
  position: absolute;
  z-index: 70;
  left: 0;
  top: calc(100% + 8px);
  width: min(330px, calc(100vw - 32px));
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid color-mix(in srgb, var(--accent) 42%, var(--line));
  border-radius: 10px;
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--accent) 12%, transparent), transparent 54%),
    color-mix(in srgb, var(--surface) 96%, var(--surface-2));
  color: var(--text);
  box-shadow: 0 18px 44px color-mix(in srgb, #000 24%, transparent);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px) scale(0.98);
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.distribution-recommendation-chip:hover .distribution-recommendation-popover,
.distribution-recommendation-chip:focus-visible .distribution-recommendation-popover {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.recommendation-profile-head,
.recommendation-profile-reasons {
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
}

.recommendation-profile-head strong {
  font-size: 14px;
}

.recommendation-profile-head em,
.recommendation-profile-reasons i {
  padding: 2px 6px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 12%, var(--surface-2));
  color: var(--muted);
  font-size: 10px;
  font-style: normal;
  font-weight: 850;
}

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

.recommendation-profile-grid > span {
  min-width: 0;
  display: grid;
  gap: 1px;
  padding: 6px;
  border: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-2) 40%, transparent);
}

.recommendation-profile-grid small {
  color: var(--muted);
  font-size: 9px;
  text-transform: uppercase;
}

.recommendation-profile-grid b {
  color: var(--accent);
  font-size: 13px;
}

.profile-active-work-panel {
  display: grid;
  gap: 10px;
}

.profile-work-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.profile-effectiveness-panel {
  display: grid;
  gap: 10px;
}

.profile-effectiveness-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

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

.profile-work-columns > div {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.profile-work-columns > div > strong {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.profile-work-row {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(74px, auto) minmax(0, 1fr) auto;
  gap: 7px;
  align-items: center;
  padding: 8px;
  border: 1px solid color-mix(in srgb, var(--line) 75%, transparent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-2) 34%, transparent);
  color: var(--text);
  text-align: left;
}

.profile-work-row:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--accent) 50%, var(--line));
}

.profile-work-row span {
  color: var(--accent);
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
}

.profile-work-row strong,
.profile-work-row small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-work-row small {
  color: var(--muted);
}

[data-density="compact"] .content {
  padding-block: 10px;
}

[data-density="compact"] .grid,
[data-density="compact"] .distribution-zones,
[data-density="compact"] .distribution-admin-stack {
  gap: 8px;
}

[data-density="compact"] .card-header {
  min-height: 46px;
  padding-block: 8px;
}

[data-density="compact"] .card-body {
  padding-block: 8px;
}

[data-density="compact"] .distribution-admin-card {
  padding: 8px;
  gap: 8px;
}

[data-density="compact"] .distribution-admin-card-main,
[data-density="compact"] .distribution-admin-role-grid,
[data-density="compact"] .distribution-admin-recommendations {
  gap: 6px;
}

[data-density="compact"] .distribution-admin-role-slot {
  min-height: 38px;
  padding: 6px;
}

[data-density="compact"] .distribution-recommendation-reasons {
  display: none;
}

[data-density="compact"] .dashboard-problem-grid,
[data-density="compact"] .dashboard-quick-grid,
[data-density="compact"] .personal-work-grid,
[data-density="compact"] .profile-effectiveness-grid,
[data-density="compact"] .profile-work-summary {
  gap: 6px;
}

[data-density="compact"] .dashboard-problem-card,
[data-density="compact"] .dashboard-quick-action,
[data-density="compact"] .personal-work-card,
[data-density="compact"] .profile-signal-card {
  padding: 7px 8px;
}

[data-density="compact"] .team-compact-card {
  padding-block: 7px;
}

[data-density="compact"] .title-episode-card,
[data-density="compact"] .title-ops-chip {
  padding-block: 6px;
}

@media (max-width: 920px) {
  .profile-effectiveness-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.notification-priority-bar {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.notification-priority-bar select {
  min-width: min(280px, 100%);
}

.notification-priority-bar span {
  color: var(--accent);
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
}

.notification-card,
.dashboard-problem-card,
.title-ops-chip,
.profile-work-row,
.distribution-admin-card,
.distribution-title-card {
  content-visibility: auto;
  contain-intrinsic-size: 80px;
}

@keyframes ops-panel-in {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Final title rows polish: released episodes collapse into a useful compact line. */
.production-row.released.collapsed {
  min-height: 0;
  padding: 7px 10px;
  gap: 0;
}

.production-row.released.collapsed .production-head {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  justify-items: stretch;
  text-align: left;
}

.production-row.released.collapsed .production-title-toggle {
  min-height: 34px;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  overflow: hidden;
}

.production-row.released.collapsed .toggle-caret {
  width: 18px;
  height: 18px;
}

.production-row.released.collapsed .production-head strong {
  font-size: 16px;
  line-height: 1;
}

.production-row.released.collapsed .production-head .pill {
  min-width: 0;
  min-height: 24px;
  padding: 2px 8px;
}

.production-row.released.collapsed .production-title-toggle > span:not(.toggle-caret):not(.pill):not(.release-ready-badge):not(.release-reupload-badge) {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.production-row.released.collapsed .release-ready-badge,
.production-row.released.collapsed .release-reupload-badge {
  min-height: 24px;
  margin-left: auto;
  padding: 2px 8px;
}

.production-row.released.collapsed .production-head .inline-actions {
  margin-left: 0;
  display: inline-flex;
  flex-wrap: nowrap;
  gap: 5px;
  justify-content: flex-end;
}

.production-row.released.collapsed .production-head .inline-actions button {
  min-height: 30px;
  padding-inline: 8px;
}

/* Final motion guard: updating an already open distribution title must not replay the modal entrance. */
.app.distribution-detail-steady .distribution-detail-layer,
.app.distribution-detail-steady .distribution-detail-panel,
.app.distribution-detail-steady .distribution-detail-layer details[open] > *:not(summary) {
  animation: none !important;
}

.app.distribution-detail-steady .distribution-detail-panel {
  opacity: 1;
  transform: none;
}

/* Calendar, reliability profile and operational status badges. */
.operational-status-badges {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  min-width: 0;
}

.operational-status-badge {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 1.15;
  white-space: nowrap;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.operational-status-gold { color: #ffe7a3; background: linear-gradient(135deg, rgba(163, 104, 19, 0.45), rgba(245, 197, 92, 0.22)); border-color: rgba(245, 197, 92, 0.48); }
.operational-status-green { color: #8dffba; background: linear-gradient(135deg, rgba(18, 95, 55, 0.45), rgba(47, 192, 116, 0.2)); border-color: rgba(74, 222, 128, 0.44); }
.operational-status-cyan { color: #8ff7ff; background: linear-gradient(135deg, rgba(12, 91, 106, 0.45), rgba(34, 211, 238, 0.18)); border-color: rgba(34, 211, 238, 0.44); }
.operational-status-mint { color: #b8ffe2; background: linear-gradient(135deg, rgba(13, 91, 72, 0.42), rgba(45, 212, 191, 0.2)); border-color: rgba(45, 212, 191, 0.38); }
.operational-status-amber { color: #ffe4a1; background: linear-gradient(135deg, rgba(120, 76, 18, 0.42), rgba(251, 191, 36, 0.18)); border-color: rgba(251, 191, 36, 0.44); }
.operational-status-red { color: #ffb5b5; background: linear-gradient(135deg, rgba(127, 29, 29, 0.48), rgba(248, 113, 113, 0.16)); border-color: rgba(248, 113, 113, 0.5); }
.operational-status-violet { color: #e7d7ff; background: linear-gradient(135deg, rgba(88, 28, 135, 0.42), rgba(168, 85, 247, 0.18)); border-color: rgba(168, 85, 247, 0.42); }

:root[data-theme="light"] .operational-status-gold { color: #7a4d08; background: linear-gradient(135deg, rgba(254, 243, 199, 0.95), rgba(245, 158, 11, 0.2)); border-color: rgba(180, 114, 8, 0.35); }
:root[data-theme="light"] .operational-status-green { color: #11643a; background: linear-gradient(135deg, rgba(220, 252, 231, 0.95), rgba(34, 197, 94, 0.18)); border-color: rgba(22, 163, 74, 0.3); }
:root[data-theme="light"] .operational-status-cyan { color: #0e6272; background: linear-gradient(135deg, rgba(207, 250, 254, 0.95), rgba(6, 182, 212, 0.16)); border-color: rgba(8, 145, 178, 0.3); }
:root[data-theme="light"] .operational-status-mint { color: #0f6655; background: linear-gradient(135deg, rgba(204, 251, 241, 0.95), rgba(20, 184, 166, 0.16)); border-color: rgba(15, 118, 110, 0.28); }
:root[data-theme="light"] .operational-status-amber { color: #7c4f0b; background: linear-gradient(135deg, rgba(255, 251, 235, 0.95), rgba(245, 158, 11, 0.18)); border-color: rgba(180, 114, 8, 0.32); }
:root[data-theme="light"] .operational-status-red { color: #9d2525; background: linear-gradient(135deg, rgba(254, 226, 226, 0.95), rgba(239, 68, 68, 0.16)); border-color: rgba(220, 38, 38, 0.32); }
:root[data-theme="light"] .operational-status-violet { color: #663399; background: linear-gradient(135deg, rgba(243, 232, 255, 0.95), rgba(147, 51, 234, 0.16)); border-color: rgba(126, 34, 206, 0.3); }

.team-compact-operational {
  grid-column: 1 / -1;
  min-width: 0;
}

.profile-reliability-panel {
  display: grid;
  gap: 14px;
}

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

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

.profile-reliability-columns > div {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: color-mix(in srgb, var(--panel) 82%, transparent);
}

.profile-reliability-columns span {
  min-width: 0;
  color: var(--muted);
  overflow-wrap: anywhere;
}

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

.ops-calendar-hero,
.ops-calendar-panel.span-wide {
  grid-column: 1 / -1;
}

.ops-calendar-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(90px, 1fr));
  gap: 8px;
  min-width: min(460px, 100%);
}

.ops-calendar-stats span {
  display: grid;
  gap: 2px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: color-mix(in srgb, var(--panel) 78%, transparent);
}

.ops-calendar-stats strong {
  color: var(--accent);
}

.ops-calendar-stats small {
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
}

.ops-calendar-month {
  position: relative;
  display: grid;
  gap: 12px;
  border: 1px solid color-mix(in srgb, var(--accent) 20%, var(--line));
  border-radius: 8px;
  padding: 12px;
  overflow: hidden;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 10%, transparent), transparent 32%),
    linear-gradient(180deg, color-mix(in srgb, var(--panel) 92%, transparent), color-mix(in srgb, var(--bg) 92%, transparent));
  box-shadow:
    inset 0 1px 0 color-mix(in srgb, #fff 7%, transparent),
    0 18px 48px rgba(0, 0, 0, 0.18);
}

.ops-calendar-month-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
}

.ops-calendar-month-head h3 {
  margin: 2px 0 0;
  font-size: 1.28rem;
  letter-spacing: 0;
}

.ops-calendar-month-range {
  border: 1px solid color-mix(in srgb, var(--accent) 24%, var(--line));
  border-radius: 999px;
  padding: 5px 10px;
  color: var(--muted);
  font-size: 0.82rem;
  background: color-mix(in srgb, var(--panel) 78%, transparent);
  white-space: nowrap;
}

.ops-calendar-month-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 7px;
}

.ops-calendar-month-tools .icon-btn {
  width: 34px;
  height: 34px;
  font-size: 1.24rem;
  line-height: 1;
}

.ops-calendar-filterbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  border: 1px solid color-mix(in srgb, var(--accent) 16%, var(--line));
  border-radius: 8px;
  padding: 8px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 7%, transparent), transparent 60%),
    color-mix(in srgb, var(--panel) 76%, transparent);
}

.ops-calendar-filter {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  border: 1px solid color-mix(in srgb, var(--line) 88%, transparent);
  border-radius: 999px;
  padding: 5px 8px 5px 6px;
  color: var(--muted);
  background: linear-gradient(180deg, color-mix(in srgb, var(--panel) 86%, transparent), color-mix(in srgb, var(--bg) 90%, transparent));
  cursor: pointer;
  transition: border-color 140ms ease, color 140ms ease, background 140ms ease, box-shadow 140ms ease;
}

.ops-calendar-filter input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.ops-calendar-filter span {
  font-weight: 850;
  line-height: 1;
}

.ops-calendar-filter small {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  border-radius: 999px;
  color: var(--muted);
  background: color-mix(in srgb, var(--bg) 70%, transparent);
  font-size: 0.68rem;
  font-weight: 900;
}

.ops-calendar-filter.is-active {
  border-color: color-mix(in srgb, var(--accent) 52%, var(--line));
  color: var(--text);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 16%, transparent), transparent 72%),
    linear-gradient(180deg, color-mix(in srgb, var(--panel) 90%, transparent), color-mix(in srgb, var(--bg) 88%, transparent));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 12%, transparent);
}

.ops-calendar-filter.is-active small {
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 13%, transparent);
}

.ops-calendar-filter-reset {
  margin-left: auto;
  min-height: 34px;
}

.ops-calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.ops-calendar-weekdays span {
  border: 1px solid color-mix(in srgb, var(--accent) 16%, var(--line));
  border-radius: 8px;
  padding: 6px 8px;
  color: var(--muted);
  background: linear-gradient(180deg, color-mix(in srgb, var(--panel) 86%, transparent), color-mix(in srgb, var(--bg) 92%, transparent));
  font-size: 0.72rem;
  font-weight: 800;
  text-align: center;
  text-transform: uppercase;
}

.ops-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.ops-calendar-day {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 102px;
  border: 1px solid color-mix(in srgb, var(--line) 86%, transparent);
  border-radius: 8px;
  padding: 7px;
  overflow: hidden;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--panel) 90%, transparent), color-mix(in srgb, var(--bg) 94%, transparent));
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.ops-calendar-day::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 2px;
  opacity: 0;
  background: linear-gradient(90deg, var(--accent), rgba(168, 85, 247, 0.72), rgba(245, 158, 11, 0.72));
  transition: opacity 160ms ease;
}

.ops-calendar-day.has-events {
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--accent) 10%, transparent), transparent 46%),
    linear-gradient(180deg, color-mix(in srgb, var(--panel) 92%, transparent), color-mix(in srgb, var(--bg) 92%, transparent));
}

.ops-calendar-day.has-events::before {
  opacity: 1;
}

.ops-calendar-day.is-outside-month {
  opacity: 0.54;
  background: color-mix(in srgb, var(--panel) 58%, transparent);
}

.ops-calendar-day.is-weekend:not(.is-outside-month) {
  background:
    linear-gradient(160deg, rgba(245, 158, 11, 0.06), transparent 45%),
    linear-gradient(180deg, color-mix(in srgb, var(--panel) 90%, transparent), color-mix(in srgb, var(--bg) 94%, transparent));
}

.ops-calendar-day.is-today {
  border-color: color-mix(in srgb, var(--accent) 68%, var(--line));
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--accent) 34%, transparent),
    0 0 0 1px color-mix(in srgb, var(--accent) 14%, transparent),
    0 12px 32px color-mix(in srgb, var(--accent) 14%, transparent);
}

.ops-calendar-day-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.ops-calendar-day-head > div {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  min-width: 0;
}

.ops-calendar-day-head strong {
  font-size: 0.98rem;
  line-height: 1;
}

.ops-calendar-day-head span {
  color: var(--muted);
  font-size: 0.66rem;
  text-transform: uppercase;
}

.ops-calendar-day-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  border: 1px solid color-mix(in srgb, var(--accent) 36%, var(--line));
  border-radius: 999px;
  padding: 0 6px;
  color: var(--accent);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--accent) 18%, transparent), color-mix(in srgb, var(--panel) 74%, transparent));
  font-size: 0.68rem;
  font-style: normal;
  font-weight: 900;
  line-height: 1;
}

.ops-calendar-day-events,
.ops-release-list,
.ops-vacation-list,
.ops-workload-list {
  display: grid;
  gap: 4px;
}

.ops-calendar-event,
.ops-release-row,
.ops-vacation-card,
.ops-workload-card,
.ops-weekday-column button {
  width: 100%;
  min-width: 0;
  text-align: left;
  border-radius: 8px;
  justify-content: flex-start;
}

.ops-calendar-event {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 5px;
  min-height: 0;
  border-radius: 6px;
  padding: 3px 5px;
  overflow: hidden;
  color: var(--text);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--panel) 72%, transparent), color-mix(in srgb, var(--bg) 84%, transparent));
  box-shadow:
    inset 0 1px 0 color-mix(in srgb, #fff 7%, transparent),
    0 3px 10px rgba(0, 0, 0, 0.12);
  transition: border-color 140ms ease, background 140ms ease, transform 140ms ease, box-shadow 140ms ease;
}

.ops-calendar-event:hover {
  transform: translateY(-1px);
  box-shadow:
    inset 0 1px 0 color-mix(in srgb, #fff 10%, transparent),
    0 8px 18px rgba(0, 0, 0, 0.18);
}

.ops-calendar-event b {
  display: inline-flex;
  align-items: center;
  max-width: 64px;
  border-radius: 999px;
  padding: 2px 5px;
  color: color-mix(in srgb, var(--text) 88%, var(--accent));
  background: color-mix(in srgb, var(--panel) 72%, transparent);
  font-size: 0.56rem;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ops-calendar-event span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.72rem;
  font-weight: 800;
}

.ops-calendar-event small {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  font-size: 0.62rem;
  font-weight: 900;
}

.ops-release-row small,
.ops-vacation-card small,
.ops-workload-card small,
.ops-weekday-column button span,
.ops-weekday-column button small {
  overflow-wrap: anywhere;
}

.ops-calendar-more {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--line));
  border-radius: 999px;
  padding: 1px 6px;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  font-size: 0.64rem;
  font-weight: 800;
}

.ops-calendar-info,
.ops-release-info {
  border-color: color-mix(in srgb, var(--accent) 36%, var(--line));
}

.ops-calendar-event.ops-calendar-info {
  border-color: color-mix(in srgb, var(--accent) 46%, var(--line));
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 17%, transparent), transparent 72%),
    linear-gradient(180deg, color-mix(in srgb, var(--panel) 80%, transparent), color-mix(in srgb, var(--bg) 88%, transparent));
}

.ops-calendar-ok,
.ops-release-ok,
.ops-workload-ok {
  border-color: rgba(47, 192, 116, 0.45);
}

.ops-calendar-event.ops-calendar-ok {
  border-color: rgba(47, 192, 116, 0.58);
  background:
    linear-gradient(135deg, rgba(47, 192, 116, 0.16), transparent 72%),
    linear-gradient(180deg, color-mix(in srgb, var(--panel) 80%, transparent), color-mix(in srgb, var(--bg) 88%, transparent));
}

.ops-calendar-warn,
.ops-release-warn,
.ops-workload-warn {
  border-color: rgba(245, 158, 11, 0.52);
}

.ops-calendar-event.ops-calendar-warn {
  border-color: rgba(245, 158, 11, 0.64);
  background:
    linear-gradient(135deg, rgba(245, 158, 11, 0.17), transparent 72%),
    linear-gradient(180deg, color-mix(in srgb, var(--panel) 80%, transparent), color-mix(in srgb, var(--bg) 88%, transparent));
}

.ops-calendar-event.ops-calendar-title-release {
  border-color: color-mix(in srgb, var(--accent) 58%, rgba(245, 158, 11, 0.52));
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 19%, transparent), rgba(245, 158, 11, 0.1) 68%, transparent),
    linear-gradient(180deg, color-mix(in srgb, var(--panel) 82%, transparent), color-mix(in srgb, var(--bg) 88%, transparent));
}

.ops-calendar-event.ops-calendar-title-release b {
  color: color-mix(in srgb, var(--accent) 82%, #fff);
  background: color-mix(in srgb, var(--accent) 20%, transparent);
}

.ops-workload-danger {
  border-color: rgba(248, 113, 113, 0.58);
}

.ops-calendar-vacation {
  border-color: rgba(168, 85, 247, 0.45);
}

.ops-calendar-event.ops-calendar-vacation {
  border-color: rgba(168, 85, 247, 0.58);
  background:
    linear-gradient(135deg, rgba(168, 85, 247, 0.18), rgba(236, 72, 153, 0.08) 58%, transparent),
    linear-gradient(180deg, color-mix(in srgb, var(--panel) 80%, transparent), color-mix(in srgb, var(--bg) 88%, transparent));
}

.ops-calendar-event.ops-calendar-vacation b {
  color: color-mix(in srgb, #fff 86%, rgb(216, 180, 254));
  background: rgba(168, 85, 247, 0.24);
}

.ops-calendar-vacation-stack {
  cursor: default;
}

.ops-release-title-release {
  border-color: color-mix(in srgb, var(--accent) 48%, rgba(245, 158, 11, 0.42));
}

.ops-release-row,
.ops-vacation-card,
.ops-workload-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 4px 10px;
  padding: 10px;
}

.ops-release-row small,
.ops-vacation-card small,
.ops-workload-card small {
  grid-column: 1 / -1;
  color: var(--muted);
}

.ops-workload-card > span {
  grid-column: 1 / -1;
}

.ops-weekly-map {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.ops-weekday-column {
  display: grid;
  align-content: start;
  gap: 7px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px;
  background: color-mix(in srgb, var(--panel) 78%, transparent);
}

.ops-weekday-column h3 {
  margin: 0;
  font-size: 0.9rem;
}

.ops-weekday-column.is-empty {
  opacity: 0.68;
}

.distribution-release-schedule-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 9px;
}

.distribution-release-schedule-card {
  display: grid;
  gap: 5px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--panel) 88%, transparent), color-mix(in srgb, var(--bg) 92%, transparent));
}

.distribution-release-schedule-card.is-pinned {
  border-color: color-mix(in srgb, var(--accent) 58%, var(--line));
}

.distribution-release-schedule-card span {
  color: var(--accent);
  font-weight: 900;
}

.distribution-release-schedule-card strong,
.distribution-release-schedule-card small {
  overflow-wrap: anywhere;
}

.distribution-release-schedule-card small {
  color: var(--muted);
}

[data-density="compact"] .ops-calendar-page,
[data-density="compact"] .ops-calendar-grid,
[data-density="compact"] .ops-calendar-weekdays,
[data-density="compact"] .ops-weekly-map,
[data-density="compact"] .distribution-release-schedule-grid {
  gap: 7px;
}

[data-density="compact"] .ops-calendar-day {
  min-height: 106px;
  padding: 7px;
}

[data-density="compact"] .ops-calendar-stats span,
[data-density="compact"] .distribution-release-schedule-card,
[data-density="compact"] .ops-weekday-column {
  padding: 7px;
}

/* Topbar clock layout v2: keeps the premium clock readable without squeezing tools. */
.topbar {
  grid-template-columns: minmax(210px, 0.9fr) minmax(292px, 350px) minmax(460px, 1.25fr);
  gap: clamp(14px, 1.35vw, 22px);
  align-items: center;
  min-height: 98px;
  border-bottom-color: color-mix(in srgb, var(--accent) 18%, var(--line));
  background:
    radial-gradient(circle at 26% 48%, color-mix(in srgb, var(--accent) 13%, transparent), transparent 27%),
    linear-gradient(90deg, color-mix(in srgb, var(--surface) 96%, transparent), color-mix(in srgb, var(--surface-2) 92%, transparent));
  box-shadow: 0 16px 34px color-mix(in srgb, #000 9%, transparent);
}

.topbar-title {
  display: grid;
  gap: 4px;
  min-width: 0;
  max-width: 440px;
}

.topbar-title h1 {
  font-size: clamp(22px, 1.55vw, 29px);
  line-height: 1.06;
}

.topbar-title p {
  max-width: 34ch;
  line-height: 1.35;
}

.topbar .deadline-clock {
  width: 100%;
  min-width: 292px;
  max-width: 350px;
  min-height: 76px;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 13px;
  padding: 12px 16px 15px;
  border-radius: 20px;
  box-shadow:
    0 18px 46px color-mix(in srgb, #000 16%, transparent),
    0 0 44px color-mix(in srgb, var(--clock-a) 24%, transparent),
    inset 0 1px 0 color-mix(in srgb, #fff 30%, transparent);
}

.topbar .deadline-clock::before {
  width: 38%;
  opacity: 0.5;
}

.topbar .deadline-clock-orb {
  width: 46px;
  height: 46px;
}

.topbar .deadline-clock-eyebrow {
  font-size: 11px;
  line-height: 1;
}

.topbar .deadline-clock-time {
  gap: 6px;
  font-size: clamp(32px, 2.35vw, 40px);
  line-height: 0.92;
}

.topbar .deadline-clock-time small {
  padding: 2px 6px;
  border: 1px solid color-mix(in srgb, var(--clock-b) 20%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--clock-b) 13%, transparent);
  font-size: 13px;
}

.topbar .deadline-clock-caption {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 7px;
  align-items: center;
  font-size: 11px;
  line-height: 1.12;
  white-space: normal;
}

.topbar .deadline-clock-caption span,
.topbar .deadline-clock-caption em {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar .deadline-clock-phase {
  left: 16px;
  right: 16px;
  bottom: 7px;
  height: 4px;
}

.topbar-controls {
  display: grid;
  grid-template-columns: minmax(310px, 1fr) auto;
  gap: 10px;
  align-items: center;
  justify-content: stretch;
  min-width: 0;
}

.toolbar-primary {
  display: grid;
  grid-template-columns: auto minmax(240px, 1fr) auto;
  gap: 9px;
  align-items: center;
  min-width: 0;
}

.toolbar-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
}

.topbar-controls .department-toggle,
.topbar-controls .searchbox {
  min-width: 0;
}

.topbar-controls .searchbox {
  width: 100%;
  max-width: none;
  grid-template-columns: minmax(104px, 0.34fr) minmax(0, 1fr) auto;
}

.topbar-controls .search-scope-select {
  grid-column: 1;
  grid-row: 1;
  width: 100%;
  min-width: 0;
  min-height: 40px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-controls .searchbox::before {
  grid-column: 2;
  grid-row: 1;
}

.topbar-controls .searchbox input {
  grid-column: 2;
  grid-row: 1;
  width: 100%;
  min-width: 0;
  padding-left: 38px;
  padding-right: 38px;
}

.topbar-controls .searchbox input::placeholder {
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-controls .searchbox .icon-btn {
  grid-column: 3;
  grid-row: 1;
}

.topbar-controls .search-count {
  justify-self: start;
}

.topbar-controls .toolbar-action {
  min-width: 42px;
  box-shadow:
    inset 0 1px 0 color-mix(in srgb, #fff 18%, transparent),
    0 10px 22px color-mix(in srgb, #000 8%, transparent);
}

.topbar-controls .department-toggle {
  flex-wrap: nowrap;
  align-self: center;
  overflow: visible;
}

.topbar-controls .department-toggle button {
  min-width: 48px;
  padding-inline: 12px;
}

.topbar-controls .searchbox,
.toolbar-actions .toolbar-action {
  border-color: color-mix(in srgb, var(--accent) 22%, var(--line));
  background:
    linear-gradient(180deg, color-mix(in srgb, #fff 8%, transparent), transparent),
    color-mix(in srgb, var(--surface-2) 62%, transparent);
}

@media (max-width: 1500px) and (min-width: 1181px) {
  .topbar {
    grid-template-columns: minmax(190px, 0.72fr) minmax(280px, 320px) minmax(380px, 1.15fr);
    gap: 12px;
    min-height: 104px;
  }

  .topbar-title p {
    max-width: 27ch;
  }

  .topbar .deadline-clock {
    min-width: 280px;
    max-width: 320px;
    grid-template-columns: 46px minmax(0, 1fr);
    gap: 11px;
    padding-inline: 14px;
  }

  .topbar .deadline-clock-orb {
    width: 42px;
    height: 42px;
  }

  .topbar .deadline-clock-time {
    font-size: clamp(30px, 2.15vw, 36px);
  }

  .topbar-controls {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    align-content: center;
  }

  .toolbar-primary {
    grid-template-columns: auto minmax(210px, 1fr);
  }

  .topbar-controls .search-count {
    grid-column: 1 / -1;
  }

  .toolbar-actions {
    justify-self: end;
  }

  .toolbar-actions .toolbar-action {
    width: 42px;
    padding-inline: 0;
  }

  .toolbar-actions .toolbar-action-label {
    display: none;
  }
}

@media (min-width: 981px) and (max-width: 1180px) {
  .topbar {
    grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
    min-height: 0;
  }

  .topbar-title {
    max-width: none;
  }

  .topbar .deadline-clock {
    width: 100%;
    min-width: 280px;
    max-width: 340px;
    justify-self: stretch;
  }

  .topbar-controls {
    grid-column: 1 / -1;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    width: 100%;
  }

  .toolbar-primary {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .toolbar-actions {
    justify-self: end;
  }

  .toolbar-actions .toolbar-action {
    width: 42px;
    padding-inline: 0;
  }

  .toolbar-actions .toolbar-action-label {
    display: none;
  }
}

/* Topbar reflow v3: clock stays central, controls get a full readable lane. */
@media (min-width: 1181px) {
  .topbar {
    grid-template-areas:
      "title clock spacer"
      "title controls controls";
    grid-template-rows: minmax(76px, auto) auto;
    row-gap: 8px;
    min-height: 148px;
    padding-block: 12px;
  }

  .topbar-title {
    grid-area: title;
    align-self: center;
  }

  .topbar .deadline-clock {
    grid-area: clock;
    justify-self: center;
    width: min(100%, 350px);
    min-width: 320px;
    max-width: 350px;
  }

  .topbar-controls {
    grid-area: controls;
    width: 100%;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-self: start;
    padding: 6px;
    border: 1px solid color-mix(in srgb, var(--accent) 18%, transparent);
    border-radius: 18px;
    background:
      linear-gradient(180deg, color-mix(in srgb, #fff 6%, transparent), transparent),
      color-mix(in srgb, var(--surface) 52%, transparent);
    box-shadow: inset 0 1px 0 color-mix(in srgb, #fff 16%, transparent);
  }

  .toolbar-primary {
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 9px;
  }

  .topbar-controls .department-toggle {
    min-width: 118px;
    justify-self: start;
  }

  .topbar-controls .department-toggle button {
    min-width: 54px;
    padding-inline: 14px;
  }

  .topbar-controls .searchbox {
    grid-template-columns: minmax(118px, 0.28fr) minmax(0, 1fr) auto;
  }

  .toolbar-actions {
    justify-self: end;
  }

  .toolbar-actions .toolbar-action {
    width: auto;
    min-width: 42px;
    padding-inline: 12px;
  }

  .toolbar-actions .toolbar-action-label {
    display: inline;
  }
}

@media (min-width: 1181px) and (max-width: 1360px) {
  .topbar {
    min-height: 152px;
    column-gap: 12px;
  }

  .topbar-title p {
    max-width: 29ch;
  }

  .topbar .deadline-clock {
    min-width: 320px;
    max-width: 350px;
  }

  .topbar-controls {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .toolbar-actions .toolbar-action {
    width: 42px;
    padding-inline: 0;
  }

  .toolbar-actions .toolbar-action-label {
    display: none;
  }
}

/* Topbar clock expansion v4: a wider premium clock with an animated day/night orbit. */
.deadline-clock {
  --day-progress: 0%;
}

.deadline-clock-sky {
  position: relative;
  z-index: 1;
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 20px;
  background:
    radial-gradient(circle at 48% 50%, color-mix(in srgb, var(--clock-a) 24%, transparent), transparent 47%),
    linear-gradient(145deg, color-mix(in srgb, var(--surface-3) 78%, transparent), color-mix(in srgb, #000 8%, transparent));
  box-shadow:
    inset 0 1px 0 color-mix(in srgb, #fff 22%, transparent),
    0 0 30px color-mix(in srgb, var(--clock-a) 28%, transparent);
}

.deadline-clock-sky::before {
  content: "";
  position: absolute;
  inset: 5px;
  border-radius: inherit;
  border: 1px solid color-mix(in srgb, var(--clock-b) 28%, transparent);
  box-shadow: inset 0 0 16px color-mix(in srgb, var(--clock-a) 22%, transparent);
  opacity: 0.78;
  animation: deadline-sky-orbit 8s linear infinite;
}

.deadline-clock-sky::after {
  content: "";
  position: absolute;
  left: 12%;
  right: 12%;
  bottom: 9px;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--clock-b) 72%, transparent), transparent);
  opacity: 0.7;
}

.deadline-clock-orb {
  z-index: 1;
  overflow: hidden;
  width: 44px;
  height: 44px;
  transform: translateZ(0);
}

.deadline-clock[data-mode="active"] .deadline-clock-orb {
  background:
    radial-gradient(circle at 30% 28%, rgba(255, 255, 255, 0.9), transparent 17%),
    radial-gradient(circle at 50% 50%, #ffe66c 0 17%, #3de7cd 47%, #159c91 72%, #0a4d4b 100%);
  animation: deadline-sun-breathe 3.8s ease-in-out infinite;
}

.deadline-clock[data-mode="active"] .deadline-clock-orb::before,
.deadline-clock[data-mode="active"] .deadline-clock-orb::after,
.deadline-clock[data-mode="pause"] .deadline-clock-orb::before,
.deadline-clock[data-mode="pause"] .deadline-clock-orb::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.deadline-clock[data-mode="active"] .deadline-clock-orb::before {
  inset: 7px;
  border-radius: inherit;
  background:
    radial-gradient(circle at 44% 44%, rgba(255, 255, 255, 0.95), rgba(255, 231, 110, 0.76) 30%, transparent 62%);
  filter: blur(0.2px);
  opacity: 0.8;
  animation: deadline-sun-core 2.8s ease-in-out infinite;
}

.deadline-clock[data-mode="active"] .deadline-clock-orb::after {
  top: -46%;
  left: -76%;
  width: 58%;
  height: 190%;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.48), transparent);
  transform: rotate(22deg);
  animation: deadline-sun-sweep 4.7s ease-in-out infinite;
}

.deadline-clock[data-mode="pause"] .deadline-clock-sky {
  background:
    radial-gradient(circle at 48% 45%, color-mix(in srgb, #8f7dff 28%, transparent), transparent 50%),
    linear-gradient(145deg, color-mix(in srgb, #111827 80%, transparent), color-mix(in srgb, #070a14 66%, transparent));
}

.deadline-clock[data-mode="pause"] .deadline-clock-orb {
  background:
    radial-gradient(circle at 36% 31%, rgba(255, 255, 255, 0.92), transparent 16%),
    linear-gradient(135deg, #f7edff, #9888ff 52%, #3b2e87 100%);
  animation: deadline-moon-float 4.2s ease-in-out infinite;
}

.deadline-clock[data-mode="pause"] .deadline-clock-orb::before {
  top: -1px;
  right: -8px;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background:
    radial-gradient(circle at 35% 42%, color-mix(in srgb, #111827 78%, #4a3b96), color-mix(in srgb, #070a14 94%, #271e62));
  box-shadow: -8px 6px 13px rgba(15, 18, 38, 0.32);
}

.deadline-clock[data-mode="pause"] .deadline-clock-orb::after {
  inset: 0;
  border-radius: inherit;
  background:
    radial-gradient(circle at 30% 34%, rgba(255, 255, 255, 0.44), transparent 21%),
    radial-gradient(circle at 62% 74%, rgba(255, 255, 255, 0.18), transparent 18%);
  mix-blend-mode: screen;
  animation: deadline-moon-glow 3.8s ease-in-out infinite;
}

.deadline-clock-star {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 999px;
  background: color-mix(in srgb, #fff 86%, var(--clock-b));
  box-shadow: 0 0 10px color-mix(in srgb, var(--clock-b) 76%, transparent);
  opacity: 0.18;
  transform: scale(0.6);
}

.deadline-clock-star-a {
  top: 12px;
  right: 11px;
}

.deadline-clock-star-b {
  left: 10px;
  bottom: 15px;
  width: 3px;
  height: 3px;
}

.deadline-clock-star-c {
  right: 17px;
  bottom: 12px;
  width: 2px;
  height: 2px;
}

.deadline-clock[data-mode="pause"] .deadline-clock-star {
  opacity: 0.9;
  animation: deadline-star-twinkle 2.6s ease-in-out infinite;
}

.deadline-clock[data-mode="pause"] .deadline-clock-star-b {
  animation-delay: 0.5s;
}

.deadline-clock[data-mode="pause"] .deadline-clock-star-c {
  animation-delay: 1.1s;
}

.deadline-clock-side {
  z-index: 1;
  min-width: 0;
  display: grid;
  gap: 5px;
  align-content: center;
  padding-left: 14px;
  border-left: 1px solid color-mix(in srgb, var(--clock-a) 22%, transparent);
}

.deadline-clock-status {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.deadline-clock-status strong {
  color: color-mix(in srgb, var(--clock-b) 88%, var(--text));
  font-size: 14px;
  font-weight: 950;
  line-height: 1;
  text-transform: uppercase;
  text-shadow: 0 0 16px color-mix(in srgb, var(--clock-a) 28%, transparent);
}

.deadline-clock-status small,
.deadline-clock-note,
.deadline-clock-scale {
  color: color-mix(in srgb, var(--muted) 86%, var(--text));
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
}

.deadline-clock-note {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.deadline-clock-dayline {
  position: relative;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background:
    linear-gradient(90deg, rgba(135, 125, 255, 0.22) 0 25%, rgba(63, 226, 201, 0.12) 25% 100%),
    color-mix(in srgb, var(--line) 58%, transparent);
  box-shadow: inset 0 1px 1px color-mix(in srgb, #000 16%, transparent);
}

.deadline-clock-dayline-night {
  position: absolute;
  inset: 0 auto 0 0;
  width: 25%;
  border-radius: inherit;
  background: linear-gradient(90deg, #786bff, #64d8ff);
  opacity: 0.55;
}

.deadline-clock-dayline-progress {
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--day-progress);
  border-radius: inherit;
  background: linear-gradient(90deg, #8f7dff 0 25%, #38e7d0 38%, #f5c542 100%);
  box-shadow: 0 0 12px color-mix(in srgb, var(--clock-a) 52%, transparent);
  transition: width 0.35s ease;
}

.deadline-clock-dayline-marker {
  position: absolute;
  top: 50%;
  left: var(--day-progress);
  width: 12px;
  height: 12px;
  border: 2px solid color-mix(in srgb, #fff 76%, var(--clock-b));
  border-radius: 999px;
  background: color-mix(in srgb, var(--clock-a) 80%, #fff);
  box-shadow: 0 0 16px color-mix(in srgb, var(--clock-a) 64%, transparent);
  transform: translate(-50%, -50%);
  transition: left 0.35s ease;
}

.deadline-clock-scale {
  display: flex;
  justify-content: space-between;
  letter-spacing: 0;
  opacity: 0.78;
}

.toolbar-action-theme .toolbar-action-icon {
  display: inline-grid;
  place-items: center;
  width: 1.15em;
  height: 1.15em;
  border-radius: 999px;
  transform-origin: center;
}

[data-theme="dark"] .toolbar-action-theme .toolbar-action-icon {
  color: #ffe66d;
  text-shadow: 0 0 12px rgba(255, 214, 83, 0.44);
  animation: deadline-theme-sun 5.8s ease-in-out infinite;
}

[data-theme="light"] .toolbar-action-theme .toolbar-action-icon {
  color: #7465ff;
  text-shadow: 0 0 12px rgba(116, 101, 255, 0.36);
  animation: deadline-theme-moon 6.6s ease-in-out infinite;
}

@media (min-width: 1181px) {
  .topbar {
    grid-template-columns: minmax(220px, 0.58fr) minmax(500px, 680px) minmax(40px, 0.2fr);
    min-height: 156px;
  }

  .topbar .deadline-clock {
    justify-self: center;
    width: min(100%, 680px);
    min-width: 500px;
    max-width: 680px;
    min-height: 88px;
    grid-template-columns: 58px minmax(156px, 1fr) minmax(156px, 0.82fr);
    gap: 14px;
    padding: 13px 18px 17px;
  }

  .topbar .deadline-clock::before {
    width: 31%;
  }

  .topbar .deadline-clock-time {
    font-size: clamp(34px, 2.4vw, 43px);
  }
}

@media (min-width: 1181px) and (max-width: 1360px) {
  .topbar {
    grid-template-columns: minmax(205px, 0.52fr) minmax(440px, 560px) minmax(22px, 0.12fr);
    min-height: 154px;
  }

  .topbar .deadline-clock {
    width: min(100%, 560px);
    min-width: 440px;
    max-width: 560px;
    grid-template-columns: 54px minmax(140px, 1fr) minmax(128px, 0.74fr);
    gap: 12px;
    padding-inline: 15px;
  }

  .deadline-clock-sky {
    width: 54px;
    height: 54px;
  }

  .deadline-clock-orb {
    width: 40px;
    height: 40px;
  }

  .deadline-clock-side {
    padding-left: 11px;
  }
}

@media (max-width: 1180px) {
  .deadline-clock-side {
    display: none;
  }
}

@keyframes deadline-sky-orbit {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

@keyframes deadline-sun-breathe {
  0%,
  100% {
    box-shadow:
      0 0 20px color-mix(in srgb, var(--clock-a) 44%, transparent),
      inset 0 1px 1px rgba(255, 255, 255, 0.44);
    transform: scale(1);
  }
  50% {
    box-shadow:
      0 0 30px color-mix(in srgb, var(--clock-b) 58%, transparent),
      inset 0 1px 1px rgba(255, 255, 255, 0.54);
    transform: scale(1.035);
  }
}

@keyframes deadline-sun-core {
  0%,
  100% {
    opacity: 0.68;
    transform: scale(0.96);
  }
  50% {
    opacity: 0.95;
    transform: scale(1.14);
  }
}

@keyframes deadline-sun-sweep {
  0%,
  62% {
    transform: translateX(-120%) rotate(22deg);
    opacity: 0;
  }
  74% {
    opacity: 0.8;
  }
  100% {
    transform: translateX(310%) rotate(22deg);
    opacity: 0;
  }
}

@keyframes deadline-moon-float {
  0%,
  100% {
    transform: translateY(0) rotate(-2deg);
  }
  50% {
    transform: translateY(-2px) rotate(2deg);
  }
}

@keyframes deadline-moon-glow {
  0%,
  100% {
    opacity: 0.52;
  }
  50% {
    opacity: 0.84;
  }
}

@keyframes deadline-star-twinkle {
  0%,
  100% {
    opacity: 0.28;
    transform: scale(0.7);
  }
  50% {
    opacity: 1;
    transform: scale(1.15);
  }
}

@keyframes deadline-theme-sun {
  0%,
  100% {
    transform: rotate(0deg) scale(1);
  }
  50% {
    transform: rotate(14deg) scale(1.06);
  }
}

@keyframes deadline-theme-moon {
  0%,
  100% {
    transform: translateY(0) rotate(-6deg);
  }
  50% {
    transform: translateY(-1px) rotate(7deg);
  }
}

.topbar-center {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(156px, 198px) minmax(0, 1fr);
  gap: 10px;
  align-items: stretch;
}

.topbar-center > .deadline-clock {
  grid-area: auto;
}

.topbar-calendar-widget {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-width: 0;
  min-height: 88px;
  padding: 11px;
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 8px 10px;
  align-items: center;
  border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--line));
  border-radius: 18px;
  background:
    radial-gradient(circle at 18% 18%, color-mix(in srgb, var(--accent) 24%, transparent), transparent 38%),
    linear-gradient(145deg, color-mix(in srgb, var(--surface) 88%, var(--accent) 8%), color-mix(in srgb, var(--surface-2) 82%, #151a18));
  color: var(--text);
  box-shadow:
    0 14px 34px color-mix(in srgb, #000 13%, transparent),
    inset 0 1px 0 color-mix(in srgb, #fff 22%, transparent);
  text-align: left;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

button.topbar-calendar-widget {
  width: 100%;
  cursor: pointer;
}

.topbar-calendar-widget::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(120deg, color-mix(in srgb, #fff 10%, transparent), transparent 42%),
    radial-gradient(circle at 84% 82%, color-mix(in srgb, #f5c542 16%, transparent), transparent 36%);
  opacity: 0.8;
}

.topbar-calendar-widget:hover {
  border-color: color-mix(in srgb, var(--accent) 58%, var(--line));
  box-shadow:
    0 16px 38px color-mix(in srgb, #000 15%, transparent),
    0 0 26px color-mix(in srgb, var(--accent) 18%, transparent),
    inset 0 1px 0 color-mix(in srgb, #fff 26%, transparent);
  transform: translateY(-1px);
}

.topbar-calendar-date {
  min-width: 0;
  height: 54px;
  display: grid;
  place-items: center;
  align-content: center;
  border-radius: 15px;
  background:
    radial-gradient(circle at 50% 38%, color-mix(in srgb, #fff 22%, transparent), transparent 52%),
    linear-gradient(145deg, color-mix(in srgb, var(--accent) 36%, var(--surface)), color-mix(in srgb, #f5c542 28%, var(--surface-2)));
  box-shadow:
    inset 0 1px 0 color-mix(in srgb, #fff 30%, transparent),
    0 0 22px color-mix(in srgb, var(--accent) 24%, transparent);
}

.topbar-calendar-date strong {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 24px;
  line-height: 0.96;
  font-weight: 950;
  font-variant-numeric: tabular-nums;
}

.topbar-calendar-date small {
  color: color-mix(in srgb, var(--text) 74%, var(--muted));
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
}

.topbar-calendar-main {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.topbar-calendar-kicker {
  color: color-mix(in srgb, var(--accent) 88%, var(--text));
  font-size: 10px;
  font-weight: 950;
  line-height: 1;
  text-transform: uppercase;
}

.topbar-calendar-weekday {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  color: color-mix(in srgb, var(--text) 94%, #fff);
  font-size: 15px;
  font-weight: 950;
  line-height: 1.05;
  text-transform: capitalize;
  white-space: nowrap;
}

.topbar-calendar-count {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  line-height: 1.15;
  white-space: nowrap;
}

.topbar-calendar-events {
  grid-column: 1 / -1;
  min-width: 0;
  display: grid;
  gap: 4px;
}

.topbar-calendar-event {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 5px;
  align-items: center;
  padding: 4px 7px;
  border: 1px solid color-mix(in srgb, var(--accent) 34%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 11%, var(--surface));
  font-size: 10px;
  line-height: 1.1;
}

.topbar-calendar-event b,
.topbar-calendar-event span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-calendar-event b {
  color: color-mix(in srgb, var(--accent) 88%, var(--text));
  font-weight: 950;
}

.topbar-calendar-event span {
  color: color-mix(in srgb, var(--text) 82%, var(--muted));
  font-weight: 800;
}

.topbar-calendar-event-warn {
  border-color: color-mix(in srgb, var(--warning) 54%, transparent);
  background: color-mix(in srgb, var(--warning) 13%, var(--surface));
}

.topbar-calendar-event-warn b {
  color: color-mix(in srgb, var(--warning) 88%, var(--text));
}

.topbar-calendar-event-ok {
  border-color: color-mix(in srgb, var(--success) 54%, transparent);
  background: color-mix(in srgb, var(--success) 12%, var(--surface));
}

.topbar-calendar-event-ok b {
  color: color-mix(in srgb, var(--success) 88%, var(--text));
}

.topbar-calendar-event-vacation {
  border-color: color-mix(in srgb, #a855f7 54%, transparent);
  background: color-mix(in srgb, #a855f7 12%, var(--surface));
}

.topbar-calendar-event-vacation b {
  color: color-mix(in srgb, #c084fc 86%, var(--text));
}

.topbar-calendar-event-empty {
  border-style: dashed;
  border-color: color-mix(in srgb, var(--line) 72%, transparent);
  background: color-mix(in srgb, var(--surface) 76%, transparent);
}

.topbar-calendar-event-empty b {
  color: var(--muted);
}

.bot-settings-grid {
  align-items: start;
}

.bot-settings-hero {
  overflow: hidden;
  border-color: color-mix(in srgb, var(--accent) 34%, var(--line));
  background:
    radial-gradient(circle at 10% 15%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 30%),
    linear-gradient(135deg, color-mix(in srgb, var(--surface-2) 88%, var(--accent)), var(--surface));
}

.bot-settings-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.bot-settings-metric {
  min-width: 0;
  padding: 12px;
  border: 1px solid color-mix(in srgb, var(--line) 78%, transparent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
}

.bot-settings-metric span,
.bot-settings-metric small,
.bot-template-code,
.bot-template-head small,
.bot-template-field span,
.bot-template-preview span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.bot-settings-metric strong {
  display: block;
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 18px;
  font-weight: 950;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bot-token-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
}

.bot-token-row code {
  padding: 5px 8px;
  border: 1px solid color-mix(in srgb, var(--accent) 26%, var(--line));
  border-radius: 999px;
  color: color-mix(in srgb, var(--accent) 86%, var(--text));
  background: color-mix(in srgb, var(--accent) 9%, transparent);
  font-size: 12px;
  font-weight: 900;
}

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

.bot-template-card {
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 14px;
  border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--line));
  border-radius: 8px;
  background:
    linear-gradient(150deg, color-mix(in srgb, var(--surface-2) 92%, var(--accent)), var(--surface));
  box-shadow: inset 0 1px 0 color-mix(in srgb, white 9%, transparent);
  transition: border-color .18s ease, opacity .18s ease, transform .18s ease;
}

.bot-template-card:hover {
  border-color: color-mix(in srgb, var(--accent) 54%, var(--line));
  transform: translateY(-1px);
}

.bot-template-card.is-disabled {
  opacity: .68;
}

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

.bot-template-head h3 {
  margin: 3px 0;
  font-size: 18px;
}

.bot-template-field {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.bot-template-field textarea {
  min-height: 88px;
  resize: vertical;
}

.bot-template-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(120px, auto);
  gap: 10px;
  align-items: stretch;
}

.bot-template-pings select {
  min-height: 110px;
}

.bot-template-toggles {
  display: grid;
  gap: 8px;
  align-content: start;
}

.bot-template-toggles label,
.bot-switch {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid color-mix(in srgb, var(--line) 75%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 78%, transparent);
  font-weight: 900;
}

.bot-switch input,
.bot-template-toggles input {
  width: 16px;
  height: 16px;
}

.bot-template-preview {
  min-width: 0;
  padding: 10px 12px;
  border: 1px dashed color-mix(in srgb, var(--accent) 38%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent) 7%, transparent);
}

.bot-template-preview p {
  margin: 3px 0 0;
  white-space: pre-wrap;
}

@media (max-width: 1100px) {
  .bot-settings-metrics,
  .bot-template-grid {
    grid-template-columns: 1fr;
  }

  .bot-template-controls {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .deadline-clock,
  .deadline-clock::before,
  .deadline-clock-sky::before,
  .deadline-clock-orb,
  .deadline-clock-orb::before,
  .deadline-clock-orb::after,
  .deadline-clock-star,
  .toolbar-action-theme .toolbar-action-icon {
    animation: none !important;
    transition: none !important;
  }

  .topbar-calendar-widget {
    transition: none !important;
  }
}

/* Topbar full-width v5: use the whole header lane so search filters stay readable. */
@media (min-width: 1181px) {
  .topbar {
    grid-template-columns: minmax(198px, 0.22fr) minmax(0, 1fr);
    grid-template-areas:
      "title clock"
      "controls controls";
    grid-template-rows: minmax(88px, auto) auto;
    column-gap: clamp(14px, 1.45vw, 22px);
    row-gap: 10px;
    min-height: 164px;
  }

  .topbar-title {
    max-width: min(36ch, 100%);
  }

  .topbar-title p {
    max-width: 32ch;
  }

  .topbar-center {
    grid-area: clock;
    width: 100%;
    justify-self: stretch;
    grid-template-columns: minmax(148px, 182px) minmax(0, 1fr);
    align-items: stretch;
  }

  .topbar .deadline-clock {
    grid-area: auto;
    width: 100%;
    min-width: 0;
    max-width: none;
    justify-self: stretch;
    grid-template-columns: 58px minmax(210px, 0.72fr) minmax(270px, 1fr);
    min-height: 92px;
    padding-bottom: 20px;
  }

  .topbar .deadline-clock-phase {
    left: 18px;
    right: 18px;
    bottom: 9px;
  }

  .topbar .deadline-clock-side {
    grid-template-columns: minmax(132px, 0.42fr) minmax(210px, 1fr);
    gap: 5px 13px;
    align-items: center;
    padding-left: 15px;
  }

  .topbar .deadline-clock-status {
    grid-column: 1;
    grid-row: 1;
  }

  .topbar .deadline-clock-note {
    grid-column: 1;
    grid-row: 2;
  }

  .topbar .deadline-clock-dayline {
    grid-column: 2;
    grid-row: 1;
    align-self: end;
  }

  .topbar .deadline-clock-scale {
    grid-column: 2;
    grid-row: 2;
  }

  .topbar-controls {
    width: 100%;
    justify-self: stretch;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    padding: 7px;
  }

  .toolbar-primary {
    grid-template-columns: minmax(118px, max-content) minmax(0, 1fr) auto;
    gap: 10px;
  }

  .topbar-controls .searchbox {
    min-width: 0;
    grid-template-columns: minmax(156px, 0.24fr) minmax(220px, 1fr) auto;
  }

  .topbar-controls .search-scope-select {
    min-width: 156px;
    padding-right: 30px;
  }

  .topbar-controls .searchbox input {
    min-width: 0;
  }

  .toolbar-actions {
    flex-wrap: nowrap;
  }

  .toolbar-actions .toolbar-action {
    width: auto;
    min-width: 42px;
    padding-inline: 12px;
  }

  .toolbar-actions .toolbar-action-label {
    display: inline;
  }
}

@media (min-width: 1181px) and (max-width: 1360px) {
  .topbar {
    grid-template-columns: minmax(190px, 0.2fr) minmax(0, 1fr);
    min-height: 166px;
  }

  .topbar .deadline-clock {
    grid-template-columns: 54px minmax(190px, 0.66fr) minmax(0, 1fr);
    padding-inline: 16px;
  }

  .topbar-center {
    grid-template-columns: minmax(138px, 168px) minmax(0, 1fr);
    gap: 8px;
  }

  .topbar-calendar-widget {
    padding: 10px;
  }

  .topbar .deadline-clock-side {
    grid-template-columns: minmax(96px, 0.34fr) minmax(0, 1fr);
    gap: 4px 9px;
  }

  .topbar-controls .searchbox {
    grid-template-columns: minmax(150px, 0.24fr) minmax(200px, 1fr) auto;
  }

  .topbar-controls .search-scope-select {
    min-width: 150px;
  }
}

/* Final topbar scroll behavior: the header scrolls with the page instead of sticking. */
.topbar {
  position: relative !important;
  top: auto !important;
}
