:root {
  --bg: #eef2f6;
  --surface: #ffffff;
  --ink: #172033;
  --muted: #667085;
  --line: #d8dee8;
  --soft: #f5f7fb;
  --primary: #162a5c;
  --accent: #e84e1b;
  --highlight: #f6bf3e;
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.auth-gate {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(180deg, #ffffff 0 46%, #f3f5f8 46% 100%);
}

.auth-panel {
  width: min(100%, 440px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 38px;
  box-shadow: 0 20px 60px rgba(23, 32, 51, 0.1);
}

.auth-brand-mark {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  margin-bottom: 28px;
  border-radius: 8px;
  background: #111827;
  color: #ffffff;
  font-weight: 900;
}

.auth-panel h1 {
  margin: 6px 0 12px;
  color: #111827;
  font-size: 34px;
  line-height: 1.08;
  letter-spacing: 0;
}

.auth-panel > p:not(.eyebrow):not(.auth-message) {
  margin: 0 0 26px;
  color: #5f6b7e;
  font-size: 16px;
  line-height: 1.55;
}

.google-sign-in {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border: 1px solid #cfd6e1;
  border-radius: 6px;
  background: #ffffff;
  color: #111827;
  font-weight: 750;
  text-decoration: none;
}

.google-sign-in:hover {
  border-color: #111827;
  background: #f8fafc;
}

.auth-message {
  margin: 16px 0 0;
  color: #b42318;
  font-size: 13px;
  line-height: 1.45;
}

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

button {
  border: 1px solid #111827;
  background: #fff;
  color: #111827;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 6px;
  font-weight: 800;
  cursor: pointer;
}

button:hover {
  background: #f7f7f7;
}

button.primary {
  background: #111827;
  color: #fff;
}

button.primary:hover {
  background: var(--accent);
  color: #111827;
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

button:has(.spin-icon) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.spin-icon {
  flex-shrink: 0;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes pulse-opacity {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 340px 1fr;
}

.sidebar {
  border-right: 1px solid var(--line);
  background: #fbfcfe;
  padding: 22px;
  overflow-y: auto;
}

.brand-lockup {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 14px;
  align-items: center;
  margin-bottom: 22px;
}

.brand-mark {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  background: var(--primary);
  color: #fff;
  border: 3px solid var(--accent);
  font-weight: 900;
  letter-spacing: 1px;
}

.brand-lockup h1 {
  margin: 0;
  font-size: 18px;
  line-height: 1.1;
}

.brand-lockup p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: 0 12px 30px rgba(16, 24, 40, 0.05);
}

.sidebar .panel + .panel {
  margin-top: 16px;
}

.panel h2,
.panel h3 {
  margin: 0;
  color: #111827;
}

.panel h2 {
  font-size: 16px;
}

.panel h3 {
  font-size: 14px;
}

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

.brand-panel {
  display: block;
}

.brand-panel summary {
  cursor: pointer;
  color: #111827;
  font-size: 16px;
  font-weight: 900;
}

.brand-panel .panel-head {
  margin-top: 14px;
}

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

.history-block + .history-block {
  margin-top: 16px;
}

.history-block h3 {
  margin: 0 0 8px;
  color: #344054;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.history-list {
  display: grid;
  gap: 8px;
}

.history-empty {
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  color: #667085;
  padding: 10px;
  font-size: 12px;
  line-height: 1.35;
}

.history-item {
  width: 100%;
  display: grid;
  gap: 4px;
  min-height: auto;
  border: 1px solid #dbe4ef;
  border-radius: 8px;
  background: #fff;
  padding: 10px;
  text-align: left;
  cursor: pointer;
}

.history-item:hover {
  border-color: var(--primary);
  background: #f8fafc;
}

.history-item.active {
  border-color: var(--primary);
  background: #eef4ff;
}

.history-item strong {
  color: var(--primary);
  font-size: 12px;
  line-height: 1.25;
}

.history-item span {
  color: #667085;
  font-size: 11px;
  line-height: 1.25;
}

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

.source-list {
  display: grid;
  gap: 8px;
}

.source-item {
  display: grid;
  gap: 4px;
  border: 1px solid #dbe4ef;
  border-radius: 8px;
  background: #fff;
  padding: 10px;
}

.source-item strong {
  color: var(--primary);
  font-size: 12px;
  line-height: 1.25;
}

.source-item span {
  color: #667085;
  font-size: 11px;
}

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

.activity-panel summary {
  cursor: pointer;
  color: #111827;
  font-size: 13px;
  font-weight: 700;
}

.activity-head {
  margin: 10px 0;
}

.icon-button {
  min-height: 32px;
  padding: 0 10px;
  font-size: 12px;
}

.hidden-control {
  display: none;
}

label {
  display: grid;
  gap: 7px;
  color: #344054;
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 13px;
}

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

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

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(22, 42, 92, 0.12);
}

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

.color-grid input {
  height: 42px;
  padding: 4px;
}

.avatar-row {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 10px;
  align-items: center;
  margin: -2px 0 14px;
}

.avatar-preview {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 2px solid var(--primary);
  border-radius: 50%;
  background: #f8fafc;
  color: var(--primary);
  font-size: 13px;
  font-weight: 900;
}

.avatar-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.workspace {
  padding: 26px;
  overflow: hidden;
}

.topbar {
  min-height: 86px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  margin-bottom: 18px;
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 2px;
  font-size: 12px;
  font-weight: 900;
}

.topbar h2 {
  margin: 0;
  max-width: 740px;
  font-size: 26px;
  line-height: 1.08;
  letter-spacing: 0;
}

.actions {
  display: flex;
  gap: 10px;
  white-space: nowrap;
}

.builder-grid {
  height: calc(100vh - 130px);
  min-height: 660px;
  display: grid;
  grid-template-columns: minmax(360px, 480px) minmax(0, 1fr);
  gap: 20px;
}

.editor {
  overflow-y: auto;
}

.editor h2 {
  margin-bottom: 15px;
}

.idea-lab {
  border-bottom: 1px solid var(--line);
  margin: -2px -2px 18px;
  padding: 2px 2px 18px;
}

.idea-lab .panel-head {
  margin-bottom: 10px;
}

.idea-lab .panel-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.quick-prompts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: -2px 0 13px;
}

.chat-panel {
  border: 1px solid #dbe4ef;
  border-radius: 8px;
  background: #f8fafc;
  margin: 0 0 13px;
  overflow: hidden;
}

.context-panel {
  border: 1px solid #dbe4ef;
  border-radius: 8px;
  background: #f8fafc;
  padding: 10px 12px 0;
  margin: 0 0 13px;
}

.context-panel summary {
  cursor: pointer;
  color: #344054;
  font-size: 12px;
  font-weight: 900;
  margin-bottom: 10px;
}

.chat-messages {
  display: grid;
  gap: 8px;
  max-height: 265px;
  overflow-y: auto;
  padding: 12px;
}

.chat-empty {
  color: #667085;
  font-size: 12px;
  line-height: 1.4;
}

.chat-message {
  max-width: 92%;
  border: 1px solid #dbe4ef;
  border-radius: 8px;
  background: #fff;
  padding: 9px 10px;
}

.chat-message.user {
  justify-self: end;
  border-color: #c6d2ea;
  background: #eef4ff;
}

.chat-message.assistant {
  justify-self: start;
}

.chat-message strong {
  display: block;
  color: var(--primary);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 4px;
}

.chat-message p {
  margin: 0;
  color: #344054;
  font-size: 12px;
  line-height: 1.42;
}

.chat-composer {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  border-top: 1px solid #dbe4ef;
  padding: 10px;
  background: #fff;
}

.chat-composer textarea {
  min-height: 42px;
  margin: 0;
}

.quick-prompts button {
  min-height: 30px;
  border-color: #cbd5e1;
  background: #f8fafc;
  color: #344054;
  padding: 0 10px;
  font-size: 12px;
}

.quick-prompts button:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.generate-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}

.advanced-options {
  border: 1px solid #dbe4ef;
  border-radius: 8px;
  background: #f8fafc;
  padding: 10px 12px 0;
  margin: -2px 0 13px;
}

.advanced-options summary {
  cursor: pointer;
  color: #344054;
  font-size: 12px;
  font-weight: 900;
  margin-bottom: 10px;
}

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

.idea-status {
  border: 1px solid #dbe4ef;
  border-radius: 8px;
  background: #f8fafc;
  color: #475467;
  padding: 10px 12px;
  font-size: 12px;
  font-weight: 800;
}

.idea-card {
  border: 1px solid #d9e1ed;
  border-left: 5px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  padding: 12px;
  cursor: pointer;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.idea-card:hover,
.idea-card.selected {
  border-color: var(--primary);
  border-left-color: var(--accent);
  box-shadow: 0 10px 24px rgba(16, 24, 40, 0.09);
  transform: translateY(-1px);
}

.idea-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 7px;
}

.idea-card-head span {
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 1.3px;
  font-size: 10px;
  font-weight: 900;
}

.idea-card-head button {
  min-height: 28px;
  padding: 0 9px;
  border-color: #cbd5e1;
  font-size: 11px;
}

.idea-card h3 {
  margin: 0 0 6px;
  color: var(--primary);
  font-size: 15px;
  line-height: 1.2;
}

.idea-card p {
  margin: 0;
  color: #475467;
  font-size: 12px;
  line-height: 1.35;
}

.idea-points {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 9px;
}

.idea-points span {
  border: 1px solid #dbe4ef;
  border-radius: 999px;
  background: #f8fafc;
  color: #344054;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 800;
}

.fine-tune {
  margin-top: 15px;
}

.fine-tune summary {
  cursor: pointer;
  color: #111827;
  font-size: 14px;
  font-weight: 900;
  margin-bottom: 14px;
}

.item-editor-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: 8px 0 12px;
}

