/* NhacQuan - warm café design system. Light = quán sáng kem, dark = quán tối đèn vàng. */
:root {
  --bg: #FAF6F0;
  --veil: rgba(250, 246, 240, 0.78);
  --surface: rgba(255, 255, 255, 0.80);
  --surface-solid: #FFFFFF;
  --surface-2: rgba(238, 228, 213, 0.75);
  --border: rgba(200, 182, 158, 0.45);
  --text: #2B2118;
  --text-2: #6B5D4F;
  --accent: #A14E24;
  --accent-hover: #8A421E;
  --on-accent: #FFFFFF;
  --danger: #B3362B;
  --shadow: 0 1px 3px rgba(43, 33, 24, 0.08);
  --radius: 12px;
  --radius-sm: 8px;
  --sidebar-w: 232px;
  --playerbar-h: 84px;
}
/* ---------- palettes: doi MAU NEN cua dark mode (khong doi accent) ---------- */
[data-theme="dark"][data-palette="forest"] {
  --bg: #121C15; --veil: rgba(18, 28, 21, 0.78);
  --surface: rgba(25, 38, 29, 0.8); --surface-solid: #192619;
  --surface-2: rgba(36, 53, 41, 0.75); --border: rgba(76, 104, 84, 0.5);
}
[data-theme="dark"][data-palette="ocean"] {
  --bg: #0F1922; --veil: rgba(15, 25, 34, 0.78);
  --surface: rgba(22, 35, 47, 0.8); --surface-solid: #16232F;
  --surface-2: rgba(32, 49, 64, 0.75); --border: rgba(68, 98, 124, 0.5);
}
[data-theme="dark"][data-palette="sunset"] {
  --bg: #221216; --veil: rgba(34, 18, 22, 0.78);
  --surface: rgba(48, 27, 33, 0.8); --surface-solid: #301B21;
  --surface-2: rgba(62, 37, 44, 0.75); --border: rgba(116, 74, 84, 0.5);
}
[data-theme="dark"][data-palette="lavender"] {
  --bg: #171426; --veil: rgba(23, 20, 38, 0.78);
  --surface: rgba(33, 29, 52, 0.8); --surface-solid: #211D34;
  --surface-2: rgba(46, 40, 70, 0.75); --border: rgba(94, 84, 132, 0.5);
}

