/* ============================================================
   TALA — Transaction Wizard skin (scoped to the form page only)
   The approved "vault" redesign. Token blocks below are the
   single source of color/spacing tokens; everything else is
   authored against them and scoped under .wizard-shell so the
   rest of the app keeps its current look.
     [data-wizard-theme="vault"]   → "Vault"   (warm premium gold)
     [data-wizard-theme="mercury"] → "Mercury" (cool slate + gold)
   ============================================================ */

/* ---- theme tokens ------------------------------------------------ */
/* Unconditional fallback: guarantees every wizard token resolves even
   when [data-wizard-theme] is missing/empty/unrecognized. The attr-scoped
   "vault"/"mercury" blocks below still override these when present. */
.wizard-shell {
  --bg: #f3f1ec;
  --surface: #ffffff;
  --field: #f7f5f1;
  --chip: #f1eee8;
  --track-bg: #faf8f4;
  --line: #ebe6dc;
  --ink: #211d17;
  --ink-2: #5f584c;
  --muted: #7a7264;
  --nav-bg: rgba(255, 255, 255, .92);

  --accent: #a9803b;
  --on-accent: #fff8ec;
  --accent-ink: #946b27;
  --accent-soft: #f6edda;
  --accent-ring: rgba(169, 128, 59, .18);
  --accent-shadow: 0 10px 22px -8px rgba(169, 128, 59, .55);

  --card-r: 20px;
  --r-md: 15px;
  --card-shadow: 0 10px 26px -16px rgba(33, 29, 23, .28);

  --sell: #1f7a52; --sell-bg: #e9f4ee;
  --buy:  #b23a2b; --buy-bg:  #f9ebe8;
  --recv: #2f6bbf; --recv-bg: #ebf1fa;
  --pay:  #7d54b8; --pay-bg:  #f1ebfa;
  --ok: #1f7a52; --warn: #a9803b; --bad: #b23a2b;

  --gold: #a9803b;
  --gold-hover: #946b27;
  --gold-soft: #f6edda;
}

.wizard-shell[data-wizard-theme="vault"] {
  --bg: #f3f1ec;
  --surface: #ffffff;
  --field: #f7f5f1;
  --chip: #f1eee8;
  --track-bg: #faf8f4;
  --line: #ebe6dc;
  --ink: #211d17;
  --ink-2: #5f584c;
  --muted: #5f584c;
  --nav-bg: rgba(255, 255, 255, .92);

  --accent: #a9803b;
  --on-accent: #fff8ec;
  --accent-ink: #946b27;
  --accent-soft: #f6edda;
  --accent-ring: rgba(169, 128, 59, .18);
  --accent-shadow: 0 10px 22px -8px rgba(169, 128, 59, .55);

  --card-r: 20px;
  --r-md: 15px;
  --card-shadow: 0 10px 26px -16px rgba(33, 29, 23, .28);

  --sell: #1f7a52; --sell-bg: #e9f4ee;
  --buy:  #b23a2b; --buy-bg:  #f9ebe8;
  --recv: #2f6bbf; --recv-bg: #ebf1fa;
  --pay:  #7d54b8; --pay-bg:  #f1ebfa;
  --ok: #1f7a52; --warn: #a9803b; --bad: #b23a2b;
}

.wizard-shell[data-wizard-theme="mercury"] {
  --bg: #f4f6f8;
  --surface: #ffffff;
  --field: #f8fafc;
  --chip: #f1f4f7;
  --track-bg: #f8fafc;
  --line: #e6eaef;
  --ink: #0e1726;
  --ink-2: #4d5867;
  --muted: #95a0af;
  --nav-bg: rgba(255, 255, 255, .88);

  --accent: #0e1726;
  --on-accent: #ffffff;
  --accent-ink: #97701f;
  --accent-soft: #faf3e3;
  --accent-ring: rgba(14, 23, 38, .13);
  --accent-shadow: 0 6px 16px -6px rgba(14, 23, 38, .5);

  --card-r: 16px;
  --r-md: 13px;
  --card-shadow: none;

  --sell: #1f8a5b; --sell-bg: #e8f5ee;
  --buy:  #c0392b; --buy-bg:  #fbecea;
  --recv: #2a6fdb; --recv-bg: #eaf1fc;
  --pay:  #8a5cc4; --pay-bg:  #f2ecfb;
  --ok: #1f8a5b; --warn: #b97e10; --bad: #c0392b;
}