.item-editor-head button {
  min-height: 32px;
  font-size: 12px;
}

.items-editor {
  display: grid;
  gap: 12px;
  margin-bottom: 15px;
}

.item-card {
  border: 1px solid #d9e1ed;
  background: var(--soft);
  border-radius: 8px;
  padding: 12px;
}

.item-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.item-card-head strong {
  font-size: 12px;
  color: var(--primary);
}

.item-card-head button {
  min-height: 28px;
  padding: 0 8px;
  border-color: #c5cedb;
  color: #7a271a;
  font-size: 12px;
}

.preview-wrap {
  min-width: 0;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 12px;
}

.preview-toolbar {
  min-height: 54px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 14px;
}

.preview-toolbar strong {
  display: block;
  font-size: 14px;
}

.preview-toolbar span {
  color: var(--muted);
  font-size: 12px;
}

.preview-stage {
  min-height: 0;
  overflow: auto;
  display: grid;
  place-items: center;
  background:
    linear-gradient(45deg, #dfe5ee 25%, transparent 25%),
    linear-gradient(-45deg, #dfe5ee 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #dfe5ee 75%),
    linear-gradient(-45deg, transparent 75%, #dfe5ee 75%);
  background-size: 28px 28px;
  background-position: 0 0, 0 14px, 14px -14px, -14px 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
}

.asset-preview {
  display: grid;
  place-items: center;
}

.asset-preview svg {
  display: block;
  width: min(100%, 620px);
  max-height: calc(100vh - 240px);
  filter: drop-shadow(0 18px 35px rgba(16, 24, 40, 0.24));
}

.preview-empty {
  width: min(100%, 520px);
  min-height: 280px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  border: 1px dashed #b8c3d1;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  padding: 24px;
  text-align: center;
}

.preview-empty strong {
  color: var(--primary);
  font-size: 18px;
}

.preview-empty span {
  max-width: 340px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

/* Chat-first presentation */
:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --ink: #0d0d0d;
  --muted: #6b7280;
  --line: #e5e5e5;
  --soft: #f7f7f8;
  --radius: 12px;
}

body {
  background: #ffffff;
  color: #0d0d0d;
}

button {
  border-color: #d9d9e3;
  border-radius: 999px;
  font-weight: 650;
}

button.primary,
button.primary:hover {
  background: #0d0d0d;
  color: #ffffff;
}

.app-shell {
  grid-template-columns: 292px minmax(0, 1fr);
  background: #ffffff;
}

.sidebar {
  background: #f9f9f9;
  border-right: 1px solid #e3e3e3;
  padding: 12px;
}

.brand-lockup {
  grid-template-columns: 34px 1fr;
  gap: 10px;
  margin: 4px 4px 14px;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 8px;
  background: #0d0d0d;
  font-size: 11px;
}

.brand-lockup h1 {
  font-size: 14px;
  font-weight: 700;
}

.brand-lockup p {
  font-size: 12px;
}

.panel {
  border: 0;
  border-radius: 10px;
  background: transparent;
  box-shadow: none;
  padding: 10px;
}

.history-panel {
  background: transparent;
}

.panel-head {
  margin-bottom: 10px;
}

.panel h2 {
  font-size: 13px;
  font-weight: 700;
}

.history-block h3 {
  color: #8a8a8a;
  font-size: 11px;
  letter-spacing: 0;
  text-transform: none;
}

.history-empty {
  border: 0;
  background: transparent;
  color: #8a8a8a;
  padding: 7px 8px;
}

.history-item {
  border: 0;
  border-radius: 8px;
  background: transparent;
  padding: 9px 10px;
}

.history-item:hover,
.history-item.active {
  border-color: transparent;
  background: #ececec;
}

.history-item strong {
  color: #1f2937;
  font-weight: 600;
}

.history-item span {
  color: #7b7b7b;
}

.brand-panel {
  margin-top: 10px;
  border-top: 1px solid #e7e7e7;
  border-radius: 0;
  padding-top: 14px;
}

.brand-panel summary {
  font-size: 13px;
  font-weight: 700;
}

.workspace {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr;
  padding: 0;
  overflow: hidden;
}

.topbar {
  min-height: 64px;
  align-items: center;
  border-bottom: 1px solid #eeeeee;
  margin: 0;
  padding: 12px 22px;
}

.eyebrow {
  display: none;
}

.topbar h2 {
  font-size: 18px;
  font-weight: 650;
  line-height: 1.25;
}

.actions button {
  min-height: 34px;
  border-color: #d9d9e3;
  background: #ffffff;
  font-size: 13px;
}

.builder-grid {
  height: calc(100vh - 65px);
  min-height: 0;
  grid-template-columns: minmax(0, 780px) minmax(330px, 420px);
  justify-content: center;
  gap: 0;
}

.editor {
  border: 0;
  border-radius: 0;
  background: #ffffff;
  padding: 0 24px;
  overflow: hidden;
}

.idea-lab {
  height: 100%;
  display: grid;
  grid-template-rows: auto auto 1fr auto auto auto;
  border-bottom: 0;
  margin: 0;
  padding: 18px 0 24px;
}

.idea-lab .panel-head {
  max-width: 720px;
  margin: 0 auto 12px;
  width: 100%;
}

.idea-lab .panel-head h2 {
  font-size: 26px;
  font-weight: 650;
  letter-spacing: 0;
}

.idea-lab .panel-head p {
  font-size: 14px;
  color: #6b7280;
}

.context-panel {
  max-width: 720px;
  width: 100%;
  justify-self: center;
  border: 0;
  background: transparent;
  padding: 0;
  margin: 0 0 10px;
}

.context-panel summary {
  color: #6b7280;
  font-size: 13px;
  font-weight: 600;
}

.chat-panel {
  min-height: 0;
  display: grid;
  grid-template-rows: 1fr auto;
  border: 0;
  border-radius: 0;
  background: transparent;
  margin: 0;
  overflow: hidden;
}

.chat-messages {
  max-width: 720px;
  width: 100%;
  max-height: none;
  align-content: start;
  justify-self: center;
  gap: 0;
  padding: 16px 0 22px;
}

.chat-empty {
  align-self: center;
  justify-self: center;
  max-width: 460px;
  padding: 44px 22px;
  color: #6b7280;
  font-size: 15px;
  line-height: 1.5;
  text-align: center;
}

.chat-message {
  max-width: 100%;
  width: 100%;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 14px;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 18px 0;
}

.chat-message::before {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #ffffff;
  font-size: 12px;
  font-weight: 800;
}

.chat-message.user,
.chat-message.assistant {
  justify-self: stretch;
  border-color: transparent;
  background: transparent;
}

.chat-message.user::before {
  content: "You";
  background: #111827;
}

.chat-message.assistant::before {
  content: "AI";
  background: #10a37f;
}

.chat-message strong {
  display: none;
}

.chat-message p {
  color: #1f2937;
  font-size: 15px;
  line-height: 1.65;
}

.chat-composer {
  max-width: 720px;
  width: 100%;
  justify-self: center;
  grid-template-columns: 1fr auto;
  gap: 10px;
  border: 1px solid #d9d9e3;
  border-radius: 24px;
  background: #ffffff;
  padding: 10px 10px 10px 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.chat-composer textarea {
  min-height: 48px;
  max-height: 140px;
  border: 0;
  padding: 11px 0;
  resize: none;
  font-size: 15px;
}

.chat-composer textarea:focus {
  box-shadow: none;
}

.chat-composer button {
  align-self: end;
  min-width: 64px;
  min-height: 38px;
  border: 0;
  background: #0d0d0d;
  color: #ffffff;
}

.quick-prompts {
  max-width: 720px;
  width: 100%;
  justify-self: center;
  margin: 12px auto 10px;
}

.quick-prompts button {
  min-height: 32px;
  border: 1px solid #e3e3e3;
  background: #ffffff;
  color: #4b5563;
  font-weight: 500;
}

.quick-prompts button:hover {
  border-color: #bdbdbd;
  color: #111827;
}

.generate-row {
  max-width: 720px;
  width: 100%;
  justify-self: center;
  grid-template-columns: auto auto;
  justify-content: start;
  margin: 0 0 12px;
}

.generate-row button {
  min-height: 38px;
  padding: 0 15px;
  font-size: 13px;
}

.idea-list {
  max-width: 720px;
  width: 100%;
  justify-self: center;
  overflow-y: auto;
  padding-right: 2px;
}

.idea-status {
  border: 0;
  background: #f7f7f8;
  color: #6b7280;
  font-weight: 500;
}

.brief-summary {
  display: grid;
  gap: 8px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #f9fafb;
  padding: 13px 14px;
}

.brief-summary-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.brief-summary-head span {
  color: #6b7280;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.brief-summary-head strong {
  color: #111827;
  font-size: 13px;
}

.brief-summary p {
  margin: 0;
  color: #374151;
  font-size: 13px;
  line-height: 1.45;
}

.brief-summary small {
  color: #6b7280;
  font-size: 11px;
  line-height: 1.35;
}

.brief-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.brief-tags span {
  border: 1px solid #d1d5db;
  border-radius: 999px;
  background: #ffffff;
  color: #374151;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 650;
}

.idea-card {
  border: 1px solid #ececec;
  border-left: 1px solid #ececec;
  border-radius: 12px;
  background: #ffffff;
  padding: 14px;
}

.idea-card:hover,
.idea-card.selected {
  border-color: #d1d5db;
  border-left-color: #d1d5db;
  box-shadow: none;
  transform: none;
}

.idea-card-head span {
  color: #6b7280;
  letter-spacing: 0;
  text-transform: none;
}

.idea-card h3 {
  color: #111827;
  font-size: 15px;
  font-weight: 650;
}

.fine-tune {
  display: none;
}

.preview-wrap {
  min-height: 0;
  border-left: 1px solid #eeeeee;
  background: #fbfbfb;
  padding: 14px;
}

.preview-toolbar {
  min-height: 44px;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0 0 10px;
}

.preview-toolbar strong {
  font-size: 13px;
  font-weight: 650;
}

.preview-stage {
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  background: #f4f4f5;
  padding: 16px;
}

.asset-preview svg {
  width: min(100%, 370px);
  max-height: calc(100vh - 150px);
  filter: drop-shadow(0 16px 34px rgba(0, 0, 0, 0.18));
}

.preview-empty {
  min-height: 360px;
  border: 0;
  background: #ffffff;
}

.source-panel summary,
.prompt-library summary {
  cursor: pointer;
  color: #4b5563;
  font-size: 13px;
  font-weight: 650;
}

.source-head {
  margin-top: 10px;
}

.prompt-library {
  max-width: 720px;
  width: 100%;
  justify-self: center;
  margin: 8px 0 10px;
}

.generation-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  border: 1px solid #d9d9e3;
  border-radius: 999px;
  background: #f7f7f8;
  color: #374151;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 650;
}

.generation-status::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10a37f;
  animation: pulseDot 900ms ease-in-out infinite alternate;
}

@keyframes pulseDot {
  from { opacity: 0.35; }
  to { opacity: 1; }
}

.preview-toolbar {
  gap: 8px;
}

.preview-toolbar > div {
  margin-right: auto;
}

.preview-dialog {
  width: min(96vw, 1280px);
  height: min(94vh, 980px);
  border: 0;
  border-radius: 14px;
  padding: 0;
  background: #ffffff;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
}

.preview-dialog::backdrop {
  background: rgba(17, 24, 39, 0.72);
}

.preview-dialog-head {
  min-height: 54px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid #e5e7eb;
  padding: 10px 14px;
}

.large-asset-preview {
  height: calc(100% - 54px);
  overflow: auto;
  display: grid;
  place-items: center;
  background: #f4f4f5;
  padding: 24px;
}

.large-asset-preview svg {
  display: block;
  width: auto;
  max-width: none;
  max-height: calc(94vh - 110px);
  filter: drop-shadow(0 16px 34px rgba(0, 0, 0, 0.18));
}

.large-asset-preview svg[width="1080"] {
  width: min(86vw, 720px);
  height: auto;
}

.carousel-viewer {
  display: grid;
  gap: 12px;
  justify-items: center;
  width: 100%;
}

.carousel-slide-frame {
  display: grid;
  place-items: center;
  width: 100%;
}

.carousel-slide-frame svg {
  display: block;
  width: min(100%, 370px);
  height: auto;
  max-height: calc(100vh - 220px);
  filter: drop-shadow(0 16px 34px rgba(0, 0, 0, 0.18));
}

.carousel-viewer.large .carousel-slide-frame svg {
  width: min(82vw, 760px);
  max-height: calc(94vh - 170px);
}

.carousel-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.carousel-controls span {
  min-width: 92px;
  color: #4b5563;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

.carousel-controls button {
  min-height: 32px;
  padding: 0 12px;
  font-size: 12px;
}

.carousel-controls button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

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

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .builder-grid {
    height: auto;
    grid-template-columns: 1fr;
  }

  .topbar {
    flex-direction: column;
  }
}

.simple-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(360px, 560px) minmax(0, 1fr);
  gap: 22px;
  padding: 28px;
}

.idea-home {
  min-height: calc(100vh - 56px);
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
  overflow-y: auto;
}

.brand-strip {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 12px;
  align-items: center;
  padding-bottom: 14px;
  border-bottom: 1px solid #e5eaf1;
}

.brand-strip strong {
  display: block;
  color: #111827;
  font-size: 16px;
  line-height: 1.2;
}

.brand-strip span {
  display: block;
  margin-top: 4px;
  color: #667085;
  font-size: 13px;
}

.hero-copy {
  padding: 22px 0 16px;
}

.hero-copy h1 {
  margin: 0;
  color: #111827;
  font-size: 30px;
  line-height: 1;
  letter-spacing: 0;
}

.hero-copy p:not(.eyebrow) {
  max-width: 430px;
  margin: 14px 0 0;
  color: #475467;
  font-size: 16px;
  line-height: 1.5;
}

.primary-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.big-action {
  min-height: 42px;
  padding: 0 16px;
  font-size: 14px;
}

.text-link,
.external-card-link {
  color: var(--primary);
  font-size: 13px;
  font-weight: 900;
  text-decoration: none;
}

.text-link:hover,
.external-card-link:hover {
  color: var(--accent);
}

.external-card-link {
  display: inline-flex;
  margin-top: 12px;
}

.simple-preview {
  min-height: calc(100vh - 56px);
}

.simple-preview .preview-stage {
  border: 1px solid var(--line);
  border-radius: 8px;
}

@media (max-width: 1100px) {
  .simple-shell {
    grid-template-columns: 1fr;
    padding: 16px;
  }

  .idea-home,
  .simple-preview {
    min-height: auto;
  }

  .hero-copy {
    padding-top: 28px;
  }

  .hero-copy h1 {
    font-size: 36px;
  }
}

@media (max-width: 640px) {
  .workspace,
  .sidebar {
    padding: 14px;
  }

  .actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .actions button {
    flex: 1;
  }
}

.plan-app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  background: #f7f8fb;
}

