/* ===================================================================
   Primitive styles for the React components in src/primitives.

   Two decisions worth knowing before editing this file:

   1. EVERY class is prefixed `dina-`. DinaChat already owns unprefixed `.btn`,
      `.card`, `.chip`, `.input`, `.toggle`, `.segmented`, `.dot`, `.avatar`,
      `.counter` in its own stylesheet. An unprefixed shared sheet would fight it
      at equal specificity, where the winner depends on import order — the exact
      class of bug that is invisible on first load and appears on a client-side
      navigation. The prefix makes the two coexist, so DinaChat can migrate screen
      by screen instead of all at once.

   2. Plain CSS, not Tailwind utilities. DinaChat has no Tailwind at all. A shared
      component layer written in utilities would be unusable there, so the
      primitives render semantic classes and this file styles them from tokens.
      The Tailwind preset is still shipped for products that want utilities
      alongside (DinaCode, دینا لبز).

   SIZE SCALES. A marketing page and an admin inbox legitimately want different
   densities, and that was the one real difference between the two products'
   primitives (DinaCode ~1rem / 44px targets, DinaChat 12px / 28px). Rather than
   fork them, the comfortable scale is the default and a `.dina-dense` ancestor
   switches a whole subtree to the compact one:

     <div className="dina-dense">  … an admin panel …  </div>

     @import '@dinalabs/ui/components.css';
   =================================================================== */

/* ── mono / numerals ────────────────────────────────────────────────────────
   `.dina-mono` is for LATIN identifiers: ids, keys, model names, endpoints, JSON.
   Never Persian text and never Persian numerals — those use `.dina-num`, which
   stays in Estedad and leans on its tabular figures so a column still lines up
   without borrowing the Latin face.

   A mixed string is not a mono string: «usr_84213 · ۴ دقیقه در انتظار» is Persian
   prose that happens to contain an id, so only the id goes in `.dina-mono`. */
.dina-mono {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}
.dina-num {
  font-variant-numeric: tabular-nums;
}

/* ── buttons ──────────────────────────────────────────────────────────────── */
.dina-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  /* 44px is the minimum interactive target from DESIGN.md §4. */
  min-height: 44px;
  padding-inline: 22px;
  border: 1px solid var(--paper-line);
  border-radius: var(--r-pill);
  background: var(--paper-1);
  color: var(--l-fg);
  font-size: 0.95rem;
  font-weight: 700;
  white-space: nowrap;
  text-decoration: none;
  transition:
    background var(--t-fast) var(--ease),
    border-color var(--t-fast) var(--ease),
    box-shadow var(--t-slow) var(--ease),
    transform var(--t-slow) var(--ease),
    filter var(--t-fast) var(--ease);
}
.dina-btn:hover:not(:disabled) {
  background: var(--paper-3);
  border-color: color-mix(in oklch, var(--acc-1) 45%, var(--paper-line));
}

/* The ONE gradient control on a screen. Ink on it is --ink-on-grad, never white. */
.dina-btn-primary {
  background: var(--acc-grad);
  border-color: transparent;
  color: var(--ink-on-grad);
  font-weight: 800;
  box-shadow: var(--shadow-glow);
}
.dina-btn-primary:hover:not(:disabled) {
  background: var(--acc-grad);
  filter: brightness(1.06);
  transform: translateY(-2px);
  box-shadow: 0 18px 44px -12px var(--acc-glow);
}

/* Secondary on a LIGHT canvas. */
.dina-btn-ghost {
  background: var(--paper-1);
  border-color: var(--paper-line);
  color: var(--l-fg);
}

/* Secondary on a DARK canvas — the light ghost would vanish there. */
.dina-btn-ghost-dark {
  background: var(--ink-fill);
  border-color: var(--ink-line);
  color: var(--d-fg);
}
.dina-btn-ghost-dark:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--ink-line-strong);
  transform: translateY(-2px);
}

/* Quiet tertiary — no fill, no border, for a toolbar or a card header. */
.dina-btn-quiet {
  background: transparent;
  border-color: transparent;
  color: var(--l-mut);
  font-weight: 600;
}
.dina-btn-quiet:hover:not(:disabled) {
  background: var(--paper-2);
  border-color: transparent;
  color: var(--l-fg);
}

/* Solid dark — used ON an accent background, where the gradient button disappears. */
.dina-btn-dark {
  background: var(--ink-on-grad);
  border-color: transparent;
  color: #fff;
}
.dina-btn-dark:hover:not(:disabled) {
  background: #1a1a2b;
  transform: translateY(-2px);
  box-shadow: 0 20px 44px -18px rgba(0, 0, 0, 0.5);
}

/* Destructive. Outlined rather than filled: a red slab invites the misclick it warns about. */
.dina-btn-danger {
  background: var(--paper-1);
  border-color: var(--err-bd);
  color: var(--err);
}
.dina-btn-danger:hover:not(:disabled) {
  background: var(--err-bg);
  border-color: var(--err);
}

.dina-btn-sm {
  min-height: 36px;
  padding-inline: 14px;
  font-size: 0.86rem;
}
.dina-btn-lg {
  min-height: 52px;
  padding-inline: 30px;
  font-size: 1.05rem;
}
/* Fill the container — a form's submit, a pricing card's CTA. */
.dina-btn-block {
  width: 100%;
}

/* In flight. The spinner is the visible half; the disable is the load-bearing half and
   the component sets it, so a caller cannot forget. An anchor gets pointer-events too,
   since it has no `disabled` to honour. */
.dina-btn-loading {
  cursor: progress;
  opacity: 0.75;
}
a.dina-btn-loading {
  pointer-events: none;
}
.dina-btn-loading > svg:first-child {
  animation: dina-spin 0.8s linear infinite;
}

.dina-btn:disabled {
  background: var(--paper-line-soft);
  border-color: #eaeaf2;
  color: #a6a6bb;
  box-shadow: none;
  filter: none;
  transform: none;
  pointer-events: none;
}
/* A ghost-dark button lives on a dark canvas, and the rule above is a paper shade: a busy or
   disabled one turned into a bright white pill (dcc's login, where every code button disables while
   one is sent; owner, 2026-11-04, «it shows white»). It dims in place on its own fill instead, and
   one that is loading keeps its label readable beside the spinner. */
.dina-btn-ghost-dark:disabled,
.dina-btn-ghost-dark[aria-disabled='true'] {
  background: var(--ink-fill);
  border-color: var(--ink-line);
  color: var(--d-faint);
}
.dina-btn-ghost-dark.dina-btn-loading:disabled {
  color: var(--d-mut);
}

.dina-btn > svg {
  flex: 0 0 auto;
}

/* ── chips ─────────────────────────────────────────────────────────────────── */
.dina-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid transparent;
  border-radius: var(--r-pill);
  padding: 4px 11px;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}
.dina-chip-ok {
  color: var(--ok);
  background: var(--ok-bg);
}
.dina-chip-warn {
  color: var(--warn);
  background: var(--warn-bg);
}
.dina-chip-info {
  color: var(--info);
  background: var(--info-bg);
}
.dina-chip-err {
  color: var(--err);
  background: var(--err-bg);
}
.dina-chip-mut {
  color: var(--l-mut);
  background: var(--paper-2);
}
/* A credential or a tier — «مدرس», «سازمانی». Not a status: gold means "of a kind",
   where ok/warn/err all mean "in a state". */
.dina-chip-gold {
  color: #a87900;
  background: #fff6df;
}
/* The only chip allowed the gradient, and only as a 13% tint. */
.dina-chip-accent {
  color: var(--verified-fg);
  background: var(--acc-tint);
  border-color: var(--verified-bd);
}
/* Full-gradient chip — reserve it for a single headline fact per screen. */
.dina-chip-grad {
  color: var(--ink-on-grad);
  background: var(--acc-grad);
  font-weight: 800;
}

/* ── the dark canvas set — `<Chip dark>` ──────────────────────────────────────
   Every tone above is dark ink on a pale tint, which is right on paper and
   unreadable on a near-black band: the pale fill goes nearly invisible and the
   ink is a dark hue on black. These keep the hue and turn the relationship over —
   a translucent tint of the same colour, ink mixed toward white.

   `transparent` rather than a fixed dark surface, so one declaration works on
   --ink-0 through --ink-3 and on a hero photo. `grad` needs no entry: full
   gradient with --ink-on-grad already reads on any canvas, which is the point
   of the gradient. */
.dina-chip-dark.dina-chip-ok {
  color: color-mix(in oklch, var(--ok) 55%, white);
  background: color-mix(in oklch, var(--ok) 18%, transparent);
  border-color: color-mix(in oklch, var(--ok) 32%, transparent);
}
.dina-chip-dark.dina-chip-warn {
  color: color-mix(in oklch, var(--warn) 55%, white);
  background: color-mix(in oklch, var(--warn) 18%, transparent);
  border-color: color-mix(in oklch, var(--warn) 32%, transparent);
}
.dina-chip-dark.dina-chip-info {
  color: color-mix(in oklch, var(--info) 55%, white);
  background: color-mix(in oklch, var(--info) 18%, transparent);
  border-color: color-mix(in oklch, var(--info) 32%, transparent);
}
.dina-chip-dark.dina-chip-err {
  color: color-mix(in oklch, var(--err) 55%, white);
  background: color-mix(in oklch, var(--err) 18%, transparent);
  border-color: color-mix(in oklch, var(--err) 32%, transparent);
}
.dina-chip-dark.dina-chip-mut {
  color: var(--d-mut);
  background: var(--ink-fill);
  border-color: var(--ink-line-strong);
}
.dina-chip-dark.dina-chip-gold {
  color: color-mix(in oklch, var(--gold) 62%, white);
  background: color-mix(in oklch, var(--gold) 16%, transparent);
  border-color: color-mix(in oklch, var(--gold) 30%, transparent);
}
/* The accent one mirrors `.dina-eyebrow-dark`, deliberately: they are the same badge at
   two sizes, and two different violets on one dark band read as a mistake. The ink leans
   on --acc-2 because the violet end of the gradient is too close to the canvas. */
.dina-chip-dark.dina-chip-accent {
  color: color-mix(in oklch, var(--acc-2) 70%, white);
  background: color-mix(in oklch, var(--acc-1) 16%, transparent);
  border-color: color-mix(in oklch, var(--acc-1) 32%, transparent);
}

/* Counter: full gradient, tabular Persian digits, dark ink. */
.dina-counter {
  display: inline-flex;
  align-items: center;
  font-variant-numeric: tabular-nums;
  font-size: 0.74rem;
  font-weight: 800;
  color: var(--ink-on-grad);
  background: var(--acc-grad);
  border-radius: var(--r-pill);
  padding: 2px 8px;
  white-space: nowrap;
}
/* A quiet count on an inset pill. */
.dina-count-pill {
  display: inline-flex;
  align-items: center;
  font-variant-numeric: tabular-nums;
  font-size: 0.76rem;
  color: var(--l-mut);
  background: var(--paper-2);
  border-radius: var(--r-pill);
  padding: 2px 9px;
}

/* ── eyebrow — the small labelled pill above a section heading ─────────────── */
.dina-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 15px;
  border-radius: var(--r-pill);
  background: color-mix(in oklch, var(--acc-1) 10%, white);
  border: 1px solid color-mix(in oklch, var(--acc-1) 22%, white);
  color: color-mix(in oklch, var(--acc-1) 70%, black);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}
.dina-eyebrow-dark {
  background: color-mix(in oklch, var(--acc-1) 14%, transparent);
  border-color: color-mix(in oklch, var(--acc-1) 30%, transparent);
  color: color-mix(in oklch, var(--acc-2) 70%, white);
}

/* ── dot ───────────────────────────────────────────────────────────────────── */
.dina-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  border-radius: var(--r-pill);
  background: var(--l-faint);
}
.dina-dot-ok {
  background: var(--ok);
}
.dina-dot-warn {
  background: var(--warn);
}
.dina-dot-err {
  background: var(--err);
}
.dina-dot-info {
  background: var(--info);
}
.dina-dot-accent {
  background: var(--violet);
}
.dina-dot-grad {
  background: var(--acc-grad);
  box-shadow: 0 0 10px var(--acc-glow);
}
/* Live indicator — a soft expanding halo. Honours prefers-reduced-motion via base.css. */
.dina-dot-pulse {
  animation: dina-pulse 1.8s var(--ease) infinite;
}
@keyframes dina-pulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.35;
    transform: scale(0.78);
  }
}

/* ── avatar ────────────────────────────────────────────────────────────────── */
.dina-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border-radius: var(--r-pill);
  background: var(--paper-2);
  color: var(--l-mut);
  font-weight: 700;
  overflow: hidden;
}
/* The signed-in user and the brand are the only gradient avatars. */
.dina-avatar-grad {
  background: var(--acc-grad);
  color: var(--ink-on-grad);
}
.dina-avatar > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ── card ──────────────────────────────────────────────────────────────────── */
.dina-card {
  background: var(--paper-1);
  border: 1px solid var(--paper-line);
  border-radius: var(--r-lg);
  padding: 24px;
  box-shadow: var(--shadow-card);
}
/* Hover lift — only for a card that is itself a link or a button. */
.dina-card-interactive {
  transition:
    transform var(--t-slow) var(--ease),
    box-shadow var(--t-slow) var(--ease),
    border-color var(--t-slow) var(--ease);
}
.dina-card-interactive:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-pop);
  border-color: color-mix(in oklch, var(--acc-1) 28%, var(--paper-line));
}
.dina-card-dark {
  background: var(--ink-2);
  border-color: var(--ink-line);
  color: var(--d-fg);
  box-shadow: none;
}
.dina-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-block-end: 16px;
}
.dina-card-title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--l-fg);
}
.dina-card-sub {
  margin: 2px 0 0;
  font-size: 0.88rem;
  color: var(--l-faint);
}
.dina-card-dark .dina-card-title {
  color: var(--d-fg);
}
.dina-card-dark .dina-card-sub {
  color: var(--d-mut);
}
/* Pushes whatever follows it to the far inline end of a card header. */
.dina-spacer {
  flex: 1 1 auto;
}

/* ── fields ────────────────────────────────────────────────────────────────── */
.dina-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.dina-field-label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--l-mut);
}
/* The required star. `--err` because that is the colour the form already uses to say «this
   one needs you», and a second attention colour for the same meaning is one the reader has
   to learn. Not bold, and a hair smaller than the label: it marks the field, it is not the
   field's name. `aria-hidden` in the markup, so this is decoration in the accessibility
   tree as well as in the type. */
.dina-field-req {
  color: var(--err);
  font-size: 0.82rem;
}
.dina-field-hint {
  font-size: 0.8rem;
  color: var(--l-faint);
  line-height: 1.7;
}
.dina-field-error {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--err);
}

.dina-input,
.dina-textarea,
.dina-select {
  width: 100%;
  min-height: 46px;
  background: var(--paper-3);
  border: 1px solid var(--paper-line);
  border-radius: var(--r-sm);
  padding: 11px 14px;
  font-size: 1rem;
  color: var(--l-fg);
  outline: none;
  transition:
    border-color var(--t-fast) var(--ease),
    box-shadow var(--t-fast) var(--ease),
    background var(--t-fast) var(--ease);
}
.dina-input::placeholder,
.dina-textarea::placeholder {
  color: var(--l-faint);
}
/*
 * An empty `dir="auto"` field follows the page (v0.16.5). The browser takes an auto field's
 * direction from what is typed, never from the placeholder, and with nothing typed it falls back to
 * left-to-right: a Persian placeholder sat at the left edge with its «…» on the wrong end (دینا لبز's
 * playground composer, owner 2026-10-26). Once something is typed the rule no longer matches and the
 * field reads its own text again, so an English prompt still runs left to right.
 *
 * `unicode-bidi: isolate` too (v0.19.4): the browser draws an auto TEXTAREA with `plaintext`, which
 * takes the direction from the text and ignores `direction`, so the placeholder sat on the right
 * while the caret still blinked at the left edge (the playground composer, owner 2026-10-27). An
 * input is drawn `isolate` already; the line only changes the textarea.
 */
.dina-input[dir='auto']:placeholder-shown,
.dina-textarea[dir='auto']:placeholder-shown {
  direction: inherit;
  unicode-bidi: isolate;
}
.dina-input:focus,
.dina-textarea:focus,
.dina-select:focus {
  background: var(--paper-1);
  border-color: var(--violet);
  box-shadow: var(--ring);
}
.dina-input[aria-invalid='true'],
.dina-textarea[aria-invalid='true'],
.dina-select[aria-invalid='true'] {
  background: var(--err-bg);
  border-color: var(--err);
  box-shadow: none;
}
.dina-input:disabled,
.dina-textarea:disabled,
.dina-select:disabled {
  background: var(--paper-2);
  color: var(--l-faint);
  cursor: default;
}
.dina-textarea {
  resize: vertical;
  line-height: 1.8;
}
/* The caret is a background image pinned to the inline END, so it follows the page
   direction with no second rule — and `appearance: none` is what stops the platform
   drawing its own on the opposite side as well. */
.dina-select {
  appearance: none;
  cursor: pointer;
  padding-inline-end: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none' stroke='%235b5b73' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m1 1.5 5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 13px center;
  background-size: 12px 8px;
}
[dir='ltr'] .dina-select {
  background-position: right 13px center;
}
/* A field holding a Latin value — an API key, a base URL, a model id. */
.dina-input-mono {
  font-family: var(--mono);
  direction: ltr;
  text-align: start;
}

/* ── OTP digit boxes ───────────────────────────────────────────────────────────
   One box per digit, laid out LTR so digit 1 is leftmost regardless of page
   direction: a phone-verification code is read off an SMS left-to-right even in
   Persian, and mirroring it is the single most confusing thing an RTL login can do. */
.dina-otp {
  display: flex;
  direction: ltr;
  gap: 10px;
  justify-content: center;
}
.dina-otp-digit {
  width: 52px;
  height: 60px;
  flex: 0 0 52px;
  text-align: center;
  font-family: var(--mono);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--l-fg);
  background: var(--paper-3);
  border: 1.5px solid var(--paper-line);
  border-radius: var(--r-md);
  outline: none;
  transition:
    border-color var(--t-fast) var(--ease),
    box-shadow var(--t-fast) var(--ease),
    background var(--t-fast) var(--ease);
  /* Hide the number-input spinners — this is a digit box, not a stepper. */
  -moz-appearance: textfield;
  appearance: textfield;
}
.dina-otp-digit::-webkit-outer-spin-button,
.dina-otp-digit::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.dina-otp-digit:focus {
  background: var(--paper-1);
  border-color: var(--violet);
  box-shadow: var(--ring);
}
.dina-otp-digit[data-filled='true'] {
  background: var(--paper-1);
  border-color: color-mix(in oklch, var(--acc-1) 40%, var(--paper-line));
}
.dina-otp[data-invalid='true'] .dina-otp-digit {
  border-color: var(--err);
  background: var(--err-bg);
}
@media (max-width: 420px) {
  .dina-otp {
    gap: 7px;
  }
  .dina-otp-digit {
    width: 44px;
    height: 54px;
    flex: 0 0 44px;
    font-size: 1.3rem;
  }
}

/* ── toggle — 36×20 with a 16px knob ──────────────────────────────────────── */
.dina-toggle {
  display: block;
  width: 36px;
  height: 20px;
  flex: 0 0 36px;
  border: 0;
  border-radius: var(--r-pill);
  background: var(--paper-track);
  padding: 2px;
  transition: background var(--t-slow) var(--ease);
}
.dina-toggle[aria-checked='true'] {
  background: var(--acc-grad);
}
.dina-toggle .dina-knob {
  /* The knob is a <span>; without `display: block` its width/height are ignored. */
  display: block;
  width: 16px;
  height: 16px;
  border-radius: var(--r-pill);
  background: #fff;
  box-shadow: 0 1px 2px rgba(20, 20, 40, 0.2);
  /* Logical, so the knob travels toward the inline end in BOTH directions. */
  margin-inline-start: 0;
  transition: margin-inline-start var(--t-slow) var(--ease);
}
.dina-toggle[aria-checked='true'] .dina-knob {
  margin-inline-start: 16px;
}
.dina-toggle:disabled {
  opacity: 0.55;
}
.dina-toggle-row {
  display: flex;
  align-items: center;
  gap: 9px;
}
.dina-toggle-row .dina-label {
  font-size: 0.92rem;
  color: var(--l-fg);
}
.dina-toggle-row .dina-label-off {
  color: var(--l-mut);
}

/* ── segmented control ─────────────────────────────────────────────────────── */
.dina-segmented {
  display: inline-flex;
  /* In a flex column (a Field, a stack) an inline-flex box is still stretched to the full width,
     leaving an empty grey track beside two short options. A definite width is never stretched, and
     unlike `align-self: flex-start` (v0.13.5) it leaves a row's vertical centring alone (v0.13.6). */
  inline-size: fit-content;
  max-inline-size: 100%;
  gap: 4px;
  background: var(--paper-2);
  border: 1px solid var(--paper-line);
  border-radius: var(--r-pill);
  padding: 4px;
  /* Scrolls sideways when the options outgrow the row (v0.15.4): six options on a phone used to
     run past the track's end and the last two could not be reached. */
  overflow-x: auto;
  scrollbar-width: none;
}
.dina-segmented::-webkit-scrollbar {
  display: none;
}
.dina-segmented button {
  flex: none;
  white-space: nowrap;
  border: 1px solid transparent;
  background: transparent;
  border-radius: var(--r-pill);
  min-height: 36px;
  padding-inline: 18px;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--l-mut);
  transition:
    background var(--t-fast) var(--ease),
    color var(--t-fast) var(--ease),
    box-shadow var(--t-fast) var(--ease);
}
.dina-segmented button:hover {
  color: var(--l-fg);
}
.dina-segmented button[aria-pressed='true'] {
  background: var(--paper-1);
  border-color: var(--paper-line);
  color: var(--l-fg);
  box-shadow: 0 6px 18px -10px rgba(40, 30, 80, 0.4);
}

/* ── progress ──────────────────────────────────────────────────────────────── */
.dina-progress {
  height: 7px;
  border-radius: var(--r-pill);
  background: var(--paper-2);
  overflow: hidden;
}
.dina-progress > i {
  display: block;
  height: 100%;
  border-radius: var(--r-pill);
  background: var(--acc-grad);
  transition: width 1.1s var(--ease);
}

