/* ---------- Design tokens ---------- */
:root {
  /* Brand */
  --brand-name: "投資家ポートフォリオ図鑑";

  /* Surfaces — warm parchment financial editorial */
  --bg: #F6F2E9;
  --bg-2: #EFE9DB;
  --surface: #FFFFFF;
  --surface-2: #FBF8F1;
  --border: #E4DDCC;
  --border-strong: #C9C0AA;
  --divider: #EEE7D4;

  /* Ink — boosted contrast for readability */
  --ink: #0F1318;
  --ink-2: #2D323B;
  --ink-3: #555B68;
  --ink-4: #7E8491;

  /* Brand accent — deep teal-green (finance, growth, calm) */
  --accent: #0E5C4D;
  --accent-2: #094034;
  --accent-soft: #DCEBE5;
  --accent-ink-on: #FFFFFF;

  /* Signals */
  --gain: #1F7A3B;
  --gain-soft: #E2F1E5;
  --loss: #C0392B;
  --loss-soft: #F8E4E1;
  --neutral: #8B8F99;

  /* Chart palette — 10 distinct, warm-leaning */
  --c1: #0E5C4D;
  --c2: #C2410C;
  --c3: #1E5A8A;
  --c4: #B58705;
  --c5: #7C2D5C;
  --c6: #2E7D6E;
  --c7: #8A4F00;
  --c8: #4A5C8A;
  --c9: #5A7C3E;
  --c10: #9A3E3E;

  /* Typography */
  --font-serif: "Zen Old Mincho", "Source Serif 4", "Times New Roman", serif;
  --font-sans: "Zen Kaku Gothic New", "Hiragino Kaku Gothic ProN", "Yu Gothic", system-ui, sans-serif;
  --font-num: "JetBrains Mono", "SF Mono", ui-monospace, monospace;

  /* Radius */
  --r-xs: 4px;
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 20px;

  /* Spacing rhythm */
  --gutter: 20px;
  --container: 1180px;

  /* Shadow — soft editorial */
  --shadow-1: 0 1px 0 rgba(20, 24, 31, 0.04), 0 1px 2px rgba(20, 24, 31, 0.04);
  --shadow-2: 0 2px 6px rgba(20, 24, 31, 0.06), 0 8px 24px rgba(20, 24, 31, 0.06);
  --shadow-3: 0 4px 12px rgba(20, 24, 31, 0.08), 0 18px 48px rgba(20, 24, 31, 0.10);

  /* Density */
  --row-h: 44px;
}

/* Dark mode */
[data-theme="dark"] {
  --bg: #0E1014;
  --bg-2: #14171D;
  --surface: #181C24;
  --surface-2: #1F242E;
  --border: #2A3140;
  --border-strong: #3A4356;
  --divider: #232936;

  --ink: #F1ECDB;
  --ink-2: #C8C2B0;
  --ink-3: #8E94A1;
  --ink-4: #5E6573;

  --accent: #3DD68C;
  --accent-2: #6BE3A4;
  --accent-soft: #14342A;
  --accent-ink-on: #08120E;

  --gain: #3DD68C;
  --gain-soft: #14342A;
  --loss: #FF6A5C;
  --loss-soft: #3A1C19;

  --c1: #3DD68C;
  --c2: #F4A261;
  --c3: #6FA8FF;
  --c4: #E9C46A;
  --c5: #E07AB7;
  --c6: #5DDFC4;
  --c7: #D8915E;
  --c8: #9AB1E0;
  --c9: #B7D88F;
  --c10: #E07A7A;

  --shadow-1: 0 1px 0 rgba(0,0,0,0.4);
  --shadow-2: 0 6px 16px rgba(0,0,0,0.4);
  --shadow-3: 0 10px 40px rgba(0,0,0,0.5);
}

