@font-face{font-family:"Tajawal";font-style:normal;font-weight:400;font-display:swap;src:url("fonts/tajawal-400-arabic.woff2") format("woff2");unicode-range:U+0600-06FF, U+0750-077F, U+0870-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, U+102E0-102FB, U+10E60-10E7E, U+10EC2-10EC7, U+10EC9-10EEE, U+10EF0-10EFF, U+1EE00-1EE03, U+1EE05-1EE1F, U+1EE21-1EE22, U+1EE24, U+1EE27, U+1EE29-1EE32, U+1EE34-1EE37, U+1EE39, U+1EE3B, U+1EE42, U+1EE47, U+1EE49, U+1EE4B, U+1EE4D-1EE4F, U+1EE51-1EE52, U+1EE54, U+1EE57, U+1EE59, U+1EE5B, U+1EE5D, U+1EE5F, U+1EE61-1EE62, U+1EE64, U+1EE67-1EE6A, U+1EE6C-1EE72, U+1EE74-1EE77, U+1EE79-1EE7C, U+1EE7E, U+1EE80-1EE89, U+1EE8B-1EE9B, U+1EEA1-1EEA3, U+1EEA5-1EEA9, U+1EEAB-1EEBB, U+1EEF0-1EEF1;}
@font-face{font-family:"Tajawal";font-style:normal;font-weight:400;font-display:swap;src:url("fonts/tajawal-400-latin.woff2") format("woff2");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;}
@font-face{font-family:"Tajawal";font-style:normal;font-weight:500;font-display:swap;src:url("fonts/tajawal-500-arabic.woff2") format("woff2");unicode-range:U+0600-06FF, U+0750-077F, U+0870-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, U+102E0-102FB, U+10E60-10E7E, U+10EC2-10EC7, U+10EC9-10EEE, U+10EF0-10EFF, U+1EE00-1EE03, U+1EE05-1EE1F, U+1EE21-1EE22, U+1EE24, U+1EE27, U+1EE29-1EE32, U+1EE34-1EE37, U+1EE39, U+1EE3B, U+1EE42, U+1EE47, U+1EE49, U+1EE4B, U+1EE4D-1EE4F, U+1EE51-1EE52, U+1EE54, U+1EE57, U+1EE59, U+1EE5B, U+1EE5D, U+1EE5F, U+1EE61-1EE62, U+1EE64, U+1EE67-1EE6A, U+1EE6C-1EE72, U+1EE74-1EE77, U+1EE79-1EE7C, U+1EE7E, U+1EE80-1EE89, U+1EE8B-1EE9B, U+1EEA1-1EEA3, U+1EEA5-1EEA9, U+1EEAB-1EEBB, U+1EEF0-1EEF1;}
@font-face{font-family:"Tajawal";font-style:normal;font-weight:500;font-display:swap;src:url("fonts/tajawal-500-latin.woff2") format("woff2");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;}
@font-face{font-family:"Tajawal";font-style:normal;font-weight:700;font-display:swap;src:url("fonts/tajawal-700-arabic.woff2") format("woff2");unicode-range:U+0600-06FF, U+0750-077F, U+0870-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, U+102E0-102FB, U+10E60-10E7E, U+10EC2-10EC7, U+10EC9-10EEE, U+10EF0-10EFF, U+1EE00-1EE03, U+1EE05-1EE1F, U+1EE21-1EE22, U+1EE24, U+1EE27, U+1EE29-1EE32, U+1EE34-1EE37, U+1EE39, U+1EE3B, U+1EE42, U+1EE47, U+1EE49, U+1EE4B, U+1EE4D-1EE4F, U+1EE51-1EE52, U+1EE54, U+1EE57, U+1EE59, U+1EE5B, U+1EE5D, U+1EE5F, U+1EE61-1EE62, U+1EE64, U+1EE67-1EE6A, U+1EE6C-1EE72, U+1EE74-1EE77, U+1EE79-1EE7C, U+1EE7E, U+1EE80-1EE89, U+1EE8B-1EE9B, U+1EEA1-1EEA3, U+1EEA5-1EEA9, U+1EEAB-1EEBB, U+1EEF0-1EEF1;}
@font-face{font-family:"Tajawal";font-style:normal;font-weight:700;font-display:swap;src:url("fonts/tajawal-700-latin.woff2") format("woff2");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;}

