/* خرابيش · منصة الأدوات — نظام التصميم
   هوية «الورقة والحبر» نفسها: حدود مرسومة باليد، ظل مزاح، ألوان دافئة، مع وضع داكن «سبّورة». */

@font-face {
  font-family: 'Playpen Sans Arabic Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 100 800;
  src: url(/kit/fonts/playpen-arabic.woff2) format('woff2-variations');
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}
@font-face {
  font-family: 'Playpen Sans Arabic Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 100 800;
  src: url(/kit/fonts/playpen-latin.woff2) format('woff2-variations');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* خط القراءة: IBM Plex Sans Arabic للنصوص والأرقام داخل الأدوات */
@font-face { font-family: 'IBM Plex Sans Arabic'; font-style: normal; font-display: swap; font-weight: 400; src: url(/kit/fonts/plex-arabic-400.woff2) format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: 'IBM Plex Sans Arabic'; font-style: normal; font-display: swap; font-weight: 500; src: url(/kit/fonts/plex-arabic-500.woff2) format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: 'IBM Plex Sans Arabic'; font-style: normal; font-display: swap; font-weight: 600; src: url(/kit/fonts/plex-arabic-600.woff2) format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: 'IBM Plex Sans Arabic'; font-style: normal; font-display: swap; font-weight: 700; src: url(/kit/fonts/plex-arabic-700.woff2) format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: 'IBM Plex Sans Arabic'; font-style: normal; font-display: swap; font-weight: 400; src: url(/kit/fonts/plex-latin-400.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'IBM Plex Sans Arabic'; font-style: normal; font-display: swap; font-weight: 500; src: url(/kit/fonts/plex-latin-500.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'IBM Plex Sans Arabic'; font-style: normal; font-display: swap; font-weight: 600; src: url(/kit/fonts/plex-latin-600.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'IBM Plex Sans Arabic'; font-style: normal; font-display: swap; font-weight: 700; src: url(/kit/fonts/plex-latin-700.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  color-scheme: light;
  --bg: #f7f3e8;
  --bg-dot: rgba(29, 28, 40, 0.1);
  --card: #fffefa;
  --card-2: #f0ebdc;
  --ink: #1d1c28;
  --ink-2: #53516a;
  --ink-3: #6d6b82;
  --line: rgba(29, 28, 40, 0.14);
  /* حد «الحبر»: غامق في الفاتح، وهادي في الداكن حتى ما تصير الواجهة كلها خطوط فاتحة */
  --edge: #1d1c28;
  --shadow: #1d1c28;
  --yellow: #ffd84a;
  --coral: #ff8a6b;
  --mint: #7fdcb6;
  --sky: #8cc9ff;
  --lilac: #c7a9ff;
  --pink: #ff9ec4;
  --wood: #e9c896;
  --red: #b93a23;
  --green: #17794f;
  --blue: #17406f;
  --tint-yellow: #fff3c4;
  --tint-coral: #ffe2d8;
  --tint-mint: #dcf6ea;
  --tint-sky: #dceeff;
  --tint-lilac: #ece1ff;
  --tint-pink: #ffe1ee;
  --tint-wood: #f6e8cf;
  --focus: #d94f2b;
  --display: 'Playpen Sans Arabic Variable', 'IBM Plex Sans Arabic', 'Geeza Pro', 'Segoe UI', system-ui, sans-serif;
  --body: 'IBM Plex Sans Arabic', 'Geeza Pro', 'Segoe UI', 'Noto Sans Arabic', system-ui, sans-serif;
  --mono: ui-monospace, 'SF Mono', 'Cascadia Mono', Menlo, Consolas, monospace;
  --r1: 11px 13px 11px 13px / 13px 11px 13px 11px;
  --r2: 15px 18px 15px 18px / 18px 15px 18px 15px;
  --r3: 22px 26px 22px 26px / 26px 22px 26px 22px;
  --spring: cubic-bezier(0.3, 1.45, 0.5, 1);
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --wrap: 1120px;
  --side: 264px;
  --top: 56px;
}
:root[data-theme='dark'] {
  color-scheme: dark;
  --bg: #0f0e14;
  --bg-dot: rgba(243, 239, 228, 0.07);
  --card: #191820;
  --card-2: #24222e;
  --ink: #f3efe4;
  --ink-2: #c4c0d2;
  --ink-3: #9a97ae;
  --line: rgba(243, 239, 228, 0.13);
  --edge: rgba(243, 239, 228, 0.34);
  --shadow: #000;
  --yellow: #f5cf4d;
  --coral: #f08467;
  --mint: #63c7a0;
  --sky: #6fb4ee;
  --lilac: #b095ee;
  --pink: #ee86b3;
  --wood: #b8935c;
  --red: #ff8f78;
  --green: #6fe0af;
  --blue: #a9d4ff;
  --tint-yellow: #3a3420;
  --tint-coral: #3d2a26;
  --tint-mint: #20362f;
  --tint-sky: #1f3144;
  --tint-lilac: #2e2845;
  --tint-pink: #3b2533;
  --tint-wood: #352d22;
  --focus: #ffb199;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}
body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.75;
  color: var(--ink);
  background-color: var(--bg);
  background-image: radial-gradient(var(--bg-dot) 1px, transparent 1.6px);
  background-size: 24px 24px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1,
h2,
h3,
h4 {
  margin: 0;
  font-family: var(--display);
  font-weight: 800;
  line-height: 1.35;
  letter-spacing: 0;
}
p {
  margin: 0;
}
a {
  color: inherit;
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
}
[hidden] {
  display: none !important;
}
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 8px;
}
::selection {
  background: var(--yellow);
  color: #2b2a3a;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.wrap {
  width: min(var(--wrap), 100% - 32px);
  margin-inline: auto;
}
.ic {
  display: inline-block;
  flex: none;
  width: 1.25em;
  height: 1.25em;
  vertical-align: -0.22em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.muted {
  color: var(--ink-2);
}
.num,
.k-num {
  font-variant-numeric: tabular-nums;
  direction: ltr;
  unicode-bidi: isolate;
}
.skip {
  position: absolute;
  inset-inline-start: 12px;
  top: -60px;
  z-index: 100;
  padding: 8px 14px;
  background: var(--yellow);
  color: #2b2a3a;
  border: 2px solid #2b2a3a;
  border-radius: var(--r1);
  font-weight: 700;
}
.skip:focus {
  top: 10px;
}

/* ───────────── الهيكل: شريط جانبي (كمبيوتر) · شريط علوي · شريط سفلي (جوال) ───────────── */
.k-app {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 100dvh;
}
.k-logo {
  flex: none;
  width: 34px;
  height: 34px;
  transition: transform 0.3s var(--spring);
}
.k-brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.4rem;
  line-height: 1;
}
.k-brand:hover .k-logo {
  transform: rotate(-7deg) scale(1.04);
}
.k-top {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(12px) saturate(1.2);
  -webkit-backdrop-filter: blur(12px) saturate(1.2);
  border-bottom: 1.5px solid var(--line);
}
.k-top-in {
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(var(--wrap), 100% - 32px);
  min-height: var(--top);
  margin-inline: auto;
}
.k-hints {
  display: none;
  align-items: center;
  gap: 2px;
  margin-inline-start: -9px;
}
.k-hint {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 9px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink-2);
  background: none;
  border: 0;
  border-radius: 9px;
  transition:
    background 0.12s,
    color 0.12s;
}
.k-hint:hover {
  color: var(--ink);
  background: var(--card-2);
}
.keys {
  display: inline-flex;
  gap: 3px;
  direction: ltr;
}
kbd {
  display: inline-block;
  min-width: 1.6em;
  padding: 0 5px;
  font-family: var(--mono);
  font-size: 0.7rem;
  line-height: 1.65;
  text-align: center;
  color: var(--ink-2);
  background: var(--card-2);
  border: 1.5px solid var(--line);
  border-bottom-width: 2.5px;
  border-radius: 6px;
  direction: ltr;
}
.k-mod::before {
  content: 'Ctrl';
}
html[data-mac] .k-mod::before {
  content: '⌘';
}
.k-top-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-inline-start: auto;
}
.k-local {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-inline-end: 4px;
  padding: 1px 10px;
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1.8;
  white-space: nowrap;
  background: var(--tint-mint);
  border: 1.5px solid color-mix(in srgb, var(--mint) 55%, var(--ink));
  border-radius: 999px;
  cursor: default;
}
.k-local i,
.hero-kicker i,
.udrop-note i {
  flex: none;
  width: 8px;
  height: 8px;
  background: var(--green);
  border-radius: 50%;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 22%, transparent);
}
.k-iconbtn {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  background: transparent;
  border: 1.5px solid transparent;
  border-radius: 11px;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.86rem;
  transition:
    background 0.12s,
    border-color 0.12s,
    transform 0.16s var(--spring);
}
.k-iconbtn:hover {
  background: var(--card-2);
  border-color: var(--line);
}
.k-iconbtn:active {
  transform: scale(0.92);
}
.k-iconbtn .ic {
  width: 21px;
  height: 21px;
}
[data-act='install']:not([hidden]) {
  color: #1d1c28;
  background: var(--yellow);
  border-color: #1d1c28;
}

/* الشريط الجانبي */
.k-side {
  display: none;
}
.k-side .k-brand {
  padding: 4px 6px 0;
}
.s-search {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 40px;
  padding: 6px 10px;
  font-size: 0.88rem;
  text-align: start;
  color: var(--ink-2);
  background: var(--card);
  border: 1.6px solid var(--edge);
  border-radius: var(--r1);
  box-shadow: 2px 2px 0 var(--shadow);
  transition:
    transform 0.16s var(--spring),
    box-shadow 0.16s;
}
.s-search:hover {
  color: var(--ink);
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0 var(--shadow);
}
.s-search .keys {
  margin-inline-start: auto;
}
.s-nav {
  display: grid;
  gap: 2px;
}
.s-link {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 36px;
  padding: 5px 10px;
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--ink-2);
  text-decoration: none;
  border-radius: 10px;
  transition:
    background 0.12s,
    color 0.12s;
}
.s-link > .ic {
  width: 19px;
  height: 19px;
  margin-inline: 2.5px;
}
.s-link:hover {
  color: var(--ink);
  background: var(--card-2);
}
.s-link[aria-current='page'],
.s-link.open {
  color: var(--ink);
  background: var(--card);
  box-shadow:
    0 0 0 1.5px var(--edge),
    2px 3px 0 var(--shadow);
}
.s-link .n {
  margin-inline-start: auto;
  font: 600 0.72rem var(--mono);
  color: var(--ink-3);
}
.s-ic {
  display: grid;
  place-items: center;
  flex: none;
  width: 24px;
  height: 24px;
  color: #1d1c28;
  background: var(--c, var(--yellow));
  border: 1.5px solid #1d1c28;
  border-radius: 7px;
}
.s-ic .ic {
  width: 14px;
  height: 14px;
  stroke-width: 2.2;
}
.s-label {
  margin: 0 10px -8px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--ink-3);
}
.s-sub {
  display: grid;
  gap: 1px;
  margin: 6px 0;
  margin-inline-start: 21px;
  padding-inline-start: 10px;
  border-inline-start: 1.5px solid var(--line);
}
.s-sub a {
  padding: 4px 8px;
  font-size: 0.84rem;
  line-height: 1.45;
  color: var(--ink-2);
  text-decoration: none;
  border-radius: 8px;
}
.s-sub a:hover {
  color: var(--ink);
  background: var(--card-2);
}
.s-sub a[aria-current='page'] {
  font-weight: 700;
  color: var(--ink);
  background: var(--card-2);
}
.s-foot {
  margin-top: auto;
  padding-top: 10px;
  border-top: 1.5px solid var(--line);
}

