/* Vela · 钛格广告 — design system. Light + Dark themes. No emoji; Phosphor icons. */
:root {
  --primary: #4361ee;
  --primary-600: #3a53d8;
  --primary-700: #2f44b8;
  --primary-soft: rgba(67, 97, 238, 0.10);
  --accent: #f59e0b;
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #6366f1;
  --radius: 12px;
  --radius-sm: 8px;
  --sidebar-w: 248px;
  --topbar-h: 60px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --transition: .18s ease;
}

/* ---------- Light (default, matches dashboard.tag.ad) ---------- */
:root[data-theme="light"] {
  --bg: #f3f5fb;
  --bg-elev: #ffffff;
  --bg-soft: #f7f8fc;
  --bg-hover: #eef1fa;
  --card: #ffffff;
  --border: #e6e9f2;
  --border-strong: #d6dbe9;
  --text: #2b2d42;
  --text-2: #5a6376;
  --text-muted: #8d99ae;
  --shadow: 0 2px 14px rgba(43, 45, 66, .07);
  --shadow-lg: 0 12px 40px rgba(43, 45, 66, .14);
  --sidebar-bg: #ffffff;
  --topbar-bg: rgba(255, 255, 255, .85);
}

/* ---------- Dark (polished slate) ---------- */
:root[data-theme="dark"] {
  --bg: #0b0e16;
  --bg-elev: #121726;
  --bg-soft: #161c2d;
  --bg-hover: #1c2336;
  --card: #131929;
  --border: #232c41;
  --border-strong: #2d384f;
  --text: #e7ecf5;
  --text-2: #a9b3c7;
  --text-muted: #6b7689;
  --shadow: 0 2px 16px rgba(0, 0, 0, .35);
  --shadow-lg: 0 16px 50px rgba(0, 0, 0, .5);
  --sidebar-bg: #0f1420;
  --topbar-bg: rgba(15, 20, 32, .82);
  --primary-soft: rgba(67, 97, 238, 0.18);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 6px; }
::-webkit-scrollbar-track { background: transparent; }
.spin { animation: spin 1s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.boot { height: 100vh; display: grid; place-items: center; font-size: 32px; color: var(--primary); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  border: 1px solid transparent; border-radius: var(--radius-sm);
  padding: 9px 16px; font-size: 14px; font-weight: 600; font-family: inherit;
  cursor: pointer; transition: var(--transition); white-space: nowrap; color: var(--text);
  background: var(--bg-elev);
}
.btn i { font-size: 17px; }
.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-600); }
.btn-ghost { background: transparent; border-color: var(--border); color: var(--text-2); }
.btn-ghost:hover { background: var(--bg-hover); color: var(--text); }
.btn-soft { background: var(--primary-soft); color: var(--primary); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-sm { padding: 6px 11px; font-size: 13px; }
.btn-lg { padding: 12px 22px; font-size: 15px; }
.btn-icon { padding: 8px; width: 38px; height: 38px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-block { width: 100%; }

/* ---------- Form ---------- */
.field { margin-bottom: 16px; }
.label { display: block; font-weight: 600; margin-bottom: 7px; font-size: 13px; color: var(--text-2); }
.input, .select, .textarea {
  width: 100%; padding: 10px 13px; border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); background: var(--bg-elev); color: var(--text);
  font-family: inherit; font-size: 14px; transition: var(--transition);
}
.textarea { resize: vertical; min-height: 90px; }
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft);
}
.input-group { display: flex; align-items: center; border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); background: var(--bg-elev); overflow: hidden; transition: var(--transition); }
.input-group:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.input-group .addon { padding: 0 12px; color: var(--text-muted); }
.input-group input { border: none; background: transparent; padding: 11px 12px 11px 0; flex: 1; color: var(--text); font-size: 14px; }
.input-group input:focus { outline: none; }

/* ---------- Cards / layout primitives ---------- */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 0; }
.card-pad { padding: 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.card-title { font-weight: 700; font-size: 15px; display: flex; align-items: center; gap: 9px; }
.grid { display: grid; gap: 18px; }
.row { display: flex; gap: 14px; }
.spread { display: flex; align-items: center; justify-content: space-between; }
.muted { color: var(--text-muted); }
.text-2 { color: var(--text-2); }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 100px; font-size: 12px; font-weight: 600; background: var(--bg-hover); color: var(--text-2); }
.chip.green { background: rgba(34,197,94,.14); color: #16a34a; }
.chip.amber { background: rgba(245,158,11,.16); color: #d97706; }
.chip.red { background: rgba(239,68,68,.14); color: #dc2626; }
.chip.blue { background: var(--primary-soft); color: var(--primary); }

/* ---------- App shell ---------- */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w); background: var(--sidebar-bg); border-right: 1px solid var(--border);
  position: fixed; inset: 0 auto 0 0; display: flex; flex-direction: column; z-index: 50;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 18px 20px; border-bottom: 1px solid var(--border); }
.brand .logo { width: 36px; height: 36px; border-radius: 9px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--primary), var(--info)); color: #fff; font-size: 20px; }
.brand .logo-img { width: 40px; height: 40px; object-fit: contain; flex-shrink: 0; }
.brand .name { font-weight: 800; font-size: 18px; letter-spacing: .3px; }
.brand .sub { font-size: 11px; color: var(--text-muted); }
.nav { flex: 1; overflow-y: auto; padding: 12px 10px; }
.nav-group { margin: 8px 0; }
.nav-group .gl { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: var(--text-muted); padding: 8px 12px 4px; }
.nav-item { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: var(--radius-sm);
  color: var(--text-2); cursor: pointer; font-weight: 500; transition: var(--transition); margin: 1px 0; }
