/* Raqib consumer app. Shelf-tag motif: the link field is a hang tag; prices read like shelf labels. No web fonts, no inline styles (CSP 'self'). */
:root {
  --paper: #eef0ec; --ink: #1c2b26; --muted: #5e6b65; --card: #f8f9f6; --line: rgba(28, 43, 38, .14);
  --real: #006c35; --suspicious: #9a5b13; --tint: #dfe8e1;
  --sans: "SF Arabic", "Geeza Pro", "Segoe UI", "Noto Sans Arabic", system-ui, Tahoma, sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root { --paper: #141c19; --ink: #e4e8e2; --muted: #9aa69f; --card: #1c2622; --line: rgba(228, 232, 226, .14);
          --real: #5cc98c; --suspicious: #e0a560; --tint: #213229; }
}
* { box-sizing: border-box; }
html { background: var(--paper); -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 17px/1.6 var(--sans); -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
a { color: inherit; text-underline-offset: 4px; text-decoration-thickness: 1px; }
:focus-visible { outline: 2px solid var(--real); outline-offset: 3px; border-radius: 4px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
button { font: inherit; color: inherit; cursor: pointer; }
input { font: inherit; color: inherit; }
bdi { font-variant-numeric: tabular-nums lining-nums; }

.top, main { max-width: 36rem; margin-inline: auto; padding-inline: 16px; }
.top { display: flex; align-items: center; justify-content: space-between; min-height: 72px; }
.brand { font-size: 26px; font-weight: 700; text-decoration: none; letter-spacing: 0; }
[lang="en"] .brand { letter-spacing: -.01em; }
nav { display: flex; gap: 20px; align-items: center; }
nav a { text-decoration: none; }
nav a:hover, .link:hover { text-decoration: underline; }
.link { background: none; border: 0; padding: 10px 0; min-height: 44px; text-align: start; }
.danger { color: #a8434b; }
@media (prefers-color-scheme: dark) { .danger { color: #e8939a; } }

main { padding-block: 5vh 96px; }
.msg { min-height: 1.6em; margin: 0 0 8px; color: var(--muted); }
.msg.err { color: var(--suspicious); }

/* Home: the question is the headline; the tag is the one bold thing. */
.headline { font-size: clamp(40px, 11vw, 64px); line-height: 1.1; font-weight: 800; margin: 0; letter-spacing: -.01em; text-wrap: balance; }
[lang="ar"] .headline { letter-spacing: 0; line-height: 1.25; }
.tagline { font-size: 19px; color: var(--muted); margin: 16px 0 40px; max-width: 30em; text-wrap: pretty; }

.bar { display: flex; gap: 10px; align-items: stretch; }
.tag {
  --notch: 22px;
  position: relative; flex: 1; min-width: 0; display: flex; align-items: center; min-height: 64px;
  background: var(--card); padding-inline: calc(var(--notch) + 24px) 16px;
  clip-path: polygon(var(--notch) 0, 100% 0, 100% 100%, var(--notch) 100%, 0 50%);
  transition: background-color .15s;
}
[dir="rtl"] .tag { clip-path: polygon(0 0, calc(100% - var(--notch)) 0, 100% 50%, calc(100% - var(--notch)) 100%, 0 100%); }
.tag::before { /* the eyelet */
  content: ""; position: absolute; inset-inline-start: calc(var(--notch) - 2px); top: 50%; width: 11px; height: 11px; margin-top: -5.5px;
  border-radius: 50%; background: var(--paper); box-shadow: inset 0 0 0 1.5px var(--line); transition: background-color .15s;
}
.tag:focus-within { background: var(--tint); }
.tag:focus-within::before { background: var(--real); box-shadow: none; }
.tag input { flex: 1; min-width: 0; border: 0; background: none; font-size: 18px; padding: 8px 0; direction: ltr; text-align: left; }
[dir="rtl"] .tag input { text-align: right; }
.tag input:focus-visible { outline: none; }
.tag input::placeholder { color: var(--muted); opacity: .8; }
.go, .solid { border: 0; border-radius: 999px; background: var(--ink); color: var(--paper); font-weight: 600; min-height: 48px; padding: 0 22px; white-space: nowrap; }
.go { border-radius: 14px; padding: 0 26px; }
.go:active, .solid:active { transform: translateY(1px); }

.options { display: grid; gap: 4px; margin-top: 20px; padding-inline-start: 4px; }
.field { display: grid; gap: 6px; margin: 0 0 12px; color: var(--muted); font-size: 15px; }
.field input { color: var(--ink); background: var(--card); border: 1.5px solid var(--line); border-radius: 10px; min-height: 48px; padding: 0 14px; font-size: 18px; width: 100%; }
.field input:focus-visible { outline: none; border-color: var(--real); }
#target { max-width: 12rem; }
.check { display: flex; gap: 12px; align-items: center; min-height: 44px; cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 0; accent-color: var(--real); flex: none; }

.step { margin-top: 36px; padding-top: 24px; border-top: 1.5px dashed var(--line); display: grid; gap: 8px; justify-items: start; }
.step .field { width: 100%; }
.code { letter-spacing: .4em; font-size: 26px !important; max-width: 14rem; font-variant-numeric: tabular-nums; }
.fine { font-size: 14px; color: var(--muted); margin: 8px 0 0; }
#turnstile:empty { display: none; }

/* My items: shelf labels on one strip. */
#view-me h1 { font-size: 34px; line-height: 1.2; margin: 0 0 24px; }
.banner { background: var(--card); border-inline-start: 3px solid var(--suspicious); padding: 12px 16px; margin: 0 0 20px; }
.empty { color: var(--muted); font-size: 19px; }
ul { list-style: none; margin: 0; padding: 0; }
.item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 20px; padding: 20px 0; border-bottom: 1px solid var(--line); }
.item:first-child { border-top: 1px solid var(--line); }
.title { font-weight: 600; text-decoration: none; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.title:hover { text-decoration: underline; }
[dir="ltr"] .title { text-align: left; } [dir="rtl"] .title { text-align: right; } /* dir=auto titles keep the column edge */
.meta { margin: 2px 0 0; font-size: 14px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 14px; }
.meta .state { display: none; }
.paused .meta .state { display: inline; color: var(--suspicious); }
.paused .title, .paused .price { opacity: .5; }
.price { margin: 0; text-align: end; line-height: 1.1; white-space: nowrap; }
.now { font-size: 28px; font-weight: 700; display: block; }
.now .h { font-size: .5em; vertical-align: .75em; margin-inline-start: 1px; }
.now .cur { font-size: .45em; font-weight: 600; margin-inline-start: 6px; color: var(--muted); }
.now.pending { font-size: 15px; font-weight: 400; color: var(--muted); }
s { color: var(--muted); font-size: 15px; }
.chip { justify-self: start; display: inline-block; margin-top: 10px; font-size: 14px; font-weight: 600; padding: 3px 12px; border-radius: 999px; background: var(--tint); }
.chip[data-v="plausible"], .chip[data-v="partial"] { color: var(--real); }
.chip[data-v="suspicious"] { color: var(--suspicious); background: color-mix(in srgb, var(--suspicious) 14%, transparent); }
.why { margin-top: 8px; font-size: 14px; color: var(--muted); }
.why summary { cursor: pointer; min-height: 32px; display: inline-flex; align-items: center; text-decoration: underline; text-underline-offset: 4px; }
.whytext { margin: 4px 0; }
.evidence { font-size: 13px; }
.row { grid-column: 1 / -1; display: flex; gap: 24px; font-size: 15px; color: var(--muted); }
.more { display: inline-block; margin-top: 20px; font-weight: 600; min-height: 44px; }

.settings { margin-top: 48px; border-top: 1px solid var(--line); padding-top: 8px; }
.settings summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; font-weight: 600; }
.settings[open] { display: grid; justify-items: start; }

@media (max-width: 480px) {
  .bar { flex-direction: column; }
  .go { min-height: 52px; }
  .now { font-size: 24px; }
}

/* The one moment: a newly tracked item prints onto the strip; verdicts arrive softly. */
@media (prefers-reduced-motion: no-preference) {
  .item.fresh { animation: print .45s cubic-bezier(.2, .7, .2, 1) both; }
  .chip { animation: fade .3s ease-out both; }
  @keyframes print { from { clip-path: inset(0 0 100% 0); transform: translateY(-6px); } to { clip-path: inset(0 0 0 0); transform: none; } }
  @keyframes fade { from { opacity: 0; } }
}
