/* WE MIRROR Marketing — design tokens */
:root {
  color-scheme: light;
  --bg: #f4f3f0;
  --surface: #fcfcfb;
  --surface-2: #f0efec;
  --surface-3: #e6e4df;
  --border: #dedcd6;
  --text: #0b0b0b;
  --text-2: #52514e;
  --text-3: #7a7974;
  --accent: #111111;
  --accent-ink: #ffffff;
  --focus: #2a78d6;
  --grid: #e6e4df;
  --series-1: #2a78d6;
  --series-2: #eb6834;
  --series-3: #1baf7a;
  --series-4: #eda100;
  --good: #0ca30c;
  --good-text: #006300;
  --warning: #fab219;
  --serious: #ec835a;
  --critical: #d03b3b;
  --critical-text: #b42b2b;
  --good-bg: #e6f4e6;
  --warning-bg: #fdf3dc;
  --critical-bg: #fbe7e7;
  --info-bg: #e3eefb;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.05), 0 8px 24px rgba(0, 0, 0, 0.06);
  --radius: 10px;
  --radius-sm: 6px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --sidebar-w: 236px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #121211;
    --surface: #1a1a19;
    --surface-2: #232321;
    --surface-3: #2d2d2a;
    --border: #34342f;
    --text: #ffffff;
    --text-2: #c3c2b7;
    --text-3: #93928a;
    --accent: #f4f3f0;
    --accent-ink: #111111;
    --focus: #3987e5;
    --grid: #2d2d2a;
    --series-1: #3987e5;
    --series-2: #d95926;
    --series-3: #199e70;
    --series-4: #c98500;
    --good-text: #4cc94c;
    --critical-text: #f08a8a;
    --good-bg: #16301a;
    --warning-bg: #3a2f12;
    --critical-bg: #3b1a1a;
    --info-bg: #15263b;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.35);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #121211;
  --surface: #1a1a19;
  --surface-2: #232321;
  --surface-3: #2d2d2a;
  --border: #34342f;
  --text: #ffffff;
  --text-2: #c3c2b7;
  --text-3: #93928a;
  --accent: #f4f3f0;
  --accent-ink: #111111;
  --focus: #3987e5;
  --grid: #2d2d2a;
  --series-1: #3987e5;
  --series-2: #d95926;
  --series-3: #199e70;
  --series-4: #c98500;
  --good-text: #4cc94c;
  --critical-text: #f08a8a;
  --good-bg: #16301a;
  --warning-bg: #3a2f12;
  --critical-bg: #3b1a1a;
  --info-bg: #15263b;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; }
h1 { font-size: 22px; font-weight: 650; letter-spacing: -0.01em; }
h2 { font-size: 16px; font-weight: 620; }
h3 { font-size: 14px; font-weight: 620; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.muted { color: var(--text-2); }
.subtle { color: var(--text-3); font-size: 12px; }
.num { font-variant-numeric: tabular-nums; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Layout ---------- */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.brand { padding: 20px 20px 12px; display: flex; align-items: center; gap: 10px; }
.brand-mark {
  width: 32px; height: 32px; border-radius: 8px; background: var(--accent); color: var(--accent-ink);
  display: grid; place-items: center; font-weight: 800; font-size: 13px; letter-spacing: -0.04em;
}
.brand-name { font-weight: 750; letter-spacing: 0.08em; font-size: 13px; }
.brand-sub { font-size: 11px; color: var(--text-3); letter-spacing: 0.02em; }
.nav { padding: 8px 10px 16px; display: flex; flex-direction: column; gap: 1px; }
.nav-group { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-3); padding: 14px 10px 4px; }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: var(--radius-sm);
  text-decoration: none; color: var(--text-2); font-weight: 500;
}
.nav a:hover { background: var(--surface-2); color: var(--text); }
.nav a.active { background: var(--surface-3); color: var(--text); }
.nav svg { width: 17px; height: 17px; flex-shrink: 0; }
.nav .count { margin-left: auto; font-size: 11px; background: var(--critical); color: #fff; border-radius: 10px; padding: 0 6px; }
.sidebar-foot { margin-top: auto; padding: 12px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 6px; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 6px; border-radius: var(--radius-sm); text-decoration: none; }
.user-chip:hover { background: var(--surface-2); }
.avatar {
  width: 30px; height: 30px; border-radius: 50%; background: var(--surface-3); display: grid; place-items: center;
  font-size: 12px; font-weight: 650; flex-shrink: 0;
}
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: none; align-items: center; gap: 12px; padding: 10px 16px; background: var(--surface);
  border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 20;
}
.content { padding: 28px 32px 48px; max-width: 1400px; width: 100%; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head p { margin-top: 4px; }
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.backdrop { display: none; }

@media (max-width: 900px) {
  .sidebar { position: fixed; z-index: 50; left: 0; transform: translateX(-100%); transition: transform 0.2s; box-shadow: var(--shadow); }
  .shell.nav-open .sidebar { transform: none; }
  .shell.nav-open .backdrop { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, 0.35); z-index: 40; }
  .topbar { display: flex; }
  .content { padding: 20px 16px 40px; }
}

/* ---------- Components ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }
@media (max-width: 1100px) { .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 700px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: minmax(0, 1fr); } .span-2 { grid-column: auto; } }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }

.stat { display: flex; flex-direction: column; gap: 4px; }
.stat-label { font-size: 12px; color: var(--text-2); font-weight: 500; }
.stat-value { font-size: 26px; font-weight: 680; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stat-foot { font-size: 12px; color: var(--text-3); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.delta { font-weight: 600; font-size: 12px; }
.delta.up { color: var(--good-text); }
.delta.down { color: var(--critical-text); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 7px 14px;
  border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface); cursor: pointer;
  font-weight: 550; white-space: nowrap; text-decoration: none; min-height: 34px;
}
.btn:hover { background: var(--surface-2); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.primary:hover { opacity: 0.9; }
.btn.danger { color: var(--critical-text); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.sm { padding: 3px 9px; min-height: 28px; font-size: 13px; }
.btn.icon { padding: 6px; min-height: 32px; width: 32px; }
.btn svg { width: 16px; height: 16px; }
.btn.block { width: 100%; }

.field { display: flex; flex-direction: column; gap: 5px; }
.field label { font-size: 12px; font-weight: 600; color: var(--text-2); }
.field .help { font-size: 12px; color: var(--text-3); }
.input, select.input, textarea.input {
  width: 100%; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); min-height: 36px;
}
textarea.input { min-height: 90px; resize: vertical; }
.input:focus { outline: 2px solid var(--focus); outline-offset: -1px; border-color: transparent; }
.check { display: flex; gap: 8px; align-items: center; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 600px) { .form-grid { grid-template-columns: minmax(0, 1fr); } }
.search { max-width: 260px; }

.badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 1px 8px; border-radius: 999px; font-size: 12px;
  font-weight: 550; background: var(--surface-3); color: var(--text-2); white-space: nowrap;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: 0.8; }
.badge.plain::before { display: none; }
.badge.good { background: var(--good-bg); color: var(--good-text); }
.badge.warn { background: var(--warning-bg); color: var(--text); }
.badge.warn::before { background: var(--warning); opacity: 1; }
.badge.bad { background: var(--critical-bg); color: var(--critical-text); }
.badge.info { background: var(--info-bg); color: var(--text); }
.badge.info::before { background: var(--series-1); opacity: 1; }

.alert { padding: 10px 14px; border-radius: var(--radius-sm); font-size: 13px; display: flex; gap: 8px; align-items: flex-start; }
.alert.error { background: var(--critical-bg); color: var(--critical-text); }
.alert.info { background: var(--info-bg); }
.alert.warn { background: var(--warning-bg); }
.alert.ok { background: var(--good-bg); color: var(--good-text); }

/* Tables */
.table-wrap { overflow-x: auto; margin: 0 -18px; padding: 0 18px; }
table.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th {
  text-align: left; font-weight: 600; color: var(--text-2); font-size: 12px; padding: 8px 10px;
  border-bottom: 1px solid var(--border); white-space: nowrap; user-select: none;
}
.table th.sortable { cursor: pointer; }
.table th.sortable:hover { color: var(--text); }
.table td { padding: 9px 10px; border-bottom: 1px solid var(--surface-3); vertical-align: middle; }
.table tr.clickable { cursor: pointer; }
.table tr.clickable:hover td { background: var(--surface-2); }
.table .right { text-align: right; }
.table .truncate { max-width: 340px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.empty { padding: 32px 16px; text-align: center; color: var(--text-3); }

/* Tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 18px; overflow-x: auto; }
.tabs button {
  border: none; background: none; padding: 8px 12px; cursor: pointer; color: var(--text-2); font-weight: 550;
  border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap;
}
.tabs button.active { color: var(--text); border-bottom-color: var(--accent); }

/* Modal */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0, 0, 0, 0.45); display: grid; place-items: center; z-index: 100; padding: 16px;
}
.modal {
  background: var(--surface); border-radius: 12px; width: min(640px, 100%); max-height: calc(100vh - 32px);
  display: flex; flex-direction: column; box-shadow: var(--shadow); border: 1px solid var(--border);
}
.modal.wide { width: min(920px, 100%); }
.modal-head { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 12px; }
.modal-body { padding: 20px; overflow-y: auto; }
.modal-foot { padding: 12px 20px; border-top: 1px solid var(--border); display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }

