:root {
  color-scheme: dark;
  --bg: #10110f;
  --surface: #171916;
  --surface-2: #20231f;
  --surface-3: #292d28;
  --line: #3a3f37;
  --text: #f4f1e8;
  --muted: #b8b2a4;
  --soft: #7f8979;
  --accent: #e0b351;
  --accent-2: #77a8a2;
  --danger: #dd6b5d;
  --shadow: 0 18px 60px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(145deg, rgba(119, 168, 162, 0.08), transparent 32%),
    linear-gradient(315deg, rgba(224, 179, 81, 0.08), transparent 30%),
    var(--bg);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  letter-spacing: 0;
}

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

button {
  cursor: pointer;
}

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

body.show-assistant .app-shell {
  grid-template-columns: minmax(0, 1fr) 310px;
}

.menu-toggle {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  border: 1px solid rgba(244, 241, 232, 0.22);
  border-radius: 7px;
  background: rgba(23, 25, 22, 0.94);
  color: var(--text);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.22);
}

body.start-mode .app-shell,
body.movie-mode .app-shell {
  grid-template-columns: minmax(0, 1fr);
}

.sidebar,
body.start-mode .sidebar,
body.start-mode .assistant-panel,
body.movie-mode .sidebar,
body.movie-mode .assistant-panel,
body.movie-mode .topbar {
  display: none;
}

body.start-mode .workspace,
body.movie-mode .workspace {
  min-height: 100vh;
}

.app-menu {
  position: fixed;
  top: 82px;
  right: 26px;
  z-index: 45;
  width: min(240px, calc(100vw - 28px));
  display: grid;
  gap: 8px;
  border: 1px solid rgba(244, 241, 232, 0.18);
  background: rgba(16, 17, 15, 0.97);
  border-radius: 8px;
  padding: 12px;
  box-shadow: var(--shadow);
}

.project-banner {
  margin: 0 26px 14px;
  border: 1px solid rgba(244, 241, 232, 0.14);
  background: rgba(23, 25, 22, 0.82);
  border-radius: 8px;
  padding: 10px 14px;
  color: var(--text);
  font-weight: 750;
  letter-spacing: 0;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
}

.storage-warning {
  margin: 0 26px 14px;
  border: 1px solid rgba(224, 179, 81, 0.34);
  background: rgba(224, 179, 81, 0.1);
  border-radius: 8px;
  padding: 12px 14px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 12px;
  line-height: 1.35;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.16);
}

.storage-warning strong {
  flex: 0 0 auto;
  color: #ffe2a0;
}

.storage-warning span {
  color: var(--muted);
}

.storage-warning-panel {
  margin: 0 0 16px;
}

body.start-mode .project-banner {
  display: none;
}

body.start-mode .storage-warning {
  display: none;
}

body.movie-mode .project-banner {
  width: min(1180px, calc(100% - 48px));
  margin: 18px auto 0;
}

body.movie-mode .storage-warning {
  width: min(1180px, calc(100% - 48px));
  margin: 12px auto 0;
}

.menu-page-tab {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-2);
  color: var(--text);
  text-align: left;
  padding: 0 12px;
}

.menu-page-tab.active {
  border-color: rgba(224, 179, 81, 0.65);
  background: rgba(224, 179, 81, 0.16);
  color: #ffe2a0;
}

.menu-divider {
  height: 1px;
  background: var(--line);
  margin: 3px 0;
}

.sidebar {
  display: none;
  border-right: 1px solid var(--line);
  background: rgba(16, 17, 15, 0.88);
  padding: 22px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
}

.brand {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  margin-bottom: 24px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border: 1px solid rgba(224, 179, 81, 0.55);
  background: #1d1b13;
  color: var(--accent);
  font-weight: 800;
  border-radius: 8px;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 1.05rem;
  line-height: 1.2;
}

h2 {
  font-size: 1.9rem;
  line-height: 1.15;
}

h3 {
  font-size: 1rem;
  line-height: 1.2;
}

.brand p,
.topbar p,
.fine-print,
.empty-state {
  color: var(--muted);
}

.brand p {
  font-size: 0.85rem;
  margin-top: 5px;
}

.nav-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 20px;
}

.nav-tab,
.segment,
.primary-btn,
.secondary-btn,
.ghost-btn {
  border: 1px solid var(--line);
  color: var(--text);
  background: var(--surface-2);
  border-radius: 7px;
  min-height: 42px;
  padding: 0 14px;
}

.nav-tab.active,
.segment.active {
  border-color: rgba(224, 179, 81, 0.65);
  background: rgba(224, 179, 81, 0.16);
  color: #ffe2a0;
}

