/* =========================================================
   Tree page (/t/<ID>) — plus the pieces the tag pages share
   (certificate.html loads this file too):
   .d-state (full-page states), .d-find-wrap (the shared .id-form), .d-tree-card, .d-samples.
   Logical properties only, so Arabic mirrors without overrides.
   ========================================================= */

/* [hidden] must win over the display values of .btn, .field, .notice… (athar.css has no global
   rule for it): the Android-only app button and the "Other occasion" field rely on it. */
[data-tree-root] [hidden], [data-cert-root] [hidden] { display: none !important; }

/* ---------- shared: full-page states ---------- */
.d-state { position: relative; overflow: hidden; padding-block: clamp(2.5rem, 6vw, 5rem) var(--section-y); }
.d-state-inner { position: relative; z-index: 1; max-width: calc(900px + 2 * var(--margin)); display: grid; justify-items: start; }
.d-state .dateline { justify-self: stretch; margin-block-end: clamp(2rem, 5vw, 3.5rem); }
.d-state .disc { margin-block-end: 1.5rem; }
.d-state .label { margin-block-end: .9rem; }
.d-state .h2 { max-width: 18ch; }
.d-state .lead { max-width: 46ch; }
.d-state-actions { margin-block-start: 2rem; }
.d-state-links { display: flex; flex-wrap: wrap; gap: 1rem 2rem; margin-block-start: 2.5rem; }
.d-state-links .link, .d-state-actions .link { min-height: 44px; }

/* find a tree: the shared .id-form (athar.css) */
.d-find-wrap { width: 100%; max-width: 520px; margin-block-start: 2.25rem; }
.d-find-wrap .id-form { max-width: none; }

/* tree mini card */
.d-tree-card {
  display: flex; align-items: center; gap: 1rem; padding: .75rem; padding-inline-end: 1rem;
  background: var(--athar-ivory); border-radius: 20px; box-shadow: var(--shadow-card);
  text-decoration: none; color: var(--athar-ink); min-height: 44px;
  transition: transform .25s var(--ease), box-shadow .25s;
}
.d-tree-card:hover { transform: translateY(-2px); box-shadow: 0 16px 36px rgba(56, 40, 20, .1); }
.d-tree-card-photo { width: 76px; height: 76px; flex: none; border-radius: 14px; overflow: hidden; background: var(--athar-sand); }
.d-tree-card-photo img { width: 100%; height: 100%; object-fit: cover; }
.d-tree-card-photo img.mark { object-fit: contain; padding: 12px; }
.d-tree-card-body { flex: 1; min-width: 0; display: grid; gap: .1rem; justify-items: start; }
.d-tree-card-species { font-weight: 800; color: var(--athar-green); font-size: 1.05rem; line-height: 1.25; }
.d-tree-card .tree-id { font-size: .875rem; }
.d-tree-card-place { font-size: .875rem; color: var(--muted); line-height: 1.35; }
.d-tree-card-body .pill { margin-block-start: .35rem; }
.d-tree-card-go { color: var(--athar-brown); }
.d-samples { width: 100%; margin-block-start: 3rem; }
.d-samples .label { margin-block-end: 1rem; }
.d-samples-grid { display: grid; gap: var(--gap); grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 360px)); }

/* names and messages typed in any script: isolated from the label beside them, aligned to the
   page's start edge (so a Latin name on the Arabic page sits right, under its Arabic label) */
[data-tree-root] .bidi, [data-cert-root] .bidi { unicode-bidi: isolate; text-align: start; }

/* small notes with an icon */
.tree-note { display: flex; gap: .6rem; align-items: flex-start; color: var(--muted); font-size: .875rem; line-height: 1.55; }
.tree-note .ms { font-size: 1.2rem; color: var(--athar-green); margin-block-start: .05rem; }

/* ---------- loading skeleton ---------- */
.sk { display: block; background: var(--athar-dune); border-radius: 10px; animation: tree-sk 1.1s ease-in-out infinite alternate; }
.sk-label { width: 190px; height: 14px; margin-block-end: 1.4rem; }
.sk-title { width: 62%; height: clamp(3rem, 6vw, 5.6rem); margin-block-end: .7rem; }
.sk-title.short { width: 78%; height: clamp(1.6rem, 3vw, 2.8rem); }
.sk-line { width: 92%; height: 16px; margin-block-end: .7rem; }
.sk-line.short { width: 58%; }
.sk-photo { animation: tree-sk 1.1s ease-in-out infinite alternate; }
@keyframes tree-sk { from { opacity: .55; } to { opacity: 1; } }

/* =========================================================
   HERO: the living plate. The tree seen through an arched window (the gallery), its ATHAR tag
   resting on the window's lower edge, and its name beside it: the tree, its ID, its name.
   Sizes follow the window width (--aw) and the tag width (--tw), so the scene scales as one.
   ========================================================= */
body[data-page="tree"] { --dir: 1; }
html[dir="rtl"] body[data-page="tree"] { --dir: -1; }

.tree-hero { position: relative; padding-block: clamp(1.25rem, 2.6vw, 2.25rem) clamp(3.5rem, 7vw, 6rem); }
.tree-hero-grid {
  position: relative; z-index: 1; display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); grid-template-rows: auto 1fr;
  grid-template-areas: "date stage" "ident stage";
  column-gap: clamp(2rem, 5vw, 5.5rem);
}
.tree-hero-date { grid-area: date; align-self: start; }
.tree-ident { grid-area: ident; align-self: center; display: grid; padding-block: clamp(1.5rem, 3vw, 2.5rem) 0; }
.tree-hero-head, .tree-hero-body { display: grid; justify-items: start; align-content: start; min-width: 0; }

/* ID · eyebrow on one row; a long eyebrow wraps under itself, never leaving the dot alone */
.tree-eyebrow { flex-wrap: nowrap; align-items: flex-start; gap: .7rem; margin-block-end: clamp(.9rem, 1.6vw, 1.25rem); }
.tree-eyebrow > span:last-child { min-width: 0; }
.tree-eyebrow .tree-id { font-size: 1em; letter-spacing: .12em; color: var(--athar-green); font-weight: 700; }
html[lang="ar"] .tree-eyebrow .tree-id { font-size: .875rem; }
.tree-eyebrow-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--athar-tan); flex: none; margin-block-start: .6em; }
html[lang="ar"] .tree-eyebrow-dot { margin-block-start: .8em; }

/* the name: the species large and textured (Brown), the place beneath it (Green) */
.tree-hero .display.tree-title { font-size: clamp(3.4rem, 7vw, 6.5rem); line-height: .92; max-width: 100%; }
.tree-title .tree-title-sp { padding-block-end: .04em; }
.tree-title .alt { font-size: .46em; line-height: 1.08; letter-spacing: -0.02em; margin-block-start: .28em; max-width: 19ch; }
html[lang="ar"] .tree-hero .display.tree-title { font-size: clamp(3.2rem, 6.4vw, 6rem); line-height: 1.18; }
html[lang="ar"] .tree-title .alt { font-size: .5em; line-height: 1.4; margin-block-start: .05em; max-width: 20ch; }
.tree-hero-head .rule { margin-block: clamp(1.25rem, 2.2vw, 1.75rem); }

.tree-story { max-width: 36ch; margin-block-end: 1.5rem; text-wrap: pretty; }
html[lang="ar"] .tree-story { max-width: 40ch; }
.tree-pills { --cluster: .5rem; }
/* in honour of the late Sheikh Zayed: the dedication leads the first screen, in place of the status pill */
.tree-honour-line {
  display: inline-flex; align-items: center; gap: 1rem; max-width: 100%; margin: 0 0 clamp(1.5rem, 2.6vw, 2rem);
  padding: .85rem 1.4rem; padding-inline-start: 1rem; border-radius: 18px;
  background: var(--athar-brown); color: var(--athar-cream);
  box-shadow: 0 16px 34px rgba(104, 73, 37, .2);
}
.tree-honour-line .tree-honour-flag { flex: none; width: 32px; height: 22px; margin: 0; grid-template-columns: 9px 1fr; border-radius: 3px; }
.tree-honour-line-text { display: grid; min-width: 0; }
.tree-honour-line .lt { font-size: .9375rem; line-height: 1.35; color: var(--athar-sand); }
.tree-honour-line strong { font-weight: 700; font-size: 1.1875rem; line-height: 1.3; text-wrap: balance; }
html[lang="ar"] .tree-honour-line .lt { font-size: 1rem; line-height: 1.6; }
html[lang="ar"] .tree-honour-line strong { font-family: var(--font-arabic-display); font-size: 1.25rem; line-height: 1.55; }
.tree-tap { margin-block-start: 1.5rem; width: min(100%, 480px); }

