/* ============================================================
   AY/OS : apps.css : interiors of every application window
   ============================================================ */

.app-pad { padding: 24px; }
.mono { font-family: var(--f-mono); }
.muted { color: var(--muted); }

/* على النوافذ العريضة/المكبرة: حصر محتوى القراءة في عمود مركزي
   بهوامش متساوية بدل تركه ملتصقا بجهة واحدة (شكل المستند الاحترافي) */
.win[data-app="about"] .win-body,
.win[data-app="projects"] .win-body,
.win[data-app="skills"] .win-body,
.win[data-app="cv"] .win-body,
.win[data-app="contact"] .win-body,
.win[data-app="server"] .win-body,
.win[data-app="trash"] .win-body {
  padding-inline: max(0px, calc((100% - 1000px) / 2));
}
@media (max-width: 840px), (max-height: 540px) and (pointer: coarse) {
  .win .win-body { padding-inline: 0 !important; }
}

.app-h {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: 1.5rem;
  letter-spacing: .01em;
  margin-bottom: 4px;
}
.app-sub { color: var(--muted); font-size: .82rem; margin-bottom: 20px; }
.sect-h {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--f-mono); font-size: .74rem; letter-spacing: 0;
  text-transform: uppercase; color: var(--acc);
  margin: 28px 0 14px;
}
html[lang="en"] .sect-h { letter-spacing: .22em; }
.sect-h::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ============================================================
   TERMINAL
   ============================================================ */