.primary-btn {
  border-color: transparent;
  background: var(--accent);
  color: #18140a;
  font-weight: 700;
}

.secondary-btn {
  border-color: rgba(119, 168, 162, 0.55);
  background: rgba(119, 168, 162, 0.12);
  color: #c6e2df;
}

.ghost-btn {
  background: transparent;
  color: var(--muted);
}

.compact {
  min-height: 36px;
  padding: 0 12px;
}

.account-card,
.project-card,
.panel {
  background: rgba(23, 25, 22, 0.94);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.account-card {
  padding: 14px;
  margin-bottom: 16px;
}

.account-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 12px;
}

.account-header h3 {
  margin-bottom: 5px;
}

.project-card {
  padding: 16px;
}

.mobile-share {
  margin-top: 16px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.mobile-share h3 {
  margin-bottom: 8px;
}

.qr-box {
  width: 148px;
  height: 148px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  margin-top: 10px;
  overflow: hidden;
}

.qr-box img {
  display: block;
  width: 100%;
  height: 100%;
}

.workspace {
  padding: 26px;
  min-width: 0;
}

.assistant-panel {
  display: none;
  border-left: 1px solid var(--line);
  background: rgba(16, 17, 15, 0.88);
  padding: 22px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
}

body.show-assistant .assistant-panel {
  display: block;
}

.assistant-panel h3 {
  margin-bottom: 10px;
}

.pending-panel {
  display: grid;
  gap: 12px;
}

.assistant-drawer {
  display: grid;
  gap: 8px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  max-height: 720px;
  overflow: hidden;
  transition: max-height 180ms ease, opacity 180ms ease, transform 180ms ease;
}

.assistant-drawer.collapsed {
  max-height: 0;
  opacity: 0;
  transform: translateX(18px);
  padding-top: 0;
  margin-top: 0;
  border-top: 0;
  pointer-events: none;
}

.assistant-panel textarea {
  margin: 12px 0;
}

.assistant-log {
  margin-top: 12px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  border-radius: 7px;
  padding: 12px;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
  min-height: 90px;
}

.task-queue-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.task-item {
  border: 1px solid var(--line);
  background: var(--surface-2);
  border-radius: 7px;
  padding: 10px;
  color: var(--muted);
  font-size: 0.86rem;
}

button.task-item {
  width: 100%;
  text-align: left;
  cursor: pointer;
}

button.task-item:hover {
  border-color: rgba(119, 168, 162, 0.65);
}

.task-item strong {
  display: block;
  color: var(--text);
  margin-bottom: 4px;
}

.task-item.running {
  border-color: var(--accent);
}

.task-item.done {
  border-color: rgba(102, 179, 132, 0.55);
}

.task-item.failed {
  border-color: rgba(221, 107, 93, 0.65);
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 22px;
}

.topbar p {
  margin-top: 6px;
}

.top-title-block {
  min-width: 0;
}

.top-app-name {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.top-account-cluster {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex: 0 0 auto;
}

.profile-button {
  display: grid;
  justify-items: center;
  gap: 3px;
  min-width: 190px;
  border: 1px solid rgba(244, 241, 232, 0.14);
  border-radius: 8px;
  background: rgba(23, 25, 22, 0.78);
  color: var(--text);
  padding: 9px 14px;
  box-shadow: var(--shadow);
}

.profile-button strong {
  font-size: 1rem;
}

.profile-title {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.profile-icon {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 1px solid rgba(244, 241, 232, 0.2);
  border-radius: 999px;
  color: var(--accent);
  font-size: 0.8rem;
}

.profile-button span {
  color: var(--muted);
  font-size: 0.78rem;
}

.profile-button .profile-title,
.profile-button .profile-title strong {
  color: var(--text);
}

.page-jump {
  display: none;
  gap: 5px;
  min-width: 180px;
}

.page-jump label {
  color: var(--muted);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.page-jump select {
  min-height: 42px;
  border-radius: 7px;
  border: 1px solid rgba(244, 241, 232, 0.18);
  background: var(--surface-2);
  color: var(--text);
  padding: 0 12px;
}

.status-strip {
  display: none;
}

.status-strip span {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  border-radius: 999px;
  padding: 7px 10px;
  white-space: nowrap;
}

.choice-divider {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  color: var(--muted);
  font-size: 0.85rem;
  text-transform: uppercase;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.control-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(230px, 1fr));
  gap: 16px;
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(300px, 0.95fr) minmax(340px, 1.05fr);
  gap: 16px;
}

.admin-callout {
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  border: 1px solid rgba(224, 179, 81, 0.28);
  background: rgba(224, 179, 81, 0.08);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 14px;
}

.admin-callout strong,
.admin-callout span {
  display: block;
}

.admin-callout span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

.canon-grid {
  display: grid;
  grid-template-columns: minmax(340px, 1fr) minmax(320px, 0.85fr);
  gap: 16px;
}

.panel {
  padding: 18px;
}

.panel h3 {
  margin-bottom: 16px;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  margin-bottom: 14px;
}

.panel-header h3 {
  margin-bottom: 0;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.shot-button-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.inline-editor {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid rgba(224, 179, 81, 0.22);
  border-radius: 8px;
  background: rgba(10, 11, 10, 0.34);
}

.inline-editor.hidden {
  display: none;
}

.inline-editor h4 {
  margin: 0;
  font-size: 0.9rem;
  color: var(--accent);
}

.shot-addon-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.shot-addon-card {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: rgba(7, 8, 7, 0.42);
}

.shot-addon-card header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--accent);
}

.shot-addon-card pre {
  white-space: pre-wrap;
  max-height: 220px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px;
  background: rgba(0, 0, 0, 0.25);
}

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 16px;
}

label {
  display: block;
  color: var(--muted);
  font-size: 0.88rem;
  margin-bottom: 8px;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  background: #0e100d;
  color: var(--text);
  border-radius: 7px;
  padding: 10px 11px;
  outline: none;
}

textarea {
  resize: vertical;
  line-height: 1.45;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--accent-2);
  box-shadow: 0 0 0 3px rgba(119, 168, 162, 0.15);
}

