@import url("tokens.css");

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; background: var(--bg); color: var(--text); font-family: var(--f-body); font-weight: 600; -webkit-tap-highlight-color: transparent; overscroll-behavior: none; }
body { -webkit-user-select: none; user-select: none; }
button, input { font: inherit; color: inherit; background: none; border: 0; }
button, a, label.time { cursor: pointer; }
a { color: inherit; }
img { display: block; max-width: 100%; }
ul { list-style: none; }
:focus-visible { outline: 3px solid var(--secondary); outline-offset: 2px; }
h1, h2, h3, .brand, b, .cta, .eyebrow { font-family: var(--f-head); }
h1, h2, h3 { font-weight: 1000; letter-spacing: -.02em; line-height: 1.08; }
[hidden] { display: none !important; }
.i { width: calc(22 * var(--u)); height: calc(22 * var(--u)); flex: none; }
.coral { color: var(--primary); }
[dir="rtl"] .i.flip { transform: scaleX(-1); }

/* khung */
.screen { position: relative; display: flex; flex-direction: column; width: 100%; max-width: calc(430 * 1.18px); height: 100%; height: 100dvh; margin: 0 auto; overflow: hidden; background: var(--bg); padding-top: env(safe-area-inset-top); }
.body { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 0 calc(18 * var(--u)) calc(18 * var(--u)); scrollbar-width: none; }
.body::-webkit-scrollbar { display: none; }
.boot { flex: 1; display: grid; place-items: center; }
.boot svg { width: 54px; animation: bob 1.1s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-10px) scale(.95, 1.06); } }

/* đầu trang */
.mast { display: flex; align-items: center; justify-content: space-between; padding: calc(16 * var(--u)) calc(20 * var(--u)) calc(8 * var(--u)); gap: 8px; flex: none; }
.body > .mast { padding-inline: 0; }
.brand { display: flex; align-items: center; gap: calc(8 * var(--u)); font-weight: 1000; font-size: calc(23 * var(--u)); letter-spacing: -.01em; white-space: nowrap; }
.brand-drop { width: calc(30 * var(--u)); height: calc(32 * var(--u)); color: var(--primary); }
.brand.small { font-size: calc(16 * var(--u)); justify-content: center; }
.mast-actions { display: flex; gap: calc(9 * var(--u)); align-items: center; }
.round, .hud { display: grid; place-items: center; width: calc(39 * var(--u)); height: calc(39 * var(--u)); background: var(--surface); border: var(--bw) solid var(--border); box-shadow: var(--shadow-ctl); flex: none; }
.round { border-radius: 50%; width: calc(35 * var(--u)); height: calc(35 * var(--u)); }
.hud { border-radius: 13px; }
.hud.flat { box-shadow: none; }
.hud:active, .round:active, .chip:active, .card:active, .cta:active:not(:disabled), .ghost:active { transform: translateY(1px) scale(.985); }
.bare { display: grid; place-items: center; padding: 4px; }
.bare .i { width: calc(27 * var(--u)); height: calc(27 * var(--u)); }

.title h1 { font-size: calc(29 * var(--u)); letter-spacing: -.025em; }
.title p { font-size: calc(16 * var(--u)); color: var(--muted); line-height: 1.25; margin-top: calc(3 * var(--u)); }
.eyebrow { font-size: calc(15 * var(--u)); font-weight: 1000; text-transform: uppercase; line-height: 1.12; }
.eyebrow.big { font-size: calc(17 * var(--u)); margin: calc(10 * var(--u)) 0 calc(8 * var(--u)); letter-spacing: 0; }

.card { background: var(--surface); border: var(--bw) solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-card); }
.pill { display: inline-flex; align-items: center; justify-content: center; min-height: calc(22 * var(--u)); padding: 0 calc(13 * var(--u)); border-radius: var(--pill); border: var(--bw) solid var(--border); background: var(--surface); font-size: calc(13 * var(--u)); font-family: var(--f-head); font-weight: 800; white-space: nowrap; }
.pill.sky { background: var(--accent); border-color: var(--accent); min-height: calc(25 * var(--u)); font-size: calc(14 * var(--u)); }
.chip { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: calc(31 * var(--u)); padding: 0 calc(16 * var(--u)); border-radius: var(--pill); border: var(--bw) solid var(--border); background: var(--surface); box-shadow: var(--shadow-ctl); font-family: var(--f-head); font-weight: 800; font-size: calc(14.5 * var(--u)); white-space: nowrap; }
.chip.on { background: var(--coral-selected); border-color: var(--coral-selected); }
.chip .i { width: calc(14 * var(--u)); height: calc(14 * var(--u)); }