/* Toasts */
.toasts { position: fixed; bottom: 16px; right: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 200; max-width: calc(100vw - 32px); }
.toast { background: var(--accent); color: var(--accent-ink); padding: 10px 14px; border-radius: var(--radius-sm); box-shadow: var(--shadow); max-width: 420px; }
.toast.error { background: var(--critical); color: #fff; }

/* Auth screens */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.auth-card { width: min(420px, 100%); background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 32px; box-shadow: var(--shadow); }
.auth-card .brand { padding: 0 0 24px; }
.auth-card h1 { font-size: 20px; margin-bottom: 6px; }
.auth-card form { display: flex; flex-direction: column; gap: 14px; margin-top: 20px; }
.qr { width: 196px; height: 196px; margin: 8px auto; background: #fff; padding: 6px; border-radius: 8px; }
.qr svg { width: 100%; height: 100%; display: block; }
.secret { font-family: ui-monospace, Menlo, monospace; font-size: 13px; letter-spacing: 0.08em; word-break: break-all; background: var(--surface-2); padding: 8px 10px; border-radius: 6px; text-align: center; }
.codes { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; font-family: ui-monospace, Menlo, monospace; font-size: 14px; background: var(--surface-2); padding: 12px; border-radius: 8px; }
.otp-input { font-size: 22px; letter-spacing: 0.4em; text-align: center; font-family: ui-monospace, Menlo, monospace; }
.strength { height: 4px; border-radius: 2px; background: var(--surface-3); overflow: hidden; }
.strength > span { display: block; height: 100%; width: 0; transition: width 0.2s; }
.link-btn { background: none; border: none; padding: 0; color: var(--text-2); text-decoration: underline; cursor: pointer; font-size: 13px; }

/* Kanban */
.kanban { display: grid; grid-template-columns: repeat(4, minmax(240px, 1fr)); gap: 14px; overflow-x: auto; padding-bottom: 8px; }
.kcol { background: var(--surface-2); border-radius: var(--radius); padding: 10px; min-height: 200px; display: flex; flex-direction: column; gap: 8px; }
.kcol.drop { outline: 2px dashed var(--focus); outline-offset: -2px; }
.kcol-head { display: flex; align-items: center; justify-content: space-between; padding: 2px 4px 6px; font-weight: 620; }
.kcard { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; cursor: grab; display: flex; flex-direction: column; gap: 6px; }
.kcard:hover { border-color: var(--text-3); }
.kcard.dragging { opacity: 0.5; }
.kcard .meta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; font-size: 12px; color: var(--text-3); }
.overdue { color: var(--critical-text); font-weight: 600; }

/* Calendar */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--border); border-left: 1px solid var(--border); }
.cal-dow { font-size: 11px; text-transform: uppercase; color: var(--text-3); padding: 6px 8px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); background: var(--surface-2); }
.cal-day { min-height: 112px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 6px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.cal-day.other { background: var(--surface-2); color: var(--text-3); }
.cal-day.today .cal-num { background: var(--accent); color: var(--accent-ink); }
.cal-num { font-size: 12px; font-weight: 600; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; }
.cal-item {
  font-size: 12px; padding: 3px 6px; border-radius: 4px; background: var(--surface-3); cursor: pointer;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-left: 3px solid var(--text-3);
}
.cal-item.agendado { border-left-color: var(--series-1); }
.cal-item.publicado { border-left-color: var(--good); }
.cal-item.em_producao, .cal-item.roteiro, .cal-item.aprovacao { border-left-color: var(--warning); }
.cal-item.ideia { border-left-color: var(--text-3); }
@media (max-width: 700px) {
  .cal { grid-template-columns: minmax(0, 1fr); }
  .cal-dow, .cal-day.other.empty-day { display: none; }
  .cal-day { min-height: 0; }
}

/* Lists */
.list { display: flex; flex-direction: column; }
.list-item { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--surface-3); min-width: 0; }
.list-item:last-child { border-bottom: none; }
.list-item .grow { flex: 1; min-width: 0; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.progress { height: 6px; background: var(--surface-3); border-radius: 3px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--series-1); border-radius: 3px; }
.thumb { width: 44px; height: 44px; border-radius: 6px; object-fit: cover; background: var(--surface-3); flex-shrink: 0; }

