* { box-sizing: border-box; }
html { background: var(--cream); -webkit-text-size-adjust: 100%; }
body { margin: 0; color: var(--ink); font-family: var(--font); font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; background: var(--cream); }
html[lang="ar"] body { font-family: var(--font-ar); }
h1, h2, p, ul { margin: 0; } ul { padding: 0; list-style: none; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--saffron-deep); outline-offset: 2px; border-radius: 8px; }
.emo { display: inline-block; width: 1.15em; height: 1.15em; vertical-align: -.2em; }
.muted { color: var(--muted); }

/* top bar */
.top { position: sticky; top: 0; z-index: 50; display: flex; align-items: center; gap: 16px; padding: 12px clamp(16px, 3vw, 32px); background: rgba(246,239,227,.82); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 8px; }
.brand svg { width: 34px; height: 34px; }
.wm { font-family: var(--font); font-weight: 700; font-size: 22px; letter-spacing: -.045em; }
.wm i { font-style: normal; color: var(--saffron); }
.shop { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 14px; }
.shop b { font-weight: 600; }
.top__r { margin-inline-start: auto; display: flex; gap: 8px; align-items: center; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 600; }
.pill--sample { background: var(--ink); color: var(--saffron); letter-spacing: .02em; }
.lang, .ghost { height: 38px; padding: 0 14px; border-radius: 99px; border: 1px solid rgba(30,27,22,.15); background: rgba(255,255,255,.5); font-size: 14px; font-weight: 600; display: inline-flex; align-items: center; }
.lang { font-family: var(--font-ar); min-width: 52px; justify-content: center; }
html[lang="ar"] .lang { font-family: var(--font); }

