:root {
  --brand: #159447;
  --brand-dark: #0f7638;
  --brand-soft: #e9f6ed;
  --ink: #091b37;
  --ink-soft: #253754;
  --muted: #66758b;
  --muted-light: #8b98aa;
  --line: #dce4e8;
  --line-soft: #edf1f3;
  --mist: #f5faf7;
  --surface: #ffffff;
  --canvas: var(--mist);
  /* CherryTech shared brand contract (mirrors the public site). */
  --radius-control: 4px;
  --radius-card: 8px;
  --shadow-card: 0 8px 24px rgba(9, 27, 55, .08);
  --brand-header-height: 86px;
  --brand-shell-width: 1280px;
  --ok: #138a55;
  --warn: #a76400;
  --err: #b63838;
  --radius-sm: var(--radius-control);
  --radius: var(--radius-card);
  --radius-lg: var(--radius-card);
  --shadow-sm: 0 1px 2px rgba(9, 27, 55, .05);
  --shadow: var(--shadow-card);
  --header-height: var(--brand-header-height);
}

* { box-sizing: border-box; }
html { color-scheme: light; scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  background: var(--canvas);
  color: var(--ink);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
body.nav-open { overflow: hidden; }
button, input, select, textarea { font: inherit; }
button, select { cursor: pointer; }
a { color: var(--brand); text-decoration-thickness: 1px; text-underline-offset: 3px; }
img { max-width: 100%; }
:focus-visible { outline: 3px solid rgba(21, 148, 71, .26); outline-offset: 2px; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { color: var(--ink); line-height: 1.25; }
h1 { margin-bottom: 10px; font-size: clamp(30px, 4vw, 44px); letter-spacing: -.035em; }
h2 { margin-bottom: 14px; font-size: 20px; letter-spacing: -.015em; }
h3 { margin-bottom: 10px; font-size: 15px; }
[hidden] { display: none !important; }
.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }

/* Shared brand and app chrome */
.portal-header, .topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  min-height: var(--header-height);
  border-bottom: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 1px 0 rgba(9, 27, 55, .02);
  backdrop-filter: blur(8px);
}
.portal-header-inner, .topbar-inner {
  display: flex;
  width: min(var(--brand-shell-width), 100%);
  min-height: var(--header-height);
  align-items: center;
  gap: 18px;
  margin: 0 auto;
  padding: 10px 32px;
}
.brand-mark { display: inline-flex; flex: 0 0 auto; align-items: center; color: var(--ink); text-decoration: none; }
.brand-mark img { display: block; width: auto; height: 44px; }
.topbar-title { padding-left: 18px; border-left: 1px solid var(--line); color: var(--muted); font-size: 13px; font-weight: 700; }
.portal-context { padding-left: 18px; border-left: 1px solid var(--line); color: var(--muted); font-size: 13px; font-weight: 700; }
.portal-header .spacer, .topbar .spacer { flex: 1; }
.portal-header-actions { display: flex; align-items: center; gap: 20px; }
.topbar-user { display: flex; align-items: center; gap: 12px; }
.who { max-width: 260px; overflow: hidden; color: var(--ink-soft); font-size: 13px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.topbar .menu-toggle { display: none; min-width: 48px; }
.site-return { color: var(--ink-soft); font-size: 13px; font-weight: 700; text-decoration: none; transition: color .15s ease; }
.site-return::before { margin-right: 6px; content: "←"; }
.site-return:hover { color: var(--brand); }
.site-return.compact { white-space: nowrap; }
.language-switcher { display: flex; align-items: center; gap: 4px; color: #cbd5e1; }
.language-switcher button { min-width: 28px; min-height: 30px; padding: 4px 6px; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--muted); font-size: 12px; font-weight: 700; }
.language-switcher button:hover { color: var(--brand); }
.language-switcher button.active { background: var(--mist); color: var(--brand); }
.admin-badge { display: inline-flex; min-height: 24px; align-items: center; padding: 2px 8px; border: 1px solid #d7e5dc; border-radius: 999px; background: var(--brand-soft); color: var(--brand-dark); font-size: 11px; font-weight: 800; }
.app-nav .tabs { margin: 0; }
.mobile-nav-extras { display: none; }
.nav-overlay { display: none; }
.wrap { width: min(1180px, 100%); margin: 0 auto; padding: 30px 28px 52px; }
.page-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 26px; }
.page-heading p { margin-bottom: 0; }
.eyebrow { margin-bottom: 8px; color: var(--brand); font-size: 11px; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; }
.section-label { display: flex; align-items: center; gap: 12px; margin: 0 0 12px; color: var(--brand); font-size: 11px; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; }
.section-label > span { width: 32px; height: 1px; background: currentColor; }
.section-label b { font: inherit; }
.section-label.dark { color: #79d894; }
.lead { max-width: 700px; color: var(--muted); line-height: 1.75; }
.data-date { color: var(--muted); font-size: 13px; }

/* Admin layout */
.admin-layout { display: grid; grid-template-columns: 224px minmax(0, 1fr); min-height: calc(100vh - var(--header-height)); }
.admin-page .app-nav { position: sticky; top: var(--header-height); height: calc(100vh - var(--header-height)); padding: 28px 18px; border-right: 1px solid var(--line-soft); background: var(--surface); }
.nav-kicker { padding: 0 12px 12px; color: var(--muted-light); font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.admin-page .tabs { display: grid; gap: 4px; }
.admin-page .tabs button { width: 100%; min-height: 44px; padding: 10px 12px; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--ink-soft); font-size: 14px; font-weight: 650; text-align: left; }
.admin-page .tabs button:hover { background: var(--mist); color: var(--brand); }
.admin-page .tabs button.active { background: var(--brand-soft); color: var(--brand-dark); }
.admin-page .tabs button.active::before { display: inline-block; width: 3px; height: 16px; margin-right: 9px; border-radius: 2px; background: var(--brand); vertical-align: -3px; content: ""; }
.badge-count { display: inline-flex; min-width: 22px; height: 22px; align-items: center; justify-content: center; margin-left: 6px; padding: 0 6px; border-radius: 999px; background: var(--ink); color: #fff; font-size: 11px; }

/* Customer navigation */
.user-page .app-nav { border-bottom: 1px solid var(--line-soft); background: var(--surface); }
.user-page .app-nav .tabs { display: flex; width: min(1180px, 100%); gap: 30px; margin: 0 auto; padding: 0 28px; }
.user-page .tabs button { position: relative; min-height: 52px; padding: 0; border: 0; background: transparent; color: var(--muted); font-size: 14px; font-weight: 700; }
.user-page .tabs button:hover, .user-page .tabs button.active { color: var(--brand); }
.user-page .tabs button.active::after { position: absolute; right: 0; bottom: 0; left: 0; height: 2px; background: var(--brand); content: ""; }

/* Surfaces and grids */
.card { margin-bottom: 20px; padding: 24px; border: 1px solid var(--line-soft); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }
.card.flat { box-shadow: none; }
.card-head { display: flex; align-items: start; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.card-head h2, .card-head p { margin-bottom: 0; }
.grid { display: grid; gap: 18px; }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.section-note { margin: -2px 0 18px; padding: 13px 16px; border-left: 3px solid var(--brand); background: var(--mist); color: var(--ink-soft); font-size: 13px; }

/* Buttons */
.btn, button.btn { display: inline-flex; min-height: 42px; align-items: center; justify-content: center; gap: 8px; padding: 9px 18px; border: 1px solid var(--brand); border-radius: var(--radius-sm); background: var(--brand); color: #fff; font-weight: 750; line-height: 1.2; text-decoration: none; transition: background .16s ease, border-color .16s ease, color .16s ease, transform .16s ease; }
.btn:hover { border-color: var(--brand-dark); background: var(--brand-dark); }
.btn:active { transform: translateY(1px); }
.btn.ghost { border-color: var(--line); background: #fff; color: var(--ink-soft); }
.btn.ghost:hover { border-color: var(--brand); color: var(--brand); }
.btn.subtle { border-color: transparent; background: var(--brand-soft); color: var(--brand-dark); }
.btn.ok { border-color: var(--ok); background: var(--ok); }
.btn.no, .btn.danger { border-color: var(--err); background: #fff; color: var(--err); }
.btn.small { min-height: 34px; padding: 6px 11px; font-size: 12px; }
button[disabled], .btn[aria-disabled="true"] { cursor: not-allowed; opacity: .55; transform: none; }
.button-row { display: flex; flex-wrap: wrap; gap: 10px; }

/* Forms */
label { display: block; margin-bottom: 6px; color: var(--ink-soft); font-size: 13px; font-weight: 700; }
input, select, textarea { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; color: var(--ink); transition: border-color .16s ease, box-shadow .16s ease; }
textarea { min-height: 100px; resize: vertical; }
input:hover, select:hover, textarea:hover { border-color: #b7c5cb; }
input:focus, select:focus, textarea:focus { outline: 0; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(21, 148, 71, .13); }
input::placeholder, textarea::placeholder { color: #9aa6b5; }
.field { margin-bottom: 16px; }
.field-help { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; }
.entry-type-switch, .chart-ranges { display: inline-flex; padding: 4px; border-radius: 8px; background: #eef3f1; }
.entry-type-switch { margin-bottom: 18px; }
.entry-type-switch button, .chart-ranges button { min-height: 38px; padding: 7px 16px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); font-size: 13px; font-weight: 750; }
.entry-type-switch button.active, .chart-ranges button.active { background: var(--brand); color: #fff; box-shadow: 0 3px 10px rgba(21, 148, 71, .18); }

/* Statistics */
.stat { min-width: 0; padding: 18px; border: 1px solid var(--line-soft); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }
.stat .k { color: var(--muted); font-size: 12px; font-weight: 650; }
.stat .v { margin-top: 6px; overflow: hidden; color: var(--ink); font-size: clamp(22px, 3vw, 29px); font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -.025em; text-overflow: ellipsis; white-space: nowrap; }
.pos { color: var(--ok) !important; }
.neg { color: var(--err) !important; }
.hint { color: var(--muted); font-size: 13px; }

/* Customer dashboard */
.customer-heading { align-items: center; }
.customer-heading .lead { font-size: 14px; }
.asset-hero { display: grid; grid-template-columns: minmax(0, .82fr) minmax(420px, 1.18fr); overflow: hidden; margin-bottom: 24px; border: 1px solid #dcebe1; border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow); }
.asset-summary { display: flex; flex-direction: column; justify-content: center; padding: 34px; background: var(--mist); }
.asset-label { margin-bottom: 8px; color: var(--ink-soft); font-size: 13px; font-weight: 750; }
.asset-value-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.asset-currency { color: var(--ink); font-size: 17px; font-weight: 800; }
.asset-value { margin: 0; color: var(--ink); font-size: clamp(34px, 5vw, 54px); font-weight: 850; font-variant-numeric: tabular-nums; letter-spacing: -.045em; line-height: 1.08; }
.privacy-toggle { white-space: nowrap; min-height: 36px; padding: 5px 9px; border: 1px solid #cfdad5; border-radius: var(--radius-sm); background: transparent; color: var(--muted); font-size: 12px; font-weight: 700; }
.asset-profit { margin: 14px 0 0; color: var(--ok); font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums; }
.asset-profit-note { margin-left: 8px; color: var(--muted); font-size: 12px; font-weight: 600; }
.asset-meta { margin-top: 24px; color: var(--muted); font-size: 12px; }
.nav-overview { padding: 28px 30px; }
.product-picker { margin-bottom: 20px; }
.product-picker label { color: var(--muted); }
.product-picker select { max-width: 420px; font-weight: 750; }
.nav-metrics { display: flex; gap: 0; margin-bottom: 14px; }
.nav-metric { min-width: 180px; padding-right: 26px; }
.nav-metric + .nav-metric { padding-left: 26px; border-left: 1px solid var(--line); }
.nav-metric .k { color: var(--muted); font-size: 12px; font-weight: 650; }
.nav-metric .v { margin-top: 2px; color: var(--ink); font-size: 25px; font-weight: 850; font-variant-numeric: tabular-nums; }
.nav-metric .delta { color: var(--ok); font-size: 13px; font-weight: 750; }
.chart-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 8px 0 12px; }
.chart-wrap { position: relative; min-height: 280px; }
.nav-chart { display: block; width: 100%; height: 280px; touch-action: pan-y; }
.chart-tooltip { position: absolute; z-index: 3; min-width: 116px; padding: 8px 10px; border-radius: 7px; background: var(--ink); color: #fff; font-size: 11px; line-height: 1.45; pointer-events: none; transform: translate(-50%, calc(-100% - 12px)); box-shadow: var(--shadow-sm); }
.chart-tooltip strong { display: block; font-size: 13px; font-variant-numeric: tabular-nums; }
.chart-empty { display: grid; min-height: 250px; place-items: center; color: var(--muted); text-align: center; }
.holding-section { margin-top: 24px; }
.holding-section-title { padding: 18px 22px; border-radius: var(--radius) var(--radius) 0 0; background: var(--mist); }
.holding-section-title h2 { margin: 0; }
.holding-section .card { border-radius: 0 0 var(--radius) var(--radius); box-shadow: none; }

/* Tables */
.table-scroll { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 11px 12px; border-bottom: 1px solid var(--line-soft); text-align: left; vertical-align: middle; white-space: nowrap; }
th { background: #fafcfb; color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .02em; }
tbody tr:hover { background: #fbfdfc; }
tbody tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.empty { padding: 40px 18px; color: var(--muted); text-align: center; }
.empty strong { display: block; margin-bottom: 4px; color: var(--ink-soft); }

/* Tags and feedback */
.tag { display: inline-flex; min-height: 24px; align-items: center; padding: 2px 9px; border-radius: 999px; font-size: 11px; font-weight: 750; }
.tag.pending { background: #fff3df; color: var(--warn); }
.tag.approved { background: #e8f6ef; color: var(--ok); }
.tag.rejected { background: #fcebec; color: var(--err); }
#msg { position: fixed; top: 18px; left: 50%; z-index: 100; display: none; width: min(440px, calc(100vw - 32px)); padding: 12px 18px; border-radius: 8px; color: #fff; font-size: 14px; font-weight: 700; text-align: center; transform: translateX(-50%); box-shadow: 0 12px 28px rgba(9, 27, 55, .2); }
#msg.show { display: block; }
#msg.ok { background: var(--ok); }
#msg.err { background: var(--err); }

/* Dialog */
dialog { width: min(460px, calc(100vw - 32px)); padding: 0; border: 0; border-radius: var(--radius-lg); color: var(--ink); box-shadow: 0 24px 70px rgba(9, 27, 55, .24); }
dialog::backdrop { background: rgba(9, 27, 55, .46); }
.dialog-body { padding: 24px; }
.dialog-body h2 { margin-bottom: 8px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 24px; border-top: 1px solid var(--line-soft); background: #fafcfb; }

/* Login */
.login-page { min-height: 100vh; background: var(--surface); }
.login-shell { display: grid; min-height: calc(100vh - var(--header-height)); grid-template-columns: minmax(360px, .88fr) minmax(440px, 1.12fr); }
.login-brand-panel { position: relative; display: flex; flex-direction: column; justify-content: center; padding: 54px clamp(36px, 6vw, 84px); background: var(--ink); color: #fff; }
.login-copy { position: relative; z-index: 1; max-width: 560px; }
.login-copy h1 { margin-bottom: 22px; color: #fff; font-size: clamp(40px, 5vw, 66px); line-height: 1.08; }
.login-copy p { max-width: 480px; color: #c8d1de; font-size: 16px; line-height: 1.9; }
.login-copy .section-label { color: #79d894; }
.login-foot { position: absolute; bottom: 42px; left: clamp(36px, 6vw, 84px); z-index: 1; margin: 0; color: #a7b2c2; font-size: 12px; }
.login-form-panel { display: flex; min-width: 0; flex-direction: column; align-items: center; justify-content: center; padding: 40px; background: var(--mist); }
.login-card { width: min(430px, 100%); padding: 38px; border: 1px solid var(--line-soft); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow); }
.login-card h2 { margin-bottom: 8px; font-size: 28px; }
.login-card .sub { margin-bottom: 30px; color: var(--muted); }
.login-card .btn { width: 100%; margin-top: 6px; }
.login-help { margin: 18px 0 0; text-align: center; }
.login-legal { display: flex; width: min(430px, 100%); justify-content: space-between; gap: 20px; margin-top: 22px; color: var(--muted); font-size: 11px; }
.app-footer { border-top: 1px solid var(--line-soft); background: var(--surface); color: var(--muted); }
.app-footer > div { display: flex; width: min(var(--brand-shell-width), 100%); justify-content: space-between; gap: 20px; margin: 0 auto; padding: 20px 32px; font-size: 12px; }

/* 404 */
.not-found { display: grid; min-height: 100vh; place-items: center; padding: 24px; background: var(--mist); }
.not-found-card { max-width: 460px; padding: 42px; text-align: center; }
.not-found-code { margin: 0; color: var(--brand); font-size: 78px; font-weight: 900; line-height: 1; }

@media (max-width: 980px) {
  .grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .asset-hero { grid-template-columns: 1fr; }
  .asset-summary { min-height: 260px; }
  .login-shell { grid-template-columns: .8fr 1.2fr; }
  .login-brand-panel { padding: 42px 34px; }
}

@media (max-width: 760px) {
  body { font-size: 14px; }
  h1 { font-size: 30px; }
  .portal-header-inner, .topbar-inner { gap: 10px; padding: 10px 20px; }
  .brand-mark img { height: 44px; }
  .topbar-title, .portal-context, .topbar .admin-badge { display: none; }
  .topbar-user .who, .topbar-user > [data-logout] { display: none; }
  .topbar-user > .site-return, .app-header-language { display: none; }
  .topbar .menu-toggle { display: inline-flex; }
  .wrap { padding: 24px 16px 44px; }
  .page-heading { display: block; margin-bottom: 22px; }
  .page-heading .data-date { margin-top: 8px; }
  .admin-layout { display: block; }
  .app-nav { position: fixed !important; top: var(--header-height) !important; right: 0; left: 0; z-index: 49; display: block; height: auto !important; max-height: calc(100vh - var(--header-height)); overflow-y: auto; padding: 16px !important; border-right: 0 !important; border-bottom: 1px solid var(--line); background: #fff; box-shadow: 0 20px 38px rgba(9, 27, 55, .16); transform: translateY(calc(-100% - var(--header-height))); transition: transform .2s ease; }
  body.nav-open .app-nav { transform: translateY(0); }
  .nav-overlay { position: fixed; inset: var(--header-height) 0 0; z-index: 48; display: block; border: 0; background: rgba(9, 27, 55, .34); opacity: 0; pointer-events: none; transition: opacity .2s ease; }
  body.nav-open .nav-overlay { opacity: 1; pointer-events: auto; }
  .nav-kicker { padding-top: 2px; }
  .admin-page .tabs, .user-page .app-nav .tabs { display: grid; width: 100%; gap: 3px; padding: 0; }
  .mobile-nav-extras { display: grid; gap: 12px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line-soft); }
  .mobile-nav-extras .language-switcher { justify-content: flex-start; }
  .mobile-nav-extras .site-return { min-height: 44px; display: flex; align-items: center; padding: 0 12px; }
  .mobile-nav-extras .btn { width: 100%; min-height: 48px; }
  .admin-page .tabs button, .user-page .tabs button { width: 100%; min-height: 48px; padding: 10px 12px; border-radius: var(--radius-sm); text-align: left; }
  .user-page .tabs button.active { background: var(--brand-soft); }
  .user-page .tabs button.active::after { display: none; }
  .user-page .tabs button.active::before { display: inline-block; width: 3px; height: 16px; margin-right: 9px; border-radius: 2px; background: var(--brand); vertical-align: -3px; content: ""; }
  .grid.cols-2, .grid.cols-4 { grid-template-columns: 1fr; }
  .card { padding: 18px; border-radius: 8px; }
  .card-head { display: block; }
  .card-head .button-row { margin-top: 12px; }
  .row { grid-template-columns: 1fr; gap: 0; }
  .entry-type-switch { display: grid; grid-template-columns: repeat(3, 1fr); width: 100%; }
  .entry-type-switch button { padding: 7px 8px; }
  .customer-heading h1 { margin-bottom: 5px; }
  .asset-hero { display: block; margin-right: -16px; margin-left: -16px; border-right: 0; border-left: 0; border-radius: 0; box-shadow: none; }
  .asset-summary { min-height: 0; padding: 28px 24px; }
  .asset-value-row { flex-wrap: wrap; gap: 9px; }
  .asset-value { font-size: clamp(34px, 10.5vw, 48px); }
  .asset-currency { width: 100%; font-size: 14px; }
  .asset-profit { font-size: 16px; }
  .asset-profit-note { margin-left: 8px; }
  .asset-meta { margin-top: 18px; }
  .nav-overview { padding: 24px 20px 26px; }
  .product-picker select { max-width: none; }
  .nav-metrics { justify-content: space-between; }
  .nav-metric { min-width: 0; flex: 1; padding-right: 16px; }
  .nav-metric + .nav-metric { padding-left: 16px; }
  .nav-metric .v { font-size: 22px; }
  .chart-toolbar { display: block; }
  .chart-ranges { display: grid; grid-template-columns: repeat(4, 1fr); width: 100%; margin-top: 12px; }
  .chart-ranges button { padding: 7px 4px; }
  .chart-wrap { min-height: 250px; }
  .nav-chart { height: 250px; }
  .holding-section { margin-right: -16px; margin-left: -16px; }
  .holding-section-title { border-radius: 0; }
  .holding-section .card { border-right: 0; border-left: 0; border-radius: 0; }
  .responsive-table thead { display: none; }
  .responsive-table, .responsive-table tbody, .responsive-table tr, .responsive-table td { display: block; width: 100%; }
  .responsive-table tr { padding: 8px 0; border-bottom: 1px solid var(--line); }
  .responsive-table tr:last-child { border-bottom: 0; }
  .responsive-table td { display: grid; grid-template-columns: minmax(100px, .7fr) minmax(0, 1.3fr); gap: 16px; padding: 8px 2px; border: 0; text-align: right !important; white-space: normal; }
  .responsive-table td::before { color: var(--muted); font-size: 12px; font-weight: 700; text-align: left; content: attr(data-label); }
  .responsive-table td .table-actions { justify-content: flex-end; }
  .responsive-table tbody tr:hover { background: transparent; }
  dialog { width: calc(100vw - 20px); margin-bottom: 10px; border-radius: 14px; }
  dialog[open] { position: fixed; top: auto; bottom: 0; }
  .dialog-actions { position: sticky; bottom: 0; }
  .login-shell { display: block; min-height: calc(100vh - var(--header-height)); background: var(--mist); }
  .login-brand-panel { display: none; }
  .login-form-panel { min-height: calc(100vh - var(--header-height)); padding: 34px 18px 24px; }
  .login-card { padding: 28px 22px; box-shadow: var(--shadow-sm); }
  .login-legal { flex-direction: column; align-items: center; gap: 5px; text-align: center; }
  .portal-header-actions { gap: 10px; }
  .portal-header .site-return { font-size: 12px; }
  .app-footer > div { flex-direction: column; gap: 5px; padding: 18px 20px; text-align: center; }
}

@media (max-width: 420px) {
  .asset-value { font-size: 36px; }
  .asset-profit-note { display: block; margin: 3px 0 0; }
  .nav-metric .v { font-size: 20px; }
  .stat .v { font-size: 24px; }
  .button-row .btn { flex: 1; }
}

/* Excel 数据版新增 */
.asset-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 22px; }
.asset-facts span { display: block; color: var(--muted); font-size: 12px; font-weight: 650; }
.asset-facts strong { font-size: 16px; font-variant-numeric: tabular-nums; }
.chart-toolbar { flex-wrap: wrap; }
.stat-row { margin-bottom: 18px; }
.stat-row .v { font-size: clamp(18px, 2.2vw, 24px); }
.table-more { padding: 14px 0 0; text-align: center; }
.meta-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px 24px; margin: 0 0 8px; }
.meta-list dt { color: var(--muted); font-size: 12px; font-weight: 700; }
.meta-list dd { margin: 2px 0 0; font-variant-numeric: tabular-nums; }
.warn-note { margin: 12px 0 0; padding: 11px 14px; border-left: 3px solid var(--warn); background: #fff7e8; color: #6b4300; font-size: 13px; }
[data-preview] { margin-top: 8px; padding-top: 18px; border-top: 1px dashed var(--line); }
[data-preview] h3 { margin: 22px 0 12px; }
.admin-page .entry-type-switch { flex-wrap: wrap; }
.list-toolbar { display: grid; grid-template-columns: minmax(0, 2fr) repeat(2, minmax(0, 1fr)); gap: 0 12px; margin-bottom: 4px; }
@media (max-width: 760px) {
  .list-toolbar { grid-template-columns: 1fr; }
  .asset-facts { grid-template-columns: 1fr 1fr; }
  .chart-toolbar .chart-ranges + .chart-ranges { grid-template-columns: repeat(4, 1fr); }
  .chart-toolbar .chart-ranges:first-child { grid-template-columns: 1fr 1fr; }
  .admin-page .entry-type-switch { grid-template-columns: repeat(2, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

/* Customer investor login — reference-led responsive redesign */
.investor-login { --header-height: 70px; background: #fff; }
.investor-login .portal-header { min-height: var(--header-height); }
.investor-login .portal-header-inner { width: min(1536px, 100%); min-height: var(--header-height); padding: 8px clamp(24px, 5.4vw, 88px); }
.investor-login .brand-mark img { height: 38px; }
.investor-login .portal-context { color: #5f7088; font-size: 14px; }
.investor-login .portal-header-actions { gap: 24px; }
.investor-login .login-shell {
  position: relative;
  isolation: isolate;
  display: grid;
  min-height: calc(100vh - var(--header-height));
  min-height: calc(100svh - var(--header-height));
  grid-template-columns: minmax(0, 1.82fr) minmax(430px, 1fr);
  overflow: hidden;
  background: #eef5f8;
}
.investor-login .login-hero-media { position: absolute; inset: 0 auto 0 0; z-index: 0; display: block; width: 64.6%; height: 100%; overflow: hidden; }
.investor-login .login-hero-media img { display: block; width: 100%; height: 100%; max-width: none; object-fit: cover; object-position: 55% center; }
.investor-login .login-brand-panel {
  position: relative;
  z-index: 1;
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: flex-start;
  padding: clamp(56px, 7.5vh, 82px) clamp(42px, 6.6vw, 118px) 42px;
  background: transparent;
  color: var(--ink);
}
.investor-login .login-copy { width: min(820px, 100%); max-width: none; }
.investor-login .login-copy .section-label { margin-bottom: 20px; color: var(--brand); font-size: 13px; letter-spacing: .04em; text-transform: none; }
.investor-login .login-copy h1 { max-width: 800px; margin: 0 0 20px; color: var(--ink); font-size: clamp(43px, 4.3vw, 68px); font-weight: 850; letter-spacing: -.055em; line-height: 1.15; text-wrap: balance; }
.investor-login .login-copy h1 span, .investor-login .login-copy h1 strong { display: block; }
.investor-login .login-copy h1 strong { color: var(--brand); font-weight: inherit; }
.investor-login .login-copy > p:not(.section-label) { max-width: 590px; margin-bottom: 0; color: #43566e; font-size: 17px; line-height: 1.75; }
.investor-login .login-benefits { display: grid; max-width: 880px; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 26px; margin: clamp(34px, 6vh, 58px) 0 0; padding: 0; list-style: none; }
.investor-login .login-benefits li { display: grid; min-width: 0; grid-template-columns: 50px minmax(0, 1fr); align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid rgba(255, 255, 255, .72); border-radius: 13px; background: rgba(255, 255, 255, .8); box-shadow: 0 10px 24px rgba(9, 27, 55, .08); }
.investor-login .benefit-icon { display: grid; width: 50px; height: 50px; place-items: center; border: 1px solid rgba(21, 148, 71, .16); border-radius: 12px; background: rgba(255, 255, 255, .74); color: var(--brand); box-shadow: 0 8px 20px rgba(9, 27, 55, .06); }
.investor-login .benefit-icon i { font-size: 22px; }
.investor-login .login-benefits b, .investor-login .login-benefits small { display: block; }
.investor-login .login-benefits b { color: var(--ink); font-size: 14px; line-height: 1.35; }
.investor-login .login-benefits small { margin-top: 4px; color: #53657c; font-size: 11px; line-height: 1.4; }
.investor-login .login-foot { bottom: 28px; left: clamp(42px, 6.6vw, 118px); color: #42566e; }
.investor-login .login-form-panel { position: relative; z-index: 1; padding: 34px clamp(28px, 3.7vw, 66px); background: rgba(244, 248, 250, .94); }
.investor-login .login-card { width: min(500px, 100%); padding: clamp(34px, 4vw, 46px); border-color: rgba(220, 228, 232, .86); border-radius: 14px; box-shadow: 0 24px 70px rgba(9, 27, 55, .14); }
.investor-login .login-card .section-label { margin-bottom: 18px; font-size: 12px; letter-spacing: .04em; text-transform: none; }
.investor-login .login-card h2 { margin-bottom: 8px; font-size: clamp(27px, 2.2vw, 34px); letter-spacing: -.035em; }
.investor-login .login-card .sub { margin-bottom: 28px; font-size: 14px; }
.investor-login .login-card .field { margin-bottom: 18px; }
.investor-login .login-card label { margin-bottom: 8px; color: var(--ink); font-size: 14px; }
.investor-login .input-shell { position: relative; }
.investor-login .input-shell > .bi { position: absolute; top: 50%; left: 16px; z-index: 1; color: #61728a; font-size: 19px; pointer-events: none; transform: translateY(-50%); }
.investor-login .input-shell input { min-height: 52px; padding: 12px 50px 12px 48px; border-color: #d3dce3; border-radius: 7px; font-size: 16px; }
.investor-login .input-shell input:focus { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(21, 148, 71, .12); }
.investor-login .password-toggle { position: absolute; top: 50%; right: 6px; display: grid; width: 40px; height: 40px; place-items: center; padding: 0; border: 0; border-radius: 6px; background: transparent; color: #607189; transform: translateY(-50%); }
.investor-login .password-toggle:hover { background: var(--mist); color: var(--brand); }
.investor-login .password-toggle i { font-size: 18px; }
.investor-login .login-card .login-submit { min-height: 54px; margin-top: 5px; border-radius: 7px; font-size: 16px; letter-spacing: .08em; }
.investor-login .login-submit i { font-size: 18px; transition: transform .16s ease; }
.investor-login .login-submit:hover i { transform: translateX(3px); }
.investor-login .login-help { margin-top: 16px; }
.investor-login .login-legal { width: min(500px, 100%); margin-top: 20px; font-size: 11px; }

@media (max-width: 1199px) and (min-width: 900px) {
  .investor-login .login-shell { grid-template-columns: minmax(0, 1.28fr) minmax(430px, 1fr); }
  .investor-login .login-hero-media { width: 56.2%; }
  .investor-login .login-brand-panel { padding-right: 38px; padding-left: 38px; }
  .investor-login .login-copy h1 { font-size: clamp(38px, 4.4vw, 50px); }
  .investor-login .login-copy > p:not(.section-label) { font-size: 15px; }
  .investor-login .login-benefits { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 22px; margin-top: 30px; }
  .investor-login .login-foot { left: 38px; }
  .investor-login .login-form-panel { padding: 28px; }
}

@media (max-width: 899px) {
  .investor-login { --header-height: 64px; }
  .investor-login .portal-header-inner { min-height: var(--header-height); padding: 8px 18px; }
  .investor-login .brand-mark img { height: 35px; }
  .investor-login .portal-context, .investor-login .portal-header .site-return { display: none; }
  .investor-login .portal-header-actions { gap: 0; }
  .investor-login .language-switcher button { min-width: 30px; min-height: 36px; font-size: 12px; }
  .investor-login .login-shell {
    display: block;
    min-height: calc(100vh - var(--header-height));
    min-height: calc(100svh - var(--header-height));
    overflow: visible;
    padding: 0 16px 24px;
    background: #dff1fa;
  }
  .investor-login .login-hero-media { position: absolute; inset: 0; width: 100%; height: 100%; }
  .investor-login .login-hero-media img { object-position: center top; }
  .investor-login .login-brand-panel { display: flex; min-height: 276px; padding: 38px 8px 24px; }
  .investor-login .login-copy { width: min(560px, 100%); margin: 0 auto; }
  .investor-login .login-copy .section-label { margin-bottom: 14px; font-size: 12px; }
  .investor-login .login-copy h1 { max-width: 560px; margin-bottom: 14px; font-size: clamp(34px, 8.7vw, 47px); line-height: 1.13; }
  .investor-login .login-copy > p:not(.section-label) { max-width: 520px; color: #354a65; font-size: 14px; line-height: 1.65; }
  .investor-login .login-benefits, .investor-login .login-foot { display: none; }
  .investor-login .login-form-panel { display: block; min-height: 0; padding: 0; background: transparent; }
  .investor-login .login-card { width: min(520px, 100%); margin: 0 auto; padding: 30px 24px; border-radius: 16px; background: rgba(255, 255, 255, .97); box-shadow: 0 20px 54px rgba(9, 27, 55, .18); }
  .investor-login .login-card h2 { font-size: 27px; }
  .investor-login .login-card .sub { margin-bottom: 24px; }
  .investor-login .login-legal { width: min(520px, 100%); margin: 14px auto 0; padding: 9px 12px; border-radius: 9px; background: rgba(255, 255, 255, .9); color: #455970; }
}

@media (max-width: 480px) {
  .investor-login .portal-header-inner { padding-right: 12px; padding-left: 14px; }
  .investor-login .brand-mark img { height: 32px; }
  .investor-login .language-switcher { gap: 1px; }
  .investor-login .language-switcher button { min-width: 27px; padding-right: 4px; padding-left: 4px; }
  .investor-login .login-shell { padding-right: 14px; padding-left: 14px; }
  .investor-login .login-brand-panel { min-height: 248px; padding-top: 30px; }
  .investor-login .login-copy h1 { font-size: clamp(31px, 9vw, 38px); }
  .investor-login .login-card { padding: 27px 20px; }
  .investor-login .login-card .section-label { margin-bottom: 14px; }
  .investor-login .login-card h2 { font-size: 24px; }
  .investor-login .login-legal { flex-direction: column; align-items: center; gap: 3px; text-align: center; }
}

@media (max-width: 374px) {
  .investor-login .login-brand-panel { min-height: 218px; padding-top: 24px; }
  .investor-login .login-copy > p:not(.section-label) { display: none; }
  .investor-login .login-card { padding: 24px 18px; }
}

@media (max-width: 899px) and (max-height: 560px) and (orientation: landscape) {
  .investor-login .login-shell { display: grid; grid-template-columns: minmax(280px, .78fr) minmax(420px, 1.22fr); padding: 0; }
  .investor-login .login-hero-media { right: auto; width: 39%; }
  .investor-login .login-hero-media img { object-position: 55% center; }
  .investor-login .login-brand-panel { min-height: calc(100svh - var(--header-height)); justify-content: center; padding: 28px; }
  .investor-login .login-copy h1 { font-size: 30px; }
  .investor-login .login-copy > p:not(.section-label) { display: none; }
  .investor-login .login-form-panel { display: flex; padding: 22px; background: rgba(244, 248, 250, .96); }
  .investor-login .login-card { padding: 24px 28px; }
  .investor-login .login-card .section-label, .investor-login .login-help, .investor-login .login-legal { display: none; }
  .investor-login .login-card h2 { font-size: 24px; }
  .investor-login .login-card .sub { margin-bottom: 16px; }
  .investor-login .login-card .field { margin-bottom: 12px; }
  .investor-login .input-shell input, .investor-login .login-card .login-submit { min-height: 48px; }
}

/* Cross-page tablet and phone safeguards */
@media (max-width: 1040px) and (min-width: 761px) {
  .user-page .topbar-title, .admin-page .topbar-title,
  .user-page .topbar-user .who, .admin-page .topbar-user .who,
  .user-page .site-return.compact, .admin-page .site-return.compact { display: none; }
  .topbar-inner { padding-right: 22px; padding-left: 22px; }
  .admin-page .grid.cols-2 { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  input, select, textarea { font-size: 16px; }
  .btn.small { min-height: 44px; }
  .not-found { min-height: 100svh; padding: 16px; }
  .not-found-card { width: 100%; padding: 34px 22px; }
  .not-found-code { font-size: 64px; }
}