/* الشريط السفلي (الجوال والتابلت) */
.k-dock {
  position: fixed;
  inset-inline: 0;
  bottom: 0;
  z-index: 45;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: center;
  height: calc(62px + env(safe-area-inset-bottom));
  padding: 0 6px env(safe-area-inset-bottom);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  border-top: 1.5px solid var(--line);
}
.k-dock a,
.k-dock button {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 1px;
  padding: 7px 2px 5px;
  font: 600 0.68rem/1.35 var(--body);
  color: var(--ink-2);
  background: none;
  border: 0;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.16s var(--spring);
}
.k-dock a:active,
.k-dock button:active {
  transform: scale(0.92);
}
.k-dock .ic {
  width: 22px;
  height: 22px;
}
.k-dock [aria-current='page'] {
  color: var(--ink);
}
.k-dock [aria-current='page']::before {
  content: '';
  position: absolute;
  top: 0;
  width: 26px;
  height: 3px;
  background: var(--ink);
  border-radius: 0 0 3px 3px;
}
.k-dock .k-dock-search {
  justify-self: center;
  place-items: center;
  width: 50px;
  height: 50px;
  padding: 0;
  color: #1d1c28;
  background: var(--yellow);
  border: 1.8px solid #1d1c28;
  border-radius: var(--r1);
  box-shadow: 2px 2px 0 var(--shadow);
  transform: translateY(-9px);
}
.k-dock .k-dock-search:active {
  transform: translateY(-7px) scale(0.94);
}
.k-dock .k-dock-search .ic {
  width: 23px;
  height: 23px;
  stroke-width: 2.3;
}
@media (max-width: 1099.98px) {
  .k-app {
    padding-bottom: calc(62px + env(safe-area-inset-bottom));
  }
}
@media (min-width: 1100px) {
  body {
    display: grid;
    grid-template-columns: var(--side) minmax(0, 1fr);
  }
  .k-side {
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
    height: 100dvh;
    padding: 14px 12px 12px;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    background: color-mix(in srgb, var(--card) 50%, var(--bg));
    border-inline-end: 1.5px solid var(--line);
  }
  .k-top .k-brand,
  .k-dock {
    display: none;
  }
  .k-hints {
    display: flex;
  }
}

/* ───────────── الأزرار ───────────── */
.k-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 18px;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.3;
  color: #2b2a3a;
  text-decoration: none;
  background: var(--yellow);
  border: 1.8px solid var(--edge);
  border-radius: var(--r1);
  box-shadow: 2px 3px 0 var(--shadow);
  transition:
    transform 0.16s var(--spring),
    box-shadow 0.16s;
}
:root[data-theme='dark'] .k-btn {
  border-color: #0d0c13;
}
.k-btn:hover {
  transform: translate(-1px, -2px);
  box-shadow: 3px 5px 0 var(--shadow);
}
.k-btn:active {
  transform: translate(2px, 3px);
  box-shadow: 1px 1px 0 var(--shadow);
}
.k-btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: 2px 3px 0 var(--shadow);
}
.k-btn.coral {
  background: var(--coral);
}
.k-btn.mint {
  background: var(--mint);
}
.k-btn.sky {
  background: var(--sky);
}
.k-btn.soft {
  color: var(--ink);
  background: var(--card);
}
:root[data-theme='dark'] .k-btn.soft {
  border-color: var(--edge);
}
.k-btn.ghost {
  color: var(--ink);
  background: transparent;
  border-color: var(--line);
  box-shadow: none;
}
.k-btn.ghost:hover {
  background: var(--card-2);
  transform: none;
  box-shadow: none;
}
.k-btn.danger {
  color: #fff;
  background: #c4432b;
}
.k-btn.sm {
  min-height: 36px;
  padding: 4px 12px;
  font-size: 0.88rem;
  box-shadow: 2px 2px 0 var(--shadow);
}
.k-btn.lg {
  min-height: 54px;
  padding: 10px 26px;
  font-size: 1.15rem;
}
.k-btn.block {
  width: 100%;
}

/* ───────────── البطاقات ───────────── */
.k-card {
  position: relative;
  background: var(--card);
  border: 1.8px solid var(--edge);
  border-radius: var(--r2);
  box-shadow: 3px 4px 0 var(--shadow);
}
.k-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 1px 10px;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.7;
  white-space: nowrap;
  color: var(--ink);
  background: var(--card-2);
  border: 1.6px solid var(--line);
  border-radius: 999px;
}
.k-chip .ic {
  width: 1.05em;
  height: 1.05em;
}
.k-chip.ok {
  background: var(--tint-mint);
  border-color: color-mix(in srgb, var(--mint) 70%, var(--ink));
}
.k-chip.warn {
  background: var(--tint-yellow);
  border-color: color-mix(in srgb, var(--yellow) 70%, var(--ink));
}

/* ───────────── الصفحة الرئيسية ───────────── */
main {
  flex: 1;
  padding-bottom: 56px;
}
.hub {
  padding-top: clamp(20px, 3.6vw, 44px);
}
.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 8px;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--ink-2);
}
.hero h1 {
  font-size: clamp(2.35rem, 7.4vw, 4.9rem);
  line-height: 1.26;
}
.hero h1:lang(en) {
  line-height: 1.08;
  letter-spacing: -0.02em;
}
/* خط الماركر: شكل مرسوم باليد خلف الكلمة (ملف SVG مضمّن، بدون أي طلب للشبكة) */
.hero h1 mark {
  margin: 0 -0.04em;
  padding: 0 0.16em;
  color: #1d1c28;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 60' preserveAspectRatio='none'%3E%3Cpath d='M3 15C38 8 150 5 197 11c2 12 1 27-3 40C150 57 48 56 5 53 1 41 0 27 3 15Z' fill='%23ffd84a'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}
.hero-sub {
  max-width: 620px;
  margin-top: 12px;
  font-size: clamp(1rem, 1.6vw, 1.14rem);
  color: var(--ink-2);
}
.hero-sub b {
  font-weight: 700;
  color: var(--ink);
}
.hero-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
  font-size: 0.92rem;
  font-weight: 600;
}
.hero-facts li {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.hero-facts .ic {
  width: 18px;
  height: 18px;
  padding: 2.5px;
  color: #1d1c28;
  background: var(--mint);
  border-radius: 50%;
  stroke-width: 3;
}

/* لوحة البداية: بحث + سحب الملفات */
.console {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  margin-top: clamp(20px, 3vw, 30px);
  overflow: hidden;
  background: var(--card);
  border: 1.8px solid var(--edge);
  border-radius: var(--r3);
  box-shadow: 5px 6px 0 var(--shadow);
}
.console-search {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: clamp(14px, 2vw, 22px);
}
.hub-search {
  position: relative;
}
.hub-search input {
  width: 100%;
  min-height: 58px;
  padding: 10px 52px;
  font-size: 1.08rem;
  background: var(--bg);
  border: 1.6px solid var(--edge);
  border-radius: var(--r2);
  transition:
    box-shadow 0.15s,
    background 0.15s;
}
.hub-search input:focus {
  background: var(--card);
  box-shadow: 3px 4px 0 var(--shadow);
}
.hub-search input::placeholder {
  color: var(--ink-3);
}
.hub-search input::-webkit-search-cancel-button {
  -webkit-appearance: none;
}
.hub-search > .ic {
  position: absolute;
  top: 50%;
  inset-inline-start: 17px;
  width: 23px;
  height: 23px;
  color: var(--ink-2);
  transform: translateY(-50%);
  pointer-events: none;
}
.hub-search kbd {
  position: absolute;
  top: 50%;
  inset-inline-end: 16px;
  transform: translateY(-50%);
}
.console-try {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 0.84rem;
  color: var(--ink-2);
}
.try {
  padding: 3px 11px;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--ink);
  background: var(--card-2);
  border: 1.5px solid var(--line);
  border-radius: 999px;
  transition:
    background 0.12s,
    border-color 0.12s,
    transform 0.16s var(--spring);
}
.try:hover {
  background: var(--tint-yellow);
  border-color: var(--edge);
  transform: translateY(-1px);
}
.console-drop {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: clamp(14px, 2vw, 22px);
  color: #1d1c28;
  background-color: var(--yellow);
  background-image: repeating-linear-gradient(135deg, rgba(29, 28, 40, 0.06) 0 2px, transparent 2px 11px);
  border-inline-start: 1.8px solid #1d1c28;
  transition: background-color 0.2s;
}
.udrop-plus {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  margin-bottom: 10px;
  background: #fffefa;
  border: 1.8px solid #1d1c28;
  border-radius: var(--r1);
  box-shadow: 3px 3px 0 #1d1c28;
  transform: rotate(-5deg);
  transition: transform 0.3s var(--spring);
}
.udrop-plus .ic {
  width: 24px;
  height: 24px;
  stroke-width: 2.4;
}
.console-drop:hover .udrop-plus,
.console-drop.over .udrop-plus {
  transform: rotate(5deg) scale(1.08);
}
.udrop-tag {
  position: absolute;
  top: 16px;
  inset-inline-end: 16px;
  padding: 0 9px;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.9;
  background: #fffefa;
  border: 1.5px solid #1d1c28;
  border-radius: 6px;
  transform: rotate(1.5deg);
}
.console-drop h2 {
  font-size: clamp(1.4rem, 2.6vw, 1.9rem);
  line-height: 1.3;
}
.console-drop > p {
  font-size: 0.95rem;
  font-weight: 500;
}
.udrop-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}
.k-btn.ink {
  color: #fffefa;
  background: #1d1c28;
  border-color: #1d1c28;
}
.console-drop .k-btn {
  border-color: #1d1c28;
  box-shadow: 2px 3px 0 rgba(29, 28, 40, 0.45);
}
.console-drop .k-btn.soft {
  color: #1d1c28;
  background: #fffefa;
  box-shadow: 2px 3px 0 #1d1c28;
}
.console-drop kbd {
  color: #1d1c28;
  background: #f0ebdc;
  border-color: rgba(29, 28, 40, 0.3);
}
.console-drop .udrop-note {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding-top: 14px;
  font-size: 0.78rem;
  font-weight: 700;
}
.udrop-note i {
  background: #17794f;
  box-shadow: 0 0 0 3px rgba(23, 121, 79, 0.25);
}
.console-drop.over {
  background-color: var(--mint);
}
body.dragging .console-drop {
  outline: 3px dashed #1d1c28;
  outline-offset: -9px;
}