.term {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  background: #070b12;
  color: #cfe3f5;
  font-family: var(--f-mono);
  font-size: .845rem;
  line-height: 1.75;
  cursor: text;
}
html[data-theme="crt"] .term { background: transparent; color: var(--ink); }
.term-out { flex: 1; overflow-y: auto; padding: 16px 18px 4px; white-space: pre-wrap; word-break: break-word; }
.term-out a { color: var(--acc); }
.t-ok { color: #3ddc97; }
.t-err { color: #ff5470; }
.t-warn { color: #ffb454; }
.t-acc { color: #5ad7ff; }
.t-mut { color: #5e7187; }
.t-banner { color: #5ad7ff; text-shadow: 0 0 14px rgba(90, 215, 255, .4); line-height: 1.25; font-size: .72rem; }
html[data-theme="crt"] .t-ok, html[data-theme="crt"] .t-acc, html[data-theme="crt"] .t-banner { color: var(--ink); text-shadow: 0 0 8px rgba(86, 255, 164, .45); }

.term-in-row { display: flex; align-items: center; gap: 8px; padding: 2px 18px 14px; }
.term-prompt { white-space: nowrap; flex-shrink: 0; }
.term-prompt .p-user { color: #3ddc97; }
.term-prompt .p-at { color: #5e7187; }
.term-prompt .p-host { color: #5ad7ff; }
.term-prompt .p-sym { color: #aebdcd; margin-inline-start: 6px; }
.term-input-wrap { position: relative; flex: 1; display: flex; align-items: center; min-width: 0; }
#term-input {
  flex: 1; min-width: 0; background: none; border: 0; outline: none;
  font-family: var(--f-mono); font-size: .845rem; color: inherit;
  caret-color: transparent; /* نخفي مؤشر المتصفح ونرسم كتلة خاصة */
  direction: ltr; text-align: left;
}
.term-cursor {
  position: absolute; left: 0; top: 50%; transform: translate(0, -50%);
  width: .52em; height: 1.08em; border-radius: 1px;
  background: var(--acc); box-shadow: 0 0 9px color-mix(in srgb, var(--acc) 70%, transparent);
  pointer-events: none; opacity: 0;
}
.term-in-row.is-focused .term-cursor { animation: term-blink 1.08s steps(1, end) infinite; }
@keyframes term-blink { 0%, 55% { opacity: .92; } 55.01%, 100% { opacity: 0; } }
.term-mirror {
  position: absolute; left: 0; top: -9999px; visibility: hidden;
  white-space: pre; pointer-events: none;
  font-family: var(--f-mono); font-size: .845rem; letter-spacing: normal;
}
.term-matrix { position: absolute; inset: 0; z-index: 5; }
.t-train {
  white-space: pre; color: #5ad7ff; line-height: 1.25; font-size: .72rem;
  animation: train-run 3s linear forwards;
  text-shadow: 0 0 10px rgba(90, 215, 255, .4);
}
@keyframes train-run {
  from { transform: translateX(105%); opacity: 1; }
  to { transform: translateX(-110%); opacity: 1; }
}

/* ============================================================
   ABOUT
   ============================================================ */
.about-hero { padding: 30px 26px 6px; }
.about-name {
  font-family: var(--f-display); font-weight: 800;
  font-size: clamp(1.7rem, 4vw, 2.5rem);
  line-height: 1.1;
  background: linear-gradient(120deg, var(--ink) 40%, var(--acc) 90%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  padding-bottom: .15em;
}
.about-title { color: var(--acc); font-size: .92rem; font-weight: 600; margin-top: 6px; }
.about-tag { color: var(--ink2); font-size: .95rem; margin-top: 14px; max-width: 56ch; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(108px, 1fr)); gap: 10px; padding: 22px 26px; }
.stat {
  border: 1px solid var(--line); border-radius: var(--r);
  background: var(--panel-2);
  padding: 14px 12px;
  text-align: center;
  transition: transform var(--t-med) var(--ease), border-color var(--t-fast), box-shadow var(--t-med);
}
.stat:hover { transform: translateY(-3px); border-color: var(--acc); box-shadow: var(--glow); }
.stat b { display: block; font-family: var(--f-mono); font-size: 1.45rem; color: var(--acc); font-weight: 600; }
.stat span { font-size: .68rem; color: var(--muted); }

.about-body { padding: 0 26px 26px; }
.about-body p { color: var(--ink2); font-size: .92rem; margin-bottom: 14px; max-width: 64ch; }
.about-body p strong { color: var(--ink); }

.about-pull {
  margin: 22px 0 6px; padding: 16px 22px;
  border-inline-start: 3px solid var(--acc);
  border-radius: 0 var(--r) var(--r) 0;
  background: linear-gradient(100deg, color-mix(in srgb, var(--acc) 10%, transparent), transparent 80%);
  font-family: var(--f-display); font-weight: 700;
  font-size: clamp(1rem, 2vw, 1.18rem); line-height: 1.65;
  color: var(--ink);
}
html[dir="rtl"] .about-pull { border-radius: var(--r) 0 0 var(--r); }
.why-sub { color: var(--muted); font-size: .85rem; margin: -6px 0 14px; }

.why-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(185px, 1fr));
  gap: 10px; margin: 4px 0 8px;
}
.why {
  border: 1px solid var(--line); border-radius: var(--r);
  background: var(--panel-2);
  padding: 15px 17px;
  transition: transform var(--t-med) var(--ease), border-color var(--t-fast), box-shadow var(--t-med);
}
.why:hover { transform: translateY(-3px); border-color: var(--acc); box-shadow: var(--glow); }
.why b { display: block; color: var(--acc); font-size: .9rem; margin-bottom: 7px; }
.why p { font-size: .8rem; color: var(--muted); margin: 0; line-height: 1.7; }

.tl { position: relative; margin: 6px 0 4px; padding-inline-start: 26px; }
.tl::before { content: ""; position: absolute; inset-inline-start: 7px; top: 8px; bottom: 8px; width: 1px; background: var(--line2); }
.tl-item { position: relative; padding-bottom: 20px; }
.tl-item:last-child { padding-bottom: 4px; }
.tl-item::before {
  content: ""; position: absolute; inset-inline-start: -23px; top: 7px;
  width: 9px; height: 9px; border-radius: 99px;
  background: var(--bg1); border: 2px solid var(--acc);
  transition: background var(--t-fast), box-shadow var(--t-fast);
}
.tl-item:hover::before { background: var(--acc); box-shadow: 0 0 12px var(--acc); }
.tl-y { font-family: var(--f-mono); font-size: .72rem; color: var(--acc); letter-spacing: .12em; }
.tl-t { font-weight: 700; font-size: .95rem; margin: 2px 0; }
.tl-d { color: var(--muted); font-size: .84rem; max-width: 58ch; }

.edu-list { display: flex; flex-direction: column; gap: 10px; }
.edu {
  display: flex; justify-content: space-between; align-items: baseline; gap: 14px;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--panel-2);
  padding: 12px 16px; font-size: .86rem;
}
.edu b { font-weight: 600; }
.edu span { font-family: var(--f-mono); font-size: .72rem; color: var(--muted); white-space: nowrap; }

/* ============================================================
   PROJECTS
   ============================================================ */
.proj-grid {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(295px, 1fr));
  padding: 22px;
}

/* ---------- بطاقة البطل (المشروع الأبرز) ---------- */
.proj-featured-wrap { padding: 8px 22px 0; }
.proj.proj-hero {
  display: grid; grid-template-columns: 1.05fr 1fr; gap: 0;
  padding: 0; overflow: hidden;
  border-color: var(--line2);
  background: linear-gradient(150deg, color-mix(in srgb, var(--acc) 9%, var(--panel-2)), transparent 70%);
}
.proj.proj-hero:hover { transform: none; box-shadow: var(--shadow-win); border-color: var(--acc); }
@media (max-width: 720px) { .proj.proj-hero { grid-template-columns: 1fr; } }
.hero-media {
  position: relative; min-height: 300px;
  border-inline-end: 1px solid var(--line);
  background: radial-gradient(120% 90% at 30% 10%, color-mix(in srgb, var(--acc) 14%, transparent), transparent 70%), var(--bg1);
  display: grid; place-items: center; padding: 22px;
}
.hero-shot-ph {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  color: var(--muted); font-size: .82rem; text-align: center;
}
.hero-shot-ph svg { width: 46px; height: 46px; color: var(--line2); }
.hero-shots { display: grid; gap: 10px; width: 100%; }
.hero-shots img { width: 100%; border-radius: var(--r); border: 1px solid var(--line); box-shadow: 0 8px 24px rgba(0,0,0,.3); }
.hero-body { padding: 22px 24px; }
.hero-flag {
  margin-inline-start: auto;
  font-family: var(--f-mono); font-size: .62rem; letter-spacing: .12em;
  padding: .3em .9em; border-radius: 99px;
  color: var(--acc-ink); background: var(--acc); font-weight: 700;
}
html[lang="ar"] .hero-flag { letter-spacing: 0; }
.hero-name {
  font-family: var(--f-display); font-weight: 800;
  font-size: clamp(1.3rem, 2.6vw, 1.7rem); line-height: 1.25; margin-top: 12px;
}
.hero-tagline { color: var(--acc2); font-size: .92rem; font-weight: 600; margin: 10px 0 4px; }
.hero-body .proj-desc { margin-top: 8px; }
.hero-highlights { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 4px; }
.hero-highlights .hl {
  font-size: .74rem; color: var(--ink); font-weight: 600;
  padding: .4em .9em; border-radius: 8px;
  background: var(--panel-2); border: 1px solid var(--line2);
  display: inline-flex; align-items: center; gap: 6px;
}
.hero-highlights .hl::before { content: "✓"; color: var(--ok); font-weight: 700; }
@media (max-width: 720px) {
  .proj-hero { grid-template-columns: 1fr; }
  .hero-media { min-height: 180px; border-inline-end: 0; border-bottom: 1px solid var(--line); }
}
.proj {
  position: relative;
  border: 1px solid var(--line); border-radius: var(--r-lg);
  background: linear-gradient(160deg, var(--panel-2), transparent 60%);
  padding: 20px;
  display: flex; flex-direction: column; gap: 12px;
  transition: transform var(--t-med) var(--ease), border-color var(--t-fast), box-shadow var(--t-med);
  overflow: hidden;
}
.proj::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(420px 200px at var(--mx, 50%) -20%, color-mix(in srgb, var(--acc) 10%, transparent), transparent 70%);
  opacity: 0; transition: opacity var(--t-med);
}
.proj:hover { transform: translateY(-4px); border-color: var(--line2); box-shadow: var(--shadow-pop); }
.proj:hover::after { opacity: 1; }
.proj-top { display: flex; align-items: center; justify-content: space-between; }
.proj-ico { color: var(--acc); }
.proj-ico svg { width: 24px; height: 24px; }
.badge {
  font-family: var(--f-mono); font-size: .64rem; letter-spacing: 0;
  padding: .25em .8em; border-radius: 99px;
  border: 1px solid;
}
html[lang="en"] .badge { letter-spacing: .08em; }
.badge-live { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 45%, transparent); background: color-mix(in srgb, var(--ok) 10%, transparent); }
.badge-wip  { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 45%, transparent); background: color-mix(in srgb, var(--warn) 10%, transparent); }
.badge-doc  { color: var(--ink2); border-color: var(--line2); background: var(--panel-2); }
.badge-live::before { content: "● "; animation: gem-pulse 1.8s infinite; }
.proj-name { font-weight: 700; font-size: 1.05rem; }
.proj-period { font-family: var(--f-mono); font-size: .68rem; color: var(--muted); letter-spacing: .1em; margin-top: 2px; }
.proj-desc { color: var(--ink2); font-size: .85rem; flex: 1; }
.proj-points { list-style: none; display: flex; flex-direction: column; gap: 5px; }
.proj-points li { font-size: .8rem; color: var(--muted); padding-inline-start: 16px; position: relative; }
.proj-points li::before { content: "▸"; position: absolute; inset-inline-start: 0; color: var(--acc); font-size: .8rem; top: .05em; }
html[dir="rtl"] .proj-points li::before { content: "◂"; }
.proj-stack { display: flex; flex-wrap: wrap; gap: 6px; }
.proj-foot { display: flex; justify-content: flex-end; }
.proj-link { font-size: .8rem; font-weight: 600; }
.proj-priv { font-family: var(--f-mono); font-size: .7rem; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.proj-priv svg { width: 13px; height: 13px; }

/* ============================================================
   SKILLS : package manager
   ============================================================ */
.pkg-head {
  font-family: var(--f-mono); font-size: .82rem; color: var(--muted);
  padding: 20px 24px 4px;
}
.pkg-head .t-acc { color: var(--acc); }
.pkg-cat { padding: 0 24px; }
.pkg-cat-h {
  font-family: var(--f-mono); font-size: .72rem; letter-spacing: 0; text-transform: uppercase;
  color: var(--acc);
  display: flex; align-items: center; gap: 10px;
  margin: 22px 0 10px;
}
html[lang="en"] .pkg-cat-h { letter-spacing: .18em; }
.pkg-cat-h::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.pkg-rows { display: flex; flex-direction: column; }
.pkg-row {
  display: grid;
  grid-template-columns: minmax(150px, 1.4fr) auto minmax(70px, 1fr);
  align-items: center; gap: 14px;
  padding: 8px 10px; border-radius: var(--r-sm);
  font-family: var(--f-mono); font-size: .8rem;
  transition: background var(--t-fast);
}
.pkg-row:hover { background: var(--panel-2); }
.pkg-n { color: var(--ink); direction: ltr; text-align: start; }
.pkg-v { color: var(--muted); font-size: .7rem; white-space: nowrap; }
.pkg-meter { height: 4px; border-radius: 99px; background: var(--panel-2); border: 1px solid var(--line); overflow: hidden; }
.pkg-meter i {
  display: block; height: 100%; width: 0;
  background: linear-gradient(90deg, var(--acc-deep), var(--acc));
  border-radius: 99px;
  transition: width 1s var(--ease);
}
.pkg-row:hover .pkg-meter i { box-shadow: 0 0 8px var(--acc); }
.pkg-installing { color: var(--warn) !important; }
.pkg-meter i.installing {
  width: 38%;
  background: linear-gradient(90deg, var(--warn), var(--acc));
  animation: pkg-inst 1.15s linear infinite;
}
@keyframes pkg-inst {
  from { transform: translateX(-110%); }
  to { transform: translateX(300%); }
}
.pkg-foot { padding: 18px 24px 24px; font-family: var(--f-mono); font-size: .74rem; color: var(--ok); }

/* ---------- بطاقات فئات المهارات + حبوب التقنيات ---------- */
.skill-cats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 14px; padding: 14px 24px 4px;
}
.skill-card {
  border: 1px solid var(--line); border-radius: var(--r-lg);
  background: linear-gradient(160deg, var(--panel-2), transparent 72%);
  padding: 16px 18px;
  transition: border-color var(--t-fast), box-shadow var(--t-med), transform var(--t-med) var(--ease);
}
.skill-card:hover { border-color: var(--line2); box-shadow: var(--shadow-pop); transform: translateY(-2px); }
.skill-card-h { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.skill-cat-ico { display: grid; place-items: center; color: var(--acc); flex-shrink: 0; }
.skill-cat-ico svg { width: 19px; height: 19px; }
.skill-cat-name { font-weight: 700; font-size: .9rem; }
.skill-cat-count {
  margin-inline-start: auto;
  font-family: var(--f-mono); font-size: .68rem; color: var(--muted);
  border: 1px solid var(--line); border-radius: 99px; padding: .12em .65em;
}
.skill-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.sk {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--f-mono); font-size: .77rem; color: var(--ink2);
  padding: .42em .8em; border-radius: 9px;
  background: var(--panel-2); border: 1px solid var(--line);
  transition: all var(--t-fast) var(--ease);
  direction: ltr; cursor: default;
}
.sk:hover { border-color: var(--acc); color: var(--ink); transform: translateY(-2px); box-shadow: var(--glow); }
.sk b { font-size: .64rem; color: var(--acc); font-weight: 600; opacity: .9; }
.sk-logo { display: inline-flex; color: var(--acc); flex-shrink: 0; transition: filter var(--t-fast); }
.sk-logo svg { width: 15px; height: 15px; display: block; }
.sk:hover .sk-logo { filter: drop-shadow(0 0 5px var(--acc)); }
.sk-n { line-height: 1; }
/* حركة دخول متدرجة */
.sk { animation: sk-in .42s var(--ease) both; }
@keyframes sk-in { from { opacity: 0; transform: translateY(9px); } }
.sk-inst { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 42%, transparent); background: color-mix(in srgb, var(--warn) 9%, transparent); }
.sk-inst:hover { border-color: var(--warn); box-shadow: 0 0 18px color-mix(in srgb, var(--warn) 35%, transparent); }
.sk-dot { width: 6px; height: 6px; border-radius: 99px; background: var(--warn); animation: gem-pulse 1s ease-in-out infinite; }

/* ============================================================
   CV
   ============================================================ */
.cv-bar {
  position: sticky; top: 0; z-index: 10;
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  padding: 16px 24px;
  background: var(--panel-solid);
  border-bottom: 1px solid var(--line);
}
.cv-bar .spacer { flex: 1; }
.cv-bar-label { font-family: var(--f-mono); font-size: .76rem; color: var(--muted); letter-spacing: .04em; }
.cv-doc { padding: 30px 28px 34px; }

.cv-head { padding-bottom: 18px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.cv-name {
  font-family: var(--f-display); font-weight: 800; font-size: clamp(1.7rem, 3vw, 2.2rem);
  background: linear-gradient(120deg, var(--ink) 45%, var(--acc) 95%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  padding-bottom: .12em;
}
.cv-role { color: var(--acc); font-weight: 600; font-size: .95rem; margin: 4px 0 0; }
.cv-meta-row { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 14px; }
.cv-m { font-family: var(--f-mono); font-size: .74rem; color: var(--muted); direction: ltr; unicode-bidi: plaintext; }
.cv-m.cv-open { color: var(--ok); font-family: var(--f-ui); }
.cv-m.cv-link { color: var(--acc); text-decoration: none; transition: color var(--t-fast), text-decoration var(--t-fast); }
.cv-m.cv-link:hover { text-decoration: underline; filter: brightness(1.12); }
.cv-sum { color: var(--ink2); font-size: .92rem; margin-bottom: 12px; max-width: 70ch; line-height: 1.75; }

.cv-stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 1px;
  margin: 20px 0 8px; background: var(--line);
  border: 1px solid var(--line); border-radius: var(--r); overflow: hidden;
}
.cv-stat { background: var(--panel-solid); padding: 14px 8px; text-align: center; }
.cv-stat b { display: block; font-family: var(--f-mono); font-size: 1.25rem; color: var(--acc); font-weight: 600; }
.cv-stat span { font-size: .64rem; color: var(--muted); }

.cv-x { margin-bottom: 20px; padding-inline-start: 14px; border-inline-start: 2px solid var(--line); }
.cv-x-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.cv-x-head b { font-size: .98rem; }
.cv-x-head span { font-family: var(--f-mono); font-size: .7rem; color: var(--acc); white-space: nowrap; }
.cv-x-desc { font-size: .85rem; color: var(--ink2); margin-top: 6px; line-height: 1.7; }
.cv-x ul { list-style: none; margin-top: 8px; display: flex; flex-direction: column; gap: 5px; }
.cv-x li { font-size: .83rem; color: var(--muted); padding-inline-start: 16px; position: relative; }
.cv-x li::before { content: "▸"; position: absolute; inset-inline-start: 0; color: var(--acc); font-size: .7rem; top: .15em; }
html[dir="rtl"] .cv-x li::before { content: "◂"; }
.cv-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.cv-chips.small { margin-top: 10px; }
.cv-chips.small .chip { font-size: .68rem; }

.cv-skills { display: flex; flex-direction: column; gap: 12px; }
.cv-skill-row { display: grid; grid-template-columns: 130px 1fr; gap: 12px; align-items: start; }
.cv-skill-cat { font-size: .82rem; font-weight: 600; color: var(--ink); padding-top: 4px; }
.cv-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
@media (max-width: 600px) {
  .cv-skill-row { grid-template-columns: 1fr; gap: 6px; }
  .cv-two-col { grid-template-columns: 1fr; gap: 0; }
}

/* ============================================================
   CONTACT
   ============================================================ */
/* كتلة متوازنة عموديا (لا فراغ علوي/سفلي مزعج) + إجراء واضح + تفاصيل مهنية */
.contact { display: flex; flex-direction: column; justify-content: center; min-height: 100%; padding: 16px 0; }
.contact-cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.btn-lg { padding: .78em 1.4em; font-size: .92rem; }
.contact-details {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 10px; padding: 22px 26px 8px;
}
.cd {
  border: 1px solid var(--line); border-radius: var(--r);
  background: linear-gradient(160deg, var(--panel-2), transparent); padding: 13px 16px;
  transition: border-color var(--t-fast), box-shadow var(--t-med);
}
.cd:hover { border-color: var(--line2); box-shadow: var(--shadow-pop); }
.cd span { display: block; font-size: .67rem; color: var(--muted); margin-bottom: 5px; }
.cd b { font-size: .88rem; color: var(--ink); font-weight: 600; }
.cd b span { font-family: var(--f-mono); font-size: .82rem; }
.cd-ok { color: var(--ok) !important; font-size: .82rem !important; }
.contact-socials { display: flex; flex-wrap: wrap; gap: 10px; padding: 10px 26px 2px; }
.csoc {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--line); border-radius: 10px; padding: .55em 1.05em;
  color: var(--ink2); font-size: .82rem; transition: all var(--t-fast) var(--ease);
}
.csoc:hover { border-color: var(--acc); color: var(--ink); box-shadow: var(--glow); text-decoration: none; transform: translateY(-2px); }
.csoc svg { width: 17px; height: 17px; color: var(--acc); }

.contact-hero { padding: 30px 26px 10px; }
.contact-need {
  margin-top: 12px; padding: 11px 16px;
  border: 1px dashed var(--line2); border-radius: var(--r);
  color: var(--ink2); font-size: .86rem; max-width: 60ch;
  background: var(--panel-2);
}
.contact-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); padding: 14px 26px 8px; }
.ccard {
  border: 1px solid var(--line); border-radius: var(--r-lg);
  background: var(--panel-2);
  padding: 18px;
  display: flex; flex-direction: column; gap: 9px;
  transition: transform var(--t-med) var(--ease), border-color var(--t-fast), box-shadow var(--t-med);
}
.ccard:hover { transform: translateY(-3px); border-color: var(--acc); box-shadow: var(--glow); }
.ccard-k { display: flex; align-items: center; gap: 9px; font-size: .76rem; color: var(--muted); }
.ccard-k svg { width: 16px; height: 16px; color: var(--acc); }
.ccard-v { font-family: var(--f-mono); font-size: .9rem; color: var(--ink); direction: ltr; text-align: start; word-break: break-all; }
html[dir="rtl"] .ccard-v { text-align: end; }
.ccard-v.ar { font-family: var(--f-ui); direction: rtl; }
.ccard-acts { display: flex; gap: 7px; margin-top: auto; }
.ccard-acts .btn { padding: .45em .9em; font-size: .78rem; }
.contact-sla {
  margin: 18px 26px 6px; padding: 14px 18px;
  border: 1px dashed var(--line2); border-radius: var(--r);
  font-family: var(--f-mono); font-size: .78rem; color: var(--ok);
}

