:root {
  --canvas: #2c2c2e;
  --surface: rgba(58, 58, 60, 0.82);
  --elevated: #3a3a3c;
  --fill: #363638;
  --ink: #f2f2f3;
  --on-ink: #1c1c1e;
  --body: #c7c7cc;
  --muted: #8e8e93;
  --line: rgba(255, 255, 255, 0.08);
  --warm: #444446;
  --mint: #4a5560;
  --peach: #4a4548;
  --lavender: #3f3f48;
  --delay: #e08a6a;
  --ok: #7dcea0;
  --ok-strong: #3d9a68;
  --shadow: 0 1px 1px rgba(0, 0, 0, 0.18), 0 18px 40px rgba(0, 0, 0, 0.22);
  --font: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  --display: "Newsreader", "Times New Roman", serif;
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  position: relative;
  overflow-x: hidden;
  padding: 22px 28px 32px;
  font-family: var(--font);
  font-size: 15px;
  letter-spacing: 0.01em;
  color: var(--ink);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
}

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

button {
  cursor: pointer;
}

.orbs {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

.orb {
  position: absolute;
  width: 520px;
  height: 520px;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.28;
}

.orb-mint {
  top: -180px;
  right: 8%;
  background: var(--mint);
}

.orb-peach {
  top: 40px;
  left: -140px;
  background: var(--peach);
}

.orb-lavender {
  bottom: -200px;
  right: -80px;
  background: var(--lavender);
}

.nav,
.board,
.login,
.empty-board,
.jobs-view {
  position: relative;
  z-index: 1;
}

.login {
  display: grid;
  min-height: calc(100vh - 54px);
  place-items: center;
}

.login[hidden],
#app[hidden] {
  display: none !important;
}

.login-card,
.sheet,
.player-sheet,
.pipeline {
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px);
}

.login-card {
  width: min(360px, 100%);
  padding: 28px 24px 24px;
  border-radius: 20px;
}

.brand h1 {
  margin: 0;
  font-family: var(--display);
  font-weight: 300;
  letter-spacing: -0.045em;
  line-height: 1.02;
}

.login-card label,
.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 13px;
}

.login-card input,
.sheet input,
.sheet select,
.user-form input,
.user-form select {
  height: 46px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--fill);
  color: var(--ink);
  outline: none;
}

.login-card input:focus,
.sheet input:focus,
.sheet select:focus,
.assignee-select:focus {
  border-color: rgba(255, 255, 255, 0.28);
}

.btn-full {
  width: 100%;
  margin-top: 8px;
}

.form-error {
  margin: 0 0 12px;
  color: var(--delay);
  font-size: 13px;
}

.sheet,
.player-sheet {
  width: min(560px, calc(100% - 32px));
  padding: 26px;
  border-radius: 26px;
  background: var(--elevated);
}

.player-sheet {
  width: min(860px, calc(100% - 32px));
}

.sheet::backdrop,
.player-sheet::backdrop {
  background: rgba(0, 0, 0, 0.55);
}

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

.sheet h2,
.player-sheet h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 30px;
  font-weight: 300;
  letter-spacing: -0.03em;
}

.player-sheet video,
.player-sheet iframe {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
  border-radius: 18px;
  background: #1c1c1e;
}

.player-sheet iframe[hidden],
.player-sheet video[hidden] {
  display: none;
}

.users-sheet {
  width: min(640px, calc(100% - 32px));
}

.users-sheet .sheet-head {
  align-items: flex-start;
}

.user-list,
.log-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 340px;
  overflow: auto;
  padding-right: 4px;
}

.log-list {
  gap: 0;
  max-height: 460px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.user-card {
  padding: 14px 16px 16px;
  border-radius: 18px;
  background: var(--fill);
}

.user-card-top {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) 148px auto;
  gap: 10px;
  align-items: center;
}

.avatar {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: var(--warm);
  font-size: 14px;
  font-weight: 500;
}