.cta { display: flex; align-items: center; justify-content: center; gap: calc(11 * var(--u)); width: 100%; min-height: calc(45 * var(--u)); padding: 4px 16px; border-radius: calc(19 * var(--u)); background: var(--primary); color: var(--cream); font-weight: 1000; font-size: calc(22 * var(--u)); letter-spacing: -.015em; line-height: 1.06; box-shadow: var(--shadow-ctl); text-decoration: none; text-align: center; position: relative; }
.cta .i { width: calc(27 * var(--u)); height: calc(27 * var(--u)); }
.cta.ink { background: var(--coral-home); color: var(--text); }
.cta .i.cream { color: var(--cream); }
.cta:disabled { cursor: default; }
.ghost { display: flex; align-items: center; justify-content: center; gap: calc(10 * var(--u)); min-height: calc(44 * var(--u)); padding: 4px 12px; border-radius: var(--r-md); border: var(--bw) solid var(--border); background: var(--surface); font-family: var(--f-head); font-weight: 800; font-size: calc(16 * var(--u)); }
.ghost.wide { width: 100%; justify-content: space-between; padding: 6px 18px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: calc(11 * var(--u)); }
.link { text-decoration: underline; text-underline-offset: 3px; font-family: var(--f-head); font-weight: 800; font-size: calc(15 * var(--u)); padding: 3px 6px; }
.link.danger { color: var(--muted); font-size: calc(13 * var(--u)); }
.link-blue, .row-head a { color: var(--link); font-family: var(--f-head); font-weight: 800; font-size: calc(15 * var(--u)); text-decoration: none; padding: 4px 0; white-space: nowrap; }
.row-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.row-head h3 { font-size: calc(21 * var(--u)); }
.test-tag { display: inline-block; font-family: var(--f-head); font-weight: 900; font-size: 10px; letter-spacing: .06em; color: var(--text); background: var(--sky); border-radius: 5px; padding: 1px 5px; vertical-align: middle; }

