/* ===== Tháp Mười Runners — bảng màu lấy từ logo (xanh ngọc, hồng sen, tím than) ===== */
:root {
  --teal: #1e6b6b;
  --teal-d: #134b4b;
  --teal-l: #e3f1ef;
  --mint: #2db396;
  --mint-l: #dff5ee;
  --pink: #ee2a96;
  --pink-d: #c81e7c;
  --pink-l: #fde7f3;
  --navy: #3a3a6a;
  --navy-l: #e8e8f3;
  --strava: #fc4c02;
  --bg: #f4f7f6;
  --surface: #ffffff;
  --text: #13302f;
  --muted: #5f7674;
  --line: #e1e9e7;
  --divider: #eef3f2;
  --soft: #f3f7f6;
  --soft-2: #e9efee;
  --field: #ffffff;
  --field-line: #cfdcd9;
  --pink-soft: #fff7fb;
  --warn-l: #fff4e5;
  --danger-l: #fdecea;
  --gold-l: #fff8dc;
  --text-2: #2b4544;
  --heading: #134b4b;
  --link: #1e6b6b;
  --surface-solid: #ffffff;
  --ok: #158a6b;
  --warn: #c2410c;
  --danger: #c62828;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(19, 48, 47, 0.06), 0 4px 16px rgba(19, 48, 47, 0.06);
  --font: 'Be Vietnam Pro', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --display: 'Barlow Condensed', 'Be Vietnam Pro', sans-serif;
  --sidebar: 248px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 15px/1.55 var(--font);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
body.modal-open { overflow: hidden; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
h1, h2, h3 { margin: 0 0 .5em; line-height: 1.2; }
h1 { font: 700 30px/1.1 var(--display); letter-spacing: .2px; }
h2, .h2 { font-size: 17px; font-weight: 700; }
h3 { font-size: 15px; font-weight: 700; }
p { margin: 0 0 .6em; }
code { background: var(--teal-l); padding: 1px 6px; border-radius: 5px; font-size: 13px; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--pink) 55%, transparent); outline-offset: 2px; }