.plan-sidebar {
  display: flex;
  flex-direction: column;
  gap: 22px;
  border-right: 1px solid #e5e7eb;
  background: #ffffff;
  padding: 22px 18px;
}

.brand-strip.compact {
  grid-template-columns: 38px 1fr;
  border-bottom: 0;
  padding-bottom: 0;
}

.plan-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.plan-nav button {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  min-height: 40px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #6b7280;
  font-size: 13.5px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}

.plan-nav button:hover {
  background: #f5f6f8;
  color: #374151;
}

.plan-nav button svg {
  flex-shrink: 0;
  opacity: 0.55;
  transition: opacity 0.12s;
}

.plan-nav button:hover svg {
  opacity: 0.75;
}

.plan-nav button.active {
  background: #fff0ec;
  color: var(--accent, #e84e1b);
  box-shadow: inset 3px 0 0 var(--accent, #e84e1b);
  font-weight: 700;
}

.plan-nav button.active svg {
  opacity: 1;
}

.sidebar-note {
  margin-top: auto;
  display: grid;
  gap: 7px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fbfcff;
  padding: 12px;
}

.sidebar-note strong {
  color: #111827;
  font-size: 13px;
}

.sidebar-note span {
  color: #667085;
  font-size: 12px;
  line-height: 1.4;
}

.plan-main {
  min-width: 0;
  padding: 20px 14px 28px;
}

.plan-topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}

.plan-topbar h1 {
  margin: 0;
  color: #111827;
  font-size: 24px;
  line-height: 1.1;
}

.plan-actions {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}

.user-menu {
  display: flex;
  align-items: center;
  gap: 9px;
  padding-left: 10px;
  border-left: 1px solid #e5e7eb;
}

.user-menu img {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
}

.user-menu strong {
  display: block;
  max-width: 150px;
  overflow: hidden;
  color: #111827;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-menu button {
  min-height: 0;
  border: 0;
  padding: 2px 0 0;
  background: transparent;
  color: #667085;
  font-size: 11px;
  font-weight: 650;
}

.user-menu button:hover {
  color: var(--accent);
  background: transparent;
}

.engine-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 38px;
  border: 1px solid #bfdbfe;
  border-radius: 12px;
  background: #eff6ff;
  color: #2563eb;
  padding: 0 16px;
  margin-bottom: 14px;
}

