  /* ======================================================================
     DecoSign design system tokens (Light = Paper, Dark = Night), IBM Plex Sans Arabic only.
     Source of truth: the DecoSign design system artifact (tokens.json). Magenta is spent sparingly:
     the primary button, the page-head rule, the active link, key numbers. Magenta TEXT is --accent-text.
     success / danger are states only. Square-cut by default, 4px for inputs and chips.
     ====================================================================== */
  @font-face { font-family: "IBM Plex Sans Arabic"; src: url(/assets/IBMPlexSansArabic-Regular.woff2) format("woff2"), url(/assets/IBMPlexSansArabic-Regular.ttf) format("truetype"); font-weight: 400; font-display: swap; }
  @font-face { font-family: "IBM Plex Sans Arabic"; src: url(/assets/IBMPlexSansArabic-SemiBold.woff2) format("woff2"), url(/assets/IBMPlexSansArabic-SemiBold.ttf) format("truetype"); font-weight: 600; font-display: swap; }
  @font-face { font-family: "IBM Plex Sans Arabic"; src: url(/assets/IBMPlexSansArabic-Bold.woff2) format("woff2"), url(/assets/IBMPlexSansArabic-Bold.ttf) format("truetype"); font-weight: 700; font-display: swap; }

  :root {
    --magenta: #ce0f69; --magenta-deep: #a40755; --pink-glow: #ff5ca4; --deep: #11161c;
    --bg: #f7f5f6; --surface: #fff; --sunken: #e9e6e8; --panel: #1d242c;
    --ink: #1d242c; --muted: #565b60; --subtle: #63686d;
    --line: #dedcdf; --line-strong: #80858a; --rule: #1d242c;
    --accent: var(--magenta); --accent-text: #ce0f69; --on-accent: #fff; --on-panel: #fff; --focus: #1d242c;
    --success: #1f6b4a; --danger: #b42318; --warn: #8a5300; --on-state: #fff;
    --scrim: rgba(17, 22, 28, .55);
    --on-deep: #fff; --on-deep-muted: #aeb3b7;                       /* text on the always-dark brand panel */
    --shadow-pop: 0 6px 20px rgba(29, 36, 44, .22); --glow: rgba(206, 15, 105, .55);
    --sans: "IBM Plex Sans Arabic", "Avenir Next", "Century Gothic", Arial, sans-serif;
    --r-sm: 4px;
    --ease: cubic-bezier(.215, .61, .355, 1);
    --ease-in: cubic-bezier(.55, .055, .675, .19);
  }
  @media (prefers-color-scheme: dark) {
    :root {
      --bg: #11161c; --surface: #1d242c; --sunken: #252d35; --panel: #252d35;
      --ink: #fff; --muted: #aeb3b7; --subtle: #9e98a4;
      --line: #414a52; --line-strong: #787d82; --rule: #70757a;
      --accent-text: #ff5ca4; --focus: #ff5ca4;
      --success: #6fd3a5; --danger: #ff8a7a; --warn: #f2b44e; --on-state: #11161c;
      --scrim: rgba(0, 0, 0, .62); --shadow-pop: 0 6px 20px rgba(0, 0, 0, .55);
    }
  }

  * { box-sizing: border-box; }
  body {
    margin: 0; background: var(--bg); color: var(--ink);
    font: 400 16px/1.6 var(--sans); -webkit-font-smoothing: antialiased;
  }
  button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
  button { cursor: pointer; }
  :focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
  [dir="rtl"], [dir="auto"] { line-height: 1.8; }
  h1 { font: 700 36px/1.05 var(--sans); letter-spacing: -.8px; margin: 0; text-wrap: balance; }
  h1 em { font-style: normal; color: var(--accent-text); }

  /* ---------------- top bar ---------------- */
  .bar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 30; background: var(--surface); border-bottom: 1px solid var(--line); }
  .bar-in { max-width: 1200px; margin: 0 auto; padding: 0 24px; display: flex; align-items: center; gap: 24px; min-height: 64px; }
  .mark { display: flex; align-items: center; flex: none; cursor: pointer; transition: opacity .15s; }
  .mark:hover { opacity: .8; }
  .mark img { height: 28px; width: auto; display: block; }
  .bar-r { display: flex; align-items: center; gap: 12px; flex: none; margin-left: auto; }

  /* ---------------- page head: eyebrow, title with one accent word, the 2px accent rule ---------------- */
  .ph { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px 24px; flex-wrap: wrap; margin-bottom: 24px; padding-bottom: 16px; border-bottom: 2px solid var(--accent); animation: rise .4s var(--ease) both; }
  .eyebrow { margin: 0 0 8px; color: var(--accent-text); font: 700 12px/1.2 var(--sans); letter-spacing: 1.6px; text-transform: uppercase; }
  .ph p { margin: 8px 0 0; color: var(--muted); max-width: 60ch; }
  .ph-acts { display: flex; gap: 12px; flex-wrap: wrap; }

  /* ---------------- status chips: the word is always there; colour is only a state ---------------- */
  .pill {
    display: inline-flex; align-items: center; padding: 2px 9px; border: 1px solid transparent; border-radius: var(--r-sm);
    font: 600 12px/1.5 var(--sans); white-space: nowrap;
  }
  .pill.p-open { color: var(--ink); border-color: var(--line-strong); }
  .pill.p-part { color: var(--ink); background: var(--sunken); }
  .pill.p-void { color: var(--muted); background: var(--sunken); }
  .pill.p-ok { color: var(--success); background: color-mix(in srgb, var(--success) 13%, var(--surface)); }
  .pill.p-bad { color: var(--danger); background: color-mix(in srgb, var(--danger) 13%, var(--surface)); }

  /* ---------------- toast ---------------- */
  #toast-host { position: fixed; left: 24px; bottom: calc(24px + env(safe-area-inset-bottom, 0px) + var(--sum-h, 0px)); z-index: 9600; }
  .toast {
    max-width: min(460px, calc(100vw - 48px)); padding: 12px 18px;
    background: var(--panel); color: var(--on-panel); border: 1px solid var(--line-strong); box-shadow: var(--shadow-pop);
    font-size: 14px; animation: fade-in .15s var(--ease) both;
  }
  .toast + .toast { margin-top: 8px; }
  @media (max-width: 560px) { #toast-host { left: 16px; right: 16px; } .toast { max-width: none; } }

  /* ======================================================================
     Interface kit: page-change loader, sign-in, fields, buttons, overlays, menus, chips, tabs, history.
     Tokens come from base.css (the DecoSign design system).
     ====================================================================== */

  /* ---------------- page change: the DecoSign loader, always the WHITE wordmark on the dark ground ---------------- */
  .swap {
    position: fixed; inset: 0; z-index: 10000;
    display: flex; align-items: center; justify-content: center;
    background: var(--deep);
    opacity: 0; pointer-events: none;
    transition: opacity .24s var(--ease);
  }
  .swap.on, html.swapping .swap { opacity: 1; pointer-events: auto; }
  html.swapping .swap { transition: none; animation: swap-giveup 0s 7s forwards; }   /* never stuck */
  .swap.sweep { opacity: 1; pointer-events: auto; clip-path: inset(0 58% 0 0); animation: sweep .44s var(--ease) forwards; }
  @keyframes sweep { to { clip-path: inset(0 0 0 0); } }
  @keyframes swap-giveup { to { opacity: 0; pointer-events: none; } }

  /* ---------------- sign-in: the dark brand panel (with the arc) on the left, the form on the right ---------------- */
  .auth { position: fixed; inset: 0; z-index: 9000; display: grid; grid-template-columns: minmax(340px, 42%) 1fr; background: var(--bg); overflow-y: auto; }
  .auth-brand {
    position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: center;
    padding: 56px clamp(28px, 5vw, 64px); background: var(--deep); color: var(--on-deep);
  }
  .auth-brand::before {             /* the arc: a thin neon circle segment on deep */
    content: ""; position: absolute; width: 440px; height: 440px; right: -190px; top: -130px;
    border: 2px solid var(--pink-glow); border-radius: 50%; opacity: .8;
    box-shadow: 0 0 40px var(--glow), inset 0 0 40px var(--glow);
  }
  .auth-brand > * { position: relative; z-index: 1; }
  .auth-logo { width: 150px; height: auto; }
  .auth-brand .eyebrow { margin: 44px 0 16px; color: var(--pink-glow); }
  .auth-brand h1 { max-width: 12ch; font-size: clamp(36px, 3.6vw, 48px); line-height: 1; letter-spacing: -1px; }
  .auth-brand h1 em { color: var(--pink-glow); }
  .auth-brand p { margin: 20px 0 0; max-width: 36ch; color: var(--on-deep-muted); }

  .auth-side { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
  .auth-card { width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--line); padding: 32px 32px 20px; }
  .auth-icon { width: 40px; height: 40px; background: var(--sunken); color: var(--ink); display: grid; place-items: center; }
  .auth-kicker { margin: 18px 0 4px; color: var(--accent-text); font: 700 12px/1.2 var(--sans); letter-spacing: 1.6px; text-transform: uppercase; }
  .auth-card h2 { margin: 0; font: 700 24px/1.15 var(--sans); letter-spacing: -.3px; }
  .auth-help { margin: 8px 0 22px; color: var(--muted); font-size: 14px; line-height: 1.55; }
  .auth-foot { display: flex; gap: 8px; align-items: flex-start; margin-top: 20px; padding-top: 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; line-height: 1.5; }
  .auth-foot svg { flex: none; margin-top: 3px; }
  .auth-foot a { color: var(--accent-text); font-weight: 600; text-decoration: none; }
  .auth-foot a:hover { text-decoration: underline; }
  .auth-for { margin: -10px 0 18px; padding: 10px 12px; background: var(--sunken); color: var(--muted); font-size: 13px; line-height: 1.5; }
  .auth-for b { color: var(--ink); font-weight: 600; }
  .auth .form-msg { margin-top: 10px; }

  .auth-brand > * { animation: rise .42s var(--ease) both; }
  .auth-brand > :nth-child(2) { animation-delay: .06s; }
  .auth-brand > :nth-child(3) { animation-delay: .12s; }
  .auth-brand > :nth-child(4) { animation-delay: .18s; }
  .auth-card { animation: card-in .42s .1s var(--ease) both; }
  .auth.done .auth-card { animation: card-leave .32s var(--ease-in) forwards; }   /* signed in: the form steps back while the brand sweeps across */

  @media (max-width: 820px) {
    /* stacked: each part as tall as its content (a plain auto row would squeeze the brand panel) */
    .auth { grid-template-columns: 1fr; grid-auto-rows: max-content; align-content: start; }
    .auth-brand { padding: 32px 24px 28px; }
    .auth-brand h1 { font-size: 32px; }
    .auth-brand p { display: none; }
    .auth-brand .eyebrow { margin: 24px 0 12px; }
    .auth-logo { width: 120px; }
    .auth-side { padding: 24px 16px 40px; }
    .auth-card { padding: 24px 20px 16px; }
  }
  /* phones: iOS zooms into any field under 16px; 16px everywhere on touch keeps the page still */
  @media (hover: none) and (pointer: coarse) { input, textarea, select { font-size: 16px !important; } }

  /* ---------------- fields: label above, always visible ---------------- */
  .fld { display: block; }
  .fld[hidden] { display: none; }
  .fld + .fld { margin-top: 16px; }
  .fld label { display: block; margin: 0 0 8px; font: 600 14px/1.3 var(--sans); }
  .fld input, .fld select, .fld textarea {
    width: 100%; min-height: 46px; padding: 12px 16px;
    background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-sm);
    font: 400 16px/1.4 var(--sans); transition: border-color .15s;
  }
  .fld textarea { min-height: 84px; resize: vertical; }
  .fld input::placeholder, .fld textarea::placeholder { color: var(--subtle); }
  .fld input:focus-visible, .fld select:focus-visible, .fld textarea:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; border-color: var(--ink); }
  input[type="file"] { font-size: 14px; max-width: 100%; }
  input[type="file"]::file-selector-button {
    font: 600 13px/1 var(--sans); padding: 9px 14px; margin-inline-end: 12px; cursor: pointer;
    background: transparent; color: var(--ink); border: 2px solid var(--ink); border-radius: 0; transition: background .15s, color .15s;
  }
  input[type="file"]::file-selector-button:hover { background: var(--ink); color: var(--bg); }
  .fld-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
  .fld-row.three { grid-template-columns: repeat(3, 1fr); }
  .fld-row .fld + .fld { margin-top: 0; }
  .fld-row + .fld, .fld + .fld-row, .fld-row + .fld-row { margin-top: 16px; }
  .fld-hint { display: block; margin-top: 6px; color: var(--muted); font-size: 13px; line-height: 1.4; }
  .form-msg { min-height: 18px; margin: 12px 0 0; font: 600 13px/1.45 var(--sans); color: var(--danger); }
  .form-msg.ok { color: var(--success); }

  /* ---------------- buttons: square-cut, 44px tall, press / work / finish ---------------- */
  .btn {
    position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 44px; padding: 0 24px; border-radius: 0; border: 2px solid transparent;
    font: 600 15px/1 var(--sans); text-decoration: none;
    transition: transform .12s var(--ease), background-color .15s, color .15s, border-color .15s, opacity .15s;
  }
  .btn:active:not(:disabled) { transform: scale(.97); }
  .btn.primary { background: var(--accent); color: var(--on-accent); }
  .btn.primary:hover:not(:disabled) { background: var(--magenta-deep); }
  .btn.ghost { background: transparent; color: var(--ink); border-color: var(--ink); }
  .btn.ghost:hover:not(:disabled) { background: var(--ink); color: var(--bg); }
  .btn.go { background: var(--success); color: var(--on-state); }
  .btn.go:hover:not(:disabled) { background: color-mix(in srgb, var(--success) 82%, var(--ink)); }
  .btn.stop { background: var(--danger); color: var(--on-state); }
  .btn.stop:hover:not(:disabled) { background: color-mix(in srgb, var(--danger) 82%, var(--ink)); }
  .btn.danger { background: transparent; color: var(--danger); border-color: var(--danger); }
  .btn.danger:hover:not(:disabled) { background: var(--danger); color: var(--on-state); }
  .btn.wide { width: 100%; }
  .btn:disabled:not(.busy):not(.done), .btn[aria-disabled="true"] { cursor: default; background: var(--sunken); color: var(--muted); border-color: var(--line-strong); }   /* muted text on sunken stays above 4.5:1 */
  .btn.ghost[aria-disabled="true"]:hover, .btn.primary[aria-disabled="true"]:hover { background: var(--sunken); color: var(--muted); }
    .btn.busy .btn-l, .btn.done .btn-l { opacity: 0; }
  .btn.busy::after, .btn.done::after { content: ""; position: absolute; inset: 0; margin: auto; }
  .btn.busy::after { width: 18px; height: 18px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
  .btn.done::after { width: 18px; height: 9px; border: solid currentColor; border-width: 0 0 2.5px 2.5px; transform: translateY(-2px) rotate(-45deg); animation: tick .3s var(--ease) both; }
  .btn.done.primary { background: var(--success); color: var(--on-state); }
  .btn-l svg { vertical-align: -2px; margin-right: 7px; }
  .btn-row { display: flex; gap: 12px; margin-top: 20px; }
  .btn-row > .btn { flex: 1; }
  @keyframes spin { to { transform: rotate(360deg); } }
  @keyframes tick { from { opacity: 0; transform: translateY(-2px) rotate(-45deg) scale(.4); } }
  .icb {
    width: 32px; height: 32px; display: grid; place-items: center; flex: none; padding: 0;
    background: var(--surface); border: 1px solid var(--line-strong); border-radius: 0; color: var(--muted);
    transition: color .15s, border-color .15s, transform .12s var(--ease);
  }
  .icb:hover { color: var(--ink); border-color: var(--ink); }
  .icb:active { transform: scale(.94); }
  .icb:disabled { opacity: .3; cursor: default; }

  /* ---------------- overlays: the page dimmed behind a square-cut sheet ---------------- */
  .ovl {
    position: fixed; inset: 0; z-index: 9500; display: flex; align-items: flex-start; justify-content: center;
    padding: max(7vh, 24px) 16px 24px; overflow-y: auto; background: var(--scrim); animation: fade-in .2s var(--ease) both;
  }
  .ovl.out { animation: fade-out .16s var(--ease-in) both; pointer-events: none; }   /* a closing overlay never eats the next click */
  .ovl-card {
    position: relative; width: 100%; max-width: 440px; background: var(--surface); border: 1px solid var(--line-strong);
    padding: 24px 24px 20px; animation: card-in .3s var(--ease) both;
  }
  .ovl-card.wide { max-width: 800px; }
  .ovl.out .ovl-card { animation: card-leave .16s var(--ease-in) both; }
  .ovl-x { position: absolute; top: 14px; right: 14px; width: 32px; height: 32px; display: grid; place-items: center; border: 0; background: none; color: var(--muted); transition: background .15s, color .15s; }
  .ovl-x:hover { background: var(--sunken); color: var(--ink); }
  .ovl-title { margin: 0 40px 4px 0; font: 700 24px/1.2 var(--sans); letter-spacing: -.3px; }
  .ovl-title + .ovl-body { margin-top: 18px; }
  .ovl-sub { margin: 0 0 18px; color: var(--muted); font-size: 14px; line-height: 1.5; }
  .ovl-note { margin: 16px 0 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
  body.ovl-open { overflow: hidden; }
  .linkbox { margin: 4px 0; padding: 12px 14px; background: var(--sunken); font-size: 13px; line-height: 1.5; word-break: break-all; user-select: all; }

  /* ---------------- anchored menus ---------------- */
  .pop {
    position: fixed; z-index: 9400; width: 280px; max-width: calc(100vw - 24px); padding: 6px;
    background: var(--surface); border: 1px solid var(--line-strong);
    transform-origin: top right; animation: pop-in .18s var(--ease) both;
  }
  .pop.out { animation: pop-out .12s var(--ease-in) both; pointer-events: none; }
  .pop-head { display: flex; gap: 12px; align-items: center; padding: 10px 10px 12px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
  .pop-head b { display: block; font: 600 14px/1.3 var(--sans); }
  .pop-head small { display: block; font-size: 13px; line-height: 1.35; color: var(--muted); word-break: break-all; }
  .pop-head .role { margin-top: 3px; color: var(--accent-text); font-weight: 600; }
  .pop-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px; border: 0; background: none; font: 600 14px/1.2 var(--sans); text-align: left; transition: background .12s; }
  .pop-item:hover, .pop-item:focus-visible { background: var(--sunken); outline: none; }
  .pop-item.danger, .pop-item.danger svg { color: var(--danger); }
  .pop-item svg { color: var(--muted); flex: none; }
  .pop-item.nochk { padding-left: 35px; }
  .pop-label { padding: 10px 10px 4px; font: 600 11px/1 var(--sans); letter-spacing: 1px; text-transform: uppercase; color: var(--muted); }
  .pop-label:not(:first-child) { margin-top: 6px; border-top: 1px solid var(--line); padding-top: 12px; }
  .pop-form { padding: 8px 10px 10px; animation: rise .22s var(--ease) both; }
  .pop-form .fld input { min-height: 42px; font-size: 14px; }

  .avatar { width: 34px; height: 34px; flex: none; display: grid; place-items: center; background: var(--panel); color: var(--on-panel); font: 700 12px/1 var(--sans); }
  .avatar.lg { width: 40px; height: 40px; font-size: 14px; }
  #acctbtn { width: 34px; height: 34px; padding: 0; border: 0; transition: transform .12s var(--ease), box-shadow .15s; }
  #acctbtn:hover, #acctbtn[aria-expanded="true"] { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--ink); }
  #acctbtn:active { transform: scale(.94); }

  /* ---------------- filter chips and tabs ---------------- */
  .chips { display: flex; gap: 8px; flex-wrap: wrap; }
  .chip {
    padding: 8px 12px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--surface);
    font: 600 13px/1 var(--sans); color: var(--ink); transition: background-color .15s, color .15s, border-color .15s, transform .12s var(--ease);
  }
  .chip:hover { border-color: var(--ink); }
  .chip:active { transform: scale(.96); }
  .chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
  .tabs2 { display: flex; gap: 24px; margin: 0 0 24px; border-bottom: 1px solid var(--line); overflow-x: auto; overflow-y: hidden; }
  .tabs2 button { padding: 10px 0; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; background: none; font: 600 15px/1.2 var(--sans); color: var(--muted); white-space: nowrap; transition: color .15s, border-color .15s; }
  .tabs2 button:hover { color: var(--ink); }
  .tabs2 button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }

  /* ---------------- history: day-grouped timeline, diamond dots ---------------- */
  .tl-tools { display: flex; gap: 12px; flex-wrap: wrap; margin: 0 0 8px; }
  .tl-tools .fld { flex: 1; min-width: 200px; }
  .tl-scroll { max-height: min(58vh, 560px); overflow-y: auto; margin: 0 -6px; padding: 0 6px; overscroll-behavior: contain; }
  .tl-scroll.small { max-height: 240px; }
  .tl-day { margin: 18px 0 6px; font: 600 11px/1 var(--sans); letter-spacing: 1px; text-transform: uppercase; color: var(--muted); }
  .tl { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line-strong); }
  .tl-row { position: relative; display: grid; grid-template-columns: 46px 1fr; gap: 10px; padding: 8px 0 8px 16px; animation: rise .3s var(--ease) both; animation-delay: calc(var(--i, 0) * 18ms); }
  .tl-row::before { content: ""; position: absolute; left: -5px; top: 15px; width: 9px; height: 9px; transform: rotate(45deg); background: var(--surface); border: 2px solid var(--line-strong); }
  .tl-row.bad::before { border-color: var(--danger); }
  .tl-row.good::before { border-color: var(--success); }
  .tl-time { font: 600 12px/1.6 var(--sans); font-variant-numeric: tabular-nums; color: var(--muted); }
  .tl-line { font-size: 14px; line-height: 1.5; color: var(--muted); }
  .tl-line b { color: var(--ink); font-weight: 600; }
  .tl-sub { font-size: 13px; line-height: 1.45; color: var(--muted); word-break: break-word; }
  .tl-empty { color: var(--muted); font-size: 14px; padding: 20px 0; }

  /* ---------------- shared motion ---------------- */
  @keyframes rise { from { opacity: 0; transform: translateY(10px); } }
  @keyframes card-in { from { opacity: 0; transform: translateY(12px) scale(.97); } }
  @keyframes card-leave { to { opacity: 0; transform: translateY(6px) scale(.97); } }
  @keyframes fade-in { from { opacity: 0; } }
  @keyframes fade-out { to { opacity: 0; } }
  @keyframes pop-in { from { opacity: 0; transform: translateY(-4px) scale(.96); } }
  @keyframes pop-out { to { opacity: 0; transform: translateY(-4px) scale(.97); } }