/* ============================================================
   SERVER ROOM
   ============================================================ */
/* تخطيط عمودي يملأ كامل ارتفاع النافذة (لا فراغ في الأسفل) */
.sr { display: flex; flex-direction: column; min-height: 100%; padding-bottom: 16px; }
.sr-cap { padding: 2px 24px 10px; color: var(--ink2); font-size: .86rem; }

.sr-metrics {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px;
  padding: 2px 24px 14px;
}
.sr-metric {
  border: 1px solid var(--line); border-radius: var(--r);
  background: linear-gradient(160deg, var(--panel-2), transparent);
  padding: 12px 8px; text-align: center;
}
.sr-metric b { display: block; font-family: var(--f-mono); font-size: 1.2rem; color: var(--acc); font-weight: 600; }
.sr-metric span { font-size: .63rem; color: var(--muted); }
@media (max-width: 560px) { .sr-metrics { grid-template-columns: repeat(2, 1fr); } }

.sr-status {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 22px 24px 6px;
}
.sr-pill {
  display: inline-flex; align-items: center; gap: 9px;
  border: 1px solid color-mix(in srgb, var(--ok) 40%, transparent);
  background: color-mix(in srgb, var(--ok) 9%, transparent);
  color: var(--ok);
  border-radius: 99px; padding: .45em 1.1em;
  font-size: .8rem; font-weight: 600;
}
.sr-dot { width: 8px; height: 8px; border-radius: 99px; background: var(--ok); box-shadow: 0 0 10px var(--ok); animation: gem-pulse 1.6s infinite; }
.sr-up { font-family: var(--f-mono); font-size: .76rem; color: var(--muted); }
.sr-up b { color: var(--acc); font-weight: 600; }