.hub-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 16px 0 0;
  background: var(--card);
  border: 1.6px solid var(--edge);
  border-radius: var(--r2);
  box-shadow: 3px 4px 0 var(--shadow);
}
.hub-stats > div {
  display: flex;
  flex-direction: column-reverse;
  padding: 10px 16px;
  border-inline-start: 1.5px solid var(--line);
}
.hub-stats > div:first-child {
  border-inline-start: 0;
}
.hub-stats dt {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink-2);
}
.hub-stats dd {
  margin: 0;
  direction: inherit;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(1.35rem, 2.6vw, 1.9rem);
  line-height: 1.3;
}

/* الأقسام */
.sec {
  margin-top: clamp(30px, 4.6vw, 52px);
  scroll-margin-top: calc(var(--top) + 14px);
}
.sec-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.sec-head h2 {
  font-size: clamp(1.2rem, 2.3vw, 1.5rem);
}
.sec-head .rule {
  flex: 1;
  height: 1.5px;
  background: var(--line);
}
.sec-head a,
.sec-head .sec-note {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.86rem;
  font-weight: 600;
  white-space: nowrap;
  color: var(--ink-2);
  text-decoration: none;
}
.sec-head h2 + a,
.sec-head h2 + .sec-note {
  margin-inline-start: auto;
}
.sec-head a:hover {
  color: var(--ink);
}
.arr {
  width: 1em;
  height: 1em;
}
.chip-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(172px, 1fr));
  gap: 10px;
}
.tool-chip,
.cat-card,
.shelf-all {
  text-decoration: none;
  background: var(--card);
  border: 1.6px solid var(--edge);
  border-radius: var(--r1);
  box-shadow: 2px 2px 0 var(--shadow);
  transition:
    transform 0.16s var(--spring),
    box-shadow 0.16s;
}
.tool-chip:hover,
.cat-card:hover,
.shelf-all:hover {
  transform: translate(-1px, -2px);
  box-shadow: 3px 4px 0 var(--shadow);
}
.tool-chip:active,
.cat-card:active,
.shelf-all:active {
  transform: translate(1px, 2px);
  box-shadow: 1px 1px 0 var(--shadow);
}
.tool-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  padding: 8px 10px;
}
.tool-chip b {
  display: -webkit-box;
  overflow: hidden;
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.35;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.tool-chip .tool-ic {
  width: 34px;
  height: 34px;
}
.tool-chip .tool-ic .ic {
  width: 19px;
  height: 19px;
}
.tool-chip small {
  display: block;
  font-size: 0.74rem;
  font-weight: 500;
  color: var(--ink-2);
}
.tool-chip img {
  flex: none;
  border-radius: 8px;
}

/* مفضلتي والأخيرة */
.mine {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: 22px;
}
.mine-box .chip-grid {
  grid-template-columns: repeat(auto-fill, minmax(158px, 1fr));
}
.mine-empty {
  display: grid;
  justify-items: start;
  gap: 2px;
  padding: 18px;
  font-size: 0.88rem;
  color: var(--ink-2);
  background-image: repeating-linear-gradient(135deg, var(--line) 0 1px, transparent 1px 10px);
  border: 1.6px dashed color-mix(in srgb, var(--ink) 45%, transparent);
  border-radius: var(--r2);
}
.mine-empty .ic {
  width: 22px;
  height: 22px;
  margin-bottom: 4px;
  color: var(--ink);
}
.mine-empty b {
  font-family: var(--display);
  font-size: 1rem;
  color: var(--ink);
}

/* الأكثر استخدامًا */
.rank {
  display: grid;
  grid-template-columns: minmax(0, 270px) minmax(0, 1fr);
  gap: 26px;
  align-items: start;
}
.eyebrow {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--ink-3);
}
.rank-side h2 {
  font-size: clamp(1.7rem, 3.4vw, 2.5rem);
  line-height: 1.3;
}
.rank-side p:last-child {
  margin-top: 6px;
  font-size: 0.9rem;
  color: var(--ink-2);
}
.rank-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 20px;
  margin: 0;
  padding: 6px 14px;
  list-style: none;
  background: var(--card);
  border: 1.6px solid var(--edge);
  border-radius: var(--r2);
  box-shadow: 3px 4px 0 var(--shadow);
}
.rank-list li {
  border-bottom: 1.5px solid var(--line);
}
.rank-list li:nth-last-child(-n + 2) {
  border-bottom: 0;
}
.rank-list a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 2px;
  text-decoration: none;
}
.rank-list .no {
  min-width: 22px;
  font: 700 0.84rem var(--mono);
  color: var(--ink-3);
}
.rank-list .tool-ic {
  width: 30px;
  height: 30px;
  border-radius: 8px;
}
.rank-list .tool-ic .ic {
  width: 17px;
  height: 17px;
}
.rank-list .tx {
  min-width: 0;
}
.rank-list b {
  display: block;
  overflow: hidden;
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.35;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.rank-list small {
  display: block;
  font-size: 0.74rem;
  line-height: 1.4;
  color: var(--ink-3);
}
.rank-list a:hover b {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

/* التصنيفات */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.cat-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
}
.cat-card .tx {
  flex: 1;
  min-width: 0;
}
.cat-card b {
  display: block;
  font-family: var(--display);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.4;
}
.cat-card small {
  display: block;
  overflow: hidden;
  font-size: 0.78rem;
  line-height: 1.5;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: var(--ink-2);
}
.cat-card .n {
  font: 700 1.02rem var(--mono);
}
[data-cat='pdf'] {
  --c: var(--coral);
  --ct: var(--tint-coral);
}
[data-cat='uni'] {
  --c: var(--yellow);
  --ct: var(--tint-yellow);
}
[data-cat='study'] {
  --c: var(--mint);
  --ct: var(--tint-mint);
}
[data-cat='text'] {
  --c: var(--sky);
  --ct: var(--tint-sky);
}
[data-cat='research'] {
  --c: var(--lilac);
  --ct: var(--tint-lilac);
}
[data-cat='health'] {
  --c: var(--pink);
  --ct: var(--tint-pink);
}
[data-cat='image'] {
  --c: var(--wood);
  --ct: var(--tint-wood);
}
[data-cat='org'] {
  --c: var(--mint);
  --ct: var(--tint-mint);
}
[data-cat='math'] {
  --c: var(--sky);
  --ct: var(--tint-sky);
}
[data-cat='media'] {
  --c: var(--coral);
  --ct: var(--tint-coral);
}
[data-cat='career'] {
  --c: var(--lilac);
  --ct: var(--tint-lilac);
}
[data-cat='data'] {
  --c: var(--mint);
  --ct: var(--tint-mint);
}
[data-cat='dev'] {
  --c: var(--sky);
  --ct: var(--tint-sky);
}
[data-cat='design'] {
  --c: var(--pink);
  --ct: var(--tint-pink);
}
[data-cat='security'] {
  --c: var(--wood);
  --ct: var(--tint-wood);
}
[data-cat='money'] {
  --c: var(--yellow);
  --ct: var(--tint-yellow);
}
[data-cat='daily'] {
  --c: var(--coral);
  --ct: var(--tint-coral);
}

/* رفوف التصنيفات */
.shelf {
  content-visibility: auto;
  contain-intrinsic-size: auto 320px;
}
.shelf-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1.5px solid var(--line);
}
.shelf-head .no {
  align-self: flex-start;
  margin-top: 0.75em;
  padding: 0 7px;
  font: 700 0.74rem/1.8 var(--mono);
  color: #1d1c28;
  background: var(--c);
  border: 1.5px solid #1d1c28;
  border-radius: 6px;
}
.shelf-head .tx {
  flex: 1;
  min-width: 0;
}
.shelf-head h2 {
  font-size: clamp(1.45rem, 3.2vw, 2.15rem);
  line-height: 1.3;
}
.shelf-head p {
  font-size: 0.9rem;
  color: var(--ink-2);
}
.shelf-all {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: none;
  padding: 5px 12px;
}
.shelf-all .num {
  font: 800 1.3rem/1.4 var(--display);
}
.shelf-all small {
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--ink-2);
}
.shelf-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 12px;
}
.tool-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 13px;
  text-decoration: none;
  border-width: 1.6px;
  border-radius: var(--r1);
  box-shadow: 2px 2px 0 var(--shadow);
  transition:
    transform 0.18s var(--spring),
    box-shadow 0.18s;
}
.tool-card:hover {
  transform: translate(-1px, -3px);
  box-shadow: 3px 5px 0 var(--shadow);
}
.tool-card:active {
  transform: translate(1px, 2px);
  box-shadow: 1px 1px 0 var(--shadow);
}
.tool-ic {
  display: grid;
  place-items: center;
  flex: none;
  width: 40px;
  height: 40px;
  color: #1d1c28;
  background: var(--c, var(--yellow));
  border: 1.6px solid #1d1c28;
  border-radius: 10px;
}
.tool-ic .ic {
  width: 22px;
  height: 22px;
}
.tool-card b {
  display: block;
  font-family: var(--display);
  font-weight: 700;
  font-size: 0.98rem;
  line-height: 1.45;
}
.tool-card span.d {
  display: -webkit-box;
  overflow: hidden;
  font-size: 0.83rem;
  line-height: 1.6;
  color: var(--ink-2);
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.rooms-banner {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 18px 22px;
  background: var(--tint-yellow);
}
.rooms-banner svg {
  flex: none;
  width: 70px;
  height: 70px;
}
.rooms-banner h2 {
  font-size: 1.3rem;
}
.rooms-banner p {
  color: var(--ink-2);
}
.rooms-banner .k-btn {
  margin-inline-start: auto;
  flex: none;
}

/* نتيجة سحب ملف */
.drop-panel {
  padding: 16px;
  background: var(--card);
  border: 1.8px solid var(--edge);
  border-radius: var(--r2);
  box-shadow: 3px 4px 0 var(--shadow);
  animation: k-pop 0.25s var(--ease) both;
}
.drop-top {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 12px;
}
.drop-files {
  display: flex;
  flex: 1;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}
.drop-file {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 100%;
  padding: 6px;
  padding-inline-end: 12px;
  background: var(--card-2);
  border: 1.5px solid var(--line);
  border-radius: var(--r1);
}
.drop-file img,
.drop-file .tool-ic {
  flex: none;
  width: 40px;
  height: 40px;
  object-fit: cover;
  border: 1.5px solid var(--edge);
  border-radius: 8px;
}
.drop-file .tx {
  min-width: 0;
}
.drop-file b {
  display: block;
  max-width: 240px;
  overflow: hidden;
  font-size: 0.9rem;
  line-height: 1.4;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.drop-file small {
  display: block;
  font-size: 0.78rem;
  line-height: 1.4;
  color: var(--ink-2);
}
.drop-panel h3 {
  margin-bottom: 10px;
  font-size: 1.05rem;
}
.drop-panel .k-hint-line {
  margin-top: 10px;
  font-size: 0.8rem;
  color: var(--ink-2);
}

/* دخول خفيف للبطاقات */
.cat-card,
.tool-card,
.tool-chip {
  animation: k-rise 0.4s var(--ease) both;
  /* سقف للتأخير: صفحة فيها ١٠٠ بطاقة ما تنتظر ثواني عشان تظهر آخر بطاقة */
  animation-delay: calc(min(var(--i, 0), 10) * 24ms);
}
/* بدون opacity: 0 — البطاقات هي محتوى الصفحة الأساسي، فلازم تنرسم من أول إطار (قياس LCP) والحركة تبقى صعود خفيف */
@keyframes k-rise {
  from {
    transform: translateY(10px);
  }
}

/* ───────────── لوحة الأوامر (Ctrl/⌘ + K) ───────────── */
.k-pal-back {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  align-items: start;
  justify-items: center;
  padding: min(12vh, 100px) 14px 14px;
  background: rgba(15, 14, 20, 0.45);
  animation: k-fade 0.14s both;
}
.k-pal {
  display: flex;
  flex-direction: column;
  width: min(660px, 100%);
  max-height: min(72vh, 600px);
  overflow: hidden;
  background: var(--card);
  border: 1.8px solid var(--edge);
  border-radius: var(--r2);
  box-shadow: 6px 8px 0 var(--shadow);
  animation: k-pop 0.2s var(--ease) both;
}
.k-pal-in {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1.5px solid var(--line);
}
.k-pal-in > .ic {
  width: 22px;
  height: 22px;
  color: var(--ink-2);
}
.k-pal-in input {
  flex: 1;
  min-width: 0;
  padding: 6px 0;
  font-size: 1.1rem;
  background: none;
  border: 0;
  outline: none;
}
.k-pal-in input::-webkit-search-cancel-button {
  -webkit-appearance: none;
}
.k-pal-close {
  display: none;
}
.k-pal-list {
  flex: 1;
  margin: 0;
  padding: 6px;
  overflow-y: auto;
  overscroll-behavior: contain;
  list-style: none;
}
.k-pal-group {
  padding: 8px 10px 4px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--ink-3);
}
.k-pal-list li[role='option'] {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 5px 8px;
  border-radius: 10px;
  cursor: pointer;
  scroll-margin: 6px;
}
.k-pal-list li[role='option'] > a {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: inherit;
  text-decoration: none;
  outline: none;
}
.k-pal-list li[aria-selected='true'] {
  color: var(--bg);
  background: var(--ink);
}
.k-pal-list .tool-ic,
.k-pal-ic {
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 8px;
}
.k-pal-list .tool-ic .ic,
.k-pal-ic .ic {
  width: 17px;
  height: 17px;
}
.k-pal-ic {
  display: grid;
  place-items: center;
  color: var(--ink);
  background: var(--card-2);
  border: 1.5px solid var(--line);
}
.k-pal-list .tx {
  display: flex;
  flex: 1;
  align-items: baseline;
  gap: 9px;
  min-width: 0;
}
.k-pal-list b {
  flex: none;
  max-width: 100%;
  overflow: hidden;
  font-size: 0.95rem;
  font-weight: 600;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.k-pal-list small {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  font-size: 0.82rem;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: var(--ink-2);
}
.k-pal-list li[aria-selected='true'] small {
  color: color-mix(in srgb, var(--bg) 74%, transparent);
}
.k-pal-acts {
  display: flex;
  flex: none;
  gap: 2px;
  opacity: 0;
}
.k-pal-list li[aria-selected='true'] .k-pal-acts,
.k-pal-list li:hover .k-pal-acts,
.k-pal-acts:focus-within {
  opacity: 1;
}
.k-pal-acts button {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  color: inherit;
  background: transparent;
  border: 0;
  border-radius: 8px;
}
.k-pal-acts button:hover {
  background: color-mix(in srgb, currentColor 18%, transparent);
}
.k-pal-acts .ic {
  width: 17px;
  height: 17px;
}
.k-pal-acts [aria-pressed='true'] .ic {
  fill: var(--yellow);
}
.k-pal-empty {
  padding: 28px 16px;
  text-align: center;
  color: var(--ink-2);
}
.k-pal-foot {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 7px 14px;
  font-size: 0.76rem;
  color: var(--ink-2);
  border-top: 1.5px solid var(--line);
}
.k-pal-foot .sp {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-inline-start: auto;
  font-weight: 600;
}
.k-pal-foot .sp i {
  width: 7px;
  height: 7px;
  background: var(--green);
  border-radius: 50%;
}
@media (max-width: 640px) {
  .k-pal-back {
    padding: 0;
  }
  .k-pal {
    width: 100%;
    height: 100dvh;
    max-height: none;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    animation: k-sheet 0.24s var(--ease) both;
  }
  .k-pal-in {
    padding-top: max(12px, env(safe-area-inset-top));
  }
  .k-pal-in kbd,
  .k-pal-foot {
    display: none;
  }
  .k-pal-close {
    display: inline-grid;
  }
  .k-pal-acts {
    opacity: 1;
  }
  .k-pal-list small {
    display: none;
  }
  .k-pal-list li[role='option'] {
    min-height: 50px;
  }
}
@keyframes k-fade {
  from {
    opacity: 0;
  }
}
@keyframes k-pop {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
}
@keyframes k-sheet {
  from {
    opacity: 0;
    transform: translateY(28px);
  }
}

/* نافذة المشاركة */
.share-url {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px;
  padding-inline-start: 12px;
  background: var(--card-2);
  border: 1.5px solid var(--line);
  border-radius: var(--r1);
}
.share-url > span {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  font: 0.82rem var(--mono);
  text-align: left;
  white-space: nowrap;
  text-overflow: ellipsis;
  direction: ltr;
}
.share-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.share-grid a,
.share-grid button {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 12px 4px 10px;
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--ink);
  text-decoration: none;
  background: var(--card);
  border: 1.6px solid var(--edge);
  border-radius: var(--r1);
  box-shadow: 2px 2px 0 var(--shadow);
  transition:
    transform 0.16s var(--spring),
    box-shadow 0.16s;
}
.share-grid a:hover,
.share-grid button:hover {
  transform: translate(-1px, -2px);
  box-shadow: 3px 4px 0 var(--shadow);
}
.share-grid .ic {
  width: 24px;
  height: 24px;
}
.x-glyph {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  font: 800 1rem/1 var(--mono);
}
.k-menu-links {
  display: grid;
  gap: 8px;
}
.k-menu-links .k-btn {
  justify-content: flex-start;
}
.k-menu-links .k-btn .ic {
  width: 19px;
  height: 19px;
}
.k-menu-note {
  margin-top: 4px;
  font-size: 0.82rem;
  color: var(--ink-2);
}

/* ───────────── صفحة الأداة ───────────── */
.crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 18px 0 6px;
  font-size: 0.86rem;
  color: var(--ink-2);
}
.crumbs a {
  text-decoration: none;
}
.crumbs a:hover {
  text-decoration: underline;
}
.tool-head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 6px 0 16px;
}
.tool-head .tool-ic {
  width: 58px;
  height: 58px;
  border-radius: var(--r1);
  border-width: 2.2px;
}
.tool-head .tool-ic .ic {
  width: 31px;
  height: 31px;
}
.tool-head h1 {
  font-size: clamp(1.5rem, 3.6vw, 2.15rem);
}
.tool-head p {
  max-width: 720px;
  color: var(--ink-2);
}
.tool-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.tool-fav {
  margin-inline-start: auto;
  flex: none;
}
[data-act='fav'][aria-pressed='true'] .ic {
  fill: var(--yellow);
}
[data-act='fav'][aria-pressed='true'] {
  background: var(--tint-yellow);
  border-color: var(--line);
}
.tool-shell {
  padding: clamp(14px, 2.4vw, 24px);
  min-height: 180px;
}
/* الأداة تاخذ الشاشة الأولى كاملة حتى لو طلعت قصيرة: الشرح اللي تحتها يبدأ دايمًا من تحت حد الشاشة،
   فما يقفز قدام عين المستخدم لا وقت التحميل ولا لما تتركّب الأداة أقصر من مكانها المحجوز (قياس CLS). */
