/* ==========================================================================
   ChekYar (chek.ravandata.ir) — VibeFarsi RTL Tokens & Light/Dark System
   ========================================================================== */

:root {
  /* Light / Dark dual-mode colors with fallback + modern light-dark() */
  --bg-light: oklch(0.985 0.004 220);
  --bg-dark: oklch(0.125 0.012 245);
  --fg-light: oklch(0.18 0.015 245);
  --fg-dark: oklch(0.96 0.006 220);
  --card-light: oklch(1 0 0);
  --card-dark: oklch(0.165 0.014 245);
  --muted-bg-light: oklch(0.955 0.008 220);
  --muted-bg-dark: oklch(0.21 0.016 245);
  --muted-fg-light: oklch(0.45 0.018 240);
  --muted-fg-dark: oklch(0.72 0.014 235);
  --border-light: oklch(0.2 0.015 245 / 12%);
  --border-dark: oklch(1 0 0 / 12%);
  --brand-light: oklch(0.5 0.14 185);
  --brand-dark: oklch(0.75 0.14 182);
  --brand-fg-light: oklch(0.99 0 0);
  --brand-fg-dark: oklch(0.13 0.03 185);
  --danger-light: oklch(0.54 0.21 25);
  --danger-dark: oklch(0.72 0.19 25);
  --danger-bg-light: oklch(0.96 0.03 25);
  --danger-bg-dark: oklch(0.25 0.06 25);
  --success-light: oklch(0.48 0.15 155);
  --success-dark: oklch(0.76 0.15 158);
  --warn-light: oklch(0.6 0.15 72);
  --warn-dark: oklch(0.82 0.15 78);

  --background: var(--bg-light);
  --foreground: var(--fg-light);
  --card: var(--card-light);
  --muted: var(--muted-bg-light);
  --muted-foreground: var(--muted-fg-light);
  --border: var(--border-light);
  --brand: var(--brand-light);
  --brand-foreground: var(--brand-fg-light);
  --destructive: var(--danger-light);
  --destructive-bg: var(--danger-bg-light);
  --success: var(--success-light);
  --warning: var(--warn-light);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --shadow-card: 0 2px 12px -4px rgb(15 23 42 / 7%);
  --font-sans: "Vazirmatn", system-ui, -apple-system, sans-serif;

  /* MANDATORY: Base color-scheme stays light dark so system preference works without JS */
  color-scheme: light dark;
  accent-color: var(--brand);
  scrollbar-color: var(--muted-foreground) transparent;
}

@media (prefers-color-scheme: dark) {
  :root {
    --background: var(--bg-dark);
    --foreground: var(--fg-dark);
    --card: var(--card-dark);
    --muted: var(--muted-bg-dark);
    --muted-foreground: var(--muted-fg-dark);
    --border: var(--border-dark);
    --brand: var(--brand-dark);
    --brand-foreground: var(--brand-fg-dark);
    --destructive: var(--danger-dark);
    --destructive-bg: var(--danger-bg-dark);
    --success: var(--success-dark);
    --warning: var(--warn-dark);
    --shadow-card: 0 1px 0 0 oklch(1 0 0 / 6%) inset, 0 14px 34px -18px rgb(0 0 0 / 65%);
  }
}

:root:has(> head > meta[name="color-scheme"][content="dark"]) {
  color-scheme: dark;
  --background: var(--bg-dark);
  --foreground: var(--fg-dark);
  --card: var(--card-dark);
  --muted: var(--muted-bg-dark);
  --muted-foreground: var(--muted-fg-dark);
  --border: var(--border-dark);
  --brand: var(--brand-dark);
  --brand-foreground: var(--brand-fg-dark);
  --destructive: var(--danger-dark);
  --destructive-bg: var(--danger-bg-dark);
  --success: var(--success-dark);
  --warning: var(--warn-dark);
  --shadow-card: 0 1px 0 0 oklch(1 0 0 / 6%) inset, 0 14px 34px -18px rgb(0 0 0 / 65%);
}

:root:has(> head > meta[name="color-scheme"][content="light"]) {
  color-scheme: light;
  --background: var(--bg-light);
  --foreground: var(--fg-light);
  --card: var(--card-light);
  --muted: var(--muted-bg-light);
  --muted-foreground: var(--muted-fg-light);
  --border: var(--border-light);
  --brand: var(--brand-light);
  --brand-foreground: var(--brand-fg-light);
  --destructive: var(--danger-light);
  --destructive-bg: var(--danger-bg-light);
  --success: var(--success-light);
  --warning: var(--warn-light);
  --shadow-card: 0 2px 12px -4px rgb(15 23 42 / 7%);
}

