:root {
  color-scheme: light;
  --ink: #18251f;
  --muted: #738078;
  --line: #e2e8e2;
  --paper: #f4f6f2;
  --white: #fff;
  --green: #146b4c;
  --green-dark: #10563d;
  --lime: #c9f26a;
  --orange: #f4a96c;
  --shadow: 0 18px 60px rgba(32, 51, 41, .07);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'DM Sans', sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea, select { font: inherit; }
.shell { max-width: 1180px; margin: 0 auto; padding: 0 34px; }
.topbar { height: 78px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.brand-mark { color: var(--ink); font: 800 21px 'Manrope', sans-serif; text-decoration: none; letter-spacing: -.08em; }
.brand-mark span { color: var(--green); }
.topbar-note { color: var(--muted); font-size: 12px; display: flex; align-items: center; gap: 8px; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #62a77e; box-shadow: 0 0 0 4px #62a77e22; }
.intro { padding: 58px 0 32px; }
.eyebrow { margin: 0 0 12px; color: var(--green); font-size: 10px; font-weight: 700; letter-spacing: .16em; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 14px; font: 800 clamp(42px, 6vw, 70px)/.98 'Manrope', sans-serif; letter-spacing: -.07em; }
h1 span { color: var(--green); }
.lede { color: var(--muted); font-size: 15px; margin-bottom: 18px; }
.api-notice { display: inline-flex; padding: 8px 12px; border: 1px solid #ead8c1; border-radius: 99px; color: #80551e; background: #fff8ed; font-size: 11px; }
.api-notice.connected { color: var(--green); border-color: #cfe5d7; background: #eff8f1; }
.api-notice.error { color: #a23939; border-color: #f2caca; background: #fff1f1; }
.workspace { display: grid; grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr); gap: 18px; align-items: start; padding-bottom: 58px; }
.panel { background: var(--white); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); }
.composer { padding: 26px; }
.queue { padding: 26px; min-height: 440px; }
.section-heading { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 24px; }
.section-heading .eyebrow { margin-bottom: 5px; font-size: 9px; }
h2 { margin: 0; font: 700 21px 'Manrope', sans-serif; letter-spacing: -.04em; }
.step-pill, .count-pill { border-radius: 99px; background: #f0f3ef; padding: 7px 10px; color: #657269; font-size: 10px; font-weight: 600; }
form { display: grid; gap: 15px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
label { display: grid; gap: 7px; color: #657269; font-size: 11px; font-weight: 600; }
input, textarea, select { width: 100%; border: 1px solid var(--line); border-radius: 9px; outline: 0; color: var(--ink); background: #fcfdfb; font-size: 12px; font-weight: 400; transition: border-color .15s, box-shadow .15s; }
input, select { height: 42px; padding: 0 12px; }
textarea { resize: vertical; padding: 11px 12px; line-height: 1.55; }
input:focus, textarea:focus, select:focus { border-color: #68a98b; box-shadow: 0 0 0 3px #146b4c14; }
input::placeholder, textarea::placeholder { color: #a3ada6; }
.form-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 3px; }
.form-footer p { max-width: 210px; margin: 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 37px; border: 0; border-radius: 8px; padding: 0 13px; cursor: pointer; font-size: 11px; font-weight: 700; transition: transform .15s, background .15s; }
.button:hover { transform: translateY(-1px); }
.button:disabled { opacity: .55; cursor: wait; transform: none; }
.button-primary { color: var(--white); background: var(--green); }
.button-primary:hover { background: var(--green-dark); }
.button-secondary { color: #4d5c51; background: #eff2ee; }
.button-approve { color: #284014; background: var(--lime); }
.button-approve:hover { background: #bce94e; }
.form-message { min-height: 15px; margin: -3px 0 0; color: var(--green); font-size: 11px; }
.form-message.error { color: #a23939; }
.workflow-legend { display: flex; gap: 15px; margin: -6px 0 18px; color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .04em; }
.workflow-legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend-dot { width: 6px; height: 6px; border-radius: 50%; }
.draft-dot { background: #9aa89e; }
.review-dot { background: var(--orange); }
.approved-dot { background: #70a945; }
.post-list { display: grid; gap: 11px; }
.post-card { border: 1px solid var(--line); border-radius: 12px; padding: 15px; background: #fff; }
.post-meta { display: flex; justify-content: space-between; gap: 8px; align-items: center; margin-bottom: 10px; }
.platform-label { color: var(--muted); font-size: 9px; font-weight: 600; }
.status-badge { border-radius: 99px; padding: 5px 8px; font-size: 8px; font-weight: 700; letter-spacing: .05em; }
.status-draft { color: #5f6e63; background: #eff2ee; }
.status-review { color: #8a521e; background: #fff1e4; }
.status-approved { color: #446f26; background: #eef8e5; }
.status-published { color: #315f91; background: #eaf3fc; }
.post-title { margin-bottom: 4px; font: 700 14px 'Manrope', sans-serif; letter-spacing: -.02em; }
.post-audience, .post-content, .post-caption { margin-bottom: 8px; color: #59665d; font-size: 11px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.post-audience { color: #879188; font-size: 10px; }
.post-caption { padding-top: 8px; border-top: 1px solid #f0f2ef; color: #748078; }
.generated-image-preview { display: block; width: min(100%, 420px); aspect-ratio: 1; margin: 12px auto; border: 1px solid var(--line); border-radius: 10px; object-fit: cover; background: #f0f3ef; }
.post-footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 11px; }
.post-date { color: #9aa49c; font-size: 9px; }
.approved-note { color: #597b3e; font-size: 9px; font-weight: 600; }
.empty-state { padding: 44px 15px 34px; text-align: center; }
.empty-state[hidden] { display: none; }
.empty-icon { display: grid; place-items: center; width: 36px; height: 36px; margin: 0 auto 12px; border-radius: 12px; background: #f0f3ef; color: var(--green); font-size: 21px; }
.empty-state h3 { margin-bottom: 6px; font: 700 13px 'Manrope', sans-serif; }
.empty-state p { margin: 0; color: var(--muted); font-size: 11px; }
.footer { display: flex; justify-content: space-between; padding: 17px 0 25px; border-top: 1px solid var(--line); color: #8b958d; font-size: 10px; }

@media (max-width: 860px) {
  .workspace { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .shell { padding: 0 17px; }
  .intro { padding: 42px 0 25px; }
  .composer, .queue { padding: 19px; }
  .form-row { grid-template-columns: 1fr; }
  .form-footer { align-items: flex-start; flex-direction: column; }
  .footer { gap: 10px; flex-direction: column; }
}

/* UI polish: warmer workspace, clearer hierarchy, and more usable controls. */
:root {
  --ink: #242822;
  --muted: #5d665e;
  --line: #e7e5df;
  --paper: #f7f6f3;
  --white: #ffffff;
  --green: #176b50;
  --green-dark: #10583f;
  --shadow: 0 3px 16px rgba(33, 42, 35, .045);
}

body { font-family: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; }
.brand-mark, h1, h2, .post-title, .empty-state h3 { font-family: inherit; }
.shell { max-width: 1240px; padding-right: 30px; padding-left: 30px; }
.topbar { height: 70px; border-color: #e9e7e1; }
.brand-lockup { display: inline-flex; align-items: center; gap: 11px; color: var(--ink); text-decoration: none; }
.brand-mark { display: block; flex: 0 0 36px; width: 36px; height: 36px; border-radius: 10px; object-fit: contain; }
.brand-name { font-size: 14px; font-weight: 700; letter-spacing: -.02em; }
.topbar-note { color: #515c53; font-size: 12px; }
.intro { padding: 35px 0 24px; }
.eyebrow { font-size: 11px; letter-spacing: .12em; }
.eyebrow-divider { margin: 0 5px; color: #9aa198; }
.hero-row { display: flex; align-items: center; justify-content: space-between; gap: 28px; }
h1 { margin-bottom: 10px; font-size: clamp(36px, 4.6vw, 52px); line-height: 1.04; letter-spacing: -.055em; }
.lede { max-width: 520px; margin-bottom: 0; color: #515b53; font-size: 15px; line-height: 1.55; }
.connection-card { display: grid; gap: 8px; min-width: 275px; max-width: 365px; padding: 15px 17px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.connection-label { color: #667067; font-size: 10px; font-weight: 700; letter-spacing: .1em; }
.api-notice { display: block; padding: 0; border: 0; border-radius: 0; color: #755321; background: transparent; font-size: 12px; line-height: 1.45; }
.api-notice.connected { color: var(--green); background: transparent; }
.api-notice.error { color: #9b3535; background: transparent; }
.connection-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.connection-actions [hidden] { display: none; }
.workspace { grid-template-columns: minmax(0, .94fr) minmax(0, 1.06fr); gap: 20px; padding-bottom: 46px; }
.panel { border-color: var(--line); border-radius: 15px; box-shadow: var(--shadow); }
.composer, .queue { padding: 24px; }
.queue { min-height: 390px; }
.section-heading { align-items: center; margin-bottom: 21px; }
.section-heading .eyebrow { margin-bottom: 6px; font-size: 10px; }
h2 { font-size: 21px; letter-spacing: -.035em; }
.section-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; color: var(--green); background: #edf4ed; font-size: 20px; }
.count-pill { padding: 7px 11px; color: #4e5d52; background: #f1f2ed; font-size: 11px; }
form { gap: 12px; }
.form-row { gap: 14px; }
label { gap: 7px; color: #3f4941; font-size: 13px; font-weight: 600; }
.optional, .field-hint { color: var(--muted); font-size: 11px; font-weight: 400; }
.optional { display: inline; margin-left: 4px; }
input, textarea, select { border-color: #dddfd8; border-radius: 8px; color: var(--ink); background: #fff; font-size: 14px; }
input, select { height: 44px; }
input::placeholder, textarea::placeholder { color: #737d74; }
textarea { min-height: 104px; line-height: 1.6; }
input:focus, textarea:focus, select:focus { border-color: #4d9474; box-shadow: 0 0 0 3px rgba(23, 107, 80, .12); }
.field-help { margin: -8px 0 0; color: var(--muted); font-size: 11px; line-height: 1.45; }
.form-footer { align-items: center; margin-top: 5px; }
.form-footer p { max-width: 230px; color: #59645b; font-size: 12px; }
.form-footer strong { color: #303932; }
.button { min-height: 44px; border-radius: 8px; padding: 0 16px; font-size: 13px; }
.button-secondary { color: #35453a; background: #edf0eb; }
.button-secondary:hover { background: #e2e8e0; }
.button-approve { color: #233912; background: #d8edaa; }
.button-approve:hover { background: #cbe58f; }
.button:focus-visible, .brand-lockup:focus-visible { outline: 3px solid #2783c5; outline-offset: 3px; }
.form-message { min-height: 18px; margin-top: 0; color: var(--green); font-size: 12px; }
.workflow-legend { gap: 17px; margin: -2px 0 17px; color: #48534a; font-size: 10px; }
.legend-dot { width: 8px; height: 8px; }
.draft-dot { background: #87958a; }
.review-dot { background: #c77739; }
.approved-dot { background: #538b38; }
.post-list { gap: 12px; }
.post-card { padding: 17px; border-color: #e7e8e2; border-radius: 12px; }
.post-meta { margin-bottom: 12px; }
.platform-label { color: #566157; font-size: 11px; }
.status-badge { padding: 6px 9px; font-size: 10px; }
.status-draft { color: #455349; background: #edf0ec; }
.status-review { color: #754217; background: #fff0df; }
.status-approved { color: #385c25; background: #edf5e5; }
.post-title { margin-bottom: 5px; font-size: 15px; letter-spacing: -.02em; }
.post-audience, .post-content, .post-caption { color: #414c43; font-size: 13px; line-height: 1.55; }
.post-audience { color: #5c675e; font-size: 11px; }
.post-caption { border-color: #ecece7; color: #566158; }
.post-footer { flex-wrap: wrap; margin-top: 13px; }
.post-date, .approved-note { font-size: 11px; }
.post-date { color: #5f6c62; }
.approved-note { color: #3c6329; }
.empty-state { max-width: 360px; margin: 24px auto 0; padding: 34px 18px; }
.empty-icon { width: 42px; height: 42px; border-radius: 13px; color: var(--green); background: #edf4ed; font-size: 21px; }
.empty-state h3 { margin-bottom: 8px; font-size: 15px; }
.empty-state p { color: #566158; font-size: 13px; line-height: 1.55; }
.footer { padding: 17px 0 24px; color: #566158; font-size: 11px; }
.footer-separator { margin: 0 5px; color: #a0a79f; }

@media (max-width: 860px) {
  .hero-row { align-items: flex-start; flex-direction: column; gap: 18px; }
  .connection-card { width: 100%; max-width: none; }
  .workspace { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .shell { padding: 0 16px; }
  .topbar { height: 62px; }
  .brand-name { font-size: 12px; }
  .topbar-note { font-size: 11px; }
  .intro { padding: 27px 0 20px; }
  .eyebrow { font-size: 9px; letter-spacing: .09em; }
  h1 { font-size: clamp(34px, 10vw, 43px); }
  .composer, .queue { padding: 18px; }
  .form-row { grid-template-columns: 1fr; gap: 12px; }
  .form-footer { align-items: flex-start; flex-direction: column; }
  .form-footer .button { width: 100%; }
  .post-footer { align-items: flex-start; flex-direction: column; }
  .footer { gap: 7px; flex-direction: column; }
}

:focus-visible { outline: 3px solid #2783c5; outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

.topbar-actions { display: flex; align-items: center; gap: 18px; }
.brand-intro { padding: 38px 0 24px; }
.brand-intro h1 { margin-bottom: 12px; }
.brand-workspace { display: grid; grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr); gap: 18px; align-items: start; padding-bottom: 46px; }
.brand-selector-panel { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(240px, .7fr); align-items: center; gap: 0 24px; padding: 20px 24px; }
.brand-selector-panel .section-heading { grid-column: 1 / -1; margin-bottom: 15px; }
.brand-main { display: grid; gap: 18px; }
.brand-editor-panel, .brand-assets-panel, .brand-archive-panel { padding: 22px; }
.brand-assets-panel form { margin-bottom: 18px; }
.brand-assets-panel input[type="file"] { height: auto; min-height: 44px; padding: 9px; }
.brand-asset-list, .brand-archive-list { display: grid; gap: 11px; }
.brand-asset-card { display: grid; grid-template-columns: 76px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; }
.brand-asset-card img { width: 76px; height: 64px; border-radius: 7px; object-fit: contain; background: #f2f3ef; }
.brand-asset-details { display: grid; min-width: 0; gap: 4px; color: var(--ink); font-size: 12px; overflow-wrap: anywhere; }
.brand-asset-details .field-help { margin: 0; }
.brand-assets-panel .empty-state, .brand-archive-panel .empty-state { margin: 0; padding: 22px 10px; }
.brand-assets-panel .empty-state[hidden], .brand-archive-panel .empty-state[hidden] { display: none; }
.brand-archive-panel { min-height: 300px; }
.brand-archive-list .post-card { min-width: 0; }
.brand-archive-list .post-caption { overflow-wrap: anywhere; }
.published-link { color: var(--green); font-size: 11px; font-weight: 700; text-decoration: none; }
.published-link:hover { text-decoration: underline; }
.button-danger { color: #8d2929; background: #fae9e7; }
.button-danger:hover { background: #f3d9d6; }
.status-active { color: #176b50; background: #e7f2eb; }
.status-archived { color: #735a2d; background: #f5eedb; }
.brand-management-panel { padding: 22px; }
.brand-management-table-wrap { overflow-x: auto; }
.brand-management-table { width: 100%; border-collapse: collapse; text-align: left; }
.brand-management-table th, .brand-management-table td { padding: 13px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.brand-management-table thead th { color: #68716e; font-size: 10px; text-transform: uppercase; letter-spacing: .06em; }
.brand-management-table tbody th { color: var(--ink); font-size: 12px; font-weight: 700; }
.brand-management-table tbody td { color: #535d57; font-size: 12px; }
.brand-management-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.brand-management-actions .button { min-height: 34px; padding: 0 10px; font-size: 10px; white-space: nowrap; }
.brand-management-panel .empty-state[hidden] { display: none; }
#brand-editor[hidden] { display: none; }
#brand-editor { display: grid; gap: 18px; margin-top: 18px; scroll-margin-top: 78px; }
#brand-editor form { display: grid; gap: 22px; }
#brand-editor .setup-section { display: grid; gap: 14px; }
#brand-editor .setup-section .section-heading { margin-bottom: 0; }
#brand-editor .setup-section h3 { margin: 0; color: var(--ink); font-size: 16px; }
#brand-editor .form-footer { align-items: center; }
#brand-editor .brand-management-message[hidden] { display: none; }

@media (max-width: 860px) {
  .brand-workspace { grid-template-columns: 1fr; }
  .brand-selector-panel { grid-template-columns: 1fr; }
  .brand-selector-panel .section-heading { grid-column: auto; }
}
@media (max-width: 520px) {
  .topbar-actions { gap: 8px; }
  .topbar-actions .button { min-height: 38px; padding: 0 10px; font-size: 11px; }
  .topbar-note { display: none; }
  .brand-intro { padding: 28px 0 20px; }
  .brand-editor-panel, .brand-assets-panel, .brand-archive-panel, .brand-selector-panel { padding: 18px; }
  .brand-asset-card { grid-template-columns: 58px minmax(0, 1fr); }
  .brand-asset-card img { width: 58px; height: 56px; }
  .brand-asset-card .button { grid-column: 1 / -1; }
}

@media (max-width: 640px) {
  .shell {
    padding-right: max(16px, env(safe-area-inset-right));
    padding-left: max(16px, env(safe-area-inset-left));
  }
  .topbar { min-height: 62px; height: auto; gap: 10px; }
  .brand-lockup { min-width: 0; gap: 8px; }
  .brand-mark { flex: 0 0 34px; width: 34px; height: 34px; }
  .brand-name { font-size: 12px; }
  .topbar-actions { gap: 8px; }
  .topbar-actions .button, .topbar > .button { min-height: 44px; white-space: nowrap; padding-right: 10px; padding-left: 10px; }
  .intro, .brand-intro { padding-top: 27px; padding-bottom: 20px; }
  .hero-row { align-items: stretch; gap: 15px; }
  .connection-card { min-width: 0; padding: 14px; }
  .connection-actions .button { flex: 1 1 100%; }
  .workspace, .brand-workspace { gap: 14px; padding-bottom: 30px; }
  .composer, .queue, .brand-editor-panel, .brand-assets-panel, .brand-archive-panel, .brand-selector-panel { min-width: 0; padding: 18px; }
  .queue { min-height: 0; }
  .form-row { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  form, label, .form-row { min-width: 0; }
  input, textarea, select { min-width: 0; font-size: 16px; }
  input, select { min-height: 46px; }
  textarea { min-height: 118px; }
  .section-heading { gap: 10px; margin-bottom: 17px; }
  .section-heading h2 { font-size: 19px; }
  .section-icon { flex: 0 0 34px; }
  .form-footer { align-items: stretch; flex-direction: column; }
  .form-footer p { max-width: none; }
  .form-footer .button, .brand-assets-panel form > .button { width: 100%; }
  .workflow-legend { flex-wrap: wrap; row-gap: 9px; }
  .post-card { min-width: 0; padding: 14px; }
  .post-meta { align-items: flex-start; }
  .platform-label { min-width: 0; overflow-wrap: anywhere; }
  .status-badge { flex: 0 0 auto; }
  .post-title, .post-content, .post-caption { overflow-wrap: anywhere; }
  .post-footer { align-items: stretch; flex-direction: column; gap: 9px; }
  .post-footer > .button, .post-footer > .published-link { width: 100%; }
  .post-footer > .published-link { display: inline-flex; min-height: 44px; align-items: center; justify-content: center; border-radius: 8px; background: #edf4ed; }
  .brand-selector-panel { grid-template-columns: minmax(0, 1fr); }
  .brand-selector-panel .section-heading { grid-column: auto; }
  .brand-selector-panel label, .brand-selector-panel select { grid-column: 1; }
  .brand-selector-panel .field-help { margin-top: 5px; }
  .brand-asset-card { grid-template-columns: 58px minmax(0, 1fr); }
  .brand-asset-card img { width: 58px; height: 56px; }
  .brand-asset-card .button { grid-column: 1 / -1; }
  .generated-image-preview { width: 100%; }
  .footer { gap: 8px; flex-direction: column; padding-bottom: max(18px, env(safe-area-inset-bottom)); }
}

@media (max-width: 380px) {
  .shell {
    padding-right: max(12px, env(safe-area-inset-right));
    padding-left: max(12px, env(safe-area-inset-left));
  }

  .auth-user { max-width: 150px; overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
  .auth-logout[hidden] { display: none; }
  .auth-message { min-height: 0; margin: 0; color: #a23939; font-size: 11px; }

  @media (max-width: 520px) {
    .auth-user { display: none; }
  }
  .topbar { height: auto; min-height: 62px; flex-wrap: wrap; gap: 8px; padding: 8px 0; }
  .brand-lockup { gap: 6px; }
  .brand-mark { flex-basis: 30px; width: 30px; height: 30px; }
  .brand-name { font-size: 11px; }
  .topbar-actions { flex: 1 1 100%; justify-content: flex-end; }
  .topbar-actions .button { min-height: 44px; flex: 1 1 0; padding-right: 8px; padding-left: 8px; font-size: 10px; }
  .topbar > .button { min-height: 44px; padding-right: 9px; padding-left: 9px; font-size: 11px; }
  h1 { font-size: clamp(32px, 10vw, 38px); }
  .count-pill { padding: 6px 8px; font-size: 10px; white-space: nowrap; }
  .section-heading { align-items: flex-start; }
}

.profile-shell { max-width: 1120px; }
.profile-page { padding: 28px 0 42px; }
.profile-toolbar { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 30px; }
.profile-toolbar .eyebrow { margin-bottom: 7px; }
.profile-toolbar h1 { margin: 0; font-size: clamp(29px, 4vw, 40px); line-height: 1.08; letter-spacing: -.05em; }
.profile-brand-picker { width: min(100%, 290px); color: #3f4941; font-size: 12px; }
.profile-brand-picker select { margin-top: 7px; }
.social-profile { display: grid; grid-template-columns: minmax(150px, 1fr) minmax(0, 2fr); align-items: center; gap: clamp(22px, 7vw, 80px); max-width: 800px; margin: 0 auto 34px; padding: 10px 24px 24px; }
.profile-avatar-wrap { display: grid; place-items: center; }
.profile-avatar { display: grid; place-items: center; width: clamp(116px, 17vw, 164px); aspect-ratio: 1; overflow: hidden; border: 1px solid #e8e8e4; border-radius: 50%; color: #fff; background: linear-gradient(140deg, #1d7658, #b6d681); font-size: clamp(42px, 8vw, 64px); font-weight: 700; }
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-summary { min-width: 0; }
.profile-title-row { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 18px; }
.profile-title-row h2 { overflow-wrap: anywhere; font-size: clamp(19px, 3vw, 25px); font-weight: 500; letter-spacing: -.04em; }
.profile-title-row .button { min-height: 38px; }
.profile-stats { display: flex; flex-wrap: wrap; gap: clamp(15px, 4vw, 34px); margin-bottom: 16px; color: #39433c; font-size: 13px; }
.profile-stats span { white-space: nowrap; }
.profile-stats strong { margin-right: 4px; font-size: 15px; }
.profile-description { max-width: 500px; margin-bottom: 12px; color: #465148; font-size: 13px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.profile-palette { display: flex; gap: 7px; }
.profile-palette[hidden] { display: none; }
.profile-swatch { width: 17px; height: 17px; border: 1px solid #20262024; border-radius: 50%; }
.profile-message { min-height: 18px; margin: 0 0 8px; color: #9b3535; font-size: 12px; }
.profile-feed { border-top: 1px solid #deded9; }
.profile-feed-heading { display: flex; align-items: center; justify-content: center; min-height: 54px; margin-bottom: 14px; border-bottom: 1px solid #e8e7e2; }
.profile-feed-heading h2 { display: inline-flex; align-items: center; gap: 8px; margin: 0; color: #333c35; font-size: 11px; font-weight: 700; letter-spacing: .12em; }
.profile-feed-heading h2 span { font-size: 18px; }
.profile-filters { display: none; }
.profile-post-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
.profile-post { position: relative; display: block; min-width: 0; overflow: hidden; aspect-ratio: 1; padding: 0; border: 0; border-radius: 2px; color: inherit; background: #e9eee8; text-align: left; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.profile-post:focus-visible { z-index: 1; outline-offset: -4px; }
.profile-post-image { display: block; width: 100%; height: 100%; object-fit: cover; }
.profile-post-placeholder { display: flex; width: 100%; height: 100%; align-items: center; justify-content: center; flex-direction: column; gap: 10px; padding: 12%; color: #34443a; background: linear-gradient(145deg, #edf2e8, #dce8df 52%, #d2e0d5); text-align: center; }
.profile-post:nth-child(4n + 2) .profile-post-placeholder { color: #563e32; background: linear-gradient(145deg, #f3eadc, #e9d8c8 52%, #ded4c2); }
.profile-post:nth-child(4n + 3) .profile-post-placeholder { color: #f8f5ed; background: linear-gradient(145deg, #243e37, #426959 52%, #77977e); }
.profile-post:nth-child(4n) .profile-post-placeholder { color: #443947; background: linear-gradient(145deg, #eee5ef, #dcd1e2 52%, #cbd9dc); }
.placeholder-mark { font-size: clamp(22px, 5vw, 42px); line-height: 1; }
.placeholder-copy { display: -webkit-box; max-width: 100%; overflow: hidden; font-size: clamp(10px, 1.5vw, 14px); font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; -webkit-box-orient: vertical; -webkit-line-clamp: 5; }
.profile-post-overlay { position: absolute; inset: 0; display: flex; align-items: flex-start; justify-content: space-between; flex-direction: column; gap: 8px; padding: clamp(7px, 1.8vw, 14px); color: #fff; background: linear-gradient(180deg, #111a1b99, transparent 40%, #111a1bcc); opacity: 0; transition: opacity .16s ease; }
.profile-post:hover .profile-post-overlay, .profile-post:focus-visible .profile-post-overlay { opacity: 1; }
.profile-post-status { padding: 5px 8px; border-radius: 99px; color: #26332a; background: #ffffffed; font-size: clamp(8px, 1.2vw, 10px); font-weight: 700; }
.profile-post-status.status-published { color: #24543a; }
.profile-post-status.status-review { color: #80511f; }
.profile-post-status.status-approved { color: #416127; }
.profile-post-caption { display: -webkit-box; width: 100%; overflow: hidden; font-size: clamp(10px, 1.4vw, 13px); font-weight: 600; line-height: 1.4; overflow-wrap: anywhere; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.profile-empty { max-width: 440px; margin: 0 auto; padding: 46px 20px; }
.profile-empty[hidden] { display: none; }
.profile-empty .button { margin-top: 16px; }
.post-detail-dialog { width: min(920px, calc(100vw - 32px)); max-width: none; max-height: min(88dvh, 760px); padding: 0; overflow: auto; border: 1px solid var(--line); border-radius: 16px; color: var(--ink); background: #fff; box-shadow: 0 24px 80px #111a1b44; }
.post-detail-dialog::backdrop { background: #17211ccc; backdrop-filter: blur(3px); }
.dialog-close-row { position: sticky; z-index: 1; top: 0; display: flex; justify-content: flex-end; height: 0; margin: 0; }
.dialog-close { display: grid; place-items: center; width: 42px; height: 42px; margin: 10px 10px 0 0; border: 0; border-radius: 50%; color: #1f2922; background: #ffffffed; font-size: 28px; cursor: pointer; }
.post-detail-content { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(280px, .9fr); }
.post-detail-image { position: sticky; top: 0; width: 100%; height: 100%; max-height: 680px; aspect-ratio: 1; object-fit: cover; background: #f0f3ef; }
.post-detail-copy { padding: 42px 28px 28px; }
.post-detail-copy h2 { margin: 14px 0 4px; font-size: 22px; overflow-wrap: anywhere; }
.post-detail-meta, .post-detail-date { color: var(--muted); font-size: 12px; line-height: 1.5; }
.post-detail-section-title { margin: 20px 0 6px; font-size: 12px; }
.post-detail-text { color: #434d44; font-size: 13px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.post-detail-date { margin-top: 22px; }
.post-detail-copy .button { width: 100%; text-decoration: none; }

@media (min-width: 700px) {
  .profile-filters { display: flex; align-items: center; gap: 22px; }
  .profile-filter { min-height: 52px; margin-bottom: -1px; border: 0; border-bottom: 1px solid transparent; color: #727a73; background: transparent; font-size: 11px; font-weight: 700; letter-spacing: .08em; cursor: pointer; }
  .profile-filter.is-active { border-bottom-color: #303832; color: #303832; }
  .profile-feed-heading { justify-content: space-between; padding: 0 10px; }
  .profile-post-grid { gap: 22px; }
  .profile-post { border-radius: 2px; }
}

@media (max-width: 640px) {
  .profile-page { padding-top: 18px; }
  .profile-toolbar { align-items: stretch; flex-direction: column; gap: 14px; margin-bottom: 20px; }
  .profile-toolbar h1 { font-size: 29px; }
  .profile-brand-picker { width: 100%; }
  .social-profile { grid-template-columns: 90px minmax(0, 1fr); align-items: start; gap: 14px; margin-bottom: 22px; padding: 0 0 18px; }
  .profile-avatar { width: 78px; font-size: 34px; }
  .profile-title-row { align-items: flex-start; flex-direction: column; gap: 9px; margin-bottom: 12px; }
  .profile-title-row h2 { font-size: 18px; }
  .profile-title-row .button { min-height: 36px; }
  .profile-stats { gap: 8px 14px; margin-bottom: 10px; font-size: 11px; }
  .profile-stats strong { font-size: 13px; }
  .profile-description { font-size: 12px; }
  .profile-feed-heading { justify-content: space-between; min-height: 52px; padding: 0 2px; }
  .profile-feed-heading h2 { font-size: 10px; }
  .profile-filters { display: flex; gap: 5px; }
  .profile-filter { min-height: 36px; padding: 0 9px; border: 0; border-radius: 6px; color: #5c665d; background: transparent; font-size: 11px; cursor: pointer; }
  .profile-filter.is-active { color: #fff; background: var(--green); }
  .profile-post-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 3px; margin-right: calc(-1 * max(16px, env(safe-area-inset-right))); margin-left: calc(-1 * max(16px, env(safe-area-inset-left))); }
  .profile-post { border-radius: 0; }
  .profile-post-overlay { opacity: 1; background: linear-gradient(180deg, #111a1b55, transparent 30%, #111a1b99); }
  .profile-post-caption { font-size: 10px; -webkit-line-clamp: 2; }
  .profile-post-status { padding: 4px 6px; font-size: 8px; }
  .placeholder-copy { font-size: 10px; -webkit-line-clamp: 4; }
  .post-detail-dialog { width: calc(100vw - 20px); max-height: 90dvh; border-radius: 12px; }
  .post-detail-content { grid-template-columns: 1fr; }
  .post-detail-image { position: static; max-height: none; }
  .post-detail-copy { padding: 22px; }
  .dialog-close { width: 38px; height: 38px; }
}

.login-shell { display: grid; min-height: 100vh; place-items: center; padding: 24px; }
.login-card { width: min(100%, 430px); padding: clamp(24px, 6vw, 42px); border: 1px solid var(--line); border-radius: 18px; background: var(--white); box-shadow: var(--shadow); }
.login-card .brand-lockup { margin-bottom: 36px; }
.login-card .eyebrow { margin-bottom: 12px; }
.login-card h1 { margin-bottom: 12px; font-size: clamp(34px, 8vw, 46px); }
.login-description, .login-note { color: var(--muted); font-size: 13px; line-height: 1.6; }
.login-message { min-height: 20px; margin: 18px 0 12px; color: #a23939; font-size: 12px; }
.login-message[data-state="success"] { color: #306344; }
.login-form { display: grid; gap: 10px; }
.login-form label { margin-top: 6px; color: #414b43; font-size: 12px; font-weight: 600; }
.login-form input { width: 100%; min-height: 46px; }
.login-form .login-button { width: 100%; min-height: 46px; margin-top: 8px; font-size: 13px; }
.login-form[hidden] { display: none; }
.login-note { margin: 20px 0 0; font-size: 11px; }

@media (max-width: 520px) {
  .login-shell { padding: 16px; }
  .login-card .brand-lockup { margin-bottom: 30px; }
}

.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.ai-workspace { grid-template-columns: minmax(0, 1fr); gap: 16px; }
.ai-composer { padding: clamp(20px, 3vw, 34px); }
.ai-composer .section-heading { align-items: flex-start; }
.ai-composer .section-heading h2 { font-size: clamp(22px, 3vw, 28px); }
.ai-subtitle { max-width: 650px; margin: 9px 0 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.ai-mark { display: grid; flex: 0 0 44px; place-items: center; width: 44px; height: 44px; border-radius: 14px; color: #35511f; background: #e7f2ce; font-size: 22px; }
.ai-reference-upload { display: grid; gap: 8px; padding: 13px; border: 1px solid var(--line); border-radius: 9px; background: #fbfcfa; }
.ai-reference-upload > label { margin: 0; }
.ai-reference-upload input[type="file"] { width: 100%; padding: 9px; background: #fff; }
.ai-reference-preview { display: flex; align-items: center; gap: 12px; }
.ai-reference-preview[hidden] { display: none; }
.ai-reference-preview img { width: 88px; height: 72px; border: 1px solid var(--line); border-radius: 7px; object-fit: cover; }
.ai-options, .optional-image { border: 1px solid var(--line); border-radius: 9px; background: #fbfcfa; }
.ai-options { padding: 0 13px; }
.ai-options summary, .optional-image summary { min-height: 44px; color: #3f5948; font-size: 12px; font-weight: 650; line-height: 44px; cursor: pointer; }
.ai-options[open] { padding-bottom: 13px; }
.ai-options .form-row { margin-top: 2px; }
.ai-generate { display: flex; width: 100%; min-height: 66px; justify-content: flex-start; gap: 14px; padding: 10px 17px; }
.ai-generate-icon { display: grid; flex: 0 0 38px; place-items: center; width: 38px; height: 38px; border-radius: 11px; color: #35511f; background: var(--lime); font-size: 19px; }
.ai-generate > span:last-child { display: grid; gap: 3px; text-align: left; }
.ai-generate strong { font-size: 14px; }
.ai-generate small { font-size: 11px; font-weight: 400; opacity: .85; }
.ai-generate[aria-busy="true"] .ai-generate-icon { animation: ai-generate-pulse 1.4s ease-in-out infinite; }
.whatsapp-ai-generate { margin-top: 10px; }
.whatsapp-ai-generate-icon { display: grid; flex: 0 0 38px; place-items: center; width: 38px; height: 38px; border-radius: 11px; color: #075e54; background: #d7f7e8; font-size: 19px; }
.whatsapp-ai-generate[aria-busy="true"] .whatsapp-ai-generate-icon { animation: ai-generate-pulse 1.4s ease-in-out infinite; }
.ai-generation-status { display: flex; align-items: flex-start; gap: 11px; margin-top: -3px; padding: 11px 13px; border: 1px solid #cfe0d5; border-radius: 9px; color: #35511f; background: #f1f7f1; }
.ai-generation-status[hidden] { display: none; }
.ai-generation-copy { display: grid; gap: 4px; font-size: 12px; line-height: 1.5; }
.ai-generation-copy strong { font-weight: 650; }
.ai-generation-copy > span { color: var(--muted); font-size: 11px; }
.ai-generation-spinner { flex: 0 0 16px; width: 16px; height: 16px; margin-top: 2px; border: 2px solid #c8d8ca; border-top-color: #3c6745; border-radius: 50%; animation: ai-generation-spin .8s linear infinite; }
@keyframes ai-generation-spin { to { transform: rotate(360deg); } }
@keyframes ai-generate-pulse { 50% { opacity: .55; } }
@media (prefers-reduced-motion: reduce) {
  .ai-generation-spinner, .ai-generate[aria-busy="true"] .ai-generate-icon { animation: none; }
  .ai-generation-spinner { border-color: #3c6745; }
}
.ai-result { display: grid; gap: 12px; margin-top: 10px; padding-top: 22px; border-top: 1px solid var(--line); }
.ai-result[hidden] { display: none; }
.ai-result-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ai-result-heading .eyebrow { margin-bottom: 5px; }
.ai-result-heading h3 { margin: 0; font-size: 17px; letter-spacing: -.025em; }
.draft-state { flex: 0 0 auto; padding: 7px 10px; border-radius: 99px; color: #59645b; background: #edf0ec; font-size: 10px; font-weight: 700; }
.optional-image { padding: 0 12px; }
.optional-image[open] { padding-bottom: 12px; }
.optional-image label { margin-top: 4px; }
.queue-heading-actions { display: flex; align-items: center; gap: 14px; }
.text-link { color: var(--green); font-size: 12px; font-weight: 700; text-decoration: none; }
.text-link:hover { text-decoration: underline; }
.empty-state .button { margin-top: 12px; }
.custom-product-field { display: grid; gap: 7px; }
.custom-product-field[hidden] { display: none; }

.manual-shell { max-width: 1120px; }
.manual-intro { padding: 42px 0 26px; }
.manual-intro h1 { margin-bottom: 12px; font-size: clamp(36px, 5vw, 54px); }
.manual-intro .lede { max-width: 640px; }
.manual-layout { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(250px, .65fr); align-items: start; gap: 20px; padding-bottom: 48px; }
.manual-composer, .manual-guidance { padding: clamp(20px, 3vw, 30px); }
.manual-guidance { background: #eef4ed; }
.manual-guidance h2 { margin-bottom: 14px; font-size: 19px; }
.manual-guidance ol { display: grid; gap: 12px; margin: 0 0 22px; padding-left: 20px; color: #465148; font-size: 13px; line-height: 1.55; }
.manual-guidance .text-link { display: inline-flex; gap: 7px; align-items: center; min-height: 40px; }

@media (max-width: 860px) {
  .manual-layout { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .hero-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .hero-actions .button { min-width: 0; padding: 0 10px; font-size: 12px; }
  .ai-composer { padding: 19px; }
  .ai-result-heading { align-items: flex-start; flex-direction: column; }
  .manual-intro { padding: 28px 0 20px; }
  .manual-composer, .manual-guidance { padding: 18px; }
  .manual-layout { gap: 14px; padding-bottom: 30px; }
  .queue-heading-actions { gap: 9px; }
}

.brand-setup-shell { max-width: 1240px; }
.brand-setup-intro { padding: 42px 0 24px; }
.brand-setup-intro h1 { margin-bottom: 12px; font-size: clamp(36px, 5vw, 54px); }
.brand-setup-intro .lede { max-width: 720px; }
.brand-package-import { display: grid; gap: 14px; margin-bottom: 16px; padding: 20px 24px; }
.brand-package-import .section-heading { margin-bottom: 0; }
.brand-package-import > .field-help { margin: 0; }
.brand-package-import-form { display: grid; gap: 12px; max-width: 700px; }
.brand-package-confirmation { display: grid; grid-template-columns: 18px minmax(0, 1fr); align-items: start; gap: 9px; font-weight: 400; line-height: 1.45; }
.brand-package-confirmation input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--green); }
.brand-package-import-form > .button { justify-self: start; }
.brand-package-import-form > .button[hidden] { display: none; }
.brand-package-import .brand-setup-message:empty { display: none; }
.brand-setup-layout { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(250px, .65fr); align-items: start; gap: 20px; padding-bottom: 48px; }
.brand-setup-form, .setup-reference { padding: clamp(20px, 3vw, 30px); }
.brand-setup-form { display: grid; gap: 26px; }
.setup-section { display: grid; gap: 15px; padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.setup-section:last-of-type { padding-bottom: 0; border-bottom: 0; }
.setup-section .section-heading { margin-bottom: 0; }
.setup-field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.setup-field { min-width: 0; }
.setup-field.is-missing > input,
.setup-field.is-missing > textarea { border-color: #b7791f; background: #fff8e8; }
.setup-field-status { display: block; color: #87520c; font-size: 12px; font-weight: 650; }
.brand-setup-form.is-package-preview input[readonly],
.brand-setup-form.is-package-preview textarea[readonly] { background: #f3f5f2; }
.brand-setup-form.is-package-preview .setup-field.is-missing > input,
.brand-setup-form.is-package-preview .setup-field.is-missing > textarea { background: #fff8e8; }
.setup-field textarea { min-height: 84px; }
.setup-field .field-help { margin: 0; font-weight: 400; }
.setup-reference { background: #eef4ed; }
.setup-reference h2 { margin-bottom: 16px; font-size: 19px; }
.setup-reference #existing-brands-title { margin-top: 24px; }
.setup-reference ul { display: grid; gap: 12px; margin: 0 0 20px; padding-left: 18px; color: #465148; font-size: 12px; line-height: 1.6; }
.setup-reference #existing-brand-list a { color: #145b43; font-weight: 650; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.setup-reference code { color: #35511f; font-size: 11px; }
.setup-reference .text-link { display: inline-flex; gap: 7px; align-items: center; min-height: 40px; margin-top: 15px; }
.setup-products { display: grid; gap: 14px; }
.setup-product-card { min-width: 0; margin: 0; padding: 16px; border: 1px solid var(--line); border-radius: 10px; }
.setup-product-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.setup-product-card > legend { padding: 0; color: var(--ink); font-size: 14px; font-weight: 700; }
.setup-product-heading .button { min-height: 36px; }
.setup-submit { margin-top: 0; }
.brand-setup-message:empty { display: none; }
.brand-setup-message.error { color: #9b3535; }

@media (max-width: 900px) {
  .brand-setup-layout { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .brand-setup-intro { padding: 28px 0 20px; }
  .brand-setup-form, .setup-reference { padding: 18px; }
  .brand-setup-form { gap: 20px; }
  .setup-field-grid { grid-template-columns: minmax(0, 1fr); gap: 13px; }
  .setup-product-card { padding: 12px; }
  .setup-submit { align-items: stretch; }
}

.dashboard-page { min-height: 100vh; background: #f5f6f8; }
.dashboard-frame { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.dashboard-frame.sidebar-collapsed { grid-template-columns: 76px minmax(0, 1fr); }
.dashboard-frame.sidebar-collapsed .control-sidebar { padding-right: 10px; padding-left: 10px; }
.dashboard-frame.sidebar-collapsed .control-sidebar .brand-lockup { justify-content: center; margin-bottom: 16px; padding: 0; }
.dashboard-frame.sidebar-collapsed .control-sidebar .brand-name,
.dashboard-frame.sidebar-collapsed .sidebar-workspace,
.dashboard-frame.sidebar-collapsed .sidebar-bottom { display: none; }
.dashboard-frame.sidebar-collapsed .control-nav-link { justify-content: center; gap: 0; padding: 0; font-size: 0; }
.dashboard-frame.sidebar-collapsed .nav-symbol { width: 100%; font-size: 18px; }
.control-sidebar { position: sticky; top: 0; display: flex; height: 100dvh; min-height: 620px; flex-direction: column; padding: 22px 14px 16px; border-right: 1px solid #e4e6e9; background: #fbfcfd; }
.control-sidebar .brand-lockup { padding: 0 8px; }
.control-sidebar .brand-mark { width: 34px; height: 34px; }
.control-sidebar .brand-name { font-size: 13px; }
.sidebar-workspace { display: grid; gap: 6px; margin: 30px 6px 21px; padding: 13px 12px; border: 1px solid #e8eaed; border-radius: 10px; background: #fff; }
.sidebar-label { color: #777e86; font-size: 9px; font-weight: 700; letter-spacing: .11em; }
.sidebar-workspace strong { color: #30343a; font-size: 12px; font-weight: 600; }
.control-nav { display: grid; gap: 4px; }
.control-nav-link { display: flex; min-height: 42px; align-items: center; gap: 11px; padding: 0 12px; border-radius: 8px; color: #4b5159; font-size: 12px; font-weight: 550; text-decoration: none; transition: background .15s, color .15s; }
.control-nav-link:hover { background: #f0f2f4; color: #20252b; }
.control-nav-link.is-active { color: #145b43; background: #e8f1eb; font-weight: 700; }
.nav-symbol { display: grid; width: 20px; place-items: center; color: #68717b; font-size: 16px; }
.control-nav-link.is-active .nav-symbol { color: #176b50; }
.sidebar-bottom { display: grid; gap: 13px; margin-top: auto; padding: 14px 8px 0; border-top: 1px solid #e9ebee; }
.sidebar-bottom .topbar-note { font-size: 11px; }
.sidebar-bottom .auth-user { overflow-wrap: anywhere; color: #58616a; font-size: 11px; }
.sidebar-bottom .auth-logout { width: 100%; }
.dashboard-main { min-width: 0; padding: 0 clamp(20px, 3vw, 46px) 20px; }
.dashboard-topbar { position: sticky; z-index: 3; top: 0; display: flex; min-height: 66px; align-items: center; justify-content: flex-start; gap: 14px; border-bottom: 1px solid #e4e6e9; background: #f5f6f8ed; backdrop-filter: blur(12px); }
.dashboard-topbar > a.button { margin-left: auto; }
.sidebar-toggle { flex: 0 0 38px; width: 38px; min-height: 38px; padding: 0; font-size: 18px; }
.dashboard-crumbs { display: flex; min-width: 0; align-items: center; gap: 10px; color: #777e86; font-size: 10px; letter-spacing: .07em; }
.dashboard-crumbs strong { color: #30343a; font-size: 12px; font-weight: 650; letter-spacing: 0; }
.dashboard-topbar .button { min-height: 38px; border: 1px solid #e0e3e7; background: #fff; font-size: 11px; }
.dashboard-main .auth-message { margin: 0; }
.dashboard-main .intro { padding: 27px 0 19px; }
.dashboard-main .hero-row { align-items: center; gap: 24px; }
.dashboard-main .hero-copy { min-width: 0; }
.dashboard-main .eyebrow { color: #68727d; font-size: 10px; letter-spacing: .1em; }
.dashboard-main h1 { margin: 0 0 9px; color: #20252b; font-size: clamp(32px, 3.5vw, 43px); letter-spacing: -.055em; }
.dashboard-main .lede { max-width: 590px; margin: 0; color: #626b75; font-size: 13px; }
.dashboard-main .hero-actions { margin-top: 15px; }
.dashboard-main .hero-actions .button { min-height: 39px; font-size: 11px; }
.dashboard-main .connection-card { min-width: 250px; max-width: 310px; padding: 13px 15px; border-color: #e4e6e9; border-radius: 11px; box-shadow: none; }
.dashboard-main .connection-label { color: #747d87; font-size: 9px; }
.dashboard-main .connection-card .field-help { margin: 0; font-size: 10px; }
.dashboard-main .ai-workspace { grid-template-columns: minmax(0, 1.1fr) minmax(280px, .9fr); align-items: start; gap: 18px; padding-bottom: 24px; }
.dashboard-main .panel { border-color: #e4e6e9; border-radius: 12px; box-shadow: 0 2px 8px #26323d08; }
.dashboard-main .ai-composer, .dashboard-main .queue { padding: 20px; }
.dashboard-main .ai-composer .section-heading { margin-bottom: 18px; }
.dashboard-main .ai-composer-header-actions { display: flex; align-items: center; gap: 9px; }
.dashboard-main .ai-composer-toggle { min-height: 32px; padding: 0 10px; font-size: 10px; white-space: nowrap; }
.dashboard-main .ai-composer.is-collapsed { padding: 14px 18px; }
.dashboard-main .ai-composer.is-collapsed .section-heading { margin-bottom: 0; }
.dashboard-main .ai-composer-content[hidden] { display: none; }
.dashboard-main .ai-composer .section-heading h2, .dashboard-main .queue h2 { color: #252a30; font-size: 18px; letter-spacing: -.025em; }
.dashboard-main .ai-subtitle { font-size: 11px; }
.dashboard-main .ai-mark { flex-basis: 36px; width: 36px; height: 36px; border-radius: 11px; font-size: 18px; }
.dashboard-main label { font-size: 12px; }
.dashboard-main input, .dashboard-main textarea, .dashboard-main select { font-size: 13px; }
.dashboard-main .field-help { font-size: 10px; }
.dashboard-main .ai-options summary, .dashboard-main .optional-image summary { font-size: 11px; }
.dashboard-main .ai-generate { min-height: 58px; }
.dashboard-main .ai-generate strong { font-size: 12px; }
.dashboard-main .ai-generate small { font-size: 10px; }
.dashboard-main .queue {
  position: sticky;
  top: 78px;
  min-height: 350px;
  max-height: calc(100dvh - 96px);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.dashboard-main .queue .section-heading { align-items: flex-start; gap: 10px; }
.dashboard-main .queue-heading-actions { flex-wrap: wrap; justify-content: flex-end; gap: 9px; }
.dashboard-main .queue .text-link, .dashboard-main .count-pill { font-size: 10px; }
.dashboard-main .queue-filters {
  display: flex;
  gap: 5px;
  margin: 0 0 12px;
  overflow-x: auto;
  border-bottom: 1px solid #e6e8eb;
  scrollbar-width: thin;
}
.dashboard-main .queue-filter {
  display: inline-flex;
  min-height: 38px;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
  margin-bottom: -1px;
  padding: 0 9px;
  border: 0;
  border-bottom: 2px solid transparent;
  color: #68727d;
  background: transparent;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
}
.dashboard-main .queue-filter.is-active { border-bottom-color: #176b50; color: #176b50; }
.dashboard-main .queue-filter-count { color: #879188; font-size: 9px; font-weight: 600; }
.dashboard-main .queue-filter:focus-visible { outline: 2px solid #176b50; outline-offset: -2px; }
.dashboard-main .post-list { gap: 9px; }
.dashboard-main .post-card { padding: 11px; }
.dashboard-main .post-title { font-size: 13px; }
.dashboard-main .post-audience, .dashboard-main .post-content, .dashboard-main .post-caption { font-size: 11px; }
.dashboard-main .post-content, .dashboard-main .post-caption {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
}
.dashboard-main .post-content { -webkit-line-clamp: 3; }
.dashboard-main .post-caption { -webkit-line-clamp: 2; }
.dashboard-main .generated-image-preview {
  width: min(100%, 160px);
  margin: 8px 0;
}
.dashboard-main .post-footer .button { min-height: 38px; font-size: 11px; }
.dashboard-main .empty-state { padding: 27px 12px; }
.dashboard-main .empty-state h3 { font-size: 14px; }
.dashboard-main .empty-state p { font-size: 11px; }
.dashboard-main .footer { padding: 12px 0 18px; color: #747d87; font-size: 10px; }
.dashboard-main :is(.ai-composer, #manual-post-form) :is(.form-row > label, .field-stack > label) {
  grid-template-columns: max-content minmax(0, 1fr);
  align-items: center;
}
.dashboard-main :is(.ai-composer, #manual-post-form) :is(.form-row > label, .field-stack > label) > .field-hint { grid-column: 2; }
.dashboard-main :is(.ai-composer, #manual-post-form) :is(.form-row > label, .field-stack > label) > :is(input, select, textarea) { grid-column: 1 / -1; }

@media (max-width: 680px) {
  .dashboard-main .ai-workspace { grid-template-columns: minmax(0, 1fr); }
  .dashboard-main .queue {
    position: static;
    max-height: none;
    overflow: visible;
  }
}

@media (min-width: 681px) and (max-width: 900px) {
  .dashboard-main .ai-workspace { gap: 14px; }
  .dashboard-main .queue { min-width: 0; padding: 16px; }
  .dashboard-main .ai-composer { padding: 16px; }
  .dashboard-main .post-content, .dashboard-main .post-caption { font-size: 10px; }
}

@media (min-width: 681px) and (max-height: 800px) {
  .dashboard-main .dashboard-topbar { min-height: 56px; }
  .dashboard-main .intro { padding: 15px 0 10px; }
  .dashboard-main h1 { margin-bottom: 5px; font-size: clamp(30px, 3vw, 36px); }
  .dashboard-main .hero-actions { margin-top: 9px; }
  .dashboard-main .ai-composer .section-heading { margin-bottom: 12px; }
}

@media (max-width: 860px) {
  .dashboard-main .hero-row { align-items: stretch; }
  .dashboard-main .connection-card { width: 100%; min-width: 0; max-width: none; }
}

@media (max-width: 800px) {
  .dashboard-frame { grid-template-columns: minmax(0, 1fr); }
  .dashboard-frame.sidebar-collapsed { grid-template-columns: minmax(0, 1fr); }
  .dashboard-frame.sidebar-collapsed .control-sidebar { flex-direction: row; align-items: center; justify-content: space-between; }
  .dashboard-frame.sidebar-collapsed .control-sidebar .brand-lockup { flex: 0 0 34px; width: 34px; margin-bottom: 0; }
  .dashboard-frame.sidebar-collapsed .control-nav { min-width: 0; flex: 1; justify-content: flex-end; }
  .dashboard-frame.sidebar-collapsed .control-nav-link { width: 40px; min-height: 40px; flex: 0 0 40px; }
  .control-sidebar { position: static; height: auto; min-height: 0; gap: 12px; padding: 12px 18px 10px; border-right: 0; border-bottom: 1px solid #e4e6e9; }
  .control-sidebar .brand-lockup { padding: 0; }
  .sidebar-workspace { display: none; }
  .control-nav { display: flex; gap: 5px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: thin; }
  .control-nav-link { min-height: 40px; flex: 0 0 auto; padding: 0 11px; font-size: 11px; }
  .nav-symbol { width: 16px; }
  .sidebar-bottom { display: flex; flex-wrap: wrap; align-items: center; gap: 9px 14px; margin: 0; padding: 0; border: 0; }
  .sidebar-bottom .topbar-note { margin-right: auto; }
  .sidebar-bottom .auth-logout { width: auto; min-height: 36px; }
  .dashboard-main { padding-right: 22px; padding-left: 22px; }
}

@media (max-width: 640px) {
  .control-sidebar { gap: 10px; padding: 11px max(14px, env(safe-area-inset-left)) 9px; }
  .control-sidebar .brand-mark { flex-basis: 32px; width: 32px; height: 32px; }
  .control-sidebar .brand-name { font-size: 12px; }
  .control-nav-link { min-height: 40px; padding: 0 9px; font-size: 10px; }
  .nav-symbol { display: none; }
  .sidebar-bottom { gap: 7px 10px; }
  .sidebar-bottom .topbar-note { font-size: 10px; }
  .sidebar-bottom .auth-user { max-width: 180px; font-size: 10px; }
  .sidebar-bottom .auth-logout { min-height: 36px; padding: 0 10px; font-size: 10px; }
  .dashboard-main { padding: 0 max(15px, env(safe-area-inset-right)) 14px max(15px, env(safe-area-inset-left)); }
  .dashboard-topbar { min-height: 56px; }
  .dashboard-crumbs { gap: 7px; font-size: 8px; }
  .dashboard-crumbs strong { font-size: 11px; }
  .dashboard-topbar .button { min-height: 36px; padding: 0 10px; font-size: 10px; }
  .dashboard-main .intro { padding: 22px 0 16px; }
  .dashboard-main .hero-row { align-items: stretch; gap: 14px; }
  .dashboard-main h1 { font-size: 32px; }
  .dashboard-main .lede { font-size: 12px; }
  .dashboard-main .hero-actions { display: flex; gap: 8px; }
  .dashboard-main .hero-actions .button { min-width: 0; flex: 1 1 0; padding: 0 9px; font-size: 10px; }
  .dashboard-main .connection-card { min-width: 0; max-width: none; }
  .dashboard-main .ai-composer, .dashboard-main .queue { padding: 16px; }
  .dashboard-main .ai-composer .section-heading h2, .dashboard-main .queue h2 { font-size: 17px; }
  .dashboard-main .queue .section-heading { flex-wrap: wrap; }
  .dashboard-main .queue-heading-actions { justify-content: flex-start; }
  .dashboard-main .queue-filters { margin-bottom: 9px; }
  .dashboard-main .queue-filter { min-height: 36px; font-size: 9px; }
  .dashboard-main .ai-workspace { gap: 20px; }
  .dashboard-main .footer { gap: 6px; }
  .dashboard-main input, .dashboard-main textarea, .dashboard-main select { font-size: 16px; }
}

.dashboard-main .manual-intro,
.dashboard-main .brand-intro,
.dashboard-main .brand-setup-intro { padding: 25px 0 18px; }
.dashboard-main .manual-intro h1,
.dashboard-main .brand-intro h1,
.dashboard-main .brand-setup-intro h1,
.dashboard-main .profile-toolbar h1 { margin: 0 0 9px; color: #20252b; font-size: clamp(30px, 3.2vw, 38px); line-height: 1.08; letter-spacing: -.05em; }
.dashboard-main .manual-intro .lede,
.dashboard-main .brand-intro .lede,
.dashboard-main .brand-setup-intro .lede { max-width: 700px; margin: 0; color: #626b75; font-size: 13px; line-height: 1.55; }
.dashboard-main .manual-layout,
.dashboard-main .brand-setup-layout { gap: 16px; padding-bottom: 24px; }
.dashboard-main .manual-composer,
.dashboard-main .manual-guidance,
.dashboard-main .brand-selector-panel,
.dashboard-main .brand-editor-panel,
.dashboard-main .brand-assets-panel,
.dashboard-main .brand-archive-panel,
.dashboard-main .brand-setup-form,
.dashboard-main .setup-reference { border-color: #e4e6e9; border-radius: 12px; box-shadow: 0 2px 8px #26323d08; }
.dashboard-main .manual-guidance,
.dashboard-main .setup-reference { background: #eef3ef; }
.dashboard-main .brand-workspace { gap: 16px; padding-bottom: 24px; }
.dashboard-main .brand-selector-panel { padding: 18px 20px; }
.dashboard-main .brand-selector-panel .section-heading { margin-bottom: 14px; }
.dashboard-main .brand-selector-panel .button,
.dashboard-main .brand-assets-panel .button { min-height: 39px; font-size: 11px; }
.dashboard-main .brand-main { gap: 16px; }
.dashboard-main .brand-editor-panel,
.dashboard-main .brand-assets-panel,
.dashboard-main .brand-archive-panel { padding: 19px; }
.dashboard-main .brand-management-panel { border-color: #e4e6e9; border-radius: 12px; box-shadow: 0 2px 8px #26323d08; }
.dashboard-main .profile-page { padding: 23px 0 30px; }
.dashboard-main .profile-toolbar { margin-bottom: 23px; }
.dashboard-main .profile-toolbar h1 { margin: 0; }
.dashboard-main .profile-brand-picker { color: #3f4941; font-size: 12px; }
.dashboard-main .social-profile { max-width: 850px; }
.dashboard-main .profile-feed-heading { border-color: #e4e6e9; }
.dashboard-main .profile-feed { border-color: #e4e6e9; }
.dashboard-main .profile-filter.is-active { color: #fff; background: #176b50; }
.dashboard-main .profile-empty { color: #20252b; }
.dashboard-main .profile-message { margin-bottom: 9px; }
.login-page { min-height: 100vh; background: #f5f6f8; }
.login-page .login-card { border-color: #e4e6e9; border-radius: 12px; box-shadow: 0 2px 12px #26323d0a; }
.login-page .login-card .brand-mark { width: 36px; height: 36px; border-radius: 10px; }

.landing-page {
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 78% 18%, rgba(201, 242, 106, .14), transparent 21rem),
    #f4f5f1;
}
.landing-nav {
  width: min(1180px, calc(100% - 48px));
  height: 78px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  border-bottom: 1px solid #dde2da;
}
.landing-nav-links { display: flex; gap: 28px; }
.landing-nav-links a {
  color: #59645d;
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
}
.landing-nav-links a:hover { color: var(--green); }
.landing-login { justify-self: end; min-height: 42px; color: #fff; background: var(--ink); }
.landing-hero {
  width: min(1180px, calc(100% - 48px));
  min-height: 620px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, .92fr) minmax(480px, 1.08fr);
  align-items: center;
  gap: 54px;
  padding: 68px 0 76px;
}
.landing-copy { max-width: 590px; }
.landing-eyebrow {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 18px;
  color: var(--green);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .16em;
}
.landing-eyebrow span { width: 24px; height: 2px; background: var(--lime); }
.landing-copy h1 {
  max-width: 560px;
  margin-bottom: 22px;
  color: #20251f;
  font-size: clamp(54px, 6vw, 82px);
  line-height: .94;
  letter-spacing: -.075em;
}
.landing-copy h1 em { color: var(--green); font-style: normal; }
.landing-lede {
  max-width: 530px;
  margin-bottom: 28px;
  color: #5d685f;
  font-size: 17px;
  line-height: 1.68;
}
.landing-actions { display: flex; align-items: center; gap: 22px; }
.landing-primary {
  min-height: 52px;
  padding: 0 20px;
  color: #fff;
  background: var(--green);
  border-radius: 10px;
  box-shadow: 0 12px 28px rgba(20, 107, 76, .16);
}
.landing-primary:hover { background: var(--green-dark); }
.landing-secondary {
  display: inline-flex;
  gap: 8px;
  color: #465248;
  text-decoration: none;
  font-size: 13px;
  font-weight: 800;
}
.landing-proof {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  max-width: 520px;
  margin-top: 42px;
  padding-top: 20px;
  border-top: 1px solid #dde2da;
}
.landing-proof div { display: grid; gap: 4px; }
.landing-proof strong { color: #2e3931; font-size: 13px; }
.landing-proof span { color: #7a857d; font-size: 10px; }
.landing-preview { position: relative; min-width: 0; }
.preview-window {
  overflow: hidden;
  border: 1px solid #dfe4dc;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 28px 70px rgba(40, 57, 48, .13);
  transform: rotate(.7deg);
}
.preview-topbar {
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  border-bottom: 1px solid #edf0eb;
}
.preview-brand { display: flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 800; }
.preview-brand img { width: 28px; height: 28px; }
.preview-user { padding: 7px 9px; border-radius: 7px; color: #68746b; background: #f1f3ef; font-size: 8px; font-weight: 800; }
.preview-body { height: 430px; display: grid; grid-template-columns: 58px 1fr; }
.preview-sidebar { display: flex; flex-direction: column; align-items: center; gap: 14px; padding-top: 24px; border-right: 1px solid #edf0eb; }
.preview-sidebar-item {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #8a948c;
  font-size: 12px;
}
.preview-sidebar-item.active { color: var(--green); background: #edf4ed; }
.preview-content { min-width: 0; padding: 25px; background: #fafbf8; }
.preview-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.preview-heading div { display: grid; gap: 5px; }
.preview-heading small { color: var(--green); font-size: 8px; font-weight: 800; letter-spacing: .12em; }
.preview-heading strong { font-size: 18px; letter-spacing: -.04em; }
.preview-status { padding: 6px 8px; border-radius: 99px; color: #507137; background: #edf5e5; font-size: 8px; font-weight: 800; }
.preview-grid { display: grid; grid-template-columns: 1.42fr .58fr; gap: 12px; }
.preview-card { border: 1px solid #e5e8e1; border-radius: 12px; background: #fff; }
.preview-card-main { padding: 15px; }
.preview-card-head { display: flex; justify-content: space-between; margin-bottom: 14px; color: #68736a; font-size: 8px; font-weight: 800; }
.preview-card-head span:last-child { color: var(--green); }
.preview-label { margin: 0 0 7px; color: #777f78; font-size: 8px; }
.preview-field { height: 36px; margin-bottom: 8px; display: flex; align-items: center; padding: 0 10px; border: 1px solid #e7e9e4; border-radius: 7px; color: #69736b; font-size: 9px; }
.preview-field-long { height: 82px; align-items: flex-start; padding-top: 10px; }
.preview-card-main button { width: 100%; height: 38px; border: 0; border-radius: 7px; color: #fff; background: var(--green); font-size: 9px; font-weight: 800; }
.preview-card-status { display: grid; align-content: start; gap: 10px; padding: 15px 12px; }
.preview-card-kicker { margin-bottom: 3px; color: #68736a; font-size: 8px; font-weight: 800; }
.preview-status-row { display: flex; align-items: center; justify-content: space-between; padding-bottom: 8px; border-bottom: 1px solid #f0f1ed; color: #69736b; font-size: 8px; }
.preview-status-row span { display: flex; align-items: center; gap: 6px; }
.preview-status-row strong { color: #303730; font-size: 10px; }
.preview-status-row i { width: 7px; height: 7px; border-radius: 50%; }
.dot-draft { background: #87958a; }.dot-review { background: #c77739; }.dot-approved { background: #538b38; }.dot-published { background: #3972a5; }
.preview-badge {
  position: absolute;
  right: -18px;
  bottom: 35px;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 205px;
  padding: 12px 14px;
  border: 1px solid #dfe5dc;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 16px 36px rgba(40, 57, 48, .12);
}
.preview-badge > span { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 9px; color: var(--green); background: #edf4ed; }
.preview-badge div { display: grid; gap: 3px; }
.preview-badge strong { font-size: 10px; }
.preview-badge small { color: #7b857d; font-size: 8px; }
.landing-features {
  background: #fff;
  padding: 92px max(24px, calc((100% - 1180px) / 2)) 100px;
  border-top: 1px solid #edf0ea;
  border-bottom: 1px solid #edf0ea;
}
.landing-section-heading { display: flex; align-items: end; justify-content: space-between; margin-bottom: 38px; }
.landing-section-heading .landing-eyebrow { margin: 0 0 8px; }
.landing-section-heading h2 {
  max-width: 560px;
  margin: 0;
  font-size: clamp(38px, 4vw, 58px);
  line-height: 1;
  letter-spacing: -.06em;
}
.landing-feature-grid { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid #e2e6df; }
.landing-feature-grid article { position: relative; min-height: 280px; padding: 32px 28px 20px 0; border-right: 1px solid #e2e6df; }
.landing-feature-grid article:not(:first-child) { padding-left: 28px; }
.landing-feature-grid article:last-child { border-right: 0; }
.feature-number { position: absolute; top: 34px; right: 22px; color: #9fa79f; font-size: 10px; font-weight: 800; }
.feature-icon { width: 44px; height: 44px; display: grid; place-items: center; margin-bottom: 48px; border-radius: 12px; color: var(--green); background: #edf4ed; font-size: 18px; }
.landing-feature-grid h3 { max-width: 210px; margin-bottom: 12px; font-size: 18px; line-height: 1.25; letter-spacing: -.03em; }
.landing-feature-grid p { margin: 0; color: #6c776f; font-size: 13px; line-height: 1.65; }
.landing-workflow {
  min-height: 400px;
  display: grid;
  grid-template-columns: .9fr 1.1fr;
  align-items: center;
  gap: 70px;
  padding: 82px max(24px, calc((100% - 1180px) / 2));
  color: #fff;
  background: #173d2f;
}
.landing-eyebrow-light { color: #cbe8d8; }
.landing-eyebrow-light span { background: var(--lime); }
.landing-workflow h2 { margin: 0; font-size: clamp(38px, 4vw, 56px); line-height: 1.02; letter-spacing: -.06em; }
.landing-steps { display: grid; margin: 0; padding: 0; list-style: none; }
.landing-steps li { display: grid; grid-template-columns: 44px 1fr; gap: 16px; align-items: start; padding: 19px 0; border-bottom: 1px solid rgba(255,255,255,.13); }
.landing-steps li:last-child { border-bottom: 0; }
.landing-steps li > span { width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.28); border-radius: 50%; color: var(--lime); font-size: 12px; font-weight: 800; }
.landing-steps strong { display: block; margin-bottom: 5px; font-size: 14px; }
.landing-steps p { margin: 0; color: #b9c9bf; font-size: 12px; }
.landing-footer {
  min-height: 110px;
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.landing-footer p { color: #78837b; font-size: 11px; }

@media (max-width: 980px) {
  .landing-hero { grid-template-columns: 1fr; padding-top: 50px; }
  .landing-copy { max-width: 680px; }
  .landing-preview { width: min(680px, 100%); }
  .landing-feature-grid { grid-template-columns: 1fr 1fr; }
  .landing-feature-grid article:nth-child(2) { border-right: 0; }
  .landing-feature-grid article:nth-child(3) { padding-left: 0; }
  .landing-workflow { grid-template-columns: 1fr; gap: 40px; }
}
@media (max-width: 620px) {
  .landing-nav { width: calc(100% - 32px); grid-template-columns: 1fr auto; }
  .landing-nav-links { display: none; }
  .landing-nav .brand-name { font-size: 12px; }
  .landing-login { min-height: 38px; }
  .landing-hero { width: calc(100% - 32px); min-height: auto; gap: 42px; padding: 44px 0 52px; }
  .landing-copy h1 { font-size: clamp(47px, 15vw, 64px); }
  .landing-lede { font-size: 15px; }
  .landing-actions { align-items: stretch; flex-direction: column; gap: 14px; }
  .landing-primary { width: 100%; }
  .landing-secondary { justify-content: center; }
  .landing-proof { margin-top: 34px; }
  .landing-proof div:nth-child(2) { text-align: center; }
  .landing-proof div:last-child { text-align: right; }
  .preview-window { transform: none; }
  .preview-body { height: 350px; grid-template-columns: 44px 1fr; }
  .preview-content { padding: 16px 12px; }
  .preview-grid { grid-template-columns: 1fr; }
  .preview-card-status { display: none; }
  .preview-badge { right: 8px; bottom: -28px; }
  .landing-features { padding: 64px 16px 68px; }
  .landing-section-heading { display: block; }
  .landing-feature-grid { grid-template-columns: 1fr; }
  .landing-feature-grid article,
  .landing-feature-grid article:not(:first-child) { min-height: 220px; padding: 26px 0; border-right: 0; border-bottom: 1px solid #e2e6df; }
  .landing-feature-grid article:last-child { border-bottom: 0; }
  .feature-icon { margin-bottom: 28px; }
  .landing-workflow { padding: 58px 16px; }
  .landing-footer { width: calc(100% - 32px); align-items: flex-start; flex-direction: column; justify-content: center; gap: 8px; }
}

@media (max-width: 1080px) {
  .dashboard-main .manual-layout,
  .dashboard-main .brand-setup-layout { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 800px) {
  .dashboard-main .brand-workspace { grid-template-columns: minmax(0, 1fr); }
  .dashboard-main .brand-selector-panel { grid-template-columns: minmax(0, 1fr); }
  .dashboard-main .brand-selector-panel .section-heading { grid-column: auto; }
}

@media (max-width: 640px) {
  .dashboard-main .manual-intro,
  .dashboard-main .brand-intro,
  .dashboard-main .brand-setup-intro { padding: 20px 0 16px; }
  .dashboard-main .manual-intro h1,
  .dashboard-main .brand-intro h1,
  .dashboard-main .brand-setup-intro h1,
  .dashboard-main .profile-toolbar h1 { font-size: 30px; }
  .dashboard-main .manual-layout,
  .dashboard-main .brand-workspace,
  .dashboard-main .brand-setup-layout { gap: 13px; padding-bottom: 19px; }
  .dashboard-main .brand-editor-panel,
  .dashboard-main .brand-assets-panel,
  .dashboard-main .brand-archive-panel,
  .dashboard-main .brand-management-panel,
  .dashboard-main .brand-selector-panel,
  .dashboard-main .brand-package-import,
  .dashboard-main .brand-setup-form,
  .dashboard-main .setup-reference { padding: 16px; }
  .dashboard-main .profile-page { padding-top: 20px; }
  .dashboard-main .profile-toolbar { margin-bottom: 20px; }
}

.ai-tool-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ai-tool-button, .ai-grounding-toggle { display: inline-flex; min-height: 38px; align-items: center; gap: 8px; padding: 0 12px; border: 1px solid #e1e4e9; border-radius: 9px; color: #414851; background: #fff; font-size: 11px; font-weight: 650; }
.ai-tool-button { cursor: pointer; }
.ai-tool-button:hover { border-color: #b7c9bc; background: #f7faf7; }
.ai-tool-button.has-context { border-color: #bbd8c5; color: #235a3d; background: #eff7f0; }
.ai-tool-plus { display: grid; width: 19px; height: 19px; place-items: center; border: 1px solid #e3e6e9; border-radius: 50%; color: #69727c; font-size: 14px; }
.ai-grounding-toggle { cursor: pointer; }
.ai-grounding-toggle:has(input:checked) { border-color: #c9d1e4; color: #39445d; background: #eef1f8; }
.ai-grounding-toggle input { width: 14px; height: 14px; margin: 0; accent-color: #50628e; }
.google-mark { display: grid; width: 18px; height: 18px; place-items: center; border-radius: 50%; color: #4a6fa8; background: #edf2fb; font-size: 12px; font-weight: 800; }
.ai-tool-help { margin: -5px 0 0; }
.ai-error-banner { position: fixed; z-index: 1000; top: max(14px, env(safe-area-inset-top)); left: 50%; display: grid; grid-template-columns: 32px minmax(0, 1fr) 32px; align-items: start; gap: 12px; width: min(760px, calc(100vw - 28px)); padding: 16px; border: 1px solid #e8aaaa; border-radius: 12px; color: #672d2d; background: #fff5f5; box-shadow: 0 12px 40px #27101033; transform: translateX(-50%); }
.ai-error-banner[hidden] { display: none; }
.ai-error-banner-icon { display: grid; width: 30px; height: 30px; place-items: center; border-radius: 9px; color: #a53d3d; background: #fbe1e1; font-weight: 800; }
.ai-error-banner-body { min-width: 0; }
.ai-error-banner-body > strong { display: block; margin: 1px 0 5px; font-size: 14px; line-height: 1.4; }
.ai-error-banner-body > p { margin: 0; color: #7e3f3f; font-size: 12px; line-height: 1.55; overflow-wrap: anywhere; white-space: pre-wrap; }
.ai-error-banner-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.ai-error-banner-actions .button { min-height: 38px; }
.ai-error-banner-close { display: grid; width: 30px; height: 30px; place-items: center; padding: 0; border: 1px solid #efd0d0; border-radius: 8px; color: #713e3e; background: #fff; font-size: 20px; line-height: 1; cursor: pointer; }
.ai-error-banner-close:hover { background: #ffebeb; }
.ai-response-card { display: grid; grid-template-columns: 30px minmax(0, 1fr); align-items: start; gap: 12px; padding: 16px; border: 1px solid #dfe5ec; border-radius: 11px; background: #f8fafc; }
.ai-response-card[hidden] { display: none; }
.ai-response-card[data-tone="needs-context"] { border-color: #efd9b7; background: #fffaf1; }
.ai-response-card[data-tone="error"] { border-color: #f0cccc; background: #fff7f7; }
.ai-response-icon { display: grid; width: 28px; height: 28px; place-items: center; border-radius: 9px; color: #3c597e; background: #e8eff8; font-size: 15px; font-weight: 800; }
.ai-response-card[data-tone="needs-context"] .ai-response-icon { color: #85591e; background: #f8e9cc; }
.ai-response-card[data-tone="error"] .ai-response-icon { color: #a53d3d; background: #fbe4e4; }
.ai-response-body { min-width: 0; }
.ai-response-body .eyebrow { margin-bottom: 5px; font-size: 9px; }
.ai-response-body h3 { margin: 0 0 6px; color: #26313c; font-size: 14px; line-height: 1.4; }
.ai-response-message { margin: 0; color: #505d69; font-size: 12px; line-height: 1.6; overflow-wrap: anywhere; white-space: pre-wrap; }
.ai-response-card[data-tone="needs-context"] .ai-response-message { color: #694d2e; }
.ai-response-card[data-tone="error"] .ai-response-message { color: #7e3f3f; }
.ai-response-sources { margin-top: 12px; padding-top: 10px; border-top: 1px solid #e6e9ed; color: #43505c; font-size: 11px; }
.ai-response-sources[hidden] { display: none; }
.ai-response-sources ul, .ai-result-sources ul { display: grid; gap: 6px; margin: 7px 0 0; padding-left: 18px; }
.ai-response-sources a, .ai-result-sources a { color: #245c8d; font-size: 11px; line-height: 1.45; overflow-wrap: anywhere; }
.ai-response-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 13px; }
.ai-response-actions:empty { display: none; }
.ai-response-actions .button { min-height: 36px; font-size: 11px; }
.ai-result-sources { padding: 9px 11px; border: 1px solid #e2e8e2; border-radius: 8px; background: #f8faf8; }
.ai-result-sources[hidden] { display: none; }
.ai-result-sources .field-help { margin: 0; }
.ai-context-dialog { width: min(540px, calc(100vw - 28px)); max-width: none; max-height: min(88dvh, 720px); padding: 0; overflow: auto; border: 1px solid #e0e4e8; border-radius: 15px; color: var(--ink); background: #fff; box-shadow: 0 24px 80px #111a1b44; }
.ai-context-dialog::backdrop { background: #17211ccc; backdrop-filter: blur(3px); }
.ai-context-dialog > form { display: grid; gap: 14px; padding: clamp(20px, 5vw, 28px); }
.ai-context-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.ai-context-heading .eyebrow { margin-bottom: 5px; }
.ai-context-heading h2 { font-size: 19px; }
.ai-context-heading .dialog-close { flex: 0 0 38px; margin: 0; border: 1px solid #e5e7ea; background: #f8f9fa; }
.ai-context-description { margin: -5px 0 0; color: #5d6771; font-size: 12px; line-height: 1.55; }
.ai-context-dialog textarea { min-height: 120px; }
.ai-context-confirm { display: grid; grid-template-columns: 18px minmax(0, 1fr); align-items: start; gap: 9px; color: #48535d; font-size: 11px; font-weight: 500; line-height: 1.5; }
.ai-context-confirm input { width: 16px; height: 16px; min-height: 0; margin: 1px 0 0; accent-color: var(--green); }
.ai-context-message { min-height: 0; margin: 0; color: #a23939; font-size: 11px; }
.ai-context-message:empty { display: none; }
.ai-context-actions { display: flex; justify-content: space-between; gap: 10px; padding-top: 6px; border-top: 1px solid #e9ebed; }
.ai-context-actions .button { min-height: 42px; }
.whatsapp-draft-footer { align-items: center; }
.whatsapp-draft-actions { display: flex; gap: 9px; }
.whatsapp-send-help { margin-top: -6px; }
.whatsapp-send-status:empty { display: none; }
.whatsapp-generation-status:empty { display: none; }
.whatsapp-generation-result { display: grid; gap: 8px; padding: 14px; border: 1px solid #e2e8e2; border-radius: 9px; background: #f8faf8; }
.whatsapp-generation-result[hidden], .whatsapp-generation-retry[hidden] { display: none; }
.whatsapp-generation-result pre[hidden] { display: none; }
.whatsapp-generation-result h4 { margin: 0; color: var(--ink); font-size: 13px; }
.whatsapp-generation-result pre { max-height: 360px; margin: 0; overflow: auto; color: var(--ink); font: inherit; font-size: 12px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.whatsapp-generation-files { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.whatsapp-generation-files a { color: var(--green); font-size: 12px; font-weight: 700; }
.whatsapp-generation-files small { display: block; color: var(--muted); font-size: 10px; }
.whatsapp-send-dialog > div { display: grid; gap: 14px; padding: clamp(20px, 5vw, 28px); }
.whatsapp-send-preview { max-height: min(42dvh, 360px); margin: 0; padding: 13px; overflow: auto; border: 1px solid #e2e8e2; border-radius: 9px; color: var(--ink); background: #f8faf8; font: inherit; font-size: 12px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.whatsapp-config-intro { padding-bottom: 20px; }
.whatsapp-config-panel, .whatsapp-pairing-panel { display: grid; gap: 14px; margin-bottom: 16px; padding: clamp(20px, 3vw, 30px); }
.whatsapp-config-panel .section-heading, .whatsapp-pairing-panel .section-heading { margin-bottom: 0; }
.whatsapp-config-form { display: grid; gap: 10px; max-width: 760px; }
.whatsapp-config-form > label { margin-top: 5px; }
.whatsapp-config-form > .field-help { margin: -5px 0 3px; }
.whatsapp-config-actions { align-items: center; margin-top: 8px; }
.whatsapp-config-actions > span { color: var(--muted); font-size: 11px; }
.whatsapp-config-message:empty { display: none; }
.whatsapp-connection-badge { flex: 0 0 auto; padding: 7px 10px; border-radius: 99px; color: #5e695f; background: #edf0ec; font-size: 10px; font-weight: 700; }
.whatsapp-connection-badge[data-state="connected"] { color: #215e3b; background: #e7f3e8; }
.whatsapp-connection-badge[data-state="pending"] { color: #795b27; background: #fbf1d8; }
.whatsapp-connection-badge[data-state="error"] { color: #8a3333; background: #fbe5e5; }
.whatsapp-status-card { padding: 14px 16px; border: 1px solid #dfe5ec; border-radius: 10px; background: #f8fafc; }
.whatsapp-status-card[data-state="connected"] { border-color: #c8dfce; background: #f1f8f2; }
.whatsapp-status-card[data-state="pending"] { border-color: #ead9ae; background: #fffaf0; }
.whatsapp-status-card[data-state="error"] { border-color: #efcaca; background: #fff6f6; }
.whatsapp-status-card strong { display: block; margin-bottom: 5px; font-size: 13px; }
.whatsapp-status-card p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.whatsapp-qr-panel { display: grid; justify-items: center; gap: 12px; padding: 20px; border: 1px solid var(--line); border-radius: 10px; background: #fff; text-align: center; }
.whatsapp-qr-panel[hidden] { display: none; }
.whatsapp-qr-panel img { width: min(280px, 100%); aspect-ratio: 1; padding: 8px; border: 1px solid #e4e6e5; border-radius: 8px; background: #fff; image-rendering: pixelated; }
.whatsapp-qr-panel p { max-width: 520px; margin: 0; color: #4e5a50; font-size: 12px; line-height: 1.6; }
.whatsapp-qr-panel small { color: var(--muted); font-size: 10px; }
.whatsapp-security-note { margin: 0; padding: 12px 14px; border-left: 3px solid #c18b3b; color: #685638; background: #fff9ee; font-size: 11px; line-height: 1.6; }
.whatsapp-security-note strong { color: #59451f; }

@media (max-width: 640px) {
  .whatsapp-config-panel, .whatsapp-pairing-panel { padding: 18px; }
  .whatsapp-config-actions { align-items: stretch; flex-direction: column; }
  .whatsapp-config-actions .button { width: 100%; }
  .whatsapp-pairing-panel .section-heading { align-items: flex-start; }
  .ai-error-banner { grid-template-columns: 26px minmax(0, 1fr) 28px; gap: 9px; width: calc(100vw - 20px); padding: 12px; }
  .ai-error-banner-icon, .ai-error-banner-close { width: 26px; height: 26px; }
  .ai-error-banner-body > strong { font-size: 13px; }
  .ai-error-banner-actions { display: grid; }
  .ai-error-banner-actions .button { width: 100%; }
  .ai-tool-row { align-items: stretch; }
  .ai-tool-button, .ai-grounding-toggle { min-height: 42px; font-size: 10px; }
  .ai-response-card { grid-template-columns: 25px minmax(0, 1fr); gap: 9px; padding: 13px; }
  .ai-response-icon { width: 24px; height: 24px; }
  .ai-response-actions { display: grid; grid-template-columns: 1fr; }
  .ai-response-actions .button { width: 100%; }
  .ai-context-dialog > form { padding: 20px; }
  .whatsapp-send-dialog > div { padding: 20px; }
  .ai-context-actions .button { flex: 1 1 0; padding: 0 10px; font-size: 10px; }
  .whatsapp-draft-footer, .whatsapp-draft-actions { align-items: stretch; flex-direction: column; }
  .whatsapp-draft-actions .button { width: 100%; }
}

/* Drafter: keep each help text attached to its field. */
.field-stack { display: grid; gap: 6px; align-content: start; }
.field-stack .field-help { margin: 0; }
.technical-notes { color: var(--muted); font-size: 12px; }
.technical-notes summary { cursor: pointer; font-weight: 600; }
.technical-notes .field-help { margin: 6px 0 0; }
.whatsapp-draft-actions { flex-wrap: wrap; justify-content: flex-end; }

/* Drafter position (left/right/top) and a wider content queue. */
.dashboard-main .ai-workspace {
  --drafter-col: minmax(0, 1fr);
  --queue-col: minmax(360px, 1.3fr);
  grid-template-columns: var(--drafter-col) var(--queue-col);
  grid-template-areas: "drafter queue";
}
.dashboard-main .ai-workspace > .ai-composer { grid-area: drafter; }
.dashboard-main .ai-workspace > .queue { grid-area: queue; }
.dashboard-main .ai-workspace.layout-right { grid-template-columns: var(--queue-col) var(--drafter-col); grid-template-areas: "queue drafter"; }
.dashboard-main .ai-workspace.layout-top { grid-template-columns: minmax(0, 1fr); grid-template-areas: "drafter" "queue"; }
.dashboard-main .ai-workspace.drafter-collapsed { --drafter-col: minmax(240px, .5fr); }
.layout-switch { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.layout-switch button { width: 30px; height: 28px; padding: 0; border: 0; border-radius: 6px; color: var(--muted); background: transparent; font-size: 15px; line-height: 1; cursor: pointer; }
.layout-switch button:hover { color: var(--ink); background: #f1f3ee; }
.layout-switch button[aria-pressed="true"] { color: #fff; background: #176b50; }
.layout-switch button:focus-visible { outline: 2px solid #4d9474; outline-offset: 1px; }
@media (max-width: 680px) {
  .dashboard-main .ai-workspace,
  .dashboard-main .ai-workspace.layout-right { grid-template-columns: minmax(0, 1fr); grid-template-areas: "drafter" "queue"; }
  .layout-switch { display: none; }
}

/* Drag-and-drop for the drafter panel; the buttons stay as the keyboard alternative. */
.drafter-drag-handle { display: inline-grid; place-items: center; width: 28px; height: 34px; border-radius: 7px; color: var(--muted); font-size: 18px; cursor: grab; user-select: none; }
.drafter-drag-handle:hover { color: var(--ink); background: #f1f3ee; }
.drafter-drag-handle:active { cursor: grabbing; }
.dashboard-main .ai-workspace { position: relative; }
.dashboard-main .ai-workspace.is-arranging::after { content: ""; position: absolute; z-index: 5; border: 2px dashed #4d9474; border-radius: 14px; background: rgba(23, 107, 80, .08); pointer-events: none; transition: inset .12s; }
.dashboard-main .ai-workspace[data-drop-layout="left"]::after { inset: 0 50% 0 0; }
.dashboard-main .ai-workspace[data-drop-layout="right"]::after { inset: 0 0 0 50%; }
.dashboard-main .ai-workspace[data-drop-layout="top"]::after { inset: 0 0 75% 0; }
@media (max-width: 680px) {
  .drafter-drag-handle { display: none; }
}
