@font-face {
  font-family: "Be Vietnam Pro";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("assets/fonts/be-vietnam-pro-400-vi.woff2") format("woff2");
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}

@font-face {
  font-family: "Be Vietnam Pro";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("assets/fonts/be-vietnam-pro-400-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Be Vietnam Pro";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("assets/fonts/be-vietnam-pro-700-vi.woff2") format("woff2");
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}

@font-face {
  font-family: "Be Vietnam Pro";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("assets/fonts/be-vietnam-pro-700-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Be Vietnam Pro";
  font-style: normal;
  font-weight: 900;
  font-display: swap;
  src: url("assets/fonts/be-vietnam-pro-900-vi.woff2") format("woff2");
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}

@font-face {
  font-family: "Be Vietnam Pro";
  font-style: normal;
  font-weight: 900;
  font-display: swap;
  src: url("assets/fonts/be-vietnam-pro-900-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --site-logo-image: url("assets/logo-tuvi-ai-site.png");
  --chart-watermark-image: url("assets/logo-tuvi-ai-site.png");
  --chart-watermark-opacity: 0.18;
  --blue: #0a76ff;
  --tab-gray: #8d8a86;
  --red: #f20c0c;
  --ink: #161616;
  --muted: #555;
  --line: #b7b7b7;
  --paper: #fff;
  --soft: #f5f5f5;
  --gold: #b98524;
  --shadow: 0 14px 32px rgba(0, 0, 0, 0.18);
  --brand: #873816;
  --brand-dark: #32170f;
  --cream: #fff7ed;
  --panel: #fffdf8;
  --body-bg: #fff8ef;
  --header-bg: rgba(255, 251, 244, 0.96);
  --header-border: rgba(115, 88, 55, 0.16);
  --text-strong: #15171d;
  --hero-bg-a: #f3c891;
  --hero-bg-b: #fff0dc;
  --hero-bg-c: #fffaf4;
  --card-bg: rgba(255, 253, 248, 0.92);
}

html[data-theme="dark"] {
  color-scheme: dark;
  --ink: #f4efe8;
  --muted: #c5b9ac;
  --line: rgba(255, 224, 184, 0.18);
  --paper: #17120f;
  --soft: #211914;
  --cream: #21170f;
  --panel: #1f1712;
  --body-bg: #100c0a;
  --header-bg: rgba(19, 14, 11, 0.96);
  --header-border: rgba(255, 210, 151, 0.14);
  --text-strong: #fff8ef;
  --brand: #ff9a35;
  --brand-dark: #fff1df;
  --hero-bg-a: #2b1710;
  --hero-bg-b: #18110d;
  --hero-bg-c: #100c0a;
  --card-bg: rgba(31, 23, 18, 0.92);
  --shadow: 0 18px 44px rgba(0, 0, 0, 0.42);
}

* {
  box-sizing: border-box;
}

html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  background: var(--body-bg);
  color: var(--ink);
  font-family: "Be Vietnam Pro", Arial, Tahoma, Helvetica, sans-serif;
  font-size: 15px;
  line-height: 1.45;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.page {
  width: min(1160px, calc(100% - 24px));
  margin: 18px auto 48px;
  background: var(--paper);
  min-height: calc(100vh - 36px);
  padding: 14px 26px 34px;
  box-shadow: 0 1px 8px rgba(0, 0, 0, 0.16);
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand img {
  width: 54px;
  height: 54px;
}

.brand p {
  margin: 0 0 2px;
  color: var(--blue);
  font-weight: 700;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin: 0;
  font-size: clamp(28px, 3vw, 42px);
  line-height: 1.08;
  letter-spacing: 0;
}

.privacy {
  width: min(420px, 100%);
  margin: 0;
  color: var(--muted);
  text-align: right;
}

.tool {
  max-width: 650px;
  margin-top: 14px;
}

.tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
}

.tab {
  min-width: 126px;
  border: 0;
  background: var(--tab-gray);
  color: #fff;
  padding: 6px 16px;
  font-weight: 700;
}

.tab.active {
  background: var(--blue);
}

.panel {
  display: none;
  padding: 14px 0 0;
}

.panel.active {
  display: block;
}

.form-row {
  display: grid;
  grid-template-columns: 100px 1fr 180px;
  align-items: center;
  gap: 24px;
  min-height: 43px;
}

.form-row > label:first-child {
  font-weight: 400;
}

input[type="text"] {
  width: 100%;
  height: 28px;
  border: 1px solid #d6d6d6;
  padding: 0 10px;
  color: #526079;
  font-size: 12px;
}

select {
  height: 22px;
  min-width: 110px;
  border: 1px solid #aaa;
  background: #f5f5f5;
  padding: 0 28px 0 8px;
}

input[type="radio"],
input[type="checkbox"] {
  transform: translateY(1px);
}

.inline-radio,
.radio-set {
  display: flex;
  align-items: center;
  gap: 34px;
}

.radio-set {
  grid-column: 2 / 4;
}

.select-line {
  grid-template-columns: 100px 120px 1fr;
  min-height: 26px;
}

.time-line {
  grid-template-columns: 100px 120px 44px 84px;
}

.minute-label {
  justify-self: end;
}

.commit {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 18px;
}

.button-line {
  display: flex;
  justify-content: center;
  margin-top: 20px;
}

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: var(--red);
  color: #fff;
  min-width: 150px;
  min-height: 40px;
  padding: 0 18px;
  font-weight: 700;
  box-shadow: none;
  text-align: center;
  text-decoration: none;
}

.action-line {
  display: flex;
  justify-content: center;
  margin-top: 16px;
}

.dark-button,
.light-button,
.result-actions button {
  min-width: 112px;
  min-height: 34px;
  border: 1px solid #8a8a8a;
  padding: 0 16px;
  font-weight: 500;
  box-shadow: var(--shadow);
}

.dark-button {
  background: #111;
  color: #fff;
}

.light-button,
.result-actions button {
  background: linear-gradient(#fafafa, #e9e9e9);
  color: #111;
}

.note {
  line-height: 1.55;
  color: var(--muted);
}

.option-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 24px;
  padding: 10px 0 6px;
}

.guide {
  border-left: 4px solid var(--blue);
  background: #f8fbff;
  padding: 14px 18px;
  line-height: 1.55;
}

.guide h2 {
  margin-bottom: 10px;
  font-size: 20px;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: clamp(18px, 4vw, 56px);
  min-height: 74px;
  padding: 0 clamp(24px, 11vw, 260px);
  border-bottom: 1px solid var(--header-border);
  background: var(--header-bg);
  backdrop-filter: blur(14px);
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--text-strong);
  text-decoration: none;
}

.logo img {
  width: 43px;
  height: 43px;
}

.logo strong {
  font-size: 34px;
  line-height: 1;
}

.logo span {
  align-self: start;
  color: #71727b;
  font-size: 14px;
}

.main-nav,
.auth-links {
  display: flex;
  align-items: center;
  gap: clamp(18px, 2.5vw, 38px);
}

.main-nav {
  justify-content: center;
}

.main-nav a,
.auth-links a {
  color: #4c4d56;
  font-size: 16px;
  font-weight: 700;
  text-decoration: none;
}

.main-nav a.active,
.auth-links .login-link {
  color: #b14b17;
}

.login-link {
  border-radius: 2px;
  padding: 16px 22px;
  background: #fff7ec;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 40px;
  border: 1px solid rgba(177, 75, 23, 0.2);
  border-radius: 999px;
  padding: 0 13px;
  background: rgba(255, 255, 255, 0.76);
  color: var(--ink);
  font-weight: 800;
}

.theme-toggle::before {
  content: "☀";
  width: 18px;
  text-align: center;
}

html[data-theme="dark"] .theme-toggle {
  border-color: rgba(255, 154, 53, 0.38);
  background: rgba(255, 154, 53, 0.12);
}

html[data-theme="dark"] .theme-toggle::before {
  content: "☾";
}

html[data-theme="dark"] .main-nav a,
html[data-theme="dark"] .auth-links a,
html[data-theme="dark"] .auth-links button {
  color: #f4efe8;
}

html[data-theme="dark"] .main-nav a.active,
html[data-theme="dark"] .auth-links .login-link {
  color: #ff9a35;
}

html[data-theme="dark"] .login-link {
  background: rgba(255, 154, 53, 0.12);
}

.admin-page {
  min-height: calc(100vh - 74px);
  padding: 34px clamp(18px, 7vw, 120px) 64px;
  background:
    linear-gradient(135deg, rgba(255, 244, 230, 0.96), rgba(247, 250, 255, 0.96)),
    #fffaf4;
}

.admin-hero,
.admin-panel,
.admin-alert,
.admin-stats article {
  border: 1px solid rgba(120, 83, 42, 0.16);
  background: rgba(255, 253, 248, 0.92);
  box-shadow: 0 18px 44px rgba(66, 45, 24, 0.08);
}

.admin-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 18px;
  padding: 28px;
  border-radius: 18px;
}

.admin-hero h1,
.admin-panel h2 {
  margin: 0;
  color: #31180f;
}

.admin-hero h1 {
  font-size: clamp(30px, 3.4vw, 48px);
  line-height: 1.1;
  font-weight: 900;
}

.admin-hero p,
.panel-heading p,
.admin-list span {
  color: #687086;
}

.eyebrow {
  margin: 0 0 8px;
  color: #b14b17;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.admin-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 18px 0;
}

.admin-stats article {
  padding: 20px;
  border-radius: 16px;
}

.admin-stats span {
  display: block;
  color: #6b7280;
  font-weight: 700;
}

.admin-stats strong {
  display: block;
  margin-top: 10px;
  color: #0f172a;
  font-size: 28px;
}

.admin-stats small {
  display: block;
  margin-top: 6px;
  color: #7c6b5b;
  font-weight: 800;
}

.overview-report {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.overview-report article,
.usage-summary-card {
  border: 1px solid rgba(120, 83, 42, 0.16);
  border-radius: 16px;
  background: rgba(255, 253, 248, 0.94);
  padding: 16px;
  box-shadow: 0 18px 44px rgba(66, 45, 24, 0.06);
}

.overview-report h3,
.usage-summary-card strong {
  margin: 4px 0 12px;
  color: var(--brand-dark);
}

.report-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid rgba(120, 83, 42, 0.12);
  padding: 10px 0;
}

.report-row:first-of-type {
  border-top: 0;
}

.report-row span {
  color: #687086;
  font-weight: 800;
}

.report-row strong {
  color: #0f172a;
  text-align: right;
}

.report-row small {
  color: #8b6f55;
  font-size: 12px;
}

.usage-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.ai-diagnostics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.ai-diagnostics article {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  padding: 14px;
}

.ai-diagnostics h3 {
  margin: 0 0 8px;
  color: var(--ink);
  font-size: 1rem;
}

.usage-summary-card {
  display: grid;
  gap: 6px;
}

.usage-summary-card span,
.usage-summary-card small {
  color: #687086;
  font-weight: 800;
}

.usage-summary-card strong {
  display: block;
  margin: 0;
  font-size: 20px;
}

.admin-dashboard-shell {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.admin-sidebar {
  position: sticky;
  top: 92px;
  display: grid;
  gap: 7px;
  border: 1px solid rgba(120, 83, 42, 0.16);
  border-radius: 18px;
  background: rgba(255, 253, 248, 0.96);
  padding: 14px;
  box-shadow: 0 18px 44px rgba(66, 45, 24, 0.08);
}

.admin-sidebar-title {
  display: grid;
  gap: 3px;
  margin-bottom: 8px;
  padding: 8px 10px 12px;
  border-bottom: 1px solid #eadcc9;
}

.admin-sidebar-title span {
  color: #687086;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.admin-sidebar-title strong {
  color: #31180f;
  font-size: 18px;
}

.admin-sidebar button {
  width: 100%;
  min-height: 42px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: #3b3a42;
  padding: 10px 12px;
  text-align: left;
  font-weight: 900;
  transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.admin-sidebar button:hover {
  background: #fff4e6;
  color: #9a3f13;
}

.admin-sidebar button.active {
  background: linear-gradient(90deg, #ff8a00, #ffad33);
  color: #fff;
  box-shadow: 0 12px 24px rgba(255, 138, 0, 0.18);
}

.admin-main {
  min-width: 0;
}

.admin-view {
  display: none;
}

.admin-view.active {
  display: block;
}

.admin-section-head {
  border: 1px solid rgba(120, 83, 42, 0.16);
  border-radius: 18px;
  background: rgba(255, 253, 248, 0.92);
  padding: 22px;
  box-shadow: 0 18px 44px rgba(66, 45, 24, 0.08);
}

.admin-section-head h2 {
  margin: 0;
  color: #31180f;
  font-size: clamp(24px, 2.1vw, 34px);
}

.admin-section-head p:last-child {
  max-width: 680px;
  margin: 8px 0 0;
  color: #687086;
}

.statistics-dashboard {
  display: grid;
  gap: 18px;
  margin-top: 18px;
}

.stat-metric-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.stat-metric-card,
.stat-panel {
  border: 1px solid rgba(120, 83, 42, 0.16);
  border-radius: 18px;
  background: rgba(255, 253, 248, 0.92);
  box-shadow: 0 18px 44px rgba(66, 45, 24, 0.08);
}

.stat-metric-card {
  padding: 18px;
}

.stat-metric-card span,
.stat-metric-card small,
.stat-provider-row span,
.stat-provider-row small {
  color: #687086;
}

.stat-metric-card span {
  display: block;
  font-weight: 800;
}

.stat-metric-card strong {
  display: block;
  margin-top: 8px;
  color: #101828;
  font-size: 28px;
  line-height: 1.1;
}

.stat-metric-card small {
  display: block;
  margin-top: 8px;
  font-weight: 700;
}

.stat-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(320px, 0.82fr);
  gap: 18px;
}

.stat-panel {
  padding: 20px;
}

.stat-panel.wide {
  min-width: 0;
}

.stat-provider-list,
.stat-feature-list {
  display: grid;
  gap: 12px;
}

.stat-provider-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(160px, 0.9fr) auto auto;
  gap: 12px;
  align-items: center;
  border: 1px solid #eadcc9;
  border-radius: 14px;
  background: #fffaf4;
  padding: 12px;
}

.stat-provider-row strong,
.stat-provider-row span {
  display: block;
}

.stat-bar {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #eadcc9;
}

.stat-bar i {
  display: block;
  width: var(--pct, 0%);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #ff8a00, #0b78ff);
}

.stat-feature-row {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(100px, 1.2fr) auto;
  gap: 12px;
  align-items: center;
  border-bottom: 1px solid #eadcc9;
  padding: 10px 0;
}

.stat-feature-row span,
.stat-feature-row strong {
  font-weight: 900;
}

.compact-list {
  max-height: 360px;
}

.admin-panel {
  margin-top: 18px;
  padding: 22px;
  border-radius: 18px;
}

.panel-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.panel-heading p {
  max-width: 520px;
  margin-bottom: 0;
}

.admin-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.admin-form.compact {
  grid-template-columns: 1fr 1fr;
}

.admin-form.user-form {
  grid-template-columns: 1.15fr 1fr 1fr 0.7fr 0.45fr auto;
  align-items: end;
}

.admin-form label {
  display: grid;
  gap: 7px;
  color: #374151;
  font-weight: 800;
}

.admin-form input,
.admin-form select,
.admin-search,
.inline-input {
  width: 100%;
  min-height: 40px;
  border: 1px solid #e5d4bd;
  border-radius: 10px;
  padding: 8px 10px;
  background: #fff;
}

.admin-search {
  max-width: 320px;
}

.admin-form .checkline {
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-form .checkline input {
  width: auto;
  min-height: auto;
}

.admin-actions {
  display: flex;
  align-items: end;
  gap: 10px;
}

.admin-table-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px 16px;
  margin: -4px 0 14px;
  padding: 10px 12px;
  border: 1px solid #eadcc9;
  border-radius: 14px;
  background: rgba(255, 250, 244, 0.82);
}

.admin-table-controls label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #6b4226;
  font-size: 13px;
  font-weight: 900;
}

.admin-table-controls select {
  min-width: 132px;
  min-height: 34px;
  border: 1px solid #e5d4bd;
  border-radius: 999px;
  background: #fff;
  color: #31180f;
  padding: 6px 28px 6px 12px;
  font-weight: 800;
}

.admin-table-controls input[type="checkbox"] {
  width: 16px;
  height: 16px;
}

.admin-page button,
.admin-table button {
  min-height: 38px;
  border: 0;
  border-radius: 10px;
  padding: 8px 14px;
  background: #ff8a00;
  color: #fff;
  font-weight: 800;
}

.admin-page .admin-sidebar button {
  background: transparent;
  color: #3b3a42;
}

.admin-page .admin-sidebar button:hover {
  background: #fff4e6;
  color: #9a3f13;
}

.admin-page .admin-sidebar button.active {
  background: linear-gradient(90deg, #ff8a00, #ffad33);
  color: #fff;
}

.admin-table button + button,
#provider-reset,
#admin-logout {
  background: #fff1df;
  color: #873816;
}

.table-wrap {
  overflow-x: auto;
}

.user-table-wrap {
  max-height: 520px;
  overflow: auto;
  border: 1px solid #eadcc9;
  border-radius: 14px;
}

.user-table-wrap .admin-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #fffaf4;
}

.user-table-wrap .admin-table {
  table-layout: fixed;
}

.user-table-wrap .admin-table th:nth-child(1),
.user-table-wrap .admin-table td:nth-child(1) {
  width: 48px;
}

.user-table-wrap .admin-table th:nth-child(4),
.user-table-wrap .admin-table td:nth-child(4) {
  width: 86px;
}

.balance-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 62px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #fff1df;
  color: #873816;
  font-weight: 800;
  white-space: nowrap;
}

.user-table-wrap .admin-table th:last-child,
.user-table-wrap .admin-table td:last-child {
  width: 172px;
}

.user-table-wrap .admin-table td:last-child {
  display: grid;
  grid-template-columns: repeat(3, minmax(44px, 1fr));
  gap: 8px;
}

.user-table-wrap .admin-table td:last-child button {
  width: 100%;
  min-width: 0;
  padding-inline: 8px;
}

.admin-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  color: #5e6a80;
  font-weight: 800;
}

