/* ================= v0.2 — bản đầy đủ theo mockup ================= */
:root { --art-ink: #2B2B31; --art-sun: #C7362B; --art-snow: #FFFFFF; --art-paper: #F5F2EC; --green: #4F7A4A; --green-soft: #E2ECDD; }
@media (prefers-color-scheme: dark) { :root { --art-ink: #B9B4AA; --art-sun: #D9483C; --art-snow: #EDEAE3; --art-paper: #111215; --green: #8DB687; --green-soft: #22301F; } }
svg.art { display: block; width: 100%; height: auto; }
.mobile-only { display: block; } .desk-only { display: none !important; }
@media (min-width: 900px) { .mobile-only { display: none !important; } .desk-only { display: block !important; } }

/* thanh trên */
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--ink); color: var(--card); display: grid; place-items: center; font-weight: 600; font-size: 14px; border: 0; cursor: pointer; flex: none; text-decoration: none; }
.searchbox { display: none; align-items: center; gap: 8px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 0 12px; height: 40px; min-width: 240px; color: var(--muted); cursor: text; font-size: 14px; }
.searchbox svg.i { width: 18px; height: 18px; }
.page-title { display: none; }
.page-title b { display: block; font: 600 22px var(--serif); }
.page-title span { font-size: 13px; color: var(--muted); }
@media (min-width: 900px) { .searchbox { display: flex; } .top { padding-top: 22px; padding-bottom: 14px; } .top .menu-btn, .top .search-btn { display: none; } .page-title { display: block; } }
.side .sec { font-size: 12px; color: var(--side-muted); padding: 18px 12px 6px; letter-spacing: .02em; }
.side .me { display: flex; align-items: center; gap: 10px; padding: 12px 8px 4px; border-top: 1px solid #ffffff14; margin-top: 8px; text-decoration: none; color: var(--side-ink); }
.side .me .avatar { background: #F5F2EC; color: #17191F; }
.side .me small { display: block; color: var(--side-muted); font-size: 12px; }

/* tiêu đề trang có tranh */
.hero { position: relative; padding: 6px 0 16px; min-height: 92px; }
.hero .art { position: absolute; right: -6px; top: -6px; width: 168px; pointer-events: none; }
.hero > *:not(.art) { position: relative; }
.hero h1 { max-width: 72%; }
.hero .date { font-size: 13px; color: var(--muted); margin-bottom: 4px; text-transform: capitalize; }
.hero .lead { color: var(--ink-2); margin-top: 4px; max-width: 70%; font-size: 14px; }
.chip-k { display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; font-size: 12.5px; padding: 4px 10px; border-radius: 8px; background: var(--card); border: 1px solid var(--line); color: var(--ink-2); }
.chip-k .kanji { font-size: 13px; }

/* thẻ mục tiêu 90 ngày */
.goal90 { display: flex; gap: 12px; align-items: center; text-decoration: none; }
.goal90 .ic { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; color: var(--red); background: var(--red-soft); flex: none; }
.goal90 .t { flex: 1; min-width: 0; }
.goal90 small { color: var(--muted); font-size: 12.5px; }
.goal90 b { display: block; margin-bottom: 8px; }
.bar.red > i { background: var(--red); }
.bar.green > i { background: var(--green); }
.bar.thick { height: 8px; }
.pct { font-weight: 600; font-variant-numeric: tabular-nums; font-size: 14px; }

/* 3 ô số */
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 6px; text-align: center; box-shadow: var(--shadow); }
.tile svg.i { width: 20px; height: 20px; color: var(--red); }
.tile b { display: block; font: 600 22px/1.2 var(--serif); margin-top: 4px; font-variant-numeric: tabular-nums; }
.tile span { font-size: 12px; color: var(--muted); }
.chk.green.on { background: var(--green); border-color: var(--green); }

/* donut */
.donut-row { display: flex; align-items: center; gap: 18px; }
.donut { width: 108px; height: 108px; flex: none; position: relative; }
.donut svg { transform: rotate(-90deg); width: 100%; height: 100%; }
.donut circle { fill: none; stroke-width: 10; }
.donut b { position: absolute; inset: 0; display: grid; place-items: center; font: 600 20px var(--serif); }
.legend { flex: 1; display: grid; gap: 9px; font-size: 14px; }
.legend div { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 8px; border: 2px solid currentColor; }
.legend span:last-child { font-variant-numeric: tabular-nums; color: var(--ink-2); }

/* khung giờ */
.tb { display: grid; grid-template-columns: 92px 1fr; gap: 10px; align-items: center; padding: 6px 0; font-size: 14px; }
.tb .time { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 13px; }
.tb .blk { border-left: 3px solid #B9B3A7; padding: 6px 10px; border-radius: 4px; background: var(--soft); display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.tb .blk.big3 { border-color: #D59B2B; background: #FBF2DF; }
.tb .blk.done span { text-decoration: line-through; opacity: .6; }
@media (prefers-color-scheme: dark) { .tb .blk.big3 { background: #3A301C; } }

/* trụ cột */
.pil { display: grid; grid-template-columns: 24px 84px 1fr 42px; gap: 10px; align-items: center; padding: 7px 0; font-size: 14px; }
.pil svg.i { width: 19px; height: 19px; color: var(--red); }
.pil span:last-child { text-align: right; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.pcard { padding: 14px 0; border-top: 1px solid var(--line); }
.pcard:first-of-type { border-top: 0; padding-top: 2px; }
.pcard .h { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; }
.pcard .h svg.i { color: var(--red); }
.pcard .h b { flex: 1; }

/* tab gạch chân */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; scrollbar-width: none; }
.tabs a { padding: 10px 12px; text-decoration: none; color: var(--muted); font-weight: 500; white-space: nowrap; border-bottom: 2px solid transparent; margin-bottom: -1px; font-size: 14.5px; }
.tabs a.on { color: var(--ink); border-color: var(--red); font-weight: 600; }

/* nguyên lý */
.banner { position: relative; border-radius: var(--r); overflow: hidden; margin-bottom: 14px; height: 132px; }
.banner .art { position: absolute; inset: 0; width: 100%; height: 100%; }
.banner .txt { position: relative; padding: 20px 18px; max-width: 62%; color: #2B2420; }
.banner .txt b { display: block; font: 600 20px/1.25 var(--serif); margin-bottom: 4px; }
.banner .txt span { font-size: 13.5px; }
.prow { display: flex; align-items: center; gap: 14px; padding: 12px 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); margin-bottom: 10px; text-decoration: none; box-shadow: var(--shadow); }
.prow .k { width: 52px; height: 52px; border-radius: 12px; background: var(--red-soft); display: grid; place-items: center; font: 600 16px/1.1 var(--serif); color: var(--red); flex: none; text-align: center; padding: 2px; }
.prow .t { flex: 1; min-width: 0; }
.prow .t b { display: block; letter-spacing: .03em; }
.prow .t span { font-size: 13px; color: var(--muted); }
.prow .done-dot { font-size: 12px; color: var(--green); font-weight: 600; }
.pr-hero { position: relative; text-align: center; padding: 4px 0; }
.pr-hero .sak { position: absolute; right: -16px; top: -30px; width: 140px; opacity: .95; pointer-events: none; }
.pr-hero .big-ic { display: inline-grid; place-items: center; width: 130px; height: 130px; border-radius: 50%; background: var(--card); border: 1px solid var(--line); margin: 10px 0; }
.pr-hero .big-ic svg { width: 66px; height: 66px; }
.pr-hero .kanji-big { font: 600 30px var(--serif); color: var(--red); display: block; margin-top: 4px; }
.ikigai-svg { width: 100%; max-width: 340px; display: block; margin: 0 auto; }
.pr-title { font: 600 23px var(--serif); margin: 16px 0 8px; padding-left: 12px; border-left: 3px solid var(--red); }
.pr-desc { color: var(--ink-2); margin: 0 0 16px; }
.pcards { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.pcards a { text-decoration: none; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 6px 12px; text-align: center; font-size: 12px; color: var(--muted); box-shadow: var(--shadow); }
.pcards a .kj { display: block; font: 600 21px var(--serif); color: var(--red); white-space: nowrap; }
.pcards a em { display: block; font-style: normal; font-weight: 700; color: var(--ink); font-size: 11.5px; margin: 6px 0 4px; letter-spacing: .03em; }
.pcards a svg { width: 26px; height: 26px; display: block; margin: 4px auto 6px; }
@media (max-width: 899px) { .pcards { gap: 6px; } .pcards a { padding: 10px 2px; } .pcards a .kj { font-size: 15px; } .pcards a .d { display: none; } .pcards a em { font-size: 10px; } }

/* tầm nhìn */
.hz { display: flex; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.hz:first-of-type { border-top: 0; padding-top: 2px; }
.hz .lbl { width: 66px; flex: none; font-size: 11.5px; font-weight: 700; letter-spacing: .06em; color: var(--red); padding-top: 3px; }
.hz .body { flex: 1; min-width: 0; }
.hz .body a { display: flex; justify-content: space-between; gap: 10px; text-decoration: none; padding: 3px 0; }
.hz .body a span { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.hz.focus { background: var(--red-soft); margin: 4px -16px 0; padding: 12px 16px; border-top-color: transparent; }
.tl { position: relative; padding-left: 26px; }
.tl::before { content: ""; position: absolute; left: 8px; top: 10px; bottom: 10px; width: 2px; background: var(--line); }
.tl .it { position: relative; padding: 6px 0 10px; }
.tl .it::before { content: ""; position: absolute; left: -24px; top: 9px; width: 14px; height: 14px; border-radius: 50%; border: 2px solid #C9C2B5; background: var(--card); box-sizing: border-box; }
.tl .it.done::before { background: var(--red); border-color: var(--red); }
.tl .it.next::before { border-color: var(--red); }
.tl .it small { display: block; color: var(--muted); font-size: 12.5px; }
.tl .it.done small { color: var(--green); }
.identity { font: 500 17px/1.5 var(--serif); }

/* nhật ký */
.prompts { margin: 0; padding-left: 18px; }
.prompts li { padding: 6px 0; cursor: pointer; }
.prompts li::marker { color: var(--red); }
.erow { display: flex; gap: 12px; align-items: center; padding: 11px 0; border-top: 1px solid var(--line); cursor: pointer; }
.erow:first-of-type { border-top: 0; }
.erow > svg.i { color: var(--muted); flex: none; }
.erow .t { flex: 1; min-width: 0; }
.erow .t b { display: block; font-size: 14px; }
.erow .t span { display: block; color: var(--muted); font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* phân tích */
.big-num { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.big-num b { font: 600 40px/1 var(--serif); }
.delta { font-size: 13px; color: var(--green); font-weight: 600; }
.delta.down { color: var(--red); }

/* thư viện + podcast */
.pod { display: flex; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); align-items: flex-start; }
.pod:first-of-type { border-top: 0; }
.pod img, .pod .ph { width: 96px; aspect-ratio: 16/9; object-fit: cover; border-radius: 8px; background: var(--soft); flex: none; }
.pod .t { flex: 1; min-width: 0; }
.pod .t b { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 14.5px; line-height: 1.35; }
.pod .t small { color: var(--muted); font-size: 12.5px; }
.pod .acts { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; align-items: center; }
.pod .listened { height: 3px; background: var(--soft); border-radius: 2px; margin-top: 6px; overflow: hidden; }
.pod .listened i { display: block; height: 100%; background: var(--red); }
.pod .err { color: var(--red); font-size: 12.5px; }
.play-btn { width: 38px; height: 38px; border-radius: 50%; background: var(--ink); color: var(--card); border: 0; display: grid; place-items: center; cursor: pointer; flex: none; }
.play-btn svg { width: 15px; height: 15px; fill: currentColor; stroke: none; }
.kcard { padding: 12px 0; border-top: 1px solid var(--line); }
.kcard:first-of-type { border-top: 0; }
.kcard p { margin: 6px 0 0; color: var(--ink-2); font-size: 14px; }

/* trình phát mini + đầy đủ */
.mini { position: fixed; left: 8px; right: 8px; bottom: calc(66px + env(safe-area-inset-bottom)); z-index: 25; background: #17191F; color: #F2EFE8; border-radius: 14px; display: flex; align-items: center; gap: 10px; padding: 8px 10px 10px; box-shadow: 0 8px 24px rgba(0,0,0,.22); cursor: pointer; }
.mini img { width: 52px; height: 36px; border-radius: 6px; object-fit: cover; flex: none; background: #333; }
.mini .t { flex: 1; min-width: 0; font-size: 13.5px; }
.mini .t b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.mini .t small { color: #A9A59D; }
.mini button { background: transparent; border: 0; color: inherit; width: 40px; height: 40px; display: grid; place-items: center; cursor: pointer; }
.mini button svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.8; }
.mini button.pp svg { fill: currentColor; stroke: none; width: 18px; height: 18px; }
.mini .prog { position: absolute; left: 12px; right: 12px; bottom: 4px; height: 2px; background: #ffffff22; border-radius: 2px; overflow: hidden; }
.mini .prog i { display: block; height: 100%; background: #E2584C; }
@media (min-width: 900px) { .mini { left: 260px; right: 32px; bottom: 16px; } }
body.has-mini .main { padding-bottom: calc(160px + env(safe-area-inset-bottom)); }
.player .art-big { width: 100%; aspect-ratio: 16/9; object-fit: cover; border-radius: 14px; background: var(--soft); display: block; }
.player .ttl { margin: 14px 0 2px; font: 600 18px/1.35 var(--serif); }
.player input[type=range] { width: 100%; accent-color: var(--red); min-height: 0; padding: 0; border: 0; margin: 14px 0 4px; }
.player .times { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.player .ctrl { display: flex; align-items: center; justify-content: center; gap: 26px; margin: 14px 0 10px; }
.player .ctrl button { background: transparent; border: 0; cursor: pointer; color: var(--ink); display: grid; place-items: center; position: relative; padding: 0; }
.player .ctrl .skip svg { width: 38px; height: 38px; stroke-width: 1.5; }
.player .ctrl .skip span { position: absolute; inset: 0; display: grid; place-items: center; font-size: 10.5px; font-weight: 700; padding-top: 2px; }
.player .ctrl .pp { width: 68px; height: 68px; border-radius: 50%; background: var(--ink); color: var(--card); }
.player .ctrl .pp svg { width: 26px; height: 26px; fill: currentColor; stroke: none; }
.player .row2 { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }

/* ngăn kéo + tìm kiếm + chuông */
.drawer { position: fixed; inset: 0 auto 0 0; width: min(300px, 84vw); background: var(--side); color: var(--side-ink); z-index: 45; padding: calc(20px + env(safe-area-inset-top)) 14px 20px; display: flex; flex-direction: column; gap: 2px; animation: slidein .2s ease; overflow: auto; }
.drawer a { display: flex; gap: 12px; align-items: center; padding: 12px; border-radius: 10px; color: var(--side-ink); text-decoration: none; }
.drawer a:hover, .drawer a.on { background: #ffffff12; }
.drawer .sec { font-size: 12px; color: var(--side-muted); padding: 14px 12px 4px; }
.drawer .brandrow { display: flex; gap: 10px; align-items: center; padding: 4px 12px 16px; letter-spacing: .22em; font-weight: 600; font-size: 14px; }
.drawer .brandrow img { width: 32px; }
@keyframes slidein { from { transform: translateX(-30px); opacity: .5; } }
.results a { display: block; padding: 9px 4px; border-top: 1px solid var(--line); text-decoration: none; }
.results a small { color: var(--muted); display: block; font-size: 12px; }
.results h2 { margin: 14px 0 4px; }
.notif { display: flex; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line); text-decoration: none; align-items: center; cursor: pointer; }
.notif:first-of-type { border-top: 0; }
.notif .k { color: var(--red); font: 600 15px var(--serif); width: 34px; flex: none; text-align: center; }

/* màn chào */
.splash { min-height: 100dvh; display: flex; flex-direction: column; align-items: center; position: relative; overflow: hidden; text-align: center; background: var(--bg); }
.splash .sak { position: absolute; left: -8px; top: -6px; width: 180px; }
.splash .inner { position: relative; z-index: 2; padding: 13vh 24px 0; max-width: 400px; width: 100%; }
.splash .inner img.m { width: 116px; }
.splash .inner img.w { width: 220px; margin: 12px 0 2px; display: block; margin-inline: auto; }
.splash .sub2 { font: 500 18px var(--serif); margin-bottom: 14px; }
.splash .tag { color: var(--ink-2); }
.splash .fuji { position: absolute; left: 0; right: 0; bottom: 0; z-index: 1; }
.splash .fuji svg { width: 100%; height: auto; max-height: 50vh; }
@media (min-width: 700px) { .splash .fuji svg { -webkit-mask-image: linear-gradient(to right, transparent, #000 18%, #000 82%, transparent); mask-image: linear-gradient(to right, transparent, #000 18%, #000 82%, transparent); } .splash .inner { padding-top: 9vh; } }
.splash .cta { position: relative; z-index: 3; margin-top: auto; padding: 0 24px calc(26px + env(safe-area-inset-bottom)); width: 100%; max-width: 400px; }
.splash .cta .btn { background: #17191F; color: #F5F2EC; border-color: #17191F; border-radius: 99px; }
.splash .cta p { margin: 12px 0 0; font-size: 14px; color: #2B2B31; background: #F5F2ECcc; border-radius: 8px; padding: 2px 0; }
.splash .cta p b { cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.splash form { text-align: left; background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 18px; box-shadow: 0 10px 30px rgba(0,0,0,.1); }
@media (prefers-color-scheme: dark) { .splash .inner img.w { filter: invert(1) hue-rotate(180deg); } .splash .cta p { color: var(--ink-2); background: transparent; } .splash .inner img.m { content: url(img/mark-light.png); } }

/* v0.3 — sửa trụ cột / loại mục tiêu */
.icon-btn.sm { width: 32px; height: 32px; border-radius: 9px; margin: -6px -6px -6px 0; }
.icon-btn.sm svg.i { width: 17px; height: 17px; color: var(--muted); }
.btn.danger { color: var(--red); }
.chip.ico { min-width: 44px; min-height: 44px; padding: 0; justify-content: center; }
.chip.ico svg.i { width: 20px; height: 20px; }
.chip.ico.sel svg.i { color: inherit; }
.frow3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.tgt { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 10px; }
.tgt > div { background: var(--soft); border-radius: 12px; padding: 10px 12px; }
.tgt small { display: block; font-size: 12px; color: var(--muted); }
.tgt b { font: 600 26px var(--serif); line-height: 1.2; }
.tgt b.red { color: var(--red); }
.tgt span { font-size: 12px; color: var(--muted); margin-left: 4px; }
.add-line .btn + .btn { margin-left: -4px; }
@media (max-width: 480px) { .tgt b { font-size: 21px; } .tgt > div { padding: 8px 10px; } }