/* điều hướng đáy */
.tabs { flex: none; display: flex; border-top: 1px solid var(--border); background: var(--surface); padding: calc(5 * var(--u)) calc(8 * var(--u)) calc(8 * var(--u) + env(safe-area-inset-bottom)); }
.tabs a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: calc(2 * var(--u)); min-height: calc(49 * var(--u)); text-decoration: none; font-family: var(--f-head); font-weight: 800; font-size: calc(12.5 * var(--u)); line-height: 1.15; text-align: center; border-radius: var(--r-md); }
.tabs a .i { width: calc(25 * var(--u)); height: calc(25 * var(--u)); }
.tabs-home a.on .i { color: var(--primary); background: var(--coral-selected); border-radius: 9px; padding: calc(2 * var(--u)) calc(9 * var(--u)); width: calc(44 * var(--u)); }
.tabs-explore a.on { color: var(--primary); }
.tabs-profile a.on { color: var(--primary); background: #f7ddd4; }

/* giới thiệu */
.screen-welcome { overflow-y: auto; padding-bottom: env(safe-area-inset-bottom); }
.lang-fab { position: absolute; top: calc(12px + env(safe-area-inset-top)); inset-inline-end: 14px; z-index: 2; display: grid; place-items: center; width: calc(35 * var(--u)); height: calc(35 * var(--u)); border-radius: 50%; border: var(--bw) solid var(--border); background: var(--surface); }
.onb-head { text-align: center; padding-top: calc(18 * var(--u)); flex: none; }
.onb-logo { width: calc(60 * var(--u)); height: calc(66 * var(--u)); display: block; margin: 0 auto; }
.onb-head h1 { font-size: calc(43 * var(--u)); line-height: 1.02; letter-spacing: -.025em; margin-top: calc(2 * var(--u)); white-space: nowrap; }
.onb-head p { font-size: calc(17 * var(--u)); margin-top: calc(2 * var(--u)); }
.onb-art { position: relative; flex: 1 0 calc(240 * var(--u)); min-height: calc(220 * var(--u)); touch-action: pan-y; }
.onb-art img { position: absolute; inset: 2% 6%; width: 88%; height: 96%; object-fit: contain; opacity: 0; transform: translateY(10px) scale(.97); transition: opacity .35s, transform .45s cubic-bezier(.3, 1.6, .5, 1); pointer-events: none; }
.onb-art img.on { opacity: 1; transform: none; }
.onb-art img.night { border-radius: var(--r-lg); object-fit: cover; inset: 6% 5%; width: 90%; height: 88%; }
.onb-foot { flex: none; display: flex; flex-direction: column; align-items: stretch; gap: calc(9 * var(--u)); padding: 0 calc(19 * var(--u)) calc(14 * var(--u)); text-align: center; }
.dots { display: flex; justify-content: center; gap: calc(6 * var(--u)); }
.dots button { width: calc(14 * var(--u)); height: calc(14 * var(--u)); display: grid; place-items: center; }
.dots button::after { content: ''; width: calc(9 * var(--u)); height: calc(9 * var(--u)); border-radius: 50%; background: var(--track); }
.dots button.on::after { background: var(--primary); }
.onb-copy { min-height: calc(62 * var(--u)); display: flex; flex-direction: column; justify-content: center; }
.onb-copy h2 { font-size: calc(30 * var(--u)); letter-spacing: -.025em; }
.onb-copy p { font-size: calc(16 * var(--u)); line-height: 1.25; margin-top: calc(3 * var(--u)); }
.or { display: flex; align-items: center; gap: 12px; font-size: calc(14 * var(--u)); }
.or::before, .or::after { content: ''; height: 1px; background: var(--border); flex: 1; }
.guest { align-self: center; font-size: calc(15 * var(--u)); }
.legal { font-size: calc(12.5 * var(--u)); line-height: 1.3; }

/* trang chủ */
.hero h1 { font-size: calc(31.5 * var(--u)); line-height: 1.02; letter-spacing: -.025em; }
.hero p { font-size: calc(16 * var(--u)); color: var(--muted); margin-top: calc(5 * var(--u)); }
.daily { margin-top: calc(11 * var(--u)); padding: calc(11 * var(--u)) calc(9 * var(--u)) calc(9 * var(--u)); text-align: center; cursor: pointer; }
.daily-top { display: flex; justify-content: space-between; align-items: flex-start; padding: 0 calc(8 * var(--u)); text-align: start; gap: 8px; }
.daily-art { position: relative; height: calc(204 * var(--u)); margin-top: calc(-4 * var(--u)); }
.daily-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.daily h2 { font-size: calc(26 * var(--u)); margin-top: calc(2 * var(--u)); }
.daily p { font-size: calc(15.5 * var(--u)); color: var(--muted); margin: calc(1 * var(--u)) 0 calc(9 * var(--u)); }
.minis { margin-top: calc(13 * var(--u)); }
.minis .two { margin-top: calc(7 * var(--u)); }
.mini { position: relative; display: flex; flex-direction: column; align-items: center; height: calc(124 * var(--u)); padding: calc(5 * var(--u)) calc(6 * var(--u)) calc(7 * var(--u)); min-width: 0; }
.mini img { flex: 1; min-height: 0; width: 100%; object-fit: contain; }
.mini b { font-weight: 1000; font-size: calc(14.5 * var(--u)); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lock { position: absolute; top: 7px; inset-inline-end: 7px; width: calc(24 * var(--u)); height: calc(24 * var(--u)); border-radius: 8px; background: var(--surface); border: var(--bw) solid var(--border); display: grid; place-items: center; }
.lock .i { width: calc(13 * var(--u)); height: calc(13 * var(--u)); }

/* khám phá */
.screen-explore .title { margin-top: calc(-2 * var(--u)); }
.filters { display: flex; gap: calc(9 * var(--u)); margin-top: calc(11 * var(--u)); overflow-x: auto; scrollbar-width: none; padding-bottom: 4px; }
.filters .chip { flex: 1 0 auto; }
.feature { padding: calc(5 * var(--u)); cursor: pointer; }
.feature-art { position: relative; height: calc(186 * var(--u)); border-radius: var(--r-md); overflow: hidden; background: #55557a; }
.feature-art > img { width: 100%; height: 100%; object-fit: cover; }
.feature-art .badge { position: absolute; top: calc(8 * var(--u)); inset-inline-start: calc(8 * var(--u)); background: var(--sky); border-color: var(--sky); min-height: calc(25 * var(--u)); }
.feature-art .mark { position: absolute; top: calc(8 * var(--u)); inset-inline-end: calc(8 * var(--u)); width: calc(32 * var(--u)); height: calc(32 * var(--u)); }
.mark.on { background: var(--coral-selected); border-color: var(--primary); }
.mark .i { width: calc(18 * var(--u)); height: calc(18 * var(--u)); }
.feature h2 { font-size: calc(22 * var(--u)); padding: calc(7 * var(--u)) calc(6 * var(--u)) 0; }
.feature > p { font-size: calc(14 * var(--u)); color: var(--muted); padding: 0 calc(6 * var(--u)); }
.meta { display: flex; align-items: center; flex-wrap: wrap; gap: calc(9 * var(--u)); padding: calc(7 * var(--u)) calc(6 * var(--u)) 0; }
.meta i { width: 4px; height: 4px; border-radius: 50%; background: var(--text); }
.chips-color { display: flex; align-items: center; gap: calc(7 * var(--u)); padding: calc(8 * var(--u)) calc(6 * var(--u)); }
.chips-color span { width: calc(24 * var(--u)); height: calc(24 * var(--u)); border-radius: 50%; box-shadow: var(--shadow-ctl); }
.chips-color small { border-inline-start: var(--bw) solid var(--border); padding-inline-start: calc(12 * var(--u)); margin-inline-start: calc(6 * var(--u)); font-size: calc(12.5 * var(--u)); color: var(--muted); white-space: nowrap; }
.feature .cta { min-height: calc(38 * var(--u)); font-size: calc(18 * var(--u)); border-radius: calc(16 * var(--u)); }
.more { margin-top: calc(11 * var(--u)); }
.rows { display: flex; flex-direction: column; gap: calc(7 * var(--u)); margin-top: calc(7 * var(--u)); }
.srow { display: flex; align-items: center; gap: calc(11 * var(--u)); min-height: calc(63 * var(--u)); padding: calc(4 * var(--u)) calc(6 * var(--u)); text-align: start; width: 100%; border-radius: var(--r-md); }
.srow-art { width: calc(82 * var(--u)); height: calc(53 * var(--u)); object-fit: contain; border-radius: 10px; background: #cfe0e8; flex: none; }
.srow-art.cat-city { background: #ecd9cd; }
.srow-art.cat-outdoor { background: #dbe2cc; }
.srow-text { flex: 1; min-width: 0; display: grid; grid-template-columns: 1fr auto; align-items: center; }
.srow-text b { grid-column: 1 / -1; font-weight: 1000; font-size: calc(16 * var(--u)); line-height: 1.15; }
.srow-text small { font-size: calc(12.5 * var(--u)); color: var(--muted); }
.srow-text em { font-style: normal; font-size: 11px; font-family: var(--f-head); font-weight: 900; display: inline-flex; align-items: center; gap: 3px; color: var(--muted); }
.srow-text em.done { color: #5f7a38; }
.srow-text em .i { width: 11px; height: 11px; }
.chev { width: calc(17 * var(--u)); height: calc(17 * var(--u)); }
.saved-row { display: flex; gap: 8px; align-items: center; }
.saved-row .srow { flex: 1; min-width: 0; }

/* kệ tranh */
.shelf-head { font-size: calc(20 * var(--u)); margin: calc(18 * var(--u)) 0 calc(8 * var(--u)); }
.shelf-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(calc(165 * var(--u)), 1fr)); gap: calc(11 * var(--u)); }
.shelf { display: flex; flex-direction: column; align-items: center; padding: calc(7 * var(--u)); min-width: 0; text-align: center; }
.shelf-art { width: 100%; aspect-ratio: 4 / 3; display: block; }
.shelf-art img { width: 100%; height: 100%; object-fit: contain; }
.shelf b { font-weight: 1000; font-size: calc(15 * var(--u)); }
.shelf small { font-size: calc(12 * var(--u)); color: var(--muted); }
.empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; text-align: center; padding: 28px 18px; }
.empty > img { width: 72%; max-height: 40vh; object-fit: contain; filter: grayscale(1) opacity(.75); }
.empty p { max-width: 30ch; line-height: 1.4; }
.empty-ic { width: 54px; height: 54px; color: var(--divider); }

/* hồ sơ */
.screen-profile .title h1 { font-size: calc(34 * var(--u)); }
.who { display: flex; align-items: center; gap: calc(13 * var(--u)); margin-top: calc(9 * var(--u)); }
.who .avatar { width: calc(71 * var(--u)); height: calc(71 * var(--u)); border-radius: 50%; }
.who > div { flex: 1; min-width: 0; }
.who h2 { font-size: calc(24 * var(--u)); overflow-wrap: anywhere; }
.who p { font-size: calc(14.5 * var(--u)); color: var(--muted); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); padding: calc(7 * var(--u)) 0; margin-top: calc(11 * var(--u)); }
.stats div { display: flex; flex-direction: column; align-items: center; text-align: center; }
.stats div + div { border-inline-start: 1px solid var(--border); }
.stats img { height: calc(29 * var(--u)); width: auto; }
.stats b { font-size: calc(26 * var(--u)); font-weight: 1000; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stats span { font-size: calc(13.5 * var(--u)); }
.chart-sec { margin-top: calc(14 * var(--u)); }
.chart-sec h3 { font-size: calc(23 * var(--u)); }
.chart-sec p { font-size: calc(14 * var(--u)); color: var(--muted); }
.chart { display: flex; gap: 7px; height: calc(116 * var(--u)); margin-top: calc(16 * var(--u)); padding-bottom: calc(18 * var(--u)); font-size: calc(11.5 * var(--u)); }
.yaxis { display: flex; flex-direction: column; justify-content: space-between; margin-block: -7px; white-space: nowrap; }
.plot { flex: 1; display: flex; gap: calc(7 * var(--u)); padding: 0 calc(8 * var(--u)); border-bottom: 1px solid var(--divider); background: linear-gradient(var(--border), var(--border)) top / 100% 1px no-repeat, linear-gradient(var(--border), var(--border)) center / 100% 1px no-repeat; }
.col { flex: 1; position: relative; display: flex; align-items: flex-end; }
.bar { width: 100%; background: var(--bar); border-radius: 7px 7px 3px 3px; position: relative; transition: height .5s cubic-bezier(.3, 1.4, .5, 1); }
.bar.today { background: var(--bar-today); }
.bar label { position: absolute; bottom: calc(100% + 1px); left: 50%; transform: translateX(-50%); white-space: nowrap; font-size: calc(11 * var(--u)); }
.col > span { position: absolute; top: calc(100% + 3px); left: 0; right: 0; text-align: center; }
.legend { display: flex; align-items: center; gap: 7px; font-size: calc(12 * var(--u)); margin-top: calc(2 * var(--u)); }
.legend i { width: calc(12 * var(--u)); height: calc(12 * var(--u)); border-radius: 50%; background: var(--primary); }
.goal { margin-top: calc(11 * var(--u)); padding: calc(8 * var(--u)) calc(15 * var(--u)); }
.goal h3 { font-size: calc(20 * var(--u)); }
.goal .row-head b { font-weight: 1000; font-size: calc(15 * var(--u)); }
.goal-dots { display: flex; justify-content: space-between; padding: calc(6 * var(--u)) calc(20 * var(--u)); }
.goal-dots span { width: calc(26 * var(--u)); height: calc(26 * var(--u)); border-radius: 50%; border: var(--bw) solid var(--divider); display: grid; place-items: center; }
.goal-dots span.on { background: var(--bar-today); border-color: var(--bar-today); color: var(--cream); box-shadow: var(--shadow-ctl); }
.goal-dots .i { width: calc(15 * var(--u)); height: calc(15 * var(--u)); }
.goal p { font-size: calc(13 * var(--u)); }
.latest { margin-top: calc(11 * var(--u)); }
.latest h3 { font-size: calc(22 * var(--u)); margin-bottom: calc(6 * var(--u)); }
.latest-card { display: flex; align-items: center; gap: calc(14 * var(--u)); width: 100%; padding: calc(5 * var(--u)) calc(14 * var(--u)); text-align: start; min-height: calc(92 * var(--u)); }
.latest-card img { width: calc(125 * var(--u)); height: calc(82 * var(--u)); object-fit: contain; }
.latest-card span { flex: 1; display: flex; flex-direction: column; }
.latest-card b { font-weight: 1000; font-size: calc(19 * var(--u)); }
.latest-card small { font-size: calc(13.5 * var(--u)); color: var(--muted); }
.latest-card em { font-style: normal; display: flex; align-items: center; gap: 6px; font-family: var(--f-head); font-weight: 1000; font-size: calc(16 * var(--u)); margin-top: 3px; }
.latest-card em .i { color: var(--primary); width: calc(19 * var(--u)); height: calc(19 * var(--u)); }

/* cài đặt */
.set-head { flex: none; position: relative; display: flex; justify-content: center; text-align: center; padding: calc(16 * var(--u)) 60px calc(8 * var(--u)); }
.set-head .hud { position: absolute; inset-inline-start: calc(18 * var(--u)); top: calc(24 * var(--u)); }
.set-head h1 { font-size: calc(35 * var(--u)); line-height: 1.03; letter-spacing: -.025em; }
.premium { border-width: 2px; padding: calc(11 * var(--u)) calc(10 * var(--u)) calc(7 * var(--u)); text-align: center; }
.premium-lead { display: flex; gap: calc(14 * var(--u)); align-items: center; text-align: start; padding: 0 calc(10 * var(--u)); }
.premium-lead > .i { width: calc(34 * var(--u)); height: calc(40 * var(--u)); }
.premium-lead h2 { font-size: calc(23 * var(--u)); }
.premium-lead p { font-size: calc(14.5 * var(--u)); color: var(--muted); }
.premium-art { width: calc(250 * var(--u)); height: calc(138 * var(--u)); object-fit: contain; margin: calc(2 * var(--u)) auto; }
.premium h3 { font-size: calc(27 * var(--u)); }
.until { font-size: calc(13 * var(--u)); color: var(--muted); }
.premium ul { display: inline-flex; flex-direction: column; gap: calc(7 * var(--u)); margin: calc(8 * var(--u)) 0; text-align: start; font-size: calc(16 * var(--u)); }
.premium li { display: flex; align-items: center; gap: calc(17 * var(--u)); }
.premium li .i { width: calc(25 * var(--u)); height: calc(25 * var(--u)); }
.plans { display: grid; grid-template-columns: 1fr 1fr; gap: calc(10 * var(--u)); margin-bottom: calc(10 * var(--u)); }
.plan { position: relative; display: flex; align-items: center; gap: calc(11 * var(--u)); min-height: calc(68 * var(--u)); padding: 6px calc(11 * var(--u)); border: 2px solid var(--border); border-radius: var(--r-md); text-align: start; min-width: 0; }
.plan .i { width: calc(20 * var(--u)); height: calc(20 * var(--u)); }
.plan.on { border-color: var(--coral-settings); }
.plan.on .i { color: var(--coral-settings); }
.plan span { display: flex; flex-direction: column; min-width: 0; }
.plan b { font-weight: 1000; font-size: calc(18 * var(--u)); }
.plan small { font-size: calc(13.5 * var(--u)); }
.plan em { position: absolute; top: calc(-1 * var(--u)); inset-inline-end: 5px; transform: translateY(-15%); background: var(--coral-settings); color: var(--cream); border-radius: var(--pill); padding: 1px 9px; font-style: normal; font-family: var(--f-head); font-weight: 900; font-size: calc(12 * var(--u)); white-space: nowrap; }
.premium .cta { background: var(--coral-settings); font-size: calc(25 * var(--u)); min-height: calc(47 * var(--u)); }
.renew { display: block; font-size: calc(12.5 * var(--u)); color: var(--muted); margin-top: calc(5 * var(--u)); }
.prefs { margin-top: calc(10 * var(--u)); padding: 0 calc(15 * var(--u)); }
.prefs h3 { font-size: calc(17 * var(--u)); padding-top: calc(10 * var(--u)); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.prefs h3 small { font-family: var(--f-body); font-weight: 600; font-size: calc(13 * var(--u)); color: var(--muted); letter-spacing: 0; }
.pref { display: flex; align-items: center; gap: calc(14 * var(--u)); width: 100%; min-height: calc(44 * var(--u)); text-align: start; font-size: calc(16 * var(--u)); }
.prefs .pref + .pref { border-top: 1px solid var(--border); }
.pref > span { flex: 1; }
.pref > b { font-family: var(--f-body); font-weight: 600; font-size: calc(14 * var(--u)); }
.switch { width: 49px; height: 25px; border-radius: var(--pill); background: var(--track); position: relative; flex: none; transition: background .2s; }
.switch::after { content: ''; position: absolute; top: 2.5px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--cream); box-shadow: var(--shadow-ctl); transition: transform .2s; }
.switch.on { background: var(--secondary); }
.switch.on::after { transform: translateX(23px); }
.time { position: relative; display: flex; align-items: center; gap: 8px; }
.time input { position: absolute; inset: 0; opacity: 0; width: 100%; cursor: pointer; }
.time input::-webkit-calendar-picker-indicator { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.time .i { width: calc(14 * var(--u)); height: calc(14 * var(--u)); }
.off { font-size: 20px; padding: 0 4px; color: var(--muted); }
.chip.buy { min-width: 76px; }
.legal-foot { text-align: center; padding: calc(11 * var(--u)) 0 env(safe-area-inset-bottom); display: flex; flex-direction: column; align-items: center; gap: 5px; }
.legal-foot p a { font-size: calc(13.5 * var(--u)); text-underline-offset: 3px; }
.legal-text { line-height: 1.6; font-size: calc(16 * var(--u)); padding-top: 10px; }

/* màn tô */
.screen-paint { padding-bottom: env(safe-area-inset-bottom); }
.paint-head { grid-area: head; flex: none; display: flex; justify-content: space-between; align-items: center; padding: calc(12 * var(--u)) calc(18 * var(--u)) 0; }
.paint-info { grid-area: info; flex: none; padding: calc(9 * var(--u)) calc(19 * var(--u)) 0; }
.paint-info .eyebrow { font-weight: 800; font-size: calc(13.5 * var(--u)); color: var(--muted); }
.info-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.info-row h1 { font-size: calc(26 * var(--u)); }
.info-row .time { font-family: var(--f-head); font-weight: 800; font-size: calc(15.5 * var(--u)); white-space: nowrap; gap: 7px; }
.info-row .time .i { width: calc(18 * var(--u)); height: calc(18 * var(--u)); }
.info-row.sub { margin-top: calc(7 * var(--u)); font-family: var(--f-head); font-weight: 800; font-size: calc(15 * var(--u)); font-variant-numeric: tabular-nums; min-height: 1.3em; }
.track { height: calc(10 * var(--u)); border-radius: var(--pill); background: var(--track); overflow: hidden; margin-top: calc(7 * var(--u)); }
.track i { display: block; height: 100%; width: 0; background: var(--danger); border-radius: var(--pill); transition: width .45s cubic-bezier(.3, 1.4, .5, 1); }
.stage { grid-area: stage; flex: 1; min-height: 0; position: relative; }
.view { position: absolute; inset: 0 0 calc(24 * var(--u)) 0; width: 100%; height: calc(100% - 24 * var(--u)); display: block; z-index: 1; cursor: grab; outline-offset: -3px; }
.side { position: absolute; z-index: 2; inset-inline-end: calc(18 * var(--u)); top: calc(8 * var(--u)); display: flex; flex-direction: column; gap: 8px; }
.hint { position: relative; }
.hint b { position: absolute; top: -6px; inset-inline-end: -6px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: var(--pill); background: var(--primary); color: var(--cream); font-size: 11px; display: grid; place-items: center; }
.gesture { position: absolute; z-index: 1; bottom: calc(3 * var(--u)); left: 0; right: 0; display: flex; justify-content: center; align-items: center; gap: calc(10 * var(--u)); font-size: calc(13.5 * var(--u)); color: var(--muted); pointer-events: none; padding: 0 12px; text-align: center; }
.gesture .i { width: calc(23 * var(--u)); height: calc(23 * var(--u)); color: var(--text); }
.loader { position: absolute; inset: 0; z-index: 3; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; text-align: center; padding: 24px; }
.drop-load .i { width: 46px; height: 46px; color: var(--primary); animation: bob 1s ease-in-out infinite; }
.target-ring { position: absolute; z-index: 2; width: 52px; height: 52px; margin: -26px; border-radius: 50%; border: 3px solid var(--cream); box-shadow: 0 0 0 3px var(--primary); pointer-events: none; animation: ring .8s ease-in-out infinite; }
@keyframes ring { 50% { transform: scale(.65); } }
.dock { grid-area: dock; flex: none; border-top: 1px solid var(--divider); margin: 0 calc(15 * var(--u)); padding: calc(8 * var(--u)) calc(3 * var(--u)) calc(9 * var(--u)); }
.dock h2 { font-size: calc(21 * var(--u)); }
.dock .left { font-size: calc(15 * var(--u)); font-variant-numeric: tabular-nums; }
.swatches { --g: calc(10 * var(--u)); display: flex; justify-content: safe center; gap: var(--g); overflow-x: auto; padding: calc(8 * var(--u)) 3px calc(6 * var(--u)); scrollbar-width: none; min-height: calc(79 * var(--u)); align-items: center; }
.swatches button { position: relative; flex: none; width: min(calc(65 * var(--u)), calc((100% - (var(--n) - 1) * var(--g)) / var(--n))); min-width: 40px; aspect-ratio: 1; border-radius: 50%; background: var(--c); color: var(--ink); box-shadow: var(--shadow-ctl), inset 0 -3px 6px rgb(0 0 0 / 8%); font-family: var(--f-head); font-weight: 900; font-size: calc(22 * var(--u)); display: grid; place-items: center; transition: transform .2s cubic-bezier(.3, 1.8, .5, 1); }
.swatches button.on { box-shadow: 0 0 0 3px var(--bg), 0 0 0 5.5px var(--c), var(--shadow-ctl); transform: scale(.94); }
.swatches button.done { opacity: .62; }
.swatches button em { position: absolute; inset-inline-end: -4px; bottom: -3px; width: calc(23 * var(--u)); height: calc(23 * var(--u)); border-radius: 50%; background: var(--cream); display: grid; place-items: center; box-shadow: var(--shadow-ctl); }
.swatches button em .i { width: calc(13 * var(--u)); height: calc(13 * var(--u)); color: var(--primary); }
.swatches button.nudge { animation: nudge .45s ease 2; }
@keyframes nudge { 50% { transform: scale(1.16); } }
.tip { text-align: center; font-size: calc(13.5 * var(--u)); margin-bottom: calc(8 * var(--u)); }
.light .lk { position: absolute; inset-inline-end: calc(24 * var(--u)); width: calc(20 * var(--u)); height: calc(20 * var(--u)); }
.light.ready .lk { display: none; }
.light.ready { animation: ready 1.3s ease-in-out infinite; }
@keyframes ready { 50% { transform: scale(1.025); } }
.note { text-align: center; font-size: calc(12.5 * var(--u)); color: var(--muted); margin-top: calc(4 * var(--u)); }
.sky { position: absolute; inset: 0; opacity: 0; transition: opacity 2s; pointer-events: none; overflow: hidden; }
.sky .moon { position: absolute; top: 8%; inset-inline-start: 10%; width: calc(44 * var(--u)); height: calc(44 * var(--u)); color: #ffe3a0; }
.sky i { position: absolute; top: 12%; left: 28%; width: 3px; height: 3px; border-radius: 50%; background: #ffe3a0; box-shadow: 60px -20px #ffe3a0, 130px 30px #ffe3a0, 200px -8px #ffe3a0, -70px 90px #ffe3a0, 230px 110px #ffe3a0, 90px 70px 0 -0.5px #ffe3a0, -40px 200px 0 -0.5px #ffe3a0; }
.screen-paint { transition: background-color 2s, color 2s; }
.screen-paint.night { background: #3b3f60; color: var(--cream); }
.night .sky { opacity: 1; }
.night .hud { color: var(--text); }
.night .paint-info .eyebrow, .night .gesture, .night .gesture .i { color: #d9d7e8; }
.night .track { background: #5a5e80; }
.night .side .hint { display: none; }
.night .dock { border-color: #5a5e80; }
.lit { text-align: center; display: flex; flex-direction: column; gap: calc(9 * var(--u)); animation: rise .5s cubic-bezier(.3, 1.4, .5, 1); }
.lit h2 { font-size: calc(27 * var(--u)); }
.lit p { font-size: calc(14.5 * var(--u)); margin-top: calc(-6 * var(--u)); }
.lit .ghost { color: var(--text); }
.lit-links { display: flex; justify-content: space-between; gap: 10px; }
@keyframes rise { from { opacity: 0; transform: translateY(30px); } }

/* hộp thoại + thông báo */
.sheet-wrap { position: fixed; inset: 0; z-index: 50; background: rgb(40 41 63 / 46%); display: flex; align-items: flex-end; justify-content: center; }
.sheet { position: relative; width: 100%; max-width: 480px; max-height: 92dvh; overflow-y: auto; background: var(--surface); color: var(--text); border-radius: 24px 24px 0 0; padding: 24px 20px calc(22px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 12px; text-align: center; animation: rise .3s ease-out; }
.sheet h2 { font-size: 23px; padding: 0 28px; }
.sheet p { line-height: 1.4; font-size: 15px; }
.sheet .cta { font-size: 19px; min-height: 46px; }
.sheet .ghost { font-size: 15px; }
.sheet-x { position: absolute; top: 10px; inset-inline-end: 14px; font-size: 26px; line-height: 1; padding: 4px; color: var(--muted); }
.sheet-art { height: 140px; object-fit: contain; margin: 0 auto; }
.sheet form { display: flex; flex-direction: column; gap: 12px; }
.sheet label { text-align: start; font-size: 13px; display: flex; flex-direction: column; gap: 5px; }
.sheet input { border: var(--bw) solid var(--border); border-radius: var(--r-sm); padding: 11px 13px; font-size: 17px; background: var(--cream); -webkit-user-select: text; user-select: text; }
.result video, .result img { max-height: 52dvh; width: auto; max-width: 100%; margin: 0 auto; border-radius: var(--r-md); border: var(--bw) solid var(--border); }
.toast { position: fixed; z-index: 60; left: 50%; top: calc(14px + env(safe-area-inset-top)); transform: translateX(-50%); width: max-content; max-width: 90vw; background: var(--text); color: var(--cream); padding: 10px 18px; border-radius: var(--pill); font-family: var(--f-head); font-weight: 800; font-size: 14px; text-align: center; animation: drop-in .25s ease-out; pointer-events: none; }
@keyframes drop-in { from { opacity: 0; margin-top: -12px; } }

/* popup ngôn ngữ (i18n.js dùng chung) — tô lại theo phong cách đất sét */
#vds-lang-pop { background: rgb(40 41 63 / 46%) !important; font-family: var(--f-head) !important; }
#vds-lang-pop > div { background: var(--surface) !important; color: var(--text) !important; border: 2px solid var(--border); border-radius: 22px !important; }
#vds-lang-pop button { background: var(--bg) !important; color: var(--text) !important; border: var(--bw) solid var(--border) !important; border-radius: 14px !important; font-family: var(--f-head); font-weight: 800; }
#vds-lang-pop button[data-l]:hover { border-color: var(--primary) !important; }
#vds-lang-pop button.cur { background: var(--coral-selected) !important; border-color: var(--primary) !important; }

/* chữ không phải Latin: giãn dòng, bỏ siết chữ */
:lang(ar) *, :lang(hi) *, :lang(ja) *, :lang(ko) *, :lang(zh-Hans) *, :lang(zh-Hant) * { letter-spacing: 0 !important; }
:lang(ar) h1, :lang(hi) h1, :lang(hi) h2, :lang(ar) h2, :lang(hi) .hero h1 { line-height: 1.3; }
:lang(de) .onb-copy h2, :lang(fr) .onb-copy h2, :lang(es) .onb-copy h2, :lang(pt) .onb-copy h2, :lang(vi) .onb-copy h2, :lang(hi) .onb-copy h2, :lang(ar) .onb-copy h2 { font-size: calc(25 * var(--u)); }
:lang(de) .hero h1, :lang(fr) .hero h1, :lang(es) .hero h1, :lang(pt) .hero h1, :lang(vi) .hero h1, :lang(hi) .hero h1, :lang(ar) .hero h1 { font-size: calc(28 * var(--u)); }

/* ---------- XOAY NGANG: bố cục riêng ---------- */
@media (orientation: landscape) and (min-width: 600px) {
  :root { --u: min(calc(100vw / 940), calc(100vh / 560), 1.2px); }
  .screen { max-width: calc(1040 * var(--u)); padding-inline: env(safe-area-inset-left) env(safe-area-inset-right); }
  .screen-paint { max-width: none; display: grid; grid-template-columns: minmax(0, 1fr) calc(390 * var(--u)); grid-template-rows: auto auto 1fr; grid-template-areas: "stage head" "stage info" "stage dock"; }
  .screen-paint .stage { height: 100%; }
  .screen-paint .side { inset-inline-end: auto; inset-inline-start: calc(16 * var(--u)); }
  .dock { align-self: end; max-height: 100%; overflow-y: auto; }
  .swatches { flex-wrap: wrap; justify-content: center; overflow: visible; }
  .swatches button { width: calc(60 * var(--u)); }
  .screen-welcome { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: auto 1fr; grid-template-areas: "art head" "art foot"; overflow: hidden; }
  .screen-welcome .onb-head { grid-area: head; }
  .screen-welcome .onb-art { grid-area: art; height: 100%; min-height: 0; }
  .screen-welcome .onb-foot { grid-area: foot; align-self: center; overflow-y: auto; max-height: 100%; }
  .screen-welcome .onb-logo { width: calc(40 * var(--u)); height: calc(46 * var(--u)); }
  .screen-welcome .onb-head h1 { font-size: calc(36 * var(--u)); }
  .home-grid { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: auto 1fr; gap: 0 calc(28 * var(--u)); align-content: start; }
  .home-grid .daily { grid-column: 2; grid-row: 1 / span 2; margin-top: 0; align-self: start; }
  .home-grid .hero { padding-top: calc(14 * var(--u)); }
  .home-grid .minis { align-self: end; }
  .home-grid .mini { height: calc(170 * var(--u)); }
  .screen-explore .explore-body { display: grid; grid-template-columns: 1fr 1fr; gap: 0 calc(24 * var(--u)); align-items: start; }
  .screen-explore .more { margin-top: calc(12 * var(--u)); }
  .screen-profile .profile-body { display: grid; grid-template-columns: 1fr 1fr; gap: 0 calc(28 * var(--u)); align-items: start; }
  .screen-profile .chart-sec { grid-column: 2; grid-row: 1 / span 2; }
  .screen-profile .latest { grid-column: 2; }
  .screen-settings .settings-body { display: grid; grid-template-columns: 1fr 1fr; gap: 0 calc(24 * var(--u)); align-items: start; }
  .screen-settings .premium { grid-row: 1 / span 4; }
  .screen-settings .settings-body > .prefs:nth-child(2) { margin-top: 0; }
  .tabs { padding-block: 2px calc(4px + env(safe-area-inset-bottom)); }
  .tabs a { flex-direction: row; gap: 8px; min-height: calc(42 * var(--u)); }
}

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