/* the window: an arch, outlined by a hairline, as on the home page */
.tree-stage {
  --aw: clamp(300px, min(34vw, calc((100svh - var(--header-h) - 11rem) * .8)), 520px);
  --tw: calc(var(--aw) * .44);
  grid-area: stage; display: grid; justify-items: end; align-content: start;
  padding-block-start: calc(var(--aw) * .04);
}
.tree-window { position: relative; width: var(--aw); }
.tree-arch-line { position: absolute; z-index: 0; inset: calc(var(--aw) * -.034); border: 1px solid rgba(104, 73, 37, .3); border-radius: 50% 50% 34px 34px / 40.6% 40.6% 34px 34px; pointer-events: none; }
.g-frame { position: relative; z-index: 1; isolation: isolate; overflow: hidden; width: 100%; aspect-ratio: 4 / 5; border-radius: 50% 50% 28px 28px / 40% 40% 28px 28px; background: var(--athar-sand); box-shadow: 0 34px 70px rgba(104, 73, 37, .2), 0 4px 12px rgba(56, 40, 20, .06); }
.g-track { display: flex; height: 100%; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain; }
.g-track::-webkit-scrollbar { display: none; }
.g-track:focus-visible { outline-offset: -6px; }
.g-slide { flex: 0 0 100%; height: 100%; margin: 0; scroll-snap-align: start; scroll-snap-stop: always; overflow: hidden; }
.g-slide img { width: 100%; height: 100%; object-fit: cover; }
.g-slide:first-child img { object-position: 50% 40%; }
/* photo count + arrows sit at the window's end corner, clear of the tag */
.g-ui { position: absolute; z-index: 2; inset-inline: 0; inset-block-end: 0; display: flex; justify-content: flex-end; align-items: center; gap: .6rem; padding: 4rem 1.1rem 1.1rem; background: linear-gradient(to top, rgba(28, 22, 14, .4), rgba(28, 22, 14, 0)); pointer-events: none; }
.g-ui > * { pointer-events: auto; }
.g-count { font-family: var(--font-num); font-weight: 700; font-size: .875rem; color: var(--athar-cream); background: rgba(28, 22, 14, .35); padding: .3rem .8rem; border-radius: var(--radius-pill); }
.g-arrows { display: flex; gap: .5rem; }
.g-btn { width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(252, 248, 239, .92); color: var(--athar-brown); display: grid; place-items: center; cursor: pointer; transition: background-color .2s, transform .2s var(--ease); }
.g-btn:hover { background: var(--athar-cream); transform: scale(1.06); }
.g-thumbs { display: flex; gap: .5rem; flex-wrap: wrap; justify-content: flex-end; width: var(--aw); margin-block-start: 1rem; }
.g-thumb { width: 60px; height: 60px; padding: 0; border-radius: 14px; overflow: hidden; border: 2px solid transparent; background: var(--athar-sand); cursor: pointer; opacity: .6; transition: opacity .2s, border-color .2s; }
.g-thumb:hover { opacity: .9; }
.g-thumb[aria-current="true"] { border-color: var(--athar-brown); opacity: 1; }
.g-thumb img { width: 100%; height: 100%; object-fit: cover; }
.g-frame.empty { display: grid; place-items: center; align-content: center; gap: 1rem; }
.g-empty-mark { width: 38%; height: auto; }
.g-empty-text { font-weight: 600; color: var(--athar-brown); opacity: .75; }

/* the tag: drawn after the one on the trunk (cream plate, two fixings, logo, species, QR + NFC, ID) */
.tree-tag {
  position: absolute; z-index: 3; margin: 0;
  inset-inline-start: calc(var(--tw) * -.5); inset-block-end: calc(var(--aw) * -.075);
  width: var(--tw); display: grid; justify-items: center; text-align: center;
  padding: calc(var(--tw) * .12) calc(var(--tw) * .08) calc(var(--tw) * .12);
  border-radius: calc(var(--tw) * .07);
  background: linear-gradient(165deg, var(--athar-ivory) 30%, var(--athar-cream));
  box-shadow: inset 0 0 0 1px rgba(104, 73, 37, .1), 0 26px 50px rgba(56, 40, 20, .22), 0 4px 10px rgba(56, 40, 20, .08);
  transform: rotate(calc(var(--dir) * -3deg)); transform-origin: 50% 0;
  color: var(--athar-brown);
}
.tree-tag-screw { position: absolute; inset-block-start: calc(var(--tw) * .04); inset-inline: 0; margin-inline: auto; width: calc(var(--tw) * .062); aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle at 35% 35%, var(--athar-ivory), var(--athar-print) 50%, rgba(104, 73, 37, .5)); box-shadow: 0 1px 1px rgba(56, 40, 20, .25); }
.tree-tag-screw.end { inset-block-start: auto; inset-block-end: calc(var(--tw) * .04); }
.tree-tag-logo { width: calc(var(--tw) * .4); height: auto; }
.tree-tag-k { margin-block-start: calc(var(--tw) * .055); font-size: calc(var(--tw) * .052); font-weight: 500; line-height: 1.3; color: var(--id-grey); }
.tree-tag-sp { display: grid; justify-items: center; margin-block-start: calc(var(--tw) * .015); color: var(--athar-brown); }
.tree-tag-sp [lang="ar"] { font-family: var(--font-arabic-display); font-weight: 600; font-size: calc(var(--tw) * .088); line-height: 1.35; }
.tree-tag-sp [lang="en"] { font-family: var(--font-latin); font-weight: 600; font-size: calc(var(--tw) * .074); line-height: 1.1; }
.tree-tag-hr { display: block; width: 88%; height: 1px; background: rgba(104, 73, 37, .22); margin-block: calc(var(--tw) * .06); }
.tree-tag-codes { display: flex; align-items: center; justify-content: center; gap: calc(var(--tw) * .05); direction: ltr; }
.tree-tag-codes img { width: calc(var(--tw) * .36); height: auto; aspect-ratio: 1; }
.tree-tag-nfc { width: calc(var(--tw) * .13); height: auto; fill: none; stroke: var(--id-grey); stroke-width: 1.7; stroke-linecap: round; }
.tree-tag-id { margin-block-start: calc(var(--tw) * .05); font-family: var(--font-id); font-weight: 700; font-size: calc(var(--tw) * .1); letter-spacing: .05em; line-height: 1.2; color: var(--id-grey); direction: ltr; white-space: nowrap; }
.tree-tag-line { margin-block-start: calc(var(--tw) * .025); font-size: max(9px, calc(var(--tw) * .044)); line-height: 1.45; color: var(--muted); }
html[lang="ar"] .tree-tag-line { font-size: max(9px, calc(var(--tw) * .046)); line-height: 1.55; }

/* life: the photo settles, the tag comes to rest on the window, its NFC arcs call softly */
@media (prefers-reduced-motion: no-preference) {
  .tree-hero:not(.tree-skeleton) .g-slide:first-child img { animation: tree-settle 2.4s var(--ease) both; }
  .tree-tag { animation: tree-tag-in 1.1s var(--ease) .35s both; }
  .tree-tag-nfc path { animation: tree-nfc 3.2s ease-in-out 1.4s infinite both; }
  .tree-tag-nfc path:nth-child(2) { animation-delay: 1.6s; }
  .tree-tag-nfc path:nth-child(3) { animation-delay: 1.8s; }
}
@keyframes tree-settle { from { transform: scale(1.09); } to { transform: none; } }
@keyframes tree-tag-in { from { opacity: 0; transform: translateY(32px) rotate(calc(var(--dir) * -10deg)); } to { opacity: 1; transform: rotate(calc(var(--dir) * -3deg)); } }
@keyframes tree-nfc { 0%, 60%, 100% { opacity: 1; } 20% { opacity: .25; } }

