:root {
  --bg: #0f0f0f;
  --surface: #181818;
  --surface-2: #272727;
  --surface-3: #202020;
  --text: #f1f1f1;
  --muted: #aaaaaa;
  --line: #303030;
  --line-strong: #3f3f3f;
  --red: #ff0033;
  --red-dark: #cc0029;
  --blue: #3ea6ff;
  --green: #2ba640;
  --amber: #ffb84d;
  --danger: #ff6d6a;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font-family:
    "Yu Gothic UI",
    "Hiragino Kaku Gothic ProN",
    Meiryo,
    system-ui,
    sans-serif;
  letter-spacing: 0;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

button:disabled,
select:disabled,
input:disabled,
textarea:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.icon {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  flex: 0 0 auto;
}

.auth-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background-color: #111111;
  background-image:
    linear-gradient(180deg, rgba(0, 0, 0, 0.18), rgba(0, 0, 0, 0.58)),
    url("assets/login-bg.png");
  background-position: center;
  background-size: cover;
  padding: 28px;
}

.auth-visual {
  display: none;
}

.auth-brand {
  display: grid;
  justify-items: center;
  margin-bottom: 28px;
  text-align: center;
}

.auth-brand > div {
  display: grid;
  gap: 4px;
}

.auth-brand strong {
  color: #111111;
  font-size: 1.16rem;
  font-weight: 800;
}

.auth-brand span {
  color: #4f4f4f;
  font-size: 0.9rem;
  font-weight: 700;
}

.studio-mark {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 1.08rem;
  font-weight: 800;
}

.brand-logo {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border-radius: 50%;
  object-fit: cover;
  background: #000;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.14);
}

.hero-logo {
  width: 96px;
  height: 96px;
}

.auth-visual h1 {
  max-width: 720px;
  margin: 0;
  font-size: clamp(2.8rem, 5vw, 5.2rem);
  font-weight: 800;
  line-height: 1.04;
}

.auth-visual p {
  max-width: 620px;
  margin: 18px 0 0;
  color: rgba(255, 255, 255, 0.76);
  font-size: 1rem;
  line-height: 1.9;
}

.auth-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  max-width: 620px;
}

.metric {
  min-height: 92px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.06);
}

.metric b {
  display: block;
  font-size: 1.8rem;
  line-height: 1;
}

.metric span {
  display: block;
  margin-top: 10px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.85rem;
}

.auth-form-wrap {
  display: grid;
  place-items: center;
  width: min(100%, 460px);
  padding: 0;
}

.auth-card {
  width: min(100%, 430px);
  margin-inline: auto;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  color: #111111;
  padding: 34px;
  box-shadow: 0 20px 80px rgba(0, 0, 0, 0.36);
}

.auth-card h2 {
  margin: 0 0 8px;
  font-size: 1.45rem;
  font-weight: 700;
  text-align: center;
}

.auth-submit {
  width: min(100%, 220px);
  justify-self: center;
}

.auth-card .subtle {
  margin: 0 0 24px;
  color: #6a6a6a;
  text-align: center;
}

.auth-card .field label,
.auth-card .field-title {
  color: #222222;
}

.auth-card .input {
  border-color: #d6d6d6;
  background: #ffffff;
  color: #111111;
}

.auth-card .input:focus {
  border-color: #3ea6ff;
  box-shadow: 0 0 0 1px #3ea6ff;
}

.auth-card .secondary-btn {
  border-color: #d6d6d6;
  background: #ffffff;
  color: #111111;
}

.form-error {
  border: 1px solid rgba(255, 109, 106, 0.35);
  border-radius: 6px;
  background: rgba(255, 109, 106, 0.12);
  color: #ffb8b6;
  padding: 10px 12px;
  margin-bottom: 14px;
  font-size: 0.88rem;
  font-weight: 700;
}

.field-stack {
  display: grid;
  gap: 16px;
}

.field {
  display: grid;
  gap: 7px;
}

.field label,
.check-row span,
.field-title {
  color: var(--text);
  font-size: 0.84rem;
  font-weight: 700;
}

.input,
.select,
.textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: #121212;
  color: var(--text);
  padding: 9px 11px;
  outline: none;
}