.tool-stage {
  min-height: 160px;
  min-height: max(160px, calc(100svh - 240px));
}
.tool-loading {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  min-height: 160px;
  min-height: max(160px, calc(100svh - 240px));
  color: var(--ink-2);
}
.k-spin {
  width: 30px;
  height: 30px;
  border: 3px solid var(--line);
  border-top-color: var(--coral);
  border-radius: 50%;
  animation: k-spin 0.8s linear infinite;
}
@keyframes k-spin {
  to {
    transform: rotate(360deg);
  }
}
.tool-info {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
  margin-top: 26px;
}
.info-card {
  padding: 16px 18px;
  box-shadow: 3px 4px 0 var(--shadow);
}
.info-card h2 {
  margin-bottom: 8px;
  font-size: 1.12rem;
}
.info-card ol,
.info-card ul {
  margin: 0;
  padding-inline-start: 22px;
}
.info-card li {
  margin: 3px 0;
}
.info-card details {
  padding: 8px 0;
  border-bottom: 1.5px dashed var(--line);
}
.info-card details:last-child {
  border-bottom: 0;
}
.info-card summary {
  font-weight: 600;
  cursor: pointer;
}
.info-card details p {
  margin-top: 6px;
  color: var(--ink-2);
}
.info-wide {
  grid-column: 1 / -1;
}
.src-list {
  font-size: 0.88rem;
  color: var(--ink-2);
}