/* ---------- the state, under the hero ---------- */
/* the next section brings its own top spacing, so the state only needs a little air below */
.tree-state { position: relative; padding-block-end: clamp(.5rem, 1.5vw, 1.25rem); }

/* a card waiting to be activated (in the app) */
.gift-band {
  position: relative; overflow: hidden; isolation: isolate;
  display: grid; grid-template-columns: minmax(0, 1fr);
  padding: clamp(1.75rem, 4.5vw, 4rem); border-radius: 32px;
  background: var(--athar-green); color: var(--athar-cream); box-shadow: 0 30px 60px rgba(63, 89, 59, .2);
}
.gift-band-mark { position: absolute; z-index: -1; inset-block-start: -22%; inset-inline-end: -6%; width: clamp(240px, 30vw, 440px); height: auto; opacity: .08; pointer-events: none; }
.gift-band .label { color: var(--athar-sand); margin-block-end: .9rem; }
.gift-band .h2 { color: var(--athar-cream); }
.gift-band .h2 .alt { color: var(--athar-sand); }
.gift-band .rule { background: var(--athar-sand); }
.gift-band-body { font-size: 1.125rem; line-height: 1.6; opacity: .92; max-width: 46ch; text-wrap: pretty; }
html[lang="ar"] .gift-band-body { line-height: 1.8; }
.gift-band-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.5rem; margin-block-start: 2rem; }
.gift-band-cta p { font-size: .9375rem; opacity: .78; max-width: 30ch; }
.gift-band .promise { color: var(--athar-sand); margin-block-start: 2rem; padding-block-start: 1.25rem; border-block-start: 1px solid rgba(252, 248, 239, .18); max-width: none; }
.gift-band .promise .ms { color: var(--athar-cream); }

/* the floating "Activate" pill */
.gift-dock { position: fixed; z-index: 90; inset-inline: 0; inset-block-end: max(1rem, env(safe-area-inset-bottom)); display: flex; justify-content: center; padding-inline: 1rem; pointer-events: none; opacity: 0; transform: translateY(16px); transition: opacity .35s var(--ease), transform .35s var(--ease); }
.gift-dock.show { opacity: 1; transform: none; }
.gift-dock-inner { display: flex; align-items: center; gap: .75rem; max-width: 100%; min-height: 58px; padding-block: .45rem; padding-inline: 1.1rem .45rem; border-radius: var(--radius-pill); background: var(--athar-green); color: var(--athar-cream); text-decoration: none; font-weight: 700; box-shadow: 0 16px 40px rgba(28, 22, 14, .3); }
.gift-dock.show .gift-dock-inner { pointer-events: auto; }
.gift-dock-text { white-space: nowrap; }
.gift-dock-cta { display: inline-flex; align-items: center; gap: .35rem; min-height: 46px; padding-inline: 1.1rem; border-radius: var(--radius-pill); background: var(--athar-cream); color: var(--athar-green); font-weight: 800; white-space: nowrap; }
.gift-dock-cta .ms { font-size: 1.2rem; }
@media (min-width: 961px) { .gift-dock { display: none; } }

/* adopted: the name it carries, the message, the record */
.adopt-card { overflow: hidden; isolation: isolate; display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(1.75rem, 5vw, 4.5rem); padding: clamp(1.75rem, 4.5vw, 4rem); border-radius: 32px; }
.adopt-wm { position: absolute; z-index: -1; inset-block-end: -34%; inset-inline-end: -4%; width: clamp(200px, 22vw, 340px); height: auto; opacity: .3; pointer-events: none; }
.adopt-main { display: grid; justify-items: start; align-content: center; }
.adopt-by { display: inline-flex; align-items: center; gap: .5rem; font-size: .9375rem; font-weight: 700; color: var(--athar-brown); }
.adopt-by .ms { font-size: 1.25rem; color: var(--athar-green); }
html[lang="ar"] .adopt-by { font-size: 1rem; }
.adopt-name { margin-block-start: .6rem; font-size: clamp(2.4rem, 5vw, 4.4rem); font-weight: 800; color: var(--athar-brown); line-height: 1; letter-spacing: -0.025em; overflow-wrap: anywhere; }
html[lang="ar"] .adopt-name { font-family: var(--font-arabic-display); font-weight: 700; letter-spacing: 0; line-height: 1.3; }
.adopt-main .rule { margin-block: 1.4rem 0; }
.adopt-quote { margin: 1.5rem 0 0; }
.adopt-quote p { font-size: clamp(1.2rem, 1.8vw, 1.55rem); line-height: 1.45; color: var(--athar-green); max-width: 34ch; text-wrap: pretty; }
html[lang="ar"] .adopt-quote p { line-height: 1.75; }
.adopt-quote footer { margin-block-start: .6rem; font-weight: 700; font-size: .9375rem; color: var(--athar-brown); }
.adopt-side { display: grid; gap: 1.5rem; align-content: center; justify-items: start; padding-inline-start: clamp(0rem, 3.5vw, 3.5rem); border-inline-start: 1px solid var(--line); }
.adopt-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem 1.5rem; width: 100%; margin: 0; }
.adopt-grid dt { font-size: .75rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--athar-brown); }
html[lang="ar"] .adopt-grid dt { letter-spacing: 0; font-size: .875rem; }
.adopt-grid dd { margin: .2rem 0 0; font-weight: 600; font-size: 1.0625rem; }
.adopt-grid dd .tree-id { font-size: .8125rem; letter-spacing: .04em; }
.adopt-card > .promise { grid-column: 1 / -1; max-width: none; border-block-start: 1px solid var(--line); padding-block-start: 1.25rem; }

/* available: both paths, side by side, then the promise */
.avail-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 1.5rem clamp(2rem, 5vw, 4rem); padding: clamp(1.75rem, 4vw, 3.25rem); border-radius: 32px; }
.avail-title { font-weight: 800; color: var(--athar-green); font-size: clamp(1.5rem, 2.4vw, 2rem); line-height: 1.2; }
html[lang="ar"] .avail-title { font-family: var(--font-arabic-display); font-weight: 700; line-height: 1.4; }
.avail-body { color: var(--muted); margin-block-start: 1.1rem; max-width: 52ch; }
.avail-actions { display: flex; flex-wrap: wrap; gap: .75rem; justify-content: flex-end; }
.avail-card > .promise { grid-column: 1 / -1; padding-block-start: 1.25rem; border-block-start: 1px solid var(--line); max-width: none; }