.admin-pager div {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.admin-pager button {
  border: 0;
  border-radius: 12px;
  padding: 10px 16px;
  background: #fff1df;
  color: #873816;
  font-weight: 900;
  cursor: pointer;
}

.admin-pager button:not(:disabled):hover {
  background: #ff8a00;
  color: #fff;
}

.admin-pager button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.admin-table th,
.admin-table td {
  border-bottom: 1px solid #eadcc9;
  padding: 11px 10px;
  text-align: left;
  vertical-align: top;
}

.admin-table th {
  color: #6b4226;
  font-size: 12px;
  text-transform: uppercase;
}

.admin-table small {
  display: block;
  max-width: 260px;
  margin-top: 5px;
  color: #b42318;
}

.pill {
  display: inline-flex;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 800;
}

.pill.good {
  background: #dcfce7;
  color: #166534;
}

.pill.active {
  background: #dbeafe;
  color: #1d4ed8;
}

.pill.muted {
  background: #f1f5f9;
  color: #475569;
}

.pill.warn {
  background: #fff7ed;
  color: #c2410c;
}

.pill.bad {
  background: #fee2e2;
  color: #b91c1c;
}

html[data-theme="dark"] .admin-page,
html[data-theme="dark"] .page,
html[data-theme="dark"] .about-band,
html[data-theme="dark"] .wallet-panel,
html[data-theme="dark"] .history-panel,
html[data-theme="dark"] .history-workspace,
html[data-theme="dark"] .auth-page {
  background: var(--body-bg);
}

html[data-theme="dark"] .admin-hero,
html[data-theme="dark"] .admin-panel,
html[data-theme="dark"] .admin-alert,
html[data-theme="dark"] .admin-stats article,
html[data-theme="dark"] .overview-report article,
html[data-theme="dark"] .ai-diagnostics article,
html[data-theme="dark"] .usage-summary-card,
html[data-theme="dark"] .admin-sidebar,
html[data-theme="dark"] .admin-section-head,
html[data-theme="dark"] .stat-metric-card,
html[data-theme="dark"] .stat-panel,
html[data-theme="dark"] .admin-list article,
html[data-theme="dark"] .reading article,
html[data-theme="dark"] .ai-suite,
html[data-theme="dark"] .wallet-card,
html[data-theme="dark"] .history-list article,
html[data-theme="dark"] .history-reading,
html[data-theme="dark"] .lunar-calendar-card,
html[data-theme="dark"] .lunar-day-detail,
html[data-theme="dark"] .auth-page-card .auth-dialog {
  border-color: rgba(255, 210, 151, 0.16);
  background: var(--card-bg);
  color: var(--ink);
}

html[data-theme="dark"] .stat-metric-card strong {
  color: var(--ink);
}

html[data-theme="dark"] .ai-diagnostics h3 {
  color: var(--ink);
}

html[data-theme="dark"] .admin-stats strong,
html[data-theme="dark"] .overview-report h3,
html[data-theme="dark"] .usage-summary-card strong,
html[data-theme="dark"] .report-row strong {
  color: var(--ink);
}

html[data-theme="dark"] .admin-stats small,
html[data-theme="dark"] .report-row span,
html[data-theme="dark"] .report-row small,
html[data-theme="dark"] .usage-summary-card span,
html[data-theme="dark"] .usage-summary-card small {
  color: var(--muted);
}

html[data-theme="dark"] .stat-metric-card span,
html[data-theme="dark"] .stat-metric-card small,
html[data-theme="dark"] .stat-provider-row span,
html[data-theme="dark"] .stat-provider-row small {
  color: var(--muted);
}

html[data-theme="dark"] .stat-provider-row {
  border-color: rgba(255, 214, 170, 0.18);
  background: rgba(255, 255, 255, 0.04);
}

html[data-theme="dark"] .stat-feature-row {
  border-color: rgba(255, 214, 170, 0.16);
}

html[data-theme="dark"] .stat-bar {
  background: rgba(255, 214, 170, 0.14);
}

html[data-theme="dark"] .admin-sidebar-title {
  border-color: rgba(255, 214, 170, 0.18);
}

html[data-theme="dark"] .admin-sidebar-title span,
html[data-theme="dark"] .admin-section-head p:last-child {
  color: var(--muted);
}

html[data-theme="dark"] .admin-sidebar-title strong,
html[data-theme="dark"] .admin-section-head h2 {
  color: var(--ink);
}

html[data-theme="dark"] .admin-sidebar button {
  color: #e9edf5;
}

html[data-theme="dark"] .admin-sidebar button:hover {
  background: rgba(255, 154, 53, 0.12);
  color: #ffbf75;
}

html[data-theme="dark"] .hero-shell,
html[data-theme="dark"] .feature-hero,
html[data-theme="dark"] .lunar-view {
  background:
    radial-gradient(circle at 18% 28%, rgba(255, 154, 53, 0.14) 0 0, transparent 190px),
    linear-gradient(180deg, var(--hero-bg-a), var(--hero-bg-b) 78%, var(--hero-bg-c));
}

html[data-theme="dark"] .day-card,
html[data-theme="dark"] .hero-form {
  border-color: rgba(255, 210, 151, 0.16);
  background: rgba(31, 23, 18, 0.86);
  box-shadow: var(--shadow);
}

html[data-theme="dark"] .hero-form input[type="text"],
html[data-theme="dark"] .hero-form select,
html[data-theme="dark"] .date-row,
html[data-theme="dark"] .ai-date-tools select,
html[data-theme="dark"] .ai-task-button,
html[data-theme="dark"] .lunar-toolbar button,
html[data-theme="dark"] .lunar-toolbar select,
html[data-theme="dark"] .lunar-day-cell,
html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea {
  border-color: rgba(255, 210, 151, 0.16);
  background-color: #241a14;
  color: var(--ink);
}

html[data-theme="dark"] .user-table-wrap .admin-table th {
  background: #241a14;
}

html[data-theme="dark"] .chart-wrap {
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

html[data-theme="dark"] .chart-center {
  background:
    linear-gradient(rgba(252, 250, 244, 0.82), rgba(252, 250, 244, 0.82)),
    url("assets/chart-pattern.svg") center / 760px no-repeat,
    rgba(250, 248, 241, 0.9);
}

.quota-cell {
  min-width: 118px;
}

.quota-cell span {
  display: block;
  margin-bottom: 5px;
  color: #334155;
  font-size: 12px;
  font-weight: 800;
}

.quota-cell i {
  display: block;
  width: 100%;
  height: 7px;
  border-radius: 999px;
  background:
    linear-gradient(90deg, #ff8a00 var(--pct, 0%), #eadcc9 var(--pct, 0%));
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
}

.admin-list {
  display: grid;
  gap: 10px;
}

.admin-list article {
  border: 1px solid #eadcc9;
  border-radius: 12px;
  padding: 12px;
  background: #fff;
}

.admin-list {
  max-height: 520px;
  overflow: auto;
}

.usage-log.success {
  border-left: 4px solid #22c55e;
}

.usage-log.provider-response {
  border-left: 4px solid #f59e0b;
}

.usage-log.error {
  border-left: 4px solid #ef4444;
}

.usage-log small {
  display: block;
  margin-top: 6px;
  color: #b42318;
  overflow-wrap: anywhere;
}

.admin-list strong,
.admin-list span {
  display: block;
}

.admin-alert {
  border-color: #fca5a5;
  border-radius: 16px;
  padding: 18px;
  color: #991b1b;
  background: #fff7f7;
  font-weight: 800;
}

.page {
  width: 100%;
  min-height: auto;
  margin: 0;
  padding: 0;
  background: #fffaf4;
  box-shadow: none;
}

.hero-shell {
  position: relative;
  display: grid;
  grid-template-columns: minmax(360px, 640px) minmax(360px, 500px);
  gap: clamp(42px, 5vw, 86px);
  align-items: start;
  min-height: 430px;
  padding: 58px clamp(24px, 11vw, 260px) 34px;
  overflow: hidden;
  background:
    radial-gradient(circle at 19% 31%, rgba(255, 255, 255, 0.95) 0 0, transparent 190px),
    linear-gradient(180deg, #f4cfa4 0%, #f6dfc4 88%);
}

.hero-art {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.mountain {
  position: absolute;
  bottom: -35px;
  width: 280px;
  height: 270px;
  background: linear-gradient(145deg, #a85f18, #efbb6a);
  clip-path: polygon(0 100%, 52% 0, 100% 100%);
  opacity: 0.88;
}

.mountain-left {
  left: -50px;
}

.mountain-right {
  right: -20px;
  width: 220px;
  height: 180px;
  opacity: 0.72;
}

.cloud {
  position: absolute;
  border: 18px solid rgba(255, 255, 255, 0.72);
  border-radius: 50%;
  filter: blur(1px);
}

.cloud-one {
  top: -95px;
  right: 40px;
  width: 580px;
  height: 190px;
}

.cloud-two {
  top: 120px;
  right: -105px;
  width: 220px;
  height: 110px;
}

.day-card,
.hero-form {
  position: relative;
  z-index: 1;
  border: 1px solid rgba(255, 255, 255, 0.78);
  background: rgba(255, 248, 238, 0.88);
  box-shadow: 0 18px 45px rgba(139, 82, 30, 0.13);
}

.day-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 28px;
  min-height: 300px;
  border-radius: 14px;
  padding: 42px 58px 24px;
}

.date-block {
  text-align: center;
  color: #7d3418;
}

.date-block p {
  margin-bottom: 15px;
  font-size: 16px;
}

.date-block strong {
  display: block;
  font-size: 62px;
  line-height: 0.9;
}

.date-block span,
.day-grid strong {
  font-size: 16px;
  font-weight: 800;
}

.score-ring {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 132px;
}

.score-ring svg {
  position: absolute;
  width: 132px;
  height: 132px;
  transform: rotate(126deg);
}

.score-ring circle {
  fill: none;
  stroke-width: 10;
}

.score-ring circle:first-child {
  stroke: #91eec2;
  opacity: 0.75;
}

.score-ring circle:last-child {
  stroke: #2fcc82;
  stroke-dasharray: 100 301;
  stroke-linecap: round;
}

.score-ring div {
  position: relative;
  text-align: center;
  color: #0d9d62;
}

.score-ring strong {
  display: block;
  font-size: 32px;
}

.score-ring small {
  font-size: 18px;
}

.score-ring span {
  color: #316145;
  font-size: 13px;
}

.day-status {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: #75808f;
}

.day-status b {
  border-radius: 8px;
  padding: 8px 15px;
  background: #f6f3ef;
  color: #697284;
}

.day-grid {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  text-align: center;
}

.day-grid p {
  margin: 0;
  color: #7d3418;
}

.day-grid p + p {
  border-left: 1px solid rgba(126, 93, 69, 0.18);
}

.day-grid strong {
  display: block;
  margin-top: 5px;
}

.quote-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 300px;
  gap: 22px;
  padding: 44px 58px;
  overflow: hidden;
}

.quote-card::before {
  content: "";
  position: absolute;
  right: -60px;
  top: -70px;
  width: 230px;
  height: 230px;
  border: 28px solid rgba(255, 139, 0, 0.12);
  border-radius: 999px;
}

.quote-kicker {
  margin: 0;
  color: #006cff;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.quote-card blockquote {
  position: relative;
  z-index: 1;
  max-width: 650px;
  margin: 0;
  color: var(--brand-dark);
  font-size: clamp(28px, 3.2vw, 48px);
  font-weight: 900;
  line-height: 1.12;
}

.quote-foot {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 16px;
  max-width: 560px;
  color: #5d687f;
  font-size: 17px;
}

.quote-foot span {
  display: grid;
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: #fff7ed;
  color: #ff8a00;
  font-weight: 900;
  box-shadow: inset 0 0 0 1px rgba(255, 139, 0, 0.22);
}

.quote-foot strong {
  font-weight: 800;
}

.hero-form {
  display: grid;
  gap: 16px;
  border-radius: 24px;
  padding: 36px 44px;
}

.form-title {
  text-align: center;
}

.form-title h1 {
  margin: 0 0 10px;
  color: var(--brand-dark);
  font-size: clamp(28px, 2.6vw, 36px);
  font-weight: 900;
  line-height: 1.1;
}

.form-title p {
  position: relative;
  margin: 0;
  padding-bottom: 20px;
  color: #5d687f;
  font-size: clamp(16px, 1.25vw, 19px);
  font-weight: 600;
}

.form-title p::after {
  content: "";
  position: absolute;
  left: 26%;
  right: 26%;
  bottom: 0;
  height: 1px;
  background: rgba(148, 124, 102, 0.22);
}

.hero-form input[type="text"],
.hero-form select {
  width: 100%;
  min-height: 52px;
  border: 0;
  border-radius: 13px;
  background: #fff;
  color: #1e2430;
  padding: 0 16px;
  font-size: 16px;
  box-shadow: 0 1px 0 rgba(108, 80, 58, 0.04);
}

.hero-form input[type="text"]::placeholder {
  color: #a0a8b7;
}

.date-row,
.field-row {
  display: grid;
  gap: 0;
}

.date-row {
  grid-template-columns: 1fr 1fr 1fr 1.35fr;
  overflow: hidden;
  border-radius: 15px;
  background: #fff;
}

.date-row select {
  border-radius: 0;
  box-shadow: none;
}

.date-row select + select {
  border-left: 1px solid rgba(130, 119, 110, 0.08);
}

.field-row {
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.field-row:not(.two-col) {
  grid-template-columns: 1fr;
}

.two-col {
  gap: 14px;
}

.hero-form .primary-button {
  width: 100%;
  min-height: 52px;
  border-radius: 13px;
  background: linear-gradient(90deg, #ff8a00, #fb9700);
  color: #fff;
  font-size: 16px;
  box-shadow: none;
}

.sample-link {
  margin: 4px 0 0;
  color: #6f7d93;
  text-align: center;
}

.sample-link button,
.clear-button {
  border: 0;
  background: transparent;
  color: #f28b00;
  font-weight: 800;
}

.clear-button {
  justify-self: center;
  color: #9a7b62;
}

.hidden-options {
  display: none;
}

.about-band {
  display: grid;
  grid-template-columns: minmax(0, 680px);
  padding: 95px clamp(24px, 11vw, 260px) 72px;
  background: #fffaf4;
}

.about-band h2 {
  margin: 0 0 18px;
  color: #813818;
  font-size: 42px;
  line-height: 1.18;
}

.about-band p {
  color: #5f6b82;
  font-size: 21px;
  line-height: 1.36;
}

.floating-actions {
  position: fixed;
  right: 22px;
  bottom: 28px;
  z-index: 30;
  display: grid;
  gap: 10px;
  justify-items: end;
}

.floating-actions span {
  border-radius: 10px;
  padding: 13px 18px;
  background: #fff;
  color: #8a8f9b;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.16);
}

.floating-actions button {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: #ff9800;
  color: #fff;
  font-weight: 800;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.16);
}

.contact-float {
  position: fixed;
  right: 12px;
  bottom: 24px;
  z-index: 80;
  display: grid;
  gap: 12px;
  justify-items: center;
  font-family: inherit;
}

.contact-hint {
  position: relative;
  width: 172px;
  margin-right: 18px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.96);
  color: #727887;
  padding: 12px 30px 12px 14px;
  font-size: 14px;
  line-height: 1.32;
  box-shadow: 0 12px 30px rgba(43, 28, 14, 0.16);
}

.contact-hint::after {
  content: "";
  position: absolute;
  right: 22px;
  bottom: -9px;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 10px 10px 0 -5px #fff;
}

.contact-hint-close {
  position: absolute;
  top: 6px;
  right: 7px;
  width: 20px;
  height: 20px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #9aa0aa;
  font-size: 22px;
  line-height: 18px;
  cursor: pointer;
}

.contact-round {
  width: 48px;
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  color: #fff;
  text-decoration: none;
  font-weight: 900;
  box-shadow: 0 12px 26px rgba(54, 31, 11, 0.2);
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.contact-round:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 32px rgba(54, 31, 11, 0.25);
}

.contact-chat {
  background: linear-gradient(135deg, #ff8a00, #ffab1a);
}

.contact-chat-icon {
  position: relative;
  width: 28px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
  border-radius: 13px;
  font-size: 13px;
  letter-spacing: 1px;
  line-height: 1;
}

.contact-chat-icon::after {
  content: "";
  position: absolute;
  right: 2px;
  bottom: -6px;
  border-width: 6px 0 0 7px;
  border-style: solid;
  border-color: transparent transparent transparent #fff;
}

.contact-zalo-round {
  background: #fff;
  color: #0088ff;
  font-size: 13px;
}

.contact-facebook-round {
  background: #1877f2;
  font-family: Arial, sans-serif;
  font-size: 28px;
  line-height: 1;
}

.contact-menu {
  display: grid;
  gap: 10px;
  width: min(300px, calc(100vw - 32px));
  border: 1px solid rgba(138, 75, 26, 0.16);
  border-radius: 18px;
  background: rgba(255, 254, 251, 0.96);
  padding: 12px;
  box-shadow: 0 24px 70px rgba(32, 19, 10, 0.18);
  backdrop-filter: blur(12px);
}

.contact-menu[hidden] {
  display: none;
}

.contact-menu button,
.contact-link,
.contact-card {
  display: grid;
  gap: 3px;
  width: 100%;
  border: 1px solid #ead7bf;
  border-radius: 14px;
  background: #fffaf4;
  color: #35170d;
  padding: 13px 14px;
  text-align: left;
}

.contact-link {
  text-decoration: none;
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.contact-link:hover {
  transform: translateY(-1px);
}

.contact-zalo {
  border-color: rgba(0, 104, 255, 0.22);
  background: #f3f8ff;
}

.contact-facebook {
  border-color: rgba(24, 119, 242, 0.22);
  background: #f5f9ff;
}

.contact-card {
  background: #fff;
}

.contact-menu button:hover,
.contact-link:hover {
  border-color: #ff9d00;
  background: #fff4e6;
}

.contact-menu strong {
  font-size: 16px;
}

.contact-menu span {
  color: #667085;
  font-size: 13px;
  line-height: 1.35;
}

.support-box {
  display: grid;
  gap: 10px;
}

.support-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.contact-menu .support-close {
  width: 34px;
  min-width: 34px;
  height: 34px;
  border-radius: 999px;
  padding: 0;
  place-items: center;
  text-align: center;
  font-size: 20px;
  line-height: 1;
}

.support-thread {
  display: grid;
  gap: 9px;
  max-height: 320px;
  overflow: auto;
  border: 1px solid #f0dfca;
  border-radius: 14px;
  background: #fffdf9;
  padding: 10px;
}

.support-empty {
  margin: 0;
  color: #667085;
  font-size: 14px;
  line-height: 1.45;
}

.support-login {
  display: inline-flex;
  justify-content: center;
  border-radius: 999px;
  background: #ff8a00;
  color: #fff;
  padding: 10px 14px;
  font-weight: 900;
  text-decoration: none;
}

.support-message {
  max-width: 88%;
  border: 1px solid #ead7bf;
  border-radius: 14px;
  background: #fff8ee;
  padding: 9px 10px;
}

.support-message.admin {
  justify-self: start;
  background: #fff;
}

.support-message.user {
  justify-self: end;
  background: #fff0db;
}

.support-message strong,
.support-message span {
  display: block;
}

.support-message p {
  margin: 4px 0;
  color: #35170d;
  font-size: 14px;
  line-height: 1.45;
  white-space: pre-wrap;
}

.support-input {
  width: 100%;
  min-height: 76px;
  resize: vertical;
  border: 1px solid #ead7bf;
  border-radius: 14px;
  background: #fff;
  padding: 12px;
  color: #35170d;
  font: inherit;
}

.contact-menu .support-send {
  display: inline-flex;
  justify-content: center;
  border: 0;
  background: #ff8a00;
  color: #fff;
  text-align: center;
  font-weight: 900;
}

.contact-menu .support-send:disabled {
  opacity: 0.65;
  cursor: wait;
}

.support-socials {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.support-socials button {
  justify-items: center;
  text-align: center;
  font-weight: 900;
}

.admin-support-panel {
  grid-column: 1 / -1;
}

.support-admin-list {
  display: grid;
  gap: 14px;
  max-height: 620px;
  overflow: auto;
}

.support-admin-thread {
  display: grid;
  gap: 12px;
  border: 1px solid #eadcc9;
  border-radius: 16px;
  background: #fff;
  padding: 14px;
}

.support-admin-thread > header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.support-admin-thread > header strong,
.support-admin-thread > header span {
  display: block;
}

.support-admin-thread > header span {
  color: #667085;
  font-size: 13px;
}

.support-unread {
  border-radius: 999px;
  background: #fee2e2;
  color: #b42318;
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 900;
}

.support-admin-messages {
  display: grid;
  gap: 8px;
  max-height: 260px;
  overflow: auto;
  border: 1px solid #f0dfca;
  border-radius: 14px;
  background: #fffdf9;
  padding: 10px;
}

.support-admin-message {
  max-width: 82%;
  border: 1px solid #ead7bf;
  border-radius: 14px;
  padding: 10px;
  background: #fff;
}

.support-admin-message.user {
  justify-self: start;
  border-left: 4px solid #ff8a00;
}

.support-admin-message.admin {
  justify-self: end;
  background: #fff0db;
}

.support-admin-message div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: #667085;
  font-size: 12px;
}

.support-admin-message p {
  margin: 6px 0;
  white-space: pre-wrap;
}

.support-admin-message a {
  color: #0969da;
  font-weight: 800;
}

.support-admin-reply {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.support-admin-reply textarea {
  width: 100%;
  resize: vertical;
  border: 1px solid #ead7bf;
  border-radius: 12px;
  padding: 10px 12px;
  font: inherit;
}

.support-admin-reply button {
  align-self: stretch;
}

.result {
  margin-top: 28px;
  border-top: 3px solid #111;
  padding: 28px clamp(24px, 5vw, 72px) 60px;
}

.result-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

.kicker {
  margin: 0 0 10px;
  color: var(--blue);
  font-weight: 900;
  text-transform: uppercase;
  font-size: clamp(14px, 1.05vw, 18px);
  letter-spacing: 0.03em;
}

.result h2 {
  margin-bottom: 6px;
  font-size: 24px;
}

#result-meta {
  margin: 0;
  color: var(--muted);
}

.result-actions {
  display: flex;
  gap: 10px;
}

.chart-wrap {
  --palace-cell-height: 336px;
  width: min(980px, 100%);
  margin: 0 auto;
  overflow: hidden;
  border: 2px solid #111;
  background:
    linear-gradient(rgba(244, 241, 232, 0.9), rgba(244, 241, 232, 0.9)),
    url("assets/chart-pattern.svg") center / cover no-repeat,
    #f4f1e8;
  font-family: "Be Vietnam Pro", Arial, Tahoma, Helvetica, sans-serif;
}

.chart-wrap.black-white {
  filter: grayscale(1);
}

.chart-wrap.capture-mode {
  width: 980px !important;
  max-width: none !important;
  margin: 0 !important;
  transform: none !important;
}

.chart-viewer {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  grid-template-rows: auto 1fr;
  background: rgba(9, 10, 12, 0.86);
  backdrop-filter: blur(10px);
}

.chart-viewer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px clamp(14px, 3vw, 34px);
  background: rgba(255, 250, 244, 0.96);
  color: #22130d;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.24);
}

.chart-viewer-bar button {
  border: 0;
  border-radius: 999px;
  background: #ff8a00;
  color: #fff;
  padding: 10px 18px;
  font-weight: 900;
}

.chart-viewer-stage {
  overflow: auto;
  padding: 24px;
}

.chart-viewer .viewer-chart {
  width: 980px;
  max-width: none;
  margin: 0 auto;
  transform: none !important;
  filter: none;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
}

.transit-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 14px;
  width: min(980px, 100%);
  margin: 16px auto 0;
  padding: 12px 14px;
  border: 1px solid rgba(145, 82, 31, 0.18);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.76);
  color: var(--ink);
  font-weight: 700;
}

.transit-controls label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.transit-controls input[type="number"] {
  width: 84px;
  height: 38px;
  border: 1px solid #d9c7b2;
  border-radius: 6px;
  padding: 0 10px;
  font: inherit;
  font-weight: 700;
}

.transit-controls input[type="checkbox"] {
  width: 18px;
  height: 18px;
}

.chart-grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-rows: repeat(4, var(--palace-cell-height));
  gap: 1px;
  background: #111;
}

.chart-grid.chart-placeholder-grid {
  display: block;
  min-height: min(72vh, 780px);
  padding: 18px;
  background:
    linear-gradient(rgba(255, 253, 247, 0.94), rgba(255, 253, 247, 0.94)),
    url("assets/chart-pattern.svg") center / 620px no-repeat,
    #fffdf7;
}

.chart-placeholder {
  width: min(520px, 100%);
  margin: 0 auto;
  color: #172033;
}

.chart-placeholder h3 {
  margin-bottom: 8px;
  color: #0b78ff;
}

.chart-placeholder p {
  color: #5f6b83;
}

.chart-side,
.chart-middle,
.chart-row {
  display: contents;
}

.chart-cell {
  min-width: 0;
  min-height: 0;
  display: grid;
}

.palace {
  position: relative;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto auto;
  min-height: 0;
  background: #fffdf7;
  padding: 8px 8px 6px;
  line-height: 1.14;
  overflow: hidden;
}

.palace::before {
  content: "";
  position: absolute;
  inset: 8px;
  z-index: 0;
  pointer-events: none;
  background: url("assets/chart-pattern.svg") center / 230px no-repeat;
  opacity: 0.18;
}

.palace > * {
  position: relative;
  z-index: 1;
}

.palace:nth-child(2n) {
  background: #fffdf7;
}

.palace.primary {
  background:
    linear-gradient(rgba(255, 253, 247, 0.94), rgba(255, 253, 247, 0.94)),
    #fff7df;
}

.palace header {
  display: grid;
  grid-template-columns: 50px 1fr 42px;
  align-items: start;
  gap: 6px;
  margin: 0 0 7px;
  color: #b00000;
  font-family: "Be Vietnam Pro", Arial, Tahoma, Helvetica, sans-serif;
  font-size: 15px;
  text-transform: uppercase;
  font-weight: 700;
}

.palace .branch-name {
  text-transform: none;
}

.palace header strong {
  color: #111;
  text-align: center;
  letter-spacing: 0;
  font-size: 16px;
  line-height: 1.08;
}

.palace header span:last-child {
  color: #111;
  font-weight: 400;
  text-align: right;
}

.main-stars {
  display: grid;
  align-content: center;
  justify-items: center;
  min-height: 48px;
  margin-bottom: 7px;
  color: #b00000;
  font-family: "Be Vietnam Pro", Arial, Tahoma, Helvetica, sans-serif;
  font-size: 20px;
  font-weight: 800;
  line-height: 1.14;
  text-align: center;
}

.main-stars em {
  color: #777;
  font-size: 14px;
  font-weight: 400;
}

.support-stars {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-content: start;
  gap: 4px 12px;
  min-height: 0;
  overflow: hidden;
  font-family: "Be Vietnam Pro", Arial, Tahoma, Helvetica, sans-serif;
}

.support-stars > div {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.support-stars span {
  display: block;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.annual-stars {
  display: flex;
  flex-wrap: wrap;
  gap: 3px 9px;
  align-items: end;
  margin: 5px 0 3px;
  padding-top: 5px;
  border-top: 1px dashed rgba(0, 0, 0, 0.18);
  font-family: "Be Vietnam Pro", Arial, Tahoma, Helvetica, sans-serif;
  min-height: 43px;
  max-height: 58px;
  overflow: hidden;
}

.annual-stars b {
  width: 100%;
  color: #6b2bb7;
  font-size: 12px;
  line-height: 1.16;
}

.annual-stars span {
  font-size: 13px;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
}

.major-transit-block b {
  color: #064c8a;
}

.minor-transit-block b {
  color: #8a4c00;
}

.luuNien,
.luuTot {
  color: #7a38bd;
}

.luuDaiVan {
  color: #005aa8;
}

.luuTieuVan {
  color: #a66a00;
}

.luuThaiTue,
.luuXau {
  color: #c40000;
}

.hard-star,
.hanhHoa {
  color: #ad0000;
}

.hanhKim {
  color: #666;
}

.hanhThuy {
  color: #0040a8;
}

.hanhMoc {
  color: #168200;
}

.hanhTho {
  color: #8a5c00;
}

.palace p {
  margin: 8px 0 0;
  color: #414141;
  font-size: 12px;
}

.palace footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-top: 1px solid rgba(0, 0, 0, 0.13);
  padding-top: 5px;
  color: #444;
  font-family: "Be Vietnam Pro", Arial, Tahoma, Helvetica, sans-serif;
  font-size: 13px;
  font-weight: 500;
}

.marker {
  display: inline-block;
  margin-right: 4px;
  padding: 1px 6px;
  background: #111;
  color: #fff;
  font-size: 12px;
}

.marker-overlay {
  position: absolute;
  z-index: 8;
  pointer-events: none;
  margin: 0;
  display: inline-flex;
  gap: 2px;
  align-items: center;
  border: 1px solid #111;
  line-height: 1.05;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.35);
}

.marker-overlay span {
  display: inline-block;
}

.marker-overlay.vertical {
  transform: translate(-50%, -92%);
}

.marker-overlay.horizontal {
  transform: translate(-50%, -50%);
}

.chart-center {
  grid-column: 2 / span 2;
  grid-row: 2 / span 2;
  position: relative;
  display: grid;
  place-items: center;
  min-height: 0;
  padding: 26px 36px;
  background:
    linear-gradient(rgba(252, 250, 244, 0.82), rgba(252, 250, 244, 0.82)),
    url("assets/chart-pattern.svg") center / 760px no-repeat,
    rgba(250, 248, 241, 0.9);
  text-align: center;
  font-family: "Be Vietnam Pro", Arial, Tahoma, Helvetica, sans-serif;
  overflow: hidden;
}

.chart-center::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: var(--chart-watermark-image) center / 255px no-repeat;
  opacity: var(--chart-watermark-opacity);
}

.chart-center > div {
  position: relative;
  z-index: 1;
}

.chart-center h3 {
  margin: 6px 0 16px;
  padding-top: 10px;
  border-top: 1px solid #263dc2;
  color: #263dc2;
  font-size: 22px;
  letter-spacing: 0;
}

.chart-center p {
  margin: 3px 0;
}

.forum-name {
  margin: 0;
  color: #263dc2;
  font-weight: 800;
  font-size: 16px;
}

.forum-url {
  margin: 0 0 7px;
  color: #d00000;
  font-size: 14px;
  font-weight: 800;
}

.chart-center dl {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px 20px;
  margin: 0 auto;
  max-width: 520px;
  text-align: left;
}

.chart-center dt {
  color: #111;
  font-weight: 500;
  font-size: 15px;
  line-height: 1.42;
}

.chart-center dd {
  margin: 0;
  color: #263dc2;
  font-size: 15px;
  line-height: 1.42;
  min-width: 0;
}

.chart-center dd:nth-of-type(odd) {
  font-weight: 800;
}

.chart-center dd:nth-of-type(even) {
  font-weight: 800;
}

.center-note {
  margin-top: 20px;
  color: #263dc2;
  font-weight: 800;
  font-size: 16px;
}

.chart-legend {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 28px;
  padding: 4px 10px 5px;
  border-top: 1px solid #111;
  background: rgba(250, 248, 241, 0.92);
  color: #222;
  font-size: 12px;
  font-weight: 700;
}

.state-legend,
.element-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.state-legend b {
  font-weight: 900;
}

.state-m,
.state-v {
  color: #c40000;
}

.state-d,
.state-b {
  color: #ad6f00;
}

.state-h {
  color: #333;
}

.element-legend i {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 3px;
  vertical-align: -1px;
}

.element-legend .kim { background: #9ca3af; }
.element-legend .moc { background: #089144; }
.element-legend .thuy { background: #111827; }
.element-legend .hoa { background: #f04438; }
.element-legend .tho { background: #f59e0b; }

.reading {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.reading article {
  border: 1px solid var(--line);
  background: #fff;
  padding: 14px;
}

.reading h3 {
  margin: 0 0 8px;
  color: var(--blue);
  font-size: 16px;
}

.reading p {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.68;
}

.reading .ai-reading {
  grid-column: 1 / -1;
  border-radius: 8px;
  padding: 22px 24px;
  font-size: 16px;
  line-height: 1.72;
}

.ai-text {
  font-size: 16px;
  line-height: 1.72;
}

.ai-text p {
  margin-bottom: 12px;
}

.ai-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid rgba(129, 56, 24, 0.14);
  color: var(--muted);
  font-size: 14px;
}

.ai-suite {
  grid-column: 1 / -1;
  min-width: 0;
  border: 1px solid rgba(129, 56, 24, 0.18);
  border-radius: 12px;
  background: #fffdf8;
  padding: 22px;
}

.ai-suite-head {
  max-width: 780px;
  margin: 0 auto 18px;
  text-align: center;
}

.ai-suite-head h3 {
  margin: 0 0 7px;
  color: #813818;
  font-size: clamp(24px, 2.3vw, 32px);
  font-weight: 900;
}

.ai-suite-head p:last-child {
  margin: 0;
  color: #607089;
}

.ai-full-package-button {
  margin-left: auto;
  margin-right: auto;
}

.ai-date-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 18px;
}

.ai-date-tools label {
  display: grid;
  gap: 6px;
  color: #6f4f39;
  font-weight: 800;
}

.ai-date-tools select {
  min-width: 150px;
  min-height: 38px;
  border: 1px solid #e2d2bf;
  border-radius: 8px;
  background: #fff;
}

.ai-tabs {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  max-width: 100%;
  margin: 8px 0 18px;
  border: 1px solid #ead8c2;
  background: #fff;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.ai-tab {
  min-height: 44px;
  border: 0;
  border-right: 1px solid #ead8c2;
  background: #fffdf8;
  color: #171717;
  padding: 0 14px;
  font-size: 16px;
  font-weight: 900;
  white-space: nowrap;
}

.ai-tab:last-child {
  border-right: 0;
}

.ai-tab.active {
  background: #b94708;
  color: #fff;
}

.ai-tab:not(.active):hover {
  background: #fff2e3;
  color: #8a3a16;
}

.ai-chart-tools-panel {
  border: 1px solid #ead8c2;
  border-radius: 8px;
  background: #fffaf4;
  padding: 16px;
}

.ai-chart-tools-panel h4 {
  margin: 0 0 6px;
  color: #813818;
  font-size: 18px;
}

.ai-chart-tools-panel p {
  margin: 0;
  color: #607089;
  line-height: 1.45;
}

.ai-chart-tools-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.secondary-button {
  min-height: 42px;
  border: 1px solid #d8c5b2;
  border-radius: 6px;
  background: #fff;
  color: #813818;
  padding: 0 18px;
  font-weight: 900;
}

.secondary-button:hover {
  border-color: #fb9700;
  background: #fff2e3;
}

.ai-year-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 0 0 16px;
  color: #6f4f39;
  font-weight: 900;
}

.ai-year-pager button {
  min-height: 38px;
  border: 1px solid #d8c5b2;
  border-radius: 999px;
  background: #fff;
  color: #813818;
  padding: 0 18px;
  font-weight: 900;
}

.ai-year-pager button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.ai-year-limit-note {
  margin: -6px 0 16px;
  color: #6f4f39;
  font-size: 0.9rem;
  line-height: 1.5;
  text-align: center;
}

.topic-suite {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.topic-card {
  border: 1px solid #ff9d1b;
  background: #fffdf8;
  min-width: 0;
}

.topic-card summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  cursor: pointer;
  list-style: none;
  padding: 22px 26px 14px;
  color: #111;
  font-size: 20px;
  font-weight: 950;
}

.topic-card summary::-webkit-details-marker {
  display: none;
}

.topic-card summary b {
  display: grid;
  place-items: center;
  width: 36px;
  height: 32px;
  border: 1px solid #e5e7eb;
  border-radius: 4px;
  color: #4b5563;
  font-size: 18px;
  line-height: 1;
}

.topic-card:not([open]) summary {
  padding-bottom: 22px;
}

.topic-card:not([open]) summary b {
  transform: rotate(180deg);
}

.topic-card > p {
  margin: 0;
  padding: 0 26px 28px;
  color: #111827;
  font-style: italic;
  line-height: 1.65;
}

.topic-question-list {
  border-top: 1px solid #ead8c2;
}

.topic-question-button {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  width: 100%;
  min-height: 72px;
  border: 0;
  border-bottom: 1px solid #ead8c2;
  background: #fffdf8;
  padding: 0 26px;
  text-align: left;
  color: #111;
  font-size: 16px;
  font-weight: 900;
  min-width: 0;
}

.topic-question-button:last-child {
  border-bottom: 0;
}

.topic-question-button strong {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 112px;
  min-height: 36px;
  background: #fb8c00;
  color: #fff;
  padding: 0 14px;
  font-size: 14px;
  font-weight: 950;
}

.topic-question-button:hover {
  background: #fff3e3;
}

.ai-task-group {
  margin-top: 16px;
}

.ai-task-group h4 {
  margin: 0 0 10px;
  color: #1f2a44;
  font-size: 16px;
}

.ai-task-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  min-width: 0;
}

.ai-full-package-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  width: 100%;
  min-height: 58px;
  margin-top: 16px;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(90deg, #ff8a00, #fb9700);
  color: #fff;
  font-size: 18px;
  font-weight: 900;
  box-shadow: 0 16px 34px rgba(251, 151, 0, 0.22);
}

.ai-full-package-button strong {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  padding: 6px 12px;
  font-size: 15px;
}

.ai-task-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 44px;
  border: 1px solid #ead8c2;
  border-radius: 8px;
  background: #fff;
  color: #813818;
  padding: 8px 10px;
  font-weight: 800;
  text-align: left;
}

.ai-task-button.locked {
  cursor: not-allowed;
  opacity: 0.45;
  filter: grayscale(0.45);
}

.ai-task-button small {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 3px 8px;
  background: #fff1df;
  color: #a4530c;
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

.ai-task-button small.free {
  background: #e9fbf0;
  color: #08743d;
}

.ai-task-button small.viewed {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid rgba(22, 163, 74, 0.18);
}

#saved-reading-panel {
  display: none;
}

.ai-task-button:hover {
  border-color: #fb9700;
  background: #fff8ed;
}

.ai-output {
  margin-top: 20px;
}

.ai-question-box {
  display: grid;
  gap: 12px;
  margin-top: 18px;
  border: 1px solid #ead7be;
  border-radius: 14px;
  padding: 18px;
  background: #fffaf4;
}

.ai-question-box.locked {
  opacity: 0.5;
  filter: grayscale(0.45);
}

.ai-question-box h4 {
  margin: 0 0 6px;
  color: var(--brand);
  font-size: 18px;
}

.ai-question-box p {
  margin: 0;
  color: #667085;
  line-height: 1.45;
}

.ai-question-box textarea {
  width: 100%;
  min-height: 110px;
  resize: vertical;
  border: 1px solid #e5d4bd;
  border-radius: 12px;
  padding: 12px 14px;
  background: #fff;
  color: #111827;
  line-height: 1.5;
}

.ai-question-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ai-suggestion-button {
  border: 1px solid rgba(251, 151, 0, 0.28);
  border-radius: 999px;
  padding: 8px 12px;
  background: #fff7e8;
  color: #813818;
  font-size: 13px;
  font-weight: 800;
  text-align: left;
}

.ai-suggestion-button:hover {
  border-color: #fb9700;
  background: #fff0d7;
}

.ai-suggestion-button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.ai-question-box > button {
  justify-self: start;
  min-height: 42px;
  border: 0;
  border-radius: 10px;
  padding: 0 18px;
  background: #ff8a00;
  color: #fff;
  font-weight: 900;
}

.reading .ai-reading.loading {
  border-color: #ffd08a;
  background: #fffaf0;
}

.reading .ai-reading.unlock-loading {
  border-color: rgba(251, 151, 0, 0.28);
  background: linear-gradient(180deg, #fffaf0, #fff7e8);
}

.unlock-progress {
  position: relative;
  height: 12px;
  margin: 14px 0 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #f0dfc6;
}

.unlock-progress span {
  position: absolute;
  inset: 0 auto 0 0;
  width: 42%;
  border-radius: inherit;
  background: linear-gradient(90deg, #ff8a00, #ffbd4a, #ff8a00);
  animation: unlockProgress 1.15s ease-in-out infinite;
}

.ai-progress {
  max-width: 420px;
  height: 10px;
  margin-top: 12px;
}

.ai-loading-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}

.ai-loading-row span {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #ff8a00;
  animation: aiPulse 0.9s ease-in-out infinite;
}

.ai-loading-row span:nth-child(2) {
  animation-delay: 0.14s;
}

.ai-loading-row span:nth-child(3) {
  animation-delay: 0.28s;
}

.ai-loading-copy {
  max-width: 720px;
  margin-top: 8px;
}

.ai-loading-copy p {
  margin: 0;
}

.ai-estimate {
  display: inline-block;
  color: #667085;
  font-size: 0.82em;
  font-weight: 700;
}

.ai-estimate-note {
  margin-top: 6px !important;
  color: #667085;
  font-size: 0.9rem;
}

.ai-elapsed,
.ai-completion-time {
  font-variant-numeric: tabular-nums;
}

.ai-elapsed {
  display: block;
  margin-top: 6px;
  color: #737373;
  font-size: 0.88rem;
  font-weight: 500;
}

.ai-completion-time {
  margin: 6px 0 14px;
  color: #667085;
  font-size: 0.92rem;
}

@keyframes unlockProgress {
  0% {
    transform: translateX(-105%);
  }

  100% {
    transform: translateX(245%);
  }
}

@keyframes aiPulse {
  0%, 100% {
    opacity: 0.35;
    transform: translateY(0) scale(0.9);
  }

  50% {
    opacity: 1;
    transform: translateY(-3px) scale(1.08);
  }
}

.reading .ai-reading.warning {
  border-color: #f0b3a2;
  background: #fff7f4;
}

.topup-cta-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  margin-top: 14px;
  border: 0;
  border-radius: 14px;
  padding: 0 24px;
  background: linear-gradient(135deg, #ff8a00, #ffae2b);
  color: #fff;
  font-weight: 900;
  box-shadow: 0 12px 24px rgba(255, 138, 0, 0.24);
  transition: transform 0.16s ease, box-shadow 0.16s ease, filter 0.16s ease;
}

.topup-cta-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 30px rgba(255, 138, 0, 0.3);
  filter: saturate(1.05);
}

.topup-cta-button:focus-visible {
  outline: 3px solid rgba(255, 138, 0, 0.28);
  outline-offset: 3px;
}

.reading-provider {
  margin-bottom: 14px;
  color: var(--brown);
  font-weight: 800;
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 0;
}

.ai-text {
  color: #24304a;
  font-size: 16px;
  line-height: 1.7;
}

.ai-text h3 {
  margin: 22px 0 8px;
  color: #8a3619;
  font-size: 20px;
}

.ai-text h3:first-child {
  margin-top: 0;
}

.ai-text p + p {
  margin-top: 12px;
}

.spouse-portrait {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 22px;
  align-items: center;
  margin: 0 0 22px;
  border: 1px solid #efddc6;
  border-radius: 14px;
  background: linear-gradient(135deg, #fffaf3, #fff);
  padding: 18px;
}

.portrait-frame {
  border-radius: 18px;
  background: #e8e1d7;
  box-shadow: 0 18px 36px rgba(88, 45, 20, 0.12);
  overflow: hidden;
}

.portrait-frame img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  filter: grayscale(1);
}

.ai-photo-frame {
  display: grid;
  min-height: 280px;
  place-items: center;
}

.portrait-loading,
.portrait-error {
  display: grid;
  gap: 10px;
  padding: 24px;
  text-align: center;
  color: #5b6475;
}

.portrait-loading span {
  width: 54px;
  height: 54px;
  margin: 0 auto;
  border: 5px solid rgba(129, 56, 24, 0.16);
  border-top-color: #813818;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.portrait-loading strong,
.portrait-error strong {
  color: #813818;
  font-size: 16px;
}

.portrait-loading p,
.portrait-error p,
.portrait-error small {
  margin: 0;
  line-height: 1.45;
}

.portrait-error code {
  color: #813818;
  font-weight: 800;
}

.partner-form {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.partner-form input,
.partner-form select {
  width: 100%;
  min-height: 48px;
  border: 1px solid #e5d4bd;
  border-radius: 12px;
  background: #fff;
  padding: 0 12px;
  color: #1e2430;
  font: inherit;
}

.partner-date-row,
.partner-two-col {
  display: grid;
  gap: 10px;
}

.partner-date-row {
  grid-template-columns: 1fr 1fr 1fr 1.35fr;
}

.partner-two-col {
  grid-template-columns: 1fr 1fr;
}

.partner-form button {
  justify-self: start;
  min-height: 44px;
  border: 0;
  border-radius: 11px;
  padding: 0 18px;
  background: #ff8a00;
  color: #fff;
  font-weight: 900;
}

.partner-form button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.partner-note {
  margin: 10px 0 0;
  color: #667085;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.portrait-copy h3 {
  margin: 4px 0 10px;
  color: #813818;
  font-size: 26px;
}

.portrait-copy p {
  margin: 0 0 12px;
  color: #4d5a70;
  line-height: 1.6;
}

.portrait-copy ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.portrait-copy li {
  border-radius: 999px;
  background: #fff1df;
  color: #813818;
  padding: 9px 12px;
  font-weight: 800;
}

.api-help {
  margin-top: 16px;
  border-radius: 8px;
  background: #fff;
  padding: 14px 16px;
  color: #2f3544;
}

.api-help strong {
  display: block;
  margin-bottom: 8px;
  color: #8a3619;
  font-size: 16px;
}

.api-help ol {
  margin: 0;
  padding-left: 20px;
}

.api-help li {
  margin: 7px 0;
  line-height: 1.45;
}

.api-help a {
  color: #0a55cc;
  font-weight: 800;
}

.api-help code {
  border-radius: 4px;
  background: #fff3e4;
  padding: 2px 5px;
  color: #7c310f;
}

/* Product refresh */
.app-header {
  grid-template-columns: minmax(190px, auto) 1fr auto;
  min-height: 80px;
  padding: 0 clamp(18px, 5vw, 84px);
  background: rgba(255, 252, 247, 0.98);
  box-shadow: 0 12px 34px rgba(80, 45, 17, 0.08);
}

.app-header .main-nav {
  min-width: 0;
  flex-wrap: nowrap;
}

.app-header .main-nav a,
.app-header .auth-links button,
.app-header .auth-links a,
.app-header .auth-links .user-badge {
  white-space: nowrap;
}

.app-header .auth-links {
  justify-content: flex-end;
  gap: 12px;
}

.logo {
  gap: 11px;
}

.logo img {
  width: 48px;
  height: 48px;
}

.logo strong {
  color: var(--brand-dark);
  font-size: clamp(28px, 2.6vw, 38px);
  font-weight: 900;
  white-space: nowrap;
}

.logo span {
  border-radius: 999px;
  background: #fff2df;
  padding: 4px 9px;
  color: var(--brand);
  font-size: 13px;
  font-weight: 900;
}

.main-nav {
  gap: clamp(16px, 2.3vw, 34px);
}

.main-nav a {
  position: relative;
  color: #34323b;
  font-size: clamp(18px, 1.25vw, 21px);
  font-weight: 900;
  padding: 28px 6px 25px;
}

.main-nav a.active::after,
.main-nav a:hover::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 17px;
  height: 3px;
  border-radius: 999px;
  background: #ff8a00;
}

.auth-links button,
.auth-links a,
.auth-links .user-badge {
  border: 0;
  border-radius: 999px;
  background: #fff;
  color: #4c4d56;
  padding: 11px 16px;
  box-shadow: 0 8px 22px rgba(80, 45, 17, 0.08);
  font-size: 15px;
  font-weight: 900;
  text-decoration: none;
}


.theme-toggle {
  min-width: auto;
}

@media (max-width: 1500px) {
  .app-header {
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 20px;
    padding: 0 40px;
  }

  .logo img {
    width: 42px;
    height: 42px;
  }

  .logo strong {
    font-size: 31px;
  }

  .logo span {
    font-size: 12px;
    padding: 4px 8px;
  }

  .main-nav {
    gap: 20px;
  }

  .main-nav a {
    font-size: 18px;
    padding-inline: 4px;
  }

  .auth-links button,
  .auth-links a,
  .auth-links .user-badge {
    padding: 10px 14px;
    font-size: 14px;
  }

  .auth-links .user-badge {
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

@media (max-width: 1350px) {
  .app-header {
    padding: 0 28px;
    gap: 16px;
  }

  .logo strong {
    font-size: 28px;
  }

  .main-nav {
    gap: 14px;
  }

  .main-nav a {
    font-size: 17px;
  }

  .auth-links {
    gap: 9px;
  }

  .auth-links button,
  .auth-links a,
  .auth-links .user-badge {
    padding: 9px 12px;
    font-size: 13px;
  }
}

.auth-links .login-link {
  background: #ff8a00;
  color: #fff;
}

.auth-links .login-link:hover,
.auth-links a:hover,
.auth-links button:hover {
  transform: translateY(-1px);
}

.auth-links .login-link {
  color: #fff;
}

.user-badge {
  background: #f6eadc !important;
  color: #6f341a !important;
}

.hero-shell {
  grid-template-columns: minmax(320px, 0.9fr) minmax(360px, 1.05fr);
  padding-inline: clamp(18px, 6vw, 96px);
}

.day-card,
.hero-form {
  border-radius: 22px;
}

.about-band,
.daily-view,
.wallet-panel,
.history-panel {
  padding: 70px clamp(18px, 6vw, 96px);
  background: #fffaf4;
}

.section-head {
  max-width: 760px;
  margin-bottom: 22px;
}

.section-head h2,
.wallet-panel h2 {
  margin: 0 0 10px;
  color: var(--brand);
  font-size: clamp(30px, 4vw, 44px);
}

.section-head p,
.wallet-panel p {
  color: #65718a;
  font-size: 18px;
  line-height: 1.45;
}

.daily-view {
  background: linear-gradient(180deg, #fffaf4, #fff3e3);
}

.daily-tool {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: end;
  margin-bottom: 18px;
}

.daily-tool label {
  display: grid;
  gap: 7px;
  color: #6f4f39;
  font-weight: 800;
}

.daily-tool input {
  min-height: 46px;
  border: 1px solid #ead7bf;
  border-radius: 10px;
  background: #fff;
  padding: 0 14px;
}

.daily-tool button,
.wallet-card button {
  min-height: 46px;
  border: 0;
  border-radius: 10px;
  background: linear-gradient(90deg, #ff8a00, #fb9700);
  color: #fff;
  padding: 0 18px;
  font-weight: 800;
}

.daily-card-result {
  display: grid;
  grid-template-columns: 180px 1fr 120px;
  gap: 18px;
  align-items: center;
  border: 1px solid #f0d8bc;
  border-radius: 16px;
  background: #fff;
  padding: 22px;
  box-shadow: 0 14px 34px rgba(138, 75, 26, 0.09);
}

.daily-card-result strong {
  display: block;
  color: var(--brand);
  font-size: 56px;
  line-height: 1;
}

.daily-card-result b {
  color: var(--brand);
}

.daily-card-result p {
  margin: 6px 0;
}

.day-score {
  display: grid;
  place-items: center;
  width: 104px;
  height: 104px;
  border: 10px solid #83edbb;
  border-radius: 50%;
  color: #09a664;
  font-size: 30px;
  font-weight: 900;
}

.day-score small {
  font-size: 14px;
}

.daily-card-result ul {
  grid-column: 1 / -1;
  margin: 0;
  padding-left: 20px;
  color: #59657c;
  line-height: 1.55;
}

.lunar-view {
  background:
    radial-gradient(circle at 16% 10%, rgba(255, 154, 51, 0.18), transparent 30%),
    linear-gradient(180deg, #fffaf4, #fff2df);
}

.lunar-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin: 0 0 18px;
}

.lunar-toolbar button,
.lunar-toolbar select {
  min-height: 44px;
  border: 1px solid #ecd8bf;
  border-radius: 12px;
  background: #fff;
  color: #402314;
  padding: 0 14px;
  font-weight: 850;
}

.lunar-toolbar button {
  background: #fff5e8;
  color: var(--brand);
}

.lunar-toolbar button:first-child,
.lunar-toolbar button:nth-child(4) {
  width: 48px;
  padding: 0;
  font-size: 28px;
}

.lunar-board {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 22px;
  align-items: start;
}

.lunar-calendar-card,
.lunar-day-detail,
.ai-gate {
  border: 1px solid #ead7bf;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 18px 40px rgba(138, 75, 26, 0.1);
}

.lunar-calendar-card {
  padding: 16px;
}

.lunar-weekdays,
.lunar-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.lunar-weekdays {
  margin-bottom: 8px;
  color: #9a6a48;
  font-size: 13px;
  font-weight: 900;
  text-align: center;
}

.lunar-day-cell {
  min-height: 106px;
  border: 1px solid #f0dfc9;
  border-radius: 14px;
  background: #fffdfa;
  color: #331a10;
  padding: 10px;
  text-align: left;
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.lunar-day-cell:hover,
.lunar-day-cell.selected {
  border-color: #ff8a00;
  box-shadow: 0 10px 24px rgba(255, 138, 0, 0.16);
  transform: translateY(-1px);
}

.lunar-day-cell.outside {
  opacity: 0.48;
}

.lunar-day-cell.today {
  background: #fff4e1;
}

.solar-num {
  display: block;
  color: var(--brand);
  font-size: 24px;
  font-weight: 950;
}

.lunar-num {
  display: block;
  margin: 3px 0 8px;
  color: #0f8a55;
  font-size: 14px;
  font-weight: 850;
}

.lunar-day-cell small {
  color: #667085;
  font-size: 12px;
  font-weight: 750;
}

.lunar-day-detail {
  position: sticky;
  top: 92px;
  padding: 24px;
}

.lunar-day-detail h2 {
  margin: 0;
  color: var(--brand);
  font-size: 76px;
  line-height: 0.95;
}

.lunar-day-detail h3 {
  margin: 8px 0 18px;
  color: #402314;
}

.lunar-big {
  margin: 0 0 18px;
  border-radius: 14px;
  background: #fff1df;
  color: #0d6e49;
  padding: 14px;
  font-size: 18px;
  font-weight: 900;
}

.lunar-day-detail dl {
  display: grid;
  gap: 10px;
  margin: 0 0 18px;
}

.lunar-day-detail dl div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid #f1dfca;
  padding-bottom: 9px;
}

.lunar-day-detail dt {
  color: #8a684d;
  font-weight: 800;
}

.lunar-day-detail dd {
  margin: 0;
  color: #2c3548;
  font-weight: 900;
  text-align: right;
}

.lunar-day-detail ul {
  margin: 0;
  padding-left: 18px;
  color: #5d6678;
  line-height: 1.55;
}

.calendar-error {
  grid-column: 1 / -1;
  color: #b42318;
  font-weight: 800;
}

.ai-gate {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  padding: 22px;
}

.ai-gate h3 {
  margin: 4px 0 8px;
  color: var(--brand);
  font-size: 26px;
}

.ai-gate p {
  margin: 0;
  color: #667085;
  line-height: 1.55;
}

.ai-gate-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.ai-gate-actions button {
  min-height: 44px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(90deg, #ff8a00, #fb9700);
  color: #fff;
  padding: 0 16px;
  font-weight: 900;
}

.ai-gate-actions button:first-child {
  background: #fff1df;
  color: var(--brand);
}

.wallet-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 28px;
  align-items: center;
}

.wallet-card {
  border: 1px solid #ead7bf;
  border-radius: 16px;
  background: #fff;
  padding: 22px;
  box-shadow: 0 14px 34px rgba(138, 75, 26, 0.08);
}

.wallet-card span {
  color: #667085;
  font-weight: 800;
}

.wallet-card strong {
  display: block;
  margin: 8px 0 16px;
  color: var(--brand);
  font-size: 34px;
}

.wallet-card button:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.history-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.history-list article {
  border: 1px solid #ead7bf;
  border-radius: 12px;
  background: #fff;
  padding: 16px;
}

.history-list strong {
  display: block;
  color: var(--brand);
  font-size: 16px;
}

.history-list span {
  display: block;
  margin: 6px 0 10px;
  color: #7a8294;
  font-size: 12px;
}

.history-list p {
  margin: 0;
  color: #4e596d;
  line-height: 1.45;
}

.history-workspace {
  background: #fffaf4;
  padding: 70px clamp(18px, 6vw, 96px);
}

.history-tabs {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 4px;
  margin-bottom: 24px;
  padding: 4px;
  border: 1px solid #e3d4c3;
  border-radius: 8px;
  background: #f7f2ec;
}

.history-tabs button {
  min-height: 46px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #5f5964;
  padding: 0 20px;
  font-weight: 800;
}

.history-tabs button.active {
  background: #fff;
  color: var(--brand);
  box-shadow: 0 2px 8px rgba(89, 51, 31, 0.1);
}

.history-tab-panel[hidden] {
  display: none;
}

.history-panel-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid #eadcc9;
}

.history-panel-head h3 {
  margin: 0 0 5px;
  color: var(--brand-dark);
  font-size: 24px;
}

.history-panel-head p {
  margin: 0;
  color: var(--muted);
}

.history-panel-head > a,
.love-history-list > article > a {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: #fff1df;
  color: #963d18;
  padding: 0 16px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.saved-chart-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.saved-chart-list article {
  border: 1px solid #ead7bf;
  border-radius: 14px;
  background: #fff;
  padding: 16px;
  box-shadow: 0 14px 30px rgba(138, 75, 26, 0.08);
}

.saved-chart-card.active {
  border-color: #ff8a00;
  box-shadow: 0 18px 36px rgba(255, 138, 0, 0.16);
}

.saved-chart-list strong {
  display: block;
  color: var(--brand);
  font-size: 18px;
}

.saved-chart-list span {
  display: block;
  margin: 7px 0;
  color: #667085;
  font-weight: 800;
}

.saved-chart-list p {
  margin: 0 0 12px;
  color: #5b6576;
  line-height: 1.45;
}

.saved-chart-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.saved-chart-list button,
.love-history-list button,
.history-open-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border: 0;
  border-radius: 10px;
  background: linear-gradient(90deg, #ff8a00, #fb9700);
  color: #fff;
  padding: 0 14px;
  font-weight: 900;
  text-decoration: none;
}

.saved-chart-list button.danger,
.love-history-list button.danger,
.delete-reading {
  background: #fff1eb;
  color: #b42318;
}

.love-history-list {
  display: grid;
  gap: 14px;
}

.love-history-list > article {
  border: 1px solid #ead7bf;
  border-radius: 8px;
  background: #fff;
  padding: 20px;
}

.love-history-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px 22px;
  align-items: start;
}

.love-history-card strong,
.love-history-card span {
  display: block;
}

.love-history-card strong {
  color: var(--brand);
  font-size: 19px;
}

.love-history-card span {
  margin-top: 5px;
  color: #5e6980;
  font-weight: 700;
}

.love-history-card p {
  margin: 7px 0 0;
  color: var(--muted);
}

.love-history-card details {
  grid-column: 1 / -1;
  border-top: 1px solid #eadcc9;
  padding-top: 12px;
}

.love-history-card summary {
  color: var(--brand);
  cursor: pointer;
  font-weight: 800;
}

html[data-theme="dark"] .history-tabs {
  border-color: rgba(255, 214, 170, 0.2);
  background: #151210;
}

html[data-theme="dark"] .history-tabs button.active,
html[data-theme="dark"] .love-history-list > article {
  border-color: rgba(255, 214, 170, 0.2);
  background: #1c1816;
}

html[data-theme="dark"] .history-panel-head {
  border-bottom-color: rgba(255, 214, 170, 0.18);
}

@media (max-width: 680px) {
  .history-tabs {
    display: grid;
    width: 100%;
    grid-template-columns: 1fr 1fr;
  }

  .history-tabs button {
    min-width: 0;
    padding: 0 10px;
  }

  .history-panel-head {
    align-items: stretch;
    flex-direction: column;
  }

  .history-panel-head > a {
    align-self: flex-start;
  }

  .love-history-card {
    grid-template-columns: 1fr;
  }

  .love-history-card .saved-chart-actions,
  .love-history-card details {
    grid-column: 1;
  }
}

.saved-readings details {
  border-top: 1px solid #f1dfca;
  padding: 12px 0;
}

.saved-readings summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--brand);
  cursor: pointer;
  font-weight: 900;
}

.delete-reading {
  min-height: 30px;
  border: 0;
  border-radius: 8px;
  padding: 0 10px;
  font-weight: 900;
}

.history-unlock-cta {
  display: grid;
  gap: 8px;
  margin: 0 0 14px;
  border: 1px solid #f2d7a7;
  border-radius: 10px;
  background: #fff8e8;
  padding: 12px 14px;
}

.history-unlock-cta.active {
  border-color: #bde8cc;
  background: #f0fff5;
}

.history-unlock-cta strong {
  color: var(--brand);
}

.history-unlock-cta span {
  color: #667085;
}

.history-unlock-cta button {
  justify-self: start;
  min-height: 38px;
  border: 0;
  border-radius: 9px;
  padding: 0 14px;
  background: #ff8a00;
  color: #fff;
  font-weight: 900;
}

.history-list details {
  margin-top: 12px;
  border-top: 1px solid #f1dfca;
  padding-top: 10px;
}

.history-list summary {
  color: var(--brand);
  cursor: pointer;
  font-weight: 900;
}

.history-reading {
  margin-top: 10px;
  max-height: 360px;
  overflow: auto;
  color: #334155;
  font-size: 16px;
  line-height: 1.68;
}

.history-reading-note {
  margin: 10px 0 0;
  color: var(--muted);
  font-weight: 600;
  line-height: 1.55;
}

.history-reading h3 {
  margin: 12px 0 6px;
  color: var(--brand);
  font-size: 18px;
}

.history-reading p {
  margin: 0 0 10px;
}

.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background: rgba(28, 19, 14, 0.42);
  padding: 18px;
}

.auth-modal[hidden] {
  display: none;
}

.auth-dialog {
  position: relative;
  width: min(420px, 100%);
  border-radius: 18px;
  background: #fffdf8;
  padding: 28px;
  box-shadow: 0 28px 70px rgba(37, 20, 11, 0.28);
}

.auth-dialog h2 {
  margin: 0 0 18px;
  color: var(--brand);
  font-size: 30px;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 14px;
  border: 0;
  background: transparent;
  color: #8b7768;
  font-size: 28px;
}

#auth-form {
  display: grid;
  gap: 12px;
}

#auth-form input {
  min-height: 48px;
  border: 1px solid #ead7bf;
  border-radius: 10px;
  padding: 0 14px;
}

.auth-message {
  min-height: 20px;
  margin: 12px 0 0;
  color: #b42318;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0;
  color: #8b7768;
  font-size: 13px;
  font-weight: 800;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #ead7bf;
}

.google-login-wrap {
  display: grid;
}

.google-login-button {
  min-height: 50px;
  border: 1px solid #ead7bf;
  border-radius: 999px;
  background: #fff;
  color: #2f2a30;
  font-size: 16px;
  font-weight: 900;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.google-login-button span {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  border: 1px solid #e2e8f0;
  color: #1a73e8;
  font-family: "Be Vietnam Pro", Arial, sans-serif;
  font-weight: 900;
}

.google-login-button:hover {
  border-color: #ff8a00;
  box-shadow: 0 12px 26px rgba(255, 138, 0, 0.14);
}

.auth-switch {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 14px 0 0;
  color: #5f6b82;
  font-size: 15px;
}

.auth-switch button {
  border: 0;
  background: transparent;
  color: #ff8a00;
  cursor: pointer;
  font: inherit;
  font-weight: 900;
  padding: 0;
}

.feature-hero {
  position: relative;
  overflow: hidden;
  min-height: 360px;
  display: grid;
  align-items: center;
  padding: 82px clamp(18px, 8vw, 120px);
  background:
    radial-gradient(circle at 78% 24%, rgba(255, 255, 255, 0.78) 0 0, transparent 180px),
    linear-gradient(135deg, #f3c891 0%, #fff0dc 68%, #fffaf4 100%);
}

.feature-hero::after {
  content: "";
  position: absolute;
  right: -80px;
  bottom: -140px;
  width: 430px;
  height: 430px;
  border: 42px solid rgba(255, 255, 255, 0.42);
  border-radius: 50%;
}

.feature-hero > div {
  position: relative;
  z-index: 1;
  max-width: 720px;
}

.feature-hero h1,
.auth-page-copy h1 {
  margin: 0 0 16px;
  color: var(--brand-dark);
  font-size: clamp(34px, 4.8vw, 58px);
  line-height: 1.08;
  font-weight: 900;
}

.feature-hero p:last-child,
.auth-page-copy p:last-child {
  color: #5f6b82;
  font-size: clamp(17px, 1.8vw, 21px);
  line-height: 1.42;
}

.page-section {
  padding: 70px clamp(18px, 8vw, 120px);
}

.about-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  background: #fffaf4;
}

.about-grid article,
.price-grid article {
  border: 1px solid #ead7bf;
  border-radius: 18px;
  background: #fff;
  padding: 24px;
  box-shadow: 0 14px 34px rgba(138, 75, 26, 0.08);
}

.about-grid span {
  color: #fb9700;
  font-weight: 900;
}

.about-grid h2 {
  margin: 12px 0 10px;
  color: var(--brand);
  font-size: 26px;
}

.about-grid p {
  margin: 0;
  color: #5f6b82;
  line-height: 1.55;
}

.legal-section {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(360px, 1.1fr);
  gap: 28px;
  align-items: start;
  background:
    linear-gradient(135deg, rgba(255, 250, 244, 0.98), rgba(247, 252, 255, 0.98)),
    #fffaf4;
}

.legal-section > div:first-child {
  border-left: 5px solid #ff8a00;
  padding-left: 22px;
}

.legal-section h2 {
  margin: 0 0 16px;
  color: var(--brand-dark);
  font-size: clamp(30px, 3vw, 44px);
  line-height: 1.08;
}

.legal-section p {
  color: #4d5568;
  font-size: 17px;
  line-height: 1.65;
}

.legal-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.legal-list article {
  border: 1px solid rgba(138, 75, 26, 0.16);
  border-radius: 16px;
  background: #fff;
  padding: 22px;
  box-shadow: 0 14px 34px rgba(138, 75, 26, 0.07);
}

.legal-list h3 {
  margin: 0 0 10px;
  color: #7c310f;
  font-size: 21px;
}

.legal-list p {
  margin: 0;
  font-size: 15px;
  line-height: 1.58;
}

.seo-page {
  width: min(1180px, calc(100% - 48px));
  max-width: none;
  margin-inline: auto;
  padding-inline: clamp(18px, 4vw, 56px);
}

.seo-article {
  width: min(920px, 100%);
  max-width: none;
  margin: 34px auto;
  border: 1px solid #ead7bf;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.88);
  padding: clamp(24px, 4vw, 46px);
  box-shadow: 0 18px 45px rgba(108, 56, 18, 0.08);
}

.seo-article h1 {
  margin: 8px 0 16px;
  color: var(--brand-dark);
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1.02;
}

.seo-article h2 {
  margin: 30px 0 10px;
  color: #8c3b16;
  font-size: clamp(22px, 3vw, 30px);
}

.seo-article p {
  color: #5d6a82;
  font-size: 18px;
  line-height: 1.72;
}

.seo-lead {
  color: #2f3542;
  font-size: 21px;
  font-weight: 700;
}

.seo-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 30px;
}

.seo-cta .primary-button {
  min-width: 190px;
  min-height: 52px;
  border-radius: 8px;
  padding: 0 22px;
}

.seo-cta a:not(.primary-button) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 18px;
  border: 1px solid #ead7bf;
  border-radius: 8px;
  background: #fff8ed;
  color: #8c3b16;
  font-weight: 900;
  text-decoration: none;
  text-align: center;
}

