/* ==========================================================================
   Design system — موقع الشركة (RTL)
   Tokens → base → components → sections → editor → motion
   ========================================================================== */

/* ---------- 1. Tokens ---------- */
:root {
  --h: 165; --h2: 85;
  --bg: oklch(0.985 0.005 var(--h));
  --bg2: oklch(0.957 0.014 var(--h));
  --surface: oklch(1 0 0);
  --fg: oklch(0.23 0.02 var(--h));
  --muted: oklch(0.46 0.02 var(--h));
  --line: oklch(0.91 0.01 var(--h));
  --primary: oklch(0.34 0.085 var(--h));
  --primary-2: oklch(0.45 0.1 calc(var(--h) + 18));
  --on-primary: oklch(0.985 0.005 var(--h));
  --head: oklch(0.34 0.085 var(--h));
  --accent: oklch(0.83 0.15 var(--h2));
  --accent-2: oklch(0.72 0.16 calc(var(--h2) - 14));
  --on-accent: oklch(0.26 0.06 var(--h));
  --danger: oklch(0.52 0.2 27);
  --ok: oklch(0.58 0.15 150);
  --glass: color-mix(in oklab, var(--surface) 72%, transparent);
  --glass-line: color-mix(in oklab, var(--fg) 12%, transparent);

  --r-sm: 10px; --r-md: 16px; --r-lg: 24px; --r-pill: 999px;
  --sh-1: 0 1px 2px rgb(15 30 25 / .05), 0 1px 1px rgb(15 30 25 / .03);
  --sh-2: 0 2px 4px rgb(15 30 25 / .04), 0 8px 20px -6px rgb(15 30 25 / .10);
  --sh-3: 0 4px 8px rgb(15 30 25 / .04), 0 24px 48px -12px rgb(15 30 25 / .20);
  --ease: cubic-bezier(.22, 1, .36, 1);
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);

  --f-display: 'Readex Pro', 'IBM Plex Sans Arabic', Tahoma, system-ui, sans-serif;
  --f-body: 'IBM Plex Sans Arabic', Tahoma, system-ui, sans-serif;
  --pat: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='72' height='72' viewBox='0 0 72 72'%3E%3Cg fill='none' stroke='white' stroke-opacity='.10' stroke-width='1.2'%3E%3Cpath d='M36 6l9 21 21 9-21 9-9 21-9-21-21-9 21-9z'/%3E%3Ccircle cx='36' cy='36' r='7'/%3E%3C/g%3E%3C/svg%3E");
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { color-scheme: dark;
    --bg: oklch(0.19 0.012 var(--h)); --bg2: oklch(0.225 0.014 var(--h)); --surface: oklch(0.26 0.016 var(--h));
    --fg: oklch(0.95 0.01 var(--h)); --muted: oklch(0.75 0.02 var(--h)); --line: oklch(0.34 0.02 var(--h));
    --primary: oklch(0.27 0.06 var(--h)); --head: oklch(0.88 0.06 var(--h)); --accent: oklch(0.8 0.14 var(--h2));
    --danger: oklch(0.72 0.16 27);
    --sh-1: 0 1px 2px rgb(0 0 0 / .3); --sh-2: 0 8px 20px -6px rgb(0 0 0 / .5); --sh-3: 0 24px 48px -12px rgb(0 0 0 / .6); }
}