/* ───────────── مكوّنات الأدوات المشتركة ───────────── */
.tool {
  display: grid;
  gap: 16px;
}
.k-field {
  display: grid;
  gap: 5px;
  min-width: 0;
}
.k-label {
  font-weight: 600;
  font-size: 0.92rem;
}
.k-hint {
  font-size: 0.82rem;
  color: var(--ink-2);
}
.k-input,
.k-select,
.k-textarea {
  width: 100%;
  min-height: 44px;
  padding: 8px 12px;
  background: var(--bg);
  border: 1.6px solid var(--edge);
  border-radius: 11px 13px 10px 14px;
  transition: box-shadow 0.15s;
}
.k-input:focus,
.k-select:focus,
.k-textarea:focus {
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 45%, transparent);
}
.k-select {
  text-overflow: ellipsis;
}
.k-textarea {
  min-height: 130px;
  line-height: 1.8;
  resize: vertical;
}
/* حقل فاضي اتجاهه تلقائي (dir=auto): المتصفح يعتبره LTR فيطلع التلميح العربي يسار ونقاطه مقلوبة.
   نخليه يتبع اتجاه الصفحة ما دام فاضي، وأول ما ينكتب فيه يرجع الاتجاه التلقائي حسب لغة النص. */
[dir='rtl'] :is(textarea, input)[dir='auto']:placeholder-shown {
  direction: rtl;
}
.k-input.num {
  text-align: start;
  font-variant-numeric: tabular-nums;
}
.k-input[aria-invalid='true'] {
  border-color: var(--red);
}
.k-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
}
.k-row > .k-field {
  flex: 1 1 160px;
}
.k-row.tight {
  gap: 8px;
}
.k-row.center {
  align-items: center;
}
/* صف كله حقول وواحد منها تحته تلميح: نحاذي من فوق عشان العناوين تبقى على خط واحد */
.k-row:has(> .k-field > .k-hint):not(:has(> .k-btn, > .k-iconbtn, > button)) {
  align-items: flex-start;
}
.k-grid {
  display: grid;
  grid-template-columns: repeat(var(--cols, 2), minmax(0, 1fr));
  gap: 12px;
}
.k-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.k-box {
  padding: 14px 16px;
  background: var(--card-2);
  border: 1.8px dashed var(--line);
  border-radius: var(--r1);
}
.k-sub {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.05rem;
}
.k-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}
.k-stat {
  padding: 12px 14px;
  background: var(--ct, var(--tint-yellow));
  border: 1.6px solid var(--edge);
  border-radius: var(--r1);
}
.k-stat b {
  display: block;
  font-family: var(--display);
  font-size: 1.7rem;
  font-weight: 800;
  line-height: 1.25;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.k-stat span {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--ink-2);
}
.k-stat small {
  display: block;
  font-size: 0.78rem;
  color: var(--ink-2);
}
.k-stat.big b {
  font-size: 2.4rem;
}
.k-stat.mint {
  background: var(--tint-mint);
}
.k-stat.coral {
  background: var(--tint-coral);
}
.k-stat.sky {
  background: var(--tint-sky);
}
.k-stat.lilac {
  background: var(--tint-lilac);
}
.k-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 14px;
  font-size: 0.9rem;
  background: var(--tint-sky);
  border: 1.8px solid color-mix(in srgb, var(--sky) 60%, var(--ink));
  border-radius: var(--r1);
}
.k-note .ic {
  margin-top: 3px;
}
.k-note.warn {
  background: var(--tint-yellow);
  border-color: color-mix(in srgb, var(--yellow) 60%, var(--ink));
}
.k-note.error {
  background: var(--tint-coral);
  border-color: var(--red);
}
.k-note.ok {
  background: var(--tint-mint);
  border-color: color-mix(in srgb, var(--mint) 60%, var(--ink));
}
.k-table-wrap {
  overflow-x: auto;
  border: 1.6px solid var(--edge);
  border-radius: var(--r1);
}
.k-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.93rem;
}
.k-table th,
.k-table td {
  padding: 8px 12px;
  text-align: start;
  border-bottom: 1.5px solid var(--line);
}
.k-table th {
  font-weight: 700;
  background: var(--card-2);
  white-space: nowrap;
}
.k-table tr:last-child td {
  border-bottom: 0;
}
.k-table td .k-input,
.k-table td .k-select {
  min-height: 38px;
  padding: 4px 8px;
}
.k-seg {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px;
  background: var(--card-2);
  border: 1.6px solid var(--edge);
  border-radius: var(--r1);
}
.k-seg button {
  min-height: 34px;
  padding: 3px 14px;
  font-weight: 600;
  background: transparent;
  border: 0;
  border-radius: 9px 11px 8px 12px;
}
.k-seg button[aria-pressed='true'] {
  color: #2b2a3a;
  background: var(--yellow);
  box-shadow: 0 0 0 1.8px var(--ink);
}
.k-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  cursor: pointer;
}
.k-check input {
  width: 20px;
  height: 20px;
  accent-color: var(--coral);
}
.k-range {
  width: 100%;
  accent-color: var(--coral);
}
.k-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  border-bottom: 2px solid var(--line);
}
.k-tabs button {
  padding: 7px 14px;
  font-weight: 600;
  color: var(--ink-2);
  background: none;
  border: 2px solid transparent;
  border-bottom: 0;
  border-radius: 12px 14px 0 0;
}
.k-tabs button[aria-selected='true'] {
  color: var(--ink);
  background: var(--card-2);
  border-color: var(--line);
}
.k-out {
  padding: 12px 14px;
  min-height: 60px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: var(--bg);
  border: 1.6px solid var(--edge);
  border-radius: 11px 13px 10px 14px;
}
.k-out.mono {
  font-family: var(--mono);
  font-size: 0.9rem;
  direction: ltr;
  text-align: left;
}
.k-empty {
  display: grid;
  place-items: center;
  gap: 6px;
  padding: 26px 14px;
  text-align: center;
  color: var(--ink-2);
}
.k-empty .ic {
  width: 34px;
  height: 34px;
}
.k-progress {
  display: grid;
  gap: 6px;
}
.k-progress-bar {
  height: 14px;
  overflow: hidden;
  background: var(--card-2);
  border: 1.6px solid var(--edge);
  border-radius: 999px;
}
.k-progress-bar i {
  display: block;
  width: 0;
  height: 100%;
  background: repeating-linear-gradient(-45deg, var(--mint) 0 8px, color-mix(in srgb, var(--mint) 70%, #fff) 8px 16px);
  transition: width 0.25s;
}
.k-progress-bar.indet i {
  width: 40%;
  animation: k-indet 1.1s ease-in-out infinite alternate;
}
@keyframes k-indet {
  to {
    margin-inline-start: 60%;
  }
}
.k-progress span {
  font-size: 0.86rem;
  color: var(--ink-2);
}

/* إدخال الملفات */
.k-drop {
  display: grid;
  place-items: center;
  gap: 6px;
  width: 100%;
  padding: 26px 16px;
  text-align: center;
  background: var(--ct, var(--tint-sky));
  border: 1.8px dashed var(--edge);
  border-radius: var(--r2);
  transition:
    transform 0.15s,
    background 0.15s;
}
.k-drop:hover,
.k-drop.over {
  transform: scale(1.01);
  background: var(--tint-yellow);
}
.k-drop .ic {
  width: 36px;
  height: 36px;
}
.k-drop b {
  font-family: var(--display);
  font-size: 1.05rem;
}
.k-drop small {
  color: var(--ink-2);
}
.k-files {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.k-file {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: var(--bg);
  border: 1.6px solid var(--edge);
  border-radius: 11px 13px 10px 14px;
}
.k-file.dragging {
  opacity: 0.5;
}
.k-file-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  font-weight: 600;
  white-space: nowrap;
  text-overflow: ellipsis;
  direction: ltr;
  text-align: start;
}
.k-file small {
  flex: 0 1 auto;
  min-width: 0;
  color: var(--ink-2);
  overflow-wrap: anywhere;
}
@media (max-width: 480px) {
  /* على الجوال: التفاصيل الطويلة تنزل سطر تحت اسم الملف بدل ما تطلع برا البطاقة */
  .k-file {
    flex-wrap: wrap;
  }
  .k-file-name {
    flex-basis: 55%;
  }
}
.k-file .k-iconbtn {
  width: 34px;
  height: 34px;
}
.k-handle {
  cursor: grab;
  color: var(--ink-3);
}
.k-preview {
  display: grid;
  place-items: center;
  padding: 10px;
  overflow: auto;
  background:
    linear-gradient(45deg, var(--card-2) 25%, transparent 25% 75%, var(--card-2) 75%) 0 0 / 18px 18px,
    linear-gradient(45deg, var(--card-2) 25%, transparent 25% 75%, var(--card-2) 75%) 9px 9px / 18px 18px,
    var(--bg);
  border: 1.6px solid var(--edge);
  border-radius: var(--r1);
}
.k-preview img,
.k-preview canvas {
  max-width: 100%;
  height: auto;
  max-height: 460px;
}
/* شبكة صفحات PDF */
.k-pages {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  gap: 12px;
}
.k-page {
  position: relative;
  display: grid;
  gap: 4px;
  justify-items: center;
  padding: 8px 6px 6px;
  background: var(--bg);
  border: 2px solid var(--line);
  border-radius: 12px;
  user-select: none;
}
.k-page canvas {
  max-width: 100%;
  height: auto;
  max-height: 150px;
  background: #fff;
  box-shadow: 0 0 0 1px var(--line);
  transition: transform 0.2s;
}
.k-page[aria-pressed='true'],
.k-page.sel {
  border-color: var(--ink);
  background: var(--tint-yellow);
}
.k-page.del {
  border-color: var(--red);
  background: var(--tint-coral);
}
.k-page.del canvas {
  opacity: 0.35;
}
.k-page.dragging {
  opacity: 0.4;
}
.k-page .pg-no {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ink-2);
}
.k-page .pg-tools {
  display: flex;
  gap: 2px;
}
.k-page .pg-tools button {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: 8px;
}

/* نوافذ وتنبيهات */
.k-modal-back {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(20, 19, 28, 0.5);
  animation: k-fade 0.15s both;
}
.k-modal {
  width: min(480px, 100%);
  max-height: 86vh;
  overflow-y: auto;
  padding: 20px;
  animation: k-pop 0.28s var(--spring) both;
}
.k-modal h2 {
  margin-bottom: 10px;
  font-size: 1.25rem;
}
.k-modal .k-actions {
  margin-top: 16px;
  justify-content: flex-end;
}
#k-toasts {
  position: fixed;
  inset-inline: 0;
  bottom: 18px;
  z-index: 100;
  display: grid;
  justify-items: center;
  gap: 8px;
  pointer-events: none;
}
.k-toast {
  padding: 8px 16px;
  font-weight: 600;
  color: #2b2a3a;
  background: var(--yellow);
  border: 2px solid #2b2a3a;
  border-radius: var(--r1);
  box-shadow: 3px 4px 0 rgba(0, 0, 0, 0.6);
  animation: k-pop 0.3s var(--spring) both;
}
.k-toast.ok {
  background: var(--mint);
}
.k-toast.error {
  background: var(--coral);
}

