/* =========================================================================
   View styles — Gallery cards, Launch bar, Table, Generate, Insights, Modal
   ========================================================================= */

/* ---------------- GALLERY GRID ---------------- */
.gal-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(286px, 1fr)); gap: 18px;
}
.gcard {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  overflow: hidden; display: flex; flex-direction: column; transition: 160ms ease;
  position: relative;
}
.gcard:hover { border-color: var(--line-2); transform: translateY(-2px); box-shadow: 0 18px 36px -26px rgba(27,23,19,0.28); }
.gcard.sel { border-color: var(--acc); box-shadow: 0 0 0 1px var(--acc), 0 18px 40px -24px rgba(49,133,85,0.32); }
.gcard.removed { opacity: 0.5; filter: grayscale(0.5); }

.gcard-top { position: absolute; top: 11px; left: 11px; right: 11px; display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }

.launch-toggle {
  position: absolute; bottom: 11px; right: 11px;
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--sans); font-size: 13px; font-weight: 500; color: var(--t1);
  background: rgba(252,251,248,0.85); backdrop-filter: blur(8px);
  border: 1px solid var(--line-2); border-radius: 100px; padding: 6px 13px 6px 7px; cursor: pointer; transition: 130ms;
}
.launch-toggle:hover { border-color: var(--line-3); background: rgba(252,251,248,0.96); }
.launch-toggle .box { width: 17px; height: 17px; border-radius: 5px; border: 1.5px solid var(--line-3); display: grid; place-items: center; color: var(--acc-ink); transition: 120ms; }
.launch-toggle.on { background: var(--acc); color: var(--acc-ink); border-color: transparent; }
.launch-toggle.on .box { background: var(--acc-ink); color: var(--acc); border-color: transparent; }

.gcard-metric {
  position: absolute; left: 11px; bottom: 11px;
  font-family: var(--mono); font-size: 11.5px; color: var(--t1);
  background: rgba(252,251,248,0.9); backdrop-filter: blur(8px);
  border: 1px solid var(--line-2); border-radius: 8px; padding: 4px 9px;
  display: flex; gap: 6px; align-items: center;
}
.gcard-metric .sep { color: var(--t4); }
.gcard-metric .over { color: var(--bad); }
.gcard-metric .under { color: var(--ok); }

.gcard-body { padding: 14px 15px 13px; display: flex; flex-direction: column; gap: 7px; flex: 1; }
.gcard-head { font-size: 17px; font-weight: 600; line-height: 1.18; letter-spacing: -0.01em; }
.gcard-meta { font-size: 10.5px; color: var(--t3); letter-spacing: 0.01em; }
.gcard-primary {
  font-size: 12.5px; color: var(--t2); line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.gcard-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 11px; border-top: 1px solid var(--line); }
.cta-chip { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.04em; color: var(--acc); background: var(--acc-soft); border: 1px solid var(--acc-line); border-radius: 6px; padding: 3px 9px; white-space: nowrap; }
.card-actions { display: flex; gap: 4px; }
.link-btn {
  font-family: var(--sans); font-size: 12.5px; color: var(--t2); background: none; border: none;
  padding: 5px 8px; border-radius: 7px; cursor: pointer; display: inline-flex; align-items: center; gap: 5px; transition: 120ms;
}
.link-btn:hover { background: rgba(27,23,19,0.05); color: var(--t1); }
.link-btn.danger:hover { background: var(--bad-bg); color: var(--bad); }

/* ---------------- STUDIO LAYOUT B (rail + dense rows) ---------------- */
.studio { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 24px; align-items: start; }
.studio-main { min-width: 0; }

