/* ===== Theme tokens (taken from the original's recorded design) ===== */
:root {
  --page: #ffffff;
  --surface: #f9fafb;
  --surface-2: #eef1f6;
  --surface-3: #f5f7fab3;
  --line: #a9afb833;
  --line-soft: #eef1f6;
  --line-btn: #e3e6eb;
  --ink: #1d1f21;
  --ink-soft: #1d1f21a6;
  --ink-active: #3f4145;
  --muted: #595d63bf;
  --label: #a9afb8;
  --body: #586069;
  --btn-light-ink: #5e6268;
  --dark: #1f2121;
  --teal: #00dbc9;
  --logo-b: #667f8a;
  --green: #03a96c;

  --r-card: 24px;
  --r-panel: 32px;
  --r-main: 40px;
  --r-item: 12px;
  --r-nav: 14px;
  --r-badge: 8px;

  --font: "Inter-Medium", Inter, "Inter Placeholder", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-logo: Neco, "Neco Placeholder", Georgia, "Times New Roman", serif;
  --shadow-dark-btn: rgb(0, 0, 0) 0px -1px 1px 0px inset, rgba(255, 255, 255, 0.45) 0px 1px 1px 0px inset, rgba(0, 0, 0, 0.25) 0px 4px 8px 0px;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--page);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