.rack { display: grid; grid-template-columns: repeat(auto-fill, minmax(195px, 1fr)); gap: 10px; padding: 18px 24px; }
.node {
  border: 1px solid var(--line); border-radius: var(--r);
  background: linear-gradient(180deg, var(--panel-2), transparent);
  padding: 12px 14px;
  display: flex; flex-direction: column; gap: 8px;
  transition: border-color var(--t-fast), box-shadow var(--t-med);
}
.node:hover { border-color: var(--acc); box-shadow: var(--glow); }
.node[data-level="mid"] .node-meter i { background: linear-gradient(90deg, var(--acc-deep), var(--warn)); }
.node[data-level="hi"] .node-meter i { background: linear-gradient(90deg, var(--warn), var(--bad)); }
.node[data-level="mid"] .led { background: var(--warn); box-shadow: 0 0 8px var(--warn); }
.node[data-level="hi"] .led { background: var(--bad); box-shadow: 0 0 9px var(--bad); }
.node[data-level="hi"] .node-pct { color: var(--bad); }
.node-top { display: flex; align-items: center; gap: 9px; font-family: var(--f-mono); font-size: .72rem; color: var(--ink2); direction: ltr; text-align: left; }
.led { width: 7px; height: 7px; border-radius: 99px; background: var(--ok); box-shadow: 0 0 8px var(--ok); animation: led-blink 2.4s infinite; flex-shrink: 0; }
@keyframes led-blink { 0%, 88%, 100% { opacity: 1; } 92%, 96% { opacity: .25; } }
.node-load { display: flex; align-items: center; gap: 8px; }
.node-meter { flex: 1; height: 4px; border-radius: 99px; background: var(--panel-2); border: 1px solid var(--line); overflow: hidden; }
.node-meter i { display: block; height: 100%; background: linear-gradient(90deg, var(--acc-deep), var(--acc)); border-radius: 99px; transition: width 1.4s var(--ease); }
.node-pct { font-family: var(--f-mono); font-size: .64rem; color: var(--muted); width: 4ch; text-align: end; }