.engine-banner strong,
.engine-banner span {
  font-size: 13px;
}

.platform-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  margin-bottom: 14px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.platform-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid transparent;
  background: transparent;
  padding: 5px 10px 5px 5px;
  min-height: auto;
  border-radius: 999px;
  font-weight: 700;
}

.platform-tab:hover {
  background: #f5f6f8;
}

.platform-tab.active {
  background: #eef2ff;
  border-color: #c7d2fe;
}

.platform-tab-icon {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #9aa3b2;
  flex-shrink: 0;
}

.platform-tab-icon.platform-tab-all {
  background: #475467;
  color: #fff;
  font-size: 10px;
  font-weight: 900;
}

.platform-tab-label {
  color: #667085;
  font-size: 11px;
  font-weight: 700;
  padding-right: 2px;
  white-space: nowrap;
}

.platform-tab.active .platform-tab-label {
  color: #4f46e5;
}

.plan-stats-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}

.stat-chip {
  display: flex;
  align-items: baseline;
  gap: 7px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #ffffff;
  padding: 8px 14px;
}

.stat-chip strong {
  color: #111827;
  font-size: 18px;
  line-height: 1;
}

.stat-chip span {
  color: #667085;
  font-size: 12px;
  font-weight: 650;
}

.stat-chip.muted {
  background: #fbfcfe;
}

.stat-chip.muted strong,
.stat-chip.muted span {
  color: #9aa3b2;
}


.calendar-toolbar {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 18px 0 10px;
}

.calendar-month-nav {
  display: flex;
  align-items: center;
  gap: 10px;
}

.calendar-month-nav strong {
  color: #111827;
  font-size: 24px;
  line-height: 1;
  min-width: 190px;
}

.calendar-month-nav button {
  width: 30px;
  height: 30px;
  min-height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid #e2e8f0;
  border-radius: 7px;
  background: #ffffff;
  color: #475467;
  padding: 0;
}

.calendar-month-nav button:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: #fff7ed;
}

.calendar-toolbar span,
.calendar-toolbar #calendarToolbarHint {
  color: #667085;
  font-size: 15px;
  font-weight: 650;
}

#calendarToolbarHint button[data-generate-month] {
  border: 0;
  background: none;
  padding: 0;
  min-height: auto;
  color: var(--accent);
  font-size: 15px;
  font-weight: 800;
  text-decoration: underline;
  cursor: pointer;
}

#calendarToolbarHint button[data-generate-month]:hover {
  color: var(--primary);
}

.content-calendar {
  display: grid;
  grid-template-columns: repeat(7, minmax(160px, 1fr));
  grid-template-rows: 46px;
  grid-auto-rows: 194px;
  min-width: 1120px;
  border: 1px solid #e5e7eb;
  background: #ffffff;
}

.calendar-scroll {
  width: 100%;
  overflow-x: auto;
  padding-bottom: 8px;
  scrollbar-gutter: stable;
}

.calendar-weekday {
  display: grid;
  place-items: center;
  min-height: 46px;
  padding: 0 12px;
  border-bottom: 1px solid #e5e7eb;
  color: #111827;
  font-size: 13px;
  font-weight: 900;
  text-align: center;
  letter-spacing: 0;
}

.calendar-cell {
  position: relative;
  min-height: 0;
  border-right: 1px solid #e5e7eb;
  border-bottom: 1px solid #e5e7eb;
  padding: 38px 12px 12px;
  background: #ffffff;
}

.calendar-cell:nth-child(7n) {
  border-right: 0;
}

.calendar-cell.muted {
  background: #fbfcfe;
}

.calendar-cell.selected {
  background: #fff8ef;
}

.calendar-cell.is-past:not(.selected) {
  background: #fafafb;
}

.calendar-cell.is-past .calendar-day {
  color: #aab1bd;
}

.calendar-cell.is-today {
  background: #fff7ed;
}

.calendar-cell.is-today .calendar-day {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent);
  color: #ffffff;
}

.calendar-day {
  position: absolute;
  top: 13px;
  left: 13px;
  color: #667085;
  font-size: 14px;
  font-weight: 650;
  line-height: 1;
}

.calendar-post {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  height: 146px;
  border: 1px solid #d9dee8;
  border-radius: 8px;
  background: #ffffff;
  padding: 10px;
  text-align: left;
  box-shadow: 0 1px 0 rgba(16, 24, 40, 0.02);
  overflow: hidden;
}

.calendar-post:hover {
  border-color: var(--primary);
  box-shadow: 0 8px 18px rgba(16, 24, 40, 0.08);
}

.calendar-channel-count {
  position: absolute;
  top: 8px;
  right: 8px;
  border: 1px solid #dbe3ef;
  border-radius: 999px;
  background: #f8fafc;
  color: #64748b;
  padding: 3px 7px;
  font-size: 9px;
  font-weight: 800;
  line-height: 1;
}

.calendar-post > .status-pill {
  align-self: flex-start;
  max-width: calc(100% - 66px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-post-title {
  color: #111827;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  overflow: hidden;
  font-size: 13px;
  line-height: 1.28;
  letter-spacing: 0;
}

.calendar-post-footer {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-top: 1px solid #edf1f6;
  padding-top: 8px;
}

.calendar-post-footer small {
  color: #667085;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 10px;
  font-weight: 750;
  text-decoration: underline;
}

.provider-pill {
  width: fit-content;
  border: 1px solid #d9e3f2;
  border-radius: 999px;
  background: #f8fafc;
  color: #41516b;
  flex: 0 0 auto;
  font-size: 9px;
  font-weight: 850;
  line-height: 1;
  padding: 4px 7px;
}

.provider-pill.asset-provider {
  border-color: #d7f0e5;
  background: #ecfdf5;
  color: #08724a;
}

.calendar-card-actions {
  position: absolute;
  right: 8px;
  bottom: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.16s ease;
}

.calendar-post:hover .calendar-card-actions,
.calendar-post:focus-within .calendar-card-actions,
.calendar-post.is-busy .calendar-card-actions {
  opacity: 1;
  pointer-events: auto;
}

.calendar-card-actions button {
  width: 25px;
  height: 25px;
  min-height: 25px;
  display: grid;
  place-items: center;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #ffffff;
  color: #667085;
  padding: 0;
  box-shadow: 0 3px 10px rgba(16, 24, 40, 0.08);
}

.calendar-card-actions button:hover {
  border-color: #d9dee8;
  color: var(--accent);
  background: #fff7ed;
}

.calendar-card-actions svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.calendar-add-post {
  width: 100%;
  height: 100%;
  min-height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed transparent;
  border-radius: 8px;
  background: transparent;
  color: #9aa6b8;
  opacity: 0;
  transition: opacity 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.calendar-cell:hover .calendar-add-post {
  opacity: 1;
  border-color: #d9dee8;
}

.calendar-add-post:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: #fff7ed;
}

.calendar-add-post svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.calendar-day-summary {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
  padding: 10px;
  text-align: left;
  cursor: pointer;
}

.calendar-day-summary:hover {
  border-color: var(--accent);
  background: #fff7ed;
}

.calendar-day-summary-count {
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  color: #51607a;
}

.calendar-day-summary-dots {
  display: flex;
  gap: 4px;
}

.day-summary-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #cbd5e1;
}

.day-summary-dot.is-busy {
  animation: pulse-opacity 1.2s ease-in-out infinite;
}

.day-summary-dot.asset-ready, .day-summary-dot.scheduled {
  background: #16a34a;
}

.day-summary-dot.drafting, .day-summary-dot.replacing {
  background: #d97706;
}

.day-summary-dot.needs-attention {
  background: #dc2626;
}

.calendar-day-summary-title {
  font-size: 12px;
  line-height: 1.3;
  color: #111827;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.status-pill {
  width: fit-content;
  border-radius: 6px;
  background: #e0f2fe;
  color: #0369a1;
  padding: 3px 7px;
  font-size: 9px;
  font-weight: 900;
  text-transform: uppercase;
}

.status-pill.asset-ready {
  background: #dcfce7;
  color: #047857;
}

.status-pill.scheduled {
  background: #dcfce7;
  color: #047857;
}

.status-pill.drafting {
  background: #fef3c7;
  color: #92400e;
}

.status-pill.queued {
  background: #eef2f7;
  color: #51607a;
}

.status-pill.replacing {
  background: #fef3c7;
  color: #92400e;
}

.status-pill.needs-attention {
  background: #fee2e2;
  color: #b91c1c;
}

.calendar-post-error {
  display: flex;
  align-items: center;
  gap: 4px;
  background: #fee2e2;
  color: #b91c1c;
  border-radius: 6px;
  padding: 4px 7px;
  font-size: 10px;
  font-weight: 750;
  line-height: 1.3;
}

.calendar-post-error .text-link {
  font-size: 10px;
  font-weight: 850;
  color: #b91c1c;
  text-decoration: underline;
}

.detail-error {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: #fee2e2;
  border: 1px solid #fecaca;
  border-radius: 10px;
  padding: 12px 14px;
  color: #991b1b;
}

.detail-error strong {
  font-size: 13px;
}

.detail-error span {
  font-size: 12px;
  line-height: 1.4;
  color: #b3413a;
}

.detail-error button {
  align-self: flex-start;
}

.status-pill.is-busy-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  animation: pulse-opacity 1.4s ease-in-out infinite;
}

