/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   FundScope — Premium Dark Dashboard Stylesheet
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

/* ── Google Fonts ── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500&display=swap');

/* ── Design Tokens ── */
:root {
  /* Backgrounds */
  --bg-base:       #faf4ed; /* 肌色ベース */
  --bg-surface:    #fffbf8;
  --bg-card:       #ffffff;
  --bg-card-hover: #fff3e6;
  --bg-modal:      #faf4ed;

  /* Borders */
  --border:        #ebd9c9;
  --border-hover:  #d9caa4;

  /* Accent colors */
  --cyan:          #0ea5e9;
  --cyan-dim:      rgba(14,165,233,0.1);
  --green:         #059669;
  --green-dim:     rgba(5,150,105,0.1);
  --red:           #e11d48;
  --red-dim:       rgba(225,29,72,0.1);
  --amber:         #d97706;
  --purple:        #7c3aed;

  /* Text */
  --text-primary:  #1e140d; /* さらに濃いブラウン（ほぼ黒に近い） */
  --text-secondary:#4a3c31; /* 濃いブラウン */
  --text-muted:    #736357; /* 視認性を保つやや薄めのブラウン */

  /* Gradients */
  --grad-brand: linear-gradient(135deg, #fba8a4 0%, #ffcf70 100%); /* やわらかなオレンジピンク系 */
  --grad-glass: linear-gradient(135deg, rgba(255,255,255,0.8) 0%, rgba(255,255,255,0.4) 100%);

  /* Spacing */
  --radius-sm:   8px;
  --radius-md:   14px;
  --radius-lg:   20px;
  --radius-xl:   28px;

  /* Shadows */
  --shadow-card: 0 4px 16px rgba(100, 80, 60, 0.08); /* やわらかな影でカードを浮き立たせる */
  --shadow-glow: 0 0 40px rgba(14, 165, 233, 0.1);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-surface); }
::-webkit-scrollbar-thumb { background: var(--border-hover); border-radius: 3px; }

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   BACKGROUND AMBIENT
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

.bg-ambient {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.bg-ambient::before {
  content: '';
  position: absolute;
  top: -200px; left: -200px;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(251,168,164,0.15) 0%, transparent 70%);
  animation: ambientFloat 12s ease-in-out infinite;
}
.bg-ambient::after {
  content: '';
  position: absolute;
  bottom: -200px; right: -100px;
  width: 700px; height: 500px;
  background: radial-gradient(circle, rgba(255,207,112,0.15) 0%, transparent 70%);
  animation: ambientFloat 15s ease-in-out infinite reverse;
}
@keyframes ambientFloat {
  0%, 100% { transform: translateY(0) scale(1); }
  50%       { transform: translateY(40px) scale(1.05); }
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   LAYOUT WRAPPER
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

.page-wrapper {
  position: relative;
  z-index: 1;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px 60px;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   HEADER / NAV
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 0 24px;
  border-bottom: 1px solid var(--border);
  gap: 16px;
  flex-wrap: wrap;
}

.logo-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  width: 40px; height: 40px;
  background: var(--grad-brand);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  box-shadow: 0 0 20px rgba(14,165,233,0.3);
}

.logo-text {
  font-size: 22px;
  font-weight: 800;
  background: var(--grad-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.5px;
}

.logo-tagline {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 400;
  margin-top: -2px;
}

.header-meta {
  display: flex;
  align-items: center;
  gap: 20px;
}

.nav-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  padding: 6px 12px;
  border-radius: 8px;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
}

.nav-btn:hover {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.2);
  transform: translateY(-1px);
}

.live-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--green);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.live-dot {
  width: 8px; height: 8px;
  background: var(--green);
  border-radius: 50%;
  animation: livePulse 1.5s ease-in-out infinite;
  box-shadow: 0 0 0 0 rgba(74,222,128,0.5);
}
@keyframes livePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(74,222,128,0.5); }
  50%       { box-shadow: 0 0 0 6px rgba(74,222,128,0); }
}

