:root {
  color-scheme: light;
  --ink: #16242b;
  --ink-soft: #53636a;
  --ink-faint: #829198;
  --paper: #f5f7f6;
  --card: #ffffff;
  --line: #dfe7e5;
  --line-strong: #c7d5d1;
  --teal: #087f78;
  --teal-dark: #07645f;
  --teal-wash: #e7f4f1;
  --amber: #b86c1d;
  --amber-wash: #fff4e4;
  --red: #ad3e46;
  --red-wash: #fff0f0;
  --blue: #376bb0;
  --blue-wash: #edf4ff;
  --shadow: 0 18px 50px rgb(25 49 54 / 7%);
  --radius-lg: 20px;
  --radius-md: 13px;
  --radius-sm: 9px;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--paper);
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 84% 0%, rgb(216 239 233 / 65%), transparent 27rem),
    var(--paper);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

button:disabled,
input:disabled {
  cursor: not-allowed;
  opacity: .6;
}

a {
  color: inherit;
}

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

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1180px, calc(100% - 48px));
  min-height: 84px;
  margin: 0 auto;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 35px;
  height: 35px;
  border: 1px solid rgb(8 127 120 / 20%);
  border-radius: 11px;
  color: var(--teal-dark);
  background: var(--teal-wash);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
}

.brand-name,
.brand-subtitle {
  display: block;
}

.brand-name {
  font-size: 15px;
  font-weight: 750;
  letter-spacing: .01em;
}

.brand-subtitle {
  margin-top: 1px;
  color: var(--ink-faint);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10px;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.session-area {
  display: flex;
  align-items: center;
  gap: 14px;
}

.session-status {
  color: var(--ink-faint);
  font-size: 13px;
}

.session-status.is-active {
  color: var(--teal-dark);
}

.main-content {
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
  padding: 36px 0 72px;
}

.login-view {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(330px, 410px);
  align-items: center;
  gap: clamp(42px, 9vw, 140px);
  min-height: calc(100vh - 160px);
  max-width: 1030px;
  margin: 0 auto;
}

.login-intro {
  max-width: 500px;
  padding: 16px 0;
}

.login-intro h1,
.page-heading h1 {
  margin: 7px 0 16px;
  color: var(--ink);
  font-size: clamp(34px, 5vw, 58px);
  font-weight: 760;
  letter-spacing: -.055em;
  line-height: 1.1;
}

.login-intro p:not(.eyebrow) {
  max-width: 440px;
  margin: 0;
  color: var(--ink-soft);
  font-size: 17px;
  line-height: 1.8;
}

.eyebrow {
  margin: 0;
  color: var(--teal);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .16em;
  line-height: 1.4;
}

.card {
  border: 1px solid rgb(199 213 209 / 78%);
  border-radius: var(--radius-lg);
  background: rgb(255 255 255 / 94%);
  box-shadow: var(--shadow);
}

.login-card {
  padding: 31px;
}

.card-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.card-heading h2 {
  margin: 5px 0 0;
  font-size: 20px;
  font-weight: 740;
  letter-spacing: -.025em;
  line-height: 1.3;
}

.lock-mark,
.step-number {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 35px;
  height: 35px;
  border-radius: 11px;
  color: var(--teal-dark);
  background: var(--teal-wash);
  font-size: 17px;
}

.step-number {
  color: var(--ink-faint);
  background: #f2f5f4;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
}

.field-label {
  display: block;
  margin: 17px 0 7px;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 650;
}

.text-input {
  display: block;
  width: 100%;
  min-height: 45px;
  padding: 9px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  outline: none;
  color: var(--ink);
  background: #fff;
  transition: border-color .16s ease, box-shadow .16s ease;
}

.text-input::placeholder {
  color: #a5b0b2;
}

.text-input:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgb(8 127 120 / 12%);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 8px 15px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 680;
  line-height: 1.2;
  transition: background .16s ease, border-color .16s ease, color .16s ease, transform .16s ease;
}

.button:not(:disabled):active {
  transform: translateY(1px);
}

.button-primary {
  color: #fff;
  background: var(--teal);
}