/* Accent color variants — overridden by Tweaks */
[data-accent="teal"]   { --accent: #0E5C4D; --accent-2: #094034; --accent-soft: #DCEBE5; }
[data-accent="indigo"] { --accent: #2C3E8A; --accent-2: #1B266A; --accent-soft: #E0E4F2; }
[data-accent="copper"] { --accent: #B0451A; --accent-2: #7D3013; --accent-soft: #F4E2D6; }
[data-accent="ink"]    { --accent: #1A1A1A; --accent-2: #000000; --accent-soft: #E8E5DC; }

[data-theme="dark"][data-accent="indigo"] { --accent: #8AA0FF; --accent-2: #B6C2FF; --accent-soft: #1B2249; }
[data-theme="dark"][data-accent="copper"] { --accent: #F0A56E; --accent-2: #F7C599; --accent-soft: #3A2417; }
[data-theme="dark"][data-accent="ink"]    { --accent: #F1ECDB; --accent-2: #FFFFFF; --accent-soft: #2A2A2A; }

/* ---------- Reset / base ---------- */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
img { display: block; max-width: 100%; }
.material-symbols-outlined {
  font-family: "Material Symbols Outlined";
  font-weight: 500;
  font-style: normal;
  font-size: 24px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  direction: ltr;
  -webkit-font-feature-settings: "liga";
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "liga";
}

h1, h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.01em;
  margin: 0;
  text-wrap: balance;
}

.num { font-family: var(--font-num); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; font-weight: 500; }
.eyebrow {
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 700;
}
.serif { font-family: var(--font-serif); }

/* ---------- Layout ---------- */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
}
.container-wide { max-width: 1340px; }

/* ---------- Header ---------- */
.app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.app-header__inner {
  display: flex;
  align-items: center;
  gap: 32px;
  height: 64px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-serif);
  font-size: 18px;
  color: var(--ink);
  letter-spacing: -0.01em;
  flex: 0 0 auto;
}
.brand__mark {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: var(--accent);
  color: var(--accent-ink-on);
  display: grid;
  place-items: center;
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 16px;
}
.brand__mark svg {
  width: 18px;
  height: 18px;
}
.brand__text {
  min-width: 0;
}
.brand__name {
  display: block;
  white-space: nowrap;
}
.brand__name--mobile {
  display: none;
}
.brand__sub {
  color: var(--ink-3);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin-left: 2px;
  white-space: nowrap;
}
.nav {
  display: flex;
  gap: 4px;
  margin-left: auto;
  align-items: center;
  min-width: 0;
}
.nav a {
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 500;
  color: var(--ink-2);
  position: relative;
  white-space: nowrap;
}
.nav a:hover { color: var(--ink); background: var(--bg-2); }
.nav a.active {
  color: var(--ink);
  background: var(--surface);
  box-shadow: var(--shadow-1);
}
.nav-yt {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  color: var(--ink-3);
  margin-left: 4px;
  transition: color .12s ease, background .12s ease;
}
.nav-yt:hover { color: #FF0000; background: var(--bg-2); }
.search-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px 7px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-3);
  font-size: 13px;
  margin-left: 8px;
  flex: 0 0 auto;
}
.search-trigger kbd {
  font-family: var(--font-num);
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  color: var(--ink-3);
}
.auth-nav {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: 4px;
}
.nav-button {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink-2);
  border-radius: 999px;
  padding: 7px 11px;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
}
.nav-button:hover { background: var(--bg-2); color: var(--ink); }
.account-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 34px;
  max-width: 160px;
  height: 34px;
  padding: 3px 10px 3px 3px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  overflow: hidden;
  white-space: nowrap;
}
.account-pill__avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: var(--accent-ink-on);
  flex: 0 0 auto;
  font-family: var(--font-serif);
}
.account-pill .desktop-only {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mobile-menu-button {
  appearance: none;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  place-items: center;
  padding: 0;
  flex: 0 0 auto;
  transition: background .14s ease, color .14s ease, transform .14s ease;
}
.mobile-menu-button:hover,
.mobile-menu-button[aria-expanded="true"] {
  background: var(--bg-2);
}
.mobile-menu-button .material-symbols-outlined {
  font-size: 26px;
  line-height: 1;
}
.mobile-menu {
  position: absolute;
  left: 0;
  right: 0;
  top: 64px;
  z-index: 60;
  padding: 8px var(--gutter) 12px;
  background: color-mix(in srgb, var(--bg) 94%, transparent);
  border-bottom: 1px solid var(--border);
  backdrop-filter: saturate(160%) blur(10px);
}
.mobile-menu__panel {
  display: grid;
  gap: 6px;
  max-width: 480px;
  margin: 0 auto;
  padding: 6px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-2);
}
.mobile-menu__panel a,
.mobile-menu__panel button {
  width: 100%;
  min-height: 44px;
  border-radius: 10px;
  border: none;
  background: transparent;
  color: var(--ink-2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  font-size: 14px;
  font-weight: 600;
}
.mobile-menu__panel a.active {
  color: var(--ink);
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
}
.mobile-menu__left {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}
.mobile-menu__left .material-symbols-outlined {
  font-size: 22px;
  color: var(--ink-3);
}
.mobile-menu__panel a.active .mobile-menu__left .material-symbols-outlined {
  color: var(--accent);
}
.mobile-menu__chevron {
  color: var(--ink-4);
  font-size: 22px;
}
.mobile-menu__search {
  color: var(--accent) !important;
}
.mobile-menu__primary {
  background: var(--accent) !important;
  border-color: var(--accent) !important;
  color: var(--accent-ink-on) !important;
  justify-content: center !important;
}
.mobile-menu__muted {
  justify-content: center !important;
}
.mobile-bottom-nav {
  position: fixed;
  left: max(12px, env(safe-area-inset-left));
  right: max(12px, env(safe-area-inset-right));
  bottom: max(10px, env(safe-area-inset-bottom));
  z-index: 55;
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  max-width: 520px;
  margin: 0 auto;
  padding: 6px;
  border: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
  border-radius: 22px;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  box-shadow: 0 14px 38px rgba(15, 23, 42, 0.16);
  backdrop-filter: saturate(160%) blur(16px);
  transition: transform .22s ease, opacity .22s ease, background .22s ease;
}
.mobile-bottom-nav__item {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--ink-3);
  min-width: 0;
  flex: 1 1 0;
  height: 50px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 2px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0;
}
.mobile-bottom-nav__item .material-symbols-outlined {
  font-size: 23px;
  line-height: 1;
}
.mobile-bottom-nav__item.active {
  color: var(--ink);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}