.frail { position: sticky; top: 16px; display: flex; flex-direction: column; gap: 22px; }
.frail-group { display: flex; flex-direction: column; gap: 1px; }
.frail-label { font-family: var(--mono); font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--t3); margin: 0 0 6px 9px; }
.frail-item {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  background: none; border: none; text-align: left; cursor: pointer;
  font-family: var(--sans); font-size: 13px; color: var(--t2);
  padding: 6px 9px; border-radius: 8px; transition: 110ms;
}
.frail-item:hover { background: rgba(27,23,19,0.05); color: var(--t1); }
.frail-item.on { background: var(--acc-soft); color: var(--acc); font-weight: 600; }
.frail-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.frail-n { font-family: var(--mono); font-size: 11px; color: var(--t4); flex: none; }
.frail-item.on .frail-n { color: var(--acc); }
.frail-toggle {
  margin-top: 2px; font-family: var(--sans); font-size: 12.5px; color: var(--t2);
  background: none; border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; cursor: pointer; transition: 120ms;
}
.frail-toggle:hover { border-color: var(--line-2); color: var(--t1); }
.frail-toggle.on { background: var(--acc-soft); border-color: var(--acc-line); color: var(--acc); }

.studio-bar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 12px; flex-wrap: wrap; }
.studio-count { font-size: 13px; color: var(--t3); }
.studio-count b { color: var(--acc); }

.studio-list { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow); }
.srow { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-bottom: 1px solid var(--line); position: relative; transition: 110ms; }
.srow:last-child { border-bottom: none; }
.srow:hover { background: rgba(27,23,19,0.025); }
.srow.sel { background: var(--acc-soft); box-shadow: inset 3px 0 0 var(--acc); }
.srow.removed { opacity: 0.5; filter: grayscale(0.5); }
.srow .ck { flex: none; }
.ck-spacer { width: 17px; flex: none; }

.srow-thumb { flex: none; width: 116px; border-radius: 8px; overflow: hidden; border: 1px solid var(--line-2); }
.srow-thumb .media { aspect-ratio: 16 / 10 !important; width: 100%; }
.srow-fmt {
  position: absolute; left: 7px; bottom: 7px; font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.02em;
  color: var(--t1); background: rgba(252,251,248,0.88); backdrop-filter: blur(6px);
  border: 1px solid var(--line-2); border-radius: 5px; padding: 2px 6px;
}

