:root {
  color-scheme: light;
  --bg: #f6f7f4;
  --surface: #fffdfa;
  --surface-2: #eef2ec;
  --surface-3: #e5f6f1;
  --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;
  --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;
  --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, transform 0.16s ease;
}

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

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

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

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

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

.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;
}

.sidebar-collapse-toggle {
  width: 34px;
  min-height: 34px;
  padding: 0;
}

.brand {
  display: grid;
  gap: 3px;
}

.brand strong {
  font-size: 18px;
  letter-spacing: 0;
}

.brand::before {
  content: "";
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background:
    linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 10px 26px color-mix(in srgb, var(--accent) 30%, transparent);
  grid-row: span 2;
}

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

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

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

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

.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-group-items button {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
}

.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: 74px minmax(0, 1fr);
  }

.sidebar.collapsed {
  padding: 12px 10px;
  gap: 12px;
  overflow-x: visible;
  overflow-y: auto;
}

  .sidebar.collapsed .brand-row {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .sidebar.collapsed .brand {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .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;
  }

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

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

.sidebar.collapsed .nav button {
  width: 44px;
  min-height: 38px;
  padding: 8px;
  justify-content: center;
  overflow: visible;
  position: relative;
}

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

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

.sidebar.collapsed .nav-badge {
  position: absolute;
  top: 0;
  right: 0;
  transform: translate(45%, -45%);
  min-width: 22px;
  height: 20px;
  padding: 0 6px;
  font-size: 11px;
  line-height: 1.2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.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;
  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: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  align-items: center;
  min-width: 0;
}

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

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

.searchbox input {
  grid-column: 1 / -1;
  grid-row: 1;
  padding-right: 42px;
}

.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: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-2) 55%, transparent);
}

.department-toggle button {
  min-height: 30px;
  padding: 0 12px;
  border: 0;
  background: transparent;
  font-weight: 800;
}

.department-toggle button.active {
  background: var(--accent);
  color: var(--surface);
}

.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-voice,
.content-translation,
.content-fixes,
.content-publications,
.content-release-guides,
.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;
}

.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);
}

.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;
}

.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;
  gap: 12px;
}

.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: 2px 2px 2px;
}

.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-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-grid {
  display: grid;
  grid-template-columns: minmax(220px, 320px) minmax(0, 1fr);
  gap: 8px;
  align-items: end;
}

.distribution-load-note {
  min-height: 34px;
  padding: 9px 10px;
  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;
  align-items: center;
  overflow-wrap: anywhere;
}

.distribution-preference-signup {
  display: grid;
  grid-template-columns: minmax(170px, 1.4fr) minmax(130px, 1.15fr) minmax(150px, 1fr) minmax(240px, 1.9fr) auto;
  gap: 8px;
  align-items: end;
}

.distribution-preference-signup .distribution-quick-note {
  min-width: 0;
}

.distribution-quick-comment {
  min-height: 38px;
  max-height: 82px;
  resize: vertical;
}

.distribution-signup-action {
  display: flex;
  align-items: end;
}

.distribution-signup-action .primary {
  width: 100%;
  min-height: 38px;
}

.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;
}

.distribution-overview {
  overflow: hidden;
}

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

.distribution-title-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  overflow: hidden;
  transition: border-color 0.15s ease, box-shadow 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) auto;
  gap: 6px 10px;
  align-items: center;
  justify-content: space-between;
  padding: 7px 9px;
  border-bottom: 1px solid var(--line);
}

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

.distribution-title-toggle {
  width: 28px;
  min-height: 28px;
  padding: 0;
  margin-right: 2px;
}

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

.distribution-title-main strong {
  font-size: 14px;
  line-height: 1.2;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.distribution-title-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 6px;
  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;
  padding: 4px 6px;
  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 {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

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

.distribution-self-panel {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(260px, 1.2fr);
  gap: 8px;
  align-items: center;
  align-content: start;
  padding: 6px 9px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--accent) 7%, 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-end;
}

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

.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: 29px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  cursor: pointer;
  font-weight: 600;
  font-size: 12px;
  list-style: none;
  text-align: center;
}

.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: minmax(120px, 1.1fr) minmax(120px, 1fr) minmax(150px, 1.3fr) minmax(100px, .85fr);
  gap: 6px;
  align-items: center;
  margin-top: 6px;
}