.mobile-bottom-nav__item.active .material-symbols-outlined {
  color: var(--accent);
}
.mobile-bottom-nav__item--search {
  color: var(--accent);
}
.mobile-bottom-nav--hidden {
  transform: translateY(calc(100% - 16px));
  opacity: .36;
  background: color-mix(in srgb, var(--surface) 58%, transparent);
}
.mobile-bottom-nav--soft {
  opacity: .68;
  transform: translateY(8px);
  background: color-mix(in srgb, var(--surface) 66%, transparent);
}

@media (max-width: 1280px) {
  .search-trigger,
  .nav-yt {
    display: none !important;
  }
  .auth-nav .nav-button {
    display: none !important;
  }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  border: 1px solid transparent;
  transition: transform .08s ease, background .15s ease, border-color .15s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--accent); color: var(--accent-ink-on); }
.btn--primary:hover { background: var(--accent-2); }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--border-strong); }
.btn--ghost:hover { background: var(--bg-2); }
.btn--soft { background: var(--surface); color: var(--ink); border-color: var(--border); box-shadow: var(--shadow-1); }
.btn--soft:hover { background: var(--surface-2); }
.btn--sm { padding: 6px 12px; font-size: 13px; }
.btn--lg { padding: 14px 22px; font-size: 15px; }