.wizard-shell[data-wizard-theme="warm"] {
  /* «Warm Authority» — cream + midnight navy (navy is the only accent) */
  --bg: #f0ede6;
  --surface: #ffffff;
  --field: #ffffff;
  --chip: #ece7dd;
  --track-bg: #f7f4ee;
  --line: #d6d0c4;
  --ink: #1c2b4a;
  --ink-2: #4a5870;
  --muted: #4a5870;
  --nav-bg: rgba(255, 255, 255, .96);

  --accent: #1c2b4a;
  --on-accent: #ffffff;
  --accent-ink: #1c2b4a;
  --accent-soft: #e7e9f0;
  --accent-ring: rgba(28, 43, 74, .16);
  --accent-shadow: 0 2px 8px rgba(28, 43, 74, .20);

  --gold: #1c2b4a;
  --gold-hover: #2a3f5f;
  --gold-soft: #e7e9f0;

  --card-r: 16px;
  --r-md: 12px;
  --card-shadow: 0 1px 4px rgba(28, 43, 74, .07);

  /* دسته‌بندیِ رنگیِ عملیات حفظ می‌شود (به‌خواستِ صاحب‌کار) */
  --sell: #1f8a5b; --sell-bg: #e8f5ee;
  --buy:  #c0392b; --buy-bg:  #fbecea;
  --recv: #2a6fdb; --recv-bg: #eaf1fc;
  --pay:  #8a5cc4; --pay-bg:  #f2ecfb;
  --ok: #1f8a5b; --warn: #1c2b4a; --bad: #dc2626;
}

/* ---- category color map (selected op-pick / review badge) -------- */
.wizard-shell .t-sell    { --cat: var(--sell); --cat-bg: var(--sell-bg); }
.wizard-shell .t-buy     { --cat: var(--buy);  --cat-bg: var(--buy-bg); }
.wizard-shell .t-receipt { --cat: var(--recv); --cat-bg: var(--recv-bg); }
.wizard-shell .t-payment { --cat: var(--pay);  --cat-bg: var(--pay-bg); }
.wizard-shell .t-expense { --cat: var(--warn); --cat-bg: var(--accent-soft); }

/* ---- themed canvas (full-bleed background) ---------------------- */
.wizard-shell {
  background: var(--bg);
  color: var(--ink);
  margin: -24px -16px -168px;
  padding: 24px 16px 168px;
  min-height: 100vh;
  font-variant-numeric: tabular-nums;
}
.wizard-shell .tnum { font-variant-numeric: tabular-nums; }

/* ---- header ------------------------------------------------------ */
.wizard-shell .wiz-head { margin: 0 0 18px; }
.wizard-shell .wiz-head .eyebrow {
  display: block;
  margin-bottom: 4px;
  color: var(--accent-ink);
  font-size: 12px;
  font-weight: 800;
}
.wizard-shell .wiz-head h1 {
  margin: 0;
  font-size: clamp(22px, 6vw, 28px);
  font-weight: 850;
  line-height: 1.25;
  color: var(--ink);
}

/* ---- stepper ----------------------------------------------------- */
.wizard-shell .stepper {
  position: sticky;
  top: 64px;
  z-index: 20;
  display: flex;
  align-items: flex-start;
  gap: 0;
  margin: -8px -16px 20px;
  padding: 14px 18px;
  background: var(--nav-bg);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px) saturate(1.1);
}
.wizard-shell .step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: var(--muted);
}
.wizard-shell .step .dot {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--surface);
  border: 1.5px solid var(--line);
  color: var(--muted);
  font-weight: 800;
  font-size: 14px;
  transition: background .2s ease, border-color .2s ease, color .2s ease;
}
.wizard-shell .step .dot-num { display: block; }
.wizard-shell .step .dot-check { display: none !important; }
.wizard-shell .step small {
  font-size: 11px;
  font-weight: 700;
  text-align: center;
  line-height: 1.2;
}

/* active step: accent dot with number, ink label */
.wizard-shell .step.is-active { color: var(--ink); }
.wizard-shell .step.is-active .dot {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}