.k-files:empty,
.k-hint:empty,
.k-actions:empty {
  display: none;
}
/* تذييل */
.k-foot {
  padding: 24px 0 30px;
  font-size: 0.88rem;
  color: var(--ink-2);
  border-top: 1.5px solid var(--line);
}
.k-foot .wrap {
  display: grid;
  gap: 14px;
}
.foot-main {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 18px;
}
.foot-brand b {
  font-family: var(--display);
  font-size: 1.05rem;
  color: var(--ink);
}
.foot-by b {
  color: var(--ink);
}
.foot-x {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
  unicode-bidi: isolate;
}
.foot-x .x-glyph {
  width: 20px;
  height: 20px;
  font-size: 0.78rem;
  color: var(--bg);
  background: var(--ink);
  border-radius: 6px;
}
.foot-x:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.foot-acts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-inline-start: auto;
}
.foot-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  padding-top: 12px;
  border-top: 1.5px dashed var(--line);
}
.foot-links a {
  font-weight: 600;
  text-decoration: none;
}
.foot-links a:hover {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.foot-links .sp {
  flex: 1;
}
.prose {
  max-width: 760px;
}
.prose h2 {
  margin: 22px 0 6px;
  font-size: 1.3rem;
}
.prose p,
.prose li {
  color: var(--ink-2);
}
.offline-pill {
  position: fixed;
  inset-inline-start: 14px;
  bottom: 14px;
  z-index: 60;
}

/* ───────────── الطباعة: نطبع المنطقة المطلوبة بس ───────────── */
#k-print {
  display: none;
}
@media print {
  @page {
    margin: 14mm;
  }
  html.k-printing body {
    background: #fff !important;
    color: #000 !important;
  }
  html.k-printing body > *:not(#k-print) {
    display: none !important;
  }
  html.k-printing #k-print {
    display: block;
    color: #000;
    font-family: var(--body);
  }
  html.k-printing #k-print * {
    box-shadow: none !important;
  }
  .no-print {
    display: none !important;
  }
}

/* ───────────── تجاوب ───────────── */
@media (max-width: 1099.98px) {
  #k-toasts {
    bottom: calc(78px + env(safe-area-inset-bottom));
  }
  .offline-pill {
    bottom: calc(76px + env(safe-area-inset-bottom));
  }
}
@media (max-width: 900px) {
  .console,
  .mine,
  .rank {
    grid-template-columns: minmax(0, 1fr);
  }
  .console-drop {
    border-inline-start: 0;
    border-top: 1.8px solid #1d1c28;
  }
  .rank {
    gap: 14px;
  }
  .cat-grid,
  .shelf-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .tool-info {
    grid-template-columns: minmax(0, 1fr);
  }
  .rooms-banner {
    flex-wrap: wrap;
  }
  .rooms-banner .k-btn {
    margin-inline-start: 0;
    width: 100%;
  }
}
@media (max-width: 640px) {
  .hub-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .hub-stats > div:nth-child(odd) {
    border-inline-start: 0;
  }
  .hub-stats > div:nth-child(n + 3) {
    border-top: 1.5px solid var(--line);
  }
  .chip-grid,
  .mine-box .chip-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .rank-list {
    grid-template-columns: minmax(0, 1fr);
  }
  .rank-list li:nth-last-child(2) {
    border-bottom: 1.5px solid var(--line);
  }
  .cat-card small {
    display: none;
  }
  .cat-card {
    gap: 9px;
    padding: 8px 10px;
  }
  .cat-card b {
    font-size: 0.92rem;
  }
  /* رفوف الأدوات تتمرّر أفقيًا مثل التطبيقات */
  .shelf-row {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: min(80%, 300px);
    margin-inline: -12px;
    padding: 2px 12px 10px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: 12px;
    scrollbar-width: none;
  }
  .shelf-row::-webkit-scrollbar {
    display: none;
  }
  .shelf-row > * {
    scroll-snap-align: start;
  }
  .shelf-head {
    gap: 10px;
  }
  .shelf-head p {
    display: none;
  }
  .k-local {
    font-size: 0.72rem;
  }
  /* النوافذ تطلع من تحت مثل تطبيقات الجوال */
  .k-modal-back {
    align-items: end;
    padding: 0;
  }
  .k-modal {
    width: 100%;
    max-height: 88dvh;
    padding-bottom: calc(20px + env(safe-area-inset-bottom));
    border-bottom: 0;
    border-inline: 0;
    border-radius: 22px 22px 0 0;
    box-shadow: none;
    animation: k-sheet 0.26s var(--ease) both;
  }
}
@media (max-width: 560px) {
  body {
    font-size: 15.5px;
  }
  .wrap,
  .k-top-in {
    width: min(var(--wrap), 100% - 24px);
  }
  .tool-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .tool-head {
    flex-wrap: wrap;
  }
  .tool-head > .tool-fav {
    order: 1;
  }
  .tool-head > div:not(.tool-fav) {
    order: 2;
    flex-basis: 100%;
  }
  .tool-head .tool-ic {
    width: 48px;
    height: 48px;
  }
  .k-grid {
    --cols: 1 !important;
  }
  .k-brand {
    font-size: 1.25rem;
  }
  .hub-search input {
    padding-inline-end: 16px;
  }
  .hub-search kbd,
  .udrop-actions .keys {
    display: none;
  }
  .k-stat b {
    font-size: 1.45rem;
  }
  .udrop-tag {
    display: none;
  }
}
@media (hover: none) {
  .hub-search kbd,
  .udrop-actions .keys {
    display: none;
  }
}

/* ───────────── انتقال ناعم بين الصفحات (تحسين تدريجي: المتصفحات اللي ما تدعمه تتنقل عادي) ───────────── */
@view-transition {
  navigation: auto;
}
.k-side {
  view-transition-name: k-side;
}
.k-top {
  view-transition-name: k-top;
}
.k-dock {
  view-transition-name: k-dock;
}
main {
  view-transition-name: k-main;
}
::view-transition-group(*) {
  animation-duration: 0.2s;
}
::view-transition-old(k-main) {
  animation: 0.12s ease-out both k-vt-out;
}
::view-transition-new(k-main) {
  animation: 0.24s var(--ease) both k-vt-in;
}
@keyframes k-vt-out {
  to {
    opacity: 0;
  }
}
@keyframes k-vt-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  @view-transition {
    navigation: none;
  }
}