/* ---------- Card ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 20px;
}
.card--flat { box-shadow: none; }
.card--elev { box-shadow: var(--shadow-2); }

/* ---------- Chips ---------- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 11px;
  border-radius: 999px;
  background: var(--bg-2);
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 500;
  border: 1px solid var(--border);
  white-space: nowrap;
}
.chip--gain { background: var(--gain-soft); color: var(--gain); border-color: transparent; }
.chip--loss { background: var(--loss-soft); color: var(--loss); border-color: transparent; }
.chip--accent { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.chip--dot::before {
  content: "";
  width: 6px; height: 6px; border-radius: 50%;
  background: currentColor;
  display: inline-block;
}

/* ---------- Tables ---------- */
.table { width: 100%; border-collapse: separate; border-spacing: 0; }
.table th, .table td {
  text-align: left;
  padding: 14px 12px;
  border-bottom: 1px solid var(--divider);
  font-size: 15px;
}
.table th {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
  padding-top: 10px;
  padding-bottom: 10px;
}
.table tr:last-child td { border-bottom: none; }
.table td.num, .table th.num { text-align: right; }
.table td.ticker {
  font-family: var(--font-num);
  font-weight: 600;
  letter-spacing: -0.01em;
}
.table tr.row-hover:hover td { background: var(--surface-2); cursor: pointer; }

/* External-ticker link */
.ticker-link {
  font-family: var(--font-num);
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink) !important;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-bottom: 1px dashed transparent;
  transition: border-color .12s ease, color .12s ease;
  position: relative;
}
.ticker-link:hover { color: var(--accent) !important; border-bottom-color: currentColor; }
.ticker-link .ext-icon { opacity: 0.5; }
.ticker-link:hover .ext-icon { opacity: 1; }
.ticker-link::after {
  content: "";
  display: none;
}

/* moomoo affiliate link */
.aff-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--ink-2);
  font-size: 12px;
  transition: all .12s ease;
  white-space: nowrap;
}
.aff-link:hover { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-soft); }
.aff-link__pr {
  font-size: 9px;
  letter-spacing: 0.06em;
  padding: 1px 5px;
  border-radius: 3px;
  background: var(--bg-2);
  color: var(--ink-3);
  font-weight: 600;
}
.aff-link:hover .aff-link__pr { background: var(--surface); }

/* Moomoo CTA card */
.cta-moomoo {
  position: relative;
  border-radius: var(--r-lg);
  padding: 28px 32px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  color: #fff;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: center;
  overflow: hidden;
}
.cta-moomoo::before {
  content: "PR";
  position: absolute;
  top: 12px;
  right: 14px;
  font-size: 10px;
  letter-spacing: 0.12em;
  padding: 2px 8px;
  border-radius: 3px;
  background: rgba(255,255,255,0.18);
  color: rgba(255,255,255,0.85);
  font-weight: 600;
}
.cta-moomoo h3 {
  color: #fff;
  font-size: 22px;
  margin: 0 0 6px;
  letter-spacing: -0.01em;
}
.cta-moomoo p { margin: 0; color: rgba(255,255,255,0.85); font-size: 14px; line-height: 1.6; max-width: 480px; }
.cta-moomoo__btn {
  background: #fff;
  color: var(--ink);
  padding: 12px 22px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}
.cta-moomoo__btn:hover { background: rgba(255,255,255,0.92); }

@media (max-width: 720px) {
  .cta-moomoo { grid-template-columns: 1fr; padding: 24px; }
  .cta-moomoo__btn { width: 100%; text-align: center; justify-content: center; }
}

/* Inline bar inside table cell */
.bar-cell {
  display: flex; align-items: center; gap: 10px;
}
.bar-cell__track {
  flex: 1;
  height: 6px;
  background: var(--bg-2);
  border-radius: 999px;
  overflow: hidden;
}
.bar-cell__fill {
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
}
.bar-cell__val {
  font-family: var(--font-num);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  min-width: 42px;
  text-align: right;
}