.srow-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.srow-head { font-size: 15px; font-weight: 600; line-height: 1.2; letter-spacing: -0.01em; }
.srow-meta { font-size: 10.5px; color: var(--t3); letter-spacing: 0.01em; }
.srow-primary { font-size: 12px; color: var(--t2); line-height: 1.4; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.srow-metric { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; font-size: 11.5px; color: var(--t1); }
.srow-metric .over { color: var(--bad); }
.srow-metric .under { color: var(--ok); }

.srow-actions { flex: none; display: flex; align-items: center; gap: 8px; }

.shell[data-density="compact"] .srow { padding: 9px 14px; gap: 11px; }
.shell[data-density="compact"] .srow-thumb { width: 92px; }
.shell[data-density="comfy"] .srow { padding: 15px 18px; }
.shell[data-density="comfy"] .srow-thumb { width: 132px; }

.srow-thumb { position: relative; }
.srow-zoom { position: absolute; top: 6px; right: 6px; width: 20px; height: 20px; border-radius: 5px; display: grid; place-items: center; color: #fff; background: rgba(27,23,19,0.55); opacity: 0; transition: 120ms; }
.srow-thumb:hover .srow-zoom { opacity: 1; }

/* ---------------- LIGHTBOX (gallery preview) ---------------- */
.lightbox {
  background: var(--panel); border: 1px solid var(--line-2); border-radius: var(--r-lg);
  box-shadow: 0 30px 80px -20px rgba(27,23,19,0.5); width: min(760px, 94vw); max-height: 92vh;
  overflow: auto; padding: 0;
}
.lb-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.lb-title { font-size: 18px; font-weight: 600; line-height: 1.2; }
.lb-head .mid { font-family: var(--mono); font-size: 11px; color: var(--t3); margin-top: 3px; }
.lb-media { display: grid; place-items: center; padding: 18px 20px; background: var(--inset); }
.lb-media img, .lb-media video { max-width: 100%; max-height: 68vh; border-radius: 10px; display: block; box-shadow: 0 10px 30px -16px rgba(27,23,19,0.4); }
.lb-noasset { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 50px 20px; color: var(--t3); text-align: center; font-size: 13px; line-height: 1.5; }
.lb-primary { padding: 14px 20px; font-size: 13.5px; color: var(--t2); line-height: 1.5; border-top: 1px solid var(--line); }
.lb-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 20px 16px; }

/* ---------------- LAUNCH BAR ---------------- */
.launchbar-wrap { position: sticky; bottom: 20px; z-index: 40; margin-top: 26px; animation: rise 220ms cubic-bezier(.2,.7,.2,1); }
.launchbar {
  background: var(--panel);
  border: 1px solid var(--line-2); border-radius: var(--r-lg);
  box-shadow: 0 26px 60px -24px rgba(27,23,19,0.3);
  padding: 14px 18px; display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
}
.lb-safety { display: flex; align-items: center; gap: 11px; padding-right: 20px; border-right: 1px solid var(--line); }
.lb-lock { width: 34px; height: 34px; flex: none; border-radius: 9px; display: grid; place-items: center; color: var(--ok); background: var(--ok-bg); border: 1px solid oklch(0.74 0.13 152 / 0.3); }
.lb-safety-t { font-size: 13px; color: var(--t1); }
.lb-safety-t b { color: var(--ok); letter-spacing: 0.04em; }
.lb-safety-s { font-size: 11.5px; color: var(--t3); }
.lb-count { font-size: 14px; color: var(--t2); }
.lb-count b { font-family: var(--serif); font-size: 22px; color: var(--t1); margin-right: 4px; }
.lb-actions { margin-left: auto; display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.lb-result { font-family: var(--mono); font-size: 12px; }
.lb-result.ok { color: var(--ok); }
.lb-result.err { color: var(--bad); }

/* ---------------- EMPTY ---------------- */
.empty { padding: 80px 20px; text-align: center; color: var(--t3); display: flex; flex-direction: column; align-items: center; gap: 14px; }

/* ---------------- ALL ADS TABLE ---------------- */
.table-wrap { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow); }
table.ads { width: 100%; border-collapse: collapse; }
.ads th { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--t3); text-align: left; font-weight: 400; padding: 14px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.ads th.num, .ads td.num { text-align: right; font-variant-numeric: tabular-nums; }
.ads td { padding: 13px 14px; border-bottom: 1px solid var(--line); font-size: 13.5px; vertical-align: middle; }
.ads tr:last-child td { border-bottom: none; }
.ads tbody tr { transition: 110ms; }
.ads tbody tr:hover { background: rgba(27,23,19,0.025); }
.ads tr.rsel { background: var(--acc-soft); }
.ads .adid { font-family: var(--mono); font-size: 12.5px; color: var(--t2); }
.ads .model-cell { color: var(--t1); font-weight: 500; }
.ads .angle-cell { color: var(--t3); font-size: 12px; margin-top: 2px; }
.ads .num.cpa-over { color: var(--bad); }
.ads .num.cpa-under { color: var(--ok); }
.ck { width: 17px; height: 17px; border-radius: 5px; border: 1.5px solid var(--line-3); background: var(--inset); display: grid; place-items: center; cursor: pointer; color: var(--acc-ink); transition: 120ms; }
.ck.on { background: var(--acc); border-color: transparent; }
.ico-btn { width: 28px; height: 28px; border-radius: 7px; border: 1px solid var(--line); background: var(--panel-2); color: var(--t2); display: grid; place-items: center; cursor: pointer; transition: 120ms; }
.ico-btn:hover { color: var(--t1); border-color: var(--line-2); }
.ico-btn.danger:hover { color: var(--bad); border-color: var(--bad); background: var(--bad-bg); }
.tbl-actions { display: flex; gap: 6px; justify-content: flex-end; }

/* ---------------- GENERATE ---------------- */
.gen-grid { display: grid; grid-template-columns: 380px 1fr; gap: 22px; align-items: start; }
.gen-form { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 22px; box-shadow: var(--shadow); }
.gen-form h3 { font-family: var(--serif); font-size: 22px; font-weight: 600; margin: 0 0 4px; }
.gen-form .sub { color: var(--t3); font-size: 13px; margin-bottom: 20px; }
.gen-form .sub b { color: var(--acc); font-family: var(--mono); font-weight: 400; }
.field { margin-bottom: 15px; }
.prompt-preview {
  background: linear-gradient(180deg, oklch(0.74 0.13 152 / 0.06), transparent), var(--inset);
  border: 1px solid oklch(0.74 0.13 152 / 0.28); border-radius: var(--r); padding: 18px 20px;
}
.pp-label { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ok); margin-bottom: 11px; }
.pp-body { font-family: var(--mono); font-size: 13px; line-height: 1.65; color: var(--t1); }
.pp-body .hl { color: var(--acc); }
.how-box { margin-top: 16px; background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 18px; font-size: 13px; color: var(--t2); line-height: 1.6; }
.how-box b { color: var(--t1); font-weight: 600; }
.how-box .cmd { font-family: var(--mono); color: var(--acc); font-size: 12px; }
.queue-box { margin-top: 16px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px 20px; box-shadow: var(--shadow); }
.queue-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.queue-head h4 { font-family: var(--serif); font-size: 19px; font-weight: 600; margin: 0; display: flex; align-items: center; gap: 10px; }
.qpill { font-family: var(--mono); font-size: 11px; color: var(--acc); background: var(--acc-soft); border-radius: 7px; padding: 2px 9px; }
.qrow { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 14px; background: var(--inset); border: 1px solid var(--line); border-radius: var(--r-sm); margin-bottom: 8px; }
.qrow-id { font-family: var(--mono); font-size: 13px; color: var(--t1); }
.qrow-meta { font-size: 11.5px; color: var(--t3); margin-top: 3px; }
.qrow-scene { font-size: 12px; color: var(--t2); margin-top: 3px; }

