/* =========================================================
   ManhTool — Tạo mật khẩu mạnh
   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;
  --border: #e1ebe5;
  --border-strong: #cddcd3;
  --text: #13241f;
  --text-2: #4a5a55;
  --text-3: #6f7f79;
  --primary: #0e7c5a;
  --primary-hover: #0a5c44;
  --on-primary: #ffffff;
  --accent-text: #0e7c5a;
  --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);

  /* Màu ký tự trong mật khẩu */
  --c-digit: #0b6bcb;
  --c-symbol: #c2410c;
  /* 5 mức độ mạnh */
  --s0: #dc2626; --s1: #ea580c; --s2: #d4a106; --s3: #12b886; --s4: #0e7c5a;
  --meter-off: #e3ebe6;

  --r-lg: 18px;
  --r: 12px;
  --r-sm: 9px;
  --font: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains 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;
    --danger: #fb923c; --danger-bg: #2a1a10;
    --c-digit: #6cb6ff; --c-symbol: #fb923c;
    --s0: #f87171; --s1: #fb923c; --s2: #facc15; --s3: #34d399; --s4: #a3e635;
    --meter-off: #23362f;
    --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;
  --danger: #fb923c; --danger-bg: #2a1a10;
  --c-digit: #6cb6ff; --c-symbol: #fb923c;
  --s0: #f87171; --s1: #fb923c; --s2: #facc15; --s3: #34d399; --s4: #a3e635;
  --meter-off: #23362f;
  --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); position: relative;
}
body::before {
  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, input { font: inherit; color: inherit; }
h1, h2, h3, p { margin: 0; }
[hidden] { display: none !important; }

.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; }
#generator:focus { outline: none; }

.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: 36px; padding-bottom: 24px; }
.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: 22px; padding-bottom: 16px; } }

/* ---------- 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); }

/* ---------- Công cụ ---------- */
.tool { padding: 14px; }
@media (min-width: 768px) { .tool { padding: 20px; } }

/* Ô hiển thị mật khẩu */
.output-box {
  padding: 14px 16px 14px; border-radius: var(--r);
  background: var(--surface-2); border: 1.5px solid var(--border);
  transition: border-color .2s, box-shadow .2s;
}
.output-box.flash { animation: flash .5s ease; }
@keyframes flash { 40% { border-color: var(--brand-500); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand-500) 18%, transparent); } }
.output-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.output-label { font-size: .8rem; font-weight: 600; color: var(--text-3); }

.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;
}
.mini-btn:hover { background: var(--tint); color: var(--accent-text); }
.mini-btn .ic { width: 16px; height: 16px; }
.mini-btn .ic-eye { display: none; }
.mini-btn[aria-pressed="true"] .ic-eye { display: block; }
.mini-btn[aria-pressed="true"] .ic-eye-off { display: none; }

.pw-out {
  margin: 6px 0 12px; min-height: 3.6rem; display: flex; align-items: center;
  font-family: var(--mono); font-weight: 600; font-size: 1.6rem; line-height: 1.35;
  letter-spacing: .02em; color: var(--text); overflow-wrap: anywhere; word-break: break-all;
  user-select: all; -webkit-user-select: all; cursor: text; border-radius: 6px;
}
.pw-out > span { display: block; width: 100%; }
.pw-out.size-m { font-size: 1.3rem; }
.pw-out.size-s { font-size: 1.05rem; }
.pw-out.size-xs { font-size: .9rem; letter-spacing: 0; }
.pw-out.masked { letter-spacing: .12em; color: var(--text-2); user-select: none; -webkit-user-select: none; }
.pw-out.error { font-family: var(--font); font-size: 1rem; font-weight: 600; color: var(--danger); letter-spacing: 0; user-select: none; }
.cd { color: var(--c-digit); }
.cs { color: var(--c-symbol); }
@media (max-width: 559px) {
  .pw-out { font-size: 1.3rem; }
  .pw-out.size-m { font-size: 1.1rem; }
  .pw-out.size-s { font-size: .95rem; }
  .pw-out.size-xs { font-size: .82rem; }
}