/* ---------- Compare page ---------- */
.compare-selectors,
.compare-picker,
.compare-picker__control,
.compare-picker__select {
  min-width: 0;
}
.compare-picker__control .avatar {
  flex: 0 0 auto;
}
.compare-picker__select {
  width: 100%;
  max-width: 100%;
  flex: 1 1 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.table-scroll {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.compare-common-table {
  min-width: 640px;
}
.compare-bar-track {
  max-width: 100px;
}

@media (max-width: 720px) {
  .compare-selectors {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
    margin-bottom: 20px !important;
  }
  .compare-vs {
    font-size: 14px !important;
    line-height: 1;
    min-height: 14px;
  }
  .compare-picker {
    width: 100%;
    padding: 14px !important;
  }
  .compare-picker__control {
    gap: 10px !important;
  }
  .compare-picker__control .avatar {
    width: 36px;
    height: 36px;
    font-size: 18px;
  }
  .compare-picker__select {
    height: 42px;
    font-size: 13px;
    padding-left: 10px;
    padding-right: 8px;
  }
  .compare-overlap-grid {
    gap: 16px !important;
  }
  .compare-donut-grid {
    gap: 14px !important;
  }
  .compare-common-table {
    min-width: 560px;
  }
  .compare-bar-track {
    max-width: 72px;
  }
}

/* ---------- Avatar ---------- */
.avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-2);
  color: var(--ink);
  display: grid;
  place-items: center;
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 18px;
  border: 1px solid var(--border);
  flex-shrink: 0;
  overflow: hidden;
}
.avatar--lg { width: 88px; height: 88px; font-size: 36px; }
.avatar--xl { width: 120px; height: 120px; font-size: 48px; }
.avatar--sm { width: 28px; height: 28px; font-size: 12px; }

/* ---------- Investor card ---------- */
.investor-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 18px;
  min-height: 222px;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.investor-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-2);
  border-color: var(--border-strong);
}

/* ---------- Donut/Pie ---------- */
.donut { display: block; }
.donut__center {
  font-family: var(--font-serif);
  fill: var(--ink);
}
.legend { display: flex; flex-direction: column; gap: 8px; }
.legend__row {
  display: grid;
  grid-template-columns: 14px 1fr auto;
  align-items: center;
  gap: 10px;
  font-size: 14px;
}
.legend__sw { width: 12px; height: 12px; border-radius: 3px; }

/* ---------- Section heading ---------- */
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
.section-head h2 { font-size: 30px; line-height: 1.1; font-weight: 600; }
.section-head__sub { color: var(--ink-3); font-size: 14px; }

/* ---------- Footer ---------- */
.app-footer {
  margin-top: 80px;
  border-top: 1px solid var(--border);
  background: var(--bg-2);
  color: var(--ink-2);
  padding: 40px 0 32px;
  font-size: 13px;
}
.app-footer .grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 32px;
}
.app-footer h4 {
  font-family: var(--font-sans);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 12px;
  font-weight: 600;
}
.app-footer ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.app-footer a:hover { color: var(--ink); }
.disclaimer {
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  color: var(--ink-3);
  font-size: 12px;
  line-height: 1.7;
}

/* ---------- Disclaimer banner ---------- */
.disclaimer-banner {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 14px 16px;
  font-size: 13px;
  color: var(--ink-3);
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.disclaimer-banner__icon {
  width: 16px; height: 16px; flex-shrink: 0; color: var(--ink-3);
}

.investor-private-note {
  margin-top: 12px;
  max-width: 720px;
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--accent) 18%, var(--border));
  border-radius: var(--r-sm);
  background: color-mix(in srgb, var(--accent-soft) 56%, var(--surface));
  color: var(--ink-2);
  font-size: 12px;
  line-height: 1.65;
}
.investor-private-note strong {
  color: var(--ink);
  font-weight: 700;
}

/* ---------- Empty / placeholder ---------- */
.empty {
  padding: 40px;
  text-align: center;
  color: var(--ink-3);
  border: 1px dashed var(--border-strong);
  border-radius: var(--r-md);
  background: var(--surface-2);
}

/* ---------- Treemap ---------- */
.treemap-tile {
  position: absolute;
  border: 1px solid var(--bg);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  color: #fff;
  overflow: hidden;
  transition: filter .15s ease;
}
.treemap-tile:hover { filter: brightness(1.08); }
.treemap-tile__ticker {
  font-family: var(--font-num);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: -0.01em;
}
.treemap-tile__pct {
  font-family: var(--font-num);
  font-size: 12px;
  opacity: 0.85;
}

/* ---------- Mobile nav ---------- */
.mobile-only { display: none !important; }
.desktop-only {}

