/* Wakala — لوحة التحكم. RTL أولاً، بلا أدوات بناء. */
:root {
  --primary: #6360e0; --primary-dark: #4f4cc4; --primary-soft: #eeeefc;
  --ink: #12161f; --muted: #6b7482; --line: #e4e7ec; --bg: #f6f7f9; --card: #fff;
  --ok: #16a34a; --warn: #d97706; --danger: #dc2626; --radius: 12px;
}
* { box-sizing: border-box; }
html { font-size: 15px; }
body {
  margin: 0; background: var(--bg); color: var(--ink); line-height: 1.6;
  font-family: "IBM Plex Sans Arabic", "Noto Sans Arabic", "Segoe UI", Tahoma, -apple-system, BlinkMacSystemFont, sans-serif;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.5rem; margin: 0; } h2 { font-size: 1.1rem; margin: 0 0 .75rem; } h3 { font-size: 1rem; margin: 0; }
.muted { color: var(--muted); } .small { font-size: .85rem; } .ltr { direction: ltr; unicode-bidi: isolate; }
input.ltr, textarea.ltr { text-align: left; }
span.ltr[style*="display:block"], div.ltr { text-align: right; }

/* الهيكل */
.shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.side { background: #14162b; color: #cfd2e6; padding: 1.25rem 1rem; display: flex; flex-direction: column; gap: 1.5rem; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: .6rem; color: #fff; font-weight: 700; font-size: 1.15rem; }
.brand-mark { width: 34px; height: 34px; border-radius: 10px; background: var(--primary); display: grid; place-items: center; color: #fff; font-weight: 800; }
.ws-name { font-size: .8rem; color: #8f94b8; margin-top: -1rem; padding-inline-start: 2.9rem; }
.nav { display: flex; flex-direction: column; gap: .2rem; }
.nav a { color: #cfd2e6; padding: .55rem .75rem; border-radius: 9px; display: block; }
.nav a:hover { background: #20233f; text-decoration: none; }
.nav a.active { background: var(--primary); color: #fff; }
.side-foot { margin-top: auto; font-size: .85rem; border-top: 1px solid #262a4a; padding-top: 1rem; }
.side-foot .who { color: #fff; font-weight: 600; }
.linkish { background: none; border: 0; padding: 0; color: #a9aed3; cursor: pointer; font: inherit; }
.linkish:hover { color: #fff; text-decoration: underline; }
.main { padding: 1.75rem 2rem 3rem; min-width: 0; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.crumbs { font-size: .85rem; color: var(--muted); margin-bottom: .25rem; }

/* عناصر عامة */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.25rem; }
.card + .card { margin-top: 1rem; }
.grid { display: grid; gap: 1rem; }
.cols-2 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); align-items: start; }
.stats { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); margin-bottom: 1.25rem; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: .9rem 1rem; }
.stat b { display: block; font-size: 1.7rem; line-height: 1.2; }
.stat span { color: var(--muted); font-size: .85rem; }
.btn { display: inline-flex; align-items: center; gap: .4rem; border: 1px solid transparent; border-radius: 9px; padding: .5rem .95rem; font: inherit; font-weight: 600; cursor: pointer; background: var(--primary); color: #fff; }
.btn:hover { background: var(--primary-dark); text-decoration: none; }
.btn.ghost { background: #fff; color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { background: var(--bg); }
.btn.danger { background: #fff; color: var(--danger); border-color: #f3c7c7; }
.btn.danger:hover { background: #fef2f2; }
.btn.sm { padding: .3rem .65rem; font-size: .85rem; }
.actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.badge { display: inline-block; padding: .12rem .6rem; border-radius: 999px; font-size: .78rem; font-weight: 700; white-space: nowrap; }
.st-draft { background: #eef0f3; color: #5b6472; } .st-pending_review { background: #fef3c7; color: #92400e; }
.st-needs_revision { background: #ffedd5; color: #c2410c; } .st-approved { background: #dcfce7; color: #166534; }
.st-rejected { background: #fee2e2; color: #b91c1c; } .st-published { background: #ede9fe; color: #6d28d9; }
.alert { border-radius: 10px; padding: .7rem 1rem; margin-bottom: 1rem; border: 1px solid; }
.alert.ok { background: #f0fdf4; border-color: #bbf7d0; color: #166534; }
.alert.err { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.alert.key { background: #fffbeb; border-color: #fde68a; color: #78350f; }
.alert ul { margin: 0; padding-inline-start: 1.1rem; }
.empty { text-align: center; color: var(--muted); padding: 2rem 1rem; }

/* النماذج */
label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: .3rem; }
.field { margin-bottom: 1rem; }
.hint { color: var(--muted); font-size: .8rem; font-weight: 400; margin-top: .25rem; }
input[type=text], input[type=email], input[type=password], input[type=url], input[type=datetime-local], select, textarea {
  width: 100%; border: 1px solid #cfd4dc; border-radius: 9px; padding: .55rem .7rem; font: inherit; background: #fff; color: var(--ink);
}
textarea { min-height: 120px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--primary-soft); border-color: var(--primary); }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.drop { border: 2px dashed #cfd4dc; border-radius: var(--radius); padding: 1.25rem; text-align: center; background: #fafbfc; }
.drop input { margin-top: .5rem; }
.previews { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: .5rem; margin-top: .75rem; }
.previews div { aspect-ratio: 1; border-radius: 8px; background: #e9ecf1 center/cover no-repeat; display: grid; place-items: center; font-size: .75rem; color: var(--muted); padding: .25rem; overflow: hidden; word-break: break-all; }
.checks { display: grid; gap: .4rem; }
.checks label { font-weight: 400; display: flex; gap: .5rem; align-items: center; margin: 0; }

/* الجداول والقوائم */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: start; padding: .65rem .5rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: .8rem; color: var(--muted); font-weight: 600; }
tr:last-child td { border-bottom: 0; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: block; color: inherit; }
.tile:hover { border-color: var(--primary); text-decoration: none; }
.thumb { aspect-ratio: 1; background: #e9ecf1 center/cover no-repeat; display: grid; place-items: center; color: var(--muted); font-size: .85rem; }
.tile-body { padding: .7rem .8rem; }
.tile-body h3 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: .35rem; }
.list-row { display: flex; align-items: center; gap: .75rem; padding: .6rem 0; border-bottom: 1px solid var(--line); color: inherit; }
.list-row:last-child { border-bottom: 0; }
.list-row .thumb { width: 44px; border-radius: 8px; flex: none; font-size: .65rem; }
.list-row .grow { flex: 1; min-width: 0; }

/* صفحة المنشور */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .75rem; }
.gallery figure { margin: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #0f172a; position: relative; }
.gallery img, .gallery video { width: 100%; aspect-ratio: 1; object-fit: contain; display: block; background: #0f172a; }
.gallery figcaption { background: #fff; padding: .35rem .5rem; display: flex; justify-content: space-between; align-items: center; font-size: .78rem; color: var(--muted); }
.caption-box { white-space: pre-wrap; background: #fafbfc; border: 1px solid var(--line); border-radius: 10px; padding: .8rem 1rem; }
.thread { display: grid; gap: .75rem; }
.fb { border: 1px solid var(--line); border-radius: 10px; padding: .7rem .9rem; background: #fff; }
.fb.approval { border-inline-start: 4px solid var(--ok); } .fb.revision_request { border-inline-start: 4px solid var(--warn); } .fb.rejection { border-inline-start: 4px solid var(--danger); }
.fb-head { display: flex; justify-content: space-between; gap: .5rem; font-size: .82rem; color: var(--muted); margin-bottom: .3rem; flex-wrap: wrap; }
.fb p { margin: .2rem 0; white-space: pre-wrap; }
.fb audio { width: 100%; margin-top: .4rem; height: 36px; }
details.edit > summary { cursor: pointer; font-weight: 600; color: var(--primary); list-style: none; }
details.edit > summary::-webkit-details-marker { display: none; }
details.edit[open] > summary { margin-bottom: 1rem; }

/* الدخول */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem; }
.auth-card { width: 100%; max-width: 400px; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 2rem; }
.auth-card .brand { color: var(--ink); justify-content: center; margin-bottom: .25rem; }
.auth-card p.lead { text-align: center; color: var(--muted); margin: 0 0 1.5rem; }
.auth-card .btn { width: 100%; justify-content: center; padding: .65rem; }

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: .75rem; }
  .ws-name { display: none; } .nav { flex-direction: row; flex-wrap: wrap; } .side-foot { margin: 0; border: 0; padding: 0; margin-inline-start: auto; }
  .main { padding: 1.25rem 1rem 2.5rem; } .cols-2, .row { grid-template-columns: 1fr; }
}

/* ملاحظات الصور والرسم */
.note { display: grid; grid-template-columns: 96px 1fr; gap: .6rem; align-items: start; margin-top: .5rem; padding-top: .5rem; border-top: 1px dashed var(--line); }
.note p { margin: 0; }
.stack { position: relative; display: block; line-height: 0; border-radius: 8px; overflow: hidden; background: #0f172a; }
.stack img { width: 100%; height: auto; display: block; }
.stack .overlay { position: absolute; inset: 0; width: 100%; height: 100%; }
.caption-tabs { display: grid; gap: .6rem; }
.caption-tabs .cap h3 { font-size: .85rem; color: var(--muted); margin-bottom: .25rem; }
.cap-row { display: grid; grid-template-columns: 170px 1fr auto; gap: .5rem; align-items: start; margin-bottom: .5rem; }
.cap-row textarea { min-height: 70px; }
.inline-form { display: inline; }
.pill { display: inline-block; padding: .1rem .55rem; border-radius: 999px; font-size: .75rem; font-weight: 700; background: #eef0f3; color: #5b6472; }
.pill.new { background: #fef3c7; color: #92400e; } .pill.in_progress { background: #dbeafe; color: #1d4ed8; }
.pill.done { background: #dcfce7; color: #166534; } .pill.declined { background: #fee2e2; color: #b91c1c; }
.key-state { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; direction: ltr; unicode-bidi: embed; }

/* بوابة العميل */
.portal-top { background: #14162b; color: #fff; padding: .7rem 1rem; display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; position: sticky; top: 0; z-index: 5; }
.portal-top .brand { font-size: 1rem; }
.portal-top nav { display: flex; gap: .25rem; margin-inline-start: auto; align-items: center; flex-wrap: wrap; }
.portal-top nav a { color: #cfd2e6; padding: .35rem .7rem; border-radius: 8px; }
.portal-top nav a.active, .portal-top nav a:hover { background: var(--primary); color: #fff; text-decoration: none; }
.portal-main { max-width: 760px; margin: 0 auto; padding: 1.25rem 1rem 6rem; }
.slide { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: .75rem; margin-bottom: 1rem; }
.slide-head { display: flex; justify-content: space-between; align-items: center; font-size: .85rem; color: var(--muted); margin-bottom: .5rem; }
.slide video { width: 100%; border-radius: 8px; background: #0f172a; max-height: 70vh; }
.draw-wrap { position: relative; line-height: 0; border-radius: 8px; overflow: hidden; background: #0f172a; }
.draw-wrap img { width: 100%; height: auto; display: block; user-select: none; -webkit-user-drag: none; }
.draw-wrap canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.draw-wrap.drawing canvas { pointer-events: auto; touch-action: none; cursor: crosshair; }
.draw-wrap.drawing { outline: 3px solid var(--primary); }
.tools { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; margin: .5rem 0; }
.swatch { width: 26px; height: 26px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px #cfd4dc; cursor: pointer; padding: 0; }
.swatch.on { box-shadow: 0 0 0 3px var(--primary); }
.review-bar { position: sticky; bottom: .5rem; margin-top: 1rem; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: .6rem .75rem; box-shadow: 0 -6px 20px rgba(18, 22, 31, .08); }
.btn.ok { background: var(--ok); } .btn.ok:hover { background: #12833c; }
.btn.warn { background: var(--warn); } .btn.warn:hover { background: #b45f05; }
@media (max-width: 860px) { .cap-row { grid-template-columns: 1fr; } .note { grid-template-columns: 72px 1fr; } }
.card > .fb + .fb { margin-top: .75rem; }
.review-bar .actions { justify-content: center; }
.review-bar .btn { flex: 1; justify-content: center; }

/* أدوات الرسم الموسّعة */
.tool-group { display: inline-flex; gap: .25rem; align-items: center; padding-inline-end: .5rem; margin-inline-end: .25rem; border-inline-end: 1px solid var(--line); }
.tool-btn { min-width: 36px; height: 34px; border: 1px solid var(--line); border-radius: 8px; background: #fff; cursor: pointer; font: inherit; font-size: .85rem; padding: 0 .5rem; color: var(--ink); }
.tool-btn.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.tool-btn .dot { display: inline-block; border-radius: 50%; background: currentColor; vertical-align: middle; }
[data-draw-tools] { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
[data-draw-tools][hidden] { display: none; }

/* المعاينة داخل الصفحة */
.lightbox { position: fixed; inset: 0; z-index: 50; background: rgba(10, 12, 24, .9); display: grid; place-items: center; padding: 1rem; cursor: zoom-out; }
.lightbox-stack { position: relative; line-height: 0; max-width: 100%; max-height: 100%; cursor: default; }
.lightbox-stack img { max-width: calc(100vw - 2rem); max-height: calc(100vh - 2rem); display: block; border-radius: 8px; }
.lightbox-stack .overlay { position: absolute; inset: 0; width: 100%; height: 100%; }
.lightbox-close { position: fixed; top: .75rem; inset-inline-start: .75rem; width: 42px; height: 42px; border-radius: 50%; border: 0; background: #fff; color: var(--ink); font-size: 1.6rem; line-height: 1; cursor: pointer; }
a[data-lightbox] { cursor: zoom-in; }

/* مشاركة الرابط والتسجيل الصوتي */
.share-row { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; }
.share-row input { flex: 1; min-width: 180px; font-size: .85rem; }
.btn.wa { background: #1faa59; } .btn.wa:hover { background: #17894a; text-decoration: none; }
.recorder { border: 1px dashed #cfd4dc; border-radius: var(--radius); padding: .75rem; background: #fafbfc; }
.recorder audio { width: 100%; margin-top: .5rem; height: 36px; }
.guest-note { background: var(--primary-soft); border-radius: 10px; padding: .6rem .8rem; font-size: .85rem; margin-bottom: 1rem; }

/* مهام التعديل */
.task { display: flex; gap: .7rem; align-items: flex-start; padding: .6rem 0; border-bottom: 1px solid var(--line); }
.task:last-of-type { border-bottom: 0; }
.task .grow { flex: 1; min-width: 0; }
.task-title { font-weight: 600; }
.task.done .task-title { text-decoration: line-through; color: var(--muted); font-weight: 400; }
.check { width: 26px; height: 26px; border-radius: 7px; border: 2px solid #b6bcc7; background: #fff; cursor: pointer; font-size: 1rem; line-height: 1; color: #fff; padding: 0; flex: none; }
.check:hover { border-color: var(--ok); }
.task.done .check { background: var(--ok); border-color: var(--ok); }
a.stat:hover { border-color: var(--primary); text-decoration: none; }

/* التفريغ الصوتي: مطوي افتراضياً */
details.transcript { margin-top: .35rem; }
details.transcript > summary { cursor: pointer; font-size: .82rem; color: var(--primary); width: fit-content; }
details.transcript > p { margin: .35rem 0 0; padding: .5rem .7rem; background: #fafbfc; border: 1px solid var(--line); border-radius: 8px; white-space: pre-wrap; }

/* بطاقات العملاء */
.client-tile .tile-body { padding: 1rem; display: grid; gap: .3rem; justify-items: start; }
.avatar { width: 44px; height: 44px; border-radius: 12px; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; font-weight: 800; font-size: 1.2rem; }
.avatar.muted-avatar { background: #eef0f3; color: var(--muted); }

/* الدردشة */
.nav-count { display: inline-block; min-width: 1.35rem; text-align: center; background: #e5484d; color: #fff; border-radius: 999px; font-size: .72rem; font-weight: 700; padding: 0 .4rem; margin-inline-start: .3rem; }
.chat-layout { display: grid; grid-template-columns: 260px 1fr; gap: 1rem; align-items: start; }
.chat-threads { padding: .4rem; }
.chat-threads a { display: block; padding: .6rem .7rem; border-radius: 9px; color: var(--ink); }
.chat-threads a:hover, .chat-threads a.active { background: var(--primary-soft); text-decoration: none; }
.chat-threads .preview { display: block; color: var(--muted); font-size: .8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-box { display: flex; flex-direction: column; height: min(70vh, 640px); padding: 0; overflow: hidden; }
.chat-log { flex: 1; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: .5rem; background: var(--bg); }
.chat-msg { max-width: 78%; padding: .5rem .75rem; border-radius: 14px; background: #fff; border: 1px solid var(--line); align-self: flex-end; white-space: pre-wrap; overflow-wrap: anywhere; }
.chat-msg.mine { background: var(--primary); color: #fff; border-color: var(--primary); align-self: flex-start; }
.chat-msg .meta { display: block; font-size: .72rem; opacity: .75; margin-top: .15rem; }
.chat-form { display: flex; gap: .5rem; padding: .6rem; border-top: 1px solid var(--line); background: #fff; }
.chat-form textarea { flex: 1; min-height: 44px; max-height: 140px; resize: vertical; }
.chat-empty { margin: auto; color: var(--muted); text-align: center; }
@media (max-width: 800px) { .chat-layout { grid-template-columns: 1fr; } }
.chat-msg audio { display: block; width: 240px; max-width: 100%; height: 36px; margin-bottom: .25rem; }
.chat-text { display: block; }
.chat-note { display: block; font-size: .8rem; opacity: .8; }
.chat-idea { display: inline-block; margin-top: .25rem; font-size: .75rem; font-weight: 700; padding: .05rem .5rem; border-radius: 999px; background: #fff4cc; color: #7a5200; }
.chat-transcript { font-size: .85rem; margin-top: .2rem; }
.chat-transcript > summary { cursor: pointer; opacity: .85; width: fit-content; }
.chat-rec { padding: 0 .7rem .5rem; color: #c0392b; background: #fff; }
.chat-form .btn.danger { white-space: nowrap; }
/* دليل الهوية */
.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .7rem; }
.swatch { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; }
.swatch .chip { height: 72px; border-bottom: 1px solid var(--line); }
.swatch .chip.none { background: repeating-linear-gradient(45deg, #f1f2f5, #f1f2f5 8px, #fff 8px, #fff 16px); }
.swatch .info { padding: .45rem .6rem; font-size: .85rem; }
.swatch button { all: unset; cursor: pointer; font-family: ui-monospace, monospace; font-size: .82rem; color: var(--primary); direction: ltr; }
.brand-list { margin: 0; padding-inline-start: 1.1rem; }
.brand-list li { margin-bottom: .25rem; }
.brand-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.brand-do h3 { color: #15803d; } .brand-dont h3 { color: #b91c1c; }
.brand-pdf { width: 100%; height: 80vh; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.font-row { display: flex; gap: .75rem; align-items: baseline; padding: .4rem 0; border-bottom: 1px dashed var(--line); }
.font-row strong { direction: ltr; unicode-bidi: isolate; min-width: 160px; }
@media (max-width: 800px) { .brand-cols { grid-template-columns: 1fr; } }

.chat-idea-form { display: block; margin-top: .3rem; }
.chat-suggest { display: block; font-size: .8rem; font-weight: 600; color: #7a5200; background: #fff4cc; border-radius: 8px; padding: .15rem .5rem; margin-bottom: .25rem; }
.chat-idea-btn { all: unset; cursor: pointer; font-size: .78rem; font-weight: 700; color: var(--primary); margin-inline-end: .75rem; }
.chat-idea-btn:hover { text-decoration: underline; }
.chat-idea-btn:disabled { opacity: .5; cursor: default; }

.chat-img { display: block; margin-bottom: .25rem; }
.chat-img img { display: block; max-width: 240px; max-height: 260px; width: auto; height: auto; border-radius: 10px; background: #eef0f3; }

.idea-fresh { background: #fffbea; border-radius: 10px; padding-inline: .6rem; }

.idea-attachments { display: flex; flex-wrap: wrap; gap: .5rem; margin: .5rem 0; }
.idea-attachments a, .idea-attachments .thumb { position: relative; display: block; }
.idea-attachments img { width: 120px; height: 120px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); background: #eef0f3; display: block; }
.idea-attachments .thumb form { position: absolute; top: 4px; inset-inline-end: 4px; }
.idea-attachments .thumb button { all: unset; cursor: pointer; background: rgba(0,0,0,.65); color: #fff; width: 24px; height: 24px; border-radius: 50%; text-align: center; line-height: 24px; font-size: .85rem; }
.table-scroll { overflow-x: auto; }
td.num { direction: ltr; text-align: end; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* بطاقات المنصات الإعلانية */
.range-nav { display: flex; flex-wrap: wrap; gap: .4rem; }
.range-nav a { padding: .35rem .85rem; border-radius: 999px; border: 1px solid var(--line); background: #fff; color: var(--ink); font-size: .85rem; font-weight: 600; }
.range-nav a.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.range-nav a:hover { text-decoration: none; }
.ad-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: .9rem; }
.ad-card { background: #fff; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; border-top: 4px solid var(--primary); }
.ad-card.ad-meta { border-top-color: #1877f2; } .ad-card.ad-google { border-top-color: #34a853; }
.ad-card.ad-tiktok { border-top-color: #111; } .ad-card.ad-snapchat { border-top-color: #f7d000; }
.ad-card-head { padding: .7rem 1rem 0; font-weight: 700; }
.ad-card-body { display: grid; grid-template-columns: 1fr auto; gap: .5rem 1rem; padding: .6rem 1rem 1rem; align-items: end; }
.ad-num { display: block; font-size: 1.35rem; font-weight: 800; direction: ltr; text-align: start; font-variant-numeric: tabular-nums; line-height: 1.2; }
.ad-card-body > div:last-child .ad-num { text-align: end; }
.ad-cap { display: block; color: var(--muted); font-size: .8rem; }
.ad-card-note { padding: 0 1rem .8rem; color: var(--muted); font-size: .78rem; }