.field-row {
  margin-bottom: 14px;
}

.field-row.two-column {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.field-row.three-column {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  border-radius: 7px;
  padding: 0 12px;
  margin-bottom: 14px;
}

.toggle-row input {
  width: 18px;
  height: 18px;
}

.toggle-row span {
  color: var(--text);
}

.fine-print {
  font-size: 0.86rem;
  line-height: 1.45;
}

.image-preview {
  border: 1px solid var(--line);
  background: #0e100d;
  border-radius: 8px;
  width: min(100%, var(--preview-width, 620px));
  height: auto;
  min-height: unset;
  min-width: 240px;
  max-width: 100%;
  margin: 0 0 10px;
  display: block;
  color: var(--muted);
  overflow: auto;
  resize: both;
  text-align: center;
}

.image-preview img {
  display: block;
  width: 100%;
  height: auto;
  max-height: none;
  object-fit: contain;
  background: #090a08;
}

.image-preview a {
  display: block;
  width: 100%;
  height: auto;
}

.reference-grid {
  border: 1px solid var(--line);
  background: #0e100d;
  border-radius: 8px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 8px;
  padding: 8px;
  color: var(--muted);
}

.image-preview figure,
.reference-grid figure {
  margin: 0;
  overflow: hidden;
  border: 1px solid rgba(244, 241, 232, 0.12);
  border-radius: 7px;
  background: #090a08;
}

.image-preview figure img,
.reference-grid img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}

.image-preview figcaption,
.reference-grid figcaption {
  padding: 5px 6px;
  color: var(--muted);
  font-size: 0.7rem;
  white-space: normal;
  overflow: hidden;
  text-overflow: ellipsis;
}

.reference-grid figcaption span {
  display: block;
  margin-top: 2px;
  color: var(--text);
  line-height: 1.25;
}

.full-plan-panel {
  margin: 10px 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(9, 10, 8, 0.74);
  padding: 10px;
}

.compact-header {
  align-items: baseline;
  gap: 10px;
}

.full-plan-list {
  display: grid;
  gap: 8px;
  max-height: 420px;
  overflow: auto;
  padding-right: 4px;
}

.full-plan-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  border: 1px solid rgba(244, 241, 232, 0.1);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.025);
  padding: 9px;
}

.full-plan-item.selected {
  border-color: rgba(218, 179, 95, 0.65);
  background: rgba(218, 179, 95, 0.08);
}

.full-plan-item p {
  margin: 4px 0;
}