/* ---------- Google AdSense ---------- */
.ad-slot {
  margin: 32px 0;
  padding: 16px 0;
  border-top: 1px solid var(--divider);
  border-bottom: 1px solid var(--divider);
  min-height: 90px;
  position: relative;
  width: 100%;
}
.ad-slot__label {
  position: absolute;
  top: 4px;
  right: 0;
  font-size: 10px;
  color: var(--ink-4);
  letter-spacing: 0.08em;
}
.ad-slot .adsbygoogle {
  min-height: 90px;
}
.ad-slot .adsbygoogle[data-ad-status="unfilled"] {
  display: none !important;
}
.ad-slot--unfilled {
  display: none;
}
.ad-slot--preview {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-3);
}
.ad-slot--preview::after {
  content: attr(data-ad-preview);
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 120px;
  border: 1px dashed var(--border-strong);
  border-radius: 6px;
  background: var(--bg-2);
  font-size: 13px;
  letter-spacing: 0.04em;
}
.ad-slot--preview .adsbygoogle[data-ad-status="unfilled"] {
  display: none !important;
}
.ad-slot--card {
  margin: 0;
  padding: 18px;
  min-height: 288px;
  height: 100%;
  display: flex;
  align-items: stretch;
  justify-content: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: none;
}
.ad-slot--card .ad-slot__label {
  top: 10px;
  right: 12px;
}
.ad-slot--card .adsbygoogle {
  width: 100% !important;
  min-height: 250px;
  height: 100%;
}
.ad-slot--card.ad-slot--preview::after {
  min-height: 250px;
}
.ad-slot--card.ad-slot--unfilled {
  display: none;
}