.seo-link-section h2 {
  margin: 6px 0 18px;
  color: var(--brand-dark);
  font-size: clamp(28px, 4vw, 44px);
}

.seo-link-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.seo-link-grid a {
  display: grid;
  gap: 8px;
  min-height: 132px;
  border: 1px solid #ead7bf;
  border-radius: 16px;
  background: #fff;
  padding: 18px;
  color: #5d6a82;
  text-decoration: none;
  box-shadow: 0 14px 34px rgba(138, 75, 26, 0.07);
}

.seo-link-grid strong {
  color: #8c3b16;
  font-size: 18px;
}

.seo-link-grid a:hover {
  border-color: #fb9700;
  background: #fff8ed;
}

.price-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  background: #fff4e4;
}

.price-grid strong {
  display: block;
  color: var(--brand);
  font-size: 24px;
}

.price-grid span {
  display: block;
  margin: 8px 0 18px;
  color: #667085;
}

.price-grid b {
  border-radius: 999px;
  background: #fff1df;
  color: #ad5c10;
  padding: 7px 11px;
}

.topup-page {
  background: #fffaf4;
}

.topup-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
  gap: clamp(24px, 5vw, 72px);
  align-items: center;
  overflow: hidden;
  background:
    radial-gradient(circle at 92% 58%, rgba(255, 255, 255, 0.86) 0 16%, transparent 16.5%),
    radial-gradient(circle at 92% 58%, transparent 0 26%, rgba(255, 255, 255, 0.58) 26.5% 31%, transparent 31.5%),
    linear-gradient(90deg, #f7cc94 0%, #f8d9ad 46%, #fff8ef 100%);
}

