/* Shared styles for the admin panel, client portal and login page. */
:root {
  --accent: #FF8400;
  --accent-soft: #fff1e3;
  --charcoal: #333333;
  --side: #151515;
  --bg: #f5f4f1;
  --panel: #ffffff;
  --ink: #141414;
  --text: #3d3d3d;
  --muted: #8b8b86;
  --line: #e8e6e1;
  --danger: #d93b3b;
  --ok: #1f9d55;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 8px 24px -12px rgba(0,0,0,.08);
  --panel-2: #fbfaf8;      /* subtle fills inside cards */
  --fill: #efede8;         /* chips, bubbles, tracks */
  --border-strong: #d4d1ca;
  --text-2: #5f5d58;
  --hover: rgba(0,0,0,.04);
  --on-ink: #ffffff;       /* text on ink-coloured surfaces (toasts, dark buttons) */
  --ink-hover: #333333;
  --callout-ink: #7a4300;
  --mark: #333333;
  --input: #ffffff;
  color-scheme: light;
  --brand-font: "Montserrat", "Inter Tight", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: "Inter Tight", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg); color: var(--text);
  font-size: 14px; line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
ul { list-style: none; }
[hidden] { display: none !important; }
::selection { background: var(--accent); color: #fff; }
svg.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Logo ---------- */
.logo { display: inline-flex; align-items: center; gap: 8px; line-height: 1; }
.logo__text { display: flex; flex-direction: column; }
.logo__word { font-family: var(--brand-font); font-weight: 800; font-size: 22px; letter-spacing: .02em; color: var(--accent); }
.logo__sub { font-family: var(--brand-font); font-weight: 500; font-size: 6.6px; letter-spacing: .52em; text-transform: uppercase; margin-top: 3px; opacity: .7; }
.logo__mark { width: 24px; height: auto; color: var(--mark); }
.sidebar .logo__mark, .sidebar .logo__sub { color: #fff; }

/* ---------- App layout ---------- */
.app { display: grid; grid-template-columns: 250px minmax(0, 1fr); min-height: 100vh; }
.app > div, .grid > *, .card { min-width: 0; }
.sidebar {
  background: var(--side); color: #cfcfcf;
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; padding: 22px 14px;
}
.sidebar .logo { padding: 0 10px 26px; }
.side-label { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: #6d6d6d; padding: 16px 12px 6px; }
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-nav a {
  display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 10px;
  color: #bdbdbd; font-weight: 500; position: relative; transition: background .2s, color .2s;
}
.side-nav a:hover { background: #222; color: #fff; }
.side-nav a.is-active { background: #262626; color: #fff; }
.side-nav a.is-active::before { content: ""; position: absolute; left: -14px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.side-nav a.is-active svg { color: var(--accent); }
.side-nav .count { margin-left: auto; background: var(--accent); color: #fff; font-size: 11px; font-weight: 600; border-radius: 99px; padding: 1px 7px; }
.side-foot { margin-top: auto; border-top: 1px solid #262626; padding: 14px 8px 0; display: flex; align-items: center; gap: 10px; }
.side-foot .who { flex: 1; min-width: 0; }
.side-foot .who b { display: block; color: #fff; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-foot .who span { font-size: 12px; color: #7a7a7a; }
.icon-btn { background: none; border: 0; color: inherit; width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; transition: background .2s, color .2s; }
.icon-btn:hover { background: #262626; color: #fff; }
.main .icon-btn:hover { background: var(--bg); color: var(--ink); }

.avatar {
  width: 34px; height: 34px; border-radius: 50%; flex: none;
  display: grid; place-items: center; font-weight: 600; font-size: 13px;
  background: var(--accent); color: #fff; text-transform: uppercase;
}
.avatar--lg { width: 44px; height: 44px; font-size: 15px; }
.avatar--dark { background: var(--charcoal); }

.main { min-width: 0; padding: 28px clamp(16px, 3vw, 40px) 80px; }
.topbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 26px; flex-wrap: wrap; }
.topbar h1 { font-size: 28px; font-weight: 600; letter-spacing: -.03em; color: var(--ink); line-height: 1.1; }
.topbar p { color: var(--muted); margin-top: 4px; }
.topbar .actions { display: flex; gap: 10px; flex-wrap: wrap; }
.crumb { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; margin-bottom: 8px; }
.crumb:hover { color: var(--ink); }

.mobile-bar { display: none; }

/* ---------- Cards & grids ---------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.card__head h2, .card__head h3 { font-size: 15px; font-weight: 600; color: var(--ink); letter-spacing: -.01em; }
.card__head p { font-size: 13px; color: var(--muted); }
.card__body { padding: 20px; }
.card + .card { margin-top: 20px; }
.grid { display: grid; gap: 20px; }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid--side { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }

.stat { padding: 18px 20px; display: flex; flex-direction: column; gap: 10px; }
.stat__label { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.stat__label svg { color: var(--accent); }
.stat__value { font-size: 34px; font-weight: 600; letter-spacing: -.04em; color: var(--ink); line-height: 1; }
.stat__sub { font-size: 12px; color: var(--muted); }

/* ---------- Forms ---------- */
.form { display: grid; gap: 16px; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span { font-size: 12.5px; font-weight: 500; color: var(--ink); }
.field small { font-size: 12px; color: var(--muted); }
.input, .field input:not([type="checkbox"]):not([type="color"]):not([type="range"]):not([type="file"]), .field select, .field textarea {
  font: inherit; font-size: 14px; color: var(--ink);
  width: 100%; background: var(--input); border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px; outline: none; transition: border-color .2s, box-shadow .2s;
}
.field textarea { resize: vertical; min-height: 88px; line-height: 1.5; }
.input:focus, .field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.color-field { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 10px; padding: 5px 10px 5px 5px; background: var(--panel); }
.color-field input[type="color"] { width: 32px; height: 28px; border: 0; background: none; padding: 0; cursor: pointer; }
.color-field input[type="text"] { border: 0 !important; padding: 4px !important; box-shadow: none !important; font-family: ui-monospace, monospace; font-size: 13px !important; }
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 44px !important; }
.pw-wrap button { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); }

.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; font-weight: 500; color: var(--ink); }
.switch input[type="checkbox"] { appearance: none; -webkit-appearance: none; margin: 0; width: 36px; height: 20px; border-radius: 99px; background: var(--border-strong); position: relative; cursor: pointer; transition: background .2s; flex: none; }
.switch input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked { background: var(--accent); }
.switch input:checked::after { transform: translateX(16px); }

input[type="range"] { accent-color: var(--accent); width: 100%; }
input[type="checkbox"] { accent-color: var(--accent); width: 16px; height: 16px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--line); background: var(--panel); color: var(--ink);
  font-weight: 500; font-size: 14px; border-radius: 10px; padding: 9px 14px;
  transition: background .2s, border-color .2s, color .2s, transform .1s; white-space: nowrap;
}
.btn:hover { border-color: var(--border-strong); background: var(--panel-2); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; pointer-events: none; }
.btn--primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn--primary:hover { background: #ec7a00; border-color: #ec7a00; }
.btn--dark { background: var(--ink); border-color: var(--ink); color: var(--on-ink); }
.btn--dark:hover { background: var(--ink-hover); border-color: var(--ink-hover); }
.btn--danger { color: var(--danger); }
.btn--danger:hover { background: color-mix(in srgb, var(--danger) 8%, var(--panel)); border-color: color-mix(in srgb, var(--danger) 35%, transparent); }
.btn--ghost { border-color: transparent; background: transparent; }
.btn--ghost:hover { background: var(--hover); border-color: transparent; }
.btn--sm { padding: 6px 10px; font-size: 13px; border-radius: 8px; }
.btn--block { width: 100%; padding: 12px 16px; }

/* ---------- Tables & lists ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-weight: 500; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; padding: 12px 20px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 14px 20px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .15s; }
.table tbody tr.clickable { cursor: pointer; }
.table tbody tr:hover { background: var(--panel-2); }
.cell-user { display: flex; align-items: center; gap: 12px; }
.cell-user b { display: block; color: var(--ink); font-weight: 500; }
.cell-user span { font-size: 12.5px; color: var(--muted); }
.row-actions { display: flex; gap: 4px; justify-content: flex-end; }

.list-item { display: flex; gap: 12px; align-items: flex-start; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.list-item:last-child { border-bottom: 0; }
.list-item b { color: var(--ink); font-weight: 500; }
.list-item p { color: var(--text); }
.list-item .meta { font-size: 12px; color: var(--muted); }

.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; padding: 3px 9px; border-radius: 99px; background: var(--fill); color: var(--text-2); white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.badge--accent { background: var(--accent-soft); color: #c96500; }
.badge--blue { background: #e9f0ff; color: #2d5bd7; }
.badge--purple { background: #f1ebff; color: #6b3fd1; }
.badge--teal { background: #e3f6f3; color: #11826f; }
.badge--yellow { background: #fff6d9; color: #9a7300; }
.badge--green { background: #e4f6ea; color: var(--ok); }
.badge--grey { background: var(--fill); color: var(--text-2); }
.badge--red { background: #fdecec; color: var(--danger); }

.progress { height: 6px; background: var(--fill); border-radius: 99px; overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--accent); border-radius: inherit; transition: width .6s cubic-bezier(.16,1,.3,1); }
.progress-row { display: flex; align-items: center; gap: 10px; }
.progress-row .progress { flex: 1; }
.progress-row b { font-size: 12.5px; font-weight: 500; color: var(--ink); min-width: 34px; text-align: right; }

.empty { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty svg { width: 36px; height: 36px; color: var(--border-strong); margin-bottom: 10px; }
.empty h3 { color: var(--ink); font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.empty p { max-width: 360px; margin: 0 auto 16px; }

/* ---------- Tabs / segmented ---------- */
.tabs { display: inline-flex; gap: 4px; background: var(--fill); border-radius: 10px; padding: 3px; flex-wrap: wrap; }
.tabs button { border: 0; background: none; padding: 6px 12px; border-radius: 8px; font-weight: 500; color: var(--text-2); font-size: 13px; }
.tabs button.is-active { background: var(--panel); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); }

/* ---------- Sticky save bar ---------- */
.savebar {
  position: sticky; bottom: 16px; z-index: 20; margin-top: 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--ink); color: var(--on-ink); border-radius: 14px; padding: 12px 12px 12px 20px;
  box-shadow: 0 12px 32px -12px rgba(0,0,0,.4);
  transform: translateY(20px); opacity: 0; pointer-events: none; transition: transform .3s, opacity .3s;
}
.savebar.is-dirty { transform: none; opacity: 1; pointer-events: auto; }
.savebar .btn--ghost { color: color-mix(in srgb, var(--on-ink) 70%, transparent); }
.savebar .btn--ghost:hover { background: color-mix(in srgb, var(--on-ink) 12%, transparent); color: var(--on-ink); }

/* ---------- Repeater (editable lists) ---------- */
.repeater { display: grid; gap: 12px; }
.rep-item { border: 1px solid var(--line); border-radius: 12px; background: var(--panel-2); }
.rep-item__head { display: flex; align-items: center; gap: 8px; padding: 10px 10px 10px 14px; border-bottom: 1px solid var(--line); }
.rep-item__head b { flex: 1; color: var(--ink); font-weight: 600; }
.rep-item__num { font-size: 12px; font-weight: 600; color: var(--accent); }
.rep-item__body { padding: 14px; display: grid; gap: 12px; }

/* ---------- Portfolio cards ---------- */
.pf-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; }
.pf-card { overflow: hidden; display: flex; flex-direction: column; }
.pf-card.is-hidden .pf-thumb { opacity: .4; }
.pf-thumb { aspect-ratio: 4 / 3; position: relative; display: grid; place-items: center; overflow: hidden; font-weight: 600; font-size: 22px; letter-spacing: -.03em; }
.pf-thumb img, .pf-thumb video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.pf-thumb .badge { position: absolute; top: 10px; left: 10px; }
.pf-card__body { padding: 14px 16px; flex: 1; }
.pf-card__body b { color: var(--ink); font-weight: 600; display: block; }
.pf-card__body span { font-size: 12.5px; color: var(--muted); }
.pf-card__foot { display: flex; gap: 2px; padding: 8px; border-top: 1px solid var(--line); }
.pf-card__foot .spacer { flex: 1; }

.upload-box {
  border: 1.5px dashed var(--border-strong); border-radius: 12px; padding: 18px; text-align: center; color: var(--muted);
  cursor: pointer; transition: border-color .2s, background .2s; display: block; position: relative;
}
.upload-box:hover, .upload-box.is-drag { border-color: var(--accent); background: var(--accent-soft); color: var(--ink); }
.upload-box input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.upload-box svg { width: 22px; height: 22px; margin-bottom: 4px; }
.upload-preview { position: relative; border-radius: 12px; overflow: hidden; aspect-ratio: 16 / 9; background: var(--fill); }
.upload-preview img, .upload-preview video { width: 100%; height: 100%; object-fit: cover; }
.upload-preview button { position: absolute; top: 8px; right: 8px; }

/* ---------- Job detail ---------- */
.stepper { display: flex; gap: 6px; flex-wrap: wrap; }
.stepper span { flex: 1; min-width: 90px; font-size: 12px; font-weight: 500; color: var(--muted); padding-top: 10px; border-top: 3px solid var(--border-strong); }
.stepper span.done { border-color: var(--accent); color: var(--ink); }
.stepper span.current { border-color: var(--accent); color: var(--accent); }

.milestones { display: grid; gap: 4px; }
.milestone { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px; }
.milestone:hover { background: var(--panel-2); }
.milestone.done span { text-decoration: line-through; color: var(--muted); }
.milestone input[type="text"] { flex: 1; border: 0 !important; background: transparent !important; padding: 2px 0 !important; box-shadow: none !important; }
.milestone .check { width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--border-strong); display: grid; place-items: center; flex: none; background: var(--panel); color: #fff; padding: 0; }
.milestone .check:hover { border-color: var(--accent); }
.milestone.done .check { background: var(--accent); border-color: var(--accent); color: #fff; }
.milestone .check svg { width: 12px; height: 12px; stroke-width: 3; }

.timeline { display: flex; flex-direction: column; gap: 14px; padding: 20px; max-height: 560px; overflow-y: auto; }
.msg { display: flex; gap: 10px; max-width: 88%; }
.msg__bubble { background: var(--fill); border-radius: 4px 14px 14px 14px; padding: 10px 14px; white-space: pre-wrap; word-wrap: break-word; color: var(--ink); }
.msg__meta { font-size: 11.5px; color: var(--muted); margin-top: 4px; display: flex; gap: 8px; align-items: center; }
.msg--me { align-self: flex-end; flex-direction: row-reverse; }
.msg--me .msg__bubble { background: var(--ink); color: var(--on-ink); border-radius: 14px 4px 14px 14px; }
.msg--me .msg__meta { justify-content: flex-end; }
.msg--system { align-self: center; max-width: 100%; }
.msg--system .msg__bubble { background: transparent; color: var(--muted); font-size: 12.5px; padding: 2px 0; text-align: center; }
.composer { display: flex; gap: 8px; padding: 14px; border-top: 1px solid var(--line); align-items: flex-end; }
.composer textarea { flex: 1; font: inherit; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; resize: none; min-height: 44px; max-height: 160px; outline: none; }
.composer textarea:focus { border-color: var(--accent); }

.files { display: grid; }
.file { display: flex; align-items: center; gap: 12px; padding: 10px 20px; border-bottom: 1px solid var(--line); }
.file:last-child { border-bottom: 0; }
.file__icon { width: 36px; height: 36px; border-radius: 9px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; flex: none; font-size: 10px; font-weight: 700; text-transform: uppercase; }
.file__info { flex: 1; min-width: 0; }
.file__info b { display: block; color: var(--ink); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file__info span { font-size: 12px; color: var(--muted); }

.detail-list { display: grid; gap: 12px; }
.detail-list div { display: flex; justify-content: space-between; gap: 12px; }
.detail-list dt { color: var(--muted); }
.detail-list dd { color: var(--ink); font-weight: 500; text-align: right; }

/* ---------- Modal ---------- */
dialog.modal {
  border: 0; border-radius: 18px; padding: 0; width: min(560px, calc(100vw - 32px));
  max-height: calc(100vh - 48px); margin: auto; color: var(--text); background: var(--panel);
  box-shadow: 0 30px 80px -20px rgba(0,0,0,.35);
}
dialog.modal--wide { width: min(760px, calc(100vw - 32px)); }
dialog.modal::backdrop { background: rgba(20,20,20,.45); backdrop-filter: blur(3px); }
dialog.modal[open] { animation: pop .25s cubic-bezier(.16,1,.3,1); }
@keyframes pop { from { opacity: 0; transform: translateY(12px) scale(.98); } }
.modal__head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--panel); z-index: 1; }
.modal__head h2 { font-size: 17px; font-weight: 600; color: var(--ink); letter-spacing: -.02em; }
.modal__body { padding: 20px; display: grid; gap: 16px; }
.modal__foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--line); background: var(--panel-2); position: sticky; bottom: 0; }
.modal__foot .left { margin-right: auto; }

/* ---------- Toasts ---------- */
.toasts { position: fixed; bottom: 20px; right: 20px; z-index: 1000; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--ink); color: var(--on-ink); border-radius: 12px; padding: 12px 16px; display: flex; gap: 10px; align-items: center; box-shadow: 0 12px 32px -10px rgba(0,0,0,.4); animation: pop .3s cubic-bezier(.16,1,.3,1); max-width: 360px; }
.toast svg { color: var(--accent); }
.toast--error svg { color: #ff7b7b; }
.toast.out { opacity: 0; transform: translateY(8px); transition: .3s; }

.callout { display: flex; gap: 12px; padding: 14px 16px; border-radius: 12px; background: var(--accent-soft); color: var(--callout-ink); }
.callout svg { color: var(--accent); margin-top: 1px; }
.callout code { background: color-mix(in srgb, var(--panel) 70%, transparent); padding: 2px 6px; border-radius: 6px; font-size: 13px; }

.loading { display: grid; place-items: center; padding: 80px; color: var(--muted); }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--border-strong); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.muted { color: var(--muted); }
.mt-0 { margin-top: 0 !important; }
.hstack { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.spacer { flex: 1; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid--side { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 860px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; inset: 0 30% 0 0; min-width: 260px; z-index: 60; transform: translateX(-100%); transition: transform .35s cubic-bezier(.16,1,.3,1); }
  .app.nav-open .sidebar { transform: none; box-shadow: 0 0 0 100vw rgba(0,0,0,.4); }
  .mobile-bar { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; background: var(--panel); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 30; }
  .grid--2, .grid--3 { grid-template-columns: minmax(0, 1fr); }
  .topbar h1 { font-size: 24px; }
  .table th, .table td { padding: 12px 14px; }
  .hide-sm { display: none; }
}
@media (max-width: 520px) {
  .grid--4 { grid-template-columns: 1fr 1fr; gap: 12px; }
  .stat__value { font-size: 26px; }
  .msg { max-width: 100%; }
}

/* ---------- Auth screens ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: var(--bg); }
.auth__card { width: min(420px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: 20px; padding: 32px; box-shadow: var(--shadow); }
.auth__card .logo { margin-bottom: 28px; }
.auth__card h1 { font-size: 26px; font-weight: 600; letter-spacing: -.03em; color: var(--ink); margin-bottom: 6px; }
.auth__card > p { margin-bottom: 22px; }
.auth__error { color: var(--danger); font-size: 13px; min-height: 1em; }
.auth__error:empty { display: none; }

/* =====================================================================
   v2: builder, media, mobile tab bar, approvals, team
   ===================================================================== */
.prefixed { display: flex; align-items: stretch; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); overflow: hidden; }
.prefixed:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.prefixed em { font-style: normal; color: var(--muted); background: var(--panel-2); padding: 10px 4px 10px 12px; font-size: 14px; border-right: 1px solid var(--line); white-space: nowrap; }
.prefixed input { border: 0 !important; box-shadow: none !important; border-radius: 0 !important; }
.switch > span { display: flex; flex-direction: column; }
.switch small { font-weight: 400; color: var(--muted); font-size: 12px; }
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.sticky-side { position: sticky; top: 20px; }
.sticky-side .card + .card { margin-top: 20px; }
.card__foot { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; gap: 8px; flex-wrap: wrap; }
.dot-badge { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 600; }
.link-accent { color: var(--accent); font-weight: 500; }
.link-accent:hover { text-decoration: underline; }

/* Block builder */
.blocks { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.card__body, .form, .field { min-width: 0; }
.blk-item { border: 1px solid var(--line); border-radius: 12px; background: var(--panel); transition: box-shadow .2s, border-color .2s; }
.blk-item.is-open { border-color: var(--border-strong); box-shadow: 0 8px 24px -16px rgba(0,0,0,.25); }
.blk-item__head { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 12px; cursor: pointer; user-select: none; }
.blk-item__icon { width: 30px; height: 30px; border-radius: 8px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; flex: none; }
.blk-item__icon svg { width: 16px; height: 16px; }
.blk-item__title { flex: 1; min-width: 0; }
.blk-item__title b { display: block; color: var(--ink); font-weight: 600; font-size: 13.5px; }
.blk-item__title small { display: block; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.blk-item__tools { display: flex; }
.blk-item__tools .icon-btn { width: 30px; height: 30px; }
.blk-item__body { padding: 14px; border-top: 1px solid var(--line); display: grid; gap: 14px; background: var(--panel-2); border-radius: 0 0 12px 12px; }
.blk-add__menu { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; margin-top: 10px; padding: 12px; border: 1px dashed var(--border-strong); border-radius: 12px; background: var(--panel-2); }
.blk-add__menu button { display: flex; align-items: center; gap: 10px; text-align: left; padding: 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); font-size: 13px; color: var(--ink); }
.blk-add__menu button:hover { border-color: var(--accent); background: var(--accent-soft); }
.blk-add__menu button small { display: block; color: var(--muted); font-size: 11.5px; }
.blk-add__menu svg { color: var(--accent); flex: none; }
.sublist { display: grid; gap: 8px; }
.sublist__row { display: flex; gap: 8px; align-items: flex-start; }
.sublist__row > .grow { flex: 1; display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }

/* Media field + library */
.media-field { display: grid; gap: 8px; }
.media-field__preview { position: relative; border-radius: 10px; overflow: hidden; background: var(--fill); aspect-ratio: 16 / 9; display: grid; place-items: center; color: var(--muted); font-size: 12.5px; }
.media-field__preview img, .media-field__preview video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.media-field__preview.is-empty { border: 1.5px dashed var(--border-strong); background: var(--panel-2); }
.media-field__actions { display: flex; gap: 6px; flex-wrap: wrap; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.media-tile { position: relative; display: block; width: 100%; border-radius: 12px; overflow: hidden; background: var(--fill); aspect-ratio: 1; border: 2px solid transparent; cursor: pointer; transition: border-color .15s; padding: 0; }
.media-tile:hover { border-color: var(--accent); }
.media-tile img, .media-tile video { width: 100%; height: 100%; object-fit: cover; }
.media-tile .badge { position: absolute; top: 8px; left: 8px; }
.media-tile__bar { position: absolute; left: 0; right: 0; bottom: 0; padding: 6px 8px; background: linear-gradient(transparent, rgba(0,0,0,.7)); color: #fff; font-size: 11.5px; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.media-card { overflow: hidden; }
.media-card .media-tile { border-radius: 0; border: 0; cursor: default; }
.media-card__foot { display: flex; align-items: center; gap: 2px; padding: 6px; border-top: 1px solid var(--line); }
.media-card__foot small { flex: 1; color: var(--muted); padding-left: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Approvals */
.approval { border: 1px solid var(--line); border-radius: 12px; padding: 14px; display: grid; gap: 8px; background: var(--panel); }
.approval + .approval { margin-top: 10px; }
.approval__head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.approval__head b { flex: 1; color: var(--ink); font-weight: 600; }
.approval p { white-space: pre-wrap; }
.approval__resp { background: var(--panel-2); border-radius: 10px; padding: 10px 12px; font-size: 13.5px; white-space: pre-wrap; }
.approval--pending { border-color: color-mix(in srgb, var(--accent) 40%, transparent); background: color-mix(in srgb, var(--accent) 6%, var(--panel)); }

/* Team & permissions */
.perm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.perm { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.perm:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.perm input { margin-top: 2px; }
.perm b { display: block; color: var(--ink); font-weight: 500; font-size: 13.5px; }
.chips { display: flex; gap: 4px; flex-wrap: wrap; }
.chip { font-size: 11.5px; padding: 2px 8px; border-radius: 99px; background: var(--fill); color: var(--text-2); }
.team-pick { display: grid; gap: 6px; }
.team-pick label { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line); cursor: pointer; }
.team-pick label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }

/* Phone access */
.qr-row { display: grid; grid-template-columns: 150px 1fr; gap: 18px; align-items: center; }
.qr { width: 150px; height: 150px; border-radius: 12px; border: 1px solid var(--line); padding: 8px; background: #fff; display: grid; place-items: center; }
.qr img, .qr svg { width: 100%; height: 100%; image-rendering: pixelated; }
.url-pill { display: inline-flex; align-items: center; gap: 8px; font-family: ui-monospace, monospace; font-size: 14px; background: var(--panel-2); border-radius: 10px; padding: 8px 12px; color: var(--ink); word-break: break-all; }
.steps-list { display: grid; gap: 10px; counter-reset: s; }
.steps-list li { counter-increment: s; display: flex; gap: 10px; }
.steps-list li::before { content: counter(s); width: 22px; height: 22px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 600; font-size: 12px; display: grid; place-items: center; flex: none; }

.file__icon--img { padding: 0; overflow: hidden; }
.file__icon--img img { width: 100%; height: 100%; object-fit: cover; }

/* Mobile bottom tab bar */
.tabbar { display: none; }
@media (max-width: 860px) {
  .tabbar {
    display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
    background: color-mix(in srgb, var(--panel) 92%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    border-top: 1px solid var(--line); padding: 6px 4px max(6px, env(safe-area-inset-bottom));
  }
  .tabbar a, .tabbar button { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 10.5px; font-weight: 500; color: var(--muted); padding: 6px 0; border: 0; background: none; position: relative; }
  .tabbar a.is-active { color: var(--accent); }
  .tabbar svg.i { width: 22px; height: 22px; }
  .tabbar .dot-badge { position: absolute; top: 0; left: calc(50% + 6px); min-width: 16px; height: 16px; font-size: 10px; }
  .main { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
  .mobile-bar { padding-top: max(12px, env(safe-area-inset-top)); }
  .savebar { bottom: calc(76px + env(safe-area-inset-bottom)); }
  .form-grid-2, .qr-row { grid-template-columns: 1fr; }
  .sticky-side { position: static; }
  .topbar .actions { width: 100%; }
  .topbar .actions > * { flex: 1; }
  .card__head { flex-wrap: wrap; }
  .blk-item__tools .hide-sm { display: none; }
  dialog.modal, dialog.modal--wide { width: 100vw; max-width: 100vw; max-height: 92vh; margin: auto 0 0; border-radius: 18px 18px 0 0; }
  dialog.modal[open] { animation: sheet .3s cubic-bezier(.16,1,.3,1); }
  .modal__foot { padding-bottom: max(14px, env(safe-area-inset-bottom)); }
  .toasts { left: 16px; right: 16px; bottom: calc(84px + env(safe-area-inset-bottom)); }
  .toast { max-width: none; }
  input, select, textarea { font-size: 16px !important; }
}
@keyframes sheet { from { transform: translateY(40px); opacity: 0; } }

/* Tables become cards on small phones */
@media (max-width: 600px) {
  .table.stack thead { display: none; }
  .table.stack, .table.stack tbody, .table.stack tr, .table.stack td { display: block; width: 100%; }
  .table.stack tr { padding: 12px 16px; border-bottom: 1px solid var(--line); }
  .table.stack td { border: 0; padding: 4px 0; }
  .table.stack td.hide-sm { display: none; }
  .table.stack .row-actions { justify-content: flex-start; margin-top: 6px; }
}

/* Light/dark theme preview in Site content */
.theme-preview { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tp { position: relative; border-radius: 12px; padding: 12px 12px 26px; display: grid; gap: 8px; align-content: start; border: 1px solid var(--line); overflow: hidden; min-height: 132px; }
.tp b { font-size: 15px; font-weight: 500; letter-spacing: -.02em; line-height: 1.15; }
.tp__btn { justify-self: start; font-size: 11px; font-weight: 600; color: #fff; border-radius: 99px; padding: 4px 10px; }
.tp__foot { position: absolute; left: 0; right: 0; bottom: 0; height: 14px; }
.theme-tabs { width: 100%; }
.theme-tabs button { flex: 1; }
#contrastNote { display: flex; gap: 6px; align-items: flex-start; }
#contrastNote svg { width: 16px; height: 16px; flex: none; margin-top: 1px; }

/* =====================================================================
   Dark mode (admin, client portal, login)
   ===================================================================== */
:root[data-theme="dark"] {
  --accent-soft: color-mix(in srgb, var(--accent) 15%, transparent);
  --side: #0b0b0b;
  --bg: #111111;
  --panel: #191919;
  --panel-2: #1e1e1e;
  --fill: #262626;
  --input: #141414;
  --ink: #f2f0eb;
  --text: #cbc8c1;
  --text-2: #a8a49c;
  --muted: #8e8a83;
  --line: #2a2a2a;
  --border-strong: #3a3a3a;
  --hover: rgba(255,255,255,.06);
  --on-ink: #141414;
  --ink-hover: #d9d6cf;
  --callout-ink: #ffc38a;
  --mark: #f2f0eb;
  --charcoal: #3a3a3a;
  --danger: #ff6b6b;
  --ok: #4fd18b;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 10px 30px -14px rgba(0,0,0,.7);
  color-scheme: dark;
}
[data-theme="dark"] .sidebar { border-right: 1px solid var(--line); }
[data-theme="dark"] .side-nav a:hover { background: #1c1c1c; }
[data-theme="dark"] .side-nav a.is-active { background: #202020; }
[data-theme="dark"] .table tbody tr:hover { background: var(--panel-2); }
[data-theme="dark"] dialog.modal::backdrop { background: rgba(0,0,0,.6); }
[data-theme="dark"] .badge { background: color-mix(in srgb, currentColor 16%, transparent); color: var(--text-2); }
[data-theme="dark"] .badge--accent { color: #ffac5e; }
[data-theme="dark"] .badge--blue { color: #8fb0ff; }
[data-theme="dark"] .badge--purple { color: #bba0ff; }
[data-theme="dark"] .badge--teal { color: #5fd4bf; }
[data-theme="dark"] .badge--yellow { color: #f0c74a; }
[data-theme="dark"] .badge--green { color: var(--ok); }
[data-theme="dark"] .badge--grey { color: #9a968f; }
[data-theme="dark"] .badge--red { color: var(--danger); }
[data-theme="dark"] .avatar--dark { color: #f2f0eb; }
[data-theme="dark"] .tabbar { border-top-color: var(--line); }
[data-theme="dark"] .toast svg { color: #c96500; }
[data-theme="dark"] .toast--error svg { color: #d93b3b; }
[data-theme="dark"] .color-field input[type="text"], [data-theme="dark"] .prefixed input { background: transparent; }
[data-theme="dark"] input[type="date"]::-webkit-calendar-picker-indicator { filter: invert(.8); }
.enq-new { background: #fffaf4; }
[data-theme="dark"] .enq-new { background: color-mix(in srgb, var(--accent) 6%, var(--panel)); }

/* Smooth switch between modes */
html.theme-fade, html.theme-fade * { transition: background-color .35s, color .35s, border-color .35s !important; }

/* Appearance picker */
.appearance { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.appearance button { border: 1.5px solid var(--line); border-radius: 12px; padding: 10px; background: var(--panel); display: grid; gap: 8px; text-align: left; color: var(--ink); font-weight: 500; font-size: 13px; }
.appearance button.is-active { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.ap-prev { height: 54px; border-radius: 8px; display: grid; grid-template-columns: 26% 1fr; overflow: hidden; border: 1px solid var(--line); }
.ap-light i:first-child { background: #151515; } .ap-light i:last-child { background: #f5f4f1; }
.ap-dark i:first-child { background: #0b0b0b; } .ap-dark i:last-child { background: #191919; }
.ap-auto i:first-child { background: #151515; } .ap-auto i:last-child { background: linear-gradient(135deg, #f5f4f1 50%, #191919 50%); }

/* =====================================================================
   Galleries, bulk upload, drag-to-reorder, animations, brand logos
   ===================================================================== */
.i.flip { transform: rotate(180deg); }

/* Upload progress panel */
.up-panel { position: fixed; right: 20px; bottom: 20px; z-index: 1001; width: min(320px, calc(100vw - 32px)); background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; box-shadow: var(--shadow); display: grid; gap: 10px; animation: pop .3s cubic-bezier(.16,1,.3,1); }
.up-panel__row { display: flex; align-items: center; gap: 10px; color: var(--ink); }
.up-panel__row .spinner { width: 16px; height: 16px; }
.up-panel__row svg { color: var(--accent); }
.up-panel small { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 860px) { .up-panel { left: 16px; right: 16px; width: auto; bottom: calc(84px + env(safe-area-inset-bottom)); } }

/* Bulk drop zone */
.bulk-drop { display: grid; justify-items: center; gap: 4px; text-align: center; padding: 22px 16px; margin-bottom: 14px; border: 1.5px dashed var(--border-strong); border-radius: 14px; background: var(--panel-2); color: var(--muted); cursor: pointer; transition: border-color .2s, background .2s, transform .2s; }
.bulk-drop svg { width: 26px; height: 26px; color: var(--accent); }
.bulk-drop b { color: var(--ink); font-weight: 600; }
.bulk-drop span { font-size: 12.5px; }
.bulk-drop:hover, .bulk-drop.is-drag { border-color: var(--accent); background: var(--accent-soft); }
.bulk-drop.is-drag { transform: scale(1.01); }
.how-ico { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }

/* Block rows: grip + thumbnail */
.blk-grip { cursor: grab; color: var(--border-strong); display: grid; place-items: center; width: 18px; margin-left: -4px; transform: rotate(90deg); }
.blk-grip:hover { color: var(--muted); }
.blk-grip:active { cursor: grabbing; }
.blk-item__icon--img { padding: 0; overflow: hidden; background: var(--fill); }
.blk-item__icon--img img, .blk-item__icon--img video { width: 100%; height: 100%; object-fit: cover; }
.blk-item.is-dragging, .logo-row.is-dragging, .gal-thumb.is-dragging { opacity: .4; }
.blk-item.is-over, .logo-row.is-over { box-shadow: 0 -3px 0 var(--accent); }
.media-field__preview.is-drag { outline: 2px dashed var(--accent); outline-offset: -2px; }

/* Gallery editor */
.gal-field { border-radius: 12px; transition: background .2s; }
.gal-field.is-drag { background: var(--accent-soft); outline: 2px dashed var(--accent); outline-offset: 4px; }
.gal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; margin-bottom: 8px; }
.gal-thumb { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--fill); cursor: grab; }
.gal-thumb img, .gal-thumb video { width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.gal-thumb.is-over { outline: 3px solid var(--accent); outline-offset: -3px; }
.gal-thumb__n { position: absolute; top: 6px; left: 6px; font-size: 11px; font-weight: 600; color: #fff; background: rgba(0,0,0,.55); border-radius: 99px; padding: 1px 7px; }
.gal-thumb__tools { position: absolute; left: 0; right: 0; bottom: 0; display: flex; justify-content: space-between; padding: 4px; background: linear-gradient(transparent, rgba(0,0,0,.65)); opacity: 0; transition: opacity .2s; }
.gal-thumb:hover .gal-thumb__tools, .gal-thumb:focus-within .gal-thumb__tools { opacity: 1; }
@media (hover: none) { .gal-thumb__tools { opacity: 1; } }
.gal-thumb__tools .icon-btn { width: 26px; height: 26px; color: #fff; border-radius: 7px; }
.gal-thumb__tools .icon-btn:hover { background: rgba(255,255,255,.2); color: #fff; }
.gal-thumb__tools .icon-btn svg { width: 15px; height: 15px; }
.gal-add { aspect-ratio: 1; border-radius: 10px; border: 1.5px dashed var(--border-strong); display: grid; place-content: center; justify-items: center; gap: 2px; text-align: center; color: var(--muted); cursor: pointer; font-size: 12.5px; padding: 6px; transition: border-color .2s, background .2s, color .2s; }
.gal-add svg { width: 20px; height: 20px; }
.gal-add span { color: var(--ink); font-weight: 500; }
.gal-add small { font-size: 11px; }
.gal-add:hover { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }

/* Multi-select in the media picker */
.media-tile.is-selected { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.media-tile.is-selected::after { content: attr(data-order); position: absolute; top: 8px; right: 8px; width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 12px; font-weight: 600; display: grid; place-items: center; }

/* Animation preview in the case-study editor */
.anim-demo { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 6px; height: 64px; cursor: pointer; }
.anim-demo span { position: relative; overflow: hidden; border-radius: 6px; background: linear-gradient(135deg, var(--accent), #ffb870); }
.anim-demo span:nth-child(2) { background: linear-gradient(135deg, #333, #666); }
.anim-demo span:nth-child(3) { background: linear-gradient(135deg, #cfc8bc, #f3efe8); }
.anim-demo.play span { animation: .9s cubic-bezier(.55,0,.1,1) both; }
.anim-demo.play span:nth-child(2) { animation-delay: .12s; }
.anim-demo.play span:nth-child(3) { animation-delay: .24s; }
.anim-demo--reveal.play span { animation-name: ad-reveal; }
.anim-demo--zoom.play span { animation-name: ad-zoom; }
.anim-demo--fade.play span { animation-name: ad-fade; }
.anim-demo--slide.play span { animation-name: ad-slide; }
.anim-demo--curtain.play span::after { content: ""; position: absolute; inset: 0; background: var(--accent); transform-origin: top; animation: ad-curtain .9s cubic-bezier(.55,0,.1,1) both; animation-delay: inherit; }
.anim-demo--curtain span { background: linear-gradient(135deg, #333, #777) !important; }
@keyframes ad-reveal { from { clip-path: inset(100% 0 0 0); } to { clip-path: inset(0); } }
@keyframes ad-zoom { from { transform: scale(1.35); opacity: 0; } }
@keyframes ad-fade { from { transform: translateY(24px); opacity: 0; } }
@keyframes ad-slide { from { transform: translateX(30%); opacity: 0; } }
@keyframes ad-curtain { to { transform: scaleY(0); } }

/* Brand logos */
.logo-list { display: grid; gap: 8px; }
.logo-row { display: flex; align-items: center; gap: 10px; padding: 8px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.logo-row .blk-grip { cursor: grab; }
.logo-row__img { width: 88px; height: 56px; flex: none; border-radius: 8px; background: var(--fill); display: grid; place-items: center; padding: 8px; }
.logo-row__img img { max-width: 100%; max-height: 100%; object-fit: contain; }
.logo-row__fields { flex: 1; min-width: 0; display: grid; grid-template-columns: 1fr 1.4fr; gap: 8px; }
@media (max-width: 600px) { .logo-row__fields { grid-template-columns: 1fr; } .logo-row__img { width: 64px; } }
.logo-preview { display: grid; gap: 8px; }
.lp { border-radius: 10px; padding: 14px; border: 1px solid var(--line); }
.lp--light { background: #fff; } .lp--dark { background: #0c0c0c; }
.lp__grid { display: grid; grid-template-columns: repeat(var(--cols, 4), 1fr); gap: 12px; align-items: center; }
.lp__grid span { height: 34px; display: grid; place-items: center; }
.lp__grid img { max-width: 100%; max-height: 100%; object-fit: contain; }
.lp--mono.lp--light img { filter: brightness(0); opacity: .75; }
.lp--mono.lp--dark img { filter: brightness(0) invert(1); opacity: .8; }

.logo-slot .media-field__preview { aspect-ratio: 3 / 1; max-width: 360px; background: var(--panel-2); }
.logo-slot .media-field__preview img { object-fit: contain; padding: 14px; }

.soc-prev { width: 38px; height: 38px; flex: none; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--line); color: var(--ink); background: var(--panel-2); }
.soc-prev svg { width: 18px; height: 18px; }
.soc-prev--none { color: var(--muted); font-size: 11px; font-weight: 600; }

/* Arabic translation page */
[lang="ar"], [dir="rtl"] { font-family: "Inter Tight", "Readex Pro", sans-serif; }
.tr-progress { display: flex; align-items: center; gap: 16px; padding: 16px 20px; margin-bottom: 16px; }
.tr-progress > div:first-child { white-space: nowrap; font-size: 14px; color: var(--text-2); }
.tr-progress b { color: var(--text); }
.tr-bar { flex: 1; height: 6px; border-radius: 99px; background: var(--fill); overflow: hidden; }
.tr-bar span { display: block; height: 100%; background: var(--accent); border-radius: inherit; transition: width .4s; }
.tr-tools { margin-bottom: 16px; flex-wrap: wrap; gap: 12px; }
.tr-search { max-width: 280px; margin-left: auto; }
.tr-group { margin-bottom: 16px; }
.tr-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; padding: 12px 0; border-top: 1px solid var(--line); align-items: start; }
.tr-row:first-child { border-top: 0; padding-top: 0; }
.tr-en small { display: block; font-size: 11.5px; color: var(--text-3, var(--text-2)); margin-bottom: 4px; }
.tr-en p { margin: 0; font-size: 14px; line-height: 1.5; white-space: pre-line; overflow-wrap: anywhere; }
.tr-ar { font-size: 15px; line-height: 1.6; resize: vertical; min-height: 40px; }
@media (max-width: 720px) {
  .tr-row { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .tr-search { max-width: none; margin-left: 0; width: 100%; }
  .tr-progress { flex-wrap: wrap; }
}

/* Arabic font preview (Site settings) */
.arf-preview { border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; display: grid; gap: 10px; background: var(--fill); }
.arf-h { font-size: 26px; color: var(--text); display: block; }
.arf-p { margin: 0; font-size: 15px; line-height: 1.75; color: var(--text-2); }