.textarea {
  min-height: 150px;
  resize: vertical;
  line-height: 1.7;
}

.input:focus,
.select:focus,
.textarea:focus,
.compact-input:focus,
.compact-select:focus,
.compact-date:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 1px var(--blue);
}

.check-row {
  display: flex;
  align-items: center;
  gap: 9px;
}

.check-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--red);
}

.primary-btn,
.secondary-btn,
.ghost-btn,
.logout-btn,
.icon-only,
.danger-btn {
  min-height: 38px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  white-space: nowrap;
  font-weight: 700;
}

.primary-btn {
  background: var(--blue);
  color: #fff;
}

.primary-btn:hover {
  background: #004eb8;
}

.auth-card .auth-submit {
  background: #4a4a4a;
  color: #ffffff;
}

.auth-card .auth-submit:hover {
  background: #363636;
}

.secondary-btn {
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--text);
}

.secondary-btn:hover,
.ghost-btn:hover,
.icon-only:hover {
  background: var(--surface-2);
}

.logout-btn {
  min-width: auto;
  min-height: 34px;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  padding: 0 12px;
  font-size: 0.82rem;
  font-weight: 800;
}

.logout-btn:hover {
  background: var(--surface-2);
  color: var(--text);
}

.logout-btn:active {
  color: var(--danger);
}

.ghost-btn,
.icon-only {
  background: transparent;
  color: var(--text);
}

.icon-only {
  width: 40px;
  padding: 0;
  border-radius: 50%;
}

.danger-btn {
  background: rgba(197, 34, 31, 0.1);
  color: var(--danger);
}

.danger-btn:hover {
  background: rgba(255, 109, 106, 0.18);
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.role-picker {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface-2);
  padding: 4px;
}

.role-picker button {
  border-radius: 3px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
}

.role-picker button.active {
  background: #383838;
  color: var(--text);
  box-shadow: var(--shadow);
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 12px 12px 16px;
  border-right: 1px solid var(--line);
  background: #0f0f0f;
  color: var(--text);
}

.brand {
  min-height: 58px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 10px;
  font-size: 1.15rem;
}

.brand strong {
  display: block;
  font-weight: 800;
}

.channel-card {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 10px 10px 16px;
  border-bottom: 1px solid var(--line);
}

.avatar-button {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: transparent;
  padding: 0;
}

.avatar-button:hover .avatar {
  box-shadow: 0 0 0 2px var(--blue);
}

.avatar {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #1a73e8;
  color: #fff;
  font-weight: 800;
  overflow: hidden;
  transition:
    box-shadow 140ms ease,
    filter 140ms ease;
}

.avatar.custom {
  background: var(--surface-2);
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mini-avatar {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background: #1a73e8;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 900;
  overflow: hidden;
}

.mini-avatar.custom {
  background: var(--surface-2);
}

.mini-avatar.unassigned {
  background: var(--surface-2);
  color: var(--muted);
}

.mini-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.assignee-inline {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  vertical-align: middle;
}

.assignee-inline > span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.channel-card strong,
.channel-card span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.nav button {
  min-height: 42px;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: center;
  gap: 18px;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  text-align: left;
  padding: 0 12px;
  font-size: 0.93rem;
}

.nav button.active,
.nav button:hover {
  background: var(--surface-2);
  font-weight: 800;
}

.nav button.active {
  color: var(--red);
}

.nav button span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-settings {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.settings-button {
  width: 100%;
  min-height: 42px;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: center;
  gap: 18px;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  text-align: left;
  padding: 0 12px;
  font-size: 0.93rem;
  font-weight: 800;
}

.settings-button:hover {
  background: var(--surface-2);
  color: var(--text);
}

.main {
  min-width: 0;
  display: grid;
  grid-template-rows: 64px minmax(0, 1fr);
}

.topbar {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  padding: 0 20px;
  border-bottom: 1px solid var(--line);
  background: #0f0f0f;
  position: sticky;
  top: 0;
  z-index: 5;
}

.topbar-left {
  min-width: 0;
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  gap: 14px;
}

.subtle {
  color: var(--muted);
  font-size: 0.86rem;
}

.topbar-tools {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar-mobile-account {
  display: none;
  min-width: 0;
  align-items: center;
  gap: 10px;
}

.topbar-mobile-account span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 800;
}

.role-toggle {
  display: flex;
  gap: 2px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface-3);
  padding: 3px;
}

.role-toggle button {
  min-height: 30px;
  border-radius: 3px;
  padding: 0 10px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
}

.role-toggle button.active {
  background: #383838;
  color: var(--text);
  box-shadow: var(--shadow);
}

.account-pill {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--muted);
  padding: 0 12px;
  font-size: 0.82rem;
  font-weight: 800;
}