.nav-item i { font-size: 19px; width: 22px; text-align: center; }
.nav-item .nav-label { min-width: 0; flex: 1; }
.nav-item:hover { background: var(--bg-hover); color: var(--text); }
.nav-item.active { background: var(--primary); color: #fff; box-shadow: 0 4px 12px var(--primary-soft); }
.nav-item.active i { color: #fff; }
.future-version-badge { display: inline-flex; align-items: center; justify-content: center; padding: 2px 6px; border: 1px solid var(--border-strong); border-radius: 4px; background: var(--bg-soft); color: var(--text-muted); font-size: 10px; font-weight: 700; line-height: 1.25; white-space: normal; text-align: center; }
.nav-item .future-version-badge { flex: 0 1 92px; margin-left: auto; }
.btn.future-action { flex-wrap: wrap; white-space: normal; }
.btn.future-action .future-version-badge { margin-left: 2px; }

.main { flex: 1; margin-left: var(--sidebar-w); display: flex; flex-direction: column; min-width: 0; }
.topbar { height: var(--topbar-h); position: sticky; top: 0; z-index: 40; display: flex; align-items: center;
  gap: 14px; padding: 0 24px; background: var(--topbar-bg); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.topbar .page-title { font-weight: 700; font-size: 16px; }
.topbar .grow { flex: 1; }
.content { padding: 24px; max-width: 1480px; width: 100%; margin: 0 auto; overflow-x: hidden; }
.demo-sim-banner { display:flex; align-items:center; gap:9px; padding:10px 13px; margin-bottom:16px; border:1px solid rgba(245,158,11,.45); border-radius:var(--radius-sm); background:rgba(245,158,11,.10); color:var(--text-2); font-size:13px; }
.demo-sim-banner i { color:#d97706; font-size:18px; }
.demo-flow { display:flex; gap:7px; flex-wrap:wrap; margin:0 0 16px; }
.demo-flow .btn { min-height:34px; }
.demo-kpi-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:14px; margin-bottom:16px; }
.demo-kpi-grid .stat { padding:16px; }.demo-kpi-grid .v { font-size:22px; font-weight:800; margin-top:10px; }.demo-kpi-grid .l { color:var(--text-muted); font-size:12px; margin-top:3px; }
.demo-platform-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:14px; }.demo-note { margin-top:10px; padding:10px 12px; border-left:3px solid var(--primary); background:var(--bg-soft); color:var(--text-2); font-size:13px; line-height:1.5; }.demo-readback td code { font-size:11px; white-space:nowrap; }
.demo-mobile-list { display:none; }.demo-project-card,.demo-hierarchy-card { display:grid; gap:10px; }.demo-project-card .btn,.demo-hierarchy-card .btn { justify-self:start; }
@media (max-width:900px) { .demo-kpi-grid,.demo-platform-grid { grid-template-columns:1fr; } }
.page-head { margin-bottom: 20px; }
.page-head h1 { font-size: 22px; font-weight: 800; }
.page-head p { color: var(--text-muted); margin-top: 3px; }
.strategy-complete-cta {
  background: #15803d;
  border-color: #15803d;
  box-shadow: 0 8px 20px rgba(21, 128, 61, .2);
}
.strategy-complete-cta:hover { background: #166534; border-color: #166534; }

/* top bar controls */
.tbtn { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px;
  border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--bg-elev); color: var(--text-2);
  cursor: pointer; transition: var(--transition); font-size: 18px; }
.tbtn:hover { background: var(--bg-hover); color: var(--text); }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.seg button { padding: 7px 11px; background: var(--bg-elev); border: none; color: var(--text-2); cursor: pointer; font-weight: 600; font-size: 13px; font-family: inherit; }
.seg button.on { background: var(--primary); color: #fff; }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: linear-gradient(135deg,var(--primary),var(--info));
  color: #fff; display: grid; place-items: center; font-weight: 700; cursor: pointer; }
.usermenu { position: absolute; top: 46px; right: 0; width: 230px; background: var(--bg-elev);
  border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); z-index: 200; overflow: hidden; padding: 6px; }
.usermenu .um-head { display: flex; gap: 10px; align-items: center; padding: 8px 10px 10px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.usermenu .um-item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: var(--radius-sm); cursor: pointer; font-size: 14px; font-weight: 500; color: var(--text-2); }
.usermenu .um-item i { font-size: 18px; }
.usermenu .um-item:hover { background: var(--bg-hover); color: var(--text); }
.usermenu .um-danger { color: var(--danger); }

/* ---------- Stat cards ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; }
.stat { padding: 18px 20px; }
.stat .top { display: flex; align-items: center; justify-content: space-between; }
.stat .ic { width: 42px; height: 42px; border-radius: 10px; display: grid; place-items: center; font-size: 21px; background: var(--primary-soft); color: var(--primary); }
.stat .v { font-size: 26px; font-weight: 800; margin-top: 10px; }
.stat .l { color: var(--text-muted); font-size: 13px; }
.stat .d { font-size: 12px; font-weight: 600; margin-top: 4px; }
.up { color: var(--success); } .down { color: var(--danger); }

/* ---------- Table ---------- */
table.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .4px; color: var(--text-muted); padding: 11px 14px; border-bottom: 1px solid var(--border); }
.tbl td { padding: 12px 14px; border-bottom: 1px solid var(--border); }
.tbl tr:hover td { background: var(--bg-soft); }
.tbl tr:last-child td { border-bottom: none; }

/* ---------- Auth page ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1fr 460px; }
.auth-cover { background: linear-gradient(150deg, var(--primary) 0%, #2f44b8 55%, #1f2a6b 100%); position: relative; overflow: hidden; display: grid; place-items: center; color: #fff; }
.auth-cover .blob { position: absolute; border-radius: 50%; filter: blur(60px); opacity: .5; }
.auth-cover .b1 { width: 340px; height: 340px; background: #6ea8ff; top: -60px; left: -60px; }
.auth-cover .b2 { width: 300px; height: 300px; background: var(--accent); bottom: -80px; right: -40px; opacity: .35; }
.auth-hero { position: relative; z-index: 2; max-width: 440px; padding: 40px; }
.auth-hero h2 { font-size: 30px; font-weight: 800; line-height: 1.25; }
.auth-hero p { margin-top: 14px; opacity: .9; font-size: 15px; }
.auth-hero ul { margin-top: 24px; list-style: none; display: grid; gap: 12px; }
.auth-hero li { display: flex; align-items: center; gap: 11px; font-weight: 500; }
.auth-hero li i { font-size: 20px; background: rgba(255,255,255,.18); width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; }
.auth-form-wrap { display: grid; place-items: center; padding: 30px; background: var(--bg); }
.auth-card { width: 100%; max-width: 380px; }
.auth-card .logo-row { display: flex; align-items: center; gap: 10px; margin-bottom: 22px; }
.auth-card h1 { font-size: 22px; font-weight: 800; }
.auth-card .sub { color: var(--text-muted); margin-bottom: 22px; }
.auth-switch { text-align: center; margin-top: 16px; color: var(--text-muted); font-size: 13px; }
.auth-switch a { color: var(--primary); font-weight: 600; cursor: pointer; }
.auth-corner { position: absolute; top: 18px; right: 22px; display: flex; gap: 8px; z-index: 5; }
.test-hint { margin-top: 16px; padding: 11px 14px; border: 1px dashed var(--border-strong); border-radius: var(--radius-sm); font-size: 12.5px; color: var(--text-muted); background: var(--bg-soft); }

/* ---------- Misc ---------- */
.empty { text-align: center; padding: 60px 20px; color: var(--text-muted); }
.empty i { font-size: 46px; opacity: .5; display: block; margin-bottom: 12px; }
.toast-wrap { position: fixed; top: 18px; right: 18px; z-index: 9999; display: grid; gap: 10px; }
.toast { background: var(--bg-elev); border: 1px solid var(--border); box-shadow: var(--shadow-lg); border-radius: var(--radius-sm); padding: 12px 16px; min-width: 240px; display: flex; gap: 10px; align-items: center; animation: slidein .25s ease; }
.toast i { color: var(--primary); }
.toast.success i { color: var(--success); }
.toast.error i { color: var(--danger); }
@keyframes slidein { from { transform: translateX(30px); opacity: 0; } }
.skeleton { background: linear-gradient(90deg, var(--bg-hover) 25%, var(--bg-soft) 50%, var(--bg-hover) 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: 6px; }
@keyframes shimmer { to { background-position: -200% 0; } }
@keyframes stagedmove { 0% { margin-left: -30%; } 100% { margin-left: 100%; } }

/* ---------- AI Assistant (central chat) ---------- */
.chat-wrap { display: grid; grid-template-columns: 288px 1fr; gap: 16px; height: calc(100vh - var(--topbar-h) - 48px); }
.chat-rail { display: flex; flex-direction: column; min-height: 0; }
.chat-rail .rail-head { padding: 14px; border-bottom: 1px solid var(--border); }
.chat-rail .rail-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--text-muted); padding: 12px 12px 4px; }
.chat-rail .rail-list { flex: 1; overflow-y: auto; padding: 0 8px 10px; }
.chat-main { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.chat-head { padding: 14px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 12px; }
.chat-head .ic { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: linear-gradient(135deg,var(--primary),var(--info)); color: #fff; font-size: 20px; }
.chat-log { flex: 1; overflow-y: auto; padding: 26px 20px; }
.chat-col { width: 100%; max-width: 800px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }
.msg { max-width: 86%; padding: 12px 16px; border-radius: 16px; white-space: pre-wrap; line-height: 1.62; font-size: 14.5px; }
.msg.user { align-self: flex-end; background: var(--primary); color: #fff; border-bottom-right-radius: 5px; }
.msg.bot { align-self: flex-start; background: var(--card); border: 1px solid var(--border); border-bottom-left-radius: 5px; }
.msg .md-h { font-weight: 700; font-size: 15px; margin: 8px 0 4px; }
.msg .md-table { border-collapse: collapse; margin: 8px 0; font-size: 13px; display: block; overflow-x: auto; max-width: 100%; }
.msg .md-table th, .msg .md-table td { border: 1px solid var(--border); padding: 5px 9px; text-align: left; }
.msg .md-table th { background: var(--bg-soft); font-weight: 700; }
.msg ul, .msg ol { margin: 6px 0 6px 20px; } .msg li { margin: 2px 0; }
.msg code { background: var(--bg-soft); padding: 1px 5px; border-radius: 4px; font-size: 13px; }
.msg .md-pre { background: var(--bg-soft); padding: 10px; border-radius: 8px; overflow-x: auto; font-size: 12.5px; white-space: pre-wrap; }
.msg.user { white-space: pre-wrap; }
.platck { display: inline-flex; align-items: center; gap: 7px; padding: 9px 13px; border: 1px solid var(--border-strong); border-radius: 10px; cursor: pointer; font-size: 13px; user-select: none; transition: var(--transition); }
.platck input { accent-color: var(--primary); width: 15px; height: 15px; cursor: pointer; }
.platck.on { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }
/* ---- realistic platform ad preview frames ---- */
.pf { width: 340px; max-width: 100%; background: #fff; color: #050505; border-radius: 10px; overflow: hidden; box-shadow: 0 2px 10px rgba(0,0,0,.14); font-size: 13px; }
.pf-media { background: #f0f2f5; line-height: 0; position: relative; }
.pf-media img { width: 100%; display: block; }
.pf-play { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-size: 34px; text-shadow: 0 2px 8px rgba(0,0,0,.5); }
.pf-logo { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.pf-logo-txt { background: var(--primary); color: #fff; display: grid; place-items: center; font-weight: 700; text-transform: uppercase; }
.pf-meta .pf-m-head { display: flex; align-items: center; gap: 9px; padding: 11px 12px; }
.pf-m-id { display: flex; flex-direction: column; line-height: 1.25; flex: 1; }
.pf-m-id b { font-size: 13.5px; } .pf-m-id span { font-size: 11.5px; color: #65676b; display: flex; align-items: center; gap: 3px; }
.pf-m-more { margin-left: auto; color: #65676b; }
.pf-m-text { padding: 0 12px 10px; font-size: 13.5px; line-height: 1.4; }
.pf-m-cta { display: flex; align-items: center; gap: 10px; background: #f0f2f5; padding: 10px 12px; }
.pf-m-ctad { flex: 1; min-width: 0; } .pf-m-dom { font-size: 11px; color: #65676b; text-transform: uppercase; }
.pf-m-h { font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pf-m-btn { background: #e4e6eb; border: 0; border-radius: 6px; padding: 8px 14px; font-weight: 700; font-size: 13px; cursor: pointer; color: #050505; }
.pf-m-act { display: flex; justify-content: space-around; border-top: 1px solid #ced0d4; padding: 7px 0; color: #65676b; }
.pf-m-act span { display: flex; align-items: center; gap: 5px; font-size: 13px; font-weight: 600; }
.pf-google { padding: 12px; }
.pf-g-head { display: flex; align-items: center; gap: 7px; margin-bottom: 5px; }
.pf-g-ad { border: 1px solid #006621; color: #006621; font-weight: 700; font-size: 11px; padding: 0 5px; border-radius: 4px; }
.pf-g-url { color: #202124; font-size: 13px; } .pf-g-title { color: #1a0dab; font-size: 18px; line-height: 1.3; margin-bottom: 3px; }
.pf-g-desc { color: #4d5156; font-size: 13px; line-height: 1.4; margin-bottom: 9px; }
.pf-google .pf-media { border-radius: 8px; overflow: hidden; }
.pf-g-cta { margin-top: 9px; color: #1a73e8; font-weight: 600; display: flex; align-items: center; gap: 5px; }
.pf-tt { position: relative; background: #000; border-radius: 10px; }
.pf-tt .pf-media img { aspect-ratio: 9/16; object-fit: cover; opacity: .95; }
.pf-tt-side { position: absolute; right: 8px; bottom: 74px; display: flex; flex-direction: column; gap: 16px; align-items: center; color: #fff; }
.pf-tt-ic { display: flex; flex-direction: column; align-items: center; font-size: 24px; gap: 2px; }
.pf-tt-ic span { font-size: 11px; } .pf-tt-ic .pf-logo { width: 38px; height: 38px; border: 2px solid #fff; }
.pf-tt-cap { position: absolute; left: 12px; right: 64px; bottom: 50px; color: #fff; font-size: 13px; text-shadow: 0 1px 4px rgba(0,0,0,.6); }
.pf-tt-spon { background: rgba(255,255,255,.25); padding: 1px 6px; border-radius: 4px; font-size: 11px; }
.pf-tt-cta { position: absolute; left: 12px; right: 12px; bottom: 12px; background: #fe2c55; color: #fff; text-align: center; padding: 9px; border-radius: 6px; font-weight: 700; }
.pf-tabs { width: 100%; } .pf-tabs button { flex: 1; }
.card .pf-prev-btn { position: absolute; top: 8px; right: 8px; z-index: 3; background: rgba(0,0,0,.55); color: #fff; border: 0; border-radius: 7px; width: 30px; height: 30px; cursor: pointer; display: grid; place-items: center; opacity: 0; transition: var(--transition); }
.card:hover .pf-prev-btn { opacity: 1; }
.vote-btn { background: var(--bg-hover); border: 1px solid var(--border); border-radius: 7px; width: 30px; height: 28px; cursor: pointer; color: var(--text-muted); display: grid; place-items: center; transition: var(--transition); }
.vote-btn:hover { color: var(--text); }
.vote-btn.up { background: rgba(34,197,94,.15); color: #16a34a; border-color: transparent; }
.vote-btn.down { background: rgba(239,68,68,.14); color: #dc2626; border-color: transparent; }
/* ---- competitor expand card ---- */
.cx { padding: 14px 4px 6px; }
.cx-brand { display: flex; align-items: center; gap: 11px; padding: 0 0 12px; margin-bottom: 12px; border-bottom: 1px solid var(--border); }
.cmp-prods { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0; }
.cmp-prod { position: relative; width: 64px; height: 64px; border-radius: 8px; overflow: hidden; border: 1px solid var(--border); background: #fff; flex-shrink: 0; }
.cmp-prod img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cmp-prod-pr { position: absolute; bottom: 0; left: 0; right: 0; background: rgba(0,0,0,.6); color: #fff; font-size: 10px; text-align: center; padding: 1px 0; }
/* ---- website detail redesign ---- */
.site-hero { display: grid; grid-template-columns: 300px 1fr; overflow: hidden; }
.site-shot { position: relative; background: var(--bg-soft); min-height: 190px; }
.site-shot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.site-shot-fb { display: none; position: absolute; inset: 0; place-items: center; color: var(--text-muted); font-size: 38px; }
.site-shot.noshot img { display: none; } .site-shot.noshot .site-shot-fb { display: grid; }
.site-hero-body { padding: 18px 20px; }
.site-scores { display: flex; gap: 22px; }
.site-score-n { font-size: 24px; font-weight: 800; line-height: 1; }
.site-score-l { font-size: 11px; color: var(--text-muted); margin-top: 3px; }
.site-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 18px; }
.site-f { min-width: 0; }
.site-fk { font-size: 11px; color: var(--text-muted); }
.site-fv { font-size: 13.5px; font-weight: 600; word-break: break-word; }
.site-prods { display: grid; grid-template-columns: repeat(auto-fill, minmax(116px, 1fr)); gap: 12px; }
.site-prod { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--card); }
.site-prod img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; background: #fff; cursor: pointer; }
.site-prod.noimg img { display: none; }
.site-prod-meta { padding: 7px 9px; }
.site-prod-n { font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.site-prod-p { font-size: 12px; color: var(--primary); font-weight: 700; }
.site-comps { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.site-comp { display: flex; align-items: center; gap: 10px; border: 1px solid var(--border); border-radius: 10px; padding: 9px 11px; transition: var(--transition); }
.site-comp:hover { border-color: var(--primary); background: var(--primary-soft); }
@media (max-width: 720px) { .site-hero { grid-template-columns: 1fr; } .site-grid { grid-template-columns: 1fr; } .grid[style*="1fr 1fr"] { grid-template-columns: 1fr !important; } }
.cx-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 14px; }
.cx-fact { background: var(--bg-elev); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; }
.cx-fact-k { font-size: 11px; color: var(--text-muted); display: flex; align-items: center; gap: 5px; margin-bottom: 3px; }
.cx-fact-v { font-size: 14px; font-weight: 700; }
.cx-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.cx-block { background: var(--bg-elev); border: 1px solid var(--border); border-radius: 10px; padding: 11px 13px; font-size: 13px; line-height: 1.5; }
.cx-block-h { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; color: var(--text-muted); margin-bottom: 5px; }
.cx-chiprow { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 10px; }
.cx-lbl { font-size: 11px; font-weight: 700; color: var(--text-muted); margin-right: 4px; }
.cx-swot-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 4px; }
.cx-swot { border-radius: 10px; padding: 10px 13px; border: 1px solid var(--border); }
.cx-swot-h { font-size: 12px; font-weight: 700; display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.cx-swot ul { margin: 0 0 0 16px; padding: 0; } .cx-swot li { font-size: 12.5px; line-height: 1.5; margin: 2px 0; }
.cx-swot.good { background: rgba(34,197,94,.07); } .cx-swot.good .cx-swot-h { color: #16a34a; }
.cx-swot.bad { background: rgba(239,68,68,.06); } .cx-swot.bad .cx-swot-h { color: #dc2626; }
.cx-swot.opp { background: rgba(67,97,238,.06); } .cx-swot.opp .cx-swot-h { color: var(--primary); }
.cx-swot.threat { background: rgba(245,158,11,.08); } .cx-swot.threat .cx-swot-h { color: #d97706; }
.cx-call { border-radius: 10px; padding: 11px 13px; font-size: 13px; line-height: 1.5; }
.cx-call-h { font-weight: 700; display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.cx-call.good { background: rgba(34,197,94,.10); } .cx-call.good .cx-call-h { color: #16a34a; }
.cx-call.blue { background: var(--primary-soft); } .cx-call.blue .cx-call-h { color: var(--primary); }
@media (max-width: 640px) { .cx-cols, .cx-swot-grid { grid-template-columns: 1fr; } }
/* cross-platform ads-manager table */
.tbl.admgr { width: 100%; min-width: 760px; }
.tbl.admgr th { font-size: 11px; }
.tbl.admgr td, .tbl.admgr th { padding: 9px 12px; }
.tbl.admgr .num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl.admgr th.num { text-align: right; }
.amgr-sort:hover { color: var(--primary); }
.amgr-row:hover td { background: var(--bg-soft); }
.amgr-sub td { background: var(--bg-soft); font-size: 12.5px; color: var(--text-2); border-bottom: 1px solid var(--border); }
.amgr-pill { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 100px; font-size: 11px; font-weight: 600; cursor: pointer; user-select: none; transition: var(--transition); }
.amgr-pill.on { background: rgba(34,197,94,.14); color: #16a34a; } .amgr-pill.on:hover { background: rgba(34,197,94,.24); }
.amgr-pill.off { background: var(--bg-hover); color: var(--text-muted); } .amgr-pill.off:hover { background: var(--border); }
[data-theme="dark"] .amgr-pill.on { color: #4ade80; }
.composer { border-top: 1px solid var(--border); padding: 14px 20px 18px; }
.composer-inner { max-width: 800px; margin: 0 auto; }
.quickbar { display: flex; gap: 7px; overflow-x: auto; padding: 0 2px 9px; scrollbar-width: none; }
.quickbar::-webkit-scrollbar { display: none; }
.quickbar .qa { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; flex-shrink: 0;
  background: var(--bg-elev); border: 1px solid var(--border); color: var(--text-2); border-radius: 100px;
  padding: 6px 13px; font-size: 12.5px; font-weight: 600; cursor: pointer; transition: var(--transition); font-family: inherit; }
.quickbar .qa:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.quickbar .qa i { font-size: 15px; }
/* agent step panel (shows the autonomous multi-step work) */
.agent-steps { background: var(--bg-soft); border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; gap: 0 !important; }
.astep-head { font-size: 12px; font-weight: 700; color: var(--text-2); display: flex; align-items: center; gap: 7px; padding-bottom: 7px; margin-bottom: 5px; border-bottom: 1px solid var(--border); }
.astep { display: flex; align-items: flex-start; gap: 10px; padding: 7px 0; }
.astep-ic { font-size: 17px; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 7px; background: var(--bg-hover); color: var(--text-muted); flex-shrink: 0; margin-top: 1px; }
.astep.done .astep-ic { background: var(--primary-soft); color: var(--primary); }
.astep-body { flex: 1; min-width: 0; }
.astep-body b { font-size: 13px; font-weight: 600; }
.astep.done .astep-body b { color: var(--text); }
.astep.running .astep-body b { color: var(--text-2); }
.astep-res { font-size: 12px; color: var(--text-muted); margin-top: 1px; }
.astep-st { font-size: 16px; color: var(--primary); flex-shrink: 0; margin-top: 2px; }
.astep-st.done { color: var(--success); }
.send-btn.stopping { background: var(--danger); border-color: var(--danger); }
.result-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.result-actions .ra { display: inline-flex; align-items: center; gap: 6px; background: var(--primary-soft); color: var(--primary); border: 1px solid transparent; border-radius: 100px; padding: 6px 13px; font-size: 12.5px; font-weight: 600; cursor: pointer; transition: var(--transition); font-family: inherit; }
.result-actions .ra:hover { background: var(--primary); color: #fff; }
/* auto-optimization engine panel */
.auto-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--success); margin-right: 2px; box-shadow: 0 0 0 0 rgba(34,197,94,.5); animation: autopulse 2s infinite; }
@keyframes autopulse { 0% { box-shadow: 0 0 0 0 rgba(34,197,94,.5); } 70% { box-shadow: 0 0 0 8px rgba(34,197,94,0); } 100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); } }
.auto-feed { display: flex; flex-direction: column; }
.auto-row { display: flex; align-items: flex-start; gap: 9px; padding: 9px 0; border-top: 1px solid var(--border); }
.auto-row:first-child { border-top: 0; }
.composer-box { display: flex; gap: 8px; align-items: flex-end; background: var(--bg-elev); border: 1px solid var(--border-strong); border-radius: 16px; padding: 8px 8px 8px 16px; transition: var(--transition); }
.composer-box:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.composer-box textarea { flex: 1; border: none; background: transparent; resize: none; color: var(--text); font-family: inherit; font-size: 14.5px; outline: none; max-height: 170px; min-height: 26px; padding: 7px 0; line-height: 1.5; }
.composer .send-btn { width: 40px; height: 40px; border-radius: 12px; flex-shrink: 0; }
.welcome { margin: auto; text-align: center; max-width: 680px; padding: 24px 16px; }
.welcome .wlogo { width: 60px; height: 60px; border-radius: 16px; margin: 0 auto 16px; display: grid; place-items: center; background: linear-gradient(135deg,var(--primary),var(--info)); color: #fff; font-size: 30px; }
.welcome h2 { font-size: 24px; font-weight: 800; }
.welcome .sub { color: var(--text-muted); margin-top: 8px; font-size: 15px; }
.cap-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 24px; text-align: left; }
.cap { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border: 1px solid var(--border); border-radius: 14px; background: var(--card); }
.cap i { font-size: 22px; color: var(--primary); margin-top: 2px; }
.cap b { font-size: 14px; } .cap div > div { color: var(--text-muted); font-size: 12.5px; margin-top: 2px; }
.suggest { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 22px; }
.suggest .s { padding: 9px 14px; border: 1px solid var(--border-strong); border-radius: 100px; font-size: 13px; cursor: pointer; color: var(--text-2); transition: var(--transition); }
.suggest .s:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.agent-step { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); padding: 3px 0; }
@media (max-width: 900px) { .chat-wrap { grid-template-columns: 1fr; height: calc(100vh - var(--topbar-h) - 24px); } .chat-rail { display: none; } .cap-grid { grid-template-columns: 1fr; } }
.divider { height: 1px; background: var(--border); margin: 16px 0; }
/* ---------- Modal ---------- */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.55); backdrop-filter: blur(3px); z-index: 300; display: grid; place-items: center; padding: 24px; animation: fadein .15s ease; }
@keyframes fadein { from { opacity: 0; } }
.modal-card { background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); width: 100%; max-width: 920px; max-height: 90vh; overflow: hidden; display: flex; flex-direction: column; animation: slideup .2s ease; }
@keyframes slideup { from { transform: translateY(16px); opacity: 0; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal-body { padding: 20px; overflow-y: auto; }
.modal-x { width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; cursor: pointer; color: var(--text-2); border: 1px solid var(--border); background: var(--bg); }
.modal-x:hover { background: var(--bg-hover); color: var(--text); }
.terminal { background: #0a0e16; color: #7CFC9A; font-family: 'SFMono-Regular', ui-monospace, Menlo, monospace; font-size: 13px; line-height: 1.7; padding: 18px; border-radius: var(--radius); min-height: 280px; max-height: 420px; overflow-y: auto; border: 1px solid #1d2433; }
.terminal .ln { white-space: pre-wrap; }
.terminal .ok { color: #7CFC9A; } .terminal .dim { color: #5a6b80; } .terminal .warn { color: #f5c451; }

.mobile-only { display: none; }
.sidebar-scrim { display: none; }

/* ---------- Google Ads v24 control center ---------- */
.gads-shell { display: grid; gap: 12px; }
.gads-toolbar { border-left: 3px solid #4285f4; }
.gads-toolbar .spread { display: grid; grid-template-columns: minmax(210px, 1fr) minmax(0, 2fr); align-items: start; gap: 12px; }
.gads-toolbar .spread > :first-child { min-width: 0; }
.gads-toolbar .card-title { white-space: nowrap; }
.gads-toolbar .muted { overflow-wrap: anywhere; }
.gads-actions { gap: 7px; justify-content: flex-end; flex-wrap: wrap; min-width: 0; }
.gads-actions .select { min-width: 190px; max-width: 260px; flex: 1 1 190px; width: auto; }
.gads-actions .btn { flex: 0 0 auto; white-space: nowrap; }
.gads-notice { white-space: normal; width: 100%; justify-content: flex-start; }
.gads-account-summary { padding-top: 12px; padding-bottom: 12px; }
.gads-tree { overflow: hidden; }
.gads-node + .gads-node > .gads-node-row { border-top: 1px solid var(--border); }
.gads-node-row { display: grid; grid-template-columns: 30px minmax(240px,1fr) auto; gap: 9px; align-items: center; padding: 11px 12px 11px calc(12px + var(--gads-depth,0) * 24px); }
.gads-node-row:hover { background: var(--bg-hover); }
.gads-expand { width: 28px; height: 28px; display: grid; place-items: center; border: 0; background: transparent; color: var(--text-muted); cursor: pointer; }
.gads-expand:disabled { cursor: default; opacity: .55; }
.gads-node-main { min-width: 0; }
.gads-rn { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 10.5px; overflow-wrap: anywhere; margin-top: 3px; }
.gads-node-actions { display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; }
.gads-node-actions .btn[disabled] { opacity: .45; cursor: not-allowed; }
.gads-cap { font-size: 9px; padding: 2px 5px; }
.gads-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; }
.gads-form-grid .field { margin: 0; }
.gads-wide { grid-column: 1 / -1; }
.gads-json { min-height: 230px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; tab-size: 2; }
.gads-checks { display: grid; grid-template-columns: 1fr 1fr; gap: 7px 12px; font-size: 12px; }
.gads-checks label { display: flex; gap: 7px; align-items: flex-start; overflow-wrap: anywhere; }
.gads-operation-result { margin-top: 14px; display: grid; gap: 8px; }
.gads-progress { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.gads-safe-json { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 260px; overflow: auto; font-size: 11px; color: var(--text-2); }

/* shared cross-platform account and asset language */
.platform-assets-head { display:flex; align-items:flex-end; justify-content:space-between; gap:12px; margin:0 0 10px; }
.platform-assets-head h2 { font-size:17px; margin:0; }
.platform-assets-head p { color:var(--text-muted); font-size:12px; margin:3px 0 0; }
.platform-assets-stack { display:grid; gap:10px; margin-bottom:18px; }
.platform-section { overflow:hidden; border-radius:8px; box-shadow:none; }
.platform-section-head { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; padding:13px 16px; border-bottom:1px solid var(--border); }
.platform-section-head .muted { font-size:11px; margin-top:3px; }
.platform-section-actions { display:flex; align-items:center; justify-content:flex-end; flex-wrap:wrap; gap:7px; min-width:0; }
.platform-section-actions .select { width:auto; min-width:200px; max-width:320px; }
.platform-section-body { padding:12px 16px 14px; }
.platform-overall { display:flex; align-items:center; justify-content:space-between; gap:8px; margin-bottom:9px; font-size:11px; }
.platform-asset-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(180px,1fr)); gap:0; border:1px solid var(--border); border-radius:7px; overflow:hidden; }
.platform-asset-cell { min-width:0; padding:10px 12px; border-right:1px solid var(--border); border-bottom:1px solid var(--border); background:transparent; }
.platform-asset-cell b { font-size:12px; overflow-wrap:anywhere; }
.platform-asset-cell strong { font-size:18px; font-variant-numeric:tabular-nums; }
.platform-asset-state { gap:5px; margin-top:7px; font-size:10px; flex-wrap:wrap; }
.platform-asset-preview { color:var(--text-muted); font-size:10px; line-height:1.45; margin-top:7px; overflow-wrap:anywhere; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.platform-empty,.platform-loading,.platform-load-error { color:var(--text-muted); font-size:12px; padding:8px 0; }
.platform-load-error p { margin:7px 0 0; }
.platform-admin-detail { margin-top:8px; color:var(--text-muted); font-size:10px; }
.platform-admin-detail summary { cursor:pointer; }
.platform-admin-detail pre { max-height:180px; overflow:auto; white-space:pre-wrap; overflow-wrap:anywhere; margin:6px 0 0; }
.tt-post-list { display:grid; grid-template-columns:repeat(auto-fit,minmax(260px,1fr)); gap:8px; }
.tt-post-list .tt-post-row { margin:0 !important; height:100%; }
.tt-task-steps { border:1px solid var(--border); border-radius:7px; margin-top:12px; overflow:hidden; }
.tt-task-step { padding:10px 12px; background:var(--bg-soft); border-bottom:1px solid var(--border); }
.tt-task-step:last-child { border-bottom:0; }

/* Campaign closed-loop workspace */
.content.campaign-workspace-host { max-width:none; padding:0; overflow:visible; }
.campaign-workspace { min-height:calc(100vh - var(--topbar-h)); background:var(--bg); }
.ce-header { position:sticky; top:var(--topbar-h); z-index:35; min-height:76px; display:flex; align-items:center; justify-content:space-between; gap:16px; padding:12px 18px; background:var(--bg-elev); border-bottom:1px solid var(--border); }
.ce-header-main,.ce-header-actions,.ce-meta { display:flex; align-items:center; gap:9px; min-width:0; }
.ce-header-main h1 { font-size:18px; line-height:1.25; overflow-wrap:anywhere; letter-spacing:0; }
.ce-header-main > div:last-child { min-width:0; }
.ce-meta { margin-top:4px; flex-wrap:wrap; color:var(--text-muted); font-size:11px; }
.ce-meta span + span::before { content:"/"; margin-right:9px; color:var(--border-strong); }
.ce-header-actions { justify-content:flex-end; flex-wrap:wrap; }
.ce-layout { display:grid; grid-template-columns:240px minmax(460px,1fr) 310px; min-height:calc(100vh - var(--topbar-h) - 77px); }
.ce-outline,.ce-inspector { position:sticky; top:calc(var(--topbar-h) + 77px); height:calc(100vh - var(--topbar-h) - 77px); overflow:auto; background:var(--bg-elev); }
.ce-outline { border-right:1px solid var(--border); }
.ce-inspector { border-left:1px solid var(--border); }
.ce-editor { min-width:0; padding:20px clamp(16px,2.4vw,34px) 100px; }
.ce-drawer-head { display:none; align-items:center; justify-content:space-between; padding:12px 14px; border-bottom:1px solid var(--border); }
.ce-drawer-head button,.ce-resource-chip button { border:0; background:transparent; color:var(--text-muted); cursor:pointer; width:30px; height:30px; display:grid; place-items:center; }
.ce-outline-tools { position:sticky; top:0; z-index:2; padding:12px; background:var(--bg-elev); border-bottom:1px solid var(--border); }
.ce-outline-tools label { display:flex; align-items:center; gap:7px; margin-top:9px; font-size:12px; color:var(--text-2); }
.ce-outline-row { width:100%; min-height:42px; display:grid; grid-template-columns:20px minmax(0,1fr) auto 18px; align-items:center; gap:7px; padding:7px 10px 7px calc(11px + var(--depth) * 16px); border:0; border-bottom:1px solid var(--border); background:transparent; color:var(--text-2); text-align:left; cursor:pointer; }
.ce-outline-row:hover { background:var(--bg-hover); color:var(--text); }
.ce-outline-row span { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.ce-count { min-width:20px; height:20px; display:grid; place-items:center; border-radius:8px; background:rgba(239,68,68,.14); color:var(--danger); font-size:10px; }
.ce-band { border-top:1px solid var(--border-strong); border-bottom:1px solid var(--border); background:var(--bg-elev); margin-bottom:14px; }
.ce-band-head { min-height:58px; display:flex; align-items:center; justify-content:space-between; gap:12px; padding:12px 16px; background:var(--bg-soft); }
.ce-band-head h2 { font-size:15px; line-height:1.35; overflow-wrap:anywhere; letter-spacing:0; }
.ce-band-head p { color:var(--text-muted); font-size:11px; margin-top:2px; }
.ce-band-body { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:0 18px; padding:16px; }
.ce-band.collapsed .ce-band-body { display:none; }
.ce-band.collapsed [data-collapse] i { transform:rotate(180deg); }
.ce-child-band { margin-left:20px; border-left:2px solid var(--border-strong); }
.ce-child-band .ce-band { margin-bottom:14px; }
.ce-field { min-width:0; margin-bottom:16px; scroll-margin-top:170px; }
.ce-field.focused { outline:2px solid var(--primary); outline-offset:5px; border-radius:4px; }
.ce-field.has-error .input,.ce-field.has-error .select { border-color:var(--danger); }
.ce-field-note { margin-top:5px; color:var(--text-muted); font-size:11px; overflow-wrap:anywhere; }
.ce-field-error { width:100%; display:flex; align-items:flex-start; gap:6px; margin-top:5px; border:0; background:transparent; color:var(--danger); text-align:left; font-size:11px; cursor:pointer; overflow-wrap:anywhere; }
.ce-list { display:grid; gap:7px; }
.ce-list-row { display:grid; grid-template-columns:minmax(0,1fr) minmax(90px,130px) 38px; gap:7px; align-items:center; }
.ce-list-row:not(:has([data-list-match])) { grid-template-columns:minmax(0,1fr) 38px; }
.ce-checks { display:flex; flex-wrap:wrap; gap:8px 14px; }
.ce-checks label { display:flex; align-items:center; gap:6px; color:var(--text-2); }
.ce-toggle { display:inline-flex; align-items:center; width:44px; height:24px; position:relative; }
.ce-toggle input { position:absolute; opacity:0; }
.ce-toggle span { width:44px; height:24px; border-radius:12px; background:var(--border-strong); transition:var(--transition); }
.ce-toggle span::after { content:""; display:block; width:18px; height:18px; margin:3px; border-radius:50%; background:#fff; transition:var(--transition); }
.ce-toggle input:checked + span { background:var(--primary); }
.ce-toggle input:checked + span::after { transform:translateX(20px); }
.ce-selected { display:flex; flex-wrap:wrap; gap:7px; margin-bottom:7px; }
.ce-resource-chip { max-width:100%; min-height:34px; display:flex; align-items:center; gap:6px; padding:3px 3px 3px 9px; border:1px solid var(--border); border-radius:8px; background:var(--bg-soft); }
.ce-resource-chip span { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.ce-resource-chip img { width:34px; height:28px; object-fit:cover; border-radius:4px; }
.ce-resource-search { position:relative; }
.ce-resource-search > i { position:absolute; left:11px; top:12px; z-index:1; color:var(--text-muted); }
.ce-resource-search .input { padding-left:34px; }
.ce-resource-results { max-height:260px; overflow:auto; border:1px solid var(--border); border-top:0; }
.ce-resource-results:empty { display:none; }
.ce-resource-results > button:not(.btn) { width:100%; min-height:42px; display:flex; align-items:center; justify-content:space-between; gap:10px; padding:8px 11px; border:0; border-bottom:1px solid var(--border); background:var(--bg-elev); color:var(--text); text-align:left; cursor:pointer; }
.ce-resource-results > button:hover { background:var(--bg-hover); }
.ce-resource-results small { color:var(--text-muted); }
.ce-asset-actions { display:flex; flex-wrap:wrap; gap:6px; margin-top:7px; }
.ce-post-picker { min-height:480px; }
.ce-post-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(150px,1fr)); gap:12px; max-height:68vh; overflow:auto; padding:12px 2px; }
.ce-post-tile { position:relative; min-width:0; border:1px solid var(--border); border-radius:6px; overflow:hidden; background:var(--bg-elev); }
.ce-post-tile > [data-post-select] { width:100%; padding:0; border:0; background:transparent; color:var(--text); text-align:left; cursor:pointer; }
.ce-post-tile img,.ce-post-empty { width:100%; aspect-ratio:9/16; display:grid; place-items:center; object-fit:cover; background:var(--bg-soft); }
.ce-post-tile b,.ce-post-tile small { display:block; padding:6px 8px 0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.ce-post-tile small { padding-top:2px; padding-bottom:8px; color:var(--text-muted); }
.ce-post-tile > [data-post-preview] { position:absolute; right:6px; top:6px; background:var(--bg-elev); }
.ce-post-picker video { width:100%; max-height:70vh; background:#000; }
.ce-resource-loading { display:grid; place-items:center; min-height:52px; }
.ce-freshness { display:flex; align-items:center; justify-content:space-between; gap:8px; padding:7px 10px; border-bottom:1px solid var(--border); background:var(--bg-soft); font-size:11px; }
.ce-freshness span { color:var(--text-2); font-weight:600; }
.ce-freshness time { color:var(--text-muted); text-align:right; }
.ce-freshness[data-freshness-state=fresh] span { color:var(--success); }
.ce-freshness[data-freshness-state=stale] span { color:var(--warning); }
.ce-freshness[data-freshness-state=failed] span { color:var(--danger); }
.ce-resource-summary { display:grid; gap:8px; }
.ce-resource-state { min-width:0; padding:9px; border-bottom:1px solid var(--border); background:var(--bg-elev); }
.ce-resource-state > div:first-child { display:flex; align-items:center; justify-content:space-between; gap:8px; }
.ce-resource-state > div:first-child span,.ce-resource-state p { color:var(--text-muted); font-size:11px; }
.ce-resource-state .ce-freshness { margin:6px -4px 0; border:0; }
.ce-resource-state p { margin-top:5px; overflow-wrap:anywhere; }
.ce-inspector-tabs { position:sticky; top:0; z-index:2; display:grid; grid-template-columns:repeat(4,1fr); background:var(--bg-elev); border-bottom:1px solid var(--border); }
.ce-inspector-tabs button { min-width:0; padding:10px 3px; border:0; border-bottom:2px solid transparent; background:transparent; color:var(--text-muted); font-size:11px; cursor:pointer; overflow-wrap:anywhere; }
.ce-inspector-tabs button.on { color:var(--primary); border-bottom-color:var(--primary); }
.ce-inspector-body { padding:10px; }
.ce-problem { width:100%; display:flex; align-items:flex-start; gap:8px; padding:10px; border:0; border-bottom:1px solid var(--border); background:transparent; color:var(--text-2); text-align:left; cursor:pointer; overflow-wrap:anywhere; }
.ce-problem[data-severity=error] i { color:var(--danger); }
.ce-empty { display:flex; align-items:flex-start; gap:8px; padding:18px 10px; color:var(--text-muted); font-size:12px; }
.ce-status-row { display:grid; grid-template-columns:minmax(0,1fr); gap:5px; padding:10px; border-bottom:1px solid var(--border); }
.ce-status-row span { display:grid; grid-template-columns:minmax(58px,auto) minmax(0,1fr); gap:6px; padding:5px 7px; border-radius:4px; background:var(--bg-soft); font-size:11px; overflow-wrap:anywhere; }
.ce-status-row small { color:var(--text-muted); font-size:10px; }
.ce-status-row > time { color:var(--text-muted); font-size:10px; }
.ce-conflict { display:flex; align-items:flex-start; gap:10px; padding:10px 18px; border-bottom:1px solid rgba(245,158,11,.35); background:rgba(245,158,11,.12); color:var(--text-2); }
.ce-conflict > i { color:var(--warning); font-size:20px; }
.ce-conflict p { margin-top:2px; color:var(--text-muted); font-size:12px; }
.ce-readonly-banner { display:flex; align-items:flex-start; gap:10px; padding:11px 18px; border-bottom:1px solid rgba(14,165,233,.28); background:rgba(14,165,233,.09); color:var(--text-2); }
.ce-readonly-banner > i { flex:0 0 auto; margin-top:2px; color:var(--info); font-size:19px; }
.ce-readonly-banner p { margin-top:2px; color:var(--text-muted); font-size:12px; }
.ce-readonly .ce-field :disabled,.ce-readonly .ce-header-actions :disabled { cursor:not-allowed; opacity:.68; }
.ce-readonly .ce-resource-chip button:disabled { cursor:not-allowed; }
.ce-mobile-tools,.ce-mobile-bar,.ce-drawer-scrim { display:none; }
.ce-impact > div { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:10px; padding:9px 0; border-bottom:1px solid var(--border); }
.ce-impact span { color:var(--text-muted); overflow-wrap:anywhere; }
.ce-dialog-actions { display:flex; justify-content:flex-end; gap:8px; margin-top:16px; }
.ce-publish-summary { display:flex; gap:14px; margin-bottom:12px; color:var(--text-2); }
.ce-table-wrap { overflow:auto; max-height:62vh; }
.ce-publish-center { min-width:0; }
.ce-publish-actions { display:flex; justify-content:flex-end; gap:8px; margin-bottom:12px; }
.ce-publish-center .ce-table-wrap { max-width:100%; overflow:auto; overscroll-behavior:contain; }
.ce-publish-center table { min-width:900px; table-layout:fixed; }
.ce-publish-center th:nth-child(2),.ce-publish-center td:nth-child(2) { width:190px; }
.ce-publish-center th:last-child,.ce-publish-center td:last-child { width:190px; }
.ce-diff-row > td { padding:0 12px 14px; background:var(--bg-soft); }
.ce-row-confirm { display:flex; align-items:center; gap:6px; }
.ce-business-diff { min-width:0; padding:12px; border:1px solid var(--border); background:var(--bg-elev); }
.ce-diff-head { display:flex; justify-content:space-between; gap:12px; margin-bottom:10px; }
.ce-diff-head span,.ce-expiry { color:var(--text-muted); font-size:12px; overflow-wrap:anywhere; }
.ce-business-diff dl { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; margin:0 0 10px; }
.ce-business-diff dl > div { min-width:0; padding:7px; background:var(--bg-soft); }
.ce-business-diff dt { color:var(--text-muted); font-size:11px; }
.ce-business-diff dd { margin:3px 0 0; overflow-wrap:anywhere; }
.ce-business-diff ul { display:grid; gap:5px; margin:0; padding:0; list-style:none; }
.ce-business-diff li { display:grid; grid-template-columns:90px minmax(0,1fr) auto; gap:8px; align-items:start; }
.ce-business-diff li span,.ce-business-diff li em { color:var(--text-muted); font-size:11px; font-style:normal; }
.ce-preview-json { max-height:58vh; overflow:auto; white-space:pre-wrap; overflow-wrap:anywhere; padding:12px; background:var(--bg-soft); }
.ce-confirm { display:grid; gap:10px; }
.ce-confirm > div { display:grid; grid-template-columns:minmax(120px,1fr) minmax(0,1.5fr); gap:10px; padding:9px 0; border-bottom:1px solid var(--border); }
.ce-confirm > div span { color:var(--text-muted); }
.ce-confirm > div b { overflow-wrap:anywhere; }
.ce-confirm-check { display:flex; align-items:flex-start; gap:8px; padding:10px; background:var(--bg-soft); border:1px solid var(--border); border-radius:8px; }
.ce-loading { min-height:50vh; display:flex; align-items:center; justify-content:center; gap:10px; color:var(--text-muted); }

@media (max-width: 1180px) {
  .ce-layout { grid-template-columns:210px minmax(400px,1fr) 270px; }
  .ce-header { align-items:flex-start; }
  .ce-header-actions { max-width:560px; }
  .ce-band-body { grid-template-columns:minmax(0,1fr); }
}
@media (max-width: 1260px) {
  .ce-header { top:var(--topbar-h); flex-direction:column; align-items:stretch; }
  .ce-header-actions { max-width:none; justify-content:flex-start; overflow-x:auto; flex-wrap:nowrap; padding-bottom:2px; }
  .ce-header-actions .btn { flex:0 0 auto; }
  .ce-header-actions [data-preview] { display:none; }
  .ce-layout { display:block; min-height:0; }
  .ce-editor { padding:14px 12px 96px; }
  .ce-mobile-tools { display:flex; gap:8px; padding:10px 12px 0; }
  .ce-outline,.ce-inspector { position:fixed; top:0; bottom:0; z-index:310; width:min(88vw,340px); height:100vh; transition:transform .2s ease; box-shadow:var(--shadow-lg); }
  .ce-outline { left:0; transform:translateX(-105%); }
  .ce-inspector { right:0; transform:translateX(105%); }
  .ce-outline.open,.ce-inspector.open { transform:none; }
  .ce-drawer-head { display:flex; }
  .ce-drawer-scrim { position:fixed; inset:0; z-index:305; background:rgba(0,0,0,.48); }
  .ce-drawer-scrim.show { display:block; }
  .ce-mobile-bar { position:fixed; left:0; right:0; bottom:0; z-index:250; display:grid; grid-template-columns:1fr 1fr; gap:8px; padding:9px 12px; border-top:1px solid var(--border); background:var(--bg-elev); }
  .ce-child-band { margin-left:8px; }
  .ce-publish-center .ce-table-wrap { width:100%; max-height:60vh; }
  .ce-publish-center table { min-width:860px; }
}
@media (max-width: 560px) {
  .modal-overlay { padding:8px; }
  .modal-card { max-height:96vh; }
  .modal-body { padding:12px; }
  .ce-publish-actions { position:sticky; top:-12px; z-index:3; padding:8px 0; background:var(--bg-elev); }
  .ce-publish-actions .btn { flex:1 1 0; min-width:0; }
  .ce-publish-summary { flex-wrap:wrap; }
  .ce-publish-center table { min-width:780px; }
  .ce-business-diff dl { grid-template-columns:1fr; }
  .ce-business-diff li { grid-template-columns:72px minmax(0,1fr); }
  .ce-business-diff li em { grid-column:2; }
  .ce-header { padding:10px 12px; }
  .ce-header-main h1 { font-size:16px; }
  .ce-header-actions { gap:6px; }
  .ce-header-actions .btn:not(.btn-icon) { padding:8px 10px; font-size:12px; }
  .ce-band-body,.ce-band-head { padding-left:12px; padding-right:12px; }
  .ce-list-row { grid-template-columns:minmax(0,1fr) 96px 38px; }
  .ce-impact > div { grid-template-columns:minmax(0,1fr); }
}

@media (max-width: 900px) {
  .mobile-only { display: inline-flex; }
  .sidebar { transform: translateX(-100%); transition: transform .22s ease; box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: none; }
  .sidebar-scrim { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 49; opacity: 0; pointer-events: none; transition: opacity .2s; }
  .sidebar-scrim.show { opacity: 1; pointer-events: auto; }
  .main { margin-left: 0; }
  .content { padding: 16px; }
  .auth { grid-template-columns: 1fr; }
  .auth-cover { display: none; }
  /* stack any fixed multi-column grids */
  .grid[style*="grid-template-columns"] { grid-template-columns: 1fr !important; }
  /* tables scroll horizontally instead of overflowing */
  .card-pad { overflow-x: auto; }
  table.tbl { min-width: 520px; }
  .demo-desktop-table { display:none; }
  .demo-mobile-list { display:grid; gap:12px; }
  .demo-mobile-list .card { min-width:0; }
  .demo-mobile-list .row { gap:7px; }
  .demo-flow { gap:6px; }
  .demo-flow .btn { flex:1 1 calc(50% - 6px); min-width:0; padding:7px 8px; font-size:12px; }
  .demo-sim-banner { align-items:flex-start; }
  .page-head h1 { font-size: 19px; }
  .stat .v { font-size: 22px; }
  .topbar { padding: 0 14px; gap: 8px; }
  .seg button { padding: 6px 9px; }
  /* systematic anti-overflow pattern: heads/rows wrap, nothing forces width past the viewport */
  .card-head { flex-wrap: wrap; gap: 8px; }
  .row { flex-wrap: wrap; }
  .spread { flex-wrap: wrap; gap: 6px; }
  .page-head.spread > * { min-width: 0; }
  .input-group { width: 100% !important; }
  img, svg, video, canvas { max-width: 100%; }
  .gads-node-row { grid-template-columns: 26px minmax(0,1fr); }
  .gads-node-actions { grid-column: 2; justify-content: flex-start; }
  .gads-actions { justify-content: flex-start; }
  .gads-actions .select { width: 100%; }
  .gads-form-grid, .gads-checks { grid-template-columns: 1fr; }
  .gads-wide { grid-column: 1; }
  .platform-section-head { flex-direction:column; }
  .platform-section-actions { width:100%; justify-content:flex-start; }
  .platform-section-actions .select { width:100%; max-width:none; min-width:0; }
}
@media (max-width: 1180px) {
  .gads-toolbar .spread { grid-template-columns: minmax(0, 1fr); }
  .gads-actions { justify-content: flex-start; }
}
@media (max-width: 560px) {
  .stats { grid-template-columns: 1fr 1fr; }
  .platform-assets-head,.platform-overall { align-items:flex-start; flex-direction:column; }
  .platform-section-body,.platform-section-head { padding-left:12px; padding-right:12px; }
  .platform-asset-grid,.tt-post-list { grid-template-columns:minmax(0,1fr); }
}