/* ---------------- LEADS ---------------- */
.leads-cards { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; margin-bottom: 18px; }
.lead-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 13px 15px; box-shadow: var(--shadow); border-top: 3px solid var(--line-3); }
.lead-card.accent { border-top-color: var(--ok); }
.lead-card.fb { border-top-color: #2E6FB0; }
.lead-card.gg { border-top-color: var(--gold, #B07A1E); }
.lead-card.gg-org { border-top-color: #318555; }
.lc-label { font: 10px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--t3); }
.lc-val { font-family: var(--serif); font-size: 28px; color: var(--t1); margin-top: 5px; line-height: 1; }
.lead-card.accent .lc-val { color: var(--ok); }
.lc-foot { font-size: 11px; color: var(--t3); margin-top: 5px; }

/* insight panels */
.leads-insights { display: grid; grid-template-columns: repeat(auto-fit, minmax(232px, 1fr)); gap: 12px; margin-bottom: 22px; }
.li-panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 13px 14px; box-shadow: var(--shadow); }
.li-title { font: 11px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--t3); margin-bottom: 9px; }
.li-tbl { width: 100%; border-collapse: collapse; font: 12.5px var(--sans); }
.li-tbl th { text-align: left; font: 10px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--t4); font-weight: 400; padding: 0 6px 6px 0; }
.li-tbl th.num, .li-tbl td.num { text-align: right; padding-right: 0; font-variant-numeric: tabular-nums; }
.li-tbl td { padding: 4px 6px 4px 0; color: var(--t2); border-top: 1px solid var(--line); }
.li-tbl tbody tr:first-child td { border-top: none; }

