/* مُخطّط — سوق الأراضي العُماني | © 2026 TGTEC */

:root {
  --brand: #0b5d4b;
  --brand-600: #084a3c;
  --brand-50: #e8f3ef;
  --brand-100: #cfe7de;
  --gold: #c9973f;
  --gold-600: #a97b2c;
  --gold-50: #faf3e6;
  --ink: #13201c;
  --ink-2: #33433e;
  --muted: #5f706a;
  --line: #e1e8e5;
  --bg: #f5f7f6;
  --card: #ffffff;
  --ok: #15803d;
  --ok-bg: #e7f6ec;
  --warn: #b45309;
  --warn-bg: #fdf3e2;
  --bad: #b91c1c;
  --bad-bg: #fdecec;
  --sold: #64748b;
  --sold-bg: #eef1f5;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(15, 30, 25, .05), 0 6px 22px rgba(15, 30, 25, .06);
  --shadow-lg: 0 10px 40px rgba(15, 30, 25, .14);
  --font: "IBM Plex Sans Arabic", system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --brand: #22a07f;
    --brand-600: #1b8a6c;
    --brand-50: #10251f;
    --brand-100: #173a31;
    --gold: #d9ab55;
    --gold-600: #c49440;
    --gold-50: #2a2213;
    --ink: #e7efec;
    --ink-2: #c3d0cb;
    --muted: #93a6a0;
    --line: #23302c;
    --bg: #0c1311;
    --card: #121b18;
    --ok-bg: #11291b;
    --warn-bg: #2b2010;
    --bad-bg: #2d1414;
    --sold-bg: #1b2229;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 22px rgba(0, 0, 0, .25);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
}
img { max-width: 100%; display: block; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.3; margin: 0 0 .5em; color: var(--ink); }
h1 { font-size: clamp(1.6rem, 3.6vw, 2.5rem); font-weight: 700; }
h2 { font-size: clamp(1.25rem, 2.4vw, 1.6rem); font-weight: 700; }
h3 { font-size: 1.05rem; font-weight: 600; }
p { margin: 0 0 1em; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 6px; }
.sr, .skip:not(:focus) { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip:focus { position: fixed; top: 8px; right: 8px; z-index: 1000; background: var(--card); padding: 8px 14px; border-radius: 8px; box-shadow: var(--shadow-lg); }
.wrap { width: 100%; max-width: 1200px; margin-inline: auto; padding-inline: 16px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.ltr { direction: ltr; unicode-bidi: isolate; display: inline-block; }
.num { font-variant-numeric: tabular-nums; }
.ic { width: 1.1em; height: 1.1em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: -.18em; flex: none; }
.stack > * + * { margin-top: 16px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
hr { border: 0; border-top: 1px solid var(--line); margin: 20px 0; }

/* ------------------------------------------------ الشريط العلوي */
.topbar { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--card) 88%, transparent); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.topbar-in { display: flex; align-items: center; gap: 16px; min-height: 66px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text b { font-size: 1.3rem; font-weight: 700; letter-spacing: -.01em; }
.brand-text small { color: var(--muted); font-size: .74rem; }
.nav { display: flex; align-items: center; gap: 4px; margin-inline-start: auto; }
.nav a:not(.btn) { color: var(--ink-2); padding: 8px 12px; border-radius: 10px; font-weight: 500; font-size: .95rem; }
.nav a:not(.btn):hover { background: var(--brand-50); color: var(--brand); text-decoration: none; }
.nav a[aria-current="page"]:not(.btn) { color: var(--brand); background: var(--brand-50); }
.nav-sep { width: 1px; height: 24px; background: var(--line); margin-inline: 6px; }
.nav-user { display: inline-flex; align-items: center; gap: 8px; }
.avatar { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--brand); color: #fff; font-weight: 600; font-size: .85rem; }
.avatar-lg { width: 44px; height: 44px; font-size: 1.1rem; }
.nav-toggle { display: none; margin-inline-start: auto; background: none; border: 1px solid var(--line); border-radius: 10px; width: 44px; height: 40px; padding: 10px; cursor: pointer; flex-direction: column; justify-content: space-between; }
.nav-toggle span:not(.sr) { display: block; height: 2px; background: var(--ink); border-radius: 2px; }
@media (max-width: 900px) {
  .nav-toggle { display: flex; }
  .nav { display: none; position: absolute; inset-inline: 0; top: 66px; background: var(--card); border-bottom: 1px solid var(--line); flex-direction: column; align-items: stretch; padding: 12px 16px 16px; box-shadow: var(--shadow-lg); }
  .nav.open { display: flex; }
  .nav-sep { display: none; }
  .nav .btn { margin-top: 8px; }
}

/* ------------------------------------------------ الأزرار */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 18px; border-radius: 12px; border: 1px solid transparent; font: inherit; font-weight: 600; font-size: .95rem; cursor: pointer; text-decoration: none !important; transition: background .15s, border-color .15s, transform .05s; white-space: nowrap; background: var(--card); color: var(--ink); border-color: var(--line); }
.btn:active { transform: translateY(1px); }
.btn:hover { border-color: var(--brand-100); background: var(--brand-50); }
.btn-primary { background: var(--brand); color: #fff; border-color: var(--brand); }
.btn-primary:hover { background: var(--brand-600); border-color: var(--brand-600); }
.btn-gold { background: var(--gold); color: #1b1408; border-color: var(--gold); }
.btn-gold:hover { background: var(--gold-600); border-color: var(--gold-600); }
.btn-wa { background: #128c4a; color: #fff; border-color: #128c4a; }
.btn-wa:hover { background: #0e7a40; border-color: #0e7a40; }
.btn-danger { color: var(--bad); }
.btn-danger:hover { background: var(--bad-bg); border-color: var(--bad); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-sm { min-height: 36px; padding: 6px 12px; font-size: .875rem; border-radius: 10px; }
.btn-block { width: 100%; }
.btn-icon { width: 44px; padding: 0; }
.linklike { background: none; border: 0; padding: 8px 12px; color: var(--bad); font: inherit; cursor: pointer; text-align: start; width: 100%; border-radius: 10px; }
.linklike:hover { background: var(--bad-bg); }

/* ------------------------------------------------ الواجهة الرئيسية */
.hero { position: relative; overflow: hidden; color: #fff; background: linear-gradient(135deg, #062e25 0%, #0b5d4b 55%, #0f6f59 100%); }
.hero::before { content: ""; position: absolute; inset: 0; opacity: .14;
  background-image: linear-gradient(rgba(255,255,255,.6) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.6) 1px, transparent 1px);
  background-size: 46px 46px; mask-image: radial-gradient(ellipse at 30% 40%, #000 20%, transparent 75%); }
.hero-in { position: relative; padding-block: clamp(40px, 7vw, 84px) clamp(36px, 6vw, 64px); display: grid; gap: 28px; grid-template-columns: 1.2fr .8fr; align-items: center; }
.hero h1 { color: #fff; font-size: clamp(1.8rem, 4.4vw, 3rem); margin-bottom: .35em; }
.hero h1 em { font-style: normal; color: var(--gold); }
.hero p.lead { font-size: clamp(1rem, 1.6vw, 1.15rem); color: rgba(255,255,255,.86); max-width: 56ch; }
.hero-art { justify-self: center; width: min(360px, 100%); filter: drop-shadow(0 20px 40px rgba(0,0,0,.35)); }
.searchbox { margin-top: 22px; background: var(--card); color: var(--ink); border-radius: 18px; padding: 10px; display: grid; grid-template-columns: 1fr 1fr 1fr auto; gap: 8px; box-shadow: var(--shadow-lg); }
.searchbox select, .searchbox input { border: 0; background: var(--bg); min-height: 48px; }
.searchbox .btn { min-height: 48px; }
.hero-stats { display: flex; gap: 28px; flex-wrap: wrap; margin-top: 24px; }
.hero-stats div { display: flex; flex-direction: column; }
.hero-stats b { font-size: 1.5rem; color: #fff; }
.hero-stats span { font-size: .85rem; color: rgba(255,255,255,.75); }
@media (max-width: 900px) {
  .hero-in { grid-template-columns: 1fr; }
  .hero-art { display: none; }
  .searchbox { grid-template-columns: 1fr 1fr; }
  .searchbox .btn { grid-column: 1 / -1; }
}

.section { padding-block: clamp(36px, 6vw, 64px); }
.section-alt { background: var(--card); border-block: 1px solid var(--line); }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.section-head p { margin: 0; color: var(--muted); }
.eyebrow { display: inline-block; color: var(--gold-600); font-weight: 600; font-size: .85rem; margin-bottom: 4px; }

.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.feature { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.feature .fi { width: 46px; height: 46px; border-radius: 12px; background: var(--brand-50); color: var(--brand); display: grid; place-items: center; margin-bottom: 14px; }
.feature .fi .ic { width: 24px; height: 24px; }
.feature p { color: var(--muted); margin: 0; font-size: .95rem; }

.steps { counter-reset: step; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.step { position: relative; padding: 22px 22px 22px 22px; border-radius: var(--radius); background: var(--bg); border: 1px dashed var(--brand-100); }
.step::before { counter-increment: step; content: counter(step); display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--gold); color: #1b1408; font-weight: 700; margin-bottom: 10px; }
.step p { margin: 0; color: var(--muted); font-size: .95rem; }

.gov-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.gov { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); color: var(--ink); font-weight: 500; }
.gov:hover { border-color: var(--brand); text-decoration: none; color: var(--brand); }
.gov span { color: var(--muted); font-size: .85rem; }

.cta { border-radius: 22px; padding: clamp(24px, 5vw, 44px); background: linear-gradient(120deg, var(--gold-50), var(--brand-50)); border: 1px solid var(--line); display: flex; gap: 20px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.cta h2 { margin-bottom: .2em; }

/* ------------------------------------------------ البطاقات */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 18px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 20px; }
.listing-card { overflow: hidden; display: flex; flex-direction: column; transition: transform .15s, box-shadow .15s; }
.listing-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.card-media { position: relative; display: block; aspect-ratio: 4 / 3; background: var(--brand-50); color: var(--brand); overflow: hidden; }
.card-media img { width: 100%; height: 100%; object-fit: cover; }
.card-media .shape { width: 100%; height: 100%; }
.shape-empty { color: var(--brand); }
.card-tags { position: absolute; top: 10px; inset-inline-start: 10px; display: flex; gap: 6px; flex-wrap: wrap; }
.verified { position: absolute; bottom: 10px; inset-inline-start: 10px; background: rgba(6, 46, 37, .88); color: #fff; font-size: .78rem; font-weight: 600; padding: 4px 10px; border-radius: 999px; }
.card-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.card-price { font-size: 1.25rem; font-weight: 700; color: var(--ink); display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.card-price small { font-size: .75rem; font-weight: 500; color: var(--gold-600); }
.card-title { font-size: 1rem; font-weight: 600; margin: 0; }
.card-title a { color: var(--ink); }
.card-loc { color: var(--muted); font-size: .9rem; margin: 0; }
.facts { list-style: none; padding: 0; margin: 8px 0 0; display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--ink-2); font-size: .86rem; }
.facts li { display: inline-flex; align-items: center; gap: 5px; }
.facts .ic { color: var(--brand); }

.badge { display: inline-flex; align-items: center; gap: 4px; font-size: .75rem; font-weight: 600; padding: 3px 10px; border-radius: 999px; line-height: 1.5; background: var(--bg); color: var(--ink-2); border: 1px solid var(--line); }
.badge-available, .badge-approved { background: var(--ok-bg); color: var(--ok); border-color: transparent; }
.badge-reserved, .badge-pending, .badge-new { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
.badge-sold, .badge-closed { background: var(--sold-bg); color: var(--sold); border-color: transparent; }
.badge-rejected { background: var(--bad-bg); color: var(--bad); border-color: transparent; }
.badge-featured { background: var(--gold); color: #1b1408; border-color: transparent; }
.badge-contacted { background: var(--brand-50); color: var(--brand); border-color: transparent; }
.card-media .badge { box-shadow: 0 2px 8px rgba(0,0,0,.12); }
.card-media .badge-available { background: #e7f6ec; }
.card-media .badge-reserved { background: #fdf3e2; }

/* المشاريع */
.project-card { overflow: hidden; display: grid; grid-template-columns: 1fr; }
.project-card .card-media { aspect-ratio: 16 / 9; }
.project-meter { display: flex; height: 8px; border-radius: 999px; overflow: hidden; background: var(--line); margin: 10px 0 6px; }
.project-meter i { display: block; height: 100%; }
.m-available { background: var(--ok); } .m-reserved { background: var(--gold); } .m-sold { background: var(--sold); }
.from-price { margin-top: 10px; background: var(--bg); border-radius: 12px; padding: 10px 14px; display: flex; justify-content: space-between; align-items: center; }
.from-price small { color: var(--muted); }
.from-price b { font-size: 1.15rem; }

/* ------------------------------------------------ النماذج */
label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 6px; color: var(--ink-2); }
label .opt { font-weight: 400; color: var(--muted); font-size: .8rem; }
input:not([type]), input[type=text], input[type=search], input[type=tel], input[type=password], input[type=number], input[type=url], input[type=email], select, textarea {
  width: 100%; min-height: 46px; padding: 10px 14px; font: inherit; color: var(--ink); background: var(--card);
  border: 1px solid var(--line); border-radius: 12px; transition: border-color .15s, box-shadow .15s;
}
textarea { min-height: 110px; resize: vertical; }
input[type=file] { font: inherit; font-size: .9rem; color: var(--ink-2); max-width: 100%; }
input[type=file]::file-selector-button { font: inherit; font-weight: 600; margin-inline-end: 10px; padding: 8px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--brand-50); color: var(--brand); cursor: pointer; }
details > summary { cursor: pointer; font-weight: 600; color: var(--ink-2); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 16%, transparent); }
input[aria-invalid="true"], select[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--bad); }
.field { margin-bottom: 16px; }
.field-err { display: block; color: var(--bad); font-size: .82rem; margin-top: 5px; }
.hint { display: block; color: var(--muted); font-size: .82rem; margin-top: 5px; }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 16px; }
.form-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 16px; }
.form-grid .full, .form-grid-3 .full { grid-column: 1 / -1; }
@media (max-width: 640px) { .form-grid, .form-grid-3 { grid-template-columns: minmax(0, 1fr); } }
.check { display: flex; align-items: center; gap: 10px; font-weight: 500; cursor: pointer; margin: 0; }
.check input { width: 20px; height: 20px; accent-color: var(--brand); }
.input-group { display: flex; }
.input-group > :first-child { border-start-end-radius: 0; border-end-end-radius: 0; }
.input-group > :last-child { border-start-start-radius: 0; border-end-start-radius: 0; margin-inline-start: -1px; }
.prefix { display: grid; place-items: center; padding-inline: 14px; border: 1px solid var(--line); background: var(--bg); border-radius: 12px; color: var(--ink-2); font-weight: 600; direction: ltr; }
.form-section { border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); padding: 20px; margin-bottom: 18px; }
.form-section > h2 { font-size: 1.1rem; display: flex; align-items: center; gap: 10px; }
.form-section > h2 .step-no { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--brand); color: #fff; font-size: .85rem; }
.form-actions { position: sticky; bottom: 0; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(6px); padding: 12px 0; display: flex; gap: 10px; justify-content: flex-end; border-top: 1px solid var(--line); z-index: 5; }

.alert { padding: 12px 16px; border-radius: 12px; margin-bottom: 14px; border: 1px solid transparent; font-size: .95rem; }
.alert-ok { background: var(--ok-bg); color: var(--ok); }
.alert-warn { background: var(--warn-bg); color: var(--warn); }
.alert-bad { background: var(--bad-bg); color: var(--bad); }
.alert-info { background: var(--brand-50); color: var(--brand); }
.alert ul { margin: 6px 0 0; padding-inline-start: 20px; }
.flashes { padding-top: 16px; }

/* طرق تحديد الموقع */
.methods { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin-bottom: 14px; }
.method { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 6px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); cursor: pointer; font: inherit; font-size: .82rem; font-weight: 600; color: var(--ink-2); text-align: center; }
.method .ic { width: 22px; height: 22px; color: var(--muted); }
.method[aria-selected="true"] { border-color: var(--brand); background: var(--brand-50); color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
.method[aria-selected="true"] .ic { color: var(--brand); }
@media (max-width: 640px) { .methods { grid-template-columns: repeat(3, 1fr); } }
.method-panel[hidden] { display: none; }
.dropzone { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; padding: 26px 16px; border: 2px dashed var(--brand-100); border-radius: var(--radius); background: var(--bg); cursor: pointer; }
.dropzone.drag { border-color: var(--brand); background: var(--brand-50); }
.dropzone .ic { width: 34px; height: 34px; color: var(--brand); }
.dropzone input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.geo-summary { display: flex; gap: 10px 22px; flex-wrap: wrap; align-items: center; padding: 10px 14px; border-radius: 12px; background: var(--brand-50); color: var(--brand); font-weight: 600; font-size: .92rem; margin-top: 10px; }
.geo-summary:empty { display: none; }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.thumb { position: relative; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); background: var(--bg); }
.thumb img { aspect-ratio: 4/3; object-fit: cover; width: 100%; }
.thumb-actions { display: flex; gap: 4px; padding: 6px; }
.thumb-actions button { flex: 1; min-height: 30px; font-size: .75rem; }
.thumb .cover-tag { position: absolute; top: 6px; inset-inline-start: 6px; }

/* ------------------------------------------------ الخرائط */
.map { width: 100%; height: 420px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--brand-50); z-index: 0; }
.map-lg { height: calc(100vh - 66px); height: calc(100dvh - 66px); border-radius: 0; border: 0; }
.leaflet-container { font-family: var(--font); }
.leaflet-popup-content-wrapper { border-radius: 12px; }
.leaflet-popup-content { margin: 12px 14px; min-width: 200px; }
.pop img { border-radius: 8px; aspect-ratio: 16/10; object-fit: cover; width: 100%; margin-bottom: 8px; }
.pop b { display: block; font-size: 1.05rem; }
.pop .muted { font-size: .82rem; }
.price-pin { background: var(--brand); color: #fff; font-weight: 700; font-size: 12px; padding: 3px 8px; border-radius: 999px; white-space: nowrap; box-shadow: 0 2px 8px rgba(0,0,0,.3); border: 2px solid #fff; transform: translate(-50%, -50%); display: inline-block; font-family: var(--font); }
.price-pin.reserved { background: var(--gold-600); }
.price-pin.verified::after { content: " ✓"; }
.plot-label { font: 600 11px var(--font); color: #10201b; text-shadow: 0 0 3px #fff, 0 0 3px #fff; white-space: nowrap; }
.map-shell { position: relative; }
.map-panel { position: absolute; z-index: 500; top: 12px; inset-inline-start: 12px; width: min(360px, calc(100% - 24px)); background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 14px; max-height: calc(100% - 24px); overflow: auto; }
.map-panel h1 { font-size: 1.15rem; margin-bottom: 4px; }
.legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: .82rem; color: var(--ink-2); margin-top: 8px; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-inline-end: 5px; vertical-align: -1px; border: 1px solid rgba(0,0,0,.15); }
.l-available { background: #22c55e; } .l-reserved { background: #f59e0b; } .l-sold { background: #94a3b8; } .l-ref { background: transparent; border: 1.5px solid #0b5d4b !important; } .l-listing { background: var(--gold); }
.layer-switch { display: flex; gap: 6px; margin-top: 10px; }

/* ------------------------------------------------ صفحة الإعلان */
.crumbs { font-size: .85rem; color: var(--muted); padding-top: 16px; display: flex; gap: 6px; flex-wrap: wrap; }
.crumbs a { color: var(--muted); }
.detail { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 24px; padding-block: 16px 48px; align-items: start; }
@media (max-width: 960px) { .detail { grid-template-columns: 1fr; } }
.gallery { display: grid; grid-template-columns: 2fr 1fr; grid-template-rows: repeat(2, minmax(0, 1fr)); gap: 8px; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; }
.gallery > * { background: var(--brand-50); overflow: hidden; position: relative; }
.gallery > :first-child { grid-row: 1 / -1; }
.gallery img { width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; }
.gallery.one { grid-template-columns: 1fr; grid-template-rows: 1fr; }
.gallery.two { grid-template-rows: 1fr; grid-template-columns: 1fr 1fr; }
.gallery.two > :first-child { grid-row: auto; }
.gallery .more { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(6,30,25,.55); color: #fff; font-weight: 700; font-size: 1.1rem; pointer-events: none; }
.plot-drawing { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.plot-drawing svg { width: 100%; height: auto; display: block; }
.title-block { margin-top: 18px; }
.title-block .meta { display: flex; gap: 8px 16px; flex-wrap: wrap; color: var(--muted); font-size: .88rem; align-items: center; }
.price-big { font-size: clamp(1.6rem, 3vw, 2rem); font-weight: 700; color: var(--ink); }
.price-sub { color: var(--muted); font-size: .9rem; }
.specs { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; margin: 16px 0; }
.spec { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.spec small { display: block; color: var(--muted); font-size: .78rem; }
.spec b { font-size: 1rem; }
.block { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-top: 18px; }
.block h2 { font-size: 1.1rem; }
.desc { white-space: pre-line; color: var(--ink-2); }
.side { position: sticky; top: 84px; display: flex; flex-direction: column; gap: 14px; }
.contact-card .who { display: flex; gap: 12px; align-items: center; margin-bottom: 14px; }
.contact-card .who small { display: block; color: var(--muted); }
.contact-card .btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tools { display: flex; gap: 8px; }
.tools .btn { flex: 1; }
.fav[aria-pressed="true"] { color: #e11d48; border-color: #fecdd3; background: #fff1f2; }
.insight { display: flex; gap: 12px; align-items: center; }
.insight .bar { flex: 1; height: 8px; background: var(--line); border-radius: 999px; position: relative; }
.insight .bar i { position: absolute; top: -4px; width: 4px; height: 16px; border-radius: 2px; background: var(--brand); }
.coords-table { width: 100%; border-collapse: collapse; font-size: .85rem; direction: ltr; }
.coords-table th, .coords-table td { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: left; }
.video { position: relative; aspect-ratio: 16/9; border-radius: var(--radius); overflow: hidden; background: #000; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.mobile-bar { display: none; }
@media (max-width: 960px) {
  .side { position: static; }
  .mobile-bar { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; position: fixed; inset-inline: 0; bottom: 0; z-index: 60; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: var(--card); border-top: 1px solid var(--line); box-shadow: 0 -6px 20px rgba(0,0,0,.08); }
  body.has-mobile-bar { padding-bottom: 76px; }
}
.lightbox { position: fixed; inset: 0; z-index: 2000; background: rgba(0,0,0,.92); display: grid; place-items: center; padding: 20px; }
.lightbox img { max-height: 90vh; max-width: 100%; border-radius: 8px; }
.lightbox button { position: absolute; top: 14px; inset-inline-end: 14px; background: rgba(255,255,255,.15); color: #fff; border: 0; border-radius: 50%; width: 44px; height: 44px; font-size: 1.4rem; cursor: pointer; }

/* ------------------------------------------------ التصفح */
.browse { display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 24px; padding-block: 24px 48px; align-items: start; }
.filters { position: sticky; top: 84px; }
.filters .field { margin-bottom: 12px; }
.filters .two { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.results-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.results-head select { width: auto; min-height: 40px; }
.view-toggle { display: inline-flex; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 3px; }
.view-toggle a { padding: 6px 12px; border-radius: 9px; color: var(--ink-2); font-size: .88rem; font-weight: 600; }
.view-toggle a[aria-current="page"] { background: var(--brand); color: #fff; text-decoration: none; }
.filters-toggle { display: none; }
@media (max-width: 960px) {
  .browse { grid-template-columns: 1fr; }
  .filters { position: static; display: none; }
  .filters.open { display: block; }
  .filters-toggle { display: inline-flex; }
}
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); font-size: .85rem; color: var(--ink-2); }
.chip:hover { border-color: var(--brand); text-decoration: none; }
.chip[aria-pressed="true"], .chip.on { background: var(--brand); color: #fff; border-color: var(--brand); }
.empty { text-align: center; padding: 48px 16px; color: var(--muted); }
.empty svg { width: 120px; margin: 0 auto 12px; color: var(--brand); }
.pager { display: flex; gap: 6px; justify-content: center; margin-top: 28px; flex-wrap: wrap; }
.pager a, .pager span { min-width: 42px; height: 42px; display: grid; place-items: center; padding-inline: 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); color: var(--ink); font-weight: 600; }
.pager span[aria-current] { background: var(--brand); color: #fff; border-color: var(--brand); }

/* ------------------------------------------------ الدخول والتسجيل */
.auth { min-height: calc(100vh - 66px); display: grid; grid-template-columns: 1fr 1fr; }
.auth-side { background: linear-gradient(150deg, #062e25, #0b5d4b); color: #fff; padding: clamp(28px, 6vw, 64px); display: flex; flex-direction: column; justify-content: center; position: relative; overflow: hidden; }
.auth-side::before { content: ""; position: absolute; inset: 0; opacity: .12; background-image: linear-gradient(rgba(255,255,255,.7) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.7) 1px, transparent 1px); background-size: 40px 40px; }
.auth-side > * { position: relative; }
.auth-side h1 { color: #fff; }
.auth-side ul { list-style: none; padding: 0; margin: 18px 0 0; display: grid; gap: 12px; }
.auth-side li { display: flex; gap: 10px; align-items: flex-start; color: rgba(255,255,255,.88); }
.auth-side li .ic { color: var(--gold); margin-top: 4px; }
.auth-main { display: grid; place-items: center; padding: clamp(24px, 5vw, 48px) 16px; }
.auth-card { width: min(440px, 100%); }
.auth-card h2 { font-size: 1.5rem; }
.roles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.role { position: relative; }
.role input { position: absolute; opacity: 0; }
.role label { margin: 0; display: block; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); cursor: pointer; font-weight: 600; }
.role label small { display: block; font-weight: 400; color: var(--muted); font-size: .8rem; }
.role input:checked + label { border-color: var(--brand); background: var(--brand-50); box-shadow: inset 0 0 0 1px var(--brand); }
.role input:focus-visible + label { outline: 3px solid var(--gold); }
@media (max-width: 860px) { .auth { grid-template-columns: 1fr; } .auth-side { display: none; } }

/* ------------------------------------------------ لوحة التحكم */
.panel { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 24px; padding-block: 24px 48px; align-items: start; }
.panel-side, .panel-main { min-width: 0; }
.panel-side { position: sticky; top: 84px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.panel-me { display: flex; gap: 10px; align-items: center; padding: 6px 6px 14px; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.panel-me small { display: block; color: var(--muted); font-size: .78rem; }
.panel-nav { display: flex; flex-direction: column; gap: 2px; }
.panel-nav a { display: flex; gap: 10px; align-items: center; padding: 9px 12px; border-radius: 10px; color: var(--ink-2); font-weight: 500; }
.panel-nav a:hover { background: var(--bg); text-decoration: none; }
.panel-nav a[aria-current="page"] { background: var(--brand-50); color: var(--brand); font-weight: 600; }
.count { margin-inline-start: auto; background: var(--brand); color: #fff; font-size: .72rem; border-radius: 999px; padding: 1px 8px; font-weight: 700; }
.count-warn { background: var(--gold); color: #1b1408; }
.panel-title { font-size: 1.5rem; }
@media (max-width: 960px) {
  .panel { grid-template-columns: minmax(0, 1fr); }
  .panel-side { position: static; }
  .panel-nav { flex-direction: row; overflow-x: auto; gap: 4px; }
  .panel-nav a { white-space: nowrap; }
  .panel-nav form { display: none; }
  .panel-me { display: none; }
}
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 20px; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.tile small { color: var(--muted); display: block; font-size: .82rem; }
.tile b { font-size: 1.6rem; font-variant-numeric: tabular-nums; }
.tile.hl { background: var(--brand); border-color: var(--brand); color: #fff; }
.tile.hl small { color: rgba(255,255,255,.8); }
.table-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
table.t { width: 100%; border-collapse: collapse; font-size: .92rem; }
table.t th, table.t td { padding: 11px 14px; border-bottom: 1px solid var(--line); text-align: start; vertical-align: middle; }
table.t th { background: var(--bg); font-weight: 600; color: var(--ink-2); font-size: .82rem; white-space: nowrap; }
table.t tr:last-child td { border-bottom: 0; }
table.t td .t-title { font-weight: 600; color: var(--ink); }
table.t input, table.t select { min-height: 38px; padding: 6px 10px; }
.t-thumb { width: 64px; height: 48px; border-radius: 8px; overflow: hidden; background: var(--brand-50); color: var(--brand); flex: none; }
.t-thumb img, .t-thumb svg { width: 100%; height: 100%; object-fit: cover; }
.t-item { display: flex; gap: 12px; align-items: center; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.toolbar input, .toolbar select { width: auto; min-height: 40px; }
.toolbar input[type=search] { min-width: 220px; flex: 1; }
.inline-form { display: inline; }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { padding: 8px 0 8px; border-bottom: 1px dashed var(--line); font-size: .88rem; }
.timeline li small { color: var(--muted); }

/* ------------------------------------------------ التذييل */
.footer { background: #071d18; color: #c8d6d1; margin-top: 0; }
.footer a { color: #c8d6d1; display: block; padding: 3px 0; font-size: .92rem; }
.footer a:hover { color: #fff; }
.footer h3 { color: #fff; font-size: .95rem; margin-bottom: 10px; }
.footer .muted { color: #8fa59e; font-size: .9rem; }
.footer .brand-text b { color: #fff; }
.footer .brand-text small { color: #8fa59e; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 28px; padding-block: 44px 28px; }
.brand-footer { margin-bottom: 12px; }
.footer-bottom { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; border-top: 1px solid rgba(255,255,255,.08); padding-block: 16px 24px; font-size: .82rem; }
@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .footer-grid { grid-template-columns: 1fr; } }

@media print {
  .topbar, .footer, .side .tools, .mobile-bar, .form-actions { display: none !important; }
  body { background: #fff; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
.hl-row td { background: var(--gold-50) !important; transition: background .3s; }
.editor-tools { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.geo-msg { margin-top: 10px; }
.geo-msg:empty { display: none; }
textarea.coords { direction: ltr; text-align: left; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .88rem; min-height: 150px; }
.pd-edge { font: 600 13px ui-monospace, Menlo, Consolas, monospace; fill: var(--muted); text-anchor: middle; dominant-baseline: middle; direction: ltr; }
.pd-node { fill: var(--card); stroke: var(--ink); stroke-width: 1.5; }
.pd-usage { font: 700 13px var(--font); letter-spacing: .08em; fill: var(--gold-600); text-anchor: middle; }
.pd-plot { font-family: var(--font); font-weight: 700; fill: var(--ink); text-anchor: middle; direction: ltr; }
.pd-area { font: 500 15px ui-monospace, Menlo, Consolas, monospace; fill: var(--ink-2); text-anchor: middle; direction: ltr; }
.pd-north path { fill: var(--brand); } .pd-north text { font: 700 12px var(--font); fill: var(--brand); text-anchor: middle; }
.map-page .footer { display: none; }
@media (max-width: 640px) { .map-panel { top: auto; bottom: 12px; max-height: 45%; } }
.leaflet-tooltip.plot-label { background: transparent; border: 0; box-shadow: none; padding: 0; }
.leaflet-tooltip.plot-label::before { display: none; }

/* ---------- اعرض أرضك: قراءة الكروكي ---------- */
.btn-lg { padding: 14px 22px; font-size: 1.02rem; border-radius: 14px; }
.sell { max-width: 860px; padding-block: 28px 56px; }
.sell-intro h1 { font-size: clamp(1.5rem, 4vw, 2.1rem); margin: 0 0 6px; }
.sell-intro p { margin: 0 0 18px; }
.sell-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(16px, 3vw, 24px); margin-bottom: 16px; }
.sell-card h2 { margin-top: 0; font-size: 1.25rem; }
.sell-card h3 { font-size: 1rem; margin: 18px 0 8px; }
.sell-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sell-btn { justify-content: center; text-align: center; cursor: pointer; }
.sell-drop { margin-top: 10px; padding: 14px; }
.sell-tips { margin: 12px 0 0; padding-inline-start: 18px; line-height: 1.8; }
.sell-card.busy .sell-actions, .sell-card.busy .sell-drop { opacity: .5; pointer-events: none; }
.sell-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 0 20px; }
.sell-grid .coords-table td, .sell-grid .coords-table th { padding: 5px 6px; font-size: .8rem; white-space: nowrap; }
.sell-fields { margin: 0; display: grid; gap: 6px; }
.sell-fields div { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px dashed var(--line); padding-bottom: 6px; }
.sell-fields dt { color: var(--muted); }
.sell-fields dd { margin: 0; font-weight: 600; }
.sell-coords { margin: 0; padding: 10px 12px; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; font-size: .82rem; white-space: pre-wrap; overflow-x: auto; }
.sell-next { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-top: 20px; }
.sell-next .btn-gold { flex: 1 1 260px; justify-content: center; }
.spinner { display: inline-block; width: 1em; height: 1em; border: 2px solid currentColor; border-inline-end-color: transparent; border-radius: 50%; vertical-align: -2px; margin-inline-end: 6px; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.kroki-banner { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.kroki-shot { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
@media (max-width: 640px) {
  .sell-actions, .sell-grid { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- ابحث بالكروكي ---------- */
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--brand); text-decoration: underline; cursor: pointer; }
.find-map { height: min(62vh, 520px); }
.find-hint { background: var(--brand-50); color: var(--brand); font-weight: 600; font-size: .9rem; padding: 10px 12px; border-radius: 10px; margin-bottom: 10px; }
.find-tools { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.find-tools .btn { flex: 1 1 auto; justify-content: center; }
#btn-coords[aria-expanded="true"] { background: var(--brand-50); border-color: var(--brand); color: var(--brand); }
.find-coords[hidden] { display: none; }
.corner-pin { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: #fff; color: var(--brand); border: 3px solid var(--brand); font-weight: 700; font-size: .78rem; box-shadow: 0 2px 6px rgba(0,0,0,.35); }
.find-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.find-stats div { background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; text-align: center; }
.find-stats small { display: block; color: var(--muted); font-size: .78rem; }
.find-stats b { font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.match { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; margin-top: 12px; padding: 12px 14px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line); color: var(--ink); }
.match span { color: var(--muted); font-size: .9rem; }
.match i { font-style: normal; margin-inline-start: auto; font-weight: 600; color: var(--brand); }
.match-ok { background: var(--ok-bg); border-color: transparent; text-decoration: none; }
.match-ok:hover { text-decoration: none; filter: brightness(.98); }
.find-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.find-actions .btn { justify-content: center; padding-inline: 6px; }
.find-coords { margin-top: 10px; }
.find-coords .coords-table td, .find-coords .coords-table th { padding: 5px 6px; font-size: .78rem; white-space: nowrap; }
.near-list, .saved-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.near-list a { display: flex; flex-direction: column; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); }
.near-list a:hover { text-decoration: none; border-color: var(--brand); }
.near-list span { color: var(--muted); font-size: .85rem; }
.saved-list li { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.saved-list .link-btn { text-decoration: none; text-align: start; color: var(--ink); }
.searchbox-kroki { grid-column: 1 / -1; justify-content: center; background: transparent; border: 1px dashed var(--line); }
.fav-lands { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.fav-lands li { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
.fav-lands form { margin: 0; }
.fav-land-name { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; color: var(--ink); }
.fav-land-name:hover { text-decoration: none; }
.fav-land-name b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.find-start-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.find-start-actions .sell-btn { padding-inline: 8px; font-size: .95rem; }
.find-datum { display: grid; gap: 4px; margin-top: 12px; }
.find-datum label { font-size: .85rem; font-weight: 600; color: var(--ink-2); }
.find-datum select { max-width: 360px; }
.find-lands { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 8px; margin-bottom: 6px; }
.find-lands button { flex: 0 0 auto; border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 6px 12px; font: inherit; font-size: .85rem; cursor: pointer; white-space: nowrap; }
.find-lands button[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: #fff; }
.find-lands button.bad { color: var(--bad); border-color: var(--bad-bg); }
.saved-list .saved-actions { display: flex; gap: 4px; }
@media (max-width: 640px) {
  .find-start-actions { grid-template-columns: 1fr 1fr; }
  .find-start-actions .btn-primary { grid-column: 1 / -1; }
}

/* ---------- أداة الأرض: خريطة كاملة بأدوات عائمة ---------- */
body.tool-page .footer, body.tool-page .mobile-bar { display: none; }
body.tool-page main { padding: 0; }
.tool { position: relative; height: calc(100dvh - 66px); min-height: 480px; overflow: hidden; background: var(--brand-50); }
.tool-map { position: absolute; inset: 0; z-index: 0; }
.tool .leaflet-top { top: 118px; }
.tool .leaflet-bottom { bottom: 76px; }
.tool-search { position: absolute; z-index: 500; top: 12px; inset-inline: 12px; max-width: 620px; margin-inline: auto; display: flex; align-items: center; gap: 4px;
  background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 4px; box-shadow: var(--shadow-lg); }
.tool-search input { flex: 1 1 auto; min-width: 0; border: 0; background: transparent; padding: 10px 12px; font: inherit; font-size: .95rem; outline: none; box-shadow: none; }
.tool-search-go, .tool-search-kroki { flex: 0 0 auto; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; border: 0; cursor: pointer; font-size: 1.15rem; }
.tool-search-go { background: transparent; color: var(--ink-2); }
.tool-search-go .ic { width: 20px; height: 20px; }
.tool-search-kroki { background: var(--brand); color: #fff; }
.tool-results { position: absolute; z-index: 700; top: 66px; inset-inline: 12px; max-width: 620px; margin-inline: auto; background: var(--card); border: 1px solid var(--line);
  border-radius: 16px; box-shadow: var(--shadow-lg); max-height: 50vh; overflow: auto; padding: 6px; }
.tool-results button { display: flex; flex-direction: column; align-items: flex-start; width: 100%; text-align: start; border: 0; background: none; padding: 10px 12px; border-radius: 10px; font: inherit; cursor: pointer; }
.tool-results button:hover { background: var(--bg); }
.tool-results span { color: var(--muted); font-size: .85rem; }
.tool-proj { position: absolute; z-index: 510; top: 66px; inset-inline-end: 12px; }
.tool-proj > button { border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: 999px; padding: 7px 12px; font: inherit; font-size: .8rem; font-weight: 600; cursor: pointer; box-shadow: var(--shadow); direction: ltr; }
.tool-proj { z-index: 700 !important; }
.tool-menu { max-height: 60vh; overflow-y: auto; }
.tool-menu { position: absolute; top: calc(100% + 6px); inset-inline-end: 0; width: 270px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg); padding: 8px; display: grid; gap: 2px; }
.tool-menu[hidden] { display: none; }
.tool-menu b { font-size: .8rem; color: var(--muted); padding: 4px 8px; }
.tool-menu button { text-align: start; border: 0; background: none; padding: 9px 10px; border-radius: 10px; font: inherit; font-size: .9rem; cursor: pointer; display: flex; flex-direction: column; }
.tool-menu button small { color: var(--muted); font-size: .75rem; }
.tool-menu button:hover, .tool-menu button[aria-pressed="true"] { background: var(--brand-50); color: var(--brand); }
.tool-bar { position: absolute; z-index: 510; top: 110px; inset-inline-start: 12px; display: flex; flex-direction: column; gap: 6px; }
.tool-bar button { width: 52px; height: 52px; border-radius: 14px; border: 1px solid var(--line); background: var(--card); box-shadow: var(--shadow); cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; font-size: 1.15rem; line-height: 1; }
.tool-bar button span { font-size: .62rem; font-weight: 600; color: var(--ink-2); font-family: inherit; }
.tool-bar button[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); }
.tool-bar button[aria-pressed="true"] span { color: #fff; }
.tool-hint { position: absolute; z-index: 505; top: 66px; inset-inline: 0; margin-inline: auto; width: max-content; max-width: calc(100% - 140px); background: rgba(9, 30, 25, .88); color: #fff;
  font-size: .82rem; font-weight: 600; padding: 8px 14px; border-radius: 999px; text-align: center; }
.tool-hint[hidden], .tool-edit[hidden] { display: none; }
.tool-edit { position: absolute; z-index: 650; bottom: 88px; inset-inline: 0; margin-inline: auto; width: max-content; display: flex; gap: 6px; background: var(--card); border-radius: 999px; padding: 5px; box-shadow: var(--shadow-lg); }
.tool-edit button { border: 0; background: var(--bg); border-radius: 999px; padding: 8px 14px; font: inherit; font-size: .85rem; font-weight: 600; cursor: pointer; }
.tool-edit #btn-done { background: var(--brand); color: #fff; }
.measure-pin { display: block; width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 3px solid #0ea5e9; box-shadow: 0 1px 4px rgba(0,0,0,.4); }
.measure-label { display: inline-block; transform: translate(-50%, -50%); background: #0ea5e9; color: #fff; font-size: .72rem; font-weight: 700; padding: 2px 7px; border-radius: 999px; white-space: nowrap; direction: ltr; }
.point-pin { font-size: 28px; line-height: 1; filter: drop-shadow(0 2px 3px rgba(0,0,0,.4)); }
.sheet { position: absolute; z-index: 600; inset-inline: 0; bottom: 0; background: var(--card); border-radius: 20px 20px 0 0; box-shadow: 0 -8px 30px rgba(0,0,0,.18);
  padding: 4px 16px calc(14px + env(safe-area-inset-bottom)); max-height: 76px; overflow: hidden; transition: max-height .25s ease; }
.sheet.open { max-height: 46%; overflow-y: auto; }
.sheet.full { max-height: 86%; overflow-y: auto; }
.sheet-grip { display: block; width: 100%; height: 22px; border: 0; background: none; cursor: pointer; position: relative; }
.sheet-grip::before { content: ""; position: absolute; top: 8px; inset-inline: 0; margin: auto; width: 44px; height: 5px; border-radius: 9px; background: var(--line); }
.sheet-empty { display: grid; gap: 2px; font-size: .85rem; color: var(--muted); padding-bottom: 6px; }
.sheet-empty b { color: var(--ink); }
.sheet-empty[hidden] { display: none; }
.sheet .alert { margin: 4px 0 10px; }
.sheet .find-stats { margin-top: 4px; }
.sheet-actions { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin-top: 12px; }
.sheet-actions .btn { justify-content: center; padding: 9px 4px; font-size: .85rem; }
.sheet-actions #btn-coords[aria-expanded="true"] { background: var(--brand-50); border-color: var(--brand); color: var(--brand); }
.sheet-h { font-size: .92rem; margin: 16px 0 6px; }
.tool-card { display: grid; gap: 4px; padding: 10px 12px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line); margin-top: 6px; }
.tool-card .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .85rem; }
.tool-card small { color: var(--muted); font-family: inherit; }
.tool-card-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
@media (min-width: 900px) {
  .sheet { top: 12px; bottom: 12px; inset-inline-start: auto; inset-inline-end: 12px; width: 400px; max-height: none; border-radius: 18px; overflow-y: auto; padding-top: 10px; }
  .sheet.open, .sheet.full { max-height: none; }
  .sheet-grip { display: none; }
  .tool-search { inset-inline-end: 424px; margin-inline: 0; }
  .tool-results { inset-inline-end: 424px; margin-inline: 0; }
  .tool-proj { inset-inline-end: 424px; }
  .tool-edit { bottom: 24px; inset-inline-end: 412px; }
  .tool .leaflet-bottom { bottom: 0; }
}
@media (max-width: 420px) {
  .sheet-actions .btn { font-size: .78rem; }
}

/* أثناء الرسم أو القياس: اللوحة مصغّرة وأزرار التحرير فوقها */
.tool.editing .sheet.open, .tool.editing .sheet.full { max-height: 30%; }
.tool.editing .tool-edit { bottom: calc(30% + 10px); }
@media (min-width: 900px) { .tool.editing .tool-edit { bottom: 24px; } .tool.editing .sheet.open, .tool.editing .sheet.full { max-height: none; } }

.credit { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dev-logo { height: 22px; width: auto; vertical-align: middle; }
.dev-mark { display: inline-block; direction: ltr; font-weight: 800; letter-spacing: .04em; font-size: .78rem; padding: 3px 8px; border-radius: 6px;
  background: #fff; color: #0b2b24; line-height: 1.2; }
.dev-mark b { color: var(--gold); }

.dev-brand { display: inline-flex; align-items: center; gap: 6px; direction: rtl; }
.dev-brand b { color: #fff; font-weight: 800; letter-spacing: .02em; }
.credit a:hover { text-decoration: none; opacity: .85; }
.dev-logo { border-radius: 5px; box-shadow: 0 0 0 1px rgba(255,255,255,.25); }