/* complete step: accent dot, white check */
.wizard-shell .step.is-complete .dot {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}
/* completed step = filled gold circle keeping its number; no checkmark */

/* connector bars */
.wizard-shell .step-bar {
  flex: 1;
  height: 2px;
  margin-top: 16px;
  border-radius: 99px;
  background: var(--line);
  transition: background .2s ease;
}
.wizard-shell .step.is-complete + .step-bar { background: var(--accent); }

/* ---- cards ------------------------------------------------------- */
.wizard-shell .card.wcard {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--card-r);
  box-shadow: var(--card-shadow);
  padding: 18px 16px;
  margin-bottom: 14px;
}
.wizard-shell .wc-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--ink);
  line-height: 1.4;
}
.wizard-shell .wc-hint {
  margin-top: 2px;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.5;
}
.wizard-shell #gold-operation-section { border-top: 3px solid var(--accent-ink); }

/* ---- field labels & inputs --------------------------------------- */
.wizard-shell #transaction-form label,
.wizard-shell .field-label {
  display: block;
  margin-bottom: 6px;
  color: var(--ink-2);
  font-size: 12.5px;
  font-weight: 700;
}
.wizard-shell .required-mark { margin-inline-start: 2px; color: var(--bad); font-weight: 900; }
.wizard-shell #transaction-form .field { margin-bottom: 14px; min-width: 0; }
.wizard-shell #transaction-form .field:last-child { margin-bottom: 0; }

.wizard-shell #transaction-form input,
.wizard-shell #transaction-form select,
.wizard-shell #transaction-form textarea {
  width: 100%;
  min-height: 48px;
  background: var(--field);
  border: 1.5px solid var(--line);
  border-radius: var(--r-md);
  color: var(--ink);
  padding: 11px 14px;
  font-size: 16px;
  transition: background .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.wizard-shell #transaction-form textarea { min-height: 96px; resize: vertical; }
.wizard-shell #transaction-form input:focus,
.wizard-shell #transaction-form select:focus,
.wizard-shell #transaction-form textarea:focus {
  outline: none;
  background: var(--surface);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}
/* numeric / jalali inputs: right-aligned tabular */
.wizard-shell #transaction-form input[data-money],
.wizard-shell #transaction-form input[inputmode="numeric"] {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.wizard-shell #transaction-form input[data-jalali-date],
.wizard-shell #transaction-form input[data-jalali-datetime] { text-align: left; }

/* select as .selectbox: chevron on the LEFT (RTL) */
.wizard-shell #transaction-form select {
  appearance: none;
  -webkit-appearance: none;
  padding-inline-start: 42px;
  background-color: var(--accent);
  color: var(--on-accent);
  border-color: var(--accent);
  font-weight: 700;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 14px center;
}
.wizard-shell #transaction-form select:focus {
  background-color: var(--accent);
  color: var(--on-accent);
}

/* date+time pair sit side by side; branch full width */
.wizard-shell #transaction-form .field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.wizard-shell #transaction-form .field-grid > .field:first-child { grid-column: 1 / -1; }
.wizard-shell #transaction-form .grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

/* money input: تومان chip on the LEFT inside the field */
.wizard-shell #transaction-form .input-suffix { position: relative; }
.wizard-shell #transaction-form .input-suffix input { padding-left: 70px; padding-right: 14px; width: 100%; }
.wizard-shell #transaction-form .input-suffix span {
  position: absolute;
  left: 8px;
  right: auto;
  top: 50%;
  transform: translateY(-50%);
  background: var(--chip);
  color: var(--ink-2);
  font-size: 11px;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: 8px;
  pointer-events: none;
}

/* ---- operation picker — navy pill that opens a bottom sheet ------- */
.wizard-shell .op-select { margin-top: 14px; }
.wizard-shell .op-trigger { border-radius: var(--r-md); }
.wizard-shell .op-trigger:focus-visible {
  outline: 3px solid var(--accent-ring);
  outline-offset: 2px;
  box-shadow: none;
}

/* ---- counterparty found indicator -------------------------------- */
/* Base (non-wizard) callout — used on plain pages like «مقدار اولیه»
   which extend base.html and are NOT inside .wizard-shell. Without this,
   the inline SVG has no size box and balloons to full width. The more
   specific .wizard-shell .cp-found rule below still wins inside the wizard. */