.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(2, minmax(0, 1fr));
  gap: 6px;
  padding: 7px;
}

@media (min-width: 980px) {
  .distribution-overview .distribution-role-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 1220px) {
  .distribution-overview .distribution-role-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

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

.distribution-role-column h4 {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  display: flex;
  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: 32px;
  padding: 4px 6px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 5px;
  align-items: center;
  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: 1px;
}

.distribution-candidate strong {
  font-size: 12px;
  line-height: 1.2;
}

.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-status {
  justify-self: end;
  align-self: start;
}

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

@media (max-width: 760px) {
  .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,
  .distribution-preference-signup {
    grid-template-columns: 1fr;
  }

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

  .distribution-signup-action {
    align-self: stretch;
  }

  .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%;
  }
}

@media (max-width: 900px) and (min-width: 761px) {
  .distribution-preference-signup {
    grid-template-columns: minmax(120px, 1fr) minmax(110px, 1fr);
  }

  .distribution-preference-signup .distribution-signup-action,
  .distribution-quick-comment {
    grid-column: 1 / -1;
  }

  .distribution-preference-signup .distribution-quick-note {
    min-width: 0;
  }
}

.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: 8px;
}

.music-sound-comments article {
  display: grid;
  gap: 4px;
  padding: 8px;
  border-radius: 7px;
  background: color-mix(in srgb, var(--surface) 78%, transparent);
}

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

.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-replies div {
  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;
  resize: vertical;
}

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

.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;
  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%;
}

@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: start;
}

.lyric-preview-shell {
  min-width: 0;
  display: grid;
  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-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 {
  max-height: 360px;
  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-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-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-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-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-messages {
  max-height: 230px;
  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;
}

.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;
}

.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;
}

.team-compact-list {
  display: grid;
  gap: 8px;
}

.team-compact-card {
  display: grid;
  grid-template-columns: minmax(280px, 1.2fr) minmax(220px, 1.2fr) minmax(160px, 0.9fr) minmax(140px, 0.8fr) auto;
  gap: 10px;
  align-items: start;
  min-width: 0;
  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: start;
  justify-self: start;
}

.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: start;
  justify-items: start;
  min-width: 0;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  text-align: left;
  align-content: start;
}

.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-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;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: flex-start;
  align-content: start;
  justify-content: flex-start;
}

.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;
}

.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-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-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);
  }
}

@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;
}

.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);
}

.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));
}

.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;
}

.production-row.collapsed .production-head .inline-actions {
  margin-left: auto;
}

.production-row.collapsed .production-grid,
.production-row.collapsed .workflow-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;
  text-align: center;
}

.production-row.collapsed .production-title-toggle {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  text-align: left;
}

.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(190px, 1fr));
  gap: 8px;
}

.production-stage {
  min-height: 92px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  display: grid;
  align-content: start;
  gap: 7px;
  border-left: 4px solid var(--accent);
}

.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.blocked {
  border-left-color: var(--danger);
}

.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 {
  color: var(--accent-2);
  font-weight: 800;
}

.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;
}

.fix-details-layer {
  z-index: 75;
}

.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);
}

.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;
  gap: 8px;
  padding: 10px 12px 12px;
  overflow: auto;
}

.fix-detail-item {
  display: grid;
  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));
}

.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));
}

.person-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 8px;
}

.person-line {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  min-height: 0;
  min-width: 0;
}

.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 4px 0 0 var(--ok), 0 0 0 1px color-mix(in srgb, var(--ok) 18%, 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 4px 0 0 var(--danger), 0 0 0 1px color-mix(in srgb, var(--danger) 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 4px 0 0 var(--accent);
}

.person-line.blocked {
  border-color: color-mix(in srgb, var(--danger) 45%, var(--line));
}

.person-line.replacement {
  border-style: dashed;
  border-color: color-mix(in srgb, var(--accent-2) 68%, var(--line));
}

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

.person-line.done strong,
.person-line.done .person-state {
  color: var(--ok);
}

.person-line.overdue strong,
.person-line.overdue .person-state {
  color: var(--danger);
}

.person-line span,
.person-line small {
  color: var(--muted);
}

.person-timing {
  display: grid;
  max-width: 100%;
  gap: 2px;
  line-height: 1.35;
}

.person-timing-blocks {
  display: grid;
  gap: 2px;
  max-width: 100%;
}

.person-line .inline-actions {
  justify-content: start;
  margin-top: auto;
  align-items: flex-end;
  gap: 7px;
}

.person-line .inline-actions button {
  min-height: 28px;
  min-width: 90px;
  padding: 0 9px;
}

.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;
  line-height: 1.28;
  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-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 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);
}