/* Thanh độ mạnh */
.strength { display: grid; gap: 8px; }
.meter { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; }
.meter i { height: 6px; border-radius: 99px; background: var(--meter-off); transition: background .25s; }
.strength[data-score="0"] .meter i:nth-child(-n+1),
.strength[data-score="1"] .meter i:nth-child(-n+2),
.strength[data-score="2"] .meter i:nth-child(-n+3),
.strength[data-score="3"] .meter i:nth-child(-n+4),
.strength[data-score="4"] .meter i:nth-child(-n+5) { background: var(--s-color); }
.strength[data-score="0"] { --s-color: var(--s0); }
.strength[data-score="1"] { --s-color: var(--s1); }
.strength[data-score="2"] { --s-color: var(--s2); }
.strength[data-score="3"] { --s-color: var(--s3); }
.strength[data-score="4"] { --s-color: var(--s4); }
.strength-text { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; font-size: .84rem; color: var(--text-2); }
.strength-name { color: var(--s-color, var(--text-3)); font-weight: 700; }
.strength-bits { font-variant-numeric: tabular-nums; color: var(--text-3); }
.strength-time b { color: var(--text); font-weight: 600; }
.strength-bits:empty, .strength-time:empty { display: none; }

.tip { position: relative; display: inline-grid; place-items: center; width: 24px; height: 24px; padding: 0; border: 0; background: none; color: var(--text-3); cursor: help; border-radius: 50%; }
.tip .ic { width: 15px; height: 15px; }
.tip:hover, .tip:focus-visible { color: var(--accent-text); }
.tip-box {
  position: absolute; z-index: 10; bottom: calc(100% + 8px); right: -8px; width: min(270px, 78vw);
  padding: 10px 12px; border-radius: 10px; text-align: left;
  font-size: .8rem; font-weight: 400; line-height: 1.5; color: #fff; background: var(--ink);
  box-shadow: var(--shadow-lg); opacity: 0; visibility: hidden; transform: translateY(4px); transition: opacity .15s, transform .15s;
}
.tip:hover .tip-box, .tip:focus .tip-box { opacity: 1; visibility: visible; transform: none; }
:root[data-theme="dark"] .tip-box { background: #e7f1ec; color: #0f2620; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tip-box { background: #e7f1ec; color: #0f2620; } }

/* Nút chính */
.gen-actions { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 10px; margin-top: 12px; }
.btn-primary, .btn-ghost {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 46px; padding: 0 20px; border-radius: var(--r-sm); cursor: pointer;
  font-size: .95rem; font-weight: 600; text-decoration: none; white-space: nowrap;
  transition: background .15s, transform .1s, border-color .15s, 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-primary:disabled { opacity: .5; cursor: default; transform: none; }
.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); }
@media (max-width: 479px) {
  .gen-actions { grid-template-columns: 50px minmax(0, 1fr); }
  #btnRegen { padding: 0; }
  #btnRegen span { display: none; }
}
#btnRegen .ic { transition: transform .35s; }
#btnRegen.spin .ic { transform: rotate(180deg); }
#btnCopy .ic-check { display: none; }
#btnCopy.is-done { background: var(--leaf); color: #fff; }
#btnCopy.is-done .ic-copy { display: none; }
#btnCopy.is-done .ic-check { display: block; }

/* Thẻ chọn kiểu */
.tabs {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; margin: 18px 0 16px;
  padding: 4px; border-radius: var(--r); background: var(--surface-2); border: 1px solid var(--border);
}
.tab {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 40px; padding: 4px 8px;
  border: 0; border-radius: 9px; background: transparent; cursor: pointer;
  font-size: .9rem; font-weight: 600; color: var(--text-2); transition: background .15s, color .15s;
}
.tab .ic { width: 16px; height: 16px; }
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] { background: var(--surface); color: var(--accent-text); box-shadow: 0 1px 2px rgba(15,38,32,.08), 0 0 0 1px var(--border); }
@media (max-width: 479px) {
  .tab { flex-direction: column; gap: 2px; font-size: .78rem; line-height: 1.25; padding: 6px 4px; text-align: center; }
}

/* Trường cài đặt */
.panel { display: grid; gap: 18px; }
.field { margin: 0; padding: 0; border: 0; min-width: 0; }
.field legend, .field-head label, .bulk-form > label, .exclude-row label { font-size: .9rem; font-weight: 600; color: var(--text); padding: 0; }
.field legend { margin-bottom: 10px; }
.field-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }

.stepper { display: inline-flex; align-items: center; border: 1px solid var(--border-strong); border-radius: var(--r-sm); background: var(--surface); overflow: hidden; }
.stepper:focus-within { border-color: var(--brand-500); }
.step-btn { display: grid; place-items: center; width: 36px; height: 38px; padding: 0; border: 0; background: transparent; color: var(--text-2); cursor: pointer; }
.step-btn:hover { background: var(--tint); color: var(--accent-text); }
.step-btn .ic { width: 16px; height: 16px; }
.stepper input {
  width: 52px; height: 38px; border: 0; border-inline: 1px solid var(--border); text-align: center; background: transparent;
  font-weight: 700; font-variant-numeric: tabular-nums; outline: none; -moz-appearance: textfield; appearance: textfield;
}
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* Thanh trượt */
.range {
  --p: 50%;
  width: 100%; height: 28px; margin: 0; background: transparent; cursor: pointer;
  -webkit-appearance: none; appearance: none;
}
.range::-webkit-slider-runnable-track {
  height: 6px; border-radius: 99px;
  background: linear-gradient(90deg, var(--brand-500) var(--p), var(--meter-off) var(--p));
}
.range::-moz-range-track { height: 6px; border-radius: 99px; background: var(--meter-off); }
.range::-moz-range-progress { height: 6px; border-radius: 99px; background: var(--brand-500); }
.range::-webkit-slider-thumb {
  -webkit-appearance: none; width: 22px; height: 22px; margin-top: -8px; border-radius: 50%;
  background: #fff; border: 2px solid var(--brand-500); box-shadow: 0 2px 6px rgba(15,38,32,.25);
}
.range::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 2px solid var(--brand-500); box-shadow: 0 2px 6px rgba(15,38,32,.25); }
.range:focus-visible { outline: none; }
.range:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 5px color-mix(in srgb, var(--brand-500) 25%, transparent); }
.range:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 5px color-mix(in srgb, var(--brand-500) 25%, transparent); }

.presets { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; margin-top: 8px; }
.preset {
  min-width: 0; height: 34px; padding: 0 4px; border-radius: 8px; cursor: pointer;
  font-size: .85rem; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--text-2);
  background: var(--surface); border: 1px solid var(--border);
}
.preset:hover { border-color: var(--border-strong); color: var(--text); }
.preset.is-active { background: var(--tint); border-color: var(--brand-500); color: var(--accent-text); }

/* 4 ô chọn loại ký tự */
.opt-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
@media (min-width: 640px) { .opt-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.opt {
  position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 10px;
  align-items: center; padding: 11px 12px; border-radius: var(--r); cursor: pointer; user-select: none;
  background: var(--surface); border: 1.5px solid var(--border); transition: background .15s, border-color .15s;
}
.opt:hover { border-color: var(--border-strong); }
.opt input, .check input, .seg-chip input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.opt-box, .check-box {
  grid-row: 1 / 3; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 7px;
  border: 1.5px solid var(--border-strong); background: var(--surface); color: transparent; transition: background .15s, border-color .15s;
}
.opt-box .ic, .check-box .ic { width: 14px; height: 14px; stroke-width: 3; }
.opt-sample { font-family: var(--mono); font-weight: 600; font-size: .95rem; color: var(--text); line-height: 1.2; }
.opt-name { font-size: .78rem; color: var(--text-3); line-height: 1.3; }
.opt:has(input:checked) { background: var(--tint); border-color: var(--brand-500); }
.opt input:checked ~ .opt-box, .check input:checked ~ .check-box { background: var(--brand-500); border-color: var(--brand-500); color: #fff; }
.opt input:focus-visible ~ .opt-box, .check input:focus-visible ~ .check-box { outline: 2px solid var(--brand-500); outline-offset: 2px; }
.opt.shake { animation: shake .35s; }
@keyframes shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }

/* Ô tích nhỏ */
.check { position: relative; display: flex; align-items: flex-start; gap: 10px; cursor: pointer; font-size: .9rem; color: var(--text-2); line-height: 1.45; user-select: none; }
.check .check-box { flex: none; margin-top: 0; width: 20px; height: 20px; border-radius: 6px; }
.check:hover { color: var(--text); }
.check code, .seg-chip code, .more code {
  font-family: var(--mono); font-size: .8rem; padding: 1px 6px; border-radius: 5px;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); white-space: nowrap;
}
.check span:last-child { min-width: 0; }
.check span code { white-space: normal; word-spacing: .1em; }
.checks-row { display: grid; gap: 12px; }

