/* Chiếc túi thần kỳ — bento/masonry, sáng-mát + chế độ tối. Mọi màu lấy từ token bên dưới. */
:root {
  --nen: #f8fafc;
  --the: #ffffff;
  --muc: #0f172a;
  --phu: #334155;
  --nhan: #0369a1;
  --nhan-hover: #075985;
  --tren-nhan: #ffffff;
  --vang: #facc15;
  --vien: #64748b;
  --vien-nhe: rgba(15, 23, 42, 0.14);
  --loi: #991b1b;
  --loi-nen: #fee2e2;
  --ok: #17693b;
  --ok-nen: #e3f4ea;
  --o-ketqua: #f0f9ff;
  --chip-hover: #e0f2fe;
  --canxn: #fff1c7;
  --kho: #e2e8f0;
  --bong: 0 10px 24px rgba(15, 42, 68, 0.14);
  --c-vanban: #f5f3ff;
  --c-toan: #fefce8;
  --c-doisong: #f0fdf4;
  --c-laptrinh: #f0f9ff;
  --c-hinh: #fff1f2;
  --serif: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif;
  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif;
  --mono: ui-monospace, 'Cascadia Mono', 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  color-scheme: light;
}
html[data-theme='dark'] {
  --nen: #0b1120;
  --the: #162032;
  --muc: #f8fafc;
  --phu: #cbd5e1;
  --nhan: #38bdf8;
  --nhan-hover: #7dd3fc;
  --tren-nhan: #0b1120;
  --vien: #7d8fa8;
  --vien-nhe: rgba(232, 241, 250, 0.16);
  --loi: #fca5a5;
  --loi-nen: #450a0a;
  --ok: #7fd8a2;
  --ok-nen: #123a2a;
  --o-ketqua: #0f1a2e;
  --chip-hover: #1e3350;
  --canxn: #3a3115;
  --kho: #1e293b;
  --bong: 0 10px 24px rgba(0, 0, 0, 0.45);
  --c-vanban: #2e1065;
  --c-toan: #451a03;
  --c-doisong: #064e3b;
  --c-laptrinh: #082f49;
  --c-hinh: #4c0519;
  color-scheme: dark;
}
.cat-c-vanban { --cat-bg: var(--c-vanban); --cat-bd: #ddd6fe; --cat-ic: #ddd6fe; background: var(--c-vanban); }
.cat-c-toan { --cat-bg: var(--c-toan); --cat-bd: #fef08a; --cat-ic: #fef08a; background: var(--c-toan); }
.cat-c-doisong { --cat-bg: var(--c-doisong); --cat-bd: #a7f3d0; --cat-ic: #bbf7d0; background: var(--c-doisong); }
.cat-c-laptrinh { --cat-bg: var(--c-laptrinh); --cat-bd: #bae6fd; --cat-ic: #bae6fd; background: var(--c-laptrinh); }
.cat-c-hinh { --cat-bg: var(--c-hinh); --cat-bd: #fecdd3; --cat-ic: #fecdd3; background: var(--c-hinh); }
html[data-theme='dark'] .cat-c-vanban { --cat-bd: #581c87; --cat-ic: #ddd6fe; }
html[data-theme='dark'] .cat-c-toan { --cat-bd: #78350f; --cat-ic: #fef08a; }
html[data-theme='dark'] .cat-c-doisong { --cat-bd: #047857; --cat-ic: #bbf7d0; }
html[data-theme='dark'] .cat-c-laptrinh { --cat-bd: #0369a1; --cat-ic: #bae6fd; }
html[data-theme='dark'] .cat-c-hinh { --cat-bd: #881337; --cat-ic: #fecdd3; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--nen);
  color: var(--muc);
  font: 400 16px/26px var(--sans);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
img { max-width: 100%; }
h1, h2, h3 { font-family: var(--serif); font-weight: 700; margin: 0; }
p { margin: 0; }
a { color: var(--nhan); }
.muted { color: var(--phu); }
.small { font-size: 14px; line-height: 22px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.sr-copy { position: fixed; left: -9999px; top: 0; }
[hidden] { display: none !important; }

/* focus bàn phím: vòng 3px nhấn cách 3px (tối: vàng) */
:focus { outline: none; }
:focus-visible { outline: 3px solid var(--nhan); outline-offset: 3px; border-radius: 6px; }
html[data-theme='dark'] :focus-visible { outline-color: var(--vang); }
#main:focus, #page-title:focus, #yeu-thich:focus { outline: none; }

.skip {
  position: absolute; left: 12px; top: -80px; z-index: 50; background: var(--nhan); color: var(--tren-nhan);
  padding: 10px 16px; border-radius: 10px; font-weight: 600; text-decoration: none;
}
.skip:focus { top: 12px; }

/* ---------- header ---------- */
.top { position: sticky; top: 0; z-index: 20; background: var(--the); border-bottom: 1px solid var(--vien-nhe); }
.hdr { height: 72px; max-width: 1264px; margin: 0 auto; padding: 0 32px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.hdr__brand { min-height: 44px; display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--muc); min-width: 0; }
.hdr__name { font: 700 22px/28px var(--serif); white-space: nowrap; }
.hdr__brand img { border-radius: 10px; flex: none; }
.hdr__nav { display: flex; align-items: center; gap: 8px; }
.hdr__fav { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; padding: 0 12px; border-radius: 22px; color: var(--muc); text-decoration: none; font-weight: 500; }
.hdr__fav:hover { background: var(--chip-hover); }
.hdr__count { font-weight: 600; }
.hdr__lbl { white-space: nowrap; }
.hdr__fav { gap: 6px; }
.toast { max-width: 1264px; margin: 0 auto; padding: 8px 32px 12px; font-size: 14px; color: var(--ok); background: var(--ok-nen); }

.icon { display: block; flex: none; }
.icon__stroke { stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon__gold { fill: var(--vang); stroke: var(--muc); stroke-width: 1.5; stroke-linejoin: round; }
html[data-theme='dark'] .tile .icon__gold, html[data-theme='dark'] .toolhead__icon .icon__gold, html[data-theme='dark'] .mini .icon__gold, html[data-theme='dark'] .marquee .icon__gold { stroke: #08203a; }

.icon-btn { width: 44px; height: 44px; display: inline-grid; place-items: center; border-radius: 50%; border: 1.5px solid var(--vien); background: var(--the); color: var(--muc); cursor: pointer; padding: 0; }
.icon-btn:hover { background: var(--chip-hover); }
.icon-btn--fav[aria-pressed='true'] .icon__stroke { fill: var(--vang); }

/* ---------- khung nội dung ---------- */
.main { width: 100%; max-width: 1264px; margin: 0 auto; padding: 32px 32px 56px; flex: 1; }
.foot { max-width: 1264px; margin: 0 auto; padding: 24px 32px 40px; font-size: 14px; line-height: 22px; color: var(--phu); }

/* ---------- khối mở đầu + tìm kiếm ---------- */
.intro { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); align-items: center; gap: 24px; padding: 8px 0 16px; min-height: 280px; }
.intro__text { display: flex; flex-direction: column; justify-content: center; gap: 12px; min-width: 0; }
.intro__art { min-width: 0; display: flex; justify-content: flex-end; }
.intro__img { display: block; width: 100%; max-width: 480px; height: auto; aspect-ratio: 480 / 268; border-radius: 24px; object-fit: cover; background: var(--c-laptrinh); }
.intro__title { font-size: 48px; line-height: 52px; max-width: 18ch; }
.intro__sub { font-size: 16px; }
.search { position: relative; display: flex; align-items: center; gap: 12px; height: 64px; max-width: 720px; width: 100%; padding: 0 20px; margin-top: 8px; background: var(--the); border: 2px solid var(--vien); border-radius: 32px; color: var(--phu); }
.search:focus-within { border-color: var(--nhan); outline: 3px solid var(--nhan); outline-offset: 3px; }
html[data-theme='dark'] .search:focus-within { outline-color: var(--vang); }
.search__input { flex: 1; min-width: 0; height: 100%; border: 0; background: transparent; color: var(--muc); font: 400 17px/24px var(--sans); }
.search__input:focus-visible { outline: none; }
.search__input::placeholder { color: var(--phu); opacity: 1; }
.search__input::-webkit-search-cancel-button { display: none; }
.search__clear { width: 44px; height: 44px; border: 0; background: transparent; color: var(--phu); cursor: pointer; display: grid; place-items: center; border-radius: 50%; }
.search__clear:hover { background: var(--chip-hover); }
.search__kbd { font: 500 14px var(--mono); border: 1.5px solid var(--vien); border-radius: 8px; padding: 2px 10px; color: var(--phu); }
@media (hover: none) { .search__kbd { display: none; } }

/* ---------- dải bảo bối (ảnh, trang trí) ---------- */
.marquee { height: 72px; margin: 8px 0 24px; border-radius: 24px; overflow: hidden; border: 1.5px solid var(--vien-nhe);
  background: var(--the) url('img/gadgets-strip.webp') repeat-x 0 50% / auto 100%; animation: strip 40s linear infinite; }
.marquee:hover { animation-play-state: paused; }
.marquee__track { display: none; }
@keyframes strip { to { background-position-x: -576px; } }

/* ---------- chip ---------- */
.chips-wrap { margin-bottom: 20px; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px 0 16px; border-radius: 22px; border: 1.5px solid var(--vien); background: var(--the); color: var(--muc); font: 500 15px/22px var(--sans); cursor: pointer; }
.chip:hover { background: var(--chip-hover); }
.chip--on { background: var(--nhan); color: var(--tren-nhan); border-color: var(--nhan); }
.chip__n { min-width: 26px; height: 26px; padding: 0 8px; display: inline-grid; place-items: center; border-radius: 13px; background: var(--chip-hover); color: var(--muc); font-size: 14px; line-height: 20px; font-weight: 600; }
.chip--on .chip__n { background: var(--tren-nhan); color: var(--nhan); }
.sprite { display: block; flex: none; }
.chip--on:hover { background: var(--nhan-hover); }

/* ---------- Vừa xem / Yêu thích ---------- */
.strip { margin-bottom: 24px; }
.section-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.section-title { font-size: 22px; line-height: 30px; }
.minis { display: flex; flex-wrap: wrap; gap: 12px; }
.minis--scroll { flex-wrap: nowrap; overflow-x: auto; padding: 4px 4px 12px; scrollbar-width: thin; }
.mini { display: inline-flex; align-items: center; gap: 12px; width: 220px; height: 72px; flex: none; padding: 0 16px; border-radius: 16px; border: 1.5px solid var(--cat-bd, var(--vien-nhe)); color: var(--muc); text-decoration: none; }
.mini__name { font-weight: 600; font-size: 15px; line-height: 20px; }
.mini:hover { border-color: var(--nhan); }
.btn--link { border: 0; background: transparent; color: var(--nhan); text-decoration: underline; padding: 0 8px; min-height: 44px; }

/* ---------- lưới bento ---------- */
.grid { display: grid; grid-template-columns: repeat(12, 1fr); grid-auto-rows: 156px; grid-auto-flow: dense; gap: 16px; }
.tile { position: relative; display: flex; flex-direction: column; justify-content: flex-end; gap: 2px; padding: 14px 16px; border-radius: 20px; border: 1.5px solid var(--vien-nhe); color: var(--muc); transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease; }
.tile--l { grid-column: span 6; grid-row: span 2; padding: 20px; }
.tile--w { grid-column: span 6; }
.tile--m { grid-column: span 4; }
.tile--right { grid-column: 7 / span 6; }
.tile__icon { position: absolute; left: 16px; top: 14px; width: 48px; height: 48px; border-radius: 50%; background: var(--the); display: grid; place-items: center; color: var(--muc); transition: transform 0.2s ease; }
.tile--l .tile__icon { left: 20px; top: 20px; width: 80px; height: 80px; }
.tile__name { font-size: 19px; line-height: 24px; }
.tile--l .tile__name { font-size: 28px; line-height: 34px; }
.tile__link { color: inherit; text-decoration: none; }
.tile__link::after { content: ''; position: absolute; inset: 0; border-radius: 20px; }
.tile__link:focus-visible { outline: none; }
.tile__link:focus-visible::after { outline: 3px solid var(--nhan); outline-offset: 3px; }
html[data-theme='dark'] .tile__link:focus-visible::after { outline-color: var(--vang); }
.tile__desc { font-size: 14px; line-height: 22px; color: var(--phu); display: -webkit-box; -webkit-line-clamp: 1; line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; padding-right: 32px; }
.tile--l .tile__desc { -webkit-line-clamp: 2; line-clamp: 2; font-size: 16px; line-height: 24px; }
.tile__go { position: absolute; right: 14px; bottom: 14px; color: var(--muc); }
.star { position: absolute; right: 8px; top: 8px; z-index: 2; width: 44px; height: 44px; display: grid; place-items: center; border: 0; background: transparent; border-radius: 50%; cursor: pointer; color: var(--muc); }
.star:hover { background: rgba(255, 255, 255, 0.5); }
html[data-theme='dark'] .star:hover { background: rgba(255, 255, 255, 0.12); }
.star[aria-pressed='true'] .icon__stroke { fill: var(--vang); }
.tile--deco { grid-column: span 6; order: 999; background: transparent; border: 2px dashed var(--vien); align-items: center; justify-content: center; text-align: center; color: var(--phu); }
.tile--deco .tile__name { font-size: 16px; line-height: 22px; font-family: var(--sans); font-weight: 500; }
.tile--broken { background: var(--kho); }
.empty__art .icon__stroke { fill: none; }
.tile--deco .empty__art { margin-bottom: 4px; }

@media (hover: hover) {
  .tile:not(.tile--deco):not(.tile--broken):hover { transform: translateY(-4px); border-color: var(--nhan); border-width: 1.5px; box-shadow: var(--bong); }
  .tile:not(.tile--deco):hover .tile__icon { animation: hop 0.5s ease; }
}
.tile:not(.tile--deco):not(.tile--broken):focus-within .tile__icon { animation: hop 0.5s ease; }
.tile:active { transform: translateY(1px); }
@keyframes hop { 40% { transform: translateY(-6px) rotate(8deg); } }
.tile--pop { animation: pop 0.32s cubic-bezier(0.34, 1.56, 0.64, 1) both; animation-delay: calc(var(--i, 0) * 45ms); }
@keyframes pop { from { opacity: 0; transform: scale(0.86) translateY(24px) rotate(-3deg); } to { opacity: 1; transform: none; } }

/* ---------- trạng thái rỗng ---------- */
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 12px; padding: 32px 0; }
.empty--page { padding-top: 56px; }
.empty__art { color: var(--muc); }
.empty__title { font: 600 20px/28px var(--serif); }

/* ---------- nút ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 12px; border: 1.5px solid var(--vien); background: var(--the); color: var(--muc); font: 500 15px/22px var(--sans); cursor: pointer; text-decoration: none; }
.btn:hover { background: var(--chip-hover); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn--primary { min-height: 48px; background: var(--nhan); color: var(--tren-nhan); border-color: var(--nhan); font-weight: 600; font-size: 16px; }
.btn--primary:hover { background: var(--nhan-hover); }
.btn--block { width: 100%; }
.btn--ok { background: var(--ok-nen); color: var(--ok); border-color: var(--ok); }
.btn--small { min-height: 44px; min-width: 44px; padding: 0 10px; }
.btn--back { padding-left: 12px; }

/* ---------- trang công cụ ---------- */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin-bottom: 20px; }
.crumb { font-size: 14px; color: var(--phu); }
.crumb span { color: var(--muc); }
.toolbar__end { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.share { position: relative; }
.menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 10; display: flex; flex-direction: column; gap: 6px; min-width: 220px; padding: 8px; background: var(--the); border: 1.5px solid var(--vien); border-radius: 14px; box-shadow: var(--bong); }
.toolhead { display: flex; align-items: center; gap: 20px; margin-bottom: 24px; }
.toolhead__icon { width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; flex: none; color: var(--muc); }
.page-title { font-size: 36px; line-height: 42px; }
.card { background: var(--the); border: 1.5px solid var(--vien-nhe); border-radius: 20px; padding: 24px; }
.io { display: grid; grid-template-columns: 7fr 5fr; gap: 24px; align-items: start; }
.io__title, .result__title { font: 600 14px/20px var(--sans); color: var(--phu); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 14px; }
.io__col { min-width: 0; }
.io__in { display: flex; flex-direction: column; gap: 16px; }
.result { background: var(--o-ketqua); border-radius: 16px; padding: 20px; min-width: 0; position: sticky; top: 92px; }
.result__bar { flex-wrap: wrap; display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.result__bar .result__title { margin: 0; }
.result__text { display: block; font: 400 20px/30px var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word; margin: 8px 0 12px; }
.result__text--empty { color: var(--phu); }
.result__extra:empty { display: none; }
.result__extra { display: flex; flex-direction: column; gap: 12px; }

/* ---------- biểu mẫu ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field__label { font-size: 14px; line-height: 20px; font-weight: 600; }
.field__hint { font-size: 14px; line-height: 20px; color: var(--phu); }
.field__err { font-size: 14px; line-height: 20px; color: var(--loi); font-weight: 500; }
.input { width: 100%; min-height: 48px; padding: 8px 14px; border-radius: 12px; border: 1.5px solid var(--vien); background: var(--the); color: var(--muc); font: 400 15px/24px var(--mono); }
select.input { font-family: var(--sans); font-size: 16px; }
.input::placeholder { color: var(--phu); opacity: 1; }
.input--area { min-height: 140px; resize: vertical; }
.input[aria-invalid='true'] { border-color: var(--loi); border-width: 2px; }
input[type='checkbox'] { width: 22px; height: 22px; flex: none; accent-color: var(--nhan); margin: 0; }
input[type='range'] { width: 100%; accent-color: var(--nhan); min-height: 44px; }
.check { display: flex; align-items: center; gap: 10px; min-height: 44px; cursor: pointer; font-size: 15px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.picker { width: 64px; height: 44px; padding: 2px; min-height: 0; }
.pickrow { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.badge-note, .basis__label { font-size: 14px; line-height: 20px; background: var(--canxn); color: var(--muc); padding: 8px 12px; border-radius: 10px; }
.tag-warn { display: inline-block; margin-left: 8px; font-size: 13px; line-height: 18px; background: var(--canxn); border: 1px solid var(--vang); padding: 0 8px; border-radius: 9px; color: var(--muc); font-weight: 600; }
.basis { border-top: 1px solid var(--vien-nhe); padding-top: 10px; }
.basis summary { cursor: pointer; font-weight: 600; min-height: 44px; display: flex; align-items: center; }
.basis__list { margin: 8px 0 0; padding-left: 20px; font-size: 14px; line-height: 22px; display: flex; flex-direction: column; gap: 8px; }
.basis__note { display: block; color: var(--phu); }
.strength { font-size: 14px; color: var(--phu); }
.note { margin-top: 12px; }

/* ---------- bảng ---------- */
.table { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 22px; }
.table th, .table td { padding: 6px 0; border-bottom: 1px solid var(--vien-nhe); text-align: left; font-weight: 400; }
.table td { text-align: right; font-family: var(--mono); font-size: 14px; }
.table__total th, .table__total td { font-weight: 600; border-bottom: 0; color: var(--muc); }
.table__cap { text-align: left; font-size: 14px; color: var(--phu); padding-bottom: 6px; }
.stats { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; margin: 0; font-size: 14px; }
.stats dt { color: var(--phu); }
.stats dd { margin: 0; font-family: var(--mono); text-align: right; }

/* ---------- máy tính / màu / QR ---------- */
.keypad { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.key { min-height: 52px; border-radius: 12px; border: 1.5px solid var(--vien); background: var(--the); color: var(--muc); font: 500 18px var(--mono); cursor: pointer; }
.key:hover { background: var(--chip-hover); }
.key--op { background: var(--o-ketqua); }
.key--eq { background: var(--nhan); border-color: var(--nhan); color: var(--tren-nhan); font-weight: 600; }
.key--eq:hover { background: var(--nhan-hover); }
.swatch { height: 96px; border-radius: 14px; border: 2px solid var(--muc); background: var(--sw, transparent); }
.colorline { display: flex; align-items: center; gap: 10px; }
.colorline__k { width: 44px; font-weight: 600; font-size: 14px; }
.colorline__v { flex: 1; font: 400 15px var(--mono); overflow-wrap: anywhere; }
.qr { display: grid; place-items: center; }
.qr__img { width: 240px; height: 240px; border-radius: 12px; border: 2px solid var(--muc); background: #fff; }
.qr__actions { display: flex; gap: 8px; flex-wrap: wrap; }

.related { margin-top: 32px; }
.related .section-title { margin-bottom: 12px; }

/* ---------- tablet ---------- */
@media (max-width: 1023px) {
  .main { padding: 24px 24px 48px; }
  .hdr, .foot { padding-left: 24px; padding-right: 24px; }
  .toast { padding-left: 24px; padding-right: 24px; }
  .grid { grid-template-columns: repeat(6, 1fr); }
  .tile--l { grid-column: span 6; }
  .tile--w, .tile--deco { grid-column: span 3; }
  .tile--m { grid-column: span 2; }
  .tile--right { grid-column: span 6; }
  .io { grid-template-columns: 1fr; }
  .result { position: static; }
}

/* ---------- mobile ---------- */
@media (max-width: 767px) {
  .main { padding: 16px 16px 40px; }
  .hdr, .foot { padding-left: 16px; padding-right: 16px; }
  .toast { padding-left: 16px; padding-right: 16px; }
  .hdr { height: 64px; }
  .hdr__name { font-size: 18px; line-height: 24px; }
  .hdr__fav { padding: 0 8px; }
  .hdr__lbl { display: none; }
  .intro { min-height: 220px; }
  .intro__title { font-size: 34px; line-height: 38px; }
  .search { height: 56px; padding: 0 14px; }
  .chips { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 6px; scrollbar-width: thin; }
  .chip { flex: none; white-space: nowrap; }
  .grid { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 128px; gap: 12px; }
  .tile--l { grid-column: span 2; grid-row: span 2; }
  .tile--w, .tile--right { grid-column: span 2; }
  .tile--m, .tile--deco { grid-column: span 1; }
  .tile--deco { order: 999; }
  .tile { padding: 12px; }
  .tile__icon { left: 12px; top: 12px; width: 44px; height: 44px; }
  .tile--l { padding: 14px; }
  .tile--l .tile__icon { left: 14px; top: 14px; width: 64px; height: 64px; }
  .tile--m .tile__desc { display: none; }
  .tile--m .tile__name { font-size: 17px; line-height: 22px; }
  .tile__go { right: 10px; bottom: 10px; }
  .mini { width: 160px; height: 64px; padding: 0 12px; }
  .page-title { font-size: 28px; line-height: 34px; }
  .toolhead { gap: 14px; }
  .toolhead__icon { width: 56px; height: 56px; }
  .card { padding: 16px; }
  .row2 { grid-template-columns: 1fr; }
  .btn--primary { width: 100%; }
  .qr__actions .btn { flex: 1; }
  .menu { right: auto; left: 0; }
  .toolbar__end { margin-left: 0; width: 100%; justify-content: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .marquee__track { animation: none; flex-wrap: wrap; width: auto; justify-content: center; padding: 0 16px; gap: 20px; }
  .marquee__track > :nth-child(n + 21) { display: none; }
  .tile--pop { animation: none; }
  .tile, .tile__icon { transition: none; }
  .tile:hover, .tile:hover .tile__icon, .tile:focus-within .tile__icon { animation: none; transform: none; }
}

/* ---------- giao diện hoạt hình: ô tô màu theo danh mục, icon màu lớn ---------- */
.tile:not(.tile--deco):not(.tile--broken) { border-color: var(--cat-bd); }
.tile__icon { width: 68px; height: 68px; border-radius: 20px; background: var(--cat-ic, var(--the)); transform: rotate(-3deg); }
.tile--l .tile__icon { width: 96px; height: 96px; border-radius: 28px; transform: rotate(-4deg); }
.tile__showcase { position: absolute; right: 64px; top: 20px; width: 132px; height: 132px; opacity: 0.95; transform: rotate(6deg); pointer-events: none; }
.tile__showcase .sprite, .tile__icon .sprite { width: 100%; height: 100%; }
.tile__icon .sprite { width: 68%; height: 68%; }
.tile__chips { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 8px 0 0; padding: 0 40px 0 0; }
.tile__chips li { font-size: 14px; line-height: 22px; font-weight: 600; padding: 2px 12px; border-radius: 999px; background: var(--the); border: 1.5px solid var(--cat-bd); color: var(--muc); }
.tile--deco { flex-direction: column; gap: 6px; }
.tile__deco-img { display: block; width: 96px; height: 96px; border-radius: 20px; object-fit: cover; }
.empty__img { display: block; width: min(300px, 70vw); height: auto; border-radius: 20px; }
.toolhead { padding: 20px 24px; border-radius: 24px; border: 1.5px solid var(--cat-bd); background: linear-gradient(135deg, var(--cat-bg), var(--the)); }
.toolhead__icon { width: 84px; height: 84px; border-radius: 24px; background: var(--cat-ic); transform: rotate(-3deg); }
@media (max-width: 1023px) {
  .intro { grid-template-columns: minmax(0, 1fr) minmax(0, 0.8fr); }
}
@media (max-width: 767px) {
  .intro { grid-template-columns: 1fr; gap: 12px; min-height: 0; }
  .intro__art { justify-content: center; order: -1; }
  .intro__img { max-width: 360px; }
  .marquee { height: 56px; background-position-y: 50%; animation-name: strip-s; }
  @keyframes strip-s { to { background-position-x: -448px; } }
  .tile__icon { width: 56px; height: 56px; border-radius: 16px; }
  .tile--l .tile__icon { width: 80px; height: 80px; border-radius: 24px; }
  .tile__showcase { right: 14px; top: 16px; width: 96px; height: 96px; }
  .chips { gap: 8px; }
  .toolhead { padding: 14px 16px; }
  .toolhead__icon { width: 64px; height: 64px; border-radius: 18px; }
  .grid { grid-auto-rows: 148px; }
  .tile__chips { gap: 6px; padding-right: 36px; }
  .tile__chips li { font-size: 13px; line-height: 20px; padding: 1px 10px; }
  .mini { width: 200px; }
}
@media (prefers-reduced-motion: reduce) {
  .marquee { animation: none; }
  .tile__icon, .tile__showcase, .toolhead__icon { transform: none; }
}
