:root {
  --ink: #202329;
  --muted: #70757f;
  --paper: #f5f1eb;
  --panel: #ffffff;
  --line: #e6e0d8;
  --orange: #f36d3f;
  --orange-dark: #de5629;
  --orange-soft: #fff0e8;
  --green: #268a61;
  --green-soft: #eaf7f0;
  --blue: #4967de;
  --shadow: 0 24px 80px rgba(42, 34, 26, .08);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 5% 5%, rgba(243, 109, 63, .12), transparent 24rem),
    var(--paper);
  font-family: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, input { font: inherit; }
button { cursor: pointer; }

.shell { min-height: 100vh; }

.topbar {
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(24px, 5vw, 76px);
  border-bottom: 1px solid rgba(57, 50, 43, .09);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: inherit;
  text-decoration: none;
  letter-spacing: -.03em;
}

.brand > span:last-child { display: flex; align-items: baseline; gap: 7px; }
.brand b { font-size: 22px; font-weight: 800; }
.brand em { color: var(--orange); font-size: 13px; font-style: normal; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }

.brand-mark {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--orange);
}

.brand-mark::before,
.brand-mark i {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  border: 2px solid #fff;
  border-radius: 50%;
}

.brand-mark i { width: 4px; height: 4px; background: #fff; }

.topbar-meta { display: flex; align-items: center; gap: 18px; }
.connection { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; font-weight: 600; }
.connection i { width: 8px; height: 8px; border-radius: 50%; background: #38a875; box-shadow: 0 0 0 4px rgba(56, 168, 117, .12); }
.avatar { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: var(--ink); font-weight: 800; }

main { padding: 0 clamp(18px, 5vw, 76px) 64px; }

.intro {
  max-width: 1450px;
  margin: 0 auto;
  padding: clamp(46px, 7vw, 90px) 0 42px;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, .75fr);
  gap: 64px;
  align-items: end;
}

.eyebrow { margin: 0 0 18px; color: var(--orange); font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
h1 { margin: 0; max-width: 780px; font-size: clamp(44px, 6vw, 86px); line-height: .96; letter-spacing: -.065em; font-weight: 800; }
h1 span { color: var(--orange); }
.intro-copy { max-width: 650px; margin: 26px 0 0; color: var(--muted); font-size: clamp(15px, 1.4vw, 18px); line-height: 1.65; }

.summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid #d8d0c6;
  border-bottom: 1px solid #d8d0c6;
}

.summary div { padding: 24px 15px 22px; border-left: 1px solid #d8d0c6; }
.summary div:first-child { border-left: 0; }
.summary strong { display: block; margin-bottom: 7px; font-size: clamp(24px, 2.6vw, 38px); letter-spacing: -.04em; }
.summary span { display: block; color: var(--muted); font-size: 11px; line-height: 1.4; }

.workspace {
  max-width: 1450px;
  min-height: 700px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(350px, .72fr) minmax(540px, 1.28fr);
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.library { padding: 30px 24px; background: #fbfaf8; border-right: 1px solid var(--line); }
.library-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; }
.library-head > div { display: flex; align-items: baseline; gap: 11px; }
.section-number { color: var(--orange); font-size: 11px; font-weight: 800; }
h2 { margin: 0; font-size: 24px; letter-spacing: -.035em; }
.icon-button { width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; color: var(--muted); background: #fff; transition: .2s ease; }
.icon-button:hover { color: var(--orange); border-color: #f6b198; transform: rotate(12deg); }
.icon-button.loading span { animation: spin 1s linear infinite; }

.search { height: 48px; display: flex; align-items: center; gap: 10px; padding: 0 15px; border: 1px solid var(--line); border-radius: 14px; background: #fff; color: var(--muted); }
.search input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 13px; }

.video-list { height: 580px; margin: 18px -7px 0 0; padding-right: 7px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #d2ccc4 transparent; }
.video-card { width: 100%; margin-bottom: 9px; padding: 17px; text-align: left; border: 1px solid transparent; border-radius: 15px; color: inherit; background: transparent; transition: .18s ease; }
.video-card:hover { background: #fff; border-color: var(--line); }
.video-card.active { background: var(--orange-soft); border-color: #ffcbb8; }
.video-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 9px; }
.video-date { color: var(--muted); font-size: 11px; font-weight: 700; }
.video-card h3 { margin: 0; font-size: 14px; line-height: 1.45; letter-spacing: -.015em; }
.video-meta { display: flex; gap: 12px; margin-top: 11px; color: var(--muted); font-size: 11px; }

.status { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; font-size: 10px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status.done { color: var(--green); }
.status.running { color: var(--blue); }
.status.queued { color: #a87318; }
.status.failed { color: #b74040; }
.status.new { color: #9a958f; }

.detail { min-width: 0; padding: clamp(30px, 4vw, 54px); }
.empty-state { min-height: 580px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.empty-icon { width: 66px; height: 66px; display: grid; place-items: center; margin-bottom: 20px; border: 1px solid var(--line); border-radius: 50%; color: var(--orange); background: var(--orange-soft); }
.empty-state p { color: var(--muted); }

.detail-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.detail-kicker { margin: 0 0 12px; color: var(--orange); font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.detail h2 { max-width: 720px; font-size: clamp(27px, 3vw, 42px); line-height: 1.1; }
.file-size { flex: 0 0 auto; padding: 8px 11px; border: 1px solid var(--line); border-radius: 20px; color: var(--muted); font-size: 11px; }
.detail-meta { display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 18px 0 30px; color: var(--muted); font-size: 12px; }

.cost-panel { padding: 25px; border: 1px solid var(--line); border-radius: 18px; background: #fbfaf8; }
.cost-label { margin: 0 0 13px; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.cost-main { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; }
.cost-value { font-size: clamp(44px, 6vw, 72px); line-height: .9; font-weight: 800; letter-spacing: -.065em; }
.cost-value small { font-size: .42em; letter-spacing: -.02em; }
.cost-notes { text-align: right; color: var(--muted); font-size: 12px; line-height: 1.65; }
.cost-notes b { color: var(--ink); }

.progress-card { margin-top: 20px; padding: 20px 22px; border-radius: 16px; background: #f4f6ff; }
.progress-top { display: flex; justify-content: space-between; gap: 14px; margin-bottom: 12px; font-size: 12px; font-weight: 700; }
.progress-track { height: 8px; overflow: hidden; border-radius: 9px; background: #dfe4fb; }
.progress-fill { height: 100%; border-radius: inherit; background: var(--blue); transition: width .4s ease; }

.action-row { display: flex; gap: 12px; margin-top: 22px; }
.primary-button { min-height: 52px; flex: 1; border: 0; border-radius: 14px; color: #fff; background: var(--orange); font-weight: 800; box-shadow: 0 12px 28px rgba(243, 109, 63, .25); transition: .18s ease; }
.primary-button:hover { background: var(--orange-dark); transform: translateY(-1px); }
.primary-button:disabled { cursor: not-allowed; box-shadow: none; background: #c5c2be; transform: none; }
.secondary-button { min-height: 52px; padding: 0 19px; border: 1px solid var(--line); border-radius: 14px; background: #fff; color: var(--ink); font-weight: 700; }

.privacy-note { display: flex; gap: 10px; margin-top: 15px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.privacy-note::before { content: "✓"; color: var(--green); font-weight: 800; }

.documents { margin-top: 34px; }
.documents-title { display: flex; align-items: baseline; gap: 12px; margin-bottom: 14px; }
.documents-title span { color: var(--muted); font-size: 11px; }
.document-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.document { min-height: 94px; display: flex; flex-direction: column; justify-content: space-between; padding: 17px; border: 1px solid var(--line); border-radius: 15px; color: inherit; text-decoration: none; transition: .18s ease; }
.document:hover { border-color: #f2a589; background: var(--orange-soft); transform: translateY(-2px); }
.document strong { font-size: 13px; }
.document span { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .06em; }

.error-box { margin-top: 18px; padding: 16px; border-radius: 12px; color: #9c3333; background: #fff0f0; font-size: 12px; line-height: 1.55; }
.loading-card { margin-bottom: 9px; padding: 18px; border-radius: 15px; background: #fff; }
.loading-card span { display: block; height: 9px; margin-bottom: 10px; border-radius: 7px; background: linear-gradient(90deg, #eeeae5 25%, #f8f6f3 50%, #eeeae5 75%); background-size: 200% 100%; animation: shimmer 1.5s infinite; }
.loading-card span:nth-child(2) { width: 82%; }
.loading-card span:nth-child(3) { width: 45%; margin: 0; }

.toast { position: fixed; right: 26px; bottom: 26px; max-width: 360px; padding: 14px 18px; border-radius: 13px; color: #fff; background: var(--ink); box-shadow: 0 14px 40px rgba(0,0,0,.2); font-size: 12px; opacity: 0; transform: translateY(12px); pointer-events: none; transition: .24s ease; }
.toast.show { opacity: 1; transform: translateY(0); }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer { to { background-position: -200% 0; } }

@media (max-width: 980px) {
  .intro { grid-template-columns: 1fr; gap: 35px; }
  .workspace { grid-template-columns: 1fr; }
  .library { border-right: 0; border-bottom: 1px solid var(--line); }
  .video-list { height: 370px; }
}

@media (max-width: 600px) {
  .topbar { height: 66px; padding: 0 18px; }
  .connection { display: none; }
  main { padding: 0 12px 32px; }
  .intro { padding: 44px 7px 30px; }
  .summary { grid-template-columns: 1fr; }
  .summary div { display: flex; align-items: baseline; justify-content: space-between; border-left: 0; border-top: 1px solid #d8d0c6; padding: 14px 2px; }
  .summary div:first-child { border-top: 0; }
  .summary strong { margin: 0; }
  .workspace { border-radius: 18px; }
  .library, .detail { padding: 24px 18px; }
  .detail-head { display: block; }
  .file-size { display: inline-block; margin-top: 14px; }
  .cost-main { display: block; }
  .cost-notes { margin-top: 18px; text-align: left; }
  .document-grid { grid-template-columns: 1fr; }
  .action-row { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