.calendar-post.is-busy {
  opacity: 0.8;
}

.plan-detail {
  display: none;
  align-content: start;
  gap: 16px;
  border-left: 1px solid #e5e7eb;
  background: #ffffff;
  padding: 22px;
  overflow-y: auto;
}

.selected-post-panel {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #ffffff;
  padding: 18px;
}

.empty-detail {
  display: grid;
  gap: 8px;
  min-height: 140px;
  align-content: center;
  color: #667085;
}

.empty-detail strong {
  color: #111827;
}

.detail-head,
.detail-actions,
.detail-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.detail-head {
  justify-content: space-between;
  margin-bottom: 14px;
}

.detail-head small,
.detail-meta span {
  color: #667085;
  font-size: 12px;
}

.selected-post-panel h2 {
  margin: 0 0 10px;
  color: #111827;
  font-size: 20px;
  line-height: 1.18;
}

.selected-post-panel p {
  margin: 0 0 14px;
  color: #475467;
  font-size: 14px;
  line-height: 1.5;
}

.detail-meta {
  margin-bottom: 16px;
}

.detail-meta span {
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  padding: 5px 8px;
}

.plan-detail .simple-preview {
  min-height: auto;
}

.plan-detail .preview-stage {
  min-height: 420px;
}

.article-detail-view {
  max-width: 980px;
  margin: 0 auto;
}

.article-mode .plan-app {
  grid-template-columns: 190px minmax(0, 1fr);
}

.article-mode .plan-main {
  padding: 40px 48px;
}

.article-mode .plan-topbar,
.article-mode .engine-banner,
.article-mode .plan-detail,
.article-mode .calendar-toolbar,
.article-mode .calendar-scroll,
.article-mode .content-calendar {
  display: none;
}

.article-mode .article-detail-view {
  max-width: 1100px;
  margin: 0;
}

.settings-mode .plan-app {
  grid-template-columns: 190px minmax(0, 1fr);
}

.settings-mode .plan-main {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
}

.settings-mode .plan-topbar,
.settings-mode .engine-banner,
.settings-mode .platform-tabs,
.settings-mode .calendar-toolbar,
.settings-mode .calendar-scroll,
.settings-mode .content-calendar,
.settings-mode .article-detail-view,
.settings-mode .assets-view,
.settings-mode .plan-detail {
  display: none !important;
}

.settings-mode .settings-view {
  display: flex !important;
  flex: 1;
  overflow: hidden;
}

/* ── Assets full-page mode ───────────────────────────────────────── */
.assets-mode .plan-app {
  grid-template-columns: 190px minmax(0, 1fr);
}

.assets-mode .plan-main {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
}

.assets-mode .plan-topbar,
.assets-mode .engine-banner,
.assets-mode .platform-tabs,
.assets-mode .calendar-toolbar,
.assets-mode .calendar-scroll,
.assets-mode .content-calendar,
.assets-mode .article-detail-view,
.assets-mode .settings-view,
.assets-mode .plan-detail {
  display: none !important;
}

.assets-mode .assets-view {
  display: block;
  flex: 1;
  overflow-y: auto;
  padding: 32px 40px;
}

.article-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 8px 0 24px;
}

.edit-button {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
}

.edit-button.active {
  border-color: #4f46e5;
  background: #4f46e5;
}

.article-page {
  display: grid;
  gap: 18px;
  color: #111827;
}

.article-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.article-meta strong {
  color: #111827;
  font-size: 13px;
  text-transform: uppercase;
  margin-left: auto;
}

.platform-select-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  padding: 3px 10px 3px 3px;
  background: #fff;
}

.platform-select-icon {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  flex-shrink: 0;
}

.platform-select-wrap select {
  border: 0;
  background: none;
  padding: 0;
  min-height: auto;
  font-size: 12px;
  font-weight: 700;
  color: #344054;
  cursor: pointer;
}

.article-page h1 {
  max-width: 900px;
  margin: 0;
  color: #05070d;
  font-size: 34px;
  line-height: 1.12;
}

.article-page p {
  max-width: 920px;
  margin: 0;
  color: #475467;
  font-size: 16px;
  line-height: 1.7;
}

.article-angle {
  margin-top: -6px;
}

.article-topic-origin {
  margin: -8px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-style: italic;
}

.article-asset-panel {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #fbfbfc;
  overflow: hidden;
}

.article-asset-frame {
  min-height: 360px;
  display: grid;
  place-items: center;
  background:
    linear-gradient(135deg, rgba(232, 78, 27, 0.12), rgba(246, 191, 62, 0.18)),
    #fffaf5;
  overflow: hidden;
}

.article-asset-frame span {
  color: var(--primary);
  font-size: 28px;
  font-weight: 900;
}

.article-asset-frame.has-asset {
  min-height: auto;
  padding: 24px;
  background: #f3f4f6;
}

.article-asset-frame svg {
  display: block;
  width: min(720px, 100%);
  height: auto;
  max-height: 760px;
  border-radius: 4px;
  box-shadow: 0 18px 45px rgba(16, 24, 40, 0.16);
}

.asset-action-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 14px 18px;
  border-top: 1px solid #e5e7eb;
  background: #ffffff;
}

.platform-asset-section {
  padding-top: 4px;
}

.source-asset-section {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #fbfbfc;
  padding: 4px 16px;
}

.source-asset-section summary {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  padding: 12px 0;
  cursor: pointer;
  list-style: none;
}

.source-asset-section summary::-webkit-details-marker {
  display: none;
}

.source-asset-section summary::before {
  content: '▸';
  color: var(--muted);
  margin-right: 2px;
}

.source-asset-section[open] summary::before {
  content: '▾';
}

.source-asset-section summary strong {
  color: #111827;
  font-size: 14px;
}

.source-asset-section summary span {
  color: var(--muted);
  font-size: 12px;
}

.source-asset-section .article-asset-panel {
  margin-bottom: 14px;
}

.source-asset-section[open] {
  padding-bottom: 16px;
}

.platform-asset-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 12px;
}

.platform-asset-head h2 {
  margin: 0;
  color: #111827;
  font-size: 17px;
}

.platform-asset-head span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.platform-asset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}

.platform-asset-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #fff;
  padding: 12px;
}

.platform-asset-card.is-approved {
  border-color: #86efac;
  background: #f0fdf4;
}

.master-video-card {
  grid-column: span 2;
}

.master-video-icon {
  background: #111827;
  color: #ffffff;
}

.master-video-icon svg {
  width: 13px;
  height: 13px;
}

.master-video-destinations {
  color: #667085;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.4;
}

@media (max-width: 760px) {
  .master-video-card {
    grid-column: 1;
  }
}

.platform-asset-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.platform-asset-icon {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  flex-shrink: 0;
}

.platform-asset-card-head strong {
  font-size: 13px;
  color: #111827;
}

.format-pill {
  margin-left: auto;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  padding: 2px 9px;
  font-size: 11px;
  font-weight: 700;
  color: #667085;
  background: #f9fafb;
}

.platform-asset-preview {
  border-radius: 8px;
  overflow: hidden;
  background: #f3f4f6;
  min-height: 90px;
  display: grid;
  place-items: center;
}

.platform-asset-preview[role="button"] {
  cursor: zoom-in;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.platform-asset-preview[role="button"]:hover,
.platform-asset-preview[role="button"]:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--accent);
}

.platform-asset-preview svg {
  display: block;
  width: 100%;
  height: auto;
}

.platform-ready-video {
  display: block;
  width: 100%;
  aspect-ratio: 9 / 16;
  max-height: 420px;
  background: #111827;
  object-fit: contain;
}