#live-clock {
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  color: var(--text-secondary);
}

.refresh-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.refresh-btn:hover {
  border-color: var(--cyan);
  background: var(--bg-card);
  transform: translateY(-1px);
}
.refresh-btn.spinning .refresh-icon {
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   HERO STATUS BAR
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

.status-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin: 24px 0;
  padding: 16px 20px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.status-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.status-label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-value {
  font-size: 18px;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-primary);
}

.status-divider {
  width: 1px;
  height: 36px;
  background: var(--border);
}

.cutoff-badge {
  padding: 4px 12px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 600;
}
.cutoff-badge.live {
  background: rgba(34,211,238,0.1);
  color: var(--cyan);
  border: 1px solid rgba(34,211,238,0.25);
}
.cutoff-badge.confirmed {
  background: rgba(74,222,128,0.1);
  color: var(--green);
  border: 1px solid rgba(74,222,128,0.25);
}

.status-bar-spacer { flex: 1; }

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   SECTION TITLES
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

.section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.section-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

.section-icon {
  font-size: 20px;
}

.section-count {
  font-size: 12px;
  color: var(--text-muted);
  background: var(--bg-surface);
  padding: 2px 8px;
  border-radius: 100px;
  border: 1px solid var(--border);
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   FUND CARDS GRID
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

#funds-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 40px;
}

/* Mobile Responsive Grid */
@media (max-width: 600px) {
  #funds-grid {
    grid-template-columns: 1fr;
  }
}

/* Card */
.fund-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 280px; /* 高さを最低限確保 */
  box-shadow: var(--shadow-card);
}
.fund-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-hover);
  box-shadow: 0 8px 24px rgba(100, 80, 60, 0.12);
}
.fund-card.flash {
  animation: flashUpdate 0.4s ease;
}
@keyframes flashUpdate {
  0%   { background-color: rgba(34,211,238,0.07); }
  100% { background-color: var(--bg-card); }
}

.flash-text {
  animation: flashTextUpdate 0.6s ease-out;
}
@keyframes flashTextUpdate {
  0%   { color: var(--cyan); text-shadow: 0 0 8px var(--cyan); }
  100% { color: var(--text-primary); text-shadow: none; }
}

.card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.card-flag { font-size: 24px; line-height: 1; }

.card-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 100px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.badge-overseas {
  background: rgba(34,211,238,0.1);
  color: var(--cyan);
  border: 1px solid rgba(34,211,238,0.2);
}
.badge-domestic {
  background: rgba(248,113,113,0.1);
  color: #fb7185;
  border: 1px solid rgba(248,113,113,0.2);
}

.share-card-btn {
  margin-left: auto;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  z-index: 10;
}
.share-card-btn:hover {
  background: var(--grad-brand);
  border-color: transparent;
  color: #fff;
  transform: scale(1.1);
}
.share-card-btn svg {
  pointer-events: none;
}

.mode-badge {
  margin-left: auto;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 100px;
}
.mode-live      { background: var(--cyan-dim); color: var(--cyan); animation: modeBlink 2s ease-in-out infinite; }
.mode-confirmed { background: var(--green-dim); color: var(--green); }
.mode-holiday   { background: rgba(100, 116, 139, 0.1); color: #64748b; border: 1px solid rgba(100, 116, 139, 0.2); }
.mode-wait_ttm  { background: rgba(217,119,6,0.1); color: var(--amber); }
.mode-wait_nav  { background: rgba(124,58,237,0.1); color: var(--purple); }
@keyframes modeBlink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.6; }
}

.card-body { 
  margin-bottom: 12px;
  flex: 1;
}

.card-name {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.5px;
}

.card-fullname {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
  line-height: 1.4;
}

.card-results-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.result-divider {
  height: 1px;
  background: linear-gradient(90deg, var(--border) 0%, transparent 100%);
}