/* ── audio player (v0.12.0) ────────────────────────────────────────────────────
   A pill: play button, timeline, time, mute. Left to right in every page since v0.22.0 (the
   element is dir="ltr", so inset-inline-start is the left), and the range input that drives it is
   laid over the drawn track, invisible but focusable. Tracks are currentColor mixes, so one rule
   set serves paper and ink. */
.dina-audio {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding-block: 6px;
  padding-inline: 6px 10px;
  border: 1px solid var(--paper-line);
  border-radius: var(--r-pill);
  background: var(--paper-1);
  color: var(--l-fg);
}
.dina-audio.is-dark {
  border-color: var(--ink-line);
  background: var(--ink-fill);
  color: var(--d-fg);
}
.dina-audio.is-compact {
  gap: 8px;
  padding-inline: 4px 6px;
}
.dina-audio-btn,
.dina-audio-mute {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: var(--r-pill);
  cursor: pointer;
  transition: background-color var(--t-fast) var(--ease), opacity var(--t-fast) var(--ease);
}
.dina-audio-btn {
  background: var(--l-fg);
  color: var(--paper-1);
}
.dina-audio.is-dark .dina-audio-btn {
  background: var(--d-fg);
  color: var(--l-fg);
}
.dina-audio-btn:disabled {
  opacity: 0.4;
  cursor: default;
}
.dina-audio-mute {
  background: transparent;
  color: inherit;
  opacity: 0.7;
}
.dina-audio-mute:hover,
.dina-audio-mute[aria-pressed='true'] {
  opacity: 1;
  background: color-mix(in srgb, currentColor 8%, transparent);
}
.dina-audio-btn:focus-visible,
.dina-audio-mute:focus-visible {
  outline: none;
  box-shadow: var(--ring);
}
.dina-audio-title {
  max-width: 30%;
  overflow: hidden;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.dina-audio-bar {
  position: relative;
  display: flex;
  flex: 1;
  align-items: center;
  min-width: 48px;
  height: 44px;
}
.dina-audio-track {
  position: absolute;
  inset-inline: 0;
  height: 5px;
  overflow: hidden;
  border-radius: var(--r-pill);
  background: color-mix(in srgb, currentColor 16%, transparent);
}
.dina-audio-buf,
.dina-audio-fill {
  position: absolute;
  inset-block: 0;
  inset-inline-start: 0;
  border-radius: inherit;
}
.dina-audio-buf {
  width: var(--b, 0%);
  background: color-mix(in srgb, currentColor 14%, transparent);
}
.dina-audio-fill {
  width: var(--p, 0%);
  background: var(--acc-grad);
}
.dina-audio-thumb {
  position: absolute;
  inset-inline-start: var(--p, 0%);
  width: 14px;
  height: 14px;
  margin-inline-start: -7px;
  border-radius: var(--r-pill);
  background: currentColor;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
  opacity: 0;
  transition: opacity var(--t-fast) var(--ease);
  pointer-events: none;
}
.dina-audio-bar:hover .dina-audio-thumb,
.dina-audio-bar:focus-within .dina-audio-thumb,
.dina-audio-bar:active .dina-audio-thumb {
  opacity: 1;
}
.dina-audio-bar:focus-within .dina-audio-track {
  box-shadow: var(--ring);
}
.dina-audio-range {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}
.dina-audio-range:disabled {
  cursor: default;
}
.dina-audio-time {
  flex-shrink: 0;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  opacity: 0.75;
}
.dina-audio-err {
  flex: 1;
  font-size: 13px;
  color: var(--err);
}

/* ── video player (v0.22.0) ────────────────────────────────────────────────────
   The picture on ink in both themes; over it a big play button while paused and, along the
   bottom, the timeline and a row of controls on a soft shade. Left to right in every page: the
   element is dir="ltr", so inset-inline-start is the left. The bar fades out while the clip plays
   and nothing moves (.is-idle), and the pointer goes with it. */
.dina-video {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  max-width: 100%;
  border-radius: var(--r-lg);
  background: var(--ink-0);
  color: var(--d-fg);
  isolation: isolate;
}
.dina-video:focus-visible {
  outline: none;
  box-shadow: var(--ring);
}
.dina-video.is-full {
  width: 100%;
  height: 100%;
  border-radius: 0;
}
.dina-video.is-idle {
  cursor: none;
}
.dina-video-el {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  object-fit: contain;
  background: var(--ink-0);
}
.dina-video.is-cover .dina-video-el {
  object-fit: cover;
}
.dina-video.is-full .dina-video-el {
  max-height: none;
}
.dina-video-big {
  position: absolute;
  inset: 0;
  margin: auto;
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border: 0;
  border-radius: var(--r-pill);
  background: color-mix(in srgb, var(--ink-0) 55%, transparent);
  color: var(--d-fg);
  backdrop-filter: blur(8px);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--d-fg) 18%, transparent);
  cursor: pointer;
  z-index: 2;
  transition: transform var(--t-fast) var(--ease), background-color var(--t-fast) var(--ease);
}
.dina-video-big:hover {
  transform: scale(1.06);
  background: color-mix(in srgb, var(--ink-0) 40%, transparent);
}
.dina-video-big:focus-visible {
  outline: none;
  box-shadow: var(--ring);
}
.dina-video-big svg {
  margin-inline-start: 3px;
}
.dina-video-spin {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
  z-index: 2;
}
.dina-video-spin > span {
  width: 40px;
  height: 40px;
  border: 3px solid color-mix(in srgb, var(--d-fg) 25%, transparent);
  border-top-color: var(--d-fg);
  border-radius: var(--r-pill);
  animation: dina-spin 0.8s linear infinite;
}
.dina-video-err {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 16px;
  font-size: 13px;
  text-align: center;
  color: var(--d-fg);
  background: color-mix(in srgb, var(--ink-0) 70%, transparent);
  z-index: 2;
}
.dina-video-bar {
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  padding: 28px 8px 4px;
  background: linear-gradient(to top, color-mix(in srgb, var(--ink-0) 82%, transparent), transparent);
  z-index: 3;
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
}
.dina-video.is-idle .dina-video-bar {
  opacity: 0;
  transform: translateY(6px);
  pointer-events: none;
}
.dina-video-seek {
  position: relative;
  display: flex;
  align-items: center;
  height: 22px;
  margin-inline: 6px;
}
.dina-video-track {
  position: absolute;
  inset-inline: 0;
  height: 4px;
  overflow: hidden;
  border-radius: var(--r-pill);
  background: color-mix(in srgb, var(--d-fg) 22%, transparent);
  transition: height var(--t-fast) var(--ease);
}
.dina-video-seek:hover .dina-video-track,
.dina-video-seek:focus-within .dina-video-track {
  height: 6px;
}
.dina-video-buf,
.dina-video-fill {
  position: absolute;
  inset-block: 0;
  inset-inline-start: 0;
  border-radius: inherit;
}
.dina-video-buf {
  width: var(--b, 0%);
  background: color-mix(in srgb, var(--d-fg) 22%, transparent);
}
.dina-video-fill {
  width: var(--p, 0%);
  background: var(--acc-grad);
}
.dina-video-thumb {
  position: absolute;
  inset-inline-start: var(--p, 0%);
  width: 14px;
  height: 14px;
  margin-inline-start: -7px;
  border-radius: var(--r-pill);
  background: var(--d-fg);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
  transform: scale(0.6);
  opacity: 0;
  transition: opacity var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
  pointer-events: none;
}
.dina-video-seek:hover .dina-video-thumb,
.dina-video-seek:focus-within .dina-video-thumb,
.dina-video-seek:active .dina-video-thumb {
  opacity: 1;
  transform: scale(1);
}
.dina-video-seek:focus-within .dina-video-track {
  box-shadow: var(--ring);
}
.dina-video-tip {
  position: absolute;
  bottom: 20px;
  padding: 3px 7px;
  border-radius: 6px;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  color: var(--d-fg);
  background: color-mix(in srgb, var(--ink-0) 85%, transparent);
  /* Physical on purpose: centred on the pointer, in a player that is left to right in every page. */
  transform: translateX(-50%);
  pointer-events: none;
}
.dina-video-range {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}
.dina-video-range:disabled {
  cursor: default;
}
.dina-video-row {
  display: flex;
  align-items: center;
  gap: 2px;
}
.dina-video-btn {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  min-width: 44px;
  height: 44px;
  border: 0;
  border-radius: var(--r-pill);
  background: transparent;
  color: var(--d-fg);
  cursor: pointer;
  transition: background-color var(--t-fast) var(--ease);
}
.dina-video-btn:hover,
.dina-video-btn[aria-pressed='true'] {
  background: color-mix(in srgb, var(--d-fg) 12%, transparent);
}
.dina-video-btn:focus-visible {
  outline: none;
  box-shadow: var(--ring);
}
.dina-video-rate {
  padding-inline: 8px;
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.dina-video-sound {
  display: flex;
  align-items: center;
}
/* The volume slider opens beside the sound button on a wide screen; a phone has its own buttons. */
.dina-video-vol {
  width: 0;
  height: 44px;
  margin: 0;
  opacity: 0;
  cursor: pointer;
  accent-color: var(--d-fg);
  transition: width 0.2s var(--ease), opacity 0.2s var(--ease);
}
@media (hover: hover) and (min-width: 640px) {
  .dina-video-sound:hover .dina-video-vol,
  .dina-video-sound:focus-within .dina-video-vol {
    width: 72px;
    margin-inline-end: 6px;
    opacity: 1;
  }
}
.dina-video-time {
  padding-inline: 6px;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  opacity: 0.85;
}
.dina-video-gap {
  flex: 1;
}
@media (max-width: 380px) {
  .dina-video-rate {
    display: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  .dina-video-bar,
  .dina-video-track,
  .dina-video-thumb,
  .dina-video-big,
  .dina-video-vol {
    transition: none;
  }
}

/* ── spinner ───────────────────────────────────────────────────────────────── */
.dina-spin {
  animation: dina-spin 0.8s linear infinite;
}
@keyframes dina-spin {
  to {
    transform: rotate(360deg);
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   ADDED IN v0.2.0 — promoted out of the products.

   Everything below replaced at least two divergent copies. Where the two
   disagreed, the note says which behaviour won and why.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── ring — conic progress with a figure in the middle ─────────────────────── */
.dina-ring {
  position: relative;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  border-radius: 50%;
  background: conic-gradient(var(--acc-1) calc(var(--dina-ring-p) * 1%), var(--paper-2) 0);
  transition: background 1s var(--ease);
}
.dina-ring-cut {
  position: absolute;
  inset: var(--dina-ring-thickness);
  border-radius: 50%;
  background: var(--paper-1);
}
.dina-ring-body {
  position: relative;
  text-align: center;
  line-height: 1;
}

/* ── toasts ────────────────────────────────────────────────────────────────
   Bottom-centre, one column, above everything. Our panels put their primary
   actions at the bottom of a form and the nav at the top, so a confirmation
   900px away from the button that caused it is routinely missed. It also
   sidesteps the RTL/LTR corner question entirely.

   The bottom offset clears the iOS home indicator AND the mobile tab bar —
   the learner app's own copy did the first and not the second, so on a phone
   every toast sat behind the tab bar. */
.dina-toasts {
  position: fixed;
  z-index: 200;
  inset-inline: 0;
  bottom: calc(1.75rem + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding-inline: 16px;
  pointer-events: none;
}
@media (max-width: 760px) {
  .dina-toasts {
    bottom: calc(var(--bottom-tab-h) + 1rem + env(safe-area-inset-bottom));
  }
}
.dina-toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 9px;
  max-width: min(100%, 30rem);
  padding: 11px 14px 11px 11px;
  border-radius: var(--r-md);
  background: var(--ink-1);
  color: var(--d-fg);
  font-size: 0.9rem;
  font-weight: 700;
  box-shadow: 0 18px 40px -16px rgba(0, 0, 0, 0.5);
  animation: dina-toast-in 240ms var(--ease);
}
@keyframes dina-toast-in {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
}
/* Reduced motion gets the toast without the slide. Not `animation: none` — a
   toast that materialises with no transition at all is easy to miss entirely,
   which defeats the purpose. */
@media (prefers-reduced-motion: reduce) {
  .dina-toast {
    animation: dina-toast-fade 240ms var(--ease);
  }
  @keyframes dina-toast-fade {
    from {
      opacity: 0;
    }
  }
}
/* The tone colours only the GLYPH. A whole slab of red for «حذف شد» reads as an
   error when it was a success, which is the bug the admin copy shipped. */
.dina-toast-glyph {
  display: inline-flex;
  flex-shrink: 0;
}
.dina-toast-ok .dina-toast-glyph {
  color: var(--syn-str);
}
.dina-toast-err .dina-toast-glyph {
  color: #ff8f8a;
}
.dina-toast-info .dina-toast-glyph {
  color: var(--syn-fn);
}
.dina-toast-msg {
  flex: 1;
  line-height: 1.7;
}
.dina-toast-close {
  display: inline-flex;
  flex-shrink: 0;
  padding: 4px;
  border: 0;
  border-radius: var(--r-xs);
  background: transparent;
  color: var(--d-mut);
  cursor: pointer;
  transition: color var(--t-fast), background var(--t-fast);
}
.dina-toast-close:hover {
  color: var(--d-fg);
  background: var(--ink-fill);
}

/* ── modal ─────────────────────────────────────────────────────────────────── */
.dina-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: color-mix(in oklch, var(--ink-0) 55%, transparent);
  backdrop-filter: blur(4px);
  animation: dina-fade 160ms var(--ease);
}
@keyframes dina-fade {
  from {
    opacity: 0;
  }
}
.dina-modal {
  display: flex;
  flex-direction: column;
  width: 100%;
  /* A flex item's minimum is its content's width: an InvoiceDocument's 760px table widened the whole
     modal past a phone's screen (v0.16.4). At 0 the content scrolls inside its own box instead. */
  min-width: 0;
  /* The card never exceeds the viewport: only the BODY scrolls, so the header and
     the action row stay reachable. A modal whose «تأیید» is below the fold is a
     dialog the reader cannot answer. */
  max-height: calc(100dvh - 32px);
  border-radius: var(--r-lg);
  background: var(--paper-1);
  box-shadow: var(--shadow-pop);
  animation: dina-modal-in 200ms var(--ease);
}
@keyframes dina-modal-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.985);
  }
}
@media (prefers-reduced-motion: reduce) {
  .dina-modal,
  .dina-modal-backdrop {
    animation: none;
  }
}
.dina-modal-sm {
  max-width: 26rem;
}
.dina-modal-md {
  max-width: 34rem;
}
.dina-modal-lg {
  max-width: 52rem;
}
.dina-modal-head {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
  padding: 14px 18px;
  border-block-end: 1px solid var(--paper-line);
}
.dina-modal-title {
  flex: 1;
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
  color: var(--l-fg);
}
.dina-modal-close {
  display: inline-flex;
  padding: 6px;
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--l-mut);
  cursor: pointer;
  transition: color var(--t-fast), background var(--t-fast);
}
.dina-modal-close:hover {
  color: var(--l-fg);
  background: var(--paper-2);
}
.dina-modal-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 18px;
}

/* ── ChangelogDialog (v0.17.0) ───────────────────────────────────────────────
   Each release: its version chip (the current one in the accent), its title and its date, then a
   line per change behind a kind chip. */
.dina-chg-lead {
  margin: 0 0 18px;
  color: var(--l-mut);
  font-size: 0.86rem;
  line-height: 1.9;
}
.dina-chg-num {
  unicode-bidi: isolate;
  color: var(--l-fg);
  font-weight: 700;
}
.dina-chg-list {
  display: flex;
  flex-direction: column;
  gap: 22px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.dina-chg-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  padding-block-end: 8px;
  border-block-end: 1px solid var(--paper-line);
}
.dina-chg-ver {
  flex: none;
  padding: 1px 8px;
  border-radius: 999px;
  background: color-mix(in oklch, var(--l-fg) 7%, transparent);
  color: var(--l-mut);
  font-size: 0.74rem;
  font-weight: 700;
}
.dina-chg-ver .dina-num {
  unicode-bidi: isolate;
}
.dina-chg-ver[data-now] {
  background: color-mix(in oklch, var(--acc-1) 14%, transparent);
  color: var(--l-fg);
}
.dina-chg-title {
  flex: 1;
  min-inline-size: 0;
  margin: 0;
  color: var(--l-fg);
  font-size: 0.98rem;
  font-weight: 800;
}
.dina-chg-date {
  flex: none;
  color: var(--l-faint);
  font-size: 0.78rem;
}
.dina-chg-items {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}
.dina-chg-item {
  display: flex;
  gap: 10px;
  color: var(--l-fg);
  font-size: 0.88rem;
  line-height: 1.9;
}
.dina-chg-kind {
  flex: none;
  align-self: flex-start;
  margin-block-start: 3px;
  padding: 0 8px;
  border-radius: 999px;
  background: color-mix(in oklch, var(--l-fg) 7%, transparent);
  color: var(--l-mut);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.9;
}
.dina-chg-kind[data-accent] {
  background: color-mix(in oklch, var(--acc-1) 12%, transparent);
  color: var(--l-fg);
}
.dina-chg-text {
  min-inline-size: 0;
  overflow-wrap: anywhere;
}
.dina-chg-more {
  display: flex;
  justify-content: center;
  margin-block-start: 20px;
}
/* `wrap` since v0.19.0: two long buttons («شروع دورهٔ آزمایشی ۱۴ روزه», «ارتقا به حرفه‌ای») pushed
   the footer past a 375px screen, and the modal's own `min-width: 0` let them spill out of it. */
.dina-modal-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  flex: 0 0 auto;
  padding: 14px 18px;
  border-block-start: 1px solid var(--paper-line);
}

/* ── table ─────────────────────────────────────────────────────────────────── */
.dina-table-card {
  border: 1px solid var(--paper-line);
  border-radius: var(--r-md);
  background: var(--paper-1);
  overflow: hidden;
}
/* The scroll container is INSIDE the card. A table that overflows must scroll on
   its own axis, or the whole page picks up a horizontal scrollbar and every other
   section moves with it. */
.dina-table-scroll {
  overflow-x: auto;
}
.dina-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
.dina-table-caption {
  padding: 12px 14px;
  text-align: start;
  font-weight: 700;
  color: var(--l-fg);
}
.dina-thead {
  background: var(--paper-3);
  border-block-end: 1px solid var(--paper-line);
  font-size: 0.78rem;
  color: var(--l-mut);
}
.dina-tbody .dina-tr + .dina-tr {
  border-block-start: 1px solid var(--paper-line-row);
}
.dina-th {
  white-space: nowrap;
  padding: 11px 14px;
  text-align: start;
  font-weight: 700;
}
.dina-td {
  padding: 11px 14px;
  vertical-align: middle;
  color: var(--l-fg);
}
.dina-tr-click {
  cursor: pointer;
  transition: background var(--t-fast);
}
.dina-tr-click:hover,
.dina-tr-click:focus-visible {
  background: var(--paper-3);
  outline: none;
}
.dina-tr-click:focus-visible {
  box-shadow: inset var(--ring);
}

/* ── pagination ────────────────────────────────────────────────────────────── */
.dina-pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 4px;
  font-size: 0.85rem;
  color: var(--l-mut);
}
.dina-pagination-controls {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.dina-pagination-page {
  padding-inline: 4px;
}

/* ── stat card ─────────────────────────────────────────────────────────────── */
.dina-stat {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--paper-line);
  border-radius: var(--r-md);
  background: var(--paper-1);
  box-shadow: var(--shadow-card);
}
/* The tone colours the CHIP, never the figure. A red number reads as "this value is
   negative"; a red chip reads as "this metric is about errors", which is the meaning. */
.dina-stat-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: var(--r-sm);
}
.dina-stat-icon-accent {
  color: var(--acc-1);
  background: color-mix(in oklch, var(--acc-1) 12%, var(--paper-1));
}
.dina-stat-icon-ok {
  color: var(--ok);
  background: var(--ok-bg);
}
.dina-stat-icon-warn {
  color: var(--warn);
  background: var(--warn-bg);
}
.dina-stat-icon-info {
  color: var(--info);
  background: var(--info-bg);
}
.dina-stat-icon-err {
  color: var(--err);
  background: var(--err-bg);
}
.dina-stat-icon-gold {
  color: #a87900;
  background: #fff6df;
}
.dina-stat-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.dina-stat-label {
  font-size: 0.84rem;
  color: var(--l-mut);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dina-stat-value {
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1.25;
  color: var(--l-fg);
  /* Proportional figures (v0.13.3). Estedad's tabular figures are cut wide, so at this size a
     balance read «۲ ۰ ، ۰ ۰ ۰ تومان», every digit and the separator in its own cell. A headline is
     one number, not a column: it has nothing to line up with. */
  font-variant-numeric: normal;
}
.dina-stat-sub {
  font-size: 0.74rem;
  color: var(--l-faint);
}
/* v0.13.7: the change against the previous period. Colour follows whether the change is good for
   this figure; the arrow and the written word carry it without colour. */
.dina-stat-delta {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  margin-block-start: 2px;
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--l-mut);
}
.dina-stat-delta[data-good='true'] {
  color: var(--ok);
}
.dina-stat-delta[data-good='false'] {
  color: var(--err);
}
.dina-stat-delta-caption {
  font-weight: 400;
  color: var(--l-faint);
}
/* A small chart at the tile's inline end; the text column keeps the room it needs. */
.dina-stat-aside {
  display: inline-flex;
  flex-shrink: 0;
  margin-inline-start: auto;
  align-self: center;
}

/* ── tooltips ──────────────────────────────────────────────────────────────
   Hover and keyboard focus on a pointer device; TAP on a touch device, where
   there is no hover at all. A `title` attribute is invisible on every phone,
   and half our traffic is phones — that is the whole reason this exists. */