.trend { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; height: 92px; padding-top: 6px; }
.trend-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; }
.trend-bars { display: flex; flex-direction: column-reverse; align-items: center; justify-content: flex-end; height: 72px; width: 22px; }
.trend-bar { width: 22px; border-radius: 2px; min-height: 0; }
.trend-bar.gg { background: var(--gold, #B07A1E); }
.trend-bar.fb { background: #2E6FB0; border-radius: 2px 2px 0 0; }
.trend-n { font: 11px var(--mono); color: var(--t2); }
.trend-lab { font: 9.5px var(--mono); color: var(--t4); }
.trend-legend { display: flex; gap: 14px; margin-top: 8px; font: 11px var(--sans); color: var(--t3); }
.trend-legend i { font-style: normal; display: inline-flex; align-items: center; gap: 5px; }
.trend-legend .sw { width: 9px; height: 9px; border-radius: 2px; }
.trend-legend .sw.gg { background: var(--gold, #B07A1E); }
.trend-legend .sw.fb { background: #2E6FB0; }

.call-tag.book { color: var(--ok); background: var(--ok-bg); border-color: oklch(0.74 0.13 152 / 0.3); }
.stale-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--warn); margin-left: 7px; vertical-align: middle; }

.leads-filters { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.lead-search { max-width: 260px; height: 34px; font-size: 13px; }
.lead-count { font-size: 12.5px; color: var(--t3); margin-bottom: 10px; }

.leads-tbl td { vertical-align: middle; }
.lead-name { font-weight: 600; color: var(--t1); font-size: 13.5px; display: flex; align-items: center; gap: 7px; }
.lead-name-btn { cursor: pointer; width: fit-content; }
.lead-name-btn:hover { color: var(--acc); text-decoration: underline; }
.funnel-row { cursor: pointer; transition: 110ms; }
.funnel-row:hover { background: var(--acc-soft); }
.funnel-row:hover b { color: var(--acc); }

/* per-lead funnel timeline */
.lead-funnel { display: flex; flex-direction: column; }
.lf-step { display: flex; align-items: center; gap: 12px; padding: 9px 2px; position: relative; }
.lf-step:not(:last-child)::after { content: ""; position: absolute; left: 9px; top: 28px; bottom: -9px; width: 2px; background: var(--line-2); }
.lf-step.on:not(:last-child)::after { background: var(--ok); }
.lf-dot { width: 20px; height: 20px; flex: none; border-radius: 50%; border: 2px solid var(--line-3); background: var(--panel); display: grid; place-items: center; color: #fff; z-index: 1; }
.lf-step.on .lf-dot { background: var(--ok); border-color: var(--ok); }
.lf-label { flex: 1; font-size: 13.5px; color: var(--t3); }
.lf-step.on .lf-label { color: var(--t1); font-weight: 600; }
.lf-date { font: 11.5px var(--mono); color: var(--t3); }
.lf-step.on .lf-date { color: var(--ok); }
.lead-contact { font-size: 11.5px; color: var(--t3); margin-top: 2px; }
.lead-link { color: var(--t2); text-decoration: none; }
.lead-link:hover { color: var(--acc); text-decoration: underline; }
.lead-muted { color: var(--t3); }
.lead-detail { color: var(--t2); font-size: 12.5px; }
.call-tag { font: 9.5px var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--t3); background: var(--inset); border: 1px solid var(--line-2); border-radius: 5px; padding: 1px 6px; }

.plat-chip { font: 11px var(--sans); font-weight: 600; border-radius: 6px; padding: 3px 9px; white-space: nowrap; }
.plat-chip.facebook { color: #2E6FB0; background: rgba(46,111,176,0.1); border: 1px solid rgba(46,111,176,0.25); }
.plat-chip.google { color: #B07A1E; background: rgba(176,122,30,0.1); border: 1px solid rgba(176,122,30,0.25); }
.plat-chip.google-organic { color: #318555; background: rgba(49,133,85,0.1); border: 1px solid rgba(49,133,85,0.25); }
.plat-chip.other { color: var(--t2); background: rgba(0,0,0,0.05); border: 1px solid var(--line); }

.hs-btn { display: inline-flex; align-items: center; gap: 5px; font: 12px var(--sans); font-weight: 500; color: var(--acc); background: var(--acc-soft); border: 1px solid var(--acc-line); border-radius: 7px; padding: 5px 10px; text-decoration: none; white-space: nowrap; transition: 120ms; }
.hs-btn:hover { background: var(--acc); color: var(--acc-ink); border-color: transparent; }

.lead-note { margin-top: 14px; font-size: 11.5px; color: var(--t3); line-height: 1.55; max-width: 880px; }

@media (max-width: 1180px) { .leads-cards { grid-template-columns: repeat(4, 1fr); } .leads-insights { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 860px) { .leads-cards { grid-template-columns: repeat(2, 1fr); } .leads-insights { grid-template-columns: 1fr; } .leads-tbl { min-width: 1180px; } }

/* ---------------- CREATIVE STUDIO ---------------- */
.studio-drop { display: grid; place-items: center; min-height: 130px; border: 1.5px dashed var(--line-3); border-radius: var(--r); background: var(--inset); cursor: pointer; overflow: hidden; transition: 120ms; color: var(--t3); font-size: 13px; }
.studio-drop:hover { border-color: var(--acc); color: var(--acc); }
.studio-drop img, .studio-drop video { width: 100%; max-height: 220px; object-fit: cover; display: block; }
.studio-refname { font-size: 11.5px; color: var(--t3); margin-top: 6px; }

.studio-result { display: flex; gap: 13px; padding: 12px 0; border-top: 1px solid var(--line); }
.studio-result:first-child { border-top: none; }
.studio-media { flex: none; width: 120px; border-radius: 9px; overflow: hidden; border: 1px solid var(--line-2); background: var(--inset); }
.studio-media img, .studio-media video { width: 100%; display: block; aspect-ratio: 9/16; object-fit: cover; }
.studio-pending { display: grid; place-items: center; aspect-ratio: 9/16; font: 11px var(--mono); color: var(--t3); }
.studio-result-body { flex: 1; min-width: 0; }
.studio-result-meta { font-size: 10.5px; color: var(--t3); display: flex; align-items: center; gap: 8px; }
.studio-approved { color: var(--ok); font-weight: 600; }
.studio-result-brief { font-size: 13px; color: var(--t1); margin: 5px 0 6px; line-height: 1.4; }
.studio-result-note { font-size: 12px; color: var(--t2); font-style: italic; margin-bottom: 6px; }
.studio-actions { display: flex; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.studio-fb { display: flex; gap: 8px; align-items: center; }
.studio-fb .input { height: 32px; font-size: 12.5px; flex: 1; }

/* ---------------- INSIGHTS ---------------- */
.rec-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 16px; }
.rec {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 19px;
  border-left: 3px solid var(--slate); transition: 140ms;
}
.rec:hover { border-color: var(--line-2); transform: translateY(-2px); }
.rec.scale   { border-left-color: var(--ok); }
.rec.refresh { border-left-color: var(--warn); }
.rec.pause   { border-left-color: var(--bad); }
.rec.insight { border-left-color: var(--info); }
.rec-tag { display: inline-flex; align-items: center; gap: 7px; font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase; margin-bottom: 11px; }
.rec.scale .rec-tag { color: var(--ok); }
.rec.refresh .rec-tag { color: var(--warn); }
.rec.pause .rec-tag { color: var(--bad); }
.rec.insight .rec-tag { color: var(--info); }
.rec-tag .bd { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.rec-title { font-size: 15.5px; font-weight: 600; line-height: 1.3; margin-bottom: 7px; }
.rec-body { font-size: 13px; color: var(--t2); line-height: 1.5; }
.rec-body b { color: var(--t1); }
.rec-foot { margin-top: 12px; font-family: var(--mono); font-size: 11px; color: var(--t3); display: flex; gap: 10px; flex-wrap: wrap; }

.charts { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; margin-bottom: 22px; }
.chart-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px 22px; box-shadow: var(--shadow); }
.chart-head { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; margin-bottom: 16px; }
.chart-head h4 { font-family: var(--serif); font-size: 18px; font-weight: 600; margin: 0; white-space: nowrap; }
.chart-head .legend { font-size: 11.5px; color: var(--t3); display: flex; gap: 14px; white-space: nowrap; }
.chart-head .legend i { font-style: normal; display: inline-flex; align-items: center; gap: 5px; }
.chart-head .legend .sw { width: 9px; height: 9px; border-radius: 2px; display: inline-block; }
.section-h { font-family: var(--serif); font-size: 21px; font-weight: 600; margin: 6px 0 16px; letter-spacing: -0.01em; }
.insight-empty { text-align: center; padding: 30px; }

/* ---------------- MODAL ---------------- */
.modal-head { padding: 20px 24px; border-bottom: 1px solid var(--line); display: flex; align-items: flex-start; justify-content: space-between; }
.modal-head h3 { font-family: var(--serif); font-size: 21px; font-weight: 600; margin: 0; }
.modal-head .mid { font-family: var(--mono); font-size: 12px; color: var(--t3); margin-top: 3px; }
.modal-body { padding: 22px 24px; display: flex; flex-direction: column; gap: 16px; }
.modal-foot { padding: 16px 24px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 12px; }

/* ---------------- DENSITY + TWEAKS ---------------- */
.shell[data-density="compact"] .gal-grid { gap: 12px; grid-template-columns: repeat(auto-fill, minmax(258px, 1fr)); }
.shell[data-density="compact"] .gcard-body { padding: 11px 12px 10px; gap: 5px; }
.shell[data-density="compact"] .kpis { gap: 9px; }
.shell[data-density="comfy"] .gal-grid { gap: 26px; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); }
.shell[data-density="comfy"] .gcard-body { padding: 18px 19px 16px; gap: 9px; }
.shell[data-hide-metrics="1"] .gcard-metric { display: none; }

/* ---------------- RESPONSIVE ---------------- */
@media (max-width: 1180px) {
  .kpis { grid-template-columns: repeat(3, 1fr); }
  .gen-grid { grid-template-columns: 1fr; }
  .charts { grid-template-columns: 1fr; }
}
@media (max-width: 920px) {
  .studio { grid-template-columns: 1fr; }
  .frail { position: static; flex-direction: row; flex-wrap: wrap; gap: 10px 18px; padding-bottom: 4px; }
  .frail-group { flex: 1 1 150px; }
  .srow-metric { display: none; }
  .srow-primary { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
}
@media (max-width: 860px) {
  .shell { padding: 18px 16px 110px; }
  .topbar { flex-direction: column; gap: 16px; }
  .topbar-right { align-items: flex-start; text-align: left; }
  .meta-of-meta { text-align: left; }
  .platforms { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .h-title { font-size: 30px; }
  .tabs { overflow-x: auto; }
  .table-wrap { overflow-x: auto; }
  table.ads { min-width: 760px; }
  .launchbar { flex-direction: column; align-items: stretch; }
  .lb-safety { border-right: none; border-bottom: 1px solid var(--line); padding-right: 0; padding-bottom: 12px; }
  .lb-actions { margin-left: 0; }
}

/* Google recommendations: stack the Finding/Change/Impact columns on narrow screens */
@media (max-width: 900px) { .rec-grid { grid-template-columns: 1fr !important; } }