.platform-asset-video-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 18px 10px;
  color: #667085;
  text-align: center;
}

.platform-asset-video-placeholder span {
  font-size: 12px;
  font-weight: 700;
  color: #344054;
  line-height: 1.3;
}

.platform-asset-text {
  margin: 0;
  color: #344054;
  font-size: 13px;
  line-height: 1.45;
  white-space: pre-wrap;
  min-height: 40px;
}

.platform-text-preview {
  width: 100%;
  min-height: 110px;
  display: block;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #f8fafc;
  color: #344054;
  padding: 14px;
  text-align: left;
  cursor: zoom-in;
}

.platform-text-preview span {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 5;
  overflow: hidden;
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-wrap;
}

.platform-text-preview:hover,
.platform-text-preview:focus-visible {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 1px var(--accent);
}

.large-text-post {
  width: min(760px, 90vw);
  margin: 0 auto;
  background: #ffffff;
  color: #111827;
  padding: 36px;
}

.large-text-post > span {
  display: block;
  margin-bottom: 18px;
  color: #667085;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.large-text-post p {
  margin: 0;
  font-size: 22px;
  line-height: 1.65;
  white-space: pre-wrap;
}

.platform-asset-charcount {
  color: var(--muted);
  font-size: 11px;
  margin-top: -6px;
}

.platform-asset-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: auto;
  min-height: 36px;
  width: 100%;
  min-width: 0;
}

.platform-asset-actions button,
.asset-action-link {
  min-height: 36px;
  border-radius: 7px;
  padding: 0 14px;
  font-size: 12px;
  font-weight: 800;
  white-space: normal;
  line-height: 1.15;
  text-align: center;
}

.asset-action-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--text);
  text-decoration: none;
}

.platform-asset-actions.video-actions {
  display: flex;
  justify-content: flex-end;
}

.platform-asset-actions.video-actions > * {
  width: 42px;
  min-width: 42px;
  height: 42px;
  margin: 0;
  padding: 0;
}

.asset-icon-button {
  display: grid;
  place-items: center;
  border: 1px solid #d9dee8;
  background: #ffffff;
  color: #475467;
}

.asset-icon-button:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: #fff7ed;
}

.asset-icon-button svg {
  width: 18px;
  height: 18px;
}

.asset-action-link:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.approve-toggle {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
}

.approve-toggle:hover {
  border-color: #c53d12;
  background: #c53d12;
  color: #ffffff;
}

.approve-toggle.approved {
  background: #16a34a;
  border-color: #16a34a;
  color: #fff;
}

.asset-retry-button {
  border-color: #d9dee8;
  background: #ffffff;
  color: #475467;
}

.asset-render-status {
  margin-right: auto;
  color: #667085;
  font-size: 12px;
  font-weight: 700;
}

.regenerate-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  border: 1px dashed #d9dee8;
  border-radius: 12px;
  background: #fafbfc;
  padding: 16px 18px;
}

.regenerate-head {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.regenerate-head strong {
  color: #111827;
  font-size: 14px;
}

.regenerate-head span {
  color: var(--muted);
  font-size: 13px;
}

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

.article-editor {
  display: grid;
  gap: 16px;
  max-width: 880px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #ffffff;
  padding: 18px;
}

.article-editor label {
  display: grid;
  gap: 7px;
  color: #344054;
  font-size: 12px;
  font-weight: 850;
}

.article-editor input,
.article-editor textarea,
.article-editor select {
  width: 100%;
  border: 1px solid #d9dee8;
  border-radius: 8px;
  background: #ffffff;
  color: #111827;
  padding: 11px 12px;
  font: inherit;
}

.instructions-dialog {
  width: min(760px, calc(100vw - 32px));
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 0;
  color: #111827;
}

.instructions-dialog::backdrop {
  background: rgba(17, 24, 39, 0.35);
}

.instructions-dialog-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 22px 26px 14px;
}

.instructions-dialog-head strong {
  font-size: 22px;
}

.instructions-dialog-head button {
  min-width: 34px;
  border: 0;
  background: transparent;
  font-size: 28px;
  line-height: 1;
}

.instructions-dialog label {
  display: grid;
  gap: 8px;
  padding: 14px 26px;
  color: #111827;
  font-size: 13px;
  font-weight: 850;
}

.instructions-dialog label span {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.instructions-dialog em {
  color: #667085;
  font-style: normal;
  font-weight: 650;
}

.instructions-dialog textarea,
.instructions-dialog input {
  width: 100%;
  border: 1px solid #d9dee8;
  border-radius: 8px;
  padding: 12px 14px;
  color: #111827;
  font: inherit;
}

.instructions-dialog textarea:focus,
.instructions-dialog input:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
  outline: none;
}

.instructions-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin: 18px 26px 24px;
  padding-top: 18px;
  border-top: 1px solid #e5e7eb;
}

.topic-picker-dialog {
  width: min(640px, calc(100vw - 32px));
  height: min(680px, calc(100vh - 64px));
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 0;
  color: #111827;
}

/* The dialog's own UA default (display:none when closed) only wins the
   cascade if no author rule sets `display` unconditionally — scope it to
   [open] so closing (which just drops this attribute) actually hides it. */
.topic-picker-dialog[open] {
  display: flex;
  flex-direction: column;
}

.topic-picker-dialog::backdrop {
  background: rgba(17, 24, 39, 0.35);
}

.topic-picker-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 20px 24px 12px;
  flex: 0 0 auto;
}

.topic-picker-head strong {
  font-size: 20px;
}

.topic-picker-custom {
  display: flex;
  gap: 8px;
  padding: 0 24px 14px;
  flex: 0 0 auto;
  border-bottom: 1px solid #e5e7eb;
  margin-bottom: 4px;
}

.topic-picker-custom input {
  flex: 1 1 auto;
  min-width: 0;
  border: 1px solid #d9dee8;
  border-radius: 8px;
  padding: 9px 11px;
  font: inherit;
  font-size: 13px;
}

.topic-picker-custom button {
  flex: 0 0 auto;
}

.topic-picker-custom-stacked {
  flex-direction: column;
  align-items: stretch;
}

.topic-picker-custom-stacked button {
  align-self: flex-end;
}

.topic-picker-custom textarea {
  border: 1px solid #d9dee8;
  border-radius: 8px;
  padding: 9px 11px;
  font: inherit;
  font-size: 12.5px;
  line-height: 1.4;
  resize: vertical;
  min-height: 70px;
}

.topic-picker-url-row {
  border-top: 1px dashed #e5e7eb;
  padding-top: 14px;
}

.topic-picker-url-preview {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0 24px 14px;
  padding: 12px 14px;
  border: 1px solid #d9e3f2;
  border-radius: 8px;
  background: #f8fafc;
}

.topic-picker-url-preview strong {
  font-size: 13px;
  color: #111827;
}

.topic-picker-url-preview p {
  font-size: 12px;
  line-height: 1.4;
  color: #51607a;
  margin: 0;
}

.topic-picker-url-preview-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.topic-picker-head button {
  min-width: 34px;
  border: 0;
  background: transparent;
  font-size: 26px;
  line-height: 1;
}

.topic-picker-filters {
  display: flex;
  gap: 8px;
  padding: 0 24px 14px;
  flex: 0 0 auto;
}

.topic-picker-filters input,
.topic-picker-filters select {
  border: 1px solid #d9dee8;
  border-radius: 8px;
  padding: 9px 11px;
  font: inherit;
  font-size: 13px;
}

.topic-picker-filters input {
  flex: 1 1 auto;
  min-width: 0;
}

.topic-picker-results {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 0 12px 18px;
}

.topic-picker-group {
  position: sticky;
  top: 0;
  background: #f8fafc;
  color: #51607a;
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 8px 12px;
  margin-top: 4px;
}

.topic-picker-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  text-align: left;
  border: 0;
  border-bottom: 1px solid #f1f4f9;
  background: transparent;
  padding: 12px;
  font: inherit;
  cursor: pointer;
}

.topic-picker-item:hover {
  background: #f5f8ff;
}

.topic-picker-item-title {
  font-size: 13.5px;
  color: #111827;
}

.topic-picker-item-tag {
  flex: 0 0 auto;
  border: 1px solid #d9e3f2;
  border-radius: 999px;
  background: #f8fafc;
  color: #41516b;
  font-size: 9px;
  font-weight: 850;
  padding: 3px 8px;
}

.topic-picker-time-row {
  display: flex;
  padding: 0 24px 14px;
  flex: 0 0 auto;
}

.topic-picker-time-row label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 750;
  color: #41516b;
}

.topic-picker-time-row input {
  border: 1px solid #d9dee8;
  border-radius: 8px;
  padding: 7px 10px;
  font: inherit;
  font-size: 13px;
}