.content {
  position: relative;
  min-width: 0;
  padding: 28px 32px 40px;
}

.content-page {
  animation: content-fade-in 180ms ease both;
}

.content-page-ghost {
  position: absolute;
  top: 28px;
  right: 32px;
  left: 32px;
  z-index: 2;
  pointer-events: none;
  animation: content-fade-out 180ms ease both;
}

@keyframes content-fade-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes content-fade-out {
  from {
    opacity: 1;
    transform: translateY(0);
  }

  to {
    opacity: 0;
    transform: translateY(-4px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .content-page,
  .toast,
  .button-spinner {
    animation: none;
  }
}

.page-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}

.page-head h2 {
  margin: 0 0 6px;
  font-size: 1.62rem;
  line-height: 1.25;
  font-weight: 700;
}

.studio-tabs {
  display: flex;
  align-items: center;
  gap: 26px;
  min-height: 44px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.studio-tabs button {
  position: relative;
  align-self: stretch;
  background: transparent;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 800;
  padding: 0 0 12px;
}

.studio-tabs button.active {
  color: var(--text);
}

.studio-tabs button.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 3px;
  background: var(--text);
}

.studio-tabs .account-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

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

.studio-upload-grid {
  align-items: stretch;
}

.register-grid {
  grid-template-columns: minmax(300px, 480px);
}

.split-grid {
  display: grid;
  grid-template-columns: minmax(360px, 0.78fr) minmax(420px, 1.22fr);
  gap: 18px;
  align-items: start;
}

.assigned-grid {
  min-height: 560px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  overflow: hidden;
}

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

.panel-head h3 {
  margin: 0;
  font-size: 1rem;
  line-height: 1.25;
  font-weight: 700;
}

.panel-body {
  padding: 16px;
}

.table-filter {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  border-radius: 4px;
  background: transparent;
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 800;
  padding: 0 10px;
}

.table-filter:hover {
  background: var(--surface-2);
}

.filter-panel {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 12px;
  border-bottom: 1px solid var(--line);
  background: #121212;
  padding: 14px 16px;
}

.filter-actions {
  align-content: end;
}

.stat-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.stat-item {
  min-height: 88px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 14px;
}

.stat-item span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.stat-item b {
  display: block;
  margin-top: 10px;
  font-size: 1.65rem;
  font-weight: 500;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1160px;
}

.studio-table {
  background: var(--surface);
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 10px 14px;
  text-align: left;
  vertical-align: middle;
  color: var(--text);
  font-size: 0.88rem;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
}

tbody tr {
  height: 76px;
}

tr:hover td {
  background: #202020;
}

tr.selected td {
  background: rgba(62, 166, 255, 0.14);
}

.mini-table {
  min-width: 760px;
}

.mini-table tbody tr {
  height: 68px;
}

.log-table {
  min-width: 980px;
}

.log-table tbody tr {
  height: 58px;
}

.log-result {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 46px;
  min-height: 24px;
  border-radius: 999px;
  padding: 0 10px;
  font-size: 0.76rem;
  font-weight: 800;
}

.log-result.success {
  background: rgba(43, 166, 64, 0.14);
  color: #67d27c;
}

.log-result.failed {
  background: rgba(255, 109, 106, 0.14);
  color: var(--danger);
}

.mini-table th,
.mini-table td {
  font-size: 0.83rem;
}

.archive-list-table {
  min-width: 980px;
}

.archive-list-table tbody tr {
  cursor: pointer;
}

.compact-input,
.compact-select,
.compact-date {
  min-height: 34px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #121212;
  color: var(--text);
  padding: 5px 7px;
  outline: none;
}

.assignee-control {
  min-width: 170px;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
}

.title-cell {
  min-width: 360px;
}

.readonly-title {
  min-width: 280px;
}

.video-cell {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}

.thumbnail {
  width: 112px;
  aspect-ratio: 16 / 9;
  display: grid;
  place-items: center;
  border-radius: 4px;
  overflow: hidden;
  color: #fff;
  font-weight: 900;
  background:
    linear-gradient(135deg, rgba(0, 0, 0, 0.15), rgba(0, 0, 0, 0.45)),
    #333;
}

.thumbnail.minecraft {
  background:
    linear-gradient(135deg, rgba(15, 132, 57, 0.7), rgba(35, 35, 35, 0.72)),
    #1c7c3d;
}

.thumbnail.steam {
  background:
    linear-gradient(135deg, rgba(18, 78, 143, 0.82), rgba(18, 18, 18, 0.72)),
    #124e8f;
}

.thumbnail.sponsor {
  background:
    linear-gradient(135deg, rgba(176, 96, 0, 0.82), rgba(18, 18, 18, 0.72)),
    #b06000;
}

.thumbnail.other {
  background:
    linear-gradient(135deg, rgba(96, 96, 96, 0.82), rgba(18, 18, 18, 0.72)),
    #606060;
}

.thumbnail span {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 2px solid rgba(255, 255, 255, 0.85);
  border-radius: 50%;
  font-size: 0.9rem;
}

.thumbnail.custom {
  background: #000;
}

.thumbnail.custom img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.video-copy {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.video-copy strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
}

.video-meta,
.project-row .meta {
  color: var(--muted);
  font-size: 0.78rem;
}

.title-edit {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto;
  align-items: center;
  gap: 7px;
}

.title-copy-stack {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.thumbnail-uploader {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #121212;
  padding: 14px;
}

.thumbnail-uploader .thumbnail {
  width: 180px;
}

.upload-copy {
  min-width: 0;
  display: grid;
  gap: 8px;
}

.upload-copy strong {
  color: var(--text);
}

.file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.avatar-file-input {
  display: none;
}

.file-label.disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.title-input:disabled {
  border-color: transparent;
  background: transparent;
  color: var(--text);
  opacity: 1;
  font-weight: 700;
  padding-left: 0;
}

.compact-action {
  min-height: 32px;
  align-self: center;
  padding-inline: 10px;
}

.status-chip,
.share-chip,
.category-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 0.76rem;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.status-chip.todo {
  background: #303030;
  color: #d0d0d0;
}

.status-chip.progress {
  background: rgba(62, 166, 255, 0.16);
  color: var(--blue);
}

.status-chip.hold {
  background: rgba(255, 184, 77, 0.16);
  color: var(--amber);
}

.status-chip.done {
  background: rgba(43, 166, 64, 0.16);
  color: var(--green);
}

.share-chip.shared {
  background: rgba(43, 166, 64, 0.16);
  color: var(--green);
}

.share-chip.missing {
  background: rgba(255, 109, 106, 0.16);
  color: var(--danger);
}

.share-chip.none {
  background: #303030;
  color: #d0d0d0;
}

.category-chip.minecraft {
  background: rgba(43, 166, 64, 0.16);
  color: var(--green);
}

.category-chip.steam {
  background: rgba(62, 166, 255, 0.16);
  color: var(--blue);
}

.category-chip.sponsor {
  background: rgba(255, 184, 77, 0.16);
  color: var(--amber);
}

.category-chip.other {
  background: #303030;
  color: #d0d0d0;
}

.list {
  display: grid;
  gap: 8px;
}

.project-row {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 10px;
  text-align: left;
}

.project-row .video-cell {
  grid-template-columns: 96px minmax(0, 1fr);
}

.project-row .thumbnail {
  width: 96px;
}

.project-row:hover,
.project-row.selected {
  border-color: var(--line-strong);
  background: #202020;
}

.project-row.selected {
  box-shadow: inset 4px 0 0 var(--red);
}

.project-row strong {
  display: block;
  overflow-wrap: anywhere;
}

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

.project-row .meta .assignee-inline {
  color: var(--text);
}

.detail-title {
  min-width: 0;
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}

.detail-title h3 {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-bottom: 8px;
}

.detail-assignee-line {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  line-height: 1.35;
}

.detail-assignee-line .assignee-inline {
  gap: 8px;
}

.detail-head-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.close-detail {
  border: 1px solid var(--line);
  color: var(--muted);
}

.close-detail:hover {
  color: var(--text);
  background: var(--surface-2);
}

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

.detail-grid .wide {
  grid-column: 1 / -1;
}

.metric-field,
.history-field {
  width: min(100%, 680px);
}

.detail-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 2px;
}

.bars {
  display: grid;
  gap: 12px;
}

.bar-row {
  display: grid;
  grid-template-columns: 96px minmax(120px, 1fr) 54px;
  align-items: center;
  gap: 10px;
}

.bar-label {
  color: var(--text);
  font-size: 0.84rem;
  font-weight: 800;
}

.bar-track {
  height: 18px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  min-width: 3px;
  border-radius: inherit;
  background: var(--blue);
}

.bar-fill.todo {
  background: #808080;
}

.bar-fill.progress {
  background: var(--blue);
}

.bar-fill.done {
  background: var(--green);
}

.donut-chart-wrap {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  align-items: center;
  gap: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #121212;
  padding: 16px;
}

.donut-chart {
  width: 160px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.donut-chart > div {
  width: 84px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  align-content: center;
  border-radius: 50%;
  background: var(--surface);
  color: var(--text);
}

.donut-chart strong {
  font-size: 1.55rem;
  line-height: 1;
}

.donut-chart span {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.donut-legend {
  display: grid;
  gap: 8px;
}

.legend-row {
  min-height: 34px;
  display: grid;
  grid-template-columns: 12px minmax(72px, 1fr) 54px 48px;
  align-items: center;
  gap: 9px;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  font-size: 0.86rem;
}

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

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.legend-row strong,
.legend-row em {
  text-align: right;
}

.legend-row em {
  color: var(--muted);
  font-style: normal;
}

.history-log {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #121212;
  overflow: hidden;
}

.history-log summary {
  min-height: 46px;
  display: flex;
  align-items: center;
  cursor: pointer;
  color: var(--text);
  font-weight: 800;
  padding: 0 14px;
}

.history-list {
  display: grid;
  border-top: 1px solid var(--line);
}

.history-row {
  display: grid;
  grid-template-columns: 116px 168px minmax(176px, 1fr) 54px;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  padding: 10px 14px;
  color: var(--muted);
  font-size: 0.86rem;
}

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

.history-row strong {
  color: var(--text);
}

.history-row em {
  color: var(--text);
  font-style: normal;
  text-align: right;
}

.empty-state {
  min-height: 170px;
  display: grid;
  place-items: center;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
  padding: 24px;
}

.notice {
  border-left: 4px solid var(--amber);
  background: rgba(255, 184, 77, 0.12);
  color: var(--amber);
  padding: 11px 13px;
  border-radius: 4px;
  font-size: 0.88rem;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.68);
  padding: 24px;
}

.confirm-modal {
  width: min(100%, 440px);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  padding: 22px;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.42);
}

.confirm-modal h2 {
  margin: 0 0 10px;
  font-size: 1.18rem;
}

.confirm-modal p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.settings-modal {
  width: min(100%, 460px);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  padding: 22px;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.42);
}

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