@media (max-width: 820px) {
  body { padding-bottom: 84px; }
  .desktop-only { display: none !important; }
  .mobile-only { display: initial !important; }
  .app-header__inner { gap: 10px; height: 58px; overflow: visible; }
  .brand { gap: 9px; min-width: 0; flex: 1 1 auto; font-size: 16px; }
  .brand__mark { width: 34px; height: 34px; border-radius: 8px; }
  .brand__mark svg { width: 20px; height: 20px; }
  .brand__name--desktop { display: none; }
  .brand__name--mobile {
    display: block;
    max-width: 132px;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .nav {
    flex: 0 0 auto;
    gap: 8px;
    margin-left: auto;
    overflow: visible;
    scrollbar-width: none;
  }
  .nav > a,
  .nav-yt,
  .search-trigger {
    display: none !important;
  }
  .auth-nav { margin-left: 0; gap: 0; }
  .auth-nav .btn--sm {
    min-height: 34px;
    padding: 7px 10px;
    font-size: 12px;
    border-radius: 999px;
    white-space: nowrap;
  }
  .account-pill { width: 34px; padding-right: 3px; }
  .mobile-menu { top: 58px; }
  .mobile-menu.mobile-only { display: block !important; }
  .mobile-menu-button { display: grid !important; }
  .mobile-bottom-nav.mobile-only { display: flex !important; }
  .section-head { flex-direction: column; align-items: flex-start; }
  .section-head h2 { font-size: 22px; }
  .ad-slot--standard {
    margin: 24px 0;
    padding: 18px;
    min-height: 250px;
    max-height: 292px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
  }
  .ad-slot--standard .ad-slot__label {
    top: 8px;
    right: 12px;
  }
  .ad-slot--standard .adsbygoogle {
    width: 100% !important;
    min-height: 220px !important;
    height: 250px !important;
    max-height: 250px !important;
  }
  .app-footer .grid { grid-template-columns: 1fr 1fr; }
  .account-callout,
  .portfolio-save-grid {
    grid-template-columns: 1fr;
    align-items: stretch;
  }
  .saved-list__row {
    flex-direction: column;
    align-items: flex-start;
  }
  .account-callout__actions,
  .save-actions {
    justify-content: flex-start;
  }
}

/* ---------- Page transitions ---------- */
.page { animation: pageIn 0.25s ease both; }
@keyframes pageIn {
  from { opacity: 0.4; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .page { animation: none; }
}

/* ---------- Stat block ---------- */
.stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.stat__label {
  font-size: 12px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 700;
}
.stat__value {
  font-family: var(--font-serif);
  font-size: 28px;
  color: var(--ink);
  font-weight: 600;
  letter-spacing: -0.01em;
}
.stat__sub { font-size: 13px; color: var(--ink-3); }

/* Form */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12px; color: var(--ink-3); font-weight: 600; letter-spacing: 0.04em; }
.input, .select {
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  background: var(--surface);
  color: var(--ink);
  font-family: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.input:focus, .select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* Account / save MVP */
.account-callout {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: center;
  margin-bottom: 24px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface);
}
.account-callout--signed {
  border-color: color-mix(in srgb, var(--accent) 30%, var(--border));
  background: linear-gradient(180deg, var(--surface) 0%, var(--surface-2) 100%);
}
.account-callout h2 {
  font-size: 24px;
  margin-bottom: 6px;
}
.account-callout p {
  margin: 0;
  color: var(--ink-3);
  font-size: 14px;
  line-height: 1.7;
  max-width: 680px;
}
.account-callout__actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.portfolio-save-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--divider);
}
.save-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.save-notice {
  margin-bottom: 14px;
  padding: 10px 12px;
  border-radius: var(--r-md);
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 18%, transparent);
  font-size: 13px;
  line-height: 1.6;
}
.saved-portfolio-grid,
.public-pf-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.saved-portfolio-card,
.public-pf-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 18px;
}
.saved-portfolio-card.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.saved-portfolio-card__actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
}
.public-pf-card h3 {
  font-size: 20px;
  line-height: 1.25;
}
.public-pf-card__meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  color: var(--ink-3);
  font-size: 12px;
}
.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 4px;
  border-radius: 999px;
  background: var(--bg-2);
  margin-bottom: 20px;
}
.auth-tabs button {
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink-2);
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 600;
}
.auth-tabs button.active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-1);
}
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.local-auth-note {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--divider);
  color: var(--ink-3);
  font-size: 12px;
  line-height: 1.7;
}
.account-profile {
  display: flex;
  align-items: center;
  gap: 16px;
}
.account-profile__avatar {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: var(--accent-ink-on);
  font-family: var(--font-serif);
  font-size: 26px;
}
.account-profile h2 {
  font-size: 24px;
  margin-bottom: 2px;
}
.account-profile p {
  margin: 0;
  color: var(--ink-3);
  font-size: 13px;
}
.saved-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.saved-list__row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--divider);
}
.saved-list__row:last-child { border-bottom: 0; }

/* ---------- Tag filter ---------- */
.filter-bar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 4px;
}
.filter-bar::-webkit-scrollbar { display: none; }
.filter-pill {
  flex-shrink: 0;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink-2);
  cursor: pointer;
  transition: all .12s ease;
}
.filter-pill:hover { border-color: var(--border-strong); }
.filter-pill.active {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}

/* small utility */
.row { display: flex; gap: 12px; align-items: center; }
.col { display: flex; flex-direction: column; gap: 12px; }
.spacer { flex: 1; }
.divider { height: 1px; background: var(--divider); margin: 16px 0; }

/* density variant */
[data-density="compact"] {
  --row-h: 36px;
}
[data-density="compact"] .table th,
[data-density="compact"] .table td { padding: 10px 10px; font-size: 13px; }
[data-density="compact"] .card { padding: 14px; }

/* typeface variant — Gothic = sans-only headings */
[data-face="gothic"] {
  --font-serif: "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Yu Gothic", system-ui, sans-serif;
  --font-sans: "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Yu Gothic", system-ui, sans-serif;
}
[data-face="gothic"] h1, [data-face="gothic"] h2,
[data-face="gothic"] h3, [data-face="gothic"] h4 { font-weight: 700; letter-spacing: -0.02em; }