.topup-hero > * {
  position: relative;
  z-index: 1;
}

.topup-balance-card,
.transfer-card {
  position: relative;
  z-index: 1;
  border: 1px solid rgba(255, 255, 255, 0.76);
  border-radius: 22px;
  background: rgba(255, 250, 244, 0.82);
  padding: 26px;
  box-shadow: 0 24px 60px rgba(120, 64, 24, 0.13);
  backdrop-filter: blur(10px);
}

.topup-balance-card span,
.transfer-card span {
  display: block;
  color: #7b5b45;
  font-weight: 900;
}

.topup-balance-card strong {
  display: block;
  margin: 8px 0;
  color: var(--brand-dark);
  font-size: 46px;
  line-height: 1;
}

.topup-balance-card p {
  margin: 0;
  color: #5f6b82;
  line-height: 1.45;
}

.section-head.compact {
  max-width: 860px;
  margin-bottom: 28px;
}

.topup-packages {
  background: linear-gradient(180deg, #fffaf4, #fff4e6);
}

.package-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.coin-package {
  position: relative;
  display: grid;
  gap: 14px;
  min-height: 330px;
  border: 1px solid #ead7bf;
  border-radius: 22px;
  background: #fffefb;
  padding: 24px;
  box-shadow: 0 18px 42px rgba(138, 75, 26, 0.08);
}

.coin-package.featured {
  border-color: #ff9a16;
  background: linear-gradient(180deg, #fff7eb, #fff);
  box-shadow: 0 22px 58px rgba(255, 138, 0, 0.18);
}

.coin-package.selected {
  outline: 3px solid rgba(255, 138, 0, 0.22);
  border-color: #ff8a00;
}

.package-label {
  width: fit-content;
  border-radius: 999px;
  background: #fff0dd;
  color: #9a4610;
  padding: 7px 11px;
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}

.coin-package strong {
  color: var(--brand-dark);
  font-size: 42px;
  line-height: 1;
}

.coin-package p {
  margin: 0;
  color: #65718a;
  line-height: 1.5;
}

.coin-package b {
  align-self: end;
  color: #0f172a;
  font-size: 24px;
}

.coin-package button,
.transfer-card button {
  min-height: 48px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(90deg, #ff7a00, #ff9d00);
  color: #fff;
  padding: 0 18px;
  font-weight: 900;
}

.coin-package button:hover,
.transfer-card button:hover {
  filter: brightness(0.98);
  transform: translateY(-1px);
}

.topup-flow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 460px);
  gap: 28px;
  align-items: start;
  background: #fffaf4;
}

.topup-flow.compact-payment-flow {
  display: flex;
  justify-content: center;
}

.compact-payment-flow .payment-card {
  width: min(560px, 100%);
}

.sepay-guide {
  display: none;
}

.topup-instructions {
  border-left: 5px solid #ff8a00;
  padding-left: 24px;
}

.topup-instructions h2 {
  margin: 0 0 16px;
  color: var(--brand-dark);
  font-size: clamp(30px, 3.6vw, 48px);
  line-height: 1.08;
}

.topup-instructions ol {
  margin: 0;
  padding-left: 22px;
  color: #4d5568;
  font-size: 18px;
  line-height: 1.75;
}

.transfer-card {
  border-color: #f0d8bc;
  background: #fff;
}

.transfer-card strong {
  display: block;
  margin: 14px 0 6px;
  color: var(--brand);
  font-size: 30px;
}

.transfer-card p {
  margin: 0 0 16px;
  color: #65718a;
}

.transfer-code {
  border: 1px dashed #ff9a16;
  border-radius: 14px;
  background: #fff8ee;
  color: #7c310f;
  padding: 16px;
  font-weight: 900;
  word-break: break-word;
}

.payment-order-box {
  margin-top: 18px;
  border: 1px solid #edf0f3;
  border-radius: 6px;
  background: #fff;
  padding: 18px 22px 22px;
  box-shadow: 0 12px 28px rgba(44, 24, 12, 0.06);
}

.qr-title {
  margin: 0 0 8px !important;
  color: #cf2633 !important;
  text-align: center;
  font-weight: 700;
}

.vietqr-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  justify-content: center;
  margin: 8px auto 12px;
  border: 0;
  background: transparent;
  padding: 0;
  text-align: center;
}

.vietqr-panel[hidden] {
  display: none;
}

.vietqr-panel img {
  width: 300px;
  height: 300px;
  max-width: min(300px, 80vw);
  border-radius: 8px;
  object-fit: contain;
  background: #fff;
  box-shadow: 0 0 0 1px #e8e8e8, 0 8px 22px rgba(16, 24, 40, 0.08);
}

.vietqr-panel img:not([src]) {
  display: none;
}

.vietqr-panel span {
  display: block;
  color: #7c310f;
  font-weight: 900;
  font-size: 22px;
}

.vietqr-panel small {
  margin-top: 0;
}

.transfer-table-title {
  margin: 8px 0 10px !important;
  color: #30343b !important;
  text-align: center;
}

.transfer-info-table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid #e6e8ec;
  background: #fff;
  font-size: 15px;
}

.transfer-info-table th,
.transfer-info-table td {
  border: 1px solid #e6e8ec;
  padding: 11px 12px;
  text-align: left;
  vertical-align: middle;
}

.transfer-info-table th {
  width: 36%;
  background: #fbfbfc;
  color: #4f5662;
  font-weight: 600;
}

.transfer-info-table td {
  color: #30343b;
  font-weight: 650;
}

.transfer-info-table #transfer-account-no,
.transfer-info-table #transfer-amount,
.transfer-info-table #transfer-code {
  color: #1871c9;
  font-weight: 900;
}

.transfer-info-table .transfer-code {
  display: inline;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
}

.transfer-code-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 38px;
  gap: 8px;
  align-items: center;
}

.copy-transfer-icon {
  width: 38px !important;
  height: 38px;
  min-height: 38px;
  display: inline-grid;
  place-items: center;
  margin: 0;
  border: 1px solid #f1d3b2;
  border-radius: 10px;
  background: #fff7ec;
  color: #8d3d12;
  padding: 0;
}

.copy-transfer-icon svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.transfer-table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.transfer-card button,
.transfer-table-actions button {
  width: auto;
  margin-top: 0;
}

.transfer-card > button {
  width: 100%;
  margin-top: 14px;
}

.transfer-warning {
  margin-top: 16px;
  border-left: 6px solid #cf2633;
  border-radius: 4px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(16, 24, 40, 0.08);
  padding: 16px 18px;
  color: #344054;
  line-height: 1.55;
}

.payment-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 14px 0;
}

.payment-actions button {
  margin-top: 0;
}

.payment-actions button.secondary {
  border: 1px solid #ead7bf;
  background: #fff8ee;
  color: #8a3b13;
}

.transfer-card small {
  display: block;
  margin-top: 12px;
  color: #667085;
  line-height: 1.45;
}

.payment-status {
  margin-top: 14px;
  border: 1px solid #ead7bf;
  border-radius: 14px;
  background: #fff8ee;
  color: #6f3215;
  padding: 12px 14px;
  font-weight: 800;
  line-height: 1.45;
}

.payment-status.ok {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #166534;
}

.payment-status.error {
  border-color: #fecaca;
  background: #fff1f2;
  color: #991b1b;
}

.payment-status.loading {
  position: relative;
  overflow: hidden;
}

.payment-status.loading::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 42%;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, #ff8a00, #ffd08a);
  animation: payment-loading 1.1s ease-in-out infinite;
}

@keyframes payment-loading {
  0% {
    transform: translateX(-105%);
  }
  100% {
    transform: translateX(250%);
  }
}

.topup-history {
  background: #fffaf4;
}

.topup-history-list {
  display: grid;
  gap: 12px;
}

.topup-history-item,
.topup-history-empty {
  border: 1px solid #ead7bf;
  border-radius: 16px;
  background: #fff;
  padding: 16px 18px;
  box-shadow: 0 12px 28px rgba(138, 75, 26, 0.06);
}

.topup-history-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 14px;
  align-items: center;
}

.topup-history-item strong {
  display: block;
  color: var(--brand);
  font-weight: 900;
  word-break: break-word;
}

.topup-history-item p,
.topup-history-item span {
  margin: 4px 0 0;
  color: #667085;
  font-size: 13px;
}

.topup-history-item b {
  display: block;
  color: #166534;
  font-size: 18px;
}

.topup-history-item em {
  justify-self: end;
  border-radius: 999px;
  padding: 7px 10px;
  font-style: normal;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.topup-history-item em.paid {
  background: #dcfce7;
  color: #166534;
}

.topup-history-item em.pending {
  background: #fff7ed;
  color: #9a3412;
}

.topup-history-item em.issue {
  background: #fee2e2;
  color: #991b1b;
}

.topup-history-empty {
  color: #667085;
  font-weight: 800;
}

.sepay-guide {
  display: none;
  background: linear-gradient(180deg, #fff7eb, #fffaf4);
}

.sepay-note {
  margin-top: 14px;
}

.sepay-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  margin-top: 16px;
  border-radius: 12px;
  background: #0f172a;
  color: #fff;
  padding: 0 18px;
  font-weight: 900;
  text-decoration: none;
}

.sepay-link:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
}

.topup-usage {
  background: #fff4e4;
}

.usage-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.usage-grid article {
  border: 1px solid #ead7bf;
  border-radius: 18px;
  background: #fff;
  padding: 24px;
  box-shadow: 0 14px 34px rgba(138, 75, 26, 0.08);
}

.usage-grid strong {
  display: block;
  color: var(--brand);
  font-size: 22px;
}

.usage-grid span {
  display: inline-block;
  margin: 12px 0;
  border-radius: 999px;
  background: #fff1df;
  color: #ad5c10;
  padding: 7px 11px;
  font-weight: 900;
}

.usage-grid p {
  margin: 0;
  color: #65718a;
  line-height: 1.55;
}