/* Charts */
.chart { position: relative; width: 100%; }
.chart svg { display: block; width: 100%; overflow: visible; }
.chart .axis text { fill: var(--text-3); font-size: 11px; }
.chart .gridline { stroke: var(--grid); stroke-width: 1; }
.chart .baseline { stroke: var(--text-3); stroke-width: 1; }
.chart .crosshair { stroke: var(--text-3); stroke-width: 1; stroke-dasharray: 3 3; }
.chart-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--text-2); margin-bottom: 8px; }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.chart-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.tooltip {
  position: absolute; pointer-events: none; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow);
  border-radius: 8px; padding: 8px 10px; font-size: 12px; z-index: 5; min-width: 120px; white-space: nowrap;
}
.tooltip .t-title { font-weight: 620; margin-bottom: 4px; }
.tooltip .t-row { display: flex; align-items: center; gap: 6px; }
.tooltip .t-row i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }
.tooltip .t-row b { margin-left: auto; padding-left: 12px; font-variant-numeric: tabular-nums; }
.hbars { display: flex; flex-direction: column; gap: 8px; }
.hbar { display: grid; grid-template-columns: minmax(80px, 140px) 1fr auto; gap: 10px; align-items: center; font-size: 13px; }
.hbar-track { height: 14px; position: relative; }
.hbar-fill { height: 100%; background: var(--series-1); border-radius: 0 4px 4px 0; min-width: 2px; }
.hbar:hover .hbar-fill { opacity: 0.85; }
.hbar .val { font-variant-numeric: tabular-nums; color: var(--text-2); min-width: 60px; text-align: right; }