.result-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.result-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.result-main {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-primary);
  font-family: 'JetBrains Mono', monospace;
}

.result-sub {
  font-size: 13px;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
}
.result-sub.positive { color: var(--green); }
.result-sub.negative { color: var(--red); }
.result-sub.neutral  { color: var(--text-muted); }

.card-ticker {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

.card-footer {}

.card-bar-wrap {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 10px;
}

.card-bar {
  height: 100%;
  border-radius: 2px;
  width: 0;
  transition: width 1s ease;
}
.card-bar.positive { background: var(--green); box-shadow: 0 0 8px var(--green); }
.card-bar.negative { background: var(--red);   box-shadow: 0 0 8px var(--red); }
.card-bar.neutral  { background: var(--text-muted); }

.card-detail-hint {
  font-size: 11px;
  color: var(--text-muted);
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   ASSET SIMULATOR
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

.simulator-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin-bottom: 32px;
  position: relative;
  overflow: hidden;
}
.simulator-panel::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--grad-brand);
}

.sim-input-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.sim-input-wrap {
  display: flex;
  align-items: center;
  gap: 0;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  flex: 1;
  min-width: 200px;
  transition: border-color 0.2s;
}
.sim-input-wrap:focus-within {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px var(--cyan-dim);
}

.sim-currency {
  padding: 0 14px;
  font-size: 14px;
  font-weight: 600;
  color: var(--cyan);
  background: rgba(34,211,238,0.06);
  height: 48px;
  display: flex;
  align-items: center;
  border-right: 1px solid var(--border);
  white-space: nowrap;
}

#sim-amount {
  border: none;
  outline: none;
  background: transparent;
  color: var(--text-primary);
  font-size: 16px;
  font-family: 'JetBrains Mono', monospace;
  padding: 0 16px;
  height: 48px;
  width: 100%;
}

#sim-amount::placeholder { color: var(--text-muted); }

.sim-hint-text {
  font-size: 13px;
  color: var(--text-muted);
}

#sim-results {
  margin-top: 24px;
}

.sim-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.quick-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.quick-btn:hover {
  border-color: var(--cyan);
  color: var(--cyan);
  background: var(--cyan-dim);
  transform: translateY(-1px);
}

.quick-btn.reset {
  margin-left: auto;
  color: var(--red);
  background: var(--red-dim);
  border-color: rgba(225,29,72,0.2);
}
.quick-btn.reset:hover {
  background: var(--red);
  color: white;
  border-color: var(--red);
}

.sim-hint {
  color: var(--text-muted);
  font-size: 14px;
  text-align: center;
  padding: 16px 0;
}

.sim-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.sim-row:last-child { border-bottom: none; }

.sim-fund-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  min-width: 140px;
}

.sim-gain {
  font-size: 18px;
  font-weight: 800;
  font-family: 'JetBrains Mono', monospace;
}
.sim-gain.positive { color: var(--green); }
.sim-gain.negative { color: var(--red); }

.sim-pct {
  font-size: 13px;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-muted);
  margin-left: auto;
}
.sim-pct.positive { color: var(--green); }
.sim-pct.negative { color: var(--red); }

/* ── Market Pulse (Economic Calendar) ── */
.news-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 32px;
  position: relative;
  overflow: hidden;
}
.news-panel::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--grad-brand);
}

.news-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 16px;
}

@media (max-width: 768px) {
  .news-grid {
    grid-template-columns: 1fr;
  }
}

.news-column {
  display: flex;
  flex-direction: column;
}

.news-group-header {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
}

.calendar-item {
  display: flex;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 4px 8px 8px 4px;
  margin-bottom: 8px;
  background: rgba(255, 255, 255, 0.02);
  border-left: 3px solid transparent;
  transition: background 0.2s;
  border: 1px solid var(--border);
}

.calendar-item:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--cyan);
}