.day-detail-dialog {
  width: min(560px, calc(100vw - 32px));
  max-height: min(640px, calc(100vh - 64px));
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 0;
  color: #111827;
}

.day-detail-dialog[open] {
  display: flex;
  flex-direction: column;
}

.day-detail-dialog::backdrop {
  background: rgba(17, 24, 39, 0.35);
}

.day-detail-results {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 0 24px;
}

.day-detail-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid #f1f4f9;
}

.day-detail-time {
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 850;
  color: #51607a;
  min-width: 44px;
}

.day-detail-title {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 13px;
  color: #111827;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.day-detail-title:hover {
  color: var(--accent);
}

.day-detail-actions {
  display: flex;
  gap: 4px;
  flex: 0 0 auto;
}

.day-detail-actions button {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #ffffff;
  color: #667085;
  padding: 0;
}

.day-detail-actions button:hover {
  border-color: #d9dee8;
  color: var(--accent);
  background: #fff7ed;
}

.day-detail-actions button.approved {
  background: #16a34a;
  border-color: #16a34a;
  color: #fff;
}

.day-detail-actions button.approved:hover {
  background: #15803d;
  border-color: #15803d;
  color: #fff;
}

.day-detail-actions svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.day-detail-dialog > .day-detail-actions {
  padding: 14px 24px 20px;
  border-top: 1px solid #e5e7eb;
  margin-top: 4px;
}

.day-detail-dialog > .day-detail-actions button {
  width: auto;
  height: auto;
  padding: 10px 16px;
  border-radius: 8px;
}

@media (max-width: 1280px) {
  .plan-app {
    grid-template-columns: 190px minmax(0, 1fr);
  }

  .plan-detail {
    grid-column: 1 / -1;
    border-left: 0;
    border-top: 1px solid #e5e7eb;
  }
}

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

  .plan-sidebar {
    display: none;
  }

  .plan-main,
  .plan-detail {
    padding: 16px;
  }

  .plan-topbar {
    display: grid;
  }

  .content-calendar {
    min-width: 0;
    grid-template-columns: 1fr;
    grid-template-rows: none;
    grid-auto-rows: auto;
  }

  .calendar-weekday,
  .calendar-cell.muted {
    display: none;
  }

  .calendar-cell {
    min-height: auto;
    border-right: 0;
  }
}

/* Asset option count + variation picker */
.option-count {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.option-count select {
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  font: inherit;
  color: var(--primary);
  cursor: pointer;
}

.asset-options {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.asset-options-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 12px;
}

.asset-options-head strong {
  color: var(--primary);
  font-size: 15px;
}

.asset-options-head span {
  color: var(--muted);
  font-size: 13px;
}

.asset-options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}

.asset-option {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px;
  border: 2px solid var(--line);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
}

.asset-option:hover {
  border-color: var(--primary);
  box-shadow: 0 6px 16px rgba(16, 24, 40, 0.12);
}

.asset-option.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(232, 78, 27, 0.18);
}

.asset-option-thumb {
  display: block;
  border-radius: 6px;
  overflow: hidden;
  background: #f7f9fc;
  border: 1px solid var(--line);
}

.asset-option-thumb svg {
  display: block;
  width: 100%;
  height: auto;
}

.asset-option-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.asset-option-num {
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
}

.asset-option.selected .asset-option-num {
  color: var(--accent);
}

.asset-option-provider {
  font-size: 11px;
  color: var(--muted);
}

/* Created-assets gallery view */
.assets-view {
  padding: 4px 2px 24px;
}

.assets-view-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 16px;
}

.assets-view-head h2 {
  margin: 0;
  color: var(--primary);
  font-size: 20px;
}

.assets-view-head span {
  color: var(--muted);
  font-size: 13px;
}

.assets-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
}

.asset-tile {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
}

.asset-tile:hover {
  border-color: var(--primary);
  box-shadow: 0 8px 20px rgba(16, 24, 40, 0.14);
  transform: translateY(-2px);
}

.asset-tile-thumb {
  display: block;
  border-radius: 8px;
  overflow: hidden;
  background: #f7f9fc;
  border: 1px solid var(--line);
}

.asset-tile-thumb svg {
  display: block;
  width: 100%;
  height: auto;
}

.asset-tile-meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.asset-tile-meta strong {
  color: var(--primary);
  font-size: 14px;
  line-height: 1.25;
}

.asset-tile-meta span {
  color: var(--muted);
  font-size: 12px;
}

/* Step-by-step reel dialog */
.reel-dialog {
  border: none;
  border-radius: 14px;
  padding: 0;
  width: min(92vw, 460px);
  box-shadow: 0 30px 80px rgba(16, 24, 40, 0.35);
}

.reel-dialog::backdrop {
  background: rgba(16, 24, 40, 0.55);
}

.video-background-dialog {
  width: min(92vw, 680px);
  border: 0;
  border-radius: 10px;
  background: #ffffff;
  padding: 24px;
  box-shadow: 0 30px 80px rgba(16, 24, 40, 0.35);
}

.video-background-dialog::backdrop {
  background: rgba(16, 24, 40, 0.55);
}

.video-background-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.video-background-head strong {
  color: #111827;
  font-size: 20px;
}

.video-background-head button {
  width: 34px;
  height: 34px;
  min-height: 34px;
  display: grid;
  place-items: center;
  padding: 0;
  font-size: 22px;
}

.video-background-dialog > p {
  margin: 10px 0 18px;
  color: #667085;
  font-size: 14px;
  line-height: 1.5;
}

.video-background-options {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
  max-height: 390px;
  overflow-y: auto;
}

.video-background-option {
  position: relative;
  display: grid;
  gap: 8px;
  border: 1px solid #d9dee8;
  border-radius: 8px;
  background: #ffffff;
  padding: 8px;
  cursor: pointer;
}

.video-background-option:has(input:checked) {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(232, 78, 27, 0.14);
}

.video-background-option input {
  position: absolute;
  top: 10px;
  right: 10px;
}

.video-background-option video,
.plain-background-swatch {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 6px;
  background: #f3f4f6;
  object-fit: cover;
}

.plain-background-swatch {
  background: #ffffff;
  border: 1px solid #e5e7eb;
}

.video-background-option strong {
  color: #344054;
  font-size: 12px;
  line-height: 1.3;
}

.video-background-upload {
  display: inline-flex;
  margin-top: 18px;
  cursor: pointer;
}

.video-background-upload input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.video-background-upload span {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  border: 1px solid #d9dee8;
  border-radius: 7px;
  padding: 0 14px;
  color: #344054;
  font-size: 13px;
  font-weight: 800;
}

.video-background-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid #e5e7eb;
}

.reel-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}

.reel-dialog-head strong {
  color: var(--primary);
  font-size: 16px;
}

.reel-dialog-head button {
  border: none;
  background: transparent;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  color: var(--muted);
}

.reel-stage {
  display: grid;
  place-items: center;
  padding: 18px;
  background: #eef2f6;
}

.reel-stage canvas {
  width: auto;
  height: min(64vh, 620px);
  border-radius: 10px;
  box-shadow: 0 12px 30px rgba(16, 24, 40, 0.22);
  background: #fff;
}

.reel-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-top: 1px solid var(--line);
  flex-wrap: wrap;
}

.reel-status {
  color: var(--muted);
  font-size: 13px;
  flex: 1 1 100%;
}

.reel-bg-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  border-top: 1px solid var(--line);
  flex-wrap: wrap;
}

.reel-bg-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}

.reel-bg-pick {
  position: relative;
  cursor: pointer;
}

.reel-bg-pick input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
}

.reel-bg-pick span {
  display: inline-block;
  padding: 5px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  background: var(--surface);
  color: var(--text);
  pointer-events: none;
}

.reel-bg-pick:hover span {
  border-color: var(--accent);
  color: var(--accent);
}

.reel-bg-name {
  font-size: 12px;
  color: var(--muted);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 200px;
}

/* ── Settings view ───────────────────────────────────────────────── */
.settings-view {
  display: none;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
}

.settings-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  flex: 1;
  overflow: hidden;
  height: 100%;
}

.settings-sub-nav {
  border-right: 1px solid var(--line);
  padding: 24px 0;
  overflow-y: auto;
  background: var(--surface);
}

.settings-group {
  margin-bottom: 28px;
}

.settings-group-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0 20px;
  margin: 0 0 6px;
}

.settings-nav-btn {
  display: block;
  width: 100%;
  text-align: left;
  padding: 9px 20px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  background: transparent;
  border: none;
  border-left: 3px solid transparent;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}

.settings-nav-btn:hover {
  background: rgba(0,0,0,0.04);
  color: var(--accent);
}

.settings-nav-btn.active {
  border-left-color: var(--accent);
  background: rgba(232,78,27,0.06);
  color: var(--accent);
  font-weight: 600;
}

.settings-panel-area {
  overflow-y: auto;
  padding: 40px 48px;
}