/* The DecoSign loader (markup: src/loader.js), as on the redesigned website. Timeline (0.66 s): "Deco" rises 0.25 s (power3.out), the pen stroke runs 0.4 s
   from t = 0.2 s (power2.out), the whole of "Sign" settles in over 0.08 s at t = 0.58 s, then the finished wordmark holds. "Deco" is ink on light
   grounds and white on dark; "Sign" is always the brand magenta (#ce0f69: 3.4:1 on the dark ground, a logo mark, so the 3:1 non-text bar).
   The animations run whenever the loader is shown (.on) or the page is still changing (.swapping), or always when the
   loader sits on its own (.dsl-solo). With prefers-reduced-motion it is simply the finished wordmark. */
.dsl { width: min(60vw, 300px); height: auto; display: block; overflow: visible; }
.dsl .on-dark { display: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .dsl .on-light { display: none; } :root:not([data-theme="light"]) .dsl .on-dark { display: inline; } }
:root[data-theme="dark"] .dsl .on-light, html.swap-dark .dsl .on-light, .dsl-dark .dsl .on-light { display: none; }
:root[data-theme="dark"] .dsl .on-dark, html.swap-dark .dsl .on-dark, .dsl-dark .dsl .on-dark { display: inline; }

.dsl-pen { stroke-dasharray: var(--len); stroke-dashoffset: var(--len); }
.dsl-full { opacity: 0; }
.dsl-deco { opacity: 0; }
.swap.on .dsl-deco, html.swapping .dsl-deco, .dsl-solo .dsl-deco { animation: dsl-rise .25s cubic-bezier(.215, .61, .355, 1) both; }
.swap.on .dsl-pen, html.swapping .dsl-pen, .dsl-solo .dsl-pen { animation: dsl-write .4s .2s cubic-bezier(.25, .46, .45, .94) both; }
.swap.on .dsl-full, html.swapping .dsl-full, .dsl-solo .dsl-full { animation: dsl-settle .08s .58s linear both; }
@keyframes dsl-rise { from { opacity: 0; transform: translateY(22%); } to { opacity: 1; transform: none; } }
@keyframes dsl-write { from { stroke-dashoffset: var(--len); } to { stroke-dashoffset: 0; } }
@keyframes dsl-settle { to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .dsl-deco, .dsl-full { opacity: 1 !important; animation: none !important; }
  .dsl-pen { animation: none !important; }
}

  /* ======================================================================
     eSign pages: header, list, agreement view, editor, settings, the customer's signing page, verify.
     Tokens from base.css (the DecoSign design system, as billing), kit from ui.css.
     ====================================================================== */
  .bar-in .nav { display: flex; gap: 24px; flex: 1 1 auto; min-width: 0; align-self: stretch; }
  .navlink { display: flex; align-items: center; color: var(--muted); font-weight: 600; text-decoration: none; white-space: nowrap; border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color .15s, border-color .15s; }
  .navlink:hover { color: var(--ink); }
  .navlink[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }
  .mark { text-decoration: none; gap: 10px; }
  .mark-app { padding: 3px 7px; border: 1px solid var(--line-strong); color: var(--muted); font: 700 11px/1 var(--sans); letter-spacing: 1.4px; text-transform: uppercase; }
  .newlink { min-height: 40px; padding: 0 20px; }
  #acctbtn.avatar { border: 0; }
  @media (max-width: 680px) {
    .bar-in { flex-wrap: wrap; row-gap: 0; padding: 10px 16px 0; gap: 12px; }
    .bar-in .nav { order: 3; flex-basis: 100%; gap: 20px; min-height: 40px; }
    .newlink { padding: 0 14px; min-height: 36px; } .nl-more { display: none; }
  }

  .app { max-width: 1200px; margin: 0 auto; padding: 40px 24px 96px; }
  @media (max-width: 560px) { .app { padding: 24px 16px 80px; } h1 { font-size: 30px; } }
  .muted { color: var(--muted); } .small { font-size: 13px; }
  .ph p .pill { vertical-align: 2px; }
  .linkish { display: inline-block; margin-top: 12px; padding: 0; border: 0; background: none; color: var(--accent-text); font: 600 14px/1.4 var(--sans); text-decoration: none; cursor: pointer; }
  .linkish:hover { text-decoration: underline; } .linkish.danger { color: var(--danger); } .linkish:disabled { color: var(--muted); cursor: default; text-decoration: none; }
  .linkish.small { margin: 0; font-size: 13px; }
  .lbl { display: block; margin: 18px 0 8px; font: 600 14px/1.3 var(--sans); }

  /* ---------------- list ---------------- */
  .dash-empty { text-align: center; padding: 56px 24px; background: var(--surface); border-block: 1px solid var(--line); animation: rise .4s var(--ease) both; }
  .dash-empty h2 { margin: 0 0 8px; font: 700 24px/1.15 var(--sans); }
  .dash-empty p { margin: 0 auto 24px; max-width: 44ch; color: var(--muted); }
  .dash-sub { color: var(--muted); }
  .stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 24px; border-block: 1px solid var(--line); }
  .stat { display: flex; flex-direction: column; gap: 4px; padding: 20px 16px; border-inline-end: 1px solid var(--line); animation: rise .38s var(--ease) both; animation-delay: calc(var(--i, 0) * 50ms); }
  .stat:last-child { border-inline-end: 0; }
  .stat-k { font: 600 11px/1.3 var(--sans); letter-spacing: 1px; text-transform: uppercase; color: var(--muted); }
  .stat-v { margin-top: 4px; font: 700 28px/1.1 var(--sans); font-variant-numeric: tabular-nums; }
  .stat.accent .stat-v { color: var(--accent-text); } .stat.bad .stat-v { color: var(--danger); } .stat.ok .stat-v { color: var(--success); } .stat .stat-v.zero { color: var(--subtle); }
  @media (max-width: 860px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } .stat:nth-child(2n) { border-inline-end: 0; } .stat:nth-child(n+3) { border-top: 1px solid var(--line); } }
  .chips { margin-bottom: 16px; }
  .rows { border-top: 1px solid var(--line); }
  .row { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 16px 12px; border-bottom: 1px solid var(--line); color: inherit; text-decoration: none; background: var(--surface); transition: background .12s; animation: rise .3s var(--ease) both; animation-delay: calc(var(--i, 0) * 18ms); }
  .row:hover { background: var(--sunken); }
  .row-main { display: flex; flex-direction: column; min-width: 0; }
  .row-no { font-weight: 700; font-variant-numeric: tabular-nums; }
  .row-who { color: var(--muted); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .row-meta { display: flex; align-items: center; gap: 16px; flex: none; }
  .row-amt { font-weight: 600; font-variant-numeric: tabular-nums; }
  .row-date { color: var(--muted); font-size: 13px; min-width: 120px; text-align: right; }
  @media (max-width: 640px) { .row { flex-direction: column; align-items: flex-start; gap: 6px; } .row-date { min-width: 0; text-align: left; } }

  /* ---------------- one agreement ---------------- */
  .split { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 24px; align-items: start; }
  .side { position: sticky; top: 88px; display: grid; gap: 16px; }
  @media (max-width: 1100px) { .split { grid-template-columns: 1fr; } .side { position: static; } }
  .panel { background: var(--surface); border: 1px solid var(--line); padding: 20px; animation: rise .35s var(--ease) both; }
  .panel h3 { margin: 0 0 6px; font: 700 18px/1.3 var(--sans); } .panel h3.ok { color: var(--success); }
  .panel.slim h3 { font-size: 12px; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); }
  .panel .linkbox { margin: 12px 0 0; }
  .panel .btn-row { margin-top: 12px; flex-wrap: wrap; }
  .panel .btn.wide { margin-top: 12px; }
  .panel .linkish { display: block; }
  .hash { display: block; font: 12px/1.5 ui-monospace, Menlo, monospace; word-break: break-all; color: var(--muted); }
  .checks { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; font-size: 14px; }
  .checks li { display: flex; gap: 8px; align-items: flex-start; } .checks svg { flex: none; margin-top: 4px; }
  .checks .good { color: var(--success); } .checks .bad { color: var(--danger); font-weight: 700; }
  .sheet { container: sheet / inline-size; background: #fff; border: 1px solid var(--line); box-shadow: 0 1px 0 var(--line), 0 18px 40px -24px rgba(17, 22, 28, .35); overflow: hidden; animation: rise .45s .05s var(--ease) both; }
  .sheet + .sheet, .sheet .audit { margin-top: 0; border-top: 6px solid var(--bg); }
  .ovl .sheet { margin-bottom: 16px; max-height: 70vh; overflow-y: auto; }

  /* ---------------- editor ---------------- */
  .ed { max-width: 900px; display: grid; gap: 16px; }
  .ed-sec { background: var(--surface); border: 1px solid var(--line); padding: 24px; animation: rise .35s var(--ease) both; }
  .ed-sec > h2 { display: flex; align-items: center; gap: 12px; margin: 0 0 6px; font: 700 20px/1.3 var(--sans); }
  .ed-sec > .muted { margin: 0 0 16px; font-size: 14px; }
  .ed-n { display: inline-grid; place-items: center; width: 28px; height: 28px; background: var(--ink); color: var(--bg); font-size: 13px; }
  .ed-sub { margin: 24px 0 6px; font: 700 13px/1.3 var(--sans); letter-spacing: 1px; text-transform: uppercase; color: var(--muted); }
  .seg { display: flex; gap: 8px; margin-bottom: 16px; }
  .quote-note { display: flex; gap: 10px; align-items: flex-start; margin: 4px 0 16px; padding: 12px 14px; background: var(--sunken); font-size: 14px; line-height: 1.5; }
  .quote-note svg { flex: none; margin-top: 3px; color: var(--accent-text); }
  .ms { display: grid; grid-template-columns: 1fr 1fr 80px 150px 32px; gap: 10px; align-items: end; margin-bottom: 10px; }
  .ms .fld + .fld { margin-top: 0; } .ms .fld label:empty { display: none; }
  .ms-amt { min-height: 46px; display: flex; align-items: center; justify-content: flex-end; font-weight: 600; font-variant-numeric: tabular-nums; }
  .ms .icb { margin-bottom: 7px; }
  .ms-foot { display: flex; justify-content: space-between; align-items: center; }
  .ms-foot .linkish { margin: 0; }
  .ms-sum { font-weight: 700; font-variant-numeric: tabular-nums; } .ms-sum.ok { color: var(--success); } .ms-sum.bad { color: var(--danger); }
  @media (max-width: 720px) { .ms { grid-template-columns: 1fr 70px 32px; } .ms .fld:nth-child(1), .ms .fld:nth-child(2) { grid-column: 1 / -1; } .ms-amt { grid-column: 1; justify-content: flex-start; min-height: 0; grid-row: 4; } }
  .tog { display: flex; align-items: flex-start; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
  .tog input { width: 18px; height: 18px; margin: 4px 0 0; accent-color: var(--magenta); flex: none; }
  .tog > span { flex: 1; display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; }
  .tog .ar { color: var(--muted); font-size: 14px; direction: rtl; }
  .tog .linkish { flex: none; }
  .ed-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: var(--surface); border-top: 1px solid var(--line); padding: 12px 24px calc(12px + env(safe-area-inset-bottom, 0px)); }
  .ed-bar-in { max-width: 900px; display: flex; gap: 12px; align-items: center; margin-left: max(0px, calc((100vw - 1200px) / 2)); }
  .ed-saved { margin-right: auto; color: var(--muted); font-size: 13px; }
  body.has-ed-bar .app { padding-bottom: 140px; }
  @media (max-width: 560px) { .ed-bar { padding-inline: 12px; } .ed-bar-in { gap: 8px; } .ed-bar .btn { padding: 0 12px; } .ed-saved { display: none; } .ed-sec { padding: 18px 16px; } }

  /* ---------------- settings ---------------- */
  .pane { max-width: 1000px; animation: rise .3s var(--ease) both; }
  .pane > .fld-row + .fld-row { margin-top: 16px; }
  .pane .quote-note { margin-top: 24px; }
  .cl { border: 1px solid var(--line); background: var(--surface); margin-bottom: 8px; }
  .cl summary { display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; padding: 14px 16px; cursor: pointer; }
  .cl summary .ar { color: var(--muted); direction: rtl; font-size: 14px; }
  .cl[open] summary { border-bottom: 1px solid var(--line); }
  .cl .fld-row { padding: 12px 16px; }

  /* ---------------- the signature pad ---------------- */
  .sigpad { position: relative; height: 190px; background: #fff; border: 1px solid var(--line-strong); touch-action: none; user-select: none; }
  .sigpad canvas { position: absolute; inset: 0; width: 100%; height: 100%; cursor: crosshair; }
  .sigpad-line { position: absolute; left: 24px; right: 24px; bottom: 44px; border-bottom: 1px solid #c9c6c8; pointer-events: none; }
  .sigpad-hint { position: absolute; left: 0; right: 0; bottom: 52px; text-align: center; color: #8a8f94; font-size: 14px; pointer-events: none; transition: opacity .2s; }
  .sigpad.inked .sigpad-hint { opacity: 0; }
  .sigpad-clear { position: absolute; top: 8px; inset-inline-end: 8px; padding: 6px 10px; border: 1px solid #c9c6c8; background: #fff; color: #1d242c; font: 600 12px/1 var(--sans); }

  /* ---------------- the customer's page ---------------- */
  .l-ar { display: block; } .l-en { display: block; font-size: .82em; color: var(--muted); font-weight: 400; }
  html[lang="ar"] body { direction: rtl; }
  html[lang="ar"] .l-en, html[lang="ar"] .s-facts b { text-align: right; } html[lang="ar"] .s-done .l-en { text-align: inherit; }
  html[lang="ar"] .bar-r { margin-left: 0; margin-right: auto; }
  html[lang="ar"] .toast { direction: rtl; }
  .langs { display: flex; gap: 6px; }
  .langs .chip { padding: 7px 10px; font-size: 12px; }
  @media (min-width: 721px) { .langs { display: none; } }
  .s-top { max-width: 900px; margin: 0 auto 24px; padding-bottom: 20px; border-bottom: 2px solid var(--accent); animation: rise .4s var(--ease) both; }
  .s-title { margin: 0 0 16px; font-size: clamp(26px, 4vw, 36px); }
  .s-title em { font-style: normal; color: var(--accent-text); white-space: nowrap; direction: ltr; unicode-bidi: isolate; }
  .s-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
  .s-facts > div { padding: 10px 14px; background: var(--surface); border: 1px solid var(--line); min-width: 0; }
  .s-facts .k { font-size: 12px; color: var(--muted); margin-bottom: 4px; } .s-facts .k .l-en { font-size: 11px; }
  .s-facts b { display: block; font-size: 15px; line-height: 1.4; overflow-wrap: anywhere; }
  .s-steps { margin: 0 0 14px; }
  .s-top .btn { margin-inline-end: 16px; }
  .s-top .btn-l svg { margin: 0 0 0 6px; }
  @media (max-width: 720px) { .s-facts { grid-template-columns: 1fr; } }
  .app > .sheet { max-width: 900px; margin: 0 auto; }
  .s-panel { max-width: 900px; margin: 24px auto 0; background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--accent); padding: 28px; animation: rise .4s var(--ease) both; }
  .s-panel > h2 { margin: 0 0 20px; font: 700 26px/1.25 var(--sans); }
  .s-step { border-top: 1px solid var(--line); padding: 18px 0; }
  .s-step-h { display: flex; align-items: center; gap: 12px; font: 700 17px/1.35 var(--sans); }
  .s-n { display: inline-grid; place-items: center; width: 30px; height: 30px; flex: none; background: var(--ink); color: var(--bg); font-size: 14px; }
  .s-step.done .s-n { background: var(--success); color: var(--on-state); }
  .s-step.locked { opacity: .5; } .s-step.locked .s-step-b, .s-step.done .s-step-b { display: none; }
  .s-sum { margin-inline-start: auto; color: var(--success); font-size: 14px; font-weight: 600; text-align: end; }
  .s-step-b { padding: 14px 0 0 0; padding-inline-start: 42px; }
  @media (max-width: 560px) { .s-panel { padding: 20px 16px; } .s-step-b { padding-inline-start: 0; } }
  .s-code { display: flex; gap: 12px; margin-top: 4px; }
  .s-code input { width: 200px; min-height: 52px; padding: 0 16px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--surface); font: 700 26px/1 var(--sans); letter-spacing: 10px; text-align: center; font-variant-numeric: tabular-nums; }
  .s-code input:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
  .s-code .btn { min-height: 52px; }
  .s-ack { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; margin-bottom: 8px; background: var(--sunken); cursor: pointer; line-height: 1.6; }
  .s-ack input { width: 20px; height: 20px; margin: 4px 0 0; flex: none; accent-color: var(--magenta); }
  .s-ack.strong { background: transparent; border: 1px solid var(--line-strong); font-weight: 600; }
  .s-ack:has(input:checked) { box-shadow: inset 3px 0 0 var(--success); }
  html[lang="ar"] .s-ack:has(input:checked) { box-shadow: inset -3px 0 0 var(--success); }
  .s-step .fld input { direction: inherit; }
  .s-step .btn.wide { margin-top: 18px; min-height: 52px; font-size: 16px; }
  .s-done { text-align: center; border-top-color: var(--success); }
  .s-tick { display: inline-grid; place-items: center; width: 56px; height: 56px; margin-bottom: 12px; background: var(--success); color: var(--on-state); animation: card-in .4s var(--ease) both; }
  .s-done .btn { margin-top: 16px; }
  .s-fp { display: grid; gap: 4px 16px; margin: 24px 0 0; text-align: start; font-size: 13px; }
  .s-fp dt { color: var(--muted); } .s-fp dd { margin: 0 0 10px; } .s-fp code { font: 12px/1.5 ui-monospace, Menlo, monospace; word-break: break-all; }
  .s-msg { max-width: 560px; margin: 8vh auto 0; padding: 32px; background: var(--surface); border: 1px solid var(--line); animation: card-in .4s var(--ease) both; }
  .s-h { margin: 18px 0 12px; font-size: 26px; line-height: 1.3; }
  .form-msg .l-en { color: inherit; opacity: .8; }

  /* ---------------- verify ---------------- */
  .v-badge { display: inline-grid; place-items: center; width: 52px; height: 52px; }
  .v-badge.good { background: var(--success); color: var(--on-state); } .v-badge.bad { background: var(--danger); color: var(--on-state); }
  .v-badge.wait { background: var(--sunken); color: var(--ink); } .v-badge.void { background: var(--sunken); color: var(--muted); }