.button-primary:not(:disabled):hover {
  background: var(--teal-dark);
}

.button-secondary {
  border-color: var(--line-strong);
  color: var(--ink);
  background: #fff;
}

.button-secondary:not(:disabled):hover,
.button-quiet:not(:disabled):hover {
  border-color: var(--teal);
  color: var(--teal-dark);
  background: var(--teal-wash);
}

.button-quiet {
  min-height: 34px;
  padding: 6px 11px;
  border-color: var(--line);
  color: var(--ink-soft);
  background: transparent;
  font-size: 12px;
}

.button-small {
  min-height: 32px;
  padding: 6px 10px;
  font-size: 12px;
}

.button-full {
  width: 100%;
  margin-top: 22px;
}

.form-note,
.page-footnote {
  margin: 13px 0 0;
  color: var(--ink-faint);
  font-size: 12px;
  line-height: 1.6;
}

.form-message,
.global-message {
  margin: 12px 0 0;
  font-size: 13px;
  line-height: 1.5;
}

.error-message {
  color: var(--red);
}

.success-message {
  color: var(--teal-dark);
}

.global-message {
  margin-bottom: 20px;
  padding: 12px 14px;
  border: 1px solid rgb(173 62 70 / 16%);
  border-radius: var(--radius-sm);
  background: var(--red-wash);
}

.global-message.success-message {
  border-color: rgb(8 127 120 / 18%);
  background: var(--teal-wash);
}

.app-view {
  animation: appear .24s ease both;
}

.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 31px;
}

.page-heading h1 {
  margin-bottom: 8px;
  font-size: clamp(35px, 5vw, 55px);
}

.page-description {
  margin: 0;
  color: var(--ink-soft);
  font-size: 15px;
}

.page-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 15px;
  padding-bottom: 3px;
}

.text-link {
  color: var(--teal-dark);
  font-size: 13px;
  font-weight: 650;
  text-decoration: none;
}

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

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.summary-card {
  min-height: 126px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgb(255 255 255 / 80%);
}

.summary-card-accent {
  border-color: rgb(8 127 120 / 25%);
  background: linear-gradient(135deg, #f4fbf9, #fff);
}

.summary-label {
  color: var(--ink-faint);
  font-size: 12px;
  font-weight: 650;
}

.summary-value {
  overflow: hidden;
  margin-top: 10px;
  color: var(--ink);
  font-size: 25px;
  font-weight: 760;
  letter-spacing: -.035em;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.summary-meta {
  overflow: hidden;
  margin-top: 7px;
  color: var(--ink-soft);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(300px, .83fr) minmax(0, 1.17fr);
  align-items: start;
  gap: 22px;
}

.project-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  margin-bottom: 22px;
  padding: 18px 22px;
}

.project-picker,
.project-create {
  display: flex;
  align-items: center;
  gap: 12px;
}

.project-picker {
  min-width: 0;
}

.project-picker h2 {
  margin: 4px 0 0;
  font-size: 17px;
  font-weight: 730;
  line-height: 1.25;
}

.select-input {
  min-width: 180px;
  min-height: 40px;
  padding: 7px 31px 7px 11px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  outline: none;
  color: var(--ink);
  background: #fff;
  font-size: 13px;
}

.select-input:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgb(8 127 120 / 12%);
}

.compact-input {
  min-width: 130px;
  min-height: 40px;
}

.project-meta {
  overflow: hidden;
  color: var(--ink-faint);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.upload-card,
.releases-card,
.results-card {
  padding: 27px;
}

.card-heading-inline {
  align-items: center;
  margin-bottom: 9px;
}

.card-description {
  margin: 0 0 22px;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.65;
}

.count-pill {
  flex: 0 0 auto;
  padding: 5px 9px;
  border-radius: 999px;
  color: var(--ink-soft);
  background: #f1f5f4;
  font-size: 11px;
  font-weight: 650;
}

.file-drop-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 135px;
  padding: 17px;
  border: 1px dashed #aac4bf;
  border-radius: var(--radius-md);
  color: var(--teal-dark);
  background: #f6fbfa;
  cursor: pointer;
  text-align: center;
  transition: border-color .16s ease, background .16s ease;
}