@supports (color: light-dark(white, black)) {
  :root {
    --background: light-dark(var(--bg-light), var(--bg-dark));
    --foreground: light-dark(var(--fg-light), var(--fg-dark));
    --card: light-dark(var(--card-light), var(--card-dark));
    --muted: light-dark(var(--muted-bg-light), var(--muted-bg-dark));
    --muted-foreground: light-dark(var(--muted-fg-light), var(--muted-fg-dark));
    --border: light-dark(var(--border-light), var(--border-dark));
    --brand: light-dark(var(--brand-light), var(--brand-dark));
    --brand-foreground: light-dark(var(--brand-fg-light), var(--brand-fg-dark));
    --destructive: light-dark(var(--danger-light), var(--danger-dark));
    --destructive-bg: light-dark(var(--danger-bg-light), var(--danger-bg-dark));
    --success: light-dark(var(--success-light), var(--success-dark));
    --warning: light-dark(var(--warn-light), var(--warn-dark));
  }
}

/* Theme Toggle CSS Branching without JS dependency */
.theme-toggle .theme-opt {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.theme-toggle .theme-opt-to-light { display: none; }
.theme-toggle .theme-opt-to-dark { display: inline-flex; }

@media (prefers-color-scheme: dark) {
  :root:not(:has(> head > meta[name="color-scheme"][content="light"])) .theme-toggle .theme-opt-to-light {
    display: inline-flex;
  }
  :root:not(:has(> head > meta[name="color-scheme"][content="light"])) .theme-toggle .theme-opt-to-dark {
    display: none;
  }
}
:root:has(> head > meta[name="color-scheme"][content="dark"]) .theme-toggle .theme-opt-to-light {
  display: inline-flex;
}
:root:has(> head > meta[name="color-scheme"][content="dark"]) .theme-toggle .theme-opt-to-dark {
  display: none;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.8;
  letter-spacing: 0;
  background-color: var(--background);
  color: var(--foreground);
}

body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background-color: var(--background);
  color: var(--foreground);
}

/* Prevent iOS Safari auto-zoom on form controls */
@supports (-webkit-touch-callout: none) {
  input, select, textarea {
    font-size: max(1rem, 1em);
  }
}

.visually-hidden:where(:not(:focus-within, :active)) {
  position: absolute !important;
  clip-path: inset(50%) !important;
  overflow: hidden !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  border: 0 !important;
  white-space: nowrap !important;
}

/* Sticky Top Bar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background-color: color-mix(in oklch, var(--background) 88%, transparent);
  backdrop-filter: blur(14px);
  border-block-end: 1px solid var(--border);
}

.topbar-inner {
  max-width: 1120px;
  margin-inline: auto;
  padding: 12px 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
}

.brand-mark {
  inline-size: 44px;
  block-size: 44px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-md);
  background: color-mix(in oklch, var(--brand) 16%, transparent);
  border: 1px solid color-mix(in oklch, var(--brand) 36%, transparent);
  font-size: 22px;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.35;
}
.brand-text strong { font-size: 1rem; font-weight: 800; }
.brand-text small { font-size: 0.78rem; color: var(--muted-foreground); }

.main-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.nav-pill {
  min-block-size: 44px;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--foreground);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: border-color 180ms ease, background-color 180ms ease;
}
.nav-pill:hover {
  border-color: var(--brand);
}
.nav-pill.is-active {
  background: var(--brand);
  color: var(--brand-foreground);
  border-color: var(--brand);
}

.nav-badge {
  display: inline-grid;
  place-items: center;
  min-inline-size: 22px;
  block-size: 22px;
  padding-inline: 6px;
  border-radius: 999px;
  background: color-mix(in oklch, var(--foreground) 14%, transparent);
  font-size: 0.78rem;
  font-weight: 700;
}
.nav-pill.is-active .nav-badge {
  background: color-mix(in oklch, var(--brand-foreground) 18%, transparent);
}

.theme-toggle {
  min-block-size: 44px;
  min-inline-size: 44px;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--foreground);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.theme-toggle:hover { border-color: var(--brand); }

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

/* Main Page Container */
.page-wrap {
  flex: 1;
  width: 100%;
  max-width: 1120px;
  margin-inline: auto;
  padding: 20px 16px 40px;
}

.hero-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px;
  margin-block-end: 20px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}
.hero-strip h1 {
  margin: 0 0 6px;
  font-size: 1.25rem;
  line-height: 1.35;
  font-weight: 800;
}
.hero-sub {
  margin: 0;
  color: var(--muted-foreground);
  font-size: 0.92rem;
}

