/* BSFL Control Panel */
:root {
  --bg: #F5F1E8; --surface: #FFFFFF; --surface-2: #FBF9F4; --ink: #1F1E1B; --ink-2: #3A3833; --muted: #6F6A60;
  --line: #E6E0D3; --line-2: #D8D0BF;
  --brand: #1F1E1B; --brand-2: #2B2A27; --bone: #ECE5D6; --dim: #A8A193;
  --gold: #D9A441; --gold-ink: #7A5512; --gold-bg: #FBF0D9;
  --green: #2F7A4A; --green-bg: #E3F2E7; --blue: #2C5C93; --blue-bg: #E3ECF7; --violet: #5B3C8F; --violet-bg: #EEE6F8;
  --orange: #9A4A0B; --orange-bg: #FFE7D1; --rust: #A44A3F; --rust-bg: #F8E3DF; --grey-bg: #EFECE6;
  --r: 14px; --r-sm: 10px;
  --shadow: 0 1px 2px rgba(31,30,27,.06), 0 8px 24px -12px rgba(31,30,27,.18);
  --font: 'IBM Plex Sans Arabic', system-ui, Tahoma, sans-serif;
  --font-en: 'Archivo', 'Helvetica Neue', Arial, sans-serif;
  --nav-h: 64px;
  color-scheme: light;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body.cp { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.6 var(--font); -webkit-font-smoothing: antialiased; }
html[lang="en"] body.cp { font-family: var(--font-en); }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--gold-ink); }
[hidden] { display: none !important; }
.ltr { direction: ltr; unicode-bidi: isolate; display: inline-block; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- auth ---------- */
.cp-auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: radial-gradient(900px 500px at 80% -10%, rgba(217,164,65,.18), transparent 60%), var(--brand); }
.cp-auth-card { width: 100%; max-width: 400px; background: var(--surface); border-radius: 20px; padding: 32px 28px; box-shadow: 0 30px 80px -30px rgba(0,0,0,.6); }
.cp-logo { font: 800 14px/1 var(--font-en); letter-spacing: .16em; color: var(--gold-ink); margin-bottom: 18px; }
.cp-auth h1 { margin: 0 0 18px; font-size: 26px; }
.cp-form { display: grid; gap: 14px; }
.cp-form label { display: grid; gap: 6px; font-weight: 600; font-size: 14px; }
.cp-form input[type=text], .cp-form input[type=password] { width: 100%; border: 1px solid var(--line-2); border-radius: 12px; padding: 12px 14px; min-height: 48px; background: var(--surface-2); }
.cp-form input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(217,164,65,.22); }
.cp-check { display: flex !important; grid-auto-flow: column; align-items: center; gap: 8px; font-weight: 400 !important; }
.cp-alert { background: var(--rust-bg); color: var(--rust); padding: 10px 14px; border-radius: 10px; font-size: 14px; }
.cp-muted { color: var(--muted); }
.cp-small { font-size: 13px; margin-top: 16px; }