/* in honour of the late Sheikh Zayed: a plate of dedication, in the earth colour */
.tree-honour {
  position: relative; overflow: hidden; isolation: isolate;
  display: grid; justify-items: center; text-align: center;
  padding: clamp(2.75rem, 6vw, 5.5rem) clamp(1.5rem, 5vw, 4rem);
  border-radius: 32px; background: var(--athar-brown); color: var(--athar-cream);
  box-shadow: 0 30px 60px rgba(104, 73, 37, .22);
}
.tree-honour-wm { position: absolute; z-index: -1; inset-block-end: -24%; inset-inline-start: -4%; width: clamp(220px, 26vw, 400px); height: auto; opacity: .07; pointer-events: none; }
.tree-honour-head { display: grid; justify-items: center; margin: 0; font: inherit; color: inherit; }
.tree-honour-title { display: block; font-weight: 300; font-size: clamp(1.5rem, 2.8vw, 2.5rem); line-height: 1.2; letter-spacing: -0.01em; color: var(--athar-cream); text-wrap: balance; }
html[lang="ar"] .tree-honour-title { font-family: var(--font-arabic-display); font-weight: 400; line-height: 1.5; letter-spacing: 0; }
.tree-honour-who { display: inline-grid; justify-items: center; gap: .25rem; max-width: 100%; margin-block-start: .35rem; }
.tree-honour-who .lt { font-weight: 300; font-size: clamp(1.15rem, 1.8vw, 1.5rem); line-height: 1.4; color: var(--athar-sand); }
html[lang="ar"] .tree-honour-who .lt { font-weight: 400; }
.tree-honour-who strong { font-weight: 800; font-size: clamp(1.75rem, 3.5vw, 3.1rem); line-height: 1.12; letter-spacing: -0.015em; color: var(--athar-cream); text-wrap: balance; }
html[lang="ar"] .tree-honour-who strong { font-family: var(--font-arabic-display); font-weight: 700; line-height: 1.55; letter-spacing: 0; }
/* the UAE flag rule under the name, as on the deck and the home page (the flag keeps its own orientation) */
.tree-honour-flag { justify-self: stretch; display: grid; grid-template-columns: .55rem 1fr; height: 10px; margin-block-start: .9rem; direction: ltr; border-radius: 2px; overflow: hidden; }
.tree-honour-flag > i { display: block; background: #EF3340; }
.tree-honour-flag > b { display: grid; grid-template-rows: repeat(3, 1fr); }
.tree-honour-flag > b > i { display: block; }
.tree-honour-flag > b > i:nth-child(1) { background: #009739; }
.tree-honour-flag > b > i:nth-child(2) { background: #FFFFFF; }
.tree-honour-flag > b > i:nth-child(3) { background: #1C1C18; }
.tree-honour-body { max-width: 44ch; margin-block-start: clamp(1.75rem, 3.5vw, 2.5rem); font-size: clamp(1.0625rem, 1.3vw, 1.1875rem); line-height: 1.6; color: var(--athar-cream); opacity: .88; text-wrap: pretty; }
html[lang="ar"] .tree-honour-body { font-size: clamp(1.125rem, 1.4vw, 1.25rem); line-height: 1.85; }
.tree-honour-link { display: block; max-width: 100%; padding-block: .55rem; margin-block-start: 1.1rem; line-height: 1.5; text-align: center; text-wrap: balance; color: var(--athar-cream); font-weight: 700; text-decoration: underline; text-decoration-color: rgba(252, 248, 239, .38); text-underline-offset: 6px; transition: text-decoration-color .2s; }
/* the arrow follows the last word when the line wraps, and stays out of the underline */
.tree-honour-link .ms { display: inline-block; vertical-align: -.22em; margin-inline-start: .4rem; font-size: 1.2rem; text-decoration: none; }
.tree-honour-link:hover { text-decoration-color: var(--athar-cream); }
.tree-honour-actions { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: .75rem 1.75rem; margin-block-start: 1.75rem; }
.tree-honour-actions .tree-honour-link { margin-block-start: 0; }
/* the certificate page of an honour tree: the same plate, across the state's width */
.d-honour .d-state-inner > .label { margin-block-end: 1.25rem; }
.d-honour .tree-honour { justify-self: stretch; }

/* the one next step, before the closing band; its line breaks evenly, never leaving one word alone */
.tree-next { padding-block: clamp(1rem, 2vw, 1.5rem) clamp(2.5rem, 5vw, 4rem); }
body[data-page="tree"] .next-step .t, body[data-page="certificate"] .next-step .t { text-wrap: balance; }

/* ---------- section heads ---------- */
.tree-head .label { margin-block-end: .9rem; }
.tree-head .lead { max-width: 34ch; }

/* ---------- in numbers: the deck's data scale, sand → tan → brown → green ---------- */
.tree-impact-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 24rem); align-items: end; gap: 1rem clamp(2rem, 6vw, 6rem); margin-block-end: clamp(2rem, 4vw, 3.25rem); }
.tree-impact-head .rule { margin-block-end: 0; }
.tree-impact-head > .lead { max-width: 30ch; }
.tree-vline { display: flex; flex-wrap: wrap; align-items: baseline; }
.tree-blocks .block { min-height: clamp(9.5rem, 13vw, 12rem); display: flex; flex-direction: column; align-items: flex-start; padding: clamp(1.25rem, 2vw, 1.75rem); }
.tree-blocks .block .v { font-size: clamp(2.4rem, 4.2vw, 3.75rem); }
.tree-blocks .block .k { margin-block-start: auto; padding-block-start: 1rem; }

/* ---------- its place: the map through a round lens, the tree at the centre of fingerprint rings ---------- */
.tree-place-grid { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: clamp(2.5rem, 6vw, 6.5rem); align-items: center; }
.tree-lens { margin: 0; display: grid; justify-items: center; gap: 1.6rem; }
.tree-lens-wrap { position: relative; width: min(calc(100% - 40px), 540px); aspect-ratio: 1; margin-block-start: 20px; }
.tree-lens-wrap::before { content: ""; position: absolute; inset: -20px; border-radius: 50%; border: 1px solid rgba(104, 73, 37, .28); pointer-events: none; }
.tree-lens-disc { position: absolute; inset: 0; isolation: isolate; overflow: hidden; border-radius: 50%; background: var(--athar-sand); box-shadow: 0 34px 70px rgba(104, 73, 37, .18), 0 4px 12px rgba(56, 40, 20, .06); transform: translateZ(0); }
/* the rim fades into sand, so the streets read as a picture, not a widget */
.tree-lens-disc::after { content: ""; position: absolute; inset: 0; z-index: 2; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(104, 73, 37, .12), inset 0 0 46px 12px rgba(233, 222, 202, .8); pointer-events: none; }
.tree-map { position: absolute; inset: 0; z-index: 1; opacity: 0; transition: opacity .8s var(--ease); background: var(--athar-sand); }
.tree-map.leaflet-container { background: var(--athar-sand); }
.tree-lens.ready .tree-map { opacity: 1; }
.tree-map .leaflet-tile-pane { filter: sepia(.4) saturate(.8) contrast(1.08); }
.tree-lens-rings {
  position: absolute; inset: 0; z-index: 3; pointer-events: none;
  background: repeating-radial-gradient(circle at 50% 50%, transparent 0 13px, rgba(104, 73, 37, .34) 13px 14.2px);
  -webkit-mask-image: radial-gradient(circle at 50% 50%, transparent 0 5%, black 8.5%, black 21%, transparent 43%);
  mask-image: radial-gradient(circle at 50% 50%, transparent 0 5%, black 8.5%, black 21%, transparent 43%);
}
.tree-lens-pin { position: absolute; z-index: 4; inset: 0; margin: auto; width: 30px; height: 30px; display: grid; place-items: center; }
.tree-lens-pin::before { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--athar-green); opacity: 0; }
.tree-lens-pin.brown::before, .tree-lens-pin.tan::before { border-color: var(--athar-brown); }
.tree-pin { display: block; width: 22px; height: 22px; border-radius: 50%; background: var(--athar-green); border: 4px solid var(--athar-ivory); box-shadow: 0 0 0 9px rgba(63, 89, 59, .18), 0 4px 10px rgba(56, 40, 20, .35); }
.tree-pin.brown { background: var(--athar-brown); box-shadow: 0 0 0 9px rgba(104, 73, 37, .18), 0 4px 10px rgba(56, 40, 20, .35); }
.tree-pin.tan { background: var(--athar-tan); box-shadow: 0 0 0 9px rgba(200, 176, 138, .3), 0 4px 10px rgba(56, 40, 20, .35); }
.tree-map-open { position: absolute; inset: 0; z-index: 5; border-radius: 50%; }
.tree-map-open:focus-visible { outline-offset: 6px; border-radius: 50%; }
.tree-lens-cap { display: grid; justify-items: center; gap: .3rem; text-align: center; }
.tree-coords { font-family: var(--font-id); font-size: .8125rem; letter-spacing: .06em; color: var(--id-grey); }
.tree-lens-attr { font-size: .6875rem; color: var(--muted); }
.tree-lens-attr a { color: inherit; }
@media (prefers-reduced-motion: no-preference) {
  .tree-lens-pin::before { animation: tree-ping 3s var(--ease) infinite; }
}
@keyframes tree-ping { 0% { opacity: .8; transform: scale(.7); } 100% { opacity: 0; transform: scale(3.2); } }

.tree-place-text { display: grid; justify-items: start; }
.tree-place-row { margin-block: .25rem 1.75rem; }
.tree-place-row .title { font-size: 1.25rem; }
html[lang="ar"] .tree-place-row .title { font-family: var(--font-arabic-display); font-weight: 700; }
.tree-place-actions { --cluster: 1rem 1.5rem; }
.tree-state .link, .tree-place .link { min-height: 44px; }

/* ---------- journey + care ---------- */
.tree-records-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(2.5rem, 5vw, 5rem); align-items: start; }
.tree-col .tree-head { margin-block-end: 2rem; }
.tree-journey { padding: clamp(1.5rem, 3vw, 2.25rem); }
.tree-tl-meta { display: flex; flex-wrap: wrap; gap: .25rem .75rem; align-items: center; }
.tree-tl-meta .when { direction: ltr; unicode-bidi: isolate; }
.tree-tl-kind { font-size: .75rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--athar-brown); }
html[lang="ar"] .tree-tl-kind { letter-spacing: 0; font-size: .875rem; }
.timeline .what { margin-block-start: .15rem; line-height: 1.45; }
.tree-care { padding: 0; }
.tree-care > li { display: flex; gap: 1rem; align-items: flex-start; padding: 1.25rem clamp(1.1rem, 2.4vw, 1.6rem); }
.tree-care > li + li { border-block-start: 1px solid var(--line); }
.tree-care-body { flex: 1; min-width: 0; }
.tree-care-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: .25rem .75rem; }
.tree-care-head .t { font-weight: 800; color: var(--athar-green); }
.tree-care-head .num { font-size: .875rem; font-weight: 600; color: var(--id-grey); }
.tree-care .n { margin-block-start: .15rem; }
.tree-care .by { font-size: .8125rem; color: var(--muted); margin-block-start: .15rem; }
.tree-care-empty p { color: var(--muted); }
.tree-col > .muted.small { margin-block-start: .75rem; }