.dina-tip-wrap,
.dina-info-tip {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.dina-info-tip {
  justify-content: center;
  color: var(--l-faint);
  cursor: help;
}
.dina-info-tip:hover {
  color: var(--acc-1);
}
/* The bubble lives in a portal on <body> with fixed coordinates the component measures (v0.15.2):
   above its trigger when there is room, below when there is not, inside the window at the sides.
   Drawn inside the trigger, as it was, any scrolling box clipped it. Above modals and drawers (100),
   so a tip inside a dialog shows; below toasts (200). The component adds and removes it, so there
   is no hover rule here: on touch a sticky hover used to leave it up after a tap. */
.dina-tip-bubble {
  position: fixed;
  z-index: 150;
  width: max-content;
  max-width: min(16rem, calc(100vw - 16px));
  padding: 7px 11px;
  border-radius: var(--r-sm);
  background: var(--ink-1);
  color: var(--d-fg);
  font-size: 0.76rem;
  font-weight: 600;
  font-style: normal;
  line-height: 1.75;
  text-align: start;
  box-shadow: var(--shadow-pop);
  pointer-events: none;
  animation: dina-tip-in var(--t-fast) var(--ease);
}
@keyframes dina-tip-in {
  from {
    opacity: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .dina-tip-bubble {
    animation: none;
  }
}

/* ── empty / loading / error ───────────────────────────────────────────────── */
.dina-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding-block: 64px;
  color: var(--l-mut);
  font-size: 0.88rem;
}
.dina-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 64px 16px;
  text-align: center;
}
.dina-empty-icon {
  color: var(--l-faint);
}
.dina-empty-title {
  margin: 0;
  font-weight: 700;
  color: var(--l-fg);
}
.dina-empty-hint {
  margin: 0;
  /* 30rem, not 24 (v0.13.5): one ordinary sentence wrapped with its verb alone on a second line. */
  max-width: 30rem;
  font-size: 0.86rem;
  line-height: 1.9;
  color: var(--l-mut);
}
.dina-error-state .dina-empty-title {
  color: var(--err-deep);
}
.dina-detail {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.dina-detail-label {
  font-size: 0.74rem;
  color: var(--l-faint);
}
.dina-detail-value {
  font-size: 0.86rem;
  font-weight: 500;
  color: var(--l-fg);
}

/* ── bar chart ─────────────────────────────────────────────────────────────── */
.dina-barchart-bars {
  display: flex;
  align-items: flex-end;
  gap: 4px;
}
.dina-barchart-slot {
  position: relative;
  display: flex;
  flex: 1;
  align-items: flex-end;
  height: 100%;
  cursor: default;
  border: 0;
  background: none;
}
.dina-barchart-slot:focus-visible {
  outline: 2px solid var(--acc-1);
  outline-offset: 2px;
  border-radius: var(--r-xs);
}
.dina-barchart-bar {
  display: block;
  width: 100%;
  border-start-start-radius: 3px;
  border-start-end-radius: 3px;
  transition: opacity var(--t-fast), height var(--t-slow) var(--ease);
}
/* The tooltip renders INSIDE the hovered bar's wrapper, so it positions correctly
   in RTL with no coordinate maths. The copy this replaced computed `left` and
   landed on the wrong bar the moment the page direction flipped. */
.dina-barchart-tip {
  position: absolute;
  bottom: 100%;
  inset-inline-start: 50%;
  transform: translateX(50%);
  z-index: 20;
  margin-block-end: 8px;
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 6px 10px;
  border-radius: var(--r-sm);
  background: var(--ink-1);
  text-align: center;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: var(--shadow-pop);
}
[dir='ltr'] .dina-barchart-tip {
  transform: translateX(-50%);
}
.dina-barchart-tip b {
  font-size: 0.76rem;
  font-weight: 800;
  color: var(--d-fg);
}
.dina-barchart-tip i {
  font-size: 0.66rem;
  font-style: normal;
  color: var(--d-mut);
}
.dina-barchart-axis {
  display: flex;
  justify-content: space-between;
  margin-block-start: 8px;
  font-size: 0.72rem;
  color: var(--l-faint);
}

/* ── page header ───────────────────────────────────────────────────────────── */
.dina-page-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  height: var(--topbar-h);
  padding-inline: 16px;
  border-block-end: 1px solid var(--paper-line);
  background: var(--paper-1);
}
.dina-page-head-wide {
  gap: 12px;
}
/* With a `sub` the bar stops being a fixed strip and grows to hold two lines. A console
   screen wants the explanation; a list screen wants the 56px. Same component, and this
   is the only difference between what the two products each had. */
.dina-page-head-stacked {
  height: auto;
  min-height: var(--topbar-h);
  padding-block: 12px;
}
.dina-page-titles {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
/* Title, pill and meta on one line above the sub line (v0.13.5). */
.dina-page-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.dina-page-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
  color: var(--l-fg);
  white-space: nowrap;
}
.dina-page-sub {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.8;
  color: var(--l-mut);
}
.dina-back-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  margin-inline-start: -6px;
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--l-fg);
  cursor: pointer;
}
.dina-back-btn:hover {
  background: var(--paper-2);
}
/* The back arrow is a DIRECTION, not a glyph: in RTL "back" points right, in LTR left.
   `ArrowBack` is drawn pointing right, the RTL «بازگشت» every product here uses it as
   on its own, so it is mirrored only in an LTR page. Until v0.19.6 this mirrored it in
   RTL, on the belief that it was drawn pointing left, and every Persian back button
   pointed forward (دینا چت's inbox on a phone, dinahq.ir's detail pages). */
[dir='ltr'] .dina-back-btn > svg {
  transform: scaleX(-1);
}
.dina-search {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  padding-inline: 10px;
  border: 1px solid var(--paper-line);
  border-radius: var(--r-pill);
  background: var(--paper-3);
}
.dina-search:focus-within {
  border-color: var(--acc-1);
  box-shadow: var(--ring);
}
.dina-search input {
  flex: 1;
  min-width: 0;
  height: 34px;
  border: 0;
  background: transparent;
  color: var(--l-fg);
  /* The iOS 16px floor applies here too — a search that zooms the page on focus is
     worse than one that looks slightly large. */
  font-size: 16px;
  outline: none;
}
@media (min-width: 761px) {
  .dina-search input {
    font-size: 0.86rem;
  }
}
.dina-search input::-webkit-search-cancel-button {
  appearance: none;
}
.dina-search-glyph {
  display: inline-flex;
  color: var(--l-faint);
}
.dina-search-kbd {
  flex-shrink: 0;
  padding: 1px 6px;
  border: 1px solid var(--paper-line);
  border-radius: var(--r-xs);
  font-size: 0.7rem;
  color: var(--l-faint);
}
@media (hover: none) {
  /* The `/` hint is a promise about a keyboard. On a touch device there isn't one. */
  .dina-search-kbd {
    display: none;
  }
}
.dina-presence {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--l-mut);
}

/* ── site footer ───────────────────────────────────────────────────────────
   The pattern, not a primitive — see src/patterns/site-footer.

   Four bands, hairlined apart, all on the same dark surface:

     .dina-foot          brand + link columns
     .dina-foot-contact  phone and email on two labelled lines, plus the trust seals
     .dina-foot-family   the sibling Dina products
     .dina-foot-bar      copyright and the closing line

   This replaced three copies. Where they disagreed, دینا لبز's won — it was the
   most evolved of the three (the seal hover lift, the per-element dimming on a
   product that has not opened, the gradient hairline on the current site), and
   the other two had simply not caught up. Markup is shared; only each site's
   `footer.config.tsx` differs. */
/* Mounted inside a band the page already owns (دینا چت puts it on the closing CTA's dark
   band): no ground of its own, no top hairline, and the page's own wrap supplies the gutter. */
.dina-footer-bare {
  background: transparent;
  border-block-start: 0;
  padding-block: 0;
}
/* The bare footer's own content column.
   `bare` means the host page supplies the ground, the hairline and the landmark — it never meant
   "and the width too". This class was emitted with no rules at all, so a bare footer silently
   inherited whatever column it was dropped into: دینا چت's sits inside a 1140px `.shell` and
   measured 1092px against دینا کد's and دینا لبز's 1200px. Same measurement as `.dina-wrap`, so the
   three footers line up whether or not the page already owns a wrap. Put it OUTSIDE the host's own
   wrap, or that wrap caps it and the drift comes back quietly. */
.dina-foot-bands {
  width: min(100% - 32px, var(--wrap));
  margin-inline: auto;
}
.dina-footer {
  background: var(--ink-0);
  color: var(--d-mut);
  padding-block: 0 8px;
  border-block-start: 1px solid var(--ink-line);
  font-size: 0.88rem;
  line-height: 1.9;
}

/* band 1 — brand + columns */
.dina-foot {
  display: flex;
  gap: 40px;
  align-items: flex-start;
  padding-block: 52px 40px;
}
.dina-foot-brand {
  width: 300px;
  flex: 0 0 300px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.dina-foot-mark-row {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--d-fg);
  font-weight: 900;
  font-size: 1.15rem;
  text-decoration: none;
}
.dina-foot .dina-mark {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: var(--r-sm);
  background: var(--acc-grad);
  color: var(--ink-on-grad);
  font-size: 0.95rem;
}
/* A site that leads with artwork instead of an initial. Height matches the mark it
   replaces so the two lockups sit at the same height in the same row; width is auto,
   because a logo's aspect ratio is the logo's business. */
.dina-foot-logo {
  width: auto;
  height: 30px;
  object-fit: contain;
}
.dina-foot-highlight {
  margin: 0;
  color: var(--gold);
  font-weight: 700;
}
.dina-foot-desc {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.9;
  color: var(--d-mut);
}
.dina-foot-version {
  margin: 0;
  font-size: 0.74rem;
  color: var(--d-faint);
  /* `start`, so it follows the page: the right edge in this RTL footer. The element used to carry
     `dir="ltr"` for the sake of a `v` prefix, which pinned the whole line to the left while every
     other line in the brand block sat right. */
  text-align: start;
}
/* `isolate` rather than `embed`: the version is a self-contained LTR island inside an RTL line, and
   its dots are direction-neutral. Without isolation the bidi algorithm resolves them against the
   surrounding Persian and «1.1.1» can come out reordered. */
.dina-foot-version .dina-num {
  unicode-bidi: isolate;
}
/* The version as a button (v0.17.0, `onVersionClick`): the same quiet line, with «تاریخچهٔ
   تغییرات» after it as the part that reads as a link. */
.dina-foot-version-btn {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
}
.dina-foot-version-cta {
  margin-inline-start: 6px;
  color: var(--d-mut);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: color-mix(in oklch, var(--d-mut) 45%, transparent);
}
.dina-foot-version-btn:hover .dina-foot-version-cta,
.dina-foot-version-btn:focus-visible .dina-foot-version-cta {
  color: var(--d-fg);
}
.dina-foot-version-btn:focus-visible {
  outline: 2px solid var(--violet);
  outline-offset: 3px;
  border-radius: 4px;
}
.dina-foot-cols {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
.dina-foot-col {
  display: flex;
  flex-direction: column;
  gap: 9px;
  line-height: 1.5;
}
.dina-foot-col-title {
  display: block;
  margin: 0 0 4px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--d-faint);
}
.dina-foot-link {
  color: var(--d-fg);
  font-size: 0.92rem;
  text-decoration: none;
  transition: color var(--t-fast) var(--ease);
}
.dina-foot-link:hover {
  color: var(--acc-2);
}

/* band 2 — contact + the certificates */
.dina-foot-contact {
  display: flex;
  align-items: center;
  gap: 32px;
  flex-wrap: wrap;
  padding-block: 22px;
  border-block-start: 1px solid var(--ink-line);
}
/* Two labelled lines — phone, then email. The labels share a min-width so the
   values line up under each other instead of stepping in and out with the
   label's length. */
.dina-foot-reach {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  flex: 1;
  min-width: 260px;
}
.dina-foot-reach-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.dina-foot-reach-row .dina-foot-col-title {
  margin: 0;
  min-width: 34px;
}
/* The phone is the one thing in the footer someone acts on in a hurry, so it
   gets the size. */
.dina-foot-phone {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 1rem;
  color: var(--d-fg);
}
.dina-foot-phone a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--d-fg);
  text-decoration: none;
  transition: color var(--t-fast) var(--ease);
}
.dina-foot-phone a:hover {
  color: var(--acc-2);
}
.dina-foot-phone svg {
  color: var(--acc-2);
}
.dina-foot-phone .dina-num {
  letter-spacing: 0.04em;
}
.dina-foot-ext {
  padding: 2px 9px;
  border-radius: var(--r-pill);
  background: var(--ink-fill);
  border: 1px solid var(--ink-line);
  font-size: 0.74rem;
  color: var(--d-mut);
}
/* The address is a BUTTON that copies, not a mailto link, so it needs the button reset — a bare
   <button> inherits neither the page font nor the footer's colour. `user-select: none` is the
   point rather than a detail: there is nothing to drag across, which is what says "click me"
   instead of "select me". */
.dina-foot-email {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  color: var(--d-fg);
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  text-align: start;
}
.dina-foot-email:hover {
  color: var(--acc-2);
}
/* Out of the flow entirely, alongside the address on the side away from its label.
   Two earlier placements were wrong for instructive reasons: in-flow with a reserved `min-width`
   held a 4.5em hole open between «ایمیل» and the address every second it had nothing to say; and
   floating ABOVE the address put it on top of the phone row, which sits directly there. Beside it
   is the only free space in this block — the label is on one side, the empty column on the other.

   `right`, physically, and deliberately — the one place in this file that earns it. Which side a
   logical inset resolves to here depends on a chain nobody should have to trace: the footer is
   RTL, the button inside it is `dir="ltr"`, and the flash itself is `dir="rtl"` because its text
   is Persian. `inset-inline-end` resolved to the label's side, not away from it. The free column
   is physically to the left in a Persian-only product family whose footer will not be mirrored,
   so the physical property is both correct and the only one that says what it means. */
.dina-foot-email-flash {
  position: absolute;
  right: calc(100% + 10px);
  inset-block-start: 50%;
  transform: translateY(-50%);
  white-space: nowrap;
  pointer-events: none;
  font-size: 0.74rem;
  color: var(--acc-2);
  opacity: 0;
  transition: opacity var(--t-fast) var(--ease);
}
.dina-foot-email-flash:not(:empty) {
  opacity: 1;
}
.dina-foot-hours {
  font-size: 0.84rem;
  color: var(--d-mut);
}
/* One row, small. Each seal is dark artwork, so it sits on a WHITE tile rather
   than floating on the near-black band; the tiles are one fixed square and the
   artwork scales inside them, so no aspect ratio makes one look bigger. */
.dina-seals {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  overflow: visible;
}
/* The certificate's name, above the tile on hover and while the link inside is focused.
   Light paper, because this row sits on the footer's near-black band. `left` and
   `translateX` are physical: the bubble is centred on the tile, not aligned to a side. */
.dina-seal-tip {
  position: relative;
  display: flex;
}
.dina-seal-tip:hover::after,
.dina-seal-tip:focus-within::after {
  content: attr(data-tip);
  position: absolute;
  z-index: 5;
  bottom: calc(100% + 14px);
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  max-width: 16rem;
  padding: 7px 11px;
  border-radius: var(--r-sm);
  background: var(--paper-0);
  color: var(--l-fg);
  font-size: 0.76rem;
  font-weight: 600;
  line-height: 1.7;
  text-align: center;
  white-space: normal;
  box-shadow: var(--shadow-pop);
  pointer-events: none;
}
.dina-seal {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 92px;
  height: 92px;
  padding: 9px;
  box-sizing: border-box;
  border-radius: var(--r-md);
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.12);
  transition:
    transform var(--t-fast) var(--ease),
    box-shadow var(--t-fast) var(--ease);
}
/* Two shapes, one hover: the tile IS the link (`src` + `href`), or the tile FRAMES a seal that
   brought its own link — اینماد ships an `<a class="enamad">`. Both should lift. */
a.dina-seal:hover,
.dina-seal:has(a):hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 22px -12px rgba(0, 0, 0, 0.8);
}
.dina-seal > a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}
/* ⚠ `!important` is load-bearing, not laziness.
   Some seals are supplied by the issuing body as markup we may not alter — اتحادیه's is a
   96×144 <img> with those dimensions INLINE, because their crawler validates them for licence
   activation. An inline style beats any stylesheet rule regardless of specificity, so without
   `!important` the image renders at its native 2:3 and spills out of the 92px tile, over the
   footer's dark ground. This rule is the presentational override; the markup keeps its numbers.
   (That is exactly how it broke once: the rule was ported here from دینا کد's landing.css with
   the `!important` dropped, and the اتحادیه tile overflowed on production.) */
.dina-seal img {
  width: auto !important;
  height: 100% !important;
  max-width: 100%;
  object-fit: contain;
  display: block;
}
/* Artwork not supplied yet: the same box, dashed, saying what belongs in it. */
.dina-seal-todo {
  background: transparent;
  border: 1px dashed rgba(255, 255, 255, 0.18);
  color: var(--d-faint);
  font-size: 0.72rem;
  line-height: 1.4;
  text-align: center;
}

/* band 3 — the Dina family */
.dina-foot-family {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-block: 22px;
  border-block-start: 1px solid var(--ink-line);
}
.dina-fam-row {
  display: flex;
  align-items: stretch;
  gap: 10px;
  flex-wrap: wrap;
}
.dina-fam-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 220px;
  flex: 1 1 220px;
  padding: 10px 12px;
  border-radius: var(--r-lg);
  border: 1px solid var(--ink-line);
  background: var(--ink-1);
  text-decoration: none;
  transition:
    border-color var(--t-fast) var(--ease),
    background-color var(--t-fast) var(--ease),
    transform var(--t-fast) var(--ease);
}
a.dina-fam-item:hover {
  border-color: var(--ink-line-strong);
  background: var(--ink-2);
  transform: translateY(-2px);
}
/* The site you are on: the gradient hairline it would take as an active nav item,
   and no hover. */
.dina-fam-item-current {
  border-color: var(--verified-bd);
  background: var(--acc-tint-soft);
}
/* Not open yet: dashed and inert — it reads as «به‌زودی» rather than as a link
   that is somehow refusing to work. The logo keeps its colour (it is there to be
   recognised), so the dimming lands on the text. */
.dina-fam-item-soon {
  border-style: dashed;
  background: transparent;
  cursor: default;
}
.dina-fam-item-soon .dina-fam-name {
  color: var(--d-mut);
}
.dina-fam-item-soon .dina-fam-note {
  color: var(--d-faint);
}
.dina-fam-item-soon .dina-fam-logo {
  opacity: 0.82;
}
.dina-fam-item-soon .dina-fam-mark {
  filter: grayscale(1);
  opacity: 0.7;
}
.dina-fam-mark {
  display: grid;
  place-items: center;
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  border-radius: var(--r-sm);
  background: var(--acc-grad);
  color: var(--ink-on-grad);
  font-size: 0.85rem;
  font-weight: 800;
}
.dina-fam-logo {
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  object-fit: contain;
}
.dina-fam-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  line-height: 1.5;
}
.dina-fam-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--d-fg);
}
.dina-fam-note {
  font-size: 0.76rem;
  color: var(--d-mut);
}

/* band 4 — the last row */
.dina-foot-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-block: 20px;
  border-block-start: 1px solid var(--ink-line);
  color: var(--d-faint);
  font-size: 0.84rem;
}
.dina-foot-bar a {
  color: var(--d-mut);
  text-decoration: none;
  transition: color var(--t-fast) var(--ease);
}
.dina-foot-bar a:hover {
  color: var(--acc-2);
}
.dina-foot-powered span {
  color: var(--acc-1);
}

@media (max-width: 980px) {
  /* The brand stops being a fixed rail and the four link columns fold to two. */
  .dina-foot {
    flex-direction: column;
    gap: 28px;
    padding-block: 40px 30px;
  }
  .dina-foot-brand {
    width: auto;
    flex: 0 0 auto;
  }
  .dina-foot-cols {
    grid-template-columns: 1fr 1fr;
    gap: 26px 20px;
  }
  .dina-foot-contact {
    flex-direction: column;
    align-items: flex-start;
    gap: 18px;
  }
  .dina-foot-reach {
    min-width: 0;
  }
  .dina-fam-item {
    min-width: 0;
    flex: 1 1 100%;
  }
}
@media (max-width: 760px) {
  .dina-foot-cols {
    grid-template-columns: 1fr;
    gap: 22px;
  }
  .dina-foot-link {
    padding-block: 6px;
  }
  .dina-foot-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .dina-foot-bar .dina-spacer {
    display: none;
  }
  /* Four 92px tiles no longer fit one row. Cap the row at two so they wrap 2×2
     instead of 3+1 — the tiles keep their square, which is what makes the seals
     read as one set. */
  .dina-seals {
    gap: 8px;
    max-width: 192px;
  }
}

/* ═══ DENSE SCALE ═══════════════════════════════════════════════════════════
   Put `.dina-dense` on an admin-panel shell to switch the whole subtree to the
   compact densities DinaChat's inbox uses. Same components, same tokens — only
   the measurements change, so nothing has to be forked to get a dense panel. */
.dina-dense {
  font-size: 12.5px;
  line-height: 1.8;
}
.dina-dense .dina-btn {
  min-height: 30px;
  padding-inline: 14px;
  border-radius: var(--r-sm);
  font-size: 12px;
  font-weight: 400;
  box-shadow: none;
}
.dina-dense .dina-btn-primary {
  font-weight: 600;
  padding-inline: 15px;
}
.dina-dense .dina-btn-primary:hover:not(:disabled),
.dina-dense .dina-btn-dark:hover:not(:disabled),
.dina-dense .dina-btn-ghost-dark:hover:not(:disabled) {
  /* No lift in a dense table — rows would jitter as the pointer crosses them. */
  transform: none;
  box-shadow: none;
}
.dina-dense .dina-btn-sm {
  min-height: 24px;
  padding-inline: 10px;
  border-radius: var(--r-xs);
  font-size: 11px;
}
.dina-dense .dina-chip {
  padding: 3px 9px;
  font-size: 10px;
  font-weight: 500;
}
.dina-dense .dina-chip-accent {
  font-size: 9.5px;
  padding: 2px 7px;
}
.dina-dense .dina-counter {
  font-size: 9.5px;
  padding: 1px 6px;
}
.dina-dense .dina-count-pill {
  font-size: 10px;
  padding: 1px 7px;
}
.dina-dense .dina-card {
  border-radius: var(--r-md);
  padding: 16px;
  box-shadow: none;
}
.dina-dense .dina-card-title {
  font-size: 13.5px;
  font-weight: 600;
}
.dina-dense .dina-card-sub {
  font-size: 11px;
}
.dina-dense .dina-card-head {
  margin-block-end: 12px;
  gap: 8px;
}
.dina-dense .dina-input,
.dina-dense .dina-textarea,
.dina-dense .dina-select {
  min-height: 32px;
  padding: 9px 11px;
  font-size: 12.5px;
}
/* The select keeps room for its caret at the inline end (v0.13.5: it had no dense size at all,
   and stood a third taller than the search field beside it). */
