/* EnAds - mobile first: bottom tab bar on phones, side rail on wide screens (same design as EnCRM, orange). */
:root {
  --bg: #f5f6fa; --card: #fff; --ink: #1d2030; --muted: #6b7083; --line: #e6e8ef; --accent: #ea580c; --accent-soft: #fff1e6;
  --good: #15803d; --good-soft: #e7f6ec; --warn: #b45309; --warn-soft: #fff4e0; --bad: #b91c1c; --bad-soft: #fdecec;
  --radius: 14px; --nav-h: 62px; --safe-b: env(safe-area-inset-bottom, 0px);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-size: 15px; -webkit-tap-highlight-color: transparent; }
a { color: var(--accent); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
h1 { font-size: 20px; margin: 0; } h2 { font-size: 16px; margin: 0 0 10px; } h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 18px 0 8px; }
.muted { color: var(--muted); } .small { font-size: 13px; } .mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; }
.num { text-align: right; font-variant-numeric: tabular-nums; } .nowrap { white-space: nowrap; }
.hidden { display: none !important; }

/* layout */
.shell { min-height: 100vh; padding-bottom: calc(var(--nav-h) + var(--safe-b) + 12px); }
.top { position: sticky; top: 0; z-index: 20; background: var(--bg); padding: 12px 16px 8px; display: flex; align-items: center; gap: 10px; }
.top .title { flex: 1; min-width: 0; } .top .title .sub { font-size: 12px; color: var(--muted); }
.top-acts { display: flex; gap: 8px; }
/* Phones: the buttons go on their own row under the greeting, so the name is not squeezed. */
@media (max-width: 600px) { .top { flex-wrap: wrap; } .top-acts { order: 3; flex-basis: 100%; } .top-acts .btn { flex: 1; justify-content: center; } }
.page { padding: 0 16px 16px; }
.nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; height: calc(var(--nav-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  background: #fff; border-top: 1px solid var(--line); display: flex; }
.nav a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--muted); font-size: 11px; font-weight: 600; position: relative; }
.nav a svg { width: 24px; height: 24px; }
.nav a.on { color: var(--accent); }
.nav a .dot { position: absolute; top: 8px; left: 50%; margin-left: 6px; min-width: 16px; height: 16px; border-radius: 8px; background: var(--bad); color: #fff; font-size: 10px; line-height: 16px; text-align: center; padding: 0 4px; }
@media (min-width: 900px) {
  .shell { padding-bottom: 20px; padding-left: 92px; }
  .nav { top: 0; bottom: 0; right: auto; width: 84px; height: auto; flex-direction: column; justify-content: flex-start; padding-top: 14px; border-top: 0; border-right: 1px solid var(--line); }
  .nav a { flex: 0 0 72px; }
  .page, .top { padding-left: 20px; padding-right: 20px; }
  .nav-bg, .nav-bub, .top-more { display: none !important; }
}
/* Phones: a floating white bar; the open tab's icon rises into a round bubble sitting in a notch cut into the bar.
   More is at the top right (next to the bell) instead of in the bar. */
@media (max-width: 899px) {
  .shell { padding-bottom: calc(var(--nav-h) + var(--safe-b) + 34px); }
  .nav { background: transparent; border-top: 0; height: calc(64px + var(--safe-b)); filter: drop-shadow(0 -3px 10px rgba(30,30,80,.10)); }
  .nav-bg { position: absolute; inset: 0; background: #fff; border-radius: 24px 24px 0 0;
    -webkit-mask-image: radial-gradient(circle 35px at 50% 4px, transparent 33px, #000 34.5px); mask-image: radial-gradient(circle 35px at 50% 4px, transparent 33px, #000 34.5px);
    -webkit-mask-size: 400% 100%; mask-size: 400% 100%; -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
    transition: -webkit-mask-position .4s cubic-bezier(.45,1.35,.5,1), mask-position .4s cubic-bezier(.45,1.35,.5,1); }
  .nav-bub { position: absolute; left: 0; top: -22px; width: 52px; height: 52px; border-radius: 50%; background: #fff; pointer-events: none;
    box-shadow: 0 6px 16px rgba(30,30,80,.16); transition: left .4s cubic-bezier(.45,1.35,.5,1); }
  .nav.still .nav-bg, .nav.still .nav-bub { transition: none; }
  .nav.no-bub .nav-bub { display: none; }
  .nav.no-bub .nav-bg { -webkit-mask-image: none; mask-image: none; }
  .nav a { z-index: 1; justify-content: flex-end; gap: 6px; padding-bottom: 10px; }
  .nav a .ni { display: flex; color: #a3a8ba; transition: transform .35s cubic-bezier(.45,1.35,.5,1), color .2s; }
  .nav a .nl { font-size: 11px; font-weight: 500; color: #a3a8ba; }
  .nav a.on .ni { transform: translateY(-17px); color: var(--accent); } /* rises once, on the tap; a redrawn bar shows it already up */
  .nav a.on .nl { color: var(--accent); font-weight: 700; font-size: 12px; }
  .nav a.on .dot { display: none; }
  .nav-more { display: none !important; }
  .fab { bottom: calc(var(--nav-h) + var(--safe-b) + 44px); }
  .actionbar { padding-bottom: 32px; }
  .top-more.on { background: var(--accent-soft); color: var(--accent); }
}

/* pieces */
.card { background: var(--card); border-radius: var(--radius); padding: 14px; box-shadow: 0 1px 2px rgba(20,24,40,.05); margin-bottom: 12px; }
.card.flush { padding: 0; overflow: hidden; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid4 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 700px) { .grid4 { grid-template-columns: repeat(4, 1fr); } }
.stat { background: var(--card); border-radius: var(--radius); padding: 12px 14px; box-shadow: 0 1px 2px rgba(20,24,40,.05); }
.stat .lbl { font-size: 12px; color: var(--muted); font-weight: 600; } .stat .val { font-size: 21px; font-weight: 700; margin-top: 2px; font-variant-numeric: tabular-nums; } .stat .hint { font-size: 12px; color: var(--muted); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 9px 14px; font-weight: 600; cursor: pointer; min-height: 40px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.good { background: var(--good); border-color: var(--good); color: #fff; } .btn.bad { background: #fff; border-color: #f2c4c4; color: var(--bad); }
.btn.sm { min-height: 32px; padding: 5px 10px; font-size: 13px; border-radius: 8px; }
.btn.block { width: 100%; }
/* Icons inside buttons (Call, WhatsApp…) stay icon-sized; button links are not underlined. */
.btn svg { width: 18px; height: 18px; flex: none; }
.btn.sm svg { width: 16px; height: 16px; }
a.btn { text-decoration: none; color: inherit; } a.btn.primary, a.btn.good { color: #fff; }
.btn:disabled { opacity: .55; }
.icon-btn { width: 40px; height: 40px; border-radius: 12px; border: 0; background: #fff; display: inline-flex; align-items: center; justify-content: center; position: relative; box-shadow: 0 1px 2px rgba(20,24,40,.06); cursor: pointer; }
.icon-btn svg { width: 22px; height: 22px; }
.icon-btn .dot { position: absolute; top: 4px; right: 4px; min-width: 16px; height: 16px; border-radius: 8px; background: var(--bad); color: #fff; font-size: 10px; line-height: 16px; padding: 0 4px; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; background: #eef0f5; color: #4b5064; white-space: nowrap; }
.b-good { background: var(--good-soft); color: var(--good); } .b-warn { background: var(--warn-soft); color: var(--warn); } .b-bad { background: var(--bad-soft); color: var(--bad); } .b-acc { background: var(--accent-soft); color: var(--accent); }
.alert { padding: 10px 12px; border-radius: 10px; margin-bottom: 12px; font-size: 14px; }
.alert.warn { background: var(--warn-soft); color: #7a3e06; } .alert.bad { background: var(--bad-soft); color: var(--bad); } .alert.info { background: var(--accent-soft); color: #9a3412; }
.empty { padding: 28px 16px; text-align: center; color: var(--muted); }

/* forms */
.f { display: block; margin-bottom: 12px; }
.f > span { display: block; font-size: 13px; font-weight: 600; color: #464a5c; margin-bottom: 5px; }
.f input, .f select, .f textarea, .search { width: 100%; border: 1px solid #d7dae4; border-radius: 10px; padding: 10px 12px; background: #fff; min-height: 44px; outline: none; }
.f textarea { min-height: 80px; resize: vertical; }
.f input:focus, .f select:focus, .f textarea:focus, .search:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.hint-text { font-size: 12px; color: var(--muted); margin-top: 4px; }
.check { display: flex; align-items: center; gap: 8px; margin: 6px 0 12px; font-weight: 600; font-size: 14px; }
.check input { width: 20px; height: 20px; }
.seg { display: flex; background: #e9ebf2; border-radius: 10px; padding: 3px; gap: 3px; }
.seg button { flex: 1; border: 0; background: transparent; border-radius: 8px; padding: 7px 6px; font-weight: 600; font-size: 13px; color: var(--muted); cursor: pointer; }
.seg button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(20,24,40,.1); }
.req { color: var(--bad); }

/* chips */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 10px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: 0 0 auto; border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 6px 12px; font-size: 13px; font-weight: 600; color: #464a5c; cursor: pointer; white-space: nowrap; }
.chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.chip .n { opacity: .65; margin-left: 4px; font-weight: 500; }

/* lists */
.item { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line); background: #fff; cursor: pointer; }
.item:last-child { border-bottom: 0; }
.item .main { flex: 1; min-width: 0; }
.item .t1 { font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .t2 { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.item .side { text-align: right; flex: 0 0 auto; }
.item .amt { font-weight: 700; font-variant-numeric: tabular-nums; }
.item.off { opacity: .5; } .item.off .amt { text-decoration: line-through; }
.qa { display: flex; gap: 6px; }
.qa a { width: 38px; height: 38px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; }
.qa a svg { width: 20px; height: 20px; }
.qa .call { background: var(--accent-soft); color: var(--accent); } .qa .wa { background: #e5f8ec; color: #128c4a; }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: flex; align-items: center; justify-content: center; font-weight: 700; flex: 0 0 auto; }

/* status colours */
.st-New { background: #e0ecff; color: #1d4ed8; } .st-Contact-Attempted { background: #fff4e0; color: #b45309; } .st-Contacted { background: #e6f4ff; color: #0369a1; }
.st-Qualified { background: #f0e8ff; color: #6d28d9; } .st-Follow-Up { background: #fff1d6; color: #a16207; } .st-Converted { background: var(--good-soft); color: var(--good); }
.st-Bad-Fit, .st-Not-Interested { background: #eef0f5; color: #6b7083; }

/* timeline */
.tl { list-style: none; margin: 0; padding: 0; }
.tl li { position: relative; padding: 0 0 14px 18px; border-left: 2px solid var(--line); margin-left: 6px; }
.tl li::before { content: ""; position: absolute; left: -6px; top: 4px; width: 10px; height: 10px; border-radius: 50%; background: #c7cbe0; }
.tl li.status::before { background: var(--accent); } .tl li.whatsapp_in::before, .tl li.whatsapp::before { background: #25d366; }
.tl .when { font-size: 12px; color: var(--muted); }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 8px 14px; margin: 0; font-size: 14px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; word-break: break-word; }

/* floating + action bars */
.fab { position: fixed; right: 18px; bottom: calc(var(--nav-h) + var(--safe-b) + 16px); z-index: 25; width: 56px; height: 56px; border-radius: 18px; border: 0; background: var(--accent); color: #fff;
  box-shadow: 0 6px 18px rgba(234,88,12,.35); display: flex; align-items: center; justify-content: center; cursor: pointer; }
.fab svg { width: 28px; height: 28px; }
.actionbar { position: fixed; left: 0; right: 0; bottom: calc(var(--nav-h) + var(--safe-b)); z-index: 25; display: flex; gap: 8px; padding: 10px 12px; background: rgba(245,246,250,.96); border-top: 1px solid var(--line); }
.actionbar .btn { flex: 1; }
.has-actionbar { padding-bottom: 70px; }
@media (min-width: 900px) { .fab { bottom: 24px; } .actionbar { left: 84px; bottom: 0; } }

/* sheets (full-screen on phones, centred panel on wide screens) */
.sheet-bg { position: fixed; inset: 0; z-index: 50; background: rgba(15,18,30,.45); display: flex; align-items: flex-end; justify-content: center; }
.sheet { background: var(--bg); width: 100%; max-width: 640px; max-height: 94vh; border-radius: 18px 18px 0 0; display: flex; flex-direction: column; animation: up .18s ease-out; }
.sheet-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); background: #fff; border-radius: 18px 18px 0 0; }
.sheet-head h2 { flex: 1; margin: 0; }
.sheet-body { overflow-y: auto; padding: 16px; padding-bottom: calc(16px + var(--safe-b)); }
@media (min-width: 700px) { .sheet-bg { align-items: center; } .sheet { border-radius: 18px; } }
@keyframes up { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }

/* duty switch */
.duty { display: inline-flex; align-items: center; gap: 8px; border: 0; border-radius: 999px; padding: 6px 12px 6px 6px; font-weight: 700; font-size: 13px; cursor: pointer; background: #e9ebf2; color: #555b70; }
.duty .knob { width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.duty.on { background: var(--good); color: #fff; }

/* auth */
.auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.auth .card { width: 100%; max-width: 380px; padding: 24px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 18px; margin-bottom: 18px; }
.brand img { width: 36px; height: 36px; }

#toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--nav-h) + var(--safe-b) + 80px); z-index: 80; display: flex; flex-direction: column; gap: 8px; width: min(92vw, 420px); pointer-events: none; }
#toast div { background: var(--ink); color: #fff; padding: 11px 14px; border-radius: 12px; font-size: 14px; box-shadow: 0 6px 18px rgba(0,0,0,.2); pointer-events: auto; }
#toast div.err { background: var(--bad); }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.t td { padding: 9px 10px; border-bottom: 1px solid var(--line); }
.tbl-wrap { overflow-x: auto; }
.shot { max-width: 100%; border-radius: 10px; border: 1px solid var(--line); }
.sug { border: 1px solid var(--line); border-radius: 10px; background: #fff; margin-top: -8px; margin-bottom: 12px; max-height: 220px; overflow-y: auto; }
.sug div { padding: 10px 12px; border-bottom: 1px solid var(--line); cursor: pointer; } .sug div:last-child { border-bottom: 0; }
.picked { display: flex; align-items: center; justify-content: space-between; gap: 8px; background: var(--accent-soft); border-radius: 10px; padding: 10px 12px; margin-bottom: 12px; }
/* Plans: one row, left to right, scrolled sideways (swipe on phones). */
.plans { display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x proximity; padding: 2px 2px 8px; margin: 0 -2px; -webkit-overflow-scrolling: touch; }
.plan { flex: 0 0 152px; scroll-snap-align: start; border: 1.5px solid var(--line); background: #fff; border-radius: 12px; padding: 10px 12px; text-align: left; cursor: pointer; display: flex; flex-direction: column; gap: 3px; min-height: 64px; }
.plan b { font-size: 15px; } .plan span { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.plan small { font-size: 12px; color: #4b5064; line-height: 1.35; margin-top: 2px; white-space: pre-line; }
.plan.on { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 2px var(--accent-soft); } .plan.on span { color: var(--accent); }
pre.code { background: #f0f1f6; padding: 10px; border-radius: 8px; white-space: pre-wrap; word-break: break-all; font-size: 13px; }


/* ---------- EnAds ---------- */
.stats4 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 12px; }
@media (min-width: 700px) { .stats4 { grid-template-columns: repeat(4, 1fr); } }
.stat.link { cursor: pointer; } .stat.link:hover { box-shadow: 0 0 0 2px var(--accent-soft); }
.stat .val.warn { color: var(--warn); } .stat .val.acc { color: var(--accent); }
/* Breakdown boxes (by ad account / salesperson / plan): side by side, scrolled sideways on phones. */
.bk { display: flex; gap: 10px; overflow-x: auto; padding: 2px 2px 10px; margin: 0 -2px 4px; scrollbar-width: thin; }
.bk .box { flex: 1 0 170px; background: var(--card); border-radius: var(--radius); box-shadow: 0 1px 2px rgba(20,24,40,.05); padding: 10px 12px; max-height: 210px; overflow-y: auto; }
.bk .box h4 { margin: 0 0 6px; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.bk .box button { display: flex; width: 100%; justify-content: space-between; gap: 8px; border: 0; background: none; padding: 5px 0; border-bottom: 1px solid var(--line); font-size: 14px; cursor: pointer; text-align: left; }
.bk .box button:last-child { border-bottom: 0; } .bk .box button b { font-variant-numeric: tabular-nums; }
.bk .box button.on { color: var(--accent); font-weight: 700; }
/* Request queue */
.queue { display: flex; gap: 10px; overflow-x: auto; padding: 2px 2px 10px; margin: 0 -2px 4px; }
.qcard { flex: 0 0 220px; background: #fff; border-radius: var(--radius); padding: 10px 12px; box-shadow: 0 1px 2px rgba(20,24,40,.06); border-top: 4px solid var(--warn); cursor: pointer; color: inherit; }
.qcard.working { border-top-color: #2563eb; }
.qcard .who { display: flex; justify-content: space-between; gap: 6px; font-size: 12px; font-weight: 700; color: var(--muted); }
.qcard .nm { font-weight: 700; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qcard .sm { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.spin { display: inline-block; width: 10px; height: 10px; border: 2px solid #93c5fd; border-top-color: #2563eb; border-radius: 50%; animation: rot 1s linear infinite; vertical-align: -1px; margin-right: 4px; }
@keyframes rot { to { transform: rotate(360deg); } }
/* Ad cards */
/* Ad cards: at most 435px wide; as many columns as fit (one full-width card on phones). */
.ads { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 435px)); gap: 10px; }
.ad { background: #fff; border-radius: var(--radius); box-shadow: 0 1px 2px rgba(20,24,40,.06); padding: 12px 14px; cursor: pointer; color: inherit; display: block; border-left: 5px solid var(--good); position: relative; }
.ad.scheduled { border-left-color: #2563eb; } .ad.ending { border-left-color: var(--warn); } .ad.ended, .ad.stopped { border-left-color: #c3c7d4; }
.ad .top1 { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.ad .cn { font-weight: 750; font-size: 16px; line-height: 1.25; }
.ad .an { font-size: 13px; color: var(--muted); margin-top: 1px; }
.ad .tag { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; padding: 3px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); white-space: nowrap; }
.ad .dates { font-size: 13px; color: #4b5064; margin: 8px 0; display: flex; flex-direction: column; gap: 2px; }
.ad .dates span { color: var(--muted); }
.ad .bot { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; }
.ad .meta { font-size: 12px; color: var(--muted); text-align: right; line-height: 1.5; }
.ad .meta b { display: inline-block; font-size: 15px; font-weight: 600; color: #1d4ed8; background: #e3ecff; border-radius: 8px; padding: 2px 9px; margin-bottom: 3px; }
.ad .res { font-size: 12px; margin-top: 8px; color: #4b5064; display: flex; gap: 12px; flex-wrap: wrap; }
.ad .res b { font-variant-numeric: tabular-nums; }
.cd { display: flex; gap: 5px; }
.cd div { background: #f2f3f7; border-radius: 8px; padding: 4px 7px; text-align: center; min-width: 44px; }
.cd b { display: block; font-size: 17px; font-variant-numeric: tabular-nums; line-height: 1.1; }
.cd small { display: block; font-size: 10px; line-height: 1.1; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.cd.ending div { background: var(--warn-soft); } .cd.ending b { color: var(--warn); }
.cd.late div { background: #eef0f5; } .cd.late b { color: var(--muted); font-size: 14px; }
.filters { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px; }
@media (min-width: 900px) { .filters { grid-template-columns: repeat(5, 1fr); } }
.filters select, .filters input { width: 100%; border: 1px solid #d7dae4; border-radius: 10px; padding: 8px 10px; background: #fff; min-height: 40px; font-size: 14px; }
/* Results */
.rgrid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 8px; }
@media (min-width: 700px) { .rgrid { grid-template-columns: repeat(3, 1fr); } }
/* Media */
.mgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
.mg { position: relative; aspect-ratio: 1 / 1; border-radius: 10px; overflow: hidden; background: #e9ebf2; border: 2px solid transparent; cursor: pointer; padding: 0; }
.mg img, .mg video { width: 100%; height: 100%; object-fit: cover; display: block; }
.mg .ic { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); padding: 6px; text-align: center; word-break: break-all; }
.mg .play { position: absolute; left: 6px; bottom: 6px; background: rgba(0,0,0,.6); color: #fff; border-radius: 6px; font-size: 11px; padding: 1px 6px; }
.mg.sel { border-color: var(--accent); }
.mg.sel::after { content: "✓"; position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 13px; line-height: 22px; text-align: center; font-weight: 800; }
.viewer { max-width: 100%; max-height: 70vh; display: block; margin: 0 auto 12px; border-radius: 10px; }
.drop { border: 2px dashed #d7dae4; border-radius: 12px; padding: 16px; text-align: center; color: var(--muted); margin-bottom: 12px; cursor: pointer; background: #fff; }
.drop.over { border-color: var(--accent); background: var(--accent-soft); }
.upl { font-size: 13px; margin: -4px 0 10px; }
.upl div { display: flex; justify-content: space-between; gap: 8px; padding: 3px 0; }
/* Files picked for a task comment: preview tiles before Send (like WhatsApp). */
.attrow { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 8px; }
.attrow:empty { display: none; }
.attrow .att { position: relative; display: block; width: 76px; height: 76px; padding: 0; border-radius: 10px; overflow: hidden; background: #eef0f5; border: 1px solid var(--line); }
.att img, .att video { width: 100%; height: 100%; object-fit: cover; display: block; }
.att > span:last-child { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; font-size: 13px; background: rgba(0,0,0,.4); }
.att:not(.busy):not(.att-fail) > span:last-child { display: none; }
.att.att-fail > span:last-child { background: rgba(185,28,28,.55); }
.att .att-k { position: absolute; left: 6px; bottom: 4px; color: #fff; font-size: 12px; text-shadow: 0 1px 3px rgba(0,0,0,.6); }
.attrow .att .att-doc { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 4px; font-size: 22px; color: var(--muted); }
.att-doc svg { width: 26px; height: 26px; } .att-doc small { font-size: 10px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att-x { position: absolute; top: 3px; right: 3px; z-index: 2; width: 22px; height: 22px; border-radius: 50%; border: 0; background: rgba(0,0,0,.6); color: #fff; font-size: 15px; line-height: 22px; padding: 0; cursor: pointer; }
.pre { white-space: pre-wrap; word-break: break-word; background: #fff; border-radius: 10px; padding: 12px; border: 1px solid var(--line); font-size: 14px; max-height: 340px; overflow: auto; }
.st-pending { background: var(--warn-soft); color: var(--warn); } .st-working { background: #e0ecff; color: #1d4ed8; } .st-done { background: var(--good-soft); color: var(--good); }
.st-rejected { background: var(--bad-soft); color: var(--bad); } .st-cancelled { background: #eef0f5; color: #6b7083; }
.st-running { background: var(--good-soft); color: var(--good); } .st-scheduled { background: #e0ecff; color: #1d4ed8; } .st-ended, .st-stopped { background: #eef0f5; color: #6b7083; }
.hist { list-style: none; padding: 0; margin: 0; font-size: 13px; }
.hist li { padding: 6px 0; border-bottom: 1px solid var(--line); } .hist li:last-child { border-bottom: 0; }
/* A task comment exactly as typed: line breaks and spaces kept, long words wrapped. */
.ctext { white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 3px; font-size: 14px; line-height: 1.45; user-select: text; }
.cpick { max-height: 50vh; overflow-y: auto; }
.ad.paused { border-left-color: #64748b; } .cd.paused div { background: #eef2f7; } .cd.paused b { color: #475569; }
.st-paused { background: #eef2f7; color: #475569; }
/* Banner for a new ad request (ad team) or an ad going live (sales): stays until closed. */
.big-alert { position: fixed; z-index: 90; left: 50%; top: 14px; transform: translateX(-50%); width: min(94vw, 560px); display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 16px; color: #fff; box-shadow: 0 12px 32px rgba(0,0,0,.28); animation: drop .25s ease-out; }
.big-alert.request { background: linear-gradient(135deg, #ea580c, #c2410c); } .big-alert.live { background: linear-gradient(135deg, #16a34a, #15803d); } .big-alert.taskdone { background: linear-gradient(135deg, #2563eb, #1d4ed8); }
.splanrow input, .splanrow select, .planrow input, .accrow input, .accrow select { min-width: 0; }
.big-alert { background: linear-gradient(135deg, #334155, #1e293b); } .big-alert.ending { background: linear-gradient(135deg, #d97706, #b45309); }
.big-alert .ba-ic { font-size: 30px; } .big-alert .ba-main { flex: 1; min-width: 0; font-size: 14px; } .big-alert .ba-main b { font-size: 16px; display: block; }
.big-alert .ba-act { display: flex; flex-direction: column; gap: 6px; } .big-alert .btn { border-color: rgba(255,255,255,.6); background: rgba(255,255,255,.15); color: #fff; } .big-alert .btn.primary { background: #fff; color: #1f2230; }
@keyframes drop { from { transform: translate(-50%, -30px); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }
/* Recently used values under a field, and the tasks list. */
.chips.mini { flex-wrap: wrap; overflow: visible; padding: 6px 0 0; gap: 6px; align-items: center; }
.chips.mini .chip { padding: 4px 10px; font-size: 12px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.task .t1 .pri { color: var(--bad); font-weight: 800; margin-right: 4px; }
.task.done .t1 { text-decoration: line-through; color: var(--muted); }
.due-late { color: var(--bad); font-weight: 700; } .due-today { color: var(--warn); font-weight: 700; }
.steps { list-style: none; padding: 0; margin: 0; } .steps li { display: flex; gap: 10px; align-items: flex-start; padding: 9px 0; border-bottom: 1px solid var(--line); }
.steps li:last-child { border-bottom: 0; } .steps input { width: 20px; height: 20px; margin-top: 1px; flex: none; } .steps li.done span { text-decoration: line-through; color: var(--muted); }
.steps li small { display: block; color: var(--muted); font-size: 11px; }
.objrow, .steprow { display: grid; grid-template-columns: 1fr 170px auto; gap: 6px; align-items: center; margin-bottom: 6px; }
.steprow { grid-template-columns: 1fr auto; }
.objrow input, .objrow select, .steprow input { border: 1px solid #d7dae4; border-radius: 10px; padding: 8px 10px; min-height: 40px; background: #fff; width: 100%; }
/* Library tiles: notes (shared text / links) and the Meta size warning. */
.mg .note-t { align-items: flex-start; justify-content: flex-start; text-align: left; font-size: 11px; color: #3a3f52; background: #fffbe6; white-space: pre-wrap; word-break: break-word; overflow: hidden; }
.mg .lowres { position: absolute; right: 4px; bottom: 4px; background: rgba(180,83,9,.92); color: #fff; font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 6px; }
.svc-tag { background: #e0f2fe !important; color: #0369a1 !important; }
.xreq-tag { background: #f3e8ff !important; color: #7e22ce !important; }
.ad .xacts { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.ad .xacts .btn { flex: 1; justify-content: center; min-height: 34px; }
/* Posters / campaigns used against the plan. */
.ad .use { font-size: 12px; margin-top: 6px; color: #4b5064; } .ad .use b { font-variant-numeric: tabular-nums; }
.use .over, .meter .over { color: var(--bad); font-weight: 700; } .use .full { color: var(--warn); }
.meter { padding: 6px 0 10px; border-bottom: 1px solid var(--line); } .meter:last-of-type { border-bottom: 0; }
.meter .bar { height: 8px; background: #eef0f5; border-radius: 6px; margin-top: 6px; overflow: hidden; }
.meter .bar i { display: block; height: 100%; background: var(--accent); border-radius: 6px; } .meter .bar i.over { background: var(--bad); }
/* Page + phone side by side on wide screens, one under the other on phones. */
@media (max-width: 600px) { .grid2.stack-m { grid-template-columns: 1fr; gap: 0; } }
.task .working { color: #1d4ed8; font-weight: 600; } .task .rework { color: #b45309; } .task.locked { cursor: not-allowed; opacity: .7; } .task.locked .working { color: var(--muted); }
