/* Bảng màu lấy từ logo ManhTool */
:root {
  --bg: #f5f7f6;
  --bg-2: #eef2f1;
  --card: #ffffff;
  --ink: #0f2526;        /* chữ "Manh" */
  --ink-2: #495d5c;      /* dòng tagline */
  --muted: #5f706f;
  --line: #e0e6e4;
  --brand: #027f55;      /* chữ "T" */
  --brand-dark: #02423e; /* bóng dải ruy băng */
  --brand-mid: #0ca874;
  --brand-soft: #ecf6f1;
  --lime: #61c02f;       /* chữ "l" */
  --lime-2: #99dc3c;
  --lime-soft: #f0f8e4;
  --lime-ink: #3f7d1a;
  --red: #c0392b;        /* Chủ nhật, mùng 1 – theo thói quen lịch Việt */
  --red-soft: #fbeceb;
  --on-brand: #ffffff;
  --radius: 10px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0c1617;
    --bg-2: #142223;
    --card: #111d1e;
    --ink: #e4eceb;
    --ink-2: #a6b7b5;
    --muted: #8a9c9a;
    --line: #233334;
    --brand: #2fbf84;
    --brand-dark: #0b5b44;
    --brand-mid: #0ca874;
    --brand-soft: #143529;
    --lime: #8fd14f;
    --lime-2: #99dc3c;
    --lime-soft: #1d2d16;
    --lime-ink: #a9dc6e;
    --red: #f07a6e;
    --red-soft: #351c1a;
    --on-brand: #04170f;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0c1617;
  --bg-2: #142223;
  --card: #111d1e;
  --ink: #e4eceb;
  --ink-2: #a6b7b5;
  --muted: #8a9c9a;
  --line: #233334;
  --brand: #2fbf84;
  --brand-dark: #0b5b44;
  --brand-mid: #0ca874;
  --brand-soft: #143529;
  --lime: #8fd14f;
  --lime-2: #99dc3c;
  --lime-soft: #1d2d16;
  --lime-ink: #a9dc6e;
  --red: #f07a6e;
  --red-soft: #351c1a;
  --on-brand: #04170f;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  margin: 0;
  font-family: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--brand); }
button, input, select { font: inherit; color: inherit; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 16px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--brand); color: var(--on-brand); padding: 8px 14px; border-radius: 6px; z-index: 100; }
.skip:focus { left: 8px; }

/* Thanh trên cùng */
.topbar { position: sticky; top: 0; z-index: 20; background: var(--card); border-bottom: 1px solid var(--line); }
.topbar-inner { display: flex; align-items: center; gap: 16px; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-size: 1.2rem; }
.brand img { border-radius: 6px; background: #fff; }
.brand b { font-weight: 800; }
.brand em { font-style: normal; font-weight: 800; color: var(--brand); }
.nav { display: flex; gap: 2px; margin-left: auto; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a { padding: 8px 12px; color: var(--ink-2); text-decoration: none; font-weight: 500; font-size: .93rem; white-space: nowrap; border-bottom: 2px solid transparent; }
.nav a:hover { color: var(--brand); border-bottom-color: var(--brand); }

.icon-btn {
  display: inline-grid; place-items: center; width: 38px; height: 38px; flex: none;
  border: 1px solid var(--line); background: var(--card); border-radius: 8px; cursor: pointer; color: var(--ink-2);
}
.icon-btn:hover { color: var(--brand); border-color: var(--brand); }
#themeBtn .i-moon { display: none; }
:root[data-theme="dark"] #themeBtn .i-sun { display: none; }
:root[data-theme="dark"] #themeBtn .i-moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) #themeBtn .i-sun { display: none; }
  :root:not([data-theme="light"]) #themeBtn .i-moon { display: block; }
}

/* Tiêu đề trang */
.hero { padding: 32px 0 20px; }
.hero h1 { margin: 0; font-size: clamp(1.6rem, 4vw, 2.3rem); line-height: 1.2; letter-spacing: -.01em; font-weight: 800; }
.hero h1 span { color: var(--brand); white-space: nowrap; }
.hero p { margin: 8px 0 0; color: var(--ink-2); max-width: 680px; }

/* Thẻ */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; min-width: 0; }
.card-h { margin: 0 0 14px; font-size: 1.15rem; font-weight: 700; }
.sub-h { margin: 20px 0 10px; font-size: .92rem; font-weight: 700; color: var(--ink-2); }
.eyebrow { margin: 0; font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--brand); }