/* ---------- closing band: share ---------- */
.tree-share .watermark { background-image: url("/assets/logo/athar-mark-white.svg"); opacity: .06; }
.tree-share-inner { position: relative; z-index: 1; max-width: calc(820px + 2 * var(--margin)); display: grid; justify-items: center; text-align: center; }
.tree-share-mark { width: clamp(52px, 5vw, 68px); height: auto; margin-block-end: 1.5rem; }
.tree-share .label { margin-block-end: .9rem; }
.tree-share .rule { margin-inline: auto; }
.tree-share .lead { margin-inline: auto; }
.tree-share-url { margin-block-start: .9rem; font-family: var(--font-id); font-size: .9375rem; letter-spacing: .08em; color: var(--athar-sand); opacity: .9; }
.tree-share-actions { justify-content: center; margin-block-start: 2rem; }
.tree-app { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 1rem 1.5rem; margin-block-start: 1.5rem; }
.tree-share .link { color: var(--athar-sand); min-height: 44px; }
/* the app line wraps as one centred sentence, its phone glyph inline */
.tree-app .link { display: inline; padding-block: .7rem; line-height: 1.5; text-wrap: pretty; }
.tree-app .link .ms { vertical-align: -.25em; margin-inline-end: .35rem; font-size: 1.25em; }

/* ---------- tablet & phone ---------- */
@media (max-width: 1100px) {
  .adopt-card { grid-template-columns: 1fr; }
  .adopt-side { padding-inline-start: 0; border-inline-start: 0; border-block-start: 1px solid var(--line); padding-block-start: 1.5rem; }
}
@media (max-width: 960px) {
  /* one column: date, name, the window and its tag, then the story */
  .tree-hero-grid { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; grid-template-areas: "date" "head" "stage" "body"; }
  .tree-ident { display: contents; }
  .tree-hero-head { grid-area: head; padding-block-start: clamp(1.25rem, 4vw, 2rem); }
  .tree-hero-body { grid-area: body; }
  .tree-hero .display.tree-title { font-size: clamp(3.4rem, 10vw, 5.75rem); }
  html[lang="ar"] .tree-hero .display.tree-title { font-size: clamp(3.2rem, 9.4vw, 5.25rem); }
  /* the window and its tag, centred together */
  .tree-stage { --aw: min(calc((100vw - 2 * var(--margin)) * .74), 440px); --tw: calc(var(--aw) * .52); justify-items: center; margin-block: .5rem calc(var(--aw) * .1 + 1.75rem); }
  .tree-window { margin-inline-start: calc(var(--tw) * .6); }
  .tree-tag { inset-inline-start: calc(var(--tw) * -.6); }
  .g-arrows { display: none; }
  .g-ui { background: none; padding: 1rem; }
  .g-thumbs { display: none; }
  .gift-band, .avail-card { grid-template-columns: 1fr; }
  .avail-actions { justify-content: flex-start; }
  .tree-impact-head { grid-template-columns: 1fr; }
  .tree-place-grid { grid-template-columns: 1fr; }
  .tree-place-text { order: -1; }
  .tree-lens-wrap { width: min(calc(100% - 40px), 460px); }
  .tree-records-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .tree-hero .display.tree-title { font-size: clamp(3rem, 15vw, 4.25rem); }
  html[lang="ar"] .tree-hero .display.tree-title { font-size: clamp(2.8rem, 14vw, 4rem); }
  .tree-title .alt { font-size: .5em; }
  html[lang="ar"] .tree-title .alt { font-size: .52em; }
  .tree-tag-line { display: none; }
  .tree-tag { padding-block-end: calc(var(--tw) * .14); }
  .gift-band { border-radius: 26px; }
  .gift-band-cta .btn { width: 100%; }
  .gift-band-cta p { max-width: none; }
  .adopt-card, .avail-card, .tree-honour { border-radius: 26px; }
  .adopt-grid { gap: 1rem; }
  .adopt-wm { display: none; }
  .avail-actions { display: grid; width: 100%; }
  .avail-actions .btn { width: 100%; }
  .tree-blocks .block { min-height: 8.5rem; padding: 1.15rem; }
  .tree-blocks .block .v { font-size: clamp(2rem, 9vw, 2.6rem); }
  .tree-lens-wrap { width: calc(100% - 32px); margin-block-start: 16px; }
  .tree-lens-wrap::before { inset: -16px; }
  .tree-share-actions { display: grid; width: 100%; }
  .tree-share-actions .btn { width: 100%; }
  .gift-dock-text { display: none; }
  .tree-honour-line strong { font-size: 1.0625rem; }
  html[lang="ar"] .tree-honour-line strong { font-size: 1.125rem; }
  .tree-honour-actions .btn { width: 100%; }
  /* full-page states (the certificate's "no certificate yet"): both paths full width, equal */
  .d-state-actions { display: grid; width: 100%; }
  .d-state-actions .btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .sk, .sk-photo { animation: none; }
  .gift-dock { transition: none; }
}

@media print {
  .gift-dock, .g-ui, .g-thumbs, .tree-map-open, .tree-share-actions, .tree-app, .tree-next { display: none !important; }
  .tree-tag { animation: none !important; }
}

/* =========================================================
   The arrival (14 Oct 2026). The client: on a phone, whoever taps their card should feel the weight
   of it, that they have entered their tree. The tree full bleed, the name it carries set large over
   it, the day count since, the certificate one tap away. The tribute (zayed) keeps the plate above.
   ========================================================= */
.tree-arrive { position: relative; isolation: isolate; display: grid; min-height: calc(100svh - var(--header-h)); overflow: hidden; background: var(--athar-green); color: var(--athar-cream); }
.arrive-photo { position: absolute; inset: 0; z-index: -2; }
.arrive-photo img { width: 100%; height: 100%; object-fit: cover; object-position: center 38%; }
.arrive-photo-empty { position: absolute; inset: 0; background: url("/assets/logo/athar-mark-watermark.svg") center 32% / min(70%, 420px) no-repeat; opacity: .35; }
.arrive-shade { position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    linear-gradient(to top, rgba(24, 35, 22, .96) 0%, rgba(24, 35, 22, .82) 30%, rgba(24, 35, 22, .3) 58%, rgba(24, 35, 22, 0) 74%),
    linear-gradient(to bottom, rgba(24, 35, 22, .5) 0%, rgba(24, 35, 22, 0) 20%); }
