/* Dar Al-Khalil (دار الخليل) — shared styles.
   Taken from the calligraphy logo: emerald and royal purple ink, gold leaf, white paper.
   Signature: the dome arch from the logo's frame (dish windows, headers) and thin gold rules. */
:root {
  --plum: #4A2878;
  --plum-2: #6B3A9A;
  --orchid: #8E4592;
  --emerald: #1E8457;
  --emerald-bright: #309C6C;
  --emerald-deep: #17694A;
  --gold: #C0A86C;
  --gold-deep: #8C703A;
  --gold-soft: #F6EFDD;
  --ivory: #FFFDF8;
  --card: #FFFFFF;
  --lilac: #F2EBF7;
  --mint: #E4F3EA;
  --ink: #24152E;
  --muted: #75687E;
  --line: #ECE4D4;
  --danger: #B3261E;
  --turmeric-soft: var(--gold-soft); /* older name still used in a few inline styles */
  --r-xl: 26px;
  --r-lg: 18px;
  --r-md: 13px;
  --lift: 0 1px 0 rgba(140, 112, 58, .10), 0 12px 26px -16px rgba(74, 40, 120, .35);
  --font: "Readex Pro", system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif;
  --display: "Amiri", "Readex Pro", Georgia, serif;
  /* the pointed dome arch from the logo frame, used as a mask */
  --arch: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' preserveAspectRatio='none'%3E%3Cpath d='M0 100V42C0 22 26 10 50 0C74 10 100 22 100 42V100Z'/%3E%3C/svg%3E");
  color-scheme: light;
}
/* the lighter shades follow the four main colours, so the Design tab can recolour everything */
@supports (color: color-mix(in srgb, red, blue)) {
  :root {
    --plum-2: color-mix(in srgb, var(--plum) 82%, white);
    --emerald-deep: color-mix(in srgb, var(--emerald) 80%, black);
    --emerald-bright: color-mix(in srgb, var(--emerald) 85%, white);
    --gold-deep: color-mix(in srgb, var(--gold) 68%, black);
    --gold-soft: color-mix(in srgb, var(--gold) 20%, white);
    --lilac: color-mix(in srgb, var(--plum) 10%, white);
    --mint: color-mix(in srgb, var(--emerald) 12%, white);
    --line: color-mix(in srgb, var(--gold) 26%, white);
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--ivory); font-size: 16px; line-height: 1.6; -webkit-tap-highlight-color: transparent; }
h1, h2, h3 { font-family: var(--display); font-weight: 700; letter-spacing: 0; line-height: 1.35; color: var(--plum); }
.display { font-family: var(--display); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img { max-width: 100%; display: block; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--plum-2); outline-offset: 2px; border-radius: 8px; }
.num { font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate; }
.muted { color: var(--muted); }
.empty { text-align: center; padding: 48px 20px; color: var(--muted); }