.grid-top { display: grid; grid-template-columns: 1.25fr 1fr; gap: 20px; align-items: start; }
.grid-bottom { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 20px; align-items: start; }

/* Thẻ chi tiết ngày */
.day-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.day-title { margin: 2px 0 0; font-size: 1.12rem; font-weight: 700; }
.day-actions { display: flex; gap: 6px; align-items: center; }
.pill-btn { height: 38px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--brand); background: var(--card); color: var(--brand); font-weight: 600; cursor: pointer; }
.pill-btn:hover { background: var(--brand); color: var(--on-brand); }

.day-dual { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 18px; }
.dual { border-radius: 8px; padding: 14px 16px; display: flex; flex-direction: column; min-width: 0; }
.dual.solar { border: 1px solid var(--line); }
.dual.lunar { background: var(--brand); color: var(--on-brand); }
.dual-label { display: flex; align-items: center; gap: 8px; font-size: .78rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; opacity: .85; }
.dual.solar .dual-label { color: var(--muted); opacity: 1; }
.dual-num { font-size: clamp(3rem, 9vw, 4.2rem); font-weight: 800; line-height: 1.05; margin: 4px 0; font-variant-numeric: tabular-nums; }
.dual-sub { font-weight: 600; font-size: .96rem; }
.moon { width: 16px; height: 16px; stroke: none; }
.moon .dark { fill: currentColor; opacity: .28; }
.moon .lit { fill: currentColor; }

.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.tag { display: inline-flex; align-items: center; gap: 6px; font-size: .84rem; font-weight: 600; padding: 4px 10px; border-radius: 6px; border: 1px solid var(--line); color: var(--ink-2); }
.tag::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.tag.good { color: var(--brand); border-color: color-mix(in srgb, var(--brand) 35%, transparent); }
.tag.good::before { background: var(--lime); }
.tag.bad { color: var(--red); border-color: color-mix(in srgb, var(--red) 35%, transparent); }
.tag.bad::before { background: var(--red); }
.tag.hol { background: var(--lime-soft); border-color: transparent; color: var(--lime-ink); }
.tag.hol::before { background: var(--lime); }

.info { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; margin: 14px 0 0; }
.info div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.info dt { color: var(--muted); font-size: .9rem; }
.info dd { margin: 0; font-weight: 600; text-align: right; }