.copy-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; gap: 8px; background: var(--surface); }
.copy-text { white-space: pre-wrap; font-size: 14px; line-height: 1.55; }
.tag-list { display: flex; gap: 6px; flex-wrap: wrap; }
.trend-item { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--surface-3); }
.trend-rank { width: 26px; height: 26px; border-radius: 6px; background: var(--surface-3); display: grid; place-items: center; font-size: 12px; font-weight: 650; flex-shrink: 0; }
.dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; font-size: 13px; }
.dl dt { color: var(--text-2); }
.dl dd { margin: 0; }
pre.log { white-space: pre-wrap; font-size: 12px; background: var(--surface-2); padding: 10px; border-radius: 6px; margin: 0; max-height: 240px; overflow: auto; }
.grow { flex: 1; min-width: 0; }
details summary { cursor: pointer; margin: 8px 0; }
.toolbar .input { width: auto; max-width: 100%; }
@media (max-width: 600px) { .toolbar { width: 100%; } .toolbar .input, .toolbar .search { flex: 1 1 160px; max-width: none; } }
.cal-dow-mobile { display: none; }
@media (max-width: 700px) { .cal-dow-mobile { display: inline; } }
.chart-plot { width: 100%; min-height: 40px; }
.chart svg { width: auto; }
.kcard select.input { min-height: 28px; padding: 2px 6px; font-size: 12px; color: var(--text-2); }