.dina-dense .dina-select {
  padding-inline-end: 32px;
}
.dina-dense .dina-field {
  gap: 5px;
}
/* The combobox matches a dense input beside it (v0.13.5); at 1rem its placeholder read a size
   larger than every other field in the same dialog. */
.dina-dense .dina-combo-field {
  min-block-size: 42px;
  padding: 4px 10px;
}
.dina-dense .dina-combo-input {
  min-block-size: 30px;
  font-size: 12.5px;
}
.dina-dense .dina-field-label {
  font-size: 11px;
  font-weight: 400;
}
.dina-dense .dina-field-hint,
.dina-dense .dina-field-error {
  font-size: 10.5px;
}
.dina-dense .dina-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
}
.dina-dense .dina-segmented {
  gap: 3px;
  border-radius: var(--r-sm);
  padding: 3px;
}
.dina-dense .dina-segmented button {
  min-height: 24px;
  border-radius: var(--r-xs);
  padding-inline: 12px;
  font-size: 11.5px;
  font-weight: 400;
}
.dina-dense .dina-segmented button[aria-pressed='true'] {
  font-weight: 600;
  box-shadow: none;
}
.dina-dense .dina-toggle-row .dina-label {
  font-size: 11.5px;
}
/* The mobile 16px font-size floor exists to stop iOS auto-zoom, and a dense panel
   is a desktop surface — but it is still reachable on a tablet, so the floor stays.
   Nothing to override here; noted so nobody "fixes" it later. */

/* ═══ APP SHELL ═════════════════════════════════════════════════════════════
   The admin-panel shell (patterns/AppShell.tsx): دینا چت's panel geometry, now shared. A dark
   248px sidebar on the inline START — first in the DOM, so the right under RTL — and a content
   column whose `.dina-page-head` stays put while `.dina-shell-body` scrolls. Below 1100px the
   sidebar gives way to a bottom tab bar. No physical side is named anywhere below.

   `--dina-shell-side-w` is a component-local measurement, not a token: a product may override it
   on `.dina-shell` without the design system growing a shell-width decision for everyone. */
.dina-shell {
  --dina-shell-side-w: 248px;
  display: flex;
  block-size: 100dvh;
  overflow: hidden;
  background: var(--paper-0);
  color: var(--l-fg);
}
/* Chrome is set tighter than prose, or every nav row grows by a third. */
.dina-shell-side,
.dina-shell-content > .dina-page-head {
  line-height: 1.5;
}
.dina-shell-side {
  inline-size: var(--dina-shell-side-w);
  flex: 0 0 var(--dina-shell-side-w);
  display: flex;
  flex-direction: column;
  min-block-size: 0;
  background: var(--ink-0);
  border-inline-end: 1px solid var(--ink-line);
  color: var(--d-fg);
}
.dina-shell-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 18px 14px;
}
/* The logo mark — one of the gradient's rationed uses. Ink on it is --ink-on-grad, never white. */
.dina-shell-mark {
  display: grid;
  place-items: center;
  inline-size: 30px;
  block-size: 30px;
  flex: 0 0 30px;
  border-radius: var(--r-sm);
  background: var(--acc-grad);
  color: var(--ink-on-grad);
  font-size: 15px;
  font-weight: 700;
}
.dina-shell-brand-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-inline-size: 0;
}
.dina-shell-brand-name {
  font-size: 14px;
  font-weight: 600;
}
.dina-shell-brand-sub {
  font-size: 10px;
  color: var(--d-mut);
}

/* The workspace card: a button on the dark column, with the switcher hanging off it. */
.dina-shell-ws-wrap {
  position: relative;
  padding: 0 14px 16px;
}
.dina-shell-ws {
  display: flex;
  align-items: center;
  gap: 8px;
  inline-size: 100%;
  padding: 10px 12px;
  border: 1px solid var(--ink-line-strong);
  border-radius: var(--r-md);
  background: var(--ink-2);
  color: var(--d-fg);
  font: inherit;
  text-align: start;
  cursor: pointer;
}
.dina-shell-ws:disabled {
  cursor: default;
}
.dina-shell-ws:hover:not(:disabled) {
  background: var(--ink-3);
}
.dina-shell-ws-labels {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-inline-size: 0;
}
.dina-shell-ws-cap {
  font-size: 9.5px;
  color: var(--d-mut);
}
.dina-shell-ws-name {
  font-size: 12.5px;
  font-weight: 500;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.dina-shell-ws .dina-shell-ws-count,
.dina-shell-item .dina-shell-count {
  background: var(--ink-fill);
  color: var(--d-mut);
}

.dina-shell-nav {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding-inline: 14px;
  overflow-y: auto;
  min-block-size: 0;
}
.dina-shell-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.dina-shell-group-label {
  padding: 0 8px 4px;
  font-size: 9.5px;
  color: var(--d-faint);
}
.dina-shell-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 9px;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  color: var(--d-mut);
  font-size: 12.5px;
  text-decoration: none;
  transition:
    background var(--t-fast) var(--ease),
    color var(--t-fast) var(--ease);
}
.dina-shell-item:hover {
  background: var(--ink-fill);
  color: var(--d-fg);
  text-decoration: none;
}
/* Active: a raised row, a stronger border, bold text AND the gradient dot — never colour alone. */
.dina-shell-item[aria-current='page'] {
  background: var(--ink-3);
  border-color: var(--ink-line-strong);
  color: var(--d-fg);
  font-weight: 600;
}
.dina-shell-item[aria-current='page'] .dina-shell-count {
  background: var(--acc-grad);
  color: var(--ink-on-grad);
}
.dina-shell-dot:not(.dina-dot-grad) {
  background: var(--ink-line-strong);
}
/* A row with an icon draws its dot only while active (v0.13.5), and at the row's inline end, after
   the label: in front of the icon it read as a bullet crammed against the column's edge. */
.dina-shell-item:has(.dina-shell-icon) .dina-shell-dot {
  order: 2;
}
.dina-shell-item:has(.dina-shell-icon) .dina-shell-count {
  order: 3;
}
.dina-shell-icon {
  display: inline-flex;
  flex-shrink: 0;
  opacity: 0.85;
}
.dina-shell-label {
  flex: 1;
  min-inline-size: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.dina-shell-foot {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-block-start: auto;
  padding: 12px 14px 14px;
  border-block-start: 1px solid var(--ink-line);
}
/* The `aside` slot (v0.13.1): it takes the push to the bottom, and the foot sits right under it.
   Its contents are the product's; on the dark column they style themselves under
   `.dina-shell-side`, and in the light phone sheet under `.dina-shell-sheet`. */
.dina-shell-aside {
  margin-block-start: auto;
  padding: 10px 12px;
}
.dina-shell-aside + .dina-shell-foot {
  margin-block-start: 0;
}
/* The version line (v0.17.0, `version`): the last row of the sidebar, quiet until hovered, the
   whole row one button that opens the changelog. */
.dina-shell-version {
  display: flex;
  align-items: center;
  gap: 6px;
  inline-size: 100%;
  padding: 8px 14px 12px;
  border: 0;
  background: none;
  color: var(--d-mut);
  font: inherit;
  font-size: 10.5px;
  text-align: start;
  cursor: pointer;
}
.dina-shell-version:hover,
.dina-shell-version:focus-visible {
  color: var(--d-fg);
}
.dina-shell-version:focus-visible {
  outline: 2px solid var(--violet);
  outline-offset: -2px;
  border-radius: var(--r-sm);
}
.dina-shell-version .dina-num {
  unicode-bidi: isolate;
}
.dina-shell-version-cta {
  margin-inline-start: auto;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: color-mix(in oklch, currentColor 40%, transparent);
}
.dina-shell-version-dot {
  flex: none;
}
.dina-shell-sheet-version {
  margin-block-start: 6px;
  border-block-start: 1px solid var(--paper-line);
  border-radius: 0;
  color: var(--l-mut);
}
.dina-shell-sheet-version .dina-num {
  unicode-bidi: isolate;
}
/* The theme switch (v0.21.0): a row under the account foot on the sidebar, a row of the «بیشتر»
   sheet on a phone. */
.dina-shell-theme,
.dina-shell-sheet-theme {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 11px;
}
.dina-shell-theme {
  padding: 0 14px 4px;
  color: var(--d-mut);
}
.dina-shell-sheet-theme {
  margin-block-start: 6px;
  padding: 10px 4px 4px;
  border-block-start: 1px solid var(--paper-line);
  color: var(--l-mut);
  font-size: 13px;
}
.dina-shell-sheet-aside {
  margin-block-start: 0;
  padding: 4px 4px 10px;
  border-block-end: 1px solid var(--paper-line);
  margin-block-end: 6px;
}
.dina-shell-who {
  display: flex;
  flex-direction: column;
  gap: 1px;
  flex: 1;
  min-inline-size: 0;
}
.dina-shell-who-name {
  font-size: 12px;
  font-weight: 500;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.dina-shell-who-role {
  font-size: 10px;
  color: var(--d-mut);
}
.dina-shell-more {
  display: inline-grid;
  place-items: center;
  padding: 4px;
  border: 0;
  border-radius: var(--r-xs);
  background: transparent;
  color: var(--d-faint);
  cursor: pointer;
}
.dina-shell-more:hover {
  color: var(--d-fg);
}

/* Popovers off the dark column are LIGHT: their contents are ordinary controls, and re-theming
   toggles and help text for a dark popover would fork them. */
.dina-shell-menu {
  position: absolute;
  inset-inline: 10px;
  z-index: 20;
  display: flex;
  flex-direction: column;
  padding: 6px;
  border: 1px solid var(--paper-line);
  border-radius: var(--r-md);
  background: var(--paper-1);
  box-shadow: var(--shadow-pop);
  color: var(--l-fg);
}
.dina-shell-ws-menu {
  inset-block-start: calc(100% - 10px);
  inset-inline: 14px;
}
.dina-shell-foot-menu {
  inset-block-end: 52px;
}
.dina-shell-menu form {
  display: contents;
}
/* The switcher's groups — views, workspaces, commands — divided by a hairline, so an action never
   reads as one more workspace. */
.dina-shell-menu-group {
  display: flex;
  flex-direction: column;
}
.dina-shell-menu-group + .dina-shell-menu-group {
  margin-block-start: 4px;
  padding-block-start: 4px;
  border-block-start: 1px solid var(--paper-line);
}
.dina-shell-menu-action {
  color: var(--l-mut);
}
.dina-shell-menu-action[aria-checked='true'] {
  color: var(--l-fg);
  font-weight: 600;
}
.dina-shell-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  inline-size: 100%;
  padding: 9px 10px;
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--l-fg);
  font: inherit;
  font-size: 12.5px;
  text-align: start;
  text-decoration: none;
  cursor: pointer;
}
.dina-shell-menu-item:hover,
.dina-shell-menu-item[aria-current='page'] {
  background: var(--paper-2);
  text-decoration: none;
}
.dina-shell-menu-text {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-inline-size: 0;
}
.dina-shell-menu-sub {
  font-size: 10.5px;
  color: var(--l-mut);
}
.dina-shell-menu-danger {
  color: var(--err);
}
.dina-shell-menu-danger:hover {
  background: var(--err-bg);
}

/* The content column: the page header is fixed, the body scrolls. */
.dina-shell-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-inline-size: 0;
  min-block-size: 0;
}
.dina-shell-content > .dina-page-head {
  padding-inline: 20px;
}
.dina-shell-body {
  /* Positioned so absolutely-placed descendants (every Table's .dina-sr-only caption) are
     contained and clipped by this scroller. Without it they escaped to the viewport, made the
     DOCUMENT taller than the 100dvh shell, and the whole page scrolled past the shell. */
  position: relative;
  flex: 1;
  min-block-size: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px;
}
/* A scrolling flex column would otherwise squeeze its cards to fit instead of scrolling. */
.dina-shell-body > * {
  flex-shrink: 0;
}

/* The phone tab bar and its sheet — hidden on a desk. */
.dina-shell-tabbar,
.dina-shell-sheet-backdrop {
  display: none;
}

@media (max-width: 1099px) {
  .dina-shell-side {
    display: none;
  }
  .dina-shell-content > .dina-page-head {
    padding-inline: 16px;
  }
  .dina-shell-body {
    padding: 14px 12px calc(76px + env(safe-area-inset-bottom));
  }
  .dina-shell-tabbar {
    position: fixed;
    inset-inline: 0;
    inset-block-end: 0;
    z-index: 30;
    display: flex;
    padding-block-end: env(safe-area-inset-bottom);
    border-block-start: 1px solid var(--paper-line);
    background: var(--paper-1);
  }
  .dina-shell-tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    /* A phone target: the 44px floor holds here even inside `.dina-dense`. */
    min-block-size: 56px;
    padding-block: 8px 6px;
    border: 0;
    background: transparent;
    color: var(--l-faint);
    font: inherit;
    font-size: 10.5px;
    text-decoration: none;
    cursor: pointer;
  }
  /* Active: accent ink AND bold, so colour is not the only signal. */
  .dina-shell-tab[aria-current='page'] {
    color: var(--acc-1);
    font-weight: 700;
  }
  .dina-shell-tab-icon {
    position: relative;
    display: inline-flex;
  }
  .dina-shell-tab-count {
    position: absolute;
    inset-block-start: -6px;
    inset-inline-end: -12px;
  }
  .dina-shell-sheet-backdrop {
    position: fixed;
    inset: 0;
    z-index: 29;
    display: flex;
    align-items: flex-end;
    background: color-mix(in oklch, var(--ink-0) 40%, transparent);
  }
  .dina-shell-sheet {
    display: flex;
    flex-direction: column;
    gap: 2px;
    inline-size: 100%;
    max-block-size: 80dvh;
    overflow-y: auto;
    padding: 12px 12px calc(76px + env(safe-area-inset-bottom));
    border-start-start-radius: var(--r-lg);
    border-start-end-radius: var(--r-lg);
    background: var(--paper-1);
    box-shadow: var(--shadow-pop);
  }
  .dina-shell-sheet .dina-shell-menu-item {
    min-block-size: 44px;
    font-size: 14px;
  }
  .dina-shell-sheet-label {
    padding: 10px 10px 2px;
    font-size: 11px;
    color: var(--l-faint);
  }
}

@media (prefers-reduced-motion: reduce) {
  .dina-shell-item {
    transition: none;
  }
}

/* ═══ MARKETING — the site nav, the glass surface, the scroll reveal ═══════════
   Promoted from دینا پالس's landing when the owner decided (2026-09-26) that every Dina
   marketing site carries the same header. The nav is `SiteNav` in src/patterns; the
   glass and the reveal came with it because a landing that uses the nav is built in the
   same language, and three pasted copies of a frosted card are three frostings by the
   second redesign. Each landing's own sections stay local.

   The glass needs a vibrant background to read as glass: a page that uses it paints an
   accent wash behind it (radial gradients of --acc-1 and --acc-2), which is page layout
   and stays in the product. */

/* ── glass surface ───────────────────────────────────────────────────────────── */
.dina-glass {
  position: relative;
  z-index: 1;
  padding: clamp(20px, 2.6vw, 28px);
  border: 1px solid var(--glass-line);
  border-radius: var(--r-xl);
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  box-shadow:
    inset 0 1px 0 var(--glass-line),
    0 24px 60px -36px color-mix(in oklch, var(--acc-1) 40%, transparent);
  transition:
    transform var(--t-slow) var(--ease),
    box-shadow var(--t-slow) var(--ease);
}
a.dina-glass:hover {
  transform: translateY(-3px);
  box-shadow:
    inset 0 1px 0 var(--glass-line),
    0 30px 60px -30px color-mix(in oklch, var(--acc-1) 55%, transparent);
}
/* A ghost button frosted to sit on a wash beside the gradient one. */
.dina-btn-glass {
  background: var(--glass-bg);
  border-color: var(--glass-line);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
}

/* ── scroll reveal — see useReveal. Stagger siblings with style="--i: n" ──────── */
html.dina-js .dina-reveal {
  opacity: 0;
  transform: translateY(14px) scale(0.985);
  transition:
    opacity 0.5s var(--ease),
    transform 0.5s var(--ease);
  transition-delay: calc(var(--i, 0) * 70ms);
}
html.dina-js .dina-reveal.dina-in {
  opacity: 1;
  transform: none;
}

/* ── site nav: the floating island ─────────────────────────────────────────────
   The island takes 74px of flow (14px gap + 60px bar). A hero that wants its wash to run
   behind the glass to the top edge pulls itself up by `--sitenav-h` and pads it back. */
:root {
  --sitenav-h: 74px;
}
.dina-sitenav {
  position: sticky;
  inset-block-start: 0;
  z-index: 60;
  padding: 14px 16px 0;
  transition: padding 0.3s var(--ease);
}
.dina-sitenav[data-scrolled='true'] {
  padding-block-start: 8px;
}
.dina-sitenav-island {
  /* The progress ring below is drawn against this box. */
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  max-inline-size: var(--wrap);
  min-height: 60px;
  margin-inline: auto;
  padding-block: 6px;
  padding-inline: 8px 14px;
  border: 1px solid var(--glass-line);
  border-radius: var(--r-pill);
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  box-shadow:
    inset 0 1px 0 var(--glass-line),
    var(--shadow-card);
  /* The shape properties only move in the docked mode below; listed here so the reduced-motion
     rule at the end of this section switches them off with the rest. */
  transition:
    box-shadow 0.3s var(--ease),
    background 0.3s var(--ease),
    max-inline-size 0.3s var(--ease),
    min-height 0.3s var(--ease),
    padding 0.3s var(--ease),
    border-radius 0.3s var(--ease);
}
.dina-sitenav[data-scrolled='true'] .dina-sitenav-island {
  background: var(--glass-bg-strong);
  box-shadow:
    inset 0 1px 0 var(--glass-line),
    var(--shadow-pop);
}
/* Docked: a flat, full-width bar on the top edge until the page scrolls, then the island above.
   Both states take 68px of flow (the scrolled island's 8px gap plus its 60px bar), so the page
   below never moves while the bar changes shape. The bar's inline padding keeps its content to
   `--wrap`, the width the island's content sits in. */
.dina-sitenav[data-docked='true'] .dina-sitenav-island {
  /* Half the 60px bar. A 100px pill would round the corners in the first few frames and then
     sit still; this rounds them across the whole transition. */
  border-radius: 30px;
}
.dina-sitenav[data-docked='true']:not([data-scrolled='true']) {
  padding: 0;
}
.dina-sitenav[data-docked='true']:not([data-scrolled='true']) .dina-sitenav-island {
  max-inline-size: 100%;
  min-height: 68px;
  padding-inline: max(16px, (100% - var(--wrap)) / 2);
  border-width: 0 0 1px;
  border-color: var(--glass-line-soft);
  border-radius: 0;
  background: var(--glass-bg-strong);
  box-shadow: none;
}
.dina-sitenav[data-docked='true']:not([data-scrolled='true']) .dina-sitenav-sheet {
  margin-inline: 16px;
}
/* Reading progress along the island's border, from `--sitenav-progress` (0 to 1) on the root.
   The SVG covers the border box, so the 30px-cornered rect follows the island's outer edge (the
   bar is 60px tall, so 30px is the pill) and the stroke lies over the border. The rect's path
   starts at the top-left corner and runs clockwise; in RTL the mirror makes it start at the top
   right, where the page starts. A physical transform on purpose: it flips a drawing, not text. */
.dina-sitenav-progress {
  position: absolute;
  inset-block-start: -1px;
  inset-inline-start: -1px;
  inline-size: calc(100% + 2px);
  block-size: calc(100% + 2px);
  overflow: visible;
  pointer-events: none;
  transition: opacity 0.3s var(--ease);
}
[dir='rtl'] .dina-sitenav-progress {
  transform: scaleX(-1);
}
.dina-sitenav-progress rect {
  fill: none;
  stroke-width: 2.5;
  stroke-dasharray: 100;
  stroke-dashoffset: calc(100 - 100 * var(--sitenav-progress, 0));
}
/* A flat docked bar has no corners for the ring to follow. */
.dina-sitenav[data-docked='true']:not([data-scrolled='true']) .dina-sitenav-progress {
  opacity: 0;
}
/* Dark: for a page on a dark canvas. The floating island stays white, whiter than the standard
   glass (a 78% white film over ink reads as a grey strip) but still clear enough to show the page
   blurred behind it, and it carries a soft shadow all round so it lifts off light and dark alike.
   The owner asked for both on دینا کد's inner pages (2026-10-17). */
.dina-sitenav[data-dark='true'] {
  --glass-bg: color-mix(in srgb, var(--paper-1) 82%, transparent);
  --glass-bg-strong: color-mix(in srgb, var(--paper-1) 85%, transparent);
}
.dina-sitenav[data-dark='true']:not([data-ink='true']) .dina-sitenav-island {
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  box-shadow:
    inset 0 1px 0 var(--glass-line),
    0 2px 6px color-mix(in srgb, var(--ink-0) 10%, transparent),
    0 12px 36px -6px color-mix(in srgb, var(--ink-0) 32%, transparent);
}
/* Ink (`data-ink`, set in SiteNav.tsx): a docked bar lying flat on a dark page takes the page's
   colour. The glass tokens are re-pointed at ink inside the header, so the bar, the burger and
   the sheet all follow; the text moves to the on-dark ramp and the button turns white. */