.auth-page {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(340px, 460px);
  gap: clamp(24px, 6vw, 80px);
  align-items: center;
  min-height: calc(100vh - 74px);
  padding: 70px clamp(18px, 8vw, 120px);
  background:
    radial-gradient(circle at 15% 20%, rgba(255, 255, 255, 0.95) 0 0, transparent 220px),
    linear-gradient(135deg, #f4c994, #fff7ed 64%);
}

.auth-page-card .auth-dialog {
  width: 100%;
}

@media (max-width: 760px) {
  .app-header {
    position: static;
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 14px 18px;
  }

  .main-nav,
  .auth-links {
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 12px 18px;
  }

  .logo strong {
    font-size: 28px;
  }

  .page {
    width: 100%;
    margin: 0;
    padding: 0;
  }

  .hero-shell {
    grid-template-columns: 1fr;
    gap: 16px;
    min-height: auto;
    padding: 18px 14px 26px;
  }

  .day-card {
    grid-template-columns: 1fr 1fr;
    min-height: auto;
    padding: 24px 18px;
    gap: 10px 14px;
  }

  .quote-card {
    display: flex;
    min-height: 260px;
    padding: 28px 22px;
  }

  .quote-card blockquote {
    font-size: 30px;
  }

  .quote-foot {
    align-items: flex-start;
    font-size: 15px;
  }

  .date-block strong {
    font-size: 48px;
  }

  .score-ring {
    min-height: 108px;
  }

  .score-ring svg {
    width: 108px;
    height: 108px;
  }

  .day-grid,
  .date-row,
  .field-row,
  .partner-date-row,
  .partner-two-col,
  .field-row:not(.two-col) {
    grid-template-columns: 1fr;
  }

  .date-row select + select {
    border-left: 0;
    border-top: 1px solid rgba(130, 119, 110, 0.08);
  }

  .hero-form {
    gap: 14px;
    padding: 24px 18px;
    border-radius: 22px;
  }

  .form-title h1 {
    font-size: 28px;
  }

  .form-title p {
    padding-bottom: 16px;
    font-size: 16px;
  }

  .about-band {
    padding: 42px 18px;
  }

  .about-band h2 {
    font-size: 30px;
  }

  .about-band p {
    font-size: 17px;
  }

  .floating-actions {
    display: none;
  }

  .site-header,
  .result-head {
    flex-direction: column;
  }

  .privacy {
    text-align: left;
  }

  .tool {
    max-width: none;
  }

  .tabs {
    overflow-x: auto;
  }

  .form-row,
  .select-line,
  .time-line {
    grid-template-columns: 1fr;
    gap: 7px;
    margin-bottom: 12px;
  }

  .radio-set {
    grid-column: auto;
    flex-wrap: wrap;
  }

  .inline-radio {
    gap: 20px;
  }

  .minute-label {
    justify-self: start;
  }

  .option-grid,
  .reading {
    grid-template-columns: 1fr;
  }

  .result {
    overflow: hidden;
    padding-left: 14px;
    padding-right: 14px;
  }

  .ai-suite {
    width: 100%;
    max-width: 100%;
    padding: 16px 12px;
    overflow: hidden;
  }

  .ai-suite-head {
    max-width: 100%;
    text-align: left;
  }

  .ai-suite-head h3 {
    font-size: 24px;
    overflow-wrap: anywhere;
  }

  .ai-full-package-button {
    max-width: 100%;
    min-height: 52px;
    padding: 0 12px;
    gap: 8px;
    font-size: 16px;
  }

  .ai-tabs {
    display: flex;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
  }

  .ai-tab {
    flex: 0 0 auto;
    min-width: 118px;
    font-size: 15px;
    padding: 0 12px;
  }

  .topic-card summary {
    padding: 18px 16px 12px;
    font-size: 17px;
  }

  .topic-card > p {
    padding: 0 16px 20px;
    font-size: 14px;
  }

  .topic-question-button {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 14px 16px;
  }

  .topic-question-button strong {
    justify-self: start;
  }

  .ai-task-grid {
    grid-template-columns: 1fr;
    width: 100%;
  }

  .spouse-portrait {
    grid-template-columns: 1fr;
  }

  .portrait-frame {
    max-width: 280px;
  }

  .daily-card-result,
  .lunar-board,
  .wallet-panel,
  .topup-hero,
  .topup-flow,
  .history-list,
  .saved-chart-list,
  .about-grid,
  .legal-section,
  .legal-list,
  .seo-link-grid,
  .price-grid,
  .package-grid,
  .usage-grid,
  .auth-page {
    grid-template-columns: 1fr;
  }

  .topup-balance-card {
    max-width: none;
  }

  .seo-page {
    width: min(100%, calc(100% - 16px));
    padding-inline: 0;
  }

  .seo-article {
    margin: 12px auto;
    border-radius: 12px;
  }

  .seo-cta,
  .seo-cta .primary-button,
  .seo-cta a:not(.primary-button) {
    width: 100%;
  }

  .coin-package {
    min-height: auto;
  }

  .payment-actions {
    grid-template-columns: 1fr;
  }

  .vietqr-panel {
    text-align: center;
  }

  .vietqr-panel img {
    width: min(300px, 82vw);
    height: min(300px, 82vw);
  }

  .payment-order-box {
    padding: 14px;
  }

  .transfer-info-table {
    font-size: 14px;
  }

  .topup-history-item {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .topup-history-item em {
    justify-self: start;
  }

  .transfer-info-table th,
  .transfer-info-table td {
    padding: 10px 8px;
  }

  .transfer-table-actions {
    flex-direction: column;
  }

  .transfer-table-actions button {
    width: 100%;
  }

  .lunar-calendar-card {
    padding: 10px;
  }

  .lunar-weekdays,
  .lunar-calendar-grid {
    gap: 5px;
  }

  .lunar-day-cell {
    min-height: 82px;
    border-radius: 10px;
    padding: 7px;
  }

  .solar-num {
    font-size: 19px;
  }

  .lunar-day-cell small {
    display: none;
  }

  .lunar-day-detail {
    position: static;
  }

  .ai-gate {
    align-items: stretch;
    flex-direction: column;
  }

  .ai-gate-actions {
    justify-content: flex-start;
  }

  .feature-hero {
    min-height: 300px;
    padding: 46px 18px;
  }

  .day-score {
    width: 88px;
    height: 88px;
  }

  .chart-wrap {
    width: 980px;
    max-width: none;
    overflow: visible;
    transform-origin: top left;
  }

  .chart-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-template-rows: repeat(4, var(--palace-cell-height));
  }

  .chart-center {
    min-height: 0;
  }

  .admin-page {
    padding: 18px 12px 40px;
  }

  .admin-dashboard-shell {
    grid-template-columns: 1fr;
  }

  .admin-sidebar {
    position: static;
    grid-template-columns: repeat(6, max-content);
    gap: 8px;
    overflow-x: auto;
    padding: 10px;
  }

  .admin-sidebar-title {
    display: none;
  }

  .admin-sidebar button {
    width: auto;
    white-space: nowrap;
  }

  .admin-hero,
  .panel-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .admin-stats,
  .overview-report,
  .ai-diagnostics,
  .usage-summary-grid,
  .stat-metric-grid,
  .stat-grid,
  .stat-provider-row,
  .admin-form,
  .admin-form.user-form,
  .admin-form.compact,
  .admin-grid {
    grid-template-columns: 1fr;
  }

  .stat-feature-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .support-admin-reply {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .theme-toggle {
    min-height: 36px;
    padding: 0 10px;
    font-size: 13px;
  }

  .chart-wrap {
    transform: scale(0.62);
    margin-right: -372px;
    margin-bottom: -458px;
  }
}

/* Compact account control shared by user and admin headers. */
.account-menu {
  position: relative;
  flex: 0 0 auto;
}

.account-menu[hidden],
.account-menu-panel[hidden] {
  display: none !important;
}

.auth-links .account-menu-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 44px;
  max-width: 210px;
  border: 1px solid rgba(124, 70, 31, 0.13);
  border-radius: 999px;
  padding: 7px 13px 7px 8px;
  background: #f7eee4;
  color: #542912;
  box-shadow: none;
}

.account-menu-trigger #account-menu-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-avatar {
  display: inline-grid;
  place-items: center;
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #7e3518;
  color: #fff;
  font-size: 13px;
  font-weight: 900;
}

.account-chevron {
  width: 7px;
  height: 7px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  transition: transform 160ms ease;
}

.account-menu-trigger[aria-expanded="true"] .account-chevron {
  transform: translateY(2px) rotate(225deg);
}

.account-menu-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 80;
  display: grid;
  width: min(260px, calc(100vw - 28px));
  padding: 8px;
  border: 1px solid rgba(124, 70, 31, 0.16);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 18px 42px rgba(68, 36, 16, 0.18);
}

.app-header .account-menu-panel > button,
.app-header .account-menu-panel > .user-badge {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  min-height: 42px;
  max-width: none;
  border: 0;
  border-radius: 5px;
  padding: 9px 11px;
  background: transparent !important;
  color: var(--ink) !important;
  box-shadow: none;
  text-align: left;
}

.app-header .account-menu-panel > .user-badge {
  border-bottom: 1px solid var(--header-border);
  border-radius: 0;
  font-size: 13px;
}

.app-header .account-menu-panel > button:hover {
  background: rgba(255, 138, 0, 0.1) !important;
  transform: none;
}

.app-header .account-menu-panel .theme-toggle::before {
  width: 20px;
}

.app-header .account-menu-panel #logout-button,
.app-header .account-menu-panel #admin-logout {
  color: #b3261e !important;
}

html[data-theme="dark"] .auth-links .account-menu-trigger {
  border-color: rgba(255, 154, 53, 0.24);
  background: rgba(255, 154, 53, 0.12);
  color: #fff1df;
}

html[data-theme="dark"] .account-avatar {
  background: #ff9a35;
  color: #261208;
}

html[data-theme="dark"] .account-menu-panel {
  border-color: rgba(255, 210, 151, 0.2);
  background: #211914;
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.45);
}

@media (max-width: 760px) {
  .app-header .auth-links {
    overflow: visible;
  }

  .app-header .auth-links:has(.account-menu:not([hidden])) {
    justify-content: flex-end;
    padding-right: 0;
  }

  .auth-links .account-menu-trigger {
    max-width: min(74vw, 240px);
  }

  .account-menu-panel {
    right: 0;
    margin-top: 10px;
  }
}

@media (max-width: 560px) {
  .chart-wrap {
    transform: scale(0.54);
    margin-right: -451px;
    margin-bottom: -554px;
  }
}

/* Refined relationship workspace */
.love-page {
  width: min(1180px, calc(100% - 32px));
  padding: 0 34px 64px;
  background: var(--paper);
}

.love-intro {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 40px;
  max-width: none;
  min-height: 330px;
  align-items: center;
  overflow: hidden;
  padding: 44px 52px;
  border: 1px solid #e8ddd2;
  border-radius: 8px;
  background: #fbf7f2;
}

.love-intro::after {
  content: "";
  position: absolute;
  right: -70px;
  bottom: -130px;
  width: 390px;
  height: 390px;
  background: url("assets/chart-pattern.svg") center / contain no-repeat;
  opacity: 0.08;
  pointer-events: none;
}

.love-intro-copy {
  position: relative;
  z-index: 1;
}

.love-intro h1 {
  max-width: none;
  margin-top: 8px;
  color: #281915;
  font-size: 52px;
  line-height: 1.06;
}

.love-intro > .love-intro-copy > p:last-child {
  max-width: 620px;
  margin: 18px 0 0;
  color: #655b55;
  font-size: 16px;
  line-height: 1.7;
}

.love-intro-mark {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.love-intro-mark span {
  display: grid;
  width: 112px;
  height: 112px;
  place-items: center;
  border: 1px solid #ddd0c5;
  border-radius: 50%;
  background: #fff;
  color: #8d351d;
  box-shadow: 0 12px 30px rgba(67, 44, 32, 0.1);
  font-family: Georgia, serif;
  font-size: 44px;
}

.love-intro-mark span:last-child {
  margin-left: -14px;
  color: #176f78;
}

.love-intro-mark i {
  position: relative;
  z-index: 2;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  margin-left: -14px;
  border-radius: 50%;
  background: #e4572e;
  color: #fff;
  font-style: normal;
  box-shadow: 0 6px 18px rgba(172, 56, 30, 0.25);
}

.love-workspace-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 32px;
  padding: 42px 4px 18px;
}

.love-workspace-head h2,
.love-workspace-head p {
  margin: 0;
}

.love-workspace-head h2 {
  color: var(--brand-dark);
  font-size: 28px;
}

.love-workspace-head > p {
  max-width: 470px;
  color: var(--muted);
  font-size: 13px;
  text-align: right;
}

.couple-form {
  grid-template-columns: minmax(0, 1fr) 56px minmax(0, 1fr);
  gap: 0;
  padding: 0;
  border: 1px solid #ded8d1;
  background: #fff;
  box-shadow: 0 16px 40px rgba(46, 37, 32, 0.08);
}

.person-panel {
  padding: 30px;
  background: #fff;
}

.person-panel[data-person="a"] {
  border-top: 4px solid #a64527;
}

.person-panel[data-person="b"] {
  border-top: 4px solid #176f78;
}

.person-heading {
  margin-bottom: 24px;
  padding-bottom: 18px;
  border-bottom: 1px solid #eee8e2;
}

.person-heading > span {
  width: 38px;
  height: 38px;
  background: #a64527;
  font-family: Georgia, serif;
  font-size: 17px;
}

.person-panel[data-person="b"] .person-heading > span {
  background: #176f78;
}

.person-heading p {
  color: #8b817a;
  font-size: 10px;
}

.person-heading h2 {
  color: #292421;
  font-size: 18px;
}

.person-panel label {
  color: #615a55;
  font-size: 11px;
}

.person-panel input,
.person-panel select {
  height: 44px;
  border-color: #dcd5ce;
  background: #fbfaf8;
  color: #292421;
}

.person-panel input:focus,
.person-panel select:focus {
  outline: 2px solid rgba(23, 111, 120, 0.18);
  border-color: #176f78;
}

.couple-link {
  position: relative;
  background: #f7f3ee;
}

.couple-link::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 1px;
  background: #ded8d1;
}

.couple-link span {
  position: relative;
  z-index: 1;
  width: 38px;
  height: 38px;
  border: 0;
  background: #e4572e;
  color: #fff;
  font-size: 15px;
  box-shadow: 0 5px 14px rgba(172, 56, 30, 0.2);
}

.love-submit-row {
  padding: 22px 30px;
  border-top: 1px solid #ded8d1;
  background: #f7f3ee;
}

.love-submit-row .primary-button {
  min-width: 240px;
  border-radius: 6px;
  background: #e4572e;
  box-shadow: none;
}

.love-submit-row .primary-button:hover {
  background: #c94322;
}

.love-submit-row p {
  color: #6d645e;
}

.compatibility-summary {
  padding: 34px;
  border: 1px solid #ded8d1;
  border-top: 4px solid #e4572e;
  background: #fbfaf8;
}

.compatibility-metrics {
  padding: 30px 34px;
  border-right: 1px solid #ded8d1;
  border-bottom: 1px solid #ded8d1;
  border-left: 1px solid #ded8d1;
}

.compatibility-reading {
  padding: 38px 0;
}

html[data-theme="dark"] .love-intro,
html[data-theme="dark"] .couple-form,
html[data-theme="dark"] .person-panel,
html[data-theme="dark"] .compatibility-summary {
  border-color: rgba(255, 224, 184, 0.16);
  background: #1c1816;
}

html[data-theme="dark"] .love-intro h1,
html[data-theme="dark"] .person-heading h2,
html[data-theme="dark"] .love-workspace-head h2,
html[data-theme="dark"] .compatibility-summary h2 {
  color: #fff8ef;
}

html[data-theme="dark"] .love-intro > .love-intro-copy > p:last-child,
html[data-theme="dark"] .love-workspace-head > p,
html[data-theme="dark"] .person-panel label {
  color: #c5b9ac;
}

html[data-theme="dark"] .love-intro-mark span {
  border-color: rgba(255, 224, 184, 0.18);
  background: #28211d;
}

html[data-theme="dark"] .person-heading {
  border-color: rgba(255, 224, 184, 0.12);
}

html[data-theme="dark"] .person-panel input,
html[data-theme="dark"] .person-panel select {
  border-color: rgba(255, 224, 184, 0.18);
  background: #12100f;
  color: #fff8ef;
}

html[data-theme="dark"] .couple-link,
html[data-theme="dark"] .love-submit-row {
  border-color: rgba(255, 224, 184, 0.14);
  background: #151210;
}

html[data-theme="dark"] .couple-link::before {
  background: rgba(255, 224, 184, 0.14);
}

html[data-theme="dark"] .compatibility-metrics {
  border-color: rgba(255, 224, 184, 0.16);
}

@media (max-width: 820px) {
  .love-page {
    width: min(100% - 20px, 720px);
    padding-inline: 18px;
  }

  .love-intro {
    grid-template-columns: 1fr 190px;
    min-height: 270px;
    padding: 34px;
  }

  .love-intro h1 {
    font-size: 42px;
  }

  .love-intro-mark span {
    width: 82px;
    height: 82px;
    font-size: 32px;
  }

  .couple-form {
    grid-template-columns: 1fr;
  }

  .couple-link {
    height: 54px;
  }

  .couple-link::before {
    top: 50%;
    right: 0;
    bottom: auto;
    left: 0;
    width: auto;
    height: 1px;
  }
}

@media (max-width: 560px) {
  .love-page {
    width: calc(100% - 12px);
    padding: 0 8px 42px;
  }

  .love-intro {
    display: block;
    min-height: 0;
    padding: 28px 22px;
  }

  .love-intro h1 {
    font-size: 34px;
  }

  .love-intro > .love-intro-copy > p:last-child {
    font-size: 14px;
    line-height: 1.6;
  }

  .love-intro-mark {
    display: none;
  }

  .love-workspace-head {
    display: block;
    padding: 30px 4px 14px;
  }

  .love-workspace-head h2 {
    font-size: 22px;
  }

  .love-workspace-head > p {
    margin-top: 8px;
    text-align: left;
  }

  .couple-form {
    margin: 0;
  }

  .person-panel {
    padding: 22px 18px;
  }

  .love-date-grid {
    grid-template-columns: 0.8fr 0.8fr 1.4fr;
  }

  .love-date-grid label:last-child {
    grid-column: auto;
  }

  .love-field-grid {
    grid-template-columns: 1fr 1fr;
  }

  .love-field-grid label:first-child {
    grid-column: 1 / -1;
  }

  .love-submit-row {
    padding: 20px 18px;
  }

  .compatibility-summary,
  .compatibility-metrics {
    padding: 24px 20px;
  }
}

@media (max-width: 480px) {
  .chart-wrap {
    transform: scale(0.46);
    margin-right: -529px;
    margin-bottom: -650px;
  }
}

@media (max-width: 430px) {
  .chart-wrap {
    transform: scale(0.40);
    margin-right: -588px;
    margin-bottom: -721px;
  }
}

@media (max-width: 390px) {
  .chart-wrap {
    transform: scale(0.36);
    margin-right: -627px;
    margin-bottom: -771px;
  }
}

/* Final love page cascade: keep these after legacy responsive rules. */
.love-page .love-intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 40px;
  max-width: none;
  min-height: 330px;
  align-items: center;
  padding: 44px 52px;
}

.love-page .love-intro h1 {
  max-width: none;
  font-size: 52px;
}

.love-page .couple-form {
  grid-template-columns: minmax(0, 1fr) 56px minmax(0, 1fr);
  gap: 0;
  padding: 0;
  background: #fff;
}

.love-page .person-panel {
  padding: 30px;
}

.love-page .couple-link {
  background: #f7f3ee;
}

.love-page .love-submit-row {
  padding: 22px 30px;
}

html[data-theme="dark"] .love-page .couple-form,
html[data-theme="dark"] .love-page .person-panel {
  background: #1c1816;
}

html[data-theme="dark"] .love-page .couple-link,
html[data-theme="dark"] .love-page .love-submit-row {
  background: #151210;
}

@media (max-width: 820px) {
  .love-page .love-intro {
    grid-template-columns: 1fr 190px;
    min-height: 270px;
    padding: 34px;
  }

  .love-page .love-intro h1 {
    font-size: 42px;
  }

  .love-page .couple-form {
    grid-template-columns: 1fr;
  }

  .love-page .couple-link {
    height: 54px;
  }
}

@media (max-width: 560px) {
  .love-page .love-intro {
    display: block;
    min-height: 0;
    padding: 28px 22px;
  }

  .love-page .love-intro h1 {
    font-size: 34px;
  }

  .love-page .couple-form {
    margin: 0;
  }

  .love-page .person-panel {
    padding: 22px 18px;
  }

  .love-page .love-date-grid {
    grid-template-columns: 0.8fr 0.8fr 1.4fr;
  }

  .love-page .love-date-grid label:last-child {
    grid-column: auto;
  }

  .love-page .love-submit-row {
    padding: 20px 18px;
  }

  body:has(.love-page) .contact-float {
    display: none;
  }
}

/* Love compatibility */
.love-page {
  padding-bottom: 56px;
}

.love-intro {
  max-width: 760px;
  padding: 54px 0 30px;
}

.love-intro h1 {
  max-width: 680px;
  color: var(--brand-dark);
  font-size: clamp(36px, 6vw, 68px);
}

.love-intro > p:last-child {
  max-width: 700px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 17px;
}

.couple-form {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 50px minmax(0, 1fr);
  gap: 18px;
  align-items: stretch;
  padding: 28px;
  border: 1px solid rgba(135, 56, 22, 0.18);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(255, 245, 233, 0.92), rgba(255, 253, 248, 0.98));
}

.person-panel {
  min-width: 0;
  padding: 4px;
}

.person-heading {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-bottom: 22px;
}

.person-heading > span {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 50%;
  background: #873816;
  color: #fff;
  font-size: 18px;
  font-weight: 800;
}

.person-panel[data-person="b"] .person-heading > span {
  background: #176f78;
}

.person-heading p,
.person-heading h2 {
  margin: 0;
}

.person-heading p {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.person-heading h2 {
  font-size: 20px;
  line-height: 1.25;
}

.person-panel label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.person-panel input,
.person-panel select {
  width: 100%;
  height: 46px;
  min-width: 0;
  border: 1px solid rgba(75, 58, 43, 0.24);
  border-radius: 6px;
  background: var(--paper);
  color: var(--ink);
  padding: 0 12px;
  font-size: 14px;
}

.love-date-grid,
.love-field-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 15px;
}

.couple-link {
  display: grid;
  place-items: center;
}

.couple-link span {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(135, 56, 22, 0.22);
  border-radius: 50%;
  background: var(--paper);
  color: var(--brand);
  font-size: 24px;
  font-weight: 700;
}

.love-submit-row {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding-top: 8px;
}

.love-submit-row .primary-button {
  width: auto;
  min-width: 220px;
  margin: 0;
}

.love-submit-row p {
  max-width: 430px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.compatibility-result {
  scroll-margin-top: 24px;
  margin-top: 34px;
}

.compatibility-summary {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 28px;
  align-items: center;
  padding: 28px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.compatibility-summary h2 {
  margin-bottom: 8px;
  color: var(--brand-dark);
  font-size: clamp(28px, 4vw, 44px);
}

.compatibility-summary p:last-child {
  max-width: 650px;
  margin: 0;
  color: var(--muted);
}

.compatibility-ring {
  display: grid;
  width: 142px;
  height: 142px;
  place-content: center;
  border-radius: 50%;
  background: radial-gradient(circle at center, var(--paper) 61%, transparent 62%), conic-gradient(#e4572e calc(var(--score) * 1%), #e6ddd3 0);
  text-align: center;
}

.compatibility-ring strong {
  color: var(--brand-dark);
  font-size: 42px;
  line-height: 1;
}

.compatibility-ring span {
  color: var(--muted);
  font-size: 13px;
}

.compatibility-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 30px;
  padding: 28px 0;
}

.metric > div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  font-size: 13px;
}

.metric-track {
  height: 8px;
  overflow: hidden;
  border-radius: 4px;
  background: #e6ddd3;
}

.metric-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #176f78;
}

.compatibility-reading {
  max-width: 860px;
  margin: 18px auto 0;
  padding: 30px 0;
  border-top: 1px solid var(--line);
}

.compatibility-reading h3 {
  margin: 30px 0 10px;
  color: var(--brand-dark);
  font-size: 22px;
}

.compatibility-reading p,
.compatibility-reading li {
  color: var(--ink);
  line-height: 1.75;
}

.compatibility-table-wrap {
  width: 100%;
  margin: 18px 0 26px;
  overflow-x: auto;
  border: 1px solid #eadcc9;
  border-radius: 8px;
  background: #fffaf4;
}

.compatibility-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.55;
}

.compatibility-table th,
.compatibility-table td {
  padding: 12px 14px;
  border-bottom: 1px solid #eadcc9;
  border-right: 1px solid #eadcc9;
  text-align: left;
  vertical-align: top;
}

.compatibility-table th:last-child,
.compatibility-table td:last-child {
  border-right: 0;
}

.compatibility-table tr:last-child td {
  border-bottom: 0;
}

.compatibility-table th {
  background: #fff1df;
  color: var(--brand-dark);
  font-weight: 800;
}

.compatibility-table td:first-child,
.compatibility-table th:first-child {
  width: 72px;
  text-align: center;
  white-space: nowrap;
}

.compatibility-table td:nth-child(3),
.compatibility-table th:nth-child(3),
.compatibility-table td:nth-child(4),
.compatibility-table th:nth-child(4) {
  white-space: nowrap;
}

.ai-table-wrap {
  width: 100%;
  margin: 18px 0 24px;
  overflow-x: auto;
  border: 1px solid #eadcc9;
  border-radius: 6px;
  background: #fff;
}

.ai-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.55;
}

.ai-table th,
.ai-table td {
  padding: 12px 14px;
  border-right: 1px solid #eadcc9;
  border-bottom: 1px solid #eadcc9;
  text-align: left;
  vertical-align: top;
}

.ai-table th {
  background: #fff1df;
  color: var(--brand-dark);
  font-weight: 800;
}

.ai-table th:last-child,
.ai-table td:last-child {
  border-right: 0;
}

.ai-table tr:last-child td {
  border-bottom: 0;
}

.ai-table th:first-child,
.ai-table td:first-child {
  width: 150px;
  font-weight: 700;
  white-space: nowrap;
}

.ai-table th:nth-child(2),
.ai-table td:nth-child(2) {
  width: 90px;
  text-align: center;
  white-space: nowrap;
}

.commerce-price-form,
.voucher-form {
  align-items: end;
}

.appearance-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.appearance-form .range-label {
  gap: 10px;
}

.appearance-form input[type="range"] {
  width: 100%;
  accent-color: var(--orange);
}

.appearance-form input[type="file"] {
  margin-top: 8px;
  padding: 10px;
  min-height: 44px;
  background: rgba(255, 255, 255, 0.62);
}

.appearance-preview {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 220px minmax(240px, 1fr);
  gap: 14px;
}

.appearance-preview > div {
  min-height: 150px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
}

.appearance-preview span {
  position: absolute;
  left: 12px;
  top: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.appearance-preview img {
  max-width: 112px;
  max-height: 112px;
  object-fit: contain;
}

.appearance-watermark-preview::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--preview-watermark-image, var(--chart-watermark-image)) center / 128px no-repeat;
  opacity: var(--preview-watermark-opacity, var(--chart-watermark-opacity));
}

.appearance-watermark-preview::after {
  content: "THIÊN BÀN";
  position: relative;
  z-index: 1;
  color: #263dc2;
  font-weight: 900;
  letter-spacing: 0;
}

.commerce-package-editor {
  grid-column: 1 / -1;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.commerce-package-editor h3 {
  margin: 0 0 12px;
  font-size: 16px;
}

.commerce-package-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.commerce-package-grid article {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper);
}

.commerce-package-grid article strong {
  color: var(--brand-dark);
}

.voucher-table-wrap td:first-child strong,
.voucher-table-wrap td:first-child small {
  display: block;
}

.voucher-table-wrap td:first-child small {
  margin-top: 4px;
  color: var(--muted);
}