/* ---------- 2. Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: auto; }
body { margin: 0; background: var(--bg); color: var(--fg); font-family: var(--f-body); font-size: 17px; line-height: 1.85; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; overflow-x: hidden; }
img { max-width: 100%; }
h1, h2, h3, h4 { font-family: var(--f-display); font-weight: 700; text-wrap: balance; margin: 0; }
p { margin: 0 0 1em; }
button, input, select, textarea { font: inherit; color: inherit; }
button { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 3px; border-radius: 6px; }
[hidden] { display: none !important; }
::selection { background: color-mix(in oklab, var(--accent) 55%, transparent); }
.in { max-width: 1160px; margin-inline: auto; padding-inline: max(20px, env(safe-area-inset-left, 0px)) max(20px, env(safe-area-inset-right, 0px)); }
.skip { position: fixed; top: -80px; inset-inline-start: 12px; z-index: 100; background: var(--surface); color: var(--fg); padding: 10px 18px; border-radius: var(--r-sm); box-shadow: var(--sh-3); transition: top .2s var(--ease); }
.skip:focus { top: 12px; }
.glass { background: var(--glass); -webkit-backdrop-filter: blur(18px) saturate(1.5); backdrop-filter: blur(18px) saturate(1.5); border: 1px solid var(--glass-line); }

/* ---------- 3. Components ---------- */
/* buttons */
.btn, .hcta, .mini, .btn-pri { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; cursor: pointer; line-height: 1.5; white-space: nowrap; user-select: none; }
.btn { margin-top: 14px; padding: 13px 32px; border-radius: var(--r-pill); font-weight: 700; font-size: 1.05rem; color: var(--on-accent); background: linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: 0 8px 22px -6px color-mix(in oklab, var(--accent-2) 70%, transparent), inset 0 1px 0 rgb(255 255 255 / .45); }
.hcta { padding: 9px 22px; border-radius: var(--r-pill); font-weight: 700; font-size: .95rem; color: var(--on-accent); background: linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: inset 0 1px 0 rgb(255 255 255 / .45); }
.btn:hover, .hcta:hover { transform: translateY(-2px); filter: brightness(1.05); }
.btn:active, .hcta:active, .mini:active, .btn-pri:active { transform: scale(.96); }
.mini { min-height: 34px; padding: 0 14px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--surface); color: var(--fg); font-size: .85rem; box-shadow: var(--sh-1); }
.mini:hover { border-color: var(--head); color: var(--head); transform: translateY(-1px); box-shadow: var(--sh-2); }
.mini:disabled { opacity: .4; cursor: default; transform: none; box-shadow: none; }
.mini.danger { color: var(--danger); border-color: color-mix(in oklab, var(--danger) 50%, var(--line)); }
.mini.danger:hover { background: var(--danger); color: #fff; border-color: var(--danger); }
.mini.primary, .btn-pri { color: var(--on-primary); border-color: transparent; background: linear-gradient(135deg, var(--primary), var(--primary-2)); }
.mini.primary:hover { color: var(--on-primary); filter: brightness(1.12); }
.btn-pri { width: 100%; min-height: 50px; border-radius: var(--r-md); font-weight: 700; font-size: 1.05rem; box-shadow: 0 10px 24px -8px color-mix(in oklab, var(--primary) 80%, transparent); }
.btn-pri:hover { filter: brightness(1.1); transform: translateY(-1px); }
.spin { display: none; width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid currentColor; border-inline-end-color: transparent; animation: spin .7s linear infinite; }
.loading .spin { display: inline-block; } .loading .lbl { opacity: .7; }
.done .lbl::after { content: " ✓"; }
@keyframes spin { to { transform: rotate(360deg); } }

/* cards / chips / forms */
.chip { padding: 3px 12px; border-radius: var(--r-pill); background: color-mix(in oklab, var(--accent) 25%, var(--surface)); color: var(--head); font-weight: 600; border: 1px solid color-mix(in oklab, var(--accent) 40%, var(--line)); }
.chip.warn { background: var(--bg2); color: var(--muted); font-weight: 500; border-color: var(--line); }
.fld { display: grid; gap: 6px; margin-bottom: 16px; font-weight: 600; font-size: .92rem; }
.fld input { width: 100%; min-height: 48px; padding: 0 16px; border-radius: var(--r-md); border: 1.5px solid var(--line); background: var(--surface); font-weight: 400; transition: border-color .2s, box-shadow .2s; }
.fld input:focus { outline: 0; border-color: var(--accent-2); box-shadow: 0 0 0 4px color-mix(in oklab, var(--accent) 35%, transparent); }
.fld-err { color: var(--danger); font-size: .9rem; margin: -4px 0 14px; animation: fade-in .25s var(--ease); }
select { font-size: .85rem; padding: 6px 10px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--surface); color: var(--fg); max-width: 100%; cursor: pointer; }
.x { position: absolute; inset-block-start: 10px; inset-inline-end: 10px; width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--muted); cursor: pointer; line-height: 1; z-index: 2; display: grid; place-items: center; box-shadow: var(--sh-1); }
.x:hover { color: #fff; background: var(--danger); border-color: var(--danger); transform: rotate(90deg); }

/* ---------- 4. Header ---------- */
#top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 30; transition: box-shadow .3s, background .3s; background: color-mix(in oklab, var(--primary) 88%, transparent); -webkit-backdrop-filter: blur(16px) saturate(1.6); backdrop-filter: blur(16px) saturate(1.6); color: var(--on-primary); border-bottom: 1px solid rgb(255 255 255 / .12); }
#top.scrolled { box-shadow: 0 10px 30px -12px rgb(0 0 0 / .45); }
#top-in { display: flex; align-items: center; gap: 14px; min-height: 72px; }
.brand { display: flex; align-items: center; gap: 12px; font-family: var(--f-display); font-weight: 700; font-size: 1.25rem; white-space: nowrap; cursor: pointer; }
.brand img { height: 44px; width: auto; max-width: 160px; object-fit: contain; display: block; }
.brand-mark { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: var(--on-accent); }
.brand-mark svg { width: 20px; height: 20px; }
#nav { display: flex; gap: 2px; margin-inline-start: auto; }
.navlink { position: relative; background: none; border: 0; padding: 8px 14px; border-radius: var(--r-sm); cursor: pointer; white-space: nowrap; font-weight: 600; font-size: .95rem; color: inherit; opacity: .9; }
.navlink::after { content: ""; position: absolute; inset-inline: 14px; bottom: 3px; height: 2px; border-radius: 2px; background: var(--accent); transform: scaleX(0); transition: transform .3s var(--ease); }
.navlink:hover, .navlink.on { opacity: 1; } .navlink:hover::after, .navlink.on::after { transform: scaleX(1); }
.hdr-tools { display: flex; gap: 6px; }
.burger { display: none; width: 44px; height: 44px; margin-inline-start: auto; border: 0; border-radius: var(--r-sm); background: rgb(255 255 255 / .1); cursor: pointer; color: inherit; place-items: center; }
.burger i, .burger i::before, .burger i::after { content: ""; display: block; width: 20px; height: 2px; background: currentColor; border-radius: 2px; transition: transform .3s var(--ease), opacity .2s; }
.burger i { position: relative; } .burger i::before { position: absolute; top: -6px; } .burger i::after { position: absolute; top: 6px; }
.menu-open .burger i { background: transparent; } .menu-open .burger i::before { transform: translateY(6px) rotate(45deg); } .menu-open .burger i::after { transform: translateY(-6px) rotate(-45deg); }
@media (max-width: 860px) {
  .burger { display: grid; }
  #nav { position: fixed; inset: calc(72px + env(safe-area-inset-top, 0px)) 0 auto 0; flex-direction: column; gap: 2px; padding: 12px 20px 24px; margin: 0; background: color-mix(in oklab, var(--primary) 96%, transparent); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); border-bottom: 1px solid rgb(255 255 255 / .12); box-shadow: var(--sh-3); transform: translateY(-12px); opacity: 0; visibility: hidden; transition: transform .35s var(--ease), opacity .25s, visibility .35s; max-height: calc(100dvh - 72px); overflow-y: auto; }
  .menu-open #nav { transform: none; opacity: 1; visibility: visible; }
  .navlink { text-align: start; padding: 14px 12px; font-size: 1.05rem; border-radius: var(--r-md); }
  .navlink::after { display: none; } .navlink:hover { background: rgb(255 255 255 / .08); }
  .hcta { display: none; }
}

/* ---------- 5. Sections ---------- */
.sec { padding-block: clamp(56px, 8vw, 96px); scroll-margin-top: 76px; position: relative; }
.sec.bg2 { background: var(--bg2); }
.sec.is-hidden { opacity: .5; }
.sec h2, .t-h2 { font-size: clamp(1.9rem, 4.2vw, 2.8rem); line-height: 1.3; color: var(--head); margin-bottom: 44px; letter-spacing: -.01em; }
.sec h2::after { content: ""; display: block; width: 64px; height: 5px; border-radius: 3px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); margin-top: 18px; }
.center h2::after, .band h2::after { margin-inline: auto; }
.t-h3 { font-size: 1.25rem; line-height: 1.5; }