.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%;
}

.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 {
  position: relative;
  display: grid;
  min-width: 0;
}

.password-input-wrap input {
  padding-right: 106px;
}

.password-visibility-toggle {
  position: absolute;
  top: 50%;
  right: 6px;
  width: 94px;
  height: 34px;
  min-inline-size: 94px;
  padding: 0 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transform: translateY(-50%);
  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;
}

.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));
}

.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 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-combobox .multi-search {
  position: sticky;
  top: 0;
  z-index: 1;
  width: calc(100% - 16px);
  margin: 8px 8px 0;
}

.multi-combobox .multi-clear {
  width: calc(100% - 16px);
  min-height: 30px;
  margin: 6px 8px 0;
}

.multi-combobox[open] .choice-list {
  max-height: 230px;
  overflow: auto;
  border-top: 0;
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}

.is-hidden {
  display: none;
}

.publication-groups {
  display: grid;
  gap: 14px;
}

.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-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;
}

.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));
}

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: 80;
  max-width: min(300px, calc(100vw - 24px));
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
  white-space: normal;
  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: baseline;
  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;
  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;
  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-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-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 { color: var(--role-super-admin); }
.role-admin { color: var(--role-admin); }
.role-season_curator,
.role-title_curator { color: var(--role-curator); }
.role-dubber { color: var(--role-dubber); }
.role-sound { color: var(--role-sound); }
.role-translator { color: var(--role-translator); }
.role-editor { color: var(--role-editor); }
.role-releaser { color: var(--role-releaser); }
.role-music,
.role-music_releaser { color: var(--role-music); }
.role-music_sound_director { color: var(--role-music-sound); }
.role-vocalist { color: var(--role-vocalist); }
.role-lyricist { color: var(--role-lyricist); }
.role-video_editor { color: var(--role-video); }
.role-tune_timer { color: var(--role-tune); }
.role-beta { color: var(--role-beta); }

.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;
}

.application-open-button {
  width: 100%;
}

.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-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-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-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;
}

.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: 20;
  background: rgba(0, 0, 0, 0.38);
  display: grid;
  place-items: stretch end;
}

.drawer-panel {
  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;
}

.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;
    flex-wrap: wrap;
  }

  .searchbox {
    width: 220px;
    min-width: min(220px, 100%);
  }

  .department-toggle button {
    padding-inline: 10px;
  }

  .toolbar > button {
    padding-inline: 10px;
  }

  .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;
  }

  .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;
  }

  .toolbar {
    width: 100%;
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: auto minmax(180px, 1fr) 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 {
    flex-wrap: wrap;
    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: sticky;
    top: -14px;
    z-index: 1;
    margin: -14px -14px 0;
    padding: 14px;
    background:
      linear-gradient(180deg, color-mix(in srgb, var(--surface) 96%, var(--accent) 4%), var(--surface));
    border-bottom: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
  }

  .brand::before {
    width: 34px;
    height: 34px;
  }

  .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(82px, 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 > button {
    width: 100%;
    min-height: 38px;
    padding-inline: 8px;
  }

  .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;
  }

  .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 {
    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 {
    max-height: min(44vh, 280px);
  }

  .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;
  }

  .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;
  }
}

/* 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;
}

.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;
}

.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: 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-body .lyric-feedback-desk {
  margin-top: 0;
}

@media (min-width: 1180px) {
  .lyric-review-sheet[open] {
    width: min(1460px, calc(100vw - 44px));
    margin-inline: auto;
    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: 2;
    right: 3px;
    bottom: 3px;
    width: 24px;
    height: 24px;
    border: 0;
    background: transparent;
    color: color-mix(in srgb, var(--accent) 72%, var(--text));
    cursor: nwse-resize;
  }

  .floating-tool-resize::before {
    content: "";
    position: absolute;
    inset: 7px 4px 4px 7px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    border-bottom-right-radius: 3px;
    opacity: .82;
  }
}

.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-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));
}

/* 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-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;
}

@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;
  }
}