/* Accent Borders */
.border-top { border-left: 3px solid #e11d48; } /* var(--red) */
.border-high { border-left: 3px solid #d97706; } /* var(--amber) */
.border-normal { border-left: 3px solid #0ea5e9; } /* var(--cyan) */

.calendar-date {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-primary);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  padding: 3px 6px;
  border-radius: 4px;
  height: fit-content;
}

.calendar-content {
  flex: 1;
}

.calendar-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
  line-height: 1.3;
}

.calendar-meta {
  font-size: 0.7rem;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Impact Labels */
.impact-label {
  font-family: 'Inter', sans-serif;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 3px;
  letter-spacing: 0.5px;
}

.impact-top {
  color: #e11d48;
  background: rgba(225, 29, 72, 0.1);
}

.impact-high {
  color: #d97706;
  background: rgba(217, 119, 6, 0.1);
}

.impact-normal {
  color: #0ea5e9;
  background: rgba(14, 165, 233, 0.1);
}

.news-column .hidden-item {
  display: none;
}
.news-column.expanded .hidden-item {
  display: flex; /* or whatever the normal display is for .calendar-item */
}

.view-more-btn {
  background: transparent;
  border: 1px dashed var(--border);
  color: var(--text-muted);
  width: 100%;
  padding: 8px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: 4px;
  transition: all 0.2s;
}

.view-more-btn:hover {
  background: var(--bg-surface);
  color: var(--text-primary);
  border-color: var(--cyan);
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   ADMINISTRATOR PROFILE
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

.profile-panel {
  margin-top: 40px;
  background: var(--bg-surface);
  border-radius: 16px;
  padding: 24px;
  border: 1px solid var(--border);
}

.profile-card {
  display: flex;
  gap: 30px;
  align-items: center;
}

.profile-left {
  text-align: center;
  flex-shrink: 0;
  width: 150px;
}

.profile-icon {
  width: 100px;
  height: 100px;
  border-radius: 20px;
  background: var(--bg-dark);
  margin-bottom: 12px;
  object-fit: cover;
  border: 2px solid var(--cyan-dim);
}

.profile-name {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.profile-role {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.profile-right {
  flex: 1;
}

.profile-intro {
  color: var(--cyan);
  font-size: 1rem;
  margin-bottom: 12px;
}

.profile-right p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 12px;
}

.profile-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.profile-tags span {
  font-size: 0.7rem;
  background: var(--bg-dark);
  color: var(--text-muted);
  padding: 4px 10px;
  border-radius: 100px;
  border: 1px solid var(--border);
}

@media (max-width: 600px) {
  .profile-card {
    flex-direction: column;
    text-align: center;
  }
  .profile-left {
    width: 100%;
  }
  .profile-tags {
    justify-content: center;
  }
}

.footer-links a:hover {
  color: var(--cyan) !important;
  text-decoration: underline !important;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   FOOTER (Minimalist Horizontal Style)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

.site-footer {
  margin-top: 80px;
  padding: 40px 20px;
  border-top: 1px solid var(--border);
  text-align: center;
}

.footer-menu {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  list-style: none;
  padding: 0;
  margin: 0 0 24px 0;
  gap: 12px 24px; /* 横24px, 縦12pxの余白 */
}

.footer-link {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.footer-link:hover {
  color: var(--text-primary);
}

.footer-avatar {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border);
}

.footer-bottom {
  margin-top: 24px;
}

.copyright {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 8px;
  font-weight: 600;
}

.disclaimer-mini {
  font-size: 0.7rem;
  color: var(--text-muted);
  opacity: 0.6;
  max-width: 600px;
  margin: 0 auto;
}

@media (max-width: 600px) {
  .footer-menu {
    gap: 12px 16px;
  }
  .footer-link {
    font-size: 0.8rem;
  }
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   CONTACT MODAL (Glassmorphism)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  animation: fadeIn 0.3s ease;
}

.modal-content {
  width: 90%;
  max-width: 500px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 32px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.4);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.modal-header h3 {
  font-size: 1.25rem;
  color: var(--text-primary);
}

.close-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 24px;
  cursor: pointer;
  padding: 0 8px;
}

.input-group {
  margin-bottom: 20px;
  text-align: left;
}

.input-group label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
  font-weight: 600;
}

.input-group input,
.input-group textarea {
  width: 100%;
  background: var(--bg-dark);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 16px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.95rem;
}

.input-group input:focus,
.input-group textarea:focus {
  outline: none;
  border-color: var(--cyan);
  box-shadow: 0 0 0 4px rgba(0, 243, 255, 0.1);
}

.submit-btn {
  width: 100%;
  background: var(--cyan);
  color: #000;
  border: none;
  padding: 14px;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.2s, background 0.2s;
}

.submit-btn:hover {
  background: #00d8e4;
  transform: translateY(-2px);
}

.submit-btn:disabled {
  background: var(--border);
  cursor: not-allowed;
  transform: none;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   LOADING & ERROR
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

#loading-indicator {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(6,9,18,0.85);
  z-index: 999;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 16px;
  backdrop-filter: blur(8px);
}

.loading-spinner {
  width: 48px; height: 48px;
  border: 3px solid var(--border);
  border-top-color: var(--cyan);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading-text {
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 500;
}

#error-banner {
  display: none;
  position: fixed;
  bottom: 20px; left: 50%;
  transform: translateX(-50%);
  background: var(--red-dim);
  border: 1px solid var(--red);
  color: var(--red);
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  z-index: 500;
  backdrop-filter: blur(8px);
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   DETAIL MODAL
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

#detail-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
#detail-modal.open {
  opacity: 1;
  pointer-events: all;
}

#modal-content {
  background: var(--bg-modal);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  transform: scale(0.95) translateY(10px);
  transition: transform 0.25s ease;
}
#detail-modal.open #modal-content {
  transform: scale(1) translateY(0);
}

.modal-close {
  position: absolute;
  top: 14px; right: 14px;
  z-index: 10;
  background: rgba(255,255,255,0.5);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  width: 32px; height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s;
}
.modal-close:hover { background: var(--red-dim); color: var(--red); }

.modal-header {
  padding: 28px 24px 24px;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  display: flex;
  align-items: center;
  gap: 16px;
}

.modal-flag { font-size: 42px; line-height: 1; }

.modal-title {
  font-size: 24px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.5px;
}

.modal-subtitle {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.modal-body { padding: 24px; }

.modal-desc {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 24px;
}

.modal-section-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 14px;
  margin-top: 24px;
}

.modal-stats {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.modal-stat {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: var(--bg-surface);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.modal-stat-label { font-size: 13px; color: var(--text-secondary); }
.modal-stat-value {
  font-size: 16px; font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
}
.modal-stat-value.positive { color: var(--green); }
.modal-stat-value.negative { color: var(--red); }

.modal-mode-badge {
  margin-top: 12px;
  display: inline-block;
  padding: 4px 12px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 600;
}

.modal-no-data { font-size: 14px; color: var(--text-muted); text-align: center; padding: 16px; }

/* Composition chart */
.comp-chart { display: flex; flex-direction: column; gap: 10px; }
.comp-row {
  display: grid;
  grid-template-columns: 80px 1fr 48px;
  align-items: center;
  gap: 10px;
}
.comp-name { font-size: 13px; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.comp-bar-wrap { height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; }
.comp-bar { height: 100%; background: var(--grad-brand); border-radius: 3px; transition: width 0.8s ease; }
.comp-pct { font-size: 12px; font-weight: 600; color: var(--cyan); font-family: 'JetBrains Mono', monospace; text-align: right; }

/* Top holdings */
.top-holdings { display: flex; flex-direction: column; gap: 8px; }
.top-holding {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  background: var(--bg-surface);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.top-rank {
  font-size: 12px;
  font-weight: 800;
  color: var(--cyan);
  font-family: 'JetBrains Mono', monospace;
  width: 16px;
  text-align: center;
}
.top-holding span:last-child { font-size: 14px; font-weight: 500; color: var(--text-primary); }

.modal-disclaimer {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 20px;
  line-height: 1.5;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   ACTIVE STATE PULSE INDICATOR
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

.active-state-badge {
  font-size: 11px;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  padding: 4px 8px;
  background: var(--bg-dim);
  border-radius: 4px;
  width: max-content;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.pulse-green {
  background-color: #34d399;
  box-shadow: 0 0 8px #34d399;
  animation: pulse-anim-green 2s infinite;
}

.pulse-yellow {
  background-color: #fbbf24;
  box-shadow: 0 0 8px #fbbf24;
  animation: pulse-anim-yellow 2s infinite;
}

.static-gray {
  background-color: #94a3b8;
}

@keyframes pulse-anim-green {
  0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.4); }
  70% { box-shadow: 0 0 0 6px rgba(52, 211, 153, 0); }
  100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
}

@keyframes pulse-anim-yellow {
  0% { box-shadow: 0 0 0 0 rgba(251, 191, 36, 0.4); }
  70% { box-shadow: 0 0 0 6px rgba(251, 191, 36, 0); }
  100% { box-shadow: 0 0 0 0 rgba(251, 191, 36, 0); }
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   FOOTER
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

.site-footer {
  margin-top: 48px;
  padding: 24px 0;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.8;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   UTILITY
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

.modal-calc-breakdown {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-surface);
  padding: 1.25rem;
  border-radius: var(--radius-sm);
  margin: 1.5rem 0;
  border: 1px solid var(--border);
}

.calc-item {
  flex: 1;
  text-align: center;
}

.calc-label {
  display: block;
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.calc-value {
  font-size: 1.15rem;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
}

.calc-operator {
  font-size: 1.2rem;
  color: var(--text-dim);
  padding: 0 0.75rem;
  font-weight: 300;
}

.modal-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 1rem;
}

.modal-stat.mini {
  background: transparent;
  border: 1px dashed var(--border);
  padding: 0.75rem;
  flex-direction: column;
  align-items: flex-start;
  min-height: auto;
}

.modal-stat.mini .modal-stat-label {
  font-size: 0.65rem;
}

.modal-stat.mini .modal-stat-value {
  font-size: 0.9rem;
}

.card-results-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
}

.result-fixed, .result-live {
  padding: 8px 12px;
  background: var(--bg-surface);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.result-live {
  background: rgba(6, 182, 212, 0.03);
  border: 1px dashed var(--cyan-dim);
}

.result-label {
  font-size: 10px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 4px;
}

.result-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.result-main {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-primary);
  font-family: 'JetBrains Mono', monospace;
}

.result-sub {
  font-size: 12px;
  font-weight: 600;
  font-family: 'JetBrains Mono', monospace;
}

/* Modal Grouping */
.modal-result-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modal-stat.large {
  padding: 1.25rem;
  background: var(--bg-hover);
}

.modal-stat.large .modal-stat-value {
  font-size: 2rem;
}

.positive { color: var(--green); }
.negative { color: var(--red); }
.neutral  { color: var(--text-muted); }

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   ANIMATIONS
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
@keyframes flash {
  0% { background: rgba(52, 211, 153, 0.2); }
  100% { background: transparent; }
}

.flash {
  animation: flash 0.8s ease-out;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   RESPONSIVE
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

@media (max-width: 768px) {
  .site-header { padding: 16px 0 18px; }
  .logo-text { font-size: 18px; }
  .status-bar { padding: 12px 16px; gap: 12px; }
  .status-value { font-size: 15px; }
  #funds-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .card-change { font-size: 24px; }
  .sim-input-row { flex-direction: column; align-items: stretch; }
}

@media (max-width: 480px) {
  .page-wrapper { padding: 0 12px 40px; }
  #funds-grid { grid-template-columns: 1fr; }
  .header-meta { gap: 12px; flex-wrap: wrap; }
}