.voucher-redeem-section {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(320px, 1.3fr);
  align-items: center;
  gap: 24px;
  padding-block: 24px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.voucher-redeem-section h2,
.voucher-redeem-section p {
  margin: 4px 0;
}

.voucher-redeem-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.voucher-redeem-form input,
.voucher-redeem-form button {
  min-height: 48px;
  border-radius: 6px;
}

.voucher-redeem-form input {
  border: 1px solid var(--line);
  padding: 0 14px;
  text-transform: uppercase;
}

.voucher-redeem-form button {
  border: 0;
  padding: 0 20px;
  background: var(--brand);
  color: #fff;
  font-weight: 800;
}

.voucher-redeem-status {
  grid-column: 1 / -1;
  padding: 10px 12px;
  border-left: 3px solid var(--brand);
  background: var(--soft);
}

.voucher-redeem-status.ok {
  border-color: #1b9a59;
  color: #126d40;
}

.voucher-redeem-status.error {
  border-color: #c8372d;
  color: #a1251d;
}

@media (max-width: 900px) {
  .commerce-package-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .commerce-package-grid {
    grid-template-columns: 1fr;
  }

  .appearance-form,
  .appearance-preview {
    grid-template-columns: 1fr;
  }

  .voucher-redeem-section,
  .voucher-redeem-form {
    grid-template-columns: 1fr;
  }
}

.love-status {
  padding: 34px;
  border-left: 4px solid #176f78;
  background: var(--soft);
}

.love-status.warning {
  border-left-color: #d13b2f;
}

.love-status p {
  margin-bottom: 18px;
  color: var(--muted);
}

html[data-theme="dark"] .couple-form {
  border-color: rgba(255, 192, 120, 0.18);
  background: linear-gradient(135deg, rgba(53, 31, 20, 0.94), rgba(28, 21, 17, 0.98));
}

html[data-theme="dark"] .person-panel input,
html[data-theme="dark"] .person-panel select {
  border-color: rgba(255, 224, 184, 0.2);
}

html[data-theme="dark"] .metric-track {
  background: #3a302a;
}

@media (max-width: 820px) {
  .love-intro {
    padding-top: 36px;
  }

  .couple-form {
    grid-template-columns: 1fr;
    padding: 20px;
  }

  .couple-link {
    height: 30px;
  }

  .love-submit-row {
    grid-column: 1;
    align-items: stretch;
    flex-direction: column;
  }

  .love-submit-row .primary-button {
    width: 100%;
  }
}

@media (max-width: 560px) {
  .love-page {
    padding-inline: 15px;
  }

  .love-intro h1 {
    font-size: 38px;
  }

  .couple-form {
    margin-inline: -4px;
    padding: 17px;
  }

  .love-date-grid,
  .love-field-grid {
    grid-template-columns: 1fr 1fr;
  }

  .love-date-grid label:last-child,
  .love-field-grid label:first-child {
    grid-column: 1 / -1;
  }

  .compatibility-summary {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .compatibility-ring {
    width: 126px;
    height: 126px;
  }

  .compatibility-metrics {
    grid-template-columns: 1fr;
  }

  .love-status {
    padding: 24px 20px;
  }
}

@media print {
  body {
    background: #fff;
  }

  .page {
    box-shadow: none;
    width: 100%;
    margin: 0;
  }

  .site-header,
  .tool,
  .result-actions {
    display: none;
  }
}

/* Admin responsive hardening */
body:has(.admin-page) {
  overflow-x: hidden;
  overflow-y: auto;
}

.admin-page {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  overflow-y: visible;
}

.admin-dashboard-shell,
.admin-main,
.admin-view,
.admin-panel {
  min-width: 0;
  max-width: 100%;
}

.admin-panel {
  overflow: hidden;
}

.admin-panel .table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
}

.admin-panel .admin-table {
  min-width: 920px;
}

.admin-panel .admin-table th,
.admin-panel .admin-table td {
  white-space: normal;
  overflow-wrap: anywhere;
}

.admin-panel .admin-table td:last-child {
  min-width: 86px;
}

.provider-table-wrap {
  margin-inline: -6px;
  padding-inline: 6px;
}

.provider-table-wrap .admin-table {
  min-width: 980px;
  table-layout: fixed;
}

.provider-table-wrap.table-size-compact .admin-table {
  min-width: 880px;
}

.provider-table-wrap.table-size-balanced .admin-table {
  min-width: 980px;
}

.provider-table-wrap.table-size-wide .admin-table {
  min-width: 1180px;
}

.provider-table-wrap .admin-table th:nth-child(1),
.provider-table-wrap .admin-table td:nth-child(1) {
  width: 74px;
}

.provider-table-wrap.table-size-compact .admin-table th:nth-child(1),
.provider-table-wrap.table-size-compact .admin-table td:nth-child(1) {
  width: 64px;
}

.provider-table-wrap .admin-table th:nth-child(2),
.provider-table-wrap .admin-table td:nth-child(2) {
  width: 96px;
}

.provider-table-wrap.table-size-compact .admin-table th:nth-child(2),
.provider-table-wrap.table-size-compact .admin-table td:nth-child(2) {
  width: 84px;
}

.provider-table-wrap .admin-table th:nth-child(3),
.provider-table-wrap .admin-table td:nth-child(3) {
  width: 104px;
}

.provider-table-wrap.table-size-compact .admin-table th:nth-child(3),
.provider-table-wrap.table-size-compact .admin-table td:nth-child(3) {
  width: 88px;
}

.provider-table-wrap .admin-table th:nth-child(4),
.provider-table-wrap .admin-table td:nth-child(4) {
  width: 150px;
}

.provider-table-wrap.table-size-compact .admin-table th:nth-child(4),
.provider-table-wrap.table-size-compact .admin-table td:nth-child(4) {
  width: 132px;
}

.provider-table-wrap.table-size-wide .admin-table th:nth-child(4),
.provider-table-wrap.table-size-wide .admin-table td:nth-child(4) {
  width: 170px;
}

.provider-table-wrap .admin-table th:nth-child(5),
.provider-table-wrap .admin-table td:nth-child(5) {
  width: 200px;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.provider-table-wrap.table-size-compact .admin-table th:nth-child(5),
.provider-table-wrap.table-size-compact .admin-table td:nth-child(5) {
  width: 150px;
}

.provider-table-wrap.table-size-wide .admin-table th:nth-child(5),
.provider-table-wrap.table-size-wide .admin-table td:nth-child(5) {
  width: 300px;
}

.provider-table-wrap .admin-table th:nth-child(6),
.provider-table-wrap .admin-table td:nth-child(6) {
  width: 118px;
}

.provider-table-wrap.table-size-compact .admin-table th:nth-child(6),
.provider-table-wrap.table-size-compact .admin-table td:nth-child(6) {
  width: 104px;
}

.provider-table-wrap .admin-table th:nth-child(7),
.provider-table-wrap .admin-table td:nth-child(7) {
  width: 104px;
}

.provider-table-wrap.table-size-compact .admin-table th:nth-child(7),
.provider-table-wrap.table-size-compact .admin-table td:nth-child(7) {
  width: 90px;
}

.provider-table-wrap .admin-table th:nth-child(8),
.provider-table-wrap .admin-table td:nth-child(8) {
  width: 154px;
}

.provider-table-wrap.table-size-compact .admin-table th:nth-child(8),
.provider-table-wrap.table-size-compact .admin-table td:nth-child(8) {
  width: 146px;
}

.provider-table-wrap.hide-base-url .admin-table {
  min-width: 760px;
}

.provider-table-wrap.hide-base-url .admin-table th:nth-child(5),
.provider-table-wrap.hide-base-url .admin-table td:nth-child(5) {
  display: none;
}

.provider-table-wrap .admin-table td:last-child {
  display: grid;
  grid-template-columns: repeat(2, minmax(66px, 1fr));
  gap: 8px;
  min-width: 0;
}

.provider-table-wrap .admin-table td:last-child button {
  width: 100%;
  min-width: 0;
  margin: 0;
  padding-inline: 8px;
}

@media (min-width: 981px) {
  body:has(.admin-page) {
    overflow-x: hidden;
  }

  .admin-page {
    width: 100%;
    max-width: 100%;
  }

  .admin-dashboard-shell {
    grid-template-columns: 236px minmax(0, 1fr);
    gap: 18px;
  }

  .admin-sidebar {
    min-width: 0;
  }
}

@media (max-width: 980px) {
  body:has(.admin-page) {
    overflow-x: hidden;
    overflow-y: auto;
  }

  .admin-page {
    width: 100%;
    max-width: 100%;
    padding: 14px 10px 96px;
  }

  .admin-dashboard-shell {
    display: block;
  }

  .admin-sidebar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    max-width: 100%;
    margin: 0 0 12px;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    border-radius: 14px;
    padding: 9px;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
  }

  .admin-sidebar-title {
    display: none;
  }

  .admin-sidebar button {
    flex: 0 0 auto;
    width: auto;
    min-height: 38px;
    padding: 8px 12px;
    white-space: nowrap;
    scroll-snap-align: start;
  }

  .admin-hero {
    margin-bottom: 14px;
  }

  .admin-hero h1 {
    font-size: clamp(30px, 8vw, 44px);
    line-height: 1.05;
  }

  .admin-panel {
    padding: 14px;
    border-radius: 14px;
  }

  .admin-form,
  .admin-form.compact,
  .admin-form.user-form {
    grid-template-columns: 1fr;
  }

  .admin-actions,
  .panel-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-actions button {
    width: 100%;
  }

  .admin-pager {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-pager div {
    justify-content: space-between;
  }

  .admin-panel .admin-table {
    min-width: 880px;
    font-size: 13px;
  }

  .provider-table-wrap .admin-table {
    min-width: 960px;
  }

  .provider-table-wrap.table-size-compact .admin-table {
    min-width: 860px;
  }

  .provider-table-wrap.table-size-wide .admin-table {
    min-width: 1160px;
  }

  .provider-table-wrap.hide-base-url .admin-table {
    min-width: 740px;
  }

  .admin-panel .admin-table th,
  .admin-panel .admin-table td {
    padding: 9px 8px;
  }

  .admin-grid,
  .stat-grid,
  .stat-metric-grid,
  .provider-status-grid,
  .stat-provider-row,
  .stat-feature-row {
    grid-template-columns: 1fr;
  }

  .provider-status-row,
  .error-group-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .support-admin-list,
  .support-admin-messages,
  .admin-list {
    max-height: min(62vh, 520px);
    overflow: auto;
    -webkit-overflow-scrolling: touch;
  }
}

@media (max-width: 560px) {
  .admin-page {
    padding-inline: 8px;
  }

  .admin-section-head,
  .admin-panel {
    padding: 12px;
  }

  .admin-panel .admin-table {
    min-width: 820px;
  }

  .provider-table-wrap .admin-table {
    min-width: 920px;
  }

  .provider-table-wrap.table-size-compact .admin-table {
    min-width: 820px;
  }

  .provider-table-wrap.hide-base-url .admin-table {
    min-width: 720px;
  }
}

/* High-contrast dark mode overrides */
html[data-theme="dark"] {
  --ink: #f8fafc;
  --muted: #d2d8e3;
  --line: rgba(255, 214, 170, 0.28);
  --paper: #121417;
  --soft: #1d2127;
  --cream: #181c22;
  --panel: #1b2027;
  --body-bg: #0d1117;
  --header-bg: rgba(14, 17, 22, 0.96);
  --header-border: rgba(255, 214, 170, 0.2);
  --text-strong: #ffffff;
  --brand: #ffb15c;
  --brand-dark: #fff4e5;
  --hero-bg-a: #1f2630;
  --hero-bg-b: #151a21;
  --hero-bg-c: #0d1117;
  --card-bg: rgba(25, 30, 38, 0.96);
}

html[data-theme="dark"] body,
html[data-theme="dark"] .page {
  background: var(--body-bg);
  color: var(--ink);
}

html[data-theme="dark"] .app-header {
  background: var(--header-bg);
  border-bottom-color: var(--header-border);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.36);
}

html[data-theme="dark"] .logo strong,
html[data-theme="dark"] h1,
html[data-theme="dark"] h2,
html[data-theme="dark"] h3,
html[data-theme="dark"] h4,
html[data-theme="dark"] strong {
  color: var(--text-strong);
}

html[data-theme="dark"] .logo span {
  background: rgba(255, 177, 92, 0.16);
  color: #ffd7aa;
}

html[data-theme="dark"] .main-nav a,
html[data-theme="dark"] .auth-links a,
html[data-theme="dark"] .auth-links button,
html[data-theme="dark"] .auth-links .user-badge {
  background: rgba(255, 255, 255, 0.06);
  color: #eef2f7;
  box-shadow: none;
}

html[data-theme="dark"] .main-nav a {
  background: transparent;
  color: #f2f5fa;
}

html[data-theme="dark"] .main-nav a.active,
html[data-theme="dark"] .auth-links .login-link {
  color: #ffb15c;
}

html[data-theme="dark"] .auth-links .login-link {
  background: #ff8a00;
  color: #16110b;
}

html[data-theme="dark"] .theme-toggle {
  border-color: rgba(255, 177, 92, 0.44);
  background: rgba(255, 177, 92, 0.14);
  color: #fff4e5;
}

html[data-theme="dark"] .hero-shell,
html[data-theme="dark"] .feature-hero,
html[data-theme="dark"] .lunar-view,
html[data-theme="dark"] .admin-page {
  background:
    radial-gradient(circle at 18% 28%, rgba(255, 138, 0, 0.12) 0 0, transparent 220px),
    linear-gradient(180deg, #1e252f 0%, #151a21 70%, #0d1117 100%);
}

html[data-theme="dark"] .day-card,
html[data-theme="dark"] .hero-form,
html[data-theme="dark"] .ai-suite,
html[data-theme="dark"] .ai-tabs,
html[data-theme="dark"] .ai-chart-tools-panel,
html[data-theme="dark"] .ai-reading,
html[data-theme="dark"] .reading article,
html[data-theme="dark"] .admin-hero,
html[data-theme="dark"] .admin-panel,
html[data-theme="dark"] .admin-alert,
html[data-theme="dark"] .admin-stats article,
html[data-theme="dark"] .admin-list article,
html[data-theme="dark"] .wallet-card,
html[data-theme="dark"] .wallet-panel,
html[data-theme="dark"] .history-workspace,
html[data-theme="dark"] .feature-hero,
html[data-theme="dark"] .history-unlock-cta,
html[data-theme="dark"] .auth-page-card .auth-dialog {
  border-color: rgba(255, 214, 170, 0.24);
  background: var(--card-bg);
  color: var(--ink);
}

html[data-theme="dark"] p,
html[data-theme="dark"] .privacy,
html[data-theme="dark"] .reading p,
html[data-theme="dark"] .ai-suite-head p:last-child,
html[data-theme="dark"] .feature-hero p,
html[data-theme="dark"] .history-list p,
html[data-theme="dark"] .history-reading p,
html[data-theme="dark"] .saved-chart-list p,
html[data-theme="dark"] .result-meta,
html[data-theme="dark"] #result-meta,
html[data-theme="dark"] .wallet-panel p,
html[data-theme="dark"] .admin-panel p,
html[data-theme="dark"] .admin-list span,
html[data-theme="dark"] .usage-log small {
  color: var(--muted);
}

html[data-theme="dark"] .provider-status-card,
html[data-theme="dark"] .provider-status-row,
html[data-theme="dark"] .error-group-summary {
  border-color: rgba(255, 210, 151, 0.16);
  background: rgba(31, 23, 18, 0.92);
}

html[data-theme="dark"] .provider-status-card strong,
html[data-theme="dark"] .provider-status-row strong {
  color: var(--ink);
}

html[data-theme="dark"] .provider-status-card span,
html[data-theme="dark"] .provider-status-card small,
html[data-theme="dark"] .provider-status-row span {
  color: var(--muted);
}

html[data-theme="dark"] .provider-status-row em,
html[data-theme="dark"] .error-count,
html[data-theme="dark"] .error-group b {
  background: rgba(255, 210, 151, 0.12);
  color: #ffd59b;
}

html[data-theme="dark"] .ai-reading,
html[data-theme="dark"] .ai-text,
html[data-theme="dark"] .history-reading {
  color: #edf3ff;
}

html[data-theme="dark"] .ai-text p,
html[data-theme="dark"] .ai-text div,
html[data-theme="dark"] .ai-text span,
html[data-theme="dark"] .ai-text li,
html[data-theme="dark"] .history-reading p,
html[data-theme="dark"] .history-reading div,
html[data-theme="dark"] .history-reading span,
html[data-theme="dark"] .history-reading li,
html[data-theme="dark"] .ai-reading.loading p,
html[data-theme="dark"] .ai-reading.warning p {
  color: #dbe7f7;
}

html[data-theme="dark"] .ai-text h3,
html[data-theme="dark"] .history-reading h3 {
  color: #ffd7aa;
}

html[data-theme="dark"] .kicker,
html[data-theme="dark"] .reading-provider,
html[data-theme="dark"] .ai-suite-head h3,
html[data-theme="dark"] .ai-task-group h4,
html[data-theme="dark"] .day-date,
html[data-theme="dark"] .day-card strong {
  color: #ffd7aa;
}

html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea,
html[data-theme="dark"] .hero-form input[type="text"],
html[data-theme="dark"] .hero-form select,
html[data-theme="dark"] .date-row,
html[data-theme="dark"] .ai-date-tools select,
html[data-theme="dark"] .lunar-toolbar button,
html[data-theme="dark"] .lunar-toolbar select {
  border-color: rgba(255, 214, 170, 0.28);
  background-color: #10151d;
  color: #f8fafc;
}

html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder {
  color: #aab4c2;
}

html[data-theme="dark"] .ai-task-button,
html[data-theme="dark"] .ai-tab,
html[data-theme="dark"] .ai-year-pager button,
html[data-theme="dark"] .secondary-button,
html[data-theme="dark"] .topic-card,
html[data-theme="dark"] .topic-question-button,
html[data-theme="dark"] .ai-question-box,
html[data-theme="dark"] .saved-chart-card,
html[data-theme="dark"] .history-list article {
  border-color: rgba(255, 214, 170, 0.24);
  background: #151b24;
  color: #fff4e5;
}

html[data-theme="dark"] .ai-task-button:hover,
html[data-theme="dark"] .ai-tab:not(.active):hover,
html[data-theme="dark"] .ai-year-pager button:not(:disabled):hover,
html[data-theme="dark"] .secondary-button:hover,
html[data-theme="dark"] .topic-question-button:hover,
html[data-theme="dark"] .saved-chart-card.active {
  border-color: #ffb15c;
  background: #1e2631;
}

html[data-theme="dark"] .ai-year-pager {
  color: #ffd7aa;
}

html[data-theme="dark"] .ai-year-limit-note {
  color: #ffd7aa;
}

html[data-theme="dark"] .topic-card summary,
html[data-theme="dark"] .topic-card > p,
html[data-theme="dark"] .topic-question-button {
  color: #fff4e5;
}

html[data-theme="dark"] .topic-card summary b {
  border-color: rgba(255, 214, 170, 0.24);
  color: #ffd7aa;
}

html[data-theme="dark"] .ai-tab.active {
  background: #ff8a00;
  color: #16110b;
}

html[data-theme="dark"] .ai-task-button small {
  background: rgba(255, 177, 92, 0.18);
  color: #ffd7aa;
}

html[data-theme="dark"] .ai-task-button small.free {
  background: rgba(34, 197, 94, 0.16);
  color: #86efac;
}

html[data-theme="dark"] .ai-task-button small.viewed {
  background: rgba(34, 197, 94, 0.18);
  border-color: rgba(134, 239, 172, 0.22);
  color: #86efac;
}

html[data-theme="dark"] .ai-question-box p {
  color: #c9d2df;
}

html[data-theme="dark"] .ai-suggestion-button {
  border-color: rgba(255, 214, 170, 0.24);
  background: #1e2631;
  color: #ffd7aa;
}

html[data-theme="dark"] .ai-suggestion-button:hover {
  border-color: #ffb15c;
  background: #263140;
}

html[data-theme="dark"] .topup-page,
html[data-theme="dark"] .topup-packages,
html[data-theme="dark"] .topup-flow,
html[data-theme="dark"] .topup-history,
html[data-theme="dark"] .topup-usage {
  background: #10131a;
}

html[data-theme="dark"] .topup-balance-card,
html[data-theme="dark"] .coin-package,
html[data-theme="dark"] .transfer-card,
html[data-theme="dark"] .topup-history-item,
html[data-theme="dark"] .topup-history-empty,
html[data-theme="dark"] .usage-grid article {
  border-color: rgba(255, 255, 255, 0.12);
  background: #171b24;
  box-shadow: none;
}

html[data-theme="dark"] .coin-package.featured {
  border-color: rgba(255, 154, 22, 0.72);
  background: linear-gradient(180deg, rgba(255, 138, 0, 0.12), #171b24);
}

html[data-theme="dark"] .topup-balance-card strong,
html[data-theme="dark"] .coin-package strong,
html[data-theme="dark"] .coin-package b,
html[data-theme="dark"] .topup-instructions h2,
html[data-theme="dark"] .transfer-card strong,
html[data-theme="dark"] .usage-grid strong {
  color: #fff7ed;
}

html[data-theme="dark"] .topup-balance-card p,
html[data-theme="dark"] .coin-package p,
html[data-theme="dark"] .topup-instructions ol,
html[data-theme="dark"] .transfer-card p,
html[data-theme="dark"] .transfer-card small,
html[data-theme="dark"] .topup-history-item p,
html[data-theme="dark"] .topup-history-item span,
html[data-theme="dark"] .topup-history-empty,
html[data-theme="dark"] .usage-grid p {
  color: #b9c1d6;
}

html[data-theme="dark"] .transfer-code {
  border-color: rgba(255, 154, 22, 0.55);
  background: rgba(255, 138, 0, 0.09);
  color: #ffd19a;
}

html[data-theme="dark"] .payment-order-box,
html[data-theme="dark"] .transfer-info-table,
html[data-theme="dark"] .transfer-warning {
  border-color: rgba(255, 255, 255, 0.12);
  background: #111827;
  color: #dbe4f0;
}

html[data-theme="dark"] .transfer-info-table th,
html[data-theme="dark"] .transfer-info-table td {
  border-color: rgba(255, 255, 255, 0.12);
}

html[data-theme="dark"] .transfer-info-table th {
  background: rgba(255, 255, 255, 0.04);
  color: #cbd5e1;
}

html[data-theme="dark"] .transfer-info-table td,
html[data-theme="dark"] .transfer-table-title {
  color: #edf2ff !important;
}

html[data-theme="dark"] .vietqr-panel {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 248, 238, 0.05);
}

html[data-theme="dark"] .vietqr-panel img {
  background: #fff;
}

html[data-theme="dark"] .vietqr-panel span {
  color: #ffd19a;
}

html[data-theme="dark"] .contact-menu {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(23, 27, 36, 0.96);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
}

html[data-theme="dark"] .contact-menu button,
html[data-theme="dark"] .contact-link,
html[data-theme="dark"] .contact-card {
  border-color: rgba(255, 214, 170, 0.24);
  background: #151b24;
  color: #fff7ed;
}

html[data-theme="dark"] .contact-menu button:hover,
html[data-theme="dark"] .contact-link:hover {
  border-color: #ffb15c;
  background: #1e2631;
}

html[data-theme="dark"] .contact-menu span {
  color: #b9c1d6;
}

html[data-theme="dark"] .contact-hint {
  background: rgba(23, 27, 36, 0.96);
  color: #e7ecf8;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.34);
}

html[data-theme="dark"] .contact-hint::after {
  background: #171b24;
  box-shadow: 10px 10px 0 -5px #171b24;
}

@media (max-width: 640px) {
  .contact-float {
    right: 8px;
    bottom: 20px;
    gap: 10px;
  }

  .contact-round {
    width: 44px;
    height: 44px;
  }
}

html[data-theme="dark"] .support-thread,
html[data-theme="dark"] .support-admin-messages {
  border-color: rgba(255, 214, 170, 0.18);
  background: #111722;
}

html[data-theme="dark"] .support-empty,
html[data-theme="dark"] .support-admin-thread > header span,
html[data-theme="dark"] .support-admin-message div {
  color: #b9c1d6;
}

html[data-theme="dark"] .support-message,
html[data-theme="dark"] .support-admin-thread,
html[data-theme="dark"] .support-admin-message {
  border-color: rgba(255, 214, 170, 0.18);
  background: #151b24;
  color: #fff7ed;
}

html[data-theme="dark"] .support-message.user,
html[data-theme="dark"] .support-admin-message.admin {
  background: rgba(255, 138, 0, 0.12);
}

html[data-theme="dark"] .support-message p,
html[data-theme="dark"] .support-admin-message p {
  color: #fff7ed;
}

html[data-theme="dark"] .support-input,
html[data-theme="dark"] .support-admin-reply textarea {
  border-color: rgba(255, 214, 170, 0.22);
  background: #0f1520;
  color: #fff7ed;
}

html[data-theme="dark"] .ai-full-package-button,
html[data-theme="dark"] .primary-button,
html[data-theme="dark"] .hero-form .primary-button {
  color: #16110b;
  background: linear-gradient(90deg, #ffb15c, #ff8a00);
}

html[data-theme="dark"] .chart-wrap {
  background:
    linear-gradient(rgba(244, 241, 232, 0.9), rgba(244, 241, 232, 0.9)),
    url("assets/chart-pattern.svg") center / cover no-repeat,
    #f4f1e8;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.62);
}

html[data-theme="dark"] .chart-grid,
html[data-theme="dark"] .palace,
html[data-theme="dark"] .chart-center,
html[data-theme="dark"] .chart-legend {
  color-scheme: light;
}

html[data-theme="dark"] .chart-grid,
html[data-theme="dark"] .palace {
  color: #111;
}

html[data-theme="dark"] .palace header strong,
html[data-theme="dark"] .palace header span:last-child,
html[data-theme="dark"] .chart-center dt,
html[data-theme="dark"] .chart-legend {
  color: #111;
}

html[data-theme="dark"] .palace .branch-name,
html[data-theme="dark"] .palace header {
  color: #b00000;
}

html[data-theme="dark"] .main-stars em,
html[data-theme="dark"] .palace p {
  color: #666;
}

html[data-theme="dark"] .palace footer {
  color: #444;
}

html[data-theme="dark"] .forum-name,
html[data-theme="dark"] .chart-center h3,
html[data-theme="dark"] .chart-center dd,
html[data-theme="dark"] .center-note {
  color: #263dc2;
}

html[data-theme="dark"] .forum-url {
  color: #d00000;
}

/* Final stability pass: admin tables, mobile width and user-facing states. */
.admin-content,
.admin-main,
.admin-view,
.admin-panel {
  min-width: 0;
}

.admin-panel {
  overflow: hidden;
}

.admin-table-controls {
  flex-wrap: wrap;
}

.table-wrap,
.provider-table-wrap,
.user-table-wrap {
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.provider-table-wrap .admin-table td,
.provider-table-wrap .admin-table th,
.user-table-wrap .admin-table td,
.user-table-wrap .admin-table th {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.provider-table-wrap.hide-base-url .admin-table {
  min-width: 760px;
}

.provider-table-wrap.hide-base-url .admin-table th:nth-child(5),
.provider-table-wrap.hide-base-url .admin-table td:nth-child(5) {
  display: none;
}

.provider-table-wrap .admin-table td:last-child {
  min-width: 126px;
}

.provider-status-board {
  display: grid;
  gap: 12px;
  margin: 16px 0;
}

.provider-status-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.provider-status-card,
.provider-status-row {
  border: 1px solid #eadcc9;
  border-radius: 14px;
  background: #fff;
  padding: 12px;
}

.provider-status-card {
  min-height: 112px;
}

.provider-status-card span,
.provider-status-card small,
.provider-status-row span {
  display: block;
  color: #64748b;
}

.provider-status-card strong {
  display: block;
  margin: 6px 0;
  color: #32170f;
  font-size: 30px;
  line-height: 1;
}

.provider-status-card.active,
.provider-status-row.active {
  border-color: rgba(34, 197, 94, 0.32);
  background: #f0fdf4;
}

.provider-status-card.good,
.provider-status-row.good {
  border-color: rgba(10, 118, 255, 0.22);
  background: #eff6ff;
}

.provider-status-card.warn,
.provider-status-row.warn {
  border-color: rgba(249, 115, 22, 0.32);
  background: #fff7ed;
}

.provider-status-card.bad,
.provider-status-row.bad {
  border-color: rgba(239, 68, 68, 0.32);
  background: #fef2f2;
}

.provider-status-card.muted,
.provider-status-row.off,
.provider-status-row.muted {
  background: #f8fafc;
}

.provider-status-list {
  display: grid;
  gap: 8px;
}

.provider-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.provider-status-row strong,
.provider-status-row span {
  overflow-wrap: anywhere;
}

.provider-status-row em,
.error-count {
  flex: 0 0 auto;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  padding: 5px 9px;
  color: #334155;
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
}

.error-group-summary {
  border: 1px solid #f7c58c;
  border-radius: 12px;
  background: #fff7ed;
  padding: 10px 12px;
  color: #9a3412;
  font-weight: 900;
}

.error-group {
  display: grid;
  gap: 6px;
}

.error-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.error-group b {
  width: max-content;
  border-radius: 999px;
  background: #fee2e2;
  padding: 4px 9px;
  color: #b91c1c;
  font-size: 12px;
}

.admin-toast {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 9999;
  width: min(360px, calc(100vw - 32px));
  padding: 14px 16px;
  border: 1px solid rgba(255, 139, 0, 0.28);
  border-radius: 14px;
  background: rgba(255, 250, 242, 0.96);
  box-shadow: 0 18px 55px rgba(61, 28, 14, 0.18);
  color: #3d1c0e;
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.admin-toast.show {
  opacity: 1;
  transform: translateY(0);
}

.admin-toast strong,
.admin-toast span {
  display: block;
}

.admin-toast span {
  margin-top: 4px;
  color: #65708a;
  line-height: 1.45;
  white-space: pre-line;
}

.admin-modal-backdrop,
.app-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(18, 20, 28, 0.42);
  opacity: 0;
  transition: opacity 0.18s ease;
}

.admin-modal-backdrop.show,
.app-modal-backdrop.show {
  opacity: 1;
}

.admin-modal-card,
.app-modal-card {
  width: min(440px, 100%);
  border: 1px solid rgba(255, 139, 0, 0.24);
  border-radius: 18px;
  background: #fffaf2;
  box-shadow: 0 26px 80px rgba(61, 28, 14, 0.24);
  color: #3d1c0e;
  padding: 22px;
}

.admin-modal-card h3,
.app-modal-card h3 {
  margin: 0 0 10px;
  font-size: 1.35rem;
}

.admin-modal-card p,
.app-modal-card p {
  margin: 0 0 18px;
  color: #65708a;
  line-height: 1.55;
}

.admin-modal-input {
  width: 100%;
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid #ead7c2;
  border-radius: 12px;
  font: inherit;
}

.admin-modal-actions,
.app-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

.admin-modal-actions button,
.app-modal-actions button,
.payment-row button {
  border: 0;
  border-radius: 12px;
  padding: 11px 16px;
  background: #fff2df;
  color: #8b3a12;
  font-weight: 800;
  cursor: pointer;
}

.admin-modal-actions [data-dialog-confirm],
.app-modal-actions [data-dialog-confirm],
.payment-row button {
  background: #ff8b00;
  color: #fff;
}

.admin-modal-actions .danger,
.app-modal-actions .danger {
  background: #d93025;
  color: #fff;
}

.payment-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.payment-summary-grid article,
.payment-section {
  border: 1px solid #ead7c2;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.68);
  padding: 16px;
}

.payment-summary-grid span,
.payment-row span,
.payment-row small {
  display: block;
  color: #65708a;
}

.payment-summary-grid strong {
  display: block;
  margin-top: 8px;
  font-size: 1.55rem;
  color: #3d1c0e;
}

.payment-alert {
  display: grid;
  gap: 6px;
  margin: 0 0 18px;
  border: 1px solid #ffb35c;
  border-radius: 14px;
  background: #fff7ed;
  color: #8b3a12;
  padding: 14px 16px;
}

.payment-alert span {
  color: #65708a;
}

.payment-section {
  margin-top: 14px;
}

.payment-section h3 {
  margin: 0 0 12px;
  color: #8b3a12;
}

.payment-table {
  display: grid;
  gap: 10px;
}

.payment-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(160px, 0.75fr);
  align-items: center;
  gap: 14px;
  padding: 13px;
  border: 1px solid rgba(234, 215, 194, 0.75);
  border-radius: 14px;
  background: #fff;
}

.payment-row strong {
  overflow-wrap: anywhere;
}

.payment-retention-note {
  margin: 14px 2px 0;
  color: #65708a;
  font-size: 0.92rem;
}

.app-toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 9999;
  width: min(380px, calc(100vw - 32px));
  padding: 14px 16px;
  border: 1px solid rgba(255, 139, 0, 0.28);
  border-radius: 14px;
  background: rgba(255, 250, 242, 0.97);
  box-shadow: 0 18px 55px rgba(61, 28, 14, 0.18);
  color: #3d1c0e;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.app-toast.show {
  opacity: 1;
  transform: translateY(0);
}

.app-toast strong,
.app-toast span {
  display: block;
}

.app-toast span {
  margin-top: 4px;
  color: #65708a;
  line-height: 1.45;
}

.ai-reading.warning p,
.ai-reading.loading p {
  line-height: 1.65;
}

.topup-cta-button.secondary {
  margin-left: 8px;
  background: #fff2df;
  color: #8b3a12;
}

.chart-placeholder {
  background: #fffaf2;
  color: #3d1c0e;
}

@media (max-width: 900px) {
  body {
    overflow-x: hidden;
  }

  .admin-layout {
    grid-template-columns: 1fr;
  }

  .admin-menu {
    position: static;
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 12px;
  }

  .admin-menu h3,
  .admin-menu .eyebrow {
    display: none;
  }

  .admin-menu button {
    flex: 0 0 auto;
    min-height: 42px;
    white-space: nowrap;
  }

  .provider-table-wrap.hide-base-url .admin-table,
  .provider-table-wrap .admin-table,
  .user-table-wrap .admin-table {
    min-width: 720px;
  }

  .admin-form,
  .admin-form.user-form {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .topup-hero,
  .feature-hero,
  .history-hero {
    padding-inline: 22px;
  }

  .topup-hero h1,
  .feature-hero h1,
  .history-hero h1 {
    font-size: clamp(36px, 12vw, 58px);
    line-height: 1.05;
  }

  .admin-toast {
    left: 14px;
    right: 14px;
    width: auto;
  }

  .payment-summary-grid {
    grid-template-columns: 1fr 1fr;
  }

  .payment-row {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .payment-row button {
    width: 100%;
  }

  .ai-tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .ai-tabs button {
    min-width: max-content;
    padding-inline: 18px;
  }
}

/* Mobile header: keep History/Admin reachable without widening the page. */
@media (max-width: 760px) {
  .app-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
    max-width: 100vw;
    gap: 10px;
    padding: 12px 14px 14px;
    overflow: hidden;
  }

  .app-header .logo {
    min-width: 0;
  }

  .app-header .logo img {
    width: 42px;
    height: 42px;
  }

  .app-header .logo strong {
    min-width: 0;
    font-size: 30px;
  }

  .app-header .logo span {
    flex: 0 0 auto;
  }

  .app-header .main-nav,
  .app-header .auth-links {
    display: flex;
    flex-wrap: nowrap;
    justify-content: flex-start;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    scroll-snap-type: x proximity;
  }

  .app-header .main-nav::-webkit-scrollbar,
  .app-header .auth-links::-webkit-scrollbar {
    display: none;
  }

  .app-header .main-nav {
    gap: 18px;
    padding: 2px 18px 8px 0;
  }

  .app-header .main-nav a {
    flex: 0 0 auto;
    padding: 10px 2px 12px;
    font-size: 19px;
    scroll-snap-align: start;
  }

  .app-header .main-nav a.active::after,
  .app-header .main-nav a:hover::after {
    bottom: 4px;
  }

  .app-header .auth-links {
    gap: 9px;
    padding: 2px 18px 2px 0;
  }

  .app-header .auth-links button,
  .app-header .auth-links a,
  .app-header .auth-links .user-badge {
    flex: 0 0 auto;
    padding: 9px 13px;
    font-size: 14px;
    scroll-snap-align: start;
  }

  .app-header .auth-links .user-badge {
    max-width: min(72vw, 280px);
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

@media (max-width: 390px) {
  .app-header .logo strong {
    font-size: 27px;
  }

  .app-header .main-nav a {
    font-size: 18px;
  }
}

/* Love page cascade guard */
.love-page .love-intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 40px;
  width: 100%;
  max-width: none;
  min-height: 330px;
  align-items: center;
  padding: 44px 52px;
}

.love-page .love-intro h1 {
  max-width: none;
  font-size: 52px;
}

.love-page .couple-form {
  grid-template-columns: minmax(0, 1fr) 56px minmax(0, 1fr);
  gap: 0;
  padding: 0;
  background: #fff;
}

.love-page .person-panel {
  padding: 30px;
}

.love-page .couple-link {
  background: #f7f3ee;
}

.love-page .love-submit-row {
  padding: 22px 30px;
}

html[data-theme="dark"] .love-page .couple-form,
html[data-theme="dark"] .love-page .person-panel {
  background: #1c1816;
}

html[data-theme="dark"] .love-page .couple-link,
html[data-theme="dark"] .love-page .love-submit-row {
  background: #151210;
}

@media (max-width: 820px) {
  .love-page .love-intro {
    grid-template-columns: 1fr 190px;
    min-height: 270px;
    padding: 34px;
  }

  .love-page .love-intro h1 {
    font-size: 42px;
  }

  .love-page .couple-form {
    grid-template-columns: 1fr;
  }

  .love-page .couple-link {
    height: 54px;
  }
}

@media (max-width: 560px) {
  .love-page .love-intro {
    display: block;
    min-height: 0;
    padding: 28px 22px;
  }

  .love-page .love-intro h1 {
    font-size: 34px;
  }

  .love-page .couple-form {
    margin: 0;
  }

  .love-page .person-panel {
    padding: 22px 18px;
  }

  .love-page .love-date-grid {
    grid-template-columns: 0.8fr 0.8fr 1.4fr;
  }

  .love-page .love-date-grid label:last-child {
    grid-column: auto;
  }

  .love-page .love-submit-row {
    padding: 20px 18px;
  }
}

.pair-charts {
  scroll-margin-top: 20px;
  margin-top: 42px;
}

.pair-charts-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 16px;
}

.pair-charts-head h2,
.pair-charts-head p {
  margin: 0;
}

.pair-charts-head h2 {
  color: var(--brand-dark);
  font-size: 28px;
}

.pair-chart-tabs {
  display: inline-flex;
  padding: 3px;
  border: 1px solid #d9d2ca;
  border-radius: 6px;
  background: #f4f0eb;
}

.pair-chart-tabs button {
  min-width: 100px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #615a55;
  padding: 9px 14px;
  font-weight: 700;
}

.pair-chart-tabs button.active {
  background: #fff;
  color: #873816;
  box-shadow: 0 2px 8px rgba(46, 37, 32, 0.1);
}

.pair-chart-stage {
  padding: 12px;
  overflow: hidden;
  border: 1px solid #cfc6bc;
  background: #f4f0eb;
}

.pair-chart-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-rows: repeat(4, 180px);
  border-top: 1px solid #9f9184;
  border-left: 1px solid #9f9184;
  background: #fffdf9;
}

.pair-palace,
.pair-chart-center {
  min-width: 0;
  overflow: hidden;
  border-right: 1px solid #9f9184;
  border-bottom: 1px solid #9f9184;
  background: #fffdf9;
}

.pair-palace {
  display: flex;
  flex-direction: column;
  padding: 10px;
}

.pair-palace.than {
  background: #fff4e8;
  box-shadow: inset 0 0 0 2px rgba(164, 69, 39, 0.22);
}

.pair-palace header,
.pair-palace footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.pair-palace header {
  padding-bottom: 7px;
  border-bottom: 1px solid #e5ddd5;
  color: #655b55;
  font-size: 10px;
}

.pair-palace header strong {
  color: #27211e;
  font-size: 13px;
  text-align: center;
}

.pair-main-stars {
  display: grid;
  gap: 2px;
  margin-top: 8px;
  color: #a03024;
  font-size: 13px;
  text-align: center;
}

.pair-main-stars small {
  font-size: 9px;
}

.pair-main-stars em {
  color: #80746c;
  font-size: 11px;
}

.pair-palace > p {
  display: -webkit-box;
  margin: 8px 0;
  overflow: hidden;
  color: #504843;
  font-size: 9px;
  line-height: 1.5;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
}

.pair-palace footer {
  margin-top: auto;
  color: #6b625d;
  font-size: 9px;
}

.pair-palace footer strong {
  color: #176f78;
}

.pair-chart-center {
  grid-column: 2 / 4;
  grid-row: 2 / 4;
  display: grid;
  align-content: center;
  padding: 24px 34px;
  background: #f8f2e9 url("assets/chart-pattern.svg") center / 72% no-repeat;
}

.pair-chart-center > p {
  margin: 0 0 3px;
  color: #176f78;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.pair-chart-center h3 {
  margin-bottom: 16px;
  color: #642d1b;
  font-size: 23px;
}

.pair-chart-center dl {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr);
  gap: 8px 12px;
  margin: 0;
  font-size: 11px;
}

.pair-chart-center dt {
  color: #756b64;
}

.pair-chart-center dd {
  margin: 0;
  color: #2c2724;
  font-weight: 700;
  line-height: 1.35;
}

.pair-functions {
  display: grid;
  gap: 20px;
  padding: 22px 26px;
  border: 1px solid #cfc6bc;
  border-top: 0;
  background: #fff;
}

.pair-functions-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
}

.pair-functions p,
.pair-functions h3,
.love-qa-box label {
  margin: 0;
}

.pair-functions h3 {
  color: var(--brand-dark);
  font-size: 20px;
}

.pair-functions-head > p {
  max-width: 520px;
  color: #65708a;
  font-size: 13px;
  line-height: 1.55;
  text-align: right;
}

.love-unlock-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px;
  border: 1px solid rgba(255, 138, 0, 0.28);
  border-radius: 8px;
  background: #fffaf3;
}

