:root {
  color-scheme: dark;
  --green: #a8e06a;
  --green-soft: #c4ee9a;
  --violet: #8b3fca;
  --violet-soft: #a870e0;
  --void: #060606;
  --surface: #111111;
  --surface-2: #181818;
  --surface-3: #202020;
  --line: rgba(240, 240, 240, 0.1);
  --line-strong: rgba(196, 238, 154, 0.26);
  --ink: #f0f0f0;
  --muted: rgba(240, 240, 240, 0.66);
  --muted-2: rgba(240, 240, 240, 0.42);
  --danger: #ff7a68;
  --blue: #7db7ff;
  --grad-main: linear-gradient(135deg, #a8e06a 0%, #8b3fca 100%);
  --grad-soft: linear-gradient(135deg, rgba(168, 224, 106, 0.16), rgba(139, 63, 202, 0.16));
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.34);
  --radius: 8px;
  --dur-fast: 100ms;
  --dur-base: 200ms;
  --dur-slow: 300ms;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background:
    radial-gradient(circle at 14% 0%, rgba(168, 224, 106, 0.12), transparent 30%),
    radial-gradient(circle at 86% 8%, rgba(139, 63, 202, 0.14), transparent 32%),
    var(--void);
  color: var(--ink);
  font-family: "Open Sans", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  letter-spacing: 0;
}

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

button {
  cursor: pointer;
}

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

.topbar {
  align-items: center;
  background: rgba(17, 17, 17, 0.86);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex;
  justify-content: space-between;
  gap: 24px;
  margin: 0 auto 18px;
  max-width: 1720px;
  padding: 18px 20px;
}

.brand-block {
  align-items: center;
  display: flex;
  gap: 14px;
}

.brand-mark {
  align-items: center;
  aspect-ratio: 1;
  background: var(--grad-main);
  border-radius: 8px;
  color: #060606;
  display: inline-flex;
  font-family: Futura, "Century Gothic", "Trebuchet MS", sans-serif;
  font-size: 20px;
  font-weight: 900;
  justify-content: center;
  min-width: 44px;
  text-transform: uppercase;
}

.topbar h1,
.section-heading h2 {
  margin: 0;
}

.topbar h1 {
  font-family: Futura, "Century Gothic", "Trebuchet MS", sans-serif;
  font-size: clamp(28px, 3vw, 42px);
  font-weight: 900;
}

.topbar-actions,
.inline-actions,
.dialog-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.eyebrow {
  color: var(--green);
  font-family: "DM Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  margin: 0 0 4px;
  text-transform: uppercase;
}

.workspace {
  align-items: start;
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(300px, 380px) minmax(0, 1fr);
  margin: 0 auto;
  max-width: 1720px;
}

.sidebar,
.planner {
  display: grid;
  gap: 18px;
}

.panel {
  background: rgba(17, 17, 17, 0.92);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
}

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

.section-heading h2 {
  font-family: Futura, "Century Gothic", "Trebuchet MS", sans-serif;
  font-size: 20px;
  font-weight: 900;
}

.field,
.platform-option {
  display: grid;
  gap: 7px;
}

.field {
  margin-bottom: 12px;
}

.field span,
.platform-option span {
  color: var(--muted);
  font-family: "DM Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  font-weight: 500;
}

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

input,
select,
textarea {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  outline: none;
  padding: 10px 11px;
  width: 100%;
}

textarea {
  min-height: 44px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(168, 224, 106, 0.14);
}

::placeholder {
  color: var(--muted-2);
}

.primary-button,
.ghost-button,
.icon-button {
  align-items: center;
  border-radius: 6px;
  display: inline-flex;
  font-weight: 800;
  justify-content: center;
  min-height: 38px;
  transition:
    transform var(--dur-fast) ease-in-out,
    border-color var(--dur-base) ease-in-out,
    background var(--dur-base) ease-in-out,
    color var(--dur-base) ease-in-out;
}

.primary-button {
  background: var(--grad-main);
  border: 0;
  color: #060606;
  padding: 0 14px;
}

.ghost-button {
  background: rgba(240, 240, 240, 0.04);
  border: 1px solid var(--line);
  color: var(--ink);
  padding: 0 12px;
}

.icon-button {
  aspect-ratio: 1;
  background: rgba(240, 240, 240, 0.04);
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 20px;
  line-height: 1;
  min-width: 38px;
  padding: 0;
}

.primary-button:hover,
.ghost-button:hover,
.icon-button:hover {
  transform: translateY(-1px);
}

.ghost-button:hover,
.icon-button:hover {
  border-color: var(--line-strong);
  color: var(--green-soft);
}

.primary-button:disabled {
  cursor: wait;
  filter: grayscale(0.35);
  opacity: 0.7;
}

.full-width {
  width: 100%;
}

.compact {
  min-height: 32px;
  padding: 0 10px;
}

.platform-list {
  display: grid;
  gap: 10px;
}

.platform-option {
  align-items: center;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  grid-template-columns: 22px minmax(0, 1fr);
  padding: 10px;
}

.platform-option:has(input:checked) {
  background: var(--grad-soft);
  border-color: var(--line-strong);
}

.platform-option input {
  accent-color: var(--green);
  height: 18px;
  padding: 0;
  width: 18px;
}

.platform-option strong {
  color: var(--ink);
  display: block;
}

.platform-option small {
  color: var(--muted);
  display: block;
  font-size: 12px;
  margin-top: 2px;
}

.rule-list {
  display: grid;
  gap: 8px;
  max-height: 270px;
  overflow: auto;
}

.rule-item {
  background: rgba(139, 63, 202, 0.12);
  border: 1px solid rgba(168, 112, 224, 0.28);
  border-radius: 6px;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.45;
  padding: 10px;
}