.dina-sitenav[data-ink='true'] {
  --glass-bg: color-mix(in srgb, var(--ink-1) 62%, transparent);
  --glass-bg-strong: color-mix(in srgb, var(--ink-1) 84%, transparent);
  --glass-line: var(--ink-line-strong);
  --glass-line-soft: var(--ink-line);
}
.dina-sitenav[data-ink='true'] .dina-sitenav-brand,
.dina-sitenav[data-ink='true'] .dina-sitenav-burger,
.dina-sitenav[data-ink='true'] .dina-sitenav-sheet a:not(.dina-sitenav-sheet-cta) {
  color: var(--d-fg);
}
.dina-sitenav[data-ink='true'] .dina-sitenav-links a,
.dina-sitenav[data-ink='true'] .dina-sitenav-login {
  color: var(--d-mut);
}
.dina-sitenav[data-ink='true'] .dina-sitenav-links a:hover,
.dina-sitenav[data-ink='true'] .dina-sitenav-login:hover {
  color: var(--d-fg);
}
/* The light bar's hover fill is the strong glass, which on ink glass is the same colour again. */
.dina-sitenav[data-ink='true'] .dina-sitenav-links a:hover {
  background: var(--ink-fill);
}
.dina-sitenav[data-ink='true'] .dina-sitenav-sheet a:not(.dina-sitenav-sheet-cta):hover {
  background: var(--ink-fill);
}
.dina-sitenav[data-ink='true'] .dina-sitenav-sheet .dina-sitenav-sheet-cta:hover {
  background: var(--paper-2);
}
.dina-sitenav-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  color: var(--l-fg);
  text-decoration: none;
}
.dina-sitenav-mark {
  display: grid;
  place-items: center;
  inline-size: 36px;
  block-size: 36px;
  border-radius: 11px;
  background: var(--acc-grad);
  color: var(--ink-on-grad);
  font-weight: 900;
  font-size: 1.05rem;
  line-height: 1;
  box-shadow: var(--shadow-glow);
}
/* Artwork is wider than it is tall (the product illustrations are ~4:3), so only the height is
   fixed: the same 36px as the letter tile, so the bar measures the same either way. */
.dina-sitenav-logo {
  flex: 0 0 auto;
  inline-size: auto;
  block-size: 36px;
  object-fit: contain;
}
.dina-sitenav-name {
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: -0.01em;
}
.dina-sitenav-links {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1 1 auto;
  justify-content: center;
}
.dina-sitenav-links a {
  padding: 10px 14px;
  border-radius: var(--r-pill);
  color: var(--l-mut);
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition:
    background var(--t-fast) var(--ease),
    color var(--t-fast) var(--ease);
}
.dina-sitenav-links a:hover {
  background: var(--glass-bg-strong);
  color: var(--l-fg);
}
.dina-sitenav-cta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  margin-inline-start: auto;
}
.dina-sitenav-login {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding-inline: 12px;
  color: var(--l-mut);
  font-size: 0.92rem;
  font-weight: 700;
  text-decoration: none;
}
.dina-sitenav-login:hover {
  color: var(--l-fg);
}
.dina-sitenav-burger {
  display: none;
  inline-size: 44px;
  block-size: 44px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--glass-line);
  border-radius: var(--r-pill);
  background: var(--glass-bg-strong);
  color: var(--l-fg);
  cursor: pointer;
}
.dina-sitenav-sheet {
  display: grid;
  gap: 2px;
  max-inline-size: var(--wrap);
  margin: 8px auto 0;
  padding: 10px;
  border: 1px solid var(--glass-line);
  border-radius: var(--r-xl);
  background: var(--glass-bg-strong);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  box-shadow: var(--shadow-pop);
}
.dina-sitenav-sheet[hidden] {
  display: none;
}
.dina-sitenav-sheet a {
  display: flex;
  align-items: center;
  min-height: 48px;
  padding-inline: 14px;
  border-radius: var(--r-md);
  color: var(--l-fg);
  font-weight: 700;
  text-decoration: none;
}
.dina-sitenav-sheet a:hover {
  background: var(--paper-2);
}
.dina-sitenav-sheet .dina-sitenav-sheet-cta {
  justify-content: center;
  margin-block-start: 8px;
  border-radius: var(--r-pill);
}
.dina-sitenav-sheet .dina-sitenav-sheet-cta:hover {
  background: var(--ink-on-grad);
}
@media (max-width: 900px) {
  .dina-sitenav-links,
  .dina-sitenav-login {
    display: none;
  }
  .dina-sitenav-burger {
    display: inline-flex;
  }
}
@media (max-width: 640px) {
  .dina-sitenav-island {
    padding-inline-start: 10px;
  }
  .dina-sitenav-cta .dina-btn {
    display: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  .dina-sitenav,
  .dina-sitenav-island,
  .dina-sitenav-progress,
  .dina-glass {
    transition: none;
  }
}

/* ══════════════════════════════════════════════════════════════════════════════
   v0.13.0 — the console kit (Tabs, Drawer, Skeleton, CopyField, CodeBlock,
   Combobox, DropdownMenu, Stepper, JalaliDateRange, StackedBarChart, Sparkline).
   Built for دینا لبز's console on 2026-10-25; nothing here knows a product.
   ══════════════════════════════════════════════════════════════════════════════ */

/* ── tabs ──────────────────────────────────────────────────────────────────── */
.dina-tabs-list {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
}
.dina-tabs-list::-webkit-scrollbar {
  display: none;
}
.dina-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  min-height: 44px;
  padding-inline: 14px;
  border: 0;
  background: transparent;
  color: var(--l-mut);
  font: inherit;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  transition: color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.dina-tab:hover {
  color: var(--l-fg);
}
.dina-tab:disabled {
  opacity: 0.45;
  cursor: default;
}
.dina-tab:focus-visible {
  outline: 2px solid var(--acc-1);
  outline-offset: -2px;
  border-radius: var(--r-sm);
}
.dina-tab-badge {
  min-width: 20px;
  padding: 1px 7px;
  border-radius: var(--r-pill);
  background: var(--paper-2);
  color: var(--l-mut);
  font-size: 0.72rem;
  font-weight: 700;
  text-align: center;
}
.dina-tabs-line .dina-tabs-list {
  border-block-end: 1px solid var(--paper-line);
}
.dina-tabs-line .dina-tab {
  margin-block-end: -1px;
  border-block-end: 2px solid transparent;
}
.dina-tabs-line .dina-tab[aria-selected='true'] {
  color: var(--l-fg);
  border-block-end-color: var(--acc-1);
}
.dina-tabs-pill .dina-tabs-list {
  display: inline-flex;
  padding: 4px;
  border: 1px solid var(--paper-line);
  border-radius: var(--r-pill);
  background: var(--paper-2);
}
.dina-tabs-pill .dina-tab {
  min-height: 36px;
  border-radius: var(--r-pill);
}
.dina-tabs-pill .dina-tab[aria-selected='true'] {
  background: var(--paper-1);
  color: var(--l-fg);
  box-shadow: 0 6px 18px -10px rgba(40, 30, 80, 0.4);
}
.dina-tab-panel {
  padding-block-start: 16px;
}
.dina-tab-panel:focus-visible {
  outline: 2px solid var(--acc-1);
  outline-offset: 4px;
  border-radius: var(--r-sm);
}

/* ── drawer ────────────────────────────────────────────────────────────────── */
.dina-drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  justify-content: flex-end;
  background: color-mix(in oklch, var(--ink-0) 45%, transparent);
  backdrop-filter: blur(3px);
  animation: dina-fade 160ms var(--ease);
}
/* `flex-end` is the inline END in either direction; `from-start` flips it to the start. */
.dina-drawer-from-start {
  justify-content: flex-start;
}
.dina-drawer {
  display: flex;
  flex-direction: column;
  inline-size: 100%;
  block-size: 100dvh;
  background: var(--paper-1);
  box-shadow: var(--shadow-pop);
  animation: dina-drawer-in-end 220ms var(--ease);
}
.dina-drawer-from-start .dina-drawer {
  animation-name: dina-drawer-in-start;
}
/* The slide is a transform, which is physical: the END edge is the left of an RTL page, so
   the keyframes are written per direction. */
@keyframes dina-drawer-in-end {
  from {
    transform: translateX(-24px);
    opacity: 0;
  }
}
@keyframes dina-drawer-in-start {
  from {
    transform: translateX(24px);
    opacity: 0;
  }
}
[dir='ltr'] .dina-drawer {
  animation-name: dina-drawer-in-start;
}
[dir='ltr'] .dina-drawer-from-start .dina-drawer {
  animation-name: dina-drawer-in-end;
}
@media (prefers-reduced-motion: reduce) {
  .dina-drawer,
  .dina-drawer-backdrop {
    animation: none;
  }
}
.dina-drawer-sm {
  max-inline-size: 24rem;
}
.dina-drawer-md {
  max-inline-size: 32rem;
}
.dina-drawer-lg {
  max-inline-size: 46rem;
}
.dina-drawer-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  flex: 0 0 auto;
  padding: 16px 18px;
  border-block-end: 1px solid var(--paper-line);
}
.dina-drawer-titles {
  flex: 1;
  min-inline-size: 0;
}
.dina-drawer-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
  color: var(--l-fg);
  overflow-wrap: anywhere;
}
.dina-drawer-sub {
  margin: 4px 0 0;
  font-size: 0.8rem;
  color: var(--l-mut);
}
.dina-drawer-body {
  flex: 1 1 auto;
  min-block-size: 0;
  overflow-y: auto;
  padding: 18px;
}
.dina-drawer-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex: 0 0 auto;
  padding: 14px 18px;
  border-block-start: 1px solid var(--paper-line);
}

/* ── skeleton ──────────────────────────────────────────────────────────────── */
.dina-skel {
  display: block;
  max-inline-size: 100%;
  border-radius: var(--r-xs);
  background: linear-gradient(
    90deg,
    var(--paper-2) 0%,
    color-mix(in oklch, var(--paper-2) 55%, var(--paper-1)) 50%,
    var(--paper-2) 100%
  );
  background-size: 200% 100%;
  animation: dina-skel-shimmer 1.4s ease-in-out infinite;
}
@keyframes dina-skel-shimmer {
  from {
    background-position: 100% 0;
  }
  to {
    background-position: -100% 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .dina-skel {
    animation: none;
  }
}
.dina-skel-text {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.dina-skel-group {
  display: contents;
}

/* ── copy field and copy button ────────────────────────────────────────────── */
.dina-copyfield {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.dina-copyfield-row {
  display: flex;
  gap: 8px;
}
.dina-copyfield-input {
  flex: 1;
  min-inline-size: 0;
}
.dina-copy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex: 0 0 auto;
  min-block-size: 44px;
  padding-inline: 14px;
  border: 1px solid var(--paper-line);
  border-radius: var(--r-sm);
  background: var(--paper-1);
  color: var(--l-fg);
  font: inherit;
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
  transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast);
}
.dina-copy-btn:hover {
  background: var(--paper-2);
}
.dina-copy-btn:focus-visible {
  outline: none;
  box-shadow: var(--ring);
  border-color: var(--violet);
}
.dina-copy-btn[data-state='copied'] {
  color: var(--ok);
  border-color: color-mix(in oklch, var(--ok) 40%, var(--paper-line));
}
.dina-copy-btn[data-state='failed'] {
  color: var(--err);
}
.dina-copy-btn-icon {
  inline-size: 36px;
  min-block-size: 36px;
  padding: 0;
}

/* ── code block ────────────────────────────────────────────────────────────── */
.dina-code {
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--paper-line);
  border-radius: var(--r-md);
  background: var(--ink-1);
}
/* Wraps (v0.15.3): at phone width a title, three tabs and «کپی» did not fit on one line and the
   copy button was clipped at the edge. The tabs or the button now drop to a second row. */
.dina-code-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  padding: 6px 8px;
  border-block-end: 1px solid color-mix(in oklch, var(--d-fg) 12%, transparent);
}
.dina-code-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--d-mut);
  padding-inline-start: 6px;
}
.dina-code-tabs {
  display: flex;
  gap: 2px;
  margin-inline-end: auto;
}
.dina-code-tab {
  min-block-size: 32px;
  padding-inline: 12px;
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--d-mut);
  font-family: var(--mono);
  font-size: 0.78rem;
  cursor: pointer;
}
.dina-code-tab:hover {
  color: var(--d-fg);
}
.dina-code-tab[aria-pressed='true'] {
  background: color-mix(in oklch, var(--d-fg) 12%, transparent);
  color: var(--d-fg);
}
.dina-code-tab:focus-visible {
  outline: 2px solid var(--acc-2);
  outline-offset: -2px;
}
.dina-code .dina-code-copy {
  min-block-size: 32px;
  margin-inline-start: auto;
  border-color: color-mix(in oklch, var(--d-fg) 18%, transparent);
  background: transparent;
  color: var(--d-fg);
  font-size: 0.78rem;
}
.dina-code .dina-code-copy:hover {
  background: color-mix(in oklch, var(--d-fg) 10%, transparent);
}
/* Capped at 24rem and scrolled past that (v0.13.5): a routing preview with every provider listed
   ran a screen and a half and pushed the rest of the page out of reach. */
.dina-code-pre {
  margin: 0;
  padding: 14px 16px;
  max-block-size: 24rem;
  overflow: auto;
  color: var(--d-fg);
  font-family: var(--mono);
  font-size: 0.82rem;
  line-height: 1.7;
  text-align: left;
  white-space: pre;
  tab-size: 2;
}
.dina-code-pre:focus-visible {
  outline: 2px solid var(--acc-2);
  outline-offset: -2px;
}

/* ── combobox ──────────────────────────────────────────────────────────────── */
.dina-combo {
  position: relative;
}
.dina-combo-field {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-block-size: 46px;
  padding: 6px 10px;
  border: 1px solid var(--paper-line);
  border-radius: var(--r-sm);
  background: var(--paper-3);
  cursor: text;
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.dina-combo-field:focus-within {
  background: var(--paper-1);
  border-color: var(--violet);
  box-shadow: var(--ring);
}
.dina-combo-disabled .dina-combo-field {
  background: var(--paper-2);
  cursor: default;
}
.dina-combo-input {
  flex: 1;
  min-inline-size: 8ch;
  min-block-size: 32px;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--l-fg);
  font: inherit;
  font-size: 1rem;
}
.dina-combo-input::placeholder {
  color: var(--l-faint);
}
.dina-combo-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 4px 3px 8px;
  border-radius: var(--r-pill);
  background: var(--sel-bg);
  color: var(--l-fg);
  font-size: 0.8rem;
  font-weight: 600;
}
.dina-combo-chip button {
  display: inline-flex;
  padding: 3px;
  border: 0;
  border-radius: var(--r-pill);
  background: transparent;
  color: var(--l-mut);
  cursor: pointer;
}
.dina-combo-chip button:hover {
  background: var(--paper-2);
  color: var(--l-fg);
}
.dina-combo-caret,
.dina-combo-clear {
  flex: 0 0 auto;
  color: var(--l-faint);
}
.dina-combo-clear {
  display: inline-flex;
  padding: 6px;
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  cursor: pointer;
}
.dina-combo-clear:hover {
  color: var(--l-fg);
  background: var(--paper-2);
}
/* Placed in a portal by `useFloating` (fixed, measured from the field), so no inset here. */
.dina-combo-list {
  box-sizing: border-box;
  margin: 0;
  padding: 6px;
  overflow-y: auto;
  list-style: none;
  border: 1px solid var(--paper-line);
  border-radius: var(--r-md);
  background: var(--paper-1);
  box-shadow: var(--shadow-pop);
}
.dina-combo-option {
  display: flex;
  align-items: center;
  gap: 10px;
  min-block-size: 44px;
  padding: 7px 10px;
  border-radius: var(--r-sm);
  color: var(--l-fg);
  cursor: pointer;
}
.dina-combo-option[data-active] {
  background: var(--paper-2);
}
.dina-combo-option[aria-disabled='true'] {
  opacity: 0.45;
  cursor: default;
}
.dina-combo-leading {
  display: inline-flex;
  flex: 0 0 auto;
}
.dina-combo-text {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-inline-size: 0;
}
.dina-combo-label {
  overflow: hidden;
  font-size: 0.9rem;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dina-combo-label[dir='ltr'] {
  text-align: start;
}
.dina-combo-hint {
  font-size: 0.76rem;
  color: var(--l-mut);
}
.dina-combo-trailing {
  flex: 0 0 auto;
  font-size: 0.78rem;
  color: var(--l-mut);
}
.dina-combo-check {
  flex: 0 0 auto;
  color: var(--acc-1);
}
.dina-combo-empty {
  padding: 14px 10px;
  font-size: 0.86rem;
  color: var(--l-mut);
  text-align: center;
}

/* ── listbox (v0.23.0) ─────────────────────────────────────────────────────
   The system's dropdown for one value. The button's skin sits in :where(), so it has no
   specificity and a product's own field class (خیال's `.field`) wins over it; the layout rules
   outside :where() are what the component needs to draw at all. The list is a popover in the top
   layer: margin and inset are reset from the browser's popover defaults, and useFloating places it. */
.dina-listbox-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-inline-size: 0;
  text-align: start;
  cursor: pointer;
}
:where(.dina-listbox-btn) {
  inline-size: 100%;
  min-block-size: 46px;
  padding-block: 0;
  padding-inline: 14px 12px;
  border: 1px solid var(--paper-line);
  border-radius: var(--r-sm);
  background: var(--paper-3);
  color: var(--l-fg);
  font: inherit;
  font-size: 1rem;
  transition:
    border-color var(--t-fast) var(--ease),
    box-shadow var(--t-fast) var(--ease),
    background var(--t-fast) var(--ease);
}
:where(.dina-listbox-btn):hover:not(:disabled) {
  border-color: color-mix(in oklch, var(--paper-line), var(--l-mut) 35%);
}
:where(.dina-listbox-btn):focus-visible,
:where(.dina-listbox-btn)[aria-expanded='true'] {
  outline: none;
  background: var(--paper-1);
  border-color: var(--violet);
  box-shadow: var(--ring);
}
.dina-listbox-btn:disabled {
  opacity: 0.55;
  cursor: default;
}
.dina-listbox-value {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 8px;
  min-inline-size: 0;
}
.dina-listbox-current {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dina-listbox-current[dir='ltr'],
.dina-listbox-label[dir='ltr'] {
  unicode-bidi: isolate;
}
.dina-listbox-placeholder {
  color: var(--l-faint);
}
.dina-listbox-caret {
  flex: 0 0 auto;
  color: var(--l-mut);
  transition: transform var(--t-fast) var(--ease);
}
.dina-listbox-btn[aria-expanded='true'] .dina-listbox-caret {
  transform: rotate(180deg);
}
.dina-listbox-list {
  box-sizing: border-box;
  min-inline-size: 180px;
  margin: 0;
  inset: auto;
  padding: 6px;
  overflow-y: auto;
  overscroll-behavior: contain;
  list-style: none;
  border: 1px solid var(--paper-line);
  border-radius: var(--r-md);
  background: var(--paper-1);
  color: var(--l-fg);
  box-shadow: var(--shadow-pop);
  font-size: 0.9rem;
}
.dina-listbox-list:popover-open,
.dina-listbox-list:not([popover]):not([hidden]) {
  animation: dina-listbox-in 0.14s var(--ease) both;
}
@keyframes dina-listbox-in {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
}
.dina-listbox-group {
  padding: 10px 10px 4px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--l-mut);
}
.dina-listbox-group:first-child {
  padding-block-start: 4px;
}
.dina-listbox-option {
  display: flex;
  align-items: center;
  gap: 10px;
  min-block-size: 44px;
  padding: 7px 10px;
  border-radius: var(--r-sm);
  cursor: pointer;
}
.dina-listbox-option[data-active] {
  background: var(--paper-2);
}
.dina-listbox-option[aria-selected='true'] .dina-listbox-label {
  font-weight: 700;
}
.dina-listbox-option[aria-disabled='true'] {
  opacity: 0.45;
  cursor: default;
}
.dina-listbox-leading {
  display: inline-flex;
  flex: 0 0 auto;
}
.dina-listbox-text {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-inline-size: 0;
}
.dina-listbox-label {
  overflow: hidden;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dina-listbox-hint {
  font-size: 0.76rem;
  color: var(--l-mut);
}
.dina-listbox-trailing {
  flex: 0 0 auto;
  font-size: 0.78rem;
  color: var(--l-mut);
}
.dina-listbox-check {
  display: inline-flex;
  flex: 0 0 16px;
  color: var(--acc-1);
}
.dina-dense :where(.dina-listbox-btn) {
  min-block-size: 38px;
  font-size: 13px;
}
.dina-dense .dina-listbox-option {
  min-block-size: 36px;
}
@media (prefers-reduced-motion: reduce) {
  .dina-listbox-list:popover-open,
  .dina-listbox-list:not([popover]):not([hidden]) {
    animation: none;
  }
  .dina-listbox-caret {
    transition: none;
  }
}

/* ── picker (v0.16.6) ──────────────────────────────────────────────────────
   A wide searchable list in a popover, placed by `useFloating`; a sheet from the bottom edge on a
   phone. The panel is a column: search, filters, then the list, which alone scrolls. */
.dina-picker {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  inline-size: min(40rem, calc(100vw - 16px));
  min-block-size: 0;
  overflow: hidden;
  border: 1px solid var(--paper-line);
  border-radius: var(--r-md);
  background: var(--paper-1);
  box-shadow: var(--shadow-pop);
  color: var(--l-fg);
}
.dina-picker-sheet {
  position: fixed;
  inset-inline: 0;
  inset-block-end: 0;
  z-index: 1000;
  inline-size: 100%;
  max-block-size: 85dvh;
  border-end-start-radius: 0;
  border-end-end-radius: 0;
  padding-block-end: env(safe-area-inset-bottom, 0px);
}
.dina-picker-backdrop {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: color-mix(in oklch, var(--ink-0) 40%, transparent);
}
.dina-picker-search {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
  padding-block: 6px;
  padding-inline: 12px 6px;
  border-block-end: 1px solid var(--paper-line-soft);
  color: var(--l-mut);
}
.dina-picker-input {
  flex: 1 1 auto;
  min-inline-size: 0;
  min-block-size: 44px;
  border: 0;
  outline: none;
  background: transparent;
  font: inherit;
  font-size: 0.95rem;
  color: var(--l-fg);
}
.dina-picker-input::placeholder {
  color: var(--l-faint);
}
.dina-picker-input:placeholder-shown {
  direction: inherit;
}
.dina-picker-count {
  flex: 0 0 auto;
  font-size: 0.78rem;
  color: var(--l-faint);
  white-space: nowrap;
}
.dina-picker-close {
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  inline-size: 36px;
  block-size: 36px;
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--l-mut);
  cursor: pointer;
}
.dina-picker-close:hover {
  background: var(--paper-2);
  color: var(--l-fg);
}
.dina-picker-filters {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-block-end: 1px solid var(--paper-line-soft);
}
.dina-picker-list {
  flex: 1 1 auto;
  min-block-size: 0;
  margin: 0;
  padding: 6px;
  overflow-y: auto;
  overscroll-behavior: contain;
  list-style: none;
}
.dina-picker-group {
  padding: 10px 10px 4px;
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--l-faint);
}
.dina-picker-option {
  display: flex;
  align-items: center;
  gap: 12px;
  min-block-size: 52px;
  padding: 8px 10px;
  border-radius: var(--r-sm);
  cursor: pointer;
}
.dina-picker-option[data-active] {
  background: var(--paper-2);
}
.dina-picker-option[aria-disabled='true'] {
  opacity: 0.45;
  cursor: default;
}
.dina-picker-leading {
  display: inline-flex;
  flex: 0 0 auto;
}
.dina-picker-text {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 2px;
  min-inline-size: 0;
}
.dina-picker-label {
  overflow: hidden;
  font-size: 0.92rem;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dina-picker-sub {
  overflow: hidden;
  font-size: 0.76rem;
  color: var(--l-mut);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dina-picker-meta {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 14px;
  font-size: 0.78rem;
  color: var(--l-mut);
}
.dina-picker-check {
  display: inline-flex;
  flex: 0 0 16px;
  color: var(--acc-1);
}
.dina-picker-empty {
  padding: 18px 10px;
  font-size: 0.86rem;
  color: var(--l-mut);
  text-align: center;
}
/* ── markdown (v0.16.7) ─────────────────────────────────────────────────────
   A model's answer. Spacing between blocks only, so it sits in any bubble or card. */
.dina-md {
  font-size: 0.92rem;
  line-height: 2;
  color: var(--l-fg);
  overflow-wrap: anywhere;
}
.dina-md > * {
  margin: 0;
}
.dina-md > * + * {
  margin-block-start: 0.7em;
}
.dina-md h3,
.dina-md h4,
.dina-md h5,
.dina-md h6 {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.7;
}
.dina-md h3 {
  font-size: 1.08rem;
}
.dina-md ul,
.dina-md ol {
  padding-inline-start: 1.4em;
}
/* Named outright (v0.16.8): `list-style` inherits, and an answer is usually drawn inside a list of
   messages whose own markers are off, which took the numbers off every numbered answer. */
.dina-md ul {
  list-style-type: disc;
}
.dina-md ol {
  list-style-type: decimal;
}
.dina-md ol:dir(rtl) {
  list-style-type: persian;
}
.dina-md li + li {
  margin-block-start: 0.25em;
}
.dina-md blockquote {
  padding-inline-start: 12px;
  border-inline-start: 3px solid var(--paper-line);
  color: var(--l-mut);
}
.dina-md hr {
  border: 0;
  border-block-start: 1px solid var(--paper-line);
}
.dina-md a {
  color: var(--violet);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.dina-md code {
  padding: 1px 5px;
  border-radius: 6px;
  background: var(--paper-2);
  font-family: var(--mono);
  font-size: 0.84em;
}
.dina-md-code {
  overflow: hidden;
  border: 1px solid var(--paper-line);
  border-radius: var(--r-sm);
  background: var(--paper-2);
}
.dina-md-code figcaption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-block: 2px;
  padding-inline: 12px 4px;
  border-block-end: 1px solid var(--paper-line);
  font-family: var(--mono);
  font-size: 0.74rem;
  color: var(--l-mut);
}
.dina-md-code pre {
  margin: 0;
  padding: 12px;
  overflow-x: auto;
  line-height: 1.7;
  text-align: start; /* the pre is dir="ltr", so start is the left edge on any page */
}
.dina-md-code pre code {
  padding: 0;
  background: none;
  font-size: 0.82rem;
  white-space: pre;
}
.dina-md-table {
  overflow-x: auto;
}
.dina-md table {
  border-collapse: collapse;
  font-size: 0.86rem;
}
.dina-md th,
.dina-md td {
  padding: 6px 10px;
  border: 1px solid var(--paper-line);
  text-align: start;
  vertical-align: top;
}
.dina-md th {
  background: var(--paper-2);
  font-weight: 700;
}

@media (max-width: 640px) {
  /* The facts move under the name rather than squeeze it to a few letters. */
  .dina-picker-option {
    flex-wrap: wrap;
    row-gap: 4px;
  }
  .dina-picker-text {
    flex-basis: calc(100% - 80px);
  }
  .dina-picker-meta {
    flex-basis: 100%;
    padding-inline-start: 46px;
  }
}

/* ── dropdown menu ─────────────────────────────────────────────────────────── */
.dina-menu-wrap {
  position: relative;
  display: inline-flex;
}
.dina-menu-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-block-size: 36px;
  min-inline-size: 36px;
  padding-inline: 8px;
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--l-mut);
  font: inherit;
  cursor: pointer;
}
.dina-menu-button:hover,
.dina-menu-button[aria-expanded='true'] {
  background: var(--paper-2);
  color: var(--l-fg);
}
.dina-menu-button:focus-visible {
  outline: none;
  box-shadow: var(--ring);
}
/* Placed in a portal by `useFloating`, aligned to the button's inline start or end. */
.dina-menu {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  min-inline-size: 12rem;
  padding: 6px;
  overflow-y: auto;
  border: 1px solid var(--paper-line);
  border-radius: var(--r-md);
  background: var(--paper-1);
  box-shadow: var(--shadow-pop);
}
.dina-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-block-size: 40px;
  padding: 8px 10px;
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--l-fg);
  font: inherit;
  font-size: 0.88rem;
  text-align: start;
  text-decoration: none;
  cursor: pointer;
}
.dina-menu-item:hover,
.dina-menu-item:focus-visible {
  outline: none;
  background: var(--paper-2);
}
.dina-menu-item[aria-disabled='true'] {
  opacity: 0.45;
  cursor: default;
}
.dina-menu-icon {
  display: inline-flex;
  color: var(--l-mut);
}
.dina-menu-danger,
.dina-menu-danger .dina-menu-icon {
  color: var(--err);
}
.dina-menu-sep {
  margin-block-start: 4px;
  border-block-start: 1px solid var(--paper-line);
  border-start-start-radius: 0;
  border-start-end-radius: 0;
}