.settings-modal-head h2 {
  margin: 0;
  font-size: 1.12rem;
}

.settings-form {
  display: grid;
  gap: 18px;
}

.settings-profile {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  align-items: center;
  gap: 18px;
}

.settings-fields {
  display: grid;
  gap: 14px;
}

.settings-avatar-button {
  display: grid;
  justify-items: center;
  gap: 8px;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  padding: 8px;
  font-size: 0.78rem;
  font-weight: 800;
}

.settings-avatar-button:hover {
  background: var(--surface-2);
  color: var(--text);
}

.settings-avatar-button .avatar {
  width: 66px;
  height: 66px;
}

.avatar-modal {
  width: min(100%, 420px);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  padding: 20px;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.42);
}

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

.avatar-modal-head h2 {
  margin: 0;
  font-size: 1.08rem;
}

.avatar-cropper {
  position: relative;
  width: 280px;
  height: 280px;
  max-width: 100%;
  overflow: hidden;
  border-radius: 8px;
  background: #0b0b0b;
  margin: 0 auto 18px;
  cursor: grab;
  touch-action: none;
}

.avatar-cropper:active {
  cursor: grabbing;
}

.avatar-crop-image {
  position: absolute;
  top: 50%;
  left: 50%;
  max-width: none;
  object-fit: cover;
  pointer-events: none;
  user-select: none;
}