/* a small gold eight-point star, used as an ornament */
.star { display: inline-block; width: .7em; height: .7em; background: var(--gold); flex: none;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M10 0l2.9 4.1L18 2l-2.1 5.1L20 10l-4.1 2.9L18 18l-5.1-2.1L10 20l-2.9-4.1L2 18l2.1-5.1L0 10l4.1-2.9L2 2l5.1 2.1z'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M10 0l2.9 4.1L18 2l-2.1 5.1L20 10l-4.1 2.9L18 18l-5.1-2.1L10 20l-2.9-4.1L2 18l2.1-5.1L0 10l4.1-2.9L2 2l5.1 2.1z'/%3E%3C/svg%3E") center / contain no-repeat; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px; border: 0; border-radius: 999px;
  background: var(--card); color: var(--plum); font-weight: 600; font-size: .97rem; text-decoration: none;
  box-shadow: inset 0 0 0 1.5px var(--line); transition: transform .08s, background .15s;
}
.btn:active:not(:disabled) { transform: scale(.97); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-sun { background: var(--emerald); color: #fff; box-shadow: none; }
.btn-cocoa { background: var(--plum); color: #fff; box-shadow: none; }
.btn-leaf { background: var(--emerald-deep); color: #fff; box-shadow: none; }
.btn-tomato { background: var(--danger); color: #fff; box-shadow: none; }
.btn-block { width: 100%; }
.btn-sm { min-height: 38px; padding: 0 14px; font-size: .88rem; }
.btn-ghost { background: transparent; box-shadow: none; text-decoration: underline; text-underline-offset: 3px; }
.btn-ghost:active:not(:disabled) { transform: none; }

/* forms */
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field > span { font-weight: 600; font-size: .93rem; }
.field small { color: var(--muted); font-size: .84rem; font-weight: 400; }
.input, select.input, textarea.input {
  width: 100%; min-height: 50px; padding: 10px 16px; border: 1.5px solid var(--line); border-radius: var(--r-md);
  background: var(--card); font-size: 1rem; transition: border-color .15s, box-shadow .15s;
}
textarea.input { min-height: 88px; resize: vertical; }
.input:focus { outline: none; border-color: var(--plum-2); box-shadow: 0 0 0 3px var(--lilac); }
.input.invalid { border-color: var(--danger); box-shadow: 0 0 0 3px #F6DAD8; }

/* segmented switch */
.seg { display: inline-flex; padding: 4px; border-radius: 999px; background: var(--card); gap: 2px; box-shadow: inset 0 0 0 1.5px var(--line); }
.seg button { border: 0; background: transparent; min-height: 40px; padding: 0 18px; border-radius: 999px; font-weight: 600; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--plum); color: #fff; }

/* stepper */
.stepper { display: inline-flex; align-items: center; border-radius: 999px; background: var(--card); box-shadow: inset 0 0 0 1.5px var(--line); }
.stepper button { width: 40px; height: 40px; border: 0; background: transparent; font-size: 1.25rem; font-weight: 600; line-height: 1; color: var(--plum); }
.stepper output { min-width: 26px; text-align: center; font-weight: 700; }

/* bottom sheet */
dialog.sheet {
  border: 0; padding: 0; margin: auto auto 0; width: min(560px, 100%); max-width: 100%; max-height: 92dvh;
  border-radius: var(--r-xl) var(--r-xl) 0 0; background: var(--ivory); color: var(--ink); overflow: hidden;
  box-shadow: 0 -1px 0 var(--gold);
}
dialog.sheet::backdrop { background: rgba(36, 21, 46, .55); }
dialog.sheet[open] { animation: rise .24s cubic-bezier(.2, .8, .2, 1); display: flex; flex-direction: column; }
@media (min-width: 700px) { dialog.sheet { margin: auto; border-radius: var(--r-xl); box-shadow: 0 0 0 1px var(--gold), 0 30px 60px -20px rgba(36, 21, 46, .5); } }
@keyframes rise { from { transform: translateY(48px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

.toast {
  position: fixed; inset-inline: 16px; bottom: 96px; margin: auto; width: fit-content; max-width: calc(100% - 32px);
  background: var(--plum); color: #fff; padding: 12px 20px; border-radius: 999px; font-weight: 600; z-index: 99;
  display: flex; align-items: center; gap: 10px;
}
.toast::before { content: ""; width: 9px; height: 9px; transform: rotate(45deg); background: var(--gold); flex: none; }
.toast[hidden] { display: none; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 12px; border-radius: 999px; font-weight: 500; font-size: .85rem; background: var(--card); box-shadow: inset 0 0 0 1px var(--line); }
.pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--emerald-bright); }
.pill.closed .dot { background: var(--danger); }
.qb { display: inline-grid; place-items: center; min-width: 26px; height: 26px; padding: 0 7px; margin-inline-end: 10px; border-radius: 999px; background: var(--lilac); color: var(--plum); font-weight: 700; font-size: .88rem; }
