:root {
  --bg: #f0f2f5;
  --panel: #ffffff;
  --line: #dadde1;
  --line-soft: #e9ebee;
  --ink: #1c1e21;
  --ink-2: #65676b;
  --ink-3: #8a8d91;
  --blue: #0866ff;
  --blue-soft: #e7f0ff;
  --green: #1f8a4c;
  --green-soft: #e3f4ea;
  --red: #c4302b;
  --red-soft: #fde8e7;
  --amber: #a15c00;
  --amber-soft: #fff3dc;
  --purple: #6b3fd4;
  --purple-soft: #efe9fc;
  --radius: 8px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 14px/1.4 var(--font); color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

/* ---------- top bar ---------- */
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; height: 56px; padding: 0 16px; background: var(--panel); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 16px; white-space: nowrap; }
.brand-mark { width: 28px; height: 28px; border-radius: 7px; background: #2b3a55; display: grid; place-items: center; color: #fff; font-size: 15px; }
.filters { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; flex: 1; min-width: 0; }
.filters::-webkit-scrollbar { display: none; }
.chip { border: 1px solid var(--line); background: var(--panel); border-radius: 999px; padding: 5px 12px; white-space: nowrap; font-size: 13px; color: var(--ink-2); }
.chip.on { background: var(--blue-soft); border-color: #b9d2ff; color: var(--blue); font-weight: 600; }
.chip b { font-weight: 600; margin-left: 4px; }
.top-right { display: flex; align-items: center; gap: 8px; }
.me { color: var(--ink-3); font-size: 12px; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.btn { border: 1px solid var(--line); background: var(--panel); border-radius: 6px; padding: 7px 12px; font-weight: 600; font-size: 13px; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.btn:hover { background: #f5f6f7; }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.primary:hover { background: #0057e7; }
.btn.good { background: var(--green); border-color: var(--green); color: #fff; }
.btn.bad { color: var(--red); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn:disabled { opacity: .5; cursor: default; }
.icon-btn { border: 0; background: transparent; padding: 6px; border-radius: 6px; color: var(--ink-2); display: inline-grid; place-items: center; }
.icon-btn:hover { background: var(--line-soft); }

/* ---------- layout ---------- */
.layout { display: grid; grid-template-columns: 300px minmax(0, 1fr) 380px; height: calc(100vh - 56px); height: calc(100dvh - 56px); }
.list { background: var(--panel); border-right: 1px solid var(--line); overflow-y: auto; }
.stage { overflow: auto; display: flex; flex-direction: column; min-width: 0; }
.inspector { background: var(--panel); border-left: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }

/* ---------- ad list ---------- */
.batch-h { position: sticky; top: 0; z-index: 2; background: #f7f8fa; border-bottom: 1px solid var(--line-soft); padding: 8px 14px; font-size: 12px; font-weight: 700; color: var(--ink-2); text-transform: uppercase; letter-spacing: .04em; display: flex; justify-content: space-between; }
.row { display: grid; grid-template-columns: 56px 1fr; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line-soft); cursor: pointer; align-items: center; }
.row:hover { background: #f7f8fa; }
.row.sel { background: var(--blue-soft); box-shadow: inset 3px 0 0 var(--blue); }
.thumb { width: 56px; height: 56px; border-radius: 6px; overflow: hidden; background: #e4e6eb; position: relative; }
.thumb .cr { position: absolute; inset: 0; }
/* Thumbnails render the creative at feed size, then shrink it, so card text keeps its layout. */
.thumb-inner { position: absolute; top: 0; left: 0; width: 280px; height: 280px; transform: scale(calc(56 / 280)); transform-origin: top left; }
.media-row .thumb-inner { transform: scale(calc(72 / 280)); }
.thumb-inner .cr { position: absolute; inset: 0; }
.row-name { font-weight: 600; font-size: 13.5px; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.row-sub { color: var(--ink-3); font-size: 12px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-badges { display: flex; gap: 6px; margin-top: 5px; flex-wrap: wrap; align-items: center; }
.pill { display: inline-flex; align-items: center; gap: 4px; border-radius: 999px; padding: 1px 8px; font-size: 11.5px; font-weight: 600; background: var(--line-soft); color: var(--ink-2); }
.pill.draft { background: #eceef1; color: #4b4f56; }
.pill.review { background: var(--purple-soft); color: var(--purple); }
.pill.approved { background: var(--green-soft); color: var(--green); }
.pill.rejected { background: var(--red-soft); color: var(--red); }
.pill.live { background: #dff3ff; color: #00679e; }
.pill.paused { background: var(--amber-soft); color: var(--amber); }
.pill.archived { background: #eee; color: #999; }
.badge { font-size: 11.5px; color: var(--ink-2); display: inline-flex; gap: 3px; align-items: center; }
.badge.warn { color: var(--amber); }
.badge.err { color: var(--red); }
.list-empty { padding: 24px; color: var(--ink-3); text-align: center; }

/* ---------- stage ---------- */
.stage-bar { position: sticky; top: 0; z-index: 3; background: var(--bg); padding: 12px 16px 8px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; }
.tabs { display: flex; gap: 2px; background: #e4e6eb; padding: 3px; border-radius: 8px; overflow-x: auto; scrollbar-width: none; max-width: 100%; }
.tabs::-webkit-scrollbar { display: none; }
.tab { border: 0; background: transparent; padding: 6px 12px; border-radius: 6px; font-weight: 600; font-size: 13px; color: var(--ink-2); white-space: nowrap; }
.tab.on { background: var(--panel); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.12); }
.stage-tools { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.toggle { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-2); border: 1px solid var(--line); background: var(--panel); border-radius: 999px; padding: 4px 10px; }
.toggle.on { border-color: #b9d2ff; color: var(--blue); background: var(--blue-soft); }
.stage-body { flex: 1; display: flex; justify-content: center; align-items: flex-start; padding: 8px 16px 40px; gap: 28px; flex-wrap: wrap; }
.stage-title { width: 100%; text-align: center; color: var(--ink-2); font-size: 12.5px; margin-top: -2px; }
.stage-empty { margin: 80px auto; color: var(--ink-3); text-align: center; }

.phone { width: 390px; height: 800px; max-height: calc(100dvh - 160px); min-height: 560px; border-radius: 44px; background: #111; padding: 12px; box-shadow: 0 10px 40px rgba(0,0,0,.18); flex: none; position: relative; }
.phone-screen { width: 100%; height: 100%; border-radius: 34px; overflow: hidden; background: #fff; display: flex; flex-direction: column; position: relative; }
.phone.dark .phone-screen { background: #000; }
.phone-status { height: 44px; flex: none; display: flex; justify-content: space-between; align-items: center; padding: 0 26px 0 30px; font-weight: 600; font-size: 14px; }
.phone.dark .phone-status { color: #fff; position: absolute; top: 0; left: 0; right: 0; z-index: 5; }
.phone-island { position: absolute; top: 11px; left: 50%; transform: translateX(-50%); width: 110px; height: 30px; border-radius: 20px; background: #000; z-index: 6; }
.phone-scroll { flex: 1; overflow-y: auto; background: #c9ccd1; scrollbar-width: none; }
.phone-scroll::-webkit-scrollbar { display: none; }
.phone.full .phone-scroll { background: #000; display: flex; }
.feed-gap { height: 10px; }
.feed-ghost { background: #fff; padding: 12px; }
.feed-ghost i { display: block; height: 10px; border-radius: 5px; background: #e4e6eb; margin: 8px 0; }
.ig-chrome .phone-scroll { background: #fff; }
.desktop-card { width: 520px; max-width: 100%; background: #fff; border-radius: 10px; box-shadow: 0 1px 3px rgba(0,0,0,.15); overflow: hidden; }
.mini { transform-origin: top center; }
.all-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 24px; width: 100%; }
.all-cell { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.all-cell .cap { font-size: 12px; font-weight: 600; color: var(--ink-2); }
.all-cell .phone { transform: scale(.72); transform-origin: top center; margin-bottom: calc(-800px * .28); }

/* ---------- previews (shared) ---------- */
.pv { font-family: var(--font); color: #050505; background: #fff; }
.pv [data-field], .pv [data-form] { cursor: pointer; border-radius: 3px; transition: box-shadow .12s; }
.pv [data-field]:hover, .pv [data-form]:hover { box-shadow: 0 0 0 2px rgba(8,102,255,.45); }
.pv .flash { box-shadow: 0 0 0 3px rgba(8,102,255,.8) !important; }
.pv-avatar { border-radius: 50%; overflow: hidden; background: linear-gradient(135deg, #ffb300, #ff6d00); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 14px; flex: none; }
.pv-avatar img { width: 100%; height: 100%; object-fit: cover; }
.pv-more { color: #65676b; font-weight: 600; cursor: pointer; }

/* Facebook feed */
.fb-m { padding-top: 12px; }
.fb-head { display: flex; align-items: center; gap: 8px; padding: 0 12px; }
.fb-who { flex: 1; min-width: 0; line-height: 1.25; }
.fb-who b { display: block; font-size: 15px; }
.fb-who span { display: inline-flex; align-items: center; gap: 3px; color: #65676b; font-size: 13px; }
.fb-icons { display: flex; gap: 6px; color: #65676b; }
.fb-text { padding: 8px 12px 10px; font-size: 15px; line-height: 1.34; white-space: normal; word-wrap: break-word; }
.fb-media { width: 100%; position: relative; background: #000; overflow: hidden; }
.fb-media .cr { position: absolute; inset: 0; }
.fb-link { display: flex; align-items: center; gap: 10px; background: #f0f2f5; padding: 10px 12px; }
.fb-link-txt { flex: 1; min-width: 0; }
.fb-domain { font-size: 12px; color: #65676b; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fb-headline { font-size: 16px; font-weight: 600; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fb-desc { font-size: 14px; color: #65676b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fb-desc:empty { display: none; }
.fb-cta { flex: none; background: #e4e6eb; border-radius: 6px; padding: 8px 14px; font-weight: 600; font-size: 15px; }
.fb-stats { display: flex; justify-content: space-between; padding: 10px 12px 8px; font-size: 14px; color: #65676b; border-bottom: 1px solid #ced0d4; margin: 0 12px; padding-left: 0; padding-right: 0; }
.fb-actions { display: flex; justify-content: space-around; padding: 6px 12px 10px; color: #65676b; font-weight: 600; font-size: 14px; }
.fb-actions span { display: inline-flex; align-items: center; gap: 6px; }
.fb-d .fb-text { font-size: 15px; }
.fb-d .fb-headline { font-size: 17px; }

/* Instagram feed */
.ig { padding-bottom: 12px; }
.ig-head { display: flex; align-items: center; gap: 10px; padding: 10px 12px; }
.ig-head .pv-avatar { box-shadow: 0 0 0 2px #fff, 0 0 0 3.5px #d62976; }
.ig-who { flex: 1; line-height: 1.2; }
.ig-who b { display: block; font-size: 14px; }
.ig-who span { font-size: 12px; color: #262626; }
.ig-media { width: 100%; position: relative; background: #000; overflow: hidden; }
.ig-media .cr { position: absolute; inset: 0; }
.ig-cta { display: flex; justify-content: space-between; align-items: center; padding: 11px 12px; border-bottom: 1px solid #efefef; font-weight: 600; font-size: 14px; color: #0095f6; }
.ig-icons { display: flex; justify-content: space-between; padding: 8px 12px 4px; }
.ig-icons span { display: flex; gap: 14px; }
.ig-likes { font-weight: 600; font-size: 14px; padding: 2px 12px; }
.ig-text { font-size: 14px; padding: 2px 12px; line-height: 1.35; }

/* Stories / Reels */
.story { position: relative; width: 100%; height: 100%; background: #000; color: #fff; overflow: hidden; }
.st-bg { position: absolute; inset: 0; }
.st-bg > .cr { position: absolute; inset: 0; }
.st-blur { position: absolute; inset: -40px; filter: blur(28px) brightness(.55); }
.st-blur .cr { position: absolute; inset: 0; }
.st-center { position: absolute; left: 0; right: 0; top: 50%; transform: translateY(-50%); }
.st-center .cr { position: absolute; inset: 0; }
.st-progress { position: absolute; top: 50px; left: 10px; right: 10px; height: 2px; background: rgba(255,255,255,.35); border-radius: 2px; z-index: 3; }
.st-progress i { display: block; width: 35%; height: 100%; background: #fff; border-radius: 2px; }
.st-head { position: absolute; top: 60px; left: 12px; right: 12px; display: flex; align-items: center; gap: 8px; z-index: 3; font-size: 13.5px; text-shadow: 0 1px 2px rgba(0,0,0,.4); }
.st-head span { opacity: .85; font-size: 12.5px; }
.reels .st-head { top: auto; bottom: 150px; }
.st-cta { position: absolute; left: 50%; transform: translateX(-50%); bottom: 34px; background: #fff; color: #000; border-radius: 999px; padding: 9px 22px; font-weight: 600; font-size: 14px; display: flex; flex-direction: column; align-items: center; gap: 0; z-index: 3; white-space: nowrap; }
.reels .st-cta { left: 12px; right: 64px; transform: none; bottom: 34px; border-radius: 8px; background: rgba(255,255,255,.95); flex-direction: row; justify-content: center; }
.st-caption { position: absolute; left: 12px; right: 70px; bottom: 82px; z-index: 3; font-size: 13.5px; line-height: 1.35; text-shadow: 0 1px 2px rgba(0,0,0,.5); }
.st-spon { opacity: .8; font-size: 12px; }
.st-music { display: flex; align-items: center; gap: 5px; font-size: 12px; margin-top: 6px; opacity: .9; }
.st-rail { position: absolute; right: 10px; bottom: 120px; display: flex; flex-direction: column; gap: 20px; z-index: 3; }
.safe { position: absolute; left: 0; right: 0; z-index: 4; background: repeating-linear-gradient(45deg, rgba(255,64,64,.28) 0 8px, rgba(255,64,64,.14) 8px 16px); display: flex; align-items: center; justify-content: center; pointer-events: none; }
.safe em { font-style: normal; font-size: 11px; font-weight: 600; background: rgba(0,0,0,.6); padding: 2px 8px; border-radius: 4px; }
.safe-top { top: 0; height: 14%; }
.safe-bottom { bottom: 0; height: 20%; }
.safe-bottom.tall { height: 35%; }
.safe-right { top: 14%; bottom: 35%; left: auto; width: 16%; }

/* Instant form */
.form { position: relative; display: flex; flex-direction: column; height: 100%; width: 100%; background: #fff; }
.if-top { display: flex; align-items: center; gap: 10px; padding: 52px 14px 10px; border-bottom: 1px solid #e4e6eb; font-weight: 600; }
.if-top span:nth-child(2) { flex: 1; text-align: center; }
.if-stepn { color: #65676b; font-size: 12px; font-weight: 500; }
.if-x { color: #65676b; display: grid; }
.if-body { flex: 1; overflow-y: auto; }
.if-cover { aspect-ratio: 1.91 / 1; position: relative; overflow: hidden; background: #ddd; }
.if-cover .cr { position: absolute; inset: 0; }
.if-intro { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 0 20px 20px; margin-top: -22px; position: relative; }
.if-intro .pv-avatar { box-shadow: 0 0 0 3px #fff; }
.if-page { font-size: 13px; color: #65676b; margin: 6px 0 10px; }
.if-h { font-size: 20px; font-weight: 700; line-height: 1.25; margin-bottom: 8px; }
.if-h2 { font-size: 17px; font-weight: 700; margin: 4px 0 12px; }
.if-p { font-size: 14.5px; color: #333; line-height: 1.4; }
.if-pad { padding: 16px; }
.if-q { margin-bottom: 18px; }
.if-ql { font-weight: 600; margin-bottom: 8px; font-size: 15px; }
.if-opt { display: flex; align-items: center; gap: 10px; border: 1px solid #ccd0d5; border-radius: 8px; padding: 10px 12px; margin-bottom: 6px; font-size: 14.5px; }
.if-opt input { accent-color: #0866ff; margin: 0; }
.if-field { margin-bottom: 12px; }
.if-field span { display: block; font-size: 12.5px; color: #65676b; margin-bottom: 4px; }
.if-input { border: 1px solid #ccd0d5; border-radius: 8px; padding: 10px 12px; font-size: 14.5px; color: #1c1e21; background: #f7f8fa; }
.if-note { font-size: 12.5px; color: #0866ff; margin: 6px 0 10px; }
.if-privacy { font-size: 11.5px; color: #65676b; line-height: 1.4; margin-top: 10px; }
.if-review { display: flex; justify-content: space-between; border-bottom: 1px solid #e4e6eb; padding: 10px 0; font-size: 14px; }
.if-review span { color: #65676b; }
.if-slide { margin-top: 24px; background: #e7f0ff; border-radius: 999px; height: 50px; display: flex; align-items: center; position: relative; color: #0866ff; font-weight: 600; justify-content: center; }
.if-slide i { position: absolute; left: 4px; top: 4px; width: 42px; height: 42px; border-radius: 50%; background: #0866ff; color: #fff; display: grid; place-items: center; font-style: normal; font-size: 18px; }
.if-thanks { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 40px 22px; gap: 4px; }
.if-thanks .if-h { margin-top: 12px; }
.if-btn { margin-top: 18px; background: #0866ff; color: #fff; border-radius: 8px; padding: 10px 22px; font-weight: 600; }
.if-foot { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px 26px; border-top: 1px solid #e4e6eb; }
.if-foot button { border: 0; border-radius: 8px; padding: 10px 18px; font-weight: 600; background: #e4e6eb; }
.if-foot .if-next { background: #0866ff; color: #fff; min-width: 120px; }
.if-empty { padding: 60px 20px; text-align: center; color: #65676b; }

/* ---------- creatives ---------- */
.cr { container-type: size; overflow: hidden; }
.cr-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cr-ph { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 3cqh; padding: 8cqw; }
.cr-photo { background: repeating-linear-gradient(135deg, #e9ebee 0 14px, #f3f4f6 14px 28px); color: #606770; }
.cr-video { background: radial-gradient(circle at 50% 40%, #3a3f47, #15171a); color: #e4e6eb; }
.ph-badge { position: absolute; top: 4cqw; left: 4cqw; font: 700 max(9px, 3.6cqw)/1 var(--font); background: #ffcf33; color: #3a2c00; padding: 1.4cqw 2.4cqw; border-radius: 1cqw; letter-spacing: .02em; }
.cr-video .ph-badge { background: #ff5a5f; color: #fff; }
.ph-text { font-size: max(9px, 4.2cqw); line-height: 1.35; max-width: 92%; }
.ph-script { font-size: max(9px, 3.6cqw); line-height: 1.4; opacity: .8; font-style: italic; max-width: 92%; }
.cr-ph svg { width: 14cqw; height: 14cqw; flex: none; }
.thumb .ph-text, .thumb .ph-badge, .thumb .ph-script { display: none; }

.cr-card { display: flex; flex-direction: column; justify-content: center; padding: 7cqw; gap: 3cqw; }
.cr-redbox { background: #fff7e6; color: #1a1a1a; }
.rb-kicker { font: 800 4.4cqw/1 var(--font); letter-spacing: .08em; color: #b42318; }
.rb-box { background: #d92d20; color: #fff; font: 800 9.2cqw/1.08 var(--font); padding: 5cqw; border-radius: 1.5cqw; letter-spacing: -.01em; }
.rb-sub { font: 600 5cqw/1.3 var(--font); color: #333; }

.cr-compare { background: #0f2d4a; color: #fff; text-align: center; }
.cc-title { font: 800 8cqw/1.1 var(--font); margin-bottom: 3cqw; }
.cc-row { display: flex; align-items: stretch; gap: 3cqw; }
.cc-col { flex: 1; border-radius: 2.5cqw; padding: 5cqw 3cqw; display: flex; flex-direction: column; justify-content: center; gap: 2cqw; }
.cc-left { background: rgba(255,255,255,.1); }
.cc-right { background: #ffb300; color: #1a1a1a; }
.cc-label { font: 700 4cqw/1.1 var(--font); text-transform: uppercase; letter-spacing: .05em; opacity: .85; }
.cc-val { font: 800 7cqw/1.1 var(--font); }
.cc-arrow { align-self: center; font: 800 7cqw/1 var(--font); opacity: .7; }
.cc-foot { font: 500 3.1cqw/1.35 var(--font); opacity: .75; margin-top: 3cqw; }

.cr-reviews { background: linear-gradient(160deg, #fff, #f3f6fb); color: #1a1a1a; text-align: center; align-items: center; }
/* Gold stars fill to the real rating (4.8 shows a partly filled fifth star). */
.rv-stars { position: relative; color: #dcdfe4; font-size: 11cqw; letter-spacing: 1cqw; line-height: 1; white-space: nowrap; }
.rv-stars span { position: absolute; left: 0; top: 0; overflow: hidden; color: #f5a623; }
.rv-rating { font: 800 22cqw/1 var(--font); letter-spacing: -.02em; }
.rv-count { font: 700 5.4cqw/1.2 var(--font); color: #444; }
.rv-quote { font: 500 5cqw/1.35 var(--font); font-style: italic; margin-top: 3cqw; max-width: 90%; }
.rv-who { font: 600 4cqw/1.2 var(--font); color: #666; }

.cr-news { background: #fff; color: #111; padding: 0; justify-content: flex-start; gap: 0; }
.nw-bar { background: #c4302b; color: #fff; font: 800 5cqw/1 var(--font); padding: 4cqw 6cqw; letter-spacing: .06em; }
.nw-head { font: 800 9cqw/1.1 Georgia, "Times New Roman", serif; padding: 7cqw 6cqw 3cqw; }
.nw-sub { font: 500 5cqw/1.35 var(--font); color: #444; padding: 0 6cqw; }

/* ---------- inspector ---------- */
.insp-head { padding: 12px 16px 0; border-bottom: 1px solid var(--line); }
.insp-title { display: flex; align-items: center; gap: 8px; }
.insp-title h2 { font-size: 16px; margin: 0; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.insp-meta { color: var(--ink-3); font-size: 12px; margin: 2px 0 8px; }
.insp-actions { display: flex; gap: 6px; margin-bottom: 10px; flex-wrap: wrap; }
.insp-tabs { display: flex; gap: 2px; }
.itab { border: 0; background: transparent; padding: 9px 12px; font-weight: 600; font-size: 13px; color: var(--ink-2); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.itab.on { color: var(--blue); border-bottom-color: var(--blue); }
.itab .n { background: var(--red); color: #fff; border-radius: 999px; padding: 0 6px; font-size: 11px; margin-left: 4px; }
.itab .n.amber { background: var(--amber); }
.insp-body { flex: 1; overflow-y: auto; padding: 14px 16px 20px; }
.insp-empty { color: var(--ink-3); padding: 30px 0; text-align: center; }

.fld { margin-bottom: 14px; }
.fld > label, .fld-h { display: flex; justify-content: space-between; align-items: baseline; font-size: 12.5px; font-weight: 600; color: var(--ink-2); margin-bottom: 5px; }
.cnt { font-weight: 500; color: var(--ink-3); font-size: 11.5px; }
.cnt.warn { color: var(--amber); }
.cnt.err { color: var(--red); }
.in, textarea.in, select.in { width: 100%; border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; background: #fff; font-size: 14px; }
.in:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(8,102,255,.15); }
textarea.in { resize: vertical; min-height: 64px; line-height: 1.4; }
textarea.in.tall { min-height: 170px; }
.hint { font-size: 12px; color: var(--ink-3); margin-top: 4px; line-height: 1.35; }
.hint b { color: var(--ink-2); font-weight: 600; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.seg button { border: 0; background: #fff; padding: 6px 12px; font-size: 13px; font-weight: 600; color: var(--ink-2); border-right: 1px solid var(--line); }
.seg button:last-child { border-right: 0; }
.seg button.on { background: var(--blue-soft); color: var(--blue); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sect { border-top: 1px solid var(--line-soft); margin: 18px -16px 14px; padding: 14px 16px 0; }
.sect-h { font-size: 13px; font-weight: 700; margin-bottom: 10px; display: flex; justify-content: space-between; align-items: center; }
.media-row { display: flex; gap: 10px; align-items: center; }
.media-row .thumb { width: 72px; height: 72px; }
.claim { display: flex; gap: 8px; align-items: flex-start; padding: 6px 0; font-size: 13px; }
.claim input { margin-top: 3px; accent-color: var(--green); }
.claim.ok span { color: var(--ink-3); text-decoration: line-through; }

.savebar { border-top: 1px solid var(--line); padding: 10px 16px; display: flex; gap: 8px; align-items: center; background: #fffdf5; }
.savebar .in { flex: 1; padding: 6px 8px; font-size: 13px; }
.savebar .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--amber); flex: none; }

.check { display: flex; gap: 10px; padding: 9px 10px; border-radius: 6px; margin-bottom: 6px; font-size: 13px; align-items: flex-start; }
.check.err { background: var(--red-soft); }
.check.warn { background: var(--amber-soft); }
.check.info { background: #f2f3f5; }
.check.ok { background: var(--green-soft); }
.check i { font-style: normal; font-weight: 800; flex: none; width: 16px; text-align: center; }
.check.err i { color: var(--red); } .check.warn i { color: var(--amber); } .check.ok i { color: var(--green); } .check.info i { color: var(--ink-3); }
.check small { display: block; color: var(--ink-2); margin-top: 2px; }

.cmt { border: 1px solid var(--line-soft); border-radius: 8px; padding: 10px 12px; margin-bottom: 8px; }
.cmt.done { opacity: .55; }
.cmt-h { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--ink-3); margin-bottom: 4px; }
.cmt-h b { color: var(--ink); font-weight: 600; }
.cmt-body { white-space: pre-wrap; font-size: 13.5px; }
.cmt-foot { margin-top: 6px; font-size: 12px; }
.cmt-foot label { display: inline-flex; gap: 5px; align-items: center; color: var(--ink-2); cursor: pointer; }
.cmt-new { position: sticky; bottom: -20px; background: #fff; padding: 10px 0 0; }
.cmt-new .btn { margin-top: 6px; }

.ver { border-left: 2px solid var(--line); padding: 2px 0 12px 12px; position: relative; }
.ver::before { content: ""; position: absolute; left: -6px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: #fff; border: 2px solid var(--line); }
.ver.cur::before { border-color: var(--blue); background: var(--blue); }
.ver-h { font-size: 12.5px; color: var(--ink-2); }
.ver-h b { color: var(--ink); }
.ver-note { font-size: 13px; margin: 2px 0; }
.ver-diff { font-size: 12px; color: var(--ink-3); }
.ver .btn { margin-top: 4px; padding: 4px 9px; font-size: 12px; }

.q-edit { border: 1px solid var(--line-soft); border-radius: 8px; padding: 10px; margin-bottom: 8px; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: #1c1e21; color: #fff; padding: 10px 16px; border-radius: 8px; font-size: 13.5px; z-index: 100; box-shadow: 0 6px 20px rgba(0,0,0,.25); max-width: calc(100vw - 32px); }
.toast.err { background: var(--red); }

dialog { border: 0; border-radius: 12px; padding: 0; width: min(440px, calc(100vw - 32px)); box-shadow: 0 20px 60px rgba(0,0,0,.3); }
dialog::backdrop { background: rgba(0,0,0,.35); }
.dlg-h { padding: 16px 18px; border-bottom: 1px solid var(--line); font-weight: 700; display: flex; justify-content: space-between; align-items: center; }
.dlg-b { padding: 16px 18px; }
.dlg-f { padding: 12px 18px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; }

.signin { max-width: 420px; margin: 120px auto; text-align: center; padding: 0 16px; color: var(--ink-2); }
.signin h1 { color: var(--ink); font-size: 20px; }

.mobile-back { display: none; }

/* ---------- agency: clients, sharing, client view ---------- */
.client-sel { width: auto; max-width: 200px; padding: 6px 28px 6px 10px; font-weight: 600; font-size: 13.5px; }
.banner { background: #fff3dc; border-bottom: 1px solid #f1d9a6; color: #5c3b00; padding: 8px 16px; font-size: 13px; display: flex; gap: 10px; align-items: center; justify-content: center; flex-wrap: wrap; }
.banner .btn { padding: 3px 10px; font-size: 12px; }
.banner:not([hidden]) + .layout { height: calc(100vh - 56px - 41px); height: calc(100dvh - 56px - 41px); }
.share { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink-2); margin: -2px 0 10px; cursor: pointer; user-select: none; }
.share input { position: absolute; opacity: 0; pointer-events: none; }
.share .switch { width: 30px; height: 18px; border-radius: 999px; background: #ccd0d5; position: relative; flex: none; transition: background .15s; }
.share .switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.share.on { color: var(--green); font-weight: 600; }
.share.on .switch { background: var(--green); }
.share.on .switch::after { transform: translateX(12px); }
.share input:focus-visible + .switch { box-shadow: 0 0 0 3px rgba(8,102,255,.3); }
.badge.vis-shared { color: var(--green); font-weight: 600; }
.badge.vis-internal { opacity: .7; }
.ro { font-size: 14px; line-height: 1.45; background: #f7f8fa; border: 1px solid var(--line-soft); border-radius: 6px; padding: 8px 10px; }
.person { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line-soft); font-size: 13.5px; }
.person .btn { padding: 2px 8px; font-size: 12px; color: var(--red); }

/* ---------- smaller screens ---------- */
@media (max-width: 1180px) {
  .layout { grid-template-columns: 260px minmax(0, 1fr) 340px; }
}
@media (max-width: 960px) {
  .top { padding: 0 12px; gap: 8px; }
  .me { display: none; }
  .layout { display: block; height: auto; }
  .list { border-right: 0; min-height: calc(100dvh - 56px); }
  body.detail .list { display: none; }
  body:not(.detail) .stage, body:not(.detail) .inspector { display: none; }
  .stage { overflow: visible; }
  .stage-bar { top: 56px; padding: 10px 12px 8px; }
  .stage-body { padding: 4px 0 16px; }
  .phone { width: 100%; max-width: 430px; height: auto; max-height: none; min-height: 0; border-radius: 0; padding: 0; background: transparent; box-shadow: none; }
  .phone-screen { border-radius: 0; height: auto; }
  .phone-status, .phone-island { display: none; }
  .phone-scroll { overflow: visible; }
  .phone.full .phone-screen { height: calc(100dvh - 170px); min-height: 520px; }
  .phone.full .phone-scroll { overflow: hidden; }
  .if-top { padding-top: 14px; }
  .st-progress { top: 10px; } .st-head { top: 20px; }
  .reels .st-head { top: auto; }
  .inspector { border-left: 0; border-top: 1px solid var(--line); }
  .insp-body { overflow: visible; }
  .savebar { position: sticky; bottom: 0; z-index: 10; }
  body.detail .mobile-back { display: inline-grid; }
  .all-cell .phone { transform: none; margin-bottom: 0; }
  .filters { display: none; }
  .client-sel { max-width: 130px; }
  #as-client { display: none; }
  body.detail .brand span { display: none; }
}