/* hero */
.hero { color: #fff; overflow: hidden; background: var(--primary); padding-block: clamp(72px, 11vw, 140px); isolation: isolate; }
.hero .bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.hero .ov { position: absolute; inset: 0; z-index: -1; background: linear-gradient(to left, color-mix(in oklab, var(--primary) 94%, transparent), color-mix(in oklab, var(--primary) 45%, transparent)); }
.hero.noimg .ov { background: var(--pat), radial-gradient(60% 80% at 10% 20%, color-mix(in oklab, var(--accent) 28%, transparent), transparent 60%), radial-gradient(50% 70% at 90% 90%, color-mix(in oklab, var(--primary-2) 70%, transparent), transparent 60%), linear-gradient(135deg, color-mix(in oklab, var(--primary) 100%, #000 18%), var(--primary)); }
.hero.noimg .in { display: grid; gap: 56px; align-items: center; }
@media (min-width: 900px) { .hero.noimg .in { grid-template-columns: 1.25fr .75fr; } }
.hero .in { position: relative; }
.hero h1 { font-size: clamp(2.2rem, 5.8vw, 3.9rem); line-height: 1.3; max-width: 16em; letter-spacing: -.015em; }
.hero .lead { font-size: clamp(1.1rem, 2.4vw, 1.4rem); opacity: .92; max-width: 32em; margin-top: 22px; }
.hero-art { display: none; position: relative; aspect-ratio: 1; width: 100%; max-width: 360px; justify-self: center; }
@media (min-width: 900px) { .hero-art { display: block; } }
.hero-art i { position: absolute; display: block; border-radius: 32px; }
.hero-art i:nth-child(1) { inset: 0 22% 22% 0; background: linear-gradient(145deg, color-mix(in oklab, var(--accent) 85%, #fff), var(--accent-2)); transform: rotate(-7deg); box-shadow: 0 30px 60px -10px rgb(0 0 0 / .4); animation: float 7s ease-in-out infinite; }
.hero-art i:nth-child(2) { inset: 16% 0 0 16%; background: var(--pat), color-mix(in oklab, var(--primary) 70%, #fff); border: 1px solid rgb(255 255 255 / .3); box-shadow: 0 36px 70px -12px rgb(0 0 0 / .45); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); animation: float 8s ease-in-out -2s infinite; }
.hero-art i:nth-child(3) { width: 30%; aspect-ratio: 1; border-radius: 50%; border: 8px solid var(--accent); inset-block-start: -6%; inset-inline-end: -4%; animation: float 6s ease-in-out -4s infinite; }
@keyframes float { 0%, 100% { translate: 0 0; } 50% { translate: 0 -14px; } }

/* cards */
.grid3 { display: grid; gap: 24px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 290px), 1fr)); }
.card { position: relative; min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 32px 28px; box-shadow: var(--sh-1); overflow: hidden; }
.card::before { content: ""; position: absolute; inset: 0 0 auto; height: 4px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.card::after { content: ""; position: absolute; inset-inline-end: -40px; inset-block-start: -40px; width: 140px; height: 140px; border-radius: 50%; background: radial-gradient(closest-side, color-mix(in oklab, var(--accent) 22%, transparent), transparent); opacity: 0; transition: opacity .4s; pointer-events: none; }
.card:hover::after { opacity: 1; }
.card .num { width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; background: linear-gradient(135deg, color-mix(in oklab, var(--accent) 38%, var(--surface)), color-mix(in oklab, var(--accent) 18%, var(--surface))); color: var(--head); font-family: var(--f-display); font-size: 1.2rem; font-weight: 700; margin-bottom: 20px; font-variant-numeric: tabular-nums; }
.card p, .card .txt { color: var(--muted); margin: 10px 0 0; }
.card.add, .addcard { display: grid; place-items: center; min-height: 150px; border: 2px dashed var(--line); background: transparent; color: var(--head); cursor: pointer; box-shadow: none; font-weight: 600; border-radius: var(--r-lg); }
.card.add::before, .card.add::after { display: none; }
.card.add:hover, .addcard:hover { border-color: var(--accent-2); background: color-mix(in oklab, var(--accent) 10%, transparent); }
.card .x + .num, .card .x + h3 { padding-inline-end: 34px; }

/* text */
.cols { column-width: 22em; column-gap: 48px; }
.cols p { break-inside: avoid; font-size: 1.1rem; }
.pair { display: grid; gap: 48px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); align-items: start; }
.pair > * { min-width: 0; }
.media { margin: 0; position: relative; aspect-ratio: 4 / 3; max-width: 100%; border-radius: var(--r-lg); overflow: hidden; background: var(--bg2); box-shadow: var(--sh-3); }
.media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.media.empty { display: grid; place-items: center; width: 100%; border: 2px dashed var(--line); box-shadow: none; color: var(--head); cursor: pointer; font-weight: 600; }
.media .mtools, .tt { position: absolute; inset-block-start: 10px; inset-inline-start: 10px; display: flex; gap: 6px; z-index: 2; flex-wrap: wrap; }

/* stats */
.panel { position: relative; overflow: hidden; background: linear-gradient(145deg, var(--surface), var(--bg2)); border: 1px solid var(--line); border-radius: 28px; padding: clamp(32px, 5vw, 60px) 24px; margin-bottom: 36px; box-shadow: var(--sh-2); }
.panel::before { content: ""; position: absolute; inset: 0; background: radial-gradient(40% 60% at 0% 0%, color-mix(in oklab, var(--accent) 16%, transparent), transparent 70%); pointer-events: none; }
.stats { position: relative; display: grid; gap: 32px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); text-align: center; }
@media (min-width: 700px) { .stat + .stat { border-inline-start: 1px solid var(--line); } }
.stat .v { font-family: var(--f-display); font-weight: 700; font-size: clamp(3rem, 9vw, 4.8rem); line-height: 1.2; font-variant-numeric: tabular-nums; background: linear-gradient(135deg, var(--head), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat .v.ed { -webkit-text-fill-color: var(--head); background: none; }
.stat .l { font-size: 1.15rem; color: var(--muted); }
.center { text-align: center; max-width: 46em; margin-inline: auto; }

/* tiles */
.tiles { display: grid; gap: 14px; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 700px) { .tiles { gap: 20px; grid-template-columns: repeat(4, 1fr); } }
.tile { position: relative; aspect-ratio: 1; border-radius: var(--r-lg); overflow: hidden; background: var(--pat), linear-gradient(150deg, color-mix(in oklab, var(--primary) 90%, #000), color-mix(in oklab, var(--primary) 64%, #fff)); box-shadow: var(--sh-2); isolation: isolate; }
.tile:nth-child(4n+2) { background: var(--pat), linear-gradient(150deg, color-mix(in oklab, var(--primary) 75%, #000), color-mix(in oklab, var(--primary) 50%, var(--accent))); }
.tile:nth-child(4n+3) { background: var(--pat), linear-gradient(150deg, color-mix(in oklab, var(--primary) 82%, #000), color-mix(in oklab, var(--primary) 55%, #fff)); }
.tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -1; }
.tile .tl { position: absolute; inset-inline: 0; bottom: 0; padding: 56px 18px 16px; color: #fff; background: linear-gradient(to top, rgb(0 0 0 / .75), transparent); }
.tile h3 { font-size: clamp(.95rem, 2.4vw, 1.2rem); font-weight: 600; color: #fff; line-height: 1.5; }

/* steps band */
.band { color: #fff; background: var(--pat), linear-gradient(135deg, color-mix(in oklab, var(--primary) 100%, #000 18%), var(--primary-2)); overflow: hidden; isolation: isolate; }
.band .bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.band .ov { position: absolute; inset: 0; background: color-mix(in oklab, var(--primary) 80%, transparent); z-index: -1; }
.band .in { position: relative; }
.band h2 { color: #fff; margin-bottom: 16px; }
.band .sub { opacity: .9; max-width: 40em; font-size: 1.2rem; margin: 0 auto 52px; }
.steps { display: grid; gap: 36px; grid-template-columns: 1fr; }
.step { position: relative; text-align: center; min-width: 0; }
.step .c { width: 68px; height: 68px; margin: 0 auto 20px; border-radius: 50%; background: #fff; color: var(--primary); display: grid; place-items: center; font-family: var(--f-display); font-size: 1.6rem; font-weight: 700; box-shadow: 0 10px 24px -6px rgb(0 0 0 / .4), 0 0 0 8px rgb(255 255 255 / .12); position: relative; z-index: 1; transition: transform .4s var(--ease-spring); }
.step:hover .c { transform: scale(1.1) rotate(-6deg); }
.step h3 { font-size: 1.1rem; margin-bottom: 8px; color: #fff; }
.step p, .step .ed.multi { font-size: .95rem; opacity: .88; margin: 0; }
.band .x { background: rgb(255 255 255 / .15); color: #fff; border-color: rgb(255 255 255 / .35); }
@media (min-width: 560px) { .steps { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px) {
  .steps { grid-template-columns: repeat(var(--n, 4), 1fr); }
  .steps.line .step:not(:last-child)::before { content: ""; position: absolute; top: 34px; inset-inline-start: 50%; width: 100%; height: 2px; background: repeating-linear-gradient(90deg, rgb(255 255 255 / .45) 0 8px, transparent 8px 16px); }
}

/* news */
.news { display: grid; gap: 26px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 310px), 1fr)); }
.ncard { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--sh-1); min-width: 0; }
.ncard .im { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: var(--pat), linear-gradient(150deg, color-mix(in oklab, var(--primary) 85%, #000), color-mix(in oklab, var(--primary) 60%, #fff)); }
.ncard .im img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .6s var(--ease); }
.ncard:hover .im img { transform: scale(1.06); }
.ncard .bd { padding: 24px; }
.ncard h3 { font-size: 1.1rem; font-weight: 600; line-height: 1.6; }
.ncard .txt { color: var(--muted); margin: 8px 0 0; font-size: .95rem; }

/* logos */
.logos { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr)); }
.logo { position: relative; height: 124px; background: var(--surface); border-radius: var(--r-md); padding: 18px; display: grid; place-items: center; text-align: center; color: var(--muted); border: 1px solid var(--line); min-width: 0; box-shadow: var(--sh-1); font-weight: 600; }
.logo img { max-width: 100%; max-height: 100%; object-fit: contain; filter: grayscale(1); opacity: .75; transition: filter .3s, opacity .3s; }
.logo:hover img { filter: none; opacity: 1; }

/* faq */
.qas { max-width: 48em; display: grid; gap: 12px; }
.qa { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 6px 22px; box-shadow: var(--sh-1); transition: border-color .3s, box-shadow .3s; }
.qa[open] { border-color: color-mix(in oklab, var(--accent-2) 50%, var(--line)); box-shadow: var(--sh-2); }
.qa summary { cursor: pointer; font-family: var(--f-display); font-weight: 600; list-style: none; padding: 14px 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.qa summary::-webkit-details-marker { display: none; }
.qa summary::after { content: ""; flex: none; width: 10px; height: 10px; border-inline-end: 2px solid var(--head); border-block-end: 2px solid var(--head); transform: rotate(45deg); transition: transform .35s var(--ease); margin-block-end: 4px; }
.qa[open] summary::after { transform: rotate(-135deg); margin-block-end: -4px; }
.qa .a { color: var(--muted); padding-bottom: 14px; animation: fade-in .35s var(--ease); }
.qa .a p:last-child { margin: 0; }
.qa p, .qa .a { margin-top: 0; }
.qa .x { inset-block-start: 14px; }
.qa .x + h3 { padding-inline-end: 34px; padding-block: 12px 4px; }

/* contact */
.cgrid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 270px), 1fr)); }
.ccard { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 28px; min-width: 0; box-shadow: var(--sh-1); }
.ic { width: 50px; height: 50px; border-radius: 16px; display: grid; place-items: center; margin-bottom: 18px; background: linear-gradient(135deg, color-mix(in oklab, var(--accent) 38%, var(--surface)), color-mix(in oklab, var(--accent) 18%, var(--surface))); color: var(--head); }
.ic svg { width: 22px; height: 22px; }
.ccard .lbl { font-weight: 700; color: var(--head); font-family: var(--f-display); margin-bottom: 6px; }
.ccard .val { color: var(--muted); overflow-wrap: anywhere; user-select: text; }
.ccard .mini { margin-top: 12px; }

/* footer */
footer { position: relative; background: linear-gradient(180deg, var(--primary), color-mix(in oklab, var(--primary) 85%, #000)); color: var(--on-primary); padding-block: 72px 32px; }
footer::before { content: ""; position: absolute; inset: 0 0 auto; height: 4px; background: linear-gradient(90deg, var(--accent), var(--accent-2), var(--accent)); }
.fgrid { display: grid; gap: 40px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); margin-bottom: 40px; }
.fgrid > * { min-width: 0; }
.fgrid h4 { color: var(--accent); font-size: 1.05rem; margin-bottom: 16px; }
.fgrid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; font-size: .95rem; opacity: .9; }
.fgrid .f-about { font-size: .95rem; opacity: .85; margin-top: 14px; }
.flink { background: none; border: 0; padding: 0; cursor: pointer; color: inherit; font-size: inherit; transition: color .2s, padding .3s var(--ease); }
.flink:hover { color: var(--accent); padding-inline-start: 6px; }
.copy { border-top: 1px solid rgb(255 255 255 / .18); padding-top: 24px; text-align: center; font-size: .85rem; opacity: .7; }
.copy p { margin: 0; }

/* ---------- 6. Editor ---------- */
.ed { border-radius: 6px; cursor: text; transition: background .2s, outline-color .2s; }
.ed:hover { outline: 1.5px dashed var(--accent-2); outline-offset: 4px; }
.ed:focus { outline: 2px solid var(--accent-2); outline-offset: 4px; background: color-mix(in oklab, var(--accent) 10%, transparent); }
.ed:empty::before { content: attr(data-ph); opacity: .55; }
.ed.multi { white-space: pre-wrap; }
.tw { background: var(--glass); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border-block: 1px solid var(--line); padding-block: 10px; position: relative; z-index: 3; }
.tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: .85rem; line-height: 1.5; }
.target { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 14px; font-size: .85rem; opacity: .95; }
.target select { color: var(--fg); }
.addbar { background: var(--bg); padding-block: 40px; border-top: 1px solid var(--line); }
.addbar p { margin: 0 0 14px; color: var(--muted); font-weight: 600; }
.addbar .btns { display: flex; flex-wrap: wrap; gap: 8px; }
.addrow { margin-top: 22px; }
body.admin #app { padding-bottom: 110px; }

/* admin dock */
#bar { position: fixed; z-index: 50; inset-inline: 12px; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); max-width: 880px; margin-inline: auto; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 22px; box-shadow: var(--sh-3); animation: dock-in .6s var(--ease) both; }
#bar .grow { flex: 1; }
.seg { position: relative; display: inline-flex; padding: 3px; border-radius: 14px; background: var(--bg2); border: 1px solid var(--line); }
.seg button { position: relative; z-index: 1; border: 0; background: transparent; padding: 7px 18px; cursor: pointer; border-radius: 11px; font-weight: 600; font-size: .9rem; transition: color .25s; }
.seg button[aria-pressed="true"] { color: var(--on-primary); background: linear-gradient(135deg, var(--primary), var(--primary-2)); box-shadow: var(--sh-1); }
.dirty-note { display: inline-flex; align-items: center; gap: 6px; font-size: .85rem; color: var(--muted); }
.dirty-note::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent-2); animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.6); opacity: .5; } }
#btn-save.loading { pointer-events: none; }
#btn-save.done { background: var(--ok); }
.prog { position: absolute; inset-inline: 18px; bottom: -1px; height: 3px; border-radius: 3px; background: var(--line); overflow: hidden; opacity: 0; transition: opacity .2s; }
.prog.on { opacity: 1; } .prog b { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width .15s linear; }
#sheet { position: fixed; z-index: 51; inset-inline-start: 24px; bottom: calc(86px + env(safe-area-inset-bottom, 0px)); border-radius: var(--r-md); padding: 16px; max-width: calc(100% - 48px); box-shadow: var(--sh-3); animation: pop-in .3s var(--ease-spring) both; transform-origin: bottom right; }
#sheet p { margin: 0 0 10px; font-size: .9rem; color: var(--muted); font-weight: 600; }
.sw { display: flex; gap: 10px; flex-wrap: wrap; }
.swatch { width: 42px; height: 42px; border-radius: 50%; border: 2px solid var(--surface); box-shadow: 0 0 0 1.5px var(--line); cursor: pointer; padding: 0; transition: transform .3s var(--ease-spring), box-shadow .2s; }
.swatch:hover { transform: scale(1.12); }
.swatch[aria-pressed="true"] { box-shadow: 0 0 0 2.5px var(--fg); }
#toasts { position: fixed; z-index: 70; inset-inline: 0; bottom: calc(92px + env(safe-area-inset-bottom, 0px)); display: grid; justify-items: center; gap: 8px; pointer-events: none; padding-inline: 16px; }
.toast { display: flex; align-items: center; gap: 10px; background: var(--fg); color: var(--bg); padding: 12px 20px; border-radius: var(--r-pill); font-size: .95rem; box-shadow: var(--sh-3); animation: toast-in .45s var(--ease-spring) both; max-width: 100%; }
.toast::before { content: "i"; flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: .8rem; font-weight: 700; background: var(--accent); color: var(--on-accent); }
.toast.ok::before { content: "✓"; background: var(--ok); color: #fff; } .toast.err::before { content: "!"; background: var(--danger); color: #fff; }
.toast.out { animation: toast-out .3s ease both; }
dialog { border: 0; padding: 0; background: transparent; max-width: calc(100% - 32px); }
dialog::backdrop { background: rgb(8 20 16 / .5); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); animation: fade-in .25s both; }
.dlg { width: min(420px, 100%); background: var(--surface); color: var(--fg); border-radius: var(--r-lg); padding: 28px; box-shadow: var(--sh-3); animation: pop-in .35s var(--ease-spring) both; }
.dlg h3 { font-size: 1.2rem; margin-bottom: 8px; } .dlg p { color: var(--muted); margin: 0 0 22px; }
.dlg .row { display: flex; gap: 10px; justify-content: flex-start; flex-wrap: wrap; }
.dlg .mini { min-height: 42px; padding: 0 22px; font-size: .95rem; }
.dlg .mini.danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.empty-state { grid-column: 1 / -1; text-align: center; padding: 48px 20px; border: 2px dashed var(--line); border-radius: var(--r-lg); color: var(--muted); }
.empty-state svg { width: 48px; height: 48px; color: var(--accent-2); margin-bottom: 8px; }
.empty-state strong { display: block; color: var(--head); font-family: var(--f-display); font-size: 1.15rem; margin-bottom: 4px; }

/* ---------- 7. Auth ---------- */
.auth-page { min-height: 100dvh; display: grid; place-items: center; padding: 20px; position: relative; overflow: hidden; background: var(--bg); }
.aurora { position: absolute; inset: 0; z-index: 0; overflow: hidden; }
.aurora i { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .55; }
.aurora i:nth-child(1) { width: 46vmax; height: 46vmax; background: color-mix(in oklab, var(--primary) 70%, transparent); inset: -15vmax auto auto -10vmax; animation: float 12s ease-in-out infinite; }
.aurora i:nth-child(2) { width: 38vmax; height: 38vmax; background: color-mix(in oklab, var(--accent) 60%, transparent); inset: auto -8vmax -14vmax auto; animation: float 14s ease-in-out -3s infinite; }
.aurora i:nth-child(3) { width: 26vmax; height: 26vmax; background: color-mix(in oklab, var(--primary-2) 50%, transparent); inset: 30% auto auto 55%; animation: float 10s ease-in-out -6s infinite; }
.auth-card { position: relative; z-index: 1; width: min(440px, 100%); border-radius: 28px; padding: clamp(28px, 6vw, 44px); box-shadow: var(--sh-3); animation: rise .8s var(--ease) both; }
.auth-logo { width: 60px; height: 60px; border-radius: 18px; display: grid; place-items: center; margin-bottom: 20px; color: var(--on-accent); background: linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: 0 12px 28px -8px color-mix(in oklab, var(--accent-2) 80%, transparent); }
.auth-logo svg { width: 30px; height: 30px; }
.auth-card h1 { font-size: 1.6rem; color: var(--head); }
.auth-sub { color: var(--muted); margin: 6px 0 26px; font-size: .95rem; }
.auth-back { display: inline-block; margin-top: 20px; color: var(--muted); text-decoration: none; font-size: .9rem; }
.auth-back:hover { color: var(--head); }
.shake { animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(8px); } 40%, 80% { transform: translateX(-8px); } }

/* ---------- 8. Skeleton ---------- */
.sk { position: relative; overflow: hidden; background: var(--bg2); border-radius: var(--r-md); }
.sk::after { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 20%, color-mix(in oklab, var(--surface) 70%, transparent) 50%, transparent 80%); transform: translateX(100%); animation: shimmer 1.4s infinite; }
.sk-head { height: 72px; border-radius: 0; background: color-mix(in oklab, var(--primary) 85%, var(--bg)); }
.sk-hero { height: clamp(280px, 40vw, 440px); border-radius: 0; margin-bottom: 56px; }
.sk-row { display: grid; gap: 24px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.sk-card { height: 220px; border-radius: var(--r-lg); }
@keyframes shimmer { to { transform: translateX(-100%); } }
img.lazy { background: var(--bg2); opacity: 0; transition: opacity .5s; } img.lazy.ld { opacity: 1; }

/* ---------- 9. Motion ---------- */
@keyframes fade-in { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(24px); } }
@keyframes pop-in { from { opacity: 0; transform: scale(.9); } }
@keyframes dock-in { from { opacity: 0; transform: translateY(40px); } }
@keyframes toast-in { from { opacity: 0; transform: translateY(20px) scale(.92); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(10px) scale(.95); } }
@keyframes item-in { from { opacity: 0; transform: scale(.88) translateY(12px); } }
@keyframes item-out { to { opacity: 0; transform: scale(.88); } }
@media (prefers-reduced-motion: no-preference) {
  #app.ready { animation: fade-in .6s var(--ease) both; }
  .btn, .hcta, .mini, .navlink, .card, .ncard, .tile, .ccard, .logo, .btn-pri, .seg button, .x { transition: transform .35s var(--ease), box-shadow .35s var(--ease), background .2s, color .2s, border-color .2s, filter .2s; }
  .card:not(.add):hover, .ncard:hover, .ccard:hover { transform: translateY(-6px); box-shadow: var(--sh-3); border-color: color-mix(in oklab, var(--accent-2) 40%, var(--line)); }
  .tile:hover { transform: translateY(-6px) scale(1.02); box-shadow: var(--sh-3); }
  .logo:hover { transform: translateY(-3px); box-shadow: var(--sh-2); }
  .tile img { transition: transform .7s var(--ease); } .tile:hover img { transform: scale(1.08); }
  .rv { opacity: 0; transform: translateY(28px); transition: opacity .8s var(--ease), transform .8s var(--ease); transition-delay: calc(var(--d, 0) * 90ms); }
  .rv.in-view { opacity: 1; transform: none; }
  .rv.in-view.card:hover, .rv.in-view.ncard:hover { transition-delay: 0s; }
  .item-new { animation: item-in .5s var(--ease-spring) both; }
  .item-gone { animation: item-out .22s ease both; pointer-events: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
@media print { #top, #bar, .tw, .addbar { display: none !important; } }
