/* Business Brain — UI styles */
:root {
  --bg: #f5f6fa;
  --panel: #ffffff;
  --panel-2: #f9fafc;
  --ink: #171a24;
  --ink-2: #454b5c;
  --muted: #7a8093;
  --line: #e5e7ef;
  --line-2: #eef0f5;
  --accent: #4f46e5;
  --accent-ink: #ffffff;
  --accent-soft: #eef0ff;
  --good: #15803d; --good-soft: #e7f6ec;
  --warn: #b45309; --warn-soft: #fdf3e2;
  --bad: #c2410c;  --bad-soft: #fdece6;
  --info: #0369a1; --info-soft: #e5f2fa;
  --shadow: 0 1px 2px rgba(20,24,40,.05), 0 4px 16px rgba(20,24,40,.05);
  --radius: 12px;
  --side: 232px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1117; --panel: #171a22; --panel-2: #1c2029; --ink: #eceef4; --ink-2: #c3c7d4; --muted: #8b91a3;
    --line: #2a2f3b; --line-2: #222631; --accent: #7c74ff; --accent-soft: #24233f;
    --good: #4ade80; --good-soft: #15291d; --warn: #fbbf24; --warn-soft: #2d2512; --bad: #fb923c; --bad-soft: #2f1b12;
    --info: #38bdf8; --info-soft: #11263a; --shadow: 0 1px 2px rgba(0,0,0,.3);
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 14px/1.5 "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; letter-spacing: -.01em; }
h1 { font-size: 22px; } h2 { font-size: 17px; } h3 { font-size: 15px; } h4 { font-size: 13px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.num { font-variant-numeric: tabular-nums; }
.hidden { display: none !important; }
hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }

/* ---------- layout ---------- */
.shell { display: flex; min-height: 100vh; }
.side { width: var(--side); flex: none; background: var(--panel); border-right: 1px solid var(--line); position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 14px 10px; z-index: 30; }
.side .logo { display: flex; align-items: center; gap: 10px; padding: 6px 10px 16px; }
.side .logo .mark { width: 32px; height: 32px; border-radius: 9px; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 700; }
.side .logo b { display: block; font-size: 14px; line-height: 1.2; }
.side .logo span { font-size: 11.5px; color: var(--muted); }
.nav { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 8px; color: var(--ink-2); font-weight: 500; }
.nav a:hover { background: var(--line-2); text-decoration: none; }
.nav a.on { background: var(--accent-soft); color: var(--accent); }
.nav a svg { width: 18px; height: 18px; flex: none; }
.nav .badge { margin-left: auto; }
.nav .sep { height: 1px; background: var(--line); margin: 8px 6px; }
.side .me { margin-top: auto; padding: 10px; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 8px; font-size: 13px; }
.side .me a { margin-left: auto; font-size: 12.5px; color: var(--muted); }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); display: flex; align-items: center; gap: 10px; padding: 12px 24px; border-bottom: 1px solid var(--line); }
.topbar .burger { display: none; }
.ask { flex: 1; max-width: 640px; position: relative; }
.ask input { width: 100%; padding: 9px 14px 9px 38px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); font: inherit; }
.ask input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.ask svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--accent); }
.content { padding: 22px 24px 60px; max-width: 1280px; width: 100%; margin: 0 auto; }
.page-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head h1 { margin-right: auto; }
.page-head .sub { width: 100%; margin-top: -8px; }