/* ── stepper ───────────────────────────────────────────────────────────────── */
.dina-stepper {
  padding: 18px;
  border: 1px solid var(--paper-line);
  border-radius: var(--r-md);
  background: var(--paper-1);
}
.dina-stepper-head {
  display: flex;
  align-items: center;
  gap: 10px;
}
.dina-stepper-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
  color: var(--l-fg);
}
.dina-stepper-count {
  margin-inline-end: auto;
  font-size: 0.82rem;
  color: var(--l-mut);
}
.dina-stepper-track {
  block-size: 6px;
  margin-block: 12px 14px;
  border-radius: var(--r-pill);
  background: var(--paper-2);
  overflow: hidden;
}
.dina-stepper-track i {
  display: block;
  block-size: 100%;
  border-radius: var(--r-pill);
  background: var(--acc-grad);
  transition: inline-size var(--t-slow) var(--ease);
}
.dina-stepper-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.dina-step {
  display: flex;
  gap: 12px;
  padding: 10px;
  border-radius: var(--r-sm);
}
.dina-step[data-state='current'] {
  background: var(--paper-3);
}
.dina-step-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 26px;
  block-size: 26px;
  border: 1.5px solid var(--paper-line);
  border-radius: 50%;
  color: var(--l-mut);
  font-size: 0.78rem;
  font-weight: 800;
}
.dina-step[data-state='current'] .dina-step-mark {
  border-color: var(--acc-1);
  color: var(--acc-1);
}
.dina-step[data-done] .dina-step-mark {
  border-color: var(--ok);
  background: var(--ok-bg);
  color: var(--ok);
}
.dina-step[data-state='skipped'] .dina-step-mark {
  border-style: dashed;
}
.dina-step-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1 1 auto;
  min-inline-size: 0;
}
/* A title the reader can click to open that step (`onSelect`): the row's own text, no button chrome. */
.dina-step-select {
  min-block-size: 26px;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  text-align: start;
  cursor: pointer;
}
.dina-step-select:hover {
  color: var(--acc-1);
}
.dina-step-select:focus-visible {
  outline: 2px solid var(--acc-1);
  outline-offset: 3px;
  border-radius: var(--r-xs);
}
.dina-step-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--l-fg);
}
.dina-step[data-state='done'] .dina-step-title,
.dina-step[data-state='skipped'] .dina-step-title {
  color: var(--l-mut);
}
.dina-step-done {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--ok);
}
.dina-step-skipped {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--l-mut);
}
.dina-step-hint {
  font-size: 0.84rem;
  line-height: 1.8;
  color: var(--l-mut);
}

/* ── jalali date range ─────────────────────────────────────────────────────── */
.dina-daterange {
  position: relative;
  display: inline-flex;
}
.dina-daterange-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-block-size: 40px;
  padding-inline: 12px;
  border: 1px solid var(--paper-line);
  border-radius: var(--r-sm);
  background: var(--paper-1);
  color: var(--l-fg);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
}
.dina-daterange-button:hover {
  background: var(--paper-2);
}
.dina-daterange-button:focus-visible {
  outline: none;
  box-shadow: var(--ring);
  border-color: var(--violet);
}
.dina-daterange-pop {
  position: absolute;
  inset-block-start: calc(100% + 6px);
  inset-inline-start: 0;
  z-index: 40;
  display: flex;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--paper-line);
  border-radius: var(--r-md);
  background: var(--paper-1);
  box-shadow: var(--shadow-pop);
}
.dina-daterange-presets {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-inline-size: 8.5rem;
  padding-inline-end: 8px;
  border-inline-end: 1px solid var(--paper-line);
}
.dina-daterange-preset {
  min-block-size: 38px;
  padding-inline: 10px;
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--l-fg);
  font: inherit;
  font-size: 0.86rem;
  text-align: start;
  cursor: pointer;
}
.dina-daterange-preset:hover {
  background: var(--paper-2);
}
.dina-daterange-preset[aria-pressed='true'] {
  background: var(--sel-bg);
  font-weight: 700;
}
.dina-daterange-cal {
  inline-size: 17rem;
}
.dina-daterange-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-block-end: 6px;
}
.dina-daterange-nav button {
  display: inline-flex;
  padding: 8px;
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--l-mut);
  cursor: pointer;
}
.dina-daterange-nav button:hover {
  background: var(--paper-2);
  color: var(--l-fg);
}
.dina-daterange-month {
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--l-fg);
}
.dina-daterange-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}
.dina-daterange-wd {
  padding-block: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--l-faint);
  text-align: center;
}
.dina-daterange-day {
  block-size: 36px;
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--l-fg);
  font: inherit;
  font-size: 0.84rem;
  cursor: pointer;
}
.dina-daterange-day:hover:not(:disabled) {
  background: var(--paper-2);
}
.dina-daterange-day:disabled {
  color: var(--l-faint);
  opacity: 0.45;
  cursor: default;
}
.dina-daterange-day[data-range] {
  background: var(--sel-bg);
}
.dina-daterange-day[data-edge] {
  background: var(--acc-1);
  color: var(--ink-on-grad);
  font-weight: 800;
}
.dina-daterange-day[data-today]:not([data-edge]) {
  box-shadow: inset 0 0 0 1.5px var(--acc-1);
}
.dina-daterange-day:focus-visible {
  outline: 2px solid var(--acc-1);
  outline-offset: 1px;
}
.dina-daterange-help {
  margin: 8px 0 0;
  font-size: 0.76rem;
  color: var(--l-mut);
}
@media (max-width: 560px) {
  .dina-daterange-pop {
    position: fixed;
    inset-inline: 12px;
    inset-block-start: auto;
    inset-block-end: 12px;
    flex-direction: column;
  }
  .dina-daterange-presets {
    flex-direction: row;
    flex-wrap: wrap;
    padding-inline-end: 0;
    padding-block-end: 8px;
    border-inline-end: 0;
    border-block-end: 1px solid var(--paper-line);
  }
  .dina-daterange-cal {
    inline-size: 100%;
  }
}

/* ── stacked bar chart ─────────────────────────────────────────────────────── */
.dina-stack-defs {
  position: absolute;
  inline-size: 0;
  block-size: 0;
  overflow: hidden;
}
.dina-stack-bars {
  display: flex;
  align-items: flex-end;
  gap: 4px;
}
.dina-stack-slot {
  position: relative;
  display: flex;
  flex: 1;
  align-items: flex-end;
  block-size: 100%;
  min-inline-size: 0;
}
.dina-stack-slot:focus-visible {
  outline: 2px solid var(--acc-1);
  outline-offset: 2px;
  border-radius: var(--r-xs);
}
.dina-stack-col {
  display: flex;
  flex-direction: column-reverse;
  inline-size: 100%;
  overflow: hidden;
  /* The categorical patterns paint in currentColor: a darker version of each tone. */
  color: var(--l-fg);
  border-start-start-radius: 3px;
  border-start-end-radius: 3px;
  transition: opacity var(--t-fast), height var(--t-slow) var(--ease);
}
.dina-stack-part {
  display: block;
  inline-size: 100%;
  flex: 0 0 auto;
}
.dina-stack-tip {
  position: absolute;
  bottom: 100%;
  inset-inline-start: 50%;
  transform: translateX(50%);
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-block-end: 8px;
  min-inline-size: 9rem;
  padding: 8px 10px;
  border-radius: var(--r-sm);
  background: var(--ink-1);
  color: var(--d-fg);
  pointer-events: none;
  box-shadow: var(--shadow-pop);
}
[dir='ltr'] .dina-stack-tip {
  transform: translateX(-50%);
}
.dina-stack-tip-head {
  font-size: 0.7rem;
  font-style: normal;
  color: var(--d-mut);
}
.dina-stack-tip-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.74rem;
  white-space: nowrap;
}
.dina-stack-tip-row b {
  margin-inline-start: auto;
  font-weight: 800;
}
.dina-stack-tip-total {
  margin-block-start: 2px;
  padding-block-start: 4px;
  border-block-start: 1px solid color-mix(in oklch, var(--d-fg) 18%, transparent);
}
.dina-stack-swatch {
  flex: 0 0 auto;
  color: var(--l-fg);
}
.dina-stack-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}
.dina-stack-legend li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--l-mut);
}
.dina-stack-legend b {
  color: var(--l-fg);
  font-weight: 700;
}

/* ── sparkline ─────────────────────────────────────────────────────────────── */
.dina-spark {
  display: inline-block;
  vertical-align: middle;
  overflow: visible;
}
/* Oldest first, time read from the right in an RTL page: mirror the drawing, as BarChart's
   flex columns already run. */
[dir='rtl'] .dina-spark {
  transform: scaleX(-1);
}
[dir='rtl'] [dir='ltr'] .dina-spark {
  transform: none;
}

/* ── choice cards ──────────────────────────────────────────────────────────── */
.dina-choices {
  margin: 0;
  padding: 0;
  border: 0;
  min-inline-size: 0;
}
.dina-choices-legend {
  padding: 0;
  margin-block-end: 10px;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--l-fg);
}
.dina-choices-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, var(--choice-min, 13rem)), 1fr));
  gap: 10px;
}
.dina-choice {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-block-size: 64px;
  padding: 14px 16px;
  border: 1px solid var(--paper-line);
  border-radius: var(--r-md);
  background: var(--paper-1);
  cursor: pointer;
  transition:
    border-color var(--t-fast) var(--ease),
    box-shadow var(--t-fast) var(--ease),
    background var(--t-fast) var(--ease);
}
.dina-choice:hover {
  border-color: color-mix(in oklch, var(--acc-1) 35%, var(--paper-line));
}
.dina-choice[data-checked] {
  border-color: var(--acc-1);
  background: color-mix(in oklch, var(--acc-1) 5%, var(--paper-1));
  box-shadow: var(--ring);
}
.dina-choice[data-disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}
/* The native radio stays in the tree for the keyboard and the form; the card draws it. */
.dina-choice-input {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  cursor: inherit;
}
.dina-choice:has(.dina-choice-input:focus-visible) {
  outline: 2px solid var(--acc-1);
  outline-offset: 2px;
}
.dina-choice-mark {
  flex: none;
  inline-size: 18px;
  block-size: 18px;
  border-radius: 50%;
  border: 2px solid var(--paper-line);
  background: var(--paper-1);
  transition: border-color var(--t-fast) var(--ease), border-width var(--t-fast) var(--ease);
}
.dina-choice[data-checked] .dina-choice-mark {
  border-color: var(--acc-1);
  border-width: 6px;
}
.dina-choice-media {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  inline-size: 36px;
  block-size: 36px;
  border-radius: var(--r-sm);
  overflow: hidden;
}
.dina-choice-media img {
  max-inline-size: 100%;
  max-block-size: 100%;
  object-fit: contain;
}
.dina-choice-body {
  flex: 1;
  min-inline-size: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.dina-choice-title {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-weight: 800;
  color: var(--l-fg);
}
.dina-choice-badge {
  padding: 1px 8px;
  border-radius: var(--r-pill);
  background: var(--paper-2);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--l-mut);
}
.dina-choice-sub {
  font-size: 0.8rem;
  color: var(--l-mut);
}
/* No tabular figures, for the tile's reason below (v0.19.3): a plan's price at the row's end read
   «۵۹۰ , ۰۰۰ تومان» in دینا چت's purchase dialog. Each card is its own row, so nothing lines up. */
.dina-choice-aside {
  flex: none;
  font-weight: 800;
  color: var(--l-fg);
}
/* `variant="tile"`: one short value, centred; the check in the corner carries the state with the border. */
.dina-choices-tile .dina-choices-grid {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, var(--choice-min, 7.5rem)), 1fr));
  gap: 8px;
}
.dina-choices-tile .dina-choice {
  justify-content: center;
  min-block-size: 48px;
  padding: 10px 12px;
  text-align: center;
}
.dina-choices-tile .dina-choice-body {
  align-items: center;
}
/* No tabular figures here: Estedad draws its Persian tabular digits at Latin width, and an amount in
   a tile read «۲ ۰ ۰ , ۰ ۰ ۰» (v0.15.0). The tiles sit side by side, not in a column to align. */
.dina-choices-tile .dina-choice-title {
  justify-content: center;
  font-weight: 700;
  white-space: nowrap;
}
.dina-choice-tick {
  position: absolute;
  inset-block-start: -7px;
  inset-inline-end: -7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  inline-size: 20px;
  block-size: 20px;
  border-radius: 50%;
  background: var(--acc-1);
  color: var(--paper-1);
  box-shadow: 0 0 0 2px var(--paper-1);
}
@media (prefers-reduced-motion: reduce) {
  .dina-choice,
  .dina-choice-mark {
    transition: none;
  }
}

/* ── invoice document ─────────────────────────────────────────────────────────
   The official invoice (patterns/InvoiceDocument.tsx), drawn as the tax authority's «صورتحساب
   الکترونیکی فروش» is printed: one landscape A4 sheet, ruled in near-black like the form, white in
   every theme because it is a document and it is printed (v0.18.0). On screen the sheet keeps the
   page's width (1123px, A4 at 96 dpi) and the component scales it down whole with `zoom`; below half
   size its frame scrolls sideways instead. Printed, it is the page. */