.file-drop-zone:hover,
.file-drop-zone:focus-within {
  border-color: var(--teal);
  background: var(--teal-wash);
}

.file-drop-zone input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  clip-path: inset(50%);
}

.file-icon {
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  margin-bottom: 7px;
  border-radius: 50%;
  color: #fff;
  background: var(--teal);
  font-size: 19px;
  font-weight: 400;
  line-height: 1;
}

.file-name {
  max-width: 100%;
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  font-weight: 670;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-help {
  margin-top: 3px;
  color: var(--ink-faint);
  font-size: 11px;
}

.progress-panel {
  margin-top: 18px;
}

.progress-line {
  display: flex;
  justify-content: space-between;
  margin-bottom: 7px;
  color: var(--ink-soft);
  font-size: 12px;
}

.progress-track {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #e5eeeb;
}

.progress-bar {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--teal);
  transition: width .14s ease;
}

.media-card {
  margin-top: 22px;
  padding: 27px;
}

.media-upload-bar {
  display: flex;
  align-items: center;
  gap: 11px;
}

.media-file-picker {
  display: flex;
  align-items: center;
  min-width: 0;
  flex: 1;
  gap: 9px;
  min-height: 42px;
  padding: 6px 11px;
  border: 1px dashed #aac4bf;
  border-radius: var(--radius-sm);
  color: var(--ink-soft);
  background: #f6fbfa;
  cursor: pointer;
  font-size: 12px;
}

.media-file-picker:hover,
.media-file-picker:focus-within {
  border-color: var(--teal);
  background: var(--teal-wash);
}

.media-file-picker input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
}

.small-file-icon {
  width: 25px;
  height: 25px;
  margin: 0;
  font-size: 18px;
}

.media-upload-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-top: 13px;
}

.media-job,
.media-row,
.video-row {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #fff;
}

.media-job-heading,
.media-row,
.video-row,
.media-job-actions,
.video-replace-controls,
.media-actions {
  display: flex;
  align-items: center;
}

.media-job-heading {
  justify-content: space-between;
  gap: 12px;
}

.media-job-name,
.media-name,
.video-name {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.media-job-status {
  flex: 0 0 auto;
  color: var(--teal-dark);
  font-size: 11px;
}

.media-job-error .media-job-status {
  color: var(--red);
}

.media-progress-track {
  height: 6px;
  overflow: hidden;
  margin-top: 10px;
  border-radius: 999px;
  background: #e5eeeb;
}

.media-progress-bar {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--teal);
  transition: width .12s ease;
}

.media-job-meta,
.media-meta,
.video-key {
  margin-top: 6px;
  color: var(--ink-faint);
  font-size: 11px;
}

.media-job-actions,
.media-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 10px;
}

.button-warning {
  border-color: rgb(184 108 29 / 28%);
  color: var(--amber);
}

.media-library-heading,
.video-replacement-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 15px;
  margin-top: 27px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.media-library-heading h3,
.video-replacement-heading h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 730;
}

.video-replacement-heading p {
  margin: 4px 0 0;
  color: var(--ink-soft);
  font-size: 12px;
}

.media-list,
.video-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-top: 13px;
}

.media-row,
.video-row {
  justify-content: space-between;
  gap: 15px;
  flex-wrap: wrap;
}

.media-row-main,
.video-row-main {
  min-width: 0;
  flex: 1 1 220px;
}

.media-url-line {
  width: 100%;
  min-width: 100%;
  padding-top: 9px;
  border-top: 1px solid #edf2f0;
}

.media-actions {
  margin-top: 0;
}

.server-upload-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: 13px;
}

.server-upload-heading {
  color: var(--amber);
  font-size: 12px;
  font-weight: 700;
}

.server-upload-row {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--ink-soft);
  background: var(--amber-wash);
  font-size: 12px;
}

.video-replace-controls {
  flex: 1 1 330px;
  justify-content: flex-end;
  gap: 9px;
}

.video-select {
  min-width: 0;
  flex: 1;
}

