@font-face {
  font-family: Inter;
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/inter-latin-400.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: Inter;
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/fonts/inter-latin-700.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: Inter;
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url("/fonts/inter-latin-800.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Noto Sans Arabic";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/noto-sans-arabic-400.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}

@font-face {
  font-family: "Noto Sans Arabic";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/fonts/noto-sans-arabic-700.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}

@font-face {
  font-family: "Noto Sans Arabic";
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url("/fonts/noto-sans-arabic-800.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}

:root {
  --cream: #f4efe4;
  --cream-deep: #ebe4d4;
  --paper: #faf6ee;
  --ink: #1a1a18;
  --ink-soft: #3d3d38;
  --pitch: #1f7a3f;
  --pitch-deep: #165c2f;
  --have: #145c2e;
  --have-bg: #d4edda;
  --need: #8d2218;
  --need-bg: #fde8e6;
  --line: #d4cdb8;
  --white: #ffffff;
  color: var(--ink);
  background: var(--cream);
  font-family: Inter, "Noto Sans Arabic", sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

*,
*::before,
*::after { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--cream);
  color: var(--ink);
}

[hidden] { display: none !important; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

img, svg, video { max-width: 100%; }

.skip {
  position: absolute;
  inset-inline-start: 12px;
  top: -80px;
  background: var(--white);
  color: var(--ink);
  padding: 10px 14px;
  z-index: 40;
  min-height: 44px;
  min-width: 44px;
}

.skip:focus { top: 12px; }

.wrap {
  width: min(40rem, 100%);
  margin-inline: auto;
  padding: 12px 16px 48px;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 56px;
  flex-wrap: wrap;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  color: var(--ink);
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: -0.05em;
  text-decoration: none;
}

.wordmark img {
  width: 40px;
  height: 40px;
  display: block;
}

.wordmark .name {
  color: var(--ink);
  letter-spacing: -0.05em;
}

.wordmark .name span { color: var(--pitch); }

.lang select {
  min-height: 44px;
  min-width: 44px;
  max-width: 46vw;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  border-radius: 999px;
  padding: 0 14px;
  font: inherit;
  font-weight: 700;
  font-size: 16px;
}

h1 {
  margin: 8px 0 12px;
  font-size: clamp(2rem, 8vw, 3.25rem);
  line-height: 1.05;
  letter-spacing: -0.045em;
  font-weight: 800;
}

.lede {
  margin: 0 0 20px;
  font-size: 1.05rem;
  color: var(--ink-soft);
  max-width: 38rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  min-width: 44px;
  padding: 12px 18px;
  border-radius: 14px;
  font: inherit;
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  touch-action: manipulation;
}

.btn:disabled {
  opacity: 0.45;
  cursor: default;
}

.btn-primary {
  background: var(--pitch);
  color: var(--white);
}

.btn-primary:hover:not(:disabled) { background: var(--pitch-deep); }

.btn-secondary {
  background: var(--paper);
  color: var(--ink);
  border-color: var(--line);
}

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}

.hero-cta { width: 100%; }

@media (min-width: 721px) {
  .hero-cta { width: auto; }
}

.disclaimer {
  margin: 16px 0 0;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.steps {
  margin-top: 28px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 8px 18px 18px;
}

.steps h2 {
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 16px 0 8px;
}

.steps ol {
  list-style: none;
  margin: 0;
  padding: 0;
}

.steps ol { counter-reset: step; }

.steps li {
  counter-increment: step;
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 12px;
  align-items: start;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.steps li::before {
  content: counter(step);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--pitch);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
}

.steps h3 {
  margin: 0;
  font-size: 1.05rem;
}

.steps p {
  margin: 4px 0 0;
  color: var(--ink-soft);
}

.site-footer {
  margin-top: 28px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  align-items: center;
}

.site-footer a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  min-width: 44px;
  color: var(--pitch-deep);
  font-weight: 700;
}

.sticky-cta { display: none; }

@media (max-width: 720px) {
  body.home { padding-bottom: calc(78px + env(safe-area-inset-bottom)); }
  .sticky-cta {
    display: block;
    position: fixed;
    inset-inline: 0;
    bottom: 0;
    z-index: 20;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
    background: var(--cream);
    border-top: 1px solid var(--line);
  }
  .sticky-cta .btn { width: 100%; }
}

.page-title {
  font-size: clamp(1.8rem, 6vw, 2.4rem);
  margin-top: 12px;
}

.prose h2 {
  font-size: 1.15rem;
  margin: 1.4rem 0 0.4rem;
}

.prose p,
.prose li { color: var(--ink-soft); }

.prose ul { padding-inline-start: 1.2rem; }

.prose a {
  color: var(--pitch-deep);
  font-weight: 700;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.miss {
  margin: 12px 0 0;
  font-size: 3rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--pitch);
  line-height: 1;
}

.intro {
  margin: 0 0 16px;
  color: var(--ink-soft);
}

.banner {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 16px;
}

.banner p { margin: 0 0 8px; }

.field { margin-bottom: 16px; }

.field label {
  display: block;
  font-weight: 700;
  margin-bottom: 4px;
}

.hint {
  margin: 0 0 8px;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.example { font-weight: 700; color: var(--ink); }

textarea,
input[type="url"],
input[type="text"] {
  width: 100%;
  border: 1.5px solid var(--line);
  background: var(--white);
  color: var(--ink);
  border-radius: 12px;
  padding: 12px;
  font: inherit;
  font-size: 16px;
  min-height: 48px;
}

textarea { min-height: 96px; resize: vertical; }

textarea[aria-invalid="true"],
input[aria-invalid="true"] { border-color: var(--need); }

.error {
  color: var(--need);
  font-weight: 700;
  margin: 8px 0 0;
}

.grid-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  margin-top: 8px;
}

.grid-head h2 { font-size: 1.15rem; margin: 0; }

.legend {
  display: flex;
  gap: 12px;
  margin: 8px 0;
  font-size: 0.85rem;
  font-weight: 700;
}

.legend i {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 3px;
  margin-inline-end: 6px;
}

.lg-have { background: var(--have-bg); border: 1px solid var(--pitch); }
.lg-need { background: var(--need-bg); border: 1px solid var(--need); }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(44px, 1fr));
  gap: 8px;
}

.cell {
  min-height: 44px;
  min-width: 44px;
  border-radius: 10px;
  font: inherit;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  touch-action: manipulation;
}

.cell.have {
  background: var(--have-bg);
  color: var(--have);
  border: 1px solid var(--pitch);
}

.cell.need {
  background: var(--need-bg);
  color: var(--need);
  border: 1px solid var(--need);
}

.cell.conflict { outline: 2px solid var(--need); }

.counts { font-weight: 700; margin: 12px 0 0; }

.saved { margin: 4px 0 0; color: var(--ink-soft); }

.actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
}