.empty-state {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  margin: 0;
}

.privacy-panel ul {
  color: var(--muted);
  line-height: 1.55;
  margin: 0;
  padding-left: 18px;
}

.system-status {
  display: grid;
  gap: 12px;
}

.status-grid {
  display: grid;
  gap: 10px;
}

.status-item {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  display: grid;
  gap: 3px;
  padding: 10px;
}

.status-item span {
  color: var(--muted);
  font-family: "DM Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
}

.status-item strong {
  color: var(--ink);
  font-size: 14px;
}

.status-item small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.skill-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.skill-chip-list span,
.pill {
  background: rgba(168, 224, 106, 0.12);
  border: 1px solid rgba(168, 224, 106, 0.22);
  border-radius: 999px;
  color: var(--green-soft);
  font-family: "DM Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  font-weight: 500;
  padding: 5px 8px;
}

.table-wrap {
  overflow-x: auto;
  width: 100%;
}

table {
  border-collapse: collapse;
  width: 100%;
}

th,
td {
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  background: var(--surface-2);
  color: var(--muted);
  font-family: "DM Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  font-weight: 500;
  padding: 10px;
  text-transform: uppercase;
  white-space: nowrap;
}

td {
  padding: 10px;
}

.input-table {
  min-width: 1120px;
}

.input-table th:nth-child(1) {
  width: 150px;
}

.input-table th:nth-child(2) {
  width: 150px;
}

.input-table th:nth-child(3) {
  width: 170px;
}

.input-table th:nth-child(5) {
  width: 230px;
}

.input-table th:nth-child(6) {
  width: 74px;
}

.row-actions {
  display: grid;
  gap: 8px;
}

.asset-box {
  display: grid;
  gap: 8px;
}

.asset-file {
  color: var(--blue);
  font-size: 12px;
  min-height: 18px;
}

.output-summary {
  align-items: center;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}

.output-scroll {
  max-height: 68vh;
}

.output-table {
  min-width: 1180px;
}

.output-table td {
  min-width: 230px;
}

.output-table td:first-child,
.output-table td:last-child {
  min-width: 140px;
}


.compact-select,
.variant-select {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  min-height: 34px;
  padding: 6px 9px;
  width: auto;
}

.status-badge {
  border: 1px solid var(--line);
  border-radius: 999px;
  display: inline-flex;
  font-family: "DM Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  font-weight: 700;
  padding: 5px 8px;
  white-space: nowrap;
}

.status-idea { color: var(--muted); }
.status-draft { color: var(--blue); border-color: rgba(125, 183, 255, 0.34); }
.status-internal_review { color: var(--green-soft); border-color: rgba(168, 224, 106, 0.34); }
.status-client_review { color: var(--violet-soft); border-color: rgba(168, 112, 224, 0.44); }
.status-changes_requested { color: #ffd27d; border-color: rgba(255, 210, 125, 0.44); }
.status-approved { color: var(--green); border-color: rgba(168, 224, 106, 0.5); background: rgba(168, 224, 106, 0.08); }
.status-published { color: #ffffff; border-color: rgba(255, 255, 255, 0.42); }

.caption-cell {
  display: grid;
  gap: 8px;
}

.quality-row {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.quality-row small {
  color: var(--muted);
  font-size: 12px;
}

.quality-badge {
  border: 1px solid var(--line);
  border-radius: 999px;
  display: inline-flex;
  font-family: "DM Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  font-weight: 700;
  padding: 5px 8px;
  white-space: nowrap;
}

.quality-green {
  background: rgba(168, 224, 106, 0.1);
  border-color: rgba(168, 224, 106, 0.38);
  color: var(--green);
}

.quality-yellow {
  background: rgba(255, 210, 125, 0.1);
  border-color: rgba(255, 210, 125, 0.38);
  color: #ffd27d;
}

.quality-red {
  background: rgba(255, 122, 104, 0.1);
  border-color: rgba(255, 122, 104, 0.42);
  color: var(--danger);
}

.caption-text {
  background: #0c0c0c;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: rgba(240, 240, 240, 0.92);
  line-height: 1.48;
  max-height: 260px;
  overflow: auto;
  padding: 10px;
  white-space: pre-wrap;
}

.quality-warnings {
  color: var(--muted);
  display: grid;
  font-size: 12px;
  gap: 3px;
  line-height: 1.35;
  margin: 0;
  padding-left: 17px;
}

.cell-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.tiny-button {
  background: rgba(240, 240, 240, 0.04);
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  min-height: 30px;
  padding: 0 9px;
}

.tiny-button.warn {
  border-color: rgba(168, 112, 224, 0.44);
  color: var(--violet-soft);
}

.feedback-dialog {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.58);
  color: var(--ink);
  max-width: min(720px, calc(100vw - 28px));
  padding: 0;
  width: 720px;
}

.feedback-dialog::backdrop {
  background: rgba(0, 0, 0, 0.72);
}

.feedback-form {
  padding: 18px;
}

.toast {
  background: var(--grad-main);
  border-radius: 6px;
  bottom: 22px;
  color: #060606;
  font-weight: 800;
  left: 50%;
  opacity: 0;
  padding: 11px 14px;
  pointer-events: none;
  position: fixed;
  transform: translate(-50%, 12px);
  transition:
    opacity var(--dur-base) ease-in-out,
    transform var(--dur-base) ease-in-out;
  z-index: 10;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

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

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

  .client-panel {
    grid-row: span 3;
  }
}

@media (max-width: 760px) {
  .app-shell {
    padding: 12px;
  }

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

  .brand-block {
    align-items: flex-start;
  }

  .topbar-actions,
  .inline-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar-actions > *,
  .inline-actions > * {
    width: 100%;
  }

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

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