.cp-found {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin: 0 0 14px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--amber-bg);
  border: 1px solid var(--amber);
  color: var(--amber);
  font-size: 13px;
  font-weight: 700;
}
.cp-found svg { width: 18px; height: 18px; flex: none; margin-top: 2px; }

.wizard-shell .cp-found {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin-bottom: 14px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--amber-bg);
  border: 1px solid var(--amber);
  color: var(--amber);
  font-size: 13px;
  font-weight: 700;
}
.wizard-shell .cp-found svg { width: 18px; height: 18px; flex: none; margin-top: 2px; }
.wizard-shell .cp-found b { font-weight: 800; }
.wizard-shell .cp-found-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-start;
}
.wizard-shell .cp-found-newbtn {
  border: 1px solid var(--accent);
  background: transparent;
  color: var(--amber);
  border-radius: 8px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.wizard-shell .cp-found-newbtn:hover { background: var(--accent-soft); }

/* ---- counterparty name picker trigger ----------------------------- */
.wizard-shell .cp-name-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 52px;
  border: 1px solid var(--accent);
  border-radius: var(--r-md);
  background: var(--accent);
  color: var(--on-accent);
  padding: 12px 15px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  margin-bottom: 8px;
}
.wizard-shell .cp-name-trigger .ui-icon {
  width: 18px;
  height: 18px;
  color: var(--on-accent);
  transform: rotate(90deg);
}
.wizard-shell .cp-name-trigger:hover { filter: brightness(1.08); }

/* ---- segmented (gold category / transfer asset) ------------------ */
.wizard-shell #transaction-form .segmented { margin: 8px 0 16px; }
.wizard-shell #transaction-form .segmented ul {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
  gap: 6px;
  padding: 5px;
  margin: 0;
  list-style: none;
  background: var(--chip);
  border: 1px solid var(--line);
  border-radius: 13px;
}
.wizard-shell #transaction-form .segmented input[type="radio"],
.wizard-shell #transaction-form .segmented input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 1px;
  height: 1px;
  margin: 0;
}
.wizard-shell #transaction-form .segmented label {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  margin: 0;
  padding: 10px 12px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background .18s ease, color .18s ease, box-shadow .18s ease;
}
.wizard-shell #transaction-form .segmented label:hover { color: var(--ink); background: transparent; }
.wizard-shell #transaction-form .segmented label:has(input:checked) {
  background: var(--accent);
  color: var(--on-accent);
  box-shadow: none;
  font-weight: 800;
}
.wizard-shell #transaction-form .segmented-sub { margin: 0 0 14px; }
.wizard-shell #transaction-form .segmented-sub ul { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.wizard-shell #transaction-form .segmented-sub label { flex-direction: column; gap: 4px; min-height: 48px; font-size: 13px; }

/* ---- نوع طلا — icon-card grid ------------------------------------ */
.wizard-shell .gold-type-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 8px 0 16px;
}
.wizard-shell .gt-card {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  padding: 12px 13px;
  border: 1.5px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  text-align: right;
  transition: border-color .18s ease, background .18s ease, color .18s ease;
}
.wizard-shell .gt-card.full { grid-column: 1 / -1; }
.wizard-shell .gt-card .gt-ic {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  border-radius: 11px;
  background: var(--chip);
  color: var(--ink-2);
  transition: background .18s ease, color .18s ease;
}
.wizard-shell .gt-card .gt-ic svg { width: 19px; height: 19px; }
.wizard-shell .gt-card b { font-size: 14.5px; font-weight: 800; }
.wizard-shell .gt-card.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}
.wizard-shell .gt-card.is-active .gt-ic { background: rgba(255, 255, 255, .16); color: var(--on-accent); }
.wizard-shell .gt-card:focus-visible { outline: 3px solid var(--accent-ring); outline-offset: 2px; }

/* ---- product panels ---------------------------------------------- */
.wizard-shell .product-panel {
  margin-top: 14px;
  padding: 16px;
  background: var(--field);
  border: 1px solid var(--line);
  border-top: 3px solid var(--accent-ink);
  border-radius: var(--r-md);
}
.wizard-shell .product-panel h3 { margin: 0 0 14px; font-size: 16px; font-weight: 800; color: var(--ink); }