.avatar-crop-ring {
  position: absolute;
  inset: 0;
  border: 2px solid rgba(255, 255, 255, 0.88);
  border-radius: 50%;
  box-shadow: 0 0 0 999px rgba(0, 0, 0, 0.46);
  pointer-events: none;
}

.range-field {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.range-field input {
  width: 100%;
  accent-color: var(--blue);
}

.modal-actions {
  justify-content: end;
  margin-top: 20px;
}

.toast {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 30;
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  max-width: min(420px, calc(100vw - 36px));
  border: 1px solid rgba(43, 166, 64, 0.42);
  border-radius: 8px;
  background: #123017;
  color: #d8f7de;
  padding: 10px 14px;
  font-size: 0.9rem;
  font-weight: 800;
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.38);
  animation: toast-in 180ms ease both;
}

.toast.error {
  border-color: rgba(255, 109, 106, 0.42);
  background: #361616;
  color: #ffcecc;
}

.save-btn {
  min-width: 100px;
}

.button-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 720ms linear infinite;
}

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

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .toast,
  .button-spinner {
    animation: none;
  }
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 92px minmax(0, 1fr);
  }

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

  .sidebar {
    position: sticky;
    height: 100vh;
    padding: 10px 8px;
    gap: 10px;
  }

  .brand {
    justify-content: center;
    min-height: 58px;
    padding: 0;
  }

  .brand-logo {
    width: 46px;
    height: 46px;
  }

  .brand strong,
  .channel-card > div {
    display: none;
  }

  .channel-card {
    display: flex;
    justify-content: center;
    padding: 8px 0 12px;
  }

  .nav {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .nav button {
    min-height: 72px;
    grid-template-columns: 1fr;
    grid-template-rows: 24px auto;
    justify-items: center;
    gap: 6px;
    padding: 8px 4px;
    text-align: center;
    font-size: 0.72rem;
  }

  .sidebar-settings {
    padding-top: 10px;
  }

  .settings-button {
    min-height: 62px;
    grid-template-columns: 1fr;
    grid-template-rows: 22px auto;
    justify-items: center;
    gap: 5px;
    padding: 7px 4px;
    text-align: center;
    font-size: 0.68rem;
  }

  .topbar {
    position: sticky;
  }
}