/* Tùy chọn thêm */
.more { border: 1px solid var(--border); border-radius: var(--r); background: var(--surface); }
.more summary, .recent summary {
  display: flex; align-items: center; gap: 9px; padding: 12px 14px; cursor: pointer; list-style: none;
  font-size: .9rem; font-weight: 600; color: var(--text-2); border-radius: var(--r);
}
.more summary::-webkit-details-marker, .recent summary::-webkit-details-marker { display: none; }
.more summary:hover, .recent summary:hover { color: var(--accent-text); }
.more summary .ic { width: 16px; height: 16px; }
.chev { margin-left: auto; transition: transform .2s; }
details[open] > summary .chev { transform: rotate(180deg); }
.more-body { display: grid; gap: 12px; padding: 4px 14px 16px; }
.exclude-row { display: grid; gap: 6px; margin-top: 2px; }
.exclude-row label { font-size: .85rem; font-weight: 500; color: var(--text-2); }
.exclude-row input, .check-input input {
  width: 100%; height: 42px; padding: 0 12px; border-radius: var(--r-sm);
  border: 1.5px solid var(--border-strong); background: var(--surface); color: var(--text); outline: none;
  font-family: var(--mono); font-size: .95rem;
}
.exclude-row input:focus, .check-input input:focus { border-color: var(--brand-500); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand-500) 15%, transparent); }
.exclude-row input::placeholder, .check-input input::placeholder { font-family: var(--font); color: var(--text-3); }

/* Dấu ngăn cách */
.seg-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.seg-chip { position: relative; cursor: pointer; }
.seg-chip span {
  display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 13px; white-space: nowrap;
  font-size: .86rem; font-weight: 500; color: var(--text-2);
  background: var(--surface); border: 1px solid var(--border); border-radius: 999px; transition: background .15s, border-color .15s, color .15s;
}
.seg-chip:hover span { border-color: var(--border-strong); color: var(--text); }
.seg-chip input:checked + span { background: var(--tint); border-color: var(--brand-500); color: var(--accent-text); }
.seg-chip input:focus-visible + span { outline: 2px solid var(--brand-500); outline-offset: 2px; }
@media (max-width: 559px) {
  .seg-chips { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .seg-chip span { width: 100%; justify-content: center; padding: 0 6px; }
  .seg-chip:last-child { grid-column: 1 / -1; }
}

.panel-note { display: flex; gap: 8px; align-items: flex-start; font-size: .84rem; color: var(--text-3); line-height: 1.5; }
.panel-note .ic { width: 16px; height: 16px; margin-top: 2px; color: var(--accent-text); }

/* Danh sách mật khẩu (gần đây + hàng loạt) */
.recent { margin-top: 16px; border-top: 1px solid var(--border); padding-top: 6px; }
.recent summary { padding-left: 2px; padding-right: 2px; }
.recent summary .ic { width: 16px; height: 16px; }
.count { min-width: 22px; height: 20px; padding: 0 6px; display: inline-grid; place-items: center; border-radius: 99px; font-size: .74rem; background: var(--tint); color: var(--accent-text); }
.pw-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.pw-list li {
  display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 12px; min-width: 0;
  border-radius: var(--r-sm); background: var(--surface-2); border: 1px solid var(--border);
}
.pw-list .pw-text { flex: 1; min-width: 0; font-family: var(--mono); font-size: .88rem; font-weight: 500; overflow-wrap: anywhere; word-break: break-all; user-select: all; }
.pw-list .row-copy { flex: none; display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: var(--text-3); cursor: pointer; }
.pw-list .row-copy:hover { background: var(--tint); color: var(--accent-text); }
.pw-list .row-copy .ic { width: 16px; height: 16px; }
.pw-list .row-copy.is-done { color: var(--leaf); }
.numbered { counter-reset: n; }
.numbered li { counter-increment: n; }
.numbered li::before { content: counter(n); flex: none; min-width: 1.6em; font-size: .75rem; color: var(--text-3); font-variant-numeric: tabular-nums; }
.recent-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; font-size: .78rem; color: var(--text-3); }
.link-btn { display: inline-flex; align-items: center; gap: 5px; padding: 6px 8px; border: 0; border-radius: 7px; background: none; color: var(--text-2); font-size: .8rem; font-weight: 600; cursor: pointer; }
.link-btn .ic { width: 14px; height: 14px; }
.link-btn:hover { background: var(--danger-bg); color: var(--danger); }