.fee-badge {
  padding: 12px 18px;
  border-radius: var(--radius-md);
  background: color-mix(in oklch, var(--brand) 12%, transparent);
  border: 1px solid color-mix(in oklch, var(--brand) 30%, transparent);
  display: flex;
  flex-direction: column;
  text-align: center;
  min-inline-size: 180px;
}
.fee-badge small { font-size: 0.8rem; color: var(--muted-foreground); }
.fee-badge strong { font-size: 1.2rem; color: var(--brand); font-weight: 800; }

/* Two-Column Workspace */
.check-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 20px;
  align-items: start;
}

.form-column {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-inline-size: 0;
}

.summary-column {
  position: sticky;
  top: 84px;
  min-inline-size: 0;
}

@media (max-width: 960px) {
  .check-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .summary-column {
    position: static;
  }
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-card);
  min-inline-size: 0;
}

.card-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-block-end: 16px;
}
.card-head h2 {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.3;
  font-weight: 700;
}
.card-head p {
  margin: 4px 0 0;
  font-size: 0.86rem;
  color: var(--muted-foreground);
}

.step-num {
  inline-size: 36px;
  block-size: 36px;
  flex-shrink: 0;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: color-mix(in oklch, var(--brand) 16%, transparent);
  color: var(--brand);
  font-weight: 800;
}

/* Direction Radio Cards */
.direction-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-block-end: 16px;
}
@media (max-width: 560px) {
  .direction-switch { grid-template-columns: minmax(0, 1fr); }
}

.dir-card {
  cursor: pointer;
  display: block;
}
.dir-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.dir-card-body {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  min-block-size: 64px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border);
  background: var(--muted);
  transition: border-color 180ms ease, background-color 180ms ease;
}
.dir-card input:checked + .dir-card-body {
  border-color: var(--brand);
  background: color-mix(in oklch, var(--brand) 12%, var(--card));
}
.dir-card input:focus-visible + .dir-card-body {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}
.dir-ico { font-size: 24px; }
.dir-card-body strong { display: block; font-size: 0.95rem; }
.dir-card-body small { display: block; font-size: 0.8rem; color: var(--muted-foreground); }

/* Form Grid & Inputs */
.fields-row {
  display: grid;
  gap: 14px;
  margin-block-end: 14px;
}
.fields-row.two-col { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.fields-row.three-col { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 680px) {
  .fields-row.two-col,
  .fields-row.three-col { grid-template-columns: minmax(0, 1fr); }
}

.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-inline-size: 0;
}
.field label {
  font-size: 0.9rem;
  font-weight: 600;
}
.hint {
  font-size: 0.78rem;
  color: var(--muted-foreground);
  line-height: 1.5;
}

input[type="text"],
input[type="tel"],
input[type="email"],
input[type="number"],
select {
  width: 100%;
  min-block-size: 44px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--background);
  color: var(--foreground);
  font: inherit;
  font-size: 0.95rem;
}

/* Validation only after interaction (:user-invalid + JS fallback) */
.error-msg {
  display: none;
  color: var(--destructive);
  font-size: 0.8rem;
  margin-block-start: 2px;
}

:is(input, select, textarea):is(:user-invalid, .user-invalid-fallback) {
  border-color: var(--destructive);
  background-color: var(--destructive-bg);
}
:is(input, select, textarea):is(:user-invalid, .user-invalid-fallback) + .error-msg,
.date-input-wrap:has(:is(:user-invalid, .user-invalid-fallback)) + .error-msg {
  display: block;
}
:is(input, select, textarea):is(:user-valid, .user-valid-fallback) {
  border-color: var(--success);
}

.live-words {
  font-size: 0.82rem;
  color: var(--brand);
  font-weight: 600;
  min-block-size: 22px;
}

.date-input-wrap {
  display: flex;
  gap: 8px;
  align-items: stretch;
}
.date-input-wrap input {
  flex: 1;
  min-inline-size: 0;
}

/* Buttons & Chips */
.btn-primary {
  min-block-size: 46px;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  border: 0;
  background: var(--brand);
  color: var(--brand-foreground);
  font: inherit;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn-primary:hover { filter: brightness(1.06); }
.btn-primary:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-block { width: 100%; }

.btn-outline {
  min-block-size: 44px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--muted);
  color: var(--foreground);
  font: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.btn-outline:hover { border-color: var(--brand); }

.btn-danger-soft {
  min-block-size: 44px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid color-mix(in oklch, var(--destructive) 35%, transparent);
  background: var(--destructive-bg);
  color: var(--destructive);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}

.quick-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-block-start: 4px;
}
.chip-btn {
  min-block-size: 36px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--muted);
  color: var(--foreground);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}