@media (max-width: 760px) {
  .auth-screen {
    grid-template-columns: 1fr;
  }

  .auth-form-wrap,
  .auth-visual,
  .content {
    padding: 20px;
  }

  .content-page-ghost {
    top: 20px;
    right: 20px;
    left: 20px;
  }

  .app-shell {
    grid-template-columns: 78px minmax(0, 1fr);
  }

  .sidebar {
    padding-inline: 6px;
  }

  .nav button {
    min-height: 68px;
    font-size: 0.68rem;
  }

  .settings-button {
    min-height: 58px;
    font-size: 0.66rem;
  }

  .auth-metrics,
  .stat-strip,
  .detail-grid,
  .filter-panel {
    grid-template-columns: 1fr;
  }

  .topbar {
    min-height: auto;
    align-items: stretch;
    flex-direction: column;
    padding: 12px;
  }

  .topbar-left,
  .topbar-tools,
  .page-head {
    align-items: stretch;
    flex-direction: column;
  }

  .role-toggle {
    width: 100%;
  }

  .role-toggle button {
    flex: 1;
  }

  .nav {
    grid-template-columns: 1fr;
  }

  .studio-tabs {
    gap: 18px;
    overflow-x: auto;
  }

  .video-cell,
  .detail-title {
    grid-template-columns: 96px minmax(0, 1fr);
  }

  .thumbnail,
  .detail-title .thumbnail {
    width: 96px;
  }

  .thumbnail-uploader {
    grid-template-columns: 1fr;
  }

  .thumbnail-uploader .thumbnail {
    width: min(100%, 260px);
  }

  .donut-chart-wrap {
    grid-template-columns: 1fr;
  }

  .donut-chart {
    width: min(100%, 160px);
    justify-self: center;
  }

  .history-row {
    grid-template-columns: 1fr;
  }

  .history-row em {
    text-align: left;
  }

  .bar-row {
    grid-template-columns: 74px minmax(90px, 1fr) 46px;
  }
}