.dina-invoice-fit {
  inline-size: 100%;
  overflow-x: auto;
}
.dina-invoice {
  --inv-line: color-mix(in oklch, var(--l-fg) 72%, var(--paper-1));
  page: dina-invoice;
  box-sizing: border-box;
  inline-size: 1123px;
  min-block-size: 794px;
  padding: 34px 38px;
  color: var(--l-fg);
  background: var(--paper-1);
  border: 1px solid var(--paper-line);
  font-size: 13px;
  line-height: 1.8;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
  /* Read, not copied (owner, 2026-11-04): no selection, and no long-press menu on a phone. The
     component refuses the context menu, copy and drag. Printing is untouched. */
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
.dina-invoice-top {
  margin-block-end: 18px;
}
.dina-invoice-title {
  margin: 0;
  text-align: center;
  font-size: 22px;
  font-weight: 800;
}
/* A party: its name down the side, its details, and a box beside them, as the printed form has it. */
.dina-invoice-block {
  display: grid;
  grid-template-columns: 38px 1fr 300px;
  gap: 8px;
  margin-block-end: 8px;
}
.dina-invoice-side {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid var(--inv-line);
  background: var(--paper-3);
  font-weight: 700;
  writing-mode: vertical-rl;
  /* Physical, on purpose: the side label reads bottom to top in RTL and LTR alike, as on the form. */
  transform: rotate(180deg);
}
/* A party's details in fixed lines (names, numbers, address, contact), so every invoice has one shape. */
.dina-invoice-party {
  margin: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  padding: 10px 14px;
  border: 1.5px solid var(--inv-line);
}
.dina-invoice-fields {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 2px 26px;
}
.dina-invoice-item {
  display: flex;
  gap: 6px;
}
.dina-invoice-item dt {
  font-weight: 700;
  white-space: nowrap;
}
.dina-invoice-item dd {
  margin: 0;
}
.dina-invoice-missing {
  color: var(--l-mut);
}
.dina-invoice-box,
.dina-invoice-when {
  margin: 0;
  display: grid;
  align-content: center;
  gap: 2px;
}
.dina-invoice-box {
  padding: 8px 14px;
  border: 1.5px solid var(--inv-line);
}
.dina-invoice-box > div,
.dina-invoice-when > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.dina-invoice-box dt,
.dina-invoice-when dt {
  font-weight: 700;
  white-space: nowrap;
}
.dina-invoice-box dd,
.dina-invoice-when dd {
  margin: 0;
}
/* No tabular figures: Estedad draws its Persian tabular digits at Latin width, and a rial amount read
   «۵ , ۵۱۱ , ۷۱۹» (the same trap ChoiceCards hit in v0.15.0). */
.dina-invoice-table {
  inline-size: 100%;
  border-collapse: collapse;
  border: 1.5px solid var(--inv-line);
}
.dina-invoice-table th,
.dina-invoice-table td {
  border: 1px solid var(--inv-line);
  padding: 7px 8px;
  text-align: center;
  vertical-align: middle;
}
.dina-invoice-table thead th {
  background: var(--paper-3);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.6;
}
.dina-invoice-table .dina-invoice-desc {
  text-align: start;
  min-inline-size: 220px;
}
.dina-invoice-sum td,
.dina-invoice-line td {
  font-weight: 700;
}
.dina-invoice-line td:first-child {
  text-align: start;
  background: var(--paper-3);
}
.dina-invoice-foot {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
  border: 1.5px solid var(--inv-line);
  border-block-start: 0;
  padding: 10px 14px;
  min-block-size: 130px;
}
.dina-invoice-label {
  font-weight: 700;
}
.dina-invoice-when {
  align-content: start;
}
/* In the footer a value sits beside its label, not across the column against the next box. */
.dina-invoice-when > div {
  justify-content: flex-start;
  gap: 8px;
}
.dina-invoice-stamp {
  margin-block-start: 8px;
  max-inline-size: 160px;
}
/* Printed: the page is the document. A4 landscape, so the eleven columns fit without shrinking the
   text. A product's print view hides the rest of its page with `.dina-print-hide`. */
@page dina-invoice {
  size: A4 landscape;
  margin: 8mm;
}
/* One sheet. The screen's 794px minimum height is taller than the printable page and would push
   the signatures onto a second one, so on paper the sheet is as tall as its content; the zoom the
   component sets for the screen is undone (an inline style, hence !important). */
@media print {
  .dina-print-hide {
    display: none !important;
  }
  .dina-invoice-fit {
    overflow: visible;
  }
  .dina-invoice {
    zoom: 1 !important;
    inline-size: auto;
    min-block-size: 0;
    border: 0;
    padding: 0;
    font-size: 9pt;
    line-height: 1.55;
  }
  .dina-invoice-top {
    margin-block-end: 3mm;
  }
  .dina-invoice-title {
    font-size: 15pt;
  }
  .dina-invoice-block {
    grid-template-columns: 9mm 1fr 72mm;
    gap: 2mm;
    margin-block-end: 2mm;
  }
  .dina-invoice-party,
  .dina-invoice-box {
    padding: 2mm 3mm;
  }
  .dina-invoice-table th,
  .dina-invoice-table td {
    padding: 3px 5px;
  }
  .dina-invoice-table thead th {
    font-size: 8pt;
  }
  .dina-invoice-foot {
    min-block-size: 26mm;
    break-inside: avoid;
  }
}

/* ══ v0.19.0 — for دینا چت's panel ═════════════════════════════════════════════════════════ */

/* ── Checkbox ── a native input under a drawn box; the label is the 44px target. */
.dina-checkbox {
  position: relative;
  display: inline-flex;
  align-items: flex-start;
  gap: 10px;
  min-height: 44px;
  padding-block: 11px;
  cursor: pointer;
  color: var(--l-fg);
}
.dina-checkbox-input {
  position: absolute;
  inset-inline-start: 0;
  inset-block-start: 11px;
  width: 20px;
  height: 20px;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}
.dina-checkbox-box {
  position: relative;
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  border: 1.5px solid var(--paper-line);
  border-radius: var(--r-xs);
  background: var(--paper-1);
  transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}
.dina-checkbox-input:checked + .dina-checkbox-box,
.dina-checkbox-input[aria-checked='mixed'] + .dina-checkbox-box {
  border-color: var(--acc-1);
  background: var(--acc-1);
}
/* The tick and the dash are drawn with borders, in the paper's tone over the accent. */
.dina-checkbox-input:checked + .dina-checkbox-box::after {
  content: '';
  position: absolute;
  inset-inline-start: 6px;
  inset-block-start: 2px;
  width: 5px;
  height: 10px;
  border: solid var(--paper-1);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.dina-checkbox-input[aria-checked='mixed'] + .dina-checkbox-box::after {
  content: '';
  position: absolute;
  inset-inline: 4px;
  inset-block-start: 8px;
  height: 2px;
  background: var(--paper-1);
  transform: none;
  border: 0;
}
.dina-checkbox-input:focus-visible + .dina-checkbox-box {
  box-shadow: var(--ring);
  border-color: var(--violet);
}
.dina-checkbox-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  line-height: 1.5;
}
.dina-checkbox-label {
  font-size: 0.92rem;
  font-weight: 600;
}
.dina-checkbox-hint {
  font-size: 0.8rem;
  color: var(--l-mut);
}
.dina-checkbox-disabled {
  cursor: not-allowed;
  opacity: 0.55;
}
.dina-dense .dina-checkbox {
  min-height: 32px;
  padding-block: 6px;
}
.dina-dense .dina-checkbox-input {
  inset-block-start: 6px;
}

/* ── Callout ── the tone twice: its colour and its icon. */
.dina-callout {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--paper-line);
  border-radius: var(--r-md);
  background: var(--paper-1);
  color: var(--l-fg);
}
.dina-callout-icon {
  display: inline-flex;
  flex: 0 0 auto;
  margin-block-start: 1px;
}
.dina-callout-body {
  flex: 1;
  min-width: 0;
}
.dina-callout-title {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 800;
}
.dina-callout-text {
  font-size: 0.86rem;
  line-height: 1.7;
  color: var(--l-mut);
}
.dina-callout-title + .dina-callout-text {
  margin-block-start: 2px;
}
.dina-callout-action {
  flex: 0 0 auto;
  align-self: center;
}
.dina-callout-info {
  background: var(--info-bg);
  border-color: color-mix(in oklch, var(--info) 35%, transparent);
}
.dina-callout-info .dina-callout-icon {
  color: var(--info);
}
.dina-callout-ok {
  background: var(--ok-bg);
  border-color: color-mix(in oklch, var(--ok) 35%, transparent);
}
.dina-callout-ok .dina-callout-icon {
  color: var(--ok);
}
.dina-callout-warn {
  background: var(--warn-bg);
  border-color: var(--warn-bd);
}
.dina-callout-warn .dina-callout-icon {
  color: var(--warn-deep);
}
.dina-callout-err {
  background: var(--err-bg);
  border-color: var(--err-bd);
}
.dina-callout-err .dina-callout-icon {
  color: var(--err);
}
@media (max-width: 640px) {
  .dina-callout {
    flex-wrap: wrap;
  }
  .dina-callout-action {
    flex-basis: 100%;
    padding-inline-start: 28px;
  }
}

/* ── Kbd ── a key: an LTR island in the mono face. */
.dina-kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border: 1px solid var(--paper-line);
  border-block-end-width: 2px;
  border-radius: var(--r-xs);
  background: var(--paper-1);
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
  color: var(--l-fg);
}
.dina-kbd-chord {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}
.dina-kbd-plus {
  margin-inline: 2px;
  font-size: 0.72rem;
  color: var(--l-faint);
}

/* ── PresenceDot ── shape and colour: a disc, a half disc, a ring. */
.dina-presencedot {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.dina-presencedot-mark {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid var(--l-faint);
  background: transparent;
}
.dina-presencedot-online {
  border-color: var(--ok);
  background: var(--ok);
}
.dina-presencedot-away {
  border-color: var(--warn);
  background: linear-gradient(90deg, var(--warn) 50%, transparent 50%);
}
.dina-presencedot-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--l-mut);
}
.dina-presencedot-overlay {
  position: absolute;
  inset-inline-end: -1px;
  inset-block-end: -1px;
}
.dina-presencedot-overlay .dina-presencedot-mark {
  box-shadow: 0 0 0 2px var(--paper-1);
}

/* ── TagInput ── tokens in the page's direction, each text in its own. */
.dina-taginput {
  position: relative;
}
.dina-taginput-box {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-height: 46px;
  padding: 6px 8px;
  border: 1px solid var(--paper-line);
  border-radius: var(--r-sm);
  background: var(--paper-3);
  cursor: text;
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.dina-taginput-box:focus-within {
  background: var(--paper-1);
  border-color: var(--violet);
  box-shadow: var(--ring);
}
.dina-taginput-tag {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  max-width: 100%;
  padding-block: 3px;
  padding-inline: 10px 4px;
  border-radius: var(--r-pill);
  background: var(--paper-2);
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--l-fg);
}
.dina-taginput-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--l-mut);
  cursor: pointer;
}
.dina-taginput-remove:hover,
.dina-taginput-remove:focus-visible {
  background: var(--paper-line);
  color: var(--l-fg);
}
.dina-taginput-input {
  flex: 1;
  min-width: 8ch;
  min-height: 32px;
  border: 0;
  outline: none;
  background: transparent;
  font-size: 1rem;
  color: var(--l-fg);
}
.dina-taginput-input:placeholder-shown {
  direction: inherit;
}
.dina-taginput-list {
  position: absolute;
  z-index: 30;
  inset-inline: 0;
  inset-block-start: calc(100% + 4px);
  margin: 0;
  padding: 4px;
  list-style: none;
  max-height: 240px;
  overflow-y: auto;
  border: 1px solid var(--paper-line);
  border-radius: var(--r-sm);
  background: var(--paper-1);
  box-shadow: var(--shadow-pop);
}
.dina-taginput-option {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 0 10px;
  border-radius: var(--r-xs);
  font-size: 0.92rem;
  cursor: pointer;
}
.dina-taginput-option-active {
  background: var(--paper-2);
}
.dina-taginput-disabled .dina-taginput-box {
  cursor: not-allowed;
  opacity: 0.6;
}

/* ── SortableList ── a handle per row; the row moves, its own controls keep working. */
.dina-sortable {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.dina-sortable-row {
  display: flex;
  align-items: stretch;
  gap: 4px;
  border: 1px solid var(--paper-line);
  border-radius: var(--r-md);
  background: var(--paper-1);
  transition: box-shadow var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}
.dina-sortable-dragging {
  border-color: var(--violet);
  box-shadow: var(--shadow-pop);
}
.dina-sortable-handle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 36px;
  min-height: 44px;
  border: 0;
  border-start-start-radius: var(--r-md);
  border-end-start-radius: var(--r-md);
  background: none;
  color: var(--l-faint);
  cursor: grab;
  touch-action: none;
}
.dina-sortable-handle:active,
.dina-sortable-handle[aria-pressed='true'] {
  cursor: grabbing;
  color: var(--l-fg);
  background: var(--paper-2);
}
.dina-sortable-handle:focus-visible {
  outline: 2px solid var(--acc-1);
  outline-offset: -2px;
}
.dina-sortable-handle:disabled {
  cursor: default;
  opacity: 0.4;
}
.dina-sortable-body {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
}

/* ── FileDrop ── the zone is a label over a real file input. */
.dina-filedrop-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 112px;
  padding: 18px;
  border: 1.5px dashed var(--paper-line);
  border-radius: var(--r-md);
  background: var(--paper-1);
  text-align: center;
  color: var(--l-mut);
  cursor: pointer;
  transition: border-color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.dina-filedrop-zone:hover,
.dina-filedrop-over {
  border-color: var(--violet);
  background: var(--paper-2);
}
.dina-filedrop-zone:focus-within {
  border-color: var(--violet);
  box-shadow: var(--ring);
}
.dina-filedrop-disabled {
  cursor: not-allowed;
  opacity: 0.55;
}
.dina-filedrop-icon {
  display: inline-flex;
  color: var(--l-faint);
}
.dina-filedrop-prompt {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 0.9rem;
  font-weight: 600;
}
.dina-filedrop-limit {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--l-faint);
}
.dina-filedrop-compact .dina-filedrop-zone {
  flex-direction: row;
  min-height: 44px;
  padding: 8px 12px;
}
.dina-filedrop-refused {
  margin: 6px 0 0;
  padding: 0;
  list-style: none;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--err);
}
.dina-filedrop-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}
.dina-filedrop-item {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 40px;
  padding: 6px 10px;
  border: 1px solid var(--paper-line);
  border-radius: var(--r-sm);
  background: var(--paper-1);
  font-size: 0.86rem;
  color: var(--l-fg);
}
.dina-filedrop-item-error {
  border-color: var(--err-bd);
  background: var(--err-bg);
}
.dina-filedrop-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
}
.dina-filedrop-size {
  font-size: 0.78rem;
  color: var(--l-faint);
}
/* The bar and the error take the row's second line, after the ✕: `order` moves them past it, so the
   name, size and ✕ stay on one line whatever the DOM order. */
.dina-filedrop-bar {
  order: 1;
  flex-basis: 100%;
  height: 4px;
  overflow: hidden;
  border-radius: var(--r-pill);
  background: var(--paper-track);
}
.dina-filedrop-bar i {
  display: block;
  height: 100%;
  background: var(--acc-grad);
  transition: width var(--t-slow) var(--ease);
}
.dina-filedrop-error {
  order: 1;
  flex-basis: 100%;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--err);
}
.dina-filedrop-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--l-mut);
  cursor: pointer;
}
.dina-filedrop-remove:hover,
.dina-filedrop-remove:focus-visible {
  background: var(--paper-2);
  color: var(--l-fg);
}

/* ── LineChart ── SVG stretched to the box, mirrored in RTL like the sparkline; hit columns on top. */
.dina-linechart {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.dina-linechart-plot {
  position: relative;
}
.dina-linechart-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}
[dir='rtl'] .dina-linechart-svg {
  transform: scaleX(-1);
}
[dir='rtl'] [dir='ltr'] .dina-linechart-svg {
  transform: none;
}
.dina-linechart-grid {
  stroke: var(--paper-line-soft);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}
.dina-linechart-guide {
  stroke: var(--l-faint);
  stroke-width: 1;
  stroke-dasharray: 3 3;
  vector-effect: non-scaling-stroke;
}
.dina-linechart-cols {
  position: absolute;
  inset: 0;
  display: flex;
}
.dina-linechart-col {
  position: relative;
  flex: 1;
  height: 100%;
}
.dina-linechart-col:focus-visible {
  outline: 2px solid var(--acc-1);
  outline-offset: -2px;
  border-radius: var(--r-xs);
}
.dina-linechart-tip {
  position: absolute;
  inset-block-start: 4px;
  inset-inline-start: 50%;
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px 10px;
  border-radius: var(--r-sm);
  background: var(--ink-1);
  white-space: nowrap;
  transform: translateX(50%);
  pointer-events: none;
}
[dir='ltr'] .dina-linechart-tip {
  transform: translateX(-50%);
}
.dina-linechart-tip i {
  font-size: 0.66rem;
  font-style: normal;
  color: var(--d-mut);
}
.dina-linechart-tip b {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--d-fg);
}
.dina-linechart-swatch {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 2px;
}
.dina-linechart-max {
  position: absolute;
  inset-block-start: -2px;
  inset-inline-start: 0;
  font-size: 0.66rem;
  font-weight: 600;
  color: var(--l-faint);
  pointer-events: none;
}
.dina-linechart-axis {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  color: var(--l-faint);
}
.dina-linechart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.8rem;
  color: var(--l-mut);
}
.dina-linechart-legend li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* ── Heatmap ── a real table; the shade is one tone mixed into the paper. */
.dina-heatmap {
  overflow-x: auto;
}
.dina-heatmap-table {
  border-collapse: separate;
  border-spacing: 2px;
  font-size: 0.7rem;
}
.dina-heatmap-col,
.dina-heatmap-row {
  padding: 2px 4px;
  font-weight: 600;
  color: var(--l-faint);
  white-space: nowrap;
}
.dina-heatmap-row {
  text-align: start;
}
.dina-heatmap-cell {
  min-width: 22px;
  height: 22px;
  border-radius: 3px;
  text-align: center;
  font-weight: 700;
  color: var(--l-fg);
}
/* Ink on a strong accent is the near-black on-gradient ink, never white (DESIGN.md). */
.dina-heatmap-cell-strong {
  color: var(--ink-on-grad);
}
.dina-heatmap-scale {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-block-start: 8px;
  font-size: 0.72rem;
  color: var(--l-faint);
}
.dina-heatmap-scale i {
  display: block;
  width: 96px;
  height: 8px;
  border-radius: var(--r-pill);
  background: linear-gradient(to right, var(--hm-low), var(--hm-high));
}
[dir='rtl'] .dina-heatmap-scale i {
  background: linear-gradient(to left, var(--hm-low), var(--hm-high));
}

/* ── UpgradeDialog ── */
.dina-upgrade {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.dina-upgrade-feature {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--l-fg);
}
.dina-upgrade-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.dina-upgrade-list li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--l-fg);
}
.dina-upgrade-list svg {
  flex: 0 0 auto;
  margin-block-start: 3px;
  color: var(--ok);
}
.dina-upgrade-price {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
  color: var(--l-fg);
}
.dina-upgrade-note {
  margin: 0;
  font-size: 0.8rem;
  color: var(--l-mut);
}

/* ── colour picker ─────────────────────────────────────────────────────────── */
.dina-colorpicker {
  position: relative;
  display: inline-block;
}
.dina-colorpicker-trigger {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-block-size: 46px;
  padding: 6px 12px;
  border: 1px solid var(--paper-line);
  border-radius: var(--r-sm);
  background: var(--paper-3);
  color: var(--l-fg);
  font: inherit;
  cursor: pointer;
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.dina-colorpicker-trigger:hover:not(:disabled) {
  background: var(--paper-1);
}
.dina-colorpicker-trigger:focus-visible,
.dina-colorpicker-trigger[aria-expanded='true'] {
  background: var(--paper-1);
  border-color: var(--violet);
  box-shadow: var(--ring);
  outline: none;
}
.dina-colorpicker-trigger:disabled {
  background: var(--paper-2);
  cursor: default;
  opacity: 0.6;
}
.dina-colorpicker-chip {
  inline-size: 28px;
  block-size: 28px;
  flex: none;
  border-radius: var(--r-xs);
  /* A hairline in the ink so a white or near-white colour is still a visible square. */
  box-shadow: inset 0 0 0 1px rgba(20, 16, 40, 0.18);
}
.dina-colorpicker-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.9rem;
  letter-spacing: 0.02em;
}
.dina-colorpicker-caret {
  color: var(--l-faint);
}

/* Placed in a portal by `useFloating` (fixed, measured from the button), so no inset here. */
.dina-colorpicker-pop {
  box-sizing: border-box;
  inline-size: 288px;
  max-inline-size: calc(100vw - 16px);
  display: grid;
  gap: 14px;
  padding: 14px;
  overflow-y: auto;
  border: 1px solid var(--paper-line);
  border-radius: var(--r-md);
  background: var(--paper-1);
  box-shadow: var(--shadow-pop);
}
/* The colour plane: hue as the base, white fading in from the start edge, black rising from the
   bottom. Physical gradients and coordinates on purpose; the element is dir="ltr". */
.dina-colorpicker-plane {
  position: relative;
  block-size: 168px;
  border-radius: var(--r-sm);
  background-color: hsl(var(--h, 0) 100% 50%);
  background-image: linear-gradient(to top, rgb(0 0 0), rgb(0 0 0 / 0)), linear-gradient(to right, rgb(255 255 255), rgb(255 255 255 / 0));
  touch-action: none;
  cursor: crosshair;
  outline: none;
}
.dina-colorpicker-plane:focus-visible {
  box-shadow: var(--ring), 0 0 0 2px var(--violet);
}
.dina-colorpicker-thumb {
  position: absolute;
  inline-size: 20px;
  block-size: 20px;
  border: 3px solid rgb(255 255 255);
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgb(0 0 0 / 0.35), 0 2px 6px rgb(0 0 0 / 0.35);
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.dina-colorpicker-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.dina-colorpicker-now {
  inline-size: 36px;
  block-size: 36px;
  flex: none;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(20, 16, 40, 0.18);
}
.dina-colorpicker-hue {
  flex: 1;
  min-inline-size: 0;
  block-size: 44px;
  margin: 0;
  background: transparent;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}
.dina-colorpicker-hue::-webkit-slider-runnable-track {
  block-size: 14px;
  border-radius: var(--r-pill);
  background: linear-gradient(to right, hsl(0 100% 50%), hsl(60 100% 50%), hsl(120 100% 50%), hsl(180 100% 50%), hsl(240 100% 50%), hsl(300 100% 50%), hsl(360 100% 50%));
}
.dina-colorpicker-hue::-moz-range-track {
  block-size: 14px;
  border-radius: var(--r-pill);
  background: linear-gradient(to right, hsl(0 100% 50%), hsl(60 100% 50%), hsl(120 100% 50%), hsl(180 100% 50%), hsl(240 100% 50%), hsl(300 100% 50%), hsl(360 100% 50%));
}
.dina-colorpicker-hue::-webkit-slider-thumb {
  -webkit-appearance: none;
  inline-size: 22px;
  block-size: 22px;
  margin-block-start: -4px;
  border: 3px solid rgb(255 255 255);
  border-radius: 50%;
  background: transparent;
  box-shadow: 0 0 0 1px rgb(0 0 0 / 0.35), 0 2px 6px rgb(0 0 0 / 0.35);
}
.dina-colorpicker-hue::-moz-range-thumb {
  inline-size: 16px;
  block-size: 16px;
  border: 3px solid rgb(255 255 255);
  border-radius: 50%;
  background: transparent;
  box-shadow: 0 0 0 1px rgb(0 0 0 / 0.35), 0 2px 6px rgb(0 0 0 / 0.35);
}
.dina-colorpicker-hue:focus-visible {
  outline: none;
}
.dina-colorpicker-hue:focus-visible::-webkit-slider-thumb {
  box-shadow: 0 0 0 1px rgb(0 0 0 / 0.35), 0 0 0 5px rgba(139, 92, 246, 0.35);
}
.dina-colorpicker-hue:focus-visible::-moz-range-thumb {
  box-shadow: 0 0 0 1px rgb(0 0 0 / 0.35), 0 0 0 5px rgba(139, 92, 246, 0.35);
}
.dina-colorpicker-drop {
  display: inline-grid;
  place-items: center;
  inline-size: 44px;
  block-size: 44px;
  flex: none;
  border: 1px solid var(--paper-line);
  border-radius: var(--r-sm);
  background: var(--paper-3);
  color: var(--l-fg);
  cursor: pointer;
}
.dina-colorpicker-drop:hover {
  background: var(--paper-2);
}
.dina-colorpicker-drop:focus-visible {
  outline: none;
  border-color: var(--violet);
  box-shadow: var(--ring);
}
.dina-colorpicker-hex {
  display: grid;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--l-mut);
}
.dina-colorpicker-hexfield {
  display: flex;
  align-items: center;
  gap: 4px;
  min-block-size: 46px;
  padding-inline: 12px;
  border: 1px solid var(--paper-line);
  border-radius: var(--r-sm);
  background: var(--paper-3);
  color: var(--l-fg);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  direction: ltr;
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.dina-colorpicker-hexfield:focus-within {
  background: var(--paper-1);
  border-color: var(--violet);
  box-shadow: var(--ring);
}
.dina-colorpicker-hexfield[data-invalid] {
  border-color: var(--err);
}
.dina-colorpicker-hexfield input {
  flex: 1;
  min-inline-size: 0;
  border: 0;
  outline: none;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 1rem;
  text-transform: uppercase;
}
.dina-colorpicker-presets {
  display: grid;
  gap: 4px;
}
.dina-colorpicker-presets-label {
  font-size: 0.85rem;
  color: var(--l-mut);
}
.dina-colorpicker-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  margin-inline: -4px;
}
/* 44px target around a 28px dot. */
.dina-colorpicker-preset {
  display: grid;
  place-items: center;
  block-size: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}