.chip-btn:hover { border-color: var(--brand); }
.chip-btn.subtle { color: var(--muted-foreground); }

/* Optional Details */
.optional-details {
  border-block-start: 1px solid var(--border);
  padding-block-start: 12px;
  margin-block-start: 4px;
}
.optional-details summary {
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--brand);
  min-block-size: 44px;
  display: flex;
  align-items: center;
}

/* Channels Grid */
.channel-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-block-end: 16px;
}
@media (max-width: 560px) {
  .channel-grid { grid-template-columns: minmax(0, 1fr); }
}

.channel-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  min-block-size: 60px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border);
  background: var(--muted);
  cursor: pointer;
}
.channel-pill:has(input:checked) {
  border-color: var(--brand);
  background: color-mix(in oklch, var(--brand) 10%, var(--card));
}
.channel-pill input[type="checkbox"] {
  inline-size: 20px;
  block-size: 20px;
  flex-shrink: 0;
  accent-color: var(--brand);
}
.channel-pill strong { display: block; font-size: 0.9rem; }
.channel-pill small { display: block; font-size: 0.76rem; color: var(--muted-foreground); }

/* Brand-Consistent Forms fallback where accent-color unsupported */
@supports not (accent-color: var(--brand)) {
  .channel-pill input[type="checkbox"] {
    -webkit-appearance: none;
    appearance: none;
    inline-size: 20px;
    block-size: 20px;
    border: 2px solid var(--border);
    border-radius: 5px;
    background: var(--background);
    display: inline-grid;
    place-items: center;
  }
  .channel-pill input[type="checkbox"]:checked {
    background-color: var(--brand);
    border-color: var(--brand);
  }
  .channel-pill input[type="checkbox"]:checked::after {
    content: "✓";
    color: var(--brand-foreground);
    font-size: 0.85rem;
    font-weight: 800;
  }
  .channel-pill input[type="checkbox"]:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
  }
}

.saved-contacts-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  margin-block-end: 12px;
  border-radius: var(--radius-sm);
  background: var(--muted);
  font-size: 0.82rem;
}

/* Recipients Stack */
.recipients-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-block-end: 12px;
}
.recipient-card {
  padding: 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--muted);
}
.recipient-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-block-end: 10px;
}
.role-tag {
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  background: color-mix(in oklch, var(--brand) 16%, transparent);
  color: var(--brand);
}
.recipient-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Intervals */
.intervals-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.interval-chip {
  min-block-size: 44px;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border);
  background: var(--muted);
  color: var(--foreground);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
}
.interval-chip.is-selected {
  border-color: var(--brand);
  background: color-mix(in oklch, var(--brand) 15%, var(--card));
  color: var(--brand);
}

.schedule-preview {
  margin-block-start: 14px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px dashed color-mix(in oklch, var(--brand) 45%, transparent);
  background: color-mix(in oklch, var(--brand) 7%, transparent);
  font-size: 0.86rem;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Summary Card */
.summary-card h2 {
  margin: 0 0 4px;
  font-size: 1.05rem;
}
.summary-note {
  margin: 0 0 14px;
  font-size: 0.82rem;
  color: var(--muted-foreground);
}
.summary-dl {
  margin: 0 0 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.86rem;
}
.summary-dl > div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding-block-end: 6px;
  border-block-end: 1px solid var(--border);
}
.summary-dl dt { color: var(--muted-foreground); }
.summary-dl dd { margin: 0; font-weight: 700; text-align: end; }

.promo-box {
  margin-block-end: 16px;
}
.promo-box label {
  display: block;
  font-size: 0.84rem;
  font-weight: 600;
  margin-block-end: 4px;
}
.promo-msg {
  font-size: 0.8rem;
  margin-block-start: 4px;
}
.promo-msg.ok { color: var(--success); }
.promo-msg.err { color: var(--destructive); }

.gateway-box {
  margin-block-end: 16px;
}
.gw-title {
  display: block;
  font-size: 0.86rem;
  font-weight: 700;
  margin-block-end: 8px;
}
.gateways-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.gw-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  min-block-size: 46px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--muted);
  cursor: pointer;
  font-size: 0.86rem;
  font-weight: 600;
}
.gw-option:has(input:checked) {
  border-color: var(--brand);
  background: color-mix(in oklch, var(--brand) 12%, var(--card));
}