.full-plan-item ol {
  margin: 6px 0 0 18px;
  padding: 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.image-preview.empty {
  display: grid;
  place-items: center;
  padding: 16px;
  border-style: dashed;
  min-height: 180px;
  resize: horizontal;
}

.video-preview {
  border: 1px solid var(--line);
  background: #0e100d;
  border-radius: 8px;
  width: min(100%, var(--preview-width, 620px));
  aspect-ratio: var(--output-aspect-ratio, 9 / 16);
  min-height: 0;
  min-width: 240px;
  max-width: 100%;
  margin: 0 0 14px;
  display: grid;
  place-items: center;
  color: var(--muted);
  overflow: hidden;
  resize: horizontal;
  text-align: center;
}

.video-preview video {
  display: block;
  width: 100%;
  height: 100%;
  max-height: none;
  object-fit: contain;
  background: #000;
}

.video-preview.empty {
  padding: 16px;
  border-style: dashed;
}

.generation-placeholder {
  position: relative;
  display: grid;
  place-items: center;
  gap: 8px;
  width: 100%;
  min-height: 240px;
  padding: 24px;
  overflow: hidden;
  color: var(--text);
  text-align: center;
  background:
    linear-gradient(115deg, rgba(119, 168, 162, 0.08), rgba(224, 179, 81, 0.08)),
    #0b0d0a;
}

.video-preview .generation-placeholder {
  height: 100%;
  min-height: 100%;
}

.generation-shimmer {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(119, 168, 162, 0.12) 35%,
    rgba(224, 179, 81, 0.2) 50%,
    rgba(255, 255, 255, 0) 70%
  );
  transform: translateX(-100%);
  animation: generationShimmer 1.45s linear infinite;
}

.generation-placeholder strong,
.generation-placeholder span {
  position: relative;
  z-index: 1;
}

.generation-placeholder span {
  max-width: 28rem;
  color: var(--muted);
  font-size: 0.9rem;
}

@keyframes generationShimmer {
  to {
    transform: translateX(100%);
  }
}

.split-layout {
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(360px, 1.1fr);
  gap: 16px;
}

.start-screen {
  min-height: calc(100vh - 52px);
  display: grid;
  place-items: center;
  align-content: center;
  gap: 20px;
  padding: 24px;
}

.start-account-bar {
  width: min(920px, 100%);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  border: 1px solid rgba(244, 241, 232, 0.14);
  background: rgba(23, 25, 22, 0.76);
  border-radius: 8px;
  padding: 12px 14px;
  box-shadow: var(--shadow);
}

.start-account-bar span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
}

.start-account-bar strong {
  color: var(--text);
}

.start-hero {
  width: min(920px, 100%);
  display: grid;
  gap: 18px;
}

.start-hero h2 {
  max-width: 760px;
  font-size: clamp(2.4rem, 6vw, 5.4rem);
  line-height: 0.95;
}

.start-hero textarea {
  min-height: 220px;
  font-size: 1.05rem;
  line-height: 1.55;
  background: rgba(23, 25, 22, 0.92);
  border-color: rgba(244, 241, 232, 0.18);
  box-shadow: var(--shadow);
}

.start-hero .button-row {
  justify-content: flex-start;
}

.boards-layout {
  display: grid;
  grid-template-columns: minmax(520px, 1fr) minmax(300px, 380px);
  gap: 16px;
  align-items: start;
}

.board-list-panel {
  min-height: 620px;
  position: sticky;
  top: 22px;
  max-height: calc(100vh - 44px);
  overflow: auto;
}

.board-list {
  display: grid;
  gap: 10px;
  max-height: calc(100vh - 190px);
  overflow: auto;
  padding-right: 4px;
}

.board-media-grid {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(280px, 1fr);
  gap: 16px;
  align-items: start;
}

.media-work-panel,
.option-panel {
  border: 1px solid var(--line);
  background: rgba(32, 35, 31, 0.54);
  border-radius: 8px;
  padding: 14px;
}

.media-work-panel .image-preview,
.media-work-panel .video-preview {
  width: 100%;
  margin-bottom: 10px;
}

.board-options-stack {
  display: grid;
  gap: 16px;
  margin-top: 16px;
}

.batch-controls {
  border: 1px solid var(--line);
  background: rgba(32, 35, 31, 0.62);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 0;
}

.batch-controls-panel .batch-controls {
  background: rgba(16, 17, 15, 0.26);
}

.batch-control-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.batch-controls progress {
  width: 100%;
  height: 12px;
  margin-top: 12px;
  accent-color: var(--accent);
}

.pipeline-panel {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}

.pipeline-panel progress {
  width: 100%;
  height: 14px;
  accent-color: var(--accent);
}

.pipeline-steps {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.pipeline-step {
  border: 1px solid var(--line);
  background: var(--surface-2);
  border-radius: 7px;
  padding: 8px 10px;
  text-align: center;
  color: var(--muted);
  font-size: 0.78rem;
}

.pipeline-step.done {
  border-color: rgba(102, 179, 132, 0.55);
  color: #c9ead9;
  background: rgba(102, 179, 132, 0.1);
}

.pipeline-step.active {
  border-color: rgba(224, 179, 81, 0.7);
  color: var(--text);
  background: rgba(224, 179, 81, 0.15);
}

.board-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 8px;
  align-items: stretch;
}

