/* Public site styles. Palette from the Omani flag and the logo: white base, green for actions, red for highlights. */
:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-2: #f6f7f6;
  --ink: #1a1d1b;
  --muted: #5f6661;
  --line: #e4e7e5;
  --green: #0e7a3a;
  --green-dark: #0a5f2d;
  --green-soft: #eaf5ee;
  --red: #c8102e;
  --red-dark: #a00d25;
  --red-soft: #fcebee;
  --amber: #8a5a00;
  --amber-soft: #fbf4e4;
  --lock: #5f6661;
  --lock-soft: #f3f4f3;
  --font-body: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, sans-serif;
  --font-display: "Reem Kufi", "IBM Plex Sans Arabic", Tahoma, sans-serif;
  --r: 10px;
  color-scheme: light;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font-body); font-size: 15px; line-height: 1.7; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--green); }
a:hover { color: var(--green-dark); }
:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
h1, h2, h3 { text-wrap: balance; margin: 0; line-height: 1.35; font-weight: 700; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
[hidden] { display: none !important; }

.wrap { max-width: 960px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }

/* header: a thin flag stripe, then logo and links */
.site { background: var(--surface); border-bottom: 1px solid var(--line); }
.site::before { content: ""; display: block; height: 4px; background: linear-gradient(to left, var(--red) 0 33.4%, #fff 33.4% 66.6%, var(--green) 66.6%); border-bottom: 1px solid var(--line); }
.site .wrap { display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; padding-block: 12px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand .logo { width: 36px; height: 36px; display: block; }
.brand b { font-family: var(--font-display); font-size: 20px; font-weight: 700; color: var(--ink); }
.nav { display: flex; gap: 4px 6px; flex-wrap: wrap; align-items: center; }
.nav a { padding: 6px 12px; border-radius: 8px; text-decoration: none; color: var(--ink); font-size: 14px; }
.nav a:hover { background: var(--surface-2); color: var(--ink); }
.nav a.primary { background: var(--red); color: #fff; font-weight: 600; }
.nav a.primary:hover { background: var(--red-dark); }

main { padding-block: 24px 56px; }
.stack { display: flex; flex-direction: column; gap: 18px; }
.crumbs { font-size: 13px; color: var(--muted); display: flex; gap: 6px; flex-wrap: wrap; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--green); }

/* hero: white, with the title and search */
.hero { padding: 8px 0 4px; display: flex; flex-direction: column; gap: 12px; }
.hero h1 { font-family: var(--font-display); font-size: clamp(24px, 6vw, 34px); }
.hero h1 em { font-style: normal; color: var(--green); }
.hero p { margin: 0; color: var(--muted); max-width: 60ch; }
form.search { flex-direction: row; gap: 8px; }
.search input { flex: 1; min-width: 0; border: 1px solid var(--line); border-radius: var(--r); padding: 11px 14px; background: var(--surface); }
.search input:focus { border-color: var(--green); outline: none; box-shadow: 0 0 0 3px var(--green-soft); }
.search button { border: 0; border-radius: var(--r); padding: 10px 20px; background: var(--green); color: #fff; font-weight: 600; cursor: pointer; }
.search button:hover { background: var(--green-dark); }
.facts { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; color: var(--muted); }
.facts b { color: var(--ink); }

.sec-title { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.sec-title h2 { font-size: 18px; }

.cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.cat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; display: flex; flex-direction: column; gap: 4px; }
.cat:hover { border-color: var(--green); }
.cat .ic { width: 34px; height: 34px; border-radius: 8px; background: var(--green-soft); color: var(--green); display: grid; place-items: center; }
.cat b { font-size: 16px; }

/* group rows */
.list { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.row { background: var(--surface); border-bottom: 1px solid var(--line); padding: 12px 14px; display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; align-items: center; width: 100%; }
.row:last-child { border-bottom: 0; }
a.row:hover { background: var(--surface-2); }
.row.featured { box-shadow: inset -3px 0 0 var(--red); }
.row .t { font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.row .meta { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 2px 12px; font-size: 13px; color: var(--muted); }
.row.locked { background: var(--lock-soft); }
.blur { display: inline-block; height: 11px; border-radius: 6px; background: var(--lock); opacity: .2; vertical-align: middle; }
.card .list { border-radius: 8px; }

.pill { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; padding: 1px 9px; border-radius: 999px; white-space: nowrap; }
.pill.ok { background: var(--green-soft); color: var(--green); }
.pill.warn { background: var(--amber-soft); color: var(--amber); }
.pill.bad { background: var(--red-soft); color: var(--red); }
.pill.gold { background: var(--red-soft); color: var(--red); }
.pill.acc { background: var(--green-soft); color: var(--green); }
.pill.lock { background: var(--lock-soft); color: var(--lock); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; display: inline-block; }

.callout { border: 1px solid var(--line); border-radius: var(--r); padding: 16px; display: flex; flex-direction: column; gap: 8px; background: var(--surface); }
.callout.lock { background: linear-gradient(var(--red), var(--red)) right / 3px 100% no-repeat, var(--surface); }
.callout.lock h3 svg { color: var(--red); }
.callout.info { background: var(--surface-2); border-color: transparent; }
.callout.warn { background: var(--amber-soft); border-color: transparent; }
.callout h3 { font-size: 16px; display: flex; align-items: center; gap: 6px; }

.btn { border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 8px; padding: 9px 16px; cursor: pointer; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 6px; text-decoration: none; }
.btn:hover { border-color: var(--muted); color: var(--ink); }
.btn.primary { background: var(--green); color: #fff; border-color: var(--green); }
.btn.primary:hover { background: var(--green-dark); border-color: var(--green-dark); color: #fff; }
.btn.gold, .btn.red { background: var(--red); color: #fff; border-color: var(--red); }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--red); border-color: var(--red); background: transparent; }
.btn.sm { padding: 4px 10px; font-size: 13px; }
.btns { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.detail-head { display: flex; gap: 14px; align-items: flex-start; }
.avatar { flex: none; width: 52px; height: 52px; border-radius: 12px; background: var(--green-soft); color: var(--green); display: grid; place-items: center; font-family: var(--font-display); font-size: 22px; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; font-size: 14px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.check { display: flex; gap: 10px; align-items: flex-start; background: var(--green-soft); border-radius: 8px; padding: 12px; }
.check svg { flex: none; color: var(--green); margin-top: 3px; }
.linkbox { font-family: ui-monospace, Menlo, monospace; direction: ltr; text-align: left; background: var(--surface-2); padding: 8px 12px; border-radius: 8px; overflow-wrap: anywhere; font-size: 13px; }

/* forms */
form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field label { font-weight: 600; font-size: 14px; }
.field .hint { font-size: 12px; color: var(--muted); }
.field input, .field select, .field textarea { border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 9px 12px; width: 100%; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--green); outline: none; box-shadow: 0 0 0 3px var(--green-soft); }
.field input[dir="ltr"] { text-align: left; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.plan { border: 1px solid var(--line); border-radius: var(--r); padding: 14px; cursor: pointer; display: flex; flex-direction: column; gap: 4px; background: var(--surface); }
.plan:has(input:checked) { border-color: var(--green); box-shadow: 0 0 0 2px var(--green-soft); }
.plan input { accent-color: var(--green); }
.plan .price { font-size: 20px; font-weight: 700; color: var(--red); }
.plan .price .small { color: var(--muted); font-weight: 400; }
.drop { border: 2px dashed var(--line); border-radius: var(--r); padding: 18px; text-align: center; color: var(--muted); }
.success { text-align: center; align-items: center; }
.success .big { width: 56px; height: 56px; border-radius: 50%; background: var(--green-soft); color: var(--green); display: grid; place-items: center; }
.steps { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; font-size: 13px; }

.empty { text-align: center; padding: 28px; color: var(--muted); }
.chk { display: flex; align-items: center; gap: 8px; }
.chk input { width: 18px; height: 18px; accent-color: var(--green); }
.flash { border-radius: var(--r); padding: 10px 14px; }
.flash.ok { background: var(--green-soft); color: var(--green); }
.flash.bad { background: var(--red-soft); color: var(--red); }
.err { color: var(--red); font-size: 12px; }
.narrow { max-width: 460px; margin-inline: auto; width: 100%; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--green); cursor: pointer; font: inherit; }
details summary { cursor: pointer; color: var(--muted); font-size: 13px; }
a.cat, a.row { color: inherit; text-decoration: none; }

/* pagination */
.pager { display: flex; gap: 6px; justify-content: center; align-items: center; flex-wrap: wrap; font-size: 14px; }
.pager a, .pager span { min-width: 36px; text-align: center; border: 1px solid var(--line); border-radius: 8px; padding: 5px 10px; background: var(--surface); color: var(--ink); text-decoration: none; }
.pager a:hover { border-color: var(--green); color: var(--green); }
.pager .cur { background: var(--green); border-color: var(--green); color: #fff; font-weight: 600; }
.pager .off { color: var(--muted); opacity: .6; }
.pager .gap { border: 0; min-width: 0; padding-inline: 2px; color: var(--muted); }
.pager-info { text-align: center; font-size: 12px; color: var(--muted); margin-top: -8px; }

footer { border-top: 1px solid var(--line); padding-block: 20px; font-size: 12px; color: var(--muted); }
footer .links { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 8px; }
footer a { color: var(--muted); }
footer a:hover { color: var(--green); }

/* visitor filters */
form.filters { flex-direction: row; flex-wrap: wrap; align-items: flex-end; gap: 10px 12px; }
.filters .field { min-width: 150px; flex: 1 1 150px; max-width: 240px; }