.arrive-inner { display: grid; grid-template-rows: auto 1fr auto; padding-block: 1rem 1.1rem; min-width: 0; }
.arrive-top { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.arrive-id { padding: .4rem .85rem; border-radius: var(--radius-pill); background: rgba(252, 248, 239, .16); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); color: var(--athar-cream); font-size: .875rem; letter-spacing: .1em; }
.tree-arrive .status { color: var(--athar-cream); border-color: rgba(252, 248, 239, .45); background: rgba(252, 248, 239, .1); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.arrive-body { align-self: end; display: grid; justify-items: start; max-width: 44rem; min-width: 0; }
.arrive-seal { width: 34px; height: auto; margin-block-end: 1rem; opacity: .95; }
.arrive-kicker { font-size: .78rem; font-weight: 700; letter-spacing: .22em; text-transform: uppercase; color: var(--athar-sand); }
html[lang="ar"] .arrive-kicker { letter-spacing: 0; text-transform: none; font-size: 1.0625rem; font-weight: 600; }
.arrive-name { margin-block-start: .4rem; max-width: 100%; font-family: var(--font-latin); font-weight: 800; font-size: clamp(2.75rem, 13vw, 6.25rem); line-height: .96; letter-spacing: -.025em; color: var(--athar-cream); overflow-wrap: anywhere; text-wrap: balance; }
html[lang="ar"] .tree-arrive:not(.mode-adopted) .arrive-name { font-family: var(--font-arabic); line-height: 1.3; letter-spacing: 0; }
.arrive-rule { display: block; width: 64px; height: 3px; border-radius: 2px; background: var(--athar-sand); margin-block: 1.15rem 1rem; }
.arrive-tree { font-size: 1.125rem; font-weight: 600; line-height: 1.45; color: var(--athar-cream); }
.arrive-since { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .65rem; margin-block-start: .55rem; color: var(--athar-sand); font-size: .95rem; font-weight: 600; }
.arrive-since > .ms { font-size: 1.1rem; color: var(--athar-tan); }
.arrive-day { padding: .18rem .65rem; border-radius: var(--radius-pill); background: rgba(252, 248, 239, .16); color: var(--athar-cream); font-weight: 700; font-size: .8125rem; }
.arrive-actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-block-start: 1.5rem; }
.tree-arrive .tree-tap { margin-block-start: 1rem; }
.arrive-cue { justify-self: center; display: grid; justify-items: center; margin-block-start: 1.4rem; min-height: 44px; color: var(--athar-sand); text-decoration: none; font-size: .75rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; }
html[lang="ar"] .arrive-cue { letter-spacing: 0; text-transform: none; font-size: .875rem; }
.arrive-cue .ms { font-size: 1.4rem; }

@media (prefers-reduced-motion: no-preference) {
  .arrive-photo img { animation: arrive-photo 2.6s cubic-bezier(.2, .7, .2, 1) both; }
  .arrive-top, .arrive-body > *, .arrive-cue { animation: arrive-up .9s cubic-bezier(.2, .7, .2, 1) both; }
  .arrive-top { animation-delay: .2s; }
  .arrive-body > :nth-child(1) { animation-delay: .35s; }
  .arrive-body > :nth-child(2) { animation-delay: .5s; }
  .arrive-body > :nth-child(3) { animation-delay: .65s; }
  .arrive-body > :nth-child(n+4) { animation-delay: 1s; }
  .arrive-body > .arrive-rule { animation: arrive-rule .9s cubic-bezier(.2, .7, .2, 1) .9s both; }
  .arrive-cue { animation-delay: 1.3s; }
  .arrive-cue .ms { animation: arrive-cue 2.4s ease-in-out 2.4s infinite; }
}
@keyframes arrive-photo { from { transform: scale(1.12); filter: saturate(.45) brightness(.8); } to { transform: none; filter: none; } }
@keyframes arrive-up { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes arrive-rule { from { opacity: 0; transform: scaleX(0); } to { opacity: 1; transform: none; } }
@keyframes arrive-cue { 0%, 100% { transform: none; } 50% { transform: translateY(5px); } }
.arrive-rule { transform-origin: 0 50%; }
html[dir="rtl"] .arrive-rule { transform-origin: 100% 50%; }

@media (min-width: 961px) {
  .tree-arrive { min-height: min(calc(100svh - var(--header-h)), 920px); }
  .arrive-inner { padding-block: 1.5rem 1.75rem; }
  /* tree photos are portrait: on a wide screen show the whole tree, sharp, beside the words, over a soft
     wash of the same photo (cropping it to fill would blow up a few leaves) */
  .arrive-photo { overflow: hidden; }
  .arrive-photo::before { content: ""; position: absolute; inset: -80px; background: var(--photo) center 40% / cover no-repeat; filter: blur(40px) saturate(1.05) brightness(.85); }
  .arrive-photo img { position: absolute; inset-block: 0; inset-inline-end: 0; width: auto; max-width: 62%; height: 100%; object-fit: cover; object-position: center;
    -webkit-mask-image: linear-gradient(to right, transparent, #000 24%); mask-image: linear-gradient(to right, transparent, #000 24%); }
  html[dir="rtl"] .arrive-photo img { -webkit-mask-image: linear-gradient(to left, transparent, #000 24%); mask-image: linear-gradient(to left, transparent, #000 24%); }
  .arrive-shade { background:
    linear-gradient(to top, rgba(24, 35, 22, .92) 0%, rgba(24, 35, 22, .55) 34%, rgba(24, 35, 22, 0) 64%),
    linear-gradient(to bottom, rgba(24, 35, 22, .45) 0%, rgba(24, 35, 22, 0) 18%); }
}

/* the certificate, drawn small: a card you can tap */
.tree-cert-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 25rem); grid-template-areas: "head card" "body card"; column-gap: clamp(2.5rem, 6vw, 6rem); align-items: center; }
.tree-cert-head { grid-area: head; align-self: end; }
.tree-cert-body { grid-area: body; align-self: start; }
.cert-teaser { grid-area: card; }
.tree-cert-actions { margin-block: 1.4rem 1.25rem; }
/* its paper is the sheet's warm parchment (drawn below, with the sheet's) */
.cert-teaser { position: relative; display: grid; justify-items: center; text-align: center; gap: .15rem; width: 100%; padding: 2.1rem 1.5rem 1.4rem; border-radius: 22px; color: var(--athar-ink); text-decoration: none;
  box-shadow: 0 34px 70px rgba(56, 40, 20, .16), 0 6px 16px rgba(56, 40, 20, .08); transform: rotate(-1.5deg); transition: transform .5s cubic-bezier(.2, .7, .2, 1), box-shadow .5s; }
html[dir="rtl"] .cert-teaser { transform: rotate(1.5deg); }
.cert-teaser:hover, .cert-teaser:focus-visible { transform: translateY(-4px) rotate(0deg); box-shadow: 0 40px 80px rgba(56, 40, 20, .2), 0 8px 18px rgba(56, 40, 20, .1); }
.ct-frame { position: absolute; inset: 10px; border: 1px solid rgba(200, 176, 138, .8); border-radius: 14px; pointer-events: none; }
.ct-logo { width: 58px; height: auto; margin-block-end: .45rem; }
.ct-title-ar { font-family: var(--font-arabic); font-weight: 600; font-size: 1.0625rem; line-height: 1.5; color: var(--athar-brown); }
.ct-title-en { font-family: var(--font-latin); font-weight: 800; font-size: 1.25rem; line-height: 1.1; color: var(--athar-green); }
.ct-rule { display: block; width: 40px; height: 3px; border-radius: 2px; background: var(--athar-brown); margin-block: .75rem .65rem; }
.ct-small { font-size: .85rem; color: var(--muted); }
.ct-small.green { color: var(--athar-green); font-weight: 600; }
.ct-name { font-family: var(--font-latin); font-weight: 800; font-size: clamp(1.75rem, 7vw, 2.25rem); line-height: 1.15; color: var(--athar-brown); overflow-wrap: anywhere; }
.ct-id { margin-block-start: .4rem; font-family: var(--font-id); letter-spacing: .14em; color: var(--id-grey); font-weight: 600; direction: ltr; }
/* the sheet's seal row, small: the UAE map with the tree's pin on the start side, the gold seal in the
   middle, the green stamp on the end side crossing the rule above the details, as on the certificate */
.ct-seals { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; width: 100%; margin-block: .85rem .7rem; }
.ct-map { grid-column: 1; justify-self: center; width: 70px; height: auto; overflow: visible; }
/* at this size the sheet's hairline would almost vanish */
.ct-map .map-land { stroke-width: 1.7; }
.ct-seal.foil { grid-column: 2; width: 60px; filter: drop-shadow(0 .6px 1px rgba(56, 40, 20, .22)); }
/* the stamp is 108px, smaller only when its column is too narrow to keep it 5px clear of the seal and the
   frame (phones under about 380px), and moves outward just enough for that: its ink is 96.3% of its box */
.ct-stamp { --s: min(108px, (100% + 2px) * 1.038); grid-column: 3; justify-self: center; position: relative; inset-inline-start: max(0px, 5px + var(--s) * .4815 - 50%); width: var(--s); aspect-ratio: 1; margin-block: -28px -20px; mix-blend-mode: multiply; pointer-events: none; }
/* at this size the certificate no. inside the stamp would be noise */
.ct-stamp .stamp-no { display: none; }
.ct-meta { display: grid; grid-template-columns: repeat(3, auto); justify-content: center; gap: .3rem 1.1rem; width: 100%; padding-block-start: .85rem; border-block-start: 1px solid var(--line); font-size: .8125rem; font-weight: 700; color: var(--athar-ink); }
.ct-meta small { display: block; font-size: .625rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--athar-brown); }
html[lang="ar"] .ct-meta small { letter-spacing: 0; text-transform: none; font-size: .75rem; }
/* no value in the meta row ever breaks (a date or a certificate no. split at its slash or hyphen); on the
   narrowest phones the certificate no. takes a row of its own */
.ct-meta .ltr { white-space: nowrap; }
@media (max-width: 379px) {
  .ct-meta { grid-template-columns: repeat(2, auto); }
  .ct-meta > :last-child { grid-column: 1 / -1; }
}

/* its identity: the story, the facts, the tag on its trunk, its photos */
.tree-identity { background: var(--athar-cream); }
.tree-identity-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 20rem); grid-template-areas: "head tag" "text tag"; column-gap: clamp(2.5rem, 6vw, 6rem); align-items: center; }
.tree-identity-head { grid-area: head; align-self: end; }
.tree-identity-text { grid-area: text; align-self: start; }
.tree-identity-tag { grid-area: tag; }
.tree-identity .tree-story { margin-block-start: .25rem; max-width: 38ch; }
.tree-facts { display: grid; margin-block: 1.5rem 1.25rem; border-block-start: 1px solid var(--line); }
.tree-facts > div { display: grid; grid-template-columns: 9.5rem minmax(0, 1fr); gap: 1rem; padding-block: .85rem; border-block-end: 1px solid var(--line); }
.tree-facts dt { font-size: .75rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--athar-brown); padding-block-start: .15rem; }
html[lang="ar"] .tree-facts dt { letter-spacing: 0; text-transform: none; font-size: .9375rem; padding-block-start: 0; }
.tree-facts dd { font-weight: 600; color: var(--athar-green); }
.tree-identity-tag { --tw: min(15.5rem, 66vw); --aw: 0px; --dir: 1; display: grid; justify-items: center; gap: 1.1rem; }
html[dir="rtl"] .tree-identity-tag { --dir: -1; }
.tree-identity-tag .tree-tag { position: relative; inset: auto; }
.tree-tag-cap { font-size: .9375rem; color: var(--muted); text-align: center; }
.tree-photos { display: grid; grid-auto-flow: column; grid-auto-columns: min(78%, 22rem); gap: 1rem; margin-block-start: clamp(2rem, 4vw, 3rem); overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding-block-end: .5rem; }
.tree-photos::-webkit-scrollbar { display: none; }
.tree-photos figure { margin: 0; scroll-snap-align: start; aspect-ratio: 4 / 5; border-radius: 24px; overflow: hidden; box-shadow: var(--shadow-card); }
.tree-photos img { width: 100%; height: 100%; object-fit: cover; }