.board-row.active {
  outline: 1px solid rgba(224, 179, 81, 0.25);
  outline-offset: 2px;
  border-radius: 8px;
}

.board-select {
  width: 20px;
  height: 20px;
  align-self: start;
  margin: 14px 0 0;
}

.board-item {
  text-align: left;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text);
  border-radius: 7px;
  padding: 12px;
}

.board-item.active {
  border-color: var(--accent);
  background: rgba(224, 179, 81, 0.13);
}

.board-item strong {
  display: block;
  font-size: 0.94rem;
  margin-bottom: 5px;
}

.board-item span {
  color: var(--muted);
  font-size: 0.84rem;
}

.board-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.asset-badge {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 7px;
  color: var(--muted);
  font-size: 0.76rem;
}

.asset-badge.ready {
  color: #c9ead9;
  border-color: rgba(102, 179, 132, 0.55);
  background: rgba(102, 179, 132, 0.12);
}

.asset-badge.pending {
  color: #f0d8a4;
  border-color: rgba(224, 179, 81, 0.55);
  background: rgba(224, 179, 81, 0.12);
}

.cost-report {
  display: grid;
  gap: 8px;
  align-content: start;
  justify-items: stretch;
}

.official-total {
  border: 1px solid rgba(224, 179, 81, 0.55);
  background: rgba(224, 179, 81, 0.13);
  color: var(--text);
  border-radius: 8px;
  padding: 16px 18px;
  margin-bottom: 12px;
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: 0;
}

.cost-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  border-radius: 7px;
  padding: 10px 12px;
}

.cost-line.important {
  border-color: rgba(224, 179, 81, 0.55);
  background: rgba(224, 179, 81, 0.12);
}