/* ---- payment tracker --------------------------------------------- */
.wizard-shell #payment-tracker.tracker {
  margin-bottom: 16px;
  padding: 14px;
  background: var(--track-bg);
  border: 1px solid var(--line);
  border-radius: 16px;
}
.wizard-shell .tk-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 5px 0;
  font-size: 13.5px;
}
.wizard-shell .tk-row span { color: var(--ink-2); }
.wizard-shell .tk-row strong { color: var(--ink); font-size: 14px; font-variant-numeric: tabular-nums; }
.wizard-shell .tk-div { height: 1px; background: var(--line); margin: 6px 0; }
.wizard-shell .payment-tracker-remaining strong { color: var(--accent-ink); font-size: 16px; font-weight: 900; }
.wizard-shell .tracker-zero strong { color: var(--ok); }
.wizard-shell .tracker-positive strong { color: var(--bad); }
.wizard-shell .tracker-negative strong { color: var(--warn); }
.wizard-shell .tk-progress {
  height: 7px;
  margin-top: 10px;
  background: var(--line);
  border-radius: 99px;
  overflow: hidden;
}
.wizard-shell .tk-progress i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--accent);
  border-radius: 99px;
  transition: width .25s ease, background .25s ease;
}
.wizard-shell .tracker-zero .tk-progress i { background: var(--ok); }

/* ---- payment / tagged cards -------------------------------------- */
.wizard-shell .pay-card {
  margin-bottom: 12px;
  padding: 12px;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: 14px;
  box-shadow: none;
}
.wizard-shell .pay-card input[type="checkbox"][name$="-DELETE"] { display: none; }
.wizard-shell .pc-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  padding-bottom: 0;
  border: 0;
  font-weight: 800;
}
.wizard-shell .pc-head b { font-size: 14px; }
.wizard-shell .pc-del {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--field);
  color: var(--bad);
  cursor: pointer;
  transition: background .18s ease;
}
.wizard-shell .pc-del .ui-icon { width: 17px; height: 17px; }
.wizard-shell .pc-del:hover { background: var(--buy-bg); }
.wizard-shell .pc-del:disabled { opacity: .35; cursor: not-allowed; }
.wizard-shell .payment-card-fields { display: grid; grid-template-columns: 1fr; gap: 10px; margin-top: 10px; }

/* ---- add-row buttons (dashed accent) ----------------------------- */
.wizard-shell #transaction-form .add-btn {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 48px;
  margin-top: 4px;
  padding: 13px;
  background: var(--accent-soft);
  color: var(--accent-ink);
  border: 1.5px dashed var(--accent);
  border-radius: 13px;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  transition: filter .18s ease;
}
.wizard-shell #transaction-form .add-btn .ui-icon { width: 18px; height: 18px; }
.wizard-shell #transaction-form .add-btn:hover { filter: brightness(.98); }
.wizard-shell #transaction-form .add-btn:active { transform: translateY(1px); }

/* ---- description toggle button ----------------------------------- */
.wizard-shell #transaction-form .desc-toggle-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin-top: 14px;          /* P2-6: فاصله از کارتِ بالایی، هم‌تراز با سایر بخش‌ها */
  min-height: 44px;
  padding: 11px 16px;
  background: transparent;
  border: 1.5px dashed var(--border);
  border-radius: var(--radius-md);
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .18s, color .18s, background .18s;
}
.wizard-shell #transaction-form .desc-toggle-btn .ui-icon { width: 16px; height: 16px; flex-shrink: 0; }
.wizard-shell #transaction-form .desc-toggle-btn .desc-toggle-label { flex: 1; text-align: right; }
.wizard-shell #transaction-form .desc-toggle-btn .desc-toggle-chev {
  display: flex; align-items: center;
  transition: transform .2s;
}
.wizard-shell #transaction-form .desc-toggle-btn[aria-expanded="true"] .desc-toggle-chev { transform: rotate(180deg); }
.wizard-shell #transaction-form .desc-toggle-btn:hover { border-color: var(--accent); color: var(--accent-ink); background: var(--accent-soft); }
.wizard-shell #transaction-form .desc-toggle-btn[aria-expanded="true"] { border-color: var(--accent); color: var(--accent-ink); }

