/* =========================================================
   ManhTool — Tạo thẻ meta SEO
   Màu theo logo: xanh rừng đậm → xanh ngọc → xanh chanh
   ========================================================= */

:root {
  --ink: #0f2620;
  --brand-800: #0a5c44;
  --brand-700: #0e7c5a;
  --brand-500: #12b886;
  --leaf: #4cb944;
  --lime: #c4e43a;
  --grad: linear-gradient(115deg, #0e7c5a 0%, #12b886 50%, #7ccf3e 85%, #c4e43a 100%);

  --bg: #f5f8f6;
  --surface: #ffffff;
  --surface-2: #f3f7f4;
  --tint: #e9f6ef;           /* nền xanh rất nhạt khi rê chuột / chọn */
  --border: #e1ebe5;
  --border-strong: #cddcd3;
  --text: #13241f;
  --text-2: #4a5a55;
  --text-3: #6f7f79;
  --primary: #0e7c5a;
  --primary-hover: #0a5c44;
  --on-primary: #ffffff;
  --accent-text: #0e7c5a;
  --warn: #b45309;           /* sắp chạm giới hạn */
  --danger: #c2410c;
  --danger-bg: #fff4ee;
  --shadow: 0 1px 2px rgba(15,38,32,.04), 0 4px 16px rgba(15,38,32,.06);
  --shadow-lg: 0 24px 60px rgba(15,38,32,.2);

  --r-lg: 18px;
  --r: 12px;
  --r-sm: 9px;
  --font: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "Cascadia Code", Consolas, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0c1613; --surface: #121e1a; --surface-2: #17251f; --tint: #173328;
    --border: #213530; --border-strong: #2d463d;
    --text: #e7f1ec; --text-2: #a8bab2; --text-3: #85988f;
    --primary: #12b886; --primary-hover: #34cf98; --on-primary: #04241a; --accent-text: #3dd598;
    --warn: #facc15; --danger: #fb923c; --danger-bg: #2a1a10;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 4px 16px rgba(0,0,0,.2);
    --shadow-lg: 0 24px 60px rgba(0,0,0,.55);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0c1613; --surface: #121e1a; --surface-2: #17251f; --tint: #173328;
  --border: #213530; --border-strong: #2d463d;
  --text: #e7f1ec; --text-2: #a8bab2; --text-3: #85988f;
  --primary: #12b886; --primary-hover: #34cf98; --on-primary: #04241a; --accent-text: #3dd598;
  --warn: #facc15; --danger: #fb923c; --danger-bg: #2a1a10;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 4px 16px rgba(0,0,0,.2);
  --shadow-lg: 0 24px 60px rgba(0,0,0,.55);
  color-scheme: dark;
}

/* ---------- Nền tảng ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column; overflow-x: hidden;
  font-family: var(--font); font-size: 16px; line-height: 1.55; color: var(--text);
  background: var(--bg);
}
body::before {
  /* vệt sáng xanh nhẹ phía trên, lấy cảm hứng từ dải màu logo */
  content: ""; position: absolute; inset: 0 0 auto 0; height: 420px; z-index: -1; pointer-events: none;
  background:
    radial-gradient(600px 300px at 85% -60px, rgba(196,228,58,.22), transparent 70%),
    radial-gradient(700px 320px at 10% -80px, rgba(18,184,134,.18), transparent 70%);
}
main { flex: 1; }
img { max-width: 100%; display: block; }
a { color: var(--accent-text); }
button { font: inherit; color: inherit; }
h1, h2, h3, p { margin: 0; }

.ic { width: 18px; height: 18px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 768px) { .container { padding: 0 24px; } }

.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: 16px; top: -48px; z-index: 100; background: var(--primary); color: var(--on-primary); padding: 8px 14px; border-radius: 8px; text-decoration: none; }
.skip-link:focus { top: 12px; }
:focus-visible { outline: 2px solid var(--brand-500); outline-offset: 2px; }
[hidden] { display: none !important; }

.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.brand-mark { width: 36px; height: 36px; border-radius: 10px; background: #fff; box-shadow: 0 0 0 1px var(--border); }
.brand-name { font-weight: 800; font-size: 1.15rem; letter-spacing: -.01em; }
.brand-accent { color: var(--primary); }
.header-actions { display: flex; align-items: center; gap: 6px; }
.header-link {
  display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px;
  border-radius: 999px; text-decoration: none; color: var(--text-2); font-weight: 500; font-size: .9rem;
}
.header-link:hover { background: var(--tint); color: var(--accent-text); }
@media (max-width: 479px) { .header-link span { display: none; } .header-link { padding: 0; width: 38px; justify-content: center; } }

.icon-btn {
  display: inline-grid; place-items: center; width: 38px; height: 38px; padding: 0;
  border-radius: 999px; border: 1px solid var(--border); background: var(--surface);
  color: var(--text-2); cursor: pointer;
}
.icon-btn:hover { color: var(--accent-text); border-color: var(--border-strong); }
.icon-moon { display: none; }
:root[data-theme="dark"] .icon-sun { display: none; }
:root[data-theme="dark"] .icon-moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .icon-sun { display: none; }
  :root:not([data-theme="light"]) .icon-moon { display: block; }
}