.palette-row { display: flex; gap: 10px; flex-wrap: wrap; }
.palette-dot {
  width: 34px; height: 34px; border-radius: 50%;
  border: 2px solid rgba(128, 110, 96, 0.45);
  transition: transform 150ms ease-out, border-color 150ms ease-out;
}
.palette-dot:hover { transform: scale(1.1); }
.palette-dot.active { border-color: var(--accent); transform: scale(1.12); }
.palette-dot--cafe { background: #1A1512; }
.palette-dot--forest { background: #121C15; }
.palette-dot--ocean { background: #0F1922; }
.palette-dot--sunset { background: #221216; }
.palette-dot--lavender { background: #171426; }

[data-theme="dark"] {
  --bg: #1A1512;
  --veil: rgba(26, 21, 18, 0.78);
  --surface: rgba(37, 30, 25, 0.80);
  --surface-solid: #251E19;
  --surface-2: rgba(58, 47, 39, 0.75);
  --border: rgba(90, 74, 61, 0.5);
  --text: #F2EAE2;
  --text-2: #B3A697;
  --accent: #E8956D;
  --accent-hover: #EFAA88;
  --on-accent: #FFFFFF;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* ---------- scene layer (per-genre bg image / gradient + particles + veil) ---------- */
.scene { position: fixed; inset: 0; z-index: 0; overflow: hidden; }
.scene__img {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  opacity: 0; transition: opacity 800ms ease-out;
  transform: scale(1.03);
}
.scene__img.loaded { opacity: 1; }
.scene__video {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; opacity: 0; transition: opacity 800ms ease-out;
}
.scene__video.loaded { opacity: 1; }
.scene__fx { position: absolute; inset: 0; width: 100%; height: 100%; }
.scene__veil { position: absolute; inset: 0; background: var(--veil); }

* { margin: 0; padding: 0; box-sizing: border-box; }
html { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  height: 100%;
  overflow: hidden;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  touch-action: manipulation;
}
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
a { color: var(--accent); }
.ic { stroke: currentColor; stroke-width: 2; fill: none; stroke-linecap: round; stroke-linejoin: round; vertical-align: -4px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ---------- layout ---------- */
.shell { display: flex; height: 100%; position: relative; z-index: 1; }
.sidebar {
  width: var(--sidebar-w);
  background: var(--surface);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  padding: 16px 12px calc(var(--playerbar-h) + 16px);
  flex-shrink: 0;
  z-index: 40;
  overflow-y: auto; /* nhieu muc menu: phai cuon duoc de thay het (promo goseedup o cuoi) */
}
.brand { display: flex; align-items: center; gap: 10px; padding: 8px 4px 20px 12px; }
.brand__text { flex: 1; min-width: 0; }
.brand__theme { width: 38px; height: 38px; flex-shrink: 0; color: var(--text-2); }
.brand__theme:hover { color: var(--accent); }
.brand__logo {
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--accent); color: var(--on-accent);
  display: grid; place-items: center; flex-shrink: 0;
}
.brand__name { font-size: 18px; font-weight: 700; letter-spacing: -0.02em; }
.brand__tag { font-size: 11px; color: var(--text-2); display: block; margin-top: -2px; }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav__item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 12px; border-radius: var(--radius-sm);
  color: var(--text-2); font-weight: 500; font-size: 14.5px;
  min-height: 44px; text-decoration: none;
  transition: background 150ms ease-out, color 150ms ease-out;
}
.nav__item:hover { background: var(--surface-2); color: var(--text); }
.nav__item.active { background: var(--surface-2); color: var(--accent); font-weight: 600; }
.nav__spacer { flex: 1; }

.main {
  flex: 1; overflow-y: auto; overflow-x: hidden;
  padding: 20px 28px calc(var(--playerbar-h) + 32px);
  scroll-behavior: smooth;
}
.topbar { display: none; }

/* ---------- hero / home ---------- */
.hero { padding: 28px 0 8px; max-width: 720px; }
.hero__greet { color: var(--accent); font-weight: 600; font-size: 14px; text-transform: uppercase; letter-spacing: 0.06em; }
.hero__title { font-size: 30px; line-height: 1.25; letter-spacing: -0.02em; margin: 8px 0 12px; }
.hero__sub { color: var(--text-2); font-size: 16px; max-width: 60ch; }
.hero__cta { margin: 24px 0 8px; }
.hero__hint { font-size: 13px; color: var(--text-2); }

.trust {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px;
  margin: 24px 0 8px;
}
.trust__item {
  display: flex; gap: 12px; align-items: flex-start;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 16px;
  color: var(--accent);
}
.trust__item strong { display: block; color: var(--text); font-size: 14px; }
.trust__item span { color: var(--text-2); font-size: 12.5px; }

.install-hint { margin-top: 32px; font-size: 13px; color: var(--text-2); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 20px; min-height: 44px;
  border-radius: 999px; font-weight: 600; font-size: 15px;
  transition: background 150ms ease-out, transform 150ms ease-out;
}
.btn:active { transform: scale(0.97); }
.btn--primary { background: var(--accent); color: var(--on-accent); font-weight: 700; }
.btn--primary .ic { stroke-width: 2.4; }
.btn--primary:hover { background: var(--accent-hover); }
.btn--ghost { border: 1.5px solid var(--border); color: var(--text); }
.btn--ghost:hover { background: var(--surface-2); }
.btn--lg { padding: 14px 26px; font-size: 16px; }
.btn:disabled { opacity: 0.45; cursor: default; }

/* ---------- playlist cards ---------- */
.section-title { font-size: 18px; font-weight: 700; letter-spacing: -0.01em; margin: 32px 0 14px; }
.page-title { font-size: 26px; letter-spacing: -0.02em; margin: 12px 0 6px; }
.page-sub { color: var(--text-2); margin-bottom: 20px; max-width: 65ch; }

.pl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.pl-card {
  display: flex; align-items: center; gap: 14px; text-align: left;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px;
  box-shadow: var(--shadow);
  transition: border-color 150ms ease-out, background 150ms ease-out;
  min-height: 44px;
}
.pl-card:hover { border-color: var(--accent); }
.pl-card:hover .pl-card__play { opacity: 1; transform: scale(1); }
.pl-card__icon {
  width: 48px; height: 48px; border-radius: 12px; flex-shrink: 0;
  display: grid; place-items: center; color: #fff;
}
.pl-morning  .pl-card__icon, .pl-head.pl-morning  .pl-head__icon { background: #C98A2E; }
.pl-midday   .pl-card__icon, .pl-head.pl-midday   .pl-head__icon { background: #B4562F; }
.pl-afternoon .pl-card__icon, .pl-head.pl-afternoon .pl-head__icon { background: #8C5A3C; }
.pl-evening  .pl-card__icon, .pl-head.pl-evening  .pl-head__icon { background: #4E4A6E; }
.pl-focus    .pl-card__icon, .pl-head.pl-focus    .pl-head__icon { background: #3E6B58; }
.pl-jazz     .pl-card__icon, .pl-head.pl-jazz     .pl-head__icon { background: #7A3B52; }
.pl-acoustic .pl-card__icon, .pl-head.pl-acoustic .pl-head__icon { background: #5C7A3B; }
.pl-lofi     .pl-card__icon, .pl-head.pl-lofi     .pl-head__icon { background: #3B6B7A; }
.pl-thien    .pl-card__icon, .pl-head.pl-thien    .pl-head__icon { background: #8A76AE; }
.pl-phuot    .pl-card__icon, .pl-head.pl-phuot    .pl-head__icon { background: #4E7E8C; }
.pl-gym      .pl-card__icon, .pl-head.pl-gym      .pl-head__icon { background: #B4552E; }
.pl-dongluc  .pl-card__icon, .pl-head.pl-dongluc  .pl-head__icon { background: #B78A2E; }
.pl-card__body { flex: 1; min-width: 0; }
.pl-card__name { display: block; font-weight: 600; font-size: 15.5px; }
.pl-card__desc { display: block; color: var(--text-2); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-card__meta { display: block; color: var(--text-2); font-size: 12px; font-variant-numeric: tabular-nums; margin-top: 2px; }
.pl-card__play {
  width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0;
  background: var(--accent); color: var(--on-accent);
  display: grid; place-items: center;
  opacity: 0; transform: scale(0.9);
  transition: opacity 150ms ease-out, transform 150ms ease-out;
}
.pl-card--big { padding: 20px; }
@media (hover: none) { .pl-card__play { opacity: 1; transform: scale(1); } }

/* ---------- playlist detail ---------- */
.pl-head { display: flex; gap: 16px; align-items: center; margin: 12px 0 4px; }
.pl-head__icon { width: 64px; height: 64px; border-radius: 16px; display: grid; place-items: center; color: #fff; flex-shrink: 0; }
.pl-head__desc { color: var(--text-2); font-size: 14px; }
.pl-actions { display: flex; gap: 10px; margin: 16px 0 20px; flex-wrap: wrap; }

.track-list { list-style: none; display: flex; flex-direction: column; gap: 2px; }
.track {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 10px; border-radius: var(--radius-sm);
  transition: background 150ms ease-out;
}
.track:hover { background: var(--surface-2); }
.track--current { background: var(--surface-2); }
.track--current .track__title { color: var(--accent); font-weight: 600; }
.track__play {
  width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0;
  display: grid; place-items: center;
  background: var(--surface); border: 1px solid var(--border);
  transition: background 150ms ease-out, border-color 150ms ease-out;
}
.track__play:hover { border-color: var(--accent); color: var(--accent); }
.track__title { flex: 1; font-size: 14.5px; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track__artist { color: var(--text-2); font-size: 13px; flex-shrink: 0; }
.track__fav {
  width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0;
  display: grid; place-items: center; color: var(--text-2);
  transition: color 150ms ease-out;
}
.track__fav:hover { color: var(--danger); }
.track__fav.is-fav { color: var(--danger); }
.track__fav.is-fav .ic { fill: var(--danger); }

/* ---------- empty state ---------- */
.empty { text-align: center; padding: 56px 20px; max-width: 380px; margin: 0 auto; }
.empty__icon {
  width: 88px; height: 88px; margin: 0 auto 20px; border-radius: 50%;
  background: var(--surface-2); color: var(--text-2);
  display: grid; place-items: center;
}
.empty h2 { font-size: 18px; margin-bottom: 6px; }
.empty p { color: var(--text-2); font-size: 14px; margin-bottom: 20px; }

/* ---------- cards / forms ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; margin-bottom: 16px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.card--attr { display: flex; gap: 10px; align-items: center; color: var(--accent); font-size: 14px; }
.card--attr em { color: var(--text-2); font-style: italic; }

.field { margin-bottom: 16px; }
.field:last-child { margin-bottom: 0; }
.field label { display: block; font-weight: 600; font-size: 13.5px; margin-bottom: 6px; }
.field input[type="text"], .field input[type="time"], .field input[type="email"],
.field textarea, .field select {
  width: 100%; padding: 11px 14px; font-size: 16px;
  background: rgba(255, 255, 255, 0.45); color: var(--text);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  min-height: 44px; font-family: inherit;
}
[data-theme="dark"] .field input[type="text"], [data-theme="dark"] .field input[type="time"],
[data-theme="dark"] .field input[type="email"],
[data-theme="dark"] .field textarea, [data-theme="dark"] .field select {
  /* background-color, KHONG shorthand: shorthand reset background-repeat -> chevron bi lap */
  background-color: rgba(30, 24, 19, 0.45);
}
.rem-preset select {
  background: var(--bg); color: var(--text);
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  font-family: inherit;
}
/* custom chevron: native select arrow has inconsistent padding per OS */
.field select, .rem-preset select {
  appearance: none; -webkit-appearance: none;
  padding-right: 44px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236B5D4F' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 18px;
}
[data-theme="dark"] .field select, [data-theme="dark"] .rem-preset select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23B3A697' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}
body.zen .zen-card .field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23FFFFFF' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 18px;
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none; border-color: var(--accent);
}
.field--inline { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.field--inline label { margin: 0; flex: 1; }
/* uniform control column so rows line up cleanly */
.field--inline > select, .field--inline > .seg, .field--inline > input[type="time"] {
  width: 224px; min-width: 224px; flex-shrink: 0;
}
.field--inline > .seg { justify-content: center; }
.field--inline > .seg .seg__btn { flex: 1; justify-content: center; }
.field-row { display: flex; gap: 16px; }
.field-row .field { flex: 1; }
.field-error { color: var(--danger); font-size: 13px; margin-top: 6px; }
.req { color: var(--danger); }
.hint { color: var(--text-2); font-size: 13px; margin-top: 12px; }

.seg {
  display: inline-flex; border-radius: 999px; padding: 3px; gap: 2px;
  background: rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border);
}
[data-theme="dark"] .seg { background: rgba(30, 24, 19, 0.4); }
.seg__btn {
  padding: 8px 16px; min-height: 38px; border-radius: 999px;
  font-size: 13.5px; font-weight: 500; color: var(--text-2);
  display: inline-flex; align-items: center; gap: 6px;
  transition: background 150ms ease-out, color 150ms ease-out;
}
.seg__btn.active { background: var(--accent); color: var(--on-accent); font-weight: 700; box-shadow: var(--shadow); }

.switch-row { display: flex; align-items: center; justify-content: space-between; min-height: 44px; cursor: pointer; }
.switch-row__label { font-weight: 600; font-size: 15px; }
.switch { appearance: none; width: 52px; height: 30px; border-radius: 999px; background: var(--border); position: relative; cursor: pointer; transition: background 200ms ease-out; flex-shrink: 0; }
.switch::after {
  content: ""; position: absolute; top: 3px; left: 3px;
  width: 24px; height: 24px; border-radius: 50%; background: #fff;
  transition: transform 200ms cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 1px 3px rgba(0,0,0,0.25);
}
.switch:checked { background: var(--accent); }
.switch:checked::after { transform: translateX(22px); }

.sched-status { font-size: 13px; color: var(--text-2); margin: 4px 0 16px; }
.sched-status.on { color: var(--accent); font-weight: 600; }

/* ---------- ambience ---------- */
.amb-row { display: flex; align-items: center; gap: 14px; min-height: 48px; }
.amb-row__icon { color: var(--accent); flex-shrink: 0; }
.amb-row__label { flex: 0 0 110px; font-weight: 600; font-size: 14px; }
.amb-row input[type="range"] { flex: 1; accent-color: var(--accent); height: 32px; cursor: pointer; }

/* ---------- license table ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.lic-table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 560px; }
.lic-table th, .lic-table td { text-align: left; padding: 10px 16px; border-bottom: 1px solid var(--border); }
.lic-table th { font-size: 12.5px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-2); }
.lic-table tr:last-child td { border-bottom: none; }

/* ---------- player bar ---------- */
.playerbar {
  position: fixed; left: 0; right: 0; bottom: 0; height: var(--playerbar-h);
  background: var(--surface);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--border);
  display: flex; align-items: center; gap: 16px;
  padding: 0 20px calc(env(safe-area-inset-bottom, 0px));
  z-index: 100;
}
.pb-progress {
  position: absolute; top: -5px; left: 0; right: 0; height: 10px;
  cursor: pointer;
}
.pb-progress::before {
  content: ""; position: absolute; top: 4px; left: 0; right: 0; height: 3px;
  background: var(--border);
}
.pb-progress-fill {
  position: absolute; top: 4px; left: 0; height: 3px; width: 0;
  background: var(--accent);
}
.pb-info { flex: 1; min-width: 0; }
.pb-title { font-weight: 600; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pb-sub { color: var(--text-2); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pb-time { color: var(--text-2); font-size: 12px; font-variant-numeric: tabular-nums; flex-shrink: 0; }
.pb-controls { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.pb-btn {
  width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center; color: var(--text);
  transition: background 150ms ease-out;
}
.pb-btn:hover { background: var(--surface-2); }
.pb-btn:disabled { opacity: 0.4; }
.pb-btn--main { background: var(--accent); color: var(--on-accent); width: 52px; height: 52px; }
.pb-btn--main:hover { background: var(--accent-hover); }
.pb-btn.is-fav { color: var(--danger); }
.pb-btn.is-fav .ic { fill: var(--danger); }
.pb-vol-wrap { display: flex; align-items: center; gap: 8px; color: var(--text-2); }
.pb-vol-wrap input[type="range"] { width: 110px; accent-color: var(--accent); height: 32px; cursor: pointer; }

/* ---------- focus nook ---------- */
.focus-banner {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px 20px; margin-top: 28px;
  box-shadow: var(--shadow);
}
.focus-banner__icon {
  width: 52px; height: 52px; border-radius: 14px; flex-shrink: 0;
  background: #3E6B58; color: #fff; display: grid; place-items: center;
}
.focus-banner__body { flex: 1; min-width: 200px; }
.focus-banner__body strong { display: block; font-size: 15.5px; }
.focus-banner__body span { color: var(--text-2); font-size: 13.5px; }

.focus-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 16px; }
.stat {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 16px; text-align: center;
}
.stat__num { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.stat__unit { color: var(--text-2); font-size: 13px; margin-left: 3px; }
.stat__label { display: block; color: var(--text-2); font-size: 12.5px; margin-top: 2px; }

.chip-row { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  padding: 10px 18px; min-height: 44px; border-radius: 999px;
  border: 1.5px solid var(--border); font-weight: 600; font-size: 14px;
  color: var(--text-2);
  transition: border-color 150ms ease-out, color 150ms ease-out, background 150ms ease-out;
  font-variant-numeric: tabular-nums;
}
.chip:hover { border-color: var(--accent); color: var(--text); }
.chip.active { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }

.focus-stage { text-align: center; padding: 24px 0 8px; }
.focus-ring-wrap { position: relative; display: inline-block; }
.focus-ring__bg { fill: none; stroke: var(--surface-2); stroke-width: 10; }
.focus-ring__fg {
  fill: none; stroke: var(--accent); stroke-width: 10; stroke-linecap: round;
  transition: stroke-dashoffset 1s linear;
}
.focus-ring__center {
  position: absolute; inset: 0; display: grid; place-content: center; gap: 2px;
}
.focus-ring__time { font-size: 44px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.focus-ring__label { color: var(--text-2); font-size: 13px; }
.focus-running-label {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  color: var(--accent); font-weight: 600; margin: 16px 0 20px;
}
.focus-hist { list-style: none; display: flex; flex-direction: column; gap: 2px; }
.focus-hist li {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: var(--radius-sm);
  background: var(--surface); border: 1px solid var(--border);
  margin-bottom: 6px; font-size: 14px; color: var(--text-2);
}
.focus-hist__date { flex: 1; color: var(--text); }
.focus-hist__min { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--text); }

@media (max-width: 860px) {
  .focus-stats { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .stat__num { font-size: 20px; }
}

/* ---------- liquid glass + zen (immersive focus) ---------- */
/* iOS-26-style mirror glass: blur + saturate + specular sweep (::before) + edge shine ring */
.glass {
  position: relative;
  background: rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(24px) saturate(170%);
  -webkit-backdrop-filter: blur(24px) saturate(170%);
  border: 1px solid rgba(255, 255, 255, 0.38);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.55),
    inset 0 -1px 0 rgba(255, 255, 255, 0.12),
    inset 1px 0 0 rgba(255, 255, 255, 0.18),
    0 8px 28px rgba(0, 0, 0, 0.14);
}
.glass::before {
  content: ""; position: absolute; inset: 0;
  border-radius: inherit; pointer-events: none;
  background: linear-gradient(118deg,
    rgba(255, 255, 255, 0.42) 0%,
    rgba(255, 255, 255, 0.10) 22%,
    rgba(255, 255, 255, 0) 45%,
    rgba(255, 255, 255, 0) 68%,
    rgba(255, 255, 255, 0.16) 100%);
}
[data-theme="dark"] .glass {
  background: rgba(28, 22, 18, 0.36);
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    inset 0 -1px 0 rgba(255, 255, 255, 0.05),
    0 8px 28px rgba(0, 0, 0, 0.4);
}
[data-theme="dark"] .glass::before {
  background: linear-gradient(118deg,
    rgba(255, 255, 255, 0.16) 0%,
    rgba(255, 255, 255, 0.04) 22%,
    rgba(255, 255, 255, 0) 45%,
    rgba(255, 255, 255, 0) 68%,
    rgba(255, 255, 255, 0.07) 100%);
}
.zen-toggle {
  position: fixed; top: 16px; right: 16px; z-index: 60;
  width: 48px; height: 48px; border-radius: 50%;
  display: grid; place-items: center; color: var(--text);
  transition: transform 150ms ease-out, opacity 200ms ease-out;
}
.zen-toggle:active { transform: scale(0.94); }

.scene__veil { transition: opacity 500ms ease-out; }
body.zen .scene__veil { opacity: 0.16; }
body.zen .sidebar, body.zen .playerbar, body.zen .topbar, body.zen .scrim { display: none; }
body.zen .main { padding: 0; height: 100vh; height: 100dvh; display: block; }
body.zen #view { width: 100%; }
body.zen #view > *:not(.focus-stage):not(.zen-card):not(.zen-toggle):not(.note-board):not(.zen-note-add):not(.note-add):not(.home-hero):not(.focus-viz-wrap) { display: none; }
body.zen #view > .note-add { display: none; }
/* full-man: song nhac (focus-viz) tra thanh nen dong toan man phia sau dong ho */
body.zen .focus-viz-wrap {
  position: fixed; inset: 0; z-index: 30; margin: 0; height: 100dvh;
  border-radius: 0; background: transparent; box-shadow: none;
}
/* trang chu full man: khung player phu kin man, nut thoat (zen-toggle) noi goc */
body.zen .home-hero { position: fixed; inset: 0; z-index: 40; display: flex; }
body.zen .home-player { position: relative; z-index: 40; flex: 1; min-height: 100dvh; display: flex; flex-direction: column; justify-content: center; margin: 0; background: transparent; box-shadow: none; }
body.zen .home-player__focus { display: none; }
/* song nhac nen trong home full-man */
.home-viz-toggle { display: none; }
.home-viz { display: none; }
body.zen .home-viz {
  display: block; position: fixed; inset: 0; z-index: 30; width: 100%; height: 100dvh;
}
body.zen .home-viz-toggle {
  display: inline-flex; align-items: center; gap: 6px;
  position: fixed; right: 20px; bottom: 20px; z-index: 60;
  padding: 9px 14px; min-height: 40px; border-radius: 999px;
  font-size: 12.5px; font-weight: 600; color: #fff;
  background: rgba(255, 255, 255, 0.16); border: 1px solid rgba(255, 255, 255, 0.28);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
body.zen .home-viz-toggle.is-on { color: var(--accent); background: rgba(255, 255, 255, 0.24); }
body.zen .home-player__now { color: #fff; text-shadow: 0 2px 16px rgba(0, 0, 0, 0.55); }
body.zen .home-player__sub, body.zen .home-player__greet, body.zen .home-player__gesture { color: rgba(255, 255, 255, 0.82); text-shadow: 0 1px 10px rgba(0, 0, 0, 0.5); }

/* zen notes: fullscreen sticker board + floating add button */
body.zen .note-board {
  position: fixed; inset: 0; min-height: 100vh; z-index: 40;
  border: none; border-radius: 0;
}
.zen-note-add { display: none; }
body.zen .zen-note-add { display: grid; position: fixed; right: 20px; bottom: 20px; z-index: 60; }
body.zen.nq-show-add #view > .note-add {
  display: block; position: fixed; top: 18px; left: 50%;
  transform: translateX(-50%); width: min(92vw, 560px); z-index: 70;
}
body.zen .zen-card { max-width: 560px; margin: 12vh auto 0; text-align: center; }
body.zen .zen-card .chip-row { justify-content: center; }
body.zen .zen-card .field label { text-align: left; }
body.zen .zen-card .btn--lg { display: inline-flex; margin: 0 auto; }

/* nut thoat full-man noi goc duoi trai (khong che canh dep) */
body.zen .zen-toggle { top: auto; right: auto; left: 20px; bottom: 20px; color: #fff; z-index: 60; opacity: 1; }
body.zen .focus-stage {
  position: fixed; left: 20px; top: max(20px, env(safe-area-inset-top)); bottom: auto; z-index: 50;
  text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 18px 22px; border-radius: 18px;
  background: rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(24px) saturate(170%);
  -webkit-backdrop-filter: blur(24px) saturate(170%);
  border: 1px solid rgba(255, 255, 255, 0.32);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), 0 8px 28px rgba(0, 0, 0, 0.18);
  opacity: 0.55;
  transition: opacity 250ms ease-out;
}
body.zen .focus-stage:hover, body.zen .focus-stage:focus-within { opacity: 1; }
/* compact progress ring around the time, everything centered */
body.zen .focus-ring { width: 132px; height: 132px; }
body.zen .focus-ring-wrap { transform: none; margin: 0; }
body.zen .focus-ring__bg { stroke: rgba(255, 255, 255, 0.25); }
body.zen .focus-ring__fg { stroke: rgba(255, 255, 255, 0.92); }
body.zen .focus-ring__time { font-size: 24px; color: #fff; text-shadow: 0 2px 14px rgba(0, 0, 0, 0.5); }
body.zen .focus-ring__label { color: rgba(255, 255, 255, 0.85); text-shadow: 0 1px 8px rgba(0, 0, 0, 0.5); font-size: 11.5px; }
body.zen .focus-running-label {
  color: rgba(255, 255, 255, 0.92); text-shadow: 0 1px 10px rgba(0, 0, 0, 0.5);
  justify-content: center; margin: 0; font-size: 13px;
}
body.zen .focus-stage .btn { padding: 8px 16px; min-height: 40px; font-size: 13px; }

/* dimmed floating controls - full opacity on hover/focus */
body.zen .zen-dim {
  opacity: 0.42;
  transition: opacity 250ms ease-out;
}
body.zen .zen-dim:hover, body.zen .zen-dim:focus-visible, body.zen .zen-dim:focus-within { opacity: 1; }
.focus-btn-row { display: flex; gap: 10px; justify-content: center; align-items: center; flex-wrap: wrap; margin-bottom: 4px; }
.btn-icon-round {
  position: relative;
  width: 44px; height: 44px; border-radius: 50%; flex-shrink: 0;
  border: 1.5px solid var(--border); color: var(--text);
  display: grid; place-items: center;
  background: rgba(255, 255, 255, 0.45);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: border-color 150ms ease-out, transform 150ms ease-out;
}
.btn-icon-round:hover { border-color: var(--accent); color: var(--accent); }
.btn-icon-round:active { transform: scale(0.94); }
[data-theme="dark"] .btn-icon-round { background: rgba(30, 24, 19, 0.45); }
/* water-ripple hint: two sonar rings, removed by JS after 3s */
.ripple-hint::before, .ripple-hint::after {
  content: ""; position: absolute; inset: -2px;
  border-radius: 50%; pointer-events: none;
  border: 2px solid var(--accent);
  animation: sonar-ring 1.4s ease-out 2;
}
.ripple-hint::after { animation-delay: 0.45s; }
@keyframes sonar-ring {
  0% { transform: scale(0.85); opacity: 0.7; }
  100% { transform: scale(1.9); opacity: 0; }
}
body.zen .btn-icon-round {
  width: 40px; height: 40px; /* match .btn height in zen */
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.38);
  color: #fff;
}
body.zen .focus-hint-tap { display: none; }
body.zen .ripple-hint::before, body.zen .ripple-hint::after { border-color: rgba(255, 255, 255, 0.8); }
.focus-hint-tap { font-size: 12.5px; color: var(--text-2); margin-top: 10px; }
body.zen .focus-hint-tap { color: rgba(255, 255, 255, 0.75); text-shadow: 0 1px 6px rgba(0, 0, 0, 0.4); }

body.zen .focus-stage .btn, body.zen .zen-card .btn, body.zen .chip {
  position: relative;
  background: rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(24px) saturate(170%);
  -webkit-backdrop-filter: blur(24px) saturate(170%);
  border: 1px solid rgba(255, 255, 255, 0.38);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
  color: #fff; text-shadow: 0 1px 6px rgba(0, 0, 0, 0.4);
}
body.zen .focus-stage .btn::before, body.zen .zen-card .btn::before, body.zen .zen-card::before {
  content: ""; position: absolute; inset: 0;
  border-radius: inherit; pointer-events: none;
  background: linear-gradient(118deg,
    rgba(255, 255, 255, 0.35) 0%,
    rgba(255, 255, 255, 0.08) 25%,
    rgba(255, 255, 255, 0) 50%,
    rgba(255, 255, 255, 0.12) 100%);
}
body.zen .chip.active { background: rgba(255, 255, 255, 0.42); color: #1c1610; text-shadow: none; }
body.zen .zen-card {
  background: rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 12px 40px rgba(0, 0, 0, 0.18);
}
body.zen .zen-card label, body.zen .zen-card .switch-row__label { color: #fff; text-shadow: 0 1px 6px rgba(0, 0, 0, 0.45); }
body.zen .zen-card select {
  background-color: rgba(255, 255, 255, 0.2); color: #fff;
  border-color: rgba(255, 255, 255, 0.35);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
body.zen .zen-card select option { color: #1c1610; }

/* ---------- music visualizer (player bar) ---------- */
.pb-viz { flex-shrink: 0; opacity: 0.9; }

/* ---------- iOS-glass surfaces (home & content cards) ---------- */
.card, .pl-card, .trust__item, .focus-banner, .stat {
  position: relative;
  background: rgba(255, 255, 255, 0.66);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65), 0 8px 24px rgba(43, 33, 24, 0.08);
}
.card::before, .pl-card::before, .trust__item::before, .focus-banner::before, .stat::before {
  content: ""; position: absolute; inset: 0;
  border-radius: inherit; pointer-events: none;
  background: linear-gradient(118deg,
    rgba(255, 255, 255, 0.30) 0%,
    rgba(255, 255, 255, 0.06) 24%,
    rgba(255, 255, 255, 0) 48%,
    rgba(255, 255, 255, 0.10) 100%);
}
.pl-card:hover { border-color: var(--accent); }
[data-theme="dark"] .card, [data-theme="dark"] .pl-card, [data-theme="dark"] .trust__item,
[data-theme="dark"] .focus-banner, [data-theme="dark"] .stat {
  background: rgba(30, 24, 19, 0.68);
  border-color: rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 8px 24px rgba(0, 0, 0, 0.3);
}
[data-theme="dark"] .card::before, [data-theme="dark"] .pl-card::before,
[data-theme="dark"] .trust__item::before, [data-theme="dark"] .focus-banner::before,
[data-theme="dark"] .stat::before {
  background: linear-gradient(118deg,
    rgba(255, 255, 255, 0.10) 0%,
    rgba(255, 255, 255, 0.02) 24%,
    rgba(255, 255, 255, 0) 48%,
    rgba(255, 255, 255, 0.05) 100%);
}
/* glass chrome: menu + player bar, opaque enough to keep text crisp */
.sidebar, .playerbar {
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(20px) saturate(155%);
  -webkit-backdrop-filter: blur(20px) saturate(155%);
}
.sidebar::after, .playerbar::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(118deg,
    rgba(255, 255, 255, 0.22) 0%,
    rgba(255, 255, 255, 0.04) 30%,
    rgba(255, 255, 255, 0) 60%,
    rgba(255, 255, 255, 0.08) 100%);
}
.sidebar { position: relative; }
[data-theme="dark"] .sidebar, [data-theme="dark"] .playerbar { background: rgba(30, 24, 19, 0.74); }
[data-theme="dark"] .sidebar::after, [data-theme="dark"] .playerbar::after {
  background: linear-gradient(118deg,
    rgba(255, 255, 255, 0.07) 0%,
    rgba(255, 255, 255, 0.015) 30%,
    rgba(255, 255, 255, 0) 60%,
    rgba(255, 255, 255, 0.03) 100%);
}
.nav__item:hover { background: rgba(255, 255, 255, 0.5); }
.nav__item.active { background: rgba(255, 255, 255, 0.55); }
[data-theme="dark"] .nav__item:hover { background: rgba(255, 255, 255, 0.08); }
[data-theme="dark"] .nav__item.active { background: rgba(255, 255, 255, 0.1); }

/* ---------- reminders ---------- */
.rem-or { color: var(--text-2); font-size: 13px; align-self: center; margin: 0 2px; }
.rem-time { width: auto !important; min-width: 110px; }
.rem-preset {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 0; min-height: 48px;
  border-bottom: 1px solid var(--border);
}
.rem-preset:last-child { border-bottom: none; }
.rem-preset__name { font-weight: 600; font-size: 14px; flex: 1; min-width: 120px; }
.rem-preset select { padding: 8px 34px 8px 10px; min-height: 40px; font-size: 13px; background-position: right 10px center; }
.rem-list { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.rem-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: var(--radius-sm);
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text-2); font-size: 14px;
}
.rem-item--high { border-left: 3px solid var(--accent); }
.rem-item__text { flex: 1; color: var(--text); min-width: 0; }
.rem-item__time { font-variant-numeric: tabular-nums; font-size: 13px; flex-shrink: 0; }

/* ---------- sticky notes board ---------- */
.note-colors { display: flex; gap: 8px; }
.note-color {
  width: 32px; height: 32px; border-radius: 50%;
  border: 2px solid rgba(0, 0, 0, 0.12);
  transition: transform 150ms ease-out, border-color 150ms ease-out;
}
.note-color:hover { transform: scale(1.1); }
.note-color.active { border-color: var(--accent); transform: scale(1.12); }
.note-color--yellow { background: #F6E27F; }
.note-color--pink   { background: #F7C4D4; }
.note-color--mint   { background: #BFE8CF; }
.note-color--blue   { background: #BCD9F2; }
.note-color--purple { background: #DCCBF2; }

.note-board {
  position: relative; min-height: 62vh;
  border: 1.5px dashed var(--border); border-radius: var(--radius);
  overflow: hidden; touch-action: none;
}
.note-board__empty { position: absolute; inset: 0; display: grid; place-content: center; }

.snote {
  position: absolute; width: 168px; min-height: 120px;
  padding: 30px 14px 14px;
  transform-origin: 50% 0;
  animation: snote-sway 5s ease-in-out infinite;
  box-shadow: 0 6px 14px rgba(30, 20, 10, 0.18);
  cursor: grab; user-select: none;
  border-radius: 2px 2px 8px 2px;
}
.snote::before { /* pin */
  content: ""; position: absolute; top: 8px; left: 50%; transform: translateX(-50%);
  width: 10px; height: 10px; border-radius: 50%;
  background: rgba(0, 0, 0, 0.28);
  box-shadow: inset 0 -2px 3px rgba(0, 0, 0, 0.3), 0 1px 2px rgba(0, 0, 0, 0.25);
}
@keyframes snote-sway {
  0%, 100% { transform: rotate(-1.6deg); }
  50% { transform: rotate(1.5deg) translateY(1.5px); }
}
@media (prefers-reduced-motion: reduce) { .snote { animation: none; } }
.snote--drag { animation-play-state: paused; cursor: grabbing; z-index: 10; box-shadow: 0 14px 30px rgba(30, 20, 10, 0.3); }
.snote--yellow { background: #F6E27F; }
.snote--pink   { background: #F7C4D4; }
.snote--mint   { background: #BFE8CF; }
.snote--blue   { background: #BCD9F2; }
.snote--purple { background: #DCCBF2; }
.snote__text {
  font-size: 14px; line-height: 1.45; color: #3A2E1C;
  word-wrap: break-word; font-weight: 500;
}
.snote__check, .snote__del {
  position: absolute; top: 4px;
  width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center;
  color: rgba(58, 46, 28, 0.55);
  transition: color 150ms ease-out, background 150ms ease-out;
}
.snote__check { left: 4px; }
.snote__del { right: 4px; }
.snote__check:hover { color: #2E7D4F; background: rgba(255, 255, 255, 0.5); }
.snote__del:hover { color: var(--danger); background: rgba(255, 255, 255, 0.5); }
.snote--done .snote__text { text-decoration: line-through; opacity: 0.55; }
.snote--done { opacity: 0.72; }
.snote--done .snote__check { color: #2E7D4F; }

/* ---------- EQ / zen visualizer / local music / add-to-playlist ---------- */
.eq-grid {
  display: grid; grid-template-columns: repeat(10, 1fr);
  gap: 6px; align-items: end;
}
.eq-band { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.eq-slider {
  writing-mode: vertical-lr; direction: rtl;
  width: 30px; height: 130px;
  accent-color: var(--accent); cursor: pointer;
}
.eq-val { font-size: 11px; font-variant-numeric: tabular-nums; color: var(--text-2); min-height: 14px; }
.eq-freq { font-size: 10.5px; color: var(--text-2); }
@media (max-width: 860px) {
  .eq-grid { grid-template-columns: repeat(5, 1fr); row-gap: 16px; }
}

.zen-viz {
  position: fixed; left: 0; right: 0; bottom: 0;
  width: 100vw; height: 30vh;
  z-index: 45; pointer-events: none;
}

.ll-badge {
  display: inline-block; vertical-align: 1px;
  font-size: 9px; font-weight: 700; letter-spacing: 0.08em;
  padding: 1px 6px; border-radius: 999px; margin-left: 6px;
  background: rgba(46, 125, 79, 0.18); color: #2E7D4F;
  border: 1px solid rgba(46, 125, 79, 0.35);
}
[data-theme="dark"] .ll-badge { background: rgba(120, 220, 160, 0.14); color: #8fe0b0; border-color: rgba(120, 220, 160, 0.3); }

.addpl-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; max-height: 40vh; overflow-y: auto; }
.addpl-item {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 14px; min-height: 44px; border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.14); color: #fff; text-align: left;
  border: 1px solid rgba(255, 255, 255, 0.25);
}
.addpl-item span { margin-left: auto; opacity: 0.8; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.addpl-item:hover { background: rgba(255, 255, 255, 0.24); }

.promo-link {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 12px; margin-top: 4px; min-height: 44px;
  color: var(--text-2); font-weight: 500; font-size: 14.5px; text-decoration: none;
  border-radius: var(--radius-sm);
}
.promo-link:hover { background: var(--surface-2); color: var(--accent); }

/* ---------- pro / jingle / pomodoro / heatmap ---------- */
.pro-badge {
  display: inline-block; vertical-align: middle;
  font-size: 11px; font-weight: 700; letter-spacing: 0.08em;
  padding: 3px 10px; border-radius: 999px; margin-left: 8px;
  background: var(--accent); color: var(--on-accent);
}
.pro-list { list-style: none; margin-bottom: 18px; }
.pro-list li { display: flex; gap: 10px; align-items: center; padding: 6px 0; font-size: 14.5px; }
.pro-list .ic { color: #2E7D4F; flex-shrink: 0; }
.pro-code-row { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.pro-code-row input {
  flex: 1; min-width: 160px; padding: 10px 14px; font-size: 15px;
  background: rgba(255, 255, 255, 0.45); color: var(--text);
  border: 1.5px solid var(--border); border-radius: var(--radius-sm); min-height: 44px;
}
[data-theme="dark"] .pro-code-row input { background: rgba(30, 24, 19, 0.45); }

.venue-welcome__greet { font-size: 14px; opacity: 0.95; margin: -2px 0 8px; font-style: italic; }

.hm { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, 12px); gap: 3px; overflow-x: auto; padding: 2px; }
.hm-cell { width: 12px; height: 12px; border-radius: 3px; background: var(--surface-2); }
.hm-lv1 { background: rgba(161, 78, 36, 0.25); }
.hm-lv2 { background: rgba(161, 78, 36, 0.45); }
.hm-lv3 { background: rgba(161, 78, 36, 0.7); }
.hm-lv4 { background: var(--accent); }
[data-theme="dark"] .hm-lv1 { background: rgba(232, 149, 109, 0.25); }
[data-theme="dark"] .hm-lv2 { background: rgba(232, 149, 109, 0.45); }
[data-theme="dark"] .hm-lv3 { background: rgba(232, 149, 109, 0.7); }

/* ---------- donate gift cards ---------- */
.gift-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.gift-card {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  min-height: 150px; padding: 20px 16px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.66);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  border: 1.5px solid var(--border);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65), 0 8px 24px rgba(43, 33, 24, 0.08);
  text-align: center;
  transition: border-color 150ms ease-out, transform 150ms ease-out;
}
.gift-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.gift-card:active { transform: scale(0.98); }
.gift-card__amount {
  font-size: 44px; font-weight: 800; letter-spacing: -0.03em;
  color: var(--accent); line-height: 1; font-variant-numeric: tabular-nums;
}
.gift-card__amount small { font-size: 22px; font-weight: 700; }
.gift-card__note { font-size: 13px; color: var(--text-2); line-height: 1.5; max-width: 26ch; }
.gift-card__link { color: var(--accent); font-weight: 700; text-decoration: underline; }
[data-theme="dark"] .gift-card { background: rgba(30, 24, 19, 0.68); }

/* ---------- venue QR + welcome / milestone overlay ---------- */
.venue-qr { display: flex; gap: 20px; align-items: flex-start; flex-wrap: wrap; }
.venue-qr img { border-radius: var(--radius-sm); background: #fff; padding: 6px; flex-shrink: 0; }
.venue-qr__body { flex: 1; min-width: 220px; }
.venue-qr__body strong { font-size: 17px; display: block; }
.venue-qr__body > span { color: var(--text-2); font-size: 13.5px; }
.venue-qr .pl-actions { margin: 12px 0 0; }

.venue-welcome {
  position: fixed; inset: 0; z-index: 900;
  display: grid; place-items: center;
  background: rgba(0, 0, 0, 0.35);
  padding: 20px;
}
.venue-welcome__card {
  max-width: 420px; width: 100%;
  border-radius: 22px; padding: 32px 28px;
  text-align: center; color: #fff;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.4);
}
.venue-welcome__icon {
  width: 64px; height: 64px; border-radius: 18px; margin: 0 auto 14px;
  background: var(--accent); color: var(--on-accent);
  display: grid; place-items: center;
}
.venue-welcome__hi { font-size: 14px; opacity: 0.9; }
.venue-welcome__name { font-size: 26px; letter-spacing: -0.02em; margin: 4px 0 6px; }
.venue-welcome__pl { font-size: 13.5px; opacity: 0.9; margin-bottom: 20px; display: flex; gap: 6px; justify-content: center; align-items: center; }

/* ---------- PWA install banner ---------- */
.pwa-banner {
  position: fixed; right: 16px; bottom: calc(var(--playerbar-h) + 16px);
  z-index: 500; max-width: 400px;
  display: flex; align-items: center; gap: 12px;
  padding: 14px 14px 14px 18px; border-radius: 16px;
  animation: pwa-in 300ms cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes pwa-in {
  from { opacity: 0; transform: translateY(14px) scale(0.97); }
  to { opacity: 1; transform: none; }
}
.pwa-banner__icon {
  width: 40px; height: 40px; border-radius: 12px; flex-shrink: 0;
  background: var(--accent); color: var(--on-accent);
  display: grid; place-items: center;
}
.pwa-banner__body { flex: 1; min-width: 0; }
.pwa-banner__body strong { display: block; font-size: 14px; }
.pwa-banner__body span { color: var(--text-2); font-size: 12.5px; }
.pwa-banner .btn { flex-shrink: 0; padding: 9px 16px; min-height: 40px; font-size: 13.5px; }
@media (max-width: 860px) {
  .pwa-banner { left: 12px; right: 12px; max-width: none; }
}

/* ---------- toast ---------- */
.toast {
  position: fixed; bottom: calc(var(--playerbar-h) + 16px); left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: var(--text); color: var(--bg);
  padding: 11px 20px; border-radius: 999px; font-size: 14px; font-weight: 500;
  opacity: 0; pointer-events: none; z-index: 1000;
  transition: opacity 200ms ease-out, transform 200ms cubic-bezier(0.16, 1, 0.3, 1);
  max-width: min(90vw, 480px); text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- zen widgets (clock / lunar / weather) ---------- */
.zen-widgets {
  position: fixed; top: 20px; right: 20px; z-index: 55;
  padding: 16px 20px; border-radius: 18px;
  text-align: right; color: #fff;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.45);
  display: none;
}
body.zen .zen-widgets { display: block; }
.zw-clock { font-size: 44px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.zw-date { font-size: 14px; opacity: 0.95; margin-top: 2px; }
.zw-lunar { font-size: 12.5px; opacity: 0.85; margin-top: 4px; }
.zw-row { display: flex; gap: 10px; justify-content: flex-end; align-items: center; margin-top: 8px; flex-wrap: wrap; }
.zw-hd {
  font-size: 11.5px; font-weight: 600; padding: 3px 10px; border-radius: 999px;
  background: rgba(0, 0, 0, 0.25); border: 1px solid rgba(255, 255, 255, 0.3);
}
.zw-hd--good { background: rgba(46, 125, 79, 0.45); }
.zw-wx { font-size: 12.5px; display: inline-flex; align-items: center; gap: 5px; }

.frame-row { display: flex; gap: 10px; flex-wrap: wrap; }
.ann-list { list-style: none; display: flex; flex-direction: column; gap: 6px; margin-top: 14px; }
.ann-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: var(--radius-sm);
  background: var(--surface-2);
}
.ann-item__name { flex: 1; font-size: 14px; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ann-item__time { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 14px; color: var(--accent); }
.ann-add-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; align-items: center; }
.ann-add-row input[type="time"], .ann-add-row select {
  padding: 9px 12px; min-height: 42px; font-size: 14px;
  background: rgba(255, 255, 255, 0.45); color: var(--text);
  border: 1.5px solid var(--border); border-radius: var(--radius-sm); font-family: inherit;
}
[data-theme="dark"] .ann-add-row input[type="time"], [data-theme="dark"] .ann-add-row select {
  background-color: rgba(30, 24, 19, 0.45);
}
.ann-add-row select {
  appearance: none; -webkit-appearance: none; padding-right: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236B5D4F' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 16px;
}
.tet-line {
  display: flex; align-items: center; gap: 7px;
  margin-top: 26px; font-size: 13.5px; font-weight: 600; color: var(--accent);
}
.zw-tet { font-size: 12px; opacity: 0.9; margin-top: 3px; color: #FFD9A8; }
.venue-stats { font-size: 13px; color: var(--accent); font-weight: 600; margin-top: 8px; font-variant-numeric: tabular-nums; }

/* ---------- tap-to-start overlay (autoplay blocked) ---------- */
.tap-overlay {
  position: fixed; inset: 0; z-index: 900;
  display: grid; place-items: center;
  background: rgba(0, 0, 0, 0.35);
  cursor: pointer;
}
.tap-overlay__btn { color: #fff; text-shadow: 0 1px 8px rgba(0, 0, 0, 0.4); pointer-events: none; }

/* ---------- scrim (mobile sidebar) ---------- */
.scrim {
  display: none; position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.5); z-index: 30;
}

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .sidebar {
    position: fixed; top: 0; bottom: 0; left: 0;
    transform: translateX(-100%);
    transition: transform 250ms cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: none;
  }
  .sidebar.open { transform: translateX(0); box-shadow: 8px 0 32px rgba(0,0,0,0.2); }
  .sidebar.open ~ .scrim { display: block; }
  .topbar {
    display: flex; align-items: center; gap: 12px;
    position: sticky; top: 0; z-index: 20;
    background: var(--veil); padding: 8px 0 12px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
  }
  .topbar__title { font-weight: 700; font-size: 17px; }
  .topbar .pb-btn:last-child { margin-left: auto; }
  .main { padding: 12px 16px calc(var(--playerbar-h) + 24px); }
  .hero__title { font-size: 24px; }
  .trust { grid-template-columns: 1fr; }
  .pb-vol-wrap { display: none; }
  .pb-time { display: none; }
  .pb-viz { display: none; }
  .track__artist { display: none; }
  .field-row { flex-direction: column; gap: 0; }
  .field--inline { flex-wrap: wrap; }
  .field--inline > select, .field--inline > .seg, .field--inline > input[type="time"] {
    width: 100%; min-width: 0;
  }
}

/* ---------- giai lao (break suite) ---------- */
.brk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; margin-bottom: 20px; }
.brk-grid--2 { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.brk-card {
  display: flex; flex-direction: column; align-items: flex-start; gap: 8px;
  padding: 22px 20px; border-radius: var(--r-lg); text-decoration: none; color: var(--text);
  border: 1px solid var(--border); cursor: pointer; text-align: left;
  transition: transform 0.18s ease, border-color 0.18s ease;
}
.brk-card:hover { transform: translateY(-3px); border-color: var(--accent); }
.brk-card__icon { color: var(--accent); }
.brk-card__sub { color: var(--text-2); font-size: 13.5px; line-height: 1.45; }
.brk-card__mins { display: inline-flex; align-items: center; gap: 5px; color: var(--text-3); font-size: 12.5px; margin-top: 4px; }
.brk-science { display: flex; gap: 10px; align-items: flex-start; padding: 14px 16px; border-radius: var(--r-md); color: var(--text-2); font-size: 13.5px; max-width: 70ch; }
.brk-science .ic { flex: none; margin-top: 2px; color: var(--accent); }

.brk-stage {
  position: relative; overflow: hidden; border-radius: var(--r-lg);
  min-height: min(66vh, 620px); display: flex; flex-direction: column;
  background-size: cover; background-position: center;
  container-type: inline-size;
}
.brk-stage:fullscreen { border-radius: 0; min-height: 100vh; }
.brk-stage__bar {
  position: relative; z-index: 5; display: flex; align-items: center; gap: 10px;
  justify-content: space-between; padding: 12px 14px;
}
.brk-stage__bar strong { font-size: 15px; text-shadow: 0 1px 8px rgba(0,0,0,0.35); }
.brk-stage__hint {
  position: absolute; z-index: 5; left: 0; right: 0; bottom: 14px; text-align: center;
  color: var(--text-2); font-size: 13px; padding: 0 16px; pointer-events: none;
  text-shadow: 0 1px 6px rgba(0,0,0,0.3);
}
.brk-row { margin-top: 18px; }
.brk-tools { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 14px; }

/* birds */
.brk-stage--birds { background-color: transparent; }
#brk-birds { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 2; pointer-events: none; }
#global-birds { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 3; pointer-events: none; }
.brk-scenes { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
.brk-scene {
  position: relative; border: 2px solid var(--border); border-radius: var(--r-md); overflow: hidden;
  padding: 0; cursor: pointer; background-color: var(--surface); aspect-ratio: 16/10;
}
.brk-scene img { width: 100%; height: 100%; object-fit: cover; display: block; }
.brk-scene em {
  position: absolute; left: 0; right: 0; bottom: 0; font-style: normal; font-size: 11.5px;
  padding: 10px 6px 5px; color: #FFF; text-align: center;
  background: linear-gradient(transparent, rgba(0,0,0,0.62));
}
.brk-scene.active { border-color: var(--accent); }
.brk-scene__auto { display: grid; place-items: center; height: 100%; color: var(--text-2); }
.brk-scene .brk-scene__auto + em { color: var(--text-2); background: none; }
.brk-row .switch-row { margin-top: 14px; padding: 12px 16px; border-radius: var(--r-md); }

/* sheep */
.brk-stage--sheep { background: linear-gradient(180deg, #0B1026 0%, #17203E 62%, #1E2947 100%); color: #E9EDF8; }
.brk-stage--sheep .brk-stage__hint { color: rgba(233, 237, 248, 0.55); }
.sheep-sky { position: absolute; inset: 0; z-index: 1; }
.sheep-sky i {
  position: absolute; border-radius: 50%; background-color: #E9EDF8; opacity: 0.7;
  animation: sheepTwinkle 3.4s ease-in-out infinite;
}
@keyframes sheepTwinkle { 0%, 100% { opacity: 0.15; } 50% { opacity: 0.8; } }
.sheep-moon {
  position: absolute; top: 12%; right: 14%; width: 64px; height: 64px; border-radius: 50%;
  background: radial-gradient(circle at 38% 36%, #FFF7DE, #F0E3B2 62%, #D9C98F);
  box-shadow: 0 0 44px 10px rgba(255, 244, 214, 0.28);
}
.sheep-hill { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 34%; z-index: 2; }
.sheep-fence { position: absolute; left: 50%; bottom: 13%; width: 56px; height: 56px; margin-left: -28px; z-index: 3; }
#sheep-lane { position: absolute; inset: 0; z-index: 4; pointer-events: none; }
.sheep-run {
  position: absolute; bottom: 13.5%; left: 0; width: 96px;
  animation: sheepCross linear forwards;
}
@keyframes sheepCross { from { transform: translateX(calc(100cqw + 60px)); } to { transform: translateX(-130px); } }
.sheep-hop { animation: sheepHop ease-in-out forwards; }
@keyframes sheepHop {
  0%, 41% { transform: translateY(0) rotate(0); }
  46% { transform: translateY(-44px) rotate(7deg); }
  51% { transform: translateY(-48px) rotate(0); }
  56% { transform: translateY(0) rotate(-5deg); }
  60%, 100% { transform: translateY(0) rotate(0); }
}
.sheep { width: 96px; display: block; }
.sheep__legs { animation: sheepWalk 0.42s ease-in-out infinite alternate; transform-origin: 60px 56px; }
@keyframes sheepWalk { from { transform: translateY(0); } to { transform: translateY(-2.5px); } }
.sheep-count {
  position: relative; z-index: 5; margin: auto; text-align: center; display: flex;
  flex-direction: column; align-items: center; gap: 2px; pointer-events: none;
}
.sheep-count strong { font-size: clamp(56px, 12cqw, 96px); font-weight: 700; line-height: 1; color: #F6F2E8; text-shadow: 0 2px 22px rgba(0, 0, 0, 0.4); }
.sheep-count strong.pop { animation: sheepPop 0.5s ease; }
@keyframes sheepPop { 0% { transform: scale(1); } 35% { transform: scale(1.16); } 100% { transform: scale(1); } }
.sheep-count span { color: rgba(233, 237, 248, 0.75); font-size: 15px; }
.sheep-count em { font-style: normal; font-size: 12.5px; color: rgba(233, 237, 248, 0.5); margin-top: 6px; }
.sheep-wake { display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 14px; border-radius: var(--r-md); font-size: 14px; }
.sheep-wake > span:first-child { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); }
#sheep-wake-chips { display: inline-flex; gap: 6px; }

/* eyes */
.brk-stage--eyes { background: linear-gradient(180deg, #BFD3E2 0%, #E8E0CF 70%, #D9CDB4 100%); }
[data-theme="dark"] .brk-stage--eyes { background: linear-gradient(180deg, #16222E 0%, #2A2620 70%, #241D14 100%); }
.eyes-far { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; }
.eyes-dot { animation: eyesDot 2.4s ease-in-out infinite; }
@keyframes eyesDot { 0%, 100% { opacity: 0.55; } 50% { opacity: 1; } }
.eyes-guide {
  position: relative; z-index: 4; margin: auto auto 26px; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 0 16px;
}
.eyes-guide p { font-size: 16px; font-weight: 600; color: #FFF; text-shadow: 0 1px 10px rgba(0, 0, 0, 0.45); }
.eyes-ring { width: 72px; height: 72px; }
#eyes-sec { font-size: 26px; color: #FFF; text-shadow: 0 1px 10px rgba(0, 0, 0, 0.45); margin-top: -56px; margin-bottom: 18px; pointer-events: none; }
#eyes-blink-n { font-size: 26px; color: #FFF; text-shadow: 0 1px 10px rgba(0, 0, 0, 0.45); }
.eyes-blink { width: 110px; height: 66px; }
.eyes-blink__lid { animation: eyesBlink 0.9s ease-in-out infinite; transform-origin: center top; }
@keyframes eyesBlink { 0%, 55%, 100% { transform: scaleY(0); } 75% { transform: scaleY(1); } }
.eyes-done { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 17px; color: #FFF; text-shadow: 0 1px 10px rgba(0, 0, 0, 0.45); }
.brk-stage--stretch .eyes-done { color: var(--text); text-shadow: none; }
.brk-stage--chart { display: flex; }
.eyes-chart {
  margin: auto; text-align: center; font-weight: 700; letter-spacing: 0.14em; line-height: 1.7;
  color: var(--text); user-select: none; padding: 20px; will-change: filter;
}
.brk-stage--chart .brk-stage__hint { position: static; margin: 0 auto 18px; }

/* stretch */
.stretch-body { display: flex; flex-direction: column; flex: 1; padding: 6px 18px 24px; }
.stretch-intro, .stretch-step { margin: auto; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; max-width: 440px; }
.stretch-intro p { color: var(--text-2); }
.brk-fig { width: 132px; height: 132px; color: var(--accent); }
.brk-fig .mv { animation-duration: 2.6s; animation-timing-function: ease-in-out; animation-iteration-count: infinite; }
.brk-stage.paused .brk-fig .mv, .brk-stage.paused .sheep__legs { animation-play-state: paused; }
.brk-fig[data-ex="neck"] .mv { animation-name: brkNeck; animation-direction: alternate; }
@keyframes brkNeck { from { transform: rotate(-17deg); } to { transform: rotate(17deg); } }
.brk-fig[data-ex="shoulder"] .mv { animation-name: brkShoulder; animation-duration: 1.7s; }
@keyframes brkShoulder { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.brk-fig[data-ex="wrist"] .mv { animation-name: brkWrist; animation-direction: alternate; animation-duration: 1.8s; }
@keyframes brkWrist { from { transform: rotate(-22deg); } to { transform: rotate(24deg); } }
.brk-fig[data-ex="twist"] .mv { animation-name: brkTwist; animation-direction: alternate; }
@keyframes brkTwist { from { transform: rotate(-9deg); } to { transform: rotate(9deg); } }
.brk-fig[data-ex="chest"] .mv { animation-name: brkChest; }
@keyframes brkChest { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(-12deg); } }
.brk-fig[data-ex="reach"] .mv { animation-name: brkReach; animation-duration: 2.2s; }
@keyframes brkReach { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
.stretch-step h3 { font-size: 20px; }
.stretch-step p { color: var(--text-2); font-size: 14.5px; line-height: 1.5; }
.stretch-dots { display: flex; gap: 7px; margin-bottom: 4px; }
.stretch-dots i { width: 9px; height: 9px; border-radius: 50%; background-color: var(--border); }
.stretch-dots i.done { background-color: var(--accent); opacity: 0.45; }
.stretch-dots i.now { background-color: var(--accent); transform: scale(1.25); }
.stretch-prog { width: 100%; max-width: 300px; height: 7px; border-radius: 99px; background-color: var(--border); overflow: hidden; }
.stretch-prog span { display: block; height: 100%; width: 0; border-radius: 99px; background-color: var(--accent); transition: width 0.2s linear; }
.stretch-step strong { font-size: 26px; }

/* break suggest (sau phien tap trung) */
.brk-suggest {
  position: fixed; z-index: 60; left: 50%; bottom: 86px; transform: translateX(-50%);
  width: min(94vw, 520px); padding: 14px 16px; border-radius: var(--r-lg);
  display: flex; flex-direction: column; gap: 10px; animation: brkSuggestIn 0.35s ease;
  border: 1px solid var(--border); box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}
@keyframes brkSuggestIn { from { opacity: 0; transform: translate(-50%, 14px); } to { opacity: 1; transform: translate(-50%, 0); } }
.brk-suggest__txt { display: flex; flex-direction: column; gap: 2px; }
.brk-suggest__txt span { color: var(--text-2); font-size: 13px; }
.brk-suggest__btns { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.brk-suggest__btns .chip { display: inline-flex; align-items: center; gap: 5px; }
.brk-suggest__close {
  margin-left: auto; border: none; background: none; color: var(--text-3); cursor: pointer;
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
}
.brk-suggest__close:hover { color: var(--text); background-color: var(--surface-2); }

@media (max-width: 700px) {
  .brk-stage { min-height: 62vh; }
  .sheep-fence { bottom: 12%; }
  .brk-suggest { bottom: 128px; }
}

/* ---------- tien ich ---------- */
.tool-head { display: flex; align-items: center; gap: 14px; margin-bottom: 6px; }
.tool-head .page-title { margin: 0; }
.field-card { padding: 18px; border-radius: var(--r-lg); display: flex; flex-direction: column; gap: 14px; width: 100%; max-width: 720px; }
.field-card .btn { align-self: flex-start; }
.field-card input[type="file"] { max-width: 100%; }
.tool-tabs { margin-bottom: 16px; }
.counter-list { list-style: none; padding: 0; margin: 18px 0 0; display: flex; flex-direction: column; gap: 10px; max-width: 560px; }
.counter-row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: var(--r-md); }
.counter-row__txt { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
.counter-row__txt strong { font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.counter-row__txt span { color: var(--text-3); font-size: 12.5px; }
.counter-row__n { font-style: normal; font-weight: 700; color: var(--accent); white-space: nowrap; }
.counter-row__n--future { color: var(--text-2); }
.qr-out { margin-top: 16px; padding: 20px; border-radius: var(--r-lg); display: flex; flex-direction: column; align-items: center; gap: 6px; max-width: 560px; }
.qr-out img { border-radius: 12px; background-color: #FFF; padding: 8px; max-width: min(320px, 80vw); height: auto; }
.split-big { font-size: 17px; }
.split-big strong { font-size: 24px; color: var(--accent); }
.wc-area {
  width: 100%; border: 1.5px solid var(--border); border-radius: var(--r-md);
  background-color: var(--surface); color: var(--text); padding: 12px 14px;
  font: inherit; font-size: 14.5px; resize: vertical; min-height: 160px;
}
.wc-area:focus { outline: none; border-color: var(--accent); }
.wc-stats { display: flex; gap: 10px; flex-wrap: wrap; }
.wc-stat {
  padding: 10px 16px; border-radius: var(--r-md); display: flex; flex-direction: column;
  align-items: center; gap: 1px; min-width: 86px;
}
.wc-stat strong { font-size: 19px; }
.wc-stat span { color: var(--text-3); font-size: 12px; }
.field input[type="date"], .field input[type="number"], .field input[type="file"] {
  border: 1.5px solid var(--border); border-radius: var(--r-md); background-color: var(--surface);
  color: var(--text); padding: 10px 12px; font: inherit; font-size: 14.5px; min-height: 44px;
}
.field input[type="date"]:focus, .field input[type="number"]:focus { outline: none; border-color: var(--accent); }
.field--inline input[type="number"] { width: auto; }

/* ---------- goc tim ---------- */
.love-setup { align-items: flex-start; }
.love-setup p { color: var(--text-2); line-height: 1.55; max-width: 52ch; }
.couple-stage {
  margin-top: 6px; padding: 34px 22px 22px; border-radius: var(--r-lg);
  display: flex; flex-direction: column; align-items: center; gap: 20px; text-align: center;
}
.couple-heart {
  border: none; cursor: pointer; background: none; color: #FF5C7A;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 22px 30px; border-radius: 26px; background-color: rgba(255, 92, 122, 0.1);
  transition: transform 0.15s ease, background-color 0.15s ease;
}
.couple-heart:hover { background-color: rgba(255, 92, 122, 0.18); }
.couple-heart:active { transform: scale(0.94); }
.couple-heart.pulse { animation: cpPulse 0.45s ease; }
@keyframes cpPulse { 0% { transform: scale(1); } 35% { transform: scale(1.12); } 100% { transform: scale(1); } }
.couple-heart span { font-weight: 700; font-size: 15px; color: var(--text); }
.couple-heart--sm { padding: 14px 22px; }
.couple-heart--sm span { font-size: 18px; }
.couple-stats { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.fly-heart {
  position: fixed; z-index: 90; color: #FF5C7A; pointer-events: none;
  animation: flyHeart 1.2s ease-out forwards;
}
@keyframes flyHeart {
  from { transform: translate(0, 0) scale(0.7); opacity: 0.95; }
  to { transform: translate(var(--dx, 0px), -160px) scale(1.25); opacity: 0; }
}
.crush-stage {
  margin-top: 6px; padding: 26px 22px; border-radius: var(--r-lg);
  display: flex; flex-direction: column; align-items: center; gap: 18px; text-align: center;
}
.crush-frame {
  position: relative; background-color: #FDF9F2; padding: 14px 14px 44px; border-radius: 10px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.3); transform: rotate(-2deg); max-width: min(340px, 84vw);
}
.crush-frame img { width: 100%; aspect-ratio: 4/5; object-fit: cover; border-radius: 6px; display: block; background-color: #EAE2D5; }
.crush-frame.beat { animation: crushBeat 0.4s ease; }
@keyframes crushBeat { 0% { transform: rotate(-2deg) scale(1); } 35% { transform: rotate(-2deg) scale(1.04); } 100% { transform: rotate(-2deg) scale(1); } }
.crush-days {
  position: absolute; left: 0; right: 0; bottom: 12px; text-align: center;
  color: #6B5A4C; font-size: 14px; font-weight: 600;
}

/* ---------- chung tan so (nghe chung) ---------- */
.tg-room { padding: 22px; border-radius: var(--r-lg); display: flex; flex-direction: column; gap: 16px; max-width: 640px; }
.tg-room__head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.tg-room__head strong { font-size: 17px; }
.tg-badge {
  font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
  padding: 4px 10px; border-radius: 99px; background-color: var(--accent); color: var(--on-accent);
}
.tg-code {
  margin-left: auto; font-size: 13px; padding: 4px 10px; border-radius: 8px;
  background-color: var(--surface-2); color: var(--text-2); letter-spacing: 0.08em;
}
.tg-hint { color: var(--text-2); font-size: 14.5px; }
.tg-hint strong { color: var(--text); }
.tg-members { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------- o cua nho (wall) ---------- */
.wall-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 12px 14px; border-radius: var(--r-md); margin-bottom: 14px; }
.wall-bar__spacer { flex: 1; }
.wall-mini-toggle { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); cursor: pointer; }
.wall-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.wall-item { border-radius: var(--r-md); overflow: hidden; display: flex; flex-direction: column; border: 1px solid var(--border); }
.wall-item img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; background-color: var(--surface-2); }
.wall-note { padding: 18px 14px; font-size: 15px; line-height: 1.5; min-height: 96px; display: flex; align-items: center; }
.wall-count { padding: 18px 14px; min-height: 96px; display: flex; flex-direction: column; justify-content: center; gap: 4px; }
.wall-count strong { font-size: 20px; color: var(--accent); }
.wall-count span { color: var(--text-2); font-size: 13px; }
.wall-item__meta {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 8px 10px; font-size: 12px; color: var(--text-3); border-top: 1px solid var(--border);
}
.wall-item__acts { display: inline-flex; gap: 4px; }
.wall-heart, .wall-del {
  border: none; background: none; cursor: pointer; color: var(--text-3);
  display: inline-flex; align-items: center; gap: 3px; padding: 5px 7px; border-radius: 8px; font-size: 12px;
}
.wall-heart:hover { color: #FF5C7A; background-color: rgba(255, 92, 122, 0.12); }
.wall-del:hover { color: var(--text); background-color: var(--surface-2); }

/* o cua noi goc man hinh */
#wall-mini {
  position: fixed; right: 16px; bottom: 96px; z-index: 55; width: 148px;
  border: 1px solid var(--border); border-radius: 16px; overflow: hidden; cursor: pointer;
  padding: 0; text-align: left; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.28);
  transition: transform 0.18s ease;
}
#wall-mini:hover { transform: translateY(-3px); }
#wall-mini.pop { animation: wallPop 0.6s ease; }
@keyframes wallPop { 0% { transform: scale(0.8); } 45% { transform: scale(1.08); } 100% { transform: scale(1); } }
#wall-mini img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.wall-mini__txt { display: block; padding: 14px 12px 6px; font-size: 13px; line-height: 1.45; color: var(--text); min-height: 62px; }
.wall-mini__who {
  display: block; padding: 5px 12px 9px; font-size: 11px; color: var(--text-3);
}
@media (max-width: 700px) { #wall-mini { bottom: 140px; width: 124px; } }

/* ---------- bang viec chung ---------- */
.bd-chips { margin-bottom: 16px; }
.snote__who {
  position: absolute; left: 10px; bottom: 6px; font-size: 10.5px; color: rgba(43, 33, 24, 0.55);
  max-width: 80%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.bd-foot { margin-top: 18px; }
.bd-history {
  list-style: none; margin: 0; padding: 12px 16px; border-radius: var(--r-md);
  display: flex; flex-direction: column; gap: 7px; max-width: 560px;
}
.bd-history li { font-size: 13px; color: var(--text-2); }
.bd-history li strong { color: var(--text); }
.bd-history li em { font-style: normal; color: var(--text-3); font-size: 11.5px; margin-left: 4px; }

/* ---------- nut quay lai / toan man hinh: chi con icon (moi man hinh) ---------- */
.tool-head .btn--ghost.btn--sm, .brk-stage__bar .btn--ghost.btn--sm {
  font-size: 0; gap: 0; padding: 0; width: 40px; height: 40px; min-height: 40px;
  border-radius: 50%; justify-content: center; line-height: 0;
}
.tool-head .btn--ghost.btn--sm .ic, .brk-stage__bar .btn--ghost.btn--sm .ic { margin: 0; }

/* ---------- goi y nut menu tren mobile (chay 3 nhip, biet roi thi thoi) ---------- */
@media (max-width: 860px) {
  body:not(.menu-known) #btn-menu { position: relative; }
  body:not(.menu-known) #btn-menu::after {
    content: ''; position: absolute; inset: -3px; border-radius: 14px;
    border: 2px solid var(--accent); opacity: 0; pointer-events: none;
    animation: menuPing 2.2s ease-out 1.2s 3;
  }
  body:not(.menu-known) #btn-menu .ic {
    animation: menuWiggle 2.2s ease 1.2s 3;
  }
}
@keyframes menuPing {
  0% { transform: scale(0.75); opacity: 0.85; }
  60% { transform: scale(1.28); opacity: 0; }
  100% { transform: scale(1.28); opacity: 0; }
}
@keyframes menuWiggle {
  0%, 30%, 100% { transform: none; }
  6% { transform: rotate(-9deg) scale(1.08); }
  14% { transform: rotate(8deg) scale(1.08); }
  22% { transform: rotate(-5deg); }
}
@media (prefers-reduced-motion: reduce) {
  #btn-menu::after, #btn-menu .ic { animation: none !important; }
}

/* ---------- man hinh Song nhac ---------- */
.viz-stage {
  position: relative; border-radius: var(--r-lg); overflow: hidden;
  height: calc(100vh - 210px); min-height: 380px; display: flex; flex-direction: column;
  background-color: rgba(10, 8, 6, 0.55);
}
.viz-stage:fullscreen { border-radius: 0; height: 100vh; background-color: #0A0806; }
/* full-man gia cho iOS (Fullscreen API khong ho tro div tren iPhone) */
.viz-stage.viz-faux {
  position: fixed; inset: 0; z-index: 100;
  border-radius: 0; height: 100vh; height: 100dvh; width: 100vw;
  background-color: #0A0806; margin: 0;
}
body.viz-locked { overflow: hidden; }
body.viz-locked .playerbar, body.viz-locked .chrome-btn { display: none; }
#viz-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.viz-empty {
  position: absolute; inset: 0; z-index: 3; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 14px; text-align: center; padding: 0 20px;
}
.viz-empty p { color: rgba(255, 248, 238, 0.8); font-size: 15px; }
.viz-meta {
  position: absolute; left: 0; right: 0; bottom: 76px; z-index: 2; text-align: center;
  display: flex; flex-direction: column; gap: 3px; pointer-events: none; padding: 0 16px;
}
.viz-meta strong { color: #FFF6EA; font-size: clamp(17px, 3.4vw, 24px); text-shadow: 0 1px 12px rgba(0, 0, 0, 0.6); }
.viz-meta span { color: rgba(255, 246, 234, 0.65); font-size: 13px; text-shadow: 0 1px 8px rgba(0, 0, 0, 0.6); }
.viz-ui {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 4;
  display: flex; align-items: center; gap: 10px; padding: 12px 14px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.45));
  transition: opacity 0.25s ease;
}
.viz-styles { flex: 1; overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
.viz-styles::-webkit-scrollbar { display: none; }
.viz-styles .chip { white-space: nowrap; flex: none; }
.viz-stage.viz-hideui .viz-ui { opacity: 0; pointer-events: none; }
.viz-stage.viz-hideui .viz-meta { bottom: 28px; }

/* nut dong widget zen */
.zen-widgets { position: relative; }
.zw-close {
  position: absolute; top: 6px; right: 6px; width: 30px; height: 30px;
  border: none; background: none; color: var(--text-3); cursor: pointer;
  border-radius: 50%; display: grid; place-items: center; opacity: 0.55;
}
.zw-close:hover { opacity: 1; background-color: var(--surface-2); color: var(--text); }

/* ---------- .hidden (truoc gio thieu dinh nghia - fix moi cho dung class nay) ---------- */
.hidden { display: none !important; }

/* goi y phat o man Song nhac: tu mo sau 3s */
.viz-empty { transition: opacity 0.7s ease; }
.viz-empty.faded { opacity: 0; pointer-events: none; }

/* ---------- ru ngu ---------- */
.sleep-stage {
  position: relative; border-radius: var(--r-lg); overflow: hidden;
  height: calc(100vh - 200px); min-height: 420px;
  background-color: #050403; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 10px; text-align: center;
  transition: background 3s ease;
}
.sleep-stage.dawn { background: linear-gradient(180deg, #2A1E33 0%, #6E3A44 55%, #C4763F 100%); }
.slp-clock { font-size: clamp(56px, 14vw, 110px); font-weight: 300; color: rgba(255, 244, 226, 0.32); letter-spacing: 0.04em; }
.sleep-stage.dawn .slp-clock { color: rgba(255, 244, 226, 0.75); }
.slp-info { color: rgba(255, 244, 226, 0.22); font-size: 13px; }
.sleep-stage.dawn .slp-info { color: rgba(255, 244, 226, 0.6); }
.slp-awake { position: absolute; left: 0; right: 0; bottom: 26%; }
.slp-awake .btn { opacity: 0.5; }
.slp-dawnui { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.slp-dawnui p { color: rgba(255, 248, 235, 0.85); font-size: 16px; }
.slp-controls {
  position: absolute; left: 0; right: 0; bottom: 18px; display: flex; justify-content: center;
  opacity: 0; transition: opacity 0.4s ease; pointer-events: none;
}
.sleep-stage.show-ui .slp-controls { opacity: 0.75; pointer-events: auto; }

/* ---------- viz layout v2: dieu khien nam DUOI vung song o che do thuong ---------- */
.viz-wave { position: relative; flex: 1; min-height: 0; }
.viz-wave #viz-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.viz-stage .viz-ui {
  position: static; background: none; padding: 12px 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.viz-stage:fullscreen .viz-ui, .viz-stage.viz-faux .viz-ui {
  position: absolute; left: 0; right: 0; bottom: 0;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.45));
  border-top: none; padding-bottom: max(12px, env(safe-area-inset-bottom));
}
.viz-stage .viz-meta { bottom: 14px; }
.viz-stage:fullscreen .viz-meta, .viz-stage.viz-faux .viz-meta { bottom: 84px; }
.viz-stage:fullscreen.viz-hideui .viz-meta, .viz-stage.viz-faux.viz-hideui .viz-meta { bottom: 32px; }

/* ---------- popover tron tieng on tren thanh phat ---------- */
.noise-pop {
  position: fixed; right: 14px; bottom: 92px; z-index: 70;
  width: min(330px, calc(100vw - 24px)); padding: 14px 16px;
  border-radius: var(--r-lg); border: 1px solid var(--border);
  box-shadow: 0 14px 44px rgba(0, 0, 0, 0.3);
}
.noise-pop__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.noise-pop__head strong { font-size: 14px; }
.noise-pop .amb-row { padding: 5px 0; }
.pb-btn--on { color: var(--accent); position: relative; }
.pb-btn--on::after {
  content: ''; position: absolute; top: 7px; right: 7px; width: 7px; height: 7px;
  border-radius: 50%; background-color: var(--accent);
}
@media (max-width: 700px) { .noise-pop { bottom: 132px; right: 8px; } }

/* ---------- nut noi khoi: bam vao lun xuong nhu nut that, bo cong pill thong nhat ---------- */
.btn { transition: background 150ms ease-out, transform 110ms ease-out, box-shadow 110ms ease-out; }
.btn--primary {
  box-shadow: 0 3px 0 rgba(60, 30, 8, 0.35), 0 5px 14px rgba(0, 0, 0, 0.16);
}
.btn--primary:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 rgba(60, 30, 8, 0.35), 0 2px 5px rgba(0, 0, 0, 0.12);
}
.btn--ghost {
  background-color: var(--surface);
  box-shadow: 0 2px 0 var(--border), 0 3px 9px rgba(0, 0, 0, 0.07);
}
.btn--ghost:active {
  transform: translateY(1.5px);
  box-shadow: 0 0.5px 0 var(--border), 0 1px 3px rgba(0, 0, 0, 0.06);
}
.chip {
  box-shadow: 0 2px 0 var(--border);
  transition: background 140ms ease-out, color 140ms ease-out, transform 100ms ease-out, box-shadow 100ms ease-out;
}
.chip:active { transform: translateY(1.5px); box-shadow: 0 0.5px 0 var(--border); }
.chip.active { box-shadow: 0 2px 0 rgba(60, 30, 8, 0.3); }
.pb-btn--main { box-shadow: 0 3px 0 rgba(60, 30, 8, 0.35), 0 4px 10px rgba(0, 0, 0, 0.18); }
.pb-btn--main:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(60, 30, 8, 0.35); }
.pb-btn:not(.pb-btn--main):active { transform: scale(0.9); }

/* viz ui 2 hang: nguon + fullscreen tren, kieu song duoi */
.viz-ui { display: flex; flex-direction: column; gap: 10px; }
.viz-ui__row { display: flex; align-items: center; gap: 10px; justify-content: space-between; }
.viz-ui__row .chip-row { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.viz-src .seg__btn { gap: 6px; }
/* mobile: source thanh cong tac icon, style thanh icon can giua khong can vuot, full-man icon */
@media (max-width: 860px) {
  .viz-src .seg__btn span, #viz-full span { display: none; }
  #viz-full { padding: 10px 13px; }
  .viz-styles { flex: none; justify-content: center; flex-wrap: wrap; overflow: visible; gap: 8px; }
  .viz-styles .chip span { display: none; }
  .viz-styles .chip { padding: 10px 13px; }
  .viz-ui__row { justify-content: space-between; }
}

/* tong ket tieng dem trong man sang day */
.slp-night { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.slp-night__sum { color: rgba(255, 248, 235, 0.75); font-size: 13.5px; max-width: 46ch; }
#slp-night-canvas { opacity: 0.9; border-radius: 6px; }

/* =========================================================================
   Nut kim loai noi khoi (goc nhin tu tren xuong): dung cho dieu khien man
   Song nhac + cac che do nghi (ngam canh, dem cuu...). Nen dam, chu trang,
   canh tren sang - canh duoi toi, bam vao lun xuong nhu nut that.
   ========================================================================= */
.metal-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 42px; font-weight: 700; font-size: 14px; line-height: 1;
  color: #F1EADF; text-decoration: none; cursor: pointer; border: none;
  background: linear-gradient(180deg, #3C3A35 0%, #2A2823 52%, #211F1A 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    inset 0 -1px 0 rgba(0, 0, 0, 0.42),
    0 3px 0 #100F0C,
    0 5px 12px rgba(0, 0, 0, 0.42);
  transition: transform 110ms ease-out, box-shadow 110ms ease-out, background 140ms ease-out;
}
.metal-btn:hover { color: #FFF; background: linear-gradient(180deg, #45423A 0%, #302E28 55%, #26241F 100%); }
.metal-btn:active {
  transform: translateY(2px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    inset 0 -1px 0 rgba(0, 0, 0, 0.35),
    0 1px 0 #100F0C,
    0 2px 5px rgba(0, 0, 0, 0.35);
}
.metal-btn .ic { stroke-width: 2.2; }
.metal-btn--round { width: 42px; height: 42px; border-radius: 50%; padding: 0; }
.metal-btn--pill { padding: 9px 16px; border-radius: 999px; }

/* Bien the "dang bat" (accent) - cung phong cach kim loai nhung anh dong */
.metal-btn.is-on, .viz-ui .chip.active {
  color: #FFF;
  background: linear-gradient(180deg, #CE7040 0%, #B15A2C 52%, #9C4A20 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.32),
    inset 0 -1px 0 rgba(0, 0, 0, 0.32),
    0 3px 0 #54250F,
    0 5px 12px rgba(0, 0, 0, 0.42);
}

/* ---- Deck dieu khien man Song nhac: nen dam dac, tach khoi vung song ---- */
.viz-stage .viz-ui {
  position: static;
  background: linear-gradient(180deg, #201D19 0%, #14110D 100%);
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  padding: 12px 12px 14px;
}
.viz-stage:fullscreen .viz-ui {
  position: absolute; left: 0; right: 0; bottom: 0; border-top: none;
  background: linear-gradient(180deg, rgba(18, 15, 11, 0) 0%, rgba(18, 15, 11, 0.9) 60%);
}
/* Nut chip trong deck: kim loai toi, chu sang de doc */
.viz-ui .chip {
  border: none; color: #EBE3D7;
  background: linear-gradient(180deg, #3C3A35 0%, #2A2823 52%, #242219 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.15),
    inset 0 -1px 0 rgba(0, 0, 0, 0.4),
    0 3px 0 #100F0C,
    0 5px 11px rgba(0, 0, 0, 0.4);
  transition: transform 110ms ease-out, box-shadow 110ms ease-out, background 140ms ease-out, color 140ms ease-out;
}
.viz-ui .chip:hover { color: #FFF; background: linear-gradient(180deg, #45423A 0%, #302E28 55%, #26241F 100%); }
.viz-ui .chip:active {
  transform: translateY(2px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 1px 0 #100F0C, 0 2px 5px rgba(0, 0, 0, 0.35);
}

/* ---- Thanh dieu khien che do nghi: tu an trong toan man hinh ---- */
.brk-stage__bar { transition: opacity 0.3s ease; }
.brk-stage.brk-hideui .brk-stage__bar { opacity: 0; pointer-events: none; }

/* =========================================================================
   Sidebar gon: 2 nhom lon (Cho quan / Van phong) co the xo - thu.
   ========================================================================= */
.nav__item--top { font-weight: 600; }
.nav__grp { display: flex; flex-direction: column; margin-top: 2px; }
.nav__grphead {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 10px 12px; border-radius: var(--radius-sm);
  color: var(--text-2); font-weight: 700; font-size: 12px;
  letter-spacing: 0.03em; text-transform: uppercase;
  background: none; border: none; cursor: pointer; text-align: left;
  transition: background 150ms ease-out, color 150ms ease-out;
}
.nav__grphead:hover { background: var(--surface-2); color: var(--text); }
.nav__grpicon { flex-shrink: 0; opacity: 0.85; }
.nav__grphead > span { flex: 1; }
.nav__chev { flex-shrink: 0; opacity: 0.6; transition: transform 220ms ease; }
.nav__grphead[aria-expanded="false"] .nav__chev { transform: rotate(-90deg); }
.nav__sub {
  display: flex; flex-direction: column; gap: 2px;
  overflow: hidden; max-height: 520px; padding-left: 8px;
  transition: max-height 260ms ease, opacity 200ms ease;
}
.nav__grphead[aria-expanded="false"] + .nav__sub { max-height: 0; opacity: 0; }
.nav__sub .nav__item { font-size: 14px; }

/* =========================================================================
   Popup gioi thieu lan dau: 3 uu diem, bam Hide la xong.
   ========================================================================= */
.intro-ov {
  position: fixed; inset: 0; z-index: 200; display: grid; place-items: center;
  padding: 20px; background: rgba(10, 8, 6, 0.55);
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
}
.intro-card {
  width: min(420px, 100%); border-radius: var(--r-lg); padding: 26px 22px 22px;
  background: var(--surface-solid); box-shadow: 0 24px 64px rgba(0, 0, 0, 0.4);
  text-align: center; animation: introPop 0.28s ease-out;
}
@keyframes introPop { from { transform: translateY(16px) scale(0.97); opacity: 0; } }
.intro-card__logo {
  width: 56px; height: 56px; border-radius: 17px; display: grid; place-items: center;
  margin: 0 auto 12px; background: var(--accent); color: #fff;
}
.intro-card h2 { font-size: 21px; font-weight: 800; color: var(--text); }
.intro-card__sub { color: var(--text-2); font-size: 14px; margin-top: 4px; }
.intro-benes { display: flex; flex-direction: column; gap: 12px; margin: 20px 0; text-align: left; }
.intro-bene { display: flex; gap: 12px; align-items: flex-start; }
.intro-bene__ic {
  flex-shrink: 0; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  background: var(--surface-2); color: var(--accent);
}
.intro-bene strong { display: block; font-size: 14.5px; color: var(--text); }
.intro-bene span { color: var(--text-2); font-size: 13px; line-height: 1.4; }
.intro-card .btn { width: 100%; justify-content: center; }

/* =========================================================================
   Home = player hero: nut Play to dung + prev/next, dap thang vao mat.
   ========================================================================= */
.home-hero { position: relative; }
.home-player {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  gap: 3px; padding: 26px 18px 24px; margin-bottom: 22px;
  /* chua khoang cho dong "Nhac theo khung gio" luon lo ra duoi tam nhin */
  min-height: min(60vh, calc(100dvh - 170px));
  border-radius: var(--r-lg); background: var(--surface);
  box-shadow: 0 2px 0 var(--border), 0 10px 30px rgba(0, 0, 0, 0.08);
  touch-action: pan-y;
}
.home-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 16px; min-height: 40px; border-radius: 999px;
  font-size: 13px; font-weight: 600; color: var(--text-2);
  background: var(--surface-2); border: 1px solid var(--border);
  transition: color 140ms, background 140ms, transform 100ms;
}
.home-chip:hover { color: var(--text); }
.home-chip:active { transform: translateY(1px); }
.home-player__gesture { opacity: 0.75; margin-top: 20px; }
.home-player__focus { margin-top: 26px; }
.home-player__greet { color: var(--text-2); font-size: 13px; }
.home-player__now {
  font-size: 22px; font-weight: 800; color: var(--text); max-width: 30ch;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.home-player__sub { color: var(--text-2); font-size: 14px; }
.home-player__controls { display: flex; align-items: center; gap: 26px; margin-top: 26px; }
.home-play-side {
  width: 60px; height: 60px; border-radius: 50%; display: grid; place-items: center;
  color: var(--text); background: var(--surface-solid);
  box-shadow: 0 2px 0 var(--border), 0 4px 12px rgba(0, 0, 0, 0.12);
  transition: transform 110ms ease-out, box-shadow 110ms ease-out, background 140ms;
}
.home-play-side:hover { background: var(--surface-2); }
.home-play-side:active { transform: translateY(2px); box-shadow: 0 0.5px 0 var(--border); }
.home-play-main {
  width: 104px; height: 104px; border-radius: 50%; display: grid; place-items: center;
  color: #fff; background: var(--accent);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.25), 0 4px 0 var(--accent-hover), 0 8px 20px rgba(0, 0, 0, 0.25);
  transition: transform 110ms ease-out, box-shadow 110ms ease-out, background 140ms;
}
.home-play-main:hover { background: var(--accent-hover); }
.home-play-main:active { transform: translateY(3px); box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.2), 0 1px 0 var(--accent-hover), 0 3px 8px rgba(0, 0, 0, 0.2); }
.home-play-main .ic { margin-left: 2px; }
.home-play-main[data-playing="1"] .ic { margin-left: 0; }

/* ---- Song nhac trong che do tap trung (tuy chon, mac dinh tat) ---- */
.focus-viz-wrap {
  margin: 10px 0 6px; border-radius: var(--r-lg); overflow: hidden;
  height: clamp(120px, 22vh, 220px); background: rgba(10, 8, 6, 0.35);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.focus-viz-wrap canvas { display: block; width: 100%; height: 100%; }
.btn--ghost.is-on { color: var(--accent); border-color: var(--accent); }

/* =========================================================================
   Brand logo (anh) + nut thu/mo menu + doi sang-toi goc tren phai.
   ========================================================================= */
.brand__logo { background: transparent; }
.brand__logo img { width: 36px; height: 36px; border-radius: 10px; object-fit: cover; display: block; }
.brand__collapse { width: 34px; height: 34px; flex-shrink: 0; color: var(--text-2); }
.brand__collapse:hover { color: var(--accent); }

.chrome-btn {
  position: fixed; z-index: 55; width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer;
  color: var(--text-2); background: var(--surface-solid);
  border: 1px solid var(--border); box-shadow: 0 2px 12px rgba(0, 0, 0, 0.14);
  transition: color 150ms ease-out, background 150ms ease-out, transform 110ms ease-out;
}
.chrome-btn:hover { color: var(--accent); }
.chrome-btn:active { transform: scale(0.94); }
.chrome-btn--theme { top: 14px; right: 18px; }
.chrome-btn--rail { top: 14px; left: 14px; display: none; }

/* Desktop: cho phep thu gon sidebar; nut rail hien khi da thu gon */
@media (min-width: 861px) {
  .sidebar { transition: width 0.22s ease, opacity 0.18s ease, padding 0.22s ease; }
  body.nav-collapsed .sidebar {
    width: 0; min-width: 0; padding-left: 0; padding-right: 0;
    opacity: 0; pointer-events: none; overflow: hidden; border-right: none;
  }
  body.nav-collapsed .chrome-btn--rail { display: grid; }
}
/* Nut sang/toi: desktop nam trong thanh phat (khoi vuong goc), mobile o topbar */
.pb-btn--theme { display: none; }
@media (min-width: 861px) {
  .pb-btn--theme { display: grid; }
  .chrome-btn--theme { display: none; }
}
/* Mobile: nut toan man hinh (home + tap trung + ghi chu) can guong voi nut menu trai topbar */
@media (max-width: 860px) {
  body:not(.zen) .zen-toggle {
    top: 20px; right: 16px; width: 44px; height: 44px;
    background: none; box-shadow: none; border: none;
    backdrop-filter: none; -webkit-backdrop-filter: none;
  }
  body:not(.zen) .zen-toggle::before { display: none; }
}
/* Mobile: da co topbar (menu + sang/toi) nen an chrome noi */
@media (max-width: 860px) {
  .chrome-btn { display: none !important; }
  .brand__collapse { display: none; }
}
body.zen .chrome-btn { display: none; }

/* nut chon vai tro trong man chao lan dau */
.ob-btns { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.ob-skip { border: none; background: none; color: var(--text-3); font-size: 13px; cursor: pointer; padding: 9px; min-height: 40px; }
.ob-skip:hover { color: var(--text); }

/* mobile: can giua thoi luong + nut bat dau phien tap trung */
@media (max-width: 700px) {
  #focus-durations { justify-content: center; }
  .zen-card #focus-start { display: flex; margin-left: auto; margin-right: auto; }
  .home-player { min-height: 72vh; }
}
/* desktop: bo nut toan man hinh (zen) o home - van phong to duoc bang nhan dup */
@media (min-width: 861px) {
  .home-hero .zen-toggle { display: none; }
}

/* ---------- the "Them vao man hinh chinh" trong Cai dat ---------- */
.install-card { border: 1px solid var(--accent); background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 12%, var(--surface)), var(--surface)); }
.install-card__row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.install-card__icon { color: var(--accent); flex: none; }
.install-card__body { flex: 1; min-width: 180px; display: flex; flex-direction: column; gap: 2px; }
.install-card__body strong { font-size: 15px; }
.install-card__body span { color: var(--text-2); font-size: 13.5px; line-height: 1.45; }

/* ---------- o cua nho: bang anh treo tu do ---------- */
.wall-board {
  position: relative; min-height: 72vh; margin-top: 6px;
  border-radius: var(--r-lg); overflow: hidden;
  background:
    radial-gradient(circle at 30% 20%, rgba(255,255,255,0.04), transparent 60%),
    var(--surface);
  border: 1px solid var(--border);
  touch-action: none;
}
.wall-board__empty { position: absolute; top: 50%; left: 0; right: 0; transform: translateY(-50%); text-align: center; }
.wall-pin {
  position: absolute; width: min(46vw, 210px); transform: rotate(var(--rot, 0deg));
  cursor: grab; user-select: none; transition: box-shadow 0.15s ease, transform 0.1s ease;
}
.wall-pin--drag { cursor: grabbing; z-index: 20; transform: rotate(0deg) scale(1.03); }
.wall-pin--note { width: min(42vw, 180px); }
.wall-pin__nail {
  position: absolute; top: -6px; left: 50%; width: 10px; height: 10px; margin-left: -5px;
  border-radius: 50%; background: radial-gradient(circle at 35% 30%, #c9b48a, #7a6338);
  box-shadow: 0 1px 2px rgba(0,0,0,0.4); z-index: 2;
}
.wall-frame {
  background: #FCFAF4; padding: 9px 9px 12px; border-radius: 3px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.32), inset 0 0 0 1px rgba(0,0,0,0.06);
}
.wall-pin--photo .wall-frame { padding: 9px 9px 26px; }
.wall-frame img { width: 100%; display: block; border-radius: 2px; background: #eae2d5; pointer-events: none; }
.wall-note {
  font-size: 15px; line-height: 1.45; color: #4a3f30; min-height: 70px;
  display: flex; align-items: center; justify-content: center; text-align: center; padding: 6px;
}
.wall-count { text-align: center; padding: 10px 6px; }
.wall-count strong { display: block; font-size: 22px; color: #b4552e; }
.wall-count span { color: #6b5a4c; font-size: 13px; }
.wall-pin__meta {
  display: flex; align-items: center; gap: 6px; justify-content: center;
  margin-top: 5px; font-size: 11px; color: var(--text-3);
}
.wall-pin__who { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 60%; }
.wall-heart, .wall-del {
  border: none; background: none; cursor: pointer; color: var(--text-3);
  display: inline-flex; align-items: center; gap: 2px; padding: 4px; border-radius: 6px; font-size: 11px;
}
.wall-heart:hover { color: #FF5C7A; }
.wall-del:hover { color: var(--text); }

/* xem anh full man */
.wall-lightbox {
  position: fixed; inset: 0; z-index: 130; background: rgba(0,0,0,0.9);
  display: grid; place-items: center; padding: 20px; cursor: zoom-out;
  animation: obIn 0.25s ease;
}
.wall-lightbox img { max-width: 100%; max-height: 92vh; border-radius: 6px; box-shadow: 0 10px 40px rgba(0,0,0,0.5); }
.wall-lightbox__close {
  position: absolute; top: 16px; right: 16px; width: 44px; height: 44px; border-radius: 50%;
  border: none; background: rgba(255,255,255,0.14); color: #fff; display: grid; place-items: center; cursor: pointer;
}

/* modal hien link de gui */
.link-modal {
  position: fixed; inset: 0; z-index: 130; background: rgba(14,9,5,0.5);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  display: grid; place-items: center; padding: 20px; animation: obIn 0.28s ease;
}
.link-modal__card {
  width: min(440px, 100%); padding: 22px; border-radius: var(--r-lg); border: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 14px; text-align: center;
}
.link-modal__input {
  width: 100%; border: 1.5px solid var(--border); border-radius: var(--r-md);
  background: var(--surface); color: var(--text); padding: 12px 14px; font-size: 14px; text-align: center;
}
.link-modal__btns { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }

/* o cua nho full-man: an chrome, anh to hon */
body.wall-full .playerbar, body.wall-full .topbar, body.wall-full .sidebar, body.wall-full .chrome-btn { display: none; }
body.wall-full .main { padding: 8px 10px calc(var(--playerbar-h, 0px) + 8px); }
body.wall-full .wall-board { min-height: calc(100dvh - 120px); }
body.wall-full .wall-pin { width: min(40vw, 260px); }

/* ---------- ngu dem: full-man den xi, van co dong ho ---------- */
body.sleeping .sidebar, body.sleeping .playerbar, body.sleeping .topbar,
body.sleeping .scrim, body.sleeping .chrome-btn, body.sleeping .scene { display: none; }
body.sleeping .main { padding: 0; }
.sleep-stage {
  position: fixed; inset: 0; z-index: 150; min-height: 100dvh;
  background: #000; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 10px; text-align: center;
  transition: background 3s ease;
}
.sleep-stage.dawn { background: linear-gradient(180deg, #2A1E33 0%, #6E3A44 55%, #C4763F 100%); }
.slp-clock { font-size: clamp(64px, 16vw, 120px); font-weight: 300; color: rgba(255,244,226,0.30); letter-spacing: 0.04em; }
.sleep-stage.dawn .slp-clock { color: rgba(255,244,226,0.8); }
.slp-info { color: rgba(255,244,226,0.18); font-size: 13px; }
.sleep-stage.dawn .slp-info { color: rgba(255,244,226,0.6); }
.slp-exit-hint {
  position: absolute; bottom: 40px; left: 0; right: 0; text-align: center;
  color: rgba(255,244,226,0.4); font-size: 13px; transition: opacity 0.8s ease;
}
.slp-exit-hint.faded { opacity: 0; }
.slp-awake { position: absolute; left: 0; right: 0; bottom: 25%; }
.slp-awake .btn { opacity: 0.5; }
.slp-dawnui { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.slp-dawnui p { color: rgba(255,248,235,0.85); font-size: 16px; }

/* dark mode: moi input native (dong ho, lich, dropdown) render dung dark -> icon dong ho trang */
[data-theme="dark"] { color-scheme: dark; }
[data-theme="light"] { color-scheme: light; }
[data-theme="dark"] input[type="time"]::-webkit-calendar-picker-indicator,
[data-theme="dark"] input[type="date"]::-webkit-calendar-picker-indicator,
[data-theme="dark"] input[type="datetime-local"]::-webkit-calendar-picker-indicator {
  filter: invert(1) brightness(1.7); opacity: 0.9;
}