.hours { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
.hours li { border-radius: 6px; padding: 6px 4px; text-align: center; font-size: .8rem; border: 1px solid var(--line); color: var(--muted); }
.hours li b { display: block; font-size: .92rem; color: var(--ink-2); }
.hours li.good { background: var(--brand-soft); border-color: transparent; color: var(--brand); }
.hours li.good b { color: var(--brand); }
.hours li.now { box-shadow: inset 0 0 0 2px var(--lime); }

.row-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.ghost-btn { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 8px; border: 1px solid var(--line); background: transparent; cursor: pointer; font-weight: 600; font-size: .9rem; color: var(--ink-2); }
.ghost-btn:hover { border-color: var(--brand); color: var(--brand); }

/* Bộ chuyển đổi */
.tabs { display: flex; border-bottom: 1px solid var(--line); gap: 4px; }
.tabs button { border: 0; background: transparent; padding: 10px 14px; margin-bottom: -1px; font-weight: 600; cursor: pointer; color: var(--muted); border-bottom: 2px solid transparent; }
.tabs button:hover { color: var(--ink); }
.tabs button[aria-selected="true"] { color: var(--brand); border-bottom-color: var(--brand); }
.panel { padding-top: 16px; }
.conv-form { display: flex; flex-direction: column; gap: 12px; }
.fields { display: grid; gap: 10px; }
.fields.three { grid-template-columns: 1fr 1fr 1.3fr; }
.fields label { display: flex; flex-direction: column; gap: 6px; font-size: .85rem; font-weight: 600; color: var(--ink-2); min-width: 0; }
select, input[type="number"], input[type="text"], input[type="date"] {
  width: 100%; height: 44px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--card);
  font-size: 1rem; font-weight: 600; min-width: 0;
}
select:focus, input[type="number"]:focus, input[type="text"]:focus, input[type="date"]:focus { border-color: var(--brand); outline: none; box-shadow: 0 0 0 3px var(--brand-soft); }
input[aria-invalid="true"] { border-color: var(--red); }
.check { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; cursor: pointer; width: max-content; }
.check input { width: 18px; height: 18px; accent-color: var(--brand); }
.check.disabled { opacity: .45; cursor: not-allowed; }
.hint { margin: -4px 0 0; font-size: .86rem; color: var(--muted); min-height: 1.2em; }
.primary-btn { height: 46px; border-radius: 8px; border: 0; background: var(--brand); color: var(--on-brand); font-weight: 700; font-size: 1rem; cursor: pointer; }
.primary-btn:hover { background: var(--brand-dark); color: #fff; }

.result:empty { display: none; }
.result { margin-top: 14px; padding: 14px 16px; border-radius: 8px; border-left: 3px solid var(--brand); background: var(--brand-soft); }
.result.err { background: var(--red-soft); border-left-color: var(--red); color: var(--red); font-weight: 600; }
.result .big { font-size: 1.35rem; font-weight: 800; color: var(--ink); line-height: 1.3; }
.result .meta { margin: 6px 0 10px; color: var(--ink-2); font-size: .92rem; }
.result .link-btn { border: 0; background: none; padding: 0; color: var(--brand); font-weight: 700; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips button { border: 1px solid var(--line); background: var(--card); padding: 6px 12px; border-radius: 6px; font-size: .86rem; font-weight: 500; cursor: pointer; color: var(--ink-2); }
.chips button:hover { border-color: var(--brand); color: var(--brand); }

/* Ủng hộ */
.side { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.donate-card { border-top: 3px solid var(--lime); }
.donate-body { display: flex; gap: 18px; align-items: flex-start; }
.donate-text { flex: 1; min-width: 0; }
.donate-text .card-h { margin-bottom: 8px; }
.donate-text p { margin: 0 0 12px; color: var(--ink-2); font-size: .93rem; }
.donate-text p.muted { margin: 0; }
.donate-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.pill-btn.solid { display: inline-flex; align-items: center; gap: 6px; background: var(--brand); color: var(--on-brand); }
.pill-btn.solid:hover { background: var(--brand-dark); border-color: var(--brand-dark); color: #fff; }
a.ghost-btn { text-decoration: none; }
.qr-thumb { flex: none; padding: 6px; border: 1px solid var(--line); border-radius: 8px; background: #fff; cursor: zoom-in; }
.qr-thumb:hover { border-color: var(--brand); }
.qr-thumb img { width: 120px; height: auto; }
.donate-btn { display: inline-flex; align-items: center; gap: 6px; margin-left: 8px; }
.donate-btn svg { color: var(--red); }
.donate-btn:hover svg { color: inherit; }
.donate-dialog { border: 0; border-radius: 12px; padding: 28px 24px 22px; width: calc(100% - 32px); max-width: 380px; background: var(--card); color: var(--ink); text-align: center; }
.donate-dialog::backdrop { background: rgba(6, 18, 16, .55); }
.donate-dialog h2 { margin: 0 0 6px; font-size: 1.2rem; }
.donate-dialog p { margin: 0 0 8px; color: var(--ink-2); font-size: .93rem; }
.donate-dialog img { width: 240px; max-width: 100%; height: auto; margin: 12px auto 14px; padding: 8px; background: #fff; border: 1px solid var(--line); border-radius: 8px; }
.donate-dialog .ghost-btn { margin-bottom: 12px; }
.donate-dialog .thanks { color: var(--brand); font-weight: 600; margin: 4px 0 0; }
.dlg-close { position: absolute; top: 10px; right: 10px; margin: 0; }

/* Tiện ích */
.tools-card { margin-top: 20px; }
.tabs.scroll { overflow-x: auto; scrollbar-width: none; }
.tabs.scroll::-webkit-scrollbar { display: none; }
.tabs.scroll button { white-space: nowrap; flex: none; }
.desc { margin: 0 0 14px; color: var(--ink-2); font-size: .92rem; max-width: 760px; }
.fields.two { grid-template-columns: 1fr 1fr; }
.fields.four { grid-template-columns: 2fr 1fr 1fr 1fr; }
.btn-cell { justify-content: flex-end; }
.btn-cell .primary-btn { height: 44px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.sub-h.first { margin-top: 0; }
.tool-out:empty { display: none; }
.tool-out { margin-top: 16px; }
.tool-out .err { color: var(--red); font-weight: 600; background: var(--red-soft); border-left: 3px solid var(--red); padding: 12px 14px; border-radius: 8px; margin: 0; }
.tool-out .big { font-size: 1.3rem; font-weight: 800; line-height: 1.3; margin: 0 0 4px; }
.tool-out .note { color: var(--muted); font-size: .86rem; margin: 8px 0 0; }
.out-box { padding: 14px 16px; border-radius: 8px; border-left: 3px solid var(--brand); background: var(--brand-soft); }
.out-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.out-head h3 { margin: 0; font-size: 1rem; }
.tbl-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; }
.tbl { width: 100%; border-collapse: collapse; font-size: .92rem; }
.tbl th, .tbl td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl th { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 700; background: var(--bg-2); }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr.past td { color: var(--muted); }
.tbl tr.next td { background: var(--brand-soft); }
.tbl td.num { font-variant-numeric: tabular-nums; }
.tbl td.diff { background: var(--lime-soft); color: var(--lime-ink); font-weight: 700; }
.tbl tr.row-diff th[scope="row"] { color: var(--lime-ink); }
.tbl th[scope="row"] { background: none; text-transform: none; letter-spacing: 0; font-size: .92rem; color: var(--ink); }
.tbl .short { display: none; text-decoration: none; }
.tbl-note { display: flex; align-items: center; gap: 6px; }
.tbl-note i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; background: var(--lime-soft); border: 1px solid var(--lime); }
.tbl .sub { color: var(--muted); font-size: .82rem; }
.tbl .shift { color: var(--lime-ink); font-size: .82rem; font-weight: 600; }
.tbl button { border: 0; background: none; padding: 0; color: var(--brand); font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; font-size: inherit; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 0 18px; }
.stats div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.stats dt { color: var(--muted); font-size: .9rem; }
.stats dd { margin: 0; font-weight: 600; text-align: right; }
.good-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.good-list li { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; cursor: pointer; }
.good-list li:hover, .good-list li:focus-visible { border-color: var(--brand); }
.good-list b { display: block; }
.good-list span { display: block; font-size: .84rem; color: var(--muted); }
.good-list .past { opacity: .5; }
.install-btn { display: inline-flex; align-items: center; gap: 6px; margin-left: 8px; }
.install-btn[hidden] { display: none; }

/* Lịch tháng */
.cal-card { margin-top: 20px; }
.cal-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.cal-head .card-h { margin: 0; }
.cal-sub { margin: 2px 0 0; color: var(--muted); font-size: .92rem; }
.cal-ctrl { display: flex; gap: 6px; align-items: center; }
.cal-ctrl select { width: auto; height: 38px; }
.cal-ctrl input { width: 92px; height: 38px; }

.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal .wd { text-align: center; font-size: .78rem; font-weight: 700; color: var(--muted); padding: 4px 0; text-transform: uppercase; }
.cal .wd.sun { color: var(--red); }
.cell {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between;
  min-height: 82px; padding: 8px 10px; border-radius: 6px; border: 1px solid var(--line); background: var(--card);
  cursor: pointer; text-align: left; min-width: 0;
}
.cell:hover { border-color: var(--brand); }
.cell.out { opacity: .38; }
.cell .s { font-size: 1.25rem; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.cell.sun .s { color: var(--red); }
.cell .l { font-size: .8rem; color: var(--muted); font-weight: 500; align-self: flex-end; font-variant-numeric: tabular-nums; }
.cell .l.first { color: var(--red); font-weight: 700; }
.cell .ev { font-size: .7rem; color: var(--lime-ink); font-weight: 600; line-height: 1.2; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 4px; }
.cell .dot { position: absolute; top: 9px; right: 9px; width: 6px; height: 6px; border-radius: 50%; background: var(--lime); }
.cell.hol { background: var(--lime-soft); }
.cell.today { border: 2px solid var(--brand); }
.cell.sel { background: var(--brand); border-color: var(--brand); }
.cell.sel .s, .cell.sel .l, .cell.sel .ev, .cell.sel .l.first { color: var(--on-brand); }
.cell.sel .dot { background: var(--lime-2); }

.legend { list-style: none; display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 14px 0 0; padding: 0; font-size: .84rem; color: var(--muted); }
.legend li { display: inline-flex; align-items: center; gap: 6px; }
.lg { display: inline-block; width: 14px; height: 14px; border-radius: 3px; }
.lg.today { border: 2px solid var(--brand); }
.lg.sel { background: var(--brand); }
.lg.hd { width: 7px; height: 7px; border-radius: 50%; background: var(--lime); }
.lg.first { background: var(--red); }
.lg.hol { background: var(--lime-soft); border: 1px solid var(--lime); }

/* Danh sách */
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }
.list .d { flex: none; width: 56px; text-align: center; border-radius: 6px; border: 1px solid var(--line); padding: 5px 0; line-height: 1.1; }
.list .d b { display: block; font-size: 1.1rem; }
.list .d span { font-size: .72rem; color: var(--muted); }
.list .t { flex: 1; min-width: 0; }
.list .t b { display: block; font-weight: 600; }
.list .t span { font-size: .85rem; color: var(--muted); }
.list .c { flex: none; font-size: .82rem; font-weight: 600; color: var(--brand); }
.list li.clickable { cursor: pointer; }
.list li.clickable:hover .t b { color: var(--brand); }
.list li.cur .d { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.list li.cur .d span { color: inherit; opacity: .85; }
.tk { columns: 2; column-gap: 24px; }
.tk li { break-inside: avoid; }

/* Hỏi đáp */
.faq { margin-top: 20px; }
.faq details { border-bottom: 1px solid var(--line); padding: 12px 0; }
.faq details:last-child { border-bottom: 0; }
.faq summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary svg { color: var(--muted); transition: transform .15s; }
.faq details[open] summary svg { transform: rotate(180deg); }
.faq p { margin: 8px 0 0; color: var(--ink-2); }

/* Chân trang */
.footer { margin-top: 40px; background: var(--card); border-top: 1px solid var(--line); padding: 32px 0 16px; }
.foot-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 28px; }
.foot-brand { display: flex; gap: 16px; align-items: flex-start; }
.foot-brand img { border-radius: 8px; background: #fff; flex: none; border: 1px solid var(--line); }
.footer p { margin: 0 0 6px; color: var(--ink-2); font-size: .93rem; }
.foot-title { font-weight: 700; color: var(--ink) !important; font-size: 1rem !important; }
.foot-slogan { font-weight: 600; color: var(--brand) !important; }
.foot-link { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; text-decoration: none; }
.foot-link:hover { text-decoration: underline; }
.muted { color: var(--muted) !important; font-size: .85rem !important; }
.call-btn { display: inline-flex; align-items: center; gap: 8px; margin: 6px 0 8px; padding: 10px 16px; border-radius: 8px; background: var(--brand); color: var(--on-brand); font-weight: 700; text-decoration: none; }
.call-btn:hover { background: var(--brand-dark); color: #fff; }
.foot-donate { text-align: center; }
.foot-donate img { margin: 6px auto 8px; border-radius: 8px; background: #fff; padding: 6px; border: 1px solid var(--line); }
.copy { margin-top: 22px !important; padding-top: 14px; border-top: 1px solid var(--line); font-size: .82rem !important; color: var(--muted) !important; text-align: center; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--ink); color: var(--card); padding: 10px 16px; border-radius: 8px; font-weight: 600; font-size: .92rem;
  transition: opacity .2s, transform .2s; z-index: 50; max-width: calc(100% - 32px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Màn hình nhỏ */
@media (max-width: 980px) {
  .grid-top, .grid-bottom { grid-template-columns: 1fr; }
  .foot-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  .nav { display: none; }
  .topbar-inner { justify-content: space-between; }
  .card { padding: 16px; }
  .hero { padding: 22px 0 16px; }
  .info { grid-template-columns: 1fr; }
  .hours { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .cal { gap: 3px; }
  .cell { min-height: 58px; padding: 5px 4px; border-radius: 5px; align-items: center; }
  .cell .s { font-size: 1.05rem; }
  .cell .l { align-self: center; font-size: .7rem; }
  .cell .ev { display: none; }
  .cell .dot { top: 4px; right: 4px; width: 5px; height: 5px; }
  .cal .wd { font-size: .7rem; }
  .cal-ctrl { width: 100%; }
  .cal-ctrl select { flex: 1; }
  .tk { columns: 1; }
  .two-col { grid-template-columns: 1fr; gap: 20px; }
  .tbl th, .tbl td { white-space: normal; padding: 8px 6px; font-size: .88rem; }
  .tbl .full { display: none; }
  .tbl .short { display: inline; }
  .tabs.scroll { display: grid; grid-template-columns: 1fr 1fr; overflow: visible; }
  .tabs.scroll button { white-space: normal; padding: 10px 6px; }
  .tabs.scroll button:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .fields.four { grid-template-columns: 1fr 1fr 1fr; }
  .fields.four .wide { grid-column: 1 / -1; }
  .install-btn { padding: 0 10px; font-size: .85rem; margin-left: 8px; }
  .donate-btn { margin-left: auto; padding: 0 12px; }
  .list li { display: grid; grid-template-columns: 56px minmax(0, 1fr); column-gap: 12px; row-gap: 2px; }
  .list .d { grid-row: span 2; }
  .list .c { justify-self: start; }
  .foot-grid { grid-template-columns: 1fr; }
  .foot-brand img { width: 64px; height: 64px; }
}
@media (max-width: 400px) {
  .day-dual { gap: 8px; }
  .dual { padding: 12px; }
  .fields.three { grid-template-columns: 1fr 1fr; }
  .fields.three label:last-child { grid-column: 1 / -1; }
  .fields.three .btn-cell span { display: none; }
  .fields.two { grid-template-columns: 1fr; }
  .donate-body { flex-direction: column; }
  .qr-thumb { align-self: center; }
  .donate-btn span { display: none; }
  .donate-btn { width: 38px; padding: 0; justify-content: center; }
  .fields.two .btn-cell span { display: none; }
  .tbl th, .tbl td { padding: 7px 3px; font-size: .8rem; }
  .tbl th { letter-spacing: 0; }
  .tbl .sub { font-size: .74rem; }
  .cal-ctrl { gap: 4px; }
  .cal-ctrl select { padding: 0 4px; font-size: .9rem; }
  .cal-ctrl input { width: 60px; padding: 0 6px; font-size: .9rem; text-align: center; -moz-appearance: textfield; appearance: textfield; }
  .cal-ctrl input::-webkit-inner-spin-button, .cal-ctrl input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}

@media print {
  .topbar, .row-actions, .conv-card, .tools-card, .cal-ctrl, .footer .foot-contact, .donate-card, .donate-btn, .faq, .toast, .day-actions { display: none !important; }
  body { background: #fff; }
  .card { break-inside: avoid; }
  .grid-top { grid-template-columns: 1fr; }
}

/* ---------- Lời mời tư vấn (giống trang chủ) ---------- */
.nudge {
  position: fixed; left: 20px; bottom: 24px; z-index: 30; width: 320px; padding: 20px;
  background: var(--card, #fff); color: var(--ink, #0f2526); border: 1px solid var(--line, #e0e6e4); 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(--muted, #5f706f); cursor: pointer;
}
.nudge-close:hover { background: var(--bg-2, rgba(0,0,0,.05)); color: var(--ink); }
.nudge-close svg { 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; margin: 0; }
.nudge-text { margin-top: 8px; font-size: .88rem; line-height: 1.55; color: var(--ink-2, #495d5c); margin-bottom: 0; }
.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, #027f55), #12b886);
  border-radius: 10px; color: #fff; font-weight: 600; font-size: .88rem;
  display: inline-flex; align-items: center; justify-content: center; text-decoration: none; border: none;
}
.nudge-actions .btn-primary:hover { opacity: .92; }
.nudge-actions .btn-ghost {
  height: 42px; padding: 0 14px; border-radius: 10px;
  border: 1px solid var(--line, #e0e6e4); color: var(--ink);
  font-weight: 600; font-size: .88rem; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  text-decoration: none; background: transparent;
}
.nudge-actions .btn-ghost:hover { background: var(--bg-2); }
.nudge-actions .btn-ghost svg { width: 16px; height: 16px; }
@media (max-width: 1023px) { .nudge { display: none !important; } }
@media (prefers-reduced-motion: reduce) { .nudge { animation: none; } }