/* phones: the tree stays in hand in a slim bar once the arrival has scrolled away */
.tree-bar { display: none; }
@media (max-width: 760px) {
  .arrive-actions { width: 100%; }
  .arrive-actions .btn { flex: 1 1 9rem; justify-content: center; }
  .tree-cert-grid { grid-template-columns: minmax(0, 1fr); grid-template-areas: "head" "card" "body"; row-gap: 1.75rem; }
  .tree-identity-grid { grid-template-columns: minmax(0, 1fr); grid-template-areas: "head" "tag" "text"; row-gap: 1.25rem; }
  .tree-cert-actions .btn { width: 100%; justify-content: center; }
  .cert-teaser { width: min(100%, 22rem); justify-self: center; }
  .tree-identity-tag { padding-block: .25rem .5rem; }
  .tree-facts > div { grid-template-columns: 7.25rem minmax(0, 1fr); gap: .75rem; }
  .tree-bar { position: fixed; z-index: 60; inset-inline: .75rem; bottom: calc(.75rem + env(safe-area-inset-bottom)); display: flex; align-items: center; gap: .7rem;
    padding: .45rem; padding-inline-start: .95rem; border-radius: var(--radius-pill); background: rgba(254, 253, 249, .95); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
    box-shadow: 0 16px 36px rgba(56, 40, 20, .2), 0 2px 6px rgba(56, 40, 20, .08); transform: translateY(150%); opacity: 0; transition: transform .45s cubic-bezier(.2, .7, .2, 1), opacity .3s; }
  .tree-bar.show { transform: none; opacity: 1; }
  .tree-bar-mark { width: 22px; height: auto; flex: none; }
  .tree-bar-text { display: grid; flex: 1; min-width: 0; line-height: 1.25; }
  .tree-bar-id { font-size: .6875rem; }
  .tree-bar-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 800; color: var(--athar-green); }
  .tree-bar-actions { display: flex; gap: .35rem; flex: none; }
  .tree-bar-btn { display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 50%; background: var(--athar-green); color: var(--athar-cream); cursor: pointer; text-decoration: none; }
  .tree-bar-btn + .tree-bar-btn { background: var(--athar-sand); color: var(--athar-brown); }
  .tree-bar-cta { display: inline-flex; align-items: center; gap: .4rem; min-height: 44px; padding-inline: 1rem; border-radius: var(--radius-pill); background: var(--athar-green); color: var(--athar-cream); font-weight: 700; text-decoration: none; }
}
@media (prefers-reduced-motion: reduce) { .tree-bar { transition: none; } }
@media print { .tree-bar, .arrive-cue { display: none !important; } .tree-arrive { min-height: auto; } }

/* the tree's number (client, 14 Oct 2026: «اعرض الرقم 0001 بطريقة تفاخر», then chose the plaque: «خلص هي») */
.arrive-top { align-items: flex-start; }
.arrive-holder { margin-block-end: .55rem; color: var(--athar-tan); font-size: .9375rem; font-weight: 600; letter-spacing: .04em; }
.arrive-holder b { font-weight: 800; color: var(--athar-cream); letter-spacing: .06em; }
html[lang="ar"] .arrive-holder { letter-spacing: 0; font-size: 1.0625rem; }