/* ============ عملاق المعلومات — static site styles ============ */
/* RTL-first, Arabic (Tajawal), light/dark, zero JS framework */

:root {
  --primary: #c2185b;
  --primary-strong: #ad1457;
  --primary-soft: #fce4ec;
  --accent: #00acc1;
  --gold: #ffb300;
  --ink: #26233a;
  --muted: #6f6a85;
  --line: #ece7ee;
  --bg: #faf9fb;
  --surface: #ffffff;
  --surface-2: #f4f1f5;
  --card: #ffffff;
  --shadow: 0 1px 2px rgba(38, 35, 58, .05), 0 8px 24px -12px rgba(38, 35, 58, .18);
  --shadow-lg: 0 2px 6px rgba(38, 35, 58, .08), 0 20px 44px -18px rgba(38, 35, 58, .28);
  --radius: 16px;
  --header-h: 64px;
  --max-w: 1200px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --primary: #f06292;
    --primary-strong: #ec407a;
    --primary-soft: #3b2230;
    --accent: #4dd0e1;
    --gold: #ffca28;
    --ink: #e9e6f0;
    --muted: #a29cb5;
    --line: #312e40;
    --bg: #16141d;
    --surface: #1e1b26;
    --surface-2: #262230;
    --card: #1e1b26;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 10px 28px -14px rgba(0, 0, 0, .6);
    --shadow-lg: 0 2px 8px rgba(0, 0, 0, .5), 0 24px 48px -20px rgba(0, 0, 0, .7);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: 'Tajawal', 'Segoe UI', Tahoma, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.8;
  font-size: 17px;
}
img, video { max-width: 100%; height: auto; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-strong); }
h1, h2, h3, h4 { line-height: 1.45; margin: 0 0 .5em; font-weight: 700; }
p { margin: 0 0 1em; }
ul, ol { padding-inline-start: 1.5em; }
.container { max-width: var(--max-w); margin-inline: auto; padding-inline: 20px; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.header-row { display: flex; align-items: center; gap: 18px; min-height: var(--header-h); }
.brand { display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: 1.3rem; color: var(--ink); }
.brand:hover { color: var(--ink); }
.brand-logo { width: 46px; height: 46px; flex: none; border-radius: 12px; }
.brand small { display: block; font-size: .62rem; font-weight: 500; color: var(--muted); line-height: 1; letter-spacing: .5px; }

.main-nav { margin-inline-start: auto; display: flex; align-items: center; gap: 4px; }
.main-nav a {
  padding: 8px 13px; border-radius: 10px; color: var(--ink); font-weight: 500; font-size: .95rem;
  transition: background .15s, color .15s;
}
.main-nav a:hover { background: var(--primary-soft); color: var(--primary-strong); }
.nav-search {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 50%; background: var(--surface-2); color: var(--muted);
}
.nav-search:hover { background: var(--primary-soft); color: var(--primary); }

/* CSS-only mobile menu */
.menu-toggle { display: none; }
.menu-toggle summary {
  list-style: none; cursor: pointer; display: none;
  width: 42px; height: 42px; margin-inline-start: auto;
  align-items: center; justify-content: center; border-radius: 10px; background: var(--surface-2);
}
.menu-toggle summary::-webkit-details-marker { display: none; }
.menu-toggle summary svg { width: 22px; height: 22px; fill: none; stroke: var(--ink); stroke-width: 2; }
@media (max-width: 880px) {
  .menu-toggle summary { display: inline-flex; }
  .main-nav {
    display: none; position: absolute; inset-inline: 0; top: var(--header-h);
    flex-direction: column; align-items: stretch; gap: 2px;
    background: var(--surface); border-bottom: 1px solid var(--line);
    padding: 10px 20px 16px; box-shadow: var(--shadow-lg);
  }
  .menu-toggle[open] ~ .container .main-nav { display: flex; }
  .main-nav a { padding: 12px 14px; font-size: 1.05rem; }
}

/* ---------- hero ---------- */
.hero { padding: 34px 0 10px; }
.hero-grid { display: grid; grid-template-columns: 1.25fr 1fr; gap: 22px; }
@media (max-width: 880px) { .hero-grid { grid-template-columns: 1fr; } }
.hero-lead {
  position: relative; display: flex; flex-direction: column; justify-content: flex-end;
  min-height: 420px; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-lg);
  color: #fff; isolation: isolate;
}
.hero-lead img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.hero-lead::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg, rgba(20, 8, 16, 0) 30%, rgba(20, 8, 16, .82) 88%);
}
.hero-lead .hero-body { padding: 26px; }
.hero-lead h2 { font-size: clamp(1.35rem, 2.6vw, 2rem); margin: 8px 0 6px; color: #fff; }
.hero-lead h2 a { color: #fff; }
.hero-lead .meta { color: rgba(255, 255, 255, .82); }
.hero-side { display: grid; grid-template-rows: 1fr 1fr; gap: 18px; }
@media (max-width: 560px) { .hero-side { grid-template-rows: none; } .hero-lead { min-height: 320px; } }

/* ---------- cards ---------- */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow);
  display: flex; flex-direction: column;
  transition: transform .18s ease, box-shadow .18s ease;
}
a.card { color: inherit; }
a.card:hover { color: inherit; transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.card-thumb { aspect-ratio: 16 / 9; width: 100%; object-fit: cover; background: var(--surface-2); display: block; }
.card-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card-title { font-size: 1.08rem; font-weight: 700; line-height: 1.55; margin: 0; }
.card.excerpt-hidden .card-excerpt { display: none; }
.card-excerpt { color: var(--muted); font-size: .9rem; margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.hero-side .card { flex-direction: row; align-items: stretch; }
.hero-side .card-thumb { aspect-ratio: auto; width: 38%; flex: none; }
.hero-side .card-title { font-size: 1rem; }
@media (max-width: 560px) { .hero-side .card { flex-direction: column; } .hero-side .card-thumb { width: 100%; aspect-ratio: 16/9; } }

.section { padding: 26px 0 10px; }
.section-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.section-head h2, .section-head h1 { font-size: 1.35rem; margin: 0; }
.section-head .more { margin-inline-start: auto; font-weight: 500; font-size: .9rem; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 20px; }

.chip {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--primary-soft); color: var(--primary-strong);
  border-radius: 999px; padding: 3px 12px; font-size: .78rem; font-weight: 500;
  width: fit-content;
}
.chip:hover { filter: brightness(.96); }
.meta { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 14px; color: var(--muted); font-size: .82rem; margin: 0; }
.meta time { font-weight: 500; }

/* ---------- article ---------- */
.article-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 40px; padding: 26px 0 40px; }
@media (max-width: 980px) { .article-layout { grid-template-columns: 1fr; } }
.breadcrumb { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: .8rem; color: var(--muted); margin-bottom: 14px; }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb .sep { opacity: .5; }