.release-url {
  display: block;
  width: 100%;
  min-width: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  outline: 0;
  color: var(--teal-dark);
  background: transparent;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.release-url:focus {
  box-shadow: 0 1px 0 var(--teal);
}

.list-stack,
.results-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.release-row {
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #fff;
}

.release-row.is-current {
  border-color: rgb(8 127 120 / 30%);
  background: #f6fbfa;
}

.release-main,
.result-main,
.result-actions,
.release-actions,
.release-link-line {
  display: flex;
  align-items: center;
}

.release-main,
.result-main {
  justify-content: space-between;
  gap: 12px;
}

.release-title {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.current-tag,
.result-mode,
.sync-tag {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  min-height: 22px;
  padding: 3px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
}

.current-tag {
  color: var(--teal-dark);
  background: var(--teal-wash);
}

.release-meta,
.result-meta {
  margin-top: 5px;
  color: var(--ink-faint);
  font-size: 11px;
}

.release-link-line {
  min-width: 0;
  gap: 8px;
  margin-top: 13px;
  padding: 8px 9px;
  border-radius: var(--radius-sm);
  background: #f5f8f7;
}

.release-link {
  min-width: 0;
  overflow: hidden;
  color: var(--teal-dark);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  text-overflow: ellipsis;
  text-decoration: none;
  white-space: nowrap;
}

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

.release-actions {
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
}

.release-actions .button {
  min-height: 30px;
}

.results-card {
  margin-top: 22px;
}

.result-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 15px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.result-title {
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-mode {
  margin-left: 7px;
  color: var(--blue);
  background: var(--blue-wash);
}

.result-mode.is-formal {
  color: var(--teal-dark);
  background: var(--teal-wash);
}

.result-actions {
  justify-content: flex-end;
  gap: 9px;
}

.sync-tag {
  color: var(--ink-soft);
  background: #f1f5f4;
}

.sync-tag.is-synced {
  color: var(--teal-dark);
  background: var(--teal-wash);
}

.sync-tag.is-pending {
  color: var(--amber);
  background: var(--amber-wash);
}

.sync-tag.is-error {
  color: var(--red);
  background: var(--red-wash);
}

.empty-state {
  padding: 28px 16px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-md);
  color: var(--ink-faint);
  font-size: 13px;
  text-align: center;
}

.page-footnote {
  margin: 18px 3px 0;
  text-align: right;
}

@keyframes appear {
  from {
    opacity: 0;
    transform: translateY(5px);
  }

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

@media (max-width: 880px) {
  .login-view,
  .workspace-grid {
    grid-template-columns: 1fr;
  }

  .project-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .project-create {
    flex-wrap: wrap;
  }

  .login-view {
    max-width: 620px;
    min-height: auto;
    padding: 55px 0;
  }

  .login-intro {
    text-align: center;
  }

  .login-intro p:not(.eyebrow) {
    margin-right: auto;
    margin-left: auto;
  }

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

@media (max-width: 620px) {
  .topbar,
  .main-content {
    width: min(100% - 30px, 520px);
  }

  .topbar {
    min-height: 70px;
  }

  .session-status {
    display: none;
  }

  .main-content {
    padding-top: 22px;
    padding-bottom: 45px;
  }

  .page-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 19px;
    margin-bottom: 23px;
  }

  .page-actions {
    justify-content: flex-start;
  }

  .project-picker {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .project-create {
    align-items: stretch;
  }

  .project-create .compact-input {
    min-width: 0;
    flex: 1 1 120px;
  }

  .summary-grid {
    gap: 9px;
  }

  .summary-card {
    min-height: 110px;
    padding: 15px;
  }

  .summary-value {
    font-size: 21px;
  }

  .login-card,
  .upload-card,
  .releases-card,
  .results-card,
  .media-card {
    padding: 22px 18px;
    border-radius: 16px;
  }

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

  .result-actions {
    justify-content: flex-start;
  }

  .media-upload-bar,
  .video-replace-controls {
    align-items: stretch;
    flex-direction: column;
  }

  .media-upload-bar .button,
  .video-replace-controls .button {
    width: 100%;
  }

  .media-library-heading,
  .video-replacement-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .page-footnote {
    text-align: left;
  }
}