@media (max-width: 640px) {
  body {
    min-width: 320px;
  }

  .auth-screen {
    padding: 18px;
    background-position: center top;
  }

  .auth-card {
    padding: 26px 22px;
  }

  .hero-logo {
    width: 88px;
    height: 88px;
  }

  .app-shell {
    display: block;
    min-height: 100vh;
  }

  .main {
    min-height: 100vh;
    display: block;
    padding-bottom: 78px;
  }

  .sidebar {
    position: fixed;
    inset: auto 0 0;
    z-index: 18;
    height: 74px;
    display: flex;
    flex-direction: row;
    align-items: center;
    padding: 5px 6px calc(5px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    border-right: 0;
    overflow-x: auto;
  }

  .brand,
  .channel-card {
    display: none;
  }

  .nav {
    width: auto;
    flex: 1 1 0;
    display: flex;
    justify-content: space-around;
    gap: 2px;
  }

  .nav button {
    width: auto;
    min-height: 60px;
    min-width: 48px;
    flex: 1 1 0;
    border-radius: 8px;
    grid-template-columns: 1fr;
    grid-template-rows: 22px auto;
    justify-items: center;
    gap: 4px;
    padding: 7px 3px;
    font-size: 0.6rem;
  }

  .sidebar-settings {
    order: -1;
    flex: 0 0 48px;
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
  }

  .settings-button {
    width: 48px;
    min-height: 60px;
    border-radius: 8px;
    padding: 7px 3px;
    font-size: 0.62rem;
  }

  .nav .icon {
    width: 19px;
    height: 19px;
  }

  .topbar {
    min-height: 58px;
    position: sticky;
    top: 0;
    align-items: center;
    flex-direction: row;
    padding: 8px 12px;
  }

  .topbar-tools {
    width: 100%;
    flex-direction: row;
    align-items: center;
  }

  .topbar-mobile-account {
    display: flex;
    flex: 1 1 auto;
  }

  .topbar-mobile-account .avatar,
  .topbar-mobile-account .avatar-button {
    width: 36px;
    height: 36px;
  }

  .account-pill {
    display: none;
  }

  .logout-btn {
    min-height: 34px;
    padding-inline: 10px;
  }

  .content {
    padding: 16px 14px 20px;
  }

  .content-page-ghost {
    top: 16px;
    right: 14px;
    left: 14px;
  }

  .page-head h2 {
    font-size: 1.35rem;
  }

  .panel-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .table-wrap {
    width: calc(100% + 28px);
    margin-inline: -14px;
  }

  .studio-table {
    min-width: 920px;
  }

  .mini-table {
    min-width: 820px;
  }

  .log-table {
    min-width: 860px;
  }

  .video-cell,
  .detail-title {
    grid-template-columns: 82px minmax(0, 1fr);
  }

  .thumbnail,
  .detail-title .thumbnail {
    width: 82px;
  }

  .project-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    justify-items: stretch;
  }

  .project-row .status-chip {
    justify-self: start;
  }

  .settings-modal,
  .avatar-modal,
  .confirm-modal {
    padding: 16px;
  }

  .settings-profile {
    grid-template-columns: 1fr;
  }

  .settings-avatar-button {
    justify-self: center;
    width: 120px;
  }

  .modal-backdrop {
    padding: 12px;
  }

  .avatar-cropper {
    width: min(280px, calc(100vw - 56px));
    height: min(280px, calc(100vw - 56px));
  }

  .toast {
    top: 10px;
    right: 10px;
    left: 10px;
    max-width: none;
  }
}