/* ---- review step ------------------------------------------------- */
.wizard-shell .review-receipt { position: relative; padding-top: 18px; }
.wizard-shell .review-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
  padding: 7px 12px;
  border-radius: 99px;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-size: 13px;
  font-weight: 800;
}
.wizard-shell .review-badge .rb-ic { display: inline-flex; }
.wizard-shell .review-badge .rb-ic .ui-icon,
.wizard-shell .review-badge svg { width: 16px; height: 16px; }
.wizard-shell .review-badge.t-sell    { background: var(--sell-bg); color: var(--sell); }
.wizard-shell .review-badge.t-buy     { background: var(--buy-bg);  color: var(--buy); }
.wizard-shell .review-badge.t-receipt { background: var(--recv-bg); color: var(--recv); }
.wizard-shell .review-badge.t-payment { background: var(--pay-bg);  color: var(--pay); }
.wizard-shell .review-badge.t-expense { background: var(--accent-soft); color: var(--warn); }

.wizard-shell .amount-hero {
  margin: 14px 0;
  padding: 16px;
  text-align: center;
  border-radius: 16px;
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
}
@supports not (color: color-mix(in srgb, red, blue)) {
  .wizard-shell .amount-hero { border-color: #e7d9bd; }
}
.wizard-shell .amount-hero .ah-label { font-size: 12px; color: var(--accent-ink); font-weight: 700; }
.wizard-shell .amount-hero .ah-val {
  margin-top: 4px;
  font-size: 26px;
  font-weight: 800;
  color: var(--accent-ink);
  font-variant-numeric: tabular-nums;
}

.wizard-shell .r-list { display: grid; gap: 0; margin: 0; }
.wizard-shell .r-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.wizard-shell .r-row:last-child { border-bottom: 0; }
.wizard-shell .r-row dt { color: var(--ink-2); font-size: 13px; }
.wizard-shell .r-row dd { margin: 0; font-weight: 700; color: var(--ink); text-align: left; }
.wizard-shell .r-row.total dd { color: var(--accent-ink); font-size: 15px; }

/* ---- overflow guard: numbers/badges/triggers never spill their box -- */
.wizard-shell .r-row dd,
.wizard-shell .amount-hero .ah-val,
.wizard-shell .review-badge,
.wizard-shell .cp-name-trigger {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
}

/* ---- sticky action bar ------------------------------------------- */
.wizard-shell #transaction-form .wizard-actions {
  background: var(--nav-bg);
  border-color: var(--line);
  backdrop-filter: blur(16px);
}
.wizard-shell #transaction-form .wizard-actions button {
  min-height: 46px;
  border-radius: 13px;
  font-weight: 800;
}
.wizard-shell #transaction-form .wizard-actions [data-next-step]:disabled,
.wizard-shell #transaction-form .wizard-actions [data-next-step].is-disabled {
  opacity: .45;
  box-shadow: none;
  filter: grayscale(.35);
  cursor: not-allowed;
}
.wizard-shell #transaction-form .wizard-actions .btn-primary,
.wizard-shell #transaction-form .btn-primary {
  background: var(--accent);
  color: var(--on-accent);
  border-color: transparent;
  box-shadow: var(--accent-shadow);
}
.wizard-shell #transaction-form .btn-primary:hover {
  background: var(--accent);
  filter: brightness(1.05);
  box-shadow: var(--accent-shadow);
}
.wizard-shell #transaction-form .btn-secondary,
.wizard-shell #transaction-form .wizard-actions [data-prev-step] {
  background: var(--chip);
  color: var(--ink);
  border-color: var(--line);
}
.wizard-shell #transaction-form .btn-secondary:hover,
.wizard-shell #transaction-form .wizard-actions [data-prev-step]:hover {
  background: var(--surface);
  border-color: var(--accent);
  color: var(--accent-ink);
}

/* ---- draft restored bar ------------------------------------------ */
.wizard-shell .draft-restored-bar {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent-ink);
}

/* ---- focus visibility on interactive controls -------------------- */
.wizard-shell #transaction-form .add-btn:focus-visible,
.wizard-shell #transaction-form .pc-del:focus-visible,
.wizard-shell #transaction-form .wizard-actions button:focus-visible {
  outline: 3px solid var(--accent-ring);
  outline-offset: 2px;
}