.cost-section-title {
  margin-top: 8px;
  color: var(--text);
  font-weight: 800;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.board-context-banner {
  margin: -10px 24px 18px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.92rem;
}

.admin-spend-panel {
  grid-column: 1 / -1;
}

.spend-report {
  display: grid;
  gap: 12px;
}

.spend-total {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.spend-total > div,
.spend-row {
  border: 1px solid var(--line);
  background: var(--surface-2);
  border-radius: 7px;
  padding: 10px 12px;
}

.spend-total span {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
  margin-bottom: 5px;
}

.spend-total strong {
  color: var(--text);
  font-size: 1rem;
}

.spend-table {
  display: grid;
  gap: 6px;
  overflow-x: auto;
}

.spend-row {
  display: grid;
  grid-template-columns: 1fr 1.4fr 0.9fr 1fr 0.8fr 1.2fr;
  gap: 10px;
  align-items: center;
  min-width: 880px;
  font-size: 0.82rem;
}

.spend-row.project-profit-row {
  grid-template-columns: 1fr 1.4fr 1fr 0.9fr 0.8fr 1.2fr 0.8fr;
  min-width: 1040px;
}

.spend-row.credit-ledger-row {
  grid-template-columns: 1.1fr 1fr 1.45fr 0.7fr 0.7fr 0.7fr 1.2fr;
  min-width: 1080px;
}

.spend-row.generation-report-row {
  grid-template-columns: 1.35fr 1.35fr 0.9fr 1.25fr 1fr 1.35fr 0.8fr 0.7fr;
  min-width: 1240px;
}

.ledger-credit {
  color: #c9ead9;
}

.ledger-debit {
  color: #f0b4a4;
}

.settings-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 10px 0 12px;
}

.settings-summary > div {
  border: 1px solid var(--line);
  background: var(--surface-2);
  border-radius: 7px;
  padding: 10px;
  display: grid;
  gap: 4px;
}

.settings-summary span {
  color: var(--muted);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.settings-summary strong {
  color: var(--text);
  overflow-wrap: anywhere;
}

.invite-code-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.invite-code-card {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  border-radius: 7px;
  padding: 10px 12px;
}

.invite-code-card.used {
  opacity: 0.66;
}

.invite-code-card strong,
.invite-code-card span {
  display: block;
}

.invite-code-card span {
  color: var(--muted);
  font-size: 0.78rem;
}

.spend-head {
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(4, 6, 7, 0.72);
  backdrop-filter: blur(8px);
}

.modal-card {
  width: min(520px, 100%);
  border: 1px solid rgba(224, 179, 81, 0.45);
  background: #111312;
  border-radius: 8px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
  padding: 22px;
}

.readiness-modal-card {
  width: min(980px, 100%);
  max-height: min(86vh, 900px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.modal-title-row {
  display: flex;
  gap: 16px;
  justify-content: space-between;
  align-items: flex-start;
}

.modal-card h3 {
  margin: 0 0 10px;
}

.modal-card p {
  margin: 0 0 14px;
  color: var(--text);
}

.modal-details {
  display: grid;
  gap: 7px;
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 0.88rem;
}

.readiness-scroll {
  display: grid;
  gap: 14px;
  overflow-y: auto;
  padding-right: 8px;
}

.readiness-section {
  border: 1px solid var(--line);
  background: #0e100d;
  border-radius: 8px;
  padding: 14px;
}

.readiness-section h4 {
  margin: 0 0 10px;
  color: var(--gold);
  font-size: 0.88rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.readiness-section ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 18px;
}

.readiness-section li {
  color: var(--muted);
  line-height: 1.45;
}

.readiness-section li strong {
  color: var(--text);
}

.readiness-section code {
  color: var(--gold);
}

.canon-preview {
  border: 1px solid var(--line);
  background: #0e100d;
  border-radius: 8px;
  padding: 14px;
  color: var(--muted);
}

.canon-preview pre {
  margin: 0;
  white-space: pre-wrap;
  line-height: 1.45;
  font-size: 0.86rem;
}

.board-editor {
  min-height: 620px;
}

.editor-fields {
  display: grid;
  gap: 12px;
}

.hidden {
  display: none;
}

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

.hidden,
.empty-state.hidden {
  display: none;
}

.prompt-output {
  display: grid;
  gap: 16px;
}

.pricing-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
  gap: 18px;
  align-items: center;
  margin-bottom: 16px;
  background:
    linear-gradient(135deg, rgba(224, 179, 81, 0.13), rgba(119, 168, 162, 0.08)),
    var(--surface);
}

.pricing-hero h2 {
  max-width: 760px;
  font-size: clamp(2rem, 4.5vw, 4.5rem);
  line-height: 0.96;
  margin: 8px 0 14px;
}

.pricing-hero p:not(.fine-print) {
  max-width: 760px;
  color: var(--muted);
  line-height: 1.55;
}

.pricing-credit-card {
  border: 1px solid rgba(224, 179, 81, 0.48);
  background: rgba(16, 17, 15, 0.72);
  border-radius: 8px;
  padding: 18px;
  box-shadow: var(--shadow);
}

.pricing-credit-card span,
.pricing-eyebrow {
  display: block;
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}

.pricing-credit-card strong {
  display: block;
  font-size: 1.55rem;
  margin-bottom: 8px;
}

.pricing-credit-card p {
  color: var(--muted);
  line-height: 1.45;
}

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

.credit-purchase-panel {
  margin-bottom: 16px;
  border-color: rgba(119, 168, 162, 0.42);
}

.credit-purchase-panel .panel-header > strong {
  font-size: 1.8rem;
  color: var(--accent);
}

.purchase-grid {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(220px, 0.55fr);
  gap: 14px;
  align-items: end;
  margin: 10px 0 14px;
}

.purchase-slider-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.84rem;
}

.pricing-card {
  display: grid;
  gap: 12px;
  align-content: start;
}

.pricing-card.primary {
  border-color: rgba(224, 179, 81, 0.42);
}

.pricing-card h3 {
  font-size: 1.2rem;
}

.pricing-card p,
.pricing-card li {
  color: var(--muted);
  line-height: 1.48;
}

.pricing-card ul {
  margin: 0;
  padding-left: 18px;
}

.pricing-lines {
  display: grid;
  gap: 8px;
}

.pricing-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  background: rgba(16, 17, 15, 0.32);
  border-radius: 7px;
  padding: 9px 10px;
}

.pricing-line span {
  color: var(--muted);
}

.pricing-line strong {
  color: var(--text);
  text-align: right;
}

.pricing-wide {
  display: grid;
  grid-template-columns: minmax(280px, 0.85fr) minmax(360px, 1.15fr);
  gap: 18px;
  align-items: start;
}

.media-frame {
  width: min(100%, 520px);
  margin: 0 auto;
  display: grid;
  gap: 8px;
}

.media-frame-large {
  width: min(100%, 980px);
}

.media-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  background: rgba(16, 17, 15, 0.72);
  border-radius: 7px;
  padding: 7px 8px;
}

