:root {
  --bg: #fbf8f5; --card: #fff; --ink: #1d1a17; --muted: #6f6861; --line: #ece5de;
  --brand: #ff6a00; --brand-ink: #fff; --brand-soft: #fff1e6; --violet: #3b2a8f;
  --ok: #15803d; --ok-bg: #e9f8ee; --warn: #a16207; --warn-bg: #fff7dc; --bad: #b91c1c; --bad-bg: #fdecec; --info: #1d4ed8; --info-bg: #eaf1ff;
  --radius: 14px; --shadow: 0 1px 2px rgba(0,0,0,.04), 0 6px 20px rgba(60,40,20,.06);
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #15120f; --card: #1f1b18; --ink: #f3eee9; --muted: #a59d95; --line: #322c27; --brand-soft: #3a2416;
    --ok-bg: #12301d; --warn-bg: #33290f; --bad-bg: #3a1717; --info-bg: #142542; --ok: #4ade80; --warn: #facc15; --bad: #f87171; --info: #93c5fd; }
}
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--ink); background: var(--bg); }
a { color: var(--brand); text-decoration: none; } a:hover { text-decoration: underline; }
h1 { font-size: 1.7rem; margin: .2rem 0; letter-spacing: -.01em; } h2 { font-size: 1.2rem; } h3 { margin: .2rem 0; } h4 { margin: 1rem 0 .3rem; }
img { max-width: 100%; }
.container { max-width: 1120px; margin: 0 auto; padding: 24px 16px 48px; }
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 12px 20px; background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.brand { font-weight: 800; font-size: 1.15rem; color: var(--ink); display: flex; align-items: center; gap: 8px; }
.logo-dot { width: 22px; height: 22px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #ffd2a8, var(--brand) 50%, #c2410c); box-shadow: 0 3px 8px rgba(255,106,0,.35); }
.nav { display: flex; gap: 16px; align-items: center; } .nav a { color: var(--ink); } .nav a.active { color: var(--brand); font-weight: 600; }
.who { color: var(--muted); font-size: .9rem; }
.modebar { background: var(--warn-bg); color: var(--warn); font-size: .85rem; padding: 6px 20px; display: flex; gap: 18px; flex-wrap: wrap; }
.foot { text-align: center; color: var(--muted); font-size: .85rem; padding: 24px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); margin-bottom: 16px; }
.card.narrow { max-width: 440px; margin: 40px auto; } .card.danger { border-color: var(--bad-bg); }
.center { text-align: center; } .right { text-align: right; } .muted { color: var(--muted); } .small { font-size: .85rem; } .err { color: var(--bad); }
.mt { margin-top: 16px; } .mt-s { margin-top: 8px; }
.row { display: flex; align-items: center; } .gap { gap: 16px; } .gap-s { gap: 8px; } .wrap { flex-wrap: wrap; } .between { justify-content: space-between; }
.inline { display: inline; }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; background: var(--brand); color: var(--brand-ink); border: 0; border-radius: 10px; padding: 10px 16px; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none !important; box-shadow: 0 2px 0 rgba(0,0,0,.08); }
.btn:hover { filter: brightness(1.05); } .btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); box-shadow: none; }
.btn.small { padding: 6px 12px; font-size: .85rem; } .btn.big { padding: 14px 22px; font-size: 1.05rem; } .btn.full { width: 100%; }
.btn.bad { background: var(--bad); } .btn.fb { background: #1877f2; }
.bad-text { color: var(--bad) !important; }
button.link { background: none; border: 0; color: var(--brand); cursor: pointer; font: inherit; padding: 0; }
.form label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: .9rem; margin-bottom: 14px; }
.form .label { font-weight: 600; font-size: .9rem; display: block; margin-bottom: 6px; }
input, textarea, select { font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; width: 100%; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--brand); outline-offset: 0; border-color: transparent; }
input[type=checkbox], input[type=radio] { width: auto; accent-color: var(--brand); } input[type=range] { padding: 0; accent-color: var(--brand); }
.form label.check, label.check { flex-direction: row; align-items: center; gap: 8px; font-weight: 500; margin: 0; }
.hint { font-weight: 400; color: var(--muted); font-size: .8rem; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0 18px; }
fieldset { border: 0; padding: 0; margin: 0; }
details summary { cursor: pointer; color: var(--muted); margin: 6px 0 12px; }
.flash { padding: 10px 14px; border-radius: 10px; margin-bottom: 12px; background: var(--info-bg); color: var(--info); }
.flash.ok { background: var(--ok-bg); color: var(--ok); } .flash.bad { background: var(--bad-bg); color: var(--bad); } .flash.warn { background: var(--warn-bg); color: var(--warn); }
.pill { font-size: .75rem; font-weight: 700; padding: 2px 9px; border-radius: 99px; background: var(--line); color: var(--muted); white-space: nowrap; }
.pill.ok { background: var(--ok-bg); color: var(--ok); } .pill.warn { background: var(--warn-bg); color: var(--warn); } .pill.bad { background: var(--bad-bg); color: var(--bad); } .pill.info { background: var(--info-bg); color: var(--info); }
.src { font-size: .75rem; font-weight: 600; color: var(--violet); } .src.trend { color: #be185d; }
@media (prefers-color-scheme: dark) { .src { color: #c4b5fd; } .src.trend { color: #f9a8d4; } }
.hero { padding: 48px 0 24px; max-width: 760px; } .hero h1 { font-size: 2.6rem; line-height: 1.1; } .lead { font-size: 1.15rem; color: var(--muted); }
.agents { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-top: 24px; }
.agent { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.ai { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; color: #fff; font-weight: 800; background: linear-gradient(135deg, var(--violet), var(--brand)); box-shadow: 0 6px 14px rgba(255,106,0,.25); }
.grid { display: grid; gap: 16px; } .biz-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); margin-bottom: 24px; }
.biz { color: var(--ink); text-decoration: none !important; display: flex; flex-direction: column; gap: 10px; transition: transform .1s; } .biz:hover { transform: translateY(-2px); }
.biz-head { display: flex; align-items: center; gap: 12px; }
.biz-logo { width: 44px; height: 44px; border-radius: 12px; object-fit: contain; background: #fff; border: 1px solid var(--line); }
.biz-logo.lg { width: 60px; height: 60px; }
.biz-logo.ph { display: grid; place-items: center; font-weight: 800; color: #fff; background: linear-gradient(135deg, var(--violet), var(--brand)); border: 0; text-transform: uppercase; }
.stats { display: flex; gap: 14px; font-size: .85rem; color: var(--muted); } .stats b { color: var(--ink); }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
@media (max-width: 800px) { .two-col { grid-template-columns: 1fr; } .hero h1 { font-size: 2rem; } .nav .who { display: none; } }
.postcard { display: flex; gap: 12px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; margin-bottom: 10px; }
.thumb img, .thumb-empty { width: 92px; height: 92px; border-radius: 10px; object-fit: cover; display: block; }
.thumb-empty { background: var(--brand-soft); display: grid; place-items: center; color: var(--brand); font-size: 1.5rem; }
.pc-body { flex: 1; min-width: 0; } .pc-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pc-title { display: block; font-weight: 600; color: var(--ink); margin: 4px 0 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.post-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 0 14px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tabs a { padding: 10px 14px; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; } .tabs a.active { color: var(--ink); border-color: var(--brand); font-weight: 600; }
.filters { display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; }
.filters a { padding: 5px 12px; border-radius: 99px; border: 1px solid var(--line); color: var(--muted); font-size: .85rem; } .filters a.active { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.switch { flex-direction: row !important; align-items: center; gap: 10px !important; font-size: 1rem !important; }
.radio-cards { display: grid; gap: 8px; } .rc { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; display: grid !important; grid-template-columns: auto 1fr; gap: 0 10px !important; margin: 0 !important; cursor: pointer; }
.rc input { grid-row: span 2; margin-top: 4px; } .rc:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; } .chip { background: var(--brand-soft); color: var(--ink); padding: 3px 10px; border-radius: 99px; font-size: .82rem; }
.ideas li { margin-bottom: 4px; }
.activity { list-style: none; padding: 0; margin: 0; } .activity li { padding: 8px 0; border-bottom: 1px solid var(--line); } .activity li.error { color: var(--bad); } .activity li.warn { color: var(--warn); }
.agent-tag { font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; font-weight: 700; background: var(--line); color: var(--muted); padding: 2px 7px; border-radius: 6px; }
.post-layout { display: grid; grid-template-columns: minmax(280px, 440px) 1fr; gap: 16px; align-items: start; }
@media (max-width: 800px) { .post-layout { grid-template-columns: 1fr; } }
.creative { width: 100%; border-radius: 12px; display: block; aspect-ratio: 1; object-fit: cover; }
.creative.empty { background: var(--brand-soft); display: grid; place-items: center; color: var(--muted); }
.results { padding-left: 0; list-style: none; } .results li { margin-bottom: 6px; }
.row select, .row input:not([type=checkbox]):not([type=radio]) { width: auto; }

.autopilot { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; padding: 14px 18px; }
.ap-state { display: flex; gap: 12px; align-items: center; } .ap-controls { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.autopilot .dot { width: 12px; height: 12px; border-radius: 50%; background: var(--muted); flex: none; }
.autopilot.on .dot { background: var(--ok); box-shadow: 0 0 0 4px var(--ok-bg); } .autopilot.on { border-color: var(--ok-bg); }
.toggle { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--card); color: var(--muted); border-radius: 99px; padding: 6px 12px 6px 6px; font: inherit; font-size: .88rem; cursor: pointer; }
.toggle .knob { width: 30px; height: 18px; border-radius: 99px; background: var(--line); position: relative; }
.toggle .knob::after { content: ''; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: left .15s; }
.toggle.is-on { color: var(--ink); border-color: var(--brand); } .toggle.is-on .knob { background: var(--brand); } .toggle.is-on .knob::after { left: 14px; }
.agent-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.agent-card { border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 4px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(78px, 1fr)); gap: 10px; }
.kpis div { background: var(--bg); border-radius: 10px; padding: 8px 10px; display: flex; flex-direction: column; }
.kpis b { font-size: 1.3rem; } .kpis span { font-size: .75rem; color: var(--muted); }
.table-wrap { overflow-x: auto; } .table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.table th { text-align: left; color: var(--muted); font-weight: 600; border-bottom: 1px solid var(--line); padding: 8px 6px; white-space: nowrap; }
.table td { border-bottom: 1px solid var(--line); padding: 8px 6px; vertical-align: top; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; } .nowrap { white-space: nowrap; }
.trend-list { padding-left: 18px; } .trend-list li { margin-bottom: 8px; }
.filters-form .cols { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }

.types { display: grid; gap: 8px; margin-bottom: 16px; }
.type-row { display: grid; grid-template-columns: 230px 1fr auto; gap: 6px 14px; align-items: center; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.type-row:has(> label > input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.type-count { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; font-size: .9rem; }
.type-count input { width: 70px; }
.inline-select { width: auto !important; padding: 2px 6px; display: inline-block; }
.form label.inline-check { display: inline-flex; margin-left: 6px; }
.ap-sep { width: 1px; height: 24px; background: var(--line); }
@media (max-width: 700px) { .type-row { grid-template-columns: 1fr; } }

.warn-text { color: var(--warn); }