/* ---------- Thẻ phụ: hàng loạt, kiểm tra ---------- */
.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); }

.bulk-form { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.bulk-form .stepper input { width: 60px; }
.bulk-form .btn-primary { margin-left: auto; height: 42px; }
.bulk-result { margin-top: 14px; }
.bulk-result .pw-list { max-height: 330px; overflow: auto; padding-right: 2px; }
.bulk-actions { display: flex; gap: 8px; margin-top: 12px; }
.bulk-actions .btn-ghost { height: 40px; padding: 0 14px; font-size: .88rem; }
.act-danger-btn { margin-left: auto; display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border-radius: var(--r-sm); border: 1px solid transparent; background: transparent; color: var(--text-3); cursor: pointer; }
.act-danger-btn:hover { background: var(--danger-bg); color: var(--danger); }
@media (max-width: 559px) {
  .bulk-form .btn-primary { flex: 1 1 100%; margin-left: 0; }
  .bulk-actions .btn-ghost { flex: 1 1 0; padding: 0 8px; }
}

.check-input { position: relative; }
.check-input input { height: 48px; padding-right: 48px; font-size: 1.02rem; }
.check-input .mini-btn { position: absolute; right: 6px; top: 8px; width: 34px; padding: 0; justify-content: center; }
.check-result { margin-top: 14px; display: grid; gap: 14px; }
.rules { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.rules li { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 11px 0 8px; border-radius: 99px; font-size: .8rem; font-weight: 500; color: var(--text-3); background: var(--surface-2); border: 1px solid var(--border); }
.rules .ic { width: 15px; height: 15px; }
.rules .ok { display: none; }
.rules li.met { color: var(--accent-text); background: var(--tint); border-color: color-mix(in srgb, var(--brand-500) 40%, transparent); }
.rules li.met .ok { display: block; }
.rules li.met .no { display: none; }
.advice { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.advice:empty { display: none; }
.advice li { display: flex; gap: 10px; align-items: flex-start; font-size: .88rem; line-height: 1.5; color: var(--text-2); }
.advice .ic { width: 17px; height: 17px; margin-top: 2px; }
.advice .warn .ic { color: var(--s1); }
.advice .tip-item .ic { color: var(--accent-text); }
.advice .good .ic { color: var(--leaf); }
.privacy-inline { display: flex; gap: 8px; align-items: flex-start; margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--border); font-size: .8rem; color: var(--text-3); }
.privacy-inline .ic { width: 15px; height: 15px; margin-top: 2px; color: var(--accent-text); }

/* ---------- 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 (min-width: 1024px) { .side { position: sticky; top: 80px; } }
@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;
}

/* ---------- Mẹo an toà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: 1000px) { .guide-grid { grid-template-columns: repeat(3, 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); }
.privacy { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 24px; font-size: .85rem; color: var(--text-3); text-align: center; text-wrap: balance; }
.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); }
.brand-body .btn-primary { height: 42px; font-size: .92rem; }

.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; }
}

/* Ô kiểm tra: đang che thì hiện icon mắt (bấm để xem), đang hiện thì icon mắt gạch */
#checkMask .ic-eye { display: block; }
#checkMask .ic-eye-off { display: none; }
#checkMask[aria-pressed="true"] .ic-eye { display: none; }
#checkMask[aria-pressed="true"] .ic-eye-off { display: block; }
@media (max-width: 379px) { .xs-hide { display: none; } }