/* ---------- panels ---------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card.pad { padding: 16px 18px; }
.card-h { display: flex; align-items: center; gap: 8px; padding: 14px 18px; border-bottom: 1px solid var(--line-2); }
.card-h h2, .card-h h3 { margin-right: auto; }
.card-b { padding: 14px 18px; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.spacer { flex: 1; }

.kpi { padding: 14px 16px; }
.kpi .l { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.kpi .v { font-size: 22px; font-weight: 700; margin-top: 2px; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.kpi .s { font-size: 12px; color: var(--muted); margin-top: 2px; }
.kpi.bad .v { color: var(--bad); } .kpi.good .v { color: var(--good); }

/* ---------- buttons & inputs ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 14px; border-radius: 9px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); font: inherit; font-weight: 500; cursor: pointer; white-space: nowrap; text-decoration: none !important; line-height: 1.2; }
.btn:hover { background: var(--line-2); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--bad); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--line-2); }
.btn.sm { padding: 5px 10px; font-size: 13px; border-radius: 8px; }
.btn.icon { padding: 7px; }
.btn.block { width: 100%; }
.btn svg { width: 16px; height: 16px; }
.btn[disabled] { opacity: .55; cursor: default; }
label { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
input, select, textarea { font: inherit; font-weight: 400; color: var(--ink); background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; width: 100%; min-width: 0; }
textarea { resize: vertical; min-height: 70px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
input[type=checkbox], input[type=radio] { width: auto; accent-color: var(--accent); }
label.check { flex-direction: row; align-items: center; gap: 8px; font-weight: 500; }
.form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; }
.form .full { grid-column: 1 / -1; }
.form .hint { font-weight: 400; color: var(--muted); font-size: 12px; }
.seg { display: inline-flex; background: var(--line-2); border-radius: 9px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button, .seg label { border: 0; background: transparent; padding: 5px 12px; border-radius: 7px; font: inherit; font-size: 13px; color: var(--ink-2); cursor: pointer; flex-direction: row; align-items: center; gap: 6px; font-weight: 500; }
.seg button.on { background: var(--panel); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.search { position: relative; }
.search input { padding-left: 32px; min-width: 200px; }
.search svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--muted); }

/* ---------- badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600; background: var(--line-2); color: var(--ink-2); white-space: nowrap; text-transform: capitalize; }
.badge.good { background: var(--good-soft); color: var(--good); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.info { background: var(--info-soft); color: var(--info); }
.badge.acc { background: var(--accent-soft); color: var(--accent); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }
.dot.high { background: var(--bad); } .dot.medium { background: var(--warn); } .dot.low { background: var(--muted); }

/* ---------- tables & lists ---------- */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 11px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr.click { cursor: pointer; }
.tbl tr.click:hover td { background: var(--panel-2); }
.tbl .r { text-align: right; }
.tbl-wrap { overflow-x: auto; }
.list { display: flex; flex-direction: column; }
.li { display: flex; align-items: center; gap: 10px; padding: 10px 18px; border-bottom: 1px solid var(--line-2); }
.li:last-child { border-bottom: 0; }
.li.click { cursor: pointer; } .li.click:hover { background: var(--panel-2); }
.li .main-t { flex: 1; min-width: 0; }
.li .t { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.li .m { font-size: 12.5px; color: var(--muted); display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.empty { padding: 28px 18px; text-align: center; color: var(--muted); }
.empty b { display: block; color: var(--ink-2); margin-bottom: 4px; }
.group-h { padding: 10px 18px 6px; font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); background: var(--panel-2); border-bottom: 1px solid var(--line-2); }
.group-h.bad { color: var(--bad); }

/* task checkbox */
.tick { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--line); background: transparent; cursor: pointer; flex: none; display: grid; place-items: center; padding: 0; color: transparent; }
.tick:hover { border-color: var(--good); color: var(--good); }
.tick.done { background: var(--good); border-color: var(--good); color: #fff; }
.tick svg { width: 12px; height: 12px; }
.task-done .t { text-decoration: line-through; color: var(--muted); }

/* ---------- tabs ---------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tabs button { background: none; border: 0; border-bottom: 2px solid transparent; padding: 9px 14px; font: inherit; font-weight: 500; color: var(--muted); cursor: pointer; white-space: nowrap; }
.tabs button.on { color: var(--accent); border-bottom-color: var(--accent); }

/* ---------- modal & toast ---------- */
.overlay { position: fixed; inset: 0; background: rgba(12,14,22,.45); z-index: 100; display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px 16px; overflow-y: auto; animation: fade .12s; }
.modal { background: var(--panel); border-radius: 14px; width: 100%; max-width: 560px; box-shadow: 0 20px 60px rgba(0,0,0,.25); animation: pop .15s; }
.modal.wide { max-width: 820px; }
.modal-h { display: flex; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line-2); }
.modal-h h2 { margin-right: auto; }
.modal-b { padding: 18px 20px; }
.modal-f { display: flex; gap: 8px; justify-content: flex-end; padding: 14px 20px; border-top: 1px solid var(--line-2); flex-wrap: wrap; }
.modal-f .left { margin-right: auto; }
@keyframes fade { from { opacity: 0 } }
@keyframes pop { from { transform: translateY(8px); opacity: 0 } }
.toasts { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast { background: #1f2330; color: #fff; padding: 10px 16px; border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.2); font-size: 13.5px; animation: pop .15s; max-width: 90vw; }
.toast.err { background: #9a3412; }

/* ---------- AI brain ---------- */
.brain { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 16px; height: calc(100vh - 150px); min-height: 480px; }
.chat { display: flex; flex-direction: column; min-height: 0; }
.chat-log { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.msg { max-width: 88%; }
.msg.user { align-self: flex-end; background: var(--accent); color: var(--accent-ink); padding: 10px 14px; border-radius: 14px 14px 4px 14px; white-space: pre-wrap; }
.msg.bot { align-self: flex-start; display: flex; gap: 10px; }
.msg.bot .av { width: 28px; height: 28px; border-radius: 8px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; flex: none; font-weight: 700; font-size: 13px; }
.msg.bot .bubble { background: var(--panel-2); border: 1px solid var(--line-2); padding: 10px 14px; border-radius: 4px 14px 14px 14px; min-width: 0; }
.md p { margin: 0 0 8px; } .md p:last-child { margin-bottom: 0; }
.md ul, .md ol { margin: 4px 0 8px; padding-left: 20px; }
.md li { margin: 2px 0; }
.md h1, .md h2, .md h3, .md h4 { font-size: 14.5px; margin: 10px 0 6px; }
.md code { background: var(--line-2); padding: 1px 5px; border-radius: 4px; font-size: 12.5px; }
.md table { border-collapse: collapse; margin: 6px 0; font-size: 13px; }
.md th, .md td { border: 1px solid var(--line); padding: 4px 8px; text-align: left; }
.actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: var(--good-soft); color: var(--good); font-size: 12.5px; font-weight: 500; cursor: pointer; border: 0; font-family: inherit; }
.chip:hover { filter: brightness(.97); }
.chip.plain { background: var(--panel); border: 1px solid var(--line); color: var(--ink-2); }
.draft { border: 1px solid var(--line); background: var(--panel); border-radius: 10px; margin-top: 10px; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.draft textarea { min-height: 160px; }
.chat-in { border-top: 1px solid var(--line); padding: 12px; display: flex; gap: 8px; align-items: flex-end; }
.chat-in textarea { min-height: 44px; max-height: 200px; resize: none; }
.suggest { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 8px; }
.typing span { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--muted); margin-right: 3px; animation: blink 1.2s infinite; }
.typing span:nth-child(2) { animation-delay: .2s } .typing span:nth-child(3) { animation-delay: .4s }
@keyframes blink { 50% { opacity: .2 } }
.hello { margin: auto; text-align: center; max-width: 520px; padding: 20px; }
.hello .big { width: 52px; height: 52px; border-radius: 14px; background: var(--accent); color: #fff; display: grid; place-items: center; font-size: 24px; font-weight: 700; margin: 0 auto 12px; }

/* ---------- inbox ---------- */
.mail { display: grid; grid-template-columns: 380px minmax(0, 1fr); gap: 16px; height: calc(100vh - 150px); min-height: 480px; }
.mail .col { display: flex; flex-direction: column; min-height: 0; }
.mail .scroll { overflow-y: auto; flex: 1; }
.mail-item { padding: 11px 16px; border-bottom: 1px solid var(--line-2); cursor: pointer; }
.mail-item:hover { background: var(--panel-2); }
.mail-item.on { background: var(--accent-soft); }
.mail-item .f { display: flex; gap: 8px; font-size: 13px; }
.mail-item .f b { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.mail-item.unread .f b, .mail-item.unread .s { font-weight: 700; }
.mail-item .s { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); }
.mail-view iframe { width: 100%; border: 0; min-height: 420px; background: #fff; border-radius: 8px; }
.mail-view pre { white-space: pre-wrap; font: inherit; margin: 0; }

/* ---------- doc editor ---------- */
.items-tbl { width: 100%; border-collapse: collapse; }
.items-tbl th { font-size: 11.5px; text-transform: uppercase; color: var(--muted); text-align: left; padding: 6px 6px; font-weight: 600; letter-spacing: .04em; }
.items-tbl td { padding: 4px 6px; vertical-align: top; }
.items-tbl .amt { text-align: right; padding-top: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.items-tbl input.det { margin-top: 4px; font-size: 12.5px; color: var(--muted); }
.totals { margin-left: auto; min-width: 280px; }
.totals div { display: flex; justify-content: space-between; padding: 5px 0; gap: 20px; }
.totals .grand { font-size: 17px; font-weight: 700; border-top: 1px solid var(--line); padding-top: 9px; margin-top: 4px; }

/* ---------- chart ---------- */
.chart svg { width: 100%; height: auto; display: block; }
.chart .legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); margin-top: 6px; }
.chart .legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.bar-row { display: grid; grid-template-columns: 140px 1fr 110px; align-items: center; gap: 10px; padding: 5px 0; font-size: 13px; }
.bar-row .track { height: 8px; background: var(--line-2); border-radius: 4px; overflow: hidden; }
.bar-row .fill { height: 100%; border-radius: 4px; }
.progress { height: 6px; background: var(--line-2); border-radius: 3px; overflow: hidden; min-width: 80px; }
.progress > div { height: 100%; background: var(--good); }

/* ---------- auth pages ---------- */
.auth-page { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: radial-gradient(1200px 600px at 20% -10%, var(--accent-soft), transparent), var(--bg); }
.auth-card { width: 100%; max-width: 380px; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 28px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 14px; }
.auth-card.wide { max-width: 640px; }
.auth-card h1 { font-size: 21px; }
.auth-card h3 { margin-top: 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.auth-card p { margin: -8px 0 0; }
.auth-card .grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.brand-mark { width: 44px; height: 44px; border-radius: 12px; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 20px; }
.alert { padding: 10px 12px; border-radius: 9px; background: var(--bad-soft); color: var(--bad); font-size: 13.5px; }
.alert.ok { background: var(--good-soft); color: var(--good); }
.alert.info { background: var(--info-soft); color: var(--info); }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-main, .g3 { grid-template-columns: minmax(0, 1fr); }
  .brain { grid-template-columns: minmax(0, 1fr); }
  .brain .notes-panel { display: none; }
}
@media (max-width: 860px) {
  .side { position: fixed; left: 0; top: 0; transform: translateX(-100%); transition: transform .2s; box-shadow: 0 0 40px rgba(0,0,0,.2); }
  .side.open { transform: none; }
  .scrim { position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 25; }
  .topbar { padding: 10px 16px; }
  .topbar .burger { display: inline-flex; }
  .content { padding: 16px 16px 60px; }
  .g2 { grid-template-columns: minmax(0, 1fr); }
  .mail { grid-template-columns: minmax(0, 1fr); height: auto; }
  .mail.reading .list-col { display: none; }
  .mail:not(.reading) .view-col { display: none; }
  .mail .scroll { max-height: none; }
  .brain { height: calc(100vh - 130px); }
  .form { grid-template-columns: minmax(0, 1fr); }
  .auth-card .grid2 { grid-template-columns: 1fr; }
  .hide-m { display: none !important; }
  .bar-row { grid-template-columns: 100px 1fr 90px; }
  .msg { max-width: 100%; }
  .items-tbl thead { display: none; }
  .items-tbl tr { display: grid; grid-template-columns: 1fr 1fr 1fr auto; gap: 4px; border-bottom: 1px solid var(--line-2); padding: 6px 0; }
  .items-tbl td:first-child { grid-column: 1 / -1; }
  .totals { min-width: 0; width: 100%; }
}
@media (max-width: 520px) {
  .g4 { grid-template-columns: minmax(0, 1fr); }
  .search input { min-width: 0; }
  .page-head .btn { padding: 7px 10px; }
}
.badge svg { width: 11px; height: 11px; }
.chip svg { width: 12px; height: 12px; }
.li .m svg { width: 12px; height: 12px; vertical-align: -1px; }
.notes-panel { display: flex; flex-direction: column; min-height: 0; }
.form.f3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 1100px) { .brain .notes-panel { display: none; } }
@media (max-width: 860px) { .form.f3 { grid-template-columns: minmax(0, 1fr); } }

/* ---------- social studio ---------- */
.warn-t { color: var(--warn); font-weight: 600; }
.brand-card { display: flex; flex-direction: column; gap: 12px; padding: 16px; color: inherit; text-decoration: none !important; transition: transform .12s, box-shadow .12s; }
.brand-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(20,24,40,.08); }
.brand-logo { width: 44px; height: 44px; border-radius: 10px; object-fit: contain; background: #fff; border: 1px solid var(--line); flex: none; }
.brand-logo.ph { display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 18px; border: 0; }
.swatches { display: flex; gap: 6px; } .swatches i { width: 28px; height: 28px; border-radius: 8px; border: 1px solid var(--line); }
.product-card { cursor: pointer; overflow: hidden; }
.thumb { aspect-ratio: 4/3; background: var(--panel-2); display: grid; place-items: center; overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: contain; }
.thumb.sm { width: 72px; height: 72px; aspect-ratio: auto; border-radius: 8px; border: 1px solid var(--line); }
.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.font-demo { margin-top: 14px; }
.cal-head { display: grid; grid-template-columns: repeat(7, 1fr); border-bottom: 1px solid var(--line); }
.cal-head div { padding: 8px 10px; font-size: 11.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-cell { min-height: 112px; border-right: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); padding: 6px; display: flex; flex-direction: column; gap: 4px; cursor: default; }
.cal-cell:nth-child(7n) { border-right: 0; }
.cal-cell.out { background: var(--panel-2); } .cal-cell.out .cal-d { opacity: .45; }
.cal-cell.today .cal-d { background: var(--accent); color: #fff; }
.cal-d { font-size: 12px; font-weight: 600; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; }
.cal-post { font-size: 12px; padding: 3px 6px; border-radius: 6px; background: var(--line-2); cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border-left: 3px solid var(--muted); }
.cal-post i, .dotc { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 4px; vertical-align: 1px; }
.cal-post.st-review { border-left-color: var(--warn); background: var(--warn-soft); }
.cal-post.st-approved { border-left-color: var(--good); background: var(--good-soft); }
.cal-post.st-published { border-left-color: var(--accent); background: var(--accent-soft); }
.cal-post.st-rejected { text-decoration: line-through; opacity: .6; }
.legend-st span { display: inline-flex; align-items: center; gap: 5px; }
.st-dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; background: var(--line); }
.st-dot.st-review { background: var(--warn); } .st-dot.st-approved { background: var(--good); } .st-dot.st-published { background: var(--accent); }
.post-thumb { width: 52px; height: 52px; border-radius: 8px; background: var(--panel-2); border: 1px solid var(--line-2); display: grid; place-items: center; overflow: hidden; flex: none; color: var(--muted); }
.post-thumb img, .post-thumb video { width: 100%; height: 100%; object-fit: cover; }
.editor-grid { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); align-items: start; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.mg-item { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--panel-2); }
.mg-item img, .mg-item video { width: 100%; aspect-ratio: 4/5; object-fit: cover; display: block; cursor: zoom-in; }
.mg-bar { display: flex; align-items: center; gap: 2px; padding: 4px 6px; } .mg-bar .badge { margin-right: auto; }
.ig { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--panel); max-width: 420px; }
.ig-h { display: flex; align-items: center; gap: 8px; padding: 10px 12px; font-size: 13px; }
.ig-h img, .ig-h span { width: 30px; height: 30px; border-radius: 50%; object-fit: contain; background: #fff; border: 1px solid var(--line); display: grid; place-items: center; color: #fff; font-weight: 700; }
.ig > img, .ig > video { width: 100%; display: block; }
.ig-ph { aspect-ratio: 4/5; background: var(--panel-2); display: grid; place-items: center; color: var(--muted); }
.ig-c { padding: 10px 12px 14px; font-size: 13.5px; line-height: 1.45; max-height: 260px; overflow-y: auto; }
.ig-tags { color: #00376b; margin-top: 6px; }
@media (prefers-color-scheme: dark) { .ig-tags { color: #8ab4f8; } }
.chat-img { width: 160px; border-radius: 10px; border: 1px solid var(--line); display: block; }
.designer { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.dz-canvas { background: repeating-conic-gradient(var(--line-2) 0 25%, var(--panel) 0 50%) 0/20px 20px; border-radius: 10px; padding: 10px; position: sticky; top: 0; }
.dz-canvas canvas { width: 100%; height: auto; max-height: 70vh; object-fit: contain; display: block; border-radius: 6px; box-shadow: 0 6px 24px rgba(0,0,0,.15); }
.dz-controls { max-height: 70vh; overflow-y: auto; padding-right: 4px; }
.dz-controls input[type=color], .form input[type=color] { height: 38px; padding: 3px; }
pre.code { background: var(--panel-2); border: 1px solid var(--line); padding: 10px; border-radius: 8px; white-space: pre-wrap; word-break: break-all; font-size: 12px; }
@media (max-width: 1100px) { .editor-grid, .designer { grid-template-columns: minmax(0, 1fr); } .dz-canvas { position: static; } }
@media (max-width: 860px) { .cal-cell { min-height: 70px; padding: 3px; } .cal-post { font-size: 10.5px; padding: 2px 4px; } .cal-post .muted { display: none; } }
.reel-pick { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.rp { flex-direction: row !important; align-items: center; gap: 8px !important; font-weight: 500 !important; padding: 6px; border: 1px solid var(--line); border-radius: 8px; }
.rp img { width: 44px; height: 44px; object-fit: cover; border-radius: 6px; flex: none; }
.rp span { width: 90px; flex: none; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rp .rp-t { flex: 1; padding: 6px 8px; font-size: 13px; }
.steps { padding-left: 18px; margin: 0 0 10px; } .steps li { margin-bottom: 8px; line-height: 1.45; }
code { background: var(--line-2); padding: 1px 5px; border-radius: 4px; font-size: 12px; }
.replies { margin-top: 8px; padding-left: 10px; border-left: 2px solid var(--line); display: flex; flex-direction: column; gap: 4px; }

/* ---------- training mode ---------- */
.train-grid { align-items: start; }
.transcript { max-height: calc(100vh - 260px); min-height: 320px; overflow-y: auto; padding: 14px 18px; line-height: 1.65; font-size: 14px; white-space: normal; }
.ts { display: inline-block; font-size: 11px; font-weight: 700; color: var(--accent); background: var(--accent-soft); border-radius: 5px; padding: 0 5px; margin-right: 6px; font-variant-numeric: tabular-nums; flex: none; }
.rec-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--line); display: inline-block; }
.rec-dot.on { background: #e11d48; box-shadow: 0 0 0 0 rgba(225,29,72,.6); animation: pulse 1.6s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px rgba(225,29,72,0); } 100% { box-shadow: 0 0 0 0 rgba(225,29,72,0); } }
.meter { width: 70px; height: 6px; background: var(--line-2); border-radius: 3px; overflow: hidden; }
.meter > div { height: 100%; width: 0; background: var(--good); transition: width .2s; }
.qa { border: 1px solid var(--line-2); border-radius: 10px; padding: 10px 12px; background: var(--panel-2); }
details.card summary { cursor: pointer; }
#trTitle { outline: none; border-radius: 6px; } #trTitle:focus { box-shadow: 0 0 0 2px var(--accent-soft); }

img.av { width: 30px; height: 30px; border-radius: 9px; flex: none; }
img.brand-mark { width: 52px; height: 52px; background: none; }
.hello img.big { width: 64px; height: 64px; background: none; border-radius: 16px; box-shadow: 0 8px 24px rgba(67,56,202,.35); }
