:root {
  color-scheme: light;
  --canvas: #f7f6f4;
  --white: #fff;
  --ink: #201d20;
  --muted: #625d62;
  --line: #e8e4e2;
  --brand: #bd202b;
  --brand-dark: #9c1721;
  --red-wash: #fbe8e8;
  --sidebar: #211c20;
  --yellow: #f2d320;
  --radius: 17px;
  font: 15px/1.45 Inter, "Segoe UI", system-ui, sans-serif;
  color: var(--ink);
  background: var(--canvas);
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-width: 320px; }
h1, h2, h3, p { margin: 0; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button, select { cursor: pointer; }
button:disabled, select:disabled { cursor: not-allowed; opacity: .68; }
button, a, select, input, textarea { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid #895b00; outline-offset: 3px; }
.glyph { flex: none; vertical-align: middle; }
.sr-only, .skip:not(:focus) { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip:focus { position: fixed; inset: 12px auto auto 12px; padding: 10px 16px; background: white; z-index: 12; }
.boot { display: grid; place-content: center; min-height: 75vh; text-align: center; }

#app { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100dvh; }
.sidebar { position: sticky; top: 0; height: 100dvh; overflow-y: auto; display: flex; flex-direction: column; background: var(--sidebar); color: #f8f2f5; padding: 24px 14px 16px; }
.sidebar-civic { background: #1d2228; }
.branding { display: flex; align-items: center; gap: 11px; outline-offset: 4px; margin: 0 7px 28px; }
.branding strong { font-weight: 750; letter-spacing: -.04em; display: block; font-size: 25px; line-height: 1; }
.branding strong span { color: #f8df55; }
.branding small { font-size: 11px; color: #c6bfc3; white-space: nowrap; }
.brand-mark { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; color: white; background: linear-gradient(150deg, #d2363c, #ad1625); box-shadow: inset 0 1px 0 #ffffff30; }
.brand-mark svg { width: 22px; height: 22px; }
.nav-label { font-size: 10px; font-weight: 750; margin: 0 10px 8px; text-transform: uppercase; letter-spacing: .14em; color: #bdb5bb; }
.nav-label.extra { margin-top: 22px; }
.nav-link { display: flex; align-items: center; min-height: 41px; gap: 10px; padding: 8px 10px; margin: 2px 0; border: 1px solid transparent; border-radius: 9px; color: #e3dce1; font-weight: 560; font-size: 13.5px; }
.nav-link:hover { background: #342c32; }
.nav-link.current { background: #43292f; color: #fff; border-color: #68343c; }
.nav-link.current .glyph { color: #ff919c; }
.sidebar :focus-visible, .hero :focus-visible { outline-color: #f7df61; }
.sidebar-foot { display: flex; align-items: center; gap: 10px; margin-top: auto; padding: 14px 6px 4px; border-top: 1px solid #ffffff24; }
.sidebar-foot strong, .sidebar-foot small { display: block; }
.sidebar-foot strong { font-size: 13px; }
.sidebar-foot small { color: #c6bfc3; font-size: 11.5px; }
.profile, .avatar { width: 36px; height: 36px; display: grid; place-items: center; flex: none; border-radius: 100%; background: #f4e3e4; color: #822632; font-weight: 750; font-size: 12px; }

.workspace { min-width: 0; }
.topbar { min-height: 66px; background: #fff; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; padding: 10px clamp(14px, 2.5vw, 36px); }
.crumb, .top-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.crumb { color: var(--muted); font-size: 13px; }
.crumb .glyph { width: 14px; height: 14px; color: #857d83; }
.crumb strong { color: var(--ink); }
.demo { color: #664b06; border: 1px solid #ecd99d; background: #fff8dd; padding: 5px 10px; border-radius: 999px; font-size: 12px; font-weight: 680; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.demo span, .hero-label span, .dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
.context { min-width: 0; display: flex; align-items: center; background: var(--white); border: 1px solid #ddd7da; border-radius: 9px; padding: 0 7px; }
.context > .glyph { width: 15px; height: 15px; pointer-events: none; color: var(--muted); }
.context select { appearance: none; border: 0; min-width: 0; max-width: 176px; padding: 7px 4px; font-size: 12.5px; font-weight: 650; background: transparent; }

.main { width: min(100%, 1580px); margin-inline: auto; padding: 24px clamp(14px, 2.8vw, 38px) 42px; outline: none; }
.section-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 18px; }
.section-head h1 { font-size: clamp(26px, 3vw, 40px); font-weight: 760; line-height: 1.08; letter-spacing: -.045em; }
.section-head p { margin-top: 6px; color: var(--muted); font-size: 14px; }
.inline-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

.button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 8px 13px; min-height: 39px; border: 1px solid transparent; border-radius: 9px; font-weight: 670; font-size: 13px; white-space: nowrap; }
.button .glyph, .text-link .glyph { width: 16px; height: 16px; }
.primary { background: var(--brand); color: white; box-shadow: 0 2px 3px #a01b241c; }
.primary:hover { background: var(--brand-dark); }
.secondary { background: white; border-color: #ddd7da; color: var(--ink); }
.secondary:hover { background: #f5f2f3; }
.text-link { display: inline-flex; align-items: center; gap: 5px; padding: 4px 0; background: transparent; border: 0; color: #a31c27; font-weight: 675; font-size: 13px; white-space: nowrap; }
.text-link:hover { text-decoration: underline; }
.inline-link { display: inline; padding: 0; }

.featured-banner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; padding: 14px 18px; border-radius: var(--radius); border: 1px solid #ebd77a; background: linear-gradient(90deg, #fff9dc, #fffdf4); margin-bottom: 16px; }
.featured-banner.muted-banner { border-color: var(--line); background: #faf8f7; }
.featured-copy { display: flex; flex-direction: column; gap: 3px; }
.featured-copy strong { font-size: 15px; }
.featured-copy small, .muted-line { color: var(--muted); font-size: 12.5px; }
.featured-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 740; padding: 3px 9px; border-radius: 999px; background: #ede9eb; color: #4b4349; width: fit-content; }
.yellow-pill { background: #f2d320; color: #201d20; }
.yellow-pill .glyph { width: 13px; height: 13px; }
.sim-tag { display: inline-flex; align-items: center; font-size: 11px; font-weight: 720; padding: 3px 8px; border-radius: 999px; background: #fff2c6; color: #664b06; border: 1px solid #ead48b; white-space: nowrap; }
.ver-tag { font-size: 11px; font-weight: 720; background: #f2eef0; color: #4f464d; padding: 2px 6px; border-radius: 6px; }
.type-pill { font-size: 11px; font-weight: 700; background: #eef2fb; color: #244586; padding: 2px 8px; border-radius: 99px; }

.hero { min-height: 188px; padding: 22px 24px; border-radius: var(--radius); background: linear-gradient(108deg, #261b23 2%, #381e29 63%, #682330 100%); color: #fff8fc; position: relative; isolation: isolate; overflow: hidden; }
.hero.hero-civic { background: linear-gradient(108deg, #1b242c 2%, #243442 65%, #374a5a 100%); }
.hero-content { position: relative; z-index: 2; max-width: 78%; overflow-wrap: anywhere; }
.hero-meta, .hero-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.hero-meta > span { display: inline-flex; gap: 6px; align-items: center; font-size: 12px; color: #f5e8ee; }
.hero-meta .glyph { width: 15px; height: 15px; }
.hero-meta .hero-label { text-transform: uppercase; letter-spacing: .105em; font-size: 10px; color: #f7de6e; font-weight: 750; }
.hero h2 { margin-top: 9px; font-size: clamp(25px, 3vw, 42px); line-height: 1.05; letter-spacing: -.045em; font-weight: 760; }
.hero p { margin-top: 9px; color: #f0e2e8; max-width: 600px; }
.hero-actions { margin-top: 16px; }
.hero-button { color: #2a2027; background: #fff; min-height: 36px; padding-block: 6px; }
.hero-button:hover { background: #f9e5e6; }
.hero .badge { border-color: #ffffff3b; background: #ffffff17; color: #ffecb0; }
.hero-decoration { position: absolute; inset: 0; overflow: hidden; pointer-events: none; background: repeating-linear-gradient(90deg, transparent 0 47px, #ffc8d314 48px 49px), repeating-linear-gradient(0deg, transparent 0 47px, #ffc8d310 48px 49px); mask-image: linear-gradient(90deg, transparent 42%, black 81%); }
.hero-decoration span { width: clamp(260px, 37vw, 510px); aspect-ratio: 1; position: absolute; top: 44%; right: -3%; border-radius: 50%; border: 1px solid #f9a1ae70; transform: translateY(-50%); }
.hero-decoration span:nth-child(2) { right: 4%; border-color: #ef6a7f82; }
.hero-decoration span:nth-child(3) { right: 11%; border-color: #f2b39676; }
.hero-decoration span:nth-child(3)::before { content: ''; position: absolute; width: 9px; height: 9px; right: 10%; top: 18%; border-radius: 50%; background: #f7da4e; box-shadow: 0 0 0 7px #f7da4e24; }

.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin: 16px 0; }
.channel-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin: 16px 0; }
.metric, .panel { border-radius: var(--radius); border: 1px solid var(--line); background: var(--white); box-shadow: 0 2px 5px #20171c05; }
.metric { padding: 14px 15px; min-width: 0; }
.metric-top { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 650; color: var(--muted); }
.metric-icon { width: 32px; height: 32px; display: grid; place-items: center; flex: none; border-radius: 9px; }
.metric-icon .glyph { width: 17px; height: 17px; }
.metric-icon.green { color: #21684b; background: #e7f4eb; }
.metric-icon.red { color: #a7202b; background: #fcecee; }
.metric-icon.yellow { color: #755204; background: #fff3d4; }
.metric-icon.violet { color: #65427e; background: #f1e9f9; }
.metric > strong { display: block; margin-top: 8px; font-size: clamp(19px, 2vw, 30px); letter-spacing: -.04em; font-variant-numeric: tabular-nums; line-height: 1.14; overflow-wrap: anywhere; }
.metric small { display: block; margin-top: 4px; font-size: 12px; color: var(--muted); }

.channel-card { padding: 15px; }
.channel-card-head { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; gap: 9px; align-items: center; margin-bottom: 10px; }
.channel-card-head h3 { font-size: 15px; }
.channel-card-head small { font-size: 11.5px; color: var(--muted); }
.kpi-dl { margin: 0; }
.kpi-dl > div { display: flex; justify-content: space-between; gap: 8px; padding: 7px 0; border-top: 1px solid var(--line); font-size: 12.5px; }
.kpi-dl dt { color: var(--muted); }
.kpi-dl dd { margin: 0; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: 16px; }
.panel { min-width: 0; }
.panel-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.panel-head h2, .campaign-card h2, .integration h2 { font-size: 18px; line-height: 1.23; letter-spacing: -.025em; overflow-wrap: anywhere; }
.panel-head p, .campaign-card p, .integration p { color: var(--muted); margin-top: 3px; font-size: 13px; overflow-wrap: anywhere; }
.chart, .attention, .recent, .channel-panel, .report, .timeline-panel, .integration { padding: 18px; }
.segments { display: inline-flex; gap: 2px; padding: 3px; background: #f5f1f1; border-radius: 9px; }
.segments button { display: flex; align-items: center; gap: 6px; background: none; border: 1px solid transparent; border-radius: 7px; min-height: 31px; font-size: 12px; color: var(--muted); font-weight: 680; padding: 4px 9px; }
.segments button[aria-pressed="true"] { background: #fff; border-color: #eee6e8; color: #9c1925; box-shadow: 0 1px 3px #38213210; }
.segments .glyph { width: 14px; height: 14px; }
.bars { display: grid; gap: 11px; margin-top: 14px; }
.bar-row > div { display: flex; justify-content: space-between; font-size: 12px; gap: 8px; }
.bar-row > div span { color: var(--muted); }
meter { appearance: none; display: block; width: 100%; height: 8px; border: 0; background: #f2eeee; border-radius: 99px; overflow: hidden; margin-top: 5px; }
meter::-webkit-meter-bar { border: 0; height: 8px; border-radius: 99px; background: #f2eeee; }
meter::-webkit-meter-optimum-value { background: #c52536; border-radius: 99px; }
.bar-1::-webkit-meter-optimum-value { background: #d46369; }
.bar-2::-webkit-meter-optimum-value { background: #e4898b; }
meter::-moz-meter-bar { background: #c52536; }

.count { background: #fff2cc; color: #715208; font-size: 13px; border-radius: 999px; min-width: 26px; padding: 3px 8px; font-weight: 720; text-align: center; }
.attention-list { display: grid; }
.attention-row { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; gap: 9px; align-items: center; text-align: left; padding: 10px 2px; border: 0; border-top: 1px solid var(--line); background: white; }
.attention-row:hover { background: #faf6f6; }
.attention-row > .glyph { width: 16px; height: 16px; color: #a31c27; }
.attention-row strong, .attention-row small { display: block; overflow-wrap: anywhere; }
.attention-row strong { font-size: 13px; }
.attention-row small { font-size: 12px; color: var(--muted); margin-top: 2px; }
.attention-note { display: flex; align-items: center; gap: 7px; border-top: 1px solid var(--line); padding-top: 10px; margin-top: 5px; color: var(--muted); font-size: 12px; }
.attention-note .glyph { width: 16px; height: 16px; color: #367456; }
.recent, .channel-panel + .channel-panel { margin-top: 16px; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; align-items: center; border-top: 1px solid var(--line); gap: 11px; padding: 10px 1px; }
.timeline li > div { overflow-wrap: anywhere; }
.timeline strong { font-size: 13px; }
.timeline p, .timeline time { font-size: 12px; color: var(--muted); }
.event-icon { background: #f6eeee; color: #962731; width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; }
.event-icon .glyph { width: 16px; height: 16px; }

.campaign-grid, .integration-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.campaign-card { padding: 16px; display: flex; flex-direction: column; }
.campaign-card.selected { border-color: #c63f4c; box-shadow: 0 0 0 1px #c63f4c; }
.campaign-card:hover:not(.selected) { border-color: #ac737b; }
.card-line { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 10px; }
.scope-chip { margin-top: 10px; font-size: 11.5px; color: #5b4d55; background: #f4eff1; padding: 4px 8px; border-radius: 7px; width: fit-content; }
.campaign-card footer { padding-top: 12px; margin-top: auto; display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12.5px; }
.campaign-card footer .glyph:last-child { margin-left: auto; color: var(--brand); }

.badge { display: inline-flex; align-items: center; gap: 5px; border-radius: 99px; border: 1px solid transparent; background: #f0edef; color: #514851; padding: 3px 8px; font-size: 11px; font-weight: 720; white-space: nowrap; }
.badge.pending, .badge.planned, .badge.queued { background: #fff1c9; color: #715208; }
.badge.approved, .badge.active, .badge.resolved, .badge.completed, .badge.delivered, .badge.read, .badge.recorded { background: #e5f4ea; color: #226547; }
.badge.simulated, .badge.scheduled { background: #f0e6f8; color: #62407b; }
.badge.open, .badge.paused { background: #fff3df; color: #754a0a; }
.badge.changes_requested, .badge.failed, .badge.blocked, .badge.completed_with_failures { background: #fde6e8; color: #8c1520; }
.badge.cancelled, .badge.archived { background: #ece9eb; color: #5b5359; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }
table { width: 100%; min-width: 540px; border-collapse: collapse; font-size: 13px; }
th, td { padding: 10px 12px; text-align: left; vertical-align: top; }
thead { background: #f7f3f4; color: #60565d; }
td { border-top: 1px solid var(--line); overflow-wrap: anywhere; }
tr.selected-row { background: #fcf4f5; }
.table-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 2px 12px; }
.empty { text-align: center; padding: 24px 10px; color: var(--muted); }
.empty .glyph { color: #a9424a; margin-bottom: 8px; }
.empty h3 { color: var(--ink); font-size: 15px; }
.empty p { font-size: 13px; margin-top: 4px; }

.conflict-alert, .blocked-notice, .sim-banner, .insufficient-box { display: flex; align-items: flex-start; gap: 10px; padding: 11px 14px; border-radius: 10px; margin-bottom: 14px; font-size: 13px; }
.conflict-alert { background: #fff3d6; border: 1px solid #ebd07f; color: #644706; }
.blocked-notice { background: #fdecee; border: 1px solid #ecc1c6; color: #7d1620; }
.sim-banner { background: #211c20; color: #f8df55; }
.sim-banner strong { color: #fff; }
.insufficient-box { background: #fff3d6; border: 1px solid #ebd07f; color: #644706; margin-top: 12px; }

.summary-strip { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 12px; padding: 10px 14px; background: #faf7f6; border: 1px solid var(--line); border-radius: 10px; font-size: 13px; }
.return-reason, .return-inline { color: #8c1520; font-size: 12px; font-weight: 650; }
.batch-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.batch-tab { display: inline-flex; align-items: center; gap: 8px; padding: 7px 11px; border: 1px solid var(--line); background: #fff; border-radius: 9px; font-size: 13px; font-weight: 640; }
.batch-tab.selected { border-color: var(--brand); background: #fdf4f5; }
.batch-head { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 10px; margin-bottom: 10px; }
.batch-head h3 { font-size: 16px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.preview-box { margin: 8px 0 12px; padding: 11px 13px; border-left: 3px solid var(--brand); background: #faf6f6; border-radius: 6px; font-size: 13px; }
.batch-actions { justify-content: flex-start; margin-bottom: 14px; }

.filter-bar { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 14px; }
.inline-field { flex: 1 1 220px; margin-bottom: 0; }
.inline-select select { padding: 7px 10px; border: 1px solid #d6cfd2; border-radius: 8px; background: white; font-size: 13px; }
.ad-detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.ad-preview-card { border: 1px solid var(--line); border-radius: 12px; padding: 14px; background: #fcfbfb; display: flex; flex-direction: column; gap: 10px; }
.preview-chip { font-size: 11px; font-weight: 740; text-transform: uppercase; letter-spacing: .06em; color: #7a1922; }
.preview-meta-head { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }
.preview-primary { font-size: 13px; color: var(--ink); }
.preview-box-media { padding: 18px 12px; background: #211c20; color: #f8df55; border-radius: 9px; text-align: center; font-size: 12.5px; }
.preview-meta-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding-top: 8px; border-top: 1px solid var(--line); }
.preview-meta-foot small { display: block; color: var(--muted); font-size: 11.5px; overflow-wrap: anywhere; }
.preview-cta { padding: 5px 10px; background: #ece8ea; border-radius: 7px; font-size: 12px; font-weight: 680; white-space: nowrap; }
.search-serp { display: flex; flex-direction: column; gap: 6px; }
.serp-url { color: #226547; font-size: 12px; }
.serp-title { color: #1a439b; font-size: 16px; }
.serp-desc { font-size: 13px; color: var(--muted); }
.serp-kw { display: flex; flex-wrap: wrap; gap: 6px; font-size: 12px; color: var(--muted); }
.serp-kw code, code { background: #f2eef0; padding: 2px 6px; border-radius: 5px; font-size: 12px; }
.youtube-frame { background: #211c20; color: #fff; border-radius: 10px; padding: 18px 14px; display: flex; flex-direction: column; gap: 6px; }
.yt-badge { width: fit-content; background: var(--brand); color: #fff; font-size: 11px; font-weight: 720; padding: 2px 8px; border-radius: 6px; }

.inbox { display: grid; grid-template-columns: minmax(228px, .85fr) minmax(0, 1.55fr); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.conversation-list { border-right: 1px solid var(--line); }
.conversation-row { border: 0; border-bottom: 1px solid var(--line); background: white; width: 100%; padding: 11px 9px; display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; align-items: center; gap: 7px; text-align: left; }
.conversation-row:hover { background: #faf3f4; }
.conversation-row.selected { background: #f9eef0; box-shadow: inset 3px 0 #ba2432; }
.conversation-row strong, .conversation-row small { display: block; overflow-wrap: anywhere; }
.conversation-row strong { font-size: 13px; }
.conversation-row small { color: var(--muted); font-size: 11px; }
.conversation-detail { background: #fbfaf8; display: flex; flex-direction: column; min-height: 240px; }
.conversation-head { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; background: white; border-bottom: 1px solid var(--line); gap: 8px; }
.conversation-head h3 { font-size: 15px; }
.conversation-head small { font-size: 12px; color: var(--muted); }
.thread { list-style: none; display: flex; flex-direction: column; gap: 10px; padding: 14px; margin: 0; min-height: 140px; flex: 1; }
.bubble { background: white; border: 1px solid var(--line); border-radius: 11px; padding: 8px 10px; max-width: 87%; align-self: flex-start; overflow-wrap: anywhere; font-size: 13px; }
.bubble.out { align-self: flex-end; background: #e8f5ec; border-color: #d7ebdd; }
.bubble time { display: block; text-align: right; margin-top: 5px; font-size: 11px; color: var(--muted); }
.reply { display: flex; gap: 8px; padding: 9px; border-top: 1px solid var(--line); background: white; }
.reply label { flex: 1; min-width: 0; }
.resolved-note { border-top: 1px solid var(--line); background: white; padding: 12px; font-size: 13px; color: var(--muted); }

.reports { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.report dl { margin: 0; }
.report dl > div { display: flex; justify-content: space-between; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.report dd { margin: 0; font-weight: 700; text-align: right; }
.report dt, .integration small { color: var(--muted); }
.integration small { display: block; margin-top: 10px; font-size: 12px; }

.builder-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.ind-checks, .prov-checks { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin: 10px 0 0; }
.ind-checks legend, .prov-checks legend { font-size: 12px; font-weight: 700; color: var(--muted); padding: 0 6px; }
.ind-checks { display: flex; flex-wrap: wrap; gap: 8px; }
.prov-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; max-height: 170px; overflow-y: auto; }
.check-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; padding: 4px 8px; border-radius: 8px; background: #f8f6f6; border: 1px solid var(--line); cursor: pointer; }
.check-pill input { width: auto; min-height: auto; margin: 0; }

.kb-search { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.kb-answers { display: grid; gap: 10px; margin-top: 14px; }
.kb-answer { border: 1px solid #d5e8da; background: #f5fbf6; border-radius: 12px; padding: 13px; }
.kb-quote { margin: 8px 0; font-style: italic; }
.kb-foot { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.kb-docs-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 14px; }
.kb-doc-card { border: 1px solid var(--line); border-radius: 12px; padding: 14px; background: #fff; display: flex; flex-direction: column; gap: 6px; }
.kb-doc-card h3 { font-size: 15px; }
.kb-doc-card p { font-size: 12.5px; color: var(--muted); }
.session-list { display: grid; gap: 8px; margin-top: 10px; }
.session-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 9px; }

dialog { width: min(600px, calc(100% - 24px)); max-height: 90dvh; overflow-y: auto; border: 1px solid #e1d7db; padding: 19px; border-radius: var(--radius); color: var(--ink); background: white; box-shadow: 0 20px 80px #201a2055; }
dialog::backdrop { background: #21191fc0; }
.dialog-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 14px; }
.dialog-head h2 { font-size: 21px; letter-spacing: -.03em; overflow-wrap: anywhere; }
.dialog-head p, .review-content small { color: var(--muted); font-size: 13px; }
.icon-button { background: #f7f2f3; border: 1px solid #e5dfe2; display: grid; place-items: center; border-radius: 8px; width: 33px; height: 33px; flex: none; }
.field { display: block; font-size: 13px; font-weight: 680; margin-bottom: 10px; }
.field input, .field textarea, .field select, .reply input { width: 100%; min-width: 0; padding: 8px 9px; border: 1px solid #d6cfd2; border-radius: 8px; background: white; min-height: 39px; }
.field input, .field textarea, .field select { display: block; margin-top: 4px; font-weight: 400; }
.field textarea { resize: vertical; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.form-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; margin-top: 13px; }
.review-content p { white-space: pre-wrap; padding: 8px 0; overflow-wrap: anywhere; }
.form-error:not(:empty) { color: #8c1520; background: #fff1f2; padding: 9px; border-radius: 7px; font-size: 13px; margin-top: 10px; }
.toast { position: fixed; z-index: 11; bottom: 18px; right: 18px; max-width: calc(100vw - 36px); border-radius: 10px; background: #222024; color: #fff; padding: 12px 16px; box-shadow: 0 4px 16px #231c2340; }
.toast.error { background: #941f29; }

@media (max-width: 1160px) {
  .metrics, .channel-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kb-docs-grid, .campaign-grid, .integration-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 960px) {
  #app { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: static; height: auto; padding: 12px 14px 8px; }
  .branding { margin: 0 0 8px; }
  .branding strong { font-size: 21px; }
  .brand-mark { width: 32px; height: 32px; }
  .sidebar nav { display: flex; overflow-x: auto; gap: 4px; padding: 2px; }
  .nav-link { min-height: 36px; white-space: nowrap; margin: 0; font-size: 12px; gap: 5px; padding: 6px 9px; }
  .nav-link .glyph { width: 15px; height: 15px; }
  .nav-label, .sidebar-foot { display: none; }
  .ad-detail-grid, .builder-grid, .reports { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 570px) {
  .sidebar nav { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); overflow: visible; gap: 4px; }
  .nav-link { min-width: 0; min-height: 46px; flex-direction: column; justify-content: center; text-align: center; font-size: 10px; padding: 4px 2px; gap: 2px; }
  .main { padding: 16px 12px 32px; }
  .topbar { padding: 8px 12px; }
  .crumb { display: none; }
  .top-actions { width: 100%; justify-content: space-between; gap: 6px; }
  .context { flex: 1 1 46%; }
  .context select { max-width: 100%; width: 100%; }
  .hero { padding: 16px; }
  .hero-content { max-width: 100%; }
  .hero-decoration { opacity: .45; }
  .metrics, .channel-kpis, .campaign-grid, .integration-grid, .kb-docs-grid, .form-grid, .prov-grid { grid-template-columns: minmax(0, 1fr); }
  .dashboard-grid, .inbox { grid-template-columns: minmax(0, 1fr); }
  .conversation-list { border-right: 0; max-height: 170px; overflow-y: auto; border-bottom: 1px solid var(--line); }
  .channel-panel, .report, .timeline-panel { padding: 13px; }
  .reply { flex-wrap: wrap; }
  .reply label { flex: 1 0 100%; }
  .reply .button { margin-left: auto; }
  .timeline li { grid-template-columns: 26px minmax(0, 1fr); }
  .timeline time { grid-column: 2; }
  .event-icon { width: 26px; height: 26px; }
}
@media (prefers-reduced-motion: no-preference) {
  a, button { transition: background-color .15s, border-color .15s; }
}