.love-unlock-card h3,
.love-unlock-card p {
  margin: 0;
}

.love-unlock-card h3 {
  font-size: 22px;
}

.love-unlock-card > div {
  display: grid;
  gap: 6px;
}

.love-unlock-card button {
  min-width: 190px;
  border: 0;
  border-radius: 8px;
  padding: 13px 18px;
  background: #f0522c;
  color: #fff;
  font-weight: 900;
  cursor: pointer;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  box-shadow: 0 12px 28px rgba(240, 82, 44, 0.18);
}

.love-unlock-card button strong {
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
}

.love-unlock-card.active {
  border-color: rgba(24, 120, 128, 0.28);
  background: #f3fbfa;
}

.love-unlock-card.active button {
  background: #187880;
  cursor: default;
  box-shadow: none;
}

.love-feature-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.love-feature-grid button,
.love-qa-box button {
  border: 1px solid #e4d8ca;
  border-radius: 6px;
  background: #fffaf4;
  color: #32170f;
  font: inherit;
  font-weight: 800;
}

.love-feature-grid button {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  min-height: 72px;
  padding: 12px;
  text-align: left;
}

.love-feature-grid button.locked {
  cursor: not-allowed;
  opacity: 0.48;
  filter: grayscale(0.35);
}

.love-feature-grid button:hover,
.love-qa-box button:hover {
  border-color: rgba(228, 87, 46, 0.38);
  background: #fff1df;
}

.love-feature-grid button:disabled,
.love-qa-box button:disabled {
  cursor: not-allowed;
  opacity: 0.72;
}

.love-feature-grid span {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: #e4572e;
  color: #fff;
  font-size: 12px;
}

.love-feature-grid strong {
  min-width: 0;
  font-size: 13px;
  line-height: 1.3;
}

.love-feature-grid small,
.love-feature-grid .love-status-badge {
  position: absolute;
  top: 7px;
  right: 8px;
  border-radius: 999px;
  background: #fff1df;
  color: #a4530c;
  padding: 3px 7px;
  font-size: 10px;
  font-weight: 900;
  white-space: nowrap;
}

.love-feature-grid .love-status-badge.free,
.love-feature-grid .love-status-badge.viewed {
  background: #e7f8ec;
  color: #167a35;
  border: 1px solid #b8edc6;
}

.love-feature-grid .love-status-badge.unlocked,
.love-feature-grid .love-status-badge.limit {
  background: #176f78;
  color: #fff;
}

.love-feature-grid .vip {
  background: linear-gradient(135deg, #fff9ed, #eef8f8);
}

.love-qa-box {
  display: grid;
  gap: 10px;
  border: 1px solid #e4d8ca;
  border-radius: 8px;
  background: #fffaf4;
  padding: 14px;
}

.love-qa-box label {
  color: #32170f;
  font-weight: 900;
}

.love-qa-box > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.love-question-suggestions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 4px;
}

.love-question-suggestions .ai-suggestion-button {
  justify-content: center;
  min-height: 40px;
  width: 100%;
  padding: 8px 12px;
  line-height: 1.25;
  text-align: center;
}

@media (max-width: 760px) {
  .love-question-suggestions {
    grid-template-columns: 1fr;
  }
}

.love-qa-box input {
  width: 100%;
  min-height: 44px;
  border: 1px solid #dcd5ce;
  border-radius: 6px;
  background: #fff;
  color: #292421;
  padding: 0 12px;
}

.love-qa-box button {
  min-width: 104px;
  padding: 0 16px;
  background: #e4572e;
  color: #fff;
}

.multi-compare-panel {
  display: grid;
  gap: 16px;
  border: 1px solid #d5c8ba;
  border-radius: 8px;
  background: #fffdf8;
  padding: 16px;
}

.multi-compare-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 280px) auto auto;
  gap: 14px;
  align-items: end;
}

.multi-compare-head h3,
.multi-compare-head p {
  margin: 0;
}

.multi-compare-head label {
  display: grid;
  gap: 6px;
  color: #615a55;
  font-size: 12px;
  font-weight: 800;
}

.multi-compare-head input {
  width: 100%;
  min-height: 42px;
  border: 1px solid #dcd5ce;
  border-radius: 6px;
  background: #fff;
  color: #292421;
  padding: 0 12px;
}

.multi-compare-head button,
.multi-submit-row .primary-button,
.multi-actions button {
  min-height: 42px;
  border: 0;
  border-radius: 6px;
  background: #176f78;
  color: #fff;
  padding: 0 16px;
  font-weight: 900;
}

.multi-compare-head button.secondary {
  background: #fff1df;
  color: #873816;
}

.multi-form {
  display: grid;
  gap: 14px;
}

.multi-person-grid {
  display: grid;
  grid-template-columns: repeat(var(--multi-form-count, 2), minmax(320px, 1fr));
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
}

.multi-person-panel {
  min-width: 320px;
  border: 1px solid #ded8d1;
  border-top: 4px solid #176f78;
  background: #fff;
  padding: 24px;
}

.multi-person-panel .person-heading > span,
.multi-chart-card > header span {
  background: #176f78;
  font-family: "Be Vietnam Pro", Arial, Tahoma, Helvetica, sans-serif;
}

.multi-submit-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  border-top: 1px solid #eadcc9;
  padding-top: 14px;
  text-align: center;
}

.multi-submit-row .primary-button {
  margin-inline: auto;
}

.multi-submit-row p {
  max-width: 430px;
  margin: 0;
  color: #65708a;
  font-size: 13px;
}

.multi-actions {
  display: flex;
  justify-content: center;
  border-top: 1px solid #eadcc9;
  padding-top: 14px;
}

.multi-actions button {
  background: #e4572e;
}

.multi-chart-stage {
  display: grid;
  grid-template-columns: repeat(var(--multi-count, 3), minmax(360px, 1fr));
  gap: 12px;
  overflow-x: auto;
  padding: 12px;
  border: 1px solid #d5c8ba;
  background: #f4f0eb;
  -webkit-overflow-scrolling: touch;
}

.multi-chart-card {
  min-width: 360px;
}

html[data-theme="dark"] .pair-chart-tabs,
html[data-theme="dark"] .pair-chart-stage {
  border-color: rgba(255, 224, 184, 0.18);
  background: #151210;
}

html[data-theme="dark"] .pair-chart-tabs button.active,
html[data-theme="dark"] .pair-functions {
  background: #211b18;
  color: #ffb06c;
}

html[data-theme="dark"] .love-feature-grid button,
html[data-theme="dark"] .love-qa-box,
html[data-theme="dark"] .multi-compare-panel,
html[data-theme="dark"] .multi-person-panel {
  border-color: rgba(255, 224, 184, 0.18);
  background: #1c1816;
  color: #fff8ef;
}

html[data-theme="dark"] .love-qa-box input,
html[data-theme="dark"] .multi-compare-head input {
  border-color: rgba(255, 224, 184, 0.18);
  background: #12100f;
  color: #fff8ef;
}

html[data-theme="dark"] .pair-chart-board,
html[data-theme="dark"] .pair-palace,
html[data-theme="dark"] .pair-chart-center {
  border-color: rgba(255, 224, 184, 0.2);
  background-color: #1c1816;
}

html[data-theme="dark"] .pair-palace.than {
  background: #2b1d17;
}

html[data-theme="dark"] .pair-palace header strong,
html[data-theme="dark"] .pair-chart-center dd,
html[data-theme="dark"] .pair-functions h3,
html[data-theme="dark"] .pair-charts-head h2 {
  color: #fff8ef;
}