.settings-panel-inner h2 {
  font-size: 22px;
  font-weight: 800;
  margin: 0 0 6px;
  color: var(--text);
}

.settings-panel-desc {
  font-size: 14px;
  color: var(--muted);
  margin: 0 0 32px;
}

.settings-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 480px;
}

.settings-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}

.settings-field input[type="text"],
.settings-field select {
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 14px;
  background: #fff;
  color: var(--text);
  outline: none;
  transition: border-color 0.15s;
}

.settings-field input[type="text"]:focus,
.settings-field select:focus {
  border-color: var(--accent);
}

.settings-color-field .color-input-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.settings-color-field input[type="color"] {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  border: 1px solid var(--line);
  cursor: pointer;
  padding: 4px;
  background: #fff;
}

.color-hex {
  font-size: 13px;
  font-family: monospace;
  color: var(--muted);
}

.color-preview-strip {
  display: flex;
  gap: 10px;
  margin-top: 28px;
  max-width: 320px;
}

.color-preview-strip div {
  flex: 1;
  height: 36px;
  border-radius: 8px;
  border: 1px solid rgba(0,0,0,0.08);
}

/* Avatar upload */
.avatar-upload-zone {
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 12px;
  max-width: 420px;
  background: var(--surface);
}

.avatar-preview-img {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--accent);
}

.avatar-placeholder {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: var(--primary, #162a5c);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 32px;
  font-weight: 900;
  flex-shrink: 0;
}

.avatar-upload-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.settings-upload-btn {
  position: relative;
  cursor: pointer;
}

.settings-upload-btn input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.settings-upload-btn span {
  display: inline-block;
  padding: 8px 18px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  pointer-events: none;
}

.settings-remove-btn {
  padding: 7px 18px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
}

.settings-remove-btn:hover {
  border-color: #e11d48;
  color: #e11d48;
}

.channel-connection-card {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  border: 1px solid #d9dee8;
  border-radius: 8px;
  background: #ffffff;
  padding: 16px;
}

.channel-connections {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.meta-logo {
  background: #1877f2;
}

.threads-logo {
  background: #111111;
  font-size: 22px;
  font-weight: 900;
}

.channel-page-select {
  grid-column: 2 / -1;
  display: flex;
  align-items: center;
  gap: 10px;
}

.channel-page-select span {
  color: #667085;
  font-size: 12px;
  font-weight: 700;
}

.channel-page-select select {
  min-height: 36px;
  border: 1px solid #d9dee8;
  border-radius: 7px;
  background: #ffffff;
  padding: 0 10px;
}

.channel-connection-card.is-connected {
  border-color: #86efac;
  background: #f0fdf4;
}

.channel-logo {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #ffffff;
}

.youtube-logo {
  background: #ff0000;
}

.channel-logo svg {
  width: 24px;
  height: 24px;
}

.channel-connection-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.channel-connection-copy strong {
  color: #111827;
  font-size: 15px;
}

.channel-connection-copy span {
  color: #667085;
  font-size: 13px;
}

.settings-connect-button {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  border-radius: 7px;
  background: #111827;
  color: #ffffff;
  padding: 0 16px;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.channel-needs-config {
  color: #92400e;
  font-size: 12px;
  font-weight: 800;
}

.channel-setup-note {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
  border: 1px solid #fde68a;
  border-radius: 8px;
  background: #fffbeb;
  padding: 14px;
  color: #78350f;
  font-size: 13px;
}

.channel-setup-note code {
  overflow-wrap: anywhere;
  color: #111827;
}

.youtube-publish-button {
  border-color: #fecaca;
  color: #dc2626;
}

.facebook-publish-button {
  border-color: #bfdbfe;
  color: #1877f2;
}

.instagram-publish-button {
  border-color: #fbcfe8;
  color: #db2777;
}

.threads-publish-button {
  border-color: #d1d5db;
  color: #111827;
  font-size: 18px;
  font-weight: 900;
}

.linkedin-publish-button {
  border-color: #bfdbfe;
  color: #0a66c2;
  font-size: 15px;
  font-weight: 900;
}

.linkedin-logo {
  background: #0a66c2;
  color: #fff;
  font-weight: 900;
}

.youtube-published-link {
  background: #dcfce7;
  border-color: #86efac;
  color: #047857;
  text-decoration: none;
}

.youtube-publish-button:disabled svg {
  animation: spin 0.9s linear infinite;
}

@media (max-width: 640px) {
  .channel-connection-card {
    grid-template-columns: 44px minmax(0, 1fr);
  }

  .channel-connection-card > :last-child {
    grid-column: 1 / -1;
    justify-self: start;
  }
}

/* ── Sources full-page mode ──────────────────────────────────────── */
.sources-mode .plan-app {
  grid-template-columns: 190px minmax(0, 1fr);
}

.sources-mode .plan-main {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
}

.sources-mode .plan-topbar,
.sources-mode .engine-banner,
.sources-mode .platform-tabs,
.sources-mode .calendar-toolbar,
.sources-mode .calendar-scroll,
.sources-mode .content-calendar,
.sources-mode .article-detail-view,
.sources-mode .assets-view,
.sources-mode .settings-view,
.sources-mode .plan-detail {
  display: none !important;
}

.sources-mode .sources-view {
  display: block;
  flex: 1;
  overflow-y: auto;
}

/* ── Sources layout ──────────────────────────────────────────────── */
.sources-layout {
  padding: 36px 48px;
  display: flex;
  flex-direction: column;
  gap: 48px;
  max-width: 1100px;
}

.sources-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.sources-section-head h2 {
  font-size: 18px;
  font-weight: 800;
  margin: 0 0 4px;
  color: var(--text);
}

.sources-section-head p {
  font-size: 13px;
  color: var(--muted);
  margin: 0;
}

.sources-upload-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  background: var(--accent);
  color: #fff;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  position: relative;
}

.sources-upload-btn input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
}

.sources-upload-btn:hover {
  opacity: 0.9;
}

/* Photo grid */
.media-photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}

.media-thumb {
  position: relative;
  aspect-ratio: 1;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--surface);
}

.media-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.media-remove {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(0,0,0,0.55);
  color: #fff;
  border: none;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.15s;
}

.media-thumb:hover .media-remove,
.media-video-item:hover .media-remove {
  opacity: 1;
}

/* Video list */
.media-video-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.media-video-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  position: relative;
}

.media-video-thumb {
  width: 80px;
  height: 52px;
  object-fit: cover;
  border-radius: 6px;
  background: #1a1a2e;
  flex-shrink: 0;
}

.media-video-meta {
  flex: 1;
  min-width: 0;
}

.media-video-name {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.media-video-note {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.media-empty {
  font-size: 14px;
  color: var(--muted);
  padding: 16px 0;
  margin: 0;
}

/* ── Asset text editor (inline edit mode) ────────────────────────────────── */

/* Clickable text elements in edit mode */
.edit-mode [data-edit-field] {
  cursor: pointer;
  pointer-events: all;
}
.edit-mode [data-edit-field]:hover {
  outline: 2px solid rgba(99, 102, 241, 0.6);
  outline-offset: 2px;
  filter: brightness(1.08);
}

/* Edit toggle button active state */
#editAssetButton.active {
  background: #eef2ff;
  color: #4f46e5;
  border-color: #c7d2fe;
  font-weight: 700;
}

/* Typography row below preview toolbar */
.preview-typography-row {
  display: flex;
  gap: 24px;
  padding: 8px 16px 10px;
  border-top: 1px solid var(--border);
  background: #f9fafb;
}

.typo-ctrl {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
  cursor: default;
  user-select: none;
}

.typo-ctrl span {
  min-width: 90px;
  font-weight: 600;
  color: var(--text);
}

.typo-ctrl input[type="range"] {
  width: 100px;
  accent-color: #4f46e5;
}

.typo-ctrl output {
  min-width: 36px;
  font-size: 11px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* Floating inline text editor popover */
.asset-text-editor {
  position: fixed;
  z-index: 1200;
  background: #ffffff;
  border: 1.5px solid #c7d2fe;
  border-radius: 10px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.16);
  width: 340px;
  overflow: hidden;
}

.ate-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px 6px;
  border-bottom: 1px solid #e5e7eb;
  background: #f5f7ff;
}

.ate-label {
  font-size: 12px;
  font-weight: 700;
  color: #4f46e5;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.ate-close {
  background: none;
  border: none;
  font-size: 18px;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
  padding: 0 2px;
  border-radius: 4px;
}
.ate-close:hover { background: #f3f4f6; color: var(--text); }

.ate-input {
  display: block;
  width: 100%;
  box-sizing: border-box;
  border: none;
  outline: none;
  padding: 10px 14px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  font-family: inherit;
  resize: vertical;
  min-height: 70px;
  background: #ffffff;
}
.ate-input:focus { background: #fafbff; }