/* ---------- Hero ---------- */
.hero { text-align: center; padding-top: 40px; padding-bottom: 28px; }
.hero h1 { font-size: clamp(1.7rem, 3.6vw + .6rem, 2.75rem); font-weight: 800; letter-spacing: -.025em; line-height: 1.15; text-wrap: balance; }
.hero p { margin-top: 10px; color: var(--text-2); font-size: clamp(.98rem, .6vw + .8rem, 1.1rem); text-wrap: balance; }
@media (max-width: 559px) { .hero { padding-top: 24px; padding-bottom: 18px; } }

/* ---------- Bố cục ---------- */
.layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; align-items: start; }
@media (min-width: 1024px) { .layout { grid-template-columns: minmax(0, 1fr) 288px; gap: 24px; } }
.main-col { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; min-width: 0; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow); }

/* Thanh thao tác */
.toolbar { display: flex; align-items: center; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.actions { display: flex; gap: 6px; }
.act {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 40px; padding: 0 12px; cursor: pointer;
  font-size: .88rem; font-weight: 500; color: var(--text-2);
  background: transparent; border: 1px solid transparent; border-radius: var(--r-sm);
  transition: background .15s, color .15s;
}
.act:hover:not(:disabled) { background: var(--tint); color: var(--accent-text); }
.act:disabled { opacity: .4; cursor: default; }
.act-danger:hover:not(:disabled) { background: var(--danger-bg); color: var(--danger); }
.act-icon { width: 40px; padding: 0; }
.act-sep { width: 1px; align-self: center; height: 22px; background: var(--border); margin: 0 4px; }

.btn-primary, .btn-ghost {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; padding: 0 20px; border-radius: var(--r-sm); cursor: pointer;
  font-size: .92rem; font-weight: 600; text-decoration: none; white-space: nowrap;
  transition: background .15s, transform .1s, border-color .15s;
}
.btn-primary { color: var(--on-primary); background: var(--primary); border: 0; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-primary:active, .btn-ghost:active { transform: scale(.97); }
.btn-ghost { color: var(--text); background: var(--surface); border: 1px solid var(--border-strong); }
.btn-ghost:hover { border-color: var(--brand-500); color: var(--accent-text); }
#btnCopy { min-width: 132px; margin-left: auto; }
#btnCopy .ic-check { display: none; }
#btnCopy.is-done { background: var(--leaf); }
#btnCopy.is-done .ic-copy { display: none; }
#btnCopy.is-done .ic-check { display: block; }

@media (max-width: 559px) {
  .toolbar { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
  #btnCopy { order: -1; height: 46px; margin: 0; }
  .actions { justify-content: space-between; gap: 0; }
  .act { padding: 0; width: 44px; height: 44px; }
  .act span { display: none; }
  .act-sep { display: none; }
}
/* Khi chật: nút phụ chỉ còn icon để Sao chép luôn cùng hàng */
@media (min-width: 560px) and (max-width: 700px), (min-width: 1024px) and (max-width: 1099px) {
  .act { width: 40px; padding: 0; }
  .act span { display: none; }
}

.mini-btn {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px;
  font-size: .8rem; font-weight: 600; color: var(--text-2); cursor: pointer;
  background: transparent; border: 1px solid transparent; border-radius: 8px; white-space: nowrap;
}
.mini-btn:hover { background: var(--tint); color: var(--accent-text); }
.mini-btn .ic { width: 16px; height: 16px; }
.mini-btn .ic-check { display: none; }
.mini-btn.is-done { color: var(--accent-text); }
.mini-btn.is-done .ic-copy { display: none; }
.mini-btn.is-done .ic-check { display: block; }
.link-btn { display: inline-flex; align-items: center; gap: 5px; padding: 5px 9px; border: 0; border-radius: 7px; background: none; color: var(--accent-text); font-size: .8rem; font-weight: 600; cursor: pointer; white-space: nowrap; }
.link-btn:hover { background: var(--tint); }

/* ---------- Thẻ phụ ---------- */
.sub-card { padding: 16px; }
@media (min-width: 768px) { .sub-card { padding: 20px; } }
.sub-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.sub-head h2 { font-size: 1.05rem; font-weight: 700; line-height: 1.3; }
.sub-head p { font-size: .84rem; color: var(--text-3); }
.seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; }
.seg label { position: relative; cursor: pointer; }
.seg input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.seg span { display: block; padding: 5px 13px; font-size: .82rem; font-weight: 600; color: var(--text-2); border-radius: 999px; white-space: nowrap; transition: background .15s, color .15s; }
.seg label:hover span { color: var(--text); }
.seg input:checked + span { background: var(--surface); color: var(--accent-text); box-shadow: 0 1px 3px rgba(15,38,32,.14); }
.seg input:focus-visible + span { outline: 2px solid var(--brand-500); outline-offset: 1px; }

.check-line { display: inline-flex; align-items: center; gap: 8px; margin-top: 10px; font-size: .85rem; color: var(--text-2); cursor: pointer; user-select: none; }
.check-line input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch { position: relative; width: 34px; height: 20px; flex-shrink: 0; background: var(--border-strong); border-radius: 999px; transition: background .2s; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .2s; }
.check-line input:checked + .switch { background: var(--brand-500); }
.check-line input:checked + .switch::after { transform: translateX(14px); }
.check-line input:focus-visible + .switch { outline: 2px solid var(--brand-500); outline-offset: 2px; }
/* ---------- Thanh bên ---------- */
.side { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 640px) and (max-width: 1023px) and (hover: hover) { .side { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (hover: none) { .shortcuts-card { display: none; } }

.side-card { padding: 16px; }
.side-head { display: flex; align-items: center; gap: 12px; }
.side-head h2 { font-size: .98rem; font-weight: 700; line-height: 1.3; }
.side-head p { font-size: .82rem; color: var(--text-3); }
.side-icon {
  display: grid; place-items: center; width: 36px; height: 36px; flex-shrink: 0;
  border-radius: 10px; background: var(--tint); color: var(--accent-text);
}
.donate .side-icon { background: var(--grad); color: #fff; }
.side-note { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 10px; font-size: .8rem; color: var(--text-3); }
.side-note .ic { width: 15px; height: 15px; }

.qr-frame {
  position: relative; display: block; width: 100%; margin-top: 14px; padding: 12px;
  background: #fff; border: 1px solid var(--border); border-radius: var(--r); cursor: zoom-in; overflow: hidden;
}
.qr-frame img { width: 100%; max-width: 190px; height: auto; margin: 0 auto; }
.qr-zoom {
  position: absolute; left: 50%; bottom: 10px; transform: translate(-50%, 6px);
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px;
  font-size: .78rem; font-weight: 600; color: #fff; background: rgba(15,38,32,.85);
  border-radius: 999px; opacity: 0; transition: opacity .2s, transform .2s;
}
.qr-zoom .ic { width: 14px; height: 14px; }
.qr-frame:hover .qr-zoom, .qr-frame:focus-visible .qr-zoom { opacity: 1; transform: translate(-50%, 0); }

.shortcuts { display: grid; grid-template-columns: auto 1fr; gap: 8px 12px; margin: 14px 0 0; font-size: .82rem; align-items: center; }
.shortcuts dt { display: flex; align-items: center; gap: 3px; color: var(--text-3); }
.shortcuts dd { margin: 0; color: var(--text-2); text-align: right; }
kbd {
  font-family: var(--mono); font-size: .72rem; font-weight: 600; line-height: 1;
  padding: 4px 6px; border-radius: 5px; color: var(--text-2);
  background: var(--surface-2); border: 1px solid var(--border-strong); border-bottom-width: 2px;
}

/* ---------- Hướng dẫn ---------- */
.guide { padding-top: 56px; padding-bottom: 48px; }
.guide h2 { text-align: center; font-size: clamp(1.25rem, 1.5vw + .9rem, 1.6rem); font-weight: 800; letter-spacing: -.015em; margin-bottom: 20px; }
.guide-grid { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 600px) { .guide-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .guide-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.guide-item { padding: 18px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); }
.guide-ic { display: grid; place-items: center; width: 38px; height: 38px; margin-bottom: 12px; border-radius: 10px; background: var(--tint); color: var(--accent-text); }
.guide-item h3 { font-size: .98rem; font-weight: 700; }
.guide-item p { margin-top: 4px; font-size: .87rem; color: var(--text-2); }
.guide-item b { color: var(--text); font-weight: 600; }

.faq { max-width: 780px; margin: 48px auto 0; }
.faq details { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); }
.faq details + details { margin-top: 8px; }
.faq summary {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 16px; font-weight: 600; cursor: pointer; list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary:hover { color: var(--accent-text); }
.faq .chev { color: var(--text-3); transition: transform .2s; }
.faq details[open] .chev { transform: rotate(180deg); }
.faq details p { padding: 0 16px 16px; font-size: .92rem; color: var(--text-2); }

.privacy { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 24px; font-size: .85rem; color: var(--text-3); text-align: center; }
.privacy .ic { width: 16px; height: 16px; color: var(--accent-text); }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); padding: 18px 0 calc(18px + env(safe-area-inset-bottom)); }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 10px 20px; flex-wrap: wrap; font-size: .85rem; color: var(--text-3); }
.footer-brand { display: flex; align-items: center; gap: 10px; color: var(--text-2); text-decoration: none; }
.footer-brand img { border-radius: 7px; background: #fff; box-shadow: 0 0 0 1px var(--border); }
.footer-brand strong { color: var(--text); }

/* ---------- Hộp QR phóng to ---------- */
.qr-dialog {
  width: min(92vw, 360px); padding: 22px; border: 0; border-radius: 20px; text-align: center;
  background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg);
}
.qr-dialog::backdrop { background: rgba(6,20,16,.55); backdrop-filter: blur(3px); }
.qr-dialog h2 { font-size: 1.05rem; margin-bottom: 14px; }
.qr-dialog img { width: 100%; height: auto; padding: 10px; background: #fff; border-radius: var(--r); border: 1px solid var(--border); }
.qr-dialog p { margin-top: 12px; font-size: .88rem; color: var(--text-2); }
.qr-dialog form { position: absolute; top: 12px; right: 12px; margin: 0; }
.qr-close { width: 32px; height: 32px; }
.qr-close .ic { width: 16px; height: 16px; }

/* ---------- Thông báo ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); z-index: 50;
  max-width: calc(100vw - 32px); padding: 10px 18px; border-radius: 999px;
  background: var(--ink); color: #fff; font-size: .88rem; font-weight: 500; box-shadow: var(--shadow-lg);
  transform: translate(-50%, 16px); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
:root[data-theme="dark"] .toast { background: #e7f1ec; color: #0f2620; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .toast { background: #e7f1ec; color: #0f2620; } }

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

/* =========================================================
   Khối "Về ManhTool" + "Hợp tác" — dùng chung cho mọi công cụ
   ========================================================= */
.brand-section { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; padding-bottom: 48px; }
@media (min-width: 1024px) { .brand-section { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); align-items: stretch; } }

.brand-card {
  display: flex; align-items: center; gap: 28px; padding: 28px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow);
}
.brand-logo {
  width: 150px; height: 150px; flex: none; object-fit: contain;
  border-radius: 24px; background: #fff; border: 1px solid #e8ece9;
  box-shadow: 0 12px 30px -12px rgba(14,124,90,.45);
}
.eyebrow { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; font-weight: 700; color: var(--accent-text); margin-bottom: 8px; }
.eyebrow .ic { width: 15px; height: 15px; }
.brand-body h2 { font-size: 1.3rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.25; margin-bottom: 6px; }
.brand-slogan { font-weight: 700; font-size: 1.02rem; margin-bottom: 10px; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand-body p:not(.brand-slogan) { color: var(--text-2); margin-bottom: 16px; }
.brand-body b { color: var(--text); }

.hire-card {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; gap: 12px; padding: 26px;
  border-radius: var(--r-lg); color: #fff;
  background:
    radial-gradient(420px 220px at 100% 0%, rgba(101,199,40,.28), transparent 70%),
    radial-gradient(360px 200px at 0% 100%, rgba(15,159,110,.3), transparent 70%),
    linear-gradient(160deg, #10241c, #0c1712);
  border: 1px solid rgba(255,255,255,.06);
}
.hire-label { align-self: flex-start; padding: 4px 11px; border-radius: 999px; background: rgba(101,199,40,.16); color: #a6e77a; font-size: .75rem; font-weight: 700; letter-spacing: .02em; }
.hire-card h2 { font-size: 1.3rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.3; }
.hire-card > p { color: rgba(255,255,255,.75); }
.hire-services { list-style: none; margin: 2px 0; padding: 0; display: flex; flex-direction: column; gap: 7px; }
.hire-services li { display: flex; align-items: center; gap: 10px; font-size: .9rem; font-weight: 500; }
.hire-services .ic { width: 16px; height: 16px; color: #7ddc4a; }
.hire-phone {
  display: flex; align-items: center; gap: 14px; margin-top: 4px; padding: 14px 16px;
  border-radius: 14px; color: #fff; text-decoration: none;
  background: linear-gradient(135deg, #12b886, #4fb52a);
  box-shadow: 0 14px 30px -12px rgba(79,181,42,.65);
  transition: transform .15s, box-shadow .15s;
}
.hire-phone:hover { transform: translateY(-2px); box-shadow: 0 18px 34px -12px rgba(79,181,42,.8); }
.hp-ico { width: 44px; height: 44px; flex: none; display: grid; place-items: center; border-radius: 50%; background: rgba(255,255,255,.2); }
.hp-ico .ic { width: 20px; height: 20px; animation: ring 2.6s ease-in-out infinite; }
@keyframes ring { 0%, 70%, 100% { transform: rotate(0); } 75% { transform: rotate(-14deg); } 80% { transform: rotate(12deg); } 85% { transform: rotate(-8deg); } 90% { transform: rotate(6deg); } }
.hire-phone small { display: block; font-size: .75rem; opacity: .85; font-weight: 600; }
.hire-phone b { display: block; font-size: 1.45rem; font-weight: 800; letter-spacing: .02em; line-height: 1.2; font-variant-numeric: tabular-nums; }
.hire-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.btn-ghost-light {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 38px; padding: 0 14px; border-radius: var(--r-sm); cursor: pointer;
  font-size: .86rem; font-weight: 600; color: #fff; text-decoration: none;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.16);
  transition: background .15s;
}
.btn-ghost-light .ic { width: 16px; height: 16px; }
.btn-ghost-light:hover { background: rgba(255,255,255,.12); }
.hire-tags { font-size: .78rem; color: rgba(255,255,255,.55); margin-top: auto; padding-top: 4px; }

@media (max-width: 767px) {
  .brand-card, .hire-card { padding: 20px 16px; }
}
@media (max-width: 560px) {
  .brand-card { flex-direction: column; text-align: center; gap: 16px; }
  .brand-logo { width: 120px; height: 120px; }
  .hire-actions .btn-ghost-light { flex: 1 1 auto; }
}

/* =========================================================
   Riêng cho công cụ Tạo thẻ meta SEO
   ========================================================= */

/* Điện thoại / máy tính bảng: trải phẳng 2 cột để sắp lại thứ tự
   (biểu mẫu → xem trước → kiểm tra SEO → mã → ủng hộ) */
@media (max-width: 1023px) {
  .main-col, .side { display: contents; }
  .tool { order: 1; }
  .preview-card { order: 2; }
  .audit-card { order: 3; }
  .code-card { order: 4; }
  .donate { order: 5; }
  .shortcuts-card { order: 6; }
}

/* ---------- Đầu thẻ: nhóm + điểm ---------- */
@media (min-width: 768px) { .tool { padding: 24px; } }
.tool-head { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; }
.tabs {
  flex: 1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; padding: 4px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; min-width: 0;
}
.tab {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 12px;
  font-size: .9rem; font-weight: 600; color: var(--text-2); white-space: nowrap; cursor: pointer;
  background: none; border: 0; border-radius: 9px; transition: background .15s, color .15s;
}
.tab .ic { width: 17px; height: 17px; }
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] { background: var(--surface); color: var(--accent-text); box-shadow: 0 1px 3px rgba(15,38,32,.14); }

.score-pill {
  display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 12px; flex-shrink: 0;
  font-size: .84rem; font-weight: 600; color: var(--text-2); text-decoration: none; white-space: nowrap;
  border: 1px solid var(--border); border-radius: 999px; background: var(--surface);
}
.score-pill b { color: var(--text); font-variant-numeric: tabular-nums; font-size: .95rem; }
.score-pill:hover { border-color: var(--border-strong); color: var(--text); }
.score-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--danger); }
.score-pill.is-mid .score-dot { background: var(--warn); }
.score-pill.is-good .score-dot { background: var(--leaf); }
@media (min-width: 1024px) { .score-pill { display: none; } }
@media (max-width: 599px) {
  .tool-head { margin-bottom: 20px; }
  /* Điện thoại đã có điểm ở thanh dưới màn hình */
  .score-pill { display: none; }
}
@media (max-width: 400px) {
  .tab { padding: 0 6px; font-size: .84rem; }
  .tab .ic { display: none; }
}

/* ---------- Ô nhập ---------- */
.fields { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; }
@media (min-width: 640px) { .fields { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; } .span-2 { grid-column: 1 / -1; } }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label:not(.check-line), .field .label { font-size: .88rem; font-weight: 600; color: var(--text); }
.field small { font-weight: 400; color: var(--text-3); }
.label-row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.count { font-size: .78rem; color: var(--text-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.count b { color: var(--text-2); font-weight: 600; }

.input {
  width: 100%; min-width: 0; height: 44px; padding: 0 13px;
  font: inherit; font-size: .95rem; color: var(--text);
  background: var(--surface); border: 1.5px solid var(--border-strong); border-radius: var(--r-sm);
  transition: border-color .15s, box-shadow .15s;
}
textarea.input { height: auto; min-height: 76px; padding: 10px 13px; line-height: 1.55; resize: vertical; }
select.input {
  appearance: none; -webkit-appearance: none; padding-right: 36px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236f7f79' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center; background-size: 16px;
}
.input::placeholder { color: var(--text-3); opacity: .85; }
.input:hover { border-color: color-mix(in srgb, var(--brand-500) 45%, var(--border-strong)); }
.input:focus { outline: none; border-color: var(--brand-500); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand-500) 15%, transparent); }
.field.is-flash .input { animation: flash 1.2s ease; }
@keyframes flash { 0%, 60% { box-shadow: 0 0 0 5px color-mix(in srgb, var(--warn) 35%, transparent); } }
/* iOS tự phóng to khi chữ trong ô < 16px */
@media (max-width: 599px) { .input { font-size: 16px; } }

.hint { font-size: .8rem; color: var(--text-3); }

/* Thanh đo độ dài: chưa nhập thì hiện gợi ý, đã nhập thì hiện thanh + trạng thái */
.meter { display: flex; align-items: center; gap: 12px; min-height: 20px; margin-top: 2px; }
.meter .bar { flex: 1; height: 4px; margin: 0; box-shadow: none; background: var(--border); }
.meter em { display: inline-flex; align-items: center; gap: 8px; font-style: normal; font-size: .78rem; font-weight: 600; color: var(--text-3); white-space: nowrap; }
.meter-hint { font-size: .8rem; color: var(--text-3); }
.meter:not(.has-value) .bar, .meter:not(.has-value) em, .meter.has-value .meter-hint { display: none; }
.bar { height: 6px; border-radius: 999px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--border); overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--grad); transition: width .25s ease; }
.is-short .bar i { background: color-mix(in srgb, var(--brand-500) 55%, var(--border-strong)); }
.is-good em { color: var(--accent-text); }
.is-over em { color: var(--danger); }
.is-over .bar i { background: var(--danger); }

.switches { display: flex; flex-wrap: wrap; gap: 4px 28px; }
.check-line { margin-top: 0; padding: 6px 0; font-size: .9rem; color: var(--text); }

/* Khối gom các công tắc */
.opt-box { gap: 8px; padding: 14px 16px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r); }
.opt-box > .label { font-size: .76rem !important; font-weight: 700 !important; letter-spacing: .05em; text-transform: uppercase; color: var(--text-3) !important; }
@media (min-width: 640px) { .opt-box .switches { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1180px) { .opt-box .switches { grid-template-columns: repeat(3, auto); justify-content: start; } }

.subfields { margin: 0; padding: 16px; border: 1px dashed var(--border-strong); border-radius: var(--r); display: grid; gap: 16px; min-width: 0; }
.subfields legend { padding: 0 6px; font-size: .78rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--text-3); }
@media (max-width: 479px) { .subfields { padding: 14px 12px; } }

