:root {
  color-scheme: light;
  --ink: #101828;
  --muted: #667085;
  --line: #d9e2ef;
  --panel: #ffffff;
  --soft: #f4f7fb;
  --blue: #123c7c;
  --green: #00a676;
  --gold: #f3b51b;
  --dark: #070a0f;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--soft);
  color: var(--ink);
  font-family: Avenir Next, Inter, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

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

.app-shell {
  width: min(1160px, 100%);
  margin: 0 auto;
  padding: 18px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0 22px;
}

.brand-lockup { display: flex; align-items: center; gap: 12px; }
.brand-lockup strong { display: block; font-size: 20px; }
.brand-lockup span { display: block; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 1.4px; }

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.status-pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 11px;
  background: white;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.status-pill.online {
  border-color: rgba(0, 166, 118, .35);
  color: var(--green);
}

.status-pill.offline {
  border-color: rgba(194, 65, 12, .25);
  color: #c2410c;
}

.mark {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--blue);
  color: white;
  font-weight: 800;
  letter-spacing: 0;
}

.icon-button, .ghost-button, .primary-button, .format-button, .effect-button {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  background: white;
  color: var(--ink);
  font-weight: 700;
}

.primary-button {
  border-color: var(--blue);
  background: var(--blue);
  color: white;
}

.ghost-button { color: var(--blue); }

.settings-panel, .upload-card, .concept-card, .edit-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.settings-panel {
  padding: 18px;
  margin-bottom: 18px;
}

.panel-title, .section-heading, .editor-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.panel-title p, .eyebrow {
  margin: 0;
  color: var(--green);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1.8px;
}

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

.wide { grid-column: 1 / -1; }

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.checkbox-line {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
}

.checkbox-line input {
  width: 18px;
  height: 18px;
}

input, textarea, select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: white;
  color: var(--ink);
}

textarea { resize: vertical; }

.composer {
  display: grid;
  gap: 18px;
}

.intro h1, .section-heading h2 {
  margin: 6px 0 8px;
  letter-spacing: 0;
}

.intro p:last-child {
  margin: 0;
  color: var(--muted);
}

.upload-card {
  display: grid;
  grid-template-columns: minmax(260px, 420px) 1fr;
  gap: 18px;
  padding: 18px;
}

.drop-zone {
  position: relative;
  min-height: 420px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px dashed #98a2b3;
  border-radius: 8px;
  background: #eaf0f7;
}

.drop-zone input { display: none; }
.drop-zone img, .drop-zone video { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.drop-zone span { color: var(--blue); font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: 1.4px; z-index: 1; }

.replace-media-button {
  position: absolute;
  left: 12px;
  bottom: 12px;
  z-index: 2;
  min-height: 40px;
  border: 1px solid rgba(255,255,255,.8);
  border-radius: 8px;
  padding: 0 13px;
  background: rgba(16,24,40,.82);
  color: white;
  font-size: 12px;
  font-weight: 800;
  backdrop-filter: blur(8px);
}

.controls {
  display: grid;
  align-content: start;
  gap: 14px;
}

.ghost-button {
  background: #ffffff;
  border-color: var(--blue);
}

.concepts, .editor { margin-top: 28px; }
.concept-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.concept-list.carousel-mode {
  grid-template-columns: repeat(5, minmax(160px, 1fr));
  overflow-x: auto;
  padding-bottom: 4px;
}

.concept-card {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.concept-card h3 {
  margin: 0;
  min-height: 64px;
  font-size: 22px;
  line-height: 1.08;
}

.concept-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.editor-grid {
  display: grid;
  grid-template-columns: minmax(300px, 520px) 1fr;
  gap: 18px;
  margin-top: 14px;
  align-items: start;
}

.canvas-wrap {
  display: grid;
  place-items: center;
  overflow: auto;
  max-height: 76vh;
  background: #dfe7f0;
  border-radius: 8px;
  padding: 12px;
}

canvas {
  width: min(100%, 360px);
  height: auto;
  display: block;
  background: #111;
}

.edit-panel {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.segmented, .chip-row, .cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.format-button.active, .effect-button.active, .handle-color-button.active {
  background: var(--green);
  border-color: var(--green);
  color: white;
}

.carousel-editor {
  display: grid;
  gap: 10px;
}

.carousel-slide-editor {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.carousel-slide-editor strong {
  color: var(--ink);
  font-size: 12px;
}

@media (max-width: 820px) {
  .upload-card, .editor-grid, .concept-list, .form-grid { grid-template-columns: 1fr; }
  .drop-zone { min-height: 340px; }
  .wide { grid-column: auto; }
  .panel-title, .section-heading, .editor-actions { align-items: flex-start; flex-direction: column; }
}