p, h1, h2, h3, ul { margin: 0; }
ul { padding: 0; list-style: none; }
svg { display: block; flex: none; }
:focus-visible { outline: 2px solid #0080ff; outline-offset: 2px; }

/* ===== Desktop frame (810px and wider) ===== */
.shell {
  display: flex;
  gap: 10px;
  padding: 16px;
  height: 100vh;
  height: 100dvh;
  min-height: 560px;
}

/* icon rail */
.rail {
  flex: none;
  width: 72px;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 17px 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
}
.rail-search {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 12px;
  color: var(--ink);
}
.rail-search:hover { background: var(--surface-2); }
.rail-nav { display: flex; flex-direction: column; gap: 10px; margin-top: 38px; }
.rail-link {
  width: 48px; height: 48px;
  display: grid; place-items: center;
  border-radius: var(--r-nav);
  color: #b6bbc2;
  transition: background-color .2s, color .2s;
}
.rail-link:hover { color: var(--ink-active); }
.rail-link.is-active { background: var(--surface-2); color: var(--ink); box-shadow: rgb(235, 238, 242) 0 0 0 1px inset; }
.rail-foot { margin-top: auto; display: flex; flex-direction: column; align-items: center; gap: 20px; }
.socials {
  display: flex; flex-direction: column; gap: 6px;
  padding: 5px 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--page);
}
.socials a {
  width: 26px; height: 26px;
  display: grid; place-items: center;
  border-radius: 6px;
  color: var(--ink);
}
.socials a:hover { background: var(--surface-2); }
.avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 42%, #f6c9a8 0 28%, transparent 29%),
    radial-gradient(circle at 50% 18%, #7a4a2b 0 30%, transparent 31%),
    linear-gradient(160deg, #c4b5fd, #a78bfa);
  box-shadow: 0 0 0 1px var(--line);
}
.avatar-wrap { position: relative; display: block; }
.avatar-wrap img { display: block; width: 36px; height: 36px; border-radius: 50%; }
.avatar-tip {
  position: absolute; left: 46px; top: 50%; z-index: 5;
  transform: translate(-6px, -50%);
  padding: 4px 10px;
  border-radius: 8px;
  background: #232a2b;
  color: #f9fafb;
  font-size: 15px; font-weight: 500; line-height: 23px;
  white-space: nowrap;
  opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s;
}
.avatar-wrap:hover .avatar-tip, .avatar-wrap:focus-visible .avatar-tip { opacity: 1; transform: translate(0, -50%); }

/* category sidebar */
.sidebar {
  flex: none;
  width: 250px;
  display: flex;
  flex-direction: column;
  padding: 15px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  min-height: 0;
  transition: width .25s ease;
}
.brand-row {
  height: 45px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 4px 0 12px;
  flex: none;
}
.logo { font-family: var(--font-logo); font-size: 22px; font-weight: 700; line-height: 29px; letter-spacing: -0.01em; white-space: nowrap; }
.logo-a { color: #000; }
.logo-b { color: var(--logo-b); }
.collapse-btn { color: #000; display: grid; place-items: center; width: 22px; height: 22px; transition: transform .25s; }
.menu-btn { display: none; width: 40px; height: 40px; place-items: center; color: #000; }
.cat-label { margin: 8px 0 12px; padding-left: 12px; font-size: 16px; font-weight: 500; line-height: 19px; color: var(--label); flex: none; }
.cats {
  display: flex; flex-direction: column; gap: 5px;
  flex: 1 1 auto; min-height: 0;
  overflow-y: auto;
  scrollbar-width: none;
}
.cats::-webkit-scrollbar { display: none; }
.cat {
  flex: none;
  height: 40px;
  display: flex; align-items: center; gap: 8px;
  padding: 0 12px;
  border-radius: var(--r-item);
  font-size: 16px; font-weight: 500; line-height: 19px;
  color: var(--muted);
  white-space: nowrap;
  transition: background-color .2s, color .2s;
}
.cat:hover { background: #f1f3f6; color: var(--ink-active); }
.cat.is-active { background: var(--surface-2); color: var(--ink-active); box-shadow: rgb(235, 238, 242) 0 0 0 1px inset; }
.cat-icon { position: relative; display: grid; color: #8e939a; }
.cat.is-active .cat-icon { color: #000; }
.dot { position: absolute; top: 0; right: 0; width: 7px; height: 7px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 0 1.5px var(--surface); }
.side-actions {
  flex: none;
  display: flex; flex-direction: column; gap: 10px;
  margin-top: 5px;
  padding-top: 15px;
  border-top: 1px solid var(--line-soft);
}

/* buttons */
.btn {
  height: 48px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 0 14px;
  border-radius: 40px;
  font-size: 16px; font-weight: 500; line-height: 19px;
  white-space: nowrap;
  transition: transform .15s, background-color .2s, box-shadow .2s;
}
.btn-dark { background: var(--dark); color: #fff; box-shadow: var(--shadow-dark-btn); }
.btn-dark svg { color: #fff; }
.btn-dark:hover { background: #2c2f2f; }
.btn-light { background: var(--page); color: var(--btn-light-ink); border: 1px solid var(--line-btn); }
.btn-light svg { color: #9aa0a8; }
.btn-light:hover { background: var(--surface-2); }
.btn:active { transform: scale(.98); }

/* main area */
.main {
  flex: 1 1 auto;
  min-width: 0;
  background: var(--page);
  border: 1px solid var(--line);
  border-radius: var(--r-main);
  overflow: hidden;
}
.main-scroll {
  height: 100%;
  overflow-y: auto;
  padding: 19px;
  scrollbar-width: none;
}
.main-scroll::-webkit-scrollbar { display: none; }
.tabbar { display: none; }

/* ===== product cards ===== */
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.card {
  position: relative;
  display: flex; flex-direction: column;
  padding: 22px;
  background: var(--surface);
  border-radius: var(--r-card);
  box-shadow: var(--line) 0 0 0 1px inset, rgba(255, 255, 255, 0.61) 0 1px 1px 0 inset;
  overflow: hidden;
  transition: border-color .2s, box-shadow .2s;
}
.card:hover { box-shadow: #a9afb866 0 0 0 1px inset, rgba(255, 255, 255, 0.61) 0 1px 1px 0 inset, 0 6px 18px rgba(29, 31, 33, .06); }
.card-top { display: flex; align-items: flex-start; justify-content: space-between; height: 56px; }
.card-img { width: 56px; height: 56px; border-radius: 12px; flex: none; object-fit: cover; background-color: var(--line); }
.card-title { margin: 18px 0 0; font-size: 18px; font-weight: 600; line-height: 22px; color: var(--ink); }
.card-text { margin: 6px 0 0; font-size: 15px; font-weight: 500; line-height: 22.5px; color: var(--ink-soft); min-height: 45px; }
.read-more {
  position: absolute; right: 30px; bottom: 22px;
  border-radius: 14px;
  background-color: rgba(169, 175, 184, 0.2);
  opacity: 0;
  transform: translateY(60px);
  transition: transform .3s cubic-bezier(.2,.8,.2,1), opacity .2s;
  pointer-events: none;
}
.read-more-glow { position: absolute; inset: 4px; border-radius: 14px; background-color: #bfefff96; filter: blur(7px); }
.read-more p {
  position: relative;
  padding: 5px 13px;
  border: 1px solid #3f484d;
  border-radius: 8px;
  background: linear-gradient(#464c4f, #33373a);
  box-shadow: rgba(255, 255, 255, 0.61) 0 1px 1px 0 inset;
  color: var(--surface);
  font-family: Inter, "Inter Placeholder", sans-serif;
  font-size: 15px; font-weight: 500; line-height: 22.5px;
  white-space: nowrap;
}
.card:hover .read-more, .card:focus-visible .read-more { opacity: 1; transform: none; }

.badge {
  height: 28px;
  display: inline-flex; align-items: center; gap: 4px;
  padding: 0 10px;
  border-radius: var(--r-badge);
  border: 1px solid;
  font-size: 13px; font-weight: 500; line-height: 20px;
  white-space: nowrap;
}
.b-new { background: #bafff2; color: #02b090; border-color: #84ecd8; box-shadow: rgb(186, 255, 242) 0 1px 2px 0; }
.b-sponsored { background: #baefff; color: #0080ff; border-color: #8edcff; box-shadow: rgb(212, 250, 255) 0 1px 2px 0; }
.b-highlight { background: #d9baff; color: #8b2bff; border-color: #c89cff; box-shadow: rgba(217, 186, 255, 0.69) 0 1px 2px 0; }

.cat-title { margin: 16px 0 14px 16px; font-size: 36px; font-weight: 600; line-height: 50px; color: var(--ink); letter-spacing: -0.01em; }
.empty { padding: 16px; color: var(--body); font-size: 16px; }
.card-meta { margin: auto 0 0; padding-top: 14px; font-size: 13px; font-weight: 500; line-height: 18px; color: var(--label); }

/* subcategories: under the open category in the sidebar, and as buttons above the articles */
.subs { display: flex; flex-direction: column; gap: 2px; margin: 0 0 6px; flex: none; }
.sub-link {
  height: 32px; display: flex; align-items: center;
  padding: 0 12px 0 44px; border-radius: var(--r-item);
  font-size: 14px; font-weight: 500; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: background-color .2s, color .2s;
}
.sub-link:hover { background: #f1f3f6; color: var(--ink-active); }
.sub-link.is-active { background: var(--page); color: var(--ink); box-shadow: rgb(235, 238, 242) 0 0 0 1px inset; }
.subchips { display: flex; gap: 8px; margin: 0 0 20px 16px; overflow-x: auto; scrollbar-width: none; }
.subchips::-webkit-scrollbar { display: none; }
.subchips a {
  flex: none; height: 36px; display: inline-flex; align-items: center; gap: 7px;
  padding: 0 14px; border-radius: 12px;
  background: var(--surface); box-shadow: var(--line) 0 0 0 1px inset;
  color: var(--ink-active); font-size: 15px; font-weight: 500; white-space: nowrap;
  transition: background-color .2s;
}
.subchips a:hover { background: var(--surface-2); }
.subchips a.is-active { background: var(--dark); color: #fff; box-shadow: var(--shadow-dark-btn); }
.subchips small { font-size: 13px; color: var(--label); }
.subchips a.is-active small { color: #ffffffa6; }
.note { margin: 22px 0 0; padding: 14px 16px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line-soft); font-size: 15px; line-height: 1.6; color: var(--body); }
.row-icon { width: 48px; height: 48px; border-radius: 12px; flex: none; display: grid; place-items: center; background: var(--surface-2); color: var(--ink-active); }
.row strong a:hover { text-decoration: underline; }

/* ===== panels (about / sponsor / contact) ===== */
.two-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.panel {
  background: var(--page);
  border: 1px solid var(--line);
  border-radius: var(--r-panel);
  padding: 23px;
  min-width: 0;
}
.banner { display: block; width: 100%; height: 76px; border-radius: 16px; object-fit: cover; }
.banner-a {
  background:
    radial-gradient(40% 120% at 18% 40%, rgba(255,255,255,.85) 0, transparent 50%),
    radial-gradient(30% 140% at 60% 90%, #e0c3fc 0, transparent 60%),
    linear-gradient(100deg, #f0b6e4 0%, #b9a7f5 20%, #8b8ff0 32%, #dcd3ff 45%, #a5b4fc 58%, #c7b8f5 72%, #f5c2dc 100%);
}
.banner-b {
  background:
    radial-gradient(30% 120% at 70% 30%, rgba(255,255,255,.8) 0, transparent 50%),
    radial-gradient(35% 140% at 25% 70%, #3b82f6 0, transparent 60%),
    linear-gradient(100deg, #7c5cf0 0%, #a5b4fc 22%, #60a5fa 40%, #c4b5fd 55%, #3b82f6 70%, #e9d5ff 100%);
}
.big { margin: 32px 8px 8px; font-size: 36px; font-weight: 600; line-height: 50px; color: var(--ink); letter-spacing: -0.01em; }
.lead { margin: 0 8px; font-size: 18px; font-weight: 400; line-height: 1.8; color: var(--body); }
.h2 { font-size: 28px; font-weight: 500; line-height: 39px; color: var(--ink); }
.box {
  margin-top: 33px;
  padding: 23px;
  border: 1px solid var(--line-soft);
  border-radius: var(--r-card);
}
.box h3, .more h3 { font-size: 22px; font-weight: 500; line-height: 31px; color: var(--ink); }
.sub, .more > div p { font-size: 18px; line-height: 32px; color: var(--body); }
.rows { display: flex; flex-direction: column; gap: 16px; margin-top: 17px; }
.row {
  height: 64px;
  display: flex; align-items: center; gap: 18px;
  padding: 0 7px;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: 16px;
}
.row-img { width: 48px; height: 48px; border-radius: 12px; flex: none; display: block; }
.row > span:last-child { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.row strong { font-size: 16px; font-weight: 500; line-height: 19px; color: #000; }
.row strong + span { font-size: 16px; line-height: 19px; color: var(--body); white-space: nowrap; overflow: hidden; }

.faq { display: flex; flex-direction: column; gap: 16px; margin-top: 17px; }
.faq-item { background: var(--surface); border: 1px solid var(--line-soft); border-radius: 16px; }
.faq-q {
  width: 100%; min-height: 62px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 20px 19px;
  text-align: left;
  font-size: 16px; font-weight: 500; line-height: 19px; color: #000;
}
.faq-plus { width: 18px; height: 18px; display: grid; place-items: center; border-radius: 5px; background: #ebeef2; color: #000; font-style: normal; transition: transform .25s; flex: none; }
.faq-q[aria-expanded="true"] .faq-plus { transform: rotate(45deg); }
.faq-a { padding: 0 19px 16px; font-size: 16px; line-height: 1.6; color: var(--body); }

.more {
  margin-top: 18px;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 24px 38px 24px 24px;
  background: var(--surface-2);
  border-radius: var(--r-panel);
}
.btn-pill { min-width: 180px; padding: 0 22px; }

/* sponsor */
.sponsor { padding: 35px 31px 31px; }
.sponsor-head { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.sponsor-head .lead { margin: 10px 0 0; max-width: 560px; line-height: 32.5px; }
.billing {
  flex: none;
  display: grid; grid-template-columns: 1fr 1fr;
  width: 324px; height: 68px;
  margin-right: 20px;
  padding: 4px;
  background: var(--surface-3);
  border: 1px solid var(--line-soft);
  border-radius: 40px;
  box-shadow: 0 6px 14px rgba(29, 31, 33, .05);
}
.billing button {
  display: flex; flex-direction: column; align-items: flex-start; justify-content: center;
  padding: 0 20px;
  border-radius: 36px;
  text-align: left;
}
.billing strong { font-size: 16px; font-weight: 600; line-height: 22px; color: #727984; }
.billing span { font-size: 14px; font-weight: 500; line-height: 20px; color: #7a8484; }
.billing em { font-style: normal; font-weight: 600; color: var(--green); }
.billing .is-on { background: var(--page); box-shadow: rgb(255, 255, 255) 0 1px 2px 0 inset, 0 2px 8px rgba(29, 31, 33, .08); }
.billing .is-on strong { color: #000; }
.plans { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 17px; margin-top: 22px; }
.plan { padding: 31px; border: 1px solid var(--line-soft); border-radius: var(--r-card); min-width: 0; }
.tag { display: inline-flex; align-items: center; height: 40px; padding: 0 19px; border: 1px solid; border-radius: var(--r-badge); font-size: 16px; font-weight: 500; }
.tag-green { background: #d7fcc9; border-color: #a6e892; color: #28b002; }
.tag-grey { background: var(--surface-2); border-color: #d5dae1; color: var(--body); }
.plan-name { margin-top: 32px; color: #000; }
.price { display: flex; align-items: baseline; gap: 8px; margin-top: 4px; }
.price h2 { font-size: 32px; font-weight: 600; line-height: 50px; color: #0c0f12; }
.price p { font-size: 30px; font-weight: 500; line-height: 50px; color: #000; }
.plan-text { margin-top: 16px; font-size: 16px; font-weight: 500; line-height: 23px; color: #99a1a8; }
.features { display: flex; flex-direction: column; gap: 12px; margin-top: 24px; }
.features li {
  height: 43px;
  display: flex; align-items: center; gap: 12px;
  padding: 0 10px;
  border: 1px solid var(--line-btn);
  border-radius: 40px;
  font-size: 16px; font-weight: 500; line-height: 23px; color: #70767e;
  white-space: nowrap; overflow: hidden;
}
.tick { width: 20px; height: 20px; flex: none; display: grid; place-items: center; border-radius: 50%; background: #cccfdb; color: #3f4145; }
.btn-cta { margin-top: 34px; width: 190px; }
.sponsor .more { margin-top: 26px; border-radius: var(--r-card); }

/* contact */
.kind-contact .two-col { gap: 16px; height: 100%; }
.contact-panel { display: flex; flex-direction: column; padding: 35px 31px 31px; }
.contact-panel .lead { margin: 10px 0 0; line-height: 32.5px; }
.form { flex: 1; display: flex; flex-direction: column; margin-top: 22px; min-height: 0; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form input, .form textarea {
  width: 100%;
  border: 0;
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--ink);
  font: 400 16px/19px var(--font);
  padding: 0 15px;
}
.form input { height: 52px; }
.form textarea { flex: 1; min-height: 104px; margin-top: 12px; padding-top: 16px; resize: vertical; }
.form ::placeholder { color: #6b7079; }
.form input:focus, .form textarea:focus { outline: 2px solid #c9d2df; outline-offset: 0; }
.form [type="submit"] {
  width: 100%; border: 0; cursor: pointer;
  height: 52px; margin-top: 13px;
  border-radius: 10px;
  background: var(--ink); color: #fff;
  font-size: 16px; font-weight: 600;
}
.form [type="submit"]:hover { background: #33373a; }
.form-note { margin-top: 10px; color: var(--green); font-size: 15px; font-weight: 500; }
.map {
  position: relative;
  flex: 1; min-height: 190px;
  margin-top: 22px;
  border-radius: var(--r-card);
  overflow: hidden;
  background: #f5f7fab3;
}
.map img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: none; object-position: 50% 50%; }

/* product page */
.product { padding: 31px; max-width: 760px; }
.back { font-size: 15px; font-weight: 500; color: var(--muted); }
.back:hover { color: var(--ink); }
.product-head { display: flex; align-items: center; gap: 20px; margin-top: 24px; }
.product-head .big { margin: 0 0 6px; }
.product-img { width: 96px; height: 96px; border-radius: 20px; flex: none; }
.product .lead { margin: 22px 0 0; }
.product-img.is-icon, .card-img.is-icon { object-fit: contain; padding: 8px; background: var(--page); box-shadow: var(--line) 0 0 0 1px inset; }
.card-img.is-icon { padding: 7px; }

/* article page */
.article { max-width: 860px; }
.hero { margin: 26px 0 0; padding: 16px; border-radius: var(--r-card); background: var(--page); border: 1px solid var(--line-soft); }
.hero img { display: block; width: 100%; height: auto; max-height: 560px; object-fit: contain; cursor: zoom-in; }
.prose { margin-top: 26px; font-size: 17px; line-height: 1.75; color: var(--body); overflow-wrap: break-word; }
.prose > :first-child { margin-top: 0; }
.prose h2 { margin: 36px 0 10px; font-size: 26px; font-weight: 600; line-height: 1.3; color: var(--ink); letter-spacing: -0.01em; }
.prose h3 { margin: 28px 0 8px; font-size: 20px; font-weight: 600; line-height: 1.35; color: var(--ink); }
.prose h4, .prose h5, .prose h6 { margin: 22px 0 6px; font-size: 17px; font-weight: 600; color: var(--ink); }
.prose p { margin: 12px 0; }
.prose ul, .prose ol { margin: 10px 0; padding-left: 24px; }
.prose ul { list-style: disc; }
.prose ol { list-style: decimal; }
.prose ul ul { list-style: circle; }
.prose li { margin: 6px 0; padding-left: 2px; }
.prose li > ul, .prose li > ol { margin: 6px 0; }
.prose li::marker { color: var(--label); }
.prose strong, .prose b { font-weight: 600; color: var(--ink); }
.prose a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--teal); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.prose a:hover { text-decoration-color: var(--ink); }
.prose img { display: block; max-width: 100%; height: auto; margin: 18px auto; border-radius: 16px; border: 1px solid var(--line-soft); cursor: zoom-in; }
.prose blockquote { margin: 18px 0; padding: 4px 0 4px 18px; border-left: 3px solid var(--line-btn); color: var(--ink-soft); }
.prose hr { margin: 28px 0; border: 0; border-top: 1px solid var(--line-soft); }
.prose code { padding: 1px 6px; border-radius: 6px; background: var(--surface-2); font-size: .92em; }
.table-wrap { margin: 18px 0; overflow-x: auto; border: 1px solid var(--line-soft); border-radius: 16px; }
.prose table { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 1.5; }
.prose th, .prose td { padding: 10px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line-soft); }
.prose th { background: var(--surface); color: var(--ink); font-weight: 600; }
.prose tr:last-child td { border-bottom: 0; }
.prose td p, .prose th p { margin: 0; }
.figure-link { padding: 12px 16px; border-radius: 16px; background: var(--surface); font-size: 15px; }
/* Boxed notes for later: <aside class="callout pearl"><p class="callout-title">Clinical pearl</p><p>…</p></aside>
   Kinds: pearl, tip, pitfall, warning, high-yield, evidence. */
.callout { margin: 20px 0; padding: 14px 18px; border-radius: 16px; border: 1px solid; font-size: 16px; }
.callout > :last-child { margin-bottom: 0; }
.callout-title { margin: 0 0 4px !important; font-size: 13px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.callout.pearl { background: #ecfeff; border-color: #a5f3fc; } .callout.pearl .callout-title { color: #0e7490; }
.callout.tip { background: #f0fdf4; border-color: #bbf7d0; } .callout.tip .callout-title { color: #15803d; }
.callout.pitfall { background: #fff7ed; border-color: #fed7aa; } .callout.pitfall .callout-title { color: #c2410c; }
.callout.warning { background: #fef2f2; border-color: #fecaca; } .callout.warning .callout-title { color: #b91c1c; }
.callout.high-yield { background: #f5f3ff; border-color: #ddd6fe; } .callout.high-yield .callout-title { color: #7c3aed; }
.callout.evidence { background: #eff6ff; border-color: #bfdbfe; } .callout.evidence .callout-title { color: #1d4ed8; }
.chart { margin-top: 26px; border: 1px solid var(--line); border-radius: var(--r-card); overflow: hidden; background: var(--surface); }
.chart-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 12px 12px 18px; }
.chart-bar p { font-size: 16px; font-weight: 600; color: var(--ink); }
.chart-bar span { display: block; font-size: 13px; font-weight: 500; color: var(--label); }
.chart-bar .btn { height: 40px; font-size: 15px; flex: none; }
.chart iframe { display: block; width: 100%; height: 70vh; min-height: 420px; border: 0; border-top: 1px solid var(--line); background: var(--page); }
.byline { display: flex; align-items: center; gap: 8px; margin-top: 30px; padding-top: 18px; border-top: 1px solid var(--line-soft); font-size: 15px; font-weight: 500; color: var(--muted); }
.more-title { margin-top: 34px; font-size: 26px; line-height: 36px; }

/* zoom frame (mind maps and zoomable pictures) */
.zoomframe { margin: 26px 0 0; border: 1px solid var(--line); border-radius: var(--r-card); background: var(--surface); overflow: hidden; }
.prose .zoomframe { margin: 22px 0; }
.zf-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 10px 10px 10px 18px; }
.zf-bar p { margin: 0; font-size: 16px; font-weight: 600; line-height: 1.3; color: var(--ink); }
.zf-bar span { display: block; font-size: 13px; font-weight: 500; color: var(--label); }
.zf-tools { display: flex; gap: 6px; }
.zf-tools button { height: 36px; min-width: 36px; padding: 0 12px; border-radius: 12px; background: var(--page); border: 1px solid var(--line-btn); font-size: 15px; font-weight: 500; color: var(--ink-active); }
.zf-tools button:hover { background: var(--surface-2); }
.zf-view { position: relative; height: 360px; overflow: hidden; background: #fff; border-top: 1px solid var(--line); cursor: grab; touch-action: pan-y; user-select: none; }
.is-dragging .zf-view { cursor: grabbing; }
.zf-canvas { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.zf-canvas svg, .zf-canvas img { display: block; max-width: none; margin: 0; border: 0; border-radius: 0; cursor: inherit; }
.zoomframe.is-full { position: fixed; inset: 0; z-index: 60; margin: 0; border-radius: 0; border: 0; display: flex; flex-direction: column; }
.zoomframe.is-full .zf-view { flex: 1; height: auto !important; }
.mindmap:not(.is-drawn) .zf-view::after { content: "Drawing the mind map…"; position: absolute; inset: 0; display: grid; place-items: center; color: var(--label); font-size: 15px; }
.mindmap-text { border-top: 1px solid var(--line); padding: 10px 18px 12px; font-size: 16px; line-height: 1.6; color: var(--body); }
.mindmap-text summary { cursor: pointer; font-weight: 500; color: var(--ink-active); }
.mindmap-text ul { list-style: disc; padding-left: 22px; margin: 4px 0; }
.mindmap-text ul ul { list-style: circle; }
.mindmap-text > p { margin: 8px 0 2px; }
.dot-key { display: inline-block; width: 10px; height: 10px; margin-right: 7px; border-radius: 50%; vertical-align: 0; }
.mindmap-key { font-size: 14px; }
.contact-email { margin-top: 22px; }
.contact-email p a { font-size: 18px; font-weight: 500; color: var(--ink); text-decoration: underline; text-decoration-color: var(--teal); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.subscribe-form { margin-top: 18px; }
.mindmap-note { margin: 4px 0; padding: 6px 10px; border-left: 3px solid #4D49BE; color: #4D49BE; font-size: 15px; }

/* picture viewer */
.lightbox { position: fixed; inset: 0; z-index: 50; display: flex; flex-direction: column; background: rgba(15, 17, 19, .92); }
.lightbox[hidden] { display: none; }
.lightbox-stage { flex: 1; min-height: 0; display: grid; place-items: center; overflow: hidden; touch-action: none; cursor: grab; }
.lightbox-stage img { max-width: 94vw; max-height: 84vh; background: #fff; border-radius: 12px; transform-origin: center; user-select: none; -webkit-user-drag: none; }
.lightbox-bar { flex: none; display: flex; align-items: center; justify-content: space-between; padding: 12px 16px 16px; color: #d6dade; font-size: 14px; }
.lightbox-bar button { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 14px; background: #ffffff1f; color: #fff; }
.no-scroll, .no-scroll body { overflow: hidden; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.chips a { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border-radius: 12px; background: var(--surface-2); color: var(--ink-active); font-size: 15px; font-weight: 500; }

/* ===== overlays ===== */
.mobile-menu {
  position: fixed; z-index: 30;
  top: 180px; right: 16px; left: 16px;
  display: flex; flex-direction: column; gap: 4px;
  padding: 12px;
  background: var(--page);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  box-shadow: 0 18px 40px rgba(29, 31, 33, .12);
}
.mobile-menu > a:not(.btn), .mobile-menu > button {
  height: 44px; display: flex; align-items: center; gap: 12px;
  padding: 0 12px; border-radius: 12px;
  font-size: 16px; font-weight: 500; color: var(--ink-active);
}
.mobile-menu > a:not(.btn):hover, .mobile-menu > button:hover { background: var(--surface); }
.mobile-menu .btn { margin-top: 6px; }

.search-modal { position: fixed; inset: 0; z-index: 40; display: flex; justify-content: center; align-items: flex-start; padding: 12vh 16px 16px; }
.search-backdrop { position: absolute; inset: 0; background: rgba(29, 31, 33, .25); backdrop-filter: blur(4px); }
.search-box {
  position: relative;
  width: 100%; max-width: 560px;
  background: var(--page);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  box-shadow: 0 24px 60px rgba(29, 31, 33, .18);
  overflow: hidden;
}
.search-input { display: flex; align-items: center; gap: 10px; padding: 0 16px; height: 60px; border-bottom: 1px solid var(--line-soft); color: var(--muted); }
.search-input input { flex: 1; min-width: 0; border: 0; outline: 0; font: 500 17px var(--font); color: var(--ink); background: none; }
.search-input button { color: var(--muted); }
.search-results { max-height: 50vh; overflow-y: auto; padding: 8px; }
.search-results a { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: 14px; }
.search-results a:hover, .search-results a.is-focus { background: var(--surface); }
.search-results .s-img { width: 40px; height: 40px; border-radius: 10px; flex: none; }
.search-results strong { display: block; font-size: 15px; font-weight: 600; }
.search-results small { display: block; font-size: 14px; color: var(--ink-soft); }
.search-results .s-empty { padding: 16px; color: var(--muted); }

/* ===== collapsed sidebar (desktop) ===== */
@media (min-width: 810px) {
  .is-collapsed .sidebar { width: 72px; padding: 15px 11px; }
  .is-collapsed .brand-row { padding: 0; justify-content: center; }
  .is-collapsed .subs { display: none; }
  .is-collapsed .logo, .is-collapsed .cat-label, .is-collapsed .cat-name, .is-collapsed .side-actions .btn p { display: none; }
  .is-collapsed .collapse-btn { transform: rotate(180deg); }
  .is-collapsed .cats { margin-top: 39px; }
  .is-collapsed .cat { justify-content: center; padding: 0; }
  .is-collapsed .side-actions .btn { padding: 0; }
}

/* ===== between tablet and full desktop ===== */
@media (min-width: 810px) and (max-width: 1199px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .two-col, .plans { grid-template-columns: 1fr; }
  .kind-contact .two-col { height: auto; }
  .sponsor-head { flex-direction: column; align-items: flex-start; }
  .billing { margin-right: 0; }
}

/* ===== tablet & phone (809px and narrower) ===== */
@media (max-width: 809px) {
  body { font-size: 16px; }
  .shell { display: block; height: auto; min-height: 0; padding: 16px 16px 26px; }
  .rail, .collapse-btn, .side-actions { display: none; }
  .menu-btn { display: grid; margin-right: -8px; }
  .sidebar { width: auto; height: 156px; }
  .brand-row { padding: 0; }
  .cat-label { padding-left: 0; }
  .cats { flex-direction: row; gap: 9px; padding-left: 4px; overflow-x: auto; overflow-y: hidden; }
  .cat { padding: 0 10px; }
  .cat .cat-name { display: none; }
  .cat-all .cat-name { display: inline; }
  .subs { display: none; }
  .subchips { margin: 0 0 16px; }
  .card-meta { padding-top: 12px; }

  .main { margin-top: 92px; overflow: visible; }
  .main-scroll { height: auto; overflow: visible; padding: 15px; }
  .grid { grid-template-columns: 1fr; gap: 16px; }
  .card-text { min-height: 0; }

  /* category pages: fixed-height screen with a tab bar */
  .kind-category .shell { display: flex; flex-direction: column; height: 100vh; height: 100dvh; padding-bottom: 16px; }
  .kind-category .sidebar { flex: none; }
  .kind-category .cat-all .cat-name { display: none; }
  .kind-category .main { flex: 1 1 auto; min-height: 0; margin-top: 15px; overflow: hidden; }
  .kind-category .main-scroll { height: 100%; overflow-y: auto; padding: 19px; }
  .kind-category .cat-title { margin: 18px 0 12px 16px; font-size: 23px; line-height: 32px; }
  .kind-category .tabbar {
    flex: none;
    display: flex; align-items: center; justify-content: space-between;
    height: 72px; margin-top: 2px;
    padding: 0 11px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-card);
  }
  .tab { height: 48px; min-width: 48px; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 0 12px; border-radius: var(--r-nav); color: #b6bbc2; font-size: 16px; font-weight: 500; }
  .tab span { display: none; }
  .tab.is-active { background: var(--surface-2); color: var(--ink); box-shadow: rgb(235, 238, 242) 0 0 0 1px inset; padding: 0 14px; }
  .tab.is-active span { display: inline; }
  .tab-search { color: var(--ink); }

  /* panels */
  .kind-about .main-scroll, .kind-contact .main-scroll { padding: 7px; }
  .two-col { grid-template-columns: 1fr; gap: 12px; }
  .panel { padding: 11px; }
  .big { margin: 32px 4px 2px; font-size: 23px; line-height: 32px; }
  .lead { margin: 0 4px; font-size: 18px; line-height: 32.5px; }
  .box { margin-top: 22px; padding: 15px; border-radius: 16px; }
  .panel-faq .big, .panel-faq .lead { margin-left: 8px; margin-right: 8px; }
  .panel-faq .box { margin-top: 36px; }
  .sub { letter-spacing: -0.005em; }
  .box h3, .more h3 { font-size: 18px; line-height: 25px; }
  .sub, .more > div p { font-size: 18px; line-height: 33px; }
  .more { display: block; margin-top: 12px; padding: 24px; border-radius: var(--r-card); }
  .more .btn { margin-top: 16px; }

  .h2 { font-size: 20px; line-height: 28px; }
  .kind-sponsor .main-scroll { padding: 17px; }
  .sponsor { border: 0; padding: 4px 0 0; }
  .sponsor-head { display: block; }
  .sponsor-head .lead { margin-top: 6px; font-size: 18px; line-height: 32px; }
  .billing { margin: 22px auto 0; }
  .plans { grid-template-columns: 1fr; gap: 16px; margin-top: 30px; }
  .plan { padding: 15px; }
  .plan-name { margin-top: 16px; }
  .price { margin-top: 0; }
  .plan-text { margin-top: 8px; }
  .tag { height: 40px; }
  .btn-cta { margin-top: 16px; }
  .sponsor .more { margin-top: 20px; }

  .kind-contact .two-col { height: auto; }
  .contact-panel { padding: 23px 19px 19px; border-radius: var(--r-card); min-height: 379px; }
  .contact-panel .lead { margin-top: 6px; line-height: 32px; }
  .contact-panel .map { flex: none; height: 190px; }
  .kind-contact .shell { padding-bottom: 16px; }
  .form { margin-top: 16px; }
  .form textarea { flex: none; height: 104px; }

  .product { padding: 15px; }
  .prose { font-size: 17px; line-height: 1.7; }
  .prose h2 { font-size: 22px; }
  .prose h3 { font-size: 19px; }
  .prose ul, .prose ol { padding-left: 20px; }
  .hero { padding: 8px; }
  .chart-bar { flex-direction: column; align-items: flex-start; }
  .chart iframe { height: 60vh; min-height: 360px; }
  .more-title { margin: 28px 0 12px 4px; font-size: 22px; line-height: 30px; }
  .mobile-menu { top: 180px; }
}

@media (min-width: 480px) and (max-width: 809px) {
  .kind-about .main, .kind-sponsor .main { margin-top: 107px; }
}

@media (max-width: 480px) {
  .form textarea { height: 70px; min-height: 70px; }
  .kind-category .main { margin-top: 0; }
  .lead, .sponsor-head .lead { font-size: 18px; line-height: 32px; }
  .plan-text { font-size: 16px; }
  .features li { font-size: 16px; }
  .billing { width: 100%; max-width: 324px; }
  .product-head { flex-direction: column; align-items: flex-start; }
  .product-img { width: 72px; height: 72px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