.pair { display: flex; align-items: center; gap: 8px; }
.pair span { color: var(--text-3); }
.pair .input { font-variant-numeric: tabular-nums; }

.color-input { display: flex; gap: 8px; }
.color-input input[type="color"] {
  flex: none; width: 44px; height: 44px; padding: 4px; cursor: pointer;
  background: var(--surface); border: 1.5px solid var(--border-strong); border-radius: var(--r-sm);
}
.color-input input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.color-input input[type="color"]::-webkit-color-swatch { border: 0; border-radius: 5px; }
.color-input input[type="color"]::-moz-color-swatch { border: 0; border-radius: 5px; }

.img-status { display: flex; align-items: center; gap: 6px; font-size: .8rem; color: var(--text-3); }
.img-status .ic { width: 15px; height: 15px; }
.img-status.ok { color: var(--accent-text); }
.img-status.warn { color: var(--warn); }
.img-status.bad { color: var(--danger); }

.toolbar { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); }
#btnCopy { min-width: 150px; }
@media (max-width: 559px) { .toolbar { padding-top: 12px; } }

/* ---------- Xem trước ---------- */
.pv-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.seg-icon span { display: grid; place-items: center; padding: 5px 10px; }
.seg-icon .ic { width: 16px; height: 16px; }
@media (max-width: 400px) { .pv-bar .seg:first-child span { padding: 5px 10px; } }