.user-id strong {
  display: block;
  font-size: 14px;
  font-weight: 500;
}

.user-id span,
.access-note,
.log-item time,
.log-empty {
  color: var(--muted);
  font-size: 12px;
}

.user-card .role-select {
  height: 36px;
  padding: 0 10px;
  border: 0;
  border-radius: 10px;
  background: var(--warm);
  font-size: 13px;
  outline: none;
}

.access-note {
  margin: 10px 0 0 46px;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 0 46px;
}

.chip {
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--body);
  font-size: 12px;
}

.chip.is-on {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--on-ink);
}

.user-form {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.user-form .chip-row {
  display: none;
}

.log-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px 12px;
  align-items: baseline;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.log-filter-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 10px;
}

.log-filter-row label {
  color: var(--muted);
  font-size: 12px;
}

.log-filter-row select {
  height: 32px;
  min-width: 170px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--fill);
  color: var(--ink);
}

.log-item p {
  margin: 0;
  font-weight: 500;
  line-height: 1.45;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 12px;
}

.user-form .btn {
  margin-top: 4px;
}

#admin-password-form {
  margin-top: 14px;
}

.nav {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  padding: 4px 4px 18px;
}

.brand h1 {
  font-size: 40px;
}

.nav-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.session-chip {
  margin: 0 8px 0 0;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--fill);
  color: var(--body);
  font-size: 13px;
}

.btn {
  height: 38px;
  padding: 0 16px;
  border-radius: 999px;
  transition: transform 0.16s ease, background 0.16s ease, opacity 0.16s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-ink {
  border: 0;
  background: var(--ink);
  color: var(--on-ink);
}

.btn-ghost {
  border: 1px solid var(--line);
  background: var(--fill);
  color: var(--ink);
}

.btn-ghost:hover {
  background: var(--elevated);
}

.btn-has-alert {
  position: relative;
}

.btn-has-alert::after {
  content: "";
  position: absolute;
  top: 6px;
  right: 9px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ff4d4f;
  box-shadow: 0 0 0 2px var(--fill);
}

.empty-board {
  display: grid;
  min-height: 40vh;
  place-items: center;
  color: var(--muted);
  font-family: var(--display);
  font-size: 28px;
  font-weight: 300;
}

.empty-board[hidden] {
  display: none;
}

.board {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(300px, 1fr);
  gap: 14px;
  min-height: calc(100vh - 150px);
  padding-bottom: 8px;
  overflow-x: auto;
}

.pipeline {
  display: flex;
  flex-direction: column;
  min-width: 300px;
  max-height: calc(100vh - 150px);
  padding: 16px 12px 12px;
  border-radius: 22px;
}

.pipeline.is-ready {
  background: rgba(255, 255, 255, 0.04);
}

.pipeline-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 2px 8px 12px;
}

.pipeline-name {
  margin: 0;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.02em;
}

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

.dropzone {
  display: grid;
  place-items: center;
  min-height: 48px;
  margin: 0 4px 10px;
  border: 1px dashed rgba(255, 255, 255, 0.16);
  border-radius: 14px;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
}

.dropzone:hover,
.dropzone.active {
  border-color: var(--ink);
  background: var(--fill);
  color: var(--ink);
}

.clip-list {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 6px;
  min-height: 0;
  overflow: auto;
  padding: 0 4px 4px;
}

.clip-list::-webkit-scrollbar {
  width: 8px;
}

.clip-list::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  background-clip: padding-box;
}