/* layout */
.grid { display: grid; gap: 16px; padding: 18px clamp(16px, 3vw, 32px) 40px; max-width: 1360px; margin: 0 auto; grid-template-columns: repeat(12, minmax(0, 1fr)); }
.card { grid-column: span 12; position: relative; overflow: hidden; padding: clamp(18px, 2vw, 26px); border-radius: var(--radius); background: var(--paper); border: 1px solid rgba(30,27,22,.06); }
@media (min-width: 1000px) {
  .plan { grid-column: span 7; grid-row: span 2; }
  .events { grid-column: span 5; }
  .offer { grid-column: span 5; }
  .live { grid-column: span 7; }
  .log { grid-column: span 5; }
  .bt { grid-column: span 12; }
  .live { grid-row: auto; }
}
@media (min-width: 1000px) { .grid { grid-template-areas: none; } .offer { grid-row: 2; grid-column: 8 / span 5; } .live { grid-row: 3; grid-column: 1 / span 7; } .log { grid-row: 3; grid-column: 8 / span 5; } }
.card--ink { background: var(--ink); color: var(--cream); border: 0; }
.label { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
html[lang="ar"] .label { letter-spacing: 0; text-transform: none; font-size: 13.5px; }
.label .n { display: inline-grid; place-items: center; min-width: 28px; height: 22px; padding: 0 7px; border-radius: 99px; background: var(--saffron); color: var(--ink); font-size: 11.5px; font-weight: 700; letter-spacing: 0; font-family: var(--font); }
.h { margin-top: 8px; font-weight: 500; font-size: clamp(20px, 1.8vw, 24px); letter-spacing: -.02em; line-height: 1.2; }

/* plan */
.plan__sun { position: absolute; width: 420px; height: 420px; inset-inline-end: -120px; bottom: -140px; opacity: .07; pointer-events: none; }
.plan__top { position: relative; display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.plan__date { margin-top: 8px; font-weight: 600; font-size: clamp(30px, 3.4vw, 46px); letter-spacing: -.035em; line-height: 1; }
html[lang="ar"] .plan__date { letter-spacing: 0; line-height: 1.25; }
.datepick { display: grid; gap: 4px; font-size: 12px; color: #b9b0a2; }
.datepick input { height: 36px; padding: 0 10px; border-radius: 10px; border: 1px solid #3a352d; background: #2a2620; color: var(--cream); color-scheme: dark; }
.conds { position: relative; display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.cond { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px; border-radius: 99px; background: #2a2620; border: 1px solid #3a352d; font-size: 14px; font-weight: 500; }
.cond--on { background: var(--saffron); border-color: var(--saffron); color: var(--ink); }
.cond input[type="number"] { width: 46px; height: 26px; border: 0; border-radius: 6px; background: #1E1B16; color: var(--cream); text-align: center; font-weight: 600; }
.cond button { font-size: 13px; text-decoration: underline; text-underline-offset: 3px; }
.items { position: relative; display: grid; margin-top: 16px; }
.it { display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 4px 14px; padding: 14px 0; border-top: 1px solid #332e27; }
.it:first-child { border-top: 0; }
.it__e { font-size: 24px; line-height: 1; }
.it__e .emo { width: 28px; height: 28px; }
.it__n { font-weight: 600; font-size: 16px; }
.it__r { grid-column: 2 / 4; color: #b9b0a2; font-size: 13.5px; line-height: 1.45; }
.it__q { display: flex; align-items: baseline; gap: 6px; justify-content: flex-end; }
.it__q b { font-size: clamp(30px, 2.8vw, 40px); font-weight: 600; letter-spacing: -.04em; font-variant-numeric: tabular-nums; line-height: 1; }
.it__q small { color: #b9b0a2; font-size: 13px; }
.it__d { display: inline-block; margin-inline-start: 8px; padding: 1px 8px; border-radius: 99px; background: #3a3127; color: var(--saffron); font-size: 12px; font-weight: 600; vertical-align: 2px; }
.it.flash { animation: flash 1.2s; }
@keyframes flash { 0% { background: rgba(242,179,61,.25); } 100% { background: transparent; } }
.plan__foot { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-top: 10px; padding-top: 16px; border-top: 1px solid #332e27; }
.plan__note { color: #b9b0a2; font-size: 13.5px; max-width: 420px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 46px; padding: 0 20px; border-radius: 99px; font-weight: 600; font-size: 15px; transition: transform .4s cubic-bezier(.16,1,.3,1), background .3s; }
.btn:hover { transform: translateY(-2px); }
.btn--sun { background: var(--saffron); color: var(--ink); }
.btn--ink { background: var(--ink); color: var(--cream); }
.btn--line { border: 1px solid rgba(30,27,22,.2); }
.btn--sm { height: 38px; padding: 0 14px; font-size: 14px; }

/* events */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.chip { height: 38px; padding: 0 14px; border-radius: 99px; border: 1px solid rgba(30,27,22,.14); background: #fff; font-size: 14px; font-weight: 500; transition: background .25s, color .25s, border-color .25s; }
.chip:hover { border-color: rgba(30,27,22,.35); }
.chip.on { background: var(--ink); color: var(--cream); border-color: var(--ink); }
.evform { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; margin-top: 14px; }
.evform:empty { display: none; }
.f { display: grid; gap: 4px; font-size: 12px; color: var(--muted); font-weight: 500; }
.f select, .f input { height: 40px; padding: 0 10px; border-radius: 10px; border: 1px solid rgba(30,27,22,.15); background: #fff; font-size: 14px; color: var(--ink); min-width: 0; }
.f input[type="number"] { width: 84px; }
.f--grow { flex: 1 1 150px; }
.f--grow select, .f--grow input { width: 100%; }
.evlist { display: grid; gap: 8px; margin-top: 14px; }
.ev { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: #fff; border: 1px solid var(--line); font-size: 14px; }
.ev b { font-weight: 600; }
.ev__x { margin-inline-start: auto; width: 28px; height: 28px; border-radius: 50%; background: var(--cream); font-size: 12px; }
.evlist:empty::before { content: attr(data-empty); color: var(--muted); font-size: 13.5px; }

/* live */
.live__top { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; }
.clock { display: flex; align-items: center; gap: 10px; }
.clock b { font-size: clamp(26px, 2.6vw, 34px); font-weight: 600; letter-spacing: -.03em; font-variant-numeric: tabular-nums; direction: ltr; }
.play { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--ink); color: var(--saffron); }
.play svg { width: 18px; height: 18px; fill: currentColor; }
.play.on svg path { d: path("M7 5h4v14H7zM13 5h4v14h-4z"); }
.range { width: 100%; margin: 18px 0 2px; accent-color: var(--ink); direction: ltr; }
.range__lbl { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--muted); }
.bars { display: grid; gap: 12px; margin-top: 16px; }
.bar__t { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; margin-bottom: 6px; }
.bar__t b { font-weight: 600; }
.bar__t span { color: var(--muted); font-variant-numeric: tabular-nums; }
.bar__track { position: relative; height: 12px; border-radius: 99px; background: #F1E6D2; overflow: hidden; }
.bar__sold { position: absolute; inset-block: 0; inset-inline-start: 0; border-radius: 99px; background: var(--ink); transition: width .5s cubic-bezier(.16,1,.3,1); }
.bar.out .bar__sold { background: var(--saffron-deep); }
.tag { display: inline-flex; align-items: center; padding: 1px 8px; border-radius: 99px; font-size: 11.5px; font-weight: 600; margin-inline-start: 6px; }
.tag--out { background: #FBE3CF; color: #9A4B12; }
.tag--offer { background: var(--saffron); color: var(--ink); }
.live__sum { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.live__sum b { color: var(--ink); }

/* offer */
.offer__wait { margin-top: 12px; color: var(--muted); }
.offer__wait b { color: var(--ink); }
.ocard { margin-top: 14px; padding: 18px; border-radius: 16px; background: #fff; border: 1px solid var(--line); }
.ocard + .ocard { margin-top: 10px; }
.ocard__big { font-size: clamp(22px, 2vw, 28px); font-weight: 600; letter-spacing: -.025em; line-height: 1.15; }
.ocard__big .emo { width: 1em; height: 1em; }
.ocard__sub { margin-top: 6px; color: var(--muted); font-size: 14px; }
.ocard__deal { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.ocard__pct { padding: 6px 12px; border-radius: 99px; background: var(--saffron); font-weight: 700; font-size: 15px; }
.ocard__price { font-size: 15px; }
.ocard__price s { color: var(--muted); }
.ocard__acts { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.ocard.done { background: #FFF8E8; border-color: #F3D9A0; }
.post { margin-top: 12px; padding: 12px 14px; border-radius: 12px; background: #fff; border: 1px dashed #E1C27A; font-size: 14.5px; }

/* log */
.log__stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; }
.stat { padding: 12px; border-radius: 14px; background: #fff; border: 1px solid var(--line); }
.stat b { display: block; font-size: 22px; font-weight: 600; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.stat span { font-size: 12.5px; color: var(--muted); }
.close { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; margin-top: 14px; padding: 14px; border-radius: 14px; background: var(--cream); }
.close .f select, .close .f input { background: #fff; }
.log__list { display: grid; margin-top: 10px; }
.lrow { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; padding: 9px 2px; border-top: 1px solid var(--line); font-size: 14px; }
.lrow small { color: var(--muted); }
.out { padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 600; }
.out--donated { background: #E6F0DA; color: #3B6D11; }
.out--binned { background: #F6E1DA; color: #8A3A1F; }
.out--staff { background: #EDE6DA; color: #5F564A; }
.out--offer { background: #FCEBC4; color: #7A5410; }

/* backtest */
.btg { display: grid; gap: 14px; margin-top: 16px; }
@media (min-width: 800px) { .btg { grid-template-columns: 1.1fr 1fr 1fr 1fr; } }
.bigstat { padding: 18px; border-radius: 16px; background: var(--ink); color: var(--cream); }
.bigstat b { display: block; font-size: clamp(40px, 4vw, 58px); font-weight: 600; letter-spacing: -.05em; line-height: 1; color: var(--saffron); }
.bigstat span { display: block; margin-top: 8px; font-size: 14px; color: #cfc6b8; }
.cmp { padding: 16px; border-radius: 16px; background: #fff; border: 1px solid var(--line); }
.cmp h3 { margin: 0 0 10px; font-size: 13px; font-weight: 600; color: var(--muted); }
.cmp__row { display: grid; grid-template-columns: 1fr; gap: 3px; margin-top: 8px; font-size: 13px; }
.cmp__bar { height: 10px; border-radius: 99px; background: #E9DFCF; }
.cmp__bar i { display: block; height: 100%; border-radius: 99px; background: #BDB2A2; }
.cmp__row--g .cmp__bar i { background: var(--saffron); }
.cmp__row span { display: flex; justify-content: space-between; }
.bt__note { margin-top: 14px; color: var(--muted); font-size: 13px; max-width: 900px; }
.foot { padding: 0 clamp(16px, 3vw, 32px) 40px; max-width: 1360px; margin: 0 auto; color: var(--muted); font-size: 13px; }

/* modal */
.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; }
.modal[hidden] { display: none; }
.modal__bg { position: absolute; inset: 0; background: rgba(30,27,22,.6); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.modal__box { position: relative; display: grid; justify-items: center; gap: 18px; max-height: 100%; }
.modal__box .wa-phone { transform-origin: top center; }
.modal__x { position: absolute; top: -6px; inset-inline-end: -56px; width: 40px; height: 40px; border-radius: 50%; background: var(--paper); font-size: 14px; }
.modal__note { color: #e9e0d0; font-size: 13px; text-align: center; max-width: 380px; }
@media (max-width: 640px) { .modal__x { inset-inline-end: 0; top: -50px; } }
@media (max-height: 920px) { .modal__box .wa-phone { zoom: .82; } }
@media (max-width: 999px) { .grid { gap: 12px; } }
@media (max-width: 520px) { .log__stats { grid-template-columns: 1fr 1fr 1fr; } .stat b { font-size: 18px; } .it__q b { font-size: 30px; } .shop b { display: none; } }

.sim { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 14px; font-size: 12.5px; color: var(--muted); font-weight: 500; }
.chips--sm { margin-top: 0; gap: 6px; }
.chip--sm { height: 30px; padding: 0 11px; font-size: 13px; }
.wm { direction: ltr; unicode-bidi: isolate; }

/* conditions row: dropdowns and toggles */
.cond--sel { position: relative; padding-inline-end: 6px; cursor: pointer; }
.cond--sel select { appearance: none; -webkit-appearance: none; border: 0; background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 9l6 6 6-6' fill='none' stroke='%23F6EFE3' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 4px center / 14px; color: inherit; font: 500 14px var(--font); padding-inline-end: 22px; cursor: pointer; max-width: 230px; }
html[lang="ar"] .cond--sel select { font-family: var(--font-ar); background-position: left 4px center; }
.cond--sel select option { color: var(--ink); background: #fff; }
.cond--on.cond--sel select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 9l6 6 6-6' fill='none' stroke='%231E1B16' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E"); }
button.cond { cursor: pointer; transition: background .25s, color .25s, border-color .25s; }
.cond--auto { border-style: dashed; }
.cond--reset { background: transparent; text-decoration: underline; text-underline-offset: 3px; border-color: transparent; color: var(--saffron); }
.cond--hint { background: transparent; border-color: transparent; color: #8f8676; font-size: 12.5px; font-weight: 400; }
.it__d--down { background: #2e2a24; color: #d9cfbf; }
