:root {
  --bg: #f4f1ea;
  --card: #fffdf9;
  --ink: #1d1b18;
  --muted: #6b645d;
  --border: #dbd3c8;
  --accent: #111;
  --success: #0a6d3d;
  --error: #a12323;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Georgia, serif;
  color: var(--ink);
  background: linear-gradient(180deg, #f8f5ef 0%, #eee7db 100%);
}

html[lang="zh-Hant"] body {
  font-family: "Noto Sans TC", "Microsoft JhengHei", "PingFang TC", "Heiti TC", sans-serif;
}

html[lang="en"] body {
  font-family: Georgia, "Times New Roman", serif;
}

.page-shell { min-height: 100vh; padding: 24px 16px 40px; }
.dark-shell { background: #0b0b10; color: #f6f2e8; }
.container { max-width: 980px; margin: 0 auto; }
.container.narrow { max-width: 760px; }
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 28px;
}
.brand { font-size: 15px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }

.language-box, .lang-switcher {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.language-box label {
  margin-bottom: 0;
}

.language-box select {
  width: auto;
  min-width: 130px;
}

label { display: block; margin-bottom: 8px; line-height: 1.35; }
select, input, textarea, button, a.primary-button {
  font: inherit;
}
select, input, textarea {
  width: 100%; border-radius: 14px; border: 1px solid var(--border); padding: 14px 16px; background: white;
}
textarea { min-height: 170px; resize: vertical; }
.hero-card, .card, .video-card, .modal-card {
  background: rgba(255,255,255,0.86); border: 1px solid rgba(219,211,200,0.9); border-radius: 24px; padding: 28px;
  box-shadow: 0 14px 40px rgba(52, 41, 25, 0.08);
}
.modal-card h2,
.modal-card p {
  color: #111;
}
.hero-card { padding: 34px 30px; }
h1 { font-size: clamp(32px, 5vw, 54px); line-height: 1.05; margin: 0 0 18px; }
h2 { margin-top: 0; }
.subtitle { font-size: 18px; color: var(--muted); margin: 0 0 24px; }
.subtitle.light { color: rgba(246,242,232,0.82); }
.long-copy { font-size: 19px; line-height: 1.9; color: #2d2924; }
.primary-button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none;
  width: 100%; border: 0; border-radius: 16px; padding: 16px 18px; margin-top: 28px; background: var(--accent);
  color: #fff; cursor: pointer; font-size: 20px;
}
.primary-button:disabled { opacity: 0.65; cursor: not-allowed; }
.row, .grid-two { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.field { margin-top: 18px; }
.back-link { color: var(--muted); text-decoration: none; }
.status-box, .banner {
  margin-top: 18px; border-radius: 14px; padding: 14px 16px; font-size: 16px;
}
.status-box.success, .banner { background: rgba(10,109,61,0.09); color: var(--success); }
.status-box.error { background: rgba(161,35,35,0.09); color: var(--error); }
.hidden { display: none !important; }
.waiting-layout { text-align: center; }
.video-card { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.12); }
.waiting-video {
  display: block; width: min(100%, 560px); margin: 0 auto; border-radius: 18px; background: #111;
}
.video-fallback { color: rgba(246,242,232,0.85); margin-top: 12px; }
.modal {
  position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; padding: 20px;
  background: rgba(0,0,0,0.55);
}
.modal-card { max-width: 420px; text-align: center; }
/* Cancel banner amber styling */
#cancelNotice {
  background: rgba(194,120,3,0.10);
  color: #7a4f00;
  position: relative;
}
.cancel-dismiss {
  position: absolute;
  top: 10px;
  right: 14px;
  background: none;
  border: none;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  color: #7a4f00;
  padding: 0 4px;
  width: auto;
  margin-top: 0;
}
.cancel-edit-link {
  display: block;
  margin-top: 8px;
  font-size: 15px;
  color: #7a4f00;
  text-decoration: underline;
  cursor: pointer;
}
#cancelNotice .primary-button {
  margin-top: 14px;
  background: #7a4f00;
  color: #fff;
}

/* Pipeline step styling */
.pipeline {
  list-style: none;
  margin: 18px auto;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 320px;
  text-align: left;
}
.pipeline-step {
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 15px;
  transition: opacity 0.3s;
}
.pipeline-step.is-complete {
  color: #2ecc71;
  opacity: 1;
}
.pipeline-step.is-active {
  color: #f6f2e8;
  font-weight: bold;
  opacity: 1;
}
.pipeline-step.is-pending {
  color: rgba(246,242,232,0.4);
  opacity: 0.6;
}

@media (max-width: 720px) {
  .row, .grid-two { grid-template-columns: 1fr; }
  .topbar { align-items: flex-start; flex-direction: column; }
  .hero-card, .card, .video-card, .modal-card { padding: 22px; }
}
