:root {
  --bg: #0a0b0d;
  --surface: #111317;
  --surface-2: #181b20;
  --line: #262a31;
  --text: #eceef0;
  --muted: #8d959e;
  --accent: #c8f25a;
  --accent-ink: #0a0b0d;
  --accent-soft: rgba(200, 242, 90, .12);
  /* Màu theo chủ đề (cùng độ sáng): ngủ, tâm trạng, vận động, học, thư giãn; não và tập trung dùng --accent */
  --c-sleep: #a5b4fc; --c-mood: #fbbf6a; --c-move: #5eead4; --c-learn: #7dd3fc; --c-calm: #f9a8d4;
  /* Chỉ dùng cho thẻ điểm trí lực ở Hôm nay (mức 60–79) */
  --grad: linear-gradient(135deg, #6d4dff 0%, #9a7bff 45%, #2fd3b4 100%);
  --bad: #e3a07e; /* cam dịu thay đỏ gắt: chỉ số chưa đạt không gây căng thẳng */
  --warn: #f5b84a;
  --chart: #3d4552;
  --r: 8px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --mono: "JetBrains Mono", ui-monospace, monospace;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; min-height: 100vh; background: var(--bg); color: var(--text);
  font: 15px/1.5 "Be Vietnam Pro", system-ui, sans-serif; -webkit-font-smoothing: antialiased;
}
/* Nền: lưới chấm + quầng sáng trôi chậm */

h1, h2, h3 { margin: 0; letter-spacing: -.01em; }
h2 { font-size: 1rem; font-weight: 600; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: .82rem; }
/* Số dùng chữ thường với độ rộng đều; font mono chỉ dành cho đồng hồ và game tính nhẩm */
.mono { font-variant-numeric: tabular-nums; }
.prob, .ans, .math-top, .timer-ring .t b { font-family: var(--mono); }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
.ic, svg.lucide { width: 18px; height: 18px; flex: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.skip { position: absolute; left: 12px; top: -60px; background: var(--accent); color: var(--accent-ink); padding: 8px 12px; border-radius: var(--r); z-index: 50; }
.skip:focus { top: 12px; }

/* Header */
.top { max-width: 1120px; margin: 0 auto; padding: 18px 16px 10px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-size: 1.15rem; letter-spacing: -.02em; }
.brand b { font-weight: 700; }
.brand span { color: var(--accent); }
.mark { width: 30px; height: 30px; overflow: visible; }
.mark path { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.mark-base { stroke: var(--accent); stroke-width: 1.6; }
.mark-spark { display: none; }

.player { display: flex; align-items: center; gap: 14px; }
.lvl { display: grid; gap: 4px; min-width: 150px; }
.lvl-top { display: flex; justify-content: space-between; gap: 10px; font-size: .82rem; }
.lvl-top b { cursor: pointer; }
.lvl-top span { color: var(--muted); }
.bar { height: 4px; background: var(--line); border-radius: 99px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--accent); border-radius: inherit; transform-origin: left; transition: width .6s var(--ease); }
.streak { display: flex; align-items: center; gap: 6px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 99px; font-family: var(--mono); font-size: .85rem; }
.streak svg { color: var(--accent); width: 16px; height: 16px; }
.player.levelup .lvl { animation: flash 1s var(--ease); }
@keyframes flash { 30% { filter: drop-shadow(0 0 10px var(--accent)); } }

/* Nav */
.nav { max-width: 1120px; margin: 0 auto; padding: 4px 16px 14px; display: flex; gap: 4px; position: sticky; top: 0; z-index: 10; background: var(--bg); }
.nav { overflow-x: auto; scrollbar-width: none; }
.nav a { white-space: nowrap; flex: none; }
.nav a { display: flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: var(--r); color: var(--muted); text-decoration: none; font-weight: 500; transition: color .2s, background .2s; position: relative; }
.nav a:hover { color: var(--text); background: var(--surface); }
.nav a.on { color: var(--text); background: var(--surface-2); }
@keyframes grow { from { transform: scaleX(0); } }

main { max-width: 1120px; margin: 0 auto; padding: 0 16px 32px; display: grid; gap: 14px; outline: none; }
footer { max-width: 1120px; margin: 0 auto; padding: 8px 16px 40px; color: var(--muted); font-size: .78rem; }

/* Lưới, thẻ */
.grid { display: grid; gap: 14px; grid-template-columns: repeat(12, 1fr); }
.c4 { grid-column: span 4; } .c5 { grid-column: span 5; } .c6 { grid-column: span 6; } .c7 { grid-column: span 7; } .c8 { grid-column: span 8; } .c12 { grid-column: span 12; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: calc(var(--r) + 4px); padding: 18px; min-width: 0; }
.head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
/* Nhãn phụ: chữ thường, không mono viết hoa (tránh "mùi AI") */
.kicker { font-size: .82rem; font-weight: 500; color: var(--muted); }
/* Lời khuyên theo điểm: màu có nghĩa (xanh tốt, vàng lưu ý, đỏ cảnh báo) */
.coach { margin-top: 4px; padding: 10px 12px; border-left: 3px solid var(--accent); background: var(--accent-soft); border-radius: 0 var(--r) var(--r) 0; font-size: .93rem; }
.coach.tone-warn { border-left-color: var(--warn); background: rgba(245, 184, 74, .1); }
.coach.tone-bad { border-left-color: var(--bad); background: rgba(227, 160, 126, .1); }
.ring.tone-warn .rv { stroke: var(--warn); }
.ring.tone-bad .rv { stroke: var(--bad); }
.chip.trend.up { color: var(--accent); border-color: rgba(200, 242, 90, .4); }
.chip.trend.down { color: var(--warn); border-color: rgba(245, 184, 74, .4); }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.center { justify-content: center; }

/* Nút: nhích lên khi hover, lún khi bấm */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 16px; border-radius: var(--r); border: 1px solid var(--line); background: var(--surface-2); color: var(--text); font-weight: 600; text-decoration: none; transition: transform .15s var(--ease), border-color .2s, background .2s; }
.btn:hover { transform: translateY(-1px); border-color: #3a404a; }
.btn:active { transform: translateY(0) scale(.97); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.sm { min-height: 30px; padding: 0 10px; font-size: .82rem; }
.btn.ghost { background: transparent; }

/* Xuất hiện khi chuyển trang (một lần) */
.entering [data-enter] { animation: enter .55s var(--ease) both; animation-delay: calc(var(--i, 0) * 60ms); }
@keyframes enter { from { opacity: 0; transform: translateY(10px); } }

/* Vòng tròn điểm */
.ring { position: relative; width: 132px; aspect-ratio: 1; flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 8; stroke-linecap: round; }
.ring .rt { stroke: var(--line); }
.ring .rv { stroke: var(--accent); stroke-dasharray: 100; stroke-dashoffset: calc(100 - var(--v)); transition: stroke-dashoffset .8s var(--ease); }
.entering .ring .rv { animation: ringIn 1.1s var(--ease) both .15s; }
@keyframes ringIn { from { stroke-dashoffset: 100; } }
.ring-c { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ring-c b { font-size: 2rem; line-height: 1; }
.ring-c small { color: var(--muted); font-size: .72rem; margin-top: 4px; }
.ring.sm { width: 46px; }
.ring.sm circle { stroke-width: 12; }
.ring.sm .ring-c b { font-size: .75rem; }

.hero { display: flex; gap: 22px; align-items: center; }
.hero h1 { font-size: 1.5rem; font-weight: 700; margin: 4px 0 6px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
.chip { font-family: var(--mono); font-size: .78rem; padding: 4px 9px; border: 1px solid var(--line); border-radius: 99px; color: var(--muted); }
.chip b { color: var(--text); }

/* Thói quen */
/* Danh sách phẳng: không hộp trong hộp, chỉ một đường kẻ mảnh giữa các dòng */
.habits { display: grid; }
.habit { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 48px; padding: 10px 2px; text-align: left; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: none; overflow: hidden; transition: color .2s; }
.habit:last-child { border-bottom: 0; }
.habit:hover:not(:disabled) .ht { color: var(--accent); }
.habit:disabled { cursor: default; }
.habit .hi { color: var(--muted); }
.habit .ht { flex: 1; min-width: 0; font-weight: 500; }
.habit .hm { font-size: .8rem; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.check { width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid #3a404a; display: grid; place-items: center; flex: none; transition: background .25s, border-color .25s; }
.check svg { width: 14px; height: 14px; fill: none; stroke: var(--accent-ink); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 24; stroke-dashoffset: 24; }
.habit.done .check { background: var(--accent); border-color: var(--accent); }
.habit.done .check svg { stroke-dashoffset: 0; }
.habit.pop .check { animation: pop .45s var(--ease); }
.habit.pop .check svg { transition: stroke-dashoffset .4s var(--ease) .1s; animation: draw .45s var(--ease) both .1s; }
@keyframes draw { from { stroke-dashoffset: 24; } }
@keyframes pop { 40% { transform: scale(1.25); } }
.habit.done .ht { color: var(--muted); }

/* Hành trình 30 ngày */
.cells { display: grid; grid-template-columns: repeat(30, minmax(0, 1fr)); gap: 3px; margin: 12px 0 8px; }
.cells i { aspect-ratio: 1 / 2.4; border-radius: 2px; background: var(--line); }
.cells i.on { background: var(--accent); }
.cells i.mark { box-shadow: inset 0 -3px 0 #3a404a; }
.cells i.on.mark { box-shadow: none; }
.entering .cells i.on { animation: fill .4s var(--ease) both; animation-delay: calc(var(--k) * 25ms + .2s); }
@keyframes fill { from { background: var(--line); } }
.chapter-line { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }

.ktip { display: flex; gap: 12px; align-items: flex-start; }
.ktip > svg { color: var(--accent); margin-top: 2px; }

/* Danh sách nhiệm vụ phụ, mục tiêu */
.list { display: grid; gap: 4px; }
.li { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 6px 10px; border-radius: var(--r); background: none; border: 0; text-align: left; width: 100%; transition: background .2s; }
.li:hover:not(:disabled) { background: var(--surface-2); }
.li .ht { flex: 1; }
.li .hm { font-family: var(--mono); font-size: .78rem; color: var(--muted); }
.li:disabled { color: var(--muted); text-decoration: line-through; cursor: default; }
.goal-form { display: flex; gap: 6px; margin-bottom: 10px; }
.field, .goal-form input, textarea, input[type=number], input[type=date], input[type=search] {
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r); padding: 9px 11px; min-width: 0; color: var(--text);
}
.goal-form input[name=title] { flex: 1; }
.goal-form input[name=target] { width: 72px; }
input:focus, textarea:focus { border-color: var(--accent); outline: none; }
.goal { padding: 8px 10px; border-radius: var(--r); background: var(--surface-2); display: grid; gap: 6px; }
.goal-top { display: flex; align-items: center; gap: 6px; }
.goal-top b { flex: 1; min-width: 0; overflow-wrap: anywhere; font-weight: 500; }
.goal.done .goal-top b { color: var(--accent); }

/* Log */
.logform { display: grid; gap: 16px; }
.logform label.f { display: grid; gap: 6px; font-weight: 500; }
.logrow { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
legend { font-weight: 500; margin-bottom: 6px; padding: 0; display: flex; justify-content: space-between; width: 100%; }
legend small { color: var(--muted); font-weight: 400; font-size: .75rem; }
.seg { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.seg input, .pill input, .tag input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: grid; place-items: center; height: 40px; border-radius: var(--r); background: var(--surface-2); border: 1px solid var(--line); font-family: var(--mono); cursor: pointer; transition: background .2s, color .2s, transform .15s var(--ease); }
.seg label:hover span { transform: translateY(-1px); }
.seg input:checked + span { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 700; }
.seg input:focus-visible + span, .pill input:focus-visible + span, .tag input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag span, .pill span { display: inline-flex; align-items: center; min-height: 34px; padding: 0 12px; border-radius: 99px; border: 1px solid var(--line); font-size: .85rem; cursor: pointer; transition: background .2s, border-color .2s; }
.tag input:checked + span, .pill input:checked + span { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
textarea { width: 100%; resize: vertical; min-height: 44px; line-height: 1.45; }
.journal { display: grid; gap: 8px; }

.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.tile { background: var(--surface-2); border-radius: var(--r); padding: 12px; }
.tile b { display: block; font-size: 1.5rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.tile small { color: var(--muted); font-size: .75rem; }
.chart { width: 100%; height: 150px; display: block; margin-top: 6px; }
.chart .sb { fill: var(--chart); }
.chart .ln { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.entering .chart .ln { stroke-dasharray: 1; animation: line 1.2s var(--ease) both .2s; }
@keyframes line { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
.chart .dot { fill: var(--accent); }
.chart text { fill: var(--muted); font: 9px var(--mono); }
.legend { display: flex; gap: 14px; font-size: .75rem; color: var(--muted); margin-top: 4px; }
.legend i { display: inline-block; width: 10px; height: 3px; margin-right: 6px; vertical-align: middle; border-radius: 2px; }
.insights { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.insights li { display: flex; gap: 10px; padding: 10px 12px; background: var(--surface-2); border-radius: var(--r); font-size: .9rem; }
.insights svg { color: var(--accent); }
.entries { display: grid; gap: 6px; }
.entry { background: var(--surface-2); border-radius: var(--r); }
.entry summary { display: flex; align-items: center; gap: 12px; padding: 10px 12px; cursor: pointer; list-style: none; min-height: 44px; }
.entry summary::-webkit-details-marker { display: none; }
.entry summary .snip { flex: 1; min-width: 0; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.entry .body { padding: 0 12px 12px; display: grid; gap: 8px; font-size: .9rem; }
.entry .body p span { display: block; font-family: var(--mono); font-size: .7rem; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }

/* Tracking */
.comp { display: grid; gap: 12px; }
.comp-row { display: grid; grid-template-columns: 70px 1fr 44px; gap: 10px; align-items: center; font-size: .88rem; }
.comp-row b { text-align: right; font-size: .82rem; }
.streaks { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; }
.streaks b, .big { display: block; font-size: 2.6rem; line-height: 1.05; font-weight: 700; }
.streaks small { color: var(--muted); font-size: .78rem; }
.spark { display: flex; align-items: flex-end; gap: 3px; height: 54px; margin: 10px 0 6px; }
.spark i { flex: 1; background: var(--chart); border-radius: 2px 2px 0 0; min-height: 2px; }
.spark i.now { background: var(--accent); }
.entering .spark i { animation: rise .6s var(--ease) both; transform-origin: bottom; }
@keyframes rise { from { transform: scaleY(0); } }
.hm-wrap { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: thin; }
.hm-days { display: grid; grid-template-rows: 16px repeat(7, 13px); gap: 3px; font: .62rem var(--mono); color: var(--muted); flex: none; }
.hm-grid { display: flex; gap: 3px; }
.hm-col { display: grid; grid-template-rows: 16px repeat(7, 13px); gap: 3px; }
.hm-m { font: .62rem var(--mono); color: var(--muted); white-space: nowrap; width: 13px; }
/* ô bản đồ năm: chỉ trong .hm-col/.hm-legend, để không đè lên .hm (chữ bên phải) của dòng routine */
:is(.hm-col, .hm-legend) .hm, .hm-x { width: 13px; height: 13px; border-radius: 3px; border: 0; padding: 0; display: block; }
:is(.hm-col, .hm-legend) .hm { background: var(--line); transition: transform .12s var(--ease); }
button.hm:hover { transform: scale(1.35); outline: 1px solid var(--text); }
.hm.l1 { background: rgba(200, 242, 90, .22); }
.hm.l2 { background: rgba(200, 242, 90, .45); }
.hm.l3 { background: rgba(200, 242, 90, .7); }
.hm.l4 { background: var(--accent); }
.hm.now { outline: 1px solid var(--text); outline-offset: 1px; }
.hm-legend { display: flex; align-items: center; gap: 4px; margin-top: 8px; }
.hm-legend span { margin: 0 4px; }
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.wday { display: grid; justify-items: start; gap: 2px; padding: 12px; min-height: 120px; text-align: left; border-radius: var(--r); border: 1px solid var(--line); background: var(--surface-2); transition: transform .15s var(--ease), border-color .2s; position: relative; overflow: hidden; }
.wday:hover:not(:disabled) { transform: translateY(-2px); border-color: #3a404a; }
.wday:disabled { opacity: .35; cursor: default; }
.wday b { font-size: 1.6rem; line-height: 1.2; }
.wday.now { border-color: var(--accent); }
.wday::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--line); }
.wday.l1::after { background: rgba(200, 242, 90, .3); } .wday.l2::after { background: rgba(200, 242, 90, .5); }
.wday.l3::after { background: rgba(200, 242, 90, .75); } .wday.l4::after { background: var(--accent); }
.wscore { color: var(--accent); font-size: .9rem; }
.dots { display: flex; gap: 3px; margin-top: 4px; }
.dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--line); }
.dots i.on { background: var(--muted); }

/* Tri thức */
.kgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.kcard { padding: 16px; border-radius: var(--r); background: var(--surface-2); border-left: 2px solid var(--line); display: grid; gap: 6px; align-content: start; }
.kcard.today { border-left-color: var(--accent); }
.kcard h3 { font-size: 1rem; }
.kcard p { font-size: .9rem; }
.kcard .btn { justify-self: start; margin-top: 4px; }
.kcard.read:not(.today) { border-left-color: rgba(200, 242, 90, .35); }
.kdone { display: inline-flex; align-items: center; gap: 6px; color: var(--accent); margin-top: 4px; }
.kdone svg { width: 14px; height: 14px; }

/* Điều hướng gộp + tab con */
.nav-sep { flex: 1; }
.nav a.nav-2nd { font-size: .88rem; padding: 9px 10px; }
.subnav { max-width: 1120px; margin: 0 auto; padding: 0 16px 12px; }
.subnav:empty { display: none; }
/* Tab con: chữ thường, gạch chân mảnh khi đang chọn */
.seg-tabs { display: inline-flex; gap: 20px; border-bottom: 1px solid var(--line); }
.seg-tabs a { display: inline-flex; align-items: center; min-height: 40px; color: var(--muted); text-decoration: none; font-weight: 500; font-size: .92rem; border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color .2s; }
.seg-tabs a:hover { color: var(--text); }
.seg-tabs a.on { color: var(--text); border-bottom-color: var(--accent); }
.seg-tabs svg { display: none; }
body.landing .subnav { display: none; }

.subnav { overflow-x: auto; scrollbar-width: none; }
.seg-tabs a { white-space: nowrap; }

/* Routine */
.slot { margin-bottom: 14px; }
.slot:last-child { margin-bottom: 0; }
.slot-h { display: flex; align-items: center; gap: 6px; font-size: .82rem; font-weight: 600; color: var(--muted); margin: 0 0 6px; }
.slot-h svg { width: 15px; height: 15px; }
.habit.tool { text-decoration: none; color: var(--text); }
.habit .ht small, .rt-item .ht small { display: block; color: var(--muted); font-size: .78rem; font-weight: 400; }
.habit.fail .check { border-color: var(--bad); }
.habit.fail .hm { color: var(--bad); }
.rt-item { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 6px 2px; border-bottom: 1px solid var(--line); }
.rt-item:last-child { border-bottom: 0; }
.rt-item .xp { color: var(--muted); font-size: .8rem; font-variant-numeric: tabular-nums; }
.rt-item .hi { color: var(--muted); }
.rt-item .ht { flex: 1; min-width: 0; font-weight: 500; }
.tpls { display: grid; gap: 8px; }
.rt-new { display: grid; gap: 8px; padding: 4px 0 14px; margin-bottom: 6px; border-bottom: 1px solid var(--line); } .rt-new input[name=t] { width: 100%; } .rt-new .row { display: flex; gap: 8px; flex-wrap: wrap; } .rt-new select { flex: 1; min-width: 120px; }
.rt-icons { display: flex; flex-wrap: wrap; gap: 4px; } .rt-icons input { position: absolute; opacity: 0; pointer-events: none; } .rt-icons span { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--line); color: var(--muted); cursor: pointer; transition: border-color .15s ease-out, color .15s ease-out; } .rt-icons svg { width: 16px; height: 16px; } .rt-icons input:checked + span { border-color: var(--accent); color: var(--accent); } .rt-icons input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.rt-pillars { display: grid; margin-top: 8px; } .rt-pl { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; padding: 10px 0; border-top: 1px solid var(--line); } .rt-pl .ht { display: flex; align-items: center; gap: 8px; font-weight: 500; } .rt-pl .ht svg { width: 16px; height: 16px; color: var(--muted); } .rt-pl.on .ht svg, .rt-pl.on .mono { color: var(--accent); } .rt-pl:not(.on) .mono { color: var(--warn); } .rt-pl small, .rt-pl .rt-sug { grid-column: 1 / -1; }
.rt-sug { display: flex; flex-wrap: wrap; gap: 6px; } .card .head .ok { color: var(--accent); }
.tpl { display: grid; gap: 2px; text-align: left; padding: 12px; border-radius: var(--r); border: 1px solid var(--line); background: var(--surface-2); transition: transform .15s var(--ease), border-color .2s; }
.tpl:hover { transform: translateY(-2px); border-color: #3a404a; }
.tpl small { color: var(--muted); }
.tpl .mono { color: var(--accent); }

/* Caffeine & bổ trợ */
.caf-now { display: inline-flex; align-items: center; gap: 6px; margin: 2px 0 10px; font-size: .85rem; color: var(--muted); text-decoration: none; }
.caf-now svg { width: 15px; height: 15px; color: var(--accent); }
.caf-now.warn, .caf-now.warn svg { color: var(--warn); }
.dose-form { display: grid; gap: 12px; }
.srcs { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 6px; }
.src { display: grid; gap: 2px; text-align: left; padding: 10px; min-height: 56px; border-radius: var(--r); border: 1px solid var(--line); background: var(--surface-2); transition: transform .15s var(--ease), border-color .2s; }
.src:hover { transform: translateY(-2px); border-color: var(--accent); }
.src b { font-weight: 500; font-size: .88rem; }
.src span { color: var(--accent); font-size: .78rem; }
.tile.warn b { color: var(--warn); }
.pk { width: 100%; height: auto; display: block; touch-action: pan-y; cursor: crosshair; }
.pk text { fill: var(--muted); font: 11px var(--mono); }
.pk-lim { stroke: var(--warn); stroke-dasharray: 3 3; stroke-width: 1; }
.pk-bed { stroke: var(--muted); stroke-dasharray: 2 3; stroke-width: 1; }
.pk-row + .pk-row { margin-top: 10px; }
.facts { margin: 6px 0; padding-left: 18px; color: var(--muted); font-size: .88rem; display: grid; gap: 4px; }
.caution { display: flex; gap: 6px; align-items: flex-start; color: var(--warn); }
.caution svg { width: 15px; height: 15px; flex: none; margin-top: 2px; }

/* Vầng sáng theo con trỏ trên thẻ */

.lvlfx-card { will-change: transform, opacity; }

/* Lên cấp */
.lvlfx { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; pointer-events: none; }
.lvlfx-card { display: flex; align-items: center; gap: 18px; padding: 18px 26px 18px 18px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); box-shadow: 0 20px 50px -20px #000; }
.lvlfx-brain { width: 64px; height: 64px; }
.lvlfx-brain path { fill: none; stroke: var(--accent); stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.lvlfx-card div { display: grid; }
.lvlfx-card small { color: var(--muted); font-size: .82rem; }
.lvlfx-card b { display: inline-block; font-size: 2.2rem; line-height: 1.1; color: var(--text); transform-origin: left center; }
.lvlfx-card span { color: var(--accent); font-weight: 600; }

/* Liên hệ, pháp lý */
.page-h { font-size: clamp(1.6rem, 4vw, 2.2rem); font-weight: 700; margin: 6px 0 10px; }
.contacts { display: grid; gap: 8px; }
.contact { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 10px 14px; border-radius: var(--r); border: 1px solid var(--line); color: var(--text); text-decoration: none; transition: transform .15s var(--ease), border-color .2s; }
.contact:hover { transform: translateY(-2px); border-color: #3a404a; }
.contact span { flex: 1; display: grid; }
.contact small { color: var(--muted); overflow-wrap: anywhere; }
.contact svg:first-child { color: var(--accent); }
.cform { display: grid; gap: 12px; margin-top: 12px; }
.cform label.f, .order-form label.f { display: grid; gap: 6px; font-weight: 500; }
.order-form input:not([type=hidden]) { font: inherit; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r); padding: 9px 11px; min-width: 0; color: var(--text); }
.legal { max-width: 760px; width: 100%; margin: 0 auto; display: grid; gap: 18px; }
.legal section { display: grid; gap: 6px; padding-top: 14px; border-top: 1px solid var(--line); }
.legal h2 { display: flex; gap: 10px; align-items: baseline; }
.legal h2 .mono { color: var(--accent); font-size: .8rem; }
.btn.danger { color: var(--bad); border-color: rgba(227, 160, 126, .4); }
.btn.danger:hover { border-color: var(--bad); }

/* Chân trang */
.foot { border-top: 1px solid var(--line); max-width: none; margin-top: 24px; padding: 18px 16px 28px; }
.foot-row { max-width: 1120px; margin: 0 auto; display: flex; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; font-size: .8rem; color: var(--muted); }
.foot-links { display: flex; gap: 6px 18px; flex-wrap: wrap; }
.foot a { color: var(--muted); text-decoration: none; transition: color .2s; }
.foot a:hover { color: var(--text); }
.lang-row { margin-top: 12px; }
.lang-switch { display: inline-flex; gap: 2px; padding: 2px; border: 1px solid var(--line); border-radius: 99px; }
.lang-switch button { min-height: 32px; padding: 0 12px; border: 0; border-radius: 99px; background: none; color: var(--muted); font-size: .8rem; }
.lang-switch button:hover { color: var(--text); }
.lang-switch button.on { background: var(--surface-2); color: var(--text); }

/* Trang Giới thiệu (landing) */
body.landing main { max-width: none; padding: 0; display: block; }
.ix-hero { position: relative; min-height: calc(100vh - 60px); overflow: hidden; display: grid; align-content: end; padding: 80px 24px 64px; }
.ix-media { position: absolute; inset: -6%; }
.ix-media video { width: 100%; height: 100%; object-fit: cover; }
.ix-media { background: #07080a; }
.ix-bigbrain { position: absolute; right: 2%; top: 50%; height: min(110%, 900px); width: auto; translate: 0 -52%; overflow: visible; }
.ix-bigbrain { --zap: 0; }
.ix-bigbrain path { fill: none; stroke: var(--accent); stroke-width: .28; stroke-linecap: round; stroke-linejoin: round; opacity: calc(.35 + .3 * var(--zap)); }
/* Tia điện khi rê chuột gần não: dòng điện chạy dọc nét + tia sét gấp khúc, nét mảnh, không phát sáng */
@media (max-width: 760px) { .ix-bigbrain { right: -25%; height: 80%; } }
.ix-shade { position: absolute; inset: 0; background: linear-gradient(transparent 30%, rgba(10, 11, 13, .95)); }
.ix-copy { position: relative; max-width: 1120px; width: 100%; margin: 0 auto; display: grid; gap: 16px; }
.ix-title { font-size: clamp(3.4rem, 14vw, 10rem); font-weight: 800; line-height: .9; letter-spacing: -.05em; }
.ix-title span { display: block; }
.ix-title span:last-child { color: var(--accent); }
.ix-row { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; justify-content: space-between; }
.ix-sub { max-width: 520px; font-size: clamp(1.2rem, 2.6vw, 1.6rem); font-weight: 600; line-height: 1.3; color: var(--muted); }
.ix-sub span { color: var(--text); }
.ix-hint { position: absolute; left: 50%; bottom: 18px; translate: -50% 0; font-size: .78rem; color: var(--muted); }
.ix-neural { position: relative; min-height: 100vh; display: grid; place-items: end center; text-align: center; padding: 80px 16px 9vh; overflow: hidden; touch-action: pan-y; }
.ix-net { position: absolute; inset: 0; width: 100%; height: 100%; }
.ix-nc { position: relative; display: grid; justify-items: center; gap: 18px; max-width: 760px; pointer-events: none; }
.ix-h { font-size: clamp(2.2rem, 7vw, 4.4rem); font-weight: 800; line-height: 1.12; letter-spacing: -.03em; }
.ix-h em { font-style: normal; color: var(--accent); }
.ix-pin { height: 400vh; position: relative; }
.ix-sticky { position: sticky; top: 0; height: 100vh; display: grid; place-items: center; padding: 16px; }
.ix-stage { width: min(960px, 100%); display: grid; grid-template-columns: 280px 1fr; gap: 48px; align-items: center; }
.ix-ring { position: relative; width: 100%; max-width: 280px; aspect-ratio: 1; }
.ix-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ix-ring circle { fill: none; stroke-width: 8; stroke-linecap: round; }
.ix-ring .rt { stroke: var(--line); }
.ix-ring .rv { stroke: var(--accent); stroke-dasharray: 100; stroke-dashoffset: 100; }
.ix-ring b { position: absolute; inset: 0; display: grid; place-content: center; font-size: 3.2rem; }
.ix-steps { position: relative; min-height: 220px; }
.ix-step { position: absolute; inset: 0; display: grid; align-content: center; gap: 10px; }
.ix-step .kicker { color: var(--accent); }
.ix-step h2 { font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 800; letter-spacing: -.02em; }
.ix-step p { max-width: 440px; }
.ix-progress { grid-column: 1 / -1; height: 3px; background: var(--line); border-radius: 3px; overflow: hidden; }
.ix-progress i { display: block; height: 100%; background: var(--accent); transform: scaleX(0); transform-origin: left; }
/* Khoa học phía sau (trang Giới thiệu) */
.ix-sci { max-width: 760px; margin: 0 auto; padding: 72px 16px 24px; display: grid; gap: 12px; }
.ix-sci h2 { font-size: clamp(1.6rem, 4.5vw, 2.2rem); font-weight: 800; letter-spacing: -.02em; }
.sci { list-style: none; margin: 8px 0; padding: 0; }
.sci li { display: grid; grid-template-columns: 36px 1fr; gap: 14px; align-items: start; padding: 14px 0; border-bottom: 1px solid var(--line); }
.sci li:first-child { border-top: 1px solid var(--line); }
.sci-use { color: var(--accent); margin-top: 4px; }
.sci-ic { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); display: grid; place-items: center; color: var(--accent); margin-top: 2px; }
.sci-ic svg { width: 17px; height: 17px; }
.rt-ic { display: inline-flex; vertical-align: -3px; margin-right: 10px; color: var(--muted); }
.rt-ic svg { width: 16px; height: 16px; }
.tpl b { display: flex; align-items: center; gap: 8px; }
.tpl b svg { width: 16px; height: 16px; color: var(--accent); }
.sci-en { display: block; font-size: .75rem; font-style: italic; color: var(--muted); margin: 1px 0 3px; }
.ix-end { min-height: 70vh; display: grid; place-content: center; justify-items: center; text-align: center; gap: 14px; padding: 48px 16px; }
.ix-end h2 { font-size: clamp(1.8rem, 5vw, 2.6rem); font-weight: 800; }
/* Không có GSAP / giảm chuyển động: xếp dọc, hiện hết */
.ix-static .ix-pin, .ix-pin.ix-done { height: auto; padding: 64px 16px; }
.ix-static .ix-sticky, .ix-done .ix-sticky { position: static; height: auto; }
.ix-static .ix-steps, .ix-done .ix-steps { min-height: 0; display: grid; gap: 28px; }
.ix-static .ix-step, .ix-done .ix-step { position: static; }
.ix-static .ix-progress, .ix-done .ix-progress { display: none; }
.ix-done .ix-step h2 { font-size: clamp(1.3rem, 3vw, 1.7rem); }
@media (max-width: 760px) {
  .ix-stage { grid-template-columns: 1fr; gap: 20px; justify-items: center; text-align: center; }
  .ix-ring { max-width: 170px; }
  .ix-steps { width: 100%; }
  .ix-step p { margin: 0 auto; }
  .ix-hero { min-height: calc(100vh - 140px); }
}

/* Luyện não */
.games { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.game { text-align: left; padding: 18px; border-radius: calc(var(--r) + 4px); border: 1px solid var(--line); background: var(--surface); display: grid; gap: 8px; transition: transform .2s var(--ease), border-color .2s; }
.game:hover { transform: translateY(-2px); border-color: #3a404a; }
.game:active { transform: scale(.99); }
.game .gi { width: 40px; height: 40px; border-radius: var(--r); display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.game h3 { font-size: 1.05rem; }
.game .best { font-family: var(--mono); font-size: .78rem; color: var(--muted); }
.opt-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.opt-row > span:first-child { width: 90px; color: var(--muted); font-size: .85rem; }
.setup { display: grid; gap: 14px; max-width: 520px; }
.math { max-width: 520px; margin: 0 auto; text-align: center; display: grid; gap: 14px; }
.math { position: relative; }
.math > :not(.digits):not(.count):not(.plus) { position: relative; z-index: 1; }
.digits { position: absolute; inset: -18px; overflow: hidden; pointer-events: none; z-index: 0; }
.digits span { position: absolute; font: 700 1.1rem var(--mono); color: rgba(200, 242, 90, .1); }
.math .sc { display: inline-block; }
.plus { position: absolute; right: 22%; top: 52%; font: 700 1rem var(--mono); color: var(--accent); opacity: 0; pointer-events: none; z-index: 2; }
.count { position: absolute; inset: 0; display: grid; place-items: center; font: 800 6rem var(--mono); color: var(--accent); opacity: 0; pointer-events: none; z-index: 3; }
.math-top { display: flex; justify-content: space-between; font-family: var(--mono); }
.math-top .t { font-size: 1.3rem; }
.tbar { height: 3px; background: var(--line); border-radius: 3px; overflow: hidden; }
.tbar i { display: block; height: 100%; background: var(--accent); transform-origin: left; }
.prob { font-size: clamp(2.4rem, 8vw, 3.6rem); font-weight: 700; letter-spacing: -.02em; }
.prob.bump { animation: bump .25s var(--ease); }
@keyframes bump { 40% { transform: scale(1.06); color: var(--accent); } }
.ans { font-size: 1.8rem; text-align: center; width: 100%; max-width: 260px; margin: 0 auto; padding: 10px; border-radius: var(--r); border: 1px solid var(--line); background: var(--surface-2); }
.pads { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; max-width: 320px; margin: 0 auto; }
.pad { aspect-ratio: 1; border-radius: var(--r); border: 1px solid var(--line); background: var(--surface-2); transition: background .15s, transform .1s; }
.pad.lit { background: var(--accent); transform: scale(1.04); box-shadow: 0 0 24px -4px var(--accent); }
.pads.fail { animation: shake .4s; }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.seq-top { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; max-width: 360px; margin: 0 auto 12px; font-family: var(--mono); }
.react { width: 100%; min-height: 260px; border-radius: calc(var(--r) + 4px); border: 1px solid var(--line); display: grid; place-content: center; gap: 6px; text-align: center; user-select: none; transition: background .12s; }
.react b { font-size: 1.6rem; }
.react small { color: inherit; opacity: .75; }
.react.idle { background: var(--surface-2); }
.react.wait { background: #2a1714; }
.react.go { background: var(--accent); color: var(--accent-ink); }
.react.early { background: #3a1712; }
.result { text-align: center; padding: 22px; border: 1px solid var(--line); border-radius: calc(var(--r) + 4px); display: grid; gap: 8px; margin-top: 14px; animation: enter .5s var(--ease) both; }
.result h3 { font-size: 1.4rem; }
/* Lọc nhóm bài + game trắc nghiệm 60 giây + Ghép cặp */
.gcat { gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.chip { padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--muted); font: inherit; font-size: .88rem; cursor: pointer; transition: border-color .15s, color .15s; }
.chip:hover { color: var(--text); border-color: #3a404a; }
.chip.on { background: var(--text); color: var(--bg); border-color: var(--text); }
.qz-intro { max-width: 520px; margin: 0 auto; text-align: center; display: grid; gap: 14px; padding: 8px 0; }
.qz-h { min-height: 1.2em; margin: 0; }
.qz-q { min-height: 130px; display: grid; place-items: center; font: 700 clamp(2rem, 7vw, 3rem) var(--mono); letter-spacing: -.02em; }
.qz-q .dots { width: min(100%, 360px); height: auto; transition: opacity .12s; }
.qz-q .dots circle { fill: var(--accent); }
.qz-q.gone .dots { opacity: 0; }
.stroop { font-family: inherit; font-size: clamp(2.2rem, 8vw, 3.4rem); }
.qz-opts { display: grid; grid-template-columns: repeat(var(--n, 4), 1fr); gap: 8px; }
.qz-o { position: relative; padding: 18px 8px; border-radius: var(--r); border: 1px solid var(--line); background: var(--surface-2); color: var(--text); font: 600 1.1rem var(--mono); cursor: pointer; transition: border-color .15s, background .15s, transform .1s; }
.qz-o:hover { border-color: #3a404a; }
.qz-o:active { transform: scale(.97); }
.qz-o small { position: absolute; top: 4px; left: 7px; font-size: .66rem; font-weight: 500; color: var(--muted); }
.qz-o.ok { border-color: var(--accent); background: var(--accent-soft); }
.qz-o.no { border-color: var(--bad); }
.pair { max-width: 460px; margin: 0 auto; display: grid; gap: 12px; }
.pair .seq-top { width: 100%; max-width: none; margin: 0; }
.pair-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.pc { display: grid; justify-items: center; gap: 6px; padding: 14px 6px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface-2); }
.pc svg { width: 26px; height: 26px; color: var(--accent); }
.pc b { font-size: 1.15rem; }
.pc.big { width: 120px; margin: 10px auto; padding: 24px; }
.pc.big svg { width: 48px; height: 48px; }
@media (max-width: 560px) { .qz-opts { grid-template-columns: repeat(2, 1fr); } .qz-opts.n3 { grid-template-columns: repeat(3, 1fr); } }
.newbest { color: var(--accent); font-weight: 700; }

/* Tập trung */
.focus { display: grid; justify-items: center; gap: 16px; text-align: center; padding: 28px 18px; }
.timer-ring { position: relative; width: min(280px, 72vw); aspect-ratio: 1; }
.timer-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.timer-ring circle { fill: none; stroke-width: 4; }
.timer-ring .rt { stroke: var(--line); }
.timer-ring .rv { stroke: var(--accent); stroke-linecap: round; stroke-dasharray: 100; transition: stroke-dashoffset 1s linear; }
.timer-ring .t { position: absolute; inset: 0; display: grid; place-content: center; }
.timer-ring .t b { font: 700 3.2rem/1 var(--mono); }
@keyframes breathe { 50% { filter: drop-shadow(0 0 18px rgba(200, 242, 90, .25)); } }

/* Hồ sơ */
.ladder { display: grid; gap: 4px; }
.ladder div { display: flex; justify-content: space-between; padding: 8px 10px; border-radius: var(--r); color: var(--muted); }
.ladder div.got { color: var(--text); }
.ladder div.cur { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.badge { padding: 14px; border-radius: var(--r); background: var(--surface-2); display: grid; gap: 4px; }
.badge svg { color: var(--accent); width: 22px; height: 22px; }
.badge small { color: var(--muted); }
.badge.locked { opacity: .4; }
.badge.locked svg { color: var(--muted); }

/* Tài liệu */
.products { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.product { display: grid; gap: 10px; align-content: start; }
.product ul { margin: 0; padding-left: 18px; color: var(--muted); }
.price { font: 700 1.4rem var(--mono); color: var(--accent); }
.qr { width: 240px; max-width: 100%; display: block; margin: 10px auto; border-radius: var(--r); background: #fff; }
.qr.empty { background: var(--surface-2); color: var(--muted); padding: 24px; text-align: center; }
.code { font-family: var(--mono); color: var(--accent); }
.steps { padding-left: 18px; color: var(--muted); display: grid; gap: 4px; margin: 10px 0 0; }

/* Toast, modal */
#toasts { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); display: grid; gap: 8px; z-index: 40; width: min(92vw, 380px); }
.toast { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r); padding: 10px 14px; font-size: .9rem; animation: enter .35s var(--ease); box-shadow: 0 12px 30px -10px #000; }
.toast.big { border-color: var(--accent); color: var(--accent); font-weight: 600; }
.xpfloat { position: fixed; z-index: 45; font: 700 .95rem var(--mono); color: var(--accent); pointer-events: none; animation: float 1s var(--ease) forwards; }
@keyframes float { to { transform: translateY(-36px); opacity: 0; } }
.modal { position: fixed; inset: 0; background: rgba(0, 0, 0, .65); display: grid; place-items: center; padding: 16px; z-index: 30; backdrop-filter: blur(4px); }
.modal[hidden] { display: none; }
.modal-box { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 22px; width: min(100%, 420px); max-height: 90vh; overflow: auto; animation: enter .3s var(--ease); }
.x { position: absolute; top: 8px; right: 8px; width: 36px; height: 36px; border: 0; background: none; color: var(--muted); }

@media (max-width: 900px) {
  .c4, .c5, .c6, .c7, .c8 { grid-column: span 12; }
  .games { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  body { padding-bottom: 72px; }
  .top { padding-top: 14px; }
  .lvl { min-width: 0; width: 120px; }
  .lvl-top b { display: none; }
  .lvl-top span { white-space: nowrap; }
  .nav { position: fixed; top: auto; bottom: 0; left: 0; right: 0; padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); background: rgba(10, 11, 13, .92); backdrop-filter: blur(10px); border-top: 1px solid var(--line); justify-content: space-between; gap: 0; }
  .nav a { flex: 1; flex-direction: column; gap: 2px; padding: 6px 1px; font-size: .6rem; white-space: nowrap; }
  .nav-sep, .nav a.nav-2nd { display: none; }
  .nav a { font-size: .66rem; }
  .week { grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
  .wday { padding: 8px 4px; min-height: 96px; justify-items: center; text-align: center; }
  .wday b { font-size: 1.15rem; }
  .dots i { width: 4px; height: 4px; }
  .nav a.on::after { left: 30%; right: 30%; bottom: auto; top: 0; }
  .hero { flex-direction: column; align-items: flex-start; }
  .logrow, .products { grid-template-columns: 1fr; }
  .tiles { grid-template-columns: repeat(2, 1fr); }
  .cells { gap: 2px; }
  #toasts { bottom: 84px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ====== Thiết kế theo não bộ ====== */
/* Vòng ngày 3 mảnh */
.day3 { display: grid; grid-template-columns: 108px 1fr; gap: 18px; align-items: center; }
.dr { position: relative; width: 108px; height: 108px; display: grid; place-items: center; }
.dr b { position: absolute; font-size: 1.2rem; }
.dring { position: absolute; inset: 0; width: 100%; height: 100%; }
.dring circle { fill: none; stroke: var(--line); stroke-width: 10; stroke-linecap: round; transition: stroke .4s; }
.dring circle.on { stroke: var(--accent); }
.d3 { list-style: none; margin: 0; padding: 0; }
.d3 li { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.d3 li:last-child { border-bottom: 0; }
.d3 li.ok > span:first-child { color: var(--muted); text-decoration: line-through; }
.d3 a { color: inherit; text-decoration: none; }
.d3 a:hover { color: var(--accent); }
.anchor { margin-top: 10px; font-size: .85rem; color: var(--accent); }
.anchor-form { display: grid; gap: 10px; margin-top: 10px; }
.anchor-form label { display: grid; gap: 4px; font-size: .85rem; color: var(--muted); }
.rt-new input[name=t], .rt-new select, .anchor-form select { font: inherit; color: var(--text); background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r); padding: 8px 10px; }
/* Bộ não sống */
.alive { position: relative; height: 200px; margin: 4px 0 8px; touch-action: pan-y; }
.alive canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
/* Nhật ký gập lại trong form log */
details.journal summary { cursor: pointer; font-weight: 500; display: flex; justify-content: space-between; list-style: none; }
details.journal summary::-webkit-details-marker { display: none; }
details.journal summary small { color: var(--muted); font-weight: 400; font-size: .75rem; }
details.journal[open] summary { margin-bottom: 6px; }
/* Nghỉ 15 giây sau game */
.rest { display: grid; justify-items: center; gap: 10px; padding: 18px 0 4px; }
.orb { width: 96px; height: 96px; border-radius: 50%; border: 2px solid var(--accent); display: grid; place-items: center; animation: breathe 8s ease-in-out infinite; }
.orb b { font-size: 1.3rem; }
.rest p { color: var(--muted); font-size: .9rem; text-align: center; }
.rest.over .orb { animation: none; opacity: .4; }
@keyframes breathe { 0%, 100% { transform: scale(.72); } 50% { transform: scale(1); } }
@media (max-width: 560px) { .day3 { grid-template-columns: 1fr; justify-items: center; } .day3 > div:last-child { width: 100%; } }
@media (prefers-reduced-motion: reduce) { .orb { animation: none; } }
/* Form xác nhận chuyển khoản (trong hộp mua tài liệu) */
.order-form { display: grid; gap: 10px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.order-ok { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); color: var(--accent); }
/* Cảm xúc: mạng nơ-ron quanh bộ não (mountMood) + nút âm thanh */
.mood-stage { --mood: var(--accent); position: relative; height: 190px; margin-top: 10px; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: var(--surface); }
.mood-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.mood-brain { position: absolute; left: 50%; top: 50%; width: 56px; height: 56px; margin: -28px 0 0 -28px; overflow: visible; }
.mood-brain path { stroke: var(--mood); stroke-width: 1.3; }
.mood-brain .spark { stroke-width: 2; stroke-dasharray: 8 100; stroke-dashoffset: 108; }
.mood-tip { min-height: 1.4em; margin-top: 8px; }
.sfx-toggle { margin-left: 10px; padding: 4px 12px; border-radius: 99px; border: 1px solid var(--line); background: transparent; color: var(--muted); font: inherit; font-size: .82rem; cursor: pointer; }
.sfx-toggle:hover { color: var(--text); }
.lv { display: inline-block; }
.pk-base { stroke: var(--muted); stroke-width: 1; opacity: .5; }
.src.rec { border-color: var(--accent); }
/* Ảnh đại diện */
.avatar { --av: var(--accent); display: inline-grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: 50%; border: 1.5px solid var(--av); color: var(--av); background: var(--surface-2); }
.avatar svg { width: 55%; height: 55%; }
.avatar.sm { width: 32px; height: 32px; }
.avatar.lg { width: 84px; height: 84px; border-width: 2px; }
/* Hồ sơ: thẻ đầu trang */
.prof-hero { display: grid; grid-template-columns: auto 1fr minmax(180px, 260px); gap: 20px; align-items: center; }
.prof-id { display: grid; gap: 6px; min-width: 0; }
.prof-id h1 { font-size: 1.5rem; overflow-wrap: anywhere; }
.prof-id svg { width: 15px; height: 15px; vertical-align: -2px; margin-right: 5px; }
.linkbtn { background: none; border: 0; padding: 0; font: inherit; color: var(--accent); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.prof-mood { display: grid; gap: 4px; padding-left: 20px; border-left: 1px solid var(--line); justify-items: start; }
.prof-mood b { font-size: 1.2rem; }
@media (max-width: 760px) {
  .prof-hero { grid-template-columns: auto 1fr; }
  .prof-mood { grid-column: 1 / -1; padding: 14px 0 0; border-left: 0; border-top: 1px solid var(--line); }
  .avatar.lg { width: 64px; height: 64px; }
}
/* Tùy chọn: mỗi dòng một thiết lập, kẻ mảnh */
.set-row { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.set-row:last-child { border-bottom: 0; }
.set-row > div:first-child { display: grid; gap: 2px; min-width: 0; }
.set-row b { font-weight: 600; }
.set-ctrl { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.av-pick { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 0; }
.av-opt { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--line); background: transparent; color: var(--muted); cursor: pointer; }
.av-opt svg { width: 20px; height: 20px; }
.av-opt:hover { color: var(--text); }
.av-opt.on { border-color: var(--accent); color: var(--accent); }
.av-sw { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--bg); background: var(--av); box-shadow: 0 0 0 1px var(--line); cursor: pointer; }
.av-sw.on { box-shadow: 0 0 0 2px var(--text); }
@media (max-width: 560px) { .set-row { flex-wrap: wrap; } .set-ctrl { justify-content: flex-start; } }
/* Hướng dẫn từng bước: làm tối phần còn lại, viền phần đang giới thiệu */
.tour { position: fixed; inset: 0; z-index: 300; }
.tour-spot { position: fixed; border: 2px solid var(--accent); border-radius: 12px; box-shadow: 0 0 0 9999px rgba(5, 6, 8, .72); transition: all .3s var(--ease); pointer-events: none; }
.tour-card { position: fixed; display: grid; gap: 8px; padding: 18px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); transition: top .3s var(--ease), left .3s var(--ease), opacity .2s; }
.tour-card h3 { font-size: 1.1rem; }
.tour-card p { color: var(--muted); line-height: 1.55; }
.tour-card.dock { left: 12px !important; right: 12px; bottom: calc(76px + env(safe-area-inset-bottom)); top: auto !important; width: auto !important; }
.tour.moving .tour-card { opacity: .6; }
.tour-card [hidden] { display: none; }
/* Đang hướng dẫn: lớp phủ chặn mọi cú bấm vào trang, chỉ thẻ hướng dẫn bấm được */
.tour { touch-action: none; overscroll-behavior: contain; }
html.tour-on { overscroll-behavior: none; }
@media (prefers-reduced-motion: reduce) { .tour-spot, .tour-card { transition: none; } }
/* Chạm dễ hơn trên điện thoại: link nhỏ trong thẻ cao tối thiểu 36px */
#view .card a.small, #view .card .head a { display: inline-flex; align-items: center; min-height: 36px; }
/* Ảnh đại diện tải lên */
.avatar.img { overflow: hidden; padding: 0; }
.avatar.img img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* Trình chỉnh ảnh đại diện */
.ave { display: grid; grid-template-columns: 240px 1fr; gap: 22px; margin-top: 14px; }
.ave-left { display: grid; gap: 10px; justify-items: center; align-content: start; }
.ave-stage { --av: var(--accent); position: relative; width: 220px; height: 220px; border-radius: 50%; overflow: hidden; border: 2px solid var(--av); background: var(--surface-2); touch-action: none; cursor: grab; display: grid; place-items: center; }
.ave-stage:active { cursor: grabbing; }
.ave-stage img { position: absolute; left: 50%; top: 50%; max-width: none; transform-origin: center; user-select: none; pointer-events: none; display: none; }
.ave-stage.has img { display: block; }
.ave-stage.has .ave-empty { display: none; }
.ave-right { display: grid; gap: 8px; align-content: start; min-width: 0; }
.ave-h { font-size: .8rem; color: var(--muted); margin-top: 4px; }
.ave-fx { display: flex; flex-wrap: wrap; gap: 6px; }
.ave-sl { display: grid; grid-template-columns: 92px 1fr 44px; align-items: center; gap: 8px; width: 100%; font-size: .85rem; }
.ave-left .ave-sl { grid-template-columns: 70px 1fr; }
.ave-sl input { accent-color: var(--accent); width: 100%; }
.ave-sl output { font-family: var(--mono); font-size: .78rem; color: var(--muted); text-align: right; }
@media (max-width: 640px) { .ave { grid-template-columns: 1fr; } }
/* Màn hình đăng nhập */
body.gate #nav, body.gate #subnav, body.gate #player { display: none; }
.login { max-width: 420px; margin: 32px auto; display: grid; gap: 12px; text-align: center; padding: 32px 24px; }
.login h1 { font-size: 1.5rem; }
.login-brain { width: 56px; height: 56px; margin: 0 auto 4px; fill: none; stroke: var(--accent); stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.login-btn { justify-content: center; min-height: 46px; width: 100%; background: var(--surface-2); }
.login-btn svg { width: 18px; height: 18px; }
.login-form { display: grid; gap: 10px; text-align: left; }
.login-form .field { width: 100%; }
.login-or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: .82rem; }
.login-or::before, .login-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.login .ghost { justify-content: center; }
/* Trang quản lý tài khoản (admin.html) */
.adm { max-width: 1120px; margin: 0 auto; padding: 28px 16px 60px; display: grid; gap: 18px; }
.adm-top { display: flex; justify-content: space-between; align-items: end; gap: 12px; flex-wrap: wrap; }
.adm-top h1 { font-size: 1.6rem; }
.adm > * { min-width: 0; }
.adm-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.adm-tools { gap: 8px; }
.adm-tools .field { flex: 1; min-width: 200px; }
.adm-table { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); }
.adm-table table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.adm-table th, .adm-table td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
.adm-table tr:last-child td { border-bottom: 0; }
.adm-sort { background: none; border: 0; color: var(--muted); font: inherit; font-weight: 600; cursor: pointer; padding: 0; }
.adm-sort.on { color: var(--accent); }
@media (max-width: 640px) { .adm-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.login a { color: var(--accent); }
.modal-box.wide { width: min(680px, calc(100vw - 24px)); max-width: none; }
.ave-fx .chip { padding: 4px 10px; font-size: .8rem; }
.ave-right .av-pick { padding: 2px 0; }

/* ====== Thời gian màn hình (Routine > Màn hình) ====== */
.ext-btn { margin-left: auto; }
body.landing .ext-btn, body.gate .ext-btn { display: none; }
@media (max-width: 760px), (pointer: coarse) { .ext-btn { display: none; } }
.scr { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; }
.scr > .card { display: grid; gap: 12px; align-content: start; }
.scr-wide { grid-column: 1 / -1; }
.scr-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.scr-big { display: block; font: 700 1.6rem var(--mono); color: var(--accent); }
.scr-big.dim { color: var(--text); }
#scrPc { font-size: 2.1rem; }
.scr-stats { display: flex; gap: 24px; flex-wrap: wrap; }
.scr-stats b { font-family: var(--mono); }
#scrSrc.live { color: var(--accent); }
.scr-sites > div { display: grid; grid-template-columns: 1fr 90px 76px; gap: 10px; align-items: center; padding: 7px 0; border-top: 1px solid var(--line); font-size: .9rem; }
.scr-sites span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scr-sites i { display: block; height: 6px; border-radius: 3px; background: var(--accent); }
.scr-sites b { font: 500 .85rem var(--mono); text-align: right; }
.scr-drop { display: grid; place-items: center; gap: 6px; padding: 28px 16px; border: 1px dashed #3a404a; border-radius: var(--r); text-align: center; cursor: pointer; transition: border-color .2s, transform .2s, background .2s; }
.scr-drop:hover, .scr-drop:focus-within { border-color: var(--accent); }
.scr-drop.over { border-color: var(--accent); border-style: solid; transform: scale(.985); background: var(--surface-2); }
.scr-drop input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.scr-shot { display: grid; grid-template-columns: 96px 1fr; gap: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.scr-shot > img { width: 96px; border-radius: var(--r); border: 1px solid var(--line); }
.scr-body { display: grid; gap: 10px; min-width: 0; align-content: start; }
.scr-st { font-size: .9rem; }
.scr-st b { color: var(--accent); font-weight: 600; }
.scr-st.warn { color: var(--bad); }
.scr-cal { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; }
.scr-cal label { display: grid; gap: 4px; font-size: .78rem; color: var(--muted); }
.scr-cal select { min-height: 40px; color: var(--text); font: inherit; }
.scr-cal input[type=number] { width: 72px; }
.scr input.need { border-color: var(--bad); }
.scr-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.scr-days label { display: grid; gap: 4px; font-size: .75rem; color: var(--muted); text-align: center; }
.scr-bar { height: 64px; display: flex; align-items: end; }
.scr-bar i { width: 100%; border-radius: 4px 4px 0 0; background: var(--accent); min-height: 2px; transform-origin: bottom; }
.scr-days input { width: 100%; text-align: center; padding: 8px 2px; font-family: var(--mono); font-size: .8rem; }
.scr-hm { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, 11px); gap: 3px; overflow-x: auto; padding: 4px 2px; }
.scr-hm i, .scr-leg i { width: 11px; height: 11px; border-radius: 2px; background: var(--surface-2); display: inline-block; }
.scr-hm i { cursor: pointer; transition: transform .15s; }
.scr-hm i:hover { transform: scale(1.45); }
.scr-hm .now { outline: 1px solid var(--text); }
.scr .l1 { background: #3d4a1f; } .scr .l2 { background: #6b7d2c; } .scr .l3 { background: #c0a046; } .scr .l4 { background: #f2a35a; }
.scr-leg { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.scr-tg { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); cursor: pointer; }
.scr-tg input { width: 20px; height: 20px; accent-color: var(--accent); }
.scr-ol { margin: 0; padding-left: 20px; display: grid; gap: 4px; }
.scr-ol code { font-family: var(--mono); color: var(--accent); }
.scr-ins p { padding: 9px 0; border-top: 1px solid var(--line); font-size: .92rem; }
.scr-ins p:first-child { border-top: 0; }
@media (max-width: 520px) { .scr-shot { grid-template-columns: 1fr; } .scr-shot > img { width: 72px; } }

/* Bảng điểm trí lực: bấm vòng điểm ở Hôm nay */
.ring-btn { display: grid; justify-items: center; gap: 6px; padding: 0; border: 0; background: none; color: inherit; font: inherit; cursor: pointer; border-radius: 50%; }
.ring-btn .ring { transition: transform .2s var(--ease); }
.ring-btn:hover .ring { transform: scale(1.03); }
.ring-btn:active .ring { transform: scale(.98); }
.ring-btn > span { opacity: .8; }
.ring-btn:hover > span { color: var(--accent); }
.mind h3 { font-size: .95rem; margin: 22px 0 8px; }
.mind-stage { height: 170px; margin: 0 28px 0 0; }
.mind-stage .mood-brain { width: 72px; height: 72px; margin: -36px 0 0 -36px; }
.mind-head { display: flex; gap: 16px; align-items: center; margin-top: 16px; }
.mind-head > b { font-size: 2.6rem; line-height: 1; color: var(--accent); }
.mind-head h2 { margin: 0 0 4px; font-size: 1.15rem; }
.mind ul { list-style: none; padding: 0; margin: 0; }
.mind-f li { display: grid; grid-template-columns: 8.5rem 1fr 2.6rem; gap: 12px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
.mind-f .bar { display: block; height: 6px; border-radius: 6px; background: var(--line); overflow: hidden; }
.mind-f .bar i { display: block; height: 100%; background: var(--accent); border-radius: 6px; transform-origin: left; animation: barIn .8s var(--ease) both .2s; }
@keyframes barIn { from { transform: scaleX(0); } }
.mind-f li > b { text-align: right; font-size: .85rem; }
.mind-bands li, .mind-day li { display: grid; grid-template-columns: 4.6rem 1fr; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.mind-bands li > b { font-size: .85rem; color: var(--muted); padding-top: 1px; }
.mind-bands li.on > b, .mind-bands li.on span > b { color: var(--accent); }
.mind-bands span, .mind-day span { display: grid; gap: 2px; }
.mind-bands small, .mind-day small { font-size: .8rem; line-height: 1.45; }
.mind-day li > b { font-size: .85rem; }
@media (max-width: 520px) { .mind-f li { grid-template-columns: 6.5rem 1fr 2.4rem; } }
@media (prefers-reduced-motion: reduce) { .mind-f .bar i { animation: none; } }

/* Game Ngắm bắn */
.aim { position: relative; width: 100%; aspect-ratio: 16 / 9; max-height: 68vh; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: #0d0f12; }
.aim canvas { display: block; width: 100%; height: 100%; cursor: none; touch-action: none; user-select: none; }
.aim-tip { margin-top: 10px; }
@media (max-width: 700px) { .aim { aspect-ratio: 3 / 4; max-height: 70vh; } }

/* Hướng dẫn chơi mini-game */
.gguide h2 { margin: 0 28px 6px 0; }
.gguide h3 { font-size: .95rem; margin: 20px 0 4px; }
.gguide ul { list-style: none; padding: 0; margin: 0; }
.gguide li { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: start; padding: 12px 0; border-top: 1px solid var(--line); }
.gguide li p { margin: 3px 0 0; line-height: 1.5; }
.gguide > p:last-child { margin-top: 16px; }
@media (max-width: 520px) { .gguide li { grid-template-columns: 1fr; } .gguide li .btn { justify-self: start; } }

/* Mức độ khó trong game: chữ mức đổi màu khi tới Khó, Rất khó */
.lv { display: inline-block; color: var(--accent); }
.lv.hot { color: #f2d45c; }
.react.nogo { background: #3b2516; color: #f29a5a; }

/* Tập trung sâu: đang chạy phiên học thì nền tối hơn, phần xung quanh mờ đi, chỉ còn đồng hồ */
html.deep-focus body { background: #040405; transition: background .8s; }
html.deep-focus .top, html.deep-focus .nav a, html.deep-focus #subnav, html.deep-focus .foot { opacity: .12; transition: opacity .8s; }
html.deep-focus .nav { background: #040405; }
html.deep-focus .top:hover, html.deep-focus .nav a:hover, html.deep-focus #subnav:hover, html.deep-focus .foot:hover { opacity: .7; }
html.deep-focus .card.focus { background: transparent; border-color: transparent; min-height: 70vh; align-content: center; }
html.deep-focus .timer-ring { width: min(340px, 78vw); }
html.deep-focus .timer-ring .rt { stroke: #16181c; }
@media (prefers-reduced-motion: reduce) { html.deep-focus body, html.deep-focus .top, html.deep-focus .nav a, html.deep-focus #subnav, html.deep-focus .foot { transition: none; } }

/* Điện thoại hẹp (≤ 420px): thu gọn đầu trang để cụm hồ sơ không tràn ra ngoài màn hình */
@media (max-width: 420px) {
  .top { gap: 10px; padding-left: 12px; padding-right: 12px; }
  .player { gap: 8px; min-width: 0; }
  .lvl { width: 76px; }
  .lvl-top span { font-size: .7rem; }
  .streak { padding-left: 8px; padding-right: 8px; }
}
/* Hiệu ứng Routine, Chất bổ trợ, Tri thức (concept K) */
.habit.done .ht { flex: 0 1 auto; margin-right: auto; background: linear-gradient(var(--muted), var(--muted)) left 55% / 100% 1.5px no-repeat; }
.habit.pop .ht { animation: strike .4s var(--ease) both .08s; }
@keyframes strike { from { background-size: 0% 1.5px; } to { background-size: 100% 1.5px; } }
.fx-drop { position: fixed; width: 10px; height: 10px; border-radius: 50%; pointer-events: none; z-index: 60; }
.fx-ghost { position: fixed; margin: 0; z-index: 60; pointer-events: none; transform-origin: center; }
@media (prefers-reduced-motion: reduce) { .habit.pop .ht { animation: none; } }
/* Bảng xếp hạng */
.board { max-width: 720px; margin: 0 auto; }
.board-list { list-style: none; margin: 0; padding: 0; }
.board-list li { display: grid; grid-template-columns: 34px 32px 1fr auto auto; align-items: center; gap: 12px; padding: 10px 6px; border-bottom: 1px solid var(--line); }
.board-list li:last-child { border-bottom: 0; }
.board-list li.me { background: var(--accent-soft); border-radius: var(--r); }
.board-list .br { color: var(--muted); text-align: right; }
.board-list li:nth-child(-n+3) .br { color: var(--accent); font-weight: 700; }
.board-list .bn { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.board-list .bnm, .board-list .bst { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board-list .bst { font-size: 12px; }
.board-join { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
@media (max-width: 480px) { .board-list li { grid-template-columns: 26px 32px 1fr auto; } .board-list li > .small { display: none; } }

/* Từ điển não bộ (Tri thức) */
.terms { border-top: 1px solid var(--line); }
.terms .entry { border-bottom: 1px solid var(--line); }
.terms .entry summary b { font-weight: 600; }
.terms .entry .body p span { font-family: inherit; font-size: .8rem; text-transform: none; letter-spacing: 0; color: var(--accent); margin-bottom: 2px; }

/* Video dài nên xem hôm nay (Tri thức) */
.vlist { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.vlist li { display: flex; align-items: center; gap: 12px; border-bottom: 1px solid var(--line); }
.vlist a { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; padding: 12px 0; color: inherit; text-decoration: none; }
.vlist a:hover b { color: var(--accent); }
.vlist li > svg, .vlist li > i { width: 16px; height: 16px; color: var(--muted); flex: none; }

/* Ghi chú quyền riêng tư */
.privnote { display: flex; gap: 8px; align-items: flex-start; font-size: .8rem; color: var(--muted); margin: 4px 0 8px; }
.privnote svg, .privnote i { width: 14px; height: 14px; flex: none; margin-top: 2px; color: var(--accent); }
.card .head a.small { color: var(--muted); text-underline-offset: 3px; }
.card .head a.small:hover { color: var(--accent); }

/* Cung điện trí nhớ */
.pal { display: grid; gap: 16px; }
.pal-places { display: grid; gap: 8px; max-width: 440px; width: 100%; margin: 0 auto; }
.pal-places label { display: grid; grid-template-columns: 24px 1fr; align-items: center; gap: 8px; }
.pal-route { position: relative; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding-top: 6px; }
.pal-route::before { content: ""; position: absolute; left: 5%; right: 5%; top: 16px; height: 1px; background: var(--line); }
.pal-route span { position: relative; display: grid; justify-items: center; gap: 6px; text-align: center; color: var(--muted); min-width: 0; }
.pal-route small { font-size: .7rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.pal-route i { width: 20px; height: 20px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); transition: background .3s, border-color .3s, transform .3s; }
.pal-route .now i { background: var(--accent); border-color: var(--accent); transform: scale(1.2); }
.pal-route .now { color: var(--text); }
.pal-route .done i { border-color: var(--accent); }
.pal-route .bad i { border-color: var(--bad); }
.pal-card { display: grid; justify-items: center; gap: 8px; text-align: center; padding: 12px 0; }
.pal-item { font-size: clamp(1.8rem, 7vw, 2.8rem); font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.pal-hint { color: var(--accent); font-weight: 600; }
.pal-card .tbar { width: 100%; max-width: 320px; height: 3px; background: var(--line); border-radius: 2px; overflow: hidden; }
.pal-card .tbar i { display: block; height: 100%; background: var(--accent); transform-origin: left; }
.pal-card .qz-opts { width: 100%; max-width: 480px; margin-top: 6px; }
.pal-list { list-style: none; margin: 0 auto; padding: 0; width: 100%; max-width: 440px; border-top: 1px solid var(--line); }
.pal-list li { display: flex; justify-content: space-between; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: .9rem; }
.pal-list .miss { color: var(--bad); }
@media (max-width: 560px) { .pal-route { grid-auto-flow: row; grid-template-columns: repeat(5, 1fr); row-gap: 12px; } .pal-route::before { display: none; } }

/* Cung điện trí nhớ 3D: sân khấu cố định, chú thích kiểu bản vẽ kiến trúc */
.pal.is3d { gap: 12px; }
.p3-stage { position: relative; height: clamp(300px, 56vh, 600px); border-radius: var(--r, 10px); overflow: hidden; background: #0d0f12; border: 1px solid var(--line); }
.p3-stage canvas { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; }
.p3-stage canvas:active { cursor: grabbing; }
.p3-wait { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; }
.p3-labels { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.p3-lab { position: absolute; left: 0; top: 0; will-change: transform; }
.p3-lab::before { content: ""; position: absolute; left: -2.5px; top: -2.5px; width: 5px; height: 5px; border-radius: 50%; background: var(--text); }
.p3-lab::after { content: ""; position: absolute; left: 0; bottom: 0; width: 1px; height: 34px; background: rgba(236, 238, 240, .55); }
.p3-lab span { position: absolute; left: 0; bottom: 34px; transform: translateX(-50%); white-space: nowrap; padding: 5px 10px; border-radius: 6px;
  background: rgba(13, 15, 18, .92); border: 1px solid rgba(236, 238, 240, .14); color: var(--text); font-size: .82rem; font-weight: 600; letter-spacing: -.005em;
  opacity: 0; translate: 0 4px; transition: opacity .35s ease, translate .35s ease; }
.p3-lab.in span { opacity: 1; translate: 0 0; }
.p3-lab[data-kind="item"] span { font-size: 1rem; padding: 7px 14px; }
.p3-lab[data-kind="item"]::before, .p3-lab[data-kind="ask"]::before { background: var(--accent); }
.p3-lab[data-kind="place"] span { font-weight: 500; color: var(--muted); font-size: .75rem; }
.p3-lab[data-kind="place"]::after { height: 18px; }
.p3-lab[data-kind="place"] span { bottom: 18px; }
.p3-lab[data-kind="ask"] span { color: var(--muted); }
.p3-lab[data-kind="ok"] span { border-color: rgba(200, 242, 90, .5); }
.p3-lab[data-kind="ok"]::before { background: var(--accent); }
.p3-lab[data-kind="miss"] span { border-color: rgba(227, 160, 126, .55); color: var(--bad); }
.p3-lab[data-kind="miss"]::before { background: var(--bad); }
.pal-panel { display: grid; gap: 14px; }
.pal-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.pal-head .seg { display: flex; gap: 6px; }
.pal.is3d .pal-places { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); max-width: none; }
.pal.is3d .pal-card { padding: 4px 0; }
.pal.is3d .pal-hint { color: var(--muted); font-weight: 500; }
@media (prefers-reduced-motion: reduce) { .p3-lab span { transition: none; } }

/* Cung điện trí nhớ 2D: mặt bằng kiểu bản vẽ kiến trúc */
.p3-stage.p2 { background: #101215; }
.p2 svg { display: block; width: 100%; height: 100%; }
.p2 .lawn { fill: #1a1f18; }
.p2 .pave { fill: #22252a; }
.p2 .pave-j { stroke: #2d3036; stroke-width: .02; }
.p2 .floor { fill: #2a241e; }
.p2 .board { stroke: #241f1a; stroke-width: .025; }
.p2 .tile { fill: #24272b; stroke: #2e3237; stroke-width: .02; }
.p2 .deck { fill: #1d2024; }
.p2 .water { fill: #1b2a31; stroke: #2e4652; stroke-width: .04; }
.p2 .rug { fill: #2f2a24; stroke: #3a342d; stroke-width: .02; }
.p2 .wall { stroke: #ece8e1; stroke-width: .14; stroke-linecap: square; }
.p2 .f, .p2 .f2, .p2 .leaf, .p2 .swing, .p2 .win, .p2 .winf, .p2 .post { fill: none; stroke: #a8adb4; stroke-width: .03; }
.p2 .f { fill: #1f2226; }
.p2 .f2 { stroke: #7a8088; stroke-width: .025; }
.p2 .swing { stroke: #7a8088; stroke-width: .02; stroke-dasharray: .08 .07; }
.p2 .leaf { stroke: #ece8e1; stroke-width: .045; }
.p2 .win { stroke: #ece8e1; stroke-width: .025; }
.p2 .winf { fill: #101215; stroke: none; }
.p2 .post { fill: #3a3d43; stroke: #a8adb4; }
.p2 .rail, .p2 .fence { stroke: #8d939b; stroke-width: .04; stroke-dasharray: .05 .2; stroke-linecap: round; }
.p2 .pl { fill: #2c3a29; stroke: #4c6045; stroke-width: .02; }
.p2 .pl2 { fill: #3e5139; }
.p2 .loc { fill: #6b7078; }
.p2 .loc.ok { fill: var(--accent); }
.p2 .loc.miss { fill: var(--bad); }
.p2 .ring { fill: none; stroke: var(--accent); stroke-width: .04; }

/* Tuần của bạn: story tổng kết 7 ngày */
.wk { position: relative; height: min(640px, calc(100vh - 180px)); width: auto; max-width: 100%; aspect-ratio: 9 / 16; margin: 8px auto 0; border-radius: 14px; overflow: hidden; background: var(--surface); border: 1px solid var(--line); user-select: none; }
.wk-prog { position: absolute; top: 10px; left: 10px; right: 10px; display: flex; gap: 4px; z-index: 3; }
.wk-prog i { flex: 1; height: 2px; background: var(--line); border-radius: 2px; overflow: hidden; }
.wk-prog b { display: block; height: 100%; background: var(--text); transform: scaleX(0); transform-origin: left; }
.wk-slide { position: absolute; inset: 0; padding: 40px 22px 24px; display: grid; align-content: end; gap: 10px; opacity: 0; transform: translateY(10px); transition: opacity .4s ease, transform .4s ease; pointer-events: none; }
.wk-slide.on { opacity: 1; transform: none; pointer-events: auto; }
.wk-slide .k { color: var(--muted); font-size: .85rem; }
.wk-slide .big { font-size: clamp(2.6rem, 11vw, 3.6rem); font-weight: 800; line-height: .98; letter-spacing: -.03em; }
.wk-slide .big.acc { color: var(--accent); }
.wk-slide p { color: var(--muted); margin: 0; }
.wk-slide .brain { width: 58%; justify-self: center; margin: 24px 0 auto; }
.wk-slide .brain path { fill: none; stroke: var(--accent); stroke-width: 1.2; stroke-linecap: round; stroke-linejoin: round; }
.wk-bars { display: flex; align-items: end; gap: 6px; height: 130px; }
.wk-bars i { flex: 1; background: var(--line); border-radius: 3px 3px 0 0; }
.wk-bars i.top { background: var(--accent); }
.wk-days { display: flex; gap: 6px; font-size: .7rem; color: var(--muted); }
.wk-days span { flex: 1; text-align: center; }
.wk-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.wk-list li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.wk-list li span { color: var(--muted); }
.wk-list li b { font-size: 1.15rem; }
.wk-nav { position: absolute; top: 0; bottom: 70px; width: 40%; background: none; border: 0; cursor: pointer; z-index: 2; }
.wk-nav.prev { left: 0; width: 30%; }
.wk-nav.next { right: 0; }
.wk-slide .row { z-index: 4; position: relative; }
@media (prefers-reduced-motion: reduce) { .wk-slide { transition: none; } }

/* Popup cuối tuần: nổi lên một lần rồi bồng bềnh nhẹ, không phát sáng */
.weekpop { position: fixed; right: 24px; bottom: 24px; z-index: 60; width: min(380px, calc(100vw - 32px)); display: grid; grid-template-columns: 52px 1fr; gap: 14px; align-items: start;
  padding: 16px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 18px 40px rgba(0, 0, 0, .45);
  animation: wp-in .55s cubic-bezier(.2, 1.3, .4, 1) both, wp-float 3.2s ease-in-out .6s infinite; }
.weekpop .brain { width: 52px; height: 52px; }
.weekpop .brain path { fill: none; stroke: var(--accent); stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; }
.weekpop b { display: block; font-size: 1rem; margin: 2px 24px 2px 0; }
.weekpop small { display: block; margin-bottom: 12px; }
.weekpop .wp-x { position: absolute; top: 8px; right: 8px; width: 30px; height: 30px; display: grid; place-items: center; border: 0; background: none; color: var(--muted); cursor: pointer; border-radius: 8px; }
.weekpop .wp-x:hover { color: var(--text); background: var(--surface-2); }
.weekpop .wp-x svg { width: 16px; height: 16px; }
.weekpop.out { animation: wp-out .25s ease-in both; }
@keyframes wp-in { from { opacity: 0; transform: translateY(28px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes wp-float { 0%, 100% { translate: 0 0; } 50% { translate: 0 -5px; } }
@keyframes wp-out { to { opacity: 0; transform: translateY(16px) scale(.98); } }
@media (max-width: 640px) { .weekpop { right: 16px; left: 16px; bottom: 16px; width: auto; } }
@media (prefers-reduced-motion: reduce) { .weekpop, .weekpop.out { animation: none; } }

/* ====== Khởi động (người mới): 3 màn bằng hình ====== */
.start { position: fixed; inset: 0; z-index: 320; display: grid; place-items: center; padding: 16px; background: rgba(5, 6, 8, .86); backdrop-filter: blur(6px); animation: st-fade .3s var(--ease); }
.start.out { opacity: 0; transition: opacity .25s; }
@keyframes st-fade { from { opacity: 0; } }
.st-box { width: min(560px, 100%); max-height: calc(100svh - 32px); overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 18px 22px 24px; }
.st-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 36px; }
.st-dots { display: flex; gap: 6px; }
.st-dots i { width: 8px; height: 8px; border-radius: 99px; background: var(--line); transition: width .3s var(--ease), background .3s; }
.st-dots i.on { width: 26px; background: var(--accent); }
.st-dots i.past { background: var(--muted); }
.st-page { display: grid; gap: 20px; justify-items: center; text-align: center; padding-top: 8px; animation: st-in .45s var(--ease); }
@keyframes st-in { from { opacity: 0; transform: translateX(calc(var(--dir, 1) * 28px)); } }
.st-page h2 { font-size: clamp(1.35rem, 4.5vw, 1.7rem); display: flex; gap: 10px; align-items: center; justify-content: center; }
.st-page h2 svg { color: var(--accent); }
.st-art { width: 132px; height: 132px; }
.st-brain { width: 100%; height: 100%; fill: none; stroke: var(--accent); stroke-width: 1; stroke-linecap: round; stroke-linejoin: round; }
.st-brain path { stroke-dasharray: 60; stroke-dashoffset: 60; animation: st-draw 1.6s var(--ease) forwards; }
.st-brain path:nth-child(n+3) { animation-delay: .7s; }
@keyframes st-draw { to { stroke-dashoffset: 0; } }
.st-loop { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(5, 1fr); width: 100%; }
.st-loop li { display: grid; justify-items: center; gap: 8px; font-size: .82rem; color: var(--muted); position: relative; opacity: 0; animation: st-pop .5s var(--ease) forwards; animation-delay: calc(.9s + var(--k) * .22s); }
.st-loop li svg { width: 44px; height: 44px; padding: 11px; border-radius: 50%; border: 1px solid var(--line); color: var(--text); background: var(--bg); }
.st-loop li:last-child svg { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); }
.st-loop li + li::before { content: ""; position: absolute; top: 22px; right: calc(50% + 26px); width: calc(100% - 52px); height: 1px; background: var(--line); }
@keyframes st-pop { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.st-act { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.st-goals { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; }
.st-goal { display: grid; justify-items: start; gap: 4px; text-align: left; padding: 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); color: var(--text); cursor: pointer; font: inherit; opacity: 0; animation: st-pop .4s var(--ease) forwards; animation-delay: calc(var(--k) * .07s); transition: border-color .2s, transform .15s; }
.st-goal:hover { border-color: var(--muted); transform: translateY(-2px); }
.st-goal:active { transform: scale(.98); }
.st-goal.on { border-color: var(--accent); }
.st-goal svg { width: 26px; height: 26px; color: var(--accent); margin-bottom: 6px; }
.st-goal span { font-size: .8rem; color: var(--muted); }
.st-note { margin-top: -6px; }

/* Lộ trình 7 bước: dùng ở màn Khởi động và thẻ đầu trang Hôm nay */
.spath { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(7, 1fr); width: 100%; }
.spath li { position: relative; opacity: 0; animation: st-pop .4s var(--ease) forwards; animation-delay: calc(var(--k) * .06s); }
.spath li + li::before { content: ""; position: absolute; top: 19px; right: calc(50% + 20px); width: calc(100% - 40px); height: 2px; border-radius: 2px; background: var(--line); }
.spath li.ok + li::before { background: var(--accent); }
.spath a { display: grid; justify-items: center; gap: 6px; text-decoration: none; color: var(--muted); font-size: .72rem; text-align: center; line-height: 1.3; }
.sp-dot { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--line); background: var(--bg); color: var(--muted); transition: transform .2s var(--ease); }
.sp-dot svg { width: 18px; height: 18px; }
.spath a:hover .sp-dot { transform: translateY(-2px); }
.spath li.ok .sp-dot { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.spath li.next .sp-dot { border-color: var(--accent); color: var(--accent); animation: sp-breath 2.4s ease-in-out infinite; }
.spath li.next a { color: var(--text); }
@keyframes sp-breath { 50% { transform: scale(1.08); } }
.spath.big .sp-t { font-size: .76rem; }
.startcard .head h2 { display: flex; gap: 8px; align-items: center; }
.startcard .head h2 svg { color: var(--accent); width: 20px; height: 20px; }
.startcard .sp-next { justify-content: flex-end; margin-top: 14px; }
@media (max-width: 640px) {
  .spath { grid-template-columns: repeat(7, 1fr); }
  .spath .sp-t { display: none; }
  .sp-dot { width: 34px; height: 34px; }
  .sp-dot svg { width: 16px; height: 16px; }
  .spath li + li::before { top: 16px; right: calc(50% + 17px); width: calc(100% - 34px); }
  .spath.big .sp-t { display: block; font-size: .66rem; }
  .spath.big li.next .sp-t { position: static; transform: none; white-space: normal; }
  .st-loop li { font-size: .72rem; }
}
.tour-card h3 { display: flex; gap: 8px; align-items: center; }
.tour-ic svg { color: var(--accent); width: 20px; height: 20px; display: block; }

/* Chuyển trang (View Transitions): đầu trang và thanh điều hướng đứng yên, chỉ phần nội dung trượt nhẹ */
#view { view-transition-name: view; }
::view-transition-old(root), ::view-transition-new(root) { animation: none; }
::view-transition-old(view) { animation: vt-out .16s ease-in both; }
::view-transition-new(view) { animation: vt-in .34s var(--ease) both; }
@keyframes vt-out { to { opacity: 0; transform: translateY(-6px); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(10px); } }
@media (prefers-reduced-motion: reduce) {
  .start, .st-page, .st-loop li, .st-goal, .spath li, .st-brain path, .spath li.next .sp-dot { animation: none !important; opacity: 1; stroke-dashoffset: 0; }
}

/* ====== Giảm chữ: nút (i) mở bong bóng, hàng icon + vài chữ ====== */
.tip { display: inline-flex; align-items: center; gap: 4px; vertical-align: middle; padding: 2px; margin: -2px 0; border: 0; background: none; color: var(--muted); font: inherit; font-size: .85em; cursor: pointer; border-radius: 99px; transition: color .2s; }
.tip svg { width: 15px; height: 15px; }
.tip:hover, .tip[aria-expanded=true] { color: var(--accent); }
.tip span { text-decoration: underline dotted; text-underline-offset: 3px; }
.tip-pop { position: absolute; z-index: 400; padding: 12px 14px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); color: var(--text); font-size: .85rem; line-height: 1.5; animation: tip-in .18s var(--ease); }
@keyframes tip-in { from { opacity: 0; transform: translateY(4px); } }
.facts { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: .85rem; color: var(--muted); }
.facts span { display: inline-flex; align-items: center; gap: 6px; }
.facts svg { width: 16px; height: 16px; color: var(--accent); flex: none; }
@media (prefers-reduced-motion: reduce) { .tip-pop { animation: none; } }
.sci-use svg { width: 14px; height: 14px; vertical-align: -2px; margin-right: 4px; }

/* ====== Concept P trong web: thời tiết não, thư gửi mình, nghe tuần, nhịp năng lượng, đấu trí ====== */
.wxchip { display: inline-flex; align-items: center; gap: 8px; margin: 6px 10px 4px 0; font-size: .9rem; font-weight: 600; }
.wxchip svg { width: 26px; height: 26px; }
.wx-sun svg { color: var(--accent); animation: wx-spin 24s linear infinite; }
.wx-cloud svg { color: var(--text); animation: wx-float 4s ease-in-out infinite; }
.wx-rain svg { color: var(--muted); animation: wx-float 3s ease-in-out infinite; }
@keyframes wx-spin { to { transform: rotate(360deg); } }
@keyframes wx-float { 50% { transform: translateY(-3px); } }
.sx .head h2 svg, .capsule .head h2 svg, .wsound .head h2 svg, .duel .head h2 svg { width: 20px; height: 20px; color: var(--accent); vertical-align: -3px; margin-right: 8px; }
.capsule textarea { width: 100%; background: var(--bg); border: 1px solid var(--line); border-radius: var(--r); color: var(--text); font: inherit; padding: 10px; margin-bottom: 10px; resize: vertical; }
.cap-row { display: flex; gap: 16px; align-items: center; margin-bottom: 10px; }
.cap-row > div { display: grid; gap: 2px; flex: 1; }
.cap-env { width: 96px; flex: none; fill: var(--bg); stroke: var(--text); stroke-width: 2; stroke-linejoin: round; }
.cap-env circle { fill: var(--accent); stroke: none; }
.cap-env.open .flap { transform: scaleY(-1); transform-origin: 60px 4px; transform-box: view-box; transition: transform .6s var(--ease); }
.cap-prog { height: 6px; border-radius: 99px; background: var(--line); overflow: hidden; margin-top: 8px; }
.cap-prog i { display: block; height: 100%; background: var(--accent); }
.cap-letter { margin: 0; padding: 12px 14px; border-left: 2px solid var(--accent); background: var(--bg); border-radius: 0 var(--r) var(--r) 0; display: grid; gap: 6px; animation: st-pop .5s var(--ease); white-space: pre-wrap; }
.wsound { margin-top: 14px; }
.ws-bars { display: flex; gap: 10px; align-items: end; justify-content: center; height: 170px; margin: 18px 0 14px; }
.ws-bars span { flex: 1; max-width: 48px; display: grid; gap: 4px; justify-items: center; align-content: end; height: 100%; }
.ws-bars i { width: 100%; max-width: 44px; height: calc(var(--h) * 1.3px); min-height: 4px; border-radius: 5px; background: var(--line); transition: background .2s, transform .2s; }
.ws-bars i.none { opacity: .4; }
.ws-bars i.on { background: var(--accent); transform: translateY(-5px); }
.ws-bars small { font: .68rem var(--mono); color: var(--muted); }
.duel-vs { display: flex; gap: 10px; align-items: center; padding: 10px 0 14px; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.duel-vs svg { width: 20px; height: 20px; color: var(--muted); }
.duel-vs .mono { margin-left: auto; color: var(--accent); }
.duel-stage { display: grid; gap: 18px; justify-items: center; padding: 18px 0; text-align: center; }
.duel-top { display: flex; justify-content: space-between; width: min(320px, 100%); color: var(--muted); }
.duel-top b { color: var(--text); font-size: 1.2rem; }
.duel-q { font-size: clamp(2.2rem, 9vw, 3.4rem); font-weight: 700; }
.duel-in { width: 160px; text-align: center; font-size: 1.6rem; }
.duel-dots { display: flex; gap: 6px; }
.duel-dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--line); transition: background .2s; }
.duel-dots i.on { background: var(--accent); }
.shake { animation: shake .3s; }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.duel-res { display: flex; gap: 28px; align-items: end; height: 170px; }
.db { display: grid; justify-items: center; gap: 6px; align-content: end; height: 100%; }
.db i { width: 48px; height: var(--h); border-radius: 8px 8px 0 0; background: var(--line); animation: db-up .9s var(--ease) both; transform-origin: bottom; }
.db.me i { background: var(--accent); }
@keyframes db-up { from { transform: scaleY(0); } }
.duel-verdict { display: flex; gap: 8px; align-items: center; justify-content: center; font-size: 1.3rem; }
.duel-verdict svg { color: var(--accent); }
@media (prefers-reduced-motion: reduce) { .wxchip svg, .db i, .cap-letter, .shake { animation: none; } }

/* Hero: bộ não bằng hạt (canvas) thay cho nét SVG; không có canvas thì vẫn hiện SVG */
.ix-pbrain { position: absolute; inset: 0; width: 100%; height: 100%; }
.ix-media:has(.ix-pbrain) .ix-bigbrain { opacity: 0; }

/* Nootropics: biểu đồ chi tiết, đọc số theo giờ, tự chỉnh liều, thẻ giải thích */
.pk-grid { stroke: var(--line); stroke-width: 1; opacity: .6; }
.pk-zone { fill: var(--warn); opacity: .06; }
.pk-limt { fill: var(--warn) !important; }
.pk-now { stroke: var(--text); stroke-width: 1; opacity: .35; }
.pk-nowt { fill: var(--text) !important; }
.pk-dose { fill: var(--text) !important; font-weight: 700; }
.pk-cur { stroke: var(--accent); stroke-width: 1; stroke-dasharray: 2 3; }
.pk-read { color: var(--muted); margin-top: 6px; min-height: 1.4em; }
.src.own { border-color: var(--accent); }
.src-edit-btn { display: flex; align-items: center; gap: 8px; border-style: dashed; color: var(--muted); }
.src-edit-btn svg { width: 16px; height: 16px; }
.src-edit { display: grid; gap: 6px; }
.src-edit .li { display: grid; grid-template-columns: 1fr 90px auto 36px; gap: 8px; align-items: center; padding: 4px 0; border-bottom: 1px solid var(--line); }
.src-edit .li .field { padding: 6px 8px; text-align: right; }
.src-sp { width: 36px; }
.src-add { display: grid; grid-template-columns: 1fr 90px auto; gap: 8px; margin: 8px 0; }
.sx-grid { display: grid; grid-template-columns: 1fr 1.3fr 1fr; gap: 24px; align-items: center; }
.sx-how { display: flex; gap: 12px; align-items: flex-start; }
.sx-how > svg { width: 30px; height: 30px; color: var(--accent); flex: none; }
.sx-phase { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.sx-phase li { display: grid; justify-items: center; text-align: center; gap: 4px; font-size: .85rem; }
.sx-phase li svg { width: 40px; height: 40px; padding: 10px; border-radius: 50%; border: 1px solid var(--line); color: var(--accent); }
.sx-phase span { color: var(--muted); font-size: .78rem; }
.sx-bars { display: flex; gap: 10px; align-items: end; height: 110px; }
.sx-bars span { flex: 1; display: grid; justify-items: center; gap: 3px; height: 100%; align-content: end; grid-template-rows: 1fr auto auto; }
.sx-bars i { width: 100%; max-width: 34px; border-radius: 5px 5px 0 0; align-self: end; opacity: calc(1 - var(--k) * .18); animation: db-up .8s var(--ease) both; animation-delay: calc(var(--k) * .12s); transform-origin: bottom; }
.sx-bars small { color: var(--muted); font-size: .7rem; }
@media (max-width: 760px) { .sx-grid { grid-template-columns: 1fr; } .src-edit .li { grid-template-columns: 1fr 76px auto 36px; } }

/* Đồng hồ, vòng đeo */
.wear-set .head h2 svg, .wear .head h2 svg { width: 20px; height: 20px; color: var(--accent); vertical-align: -3px; margin-right: 8px; }
.wear-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.wear-opt { display: grid; justify-items: start; gap: 4px; padding: 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); color: var(--text); font: inherit; cursor: pointer; text-align: left; transition: border-color .2s, transform .15s; }
.wear-opt:hover:not(:disabled) { border-color: var(--accent); transform: translateY(-2px); }
.wear-opt:disabled { opacity: .45; cursor: not-allowed; }
.wear-opt svg { width: 24px; height: 24px; color: var(--accent); margin-bottom: 4px; }
.wear-opt span { font-size: .78rem; color: var(--muted); }
.ble-live[hidden] { display: none; }
.ble-live { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.ble-live > svg { width: 28px; height: 28px; color: var(--accent); animation: beat var(--beat, 1s) ease-in-out infinite; }
.ble-live b { font-size: 1.8rem; }
.ble-live .btn { margin-left: auto; }
@keyframes beat { 15% { transform: scale(1.2); } 30% { transform: scale(1); } }
.wear-how summary { cursor: pointer; display: flex; gap: 8px; align-items: center; font-size: .88rem; color: var(--muted); }
.wear-how summary svg { width: 16px; height: 16px; }
.wear-how ul { list-style: none; padding: 0; margin: 8px 0 0; }
.wear-how li { display: grid; gap: 2px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.wear-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 16px; }
.wear-m { display: grid; gap: 6px; }
.wm-h { display: flex; gap: 6px; align-items: center; color: var(--muted); font-size: .8rem; }
.wm-h svg { width: 15px; height: 15px; color: var(--accent); }
.wear-m b { font-size: 1.3rem; }
.wm-bars { display: flex; gap: 4px; align-items: end; height: 40px; }
.wm-bars i { flex: 1; border-radius: 3px; background: var(--accent); opacity: .75; }
.wm-bars i:last-child { opacity: 1; }
.wm-bars i.none { background: var(--line); }
@media (prefers-reduced-motion: reduce) { .ble-live > svg { animation: none; } }

/* Người mới: dải "trang này để làm gì", chế độ đơn giản */
.phelp { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); border-left: 3px solid var(--accent); background: var(--surface); animation: st-pop .4s var(--ease); transition: opacity .25s, transform .25s; }
.phelp.out { opacity: 0; transform: translateY(-6px); }
.phelp > svg { width: 28px; height: 28px; color: var(--accent); flex: none; }
.phelp > div { display: grid; gap: 2px; flex: 1; }
.phelp span { display: flex; align-items: center; gap: 6px; font-size: .85rem; color: var(--muted); }
.phelp span svg { width: 14px; height: 14px; color: var(--accent); }
body.simple .adv { display: none; }
.more-all { display: flex; justify-content: center; margin-top: 14px; }
.seg-more { display: inline-flex; align-items: center; gap: 6px; border: 1px dashed var(--line); background: none; color: var(--muted); border-radius: 99px; padding: 6px 12px; font: inherit; font-size: .85rem; cursor: pointer; white-space: nowrap; }
.seg-more:hover { color: var(--text); border-color: var(--muted); }
.seg-more svg { width: 14px; height: 14px; }
@media (prefers-reduced-motion: reduce) { .phelp { animation: none; } }

/* Cung điện trí nhớ khó hơn */
.pal-and { display: flex; justify-content: center; color: var(--muted); }
.pal-and svg { width: 16px; height: 16px; }
.pal-rest { justify-items: center; text-align: center; }
.pal-rest > span svg { width: 14px; height: 14px; vertical-align: -2px; margin-right: 6px; }
.rest-ring { width: 84px; height: 84px; position: relative; }
.rest-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.rest-ring circle { fill: none; stroke-width: 6; }
.rest-ring .rt { stroke: var(--line); }
.rest-ring .rv { stroke: var(--accent); stroke-dasharray: 100; stroke-linecap: round; }
.rest-ring b { position: absolute; inset: 0; display: grid; place-items: center; font-size: 1.3rem; }
.pr-in { width: 120px; text-align: center; font-size: 1.3rem; }
.wear-opts { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.wear-opt.best { border-color: var(--accent); }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; font-size: .78rem; color: var(--muted); }
.crumbs span { padding: 2px 8px; border-radius: 99px; border: 1px solid var(--line); background: var(--bg); color: var(--text); }
.crumbs svg { width: 12px; height: 12px; }
.wsc { display: grid; gap: 14px; }
.wsc h2 { display: flex; gap: 10px; align-items: center; }
.wsc h2 svg { color: var(--accent); }
.wsc-steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 0; }
.wsc-steps li { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: .9rem; opacity: 0; animation: st-pop .4s var(--ease) forwards; animation-delay: calc(var(--k) * .06s); }
.wsc-ic { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--line); flex: none; color: var(--accent); }
.wsc-ic svg { width: 16px; height: 16px; }
.wsc-link { display: flex; gap: 8px; align-items: center; padding: 10px; border-radius: var(--r); background: var(--bg); border: 1px dashed var(--line); }
.wsc-link code { flex: 1; font-size: .75rem; overflow-wrap: anywhere; color: var(--accent); }

/* Tầm nhìn chớp */
.fl-stage { position: relative; width: min(420px, 100%); aspect-ratio: 1; margin: 10px auto; border-radius: 50%; border: 1px solid var(--line); }
.fl-c { position: absolute; left: 50%; top: 50%; translate: -50% -50%; width: 64px; height: 64px; display: grid; place-items: center; }
.fl-c svg { width: 48px; height: 48px; color: var(--text); }
.fl-mask { display: block; width: 48px; height: 48px; background: repeating-linear-gradient(45deg, var(--muted) 0 3px, transparent 3px 7px); }
.fl-p { position: absolute; translate: -50% -50%; width: 52px; height: 52px; border-radius: 50%; border: 1px dashed var(--line); background: none; display: grid; place-items: center; color: var(--accent); padding: 0; }
.fl-p:not(:disabled) { cursor: pointer; border-style: solid; }
.fl-p:not(:disabled):hover { border-color: var(--accent); }
.fl-p svg { width: 30px; height: 30px; }
.fl-p.sm { width: 40px; height: 40px; }
.fl-p.sm svg { width: 22px; height: 22px; }
.fl-p.mask svg { color: var(--muted); }
.fl-p.nz svg { color: var(--muted); }
.fl-p.mask { background: repeating-linear-gradient(45deg, var(--line) 0 3px, transparent 3px 7px); }
.fl-p.ans { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 18%, transparent); }
.fl-p.bad { border-color: var(--bad); }
.fl-ask { display: grid; justify-items: center; gap: 10px; min-height: 90px; text-align: center; }
.fl-ask p svg { width: 14px; height: 14px; vertical-align: -2px; margin-right: 6px; }

/* Tri thức: thư viện dạng icon + tiêu đề, bấm để mở */
.kflips { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 0 20px; }
.kflip { border-bottom: 1px solid var(--line); }
.kflip summary { display: flex; align-items: center; gap: 12px; padding: 12px 0; cursor: pointer; list-style: none; }
.kflip summary::-webkit-details-marker { display: none; }
.kflip summary > svg { width: 16px; height: 16px; color: var(--accent); margin-left: auto; flex: none; }
.kf-ic { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); color: var(--accent); flex: none; transition: transform .2s var(--ease); }
.kf-ic svg { width: 18px; height: 18px; }
.kflip[open] .kf-ic { transform: rotate(-8deg) scale(1.08); }
.kflip p { padding: 0 0 14px 48px; animation: st-pop .3s var(--ease); }
.kflip.read b { color: var(--muted); }
.kic { display: inline-flex; gap: 6px; align-items: center; }
.kic svg { width: 14px; height: 14px; }

/* Bảng xếp hạng 4 hạng mục */
.bcats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 14px; }
.bcat { display: grid; justify-items: center; gap: 6px; padding: 12px 6px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); color: var(--muted); font: inherit; font-size: .78rem; cursor: pointer; text-align: center; transition: border-color .2s, color .2s, transform .15s; }
.bcat:hover { color: var(--text); transform: translateY(-2px); }
.bcat.on { border-color: var(--accent); color: var(--text); }
.bcat svg { width: 22px; height: 22px; color: var(--accent); }
.bme { display: flex; align-items: center; gap: 10px; padding: 10px 12px; margin-bottom: 10px; border-radius: var(--r); background: var(--surface-2); font-size: .9rem; }
.bme svg { width: 18px; height: 18px; color: var(--accent); }
.board-list .br svg { width: 18px; height: 18px; color: var(--accent); }
.board .head span svg { width: 13px; height: 13px; vertical-align: -2px; }
@media (max-width: 520px) { .bcat span { font-size: .7rem; } }

/* ====== Mục tiêu: thẻ vòng tiến độ, +1 to, mốc, ăn mừng ====== */
.goals2 .head h2 { display: flex; gap: 8px; align-items: center; }
.goals2 .head h2 svg { width: 20px; height: 20px; color: var(--accent); }
.goals2 .head .muted svg { width: 13px; height: 13px; vertical-align: -2px; margin-right: 4px; color: var(--accent); }
.g-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.g-card { position: relative; display: grid; grid-template-columns: 80px 1fr auto; align-items: center; gap: 14px; padding: 14px; border-radius: 16px; background: var(--bg); border: 1px solid var(--line); transition: border-color .3s, transform .2s var(--ease); }
.g-card:hover { border-color: #3a404a; }
.g-viz { position: relative; width: 80px; height: 80px; }
.g-ring { width: 100%; height: 100%; transform: rotate(-90deg); overflow: visible; }
.g-rt { fill: none; stroke: var(--line); stroke-width: 7; }
.g-rv { fill: none; stroke: var(--accent); stroke-width: 7; stroke-linecap: round; transition: stroke-dashoffset .7s cubic-bezier(.2, .9, .3, 1.2); }
.g-tick { fill: var(--surface-2); stroke: var(--bg); stroke-width: 1.5; transition: fill .3s; }
.g-tick.on { fill: var(--accent); }
.g-tick.pop { animation: tick-pop .6s var(--ease); transform-box: fill-box; transform-origin: center; }
@keyframes tick-pop { 40% { transform: scale(2); } }
.g-ic { position: absolute; inset: 0; display: grid; place-items: center; color: var(--text); }
.g-ic svg { width: 24px; height: 24px; }
.g-info { display: grid; gap: 4px; min-width: 0; }
.g-info b { font-size: 1rem; line-height: 1.25; overflow-wrap: anywhere; }
.g-num { color: var(--muted); font-size: .9rem; }
.g-p { display: inline-block; color: var(--text); font-weight: 700; font-size: 1.25rem; }
.g-p.roll { animation: roll .45s var(--ease); }
@keyframes roll { from { transform: translateY(70%); opacity: 0; } }
.g-plus { width: 54px; height: 54px; border-radius: 50%; border: 0; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; cursor: pointer; transition: transform .15s var(--ease); touch-action: manipulation; }
.g-plus svg { width: 26px; height: 26px; stroke-width: 2.5; }
.g-plus:hover { transform: scale(1.06); }
.g-plus:active { transform: scale(.88); }
.g-plus.hit { animation: plus-hit .4s var(--ease); }
@keyframes plus-hit { 30% { transform: scale(.82) rotate(-12deg); } 70% { transform: scale(1.08) rotate(6deg); } }
.g-float { position: absolute; left: 50%; top: 4px; translate: -50% 0; font-weight: 700; color: var(--accent); pointer-events: none; animation: g-float .9s var(--ease) forwards; }
@keyframes g-float { to { transform: translateY(-34px); opacity: 0; } }
.g-more { position: absolute; top: 6px; right: 6px; display: flex; gap: 2px; opacity: 0; transition: opacity .2s; }
.g-card:hover .g-more, .g-card:focus-within .g-more { opacity: 1; }
@media (hover: none) { .g-more { opacity: .7; } }
.g-more button { width: 26px; height: 26px; border-radius: 8px; border: 0; background: var(--surface-2); color: var(--muted); display: grid; place-items: center; cursor: pointer; }
.g-more button:hover { color: var(--text); }
.g-more svg { width: 14px; height: 14px; }
.g-card.done { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.g-card.done .g-ic { color: var(--accent); }
.g-card.done .g-p { color: var(--accent); }
.g-badge { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 99px; background: var(--accent); color: var(--accent-ink); font-weight: 700; font-size: .85rem; }
.g-badge svg { width: 15px; height: 15px; }
.g-card.finish { animation: g-finish .9s var(--ease); }
.g-card.finish .g-ring { animation: g-spin .9s var(--ease); }
@keyframes g-finish { 25% { transform: scale(1.04); } 50% { transform: scale(.98); } }
@keyframes g-spin { to { transform: rotate(270deg); } }
.g-new { display: grid; gap: 12px; margin-bottom: 14px; padding-bottom: 14px; border-bottom: 1px solid var(--line); animation: st-pop .35s var(--ease); }
.g-tpls { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.g-tpl { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 12px; border: 1px dashed var(--line); background: none; color: var(--text); font: inherit; font-size: .85rem; cursor: pointer; text-align: left; transition: border-color .2s, transform .15s; }
.g-tpl:hover { border-color: var(--accent); border-style: solid; transform: translateY(-2px); }
.g-tpl svg { width: 18px; height: 18px; color: var(--accent); flex: none; }
.g-tpl span { flex: 1; }
.g-tpl small { color: var(--muted); }
.g-form { display: grid; grid-template-columns: 1fr 80px auto; gap: 8px; }
@media (max-width: 520px) { .g-card { grid-template-columns: 64px 1fr auto; } .g-viz { width: 64px; height: 64px; } .g-form { grid-template-columns: 1fr 70px; } .g-form .btn { grid-column: 1 / -1; } }
@media (prefers-reduced-motion: reduce) { .g-rv { transition: none; } .g-p.roll, .g-plus.hit, .g-float, .g-card.finish, .g-card.finish .g-ring, .g-tick.pop { animation: none; } }

/* ====== Đầu trang Hôm nay: số điểm to, lý do, 7 cột, đêm qua (concept O) ====== */
.hero.sh { display: grid; gap: 16px; align-items: start; }
.sh-top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.sh-top h1 { margin: 0; }
.sh-main { display: grid; grid-template-columns: auto 1fr; gap: 24px; align-items: end; }
.sh-score { display: grid; justify-items: start; gap: 2px; padding: 0; border: 0; background: none; color: var(--text); cursor: pointer; text-align: left; font: inherit; }
.sh-score .lbl { font-size: .85rem; color: var(--muted); }
.sh-num { font-size: clamp(4.6rem, 13vw, 7.5rem); line-height: .9; font-weight: 700; letter-spacing: -.05em; color: var(--accent); transition: transform .2s var(--ease); }
.sh-score:hover .sh-num { transform: translateY(-2px); }
.sh-score:active .sh-num { transform: scale(.97); }
.sh-link { display: inline-flex; gap: 6px; align-items: center; color: var(--muted); margin-top: 6px; }
.sh-link svg { width: 14px; height: 14px; }
.sh-score:hover .sh-link { color: var(--accent); }
.sh-side { display: grid; gap: 10px; min-width: 0; }
.sh-side .wxchip { margin: 0; }
.sh-delta { display: flex; gap: 6px; align-items: flex-start; font-size: .9rem; color: var(--muted); margin: 0; }
.sh-delta svg { width: 16px; height: 16px; flex: none; margin-top: 2px; }
.sh-delta.up { color: var(--accent); }
.sh-delta.down { color: var(--bad); }
.sh-bars { display: flex; gap: 6px; align-items: end; height: 76px; }
.sh-bar { flex: 1; max-width: 34px; height: 100%; display: grid; grid-template-rows: 1fr auto; gap: 4px; justify-items: stretch; }
.sh-bar i { align-self: end; height: var(--h); border-radius: 5px; background: var(--line); transition: background .2s; }
.sh-bar i.none { background: transparent; border: 1px dashed var(--line); }
.sh-bar.now i { background: var(--accent); }
.sh-bar:hover i:not(.none) { background: color-mix(in srgb, var(--accent) 60%, var(--line)); }
.sh-bar small { font: .62rem var(--mono); color: var(--muted); text-align: center; }
.sh-facts { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); }
.sh-facts > div { display: grid; gap: 2px; padding: 12px 12px 4px 0; }
.sh-facts > div + div { padding-left: 12px; border-left: 1px solid var(--line); }
.sh-facts .lbl { display: flex; gap: 6px; align-items: center; font-size: .8rem; color: var(--muted); }
.sh-facts .lbl svg { width: 14px; height: 14px; color: var(--accent); }
.sh-facts b { font-size: 1.15rem; }
.sh-facts small { font-size: .78rem; }
.hero.sh .coach { margin: 0; }
@media (max-width: 560px) { .sh-main { grid-template-columns: 1fr; gap: 12px; } .sh-facts > div { padding-right: 6px; } .sh-facts > div + div { padding-left: 8px; } .sh-facts b { font-size: 1rem; } }
/* Cung điện: chọn bản đồ, thanh thời gian câu hỏi */
.pal-maps { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.pal-maps .chip svg { width: 15px; height: 15px; vertical-align: -3px; margin-right: 6px; }
.pal-card .tbar.pal-q { margin-top: 6px; }
.pal-card .tbar.pal-q i { transition: background .3s; }
.pal-card .tbar.low i { background: var(--bad); }
.pal-left { min-height: 1.2em; }
/* Bộ não chứa nước ở thanh người chơi (brainfill.js) */
.lv-txt { display: inline-flex; align-items: center; gap: 6px; }
.bfill { width: 23px; height: 23px; margin: -2px 0; display: inline-block; flex: none; cursor: pointer; transition: transform .3s cubic-bezier(.3,1.6,.5,1); }
.bfill svg { width: 100%; height: 100%; overflow: visible; display: block; }
.bfill.pop { transform: scale(1.4); }
.bfill .lb { fill: var(--surface-2); }
.bfill .w2 { fill: var(--accent); opacity: .32; }
.bfill .w1 { opacity: .9; transition: opacity .3s; }
.bfill.flash .w1 { opacity: 1; }
.bfill .sh { fill: none; stroke: #f4ffd6; stroke-width: .4; opacity: .7; }
.bfill .gy0 path { fill: none; stroke: #4a525e; stroke-width: .7; stroke-linecap: round; }
.bfill .gy path { fill: none; stroke: #0a0b0d; stroke-width: .7; stroke-linecap: round; opacity: .7; }
.bfill .fd path { fill: none; stroke: var(--bg); stroke-width: 1; stroke-linecap: round; opacity: .55; }
.bfill .ol path { fill: none; stroke: var(--accent); stroke-width: .9; stroke-linecap: round; stroke-linejoin: round; }
.bfill .pz path { fill: none; stroke: #f6ffdc; stroke-width: 1.8; stroke-linecap: round; stroke-dasharray: .07 1.2; stroke-dashoffset: 1.1; opacity: 0; }
.bfill .pz.run path { animation: bfpz .8s cubic-bezier(.4,0,.2,1) both; animation-delay: calc(var(--k) * 35ms); }
@keyframes bfpz { 0% { opacity: 1; stroke-dashoffset: 1.1; } 80% { opacity: 1; } 100% { stroke-dashoffset: -.1; opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .bfill, .bfill .pz.run path { transition: none; animation: none; } }
/* Bảng xếp hạng từng game (openGameBoard) */
.gboard .head h2 svg { width: 20px; height: 20px; color: var(--accent); vertical-align: -3px; margin-right: 8px; }
.gb-games { display: flex; flex-wrap: wrap; gap: 6px; padding: 4px 0 10px; }
.gb-games .chip { flex: none; white-space: nowrap; }
.gb-games .chip svg { width: 15px; height: 15px; vertical-align: -3px; margin-right: 6px; }
.gb-name { margin: 6px 0 10px; font-size: 1.1rem; }

/* ====== Giấc ngủ (sleep.js) ====== */
.sl-dial-card .head h2 svg, .sl-week .head h2 svg { width: 20px; height: 20px; color: var(--accent); vertical-align: -3px; margin-right: 8px; }
.sl-wrap { display: grid; grid-template-columns: minmax(0, 340px) 1fr; gap: 28px; align-items: center; }
.sl-dial { position: relative; width: 100%; aspect-ratio: 1; touch-action: none; }
.sl-dial svg { width: 100%; height: 100%; display: block; overflow: visible; }
.sl-track { fill: none; stroke: var(--surface-2); stroke-width: 22; }
.sl-ticks line { stroke: var(--line); stroke-width: 1.5; } .sl-ticks line.big { stroke: var(--muted); stroke-width: 2; }
.sl-lab text { fill: var(--muted); font: 500 10px var(--mono); }
.sl-arc { fill: none; stroke: var(--accent); stroke-width: 22; stroke-linecap: round; transition: stroke .3s; }
.sl-dial[data-st="mid"] .sl-arc { stroke: #a9c35a; }
.sl-dial[data-st="bad"] .sl-arc { stroke: var(--bad); }
#sl-cyc circle { fill: var(--accent-ink); opacity: .55; }
.sl-stars circle { fill: var(--text); opacity: .12; transition: opacity .6s; }
.sl-dial[data-st="good"] .sl-stars circle { opacity: .7; animation: sltw 2.6s ease-in-out infinite; animation-delay: var(--d); }
@keyframes sltw { 50% { opacity: .2; } }
.sl-mid { position: absolute; inset: 30%; display: grid; place-content: center; text-align: center; gap: 2px; pointer-events: none; }
.sl-mid b { font-size: clamp(1.8rem, 6vw, 2.6rem); line-height: 1; }
.sl-mid span { color: var(--muted); font-size: .82rem; }
.sl-mid em { font-style: normal; font-weight: 700; font-size: .85rem; color: var(--accent); }
.sl-dial[data-st="mid"] .sl-mid em { color: #c9d98f; } .sl-dial[data-st="bad"] .sl-mid em { color: var(--bad); }
.sl-h { position: absolute; width: 44px; height: 44px; translate: -50% -50%; border-radius: 50%; border: 2px solid var(--bg); display: grid; place-items: center; cursor: grab; padding: 0; touch-action: none; transition: scale .2s cubic-bezier(.3,1.6,.5,1); }
.sl-h svg { width: 20px; height: 20px; }
.sl-h.moon { background: #e9edf2; color: #1b2030; } .sl-h.sun { background: var(--accent); color: var(--accent-ink); }
.sl-h:hover, .sl-h:focus-visible { scale: 1.1; } .sl-h.drag { scale: 1.2; cursor: grabbing; }
.sl-side { display: grid; gap: 12px; }
.sl-time { display: flex; justify-content: space-between; align-items: baseline; border-bottom: 1px solid var(--line); padding-bottom: 10px; }
.sl-time span { color: var(--muted); display: flex; align-items: center; gap: 8px; } .sl-time span svg { width: 16px; height: 16px; }
.sl-time b { font-size: 1.5rem; }
.sl-sug-h { margin: 6px 0 0; }
.sl-sug { display: flex; gap: 8px; flex-wrap: wrap; }
.sl-sug .chip { display: grid; gap: 2px; text-align: left; padding: 8px 12px; height: auto; }
.sl-sug .chip span { font-size: .72rem; color: var(--muted); } .sl-sug .chip.on span { color: inherit; }
.sl-caf { display: flex; align-items: center; gap: 8px; background: none; border: 1px solid var(--line); border-radius: var(--r); padding: 10px 12px; color: var(--text); font: inherit; font-size: .85rem; cursor: pointer; text-align: left; }
.sl-caf span { flex: 1; } .sl-caf svg { width: 16px; height: 16px; color: var(--warn); } .sl-caf svg:last-child { color: var(--muted); }
.sl-week { }
.sl-plot { position: relative; display: flex; gap: 10px; align-items: end; height: 150px; margin-top: 26px; border-bottom: 1px solid var(--line); }
.sl-plot i { position: relative; flex: 1; max-width: 44px; margin: 0 auto; height: calc(var(--h) * 1%); min-height: 4px; border-radius: 6px 6px 2px 2px; background: var(--accent); transform-origin: bottom; animation: slgrow .8s cubic-bezier(.2,.7,.2,1) both; }
.sl-plot i span { position: absolute; bottom: 100%; left: 50%; translate: -50% -4px; font-size: .72rem; font-style: normal; color: var(--muted); }
.sl-plot i:nth-child(2) { animation-delay: .05s } .sl-plot i:nth-child(3) { animation-delay: .1s } .sl-plot i:nth-child(4) { animation-delay: .15s } .sl-plot i:nth-child(5) { animation-delay: .2s } .sl-plot i:nth-child(6) { animation-delay: .25s } .sl-plot i:nth-child(7) { animation-delay: .3s }
@keyframes slgrow { from { transform: scaleY(0); } }
.sl-plot i.mid { background: #a9c35a; } .sl-plot i.low { background: var(--bad); } .sl-plot i.none { background: var(--line); }
.sl-days { display: flex; gap: 10px; margin-top: 6px; }
.sl-days small { flex: 1; max-width: 44px; margin: 0 auto; font: .7rem var(--mono); color: var(--muted); display: flex; gap: 3px; align-items: center; justify-content: center; } .sl-days small svg { width: 11px; height: 11px; }
.sl-target { position: absolute; left: 0; right: 0; border-top: 1px dashed var(--muted); pointer-events: none; transition: bottom .3s; }
.sl-target span { position: absolute; right: 0; top: -16px; background: var(--surface); padding-left: 4px; font: .68rem var(--mono); color: var(--muted); }
.sl-deep-list > div { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.sl-deep-list > div:first-child { border-top: 0; } .sl-deep-list b { font-size: 1.05rem; color: var(--accent); } .sl-deep-list small { grid-column: 1 / -1; }
.sl-lead { font-size: 1.25rem; font-weight: 600; line-height: 1.35; margin: 0 0 4px; } .sl-lead em { font-style: normal; color: var(--warn); } .sl-lead b { color: var(--accent); } .sl-sub { margin: 0; }
.sl-bars { position: relative; display: flex; align-items: flex-end; gap: 5px; height: 130px; margin: 18px 0 6px; }
.sl-bars i { flex: 1; border-radius: 5px 5px 2px 2px; background: var(--accent); transform-origin: bottom; animation: slGrow .5s cubic-bezier(.23,1,.32,1) both; } .sl-bars i.short { background: var(--warn); } .sl-bars i.none { background: var(--line); }
@keyframes slGrow { from { transform: scaleY(0); } } @media (prefers-reduced-motion: reduce) { .sl-bars i { animation: none; } }
.sl-need { position: absolute; left: 0; right: 0; border-top: 1px dashed currentColor; opacity: .55; } .sl-need span { position: absolute; right: 0; top: -20px; font-size: .75rem; }
.sl-axis { display: flex; justify-content: space-between; font-size: .75rem; }
.sl-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); } .sl-facts b { display: block; font-size: 1.15rem; } .sl-facts small { color: var(--muted); }
.sl-dt { margin: 22px 0 4px; font-size: .95rem; }
.sl-debt { margin-top: 12px; display: flex; align-items: center; gap: 6px; font-size: .9rem; }
.sl-debt span { display: flex; align-items: center; gap: 8px; } .sl-debt svg { width: 16px; height: 16px; color: var(--warn); } .sl-debt .good svg { color: var(--accent); }
.sl-wind { }
.sl-wind-in { display: grid; grid-template-columns: auto 1fr auto; gap: 16px; align-items: center; }
.sl-wind-in > div:first-child svg { width: 28px; height: 28px; color: var(--accent); }
.sl-wind-in h2 { font-size: 1.05rem; margin: 0; }
.sl-note { display: flex; gap: 8px; align-items: flex-start; margin-top: 14px; } .sl-note svg { width: 15px; height: 15px; flex: none; margin-top: 2px; }
.sl-night { position: fixed; inset: 0; z-index: 200; background: #040507; opacity: 0; transition: opacity .6s; display: grid; place-items: center; }
.sl-night.in { opacity: 1; }
.sl-night canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.sl-night-in { position: relative; display: grid; justify-items: center; gap: 14px; text-align: center; padding: 16px; }
.sl-orb { width: 240px; height: 240px; display: grid; place-items: center; }
.sl-orb i { width: 96px; height: 96px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #e9edf2, #9aa7b8 70%); opacity: .9; }
.sl-phase { font-size: 1.4rem; min-height: 1.5em; color: #e9edf2; }
@media (max-width: 640px) { .sl-wrap { grid-template-columns: 1fr; } .sl-dial { max-width: 320px; margin: 0 auto; } .sl-wind-in { grid-template-columns: auto 1fr; } .sl-wind-in .btn { grid-column: 1 / -1; } }
@media (prefers-reduced-motion: reduce) { .sl-plot i, .sl-dial[data-st="good"] .sl-stars circle { animation: none; } }
.sl-page { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.sl-page > .card { margin: 0; }

.sl-plot i.on { translate: 0 -5px; filter: brightness(1.2); transition: translate .2s, filter .2s; }

/* Thẻ Hiểu nhanh (trang Chất bổ trợ nhận thức) */
.sg .head h2 svg { width: 20px; height: 20px; color: var(--accent); vertical-align: -3px; margin-right: 8px; }
.sg-h { margin: 0 0 6px; }
.sg-cmp { display: grid; gap: 2px; margin-bottom: 16px; }
.sg-row { display: grid; grid-template-columns: 96px 1fr auto; gap: 12px; align-items: center; padding: 7px 8px; border: 0; border-radius: 8px; background: none; color: var(--muted); font: inherit; font-size: .85rem; cursor: pointer; text-align: left; transition: background .2s, color .2s; }
.sg-row:hover { background: var(--surface-2); } .sg-row.on { background: var(--surface-2); color: var(--text); }
.sg-row i { height: 8px; border-radius: 4px; background: linear-gradient(90deg, var(--c), transparent); width: var(--w); transform-origin: left; animation: sggrow .9s cubic-bezier(.2,.7,.2,1) both; }
.sg-row i.weeks { background: repeating-linear-gradient(90deg, var(--c) 0 22%, transparent 22% 25%); opacity: .8; }
.sg-row b { font-size: .75rem; font-weight: 500; }
@keyframes sggrow { from { transform: scaleX(0); } }
.sg-body { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 24px; border-top: 1px solid var(--line); padding-top: 14px; }
.sg-how { display: flex; gap: 12px; align-items: flex-start; grid-column: 1 / -1; }
.sg-how > svg { width: 30px; height: 30px; color: var(--c); flex: none; }
.sg-how b { font-size: 1.05rem; } .sg-how p { margin: 2px 0 0; }
.sg-keys { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; align-content: start; }
.sg-keys li { display: flex; gap: 10px; align-items: center; font-size: .9rem; }
.sg-keys svg { width: 18px; height: 18px; color: var(--c); flex: none; }
.sg-left p { margin: 0 0 6px; }
.sg-warn { grid-column: 1 / -1; display: flex; gap: 8px; align-items: flex-start; color: var(--muted); margin: 0; }
.sg-warn svg { width: 15px; height: 15px; color: var(--warn); flex: none; margin-top: 2px; }
.sg-more { grid-column: 1 / -1; }
.sg-more summary { cursor: pointer; display: flex; gap: 8px; align-items: center; font-size: .88rem; color: var(--muted); }
.sg-more summary svg { width: 16px; height: 16px; }
.sg-calc { margin-top: 10px; }
.sl-link { display: inline-flex; gap: 6px; align-items: center; text-decoration: none; }
.sl-link svg { width: 14px; height: 14px; }
@media (max-width: 640px) { .sg-body { grid-template-columns: 1fr; } .sg-row { grid-template-columns: 78px 1fr; } .sg-row b { grid-column: 2; } }
@media (prefers-reduced-motion: reduce) { .sg-row i { animation: none; } }

.mood-brain { display: none; }
.gb-name { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.gb-name .small { font-weight: 400; }
.gb-name .small svg { width: 13px; height: 13px; vertical-align: -2px; }
.gboard .board-list { margin-bottom: 12px; }
/* Xung thần kinh chạy liên tục dọc nếp não, mạnh hơn khi đang có nước */
.bfill .sig path { fill: none; stroke: #f6ffdc; stroke-width: .9; stroke-linecap: round; stroke-dasharray: .18 .82; animation: bfsig 2.4s linear infinite; animation-delay: calc(var(--k) * -0.37s); opacity: .85; }
.bfill:hover .sig path, .bfill.flash .sig path { animation-duration: .9s; stroke-width: 1.2; }
@keyframes bfsig { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) { .bfill .sig path { animation: none; opacity: 0; } }

/* Giữ chỗ cho nội dung trước khi app.js vẽ trang, tránh chân trang nhảy lên rồi bị đẩy xuống (CLS) */
#view:empty { min-height: 100vh; }

/* ===== Mint OLED: thẻ điểm trí lực gradient theo mức (data-lv 4: 80–100 ... 1: 0–39, 0: chưa log) ===== */
.sh { display: grid; gap: 12px; align-content: start; }
.sh-card { position: relative; overflow: hidden; display: grid; gap: 10px; padding: 22px; border-radius: 28px; color: #fff;
  background: var(--grad); box-shadow: 0 0 0 1px rgba(255,255,255,.08) inset, 0 24px 60px rgba(109,77,255,.30); transition: background .5s, box-shadow .5s; }
.sh-card::after { content: ""; position: absolute; width: 240px; height: 240px; right: -70px; top: -80px; border-radius: 50%; background: rgba(255,255,255,.14); pointer-events: none; }
.sh-card[data-lv="4"] { background: linear-gradient(135deg, #9be15d 0%, #2fd3b4 50%, #38bdf8 100%); box-shadow: 0 0 0 1px rgba(255,255,255,.1) inset, 0 24px 60px rgba(47,211,180,.32); color: #04140f; }
.sh-card[data-lv="2"] { background: linear-gradient(135deg, #f59e0b 0%, #f472b6 60%, #a855f7 100%); box-shadow: 0 0 0 1px rgba(255,255,255,.08) inset, 0 24px 60px rgba(244,114,182,.28); }
.sh-card[data-lv="1"] { background: linear-gradient(135deg, #1e1b4b 0%, #3730a3 55%, #0e7490 100%); box-shadow: 0 0 0 1px rgba(255,255,255,.1) inset, 0 24px 60px rgba(55,48,163,.4); }
.sh-card[data-lv="0"] { background: var(--surface); box-shadow: 0 0 0 1px var(--line) inset; }
.sh-card .sh-score { position: relative; z-index: 1; display: grid; justify-items: start; gap: 2px; padding: 0; border: 0; background: none; color: inherit; cursor: pointer; text-align: left; }
.sh-card .sh-score .lbl { font-size: .85rem; color: inherit; opacity: .85; }
.sh-card .sh-num { font-size: clamp(4.4rem, 13vw, 6.5rem); line-height: .95; font-weight: 800; letter-spacing: -.05em; color: inherit; }
.sh-card .sh-delta { position: relative; z-index: 1; justify-self: start; display: inline-flex; gap: 6px; align-items: center; padding: 6px 12px; border-radius: 999px; background: rgba(255,255,255,.2); color: inherit; font-size: .85rem; font-weight: 600; }
.sh-card[data-lv="4"] .sh-delta { background: rgba(4,20,15,.12); }
.sh-card .sh-delta svg { margin: 0; }
.sh-band { position: relative; z-index: 1; display: grid; gap: 2px; }
.sh-band { gap: 6px; } .sh-band b { font-size: clamp(1.75rem, 5.5vw, 2.5rem); font-weight: 800; line-height: 1.1; letter-spacing: -.02em; text-wrap: balance; } .sh-band span { font-size: .95rem; line-height: 1.5; opacity: .88; max-width: 52ch; text-wrap: pretty; }
.sh-card .sh-bars { position: relative; z-index: 1; height: 64px; }
.sh-card .sh-bar i { background: rgba(255,255,255,.28); } .sh-card .sh-bar.now i { background: #fff; }
.sh-card[data-lv="4"] .sh-bar i { background: rgba(4,20,15,.2); } .sh-card[data-lv="4"] .sh-bar.now i { background: #04140f; }
.sh-card .sh-bar i.none { background: transparent; border-color: rgba(255,255,255,.35); }
.sh-card .sh-bar small { color: inherit; opacity: .75; }
.sh-card[data-lv="0"] .sh-bar i { background: var(--line); } .sh-card[data-lv="0"] .sh-bar.now i { background: var(--accent); }
.sh-card .sh-link { position: relative; z-index: 1; color: inherit; opacity: .8; }
.sh > .coach, .sh > p.muted { padding: 0 4px; }
@media (prefers-reduced-motion: reduce) { .sh-card { transition: none; } }

/* Routine: chọn nhóm bằng chip có icon (thay ô chọn thả xuống) */
.rt-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.rt-pick input { position: absolute; opacity: 0; pointer-events: none; }
.rt-pick span { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); font-size: .85rem; font-weight: 500; cursor: pointer; transition: border-color .15s ease-out, color .15s ease-out, background .15s ease-out; }
.rt-pick span svg { width: 15px; height: 15px; }
.rt-pick input:checked + span { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.rt-pick input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (hover: hover) { .rt-pick span:hover { color: var(--text); } }
/* Nút Thêm nằm cuối form để chốt lại sau khi điền đủ */
.rt-new select { width: 100%; }
.rt-new .rt-add { justify-self: stretch; justify-content: center; min-height: 44px; margin-top: 4px; }

/* ===== Màu theo chủ đề (concept "Chốt", 03/12/2026): icon và vạch theo màu mảng, nền nhuộm 5%, viền 14% ===== */
.sh-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; border-top: 0; }
.sh-facts > .tf, .sh-facts > .tf + .tf { display: grid; gap: 2px; padding: 14px; border-radius: 18px; border: 1px solid color-mix(in srgb, var(--c) 14%, var(--line)); border-left: 1px solid color-mix(in srgb, var(--c) 14%, var(--line)); background: linear-gradient(180deg, color-mix(in srgb, var(--c) 5%, var(--surface)), var(--surface) 55%); }
.sh-facts .tf .lbl { display: flex; align-items: center; gap: 8px; }
.tic, .hic { width: 26px; height: 26px; border-radius: 8px; display: inline-grid; place-items: center; flex: none; color: var(--c); background: color-mix(in srgb, var(--c) 14%, transparent); }
.tic svg, .hic svg { width: 14px; height: 14px; }
.sh-facts .tf .lbl svg { color: var(--c); }
.sh-facts .tf b { margin-top: 4px; }
.meter { display: block; height: 4px; border-radius: 4px; background: var(--line); margin-top: 8px; overflow: hidden; }
.meter i { display: block; height: 100%; border-radius: 4px; background: var(--c); }
@media (max-width: 560px) { .sh-facts { grid-template-columns: 1fr 1fr; } .sh-facts > .tf:last-child { grid-column: 1 / -1; } }
.habit.tinted .hic { margin-right: -2px; }
.habit.tinted.done .check { background: var(--c); border-color: var(--c); }
.rt-ic[style] { color: var(--c); }
.rt-pl[style] .ht svg { color: var(--c); } .rt-pl.on[style] .mono { color: var(--text); }
.rt-pick label[style] input:checked + span { border-color: var(--c); color: var(--c); background: color-mix(in srgb, var(--c) 12%, transparent); }
.rt-pick label[style] span svg { color: var(--c); }
/* Sửa bố cục Hôm nay: thẻ cạnh thẻ điểm không bị kéo cao, nội dung nằm trên */
.day3 { align-self: start; align-content: start; }
/* 7 ngày qua: cột xếp chồng, mỗi phần gradient sáng dần lên trên và quầng rất nhẹ cùng màu */
.today-side { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.today-side .day3 { align-self: stretch; }
.today-side .ws { flex: 1; display: flex; flex-direction: column; }
.sh-top h1 { font-size: 1.5rem; font-weight: 700; }
.ws-sleep { --g: linear-gradient(165deg, #a78bfa, #6d28d9 55%, #3b35d6); --q: #7c4dff; }
.ws-mood { --g: linear-gradient(165deg, #fff0a3, #ffb020 50%, #ff5f1f); --q: #ff9a1f; }
.ws-move { --g: linear-gradient(165deg, #e8ff8a, #4ade80 55%, #059669); --q: #4ade80; }
.ws-learn { --g: linear-gradient(165deg, #ffc2e8, #f4439b 55%, #b5127f); --q: #f4439b; }
.ws-grid { flex: 1; display: grid; grid-template-columns: repeat(7, 1fr); grid-template-rows: 1fr; gap: 8px; min-height: 160px; margin-top: 6px; }
.ws-col { display: grid; grid-template-rows: 1fr auto; gap: 6px; min-width: 0; min-height: 0; }
.ws-bar { display: flex; flex-direction: column-reverse; gap: 3px; justify-content: flex-start; min-height: 0; }
.ws-bar i { display: block; border-radius: 7px; background: var(--g); box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 0 12px color-mix(in srgb, var(--q) 28%, transparent); }
.ws-col small { text-align: center; font-size: .68rem; color: var(--muted); }
.ws-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 12px; font-size: .8rem; color: var(--muted); }
.ws-legend span { display: inline-flex; align-items: center; gap: 6px; } .ws-legend span::before { content: ""; width: 10px; height: 10px; border-radius: 4px; background: var(--g); }

/* ====== Nhật ký "Từng bước" (journal.js) ====== */
.jr { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.jnarrow { width: 100%; max-width: 560px; margin: 0 auto; }
.jnarrow .card { padding: 20px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.jtabs { display: flex; gap: 22px; justify-content: center; border-bottom: 1px solid var(--line); }
.jtabs button { background: none; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; min-height: 44px; color: var(--muted); font: 600 .95rem "Be Vietnam Pro", sans-serif; cursor: pointer; }
.jtabs [aria-selected=true] { color: var(--text); border-color: var(--accent); }
.jtop { display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; align-items: center; }
.jdate { display: flex; align-items: center; gap: 8px; font-size: .84rem; color: var(--muted); }
.jpill { display: inline-flex; gap: 2px; padding: 3px; background: var(--surface-2); border-radius: 999px; justify-self: start; }
.jpill button { border: 0; border-radius: 999px; min-height: 38px; padding: 0 14px; background: none; color: var(--muted); font: 600 .82rem "Be Vietnam Pro", sans-serif; cursor: pointer; }
.jpill [aria-pressed=true] { background: var(--text); color: var(--bg); }
.jhi { margin: 0; color: var(--muted); }
.jprog { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.jprog button { width: 100%; min-height: 40px; background: none; border: 0; border-top: 4px solid var(--line); color: var(--muted); font: 500 .78rem "Be Vietnam Pro", sans-serif; padding: 6px 0 0; text-align: left; cursor: pointer; }
.jprog .on button { border-color: var(--text); color: var(--text); }
.jprog .ok button { border-color: var(--accent); }
.jform, .jpane { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.jpane { min-height: 260px; align-content: start; }
.jr fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.jr fieldset > * + * { margin-top: 12px; }
.jr legend { padding: 0; font-weight: 600; margin-bottom: 12px; }
.jr legend.jq { font-size: 1.2rem; line-height: 1.35; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 12px; width: 100%; }
.jr legend.jq small { font-size: .84rem; font-weight: 400; color: var(--muted); }
.jr .tags .tag span { min-height: 44px; display: inline-flex; align-items: center; }
.jfeel .mood-stage { height: 230px; margin-top: 12px; }
.mood-stage.pop { animation: jpop .45s cubic-bezier(.2, 1.35, .4, 1) both; }
@keyframes jpop { from { opacity: 0; transform: scale(.86) translateY(-10px); } }
.jbrief h3 { margin: 0; font-size: 1.35rem; line-height: 1.3; text-wrap: balance; }
.jbrief p { margin: 8px 0 0; color: var(--muted); line-height: 1.55; }
.jpromise { margin: 0; padding-bottom: 12px; border-bottom: 1px solid var(--line); font-size: .88rem; color: var(--muted); }
.jpromise b { color: var(--text); }
.jmet { border-top: 1px solid var(--line); }
.jmet:last-child { border-bottom: 1px solid var(--line); }
.jmet summary { display: grid; grid-template-columns: 8px minmax(0, 1fr) 48px minmax(84px, auto); gap: 10px; align-items: center; min-height: 66px; cursor: pointer; list-style: none; }
.jmet summary::-webkit-details-marker { display: none; }
.jdot { width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.jn { font-weight: 600; }
.jn small, .jw small { display: block; font-weight: 400; font-size: .78rem; color: var(--muted); }
.jw { text-align: right; font-weight: 600; font-size: .88rem; color: var(--c); }
.jspark { display: flex; gap: 2px; align-items: end; height: 30px; }
.jspark i { flex: 1; border-radius: 2px; background: color-mix(in srgb, var(--c) 28%, transparent); }
.jspark i.now { background: var(--c); }
.jwhy { list-style: none; margin: 0; padding: 2px 0 14px 18px; display: grid; gap: 10px; font-size: .82rem; }
.jwhy li { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; }
.jwhy span { color: var(--muted); }
.jwhy b { font-weight: 500; }
.jwhy u, .jreasons u { grid-column: 1 / -1; height: 4px; border-radius: 2px; background: var(--line); overflow: hidden; text-decoration: none; }
.jwhy u i { display: block; height: 100%; background: var(--c); }
.jwhy .txt { display: block; color: var(--muted); }
.jsrc { margin: 8px 0 0; font-size: .78rem; color: var(--muted); }
.jsrc i { display: inline-block; width: 6px; height: 6px; margin-right: 8px; border-radius: 50%; background: var(--accent); }
.jmed { margin: 0; font-size: .74rem; color: var(--muted); }
.jman .seg span { min-height: 44px; display: grid; place-items: center; }
.jends { display: flex; justify-content: space-between; margin-bottom: 0; font-size: .76rem; color: var(--muted); }
.jstep { display: grid; grid-template-columns: 56px 1fr 56px; align-items: center; text-align: center; }
.jstep button { height: 52px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); font-size: 1.4rem; cursor: pointer; }
.jstep output { font-weight: 700; font-size: 1.3rem; }
.jsat { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.jsat label { cursor: pointer; position: relative; }
.jsat input { position: absolute; opacity: 0; }
.jsat span { display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 8px; height: 124px; padding: 10px 2px; border-radius: 14px; background: var(--surface-2); border: 1px solid transparent; font-size: .74rem; line-height: 1.25; text-align: center; color: var(--muted); transition: border-color .18s, background .18s, color .18s; }
.jsat span i { width: 14px; border-radius: 7px; background: var(--s); opacity: .55; }
.jsat input:checked + span { border-color: var(--s); background: color-mix(in srgb, var(--s) 14%, var(--surface-2)); color: var(--text); }
.jsat input:checked + span i { opacity: 1; }
.jsat input:focus-visible + span { outline: 2px solid var(--text); outline-offset: 2px; }
.jreason { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.jreason h3 { margin: 0; font-size: 1.05rem; }
.jreason p { margin: 0; }
.jr .jreason .tag input:checked + span { border-color: var(--s); color: var(--text); background: color-mix(in srgb, var(--s) 18%, transparent); }
.jreason textarea, .jnx input { width: 100%; font-size: 16px; resize: vertical; }
.jnx { display: grid; gap: 6px; font-size: .84rem; color: var(--muted); }
.jbar { position: sticky; bottom: 0; z-index: 5; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 0 4px; background: linear-gradient(transparent, var(--surface) 34%); }
.jbar .btn { min-height: 48px; padding: 0 22px; justify-content: center; }
.jbar .primary { margin-left: auto; }
.jdone { display: grid; justify-items: center; gap: 14px; text-align: center; padding: 20px 0; }
.jdone h2 { margin: 0; line-height: 1.35; text-wrap: balance; }
.jdone p { margin: 0; }
.jring svg { width: 72px; height: 72px; fill: none; stroke: var(--accent); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.jring circle { opacity: .25; }
.jring path { stroke-dasharray: 40; animation: jdraw .5s .1s ease-out both; }
@keyframes jdraw { from { stroke-dashoffset: 40; } }
.jdone .jins { padding: 14px 0; border-block: 1px solid var(--line); line-height: 1.6; }
.jins b { color: var(--c-mood); }
.jacts { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.jacts .btn { min-height: 46px; }
.jlink { background: none; border: 0; color: var(--muted); text-decoration: underline; min-height: 44px; cursor: pointer; font: inherit; font-size: .85rem; }
.jback { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; }
.jback p { margin: 0; }
.jyr { display: flex; align-items: center; gap: 14px; }
.jyr h2 { margin: 0; font-size: 1.8rem; font-variant-numeric: tabular-nums; }
.jyr .btn { width: 44px; height: 44px; justify-content: center; }
.jcbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.jleg { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: .74rem; color: var(--muted); }
.jleg span { display: inline-flex; gap: 5px; align-items: center; }
.jleg i { width: 9px; height: 9px; border-radius: 3px; }
.jmonths { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 18px 20px; }
.jmo h4 { margin: 0 0 6px; font-size: .78rem; font-weight: 500; color: var(--muted); }
.jmo > div { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; }
.jmo i, .jmo button { aspect-ratio: 1; border-radius: 3px; border: 0; padding: 0; min-width: 0; }
.jmo button { background: var(--surface-2); cursor: pointer; }
.jmo i { border: 1px solid var(--line); opacity: .4; }
.jmo .sel { outline: 2px solid var(--text); outline-offset: 1px; }
.jdetail { border-top: 1px solid var(--line); padding-top: 16px; display: grid; gap: 10px; justify-items: start; }
.jdetail h3, .jdetail h4 { margin: 0; }
.jdetail h4 { font-size: .85rem; color: var(--muted); font-weight: 500; }
.jdetail blockquote { margin: 0; line-height: 1.6; overflow-wrap: anywhere; }
.jdh { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.jdh i { width: 10px; height: 10px; border-radius: 50%; }
.jdh span { color: var(--muted); font-size: .84rem; }
.jchips { display: flex; flex-wrap: wrap; gap: 6px; font-size: .76rem; color: var(--muted); }
.jchips span { border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; }
.jago { width: 100%; border-top: 1px solid var(--line); padding-top: 14px; display: grid; gap: 8px; justify-items: start; }
.jreasons { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 24px; border-top: 1px solid var(--line); padding-top: 16px; }
.jreasons h3 { margin: 0 0 10px; font-size: .95rem; }
.jreasons ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.jreasons li { display: grid; grid-template-columns: 1fr auto; gap: 5px; font-size: .86rem; }
.jreasons li b { font-weight: 500; color: var(--muted); }
.jreasons u i { display: block; height: 100%; background: var(--b, var(--accent)); }
@media (max-width: 560px) { .jnarrow .card { padding: 16px 14px; } .jmonths { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 10px; } .jmo > div { gap: 2px; } .jmo i, .jmo button { border-radius: 2px; } .jbar { bottom: calc(66px + env(safe-area-inset-bottom)); } .jfeel .mood-stage { height: 200px; } }
@media (prefers-reduced-motion: reduce) { .mood-stage.pop, .jring path { animation: none; } }