.actions .btn { width: 100%; }

.qr-frame {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px;
  width: min(100%, 320px);
  margin: 12px auto;
}

.qr-frame svg { width: 100%; height: auto; display: block; }

.share-link {
  display: block;
  margin: 8px 0 12px;
  color: var(--pitch-deep);
  font-weight: 700;
  overflow-wrap: anywhere;
  min-height: 44px;
}

.status { min-height: 1.5em; font-weight: 700; }

.panel {
  background: var(--paper);
  border: 1px dashed var(--line);
  border-radius: 14px;
  padding: 14px;
  margin: 12px 0;
}

.panel h2 { margin: 0 0 6px; font-size: 1.2rem; }

.panel p { margin: 0; color: var(--ink-soft); }

.swap-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 12px 0;
}

.swap-col {
  background: var(--paper);
  border-radius: 14px;
  padding: 12px;
  border: 1px solid var(--line);
}

.swap-col.give { border-color: var(--pitch); }
.swap-col.get { border-color: var(--need); }

.swap-col h2 {
  margin: 0 0 8px;
  font-size: 1rem;
}

.num-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  min-width: 36px;
  padding: 4px 8px;
  margin: 0 6px 6px 0;
  border-radius: 8px;
  background: var(--white);
  border: 1px solid var(--line);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.give .num-chip { background: var(--have-bg); color: var(--have); border-color: var(--pitch); }
.get .num-chip { background: var(--need-bg); color: var(--need); border-color: var(--need); }

.empty-side { margin: 0; color: var(--ink-soft); }

#scan-video {
  width: 100%;
  max-height: 240px;
  background: var(--ink);
  border-radius: 12px;
  margin: 8px 0;
}

.lang-error { color: var(--need); font-weight: 700; }

:focus-visible {
  outline: 3px solid var(--pitch);
  outline-offset: 2px;
}

:focus:not(:focus-visible) {
  outline: none;
}

@media (forced-colors: active) {
  .btn { border: 1px solid ButtonText; }
}