.dina-colorpicker-preset span {
  inline-size: 28px;
  block-size: 28px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(20, 16, 40, 0.18);
  transition: transform var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.dina-colorpicker-preset:hover span {
  transform: scale(1.08);
}
.dina-colorpicker-preset[aria-pressed='true'] span {
  box-shadow: inset 0 0 0 1px rgba(20, 16, 40, 0.18), 0 0 0 2px var(--paper-1), 0 0 0 4px var(--violet);
}
.dina-colorpicker-preset:focus-visible {
  outline: none;
}
.dina-colorpicker-preset:focus-visible span {
  box-shadow: inset 0 0 0 1px rgba(20, 16, 40, 0.18), 0 0 0 2px var(--paper-1), 0 0 0 4px var(--violet);
}
/* A phone gets a sheet along the bottom edge, not a popover the thumb cannot reach. */
@media (max-width: 639px) {
  .dina-colorpicker-pop {
    inset: auto 8px 8px 8px !important;
    inline-size: auto;
    max-inline-size: none;
    max-block-size: calc(100dvh - 24px) !important;
  }
}
@media (prefers-reduced-motion: reduce) {
  .dina-colorpicker-preset span {
    transition: none;
  }
}

/* ── ThemeSwitch (v0.21.0) ────────────────────────────────────────────────────
   Three pressed-or-not buttons in a pill track, the chosen one raised. Compact (icons only) on a
   sidebar, with words in a sheet or a settings page. */
.dina-theme-switch {
  display: inline-flex;
  gap: 2px;
  padding: 2px;
  border-radius: var(--r-pill);
  background: var(--paper-2);
}
.dina-theme-switch button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-block-size: 30px;
  min-inline-size: 30px;
  padding: 0 10px;
  border: 0;
  border-radius: var(--r-pill);
  background: none;
  color: var(--l-mut);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition:
    background var(--t-fast) var(--ease),
    color var(--t-fast) var(--ease);
}
.dina-theme-switch button:hover {
  color: var(--l-fg);
}
.dina-theme-switch button[aria-pressed='true'] {
  background: var(--paper-1);
  color: var(--l-fg);
  box-shadow: 0 1px 2px rgba(20, 20, 40, 0.12);
}
.dina-theme-switch button:focus-visible {
  outline: 2px solid var(--violet);
  outline-offset: 1px;
}
.dina-theme-switch-dark {
  background: var(--ink-fill);
}
.dina-theme-switch-dark button {
  padding: 0 7px;
  color: var(--d-mut);
}
.dina-theme-switch-dark button:hover {
  color: var(--d-fg);
}
.dina-theme-switch-dark button[aria-pressed='true'] {
  background: var(--ink-3);
  color: var(--d-fg);
  box-shadow: none;
}
/* `large` (v0.21.1): 44px buttons, the touch target, where a finger chooses (a settings page, a
   phone sheet). After the dark rules, so a large dark switch keeps its size. */
.dina-theme-switch-lg {
  gap: 3px;
  padding: 3px;
}
.dina-theme-switch-lg button {
  min-block-size: 44px;
  min-inline-size: 44px;
  padding: 0 14px;
  font-size: 13px;
}

/* ── Dark theme: the literals' twins (v0.21.0) ────────────────────────────────
   Everything that reads a token follows `:root[data-theme='dark']` in tokens.css on its own. These
   are the few rules above that wrote a colour out, each given its dark value here. */
:root[data-theme='dark'] .dina-btn:disabled {
  border-color: var(--paper-line);
  color: var(--l-faint);
}
:root[data-theme='dark'] .dina-chip-gold,
:root[data-theme='dark'] .dina-stat-icon-gold {
  color: #f5c451;
  background: #2b2410;
}
:root[data-theme='dark'] .dina-eyebrow {
  background: color-mix(in oklch, var(--acc-1) 16%, var(--paper-1));
  border-color: color-mix(in oklch, var(--acc-1) 32%, var(--paper-1));
  color: color-mix(in oklch, var(--acc-1) 55%, white);
}
/* An ink surface on an ink page (a toast, a tooltip, a chart's tip) keeps its edge with a hairline. */
:root[data-theme='dark'] .dina-toast,
:root[data-theme='dark'] .dina-tip-bubble,
:root[data-theme='dark'] .dina-barchart-tip,
:root[data-theme='dark'] .dina-linechart-tip,
:root[data-theme='dark'] .dina-stack-tip {
  box-shadow:
    0 0 0 1px var(--ink-line-strong),
    var(--shadow-pop);
}

/* ── FadeImage (v0.24.0) ───────────────────────────────────────────────────────
   A picture's box painted with its own colour (inline, from `color`) or a faint wash of the text
   colour, a blurred copy behind it when given, and a fade only for a picture still loading when it
   mounted (data-state="waiting"). The box's defaults are in the `base` layer: a product that
   imports this file unlayered (خیال does) would otherwise override its own Tailwind position and
   size utilities on the box, because unlayered CSS beats every layer. In a product with Tailwind,
   `base` joins Tailwind's own lowest layer. */
@layer base {
  .dina-img {
    display: block;
    position: relative;
    overflow: hidden;
    isolation: isolate;
    background-color: color-mix(in oklch, currentColor 8%, transparent);
  }
  .dina-img-el {
    display: block;
    inline-size: 100%;
    block-size: 100%;
    transition: opacity 0.45s ease-out;
  }
}
.dina-img-blur::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--dina-img-blur) center / cover no-repeat;
  filter: blur(18px);
  transform: scale(1.15);
}
.dina-img[data-state='waiting'] > .dina-img-el {
  opacity: 0;
}
@media (prefers-reduced-motion: reduce) {
  .dina-img-el {
    transition: none;
  }
}

/* ── ScrollRow (v0.25.0) ───────────────────────────────────────────────────────
   A row that scrolls sideways and shows it: the side with more content fades (a mask on the row,
   so it works on paper and ink alike), an arrow sits on that side, and a mouse can drag the row.
   The attributes come from the component: data-start / data-end (more to see that way), data-dir
   (the row's own direction, which turns the fade around) and data-dragging. Box and row defaults
   are in the `base` layer, as FadeImage's are, so a product's utilities on them win where this
   file is imported unlayered (خیال). The knob's colours are custom properties a product may set. */
@layer base {
  .dina-scrollrow {
    position: relative;
    display: flex;
    min-inline-size: 0;
    max-inline-size: 100%;
  }
  .dina-scrollrow-track {
    display: flex;
    flex: 1 1 auto;
    min-inline-size: 0;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
  }
}
.dina-scrollrow {
  --dina-scrollrow-fade: 56px;
  --dina-scrollrow-angle: 90deg;
}
.dina-scrollrow[data-dir='rtl'] {
  --dina-scrollrow-angle: 270deg;
}
.dina-scrollrow-track::-webkit-scrollbar {
  display: none;
}
.dina-scrollrow-track {
  --dina-scrollrow-fs: 0px;
  --dina-scrollrow-fe: 0px;
}
.dina-scrollrow[data-start] > .dina-scrollrow-track {
  --dina-scrollrow-fs: var(--dina-scrollrow-fade);
}
.dina-scrollrow[data-end] > .dina-scrollrow-track {
  --dina-scrollrow-fe: var(--dina-scrollrow-fade);
}
.dina-scrollrow:is([data-start], [data-end]) > .dina-scrollrow-track {
  -webkit-mask-image: linear-gradient(
    var(--dina-scrollrow-angle),
    transparent 0,
    #000 var(--dina-scrollrow-fs),
    #000 calc(100% - var(--dina-scrollrow-fe)),
    transparent 100%
  );
  mask-image: linear-gradient(
    var(--dina-scrollrow-angle),
    transparent 0,
    #000 var(--dina-scrollrow-fs),
    #000 calc(100% - var(--dina-scrollrow-fe)),
    transparent 100%
  );
}
@media (hover: hover) and (pointer: fine) {
  .dina-scrollrow:is([data-start], [data-end]) > .dina-scrollrow-track {
    cursor: grab;
  }
}
.dina-scrollrow[data-dragging] > .dina-scrollrow-track {
  cursor: grabbing;
  scroll-snap-type: none;
  scroll-behavior: auto;
  user-select: none;
}
/* While dragging, the items under the pointer neither light up nor take the press. */
.dina-scrollrow[data-dragging] > .dina-scrollrow-track * {
  pointer-events: none;
}
.dina-scrollrow-arrow {
  position: absolute;
  inset-block-start: 50%;
  z-index: 1;
  display: grid;
  place-items: center;
  inline-size: 44px;
  block-size: 44px;
  margin-block-start: -22px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--dina-scrollrow-ink, var(--l-fg));
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 160ms var(--ease),
    visibility 0s linear 160ms;
}
.dina-scrollrow-prev {
  inset-inline-start: 0;
}
.dina-scrollrow-next {
  inset-inline-end: 0;
}
.dina-scrollrow[data-start] > .dina-scrollrow-prev,
.dina-scrollrow[data-end] > .dina-scrollrow-next {
  opacity: 1;
  visibility: visible;
  transition: opacity 160ms var(--ease);
}
.dina-scrollrow-knob {
  display: grid;
  place-items: center;
  inline-size: 32px;
  block-size: 32px;
  border-radius: 50%;
  background: var(--dina-scrollrow-knob, var(--paper-1));
  border: 1px solid var(--dina-scrollrow-line, var(--paper-line));
  box-shadow: var(--shadow-card);
  transition: transform 160ms var(--ease);
}
.dina-scrollrow-arrow:hover .dina-scrollrow-knob {
  transform: scale(1.08);
}
.dina-scrollrow-arrow:active .dina-scrollrow-knob {
  transform: scale(0.96);
}
.dina-scrollrow-dark {
  --dina-scrollrow-knob: var(--ink-3);
  --dina-scrollrow-line: var(--ink-line-strong);
  --dina-scrollrow-ink: var(--d-fg);
}
@media (prefers-reduced-motion: reduce) {
  .dina-scrollrow-arrow,
  .dina-scrollrow-knob {
    transition: none;
  }
}

/* ── bottom sheet (v0.26.0) ────────────────────────────────────────────────── */
.dina-sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: color-mix(in oklch, var(--ink-0) 45%, transparent);
  backdrop-filter: blur(3px);
  animation: dina-fade 160ms var(--ease);
}
/* On ink the sheet keeps the paper rules and re-points what they read. */
.dina-sheet-on-ink {
  --paper-1: var(--ink-2);
  --paper-2: var(--ink-3);
  --paper-line: var(--ink-line-strong);
  --l-fg: var(--d-fg);
  --l-mut: var(--d-mut);
}
.dina-sheet {
  display: flex;
  flex-direction: column;
  inline-size: 100%;
  max-inline-size: 36rem;
  max-block-size: 85dvh;
  background: var(--paper-1);
  color: var(--l-fg);
  border-start-start-radius: var(--r-lg);
  border-start-end-radius: var(--r-lg);
  box-shadow: var(--shadow-pop);
  animation: dina-sheet-in 240ms var(--ease);
  transition: transform 200ms var(--ease);
}
/* While the handle is held the sheet follows the finger, with no easing in the way. */
.dina-sheet.is-pulled {
  transition: none;
}
.dina-sheet-half {
  block-size: 55dvh;
}
.dina-sheet-tall {
  block-size: 85dvh;
}
/* Up is up in every direction: a physical transform on purpose. */
@keyframes dina-sheet-in {
  from {
    transform: translateY(28px);
    opacity: 0;
  }
}
.dina-sheet-handle {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  inline-size: 100%;
  /* 44px of target for a 4px bar: the bar is the cue, the row is what the thumb takes. */
  min-block-size: 28px;
  padding: 10px 0 6px;
  border: 0;
  background: none;
  cursor: grab;
  touch-action: none;
}
.dina-sheet-handle span {
  inline-size: 40px;
  block-size: 4px;
  border-radius: 999px;
  background: color-mix(in oklch, var(--l-mut) 45%, transparent);
}
.dina-sheet-handle:focus-visible {
  outline: 2px solid var(--acc-1);
  outline-offset: -4px;
  border-radius: var(--r-md);
}
.dina-sheet-head {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 2px 18px 12px;
  border-block-end: 1px solid var(--paper-line);
}
.dina-sheet-title {
  flex: 1;
  min-inline-size: 0;
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
  overflow-wrap: anywhere;
}
.dina-sheet-body {
  flex: 1 1 auto;
  min-block-size: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 16px 18px;
}
.dina-sheet-compact .dina-sheet-body {
  padding-block-start: 4px;
}
/* With no foot, the body itself clears the phone's home bar. */
.dina-sheet-body:last-child {
  padding-block-end: max(16px, env(safe-area-inset-bottom));
}
.dina-sheet-foot {
  flex: 0 0 auto;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 18px max(12px, env(safe-area-inset-bottom));
  border-block-start: 1px solid var(--paper-line);
}
@media (prefers-reduced-motion: reduce) {
  .dina-sheet,
  .dina-sheet-backdrop {
    animation: none;
    transition: none;
  }
}

/* ── split pane (v0.26.0) ──────────────────────────────────────────────────── */
.dina-split {
  display: flex;
  inline-size: 100%;
  block-size: 100%;
  min-block-size: 0;
}
.dina-split-pane {
  min-inline-size: 0;
  min-block-size: 0;
  /* Each pane is its own scroller's parent: the panes never scroll the page. */
  display: flex;
  flex-direction: column;
}
.dina-split-pane[hidden] {
  display: none;
}
.dina-split-start {
  flex: 0 0 var(--dina-split, 40%);
}
.dina-split-end {
  flex: 1 1 0;
}
.dina-split.is-stacked .dina-split-pane {
  flex: 1 1 auto;
  inline-size: 100%;
}
.dina-split-bar {
  flex: 0 0 9px;
  position: relative;
  cursor: col-resize;
  touch-action: none;
  outline: none;
}
/* A 1px line the eye reads, inside a 9px strip the hand can take. */
.dina-split-bar::before {
  content: '';
  position: absolute;
  inset-block: 0;
  inset-inline-start: 4px;
  inline-size: 1px;
  background: var(--dina-split-line, var(--paper-line));
  transition: background 140ms var(--ease), inline-size 140ms var(--ease), inset-inline-start 140ms var(--ease);
}
.dina-split-bar:hover::before,
.dina-split-bar:focus-visible::before,
.dina-split.is-dragging .dina-split-bar::before {
  inset-inline-start: 3px;
  inline-size: 3px;
  background: var(--acc-1);
}
/* While dragging, nothing under the pointer may take it (an iframe would) or select text. */
.dina-split.is-dragging {
  user-select: none;
}
.dina-split.is-dragging .dina-split-pane {
  pointer-events: none;
}
@media (prefers-reduced-motion: reduce) {
  .dina-split-bar::before {
    transition: none;
  }
}

/* ── preview frame (v0.26.0) ───────────────────────────────────────────────── */
.dina-preview {
  display: flex;
  flex-direction: column;
  inline-size: 100%;
  block-size: 100%;
  min-block-size: 0;
  background: var(--paper-0);
  color: var(--l-fg);
}
.dina-preview-on-ink {
  --paper-0: var(--ink-0);
  --paper-1: var(--ink-2);
  --paper-2: var(--ink-3);
  --paper-line: var(--ink-line-strong);
  --l-fg: var(--d-fg);
  --l-mut: var(--d-mut);
}
.dina-preview-bar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  min-block-size: 48px;
  padding: 6px 12px;
  border-block-end: 1px solid var(--paper-line);
  background: var(--paper-1);
}
.dina-preview-devices {
  display: flex;
  gap: 2px;
  padding: 2px;
  border-radius: 999px;
  background: var(--paper-2);
}
.dina-preview-device {
  display: grid;
  place-items: center;
  inline-size: 36px;
  block-size: 32px;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--l-mut);
  cursor: pointer;
  transition: background 140ms var(--ease), color 140ms var(--ease);
}
.dina-preview-device:hover {
  color: var(--l-fg);
}
.dina-preview-device[aria-checked='true'] {
  background: var(--paper-1);
  color: var(--l-fg);
  box-shadow: 0 1px 2px color-mix(in oklch, var(--ink-0) 18%, transparent);
}
.dina-preview-device:focus-visible {
  outline: 2px solid var(--acc-1);
  outline-offset: 2px;
}
/* On a touch screen the three buttons are the full 44px target. */
@media (pointer: coarse) {
  .dina-preview-device {
    inline-size: 44px;
    block-size: 40px;
  }
}
.dina-preview-address {
  flex: 1 1 0;
  min-inline-size: 0;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--paper-2);
  color: var(--l-mut);
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 0.78rem;
  text-align: start;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dina-preview-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-inline-start: auto;
}
.dina-preview-stage {
  flex: 1 1 auto;
  min-block-size: 0;
  display: flex;
  overflow: hidden;
}
/* A device floats in the middle of the stage; a desktop page is the stage. */
.dina-preview-stage.is-sized {
  align-items: flex-start;
  justify-content: center;
  padding: 12px;
  overflow: auto;
}
.dina-preview-screen {
  position: relative;
  flex: 1 1 auto;
  min-inline-size: 0;
  background: #fff;
  overflow: hidden;
}
.dina-preview-phone,
.dina-preview-tablet {
  flex: 0 0 auto;
  transform-origin: top center;
  border: 1px solid var(--paper-line);
  box-shadow: var(--shadow-pop);
}
.dina-preview-phone {
  border-radius: 36px;
}
.dina-preview-tablet {
  border-radius: 22px;
}
.dina-preview-screen > iframe {
  display: block;
  inline-size: 100%;
  block-size: 100%;
  border: 0;
}
.dina-preview-busy {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: color-mix(in oklch, var(--ink-0) 55%, transparent);
  backdrop-filter: blur(2px);
  color: var(--d-fg);
  text-align: center;
  animation: dina-fade 160ms var(--ease);
}
@media (prefers-reduced-motion: reduce) {
  .dina-preview-busy {
    animation: none;
  }
  .dina-preview-device {
    transition: none;
  }
}

/* ── Masonry (v0.27.0) ─────────────────────────────────────────────────────────
   A masonry wall that reads row by row: one grid, items in their own order, each spanning as many
   small rows as its height needs (the component writes `grid-row-end` and the row size once it has
   measured; until then this is a plain grid in the same order). Not CSS `columns`, which fills a
   column top to bottom before the next. Defaults sit in the `base` layer, as ScrollRow's do, so a
   product's own column classes (`md:grid-cols-3`) and gap win where this file is imported unlayered. */
@layer base {
  .dina-masonry {
    display: grid;
    grid-template-columns: repeat(var(--dina-masonry-cols, 2), minmax(0, 1fr));
    gap: var(--dina-masonry-gap, 12px);
    align-items: start;
  }
  .dina-masonry-item {
    min-inline-size: 0;
  }
}

/* ── DropOverlay (v0.28.0) ─────────────────────────────────────────────────────
   Over a whole region that takes dropped files (useFileDrop): the region dimmed and blurred, a
   dashed frame inside its edge, an upload mark, one line and a hint. It never takes the pointer, so
   the drag keeps reaching the region's children. data-on while files are over the region;
   data-refused when what is held cannot go there (the frame and the mark turn to the error colour).
   Colours read custom properties with token fallbacks, so a product sets them anywhere (:root, its
   own layer) without fighting this file's order. */
.dina-dropoverlay {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: flex;
  padding: 10px;
  background: var(--dina-dropoverlay-bg, color-mix(in srgb, var(--paper-0) 80%, transparent));
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  pointer-events: none;
  visibility: hidden;
  opacity: 0;
  /* Out: fade, then hide, so it never catches a click while invisible. */
  transition:
    opacity var(--t-slow) var(--ease),
    visibility 0s linear var(--t-slow);
}
.dina-dropoverlay[data-on] {
  visibility: visible;
  opacity: 1;
  transition:
    opacity var(--t-fast) var(--ease),
    visibility 0s;
}
.dina-dropoverlay-frame {
  --dina-dropoverlay-tone: var(--dina-dropoverlay-line, var(--violet));
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-block-size: 0;
  padding: 24px;
  border: 2px dashed var(--dina-dropoverlay-tone);
  border-radius: var(--r-lg);
  text-align: center;
  color: var(--dina-dropoverlay-fg, var(--l-fg));
  transform: scale(0.985);
  transition:
    transform var(--t-slow) var(--ease),
    border-color var(--t-fast) var(--ease);
}
.dina-dropoverlay[data-on] .dina-dropoverlay-frame {
  transform: none;
}
.dina-dropoverlay[data-refused] .dina-dropoverlay-frame {
  --dina-dropoverlay-tone: var(--dina-dropoverlay-refused, var(--err));
}
.dina-dropoverlay-icon {
  display: grid;
  place-items: center;
  inline-size: 64px;
  block-size: 64px;
  margin-block-end: 4px;
  border-radius: 999px;
  /* Tinted and ringed in the frame's tone: a plain card colour over the dimmed page all but
     vanished in a light theme (v0.28.1). */
  background: color-mix(in srgb, var(--dina-dropoverlay-tone) 12%, var(--dina-dropoverlay-chip, var(--paper-1)));
  color: var(--dina-dropoverlay-tone);
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--dina-dropoverlay-tone) 40%, transparent),
    var(--shadow-pop);
}
/* A slow lift on the mark while a drop is welcome; a vertical transform, so not mirrored in RTL. */
.dina-dropoverlay[data-on]:not([data-refused]) .dina-dropoverlay-icon {
  animation: dina-dropoverlay-lift 0.9s var(--ease) infinite alternate;
}
@keyframes dina-dropoverlay-lift {
  to {
    transform: translateY(-5px);
  }
}
.dina-dropoverlay-title {
  font-size: 18px;
  font-weight: 800;
  line-height: 1.6;
}
.dina-dropoverlay-hint {
  font-size: 13px;
  line-height: 1.8;
  color: var(--dina-dropoverlay-mut, var(--l-mut));
}
@media (prefers-reduced-motion: reduce) {
  .dina-dropoverlay,
  .dina-dropoverlay[data-on],
  .dina-dropoverlay-frame {
    transition: none;
  }
  .dina-dropoverlay-frame {
    transform: none;
  }
  .dina-dropoverlay[data-on]:not([data-refused]) .dina-dropoverlay-icon {
    animation: none;
  }
}