/* ───────────── إضافات الهيكل الجديد ───────────── */
html {
  scrollbar-gutter: stable;
}
html.k-lock {
  overflow: hidden;
}
.k-pal-list li[role='option'] > .k-pal-main {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.k-pal-list li[role='option'] > .keys {
  flex: none;
}
.k-pal-list li[aria-selected='true'] kbd {
  color: var(--bg);
  background: color-mix(in srgb, var(--bg) 16%, transparent);
  border-color: color-mix(in srgb, var(--bg) 34%, transparent);
}
.k-pal-list li[aria-selected='true'] .k-pal-ic {
  color: var(--ink);
}
.k-pal-acts button:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: -2px;
}
.k-pal-empty {
  display: grid;
  gap: 4px;
  justify-items: center;
}
.k-pal-empty small {
  font-size: 0.84rem;
  white-space: normal;
}
.k-pal-foot .keys {
  vertical-align: middle;
}
/* تبديل الوضع الفاتح/الداكن: تلاشي بدون إزاحة */
html.vt-theme::view-transition-old(k-main) {
  animation: 0.26s ease both k-vt-out;
}
html.vt-theme::view-transition-new(k-main) {
  animation: 0.26s ease both k-fade;
}
/* نتيجة سحب ملف داخل نافذة (خارج الصفحة الرئيسية) */
.k-modal .drop-panel {
  padding: 0;
  background: none;
  border: 0;
  box-shadow: none;
  animation: none;
}
.k-modal .drop-top > .k-iconbtn {
  display: none;
}
.drop-top > .k-iconbtn {
  flex: none;
}
.drop-panel .k-hint-line {
  display: flex;
  align-items: center;
  gap: 6px;
}
.drop-panel .k-hint-line.top {
  margin: -4px 0 10px;
}
.drop-panel .k-hint-line .ic {
  flex: none;
  width: 15px;
  height: 15px;
}
.tool-chip b small {
  font-size: 0.72rem;
}
.rank-list small .me {
  margin-inline-start: 6px;
  padding: 0 6px;
  font-size: 0.68rem;
  font-weight: 700;
  color: #1d1c28;
  background: var(--yellow);
  border-radius: 999px;
}
/* أثناء البحث على الشاشات الضيقة: النتائج تطلع تحت الحقل مباشرة */
@media (max-width: 900px) {
  .hub.searching .console-drop,
  .hub.searching .hub-stats {
    display: none;
  }
}
/* لوحة الأوامر على الشاشات اللمسية: بدون تلميحات المفاتيح */
@media (hover: none), (max-width: 640px) {
  .k-pal-list li[role='option'] > .keys {
    display: none;
  }
}
/* قائمة «المزيد»: عمودين مثل قوائم التطبيقات */
.k-menu-links {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.k-menu-links .k-btn {
  min-width: 0;
  padding-inline: 12px;
  line-height: 1.3;
  text-align: start;
  white-space: normal;
}
.k-menu-note {
  grid-column: 1 / -1;
}

/* ───────── المسارات: الملف يمشي بين الأدوات ───────── */
.sec-lead {
  max-width: 780px;
  margin: -2px 0 14px;
  font-size: 0.95rem;
  line-height: 1.75;
  color: var(--ink-2);
}
.flow-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 12px;
}
.flow-card,
.flow-main {
  display: flex;
  flex-direction: column;
  gap: 9px;
  color: inherit;
  text-decoration: none;
}
.flow-card {
  padding: 14px;
  transition:
    transform 0.16s var(--spring),
    box-shadow 0.16s;
  animation: k-rise 0.4s var(--ease) both;
  animation-delay: calc(min(var(--i, 0), 10) * 24ms);
}
.flow-card:hover {
  transform: translate(-1px, -2px);
  box-shadow: 4px 6px 0 var(--shadow);
}
.flow-card:active {
  transform: translate(1px, 2px);
  box-shadow: 1px 1px 0 var(--shadow);
}
.flow-card.mine {
  padding: 0;
}
.flow-card.mine .flow-main {
  flex: 1;
  padding: 14px;
}
.flow-card.mine .flow-top {
  padding-inline-end: 78px;
}
.flow-top {
  display: flex;
  align-items: center;
  gap: 10px;
}
.flow-top b {
  font-family: var(--display);
  font-size: 1.04rem;
  font-weight: 700;
  line-height: 1.4;
}
.flow-top .tool-ic {
  width: 38px;
  height: 38px;
}
.flow-card .d {
  font-size: 0.88rem;
  line-height: 1.65;
  color: var(--ink-2);
}
.flow-steps {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 4px;
  margin-top: auto;
  padding-top: 2px;
  font-size: 0.8rem;
  font-weight: 600;
}
.flow-steps .st {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding-block: 3px;
  padding-inline: 4px 10px;
  background: var(--card-2);
  border: 1.4px solid var(--line);
  border-radius: 999px;
}
.flow-steps .st i {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  font-size: 0.7rem;
  font-style: normal;
  font-weight: 700;
  color: var(--bg);
  background: var(--ink);
  border-radius: 50%;
}
.flow-steps .arr {
  flex: none;
  width: 13px;
  height: 13px;
  color: var(--ink-3);
}
.flow-go {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.88rem;
  font-weight: 700;
}
.flow-go .arr {
  width: 16px;
  height: 16px;
  transition: transform 0.2s var(--ease);
}
.flow-card:hover .flow-go .arr {
  transform: translateX(-4px);
}
[dir='ltr'] .flow-card:hover .flow-go .arr {
  transform: translateX(4px);
}
.flow-acts {
  position: absolute;
  inset-block-start: 8px;
  inset-inline-end: 8px;
  display: flex;
  gap: 4px;
}
.flow-sub {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
  margin: 2px 0 10px;
  font-size: 1rem;
}
.flow-sub small {
  font-family: var(--body);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--ink-3);
}
#hub-myflows {
  margin-bottom: 18px;
}

/* شريط المسار فوق الأداة */
.k-flow {
  margin-bottom: 14px;
  padding: 12px 14px;
  background: var(--tint-yellow);
  border: 1.8px solid var(--edge);
  border-radius: var(--r2);
  box-shadow: 3px 3px 0 var(--shadow);
  animation: k-pop 0.3s var(--ease) both;
}
.k-flow-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
}
.k-flow-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 10px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #1d1c28;
  background: var(--yellow);
  border: 1.5px solid #1d1c28;
  border-radius: 999px;
}
.k-flow-tag .ic {
  width: 14px;
  height: 14px;
}
.k-flow-name {
  font-family: var(--display);
  font-size: 1.02rem;
}
.k-flow-count {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink-2);
}
.k-flow-acts {
  display: flex;
  gap: 4px;
  margin-inline-start: auto;
}
.k-flow-acts .k-iconbtn {
  width: 34px;
  height: 34px;
}
.k-flow-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}
.k-flow-steps li {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding-block: 4px;
  padding-inline: 5px 12px;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--ink-2);
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: 999px;
}
.k-flow-steps li + li::before {
  content: '';
  position: absolute;
  inset-inline-start: -17px;
  top: 50%;
  width: 14px;
  border-top: 1.6px dashed var(--ink-3);
}
.k-flow-steps .no {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  font-size: 0.74rem;
  font-weight: 700;
  background: var(--card-2);
  border: 1.4px solid var(--line);
  border-radius: 50%;
}
.k-flow-steps .no .ic {
  width: 13px;
  height: 13px;
}
.k-flow-steps li.done {
  color: var(--ink);
}
.k-flow-steps li.done .no {
  color: #1d1c28;
  background: var(--mint);
  border-color: #1d1c28;
}
.k-flow-steps li.now {
  color: var(--ink);
  border-color: var(--edge);
  box-shadow: 2px 2px 0 var(--shadow);
}
.k-flow-steps li.now .no {
  color: var(--bg);
  background: var(--ink);
  border-color: var(--ink);
}
.k-flow-hint {
  margin: 10px 0 0;
  font-size: 0.84rem;
  line-height: 1.7;
  color: var(--ink-2);
}