/* Instagram trends */
.post-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.post-card { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--surface); display: flex; flex-direction: column; min-width: 0; }
.post-img { width: 100%; aspect-ratio: 1; object-fit: cover; background: var(--surface-3); display: block; }
.post-img.placeholder { display: grid; place-items: center; color: var(--text-3); font-size: 13px; font-weight: 600; }
.post-body { padding: 12px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.post-caption { font-size: 13px; color: var(--text-2); line-height: 1.45; flex: 1; overflow-wrap: anywhere; }
.post-card .metric { margin-left: auto; color: var(--text); }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); font-size: 13px; color: var(--text); }
.chip.clickable { cursor: pointer; font: inherit; font-size: 13px; }
.chip.clickable:hover { border-color: var(--text-3); }
.chip.error { border-color: var(--critical); color: var(--critical-text); }
.chip-x { border: none; background: none; cursor: pointer; color: var(--text-3); font-size: 15px; line-height: 1; padding: 0 0 0 4px; }
.chip-x:hover { color: var(--critical-text); }

/* Publish to Instagram */
.publish-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 1000px) { .publish-grid { grid-template-columns: minmax(0, 1fr); } }
.type-picker { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 600px) { .type-picker { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.type-option { display: flex; flex-direction: column; gap: 2px; text-align: left; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); cursor: pointer; font: inherit; color: inherit; transition: border-color 0.15s, background 0.15s; }
.type-option:hover { border-color: var(--text-3); }
.type-option.active { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); background: var(--surface-2); }
.type-option .subtle { font-size: 11px; }
.media-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.media-item { position: relative; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface-2); display: flex; flex-direction: column; min-height: 140px; }
.media-item img, .media-item video { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; background: #000; }
.media-item.add { align-items: center; justify-content: center; gap: 4px; cursor: pointer; border-style: dashed; font: inherit; color: var(--text-2); padding: 12px; }
.media-item.add:hover { border-color: var(--text-3); color: var(--text); }
.media-item.add svg { width: 22px; height: 22px; }
.media-item.uploading { align-items: center; justify-content: center; padding: 12px; text-align: center; }
.media-meta { padding: 4px 8px; font-size: 11px; }
.media-actions { position: absolute; top: 4px; right: 4px; display: flex; gap: 2px; }
.media-actions .btn { background: var(--surface); min-height: 26px; padding: 2px 6px; }
.caption-input { min-height: 180px; font-size: 14px; line-height: 1.5; }
.ig-preview { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--surface); max-width: 420px; margin: 0 auto; }
.ig-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; }
.ig-head .avatar { width: 30px; height: 30px; font-size: 11px; background: var(--accent); color: var(--accent-ink); }
.ig-media-wrap { position: relative; background: #000; }
.ig-media { width: 100%; display: block; max-height: 560px; object-fit: cover; }
.ig-media.vertical { aspect-ratio: 9 / 16; max-height: 640px; }
.ig-media.empty { aspect-ratio: 4 / 5; display: grid; place-items: center; color: var(--text-3); background: var(--surface-2); }
.ig-media.empty.vertical { aspect-ratio: 9 / 16; }
.ig-dots { position: absolute; bottom: 10px; left: 0; right: 0; display: flex; justify-content: center; gap: 5px; }
.ig-dots button { width: 7px; height: 7px; border-radius: 50%; border: none; padding: 0; background: rgba(255, 255, 255, 0.55); cursor: pointer; }
.ig-dots button.active { background: #fff; }
.ig-caption { padding: 10px 12px 14px; font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
.pre { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; line-height: 1.5; }
.review-head { align-items: flex-start; gap: 14px; }
.score { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; font-size: 20px; font-weight: 700; flex-shrink: 0; border: 3px solid currentColor; }
.score.good { color: var(--good-text); }
.score.warn { color: var(--serious); }
.score.bad { color: var(--critical-text); }
.list-item.issue { align-items: flex-start; }
.card.inset { background: var(--surface-2); padding: 12px; }
.list-row { display: flex; align-items: center; gap: 12px; text-align: left; width: 100%; cursor: pointer; font: inherit; color: inherit; padding: 12px 14px; }
.list-row:hover { border-color: var(--text-3); }
.review-loading { display: flex; align-items: center; gap: 10px; padding: 16px 0; color: var(--text-2); }
.spinner { width: 18px; height: 18px; border: 2px solid var(--surface-3); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; flex-shrink: 0; }
@keyframes spin { to { transform: rotate(360deg); } }
.dim { opacity: 0.55; }

/* ---------- Motion ----------
   Short, purposeful transitions: content enters, feedback appears, data grows into place.
   Everything is disabled for people who prefer reduced motion. */
:root { --ease-out: cubic-bezier(0.22, 1, 0.36, 1); --dur: 380ms; }

@keyframes enter-up { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes fade-out { to { opacity: 0; } }
@keyframes pop-in { from { opacity: 0; transform: translateY(12px) scale(0.97); } to { opacity: 1; transform: none; } }
@keyframes pop-out { to { opacity: 0; transform: translateY(8px) scale(0.98); } }
@keyframes toast-in { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateX(24px); } }
@keyframes draw-line { to { stroke-dashoffset: 0; } }
@keyframes grow-x { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

.auth-card { animation: pop-in 420ms var(--ease-out) both; }
.enter { animation: enter-up var(--dur) var(--ease-out) both; animation-delay: calc(var(--i, 0) * 45ms); }

/* Modal */
.modal-backdrop { animation: fade-in 180ms ease-out both; }
.modal-backdrop .modal { animation: pop-in 260ms var(--ease-out) both; }
.modal-backdrop.closing { animation: fade-out 160ms ease-in both; pointer-events: none; }
.modal-backdrop.closing .modal { animation: pop-out 160ms ease-in both; }

/* Toast */
.toast { animation: toast-in 280ms var(--ease-out) both; }
.toast.leaving { animation: toast-out 220ms ease-in both; }

/* Charts */
.chart path.series.draw { stroke-dasharray: var(--len); stroke-dashoffset: var(--len); animation: draw-line 1100ms var(--ease-out) 120ms forwards; }
.hbar-fill { transform-origin: left center; animation: grow-x 800ms var(--ease-out) both; }
.hbar:nth-child(2) .hbar-fill { animation-delay: 50ms; }
.hbar:nth-child(3) .hbar-fill { animation-delay: 100ms; }
.hbar:nth-child(4) .hbar-fill { animation-delay: 150ms; }
.hbar:nth-child(n + 5) .hbar-fill { animation-delay: 200ms; }
.strength > span { transition: width 0.3s var(--ease-out), background-color 0.3s; }

/* Hover and press */
.btn { transition: background-color 0.15s, border-color 0.15s, opacity 0.15s, transform 0.12s; }
.btn:not(:disabled):active { transform: scale(0.97); }
.nav a { transition: background-color 0.15s, color 0.15s; }
.nav a svg { transition: transform 0.2s var(--ease-out); }
.nav a:hover svg { transform: translateX(2px); }
.tabs button { transition: color 0.15s, border-color 0.2s; }
.kcard, .list-row, .post-grid > *, .type-option, .chip.clickable { transition: transform 0.18s var(--ease-out), box-shadow 0.18s, border-color 0.15s; }
.kcard:hover, .list-row:hover, .post-grid > *:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.card.stat { transition: border-color 0.15s, transform 0.18s var(--ease-out); }
.card.stat:hover { transform: translateY(-1px); border-color: var(--text-3); }
tbody tr { transition: background-color 0.12s; }
.badge { transition: background-color 0.2s, color 0.2s; }
.alert { transition: opacity 0.2s; }

/* Skeleton loading */
.skeleton { border-radius: 6px; background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 50%, var(--surface-2) 75%); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; }
.sk-title { height: 28px; width: min(280px, 60%); }
.sk-line { height: 12px; width: 100%; margin-bottom: 10px; }
.sk-line.short { width: 40%; }
.sk-num { height: 26px; width: 55%; }
.sk-chart { height: 160px; margin-top: 8px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-delay: 0ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
  .skeleton { animation: none; }
  .spinner { animation: spin 1.2s linear infinite !important; } /* loading feedback stays visible */
  .chart path.series.draw { stroke-dasharray: none; stroke-dashoffset: 0; }
}
