:root {
  --brand: #0f6b5c;
  --brand-dark: #0b5144;
  --brand-tint: #e4f2ee;
  --ink: #1b1d1c;
  --muted: #6b6f6c;
  --line: #e6e1d6;
  --bg: #f3f0e9;
  --card: #fffdf8;
  --side: #181918;
  --side-ink: #e9e7e1;
  --side-muted: #9a9993;
  --danger: #b4233c;
  --danger-tint: #fdecef;
  --warn: #a15c00;
  --warn-tint: #fff4dc;
  --radius: 16px;
  --font: 'Hind Siliguri', 'Inter', system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font); color: var(--ink); background: var(--bg); font-size: 15.5px; line-height: 1.6; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.3; margin: 0 0 6px; }
h1 { font-size: 28px; font-weight: 700; }
h2 { font-size: 20px; font-weight: 600; }
h3 { font-size: 17px; font-weight: 600; }
p { margin: 0 0 8px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 8px 0; }
code { font-family: ui-monospace, Menlo, monospace; font-size: 14px; }

/* Layout */
.shell { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.side { background: var(--side); color: var(--side-ink); padding: 24px 14px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.main { padding: 32px 40px 80px; max-width: 1180px; width: 100%; }
.brand { padding: 0 10px 18px; }
.logo { font-family: 'Inter', sans-serif; font-weight: 700; font-size: 20px; color: #fff; letter-spacing: -0.02em; }
.logo:hover { text-decoration: none; }
.logo.big { font-size: 30px; color: var(--brand); }
.tag { font-size: 12.5px; color: var(--side-muted); }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav form { margin: 0; }
.nav-item { display: block; padding: 8px 10px; border-radius: 10px; color: var(--side-ink); border-left: 3px solid transparent; }
.nav-item span { display: block; font-size: 15px; }
.nav-item small { display: block; font-size: 11.5px; color: var(--side-muted); line-height: 1.3; }
.nav-item:hover { background: #262725; text-decoration: none; }
.nav-item.active { background: #2b2c2a; border-left-color: #6fd1b8; }
.nav-item.disabled { opacity: 0.45; cursor: default; }
.nav-item.disabled:hover { background: none; }
.nav-item.add span { color: #8fdcc6; }
.nav-group { padding: 6px 0 4px; }
.nav-biz { padding: 4px 10px; font-size: 14px; color: #fff; font-weight: 600; }
.nav-biz em { font-style: normal; font-size: 11px; color: var(--side-muted); font-weight: 400; }
.nav-sub { display: block; padding: 4px 10px 4px 22px; font-size: 13.5px; color: var(--side-muted); border-radius: 8px; }
.nav-sub:hover { color: #fff; background: #262725; text-decoration: none; }
.nav-sub.active { color: #fff; background: #2b2c2a; }
.linklike { background: none; border: 0; text-align: left; width: 100%; font: inherit; cursor: pointer; }

/* Page */
.page-head { margin: 8px 0 22px; }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--brand); margin-bottom: 4px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.section-title { margin: 28px 0 12px; }
.mt { margin-top: 18px; }
.row { display: flex; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; gap: 12px; }
.row.gap { gap: 10px; }
.row form { margin: 0; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.narrow { max-width: 560px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; margin-bottom: 16px; }
.card h3 { margin-bottom: 2px; }
.step { font-size: 12px; font-weight: 600; color: var(--brand); }
.empty { text-align: center; padding: 40px; }

/* Forms */
label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 14.5px; }
.label { font-weight: 600; font-size: 14.5px; margin-bottom: 6px; }
label small { font-weight: 400; }
input, select, textarea {
  font: inherit; font-weight: 400; color: var(--ink); background: #fff;
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; width: 100%;
}
textarea { resize: vertical; line-height: 1.6; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand-tint); border-color: var(--brand); }
input:disabled { background: #f5f3ee; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { flex-direction: row; align-items: center; gap: 8px; font-weight: 500; padding: 7px 14px; border: 1px solid var(--line); border-radius: 999px; background: #fff; cursor: pointer; }
.chip input { width: auto; margin: 0; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 6px; font: inherit; font-weight: 600; font-size: 14.5px; padding: 9px 16px; border-radius: 999px; border: 1px solid var(--line); background: #fff; color: var(--ink); cursor: pointer; white-space: nowrap; }
.btn:hover { text-decoration: none; border-color: #cfc9bc; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-dark); }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--danger); background: var(--danger-tint); border-color: #f5c6cf; }
.btn.small { padding: 6px 12px; font-size: 13.5px; }
.btn.icon { padding: 4px 9px; font-size: 12px; }
.btn.full { width: 100%; justify-content: center; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.copy { font: inherit; font-size: 12.5px; font-weight: 500; border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 2px 10px; cursor: pointer; color: var(--muted); }

/* Messages */
.flash { padding: 12px 16px; border-radius: 12px; margin-bottom: 16px; background: var(--brand-tint); color: var(--brand-dark); border: 1px solid #c4e3da; }
.flash.err { background: var(--danger-tint); color: var(--danger); border-color: #f5c6cf; }
.callout { padding: 14px 18px; border-radius: 12px; margin-bottom: 16px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.callout.warn { background: var(--warn-tint); color: var(--warn); border: 1px solid #f2dca8; }
.working { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-radius: 12px; background: #eef0ff; color: #3843a8; margin-bottom: 16px; font-weight: 500; }
.spinner { width: 14px; height: 14px; border: 2px solid #c3c8f5; border-top-color: #3843a8; border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.badge { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 10px; border-radius: 999px; background: #eeebe3; color: var(--muted); white-space: nowrap; }
.badge.ready { background: var(--brand-tint); color: var(--brand-dark); }
.badge.current { background: #e7efff; color: #2f4fb0; }
.badge.queued, .badge.generating { background: #eef0ff; color: #3843a8; }
.badge.failed { background: var(--danger-tint); color: var(--danger); }
.badge.title { background: #f1eee6; }

/* Dashboard */
.biz-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.biz-card { display: flex; flex-direction: column; gap: 14px; margin: 0; }
.biz-top { display: flex; gap: 12px; align-items: center; }
.avatar { width: 44px; height: 44px; border-radius: 50%; background: var(--brand-tint); color: var(--brand-dark); display: grid; place-items: center; font-weight: 700; font-family: 'Inter', sans-serif; }
.biz-name { font-weight: 600; font-size: 17px; }
.biz-stats { display: flex; gap: 18px; font-size: 14px; color: var(--muted); }
.biz-stats b { color: var(--ink); }
.add-card { align-items: center; justify-content: center; color: var(--ink); border-style: dashed; min-height: 170px; font-weight: 600; }
.add-card:hover { text-decoration: none; border-color: var(--brand); }
.plus { font-size: 34px; font-weight: 300; line-height: 1; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }
.list li a { flex: 1; color: var(--ink); font-weight: 500; }

/* Roadmap */
.year-head { display: flex; justify-content: space-between; align-items: baseline; margin: 28px 0 12px; }
.q-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.q-card { margin: 0; display: flex; flex-direction: column; gap: 8px; }
.q-card.current { border-color: var(--brand); box-shadow: inset 4px 0 0 var(--brand); }
.q-meta { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.q-no { font-weight: 700; color: var(--brand); font-size: 14px; }
.q-title { font-size: 17px; }
.q-theme { margin-top: 8px; font-size: 22px; }
.clamp { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; color: var(--muted); font-size: 14.5px; }
.clamp1 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.q-fields { display: grid; grid-template-columns: 70px 1fr; gap: 6px 10px; margin: 6px 0; font-size: 14px; border-top: 1px solid var(--line); padding-top: 10px; }
.q-fields dt { font-weight: 600; }
.q-fields dd { margin: 0; color: var(--muted); min-width: 0; }
details.edit { font-size: 14px; }
details.edit summary { cursor: pointer; color: var(--brand); font-weight: 600; margin: 4px 0; }
details.edit[open] summary { margin-bottom: 12px; }

/* Quarter */
.plan { display: grid; grid-template-columns: 170px 1fr; gap: 10px 16px; margin: 0; }
.plan dt { font-weight: 600; }
.plan dd { margin: 0; }
.progress-card strong { font-size: 19px; }
.bar { height: 6px; background: #ebe7dd; border-radius: 99px; margin-top: 10px; overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--brand); border-radius: 99px; }
.section.current { border-color: var(--brand); }
.items { list-style: none; padding: 0; margin: 14px 0; display: flex; flex-direction: column; gap: 8px; }
.item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.item.ready { background: #f2faf7; border-color: #cfe8df; }
.item .num { width: 26px; height: 26px; border-radius: 50%; background: #efece4; display: grid; place-items: center; font-size: 13px; flex: none; }
.item.ready .num { background: var(--brand); color: #fff; }
.item-title { flex: 1; font-weight: 500; color: var(--ink); }
.item-actions { display: flex; gap: 6px; }
.item-actions form { margin: 0; }
.icon-img { font-size: 14px; }

/* Content */
.post-img { width: 100%; max-width: 460px; border-radius: 12px; display: block; margin-top: 10px; }
.img-empty { border: 1px dashed var(--line); border-radius: 12px; padding: 30px; text-align: center; color: var(--muted); margin-top: 10px; }
.short-card { background: linear-gradient(135deg, #0f6b5c, #0b4f44); color: #fff; font-weight: 600; font-size: 18px; text-align: center; border: 0; }
.pl-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 8px; background: #999; }
.pl-dot.facebook { background: #1877f2; }
.pl-dot.instagram { background: #d62976; }
.pl-dot.linkedin { background: #0a66c2; }
.pl-dot.x { background: #111; }
.sticky-save { position: sticky; bottom: 16px; display: flex; justify-content: flex-end; }
.sticky-save .btn { box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15); }

/* Settings */
.guide ol { margin: 8px 0 0; padding-left: 20px; }
.guide li { margin-bottom: 4px; }
.saved { background: #eefaf5; border: 1px solid #bfe6d6; border-radius: 12px; padding: 12px 14px; color: var(--brand-dark); }
.danger-zone { margin-top: 30px; padding-top: 16px; border-top: 1px solid var(--line); }

/* Auth & bare pages */
.bare { background: var(--bg); }
.auth { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.auth-card { background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 36px; width: 100%; max-width: 400px; }
.doc { max-width: 720px; margin: 40px auto; padding: 0 20px 60px; }
.doc h2 { margin-top: 24px; }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; }
  .main { padding: 20px 16px 80px; }
  .q-grid, .grid2, .grid3 { grid-template-columns: 1fr; }
  .plan { grid-template-columns: 1fr; }
}

/* Image provider picker */
.providers { display: grid; gap: 8px; }
.provider { flex-direction: row; align-items: flex-start; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; cursor: pointer; font-weight: 400; }
.provider input { width: auto; margin-top: 5px; }
.provider span { display: flex; flex-direction: column; }
.provider small { color: var(--muted); font-size: 13px; }
.provider:has(input:checked) { border-color: var(--brand); background: #f2faf7; }

/* Publishing */
.pill { display: inline-block; background: #6fd1b8; color: #0b2f28; border-radius: 99px; font-size: 11px; padding: 0 7px; margin-left: 4px; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.tab { padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: #fff; color: var(--ink); font-weight: 600; font-size: 14px; }
.tab:hover { text-decoration: none; border-color: #cfc9bc; }
.tab.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.tab .count { font-weight: 400; opacity: 0.7; margin-left: 4px; }
.mb { margin-bottom: 14px; }
.pub { display: grid; grid-template-columns: 120px 1fr; gap: 18px; }
.pub-img { width: 120px; height: 120px; object-fit: cover; border-radius: 12px; }
.empty-img { display: grid; place-items: center; background: #f1eee6; color: var(--muted); font-size: 13px; }
.pub-body { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.pub-title { font-weight: 600; color: var(--ink); font-size: 16.5px; }
.pub-cap { color: var(--muted); font-size: 14px; white-space: pre-line; margin: 0; }
.wrap { flex-wrap: wrap; }
.dt { width: auto; padding: 5px 10px; font-size: 14px; }
.pub-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 12px; background: #f6f4ee; border-radius: 12px; }
label.inline { flex-direction: row; align-items: center; gap: 8px; font-size: 14px; }
.badge.approved { background: #e7efff; color: #2f4fb0; }
.badge.publishing { background: #eef0ff; color: #3843a8; }
.badge.published { background: var(--brand-tint); color: var(--brand-dark); }
.badge.review { background: var(--warn-tint); color: var(--warn); }
.copyline { display: flex; gap: 8px; align-items: center; margin-top: 6px; }
.copyline code { background: #f1eee6; padding: 4px 8px; border-radius: 6px; word-break: break-all; }
.guide-list li { margin-bottom: 8px; }
.guide-list code { background: #f1eee6; padding: 1px 6px; border-radius: 5px; font-size: 12.5px; }
.list li .grow { flex: 1; }
.disabled-link { opacity: 0.5; pointer-events: none; }
@media (max-width: 900px) { .pub { grid-template-columns: 1fr; } }
.default-submit { position: absolute; left: -9999px; width: 1px; height: 1px; }
.dash-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 24px; }
.dash-grid .card { margin: 0; }
.dash-grid .list li a { font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 1100px) { .dash-grid { grid-template-columns: 1fr; } }
.dt.mini { padding: 4px 6px; font-size: 13px; }
.logo-sub { font-weight: 500; opacity: 0.75; }
.logo-img { height: 24px; vertical-align: middle; filter: brightness(0) invert(1); }
.logo-img.big { height: 34px; filter: none; }
.logo.big .logo-sub { display: block; font-size: 16px; color: var(--muted); }

/* Business settings */
.callout.info { background: var(--brand-tint); color: var(--brand-dark); border: 1px solid #c4e3da; border-left: 4px solid var(--brand); }
.ask-ai { display: flex; flex-direction: column; align-items: center; gap: 6px; margin: 4px 0 18px; }
.ask-ai-btn { display: flex; align-items: center; gap: 12px; padding: 10px 20px 10px 12px; border-radius: 999px; border: 1px solid var(--line); background: #fff; cursor: pointer; font: inherit; text-align: left; box-shadow: 0 4px 14px rgba(0,0,0,0.06); }
.ask-ai-btn:hover { border-color: var(--brand); }
.ask-ai-btn[disabled] { opacity: 0.55; cursor: wait; }
.ask-ai-btn b { color: var(--brand-dark); display: block; }
.ask-ai-btn small { color: var(--muted); font-size: 12.5px; }
.ai-dot { width: 34px; height: 34px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-size: 16px; }
.setup .bar { margin: 10px 0 16px; }
.steps { display: flex; align-items: stretch; gap: 10px; }
.step-arrow { align-self: center; color: var(--brand); font-weight: 700; }
.step-card { flex: 1; display: flex; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; color: var(--ink); background: #fff; }
.step-card:hover { text-decoration: none; border-color: var(--brand); }
.step-card.active { border: 2px solid var(--brand); }
.step-no { width: 54px; display: grid; place-items: center; font-size: 26px; font-weight: 700; color: var(--brand); background: #f1efe8; }
.step-card.active .step-no { background: var(--brand); color: #fff; }
.step-body { padding: 10px 12px; display: flex; flex-direction: column; gap: 3px; }
.step-body small { color: var(--muted); font-size: 12.5px; }
.step-body .badge { align-self: flex-start; }
.tone-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.img-layout { display: grid; grid-template-columns: 1fr 380px; gap: 16px; align-items: start; }
.preview-card { position: sticky; top: 16px; }
.preview-img { width: 100%; border-radius: 12px; display: block; border: 1px solid var(--line); }
.logo-box { width: 140px; height: 90px; border: 1px dashed var(--line); border-radius: 12px; display: grid; place-items: center; background: repeating-conic-gradient(#f3f1ec 0 25%, #fff 0 50%) 0 0 / 16px 16px; }
.logo-box img { max-width: 120px; max-height: 70px; }
.asset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.asset { border: 1px solid var(--line); border-radius: 12px; padding: 6px; background: #fff; }
.asset img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; display: block; margin-bottom: 4px; }
.file-btn { cursor: pointer; }
.kb .card { margin: 0; }
.kb-preview { white-space: pre-line; margin: 0; }
.callout.small { font-size: 13.5px; padding: 10px 14px; }
@media (max-width: 1000px) { .img-layout, .tone-grid { grid-template-columns: 1fr; } .steps { flex-direction: column; } .step-arrow { display: none; } }
.callout.info, .callout.small { display: block; }
.ask-ai label.inline { flex-direction: row; white-space: nowrap; font-weight: 400; }
.ask-ai label.inline input { width: auto; }