.pv-stage {
  --g-title: #1a0dab; --g-text: #4d5156; --g-name: #202124; --g-url: #4d5156; --g-bg: #fff;
  --fb-bg: #f0f2f5; --fb-text: #050505; --fb-sub: #65676b;
  --zl-bg: #e5efff; --zl-card: #fff; --zl-link: #0068ff;
  --x-border: #cfd9de; --x-sub: #536471; --x-text: #0f1419;
  padding: 20px; border-radius: var(--r); background: var(--surface-2); border: 1px solid var(--border);
  overflow: hidden;
}
:root[data-theme="dark"] .pv-stage {
  --g-title: #99c3ff; --g-text: #bdc1c6; --g-name: #dadce0; --g-url: #bdc1c6; --g-bg: #1f1f1f;
  --fb-bg: #3a3b3c; --fb-text: #e4e6eb; --fb-sub: #b0b3b8;
  --zl-bg: #1e3a5f; --zl-card: #22262b; --zl-link: #6aa8ff;
  --x-border: #2f3336; --x-sub: #71767b; --x-text: #e7e9ea;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .pv-stage {
    --g-title: #99c3ff; --g-text: #bdc1c6; --g-name: #dadce0; --g-url: #bdc1c6; --g-bg: #1f1f1f;
    --fb-bg: #3a3b3c; --fb-text: #e4e6eb; --fb-sub: #b0b3b8;
    --zl-bg: #1e3a5f; --zl-card: #22262b; --zl-link: #6aa8ff;
    --x-border: #2f3336; --x-sub: #71767b; --x-text: #e7e9ea;
  }
}
@media (max-width: 479px) { .pv-stage { padding: 12px; } }
.pv { margin: 0 auto; font-family: Arial, "Helvetica Neue", sans-serif; }