@media (max-width: 700px) {
  .pair-charts {
    margin-top: 32px;
  }

  .pair-charts-head {
    align-items: stretch;
    flex-direction: column;
  }

  .pair-chart-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .pair-chart-board {
    grid-template-rows: repeat(4, 112px);
  }

  .pair-chart-stage {
    padding: 4px;
  }

  .pair-palace {
    padding: 5px;
  }

  .pair-palace header span,
  .pair-palace > p,
  .pair-palace footer span:first-child {
    display: none;
  }

  .pair-palace header {
    justify-content: center;
    padding-bottom: 4px;
  }

  .pair-palace header strong {
    font-size: 8px;
    line-height: 1.15;
  }

  .pair-main-stars {
    margin-top: 5px;
    font-size: 8px;
    line-height: 1.2;
  }

  .pair-main-stars small,
  .pair-palace footer {
    font-size: 7px;
  }

  .pair-chart-center {
    padding: 10px 12px;
  }

  .pair-chart-center h3 {
    margin-bottom: 8px;
    font-size: 14px;
  }

  .pair-chart-center > p {
    font-size: 7px;
  }

  .pair-chart-center dl {
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 3px 5px;
    font-size: 7px;
  }

  .pair-functions {
    align-items: stretch;
    flex-direction: column;
    padding: 20px;
  }

  .pair-functions-head,
  .love-qa-box > div {
    display: grid;
    gap: 12px;
  }

  .pair-functions-head > p {
    max-width: none;
    text-align: left;
  }

  .love-unlock-card {
    display: grid;
    gap: 14px;
  }

  .love-unlock-card button {
    width: 100%;
    min-width: 0;
  }

  .love-feature-grid {
    grid-template-columns: 1fr;
  }

  .love-qa-box button {
    min-height: 44px;
  }

  .multi-compare-head,
  .multi-submit-row {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .multi-compare-head {
    display: grid;
  }

  .multi-submit-row {
    flex-direction: column;
  }
}

/* Love page full chart comparison */
.love-page {
  width: min(1680px, calc(100% - 88px));
  margin: 0 auto 56px;
}

.love-page .pair-charts-head {
  align-items: end;
}

.love-page .pair-charts-head > p {
  max-width: 430px;
  margin: 0;
  color: #65708a;
  text-align: right;
}

.love-page .pair-chart-stage {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  padding: 12px;
  overflow: visible;
  border: 1px solid #d5c8ba;
  background: #f4f0eb;
}

.pair-chart-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid #d5c8ba;
  background: #fffdf8;
}

.pair-chart-card > header {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 10px 12px;
  border-bottom: 1px solid #eadcc9;
  background: #fff8ef;
}

.pair-chart-card > header span {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: #873816;
  color: #fff;
  font-size: 13px;
  font-weight: 900;
}

.pair-chart-card:nth-child(2) > header span {
  background: #176f78;
}

.pair-chart-card > header strong {
  color: #31180f;
  font-size: 14px;
}

.pair-chart-viewport {
  --pair-scale: 0.56;
  --pair-source-height: 1420px;
  width: 100%;
  overflow: hidden;
  padding: 8px;
  background: #f4f1e8;
}

.pair-chart-fit {
  width: calc(980px * var(--pair-scale));
  height: calc(var(--pair-source-height) * var(--pair-scale));
}

.love-page .pair-rendered-chart.chart-wrap {
  width: 980px;
  max-width: none;
  margin: 0;
  overflow: hidden;
  transform: scale(var(--pair-scale));
  transform-origin: top left;
}

.love-page .pair-rendered-chart .chart-grid {
  grid-template-rows: repeat(4, var(--palace-cell-height));
}

.love-page .pair-rendered-chart .chart-legend {
  border-top: 1px solid #111;
}

html[data-theme="dark"] .pair-chart-card,
html[data-theme="dark"] .pair-chart-card > header {
  border-color: rgba(255, 224, 184, 0.18);
  background: #1c1816;
}

html[data-theme="dark"] .pair-chart-card > header strong {
  color: #fff8ef;
}

@media (max-width: 980px) {
  .love-page .pair-chart-stage {
    grid-template-columns: 1fr;
  }

  .love-page .pair-charts-head {
    align-items: stretch;
    flex-direction: column;
  }

  .love-page .pair-charts-head > p {
    max-width: none;
    text-align: left;
  }
}

@media (max-width: 560px) {
  .pair-chart-viewport {
    padding: 4px;
  }

  .pair-chart-card > header {
    min-height: 42px;
  }
}

/* Love form alignment guard */
.love-page .love-workspace-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: end;
  gap: 48px;
  padding-inline: 4px;
}

.love-page .love-workspace-head > p {
  justify-self: end;
  width: min(470px, 100%);
  text-align: right;
}

.love-page .couple-form {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: stretch;
}

.love-page .person-panel {
  display: grid;
  align-content: start;
  min-width: 0;
  min-height: 100%;
}

.love-page .person-panel[data-person="a"] {
  border-right: 0;
}

.love-page .person-panel[data-person="b"] {
  border-left: 0;
}

.love-page .couple-link {
  position: absolute;
  inset: 0 auto 0 50%;
  z-index: 2;
  width: 56px;
  background: transparent;
  transform: translateX(-50%);
  pointer-events: none;
}

.love-page .couple-link::before {
  display: none;
}

.love-page .couple-link span {
  position: absolute;
  top: 50%;
  left: 50%;
  margin: 0;
  transform: translate(-50%, -50%);
}

.love-page .love-submit-row {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  text-align: center;
}

.love-page .love-submit-row .primary-button {
  min-width: min(280px, 100%);
}

html[data-theme="dark"] .love-page .person-panel[data-person="a"] {
  border-right-color: rgba(255, 224, 184, 0.14);
}

@media (max-width: 820px) {
  .love-page .love-workspace-head,
  .love-page .couple-form {
    grid-template-columns: 1fr;
  }

  .love-page .love-workspace-head > p {
    justify-self: start;
    text-align: left;
  }

  .love-page .person-panel[data-person="a"] {
    border-right: 0;
    border-bottom: 0;
  }

  .love-page .couple-link {
    position: relative;
    inset: auto;
    width: 100%;
    height: 54px;
    transform: none;
  }

  .love-page .couple-link::before {
    display: none;
  }

  .love-page .couple-link span {
    position: relative;
    top: auto;
    margin: 8px auto 0;
    transform: none;
  }

  .love-page .love-submit-row {
    flex-direction: column;
  }
}

/* Keep the Tràng Sinh row visible after mobile chart scaling. */
.palace footer {
  min-height: 26px;
}

.palace footer .life-cycle-footer {
  flex: 1 1 auto;
  min-width: 0;
  color: #4f4f4f;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.12;
  text-align: center;
  white-space: nowrap;
}

@media (max-width: 760px) {
  .support-stars {
    align-content: start;
    max-height: 154px;
  }

  .annual-stars {
    min-height: 40px;
    max-height: 50px;
  }

  .palace footer {
    min-height: 30px;
    padding-top: 7px;
    font-size: 15px;
  }

  .palace footer .life-cycle-footer {
    font-size: 15px;
  }
}
/* Mobile love page width guard: keep the workspace close to the viewport edge. */
@media (max-width: 640px) {
  body:has(.love-page) {
    background: var(--paper);
  }

  main.page.love-page {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0 8px 42px;
  }

  main.page.love-page .love-intro,
  main.page.love-page .couple-form,
  main.page.love-page .pair-charts,
  main.page.love-page .compatibility-result {
    width: 100%;
    max-width: none;
    margin-right: 0;
    margin-left: 0;
  }

  main.page.love-page .love-intro {
    padding: 24px 16px;
  }

  main.page.love-page .love-workspace-head,
  main.page.love-page .pair-charts-head,
  main.page.love-page .pair-functions-head {
    padding-right: 4px;
    padding-left: 4px;
  }

  main.page.love-page .person-panel {
    padding-right: 14px;
    padding-left: 14px;
  }
}

/* Keep the compact account popover above the final mobile-header rules. */
@media (max-width: 760px) {
  .app-header.account-menu-open {
    z-index: 220;
    overflow: visible;
  }

  .app-header.account-menu-open .auth-links {
    overflow: visible;
  }

  .app-header .auth-links:has(.account-menu:not([hidden])) {
    justify-content: flex-end;
    overflow: visible;
    padding-right: 0;
  }

  .app-header .auth-links .account-menu-trigger {
    min-height: 44px;
    max-width: min(74vw, 240px);
    padding: 7px 13px 7px 8px;
    background: #f7eee4;
  }

  .app-header .account-menu-panel {
    right: 0;
    z-index: 240;
    overflow: visible;
  }
}

/* Mobile account menu must stay readable: balance, theme and logout are inside this popover. */
@media (max-width: 640px) {
  .app-header .auth-links:has(.account-menu:not([hidden])) {
    justify-content: flex-start;
    overflow: visible;
    padding-right: 0;
  }

  .app-header .account-menu {
    position: relative;
    max-width: calc(100vw - 28px);
  }

  .app-header .auth-links .account-menu-trigger {
    max-width: calc(100vw - 32px);
  }

  .app-header .account-menu-panel {
    position: fixed;
    top: calc(env(safe-area-inset-top, 0px) + 92px);
    left: 12px;
    right: 12px;
    width: auto;
    max-height: calc(100dvh - 118px);
    overflow-y: auto;
    z-index: 10000;
  }

  .app-header .account-menu-panel > button,
  .app-header .account-menu-panel > .user-badge {
    min-height: 46px;
    white-space: normal;
  }
}

@media (max-width: 640px) {
  body.account-sheet-open {
    overflow: hidden;
  }

  body > .account-menu-panel.mobile-account-sheet {
    position: fixed !important;
    inset: auto 12px calc(env(safe-area-inset-bottom, 0px) + 18px) 12px !important;
    z-index: 2147483647 !important;
    display: grid;
    width: auto !important;
    max-height: min(360px, calc(100dvh - 42px));
    overflow-y: auto;
    padding: 10px;
    border-radius: 14px;
    box-shadow: 0 22px 70px rgba(0, 0, 0, 0.38);
    -webkit-overflow-scrolling: touch;
  }

  body > .account-menu-panel.mobile-account-sheet > button,
  body > .account-menu-panel.mobile-account-sheet > .user-badge {
    display: flex !important;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    min-height: 52px;
    max-width: none;
    border: 0;
    border-radius: 8px;
    padding: 11px 14px;
    background: transparent !important;
    color: var(--ink) !important;
    box-shadow: none;
    text-align: left;
    white-space: normal;
  }

  body > .account-menu-panel.mobile-account-sheet > .user-badge {
    border-bottom: 1px solid var(--header-border);
    border-radius: 0;
    font-size: 14px;
    font-weight: 900;
  }

  body > .account-menu-panel.mobile-account-sheet #logout-button,
  body > .account-menu-panel.mobile-account-sheet #admin-logout {
    color: #b3261e !important;
  }
}

/* Dark mode readability for static/commerce pages. Keep this late in the file
   so it wins over older page-specific color declarations. */
html[data-theme="dark"] .seo-page,
html[data-theme="dark"] .topup-page {
  background: var(--body-bg);
  color: var(--ink);
}

html[data-theme="dark"] .seo-article,
html[data-theme="dark"] .about-grid article,
html[data-theme="dark"] .legal-section,
html[data-theme="dark"] .legal-list article,
html[data-theme="dark"] .seo-link-section,
html[data-theme="dark"] .seo-link-grid a,
html[data-theme="dark"] .voucher-redeem-section,
html[data-theme="dark"] .topup-hero,
html[data-theme="dark"] .topup-packages,
html[data-theme="dark"] .topup-flow,
html[data-theme="dark"] .topup-history,
html[data-theme="dark"] .topup-usage,
html[data-theme="dark"] .topup-balance-card,
html[data-theme="dark"] .coin-package,
html[data-theme="dark"] .transfer-card,
html[data-theme="dark"] .payment-card,
html[data-theme="dark"] .payment-order-box,
html[data-theme="dark"] .topup-history-item,
html[data-theme="dark"] .topup-history-empty,
html[data-theme="dark"] .usage-grid article {
  border-color: rgba(255, 214, 170, 0.2) !important;
  background-color: var(--card-bg) !important;
  color: var(--ink) !important;
  box-shadow: none;
}

html[data-theme="dark"] .topup-hero,
html[data-theme="dark"] .feature-hero.about-hero,
html[data-theme="dark"] .seo-article {
  background:
    radial-gradient(circle at 16% 26%, rgba(255, 177, 92, 0.11), transparent 260px),
    linear-gradient(135deg, #1f2630 0%, #151a21 70%, #10141b 100%) !important;
}

html[data-theme="dark"] .seo-article h1,
html[data-theme="dark"] .seo-article h2,
html[data-theme="dark"] .seo-article h3,
html[data-theme="dark"] .about-grid h2,
html[data-theme="dark"] .legal-section h2,
html[data-theme="dark"] .legal-section h3,
html[data-theme="dark"] .seo-link-section h2,
html[data-theme="dark"] .seo-link-grid strong,
html[data-theme="dark"] .topup-hero h1,
html[data-theme="dark"] .topup-packages h2,
html[data-theme="dark"] .voucher-redeem-section h2,
html[data-theme="dark"] .topup-history h2,
html[data-theme="dark"] .topup-usage h2,
html[data-theme="dark"] .coin-package strong,
html[data-theme="dark"] .coin-package b,
html[data-theme="dark"] .transfer-card strong,
html[data-theme="dark"] .usage-grid strong,
html[data-theme="dark"] .section-head h2 {
  color: #fff8ef !important;
}

html[data-theme="dark"] .seo-article p,
html[data-theme="dark"] .seo-lead,
html[data-theme="dark"] .about-grid p,
html[data-theme="dark"] .legal-section p,
html[data-theme="dark"] .seo-link-grid span,
html[data-theme="dark"] .topup-hero p,
html[data-theme="dark"] .topup-balance-card p,
html[data-theme="dark"] .coin-package p,
html[data-theme="dark"] .voucher-redeem-section p,
html[data-theme="dark"] .transfer-card p,
html[data-theme="dark"] .transfer-card small,
html[data-theme="dark"] .topup-history-item p,
html[data-theme="dark"] .topup-history-item span,
html[data-theme="dark"] .topup-history-empty,
html[data-theme="dark"] .usage-grid p,
html[data-theme="dark"] .section-head p {
  color: #cdd6e4 !important;
}

html[data-theme="dark"] .about-grid article span,
html[data-theme="dark"] .package-label,
html[data-theme="dark"] .topup-balance-card span,
html[data-theme="dark"] .coin-package span,
html[data-theme="dark"] .usage-grid span,
html[data-theme="dark"] .transfer-table-title,
html[data-theme="dark"] .qr-title,
html[data-theme="dark"] .kicker {
  color: #ffd19a !important;
}

html[data-theme="dark"] .seo-link-grid a:hover,
html[data-theme="dark"] .coin-package:hover,
html[data-theme="dark"] .coin-package.selected {
  border-color: rgba(255, 177, 92, 0.62) !important;
  background-color: #1f2630 !important;
}

html[data-theme="dark"] .coin-package button,
html[data-theme="dark"] .voucher-redeem-form button,
html[data-theme="dark"] .copy-transfer-icon {
  color: #16110b !important;
}

html[data-theme="dark"] .voucher-redeem-form input,
html[data-theme="dark"] .transfer-info-table,
html[data-theme="dark"] .transfer-warning,
html[data-theme="dark"] .payment-status {
  border-color: rgba(255, 214, 170, 0.22) !important;
  background-color: #111827 !important;
  color: #edf2ff !important;
}

html[data-theme="dark"] .transfer-info-table th,
html[data-theme="dark"] .transfer-info-table td {
  border-color: rgba(255, 214, 170, 0.16) !important;
}

html[data-theme="dark"] .transfer-info-table th {
  background: rgba(255, 255, 255, 0.04) !important;
  color: #cbd5e1 !important;
}

html[data-theme="dark"] .transfer-info-table td,
html[data-theme="dark"] .transfer-code,
html[data-theme="dark"] #transfer-amount {
  color: #fff8ef !important;
}

html[data-theme="dark"] .voucher-redeem-status,
html[data-theme="dark"] #copy-transfer-message {
  color: #ffd19a !important;
}
/* Love form hardening: keep center divider and submit button from overlapping. */
.love-page .couple-form {
  isolation: isolate;
  overflow: visible;
}

.love-page .couple-link {
  z-index: 1;
  min-width: 56px;
}

.love-page .couple-link span {
  overflow: hidden;
  text-indent: -999px;
  white-space: nowrap;
}

.love-page .couple-link span::before {
  content: "\2665";
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  text-indent: 0;
  line-height: 1;
}

.love-page .love-submit-row {
  position: relative;
  z-index: 3;
  grid-column: 1 / -1;
  justify-content: center;
  min-width: 0;
  overflow: visible;
}

.love-page .love-submit-row .primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 260px;
  max-width: 100%;
  text-align: center;
  white-space: nowrap;
}

html[data-theme="dark"] .love-page .love-submit-row .primary-button {
  color: #1d1208;
}

@media (min-width: 821px) {
  .love-page .couple-link {
    grid-column: 2;
    grid-row: 1;
  }

  .love-page .love-submit-row {
    grid-row: 2;
  }
}

@media (max-width: 820px) {
  .love-page .couple-link {
    min-width: 0;
  }

  .love-page .love-submit-row .primary-button {
    width: 100%;
    min-width: 0;
  }
}

/* Remove the center heart/divider in the love form entirely. */
.love-page .couple-link {
  display: none !important;
}

.love-page .couple-form {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
}

.love-page .love-submit-row {
  grid-column: 1 / -1 !important;
}

@media (max-width: 820px) {
  .love-page .couple-form {
    grid-template-columns: 1fr !important;
  }
}

/* Dark mode readability for love analysis controls. */
html[data-theme="dark"] .love-page .pair-functions,
html[data-theme="dark"] .love-page .love-unlock-card,
html[data-theme="dark"] .love-page .love-feature-grid button,
html[data-theme="dark"] .love-page .love-qa-box,
html[data-theme="dark"] .love-page .multi-compare-panel {
  border-color: rgba(255, 224, 184, 0.18) !important;
  background: #1b1715 !important;
  color: #fff8ef !important;
}

html[data-theme="dark"] .love-page .love-unlock-card.active {
  border-color: rgba(85, 214, 203, 0.34) !important;
  background: #122322 !important;
}

html[data-theme="dark"] .love-page .love-unlock-card h3,
html[data-theme="dark"] .love-page .love-unlock-card p,
html[data-theme="dark"] .love-page .love-feature-grid strong,
html[data-theme="dark"] .love-page .love-qa-box label,
html[data-theme="dark"] .love-page .multi-compare-panel h3,
html[data-theme="dark"] .love-page .multi-compare-panel label,
html[data-theme="dark"] .love-page .pair-functions h3 {
  color: #fff8ef !important;
  opacity: 1 !important;
}

html[data-theme="dark"] .love-page .pair-functions-head > p,
html[data-theme="dark"] .love-page .pair-functions p,
html[data-theme="dark"] .love-page .multi-compare-panel p {
  color: #f1dcc7 !important;
  opacity: 1 !important;
}

html[data-theme="dark"] .love-page .kicker,
html[data-theme="dark"] .love-page .multi-compare-panel .kicker {
  color: #ffc982 !important;
}

html[data-theme="dark"] .love-page .love-feature-grid button.locked,
html[data-theme="dark"] .love-page .love-feature-grid button:disabled,
html[data-theme="dark"] .love-page .love-qa-box button:disabled {
  opacity: 1 !important;
  filter: none !important;
}

html[data-theme="dark"] .love-page .love-feature-grid button.locked strong,
html[data-theme="dark"] .love-page .love-feature-grid button:disabled strong {
  color: #d8c7b8 !important;
}

html[data-theme="dark"] .love-page .love-feature-grid span {
  background: #e8633d !important;
  color: #fff !important;
}

html[data-theme="dark"] .love-page .love-feature-grid small,
html[data-theme="dark"] .love-page .love-feature-grid .love-status-badge {
  background: #f0d5bc !important;
  color: #5a2e18 !important;
  border-color: rgba(255, 224, 184, 0.2) !important;
}

html[data-theme="dark"] .love-page .love-feature-grid .love-status-badge.free,
html[data-theme="dark"] .love-page .love-feature-grid .love-status-badge.viewed {
  background: #dff8e7 !important;
  color: #11642c !important;
  border-color: #aee8bf !important;
}

html[data-theme="dark"] .love-page .love-feature-grid .love-status-badge.unlocked,
html[data-theme="dark"] .love-page .love-feature-grid .love-status-badge.limit {
  background: #187880 !important;
  color: #ffffff !important;
}

html[data-theme="dark"] .love-page .love-feature-grid .vip {
  background: #172321 !important;
}

html[data-theme="dark"] .love-page .love-qa-box input,
html[data-theme="dark"] .love-page .multi-compare-panel input,
html[data-theme="dark"] .love-page .multi-compare-panel select {
  border-color: rgba(255, 224, 184, 0.22) !important;
  background: #100d0c !important;
  color: #fff8ef !important;
}

html[data-theme="dark"] .love-page .multi-compare-panel hr,
html[data-theme="dark"] .love-page .multi-submit-row,
html[data-theme="dark"] .love-page .multi-actions {
  border-color: rgba(255, 224, 184, 0.18) !important;
}

/* Center the compatibility score block so it aligns with the reading width. */
.love-page .compatibility-summary,
.love-page .compatibility-metrics {
  width: min(100%, 1180px) !important;
  margin-right: auto !important;
  margin-left: auto !important;
}

.love-page .compatibility-summary {
  padding-right: clamp(26px, 5vw, 76px) !important;
  padding-left: clamp(26px, 5vw, 76px) !important;
}

.love-page .compatibility-metrics {
  padding-right: clamp(26px, 5vw, 76px) !important;
  padding-left: clamp(26px, 5vw, 76px) !important;
}

/* Match top-up hero typography to the introduction hero. */
.topup-hero {
  min-height: 360px !important;
  padding: 82px clamp(18px, 8vw, 120px) !important;
}

.topup-hero > div:first-child {
  max-width: 720px !important;
}

.topup-hero h1 {
  margin: 0 0 16px !important;
  color: var(--brand-dark) !important;
  font-size: clamp(34px, 4.8vw, 58px) !important;
  line-height: 1.08 !important;
  font-weight: 900 !important;
  letter-spacing: 0 !important;
}

.topup-hero > div:first-child > p:last-child {
  max-width: 720px !important;
  margin: 0 !important;
  color: #5f6b82 !important;
  font-size: clamp(17px, 1.8vw, 21px) !important;
  line-height: 1.42 !important;
  font-weight: 500 !important;
}

html[data-theme="dark"] .topup-hero h1 {
  color: #fff8ef !important;
}

html[data-theme="dark"] .topup-hero > div:first-child > p:last-child {
  color: #d8c7b8 !important;
}

@media (max-width: 640px) {
  .topup-hero {
    padding: 58px 22px !important;
  }

  .topup-hero h1 {
    font-size: clamp(36px, 12vw, 58px) !important;
    line-height: 1.05 !important;
  }
}

/* Admin width pass: let heavy admin tabs use the empty desktop space. */
@media (min-width: 1024px) {
  .admin-page {
    width: min(100% - 64px, 1760px);
    max-width: 1760px;
    margin-inline: auto;
    padding-inline: 0;
  }

  .admin-dashboard-shell {
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 24px;
    width: 100%;
  }

  .admin-main,
  .admin-view,
  .admin-grid.single,
  .admin-panel,
  .admin-list,
  #usage-list {
    width: 100%;
    max-width: none;
  }

  .admin-grid.single {
    grid-template-columns: minmax(0, 1fr);
  }

  .admin-panel {
    padding: 28px;
  }

  .usage-summary-grid {
    grid-template-columns: repeat(4, minmax(190px, 1fr));
    gap: 16px;
  }

  .usage-summary-card {
    min-width: 0;
    padding: 18px;
  }

  .usage-summary-card strong {
    font-size: clamp(22px, 1.7vw, 30px);
    line-height: 1.18;
  }

  .usage-log {
    padding: 18px 20px;
  }
}
/* Legal footer shared across public pages. */
.site-legal-footer {
  margin-top: 64px;
  background: linear-gradient(180deg, rgba(255, 250, 243, 0.94), #fff7ed);
  border-top: 1px solid rgba(115, 88, 55, 0.18);
  color: var(--ink);
}

.site-legal-inner {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 34px 0;
  display: grid;
  grid-template-columns: minmax(260px, 1.4fr) minmax(220px, 1fr) minmax(220px, 0.8fr);
  gap: 28px;
}

.site-legal-footer h2 {
  margin: 0 0 12px;
  font-size: 16px;
  color: var(--brand-dark);
}

.site-legal-footer p,
.site-legal-footer a,
.site-legal-footer span {
  font-size: 14px;
  line-height: 1.6;
}

.site-legal-footer p {
  margin: 0 0 8px;
  color: var(--muted);
}

.site-legal-footer a {
  color: var(--brand);
  text-decoration: none;
  font-weight: 700;
}

.site-legal-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.site-legal-logo img {
  width: 44px;
  height: 44px;
  object-fit: contain;
}

.site-legal-logo strong,
.site-legal-logo span {
  display: block;
}

.site-legal-logo strong {
  font-size: 20px;
}

.site-legal-links {
  display: grid;
  align-content: start;
  gap: 8px;
}

.site-legal-bottom {
  border-top: 1px solid rgba(115, 88, 55, 0.14);
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 14px 0 24px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted);
}

html[data-theme="dark"] .site-legal-footer {
  background: linear-gradient(180deg, rgba(31, 23, 18, 0.96), #17110d);
  border-color: rgba(255, 210, 151, 0.14);
}

html[data-theme="dark"] .site-legal-footer h2,
html[data-theme="dark"] .site-legal-logo strong {
  color: #fff8ef;
}

html[data-theme="dark"] .site-legal-footer p,
html[data-theme="dark"] .site-legal-footer span {
  color: #d7c8b7;
}

html[data-theme="dark"] .site-legal-footer a {
  color: #ffb467;
}

@media (max-width: 820px) {
  .site-legal-inner {
    grid-template-columns: 1fr;
  }

  .site-legal-bottom {
    display: grid;
  }
}