.column-empty {
  margin: auto;
  padding: 28px 8px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.clip {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 9px 8px 9px 9px;
  border-radius: 14px;
  background: var(--fill);
  transition: background 0.16s ease, transform 0.16s ease;
}

.clip:hover {
  background: var(--elevated);
}

.clip.delayed {
  box-shadow: inset 2px 0 0 var(--delay);
}

.clip-preview {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0 0 0 2px;
  border: 0;
  border-radius: 11px;
  background: var(--warm);
  color: var(--ink);
}

.clip-preview:hover {
  background: var(--ink);
  color: var(--on-ink);
}

.clip-preview .icon-check {
  display: none;
}

.clip.is-done .clip-preview {
  padding: 0;
  background: rgba(125, 206, 160, 0.16);
  color: var(--ok);
}

.clip.is-done .clip-preview:hover {
  background: var(--ok-strong);
  color: #fff;
}

.clip.is-done .icon-play {
  display: none;
}

.clip.is-done .icon-check {
  display: block;
}

.clip.is-done {
  box-shadow: inset 2px 0 0 var(--ok-strong);
}

.clip-body,
.clip-name {
  min-width: 0;
}

.clip-top,
.clip-sub,
.clip-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.clip-top {
  min-width: 0;
}

.clip-name {
  margin: 0;
  overflow: hidden;
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: -0.015em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.clip-sub {
  margin-top: 3px;
}

.clip-meta {
  margin: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 11.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-pill {
  flex-shrink: 0;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(224, 138, 106, 0.16);
  color: var(--delay);
  font-size: 10px;
  letter-spacing: 0.04em;
}

.steps {
  display: flex;
  flex-shrink: 0;
  gap: 3px;
  width: 58px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.steps li {
  flex: 1;
  height: 2px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
}

.steps li.done {
  background: var(--ink);
}

.steps li.current {
  background: rgba(255, 255, 255, 0.42);
}

.assignee-select,
.complete-btn {
  height: 28px;
  border-radius: 999px;
  font-size: 12px;
}

.assignee-select {
  width: 86px;
  padding: 0 8px;
  border: 0;
  background: var(--warm);
  color: var(--body);
  outline: none;
  appearance: none;
}

.complete-btn {
  padding: 0 11px;
  border: 0;
  background: var(--ink);
  color: var(--on-ink);
}

.done-pill {
  background: rgba(125, 206, 160, 0.16);
  color: var(--ok);
}

.drive-btn {
  height: 28px;
  padding: 0 11px;
  border: 0;
  border-radius: 999px;
  background: var(--ok-strong);
  color: #fff;
  font-size: 12px;
}

.complete-btn[hidden],
.assignee-select[hidden],
.drive-btn[hidden] {
  display: none;
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  opacity: 0;
  transition: opacity 0.16s ease, background 0.16s ease, color 0.16s ease;
}

.icon-btn.visible,
.clip:hover .delete-clip,
.icon-btn:focus-visible {
  opacity: 1;
}

.icon-btn:hover {
  background: var(--warm);
  color: var(--ink);
}

.jobs-view[hidden],
.board[hidden] {
  display: none;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.active-work-feed {
  margin-bottom: 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
}

.active-work-feed p {
  margin: 0;
  color: var(--body);
  font-size: 13px;
  line-height: 1.5;
}

.active-work-feed p + p {
  margin-top: 6px;
}

.stat {
  padding: 18px 20px 16px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px);
}

.stat em {
  display: block;
  font-family: var(--display);
  font-size: 36px;
  font-style: normal;
  font-weight: 300;
  letter-spacing: -0.04em;
  line-height: 1;
}

.stat span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}

.stat.is-delay em {
  color: var(--delay);
}

.jobs-panel {
  padding: 8px 4px 12px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px);
}

.jobs-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px 8px;
}

.jobs-head h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 28px;
  font-weight: 300;
  letter-spacing: -0.03em;
}

.drive-form {
  display: flex;
  flex: 1;
  max-width: 520px;
  gap: 8px;
}

.drive-form input {
  flex: 1;
  height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--fill);
  outline: none;
}

.drive-form .btn {
  position: relative;
  min-width: 88px;
}