.media-toolbar span {
  color: var(--muted);
  font-size: 0.82rem;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.media-frame-body img,
.media-frame-body video {
  width: 100%;
  max-height: min(72vh, 920px);
  object-fit: contain;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: #050604;
}

.media-frame:fullscreen {
  width: 100vw;
  height: 100vh;
  padding: 14px;
  background: #050604;
  align-content: center;
}

.media-frame:fullscreen .media-frame-body img,
.media-frame:fullscreen .media-frame-body video {
  max-height: calc(100vh - 70px);
}

.standalone-media-history {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(230px, 280px);
  gap: 10px;
  overflow-x: auto;
  padding: 10px 2px 2px;
  margin-top: 12px;
  scrollbar-width: thin;
}

.standalone-media-history.empty {
  display: block;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 7px;
  padding: 12px;
  text-align: center;
}

.standalone-media-card {
  border: 1px solid var(--line);
  background: var(--surface-2);
  border-radius: 7px;
  padding: 8px;
  display: grid;
  gap: 8px;
  cursor: pointer;
  min-width: 0;
}

.standalone-media-card.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(224, 179, 81, 0.25);
}

.standalone-media-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.standalone-media-thumb {
  width: 100%;
  aspect-ratio: 9 / 12;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #050604;
}

.standalone-media-thumb.placeholder {
  display: grid;
  place-items: stretch;
  padding: 0;
}

.standalone-media-thumb.placeholder .generation-placeholder {
  min-height: 100%;
  border: 0;
  border-radius: 6px;
}

.standalone-media-card-body {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.standalone-media-card-body strong,
.standalone-media-card-body span,
.standalone-media-card-body small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.standalone-media-card-body strong {
  color: var(--text);
  font-size: 0.88rem;
}

.standalone-media-card-body span,
.standalone-media-card-body small {
  color: var(--muted);
  font-size: 0.76rem;
}

.pricing-wide p {
  color: var(--muted);
  line-height: 1.55;
  margin-top: 8px;
}

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

.pricing-feature-grid > div {
  border: 1px solid var(--line);
  background: var(--surface-2);
  border-radius: 7px;
  padding: 12px;
}

.pricing-feature-grid strong,
.pricing-feature-grid span {
  display: block;
}

.pricing-feature-grid span {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.42;
  margin-top: 5px;
}

.prompt-card {
  border: 1px solid var(--line);
  background: #11130f;
  border-radius: 8px;
  overflow: hidden;
}

.prompt-card header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 14px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
}

.prompt-card header span {
  color: var(--muted);
}

.prompt-preview-textarea {
  min-height: 220px;
  font-family: Consolas, "Liberation Mono", monospace;
  font-size: 0.84rem;
}

.board-shot-prompts {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.board-shot-prompt {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #11130f;
}

.board-shot-prompt header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.04);
  border-bottom: 1px solid var(--line);
  font-size: 0.84rem;
}

.board-shot-prompt header span {
  color: var(--muted);
  white-space: nowrap;
}

.board-shot-prompt pre {
  max-height: 260px;
  font-size: 0.82rem;
}

pre {
  margin: 0;
  padding: 14px;
  overflow: auto;
  color: #eee7d8;
  white-space: pre-wrap;
  line-height: 1.48;
}

.estimate-grid {
  display: grid;
  grid-template-columns: minmax(280px, 420px) minmax(360px, 1fr);
  gap: 16px;
}

.viewer-layout {
  display: grid;
  grid-template-columns: minmax(360px, 1fr) minmax(360px, 1fr);
  gap: 16px;
  align-items: start;
}

.movie-only-bar {
  display: none;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
  border: 1px solid rgba(244, 241, 232, 0.14);
  background: rgba(23, 25, 22, 0.78);
  border-radius: 8px;
  padding: 12px 14px;
  box-shadow: var(--shadow);
}

.movie-only-bar span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
}

body.movie-mode .movie-only-bar {
  display: flex;
}

body.movie-mode #viewer {
  max-width: 1380px;
  margin: 0 auto;
}

body.movie-mode .viewer-hero {
  background: linear-gradient(135deg, rgba(224, 179, 81, 0.12), rgba(119, 168, 162, 0.08)), var(--surface);
}

body.movie-mode .viewer-layout {
  grid-template-columns: minmax(420px, 1.25fr) minmax(320px, 0.75fr);
}

.viewer-hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

.viewer-hero h3 {
  font-size: 1.3rem;
  margin-bottom: 6px;
}

.timeline-list {
  display: flex;
  gap: 8px;
  overflow: auto;
  padding-bottom: 4px;
}

.timeline-item {
  min-width: 180px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text);
  border-radius: 7px;
  padding: 10px;
  text-align: left;
}

.timeline-item.active {
  border-color: var(--accent);
  background: rgba(224, 179, 81, 0.13);
}

.timeline-item.ready {
  border-color: rgba(102, 179, 132, 0.55);
}

.timeline-item span {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
  margin-top: 4px;
}

.media-list {
  display: grid;
  gap: 8px;
  max-height: 360px;
  overflow: auto;
  margin-top: 14px;
  padding-right: 4px;
}