/* Google */
.pv-google { max-width: 600px; padding: 16px 18px; background: var(--g-bg); border-radius: 12px; box-shadow: var(--shadow); }
.pv-google.is-mobile { max-width: 380px; }
.g-top { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; min-width: 0; }
.g-fav {
  width: 28px; height: 28px; flex: none; display: grid; place-items: center; overflow: hidden;
  border-radius: 50%; background: #f1f3f4; border: 1px solid #dadce0; font-size: 13px; font-weight: 700; color: #5f6368;
}
.g-fav img { width: 18px; height: 18px; object-fit: contain; }
.g-site { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.g-name { font-size: 14px; color: var(--g-name); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-url { font-size: 12px; color: var(--g-url); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-title { font-size: 20px; line-height: 26px; color: var(--g-title); margin-bottom: 3px; overflow-wrap: anywhere; }
.is-mobile .g-title { font-size: 18px; line-height: 24px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.g-desc { font-size: 14px; line-height: 22px; color: var(--g-text); overflow-wrap: anywhere; }
.is-mobile .g-desc { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.g-date { color: #70757a; }
.g-date::after { content: " — "; }
.pv-empty { opacity: .55; font-style: italic; }
@media (max-width: 479px) { .g-title { font-size: 18px; line-height: 24px; } .pv-google { padding: 14px; } }

/* Ảnh chung cho các bản xem trước mạng xã hội */
.pv-img { position: relative; aspect-ratio: 1.91 / 1; background: var(--tint); overflow: hidden; }
.pv-img img { width: 100%; height: 100%; object-fit: cover; }
.pv-img .ph {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font); font-size: .84rem; font-weight: 500; color: var(--accent-text); text-align: center; padding: 12px;
  background:
    radial-gradient(300px 160px at 85% 0%, rgba(196,228,58,.25), transparent 70%),
    radial-gradient(300px 160px at 0% 100%, rgba(18,184,134,.22), transparent 70%), var(--tint);
}
.pv-img .ph .ic { width: 30px; height: 30px; stroke-width: 1.6; }
.pv-img .ph.is-error { color: var(--danger); }

/* Facebook */
.pv-fb { max-width: 500px; overflow: hidden; border-radius: 8px; background: var(--fb-bg); box-shadow: var(--shadow); }
.fb-body { padding: 10px 14px 12px; }
.fb-domain { font-size: 12px; color: var(--fb-sub); text-transform: uppercase; letter-spacing: .02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fb-title { margin-top: 3px; font-size: 16px; font-weight: 700; line-height: 1.3; color: var(--fb-text); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.fb-desc { margin-top: 2px; font-size: 14px; line-height: 1.35; color: var(--fb-sub); display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }

/* Zalo */
.pv-zalo { max-width: 360px; }
.zl-bubble { padding: 10px; border-radius: 14px 14px 4px 14px; background: var(--zl-bg); box-shadow: var(--shadow); }
.zl-link { padding: 0 4px 8px; font-size: 14px; color: var(--zl-link); overflow-wrap: anywhere; text-decoration: underline; text-underline-offset: 2px; }
.zl-card { overflow: hidden; border-radius: 10px; background: var(--zl-card); }
.zl-body { padding: 10px 12px 12px; }
.zl-title { font-size: 15px; font-weight: 700; line-height: 1.35; color: var(--fb-text); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.zl-desc { margin-top: 3px; font-size: 13px; line-height: 1.4; color: var(--fb-sub); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.zl-domain { margin-top: 6px; font-size: 12px; color: var(--fb-sub); opacity: .85; }

/* X */
.pv-x { max-width: 500px; }
.x-card { overflow: hidden; border: 1px solid var(--x-border); border-radius: 16px; background: var(--g-bg); }
.x-overlay {
  position: absolute; left: 12px; bottom: 12px; max-width: calc(100% - 24px);
  padding: 2px 6px; border-radius: 4px; font-size: 13px; color: #fff; background: rgba(0,0,0,.77);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.x-overlay:empty { display: none; }
.x-body { display: none; padding: 10px 14px; font-size: 15px; line-height: 1.3; min-width: 0; }
.x-domain { color: var(--x-sub); font-size: 14px; }
.x-title { color: var(--x-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.x-desc { color: var(--x-sub); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.x-from { margin-top: 4px; font-size: 13px; color: var(--x-sub); }
/* Thẻ ảnh nhỏ */
.x-card.is-small { display: flex; align-items: stretch; }
.x-card.is-small .pv-img { flex: none; width: 130px; aspect-ratio: 1; border-right: 1px solid var(--x-border); }
.x-card.is-small .pv-img .ph span { display: none; }
.x-card.is-small .x-overlay { display: none; }
.x-card.is-small .x-body { display: flex; flex-direction: column; justify-content: center; gap: 2px; }
.x-card.is-small + .x-from { display: none; }
@media (max-width: 400px) { .x-card.is-small .pv-img { width: 96px; } }

.fine-print { margin-top: 12px; font-size: .78rem; color: var(--text-3); }

/* ---------- Mã HTML ---------- */
.code-card .sub-head { flex-wrap: wrap; }
.code-card .sub-head > div:nth-child(2) { flex: 1; min-width: 0; }
.code-actions { display: flex; gap: 4px; margin-left: auto; }
.mini-primary { color: var(--accent-text); background: var(--tint); }
.mini-primary:hover { background: color-mix(in srgb, var(--brand-500) 18%, var(--tint)); }
@media (max-width: 479px) {
  .code-actions { width: 100%; margin-left: 0; }
  .code-actions .mini-btn { flex: 1; justify-content: center; height: 40px; border: 1px solid var(--border); }
}
.code {
  margin: 0; padding: 16px 18px; max-height: 520px; overflow: auto;
  font-family: var(--mono); font-size: .82rem; line-height: 1.7; tab-size: 2; font-variant-ligatures: none;
  white-space: pre-wrap; overflow-wrap: anywhere;
  color: #d7e4de; background: #0f1d18; border-radius: var(--r); border: 1px solid #1d2f28;
}
.code .t-c { color: #7c9a8e; font-style: italic; }
.code .t-tag { color: #6ee7b7; }
.code .t-attr { color: #c4e43a; }
.code .t-val { color: #fcd9a8; }
.code .t-key { color: #93c5fd; }
@media (max-width: 479px) { .code { padding: 12px; font-size: .78rem; max-height: 420px; } }

/* ---------- Kiểm tra SEO ---------- */
.audit-card .side-head { margin-bottom: 4px; }
.ring { position: relative; width: 52px; height: 52px; flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 4.5; }
.ring-bg { stroke: var(--surface-2); }
.ring-fg { stroke: var(--danger); stroke-linecap: round; stroke-dasharray: 119.4; stroke-dashoffset: 119.4; transition: stroke-dashoffset .4s ease, stroke .3s; }
.ring.is-mid .ring-fg { stroke: var(--warn); }
.ring.is-good .ring-fg { stroke: var(--brand-500); }
.ring b { position: absolute; inset: 0; display: grid; place-items: center; font-size: 1rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.checks { list-style: none; margin: 10px 0 0; padding: 0; }
.checks li + li { border-top: 1px solid var(--border); }
.check {
  display: flex; align-items: flex-start; gap: 9px; padding: 8px 6px; margin: 0 -6px; width: calc(100% + 12px);
  font-size: .85rem; line-height: 1.45; text-align: left; color: var(--text-2);
  background: none; border: 0; border-radius: 8px; cursor: pointer;
}
.check:hover { background: var(--tint); color: var(--text); }
.check .ic { width: 17px; height: 17px; margin-top: 1px; }
.check.ok .ic { color: var(--leaf); }
.check.warn .ic { color: var(--warn); }
.check.bad .ic { color: var(--danger); }
.check.info .ic { color: var(--text-3); }
.check.bad { color: var(--text); font-weight: 500; }

/* ---------- Hộp lấy từ HTML ---------- */
.import-dialog {
  width: min(94vw, 620px); padding: 24px; border: 0; border-radius: 20px;
  background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg);
}
.import-dialog::backdrop { background: rgba(6,20,16,.55); backdrop-filter: blur(3px); }
.import-dialog h2 { font-size: 1.1rem; font-weight: 700; padding-right: 40px; }
.dlg-sub { margin-top: 6px; font-size: .86rem; color: var(--text-2); }
.dlg-close { position: absolute; top: 14px; right: 14px; margin: 0; }
.dlg-close .icon-btn { width: 34px; height: 34px; }
.import-box { position: relative; margin-top: 14px; border: 1.5px solid var(--border-strong); border-radius: var(--r); overflow: hidden; }
.import-box:focus-within { border-color: var(--brand-500); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand-500) 15%, transparent); }
.import-box.dragover { border-color: var(--brand-500); border-style: dashed; }
.import-box.dragover::after {
  content: "Thả file vào đây"; position: absolute; inset: 0; display: grid; place-items: center;
  font-weight: 700; color: var(--accent-text); background: color-mix(in srgb, var(--tint) 90%, transparent);
}
#importText {
  display: block; width: 100%; height: 240px; padding: 12px 14px; border: 0; outline: none; resize: vertical;
  font-family: var(--mono); font-size: .82rem; line-height: 1.6; color: var(--text); background: var(--surface);
}
.dlg-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
@media (max-width: 479px) {
  .import-dialog { padding: 18px 16px; }
  #importText { height: 200px; font-size: 16px; }
  .dlg-actions > * { flex: 1; }
}

code { font-family: var(--mono); font-size: .88em; padding: 1px 5px; border-radius: 5px; background: var(--surface-2); }
.code code { padding: 0; background: none; font-size: inherit; }

/* ---------- Gợi ý & ghi chú dưới ô ---------- */
.suggest { align-self: flex-start; margin: -2px 0 0 -9px; font-weight: 600; }
.suggest::before { content: "+"; font-size: 1rem; line-height: 1; margin-right: 2px; }
.field-note { font-size: .8rem; color: var(--text-3); overflow-wrap: anywhere; }
.field-note.is-bad { color: var(--danger); }
.input.is-invalid { border-color: var(--danger); }
.input.is-invalid:focus { box-shadow: 0 0 0 4px color-mix(in srgb, var(--danger) 15%, transparent); }
@media (hover: none) { .kbd-hint { display: none; } }

/* ---------- Thanh thao tác dính dưới màn hình (< 1024px) ---------- */
.mobile-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--border); box-shadow: 0 -8px 24px rgba(15,38,32,.08);
  transform: translateY(110%); transition: transform .25s ease; visibility: hidden;
}
.mobile-bar.show { transform: none; visibility: visible; }
.mobile-bar .btn-primary { flex: 1; height: 46px; max-width: 420px; margin-left: auto; }
.mobile-bar .btn-primary .ic-check { display: none; }
.mobile-bar .btn-primary.is-done { background: var(--leaf); }
.mobile-bar .btn-primary.is-done .ic-copy { display: none; }
.mobile-bar .btn-primary.is-done .ic-check { display: block; }
.mb-score {
  display: inline-flex; align-items: center; gap: 7px; height: 46px; padding: 0 14px; flex-shrink: 0;
  font-size: .84rem; font-weight: 600; color: var(--text-2); text-decoration: none; white-space: nowrap;
  border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--surface);
}
.mb-score b { color: var(--text); font-size: 1rem; font-variant-numeric: tabular-nums; }
.mb-score.is-mid .score-dot { background: var(--warn); }
.mb-score.is-good .score-dot { background: var(--leaf); }
body.has-bar .toast { bottom: calc(84px + env(safe-area-inset-bottom)); }
@media (min-width: 1024px) { .mobile-bar { display: none; } }

/* ---------- Lời mời tư vấn ở góc trái (chỉ máy tính, giống trang chủ) ---------- */
.nudge {
  position: fixed; left: 20px; bottom: 24px; z-index: 30; width: 320px; padding: 20px;
  background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 18px;
  box-shadow: 0 20px 50px -12px rgba(15,38,32,.28), 0 2px 6px rgba(15,38,32,.06);
  animation: nudge-in .35s ease-out;
}
.nudge[hidden] { display: none; }
@keyframes nudge-in { from { opacity: 0; transform: translateY(12px); } }
.nudge-close {
  position: absolute; top: 10px; right: 10px; display: grid; place-items: center; width: 30px; height: 30px; padding: 0;
  background: none; border: 0; border-radius: 8px; color: var(--text-3); cursor: pointer;
}
.nudge-close:hover { background: var(--surface-2); color: var(--text); }
.nudge-close .ic { width: 16px; height: 16px; }
.nudge-head { display: flex; align-items: center; gap: 12px; padding-right: 24px; }
.nudge-head img { width: 50px; height: 30px; object-fit: contain; flex: none; }
.nudge-head p { font-size: .95rem; font-weight: 700; line-height: 1.35; }
.nudge-text { margin-top: 8px; font-size: .88rem; line-height: 1.55; color: var(--text-2); }
.nudge-actions { display: flex; gap: 8px; margin-top: 16px; }
.nudge-actions .btn-primary { flex: 1; height: 42px; padding: 0 12px; background: linear-gradient(135deg, var(--brand-700), var(--brand-500)); }
.nudge-actions .btn-primary:hover { background: linear-gradient(135deg, var(--brand-800), var(--brand-700)); }
:root[data-theme="dark"] .nudge-actions .btn-primary { color: #fff; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .nudge-actions .btn-primary { color: #fff; } }
.nudge-actions .btn-ghost { height: 42px; padding: 0 14px; }
.nudge-actions .btn-ghost .ic { width: 16px; height: 16px; }
/* Điện thoại và máy tính bảng đã có thanh Sao chép mã ở cuối màn hình */
@media (max-width: 1023px) { .nudge { display: none !important; } }
@media (prefers-reduced-motion: reduce) { .nudge { animation: none; } }