/* the number on the certificate card and in the phone bar */
.ct-no { display: inline-flex; align-items: baseline; gap: .3rem; margin-block-start: .5rem; direction: ltr; font-family: var(--font-latin); font-weight: 800; font-size: 1.9rem; line-height: 1; color: var(--athar-brown); }
.ct-no small { font-size: .7rem; font-weight: 700; letter-spacing: .2em; color: #A88B5E; }
.ct-no + .ct-id { margin-block-start: .2rem; font-size: .75rem; }
.tree-bar-id b { font-weight: 800; color: var(--athar-brown); letter-spacing: .04em; }
.tree-bar-id .tree-id { font-size: 1em; }

/* a gift message and its giver on the arrival */
.arrive-message { display: grid; gap: .3rem; max-width: 36ch; margin-block-start: .9rem; font-size: 1.0625rem; line-height: 1.55; color: var(--athar-cream); }
.arrive-from { color: var(--athar-tan); font-size: .9375rem; font-weight: 700; }

/* the plaque: the number as the label hung on the tree */
.num-plaque { display: grid; justify-items: center; gap: .15rem; padding: .7rem 1.1rem .6rem; border-radius: 14px;
  background: linear-gradient(165deg, var(--athar-ivory) 30%, var(--athar-cream)); color: var(--athar-brown);
  box-shadow: inset 0 0 0 1px rgba(200, 176, 138, .9), inset 0 0 0 4px var(--athar-ivory), inset 0 0 0 5px rgba(200, 176, 138, .55), 0 16px 34px rgba(12, 18, 11, .35); }
.np-k { font-size: .66rem; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; color: #8B6F45; }
html[lang="ar"] .np-k { letter-spacing: 0; text-transform: none; font-size: .8125rem; }
.np-n { font-family: var(--font-latin); font-weight: 800; font-size: 2.25rem; line-height: 1; letter-spacing: .04em; color: var(--athar-brown); }
.np-s { font-family: var(--font-id); font-size: .6rem; letter-spacing: .18em; color: var(--id-grey); direction: ltr; }

@media (prefers-reduced-motion: no-preference) {
  .num-plaque { animation: arrive-up 1s cubic-bezier(.2, .7, .2, 1) .3s both; }
}

/* when the photo was taken, under the status */
.arrive-flags { display: grid; justify-items: end; gap: .45rem; }
.arrive-shot { display: inline-flex; align-items: center; gap: .3rem; padding: .25rem .6rem; border-radius: 999px; background: rgba(24, 35, 22, .38); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); color: var(--athar-cream); font-size: .75rem; font-weight: 600; }
.arrive-shot .ms { font-size: .95rem; opacity: .9; }

/* ---------- the certificate's paper and its small UAE map ----------
   Shared by the sheet (certificate.css) and the teaser above. The client's warm card (19 Oct 2026:
   «ليك الصفار والديزاين الحلو واللون المصفر ضيفها لشهادتنا»): its yellowish paper, its gold-brown and
   its map with a green pin, merged into the approved sheet. Brand tokens only, no new colours:
   - the paper: Dune at the heart, Sand toward the edges, under a soft Tan veil that is 10% at the heart
     and deepens to 46% at the corners (the vignette), so it reads cream-gold like the client's card.
     Printed without "background graphics" it is plain white paper, and every line, the map and the logo
     stay as they are (none of them is a background).
   - the gold-brown (the logo, the map's line and islands): Tan 40% + Brown 60% (#8E724D in sRGB), the
     certificate foil tone recorded in brand/athar/README.md (§3, derived tones). The logo is the
     approved mono logo in that colour (img/cert/athar-logo-mono-gold.svg: the same paths as
     athar-logo-mono-brown.svg, the brand's foil treatment); at the sheet's size (under the primary
     lockup's 96px minimum) the guide asks for mono anyway.
   - the name's halo (--cert-halo): the paper's own colour where the name sits, Dune 90% + Tan 10% (the
     veil's 10% at the heart, #EBE2CD), so it is invisible on the parchment and only fades the guilloche. */
.cert, .cert-teaser {
  --cert-paper: var(--athar-dune);
  --cert-halo: #EBE2CD;
  --cert-gold: #8E724D;
  background-color: var(--athar-dune);
  background-image:
    radial-gradient(farthest-corner at 50% 42%, rgba(200, 176, 138, .1) 45%, rgba(200, 176, 138, .46) 100%),
    radial-gradient(farthest-corner at 50% 38%, var(--athar-dune) 15%, var(--athar-sand) 85%);
}
@supports (color: color-mix(in srgb, red 50%, blue)) {
  .cert, .cert-teaser {
    --cert-gold: color-mix(in srgb, var(--athar-tan) 40%, var(--athar-brown));
    --cert-halo: color-mix(in srgb, var(--athar-dune) 90%, var(--athar-tan));
  }
}
/* the map (uaeMapSVG() in tree-shared.js): the outline as a gold-brown hairline, the islands as gold-brown
   dots (Abu Musa and the Tunbs among them), the pin in ATHAR green with a paper-coloured edge, so it stays
   clear where it stands on the coast */
.map-land { fill: none; stroke: var(--cert-gold); stroke-width: 1.2; stroke-linejoin: round; stroke-linecap: round; }
.map-isles { fill: var(--cert-gold); stroke: none; }
.map-pin { fill: var(--athar-green); stroke: var(--cert-paper); stroke-width: 1.6; stroke-linejoin: round; paint-order: stroke; }

/* ---------- the certificate's gold foil seal and registry stamp ----------
   Drawn by foilSealHTML() and stampSVG() in tree-shared.js; shared by the certificate (certificate.html
   loads this file before certificate.css) and the teaser above. */
/* the seal: a rosette-edged medallion (60 round lobes) in brand Tan with a deeper rim and a light sheen, a fine inner ring,
   the mark embossed (raised highlight below, shade above). It is its own size container, so the rims
   and the emboss scale with it (1cqi = 1% of the seal). */
.foil { container-type: inline-size; display: block; aspect-ratio: 1; }
.foil-disc { position: relative; display: grid; place-items: center; width: 100%; height: 100%;
  -webkit-mask: url("/assets/img/cert/foil-edge.svg") center / 100% 100% no-repeat; mask: url("/assets/img/cert/foil-edge.svg") center / 100% 100% no-repeat;
  background:
    radial-gradient(circle at 32% 26%, rgba(254, 253, 249, .85) 0, rgba(254, 253, 249, .25) 22%, rgba(254, 253, 249, 0) 46%),
    repeating-conic-gradient(from 0deg, rgba(254, 253, 249, .16) 0deg 1.2deg, rgba(104, 73, 37, .07) 1.2deg 3deg),
    conic-gradient(from 210deg, #C8B08A, #E9DECA 12%, #C8B08A 24%, #A88B5E 40%, #C8B08A 55%, #E9DECA 68%, #A88B5E 82%, #C8B08A);
}
/* the rim: a darker band at the scallops, then the fine double ring */
.foil-disc::before { content: ""; position: absolute; inset: 0; border-radius: 50%; box-shadow: inset 0 0 0 max(1.5px, 3.6cqi) rgba(168, 139, 94, .55); }
.foil-ring { position: absolute; inset: 15%; border-radius: 50%; border: max(.5px, 1cqi) solid rgba(104, 73, 37, .45); box-shadow: 0 0 0 max(.5px, 1cqi) rgba(254, 253, 249, .55), inset 0 0 0 max(.5px, 1cqi) rgba(254, 253, 249, .45); }
.foil-emboss { position: relative; display: grid; place-items: center; width: 44%; aspect-ratio: 149.6 / 189.1;
  filter: drop-shadow(0 max(.5px, 1.2cqi) 0 rgba(254, 253, 249, .95)) drop-shadow(0 min(-.5px, -1.2cqi) 0 rgba(104, 73, 37, .6)); }
.foil-mark { width: 100%; height: 100%; background: linear-gradient(160deg, #C8B08A, #A88B5E 60%, #684925);
  -webkit-mask: url("/assets/logo/athar-mark.svg") center / contain no-repeat; mask: url("/assets/logo/athar-mark.svg") center / contain no-repeat; }

/* the stamp: green ink, slightly see-through, about 10° off true the way a hand presses it. Sizes are
   in the stamp's own 200-unit box. The element that places it sets mix-blend-mode: multiply. */
.stamp { display: block; width: 100%; height: 100%; color: var(--athar-green); opacity: .86; transform: rotate(-10deg); direction: ltr; overflow: visible; }
.stamp.blank { opacity: .16; }
.stamp text { font-family: var(--font-latin); text-anchor: middle; }
.stamp .stamp-ring { font-size: 11.4px; font-weight: 800; text-anchor: start; }
.stamp .stamp-band { font-size: 11.5px; font-weight: 800; letter-spacing: 1.3px; }
.stamp .stamp-band-ar { font-family: var(--font-arabic); font-size: 13px; font-weight: 700; letter-spacing: 0; }
.stamp .stamp-date { font-family: var(--font-num); font-size: 15px; font-weight: 700; letter-spacing: .6px; }
.stamp .stamp-no { font-family: var(--font-id); font-size: 8.2px; font-weight: 700; letter-spacing: .4px; }

/* irrigation and care first, the timeline last: one column each (client, 20 Oct 2026) */
.tree-records-grid.one { grid-template-columns: minmax(0, 1fr); max-width: 52rem; }
/* the certificate without its preview card: the words and one button (client, 20 Oct 2026) */
.tree-cert.compact .tree-cert-grid { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "head body"; align-items: end; }
.tree-cert.compact .tree-cert-body { align-self: end; }
@media (max-width: 760px) {
  .tree-cert.compact .tree-cert-grid { grid-template-columns: minmax(0, 1fr); grid-template-areas: "head" "body"; }
}