.total-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  margin-block-end: 14px;
  border-radius: var(--radius-md);
  background: var(--muted);
  font-size: 0.95rem;
}
.total-bar strong {
  font-size: 1.15rem;
  color: var(--brand);
}

.form-alert {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  margin-block-end: 12px;
  font-size: 0.86rem;
  font-weight: 600;
}
.form-alert.error {
  background: var(--destructive-bg);
  color: var(--destructive);
  border: 1px solid color-mix(in oklch, var(--destructive) 35%, transparent);
}

/* My Checks & Dossier */
.lookup-bar { align-items: end; }
.lookup-btn-cell { justify-content: flex-end; }
.saved-checks-wrap {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
  margin-block-start: 16px;
}
.saved-check-tile {
  padding: 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--muted);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.saved-check-tile strong { font-size: 0.96rem; }
.status-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
}
.status-badge.active { background: color-mix(in oklch, var(--success) 18%, transparent); color: var(--success); }
.status-badge.pending_payment { background: color-mix(in oklch, var(--warning) 20%, transparent); color: var(--warning); }
.status-badge.cleared { background: color-mix(in oklch, var(--brand) 18%, transparent); color: var(--brand); }
.status-badge.bounced,
.status-badge.cancelled { background: var(--destructive-bg); color: var(--destructive); }

.dossier-card { margin-block-start: 16px; }
.dossier-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-block-end: 14px;
  border-block-end: 1px solid var(--border);
  margin-block-end: 16px;
}
.dossier-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.jobs-table-wrap {
  overflow-x: auto;
  margin-block-start: 12px;
}
.jobs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}
.jobs-table th,
.jobs-table td {
  padding: 10px 8px;
  border-block-end: 1px solid var(--border);
  text-align: start;
}
.jobs-table th { color: var(--muted-foreground); font-weight: 700; }

/* Ras-Giri */
.ras-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ras-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
  padding: 12px;
  border-radius: var(--radius-md);
  background: var(--muted);
  border: 1px solid var(--border);
}
@media (max-width: 620px) {
  .ras-row { grid-template-columns: minmax(0, 1fr); }
}
.ras-result {
  margin-block-start: 16px;
  padding: 18px;
  border-radius: var(--radius-md);
  background: color-mix(in oklch, var(--brand) 10%, var(--card));
  border: 1px solid color-mix(in oklch, var(--brand) 35%, transparent);
}

/* Native Modal Dialogs (modern-web-guidance: dialog & light-dismiss) */
dialog {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--card);
  color: var(--foreground);
  padding: 0;
  max-inline-size: min(440px, calc(100vw - 24px));
  width: 100%;
  box-shadow: 0 24px 64px -20px rgb(0 0 0 / 55%);
}
dialog:modal {
  overscroll-behavior: contain;
}
dialog::backdrop {
  overflow: hidden;
  overscroll-behavior: contain;
  background: rgb(0 0 0 / 55%);
  backdrop-filter: blur(4px);
}

.dialog-box { padding: 20px; }
.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-block-end: 14px;
}
.dialog-head h1 {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.3;
}
.icon-close-btn {
  min-inline-size: 44px;
  min-block-size: 44px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--muted);
  color: var(--foreground);
  font-size: 1rem;
  cursor: pointer;
}
.dialog-lead {
  margin: 0 0 12px;
  font-size: 0.88rem;
  color: var(--muted-foreground);
}
.dialog-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-block-start: 16px;
}

/* Jalali Calendar Grid inside Dialog */
.cal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-block-end: 12px;
}
.cal-weekdays,
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
  text-align: center;
}
.cal-weekdays {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted-foreground);
  margin-block-end: 6px;
}
.cal-day-btn {
  min-block-size: 44px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: var(--muted);
  color: var(--foreground);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}
.cal-day-btn:hover:not(:disabled) { border-color: var(--brand); }
.cal-day-btn.is-today { border-color: var(--brand); }
.cal-day-btn.is-selected { background: var(--brand); color: var(--brand-foreground); }
.cal-day-btn:disabled { opacity: 0.32; cursor: not-allowed; }

.card-transfer-info {
  padding: 14px;
  border-radius: var(--radius-md);
  background: var(--muted);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.88rem;
}
.card-transfer-info > div {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
.brand-txt { color: var(--brand); }
.muted-txt { color: var(--muted-foreground); font-size: 0.84rem; }

.site-footer {
  border-block-start: 1px solid var(--border);
  padding: 16px;
  text-align: center;
  font-size: 0.82rem;
  color: var(--muted-foreground);
}