.sr-log-wrap { flex: 1; min-height: 140px; display: flex; flex-direction: column; padding: 4px 24px 14px; }
.sr-log-head {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--f-mono); font-size: .7rem; color: var(--muted);
  letter-spacing: .04em; margin-bottom: 7px;
}
.sr-log-head .led { width: 7px; height: 7px; border-radius: 99px; background: var(--ok); box-shadow: 0 0 8px var(--ok); animation: led-blink 2.4s infinite; }
.sr-log {
  flex: 1; min-height: 110px; overflow-y: auto;
  background: #060a10;
  border: 1px solid var(--line); border-radius: var(--r);
  padding: 12px 14px;
  font-family: var(--f-mono); font-size: .7rem; line-height: 1.85;
  color: #aebdcd;
  direction: ltr; text-align: left;
}
html[data-theme="crt"] .sr-log { background: rgba(0, 0, 0, .4); color: var(--ink2); }
.sr-log .lg-ok { color: #3ddc97; }
.sr-log .lg-info { color: #5ad7ff; }
.sr-log .lg-crit { color: #ff5470; font-weight: 600; }
.sr-log .lg-warn { color: #ffb454; }

.sr-danger { display: flex; align-items: center; justify-content: center; padding: 6px 24px 26px; }
.big-red {
  position: relative;
  padding: 16px 38px;
  border-radius: 14px;
  background: linear-gradient(180deg, #ff5470, #d6385e);
  color: #fff; font-weight: 800; font-size: .95rem; letter-spacing: .04em;
  border: 1px solid #ff8aa0;
  box-shadow: 0 10px 30px rgba(255, 84, 112, .35), inset 0 2px 0 rgba(255, 255, 255, .25);
  transition: transform var(--t-fast) var(--ease), box-shadow var(--t-fast);
}
.big-red:hover { transform: translateY(-2px); box-shadow: 0 16px 40px rgba(255, 84, 112, .5), inset 0 2px 0 rgba(255, 255, 255, .25); }
.big-red:active { transform: translateY(2px) scale(.97); }

/* ============================================================
   SETTINGS : لوحة بطاقات مركزة منظمة
   ============================================================ */
.set { max-width: 680px; margin: 0 auto; padding: 24px 24px 30px; display: flex; flex-direction: column; gap: 18px; }
.set-top { text-align: center; margin-bottom: 2px; }
.set-title { font-family: var(--f-display); font-weight: 800; font-size: 1.5rem; color: var(--ink); }
.set-ver { font-family: var(--f-mono); font-size: .74rem; color: var(--muted); margin-top: 3px; }
.set-card {
  border: 1px solid var(--line); border-radius: var(--r-lg);
  background: linear-gradient(180deg, var(--panel-2), transparent);
  overflow: hidden;
}
.set-card-h {
  display: flex; align-items: center; gap: 9px;
  padding: 12px 18px; border-bottom: 1px solid var(--line);
  font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted);
}
.set-card-h svg { width: 15px; height: 15px; color: var(--acc); }
.set-row {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  font-size: .9rem;
}
.set-row:last-child { border-bottom: 0; }
.set-row.set-block { display: block; }
.set-label { display: inline-flex; align-items: center; gap: 11px; color: var(--ink); }
.set-label > svg { width: 18px; height: 18px; color: var(--ink2); flex-shrink: 0; }
.set-block .set-label { margin-bottom: 12px; }
.set-secrets-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 18px; flex-wrap: wrap; }
.set-secrets-prog { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 140px; }
.set-secrets-bar { flex: 1; max-width: 220px; height: 6px; border-radius: 99px; background: var(--panel-2); border: 1px solid var(--line); overflow: hidden; }
.set-secrets-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--acc-deep), var(--acc)); border-radius: 99px; transition: width var(--t-med) var(--ease); }
.set-secrets-prog .mono { font-size: .8rem; color: var(--ink2); }
.seg { display: flex; gap: 5px; flex-wrap: wrap; }
.seg button {
  padding: .42em 1em; border-radius: 9px;
  border: 1px solid var(--line); color: var(--ink2);
  font-size: .78rem; transition: all var(--t-fast);
}
.seg button:hover { border-color: var(--acc); color: var(--ink); }
.seg button.is-on { background: var(--acc); border-color: var(--acc); color: var(--acc-ink); font-weight: 700; }