/* UD Gothic — designed for maximum screen readability (Morisawa Universal Design) */
[data-face="ud-gothic"] {
  --font-serif: "BIZ UDPGothic", "Hiragino Kaku Gothic ProN", "Yu Gothic", system-ui, sans-serif;
  --font-sans: "BIZ UDPGothic", "Hiragino Kaku Gothic ProN", "Yu Gothic", system-ui, sans-serif;
}
[data-face="ud-gothic"] h1, [data-face="ud-gothic"] h2,
[data-face="ud-gothic"] h3, [data-face="ud-gothic"] h4 { font-weight: 700; letter-spacing: -0.01em; }

/* Noto Serif — more readable than Zen Old Mincho, still editorial feel */
[data-face="noto-serif"] {
  --font-serif: "Noto Serif JP", "Source Serif 4", "Times New Roman", serif;
  --font-sans: "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Yu Gothic", system-ui, sans-serif;
}
[data-face="noto-serif"] h1, [data-face="noto-serif"] h2,
[data-face="noto-serif"] h3, [data-face="noto-serif"] h4 { font-weight: 600; }

/* Rounded — friendly, approachable, very clear */
[data-face="rounded"] {
  --font-serif: "M PLUS Rounded 1c", "Hiragino Maru Gothic ProN", system-ui, sans-serif;
  --font-sans: "M PLUS Rounded 1c", "Hiragino Maru Gothic ProN", system-ui, sans-serif;
}
[data-face="rounded"] h1, [data-face="rounded"] h2,
[data-face="rounded"] h3, [data-face="rounded"] h4 { font-weight: 700; letter-spacing: -0.01em; }

/* ---------- Responsive grids ---------- */
@media (max-width: 980px) {
  .container-wide[style*="grid-template-columns: 1.15fr 0.85fr"],
  .container-wide[style*="grid-template-columns: 1.2fr 0.8fr"],
  .container-wide[style*="grid-template-columns: 1.4fr 1fr"],
  .container-wide[style*="grid-template-columns: 1fr auto"],
  .container-wide[style*="grid-template-columns: 1fr auto 1fr"],
  .container-wide [style*="grid-template-columns: 1.15fr 0.85fr"],
  .container-wide [style*="grid-template-columns: 1.2fr 0.8fr"],
  .container-wide [style*="grid-template-columns: 1.4fr 1fr"],
  .container-wide [style*="grid-template-columns: 1fr auto"],
  .container-wide [style*="grid-template-columns: 1fr auto 1fr"] {
    grid-template-columns: 1fr !important;
  }
  .container-wide[style*="grid-template-columns: 0.8fr 1.2fr"],
  .container-wide [style*="grid-template-columns: 0.8fr 1.2fr"] {
    grid-template-columns: 1fr !important;
  }
  .container-wide[style*="grid-template-columns: 1fr 1fr"]:not([style*="1fr 1fr 1fr"]),
  .container-wide [style*="grid-template-columns: 1fr 1fr"]:not([style*="1fr 1fr 1fr"]) {
    grid-template-columns: 1fr !important;
  }
  .container-wide[style*="grid-template-columns: auto 1fr auto"],
  .container-wide [style*="grid-template-columns: auto 1fr auto"] {
    grid-template-columns: 1fr !important;
    text-align: left;
  }
  h1 { font-size: 32px !important; }
}
@media (max-width: 720px) {
  .container-wide[style*="grid-template-columns: 1fr 1fr 1fr"],
  .container-wide[style*="repeat(3, 1fr)"],
  .container-wide[style*="repeat(4, 1fr)"],
  .container-wide [style*="grid-template-columns: 1fr 1fr 1fr"],
  .container-wide [style*="repeat(3, 1fr)"],
  .container-wide [style*="repeat(4, 1fr)"] {
    grid-template-columns: 1fr !important;
  }
  .container-wide[style*="minmax(280px, 1fr)"],
  .container-wide [style*="minmax(280px, 1fr)"] {
    grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr)) !important;
  }
}

@media (max-width: 820px) {
  .account-callout,
  .portfolio-save-grid {
    grid-template-columns: 1fr;
    align-items: stretch;
  }
  .account-callout__actions,
  .save-actions {
    justify-content: flex-start;
  }
  .saved-list__row {
    flex-direction: column;
    align-items: flex-start;
  }
}