.media-item {
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text);
  border-radius: 7px;
  padding: 10px 12px;
  text-align: left;
}

.media-item.active {
  border-color: var(--accent);
  background: rgba(224, 179, 81, 0.13);
}

.media-item strong {
  display: block;
  margin-bottom: 4px;
}

.media-item span {
  display: block;
  color: var(--muted);
  font-size: 0.84rem;
}

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

.clip-include {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  color: var(--text);
  font-size: 0.82rem;
  white-space: nowrap;
}

.clip-include input {
  width: auto;
}

.clip-open-button {
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0;
  text-align: left;
  min-width: 0;
  cursor: pointer;
}

.clip-open-button strong,
.clip-open-button span {
  display: block;
}

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

.metric {
  border: 1px solid var(--line);
  background: var(--surface-2);
  border-radius: 7px;
  padding: 14px;
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  margin-bottom: 6px;
}

.metric strong {
  font-size: 1.35rem;
}

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

  .sidebar,
  .assistant-panel {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .control-grid {
    grid-template-columns: repeat(2, minmax(260px, 1fr));
  }

  .boards-layout,
  .board-media-grid,
  .canon-grid,
  .spend-total,
  .pricing-grid,
  .pricing-wide {
    grid-template-columns: 1fr;
  }

  .board-list-panel {
    position: static;
    max-height: none;
  }
}

@media (max-width: 760px) {
  body {
    overflow-x: hidden;
  }

  .workspace,
  .sidebar {
    padding: 12px;
  }

  .app-menu {
    top: 68px;
    right: 12px;
    left: 12px;
    width: auto;
    max-height: calc(100vh - 84px);
    overflow: auto;
  }

  .project-banner,
  .board-context-banner,
  .storage-warning {
    margin: 0 12px 12px;
    overflow-wrap: anywhere;
  }

  .storage-warning {
    display: grid;
    gap: 6px;
  }

  body.movie-mode .project-banner {
    width: calc(100% - 24px);
    margin-top: 12px;
  }

  body.movie-mode .storage-warning {
    width: calc(100% - 24px);
    margin-top: 12px;
  }

  .brand {
    grid-template-columns: 48px minmax(0, 1fr);
  }

  .brand-mark {
    width: 48px;
    height: 48px;
  }

  .topbar,
  .panel-header {
    display: grid;
    grid-template-columns: 1fr;
    align-items: start;
    gap: 10px;
  }

  .topbar {
    margin-bottom: 14px;
  }

  .top-account-cluster,
  .panel-header > div,
  .button-row {
    width: 100%;
  }

  .top-account-cluster {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .profile-button {
    min-width: 0;
    width: 100%;
  }

  .control-grid,
  .split-layout,
  .boards-layout,
  .board-media-grid,
  .canon-grid,
  .admin-grid,
  .batch-control-grid,
  .field-row.three-column,
  .estimate-grid,
  .viewer-layout,
  .metric-list,
  .pipeline-steps,
  .pricing-hero,
  .pricing-feature-grid {
    grid-template-columns: 1fr;
  }

  .panel {
    padding: 14px;
  }

  .admin-callout,
  .modal-title-row {
    display: grid;
    grid-template-columns: 1fr;
  }

  .readiness-modal-card {
    max-height: calc(100vh - 28px);
    padding: 16px;
  }

  .start-screen {
    min-height: 100vh;
    place-items: stretch;
    align-content: start;
    padding: 12px;
  }

  .start-account-bar,
  .movie-only-bar,
  .viewer-hero {
    display: grid;
    grid-template-columns: 1fr;
    align-items: start;
  }

  .start-hero h2,
  .pricing-hero h2 {
    font-size: 2.2rem;
    line-height: 1;
  }

  .start-hero textarea {
    min-height: 180px;
  }

  .image-preview,
  .video-preview {
    min-width: 0;
    width: 100%;
    resize: none;
  }

  .video-preview {
    aspect-ratio: var(--preview-ratio, 9 / 16);
    height: auto;
  }

  .generation-placeholder {
    min-height: 180px;
    padding: 18px;
  }

  .board-list-panel {
    min-height: 0;
  }

  .board-list,
  .media-list,
  .full-plan-list {
    max-height: none;
  }

  .full-plan-item,
  .spend-row,
  .admin-user-card,
  .invite-code-card {
    grid-template-columns: 1fr;
  }

  .timeline-item {
    min-width: min(72vw, 220px);
  }

  .modal-backdrop {
    align-items: start;
    padding: 12px;
    overflow: auto;
  }

  .modal-card {
    width: 100%;
    padding: 16px;
  }

  input,
  textarea,
  select,
  button {
    max-width: 100%;
  }
}