.prose { font-size: 1.06rem; }
.prose > *:first-child { margin-top: 0; }
.prose h2 { font-size: 1.45rem; margin-top: 1.6em; padding-inline-start: 14px; border-inline-start: 4px solid var(--primary); }
.prose h3 { font-size: 1.2rem; margin-top: 1.4em; }
.prose img { border-radius: 12px; margin: 10px auto; display: block; }
.prose a { text-decoration: underline; text-underline-offset: 4px; }
.prose ul li, .prose ol li { margin-bottom: .45em; }
.prose blockquote {
  margin: 1.4em 0; padding: 14px 20px; border-inline-start: 4px solid var(--accent);
  background: var(--surface-2); border-radius: 12px; color: var(--muted); font-style: normal;
}
.prose blockquote p { margin: 0; }
.prose table { width: 100%; border-collapse: collapse; font-size: .95rem; display: block; overflow-x: auto; }
.prose th, .prose td { border: 1px solid var(--line); padding: 9px 13px; text-align: start; }
.prose th { background: var(--surface-2); }
.prose figure { margin: 1.3em 0; }
.prose figcaption { text-align: center; color: var(--muted); font-size: .85rem; margin-top: 8px; }

.post-hero-img { width: 100%; border-radius: var(--radius); box-shadow: var(--shadow); margin: 18px 0 8px; }
.post-title { font-size: clamp(1.5rem, 3.4vw, 2.15rem); margin: 6px 0 12px; }

