/* Lớp Xinh, trang công cụ (/cong-cu/…). Phần đầu chép từ các khối @shared của landing/index.html
   (tokens, nền tảng, nút, thanh trên, chân trang) bởi landing/tools-css/mkcss.py: sửa ở đó. */
:root {
  --blue-500: #1877F2; --blue-600: #1267E0; --blue-700: #0F5FD0; --blue-900: #0B2E6B;
  --blue-100: #DCEAFE; --blue-50: #EEF5FF;
  --ink: #0F1D3A; --ink-2: #44546F; --ink-3: #5E6D86; --field-bd: #7C93B8;
  --line: #E3EBF7; --line-2: #C9D8EE; --bg: #FFFFFF; --bg-soft: #F4F8FF; --card: #FFFFFF;
  --red: #E0313F; --green: #0E9A68; --green-text: #0B7A52; --green-50: #E0F5EC;
  --sun: #FFC83D; --sun-50: #FFF6DB; --sun-text: #6B4E00;
  --accent-grad: linear-gradient(150deg, #FF8A5B 0%, #FF4F8B 48%, #7C5CFF 100%);

  --f-display: "Baloo 2", "Be Vietnam Pro", system-ui, sans-serif;
  --f-body: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --f-hand: "Pangolin", "Comic Sans MS", "Be Vietnam Pro", cursive;

  --fs-display: clamp(2.25rem, 1.5rem + 3.4vw, 3.75rem);
  --fs-h2: clamp(1.8rem, 1.3rem + 2.2vw, 2.5rem);
  --fs-h3: clamp(1.45rem, 1.2rem + 1vw, 1.75rem);
  --fs-h4: clamp(1.125rem, 1.1rem + .15vw, 1.1875rem);
  --fs-lead: clamp(1.0625rem, 1rem + .3vw, 1.1875rem);
  --fs-body: 1rem; --fs-sm: .90625rem; --fs-xs: .8125rem; --fs-tag: .75rem;
  --fs-price: clamp(2.25rem, 1.9rem + 1.4vw, 2.75rem); --fs-stamp: 3.25rem;

  --r-sm: 8px; --r-md: 12px; --r-lg: 20px; --r-xl: 28px; --r-pill: 999px;
  --bd: 1px solid var(--line);
  --sh-1: 0 1px 2px rgba(15, 29, 58, .06);
  --sh-2: 0 2px 4px rgba(15, 29, 58, .04), 0 12px 28px rgba(18, 103, 224, .10);
  --sh-3: 0 30px 60px rgba(15, 29, 58, .18);
  --sh-btn: 0 6px 16px rgba(18, 103, 224, .28);
  --ease: cubic-bezier(.2, .7, .2, 1);

  --wrap: 1160px; --gutter: 16px; --sec-y: 48px; --head-gap: 28px; --group-y: 40px; --grid-gap: 16px; --card-pad: 20px;
  --top-h: 56px;
  color-scheme: light;
}
@media (min-width: 720px) { :root { --gutter: 24px; --sec-y: 72px; --head-gap: 40px; --group-y: 56px; --grid-gap: 20px; --card-pad: 24px; --top-h: 64px; } }
@media (min-width: 1100px) { :root { --gutter: 32px; --head-gap: 44px; --grid-gap: 24px; --card-pad: 28px; } }
/* ── nền tảng ── */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 var(--fs-body)/1.6 var(--f-body); -webkit-font-smoothing: antialiased; overflow-x: clip; }
svg { max-width: 100%; }
a { color: inherit; }
h1, h2, h3, h4, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
h1, h2, h3 { font-family: var(--f-display); letter-spacing: -.01em; text-wrap: balance; }
h1 { font-size: var(--fs-display); font-weight: 800; line-height: 1.08; }
h2 { font-size: var(--fs-h2); font-weight: 800; line-height: 1.12; }
h3 { font-size: var(--fs-h3); font-weight: 700; line-height: 1.18; }
h4, .h4 { font: 700 var(--fs-h4)/1.3 var(--f-body); letter-spacing: 0; }
p { text-wrap: pretty; }
button { font: inherit; color: inherit; }
[id] { scroll-margin-top: calc(var(--top-h) + 16px); }
:focus-visible { outline: 3px solid var(--blue-500); outline-offset: 2px; border-radius: var(--r-sm); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: 16px; top: -64px; z-index: 50; background: var(--ink); color: #fff; padding: 12px 16px; border-radius: var(--r-md); font-weight: 600; }
.skip:focus { top: 8px; }
.wrap { max-width: calc(var(--wrap) + 2 * var(--gutter)); margin-inline: auto; padding-inline: max(var(--gutter), env(safe-area-inset-left, 0px)) max(var(--gutter), env(safe-area-inset-right, 0px)); }
.i { width: 1.25em; height: 1.25em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.sprite { display: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ── thành phần dùng chung ── */
.eyebrow { font: 600 var(--fs-xs)/1.3 var(--f-body); letter-spacing: .08em; text-transform: uppercase; color: var(--blue-700); }
.lead { font-size: var(--fs-lead); line-height: 1.55; color: var(--ink-2); max-width: 56ch; }
.mark { background: linear-gradient(transparent 58%, var(--blue-100) 58% 92%, transparent 92%); padding: 0 .08em; white-space: nowrap; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.sec { padding-block: var(--sec-y); }
.sec--soft { background: var(--bg-soft); }
.sec-head { display: grid; gap: 12px; margin-bottom: var(--head-gap); }
.sec-head--center { text-align: center; justify-items: center; max-width: 760px; margin-inline: auto; }
.h-sm { font-size: var(--fs-h3); line-height: 1.18; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 8px 22px; border: 1.5px solid transparent; border-radius: var(--r-md); font: 700 var(--fs-body)/1.2 var(--f-body); text-align: center; text-decoration: none; cursor: pointer; transition: transform .15s ease-out, background-color .15s ease-out, border-color .15s ease-out, box-shadow .15s ease-out; }
.btn-primary { background: var(--blue-600); color: #fff; box-shadow: var(--sh-btn); }
.btn-primary:hover { background: var(--blue-700); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(1px); box-shadow: var(--sh-1); }
.btn-primary[disabled] { background: var(--blue-700); cursor: progress; transform: none; }
.btn-secondary { background: var(--card); color: var(--blue-700); border-color: var(--line-2); }
.btn-secondary:hover { border-color: var(--blue-500); background: var(--blue-50); }
.btn-secondary:active { background: var(--blue-100); }
.btn-lg { min-height: 56px; padding-inline: 26px; }
.btn-sm { min-height: 44px; padding-inline: 16px; }
.btn-block { width: 100%; }
.btn-on-deep { background: #fff; color: var(--blue-700); }
.btn-on-deep:hover { background: var(--blue-50); transform: translateY(-1px); }
.top { position: sticky; top: 0; z-index: 40; background: rgba(255, 255, 255, .9); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border-bottom: 1px solid transparent; transition: border-color .2s; padding-top: env(safe-area-inset-top, 0px); }
.top.is-stuck { border-bottom-color: var(--line); }
.top__in { display: flex; align-items: center; gap: 12px; min-height: var(--top-h); }
.logo { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; margin-right: auto; font: 800 var(--fs-h3)/1 var(--f-display); color: var(--ink); text-decoration: none; }
.logo svg { width: 34px; height: 34px; flex: none; }
.nav { display: none; align-items: center; gap: 28px; margin-right: 16px; }
.nav a { display: inline-flex; align-items: center; min-height: 44px; font: 500 var(--fs-sm)/1.2 var(--f-body); color: var(--ink-2); text-decoration: none; }
.nav a:hover, .nav a[aria-current="true"] { color: var(--ink); }
.nav a[aria-current="true"] { text-decoration: underline 2px var(--blue-500); text-underline-offset: 8px; }
.top .only-wide { display: none; }
.menu-btn { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 1.5px solid var(--line-2); border-radius: var(--r-md); background: var(--card); color: var(--ink); cursor: pointer; }
.menu-btn .i { width: 22px; height: 22px; }
.menu-btn[aria-expanded="true"] .i-open, .menu-btn[aria-expanded="false"] .i-close { display: none; }
.menu { position: absolute; left: 0; right: 0; top: 100%; background: var(--card); border-bottom: var(--bd); box-shadow: var(--sh-2); padding: 0 var(--gutter) 8px; animation: menu-in .2s var(--ease); }
.menu a { display: flex; align-items: center; min-height: 52px; border-top: var(--bd); font: 600 var(--fs-lead)/1.2 var(--f-body); text-decoration: none; }
@keyframes menu-in { from { opacity: 0; transform: translateY(-8px); } }
@media (min-width: 480px) { .top .only-wide { display: inline; } .top .only-narrow { display: none; } }
@media (min-width: 900px) { .nav { display: flex; } .menu-btn, .menu { display: none !important; } }
.foot :focus-visible { outline-color: #fff; }
.foot__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 32px 24px; }
.foot__brand, .foot__mail { grid-column: 1 / -1; }
.foot .logo { color: #fff; margin: 0 0 8px; }
.foot h2 { margin-bottom: 4px; font: 600 var(--fs-xs)/1.3 var(--f-body); letter-spacing: .08em; text-transform: uppercase; color: #fff; }
.foot li a { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; text-decoration: none; }
.foot li a:hover { color: #fff; text-decoration: underline; text-underline-offset: 4px; }
.foot .i { width: 18px; height: 18px; }
.foot__end { margin-top: 32px; padding-top: 24px; border-top: 1px solid rgba(255, 255, 255, .12); font-size: var(--fs-xs); }
@media (min-width: 720px) {
  .foot { padding-bottom: 32px; }
  .foot__grid { grid-template-columns: 1fr 1fr 1fr; }
  .foot__mail { grid-column: auto; }
}
@media (min-width: 1100px) { .foot__grid { grid-template-columns: 2fr 1fr 1fr 1.2fr; } .foot__brand { grid-column: auto; } }

/* Sinh bởi landing/tools-css/fonts.py (Google Fonts, SIL OFL 1.1). */
@font-face {
  font-family: 'Baloo 2';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(/fonts/baloo-2-vietnamese.bb851167.woff2) format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
@font-face {
  font-family: 'Baloo 2';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(/fonts/baloo-2-latin.ae196042.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: 'Baloo 2';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url(/fonts/baloo-2-vietnamese.bb851167.woff2) format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
@font-face {
  font-family: 'Baloo 2';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url(/fonts/baloo-2-latin.ae196042.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: 'Be Vietnam Pro';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/fonts/be-vietnam-pro-vietnamese.f1ab404e.woff2) format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
@font-face {
  font-family: 'Be Vietnam Pro';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/fonts/be-vietnam-pro-latin.312fd8b5.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: 'Be Vietnam Pro';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(/fonts/be-vietnam-pro-vietnamese.90dc6956.woff2) format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
@font-face {
  font-family: 'Be Vietnam Pro';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(/fonts/be-vietnam-pro-latin.7aec41b3.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: 'Be Vietnam Pro';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(/fonts/be-vietnam-pro-vietnamese.d2679bb5.woff2) format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
@font-face {
  font-family: 'Be Vietnam Pro';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(/fonts/be-vietnam-pro-latin.a60e689c.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: 'Pangolin';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/fonts/pangolin-vietnamese.8ad00cd1.woff2) format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
@font-face {
  font-family: 'Pangolin';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/fonts/pangolin-latin.cc54c937.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;
}


/* ── trang công cụ ── */
.top { border-bottom-color: var(--line); }
.btn-ghost { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .55); }
.btn-ghost:hover { border-color: #fff; background: rgba(255, 255, 255, .08); }
.crumbs ol { display: flex; flex-wrap: wrap; gap: 4px 8px; padding: 16px 0 0; margin: 0; list-style: none; font-size: var(--fs-xs); color: var(--ink-3); }
.crumbs li + li::before { content: "›"; margin-right: 8px; color: var(--line-2); }
.crumbs a { text-decoration: none; }
.crumbs a:hover { text-decoration: underline; color: var(--ink); }
.tool-hero { display: grid; gap: 12px; padding: 20px 0; }
.tool-hero h1 { font-size: clamp(2rem, 1.4rem + 2.4vw, 3rem); }
.meta { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 4px 14px; border: var(--bd); border-radius: var(--r-pill); background: var(--bg-soft); font-size: var(--fs-sm); font-weight: 500; color: var(--ink-2); text-decoration: none; }
a.chip:hover { border-color: var(--blue-500); color: var(--blue-700); }
.chip small { color: var(--ink-3); font-weight: 400; }
.chip--plain { background: var(--card); }
.chip--free { background: var(--green-50); border-color: transparent; color: var(--green-text); }
.chip--on { background: var(--blue-600); border-color: var(--blue-600); color: #fff; }
.tool-frame { border: var(--bd); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--sh-2); background: #fff; }
.tool-frame iframe { display: block; width: 100%; height: min(78vh, 760px); min-height: 520px; border: 0; }
.tool-alt { margin: 10px 0 0; font-size: var(--fs-sm); color: var(--ink-3); }
.tool-alt a { color: var(--blue-700); }
.doc { max-width: 72ch; padding: 32px 0 8px; display: grid; gap: 14px; color: var(--ink-2); }
.doc h2 { margin-top: 18px; font-size: var(--fs-h3); color: var(--ink); }
.doc ul, .doc ol { display: grid; gap: 6px; padding-left: 1.4em; list-style: disc; }
.doc ol { list-style: decimal; }
.doc li::marker { color: var(--blue-500); }
.doc a { color: var(--blue-700); }
.note { padding: 14px 18px; border-radius: var(--r-md); background: var(--sun-50); color: var(--sun-text); }
.faq { border: var(--bd); border-radius: var(--r-lg); background: var(--card); }
.faq details { border-bottom: var(--bd); }
.faq details:last-child { border-bottom: 0; }
.faq summary { display: flex; align-items: center; min-height: 56px; padding: 12px 18px; font-weight: 600; color: var(--ink); cursor: pointer; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; margin-left: auto; padding-left: 12px; font-size: 1.4em; color: var(--blue-600); }
.faq details[open] summary::after { content: "–"; }
.faq details p { padding: 0 18px 16px; }
.tgroup, .related { padding-top: 32px; }
.tgroup h2, .related h2 { margin-bottom: 14px; font-size: var(--fs-h3); }
.tgroup h2 a { text-decoration: none; }
.tgroup h2 a:hover { color: var(--blue-700); }
.tgrid { display: grid; gap: 12px; padding: 0; list-style: none; grid-template-columns: 1fr; }
@media (min-width: 640px) { .tgrid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1000px) { .tgrid { grid-template-columns: 1fr 1fr 1fr; } }
.tcard a { display: grid; gap: 4px; align-content: start; height: 100%; padding: 16px 18px; border: var(--bd); border-radius: var(--r-md); background: var(--card); text-decoration: none; transition: border-color .15s, box-shadow .15s; }
.tcard a:hover { border-color: var(--blue-500); box-shadow: var(--sh-2); }
.tcard b { color: var(--ink); font-weight: 700; }
.tcard span { font-size: var(--fs-sm); color: var(--ink-2); }
.tcard small { font-size: var(--fs-xs); color: var(--ink-3); }
.search { display: block; max-width: 560px; }
.search input { width: 100%; min-height: 52px; padding: 10px 16px; border: 1.5px solid var(--field-bd); border-radius: var(--r-md); font: inherit; }
.search input:focus { outline: 3px solid var(--blue-100); border-color: var(--blue-500); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.cta { display: grid; gap: 18px; margin: 48px 0 56px; padding: 28px; border-radius: var(--r-xl); background: var(--blue-700); color: #fff; }
.cta h2 { font-size: var(--fs-h3); }
.cta p { color: rgba(255, 255, 255, .86); max-width: 60ch; }
.cta__btns { display: flex; flex-wrap: wrap; gap: 12px; }
@media (min-width: 900px) { .cta { grid-template-columns: 1fr auto; align-items: center; padding: 36px 40px; } }
.foot { padding-bottom: 32px; }
.top .btn-sm { white-space: nowrap; }
@media (max-width: 400px) { .top .btn-sm { padding-inline: 12px; font-size: var(--fs-sm); } }
.page-cols { display: grid; gap: 24px; }
@media (min-width: 1000px) { .page-cols { grid-template-columns: minmax(0, 1fr) 300px; gap: 40px; } }
.side { align-self: start; margin-top: 32px; padding: 18px 20px; border: var(--bd); border-radius: var(--r-lg); background: var(--bg-soft); }
@media (min-width: 1000px) { .side { position: sticky; top: calc(var(--top-h) + 16px); max-height: calc(100vh - var(--top-h) - 32px); overflow: auto; } }
.side h2 { font: 700 var(--fs-body)/1.3 var(--f-body); margin-bottom: 8px; }
.side h2 small { color: var(--ink-3); font-weight: 500; }
.side ul { display: grid; gap: 2px; padding: 0; list-style: none; font-size: var(--fs-sm); }
.side li a, .side li b { display: block; padding: 5px 0; color: var(--ink-2); text-decoration: none; }
.side li a:hover { color: var(--blue-700); text-decoration: underline; }
.side li b { color: var(--ink); }
.side p { margin-top: 10px; font-size: var(--fs-sm); }
.side p a { color: var(--blue-700); }
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 32px; }
.pager a { display: grid; gap: 2px; padding: 14px 18px; border: var(--bd); border-radius: var(--r-md); text-decoration: none; font-weight: 600; }
.pager a:hover { border-color: var(--blue-500); }
.pager a[rel="next"] { text-align: right; }
.pager small { font-weight: 400; font-size: var(--fs-xs); color: var(--ink-3); }
.doc ul.links { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
ul.links { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
ul.links a { display: inline-flex; min-height: 36px; align-items: center; padding: 4px 14px; border: var(--bd); border-radius: var(--r-pill); background: var(--card); font-size: var(--fs-sm); text-decoration: none; color: var(--blue-700); }
.doc p a, .doc li a, .faq a { color: var(--blue-700); }
.fr { display: inline-flex; flex-direction: column; align-items: center; vertical-align: middle; margin: 0 2px; text-align: center; }
.fr > span { padding: 0 2px; line-height: 1.25; }
.fr > span + span { border-top: 1px solid currentColor; }
.ov { text-decoration: overline; }
.static-block { display: grid; gap: 14px; }
.fcard { padding: 16px 18px; border: var(--bd); border-radius: var(--r-md); background: var(--card); }
.fcard h3 { font: 700 var(--fs-body)/1.3 var(--f-body); color: var(--ink); margin-bottom: 8px; }
.fcard .fx { display: grid; gap: 6px; padding: 10px 14px; border-radius: var(--r-sm); background: var(--blue-50); color: var(--ink); font-size: 1.1rem; }
.fcard dl { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; margin: 10px 0 0; font-size: var(--fs-sm); }
.fcard dt { font-weight: 700; color: var(--ink); }
.fcard dd { margin: 0; }
.fcard .fnote { margin-top: 8px; font-size: var(--fs-sm); }
.fcard h4 { font: 700 var(--fs-body)/1.3 var(--f-body); color: var(--ink); margin-bottom: 8px; }
.doc .fcard h2 { margin-top: 0; font-size: var(--fs-body); }
.fcard .funit { color: var(--ink-3); }
.fex { margin-top: 10px; padding: 10px 14px; border-radius: var(--r-sm); background: #FFF8EB; border: 1px solid #F6E3BC; font-size: var(--fs-sm); }
.fex__h { font-weight: 600; color: var(--ink); margin-bottom: 4px; }
.fex ol { padding-left: 1.3em; display: grid; gap: 4px; list-style: decimal; }
.fex__r { margin-top: 6px; font-weight: 700; color: var(--ink); }
.flink { margin-top: 8px; font-size: var(--fs-sm); }
.ftopic { margin-top: 10px; font-size: var(--fs-body); color: var(--blue-700); }
.doc--wide { max-width: 100ch; }
.doc h1 { font-size: var(--fs-h2); color: var(--ink); line-height: 1.2; }
.doc h2 small { font-weight: 400; color: var(--ink-3); font-size: .75em; }
.ftable th[scope="rowgroup"] { width: 28%; }
.fx-inline { margin-top: 2px; color: var(--ink); }
.fx-inline .sep { margin-right: 6px; color: var(--ink-3); }
.tscroll { overflow-x: auto; }
.tscroll table { min-width: 560px; }
.tscroll--fit table { min-width: 0; }
.tscroll th[scope="row"] { position: sticky; left: 0; background: var(--bg-soft); white-space: nowrap; }
.dtable { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.dtable th, .dtable td { padding: 8px 10px; border-bottom: var(--bd); text-align: left; vertical-align: top; }
.dtable th { color: var(--ink); background: var(--bg-soft); }
.grade-filter { align-items: center; }
.gf-label { font-size: var(--fs-sm); color: var(--ink-3); margin-right: 4px; }
button.chip { font: inherit; font-size: var(--fs-sm); cursor: pointer; }
button.chip[aria-pressed="true"] { background: var(--blue-600); border-color: var(--blue-600); color: #fff; }
.gnote { color: var(--ink-3); font-size: var(--fs-sm); margin: -4px 0 10px; }
.tgroup[hidden], .tcard[hidden] { display: none; }

/* Tool page: open-in-full-window button (phones only) and the teacher strip under the tool. */
.tool-open { display: none; width: 100%; margin-bottom: 12px; }
.pitch { display: grid; gap: 12px; margin: 18px 0 8px; padding: 16px 18px; border: 1px solid #D6E4FA; border-radius: var(--r-lg); background: #F4F8FF; }
.pitch__text { color: var(--ink-2); }
.pitch__text b { color: var(--ink); }
.pitch__btns { display: flex; flex-wrap: wrap; gap: 10px; }
@media (min-width: 900px) { .pitch { grid-template-columns: 1fr auto; align-items: center; } }
@media (max-width: 640px) {
  .tool-open { display: flex; }
  .tool-alt { display: none; }
  .pitch__btns .btn { flex: 1; }
  /* The tool must start on the first screen: short lead, no big icon, chips in one sideways row. */
  .band:has(+ .wrap .tool-frame) .band__icon { display: none; }
  .band:has(+ .wrap .tool-frame) .band__in { padding-bottom: 14px; }
  .band:has(+ .wrap .tool-frame) .meta { flex-wrap: nowrap; overflow-x: auto; margin-inline: calc(-1 * var(--gutter)); padding: 2px var(--gutter) 4px; scrollbar-width: none; }
  .band:has(+ .wrap .tool-frame) .meta::-webkit-scrollbar { display: none; }
  .band:has(+ .wrap .tool-frame) .meta .chip { flex: none; }
  .band:has(+ .wrap .tool-frame) + .wrap { padding-top: 14px; }
}

/* Touch screens: every link and chip at least 44 px tall. */
@media (pointer: coarse) {
  .chip { min-height: 44px; }
  .side a, .tool-alt a, .note a, .links a { display: inline-flex; align-items: center; min-height: 44px; }
  /* Crumbs: bigger hit area without making the band taller. */
  .crumbs a { display: inline-block; padding-block: 13px; margin-block: -13px; }
  .pager a { min-height: 56px; }
}

/* Sinh bởi landing/tools-css/look.py: màu và hoa văn nền từng môn. */
:root {
  --pat-hex: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 width=%2256%22 height=%2298%22%3E%3Cpath stroke=%22%231877F2%22 fill=%22none%22 stroke-width=%221.5%22 d=%22M28 2l26 15v30L28 62 2 47V17zM28 62v34M2 96V81M54 96V81%22/%3E%3C/svg%3E");
  --pat-wave: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 width=%2280%22 height=%2240%22%3E%3Cpath stroke=%22%231877F2%22 fill=%22none%22 stroke-width=%221.5%22 d=%22M0 20q10-16 20 0t20 0 20 0 20 0%22/%3E%3Cpath stroke=%22%231877F2%22 fill=%22none%22 stroke-width=%221.5%22 opacity=%22.5%22 d=%22M0 34q10-16 20 0t20 0 20 0 20 0%22/%3E%3C/svg%3E");
  --pat-grid: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 width=%2240%22 height=%2240%22%3E%3Cpath stroke=%22%231877F2%22 fill=%22none%22 stroke-width=%221.5%22 opacity=%22.6%22 d=%22M40 0H0v40%22/%3E%3Cpath stroke=%22%231877F2%22 fill=%22none%22 stroke-width=%221.5%22 d=%22M20 14v12M14 20h12%22/%3E%3C/svg%3E");
  --pat-rings: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 width=%22120%22 height=%22120%22%3E%3Cg stroke=%22%231877F2%22 fill=%22none%22 stroke-width=%221.5%22%3E%3Ccircle cx=%2260%22 cy=%2260%22 r=%2218%22/%3E%3Ccircle cx=%2260%22 cy=%2260%22 r=%2234%22 opacity=%22.7%22/%3E%3Ccircle cx=%2260%22 cy=%2260%22 r=%2250%22 opacity=%22.4%22/%3E%3C/g%3E%3C/svg%3E");
  --pat-cells: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 width=%2270%22 height=%2270%22%3E%3Cg stroke=%22%231877F2%22 fill=%22none%22 stroke-width=%221.5%22%3E%3Ccircle cx=%2218%22 cy=%2218%22 r=%2212%22/%3E%3Ccircle cx=%2218%22 cy=%2218%22 r=%223%22/%3E%3Ccircle cx=%2252%22 cy=%2250%22 r=%2214%22/%3E%3Ccircle cx=%2252%22 cy=%2250%22 r=%224%22/%3E%3C/g%3E%3C/svg%3E");
  --pat-dots: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 width=%2228%22 height=%2228%22%3E%3Ccircle cx=%224%22 cy=%224%22 r=%222%22 fill=%22%231877F2%22/%3E%3C/svg%3E");
  --c: #1267E0; --pat: var(--pat-dots);
}
.s-toan { --pat: var(--pat-grid); }
.s-tieng-viet { --pat: var(--pat-dots); }
.s-ngu-van { --pat: var(--pat-dots); }
.s-tieng-anh { --pat: var(--pat-dots); }
.s-tnxh { --pat: var(--pat-cells); }
.s-khoa-hoc { --pat: var(--pat-cells); }
.s-khtn { --pat: var(--pat-hex); }
.s-vat-li { --pat: var(--pat-wave); }
.s-hoa-hoc { --pat: var(--pat-hex); }
.s-sinh-hoc { --pat: var(--pat-cells); }
.s-lich-su { --pat: var(--pat-rings); }
.s-dia-li { --pat: var(--pat-rings); }
.s-tin-hoc { --pat: var(--pat-grid); }
.s-cong-nghe { --pat: var(--pat-grid); }
.s-gdcd { --pat: var(--pat-dots); }
.s-am-nhac { --pat: var(--pat-wave); }
.s-mi-thuat { --pat: var(--pat-dots); }
.s-dung-chung { --pat: var(--pat-dots); }

/* Trang công cụ: dải đầu trang, thẻ công cụ có ảnh, nhãn, ô môn. Cùng tông với trang chủ:
   nền sáng, xanh thương hiệu (--blue-*), chữ đậm màu mực. Môn học chỉ phân biệt bằng biểu tượng 3D
   (Fluent Emoji) và hoa văn --pat (look.css, sinh bởi look.py), không đổi màu. */

/* ── Dải đầu trang ─────────────────────────────────────────────────────── */
.band { position: relative; isolation: isolate; overflow: hidden;
  background: radial-gradient(90% 120% at 100% 0%, #DCEBFF 0%, transparent 60%), linear-gradient(180deg, #F1F7FF 0%, #F8FBFF 100%);
  border-bottom: 1px solid #E3ECFA; }
.band::before { content: ""; position: absolute; inset: 0; z-index: -1; background-image: var(--pat); opacity: .13;
  -webkit-mask-image: linear-gradient(90deg, transparent 15%, #000 70%); mask-image: linear-gradient(90deg, transparent 15%, #000 70%); }
.band__in { display: flex; align-items: center; gap: 24px; padding-block: 4px 32px; }
.band__text { flex: 1; min-width: 0; display: grid; gap: 12px; }
.band h1 { font-size: clamp(1.9rem, 1.3rem + 2.4vw, 2.9rem); line-height: 1.15; text-wrap: balance; }
.band .lead { color: var(--ink-2); max-width: 46rem; }
.band .chip--free { background: var(--blue-600); border-color: var(--blue-600); color: #fff; font-weight: 600; }
.band .search input { box-shadow: 0 6px 20px rgba(18, 103, 224, .10); }
.band__icon { flex: none; width: 128px; height: 128px; filter: drop-shadow(0 12px 18px rgba(18, 103, 224, .18)); animation: floaty 6s ease-in-out infinite; }
.band__num { flex: none; display: grid; place-items: center; align-content: center; width: 120px; height: 120px; border-radius: 32px;
  background: #fff; border: 1px solid #D6E4FA; box-shadow: 0 10px 24px rgba(18, 103, 224, .12); color: var(--blue-600); font: 800 3.6rem/1 var(--f-head, inherit); }
.band__num::before { content: "LỚP"; font: 700 .8rem/1 var(--f-body, inherit); letter-spacing: .14em; color: var(--ink-3); margin-bottom: 4px; }
@keyframes floaty { 50% { transform: translateY(-6px) rotate(-3deg); } }
@media (prefers-reduced-motion: reduce) { .band__icon { animation: none; } }
@media (max-width: 640px) {
  .band__in { padding-bottom: 22px; align-items: flex-start; }
  .band__icon { width: 56px; height: 56px; margin-top: 40px; }
  .band__num { width: 60px; height: 60px; border-radius: 16px; font-size: 1.8rem; margin-top: 40px; }
  .band__num::before { font-size: .55rem; }
  .band .lead { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
}
.chips-bar { padding-top: 20px; display: grid; gap: 8px; }
.chips-bar .meta { margin: 0; }

/* ── Thẻ công cụ ───────────────────────────────────────────────────────── */
.tgrid { gap: 16px; }
.tcard a { display: flex; flex-direction: column; gap: 0; padding: 0; overflow: hidden; border-radius: 16px; background: #fff;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.tcard a:hover { transform: translateY(-3px); border-color: var(--blue-500); box-shadow: 0 12px 28px rgba(18, 103, 224, .14); }
.tcard a:focus-visible { outline: 3px solid var(--blue-100, #D6E4FA); outline-offset: 2px; }
.tcard span { color: inherit; font-size: inherit; }
.tthumb { display: block; height: 168px; overflow: hidden; background: #F4F8FF; border-bottom: 1px solid #E8EEF8; }
.tthumb img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top left; transition: transform .35s ease; }
.tcard a:hover .tthumb img { transform: scale(1.03); }
/* No picture: the tool's icon, large, brand blue on a pale patterned ground. */
.tcard .tart { position: relative; display: grid; place-items: center; width: 100%; height: 100%; color: var(--blue-600);
  background: linear-gradient(180deg, #EEF5FF, #F8FBFF); }
.tcard .tart::before { content: ""; position: absolute; inset: 0; background-image: var(--pat); opacity: .14; }
.tart svg { position: relative; width: 52px; height: 52px; stroke-width: 1.6; padding: 18px; box-sizing: content-box;
  background: #fff; border-radius: 22px; box-shadow: 0 8px 20px rgba(18, 103, 224, .14); }
.tbody { display: grid; grid-template-columns: auto 1fr; gap: 6px 10px; padding: 14px 16px 16px; flex: 1; align-content: start; }
.ticon { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: #EAF2FF; color: var(--blue-600); }
.ticon svg { width: 18px; height: 18px; }
.tcard b { align-self: center; font-size: 1rem; line-height: 1.3; }
.tuse, .tmeta { grid-column: 1 / -1; }
.tuse { font-size: var(--fs-sm) !important; color: var(--ink-2) !important; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tmeta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.tag { display: inline-flex; align-items: center; min-height: 24px; padding: 2px 9px; border-radius: 999px; font-size: 12px !important; font-weight: 600; line-height: 1.2; }
.tag--g { background: #EAF2FF; color: var(--blue-700) !important; }
.tag--new { background: #FFF4DB; color: #8A5300 !important; }
.tag--sim { background: #F1EDFF; color: #5B3FB8 !important; }
.tag--solve { background: #E6F6EC; color: #1E6B3A !important; }
.tag--class { background: #F1F4F8; color: var(--ink-2) !important; }
@media (max-width: 640px) { .tthumb { height: 140px; } }

/* Nổi bật: ba thẻ lớn đầu trang môn */
.featured { padding-top: 28px; }
.featured h2 { display: flex; align-items: center; gap: 10px; }
.featured h2::before { content: "★"; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; background: #FFF4DB; color: #D98A00; font-size: 1rem; }
.tgrid--big { margin-top: 14px; }
@media (min-width: 640px) { .tgrid--big { grid-template-columns: repeat(3, 1fr); } }
.tcard--big .tthumb { height: 200px; }
.tcard--big b { font-size: 1.1rem; }

/* Tiêu đề nhóm */
.tgroup h2 { display: flex; align-items: center; gap: 10px; }
.tgroup h2::before { content: ""; width: 6px; height: 24px; border-radius: 3px; background: var(--blue-500); }

/* ── Ô môn học (trang /cong-cu/) ──────────────────────────────────────── */
.subj-tiles ul { display: grid; gap: 10px; padding: 24px 0 8px; margin: 0; list-style: none; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.subj-tiles a { display: grid; justify-items: start; gap: 2px; height: 100%; padding: 14px; border-radius: 16px; text-decoration: none; background: #fff;
  border: 1px solid #E3ECFA; transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.subj-tiles a:hover { transform: translateY(-2px); border-color: var(--blue-500); box-shadow: 0 10px 22px rgba(18, 103, 224, .12); }
.subj-tiles img { width: 44px; height: 44px; margin-bottom: 6px; transition: transform .25s ease; }
.subj-tiles a:hover img { transform: scale(1.08) rotate(-6deg); }
.subj-tiles b { color: var(--ink); font-size: .95rem; line-height: 1.3; }
.subj-tiles small { color: var(--ink-3); font-size: var(--fs-xs); }
@media (max-width: 640px) {
  .subj-tiles ul { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .subj-tiles a { padding: 10px; justify-items: center; text-align: center; }
  .subj-tiles img { width: 34px; height: 34px; margin-bottom: 2px; }
  .subj-tiles b { font-size: .8rem; }
}
.grades-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 8px 0 0; }

/* On phones the subject chips scroll sideways in one row. */
@media (max-width: 640px) {
  .chips-bar .meta:first-child { flex-wrap: nowrap; overflow-x: auto; margin-inline: calc(-1 * var(--gutter)); padding: 2px var(--gutter) 6px; scrollbar-width: none; }
  .chips-bar .meta:first-child::-webkit-scrollbar { display: none; }
  .chips-bar .meta:first-child .chip { flex: none; }
}
