@font-face {
  font-family: "IBM Plex Sans Arabic";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/ibm-plex-sans-arabic-latin-400-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+2000-206F, U+20AC, U+2122;
}
@font-face {
  font-family: "IBM Plex Sans Arabic";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("fonts/ibm-plex-sans-arabic-latin-600-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+2000-206F, U+20AC, U+2122;
}
@font-face {
  font-family: "IBM Plex Sans Arabic";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("fonts/ibm-plex-sans-arabic-latin-700-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+2000-206F, U+20AC, U+2122;
}
@font-face {
  font-family: "IBM Plex Sans Arabic";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/ibm-plex-sans-arabic-arabic-400-normal.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF;
}
@font-face {
  font-family: "IBM Plex Sans Arabic";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("fonts/ibm-plex-sans-arabic-arabic-600-normal.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF;
}
@font-face {
  font-family: "IBM Plex Sans Arabic";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("fonts/ibm-plex-sans-arabic-arabic-700-normal.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF;
}

:root {
  --ink: #14213d;
  --muted: #5c6b7a;
  --line: #e4eaf1;
  --paper: #eef3f8;
  --surface: #fff;
  --accent: #0f6e6b;
  --deep: #0f3d4c;
  --navy: #12324d;
  --coral: #c4492c;
  --mint: #e7f6f4;
  --warn: #9a4d12;
  --warn-bg: #fff6e8;
  --soft: #f2f6fa;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100vh;
  background: radial-gradient(circle at top, #f8fbff, var(--paper) 42%);
  color: var(--ink);
  font-family: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, sans-serif;
}
button { font: inherit; cursor: pointer; }
input, textarea, select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  color: var(--ink);
  padding: 12px;
  font: inherit;
  font-size: 16px;
}
textarea { min-height: 88px; }
#raw { min-height: 140px; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); background: #fff; }
label { display: block; margin: 12px 0 6px; font-size: 12px; font-weight: 700; color: var(--muted); }
.gate {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 24px;
  text-align: center;
  color: #fff;
  background: linear-gradient(180deg, var(--deep), var(--accent));
}
.gate h1 { margin: 0; font-size: clamp(32px, 6vw, 44px); }
.gate p { margin: 0; color: var(--mint); }
.brandline { display: flex; align-items: center; gap: 8px; }
.word { margin: 0; font-size: 32px; font-weight: 700; letter-spacing: 0.18em; }
.logo { width: 56px; height: 46px; }
.logo.sm { width: 48px; height: 40px; }
.langbtn {
  width: min(440px, 100%);
  border: 0;
  border-radius: 18px;
  padding: 22px 16px;
  background: var(--navy);
  color: #fff;
  font-size: clamp(28px, 6vw, 36px);
  font-weight: 700;
}
.langbtn.install { background: #fff; color: #0f3d4c; text-decoration: none; display: block; text-align: center; }
#langgate { position: fixed; inset: 0; z-index: 80; }
body.ready #langgate { display: none; }
body:not(.ready) #shell { display: none; }
header {
  background: linear-gradient(135deg, var(--deep), var(--accent));
  color: #fff;
  padding: 18px 16px;
}
.top { max-width: 1040px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
header p { max-width: 1040px; margin: 10px auto 0; color: var(--mint); font-size: 14px; line-height: 1.6; }
.pill { border: 1px solid rgba(255,255,255,.45); background: transparent; color: #fff; border-radius: 999px; padding: 8px 14px; font-weight: 700; }
.trial { background: var(--warn-bg); color: var(--warn); text-align: center; padding: 8px 12px; font-size: 14px; font-weight: 700; }
main { width: min(1040px, 100%); margin: 0 auto; padding: 16px; display: grid; gap: 16px; }
@media (min-width: 980px) {
  main { grid-template-columns: minmax(320px, 430px) 1fr; align-items: start; }
  .form { position: sticky; top: 16px; }
}
.card { background: #fff; border: 1px solid var(--line); border-radius: 22px; padding: 16px; box-shadow: 0 12px 30px rgba(20,33,61,.06); }
h2 { margin: 16px 0 8px; font-size: 18px; color: var(--deep); }
h2:first-child { margin-top: 0; }
.lead { color: var(--muted); font-size: 14px; line-height: 1.5; margin: 0 0 10px; }
.actions, .pair { display: grid; gap: 8px; }
.pair { grid-template-columns: 1fr 1fr; }
@media (max-width: 640px) { .pair { grid-template-columns: 1fr; } }
.actions { margin-top: 12px; }
button.primary, button.navy, button.soft, button.wide, button.red, button.yellow {
  border: 0;
  border-radius: 12px;
  min-height: 48px;
  padding: 12px;
  font-weight: 700;
  font-size: 16px;
}
.primary { background: var(--accent); color: #fff; }
.navy { background: var(--navy); color: #fff; }
.red { background: #c4492c; color: #fff; }
.yellow { background: #f5c518; color: #1a1a1a; border-color: #e0b000; }
.soft { background: var(--soft); color: var(--navy); }
.wide { width: 100%; margin-top: 12px; }
.status { color: var(--accent); font-weight: 700; font-size: 14px; min-height: 1.2em; }
.warnings { margin: 8px 0 0; padding: 0 18px; color: #d32f2f; font-weight: 700; font-size: 14px; }
.found { margin-top: 12px; border: 1px solid var(--line); background: var(--paper); border-radius: 12px; padding: 12px; }
.found p { margin: 0 0 8px; color: var(--accent); font-size: 12px; font-weight: 700; }
.found dt { font-size: 12px; color: var(--muted); font-weight: 700; }
.found dd { margin: 0 0 8px; font-weight: 650; }
.paywall { position: fixed; inset: 0; background: rgba(15,61,76,.62); display: none; align-items: center; justify-content: center; z-index: 20; padding: 16px; }
.paywall.show { display: flex; }
.paycard { width: min(440px, 100%); background: #fff; border-radius: 22px; padding: 20px; text-align: center; }
html[lang="en"] .paycard { direction: ltr; }
html[lang="ar"] .paycard { direction: rtl; }
.price { font-size: 28px; font-weight: 700; color: var(--accent); margin: 8px 0 12px; }
.label { width: 100%; max-width: 760px; margin-inline: auto; overflow: hidden; border: 1px solid #d7e4ea; border-radius: 18px; background: #fff; box-shadow: 0 10px 28px rgba(15,61,76,.12); }
.label-head { display: flex; justify-content: space-between; gap: 10px; padding: 16px 18px; color: #fff; background: linear-gradient(135deg, var(--deep), var(--accent)); }
.label-brand { font-size: clamp(16px, 4vw, 22px); font-weight: 700; word-break: break-word; }
.label-sub { margin-top: 4px; font-size: 12px; opacity: .85; }
.label-pill { align-self: center; border: 1px solid rgba(255,255,255,.7); border-radius: 999px; background: rgba(255,255,255,.12); padding: 6px 10px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.label-block { padding: 16px 18px 6px; }
.label-tag { font-size: 11px; font-weight: 700; color: var(--accent); }
.label-who { margin-top: 4px; font-size: clamp(22px, 4vw, 32px); font-weight: 700; line-height: 1.2; overflow-wrap: anywhere; }
.label-phone { display: inline-block; margin-top: 8px; border-radius: 10px; background: var(--mint); padding: 7px 12px; color: var(--deep); font-size: clamp(16px, 3vw, 22px); font-weight: 700; direction: ltr; unicode-bidi: isolate; }
.label-addrbox { margin: 12px 16px; border: 1px solid #d5ebe8; border-radius: 14px; background: #f7fbfb; padding: 14px; }
.label-addr { margin-top: 4px; font-size: clamp(22px, 3.4vw, 28px); font-weight: 700; line-height: 1.35; color: #111; white-space: pre-wrap; overflow-wrap: anywhere; }
.label-city { margin-top: 8px; color: var(--deep); font-size: clamp(18px, 3vw, 24px); font-weight: 700; }
.label-country { margin-top: 4px; color: var(--coral); font-size: 12px; font-weight: 700; letter-spacing: .2em; }
.label-note { margin-top: 8px; font-size: 14px; }
.label-split { display: grid; grid-template-columns: 1.4fr .8fr; }
.label-cell { padding: 14px 18px 16px; }
.label-cell + .label-cell { background: #fff8f3; }
.label-cod { margin-top: 4px; color: var(--coral); font-size: clamp(20px, 4vw, 28px); font-weight: 700; direction: ltr; }
.label-mark { display: flex; align-items: center; justify-content: center; gap: 8px; border-top: 1px solid var(--line); padding: 8px; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .2em; }
body.ticket .label { max-width: 320px; border-radius: 12px; }
body.ticket-58 .label { max-width: 220px; }
body.ticket .label-head { color: #111; background: #fff; border-bottom: 2px solid #111; }
body.ticket .label-pill { border: 1px solid #111; background: #fff; color: #111; }
body.ticket .label-phone, body.ticket .label-addrbox, body.ticket .label-cell + .label-cell { border-color: #111; background: #fff; color: #111; }
body.ticket .label-tag, body.ticket .label-city, body.ticket .label-cod, body.ticket .label-country { color: #111; }
body.ticket .label-split { grid-template-columns: 1fr; }
body.ticket .label-cell + .label-cell { border-top: 1px solid #111; }
@media (max-width: 640px) {
  .label-split { grid-template-columns: 1fr; }
  .label-cell + .label-cell { border-top: 1px solid var(--line); }
}
@media print {
  .no-print, #langgate, #authgate, #paywall { display: none !important; }
  body { background: #fff; }
  main, section, .card { display: block; border: 0 !important; background: transparent !important; padding: 0 !important; box-shadow: none !important; }
  .label { max-width: none; margin: 8mm; box-shadow: none; }
  body.ticket .label { margin: 2mm; }
  .label-addr { font-size: 22pt; font-weight: 700; color: #000; line-height: 1.3; }
}

html[lang="en"] .label-who,
html[lang="en"] .label-addr,
html[lang="en"] .label-city,
html[lang="en"] .label-phone {
  overflow-wrap: anywhere;
  word-break: break-word;
}
html[lang="en"] .label-phone,
html[lang="en"] .label-city,
html[lang="en"] .label-addr {
  direction: ltr;
  unicode-bidi: isolate;
}

/* === FIXES v2 === */
/* Phone number always LTR even in RTL mode */
.label-phone { direction: ltr !important; unicode-bidi: isolate !important; }

/* Label pill RED */
.label-pill { background: #c4492c !important; border-color: #c4492c !important; color: #fff !important; }

/* AI parse button */
.ai-btn { background: linear-gradient(135deg, #0f6e6b, #0f3d4c); color:#fff; position:relative; overflow:hidden; }
.ai-btn::after { content:'✨'; position:absolute; right:14px; top:50%; transform:translateY(-50%); font-size:18px; }

.top-actions { display:flex; align-items:center; gap:8px; }
.subscribe-pill { background:#f5c518; color:#1a1a1a; border-color:#e0b000; font-weight:700; }
#btnLangTop { background:#d32f2f; color:#fff; border-color:#d32f2f; }
.payment-option { margin:12px 0; padding:12px; border:1px solid #d7e4ea; border-radius:14px; background:#fbfdfd; }
.payment-option > strong { display:block; margin-bottom:8px; }
#paypal-button-container, #card-button-container { min-height:42px; }
.pay-link{display:flex;align-items:center;justify-content:center;text-decoration:none;text-align:center;min-height:48px;margin-top:16px;cursor:pointer}
.pay-hint{font-size:13px;line-height:1.7;opacity:.75;margin:10px 0 0;text-align:center}

/* Installed app (desktop/phone) keeps top button colors */
#btnSubscribe.subscribe-pill,
#btnLangTop {
  -webkit-appearance: none;
  appearance: none;
  opacity: 1;
}
#btnSubscribe.subscribe-pill {
  background: #f5c518 !important;
  color: #1a1a1a !important;
  border-color: #e0b000 !important;
}
#btnLangTop {
  background: #d32f2f !important;
  color: #fff !important;
  border-color: #d32f2f !important;
}
@media (display-mode: standalone), (display-mode: fullscreen), (display-mode: window-controls-overlay) {
  #btnSubscribe.subscribe-pill {
    background: #f5c518 !important;
    color: #1a1a1a !important;
    border-color: #e0b000 !important;
  }
  #btnLangTop {
    background: #d32f2f !important;
    color: #fff !important;
    border-color: #d32f2f !important;
  }
}