.share-row { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin: 26px 0; }
.share-row .label { font-weight: 700; font-size: .9rem; }
.share-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 12px; background: var(--surface-2); color: var(--ink);
  transition: background .15s, color .15s, transform .15s;
}
.share-btn:hover { color: #fff; background: var(--primary); transform: translateY(-2px); }
.share-btn svg { width: 18px; height: 18px; fill: currentColor; }

.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 34px; }
@media (max-width: 640px) { .post-nav { grid-template-columns: 1fr; } }
.post-nav a {
  display: flex; flex-direction: column; gap: 4px; padding: 16px 18px;
  border: 1px solid var(--line); border-radius: 14px; background: var(--card); box-shadow: var(--shadow);
  color: var(--ink); font-weight: 500; font-size: .95rem;
}
.post-nav a:hover { border-color: var(--primary); color: var(--primary-strong); }
.post-nav .dir { font-size: .75rem; color: var(--muted); font-weight: 400; }
.post-nav a.next { text-align: end; }

/* sidebar */
.sidebar { display: flex; flex-direction: column; gap: 26px; position: sticky; top: calc(var(--header-h) + 20px); align-self: start; }
@media (max-width: 980px) { .sidebar { position: static; } }
.widget { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.widget h3 { font-size: 1.05rem; margin-bottom: 14px; padding-bottom: 10px; border-bottom: 2px solid var(--primary-soft); display: flex; align-items: center; gap: 8px; }
.widget ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.widget li a {
  display: flex; gap: 10px; align-items: center; padding: 9px 10px; border-radius: 10px; color: var(--ink); font-size: .93rem;
}
.widget li a:hover { background: var(--primary-soft); color: var(--primary-strong); }
.widget li .n { font-size: .75rem; color: var(--muted); margin-inline-start: auto; background: var(--surface-2); border-radius: 999px; padding: 1px 9px; }

/* ---------- pagination ---------- */
.pagination { display: flex; justify-content: center; align-items: center; gap: 8px; margin: 36px 0 20px; flex-wrap: wrap; }
.pagination a, .pagination span {
  min-width: 42px; height: 42px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 12px; border: 1px solid var(--line); background: var(--card); color: var(--ink);
  font-weight: 500; padding-inline: 12px; box-shadow: var(--shadow);
}
.pagination .current { background: var(--primary); border-color: var(--primary); color: #fff; }
.pagination a:hover { border-color: var(--primary); color: var(--primary-strong); }
.pagination .dots { border: none; box-shadow: none; background: none; }

/* ---------- footer ---------- */
.site-footer { background: #14101b; color: #cfc8dc; margin-top: 50px; }
.site-footer a { color: #e6e0ef; }
.site-footer a:hover { color: var(--gold); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 34px; padding: 44px 0 20px; }
@media (max-width: 880px) { .footer-grid { grid-template-columns: 1fr; gap: 26px; } }
.site-footer h4 { color: #fff; font-size: 1rem; margin-bottom: 14px; }
.site-footer img.footer-logo { width: 88px; height: 88px; border-radius: 20px; margin-bottom: 12px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.footer-about p { font-size: .92rem; color: #b6adc7; }
.footer-bottom { border-top: 1px solid #2a2438; padding: 18px 0; display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; font-size: .85rem; color: #9c92af; }

/* ---------- search page ---------- */
.search-box { display: flex; gap: 10px; margin: 26px 0; }
.search-box input {
  flex: 1; padding: 14px 18px; border-radius: 14px; border: 1px solid var(--line);
  background: var(--card); color: var(--ink); font-family: inherit; font-size: 1.05rem; box-shadow: var(--shadow);
}
.search-box input:focus { outline: 2px solid var(--primary); outline-offset: 1px; }
.search-hint { color: var(--muted); margin-bottom: 18px; }
mark { background: color-mix(in srgb, var(--gold) 45%, transparent); color: inherit; border-radius: 3px; padding-inline: 2px; }
.search-empty { text-align: center; color: var(--muted); padding: 50px 0; font-size: 1.05rem; }

/* ---------- static contact ---------- */
.contact-note { background: var(--surface-2); border: 1px dashed var(--line); border-radius: 14px; padding: 18px 20px; margin: 18px 0; }
.contact-note a { font-weight: 700; }

/* ---------- misc ---------- */
.page-hero { padding: 34px 0 6px; }
.page-hero h1 { font-size: clamp(1.5rem, 3vw, 2rem); margin-bottom: 8px; }
.error-page { text-align: center; padding: 90px 20px; }
.error-page .code { font-size: 5.5rem; font-weight: 700; color: var(--primary); line-height: 1; margin-bottom: 10px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; background: var(--primary); color: #fff;
  padding: 11px 22px; border-radius: 12px; font-weight: 500; font-size: .95rem;
  box-shadow: 0 6px 18px -6px color-mix(in srgb, var(--primary) 55%, transparent);
}
.btn:hover { background: var(--primary-strong); color: #fff; }
.backtop { position: fixed; inset-inline-start: 22px; bottom: 22px; z-index: 40; width: 44px; height: 44px; border-radius: 50%; background: var(--primary); color: #fff; display: grid; place-items: center; box-shadow: var(--shadow-lg); opacity: 0; pointer-events: none; transition: opacity .2s; }
.backtop.show { opacity: 1; pointer-events: auto; }

.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

@media print {
  .site-header, .site-footer, .share-row, .sidebar, .post-nav, .backtop, .pagination { display: none !important; }
  body { background: #fff; color: #000; }
}

/* ============ الأدوات التفاعلية: حاسبات ومولدات ============ */

.tool-wrap {
  position: relative;
  margin: 28px 0 32px;
  padding: 26px 24px 24px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.tool-wrap::before {
  content: "";
  position: absolute; inset-inline: 0; top: 0; height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--accent), var(--gold));
}
.tool-title { display: flex; align-items: center; gap: 10px; font-size: 1.15rem; font-weight: 700; margin-bottom: 6px; }
.tool-title .ico { font-size: 1.4rem; }
.tool-sub { color: var(--muted); font-size: .88rem; margin-bottom: 18px; }

.tool-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; }
.tool-field { display: flex; flex-direction: column; gap: 6px; }
.tool-field > label { font-size: .85rem; font-weight: 500; color: var(--muted); }
.tool-field input, .tool-field select {
  width: 100%; padding: 11px 14px; border-radius: 12px; border: 1.5px solid var(--line);
  background: var(--surface-2); color: var(--ink); font: inherit; font-size: 1rem;
}
.tool-field input:focus, .tool-field select:focus { outline: 2px solid var(--primary); outline-offset: 1px; border-color: transparent; }
.tool-field input[type=date] { direction: ltr; text-align: right; }

.btn-tool {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; margin-top: 16px; padding: 13px 20px;
  border: none; border-radius: 13px; cursor: pointer;
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
  color: #fff; font: inherit; font-weight: 700; font-size: 1.05rem;
  box-shadow: 0 8px 22px -8px color-mix(in srgb, var(--primary) 65%, transparent);
  transition: transform .15s, box-shadow .15s;
}
.btn-tool:hover { transform: translateY(-2px); box-shadow: 0 12px 28px -8px color-mix(in srgb, var(--primary) 75%, transparent); }
.btn-tool:active { transform: translateY(0); }
.btn-tool:disabled { opacity: .6; cursor: wait; }

.tool-error { color: #ef5350; font-size: .85rem; margin-top: 10px; min-height: 1.2em; }

.tool-result {
  margin-top: 22px; padding: 22px;
  background: linear-gradient(160deg, color-mix(in srgb, var(--primary) 7%, var(--surface-2)), var(--surface-2));
  border: 1px solid color-mix(in srgb, var(--primary) 18%, var(--line));
  border-radius: 16px;
  display: none;
  animation: tool-in .35s ease;
}
.tool-result.show { display: block; }
@keyframes tool-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.big-num { font-size: 2.6rem; font-weight: 700; color: var(--primary); line-height: 1.2; }
.big-num small { font-size: 1.2rem; color: var(--muted); }
.res-line { margin-top: 8px; font-size: 1rem; }
.res-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; margin-top: 16px; }
.res-cell { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; text-align: center; }
.res-cell .v { font-size: 1.25rem; font-weight: 700; color: var(--ink); }
.res-cell .l { font-size: .78rem; color: var(--muted); margin-top: 2px; }

.meter { height: 14px; border-radius: 999px; background: var(--surface-2); overflow: hidden; margin-top: 14px; border: 1px solid var(--line); }
.meter > span { display: block; height: 100%; width: 0; border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--primary));
  transition: width 1.1s cubic-bezier(.22,1,.36,1); }

.share-row-tool { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.share-row-tool button {
  display: inline-flex; align-items: center; gap: 6px; padding: 9px 16px;
  border-radius: 11px; border: 1px solid var(--line); background: var(--card); color: var(--ink);
  font: inherit; font-size: .88rem; font-weight: 500; cursor: pointer;
}
.share-row-tool button:hover { border-color: var(--primary); color: var(--primary-strong); }
.share-row-tool .wa { background: #128c7e; border-color: #128c7e; color: #fff; }
.share-row-tool .wa:hover { filter: brightness(1.1); color: #fff; }

/* keypad calculator */
.calc-keys { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 14px; direction: ltr; }
.calc-keys button {
  padding: 14px 0; border-radius: 12px; border: 1px solid var(--line);
  background: var(--surface-2); color: var(--ink); font: inherit; font-size: 1.15rem; font-weight: 500; cursor: pointer;
}
.calc-keys button:hover { border-color: var(--primary); }
.calc-keys .op { color: var(--primary-strong); font-weight: 700; }
.calc-keys .eq { background: var(--primary); color: #fff; grid-column: span 2; }
.calc-keys .clr { color: #ef5350; }
.calc-display {
  direction: ltr; text-align: right; padding: 14px 16px; border-radius: 12px;
  background: var(--surface-2); border: 1px solid var(--line);
  font-size: 1.5rem; font-weight: 700; min-height: 56px; overflow-x: auto; white-space: nowrap;
}
.calc-display .expr { display: block; font-size: .8rem; font-weight: 400; color: var(--muted); min-height: 1.2em; }

/* quiz */
.quiz-q { background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px; padding: 14px 18px; margin-bottom: 10px; }
.quiz-q .q { font-weight: 700; margin-bottom: 10px; }
.quiz-opts { display: flex; flex-direction: column; gap: 6px; }
.quiz-opts label {
  display: flex; align-items: center; gap: 9px; padding: 9px 13px;
  border: 1.5px solid var(--line); border-radius: 11px; cursor: pointer; font-size: .95rem;
  transition: border-color .15s, background .15s;
}
.quiz-opts label:hover { border-color: var(--primary); }
.quiz-opts input { accent-color: var(--primary); width: 17px; height: 17px; }
.quiz-opts input:checked + span { font-weight: 700; color: var(--primary-strong); }

/* generator */
.gen-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 6px; }
.gen-chips button {
  padding: 8px 16px; border-radius: 999px; border: 1.5px solid var(--line);
  background: var(--card); color: var(--ink); font: inherit; font-size: .9rem; cursor: pointer;
}
.gen-chips button.active { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 700; }
.msg-card {
  margin-top: 18px; padding: 22px; border-radius: 16px; display: none;
  background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 6%, var(--card)), var(--card));
  border: 1.5px dashed color-mix(in srgb, var(--accent) 40%, var(--line));
  font-size: 1.1rem; line-height: 2; position: relative;
}
.msg-card.show { display: block; animation: tool-in .35s ease; }
.msg-card .quote-mark { position: absolute; top: 4px; inset-inline-start: 14px; font-size: 2.4rem; opacity: .18; color: var(--accent); }

.tool-note { margin-top: 14px; font-size: .78rem; color: var(--muted); }
@media (max-width: 560px) {
  .tool-wrap { padding: 18px 14px 16px; }
  .big-num { font-size: 2.1rem; }
}