/* ============================================================
   Single smart page — همهٔ مراحل در یک صفحه (بدون ویزاردِ سه‌مرحله‌ای).
   ارسالِ فرم همهٔ بخش‌ها را با هم اعتبارسنجی می‌کند، پس نمایشِ یکجا امن است.
   ============================================================ */
.wizard-shell .step-dots { display: none !important; }
.wizard-shell #transaction-form .form-step { display: block !important; }
.wizard-shell #transaction-form .form-step + .form-step { margin-top: 4px; }
.wizard-shell #transaction-form .wizard-actions [data-next-step] { display: none !important; }
.wizard-shell #transaction-form .wizard-actions [data-submit-step] { display: inline-flex !important; }

/* ── شیتِ «اتیکت‌های موجود» (انتخاب از انبار، یا افزودنِ جدید) ── */
.tag-stock-sheet[hidden] { display: none; }
/* P2-3: بالاتر از نوارِ «ثبت عملیات» (z-index 60) باز شود تا زیرِ آن نیفتد. */
.tag-stock-sheet { position: fixed; inset: 0; z-index: 120; display: flex; align-items: flex-end; justify-content: center; }
.tag-stock-sheet .tss-backdrop { position: absolute; inset: 0; background: rgba(20, 24, 40, .45); }
.tag-stock-sheet .tss-panel { position: relative; width: min(100%, 520px); max-height: 80vh; display: flex; flex-direction: column;
  background: var(--surface, #fff); border-radius: 18px 18px 0 0; padding: 14px 14px calc(14px + env(safe-area-inset-bottom));
  box-shadow: 0 -8px 30px rgba(0, 0, 0, .2); animation: tssUp .18s ease; }
@keyframes tssUp { from { transform: translateY(16px); opacity: .6; } to { transform: none; opacity: 1; } }
.tss-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.tss-head b { font-size: 15px; }
.tss-x { border: 0; background: transparent; font-size: 22px; line-height: 1; color: var(--muted, #666); cursor: pointer; padding: 4px 8px; }
.tss-search { width: 100%; border: 1px solid var(--border, #e6e1d6); border-radius: 12px; padding: 10px 12px; margin-bottom: 10px; font: inherit; background: var(--bg, #f7f5f0); }
.tss-list { flex: 1; overflow: auto; display: flex; flex-direction: column; gap: 6px; min-height: 80px; }
.tss-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; border: 1px solid var(--border, #e6e1d6); border-radius: 12px;
  padding: 11px 13px; background: var(--surface, #fff); cursor: pointer; font: inherit; text-align: start; }
.tss-item:hover, .tss-item:active { background: var(--accent-soft, #eef0f6); border-color: var(--accent, #1c2b4a); }
.tss-item b { font-size: 14px; }
.tss-item span { color: var(--muted, #666); font-size: 13px; }
.tss-empty { color: var(--muted, #888); text-align: center; padding: 18px 8px; font-size: 13px; }
.tss-new { margin-top: 10px; width: 100%; justify-content: center; }
body.tss-open { overflow: hidden; }

/* ── چیپِ «اطلاعات ثبت» (T36) — تاشو، خلاصهٔ زنده ── */
.reg-chip-wrap { margin-bottom: 10px; }
.reg-chip { width: 100%; display: flex; align-items: center; gap: 10px; border: 1px solid var(--border, #e6e1d6);
  background: var(--surface, #fff); border-radius: 14px; padding: 11px 14px; cursor: pointer; font: inherit; color: var(--text, #211d17); text-align: start; }
.reg-chip:hover { border-color: var(--accent, #1c2b4a); }
.reg-chip-ic { display: inline-flex; color: var(--accent, #1c2b4a); }
.reg-chip-ic svg { width: 18px; height: 18px; }
.reg-chip-summary { flex: 1; font-size: 13.5px; font-weight: 600; }
.reg-chip-chev { color: var(--muted, #888); display: inline-flex; transition: transform .15s; }
.reg-chip-chev svg { width: 16px; height: 16px; }
.reg-chip[aria-expanded="true"] .reg-chip-chev { transform: rotate(180deg); }
.reg-editor { margin-top: 8px; }