.ic { width: 20px; height: 20px; flex: none; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.xsmall { font-size: 12px; }
.center { text-align: center; }
.mt { margin-top: 14px; }
.ok { color: var(--ok); }
.warn-t { color: var(--warn); }
.mono { font-variant-numeric: tabular-nums; font-family: var(--display); font-size: 1.12em; letter-spacing: .3px; }
.grow { flex: 1; min-width: 0; }
.row { display: flex; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.gap { gap: 10px; }
.gap-sm { gap: 6px; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.row-end { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.clamp1, .clamp2 { display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; }
.clamp1 { -webkit-line-clamp: 1; }
.clamp2 { -webkit-line-clamp: 2; }
[hidden] { display: none !important; }

/* ===== Khung ===== */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar); flex: none; position: sticky; top: 0; height: 100vh; overflow-y: auto;
  background: var(--teal-d); color: #d8ecea; padding: 18px 12px 24px;
}
.brand { display: flex; align-items: center; gap: 10px; color: #fff; padding: 4px 8px 18px; }
.brand:hover { text-decoration: none; }
.brand img { width: 46px; height: 46px; }
.brand b { display: block; font: 700 21px/1 var(--display); letter-spacing: .3px; }
.brand small { display: block; font-size: 11.5px; color: #9cc9c3; margin-top: 3px; font-style: italic; }
.nav-group { margin-bottom: 14px; }
.nav-label { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: #7fb2ac; padding: 6px 10px; font-weight: 600; }
.sidebar nav a {
  display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 10px;
  color: #d8ecea; font-weight: 500; font-size: 14.5px;
}
.sidebar nav a:hover { background: rgba(255,255,255,.07); text-decoration: none; }
.sidebar nav a.active { background: var(--pink); color: #fff; }
.sidebar nav a .ic { width: 19px; height: 19px; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px;
  height: 58px; padding: 0 24px; background: rgba(244,247,246,.92); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.topbar-title { font-weight: 700; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-right { display: flex; align-items: center; gap: 8px; }
.brand-mini { display: flex; align-items: center; gap: 6px; color: var(--teal-d); }
.brand-mini img { width: 34px; height: 34px; }
.brand-mini b { font: 700 20px var(--display); }
.icon-btn {
  position: relative; display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 10px;
  border: 0; background: transparent; color: var(--text); cursor: pointer;
}
.icon-btn:hover { background: var(--teal-l); text-decoration: none; }
.icon-btn.sm { width: 30px; height: 30px; }
.icon-btn.sm .ic { width: 16px; height: 16px; }
.icon-btn .dot {
  position: absolute; top: 3px; right: 2px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px;
  background: var(--pink); color: #fff; font: 700 10.5px/17px var(--font); font-style: normal; text-align: center;
}
.me-chip { display: flex; align-items: center; gap: 7px; padding: 3px 10px 3px 3px; border-radius: 30px; background: var(--surface); border: 1px solid var(--line); color: var(--text); font-weight: 600; font-size: 14px; }
.me-chip:hover { text-decoration: none; border-color: var(--teal); }
.demo-bar { background: var(--navy); color: #e6e6f5; font-size: 12.5px; padding: 6px 24px; }
.demo-bar a { color: #ffc2e3; }
#view { padding: 24px; max-width: 1240px; width: 100%; margin: 0 auto; outline: none; padding-bottom: 60px; }
.only-mobile { display: none; }
.scrim { display: none; }
.bottomnav { display: none; }

/* ===== Thành phần ===== */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); margin-bottom: 16px; }
.card-link { display: block; color: inherit; transition: transform .15s, box-shadow .15s, border-color .15s; }
.card-link:hover { text-decoration: none; transform: translateY(-2px); border-color: var(--field-line); box-shadow: 0 8px 24px rgba(19,48,47,.1); }
section { margin-bottom: 8px; }
.sec-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.sec-head h2 { margin: 0; }
.more { display: inline-flex; align-items: center; gap: 2px; font-size: 13.5px; font-weight: 600; }
.more .ic { width: 16px; height: 16px; }
.back-link { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; font-size: 14px; margin-bottom: 12px; }
.back-link .ic { width: 18px; height: 18px; }
.narrow { max-width: 760px; margin-left: auto; margin-right: auto; }
.narrow-l { max-width: 860px; }

.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h1 { margin-bottom: 4px; color: var(--heading); }
.page-head p { max-width: 640px; margin: 0; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 40px; padding: 0 16px;
  border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--text);
  font-weight: 600; font-size: 14px; cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, transform .1s;
}
.btn:hover { text-decoration: none; border-color: var(--teal); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn .ic { width: 18px; height: 18px; }
.btn-primary { background: var(--teal); border-color: var(--teal); color: #fff; }
.btn-primary:hover { background: var(--teal-d); border-color: var(--teal-d); }
.btn-pink { background: var(--pink); border-color: var(--pink); color: #fff; }
.btn-pink:hover { background: var(--pink-d); border-color: var(--pink-d); }
.btn-ghost { background: transparent; }
.btn-ghost:hover { background: var(--teal-l); }
.btn-danger, .btn.danger:hover { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.danger { color: var(--danger); }
.btn-glass { background: rgba(255,255,255,.14); color: #fff; border-color: rgba(255,255,255,.4); backdrop-filter: blur(6px); }
.btn-glass:hover { background: rgba(255,255,255,.24); border-color: #fff; }
.btn-strava { background: var(--strava); border-color: var(--strava); color: #fff; }
.btn-sm { height: 32px; padding: 0 11px; font-size: 13px; border-radius: 8px; }
.btn-lg { height: 50px; font-size: 16px; }
.btn-block { width: 100%; }
.file-btn { position: relative; }

.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 20px; font-size: 12px; font-weight: 600; background: var(--soft-2); color: var(--muted); white-space: nowrap; }
.badge .ic { width: 13px; height: 13px; }
.badge-teal { background: var(--mint-l); color: #0e6b55; }
.badge-pink { background: var(--pink-l); color: var(--pink-d); }
.badge-navy { background: var(--navy-l); color: var(--navy); }
.badge-strava { background: #fff0e8; color: #c43c00; }
.badges { display: flex; gap: 5px; flex-wrap: wrap; align-items: center; margin-top: 3px; }

.avatar { display: inline-grid; place-items: center; border-radius: 50%; color: #fff; font-weight: 700; flex: none; object-fit: cover; letter-spacing: .3px; background: var(--teal); }
.mlink { display: inline-flex; align-items: center; gap: 9px; color: var(--text); min-width: 0; }
.mlink:hover { text-decoration: none; }
.mlink:hover b { color: var(--teal); }
.mlink span { min-width: 0; }
.mlink b { display: block; font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mlink small { display: block; color: var(--muted); font-size: 12px; }

.stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.stats-row.six { grid-template-columns: repeat(6, 1fr); }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); min-width: 0; }
.stat-label { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.stat-value { font: 700 28px/1.15 var(--display); color: var(--heading); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.stat-sub { font-size: 12px; color: var(--muted); }
.stat.pink { background: linear-gradient(135deg, var(--pink), #f45aae); border-color: transparent; color: #fff; }
.stat.pink .stat-label, .stat.pink .stat-sub, .stat.pink .warn-t { color: rgba(255,255,255,.88); }
.stat.pink .stat-value { color: #fff; }

.bar { height: 8px; background: var(--soft-2); border-radius: 6px; overflow: hidden; margin: 6px 0 2px; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--teal), var(--mint)); border-radius: 6px; transition: width .4s; }
.bar.done i { background: linear-gradient(90deg, var(--mint), #4fd1a5); }
.bar.thin { height: 5px; }

.tabs { display: inline-flex; gap: 4px; padding: 4px; background: var(--soft-2); border-radius: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.tabs a { padding: 6px 13px; border-radius: 9px; color: var(--muted); font-weight: 600; font-size: 14px; white-space: nowrap; }
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.active { background: var(--surface); color: var(--teal-d); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.tabs a i { font-style: normal; font-size: 11.5px; background: var(--pink); color: #fff; border-radius: 9px; padding: 0 6px; margin-left: 3px; }
.toolbar { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; margin-bottom: 4px; }
.search { display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; height: 40px; min-width: 240px; margin-bottom: 14px; }
.search input { border: 0; outline: none; background: transparent; flex: 1; min-width: 0; }
.search .ic { color: var(--muted); width: 18px; height: 18px; }
.filters { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.filters select { height: 40px; width: auto; }
.sec-head select { width: auto; }

.empty { text-align: center; padding: 40px 20px; background: var(--surface); border: 1px dashed var(--field-line); border-radius: var(--radius); margin-bottom: 16px; }
.empty-ic { width: 40px; height: 40px; color: #9db8b3; margin-bottom: 8px; }
.note { background: var(--teal-l); border-radius: 10px; padding: 10px 14px; font-size: 13.5px; display: flex; gap: 8px; align-items: flex-start; margin: 10px 0; }
.note .ic { width: 18px; height: 18px; color: var(--teal); flex: none; margin-top: 1px; }
.note.warn { background: var(--warn-l); }
.note.warn .ic { color: var(--warn); }

/* ===== Biểu mẫu ===== */
.form { display: flex; flex-direction: column; gap: 12px; }
.form label, .form .field { display: flex; flex-direction: column; gap: 5px; font-size: 13.5px; font-weight: 600; color: var(--text); }
.form .label { font-size: 13.5px; font-weight: 600; }
input, select, textarea { border: 1px solid var(--field-line); border-radius: 9px; padding: 9px 11px; background: var(--field); font-size: 15px; font-weight: 400; width: 100%; }
select { height: 41px; padding: 0 9px; }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(30,107,107,.15); }
input[type=checkbox], input[type=radio] { width: auto; accent-color: var(--teal); }
.form label.check, label.check { flex-direction: row; align-items: center; gap: 8px; font-weight: 500; cursor: pointer; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-row.three { grid-template-columns: repeat(3, 1fr); }
.form-inline { display: flex; gap: 8px; }
.form-inline input { flex: 1; }
.comment-form { display: flex; gap: 8px; margin-top: 10px; }
.comment-form.sm input { padding: 6px 10px; font-size: 14px; }
.divider { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; margin: 20px 0; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }

/* ===== Trang chủ ===== */
.hero { position: relative; border-radius: 20px; overflow: hidden; margin-bottom: 18px; min-height: 360px; display: flex; align-items: flex-end; background: var(--teal-d); }
.hero-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 40%; }
.hero::after { content: ''; position: absolute; inset: 0; background: linear-gradient(100deg, rgba(19,75,75,.94) 0%, rgba(19,75,75,.78) 38%, rgba(19,75,75,.15) 75%), linear-gradient(0deg, rgba(19,75,75,.55), transparent 50%); }
.hero-inner { position: relative; z-index: 1; padding: 34px; color: #fff; max-width: 560px; }
.hero-logo { width: 74px; height: 74px; margin-bottom: 10px; filter: drop-shadow(0 4px 10px rgba(0,0,0,.25)); }
.eyebrow { text-transform: uppercase; letter-spacing: 2px; font-size: 12px; font-weight: 600; color: #9fe3d1; margin-bottom: 4px; }
.hero h1 { font-size: 54px; line-height: .95; margin-bottom: 8px; color: #fff; text-transform: uppercase; }
.hero-slogan { font: italic 600 19px var(--display); letter-spacing: .5px; color: #ffc2e3; margin-bottom: 18px; }
.hero-slogan.dark { color: var(--pink-d); margin-bottom: 8px; }
.hero-cta { display: flex; gap: 10px; flex-wrap: wrap; }
.grid-main { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 18px; align-items: start; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.grid-2.tight { gap: 12px; }
.grid-2 > .card, .grid-2 > section { margin-bottom: 0; }
.grid-2 + * { margin-top: 16px; }

.ch-card h3 { font-size: 17px; margin: 8px 0 6px; }
.ch-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.ch-meta { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.ch-meta span { display: inline-flex; align-items: center; gap: 4px; }
.ch-meta .ic { width: 15px; height: 15px; }
.ch-mine { margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--line); }
.ch-card { margin-bottom: 12px; }

.rank-list { list-style: none; margin: 0; padding: 0; }
.rank-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--divider); }
.rank-row:last-child { border-bottom: 0; }
.rank-row .mlink { flex: 1; }
.rank-val { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; }
.rank-no { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--soft); font: 700 14px var(--display); color: var(--muted); flex: none; }
.rank-no.r1 { background: #ffd54f; color: #6d4c00; }
.rank-no.r2 { background: #cfd8dc; color: #37474f; }
.rank-no.r3 { background: #ffab91; color: #6d2b14; }
.rank-list.big .rank-row { padding: 11px 4px; }

.link-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.link-btn { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 10px; background: var(--teal-l); color: var(--teal-d); font-weight: 600; font-size: 13.5px; border: 0; cursor: pointer; text-align: left; }
.link-btn:hover { background: #d3e9e5; text-decoration: none; }
.link-btn.disabled { opacity: .5; cursor: not-allowed; }
.link-btn .ic { width: 18px; height: 18px; }

/* ===== Thông báo ===== */
.post-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 10px; }
.post h3 { font-size: 17px; }
.post-body { color: var(--text-2); }
.post-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.chip-btn { display: inline-flex; align-items: center; gap: 5px; padding: 5px 11px; border-radius: 20px; border: 1px solid var(--line); background: var(--surface); font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; }
.chip-btn:hover { border-color: var(--teal); color: var(--teal); text-decoration: none; }
.chip-btn .ic { width: 16px; height: 16px; }
.chip-btn.on { color: var(--pink); border-color: var(--pink-l); background: var(--pink-l); }
.chip-btn.on .ic { fill: var(--pink); }
.chip-btn.danger:hover { color: var(--danger); border-color: var(--danger); }
.comments { list-style: none; padding: 0; margin: 0; }
.comments li { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--divider); }
.comments p { margin: 2px 0 0; }
.reply { background: var(--teal-l); padding: 7px 11px; border-radius: 9px; margin-top: 6px; font-size: 13.5px; }

/* ===== Sự kiện & ảnh ===== */
.event-row { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 10px; color: var(--text); }
.event-row:hover { background: var(--teal-l); text-decoration: none; }
.event-row b { display: block; font-size: 14.5px; }
.event-row small { display: flex; align-items: center; gap: 4px; }
.event-row small .ic { width: 13px; height: 13px; }
.date-tile { display: grid; place-items: center; width: 50px; height: 54px; border-radius: 11px; background: var(--teal); color: #fff; flex: none; line-height: 1; }
.date-tile b { font: 700 22px var(--display); }
.date-tile small { font-size: 11px; opacity: .85; }
.event-hero h1 { margin-top: 8px; }
.ev-meta { display: flex; gap: 16px; flex-wrap: wrap; color: var(--muted); font-size: 14px; }
.ev-meta span { display: inline-flex; align-items: center; gap: 5px; }
.ev-meta .ic { width: 16px; height: 16px; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.photo { padding: 0; border: 0; border-radius: 10px; overflow: hidden; aspect-ratio: 4/3; cursor: zoom-in; background: var(--soft-2); }
.photo img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.photo:hover img { transform: scale(1.04); }
.photo-full { width: 100%; border-radius: 10px; }
.member-chips { display: flex; flex-wrap: wrap; gap: 10px 16px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 3px; background: var(--soft); border-radius: 20px; font-size: 13px; font-weight: 500; }

/* ===== Thành viên ===== */
.grid-members { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.member-card { margin: 0; display: flex; flex-direction: column; gap: 10px; }
.mc-top { display: flex; gap: 12px; align-items: center; color: var(--text); }
.mc-top:hover { text-decoration: none; }
.mc-top b { font-size: 15px; }
.mc-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: auto; }
.lv { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 20px; font-size: 12px; font-weight: 700; white-space: nowrap; color: #fff; background: #8aa5a1; }
.lv-2 { background: #6f9e97; } .lv-3 { background: var(--mint); } .lv-4 { background: #1f9a80; }
.lv-5 { background: var(--teal); } .lv-6 { background: var(--navy); } .lv-7 { background: #7b3fa0; }
.lv-8 { background: var(--pink-d); } .lv-9 { background: linear-gradient(90deg, var(--pink), #ff8a00); }
.lv-scale { display: flex; flex-wrap: wrap; gap: 8px; }
.lv-scale .lv { flex-direction: column; align-items: flex-start; padding: 6px 12px; border-radius: 10px; gap: 0; }
.lv-scale small { font-weight: 500; opacity: .85; }

/* ===== Thử thách ===== */
.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; margin-bottom: 16px; }
.grid-cards.wide { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.grid-cards > .card { margin: 0; }
.rules-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 14px 0 0; }
.rules-grid div { background: var(--soft); border-radius: 10px; padding: 9px 12px; }
.rules-grid dt { font-size: 12px; color: var(--muted); }
.rules-grid dd { margin: 0; font-weight: 600; }
.my-progress { border-left: 4px solid var(--teal); }
.my-progress.is-done { border-left-color: var(--mint); background: linear-gradient(90deg, var(--mint-l), var(--surface) 60%); }
.big-num { font: 700 38px/1.1 var(--display); color: var(--heading); margin-top: 6px; }
.big-num small { font-size: 20px; color: var(--muted); }
.table-wrap { overflow-x: auto; margin: 0 -4px; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .4px; padding: 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 9px 8px; border-bottom: 1px solid var(--divider); vertical-align: middle; }
.table tr.me td { background: var(--pink-soft); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table td.w-bar { min-width: 140px; }
.table td.w-bar small { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; }
.table td.w-bar .ic { width: 13px; height: 13px; }
.table select { height: 34px; font-size: 13.5px; min-width: 120px; }
.hof-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.hof-dist { font: 800 34px/1 var(--display); color: var(--pink); }
.podium { display: flex; gap: 10px; align-items: flex-end; justify-content: center; margin: 10px 0; }
.pod { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; padding: 14px 10px 12px; border-radius: 12px; background: var(--soft); width: 140px; font-size: 13px; }
.pod b { font-size: 13.5px; }
.pod i { position: absolute; top: -10px; font: 800 16px/26px var(--display); font-style: normal; width: 26px; height: 26px; border-radius: 50%; background: #cfd8dc; }
.pod-1 { order: 2; padding-top: 26px; background: var(--gold-l); } .pod-1 i { background: #ffd54f; }
.pod-2 { order: 1; } .pod-3 { order: 3; } .pod-3 i { background: #ffab91; }
.qr-box { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.qr-box img { width: 220px; height: auto; border-radius: 10px; border: 1px solid var(--line); }
.qr-box p { margin: 0 0 4px; font-size: 14px; }
.draw-stage { text-align: center; padding: 30px 10px; margin: 14px 0; background: radial-gradient(circle at 50% 30%, #2a8585, var(--teal-d)); border-radius: 16px; color: #fff; }
.draw-stage .muted { color: #b9dcd7; }
.draw-name { font: 800 42px/1.1 var(--display); min-height: 50px; letter-spacing: .5px; }
.draw-name.spinning { color: #ffc2e3; }
.draw-name.winner { color: #fff; animation: pop .5s ease; text-shadow: 0 0 24px rgba(238,42,150,.8); }
@keyframes pop { 0% { transform: scale(.7); } 60% { transform: scale(1.12); } 100% { transform: scale(1); } }
.simple-list { list-style: none; margin: 0; padding: 0; }
.simple-list li { padding: 8px 0; border-bottom: 1px solid var(--divider); }
.simple-list li:last-child { border-bottom: 0; }

/* ===== Chợ Runner ===== */
.how { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 16px; }
.how div { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; position: relative; }
.how span { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--pink); color: #fff; font: 700 14px var(--display); margin-bottom: 4px; }
.how b { display: block; font-size: 14px; }
.how small { color: var(--muted); font-size: 12.5px; display: block; line-height: 1.4; }
.cat-chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 12px; scrollbar-width: thin; }
.cat { display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: 30px; background: var(--surface); border: 1px solid var(--line); color: var(--text); font-weight: 600; font-size: 14px; white-space: nowrap; }
.cat:hover { border-color: var(--teal); text-decoration: none; }
.cat.active { background: var(--teal); border-color: var(--teal); color: #fff; }
.cat i { font-style: normal; font-size: 12px; opacity: .7; }
.cat .ic { width: 18px; height: 18px; }
.listing { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.listing-img { position: relative; aspect-ratio: 1; background: var(--soft); overflow: hidden; }
.listing-img img { width: 100%; height: 100%; object-fit: cover; }
.listing-body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 3px; flex: 1; }
.listing-body h3 { font-size: 14.5px; font-weight: 600; margin: 0; line-height: 1.35; }
.price { font: 700 22px/1.1 var(--display); color: var(--pink-d); font-variant-numeric: tabular-nums; }
.price.big { font-size: 36px; margin: 4px 0 10px; }
.seller-mini { display: flex; align-items: center; gap: 6px; font-size: 12.5px; margin-top: auto; padding-top: 6px; white-space: nowrap; overflow: hidden; }
.ribbon { position: absolute; top: 10px; left: 10px; background: rgba(19,48,47,.85); color: #fff; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 20px; }
.ribbon.sold { background: var(--pink); }
.ph { width: 100%; height: 100%; display: grid; place-items: center; color: rgba(255,255,255,.9); background: linear-gradient(135deg, var(--teal), var(--mint)); }
.ph .ic { width: 38%; height: 38%; stroke-width: 1.4; }
.ph-huy-chuong { background: linear-gradient(135deg, #f6b93b, #e58e26); }
.ph-ao-thi-dau { background: linear-gradient(135deg, var(--pink), #f78fc6); }
.ph-giay { background: linear-gradient(135deg, var(--navy), #6a6ab0); }
.ph-dong-ho { background: linear-gradient(135deg, #263238, #546e7a); }
.ph-phu-kien { background: linear-gradient(135deg, var(--teal), var(--mint)); }
.ph-sm { width: 52px; height: 52px; border-radius: 10px; flex: none; }
.listing-detail { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; margin-bottom: 18px; }
.gallery-main { position: relative; aspect-ratio: 1; border-radius: var(--radius); overflow: hidden; background: var(--soft); }
.gallery-main img, .gallery-main .ph { width: 100%; height: 100%; object-fit: cover; }
.gallery-thumbs { display: flex; gap: 8px; margin-top: 8px; }
.gallery-thumbs button { width: 70px; height: 70px; padding: 0; border: 2px solid transparent; border-radius: 10px; overflow: hidden; cursor: pointer; background: none; }
.gallery-thumbs button.on { border-color: var(--pink); }
.gallery-thumbs img { width: 100%; height: 100%; object-fit: cover; }
.ld-info h1 { font-family: var(--font); font-size: 24px; font-weight: 700; margin-top: 8px; }
.spec { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0 0 12px; }
.spec div { background: var(--soft); border-radius: 10px; padding: 8px 12px; }
.spec dt { font-size: 12px; color: var(--muted); }
.spec dd { margin: 0; font-weight: 600; font-size: 14px; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.spec .ic { width: 15px; height: 15px; }
.ld-desc { white-space: normal; color: var(--text-2); }
.fee-box { background: var(--soft); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin: 12px 0; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.fee-box.flat { background: transparent; border: 0; padding: 0; }
.fee-box .total { border-top: 1px dashed var(--field-line); padding-top: 8px; font-size: 15px; }
.fee-box .total b { font: 700 22px var(--display); color: var(--pink-d); }
.fee-box p { margin: 2px 0 0; display: flex; gap: 5px; align-items: center; }
.fee-box .ic { width: 15px; height: 15px; color: var(--teal); }
.seller-card { margin-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.seller-stats { display: flex; justify-content: space-between; font-size: 13px; flex-wrap: wrap; gap: 6px; }
.stars i { font-style: normal; color: #d5dedc; }
.stars i.on { color: #f5a623; }
.order-mini { display: flex; gap: 12px; align-items: center; color: var(--text); margin: 12px 0; }
.order-mini:hover { text-decoration: none; }
.order-mini .om { width: 64px; height: 64px; border-radius: 10px; object-fit: cover; flex: none; }
.checklist { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 5px; }
.checklist li { display: flex; gap: 6px; align-items: flex-start; }
.checklist .ic { width: 16px; height: 16px; color: var(--ok); margin-top: 2px; }
.img-drafts { display: flex; gap: 10px; flex-wrap: wrap; }
.img-draft, .img-add { position: relative; width: 96px; height: 96px; border-radius: 12px; overflow: hidden; }
.img-draft img { width: 100%; height: 100%; object-fit: cover; }
.img-draft button { position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; border-radius: 50%; border: 0; background: rgba(0,0,0,.6); color: #fff; display: grid; place-items: center; cursor: pointer; padding: 0; }
.img-draft button .ic { width: 14px; height: 14px; }
.img-add { display: flex !important; flex-direction: column; align-items: center; justify-content: center; gap: 2px !important; border: 2px dashed #b9cfcb; color: var(--teal); cursor: pointer; font-size: 12.5px !important; }
.img-add:hover { background: var(--teal-l); }
.list-card { padding: 6px; }
.order-row { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 10px; color: var(--text); }
.order-row:hover { background: var(--soft); text-decoration: none; }
.order-row img { width: 52px; height: 52px; border-radius: 10px; object-fit: cover; flex: none; }
.order-row b { display: block; font-size: 14.5px; }
.order-row small { display: block; font-size: 12.5px; }
.order-row .right { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: none; }
.ost { font-size: 11.5px; font-weight: 700; padding: 2px 9px; border-radius: 20px; white-space: nowrap; background: var(--soft-2); color: var(--muted); }
.ost-cho-thanh-toan { background: var(--warn-l); color: var(--warn); }
.ost-da-thanh-toan, .ost-dang-giao { background: var(--navy-l); color: var(--navy); }
.ost-da-nhan { background: var(--pink-l); color: var(--pink-d); }
.ost-hoan-tat { background: var(--mint-l); color: #0e6b55; }
.ost-huy { background: var(--danger-l); color: var(--danger); }
.stepper { list-style: none; padding: 0; margin: 16px 0 6px; display: flex; flex-direction: column; }
.stepper li { display: flex; gap: 12px; position: relative; padding-bottom: 16px; }
.stepper li:not(:last-child)::before { content: ''; position: absolute; left: 14px; top: 30px; bottom: 2px; width: 2px; background: var(--line); }
.stepper li.done:not(:last-child)::before { background: var(--mint); }
.stepper li > span { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--soft); color: var(--muted); font-weight: 700; font-size: 13px; flex: none; }
.stepper li.done > span { background: var(--mint); color: #fff; }
.stepper li.now > span { background: var(--pink); color: #fff; box-shadow: 0 0 0 5px var(--pink-l); }
.stepper li > span .ic { width: 16px; height: 16px; }
.stepper b { display: block; font-size: 14.5px; }
.stepper small { color: var(--muted); font-size: 12.5px; }
.stepper li:not(.done):not(.now) b { color: var(--muted); font-weight: 600; }
.contact-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--divider); flex-wrap: wrap; }
.contact-row:last-of-type { border-bottom: 0; }
.timeline { list-style: none; padding: 0 0 0 16px; margin: 0; border-left: 2px solid var(--line); }
.timeline li { position: relative; padding: 4px 0 10px 10px; display: flex; flex-direction: column; }
.timeline li::before { content: ''; position: absolute; left: -23px; top: 9px; width: 10px; height: 10px; border-radius: 50%; background: var(--teal); border: 2px solid #fff; }
.rate-input { display: inline-flex; flex-direction: row-reverse; justify-content: flex-end; gap: 2px; }
.rate-input input { display: none; }
.rate-input label { font-size: 30px; color: #d5dedc; cursor: pointer; line-height: 1; }
.rate-input input:checked ~ label, .rate-input label:hover, .rate-input label:hover ~ label { color: #f5a623; }

/* ===== Hồ sơ ===== */
.profile-head { display: flex; gap: 20px; align-items: flex-start; flex-wrap: wrap; }
.ph-avatar { position: relative; }
.ph-cam { position: absolute; bottom: 0; right: 0; width: 30px; height: 30px; border-radius: 50%; background: var(--pink); color: #fff; display: grid; place-items: center; cursor: pointer; border: 2px solid #fff; }
.ph-cam .ic { width: 15px; height: 15px; }
.ph-main { flex: 1; min-width: 240px; }
.ph-main h1 { margin-bottom: 4px; }
.ph-lv { display: flex; gap: 10px; align-items: center; margin-top: 10px; flex-wrap: wrap; }
.ph-follow { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 8px; }
.ph-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.strava { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; border-left: 4px solid var(--strava); }
.strava-logo { width: 44px; height: 44px; border-radius: 12px; background: var(--strava); color: #fff; display: grid; place-items: center; flex: none; }
.strava p { margin: 2px 0 0; }
.chart { display: flex; align-items: flex-end; gap: 6px; height: 170px; padding-top: 18px; }
.col-bar { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; position: relative; min-width: 0; }
.col-bar > i { width: 100%; max-width: 34px; background: linear-gradient(180deg, var(--mint), var(--teal)); border-radius: 6px 6px 2px 2px; min-height: 2px; }
.col-bar.now > i { background: linear-gradient(180deg, #f78fc6, var(--pink)); }
.col-bar .v { font-size: 11px; font-weight: 700; color: var(--muted); margin-bottom: 2px; }
.col-bar small { font-size: 10.5px; color: var(--muted); margin-top: 4px; white-space: nowrap; }
.chart.dual .pair { display: flex; align-items: flex-end; gap: 3px; height: 100%; width: 100%; justify-content: center; }
.chart.dual .pair i { width: 40%; max-width: 22px; border-radius: 5px 5px 2px 2px; min-height: 2px; }
.thu { background: var(--mint); }
.chi { background: var(--pink); }
.legend { display: flex; gap: 14px; font-size: 13px; margin-top: 8px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; }
.pr-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pr { background: var(--soft); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; }
.pr-d { font: 800 15px var(--display); color: var(--pink-d); letter-spacing: .5px; }
.pr b { font-size: 24px; color: var(--heading); }
.install p { margin-bottom: 10px; }
.install h2 { display: flex; align-items: center; gap: 8px; }

/* ===== Giới thiệu, hỗ trợ, quản trị ===== */
.about-hero { display: flex; gap: 22px; align-items: center; }
.about-hero img { width: 150px; height: 150px; flex: none; }
.bcn-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.rules { padding-left: 20px; margin: 0; }
.rules li { padding: 4px 0; }
.notif { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border-radius: 10px; color: var(--text); }
.notif:hover { background: var(--soft); text-decoration: none; }
.notif .ic { color: var(--muted); margin-top: 2px; }
.notif small { display: block; font-size: 12px; }
.notif.unread { background: var(--pink-soft); }
.notif.unread .ic { color: var(--pink); }
.ticket { padding: 12px 0; border-bottom: 1px solid var(--divider); }
.ticket.done { opacity: .7; }
.ticket p { margin: 6px 0 0; }

/* ===== Đăng nhập ===== */
.auth { display: grid; grid-template-columns: 1fr 1fr; max-width: 920px; margin: 10px auto; background: var(--surface); border-radius: 20px; overflow: hidden; box-shadow: 0 10px 40px rgba(19,48,47,.12); }
.auth-side { background: linear-gradient(160deg, var(--teal) 0%, var(--teal-d) 100%); color: #fff; padding: 36px; display: flex; flex-direction: column; }
.auth-side img { width: 84px; height: 84px; margin-bottom: 10px; }
.auth-side h2 { font: 700 30px var(--display); margin-bottom: 18px; }
.auth-side ul { list-style: none; padding: 0; margin: 0 0 auto; display: flex; flex-direction: column; gap: 12px; }
.auth-side li { display: flex; gap: 10px; align-items: center; font-size: 14.5px; }
.auth-side li .ic { color: #9fe3d1; }
.auth-side .hero-slogan { margin: 24px 0 0; }
.auth-main { padding: 36px; }
.auth-main h1 { color: var(--heading); }

/* ===== Modal & toast ===== */
.modal-wrap { position: fixed; inset: 0; z-index: 100; background: rgba(10,30,30,.5); display: flex; align-items: center; justify-content: center; padding: 16px; animation: fade .15s; }
.modal { background: var(--surface); border-radius: 18px; width: 100%; max-width: 520px; max-height: calc(100vh - 32px); display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0,0,0,.25); animation: rise .2s ease; }
.modal-wide { max-width: 900px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 14px 10px 20px; border-bottom: 1px solid var(--line); }
.modal-head h3 { margin: 0; font-size: 17px; }
.modal-body { padding: 18px 20px 20px; overflow-y: auto; }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { transform: translateY(14px); opacity: 0; } }
#toasts { position: fixed; z-index: 200; bottom: 22px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: max-content; max-width: calc(100vw - 32px); }
.toast { background: var(--teal-d); color: #fff; padding: 10px 18px; border-radius: 30px; font-size: 14px; font-weight: 500; box-shadow: 0 6px 20px rgba(0,0,0,.2); animation: rise .2s; transition: opacity .3s, transform .3s; }
.toast-err { background: var(--danger); }
.toast-warn { background: var(--navy); }
.toast.out { opacity: 0; transform: translateY(8px); }

/* ===== Responsive ===== */
@media (max-width: 1100px) {
  .grid-main { grid-template-columns: 1fr; }
  .stats-row.six { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 900px) {
  .only-mobile { display: inline-flex; }
  .sidebar { position: fixed; z-index: 60; left: 0; top: 0; transform: translateX(-100%); transition: transform .25s ease; box-shadow: 10px 0 30px rgba(0,0,0,.2); }
  .drawer-open .sidebar { transform: none; }
  .drawer-open .scrim { display: block; position: fixed; inset: 0; z-index: 55; background: rgba(0,0,0,.4); }
  .topbar { padding: 0 10px; }
  .topbar-title { display: none; }
  .brand-mini { flex: 1; }
  .demo-bar { padding: 6px 16px; }
  #view { padding: 16px 16px 90px; }
  .bottomnav {
    display: flex; position: fixed; z-index: 30; bottom: 0; left: 0; right: 0; background: #fff; border-top: 1px solid var(--line);
    padding: 4px 4px calc(4px + env(safe-area-inset-bottom));
  }
  .bottomnav a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0; font-size: 11px; font-weight: 600; color: var(--muted); border-radius: 10px; }
  .bottomnav a:hover { text-decoration: none; }
  .bottomnav a.active { color: var(--pink); }
  .bottomnav .ic { width: 22px; height: 22px; }
  .listing-detail { grid-template-columns: 1fr; }
  .how { grid-template-columns: 1fr 1fr; }
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .auth { grid-template-columns: 1fr; }
  .auth-side { padding: 24px; }
  .auth-side ul, .auth-side .hero-slogan { display: none; }
  .auth-side h2 { margin: 0; }
  .auth-side { flex-direction: row; align-items: center; gap: 12px; }
  .auth-side img { width: 56px; height: 56px; margin: 0; }
}
@media (max-width: 640px) {
  h1 { font-size: 26px; }
  .stats-row, .stats-row.six { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-value { font-size: 24px; }
  .hero { min-height: 420px; border-radius: 16px; }
  .hero::after { background: linear-gradient(0deg, rgba(19,75,75,.97) 15%, rgba(19,75,75,.55) 60%, rgba(19,75,75,.2)); }
  .hero-inner { padding: 22px; }
  .hero h1 { font-size: 40px; }
  .hero-logo { width: 56px; height: 56px; }
  .form-row, .form-row.three { grid-template-columns: 1fr; }
  .rules-grid { grid-template-columns: 1fr 1fr; }
  .grid-cards { grid-template-columns: 1fr 1fr; gap: 10px; }
  .grid-cards.wide { grid-template-columns: 1fr; }
  .listing-body h3 { font-size: 13.5px; }
  .price { font-size: 19px; }
  .search { min-width: 0; width: 100%; }
  .toolbar { flex-direction: column; align-items: stretch; gap: 0; }
  .hide-sm { display: none; }
  .about-hero { flex-direction: column; text-align: center; }
  .about-hero img { width: 110px; height: 110px; }
  .page-head { flex-direction: column; }
  .page-actions .btn { flex: 1; }
  .podium { gap: 6px; }
  .pod { width: auto; flex: 1; padding: 12px 6px; }
  .draw-name { font-size: 32px; }
  .form-inline { flex-direction: column; }
  .order-row .right b { font-size: 13.5px; }
  .modal-wrap { align-items: flex-end; padding: 0; }
  .modal { border-radius: 18px 18px 0 0; max-height: 92vh; }
  .link-btns { grid-template-columns: 1fr 1fr; }
  .qr-box { flex-direction: column; align-items: flex-start; }
}
/* ===== Điện thoại: giao diện kiểu app — vừa khít màn hình, thanh trên/dưới cố định, gọn ===== */
.demo-pill { display: none; }
.icon-btn.top-back { display: none; }
/* Trang đăng nhập: một form mỗi lần, chuyển bằng 2 nút — vừa một màn hình trên điện thoại và laptop */
.auth-main h1, .auth-main .divider, body.route-auth .topbar-right { display: none; }
.auth-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; background: var(--soft-2); border-radius: 12px; margin-bottom: 16px; }
.auth-switch button { height: 40px; border: 0; border-radius: 9px; background: transparent; font-weight: 600; font-size: 14.5px; color: var(--muted); cursor: pointer; }
.auth-switch button:hover { color: var(--text); }
.auth-main[data-tab="login"] .auth-switch [data-tab="login"],
.auth-main[data-tab="register"] .auth-switch [data-tab="register"] { background: var(--surface-solid); color: var(--heading); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.auth-main[data-tab="login"] .auth-register,
.auth-main[data-tab="register"] .auth-login { display: none; }
.auth-main .form { gap: 10px; }
.auth-forgot { display: none; }
.auth-main[data-tab="forgot"] .auth-forgot { display: flex; }
.auth-main[data-tab="forgot"] .auth-login, .auth-main[data-tab="forgot"] .auth-register, .auth-main[data-tab="forgot"] .auth-switch { display: none; }
.auth-forgot h3 { margin: 0; }
.link-like { background: none; border: 0; padding: 4px 0; color: var(--link); font-weight: 600; font-size: 13.5px; cursor: pointer; align-self: center; }
.link-like:hover { text-decoration: underline; }
/* Màn hình chờ / chờ duyệt */
.screen { min-height: 60vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 6px; max-width: 460px; margin: 0 auto; padding: 20px; }
.screen-logo { width: 96px; height: 96px; margin-bottom: 8px; }
.screen p { margin: 0 0 6px; }
.center-row { justify-content: center; margin-top: 10px; }
.pulse { animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .45; transform: scale(.94); } }
.table tr.pending td { background: var(--pink-soft); }
@media (min-width: 901px) {
  body.route-auth #view { min-height: calc(100vh - 90px); display: flex; align-items: center; padding-bottom: 24px; }
  .auth { width: 100%; margin: 0 auto; }
  .auth-side, .auth-main { padding: 32px; }
}
@media (max-width: 900px) {
  html, body { overscroll-behavior-y: none; }
  body { -webkit-tap-highlight-color: transparent; font-size: 14px; }
  .app { min-height: 100dvh; }
  .topbar {
    position: fixed; left: 0; right: 0; top: 0; height: calc(52px + env(safe-area-inset-top));
    padding: env(safe-area-inset-top) 6px 0; gap: 4px;
    background: linear-gradient(135deg, var(--teal-d), var(--teal)); border: 0; color: #fff; backdrop-filter: none;
    box-shadow: 0 2px 10px rgba(19, 75, 75, .25);
  }
  .topbar .icon-btn { color: #fff; }
  .topbar .icon-btn:hover { background: rgba(255,255,255,.12); }
  .brand-mini { color: #fff; }
  .brand-mini img { width: 32px; height: 32px; }
  .demo-pill { display: inline-block; font: 700 9.5px/1 var(--font); font-style: normal; letter-spacing: .6px; padding: 3px 6px; border-radius: 6px; background: var(--pink); color: #fff; }
  .topbar.has-title .brand-mini { display: none; }
  .topbar.is-sub .menu-btn { display: none; }
  .topbar.is-sub .top-back { display: inline-grid; }
  .topbar.has-title .topbar-title { display: block; flex: 1; font-size: 16.5px; color: #fff; text-align: left; padding-left: 2px; }
  .me-chip { background: rgba(255,255,255,.14); border-color: transparent; color: #fff; padding: 2px; }
  .topbar .btn-primary { background: var(--pink); border-color: var(--pink); }
  .demo-bar { display: none; }
  #view { padding: calc(64px + env(safe-area-inset-top)) 12px calc(84px + env(safe-area-inset-bottom)); }

  .bottomnav {
    height: calc(62px + env(safe-area-inset-bottom)); padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
    border: 0; box-shadow: 0 -2px 14px rgba(19, 48, 47, .1); align-items: stretch;
  }
  .bottomnav a { justify-content: center; gap: 1px; padding: 0; font-size: 10.5px; position: relative; user-select: none; }
  .bottomnav a .ic { width: 23px; height: 23px; padding: 2px 0; box-sizing: content-box; width: 46px; border-radius: 14px; transition: background .15s; }
  .bottomnav a.active { color: var(--pink-d); }
  .bottomnav a.active .ic { background: var(--pink-l); }
  .bottomnav a:active .ic { transform: scale(.92); }

  /* Mật độ gọn hơn */
  h1 { font-size: 24px; }
  h2, .h2 { font-size: 15.5px; }
  .card { padding: 13px; border-radius: 13px; margin-bottom: 10px; }
  .page-head { margin-bottom: 12px; gap: 10px; }
  .page-head p { font-size: 13px; }
  .stats-row { gap: 8px; margin-bottom: 10px; }
  .stat { padding: 10px 12px; border-radius: 12px; }
  .stat-label { font-size: 11.5px; }
  .stat-value { font-size: 22px; }
  .stat-sub { font-size: 11px; }
  .btn { height: 38px; font-size: 13.5px; padding: 0 13px; }
  .btn-lg { height: 48px; font-size: 15px; }
  .tabs { margin-bottom: 10px; flex-wrap: nowrap; overflow-x: auto; max-width: 100%; scrollbar-width: none; }
  .tabs::-webkit-scrollbar, .cat-chips::-webkit-scrollbar { display: none; }
  .tabs a { padding: 6px 11px; font-size: 13px; }
  .sec-head { margin-bottom: 8px; }
  .back-link { display: none; }
  input, select, textarea { font-size: 16px; } /* tránh iPhone tự phóng to khi nhập */
  .grid-main { gap: 10px; }
  .grid-2 { gap: 10px; }
  .grid-2 + * { margin-top: 10px; }
  .grid-cards { gap: 10px; margin-bottom: 10px; }
  .how { display: flex; overflow-x: auto; gap: 8px; scroll-snap-type: x mandatory; scroll-padding: 0 12px; scrollbar-width: none; margin: 0 -12px 10px; padding: 0 12px; }
  .how::-webkit-scrollbar { display: none; }
  .how div { flex: 0 0 72%; scroll-snap-align: start; padding: 10px 12px; }
  .cat-chips { margin: 0 -12px 8px; padding: 0 12px 4px; scrollbar-width: none; }
  .cat { padding: 7px 12px; font-size: 13px; }
  .ld-info h1 { font-size: 20px; }
  .listing-detail { gap: 12px; margin-bottom: 10px; }
  .gallery-main { aspect-ratio: 4 / 3; }
  .ld-info > [data-act="buy"] { position: sticky; bottom: calc(72px + env(safe-area-inset-bottom)); z-index: 5; box-shadow: 0 6px 18px rgba(200, 30, 124, .35); }
  .price.big { font-size: 30px; }
  .modal { max-height: 88dvh; }
  .modal-body { padding-bottom: calc(20px + env(safe-area-inset-bottom)); }
  #toasts { bottom: calc(78px + env(safe-area-inset-bottom)); }

  /* Trang đăng nhập: gói gọn trong một màn hình */
  body.route-auth .bottomnav, body.route-auth .topbar-right { display: none; }
  body.route-auth #view { padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
  .auth { min-height: calc(100dvh - 76px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); display: flex; flex-direction: column; margin: 0; }
  .auth-side { padding: 14px 16px; gap: 10px; }
  .auth-side img { width: 44px; height: 44px; }
  .auth-side h2 { font-size: 22px; }
  .auth-main { flex: 1; padding: 16px; display: flex; flex-direction: column; gap: 4px; }
  .auth-switch { margin-bottom: 12px; }
}
@media (max-width: 640px) {
  /* Hero gọn: vừa nửa màn hình */
  .hero { min-height: 0; height: min(46dvh, 330px); border-radius: 16px; margin-bottom: 10px; }
  .hero::after { background: linear-gradient(0deg, rgba(19,75,75,.96) 22%, rgba(19,75,75,.45) 62%, rgba(19,75,75,.1)); }
  .hero-inner { padding: 16px; width: 100%; }
  .hero-logo { width: 44px; height: 44px; margin-bottom: 6px; }
  .eyebrow { font-size: 10.5px; margin-bottom: 2px; }
  .hero h1 { font-size: 34px; margin-bottom: 2px; }
  .hero-slogan { font-size: 16px; margin-bottom: 12px; }
  .hero-cta { flex-wrap: nowrap; gap: 8px; }
  .hero-cta .btn { flex: 1; height: 40px; padding: 0 8px; font-size: 13px; }
  /* 4 chỉ số trên một hàng ngang, trượt được */
  .stats-row { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding: 0 12px; margin: 0 -12px 10px; padding: 0 12px 2px; scrollbar-width: none; }
  .stats-row::-webkit-scrollbar { display: none; }
  .stats-row .stat { flex: 0 0 auto; min-width: 42%; scroll-snap-align: start; box-shadow: none; }
  .stats-row.six .stat { min-width: 38%; }
  .grid-cards { grid-template-columns: 1fr 1fr; gap: 8px; }
  .listing-body { padding: 8px 10px 10px; }
  .page-actions { width: 100%; }
  .page-actions .btn { flex: 1; }
  .rank-row { padding: 7px 0; }
  .member-chips { gap: 8px 12px; }
  .profile-head { gap: 12px; }
  .ph-actions { width: 100%; }
  .ph-actions .btn { flex: 1; }
  .rules-grid { gap: 6px; }
  .rules-grid div { padding: 7px 10px; }
  .big-num { font-size: 32px; }
  .chart { height: 140px; gap: 4px; }
  .chart:not(.dual) .col-bar:nth-child(even) small { visibility: hidden; }
  .col-bar .v { font-size: 10px; }
  .auth { margin: 0 -12px; border-radius: 0; box-shadow: none; }
  .auth-main { padding: 18px 16px; }
}
@media (display-mode: standalone) and (max-width: 900px) {
  body { user-select: none; -webkit-user-select: none; }
  input, textarea, .post-body, .ld-desc, p { user-select: text; -webkit-user-select: text; }
}

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