/* ---------- buttons ---------- */
.cp-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); font-weight: 600; font-size: 14px; cursor: pointer; text-decoration: none; white-space: nowrap; transition: background .15s, border-color .15s, color .15s; }
.cp-btn:hover { border-color: var(--ink-2); }
.cp-btn:disabled { opacity: .5; cursor: not-allowed; }
.cp-btn-gold { background: var(--gold); border-color: var(--gold); color: #241B08; }
.cp-btn-gold:hover { background: #E7B75A; border-color: #E7B75A; }
.cp-btn-dark { background: var(--ink); border-color: var(--ink); color: var(--bone); }
.cp-btn-green { background: var(--green); border-color: var(--green); color: #fff; }
.cp-btn-danger { color: var(--rust); border-color: #E7C3BD; }
.cp-btn-danger:hover { background: var(--rust-bg); border-color: var(--rust); }
.cp-btn-wa { background: #E6F6EA; border-color: #BFE3C8; color: #17643A; }
.cp-btn-sm { min-height: 34px; padding: 0 12px; font-size: 13px; }
.cp-btn-block { width: 100%; }
.cp-link { background: none; border: 0; padding: 0; color: var(--gold-ink); font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.cp-icon-btn { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); display: inline-grid; place-items: center; cursor: pointer; font-size: 18px; }

/* ---------- layout ---------- */
.cp-app { min-height: 100vh; }
.cp-boot { min-height: 100vh; display: grid; place-items: center; }
.cp-boot span, .cp-spin { width: 30px; height: 30px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--gold); animation: cpSpin .8s linear infinite; display: inline-block; }
.cp-spin { width: 18px; height: 18px; border-width: 2px; vertical-align: middle; }
@keyframes cpSpin { to { transform: rotate(360deg); } }

.cp-side { position: fixed; inset-block: 0; inset-inline-start: 0; width: 236px; background: var(--brand); color: var(--bone); display: flex; flex-direction: column; padding: 22px 14px; z-index: 30; }
.cp-side .cp-logo { color: var(--gold); padding: 0 10px; margin-bottom: 22px; }
.cp-nav { display: grid; gap: 4px; }
.cp-nav button { display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 12px; border: 0; border-radius: 12px; background: transparent; color: var(--dim); font-weight: 600; font-size: 15px; cursor: pointer; text-align: start; }
.cp-nav button:hover { color: var(--bone); background: rgba(255,255,255,.05); }
.cp-nav button.on { color: var(--ink); background: var(--bone); }
.cp-nav .ic { width: 22px; text-align: center; font-size: 17px; }
.cp-nav .badge { margin-inline-start: auto; background: var(--gold); color: #241B08; border-radius: 999px; font-size: 12px; min-width: 22px; height: 22px; display: inline-grid; place-items: center; padding: 0 6px; }
.cp-side-foot { margin-top: auto; padding: 12px 10px 0; border-top: 1px solid rgba(255,255,255,.08); font-size: 13px; color: var(--dim); display: grid; gap: 8px; }
.cp-side-foot a, .cp-side-foot button { color: var(--dim); background: none; border: 0; padding: 0; cursor: pointer; text-align: start; text-decoration: none; font-size: 13px; }
.cp-side-foot a:hover, .cp-side-foot button:hover { color: var(--bone); }

.cp-main { margin-inline-start: 236px; min-height: 100vh; }
.cp-top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; padding: 14px 28px; background: rgba(245,241,232,.92); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.cp-top h1 { margin: 0; font-size: 20px; font-weight: 700; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cp-top .cp-hello { color: var(--muted); font-size: 13px; }
.cp-content { padding: 22px 28px 60px; max-width: 1180px; }

.cp-bottom { display: none; }

@media (max-width: 900px) {
  .cp-side { display: none; }
  .cp-main { margin: 0; padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom)); }
  .cp-top { padding: 12px 16px; }
  .cp-top h1 { font-size: 18px; }
  .cp-content { padding: 16px 16px 40px; }
  .cp-bottom { display: flex; position: fixed; inset-inline: 0; bottom: 0; height: calc(var(--nav-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: var(--brand); z-index: 30; }
  .cp-bottom button { flex: 1; border: 0; background: none; color: var(--dim); display: grid; place-items: center; align-content: center; gap: 2px; font-size: 11px; font-weight: 600; position: relative; cursor: pointer; padding: 0 2px; }
  .cp-bottom button .ic { font-size: 19px; line-height: 1; }
  .cp-bottom button.on { color: var(--gold); }
  .cp-bottom .badge { position: absolute; top: 8px; inset-inline-start: calc(50% + 6px); background: var(--gold); color: #241B08; border-radius: 999px; font-size: 10px; min-width: 17px; height: 17px; display: grid; place-items: center; padding: 0 4px; }
}

/* ---------- cards & grids ---------- */
.cp-grid { display: grid; gap: 16px; }
.cp-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cp-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 1000px) { .cp-grid-3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 760px) { .cp-grid-2, .cp-grid-3 { grid-template-columns: 1fr; } }
.cp-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; box-shadow: var(--shadow); min-width: 0; }
.cp-card h2 { margin: 0 0 12px; font-size: 16px; display: flex; align-items: center; gap: 8px; }
.cp-card h2 .count { background: var(--grey-bg); color: var(--muted); font-size: 12px; border-radius: 999px; padding: 1px 9px; }
.cp-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.cp-card-head h2 { margin: 0; }
.cp-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
@media (max-width: 760px) { .cp-stats { grid-template-columns: 1fr 1fr; } }
.cp-stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; }
.cp-stat small { display: block; color: var(--muted); font-size: 12.5px; }
.cp-stat b { display: block; font: 700 26px/1.2 var(--font-en); margin-top: 4px; }
.cp-stat.alert { background: var(--gold-bg); border-color: #F0D9A6; }
.cp-empty { color: var(--muted); font-size: 14px; padding: 14px 0; text-align: center; }

/* ---------- lists ---------- */
.cp-list { display: grid; gap: 8px; }
.cp-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; cursor: pointer; text-align: start; width: 100%; transition: border-color .15s, box-shadow .15s; }
.cp-row:hover { border-color: var(--line-2); box-shadow: var(--shadow); }
.cp-card .cp-row { background: var(--surface-2); }
.cp-row-main { flex: 1; min-width: 0; display: grid; gap: 2px; }
.cp-row-main b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cp-row-main small { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cp-row-side { display: grid; justify-items: end; gap: 4px; text-align: end; flex: none; }
.cp-row-side small { color: var(--muted); font-size: 12.5px; }
.cp-when { flex: none; width: 58px; text-align: center; border-radius: 10px; background: var(--grey-bg); padding: 6px 4px; line-height: 1.15; }
.cp-when small { display: block; font-size: 11px; color: var(--muted); }
.cp-when b { display: block; font: 700 17px/1.2 var(--font-en); }
.cp-day-head { font-weight: 700; font-size: 13px; color: var(--muted); margin: 12px 2px 4px; }
.cp-day-head:first-child { margin-top: 0; }

.cp-badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--grey-bg); color: var(--ink-2); }
.st-awaiting_payment, .sg-new { background: var(--gold-bg); color: var(--gold-ink); }
.st-receipt_received { background: var(--orange-bg); color: var(--orange); }
.st-confirmed, .sg-client { background: var(--green-bg); color: var(--green); }
.st-completed, .sg-contacted { background: var(--blue-bg); color: var(--blue); }
.st-follow_up, .sg-interested { background: var(--violet-bg); color: var(--violet); }
.sg-booked { background: #E1F1EF; color: #1F6A62; }
.st-cancelled, .st-expired, .sg-not_fit { background: var(--grey-bg); color: var(--muted); }

/* ---------- toolbar / chips ---------- */
.cp-toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.cp-search { flex: 1; min-width: 200px; position: relative; }
.cp-search input { width: 100%; min-height: 44px; border: 1px solid var(--line-2); border-radius: 999px; padding: 0 16px; background: var(--surface); }
.cp-search input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(217,164,65,.2); }
.cp-chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 12px; scrollbar-width: thin; }
.cp-chip { flex: none; border: 1px solid var(--line-2); background: var(--surface); border-radius: 999px; padding: 6px 13px; font-size: 13.5px; font-weight: 600; cursor: pointer; color: var(--ink-2); display: inline-flex; gap: 6px; align-items: center; }
.cp-chip .n { font-size: 12px; color: var(--muted); font-weight: 500; }
.cp-chip.on { background: var(--ink); border-color: var(--ink); color: var(--bone); }
.cp-chip.on .n { color: var(--dim); }
.cp-more { display: flex; justify-content: center; margin-top: 14px; }

/* ---------- forms ---------- */
.cp-field { display: grid; gap: 6px; margin-bottom: 14px; }
.cp-field > span, .cp-label { font-weight: 600; font-size: 14px; }
.cp-field small, .cp-help { color: var(--muted); font-size: 12.5px; }
.cp-input, .cp-field input[type=text], .cp-field input[type=email], .cp-field input[type=url], .cp-field input[type=number], .cp-field input[type=date], .cp-field input[type=time], .cp-field input[type=tel], .cp-field select, .cp-field textarea, .cp-textarea {
  width: 100%; border: 1px solid var(--line-2); border-radius: var(--r-sm); padding: 10px 12px; min-height: 44px; background: var(--surface); }
.cp-field textarea, .cp-textarea { min-height: 90px; resize: vertical; line-height: 1.6; }
.cp-input:focus, .cp-field input:focus, .cp-field select:focus, .cp-field textarea:focus, .cp-textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(217,164,65,.2); }
.cp-row-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.cp-save-bar { position: sticky; bottom: 12px; display: flex; gap: 10px; align-items: center; justify-content: flex-end; padding: 10px 12px; margin-top: 16px; background: rgba(255,255,255,.92); border: 1px solid var(--line); border-radius: 999px; box-shadow: var(--shadow); backdrop-filter: blur(8px); z-index: 5; }
.cp-save-bar .msg { margin-inline-end: auto; color: var(--muted); font-size: 13px; padding-inline-start: 8px; }
@media (max-width: 900px) { .cp-save-bar { bottom: calc(var(--nav-h) + 10px + env(safe-area-inset-bottom)); } }
.cp-switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 600; }
.cp-switch input { position: absolute; opacity: 0; pointer-events: none; }
.cp-switch .tr { width: 42px; height: 24px; border-radius: 999px; background: var(--line-2); position: relative; transition: background .15s; flex: none; }
.cp-switch .tr::after { content: ""; position: absolute; top: 3px; inset-inline-start: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: inset-inline-start .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.cp-switch input:checked + .tr { background: var(--green); }
.cp-switch input:checked + .tr::after { inset-inline-start: 21px; }
.cp-switch input:focus-visible + .tr { outline: 2px solid var(--gold); outline-offset: 2px; }

/* schedule */
.cp-week { display: grid; gap: 8px; }
.cp-dayrow { display: grid; grid-template-columns: 150px 1fr; gap: 12px; align-items: start; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.cp-dayrow.closed { opacity: .75; }
@media (max-width: 600px) { .cp-dayrow { grid-template-columns: 1fr; } }
.cp-ranges { display: grid; gap: 8px; }
.cp-range { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cp-range input[type=time] { width: 128px; min-height: 40px; border: 1px solid var(--line-2); border-radius: 10px; padding: 6px 10px; background: var(--surface); direction: ltr; }
.cp-closed-label { color: var(--muted); font-size: 14px; padding-top: 8px; }
.cp-offlist { display: grid; gap: 6px; margin-bottom: 10px; }
.cp-off { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 10px; background: var(--rust-bg); color: #6A2A22; }
.cp-off span { flex: 1; }
.cp-addoff { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; }
.cp-addoff label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.cp-addoff input { min-height: 40px; border: 1px solid var(--line-2); border-radius: 10px; padding: 6px 10px; background: var(--surface); }

.cp-cal { display: grid; gap: 8px; }
.cp-cal-day { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: var(--surface-2); }
.cp-cal-day h3 { margin: 0 0 6px; font-size: 14px; display: flex; justify-content: space-between; gap: 8px; }
.cp-cal-day h3 small { color: var(--muted); font-weight: 500; }
.cp-cal-items { display: flex; flex-wrap: wrap; gap: 6px; }
.cp-slot { font: 600 13px/1 var(--font-en); padding: 6px 10px; border-radius: 8px; background: var(--surface); border: 1px dashed var(--line-2); color: var(--muted); direction: ltr; }
.cp-slot.booked { border-style: solid; cursor: pointer; }

/* ---------- drawer / modal ---------- */
.cp-overlay { position: fixed; inset: 0; background: rgba(31,30,27,.45); z-index: 60; display: flex; justify-content: flex-end; animation: cpFade .15s ease; }
html[dir="rtl"] .cp-overlay { justify-content: flex-start; }
@keyframes cpFade { from { opacity: 0; } }
.cp-drawer { width: min(620px, 100%); height: 100%; background: var(--bg); overflow-y: auto; box-shadow: -20px 0 60px -20px rgba(0,0,0,.4); animation: cpSlide .2s ease; display: flex; flex-direction: column; }
@keyframes cpSlide { from { transform: translateX(40px); opacity: .5; } }
html[dir="rtl"] .cp-drawer { animation-name: cpSlideR; }
@keyframes cpSlideR { from { transform: translateX(-40px); opacity: .5; } }
.cp-drawer-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 10px; padding: 14px 18px; background: var(--bg); border-bottom: 1px solid var(--line); }
.cp-drawer-head h2 { margin: 0; font-size: 18px; flex: 1; min-width: 0; }
.cp-drawer-body { padding: 16px 18px 40px; display: grid; gap: 14px; }
.cp-modal-wrap { position: fixed; inset: 0; background: rgba(31,30,27,.45); z-index: 80; display: grid; place-items: center; padding: 16px; animation: cpFade .15s ease; }
.cp-modal { width: min(480px, 100%); max-height: 90vh; overflow-y: auto; background: var(--surface); border-radius: 18px; padding: 22px; box-shadow: 0 30px 80px -30px rgba(0,0,0,.5); }
.cp-modal h3 { margin: 0 0 10px; font-size: 18px; }
.cp-modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; flex-wrap: wrap; }

.cp-kv { width: 100%; border-collapse: collapse; font-size: 14px; }
.cp-kv th { text-align: start; vertical-align: top; color: var(--muted); font-weight: 500; padding: 7px 10px 7px 0; width: 42%; border-bottom: 1px solid var(--line); }
html[dir="rtl"] .cp-kv th { padding: 7px 0 7px 10px; }
.cp-kv td { padding: 7px 0; border-bottom: 1px solid var(--line); white-space: pre-wrap; word-break: break-word; }
.cp-kv tr:last-child th, .cp-kv tr:last-child td { border-bottom: 0; }
.cp-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.cp-timebox { display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: 12px; background: var(--brand); color: var(--bone); }
.cp-timebox .big { font: 700 22px/1.2 var(--font-en); direction: ltr; }
.cp-timebox small { color: var(--dim); display: block; }
.cp-timebox .grow { flex: 1; }
.cp-receipt img { max-width: 100%; border-radius: 10px; border: 1px solid var(--line); display: block; }
.cp-hist { list-style: none; margin: 0; padding: 0; font-size: 13px; color: var(--muted); display: grid; gap: 6px; }
.cp-hist li { display: flex; gap: 8px; }
.cp-hist time { flex: none; direction: ltr; unicode-bidi: isolate; }
.cp-notes { display: grid; gap: 8px; }
.cp-note { background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font-size: 14px; white-space: pre-wrap; position: relative; }
.cp-note small { display: block; color: var(--muted); font-size: 12px; margin-bottom: 4px; }
.cp-note .del { position: absolute; top: 6px; inset-inline-end: 6px; border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 16px; }
.cp-stages { display: flex; flex-wrap: wrap; gap: 6px; }
.cp-stages button { border: 1px solid var(--line-2); background: var(--surface); border-radius: 999px; padding: 6px 12px; font-size: 13px; font-weight: 600; cursor: pointer; }
.cp-stages button.on { border-color: transparent; box-shadow: 0 0 0 2px var(--ink) inset; }
.cp-slots-pick { display: grid; gap: 10px; max-height: 50vh; overflow-y: auto; }
.cp-slots-pick .d { font-weight: 700; font-size: 13px; color: var(--muted); }
.cp-slots-pick .ts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.cp-slots-pick .ts button { font: 600 14px/1 var(--font-en); padding: 9px 12px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface); cursor: pointer; direction: ltr; }
.cp-slots-pick .ts button.on { background: var(--ink); color: var(--bone); border-color: var(--ink); }

/* content editor */
.cp-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.cp-tabs button { border: 0; background: none; padding: 10px 14px; font-weight: 600; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.cp-tabs button.on { color: var(--ink); border-bottom-color: var(--gold); }
.cp-sec { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); margin-bottom: 10px; overflow: hidden; }
.cp-sec > summary { list-style: none; cursor: pointer; padding: 13px 16px; font-weight: 700; display: flex; justify-content: space-between; gap: 10px; }
.cp-sec > summary::-webkit-details-marker { display: none; }
.cp-sec > summary::after { content: "+"; color: var(--muted); font-weight: 500; }
.cp-sec[open] > summary::after { content: "–"; }
.cp-sec-body { padding: 4px 16px 16px; display: grid; gap: 14px; }
.cp-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding-top: 12px; border-top: 1px solid var(--line); }
.cp-pair:first-child { border-top: 0; padding-top: 0; }
@media (max-width: 700px) { .cp-pair { grid-template-columns: 1fr; } }
.cp-pair label { display: grid; gap: 4px; font-size: 12.5px; color: var(--muted); }
.cp-pair textarea { min-height: 44px; }
.cp-pair textarea.changed { border-color: var(--gold); background: #FFFBF1; }
.cp-pair .locked { font-size: 12px; color: var(--muted); }
.cp-qr { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.cp-qr img { width: 130px; height: 130px; object-fit: contain; border: 1px solid var(--line); border-radius: 10px; background: #fff; padding: 6px; }
.cp-qr .ph { width: 130px; height: 130px; border: 1px dashed var(--line-2); border-radius: 10px; display: grid; place-items: center; color: var(--muted); font-size: 13px; text-align: center; padding: 8px; }

/* toasts */
.cp-toasts { position: fixed; z-index: 100; bottom: 20px; inset-inline-start: 50%; transform: translateX(-50%); display: grid; gap: 8px; width: min(92vw, 420px); }
html[dir="rtl"] .cp-toasts { transform: translateX(50%); }
@media (max-width: 900px) { .cp-toasts { bottom: calc(var(--nav-h) + 14px + env(safe-area-inset-bottom)); } }
.cp-toast { background: var(--ink); color: var(--bone); padding: 12px 16px; border-radius: 12px; box-shadow: 0 10px 30px -10px rgba(0,0,0,.5); font-size: 14px; animation: cpFade .2s ease; }
.cp-toast.err { background: var(--rust); color: #fff; }
.cp-toast.ok { background: var(--green); color: #fff; }

.cp-banner { padding: 12px 14px; border-radius: 12px; background: var(--gold-bg); color: var(--gold-ink); margin-bottom: 14px; font-size: 14px; }
.cp-banner.err { background: var(--rust-bg); color: var(--rust); }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