.drive-form .spinner {
  position: absolute;
  inset: 0;
  display: none;
  margin: auto;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(28, 28, 30, 0.2);
  border-top-color: var(--on-ink);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.drive-form.is-loading .btn-label {
  opacity: 0;
}

.drive-form.is-loading .spinner {
  display: block;
}

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

.drive-status {
  margin: 0 18px 8px;
  color: var(--muted);
  font-size: 13px;
}

.drive-status[hidden] {
  display: none;
}

.jobs-list {
  display: flex;
  flex-direction: column;
  padding: 8px 10px 12px;
}

.job {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto 160px;
  gap: 14px;
  align-items: center;
  width: 100%;
  padding: 14px 12px;
  border: 0;
  border-radius: 16px;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.job-detail-btn {
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--fill);
  color: var(--body);
  font-size: 12px;
}

.deadline-input {
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--fill);
  color: var(--ink);
  font-size: 12px;
  color-scheme: dark;
}

.deadline-field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 13px;
}

.job:hover {
  background: var(--fill);
}

.job.delayed {
  box-shadow: inset 2px 0 0 var(--delay);
}

.job h3 {
  margin: 0;
  overflow: hidden;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.02em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.job-title h3,
.job-title .job-name-input {
  flex: 1;
  min-width: 0;
}

.job-row-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.job-name-input {
  width: 100%;
  min-width: 140px;
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--fill);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
}

.job-status-btn {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: transparent;
  font-size: 12px;
  line-height: 1;
}

.job-status-btn.todo {
  color: #ff6b6b;
}

.job-status-btn.done {
  color: var(--ok-strong);
}

.stage-boxes {
  display: flex;
  flex-shrink: 0;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.stage-boxes li {
  display: grid;
  place-items: center;
  min-width: 28px;
  height: 22px;
  padding: 0 5px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.02em;
  line-height: 1;
}

.stage-boxes li.current {
  border-color: rgba(255, 255, 255, 0.35);
  color: var(--ink);
}

.stage-boxes li.done {
  border-color: transparent;
  background: var(--ok);
  color: #143322;
}

.job p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.job-meter {
  display: flex;
  align-items: center;
  gap: 10px;
}

.job-meter b {
  width: 42px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.bar {
  flex: 1;
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
}

.bar i {
  display: block;
  height: 100%;
  background: var(--ink);
}

.jobs-empty {
  margin: 0;
  padding: 36px 16px;
  color: var(--muted);
  text-align: center;
}

.job-sheet {
  width: min(640px, calc(100% - 32px));
}

.job-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 22px;
}

.job-summary span {
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--warm);
  color: var(--body);
  font-size: 12px;
}

.job-summary .late {
  background: rgba(224, 138, 106, 0.16);
  color: var(--delay);
}

.job-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 22px;
}

.stage-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.stage-row {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto 140px;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border-radius: 14px;
  background: var(--fill);
}

.stage-row.done {
  opacity: 0.72;
}

.stage-row.current {
  background: var(--elevated);
  box-shadow: inset 0 0 0 1px var(--line);
}

.stage-mark {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
}

.stage-row.done .stage-mark {
  background: var(--ink);
}

.stage-row.current .stage-mark {
  background: var(--delay);
}

.stage-row strong {
  display: block;
  font-size: 14px;
  font-weight: 500;
}

.stage-row em {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.stage-row .assignee-select {
  width: 100%;
}

.stage-row .deadline-input {
  width: 138px;
}

.duration-input {
  width: 86px;
  height: 32px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--fill);
  color: var(--ink);
}

@media (max-width: 720px) {
  body {
    padding: 16px;
  }

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

  .brand h1 {
    font-size: 36px;
  }

  .board {
    grid-auto-columns: minmax(280px, 86vw);
  }

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

  .job {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .jobs-head,
  .drive-form {
    flex-direction: column;
    align-items: stretch;
    max-width: none;
  }

  .user-card-top {
    grid-template-columns: 36px minmax(0, 1fr) auto;
  }

  .user-card-top .role-select {
    grid-column: 1 / -1;
  }

  .chip-row,
  .access-note {
    margin-left: 0;
  }
}