.theme-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; padding: 2px 0; }
.tcard {
  border: 1px solid var(--line); border-radius: var(--r);
  padding: 10px; text-align: center;
  transition: all var(--t-fast);
}
.tcard .sw { height: 44px; border-radius: 8px; margin-bottom: 8px; border: 1px solid var(--line); }
.tcard span { font-size: .72rem; color: var(--ink2); }
.tcard span svg { width: 11px; height: 11px; vertical-align: -2px; }
.tcard:hover { border-color: var(--acc); transform: translateY(-2px); }
.tcard.is-on { border-color: var(--acc); box-shadow: var(--glow); }
.tcard.is-locked { opacity: .55; }
.sw-dark { background: linear-gradient(140deg, #0a0f17 60%, #5ad7ff); }
.sw-light { background: linear-gradient(140deg, #f2efe7 60%, #0c7fc4); }
.sw-crt { background: linear-gradient(140deg, #021008 60%, #56ffa4); }
.sw-rgb { background: conic-gradient(#ff2d78, #ffbe0b, #3bf4fb, #8338ec, #ff2d78); }

.switch { position: relative; width: 46px; height: 26px; border-radius: 99px; background: var(--panel-2); border: 1px solid var(--line2); transition: background var(--t-fast), border-color var(--t-fast); flex-shrink: 0; }
.switch::after {
  content: ""; position: absolute; top: 2px; inset-inline-start: 3px;
  width: 19px; height: 19px; border-radius: 99px;
  background: var(--muted);
  transition: transform var(--t-med) var(--ease-snap), background var(--t-fast);
}
.switch.is-on { background: color-mix(in srgb, var(--acc) 25%, transparent); border-color: var(--acc); }
.switch.is-on::after { transform: translateX(19px); background: var(--acc); }
html[dir="rtl"] .switch.is-on::after { transform: translateX(-19px); }
.set-foot { text-align: center; padding: 8px 12px 4px; font-family: var(--f-mono); font-size: .68rem; color: var(--muted); line-height: 2; }

/* ============================================================
   TRASH
   ============================================================ */
.trash-wrap { display: flex; flex-direction: column; height: 100%; box-sizing: border-box; max-width: 780px; margin: 0 auto; }
.trash-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 13px 20px; border-bottom: 1px solid var(--line); flex-shrink: 0;
}
.trash-meta { display: inline-flex; align-items: center; gap: 9px; color: var(--ink2); font-size: .86rem; }
.trash-meta > svg { width: 17px; height: 17px; color: var(--muted); flex-shrink: 0; }
.trash-meta b { color: var(--acc); font-weight: 600; }
.trash-list { flex: 1; min-height: 0; overflow-y: auto; padding: 16px 20px; display: flex; flex-direction: column; gap: 8px; }
.trash-item {
  display: flex; align-items: center; gap: 12px;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--panel-2);
  padding: 11px 15px; font-size: .84rem;
  transition: transform var(--t-med) var(--ease), opacity var(--t-med), border-color var(--t-fast), background var(--t-fast);
}
.trash-item:hover { border-color: var(--line2); background: var(--panel); }
.trash-item > svg { width: 18px; height: 18px; color: var(--muted); flex-shrink: 0; }
.trash-item .tn { flex: 1; font-family: var(--f-mono); font-size: .78rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trash-item .ts { font-family: var(--f-mono); font-size: .68rem; color: var(--muted); flex-shrink: 0; }
.trash-item.is-gone { transform: translateX(60px) rotate(3deg); opacity: 0; }
html[dir="rtl"] .trash-item.is-gone { transform: translateX(-60px) rotate(-3deg); }
.trash-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; text-align: center; padding: 30px; }
.trash-empty > svg { width: 52px; height: 52px; color: var(--muted); opacity: .45; }
.trash-empty-h { font-size: 1.05rem; color: var(--ink2); font-weight: 600; }
.trash-empty-joke { font-size: .82rem; color: var(--muted); font-style: italic; max-width: 340px; line-height: 1.7; }

/* ============================================================
   TYPESPEED
   ============================================================ */
.type-wrap { display: flex; flex-direction: column; gap: 14px; padding: 24px; height: 100%; box-sizing: border-box; }
.type-hud { display: flex; gap: 24px; justify-content: center; font-family: var(--f-mono); font-size: .8rem; color: var(--ink2); flex-wrap: wrap; }
.type-hud b { color: var(--acc); font-size: 1.05rem; }
.type-text {
  font-size: 1.06rem; line-height: 2.1;
  padding: 20px 22px; min-height: 110px;
  border: 1px solid var(--line); border-radius: var(--r-lg);
  background: var(--panel-2);
  cursor: text; user-select: none;
  color: var(--muted);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.type-text:focus-within, .type-text:hover { border-color: var(--line2); }
.type-text .ok { color: var(--ink); }
.type-text .bad { color: var(--bad); background: color-mix(in srgb, var(--bad) 14%, transparent); border-radius: 3px; }
.type-text .cur { border-bottom: 2px solid var(--acc); animation: gem-pulse 1.1s infinite; color: var(--ink2); }
.type-input { position: absolute; opacity: 0; pointer-events: none; width: 1px; height: 1px; }
.type-msg { text-align: center; font-size: .92rem; padding: 4px; }
.type-foot { display: flex; justify-content: center; flex-shrink: 0; }
.type-hint { text-align: center; font-size: .74rem; flex-shrink: 0; }
/* منحنى السرعة الحي، يملأ المساحة السفلية بقيمة */
.type-graph-wrap { flex: 1; min-height: 92px; display: flex; flex-direction: column; gap: 7px; }
.type-graph-cap { flex-shrink: 0; font-family: var(--f-mono); font-size: .7rem; color: var(--muted); letter-spacing: .04em; }
.type-graph { flex: 1; width: 100%; min-height: 0; display: block; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel-2); }

/* ============================================================
   SNAKE : لوحة تتمدد لملء النافذة + لوحة نتائج زجاجية
   ============================================================ */
.snake-wrap {
  height: 100%; box-sizing: border-box;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  padding: 16px; overflow: hidden;
}
.snake-hud { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; flex-shrink: 0; }
.sk-chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: .4em 1.05em; border-radius: 99px;
  border: 1px solid var(--line); background: var(--panel-2);
  font-family: var(--f-mono); font-size: .73rem; color: var(--muted);
  letter-spacing: .03em;
}
.sk-chip b { color: var(--acc); font-size: .95rem; font-weight: 700; min-width: 1.4ch; text-align: center; transition: color var(--t-fast); }
.sk-chip.bump { animation: sk-bump .34s var(--ease-snap, ease); }
@keyframes sk-bump {
  0% { transform: scale(1); }
  40% { transform: scale(1.16); border-color: var(--acc); box-shadow: var(--glow); }
  100% { transform: scale(1); }
}

.snake-stage {
  flex: 1; width: 100%; min-height: 0;
  display: grid; place-items: center; position: relative;
}
#snake-canvas {
  border: 1px solid var(--line2); border-radius: var(--r);
  box-shadow: var(--glow), inset 0 0 70px rgba(0, 0, 0, .4);
  background: var(--bg1);
  touch-action: none; cursor: pointer;
  max-width: 100%; max-height: 100%;
}
.snake-msg {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  padding: 22px 28px; max-width: 86%;
  background: var(--panel-solid);
  border: 1px solid var(--line2); border-radius: var(--r-lg);
  box-shadow: 0 20px 55px rgba(0, 0, 0, .5);
  text-align: center; font-size: .98rem; line-height: 1.55; color: var(--ink);
  animation: snake-pop var(--t-med) var(--ease) both;
}
.snake-msg small { font-family: var(--f-mono); }
.snake-msg .btn { margin-top: 2px; }
@keyframes snake-pop {
  from { opacity: 0; transform: translate(-50%, -50%) scale(.9); }
  to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
.snake-hint {
  flex-shrink: 0; text-align: center;
  font-family: var(--f-mono); font-size: .72rem; color: var(--muted);
  letter-spacing: .14em; direction: ltr;
}

/* ============================================================
   NOTEPAD
   ============================================================ */
/* اقرأني: رسالة شخصية مقروءة فقط، مصممة كخطاب أنيق */
.readme { display: flex; flex-direction: column; min-height: 100%; }
.readme-bar {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 8px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-solid);
  font-size: .72rem;
}
.readme-doc {
  flex: 1;
  display: flex; flex-direction: column; justify-content: center;
  max-width: 620px; margin: 0 auto; width: 100%;
  padding: 34px 30px 40px;
}
.readme-h {
  font-family: var(--f-display); font-weight: 800;
  font-size: clamp(1.3rem, 2.4vw, 1.7rem);
  color: var(--ink); margin-bottom: 20px;
}
.readme-doc p {
  color: var(--ink2); font-size: 1rem; line-height: 2;
  margin-bottom: 16px;
}
.readme-doc p:last-of-type { margin-bottom: 8px; }
.readme-smile {
  display: inline-block; color: var(--acc);
  font-size: 1.25em; line-height: 1; vertical-align: -1px;
  margin-inline-start: 3px;
  animation: gem-pulse 2.6s ease-in-out infinite;
}
.readme-sign {
  margin-top: 14px; padding-top: 16px;
  border-top: 1px solid var(--line);
  font-family: var(--f-display); font-weight: 700;
  font-size: 1.2rem; color: var(--acc);
}

/* ============================================================
   small screens inside windows
   ============================================================ */
@media (max-width: 840px), (max-height: 540px) and (pointer: coarse) {
  .app-pad, .cv-doc { padding: 18px; }
  .proj-grid { padding: 16px; grid-template-columns: 1fr; }
  .about-hero, .contact-hero { padding: 22px 18px 4px; }
  .stats, .about-body { padding-inline: 18px; }
  .rack, .sr-status, .sr-log-wrap, .sr-danger { padding-inline: 16px; }
  .pkg-head, .pkg-cat, .pkg-foot { padding-inline: 16px; }
  .contact-grid { padding-inline: 18px; }
  .contact-sla { margin-inline: 18px; }
  .cv-bar { padding: 12px 16px; }
  .set { padding-inline: 16px; }
}

/* ============================================================
   التحديثات : feed (microblog على طراز X)
   ============================================================ */
.fd { max-width: 600px; margin: 0 auto; }

.fd-cover {
  height: 86px;
  background: color-mix(in srgb, var(--acc) 14%, var(--panel-2));
  border-bottom: 1px solid var(--line);
}
.fd-prow {
  display: flex; justify-content: space-between; align-items: flex-end;
  padding: 0 16px; margin-top: -34px;
}
.fd-av {
  display: grid; place-items: center; border-radius: 50%;
  background: var(--panel-solid); color: var(--acc);
  border: 3px solid var(--panel-solid); overflow: hidden; flex-shrink: 0;
}
.fd-av svg { width: 58%; height: 58%; }
.fd-av.lg { width: 72px; height: 72px; border-width: 4px; }
.fd-av.sm { width: 42px; height: 42px; }

.fd-follow {
  align-self: center; margin-bottom: 8px;
  padding: 7px 18px; border-radius: 999px;
  border: 1px solid var(--line2); background: var(--ink); color: var(--bg0);
  font-weight: 700; font-size: .85rem; transition: all var(--t-fast);
}
.fd-follow:hover { opacity: .88; }
.fd-follow.is-on { background: transparent; color: var(--ink); }
.fd-follow.is-on:hover { border-color: var(--bad); color: var(--bad); }

.fd-id { padding: 8px 16px 14px; }
.fd-namerow { display: flex; align-items: center; gap: 5px; }
.fd-name { font-weight: 700; color: var(--ink); }
.fd-name.big { font-size: 1.15rem; }
.fd-check { display: inline-flex; color: var(--acc); }
.fd-check svg { width: 16px; height: 16px; }
.fd-handle { color: var(--muted); font-size: .9rem; }
.fd-handle.big { display: block; margin-top: 1px; }
.fd-bio { color: var(--ink2); margin: 11px 0 0; line-height: 1.7; font-size: .95rem; }
.fd-meta { display: flex; gap: 16px; margin-top: 12px; flex-wrap: wrap; }
.fd-mi { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: .85rem; }
.fd-mi svg { width: 15px; height: 15px; }
.fd-mi b { color: var(--ink); font-weight: 700; }

.fd-compose {
  display: flex; align-items: center; gap: 12px; width: 100%;
  text-align: start; padding: 13px 16px; cursor: pointer;
  border-top: 1px solid var(--line);
  border-bottom: 7px solid var(--panel-2);
  background: transparent; transition: background var(--t-fast);
}
.fd-compose:hover { background: var(--panel-2); }
.fd-divider { height: 7px; background: var(--panel-2); border-top: 1px solid var(--line); }
.fd-cph { flex: 1; color: var(--muted); font-size: 1rem; }
.fd-csend { color: var(--acc); display: inline-flex; }
.fd-csend svg { width: 20px; height: 20px; }

.fd-post {
  display: flex; gap: 12px; padding: 14px 16px;
  border-bottom: 1px solid var(--line); transition: background var(--t-fast);
}
.fd-post:hover { background: color-mix(in srgb, var(--panel-2) 55%, transparent); }
.fd-pmain { flex: 1; min-width: 0; }
.fd-pinrow { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: .76rem; margin-bottom: 5px; }
.fd-pinrow svg { width: 13px; height: 13px; }
.fd-phead { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.fd-phead .fd-name { font-size: .96rem; }
.fd-phead .fd-check svg { width: 15px; height: 15px; }
.fd-sep, .fd-time { color: var(--muted); font-size: .88rem; }
.fd-text {
  color: var(--ink); line-height: 1.8; margin-top: 3px; font-size: 1rem;
  white-space: pre-wrap; overflow-wrap: anywhere;
}
.fd-arnote { margin-top: 8px; cursor: help; }
.fd-eng { display: flex; gap: 4px; margin-top: 10px; justify-content: space-between; max-width: 340px; }
.fd-act {
  display: inline-flex; align-items: center; gap: 7px;
  color: var(--muted); font-size: .82rem; padding: 6px; border-radius: 999px;
  transition: color var(--t-fast), background var(--t-fast);
}
.fd-act svg { width: 18px; height: 18px; transition: transform var(--t-fast); }
.fd-act:hover { color: var(--acc); background: color-mix(in srgb, var(--acc) 14%, transparent); }
.fd-rt:hover { color: #3ddc97; background: color-mix(in srgb, #3ddc97 14%, transparent); }
.fd-like:hover { color: var(--bad); background: color-mix(in srgb, var(--bad) 14%, transparent); }
.fd-like.on { color: var(--bad); }
.fd-like.on svg { fill: var(--bad); animation: fd-pop .32s var(--ease); }
@keyframes fd-pop { 40% { transform: scale(1.32); } }

/* وضع المؤلف: محرر الكتابة + أدوات المنشور */
.fd-composer {
  display: flex; gap: 12px; padding: 13px 16px;
  border-top: 1px solid var(--line);
  border-bottom: 7px solid var(--panel-2);
}
.fd-cwrap { flex: 1; min-width: 0; }
.fd-input {
  width: 100%; resize: none; border: 0; background: transparent;
  color: var(--ink); font: inherit; font-size: 1.05rem; line-height: 1.6;
  padding: 6px 0; min-height: 44px;
}
.fd-input::placeholder { color: var(--muted); }
.fd-input:focus { outline: none; }
.fd-crow {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: 6px; border-top: 1px solid var(--line); padding-top: 9px;
}
.fd-count { font-size: .8rem; color: var(--muted); font-family: var(--f-mono); }
.fd-count.low { color: var(--bad); }
.fd-postbtn {
  padding: 7px 20px; border-radius: 999px;
  background: var(--acc); color: var(--bg0); font-weight: 700; font-size: .88rem;
  transition: opacity var(--t-fast), transform var(--t-fast);
}
.fd-postbtn:hover:not(:disabled) { opacity: .9; }
.fd-postbtn:active:not(:disabled) { transform: scale(.97); }
.fd-postbtn:disabled { opacity: .4; cursor: default; }

.fd-ctrls { display: inline-flex; gap: 2px; margin-inline-start: auto; }
.fd-cbtn {
  display: grid; place-items: center; width: 28px; height: 28px;
  border-radius: 8px; color: var(--muted); transition: all var(--t-fast);
}
.fd-cbtn svg { width: 15px; height: 15px; }
.fd-cbtn:hover { color: var(--acc); background: color-mix(in srgb, var(--acc) 14%, transparent); }
.fd-cbtn.on { color: var(--acc); }
.fd-cbtn.is-loading { color: var(--acc); }
.fd-cbtn.is-loading svg { animation: fd-spin .8s linear infinite; }
@keyframes fd-spin { to { transform: rotate(360deg); } }
.fd-cdel:hover { color: var(--bad); background: color-mix(in srgb, var(--bad) 14%, transparent); }

.fd-key {
  width: 100%; border: 0; background: transparent;
  color: var(--ink); font: inherit; font-size: 1.05rem;
  padding: 8px 0; min-height: 40px;
}
.fd-key::placeholder { color: var(--muted); }
.fd-key:focus { outline: none; }
.fd-logout {
  margin-inline-end: auto; color: var(--muted); font-size: .8rem;
  padding: 4px 8px; border-radius: 7px; transition: color var(--t-fast), background var(--t-fast);
}
.fd-logout:hover { color: var(--bad); background: color-mix(in srgb, var(--bad) 12%, transparent); }
.fd-crow-l { display: inline-flex; align-items: center; gap: 2px; margin-inline-end: auto; }

.fd-media {
  margin-top: 10px; border-radius: var(--r); overflow: hidden;
  border: 1px solid var(--line); background: var(--panel-2);
}
.fd-media img { display: block; width: 100%; max-height: 340px; object-fit: cover; }

.fd-imgprev {
  position: relative; margin-top: 8px; border-radius: var(--r); overflow: hidden;
  border: 1px solid var(--line); max-width: 220px;
}
.fd-imgprev img { display: block; width: 100%; max-height: 180px; object-fit: cover; }
.fd-imgdel {
  position: absolute; top: 6px; inset-inline-end: 6px;
  display: grid; place-items: center; width: 26px; height: 26px; border-radius: 999px;
  background: color-mix(in srgb, var(--bg0) 88%, transparent); color: #fff;
  transition: background var(--t-fast);
}
.fd-imgdel svg { width: 13px; height: 13px; }
.fd-imgdel:hover { background: color-mix(in srgb, var(--bad) 75%, transparent); }
.fd-media img { cursor: zoom-in; }

.img-light {
  position: fixed; inset: 0; z-index: 9600;
  display: grid; place-items: center;
  background: rgba(2, 4, 8, .88);
  opacity: 0; transition: opacity .18s var(--ease);
  cursor: zoom-out;
}
.img-light.show { opacity: 1; }
.img-light img {
  max-width: 92vw; max-height: 92vh; cursor: default;
  border-radius: var(--r); box-shadow: 0 20px 60px rgba(0, 0, 0, .5);
}
.img-light-close {
  position: absolute; top: 18px; inset-inline-end: 20px;
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: 999px;
  background: rgba(255, 255, 255, .08); color: #fff;
  transition: background var(--t-fast);
}
.img-light-close svg { width: 18px; height: 18px; }
.img-light-close:hover { background: rgba(255, 255, 255, .18); }

/* ============================================================
   قيمني : rate (تقييم لطيف لا يقبل «لا»)
   ============================================================ */
.rate {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; gap: 14px; padding: 28px 22px; min-height: 100%;
  box-sizing: border-box; position: relative; overflow: hidden;
}
.rate-bot { width: 100px; height: 100px; color: var(--acc); display: grid; place-items: center; transform: scale(var(--rest, 1)); transition: transform .45s var(--ease-snap), color .4s; }
.rate-bot > svg { width: 100%; height: 100%; }
.rate-bot.bounce { animation: rate-bounce .6s var(--ease-snap); }
@keyframes rate-bounce { 0%,100%{transform:translateY(0)} 30%{transform:translateY(-11px)} 62%{transform:translateY(2px)} }

.rate-q { font-family: var(--f-display); font-size: 1.5rem; font-weight: 700; color: var(--ink); margin: 0; }
/* ساحة اللعب: تحوي الأزرار المتحركة (آليات «انت وحظك») */
.rate-stage { position: relative; width: 100%; max-width: 360px; height: 200px; margin: 8px auto 0; }
.rate-stage .rate-yes { position: absolute; left: 0; top: 0; will-change: transform; }
/* تحول لوني تدريجي سلس لزر «ما عجبني» إلى هيئة «رهيب» (في آلية التبديل) */
.rate-no.to-yes {
  background: var(--acc); color: var(--bg0); border-color: transparent; font-weight: 700;
  box-shadow: 0 8px 26px color-mix(in srgb, var(--acc) 38%, transparent);
  transition: background .5s var(--ease), color .5s var(--ease), border-color .5s var(--ease), box-shadow .5s var(--ease), transform .42s var(--ease-snap);
}
.rate-yes {
  --yg: 1;                                   /* عامل التكبير، يزيد مع كل ضغطة على «ما عجبني» */
  display: inline-flex; align-items: center; gap: 9px;
  padding: 12px 30px; border-radius: 999px;
  background: var(--acc); color: var(--bg0); font-weight: 700; font-size: 1.05rem;
  box-shadow: 0 8px 26px color-mix(in srgb, var(--acc) 38%, transparent);
  transform: scale(var(--yg, 1)); transform-origin: center;
  transition: transform .5s var(--ease-snap), box-shadow var(--t-fast);
}
.rate-yes svg { width: 20px; height: 20px; }
.rate-yes:hover { transform: translateY(-2px) scale(calc(var(--yg, 1) * 1.03)); }
.rate-yes:active { transform: scale(calc(var(--yg, 1) * .96)); }
.rate-no {
  position: absolute; left: 0; top: 0; z-index: 3; will-change: transform;
  padding: 8px 22px; border-radius: 999px; white-space: nowrap;
  border: 1px solid var(--line2); color: var(--muted); background: var(--panel-2);
  font-size: .95rem;
  transition: transform .4s var(--ease-snap), color var(--t-fast), background var(--t-fast);
}
.rate-no:hover { color: var(--ink); background: var(--panel); }
.rate-no.tired { border-color: var(--acc); color: var(--ink); }
.rate-hint { font-size: .8rem; color: var(--muted); }
.rate-heart {
  position: absolute; bottom: 34%; color: var(--bad); pointer-events: none; z-index: 5;
  animation: rate-float var(--dur, 1s) ease-out forwards;
}
@keyframes rate-float { to { transform: translate(var(--dx, 0), -175px); opacity: 0; } }
.rate-sub { color: var(--ink2); font-size: .98rem; margin: -4px 0 0; }
.rate-again {
  margin-top: 10px; padding: 8px 22px; border-radius: 999px;
  border: 1px solid var(--line2); color: var(--ink2); font-size: .88rem;
  transition: color var(--t-fast), border-color var(--t-fast);
}
.rate-again:hover { color: var(--ink); border-color: var(--acc); }