/* شريط «كمّل عليه» بعد ما تطلّع الأداة ملف */
.k-chain {
  position: fixed;
  inset-block-end: 18px;
  inset-inline-end: 20px;
  z-index: 60;
  width: min(400px, calc(100vw - 40px));
  padding: 12px 14px;
  background: var(--card);
  border: 2px solid var(--edge);
  border-radius: var(--r2);
  box-shadow: 4px 5px 0 var(--shadow);
  animation: k-chain-in 0.4s var(--spring) both;
}
@keyframes k-chain-in {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.97);
  }
}
.k-chain-head {
  display: flex;
  align-items: center;
  gap: 10px;
}
.k-chain-ok {
  display: grid;
  place-items: center;
  flex: none;
  width: 30px;
  height: 30px;
  color: #1d1c28;
  background: var(--mint);
  border: 1.6px solid #1d1c28;
  border-radius: 50%;
}
.k-chain-ok .ic {
  width: 16px;
  height: 16px;
}
.k-chain-head .tx {
  display: grid;
  flex: 1;
  min-width: 0;
}
.k-chain-head b {
  overflow: hidden;
  font-size: 0.95rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.k-chain-head small {
  font-size: 0.78rem;
  color: var(--ink-3);
}
.k-chain-head .k-iconbtn {
  width: 32px;
  height: 32px;
}
.k-chain-label {
  display: block;
  margin: 10px 0 6px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink-2);
}
.k-chain-tools {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.k-chain-tools .tool-chip {
  min-height: 46px;
  padding: 6px 8px;
  animation: none;
}
.k-chain-tools .tool-chip .tool-ic {
  width: 28px;
  height: 28px;
}
.k-chain-tools .tool-chip b {
  font-size: 0.84rem;
}
.k-chain-next {
  display: flex;
  justify-content: center;
  width: 100%;
  margin-top: 10px;
}
.k-chain-next .arr {
  width: 18px;
  height: 18px;
}
.k-chain-more {
  display: block;
  margin: 8px auto 0;
  padding: 4px 8px;
  font: inherit;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--ink-2);
  text-decoration: underline;
  text-underline-offset: 3px;
  background: none;
  border: 0;
  cursor: pointer;
}
.k-chain-more:hover {
  color: var(--ink);
}
.k-chain-done {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 0 8px;
  font-size: 0.92rem;
  font-weight: 600;
}
.k-chain-done .ic {
  flex: none;
  width: 18px;
  height: 18px;
}
.k-chain-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.k-chain-note {
  margin: 10px 0 0;
  font-size: 0.86rem;
  color: var(--ink-2);
}
.k-chain .k-hint-line {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 10px 0 0;
  font-size: 0.76rem;
  color: var(--ink-3);
}
.k-chain .k-hint-line .ic {
  flex: none;
  width: 13px;
  height: 13px;
}
.drop-panel.flat {
  padding: 0;
  background: none;
  border: 0;
  box-shadow: none;
  animation: none;
}
@media (max-width: 1099.98px) {
  .k-chain {
    inset-inline: 10px;
    inset-block-end: calc(72px + env(safe-area-inset-bottom));
    width: auto;
    max-width: 520px;
    margin-inline: auto;
  }
  /* الإشعارات تطلع فوق حتى ما تغطي شريط «كمّل عليه» */
  body:has(.k-chain) #k-toasts {
    top: calc(var(--top) + 10px);
    bottom: auto;
  }
}
@media (max-width: 640px) {
  .k-flow-name {
    order: 3;
    flex-basis: 100%;
  }
  .k-flow-count {
    order: 4;
  }
  .k-flow-hint {
    font-size: 0.8rem;
  }
  /* على الجوال الخطوات تنزل تحت بعض، والخط الواصل يصير عمودي */
  .k-flow-steps {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .k-flow-steps li {
    font-size: 0.8rem;
  }
  .k-flow-steps li + li::before {
    inset-inline-start: 17px;
    top: -11px;
    width: 0;
    height: 10px;
    border-top: 0;
    border-inline-start: 1.6px dashed var(--ink-3);
  }
}
@media (prefers-reduced-motion: reduce) {
  .k-chain,
  .k-flow,
  .flow-card {
    animation: none;
  }
}

/* ───────── شارك نسختك: رابط يحمل المحتوى ───────── */
.k-carry {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-bottom: 14px;
  padding: 12px 14px;
  background: var(--tint-sky);
  border: 1.8px solid var(--edge);
  border-radius: var(--r2);
  box-shadow: 3px 3px 0 var(--shadow);
  animation: k-pop 0.3s var(--ease) both;
}
.k-carry .k-flow-tag {
  background: var(--sky);
}
.k-carry p {
  flex: 1 1 260px;
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.7;
  color: var(--ink-2);
}
.k-carry-acts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.share-picks {
  display: grid;
  gap: 10px;
}
.share-pick {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px;
  font: inherit;
  color: inherit;
  text-align: start;
  background: var(--card);
  border: 1.8px solid var(--edge);
  border-radius: var(--r1);
  box-shadow: 2px 3px 0 var(--shadow);
  cursor: pointer;
  transition:
    transform 0.16s var(--spring),
    box-shadow 0.16s;
}
.share-pick:hover {
  transform: translate(-1px, -2px);
  box-shadow: 3px 5px 0 var(--shadow);
}
.share-pick:active {
  transform: translate(1px, 2px);
  box-shadow: 1px 1px 0 var(--shadow);
}
.share-pick:first-child {
  background: var(--tint-yellow);
}
.share-pick .tx {
  display: grid;
  flex: 1;
  gap: 2px;
  min-width: 0;
}
.share-pick b {
  font-family: var(--display);
  font-size: 1rem;
}
.share-pick small {
  font-size: 0.82rem;
  line-height: 1.6;
  color: var(--ink-2);
}
.share-pick .arr {
  flex: none;
  width: 18px;
  height: 18px;
  color: var(--ink-3);
}
.share-picks .k-hint-line,
.share-note {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin: 4px 0 0;
  font-size: 0.78rem;
  line-height: 1.6;
  color: var(--ink-3);
}
.share-note {
  margin-top: 10px;
}
.share-picks .k-hint-line .ic,
.share-note .ic {
  flex: none;
  width: 14px;
  height: 14px;
  margin-top: 3px;
}
.k-chip.carry {
  background: var(--tint-sky);
}
@media (prefers-reduced-motion: reduce) {
  .k-carry {
    animation: none;
  }
}


/* ══════════ ربط لوحة المالك (core/pulse.js) ══════════
   كل اللي تحت يظهر فقط لما المالك يفعّله من اللوحة. الصفحة الافتراضية ما تتغير. */

/* شارة على بطاقة الأداة: «جديد»، «تجريبي»، «متوقفة مؤقتًا»، «قيد المراجعة».
   النص يجي من متغير CSS تحدده pulse.js لكل أداة، فينطبق حتى على البطاقات اللي تنرسم لاحقًا. */
:is(a.tool-card, a.tool-chip, .s-sub a, .rank-list a, [role='option'] > a)::after {
  content: var(--kb-tag, none);
  flex: none;
  align-self: flex-start;
  margin-inline-start: auto;
  padding: 1px 8px;
  font-family: var(--body);
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1.6;
  color: #1d1c28;
  white-space: nowrap;
  background: var(--kb-tag-bg, var(--tint-yellow));
  border: 1.5px solid #1d1c28;
  border-radius: 999px;
}
:root[data-theme='dark'] :is(a.tool-card, a.tool-chip, .s-sub a, .rank-list a, [role='option'] > a)::after {
  background: var(--yellow);
}
.s-sub a::after {
  display: inline-block;
  margin-inline-start: 6px;
  vertical-align: middle;
}

/* غرف المذاكرة على نسخة الاستضافة: البطاقة والرابط يبقون في مكانهم. لين المالك يفتح الغرف تظهر كلمة «قريبًا»
   مكان «افتح غرفة» (boot.js يحط data-rooms قبل الرسم لما تنفتح، وفي التطوير المحلي دايمًا). */
html[data-rooms] .rooms-soon,
html:not([data-rooms]) .rooms-open {
  display: none !important;
}
/* مزايا يقدر المالك يطفيها */
html[data-no-share] :is([data-act='share'], [data-act='share-site'], #carry),
html[data-no-install] [data-act='install'],
html[data-no-flows] :is(#flows, #hub-myflows, .k-chain),
html[data-no-drop] :is(#udrop, [data-act='pick'], [data-act='paste']) {
  display: none !important;
}

/* أداة متوقفة أو بانتظار المراجعة */
.k-blocked {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 34px 18px;
  text-align: center;
}
.k-blocked > .ic {
  width: 34px;
  height: 34px;
  color: var(--ink-2);
}
.k-blocked h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 1.25rem;
}
.k-blocked p {
  max-width: 52ch;
  margin: 0 0 6px;
  color: var(--ink-2);
}

/* وضع الصيانة */
html[data-maint] body {
  overflow: hidden;
}
html[data-maint] body > :not(.k-maint):not(.k-ownerbar) {
  visibility: hidden;
}
.k-maint {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 20px;
  background: var(--bg);
}
.k-maint-box {
  display: grid;
  justify-items: center;
  gap: 12px;
  max-width: 480px;
  padding: 32px 24px;
  text-align: center;
}
.k-maint-box > .ic {
  width: 38px;
  height: 38px;
}
.k-maint-box h1 {
  margin: 0;
  font-family: var(--display);
  font-size: 1.5rem;
}
.k-maint-box p {
  margin: 0;
  color: var(--ink-2);
}

/* شريط المعاينة (للمالك فقط) — اسمه مختلف عن .k-preview حق معاينة الأدوات */
.k-ownerbar {
  position: fixed;
  inset-inline: 0;
  top: 8px;
  z-index: 210;
  display: flex;
  gap: 10px;
  align-items: center;
  width: fit-content;
  max-width: calc(100% - 20px);
  margin-inline: auto;
  padding: 6px 8px 6px 14px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #1d1c28;
  background: var(--yellow);
  border: 2px solid #1d1c28;
  border-radius: 999px;
  box-shadow: 3px 4px 0 rgba(0, 0, 0, 0.5);
}
[dir='rtl'] .k-ownerbar {
  padding: 6px 14px 6px 8px;
}

/* تنبيهات المالك: بطاقة ثابتة تحت، ما تزحزح محتوى الصفحة */
.k-notices {
  position: fixed;
  inset-inline: 12px;
  bottom: 14px;
  z-index: 70;
  display: grid;
  gap: 8px;
  justify-items: center;
  pointer-events: none;
}
.k-notice {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  width: min(560px, 100%);
  padding: 10px 10px 10px 14px;
  color: #1d1c28;
  pointer-events: auto;
  background: var(--tint-sky);
  border: 2px solid #1d1c28;
  border-radius: var(--r1);
  box-shadow: 3px 4px 0 rgba(0, 0, 0, 0.45);
  animation: k-pop 0.3s var(--spring) both;
}
:root[data-theme='dark'] .k-notice {
  background: #dceeff;
}
.k-notice.ok {
  background: #dcf6ea;
}
.k-notice.warn {
  background: #fff3c4;
}
.k-notice > .ic {
  flex: none;
  margin-top: 3px;
}
.k-notice .tx {
  display: grid;
  flex: 1;
  gap: 2px;
  min-width: 0;
  font-size: 0.9rem;
}
.k-notice .tx a {
  width: fit-content;
  font-weight: 600;
  color: #17406f;
}
.k-notice .k-iconbtn {
  flex: none;
  width: 30px;
  height: 30px;
  color: #1d1c28;
}
@media (max-width: 1099px) {
  .k-notices {
    bottom: calc(74px + env(safe-area-inset-bottom));
  }
}

/* أخبار المنصة في الصفحة الرئيسية */
.k-news ul {
  display: grid;
  gap: 10px;
  padding: 0;
  margin: 0;
  list-style: none;
}
.k-news li {
  display: grid;
  gap: 2px;
  padding: 10px 14px;
  background: var(--card);
  border: 1.6px solid var(--line);
  border-radius: var(--r1);
}
.k-news li span {
  color: var(--ink-2);
}
.k-news li a {
  width: fit-content;
  font-weight: 600;
}

/* الرعاة: بطاقة هادية موسومة «برعاية» بوضوح */
.k-sponsors {
  display: grid;
  gap: 10px;
  margin-block: 18px;
}
.k-sponsors.at-footer {
  margin-block: 0 18px;
}
.k-sponsor {
  display: grid;
  overflow: hidden;
  color: var(--ink);
  text-decoration: none;
  background: var(--card);
  border: 1.6px dashed var(--line);
  border-radius: var(--r2);
  transition: border-color 0.18s;
}
.k-sponsor:hover {
  border-color: var(--ink-2);
}
.k-sponsor-banner {
  display: block;
  width: 100%;
  max-height: 150px;
  object-fit: cover;
  aspect-ratio: 16 / 4;
}
.k-sponsor-row {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 10px 14px;
}
.k-sponsor-logo {
  flex: none;
  width: 44px;
  height: 44px;
  object-fit: contain;
  background: #fff;
  border: 1.4px solid var(--line);
  border-radius: 10px;
}
.k-sponsor-tx {
  display: grid;
  flex: 1;
  min-width: 0;
}
.k-sponsor-tx small {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--ink-3);
  letter-spacing: 0.02em;
}
.k-sponsor-tx span {
  font-size: 0.88rem;
  color: var(--ink-2);
}
.k-sponsor .arr {
  flex: none;
  color: var(--ink-3);
}
.k-aff {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  align-items: center;
  margin-block: 12px;
  font-size: 0.9rem;
}

/* إضافات التذييل: رسالة عامة، بريد التواصل، حسابات التواصل */
.foot-edge {
  display: grid;
  gap: 6px;
  margin-top: 12px;
  font-size: 0.9rem;
  color: var(--ink-2);
}
.foot-edge p {
  margin: 0;
}
.foot-contact {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  align-items: center;
}
.foot-contact a {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}
.k-brand-logo {
  width: 30px;
  height: 30px;
  object-fit: contain;
}
@media (prefers-reduced-motion: reduce) {
  .k-notice {
    animation: none;
  }
}
