/* ==========================================================================
   GoldMorning Premium CSS Stylesheet
   ========================================================================== */

/* Design Tokens & Theme Variables */
:root {
  /* Colors - Premium Gold Palette */
  --gold-primary: #D4AF37;
  --gold-light: #F3E5AB;
  --gold-dark: #AA7C11;
  --gold-gradient: linear-gradient(135deg, #FFE875 0%, #D4AF37 50%, #9A6F0F 100%);
  --gold-glow: 0 0 20px rgba(212, 175, 55, 0.35);
  --gold-glow-strong: 0 0 30px rgba(212, 175, 55, 0.6);
  
  /* System Dark Colors */
  --bg-darkest: #0B0D13;
  --bg-darker: #131722;
  --bg-card: rgba(28, 32, 46, 0.75);
  --bg-input: rgba(19, 23, 34, 0.9);
  
  /* Accents & States */
  --positive: #00E676;
  --positive-bg: rgba(0, 230, 118, 0.1);
  --negative: #FF5252;
  --negative-bg: rgba(255, 82, 82, 0.1);
  --neutral: #8F9CAE;
  
  /* Borders */
  --border-color: rgba(212, 175, 55, 0.15);
  --border-glow: rgba(212, 175, 55, 0.4);
  
  /* Typography Colors */
  --text-primary: #F5F7FA;
  --text-secondary: #9AA6B8;
  --text-muted: #5F6C7D;

  /* Font Families */
  --font-display: 'Outfit', sans-serif;
  --font-body: 'Noto Sans JP', sans-serif;
  
  /* Border Radius */
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-round: 50%;
  
  /* Box Shadow */
  --shadow-card: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  --shadow-phone: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
}

/* Base Reset & Styling */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-body);
  background-color: #050608;
  color: var(--text-primary);
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  overflow: auto;
}

/* Scrollbar styling (inside phone screen) */
::-webkit-scrollbar {
  width: 4px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(212, 175, 55, 0.2);
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(212, 175, 55, 0.4);
}

/* ==========================================================================
   Device Shell Simulator (Phone Mockup)
   ========================================================================== */
.web-wrapper {
  display: flex;
  justify-content: center;
  min-height: 100vh;
  padding: 40px 20px;
  box-sizing: border-box;
  overflow-y: auto;
}

.phone-frame {
  margin: auto;
  position: relative;
  width: 390px; /* Standard iPhone/Android aspect ratio */
  height: 844px;
  background-color: var(--bg-darkest);
  border: 12px solid #202430;
  border-radius: 48px;
  box-shadow: var(--shadow-phone), 0 0 0 1px rgba(212, 175, 55, 0.2);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all 0.3s ease;
}

/* High Fidelity Notch */
.notch {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 140px;
  height: 28px;
  background-color: #202430;
  border-bottom-left-radius: 18px;
  border-bottom-right-radius: 18px;
  z-index: 1000;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
}

.speaker {
  width: 40px;
  height: 4px;
  background-color: #101217;
  border-radius: 2px;
}

.camera {
  width: 8px;
  height: 8px;
  background-color: #101217;
  border-radius: 50%;
  position: relative;
}
.camera::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 4px;
  height: 4px;
  background-color: #1a2f4c;
  border-radius: 50%;
}

/* Responsive Shell (Fills full screen on mobile devices) */
@media (max-width: 500px) {
  body {
    background-color: var(--bg-darkest);
  }
  .web-wrapper {
    padding: 0;
  }
  .phone-frame {
    width: 100vw;
    height: 100dvh;
    border: none;
    border-radius: 0;
    box-shadow: none;
  }
  .notch {
    display: none; /* Hide notch on real mobile devices to save space */
  }
}

/* ==========================================================================
   Android-style Push Notification Banner
   ========================================================================== */
.notification-banner {
  position: absolute;
  top: -100px;
  left: 12px;
  right: 12px;
  height: 76px;
  background: rgba(28, 32, 46, 0.95);
  border: 1px solid rgba(212, 175, 55, 0.3);
  box-shadow: 0 10px 30px rgba(0,0,0,0.5), var(--gold-glow);
  backdrop-filter: blur(20px);
  border-radius: 20px;
  z-index: 1001;
  display: flex;
  align-items: center;
  padding: 12px 16px;
  gap: 12px;
  pointer-events: none;
  transition: transform 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.notification-banner.show {
  transform: translateY(140px); /* Position it below status bar & notch */
  pointer-events: auto;
  cursor: pointer;
}

.noti-icon {
  width: 42px;
  height: 42px;
  background: var(--gold-gradient);
  border-radius: 12px;
  display: flex;
  justify-content: center;
  align-items: center;
}
.noti-icon span {
  color: var(--bg-darkest);
  font-weight: bold;
  font-size: 24px;
}

.noti-content {
  flex: 1;
}

.noti-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2px;
}

.noti-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  color: var(--gold-primary);
}

.noti-time {
  font-size: 10px;
  color: var(--text-muted);
}

.noti-body {
  font-size: 12px;
  color: var(--text-primary);
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 250px;
}

/* ==========================================================================
   App Screens & Navigation
   ========================================================================== */
.app-viewport {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  position: relative;
  min-height: 0;
}

/* Status Bar */
.status-bar {
  height: 44px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 24px;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 14px;
  color: var(--text-primary);
  z-index: 999;
  background-color: var(--bg-darkest);
  user-select: none;
}

.status-icons {
  display: flex;
  align-items: center;
  gap: 6px;
}

.icon-small {
  font-size: 16px !important;
}

/* Fixed Header */
.app-header {
  height: 56px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px;
  background-color: var(--bg-darkest);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  z-index: 998;
}

.brand {
  display: flex;
  align-items: center;
}

.logo-font {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 20px;
  letter-spacing: -0.5px;
}

.gold-gradient-text {
  background: var(--gold-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Notification Bell Indicator */
.icon-btn {
  background: transparent;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  transition: background-color 0.2s;
}

.icon-btn:hover {
  background-color: rgba(255, 255, 255, 0.05);
}

.icon-btn .badge {
  position: absolute;
  top: 4px;
  right: 4px;
  background-color: var(--negative);
  color: white;
  font-size: 9px;
  font-weight: bold;
  height: 14px;
  width: 14px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  border: 1px solid var(--bg-darkest);
}

/* App Main Content Area */
.app-main {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 16px 20px 120px 20px; /* Generous bottom padding so cards scroll clear of the bottom nav */
  background: linear-gradient(180deg, var(--bg-darkest) 0%, var(--bg-darker) 100%);
  position: relative;
}

/* Pages (Tab Contents) */
.app-page {
  display: none;
  animation: fadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  padding-bottom: 120px;
}

.app-page.active {
  display: block;
  min-height: 100%;
  padding-bottom: 120px;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==========================================================================
   UI Components (Cards, Inputs, Buttons)
   ========================================================================== */

/* Glass Cards */
.glass-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(12px);
  position: relative;
  overflow: hidden;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.glass-card:hover {
  border-color: rgba(212, 175, 55, 0.3);
}

/* Hero Price Card */
.hero-card {
  position: relative;
  background: linear-gradient(135deg, #1A1D29 0%, #10121A 100%);
  border: 1px solid rgba(212, 175, 55, 0.25);
  border-radius: var(--radius-lg);
  padding: 24px 20px;
  margin-bottom: 20px;
  overflow: hidden;
  box-shadow: var(--shadow-card), 0 10px 30px rgba(0,0,0,0.5);
}

.card-glow {
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(212,175,55,0.08) 0%, transparent 60%);
  pointer-events: none;
}

.hero-card .label {
  font-size: 11px;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
}

.prices-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  gap: 12px;
}

.price-box {
  flex: 1;
}

.price-box .sub-label {
  font-size: 10px;
  color: var(--text-secondary);
  display: block;
  margin-bottom: 4px;
}

.price-box .price-row {
  margin-bottom: 0;
}

.price-box .price-val {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  color: #FFFFFF;
  letter-spacing: -0.5px;
  text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.price-divider {
  width: 1px;
  height: 36px;
  background-color: rgba(212, 175, 55, 0.2);
  align-self: center;
}

.price-row {
  display: flex;
  align-items: baseline;
  margin-bottom: 10px;
}

.price-row .currency {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 500;
  color: var(--gold-light);
  margin-right: 4px;
}

.price-row .price-val {
  font-family: var(--font-display);
  font-size: 40px;
  font-weight: 700;
  color: #FFFFFF;
  letter-spacing: -0.5px;
  text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.change-row {
  display: flex;
  align-items: center;
  font-size: 13px;
  font-weight: 600;
}

.change-row.positive {
  color: var(--positive);
}

.change-row.negative {
  color: var(--negative);
}

.change-row span {
  font-size: 20px;
}

.change-row .date-label {
  font-size: 11px;
  color: var(--text-muted);
  margin-left: 8px;
  font-weight: normal;
}

/* Headings */
.section-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 24px 0 12px 0;
  letter-spacing: 0.3px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Ticker Grid */
.ticker-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ticker-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  margin-bottom: 0;
}

.ticker-info {
  display: flex;
  flex-direction: column;
}

.ticker-name {
  font-size: 11px;
  color: var(--text-secondary);
  margin-bottom: 2px;
}

.ticker-price {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
}

.ticker-trend {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 6px;
}

.ticker-trend.positive {
  color: var(--positive);
  background: var(--positive-bg);
}

.ticker-trend.negative {
  color: var(--negative);
  background: var(--negative-bg);
}

/* Buttons */
.btn {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 14px;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}

.btn-primary {
  background: var(--gold-gradient);
  color: var(--bg-darkest);
  box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
}
.btn-primary:active {
  transform: scale(0.97);
  box-shadow: 0 2px 8px rgba(212, 175, 55, 0.2);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
}

.btn-danger {
  background: linear-gradient(135deg, #FF7676 0%, #FF5252 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(255, 82, 82, 0.3);
}
.btn-danger:active {
  transform: scale(0.97);
}

.btn-full {
  width: 100%;
}

.icon-btn span, .btn-icon span {
  font-size: 20px;
}

/* ==========================================================================
   Chart Styling (SVG)
   ========================================================================== */
.chart-container {
  padding-bottom: 12px;
}

.chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.chart-header h3 {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
}

.chart-actions {
  display: flex;
  background: rgba(255, 255, 255, 0.05);
  padding: 3px;
  border-radius: 8px;
}

.chart-tab-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.chart-tab-btn.active {
  background: var(--gold-gradient);
  color: var(--bg-darkest);
}

.chart-wrapper {
  position: relative;
  width: 100%;
  height: 180px;
}

#svg-chart {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.chart-grid-line {
  stroke: rgba(255, 255, 255, 0.04);
  stroke-width: 1;
}

.chart-grid-text {
  font-family: var(--font-display);
  font-size: 9px;
  fill: var(--text-muted);
}

/* Chart Tooltip Overlay */
.chart-tooltip {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(19, 23, 34, 0.95);
  border: 1px solid var(--border-glow);
  padding: 6px 12px;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5), var(--gold-glow);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease, left 0.1s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 10;
}

.chart-tooltip.show {
  opacity: 1;
}

.tooltip-date {
  font-size: 10px;
  color: var(--text-secondary);
  margin-bottom: 2px;
}

.tooltip-price {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  color: var(--gold-light);
}

.chart-footer {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-display);
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 8px;
}

/* ==========================================================================
   Morning Report Styling
   ========================================================================== */
.news-hero {
  background: linear-gradient(180deg, rgba(212, 175, 55, 0.12) 0%, rgba(19, 23, 34, 0.3) 100%);
  border: 1px solid rgba(212, 175, 55, 0.2);
  padding: 20px;
  position: relative;
}

.badge-tag {
  display: inline-block;
  background: var(--gold-gradient);
  color: var(--bg-darkest);
  font-size: 9px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

#news-title {
  font-size: 20px;
  font-weight: 700;
  color: #FFFFFF;
  margin-bottom: 4px;
  line-height: 1.3;
}

.news-subtitle {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

/* Sentiment Gauge */
.sentiment-area {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 14px;
}

.sentiment-label {
  font-size: 11px;
  color: var(--text-secondary);
  display: block;
  margin-bottom: 8px;
}

.gauge-container {
  position: relative;
  height: 28px;
}

.gauge-track {
  position: absolute;
  top: 12px;
  left: 0;
  right: 0;
  height: 6px;
  background: linear-gradient(90deg, var(--negative) 0%, #D4AF37 50%, var(--positive) 100%);
  border-radius: 3px;
}

.gauge-fill {
  position: absolute;
  top: 8px;
  width: 14px;
  height: 14px;
  background: #FFFFFF;
  border: 2px solid var(--gold-dark);
  border-radius: 50%;
  transform: translateX(-50%);
  box-shadow: 0 0 10px rgba(0,0,0,0.8), var(--gold-glow);
  transition: left 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.gauge-labels {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 18px;
}

.gauge-labels span.active {
  color: var(--gold-light);
  font-weight: bold;
}

/* News Article Card */
.news-article {
  padding: 20px;
}

.article-meta {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 8px;
}

.read-time {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.text-icon {
  font-size: 14px !important;
}

.category {
  color: var(--gold-primary);
  font-weight: 700;
}

.article-content {
  font-size: 13px;
  line-height: 1.7;
  color: var(--text-primary);
  margin-bottom: 20px;
}

.article-content p {
  margin-bottom: 12px;
}

.article-content strong {
  color: var(--gold-light);
}

.share-area {
  display: flex;
  justify-content: center;
}

/* Factors Card */
.factors-card {
  padding: 8px 16px;
}

.factor-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}
.factor-row:last-child {
  border-bottom: none;
}

.factor-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
}

.factor-title span.orange { color: #FFA726; }
.factor-title span.blue { color: #29B6F6; }
.factor-title span.gold { color: var(--gold-primary); }

.factor-status {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
}

.factor-status.positive {
  color: var(--positive);
  background: var(--positive-bg);
}

.factor-status.negative {
  color: var(--negative);
  background: var(--negative-bg);
}

/* ==========================================================================
   Simulator Tab
   ========================================================================== */
.portfolio-card {
  background: linear-gradient(135deg, rgba(20, 24, 38, 0.9) 0%, rgba(13, 17, 28, 0.9) 100%);
  border: 1px solid rgba(212, 175, 55, 0.2);
  padding: 20px;
  position: relative;
  overflow: hidden;
}

.portfolio-glow {
  position: absolute;
  top: -30%;
  right: -30%;
  width: 80%;
  height: 80%;
  background: radial-gradient(circle, rgba(212,175,55,0.06) 0%, transparent 60%);
  pointer-events: none;
}

.portfolio-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.portfolio-header h3 {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
}

.reset-btn-icon {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.2s, transform 0.2s;
  display: flex;
  align-items: center;
}

.reset-btn-icon:hover {
  color: var(--negative);
  transform: rotate(-30deg);
}

.reset-btn-icon span {
  font-size: 18px;
}

.portfolio-main {
  margin-bottom: 20px;
}

.total-assets .lbl {
  font-size: 11px;
  color: var(--text-muted);
  display: block;
}

.total-assets .val {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 700;
  margin: 2px 0 6px 0;
}

.pl-badge {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 20px;
  font-weight: 600;
}

.pl-badge.positive {
  color: var(--positive);
  background: var(--positive-bg);
}

.pl-badge.negative {
  color: var(--negative);
  background: var(--negative-bg);
}

.portfolio-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 16px;
}

.p-item {
  display: flex;
  flex-direction: column;
}

.p-lbl {
  font-size: 10px;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.p-val {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

/* Trade card */
.trade-card h3 {
  font-size: 14px;
  margin-bottom: 12px;
}

.trade-price-row {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.trade-price-row strong {
  font-family: var(--font-display);
  font-size: 14px;
}

.input-group {
  margin-bottom: 16px;
}

.input-group label {
  font-size: 11px;
  color: var(--text-secondary);
  display: block;
  margin-bottom: 6px;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-wrapper input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 10px 40px 10px 12px;
  color: white;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.input-wrapper input:focus {
  border-color: var(--border-glow);
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.15);
}

/* Remove number spin arrows */
.input-wrapper input::-webkit-outer-spin-button,
.input-wrapper input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.input-wrapper .suffix {
  position: absolute;
  right: 14px;
  font-size: 12px;
  color: var(--text-muted);
  font-weight: bold;
}

.quick-buttons {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-top: 8px;
}

.quick-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 6px;
  padding: 6px 0;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
}
.quick-btn:hover {
  background: rgba(212, 175, 55, 0.1);
  border-color: rgba(212, 175, 55, 0.3);
  color: var(--gold-light);
}

.cost-estimate {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 20px;
}
.cost-estimate strong {
  font-family: var(--font-display);
  font-size: 14px;
  color: #FFFFFF;
}

.action-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* History Card */
.history-card {
  padding: 4px 16px;
}

.history-list {
  max-height: 180px;
  overflow-y: auto;
}

.empty-state {
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
  padding: 24px 0;
}

.history-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 12px;
}
.history-item:last-child {
  border-bottom: none;
}

.hist-left {
  display: flex;
  flex-direction: column;
}

.hist-type {
  font-weight: 700;
  margin-bottom: 2px;
}
.hist-type.buy { color: var(--positive); }
.hist-type.sell { color: var(--negative); }

.hist-date {
  font-size: 10px;
  color: var(--text-muted);
}

.hist-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.hist-amount {
  font-family: var(--font-display);
  font-weight: 600;
  margin-bottom: 2px;
}

.hist-price {
  font-family: var(--font-display);
  font-size: 10px;
  color: var(--text-muted);
}

/* ==========================================================================
   Settings & Notifications Tab
   ========================================================================== */
.settings-card {
  padding: 8px 16px;
}

.setting-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.setting-item:last-child {
  border-bottom: none;
}

.setting-info {
  flex: 1;
  padding-right: 16px;
}

.setting-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.setting-desc {
  font-size: 10px;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Time Picker input styling */
.time-picker {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: white;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: bold;
  padding: 6px 10px;
  border-radius: 6px;
  outline: none;
}
.time-picker:focus {
  border-color: var(--border-glow);
}

/* Switch styling */
.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.1);
  transition: .3s;
  border-radius: 34px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
}

input:checked + .slider {
  background: var(--gold-gradient);
}

input:checked + .slider:before {
  transform: translateX(20px);
  background-color: var(--bg-darkest);
}

.settings-intro {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 12px;
}

.text-center {
  text-align: center;
  padding: 16px;
}

.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 12px;
}
.info-row:last-child {
  border-bottom: none;
}
.info-row span {
  color: var(--text-secondary);
}
.info-row strong {
  color: var(--text-primary);
}

.footer-note {
  font-size: 10px;
  color: var(--text-muted);
  line-height: 1.5;
  text-align: center;
  margin-top: 16px;
  padding: 0 10px;
}

/* ==========================================================================
   Bottom Navigation Bar
   ========================================================================== */
.nav-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 72px;
  background-color: rgba(11, 13, 19, 0.95);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding-bottom: 12px; /* Extra padding for bottom indicator look on iPhone style */
  backdrop-filter: blur(20px);
  z-index: 997;
  user-select: none;
}

.nav-item {
  background: transparent;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  cursor: pointer;
  width: 60px;
  height: 100%;
  transition: color 0.2s, transform 0.2s;
  padding-top: 6px;
}

.nav-item span.material-symbols-outlined {
  font-size: 24px;
  margin-bottom: 3px;
  transition: transform 0.2s ease, font-variation-settings 0.2s ease;
}

.nav-label {
  font-size: 10px;
  font-weight: 500;
}

.nav-item.active {
  color: var(--gold-primary);
}

.nav-item.active span.material-symbols-outlined {
  transform: translateY(-2px);
  font-variation-settings: 'FILL' 1; /* Fills material symbols if supported */
  text-shadow: 0 0 10px rgba(212, 175, 55, 0.4);
}

/* ==========================================================================
   Macro Correlation Tab Styles
   ========================================================================== */
.ai-status-card {
  background: linear-gradient(135deg, rgba(28, 32, 46, 0.9) 0%, rgba(20, 24, 38, 0.95) 100%);
  border: 1px solid rgba(212, 175, 55, 0.3) !important;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37), var(--gold-glow);
  padding: 14px 16px;
  position: relative;
  overflow: hidden;
}

.ai-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.ai-badge {
  font-size: 11px;
  font-weight: 700;
  color: var(--gold-primary);
  display: flex;
  align-items: center;
  gap: 4px;
}

.ai-badge span {
  font-size: 16px;
}

.ai-time {
  font-size: 9px;
  color: var(--text-muted);
}

.ai-judgment-content p {
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-primary);
}

.ai-judgment-content strong {
  color: var(--gold-light);
  font-weight: bold;
}

/* Macro chart selectors */
.macro-select-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-right: 4px;
  margin-bottom: 4px;
}

.macro-select-btn:last-child {
  margin-right: 0;
}

.macro-select-btn.active {
  background: var(--gold-gradient);
  color: var(--bg-darkest);
  box-shadow: var(--gold-glow);
  border-color: transparent;
}

.flex-wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.chart-legends {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 12px;
  font-size: 10px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.legend-color {
  width: 10px;
  height: 10px;
  border-radius: 2px;
}
.legend-color.gold {
  background-color: var(--gold-primary);
}
.legend-color.indicator {
  background-color: #29B6F6; /* default blue, can be colored dynamically */
}

/* Dual Axis Axis styling */
.chart-axis-right {
  font-family: var(--font-display);
  font-size: 9px;
  fill: #29B6F6; /* Matches indicator color */
}

/* Insight card styles */
.insight-card {
  border-left: 4px solid var(--gold-primary) !important;
}

.insight-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}

.insight-header span {
  color: var(--gold-primary);
  font-size: 18px;
}

.insight-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--gold-light);
}

.insight-text {
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-secondary);
}

/* Macro tooltips double rows */
.macro-tooltip {
  width: 150px;
}

.tooltip-row {
  display: flex;
  align-items: center;
  font-size: 11px;
  margin-top: 4px;
  width: 100%;
}

.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  margin-right: 6px;
  display: inline-block;
}
.gold-dot {
  background-color: var(--gold-primary);
}
.indicator-dot {
  background-color: #29B6F6;
}

/* Curated Insights Card Styles */
.curation-card {
  padding: 16px;
}

.curation-header {
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding-bottom: 10px;
  margin-bottom: 12px;
}

.curation-tabs {
  display: flex;
  gap: 6px;
}

.curation-tab-btn {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 600;
  padding: 5px 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.curation-tab-btn:hover {
  background: rgba(255, 255, 255, 0.08);
}

.curation-tab-btn.active {
  background: rgba(212, 175, 55, 0.1);
  color: var(--gold-light);
  border-color: rgba(212, 175, 55, 0.4);
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.1);
}

.curation-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.curation-source-badge {
  background: rgba(212, 175, 55, 0.12);
  color: var(--gold-primary);
  font-family: var(--font-display);
  font-size: 9px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid rgba(212, 175, 55, 0.2);
}

.curation-date {
  font-size: 10px;
  color: var(--text-muted);
}

.curation-content {
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-primary);
}

.curation-content p {
  margin-bottom: 8px;
}
.curation-content p:last-child {
  margin-bottom: 0;
}

.curation-content strong {
  color: var(--gold-light);
  font-weight: 600;
}

/* Sub-tabs inside Market page */
.sub-tabs-bar {
  display: flex;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 20px;
  padding: 3px;
  margin-bottom: 16px;
}

.sub-tab-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 18px;
  cursor: pointer;
  transition: all 0.25s ease;
  text-align: center;
}

.sub-tab-btn:hover {
  color: white;
}

.sub-tab-btn.active {
  background: rgba(255, 255, 255, 0.1);
  color: white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.sub-tab-content {
  display: none;
  animation: fadeIn 0.3s ease;
}

.sub-tab-content.active {
  display: block;
}

/* Savings Simulator Tab Styles */
.savings-form-card {
  padding: 16px;
}

.slider-group {
  margin-bottom: 20px;
}

.slider-group:last-child {
  margin-bottom: 0;
}

.slider-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.slider-label {
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 600;
}

.slider-val {
  font-size: 13px;
  color: var(--gold-light);
  font-family: var(--font-display);
  font-weight: 700;
}

.glass-range {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.1);
  outline: none;
}

.glass-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--gold-primary);
  border: 2px solid white;
  cursor: pointer;
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.4);
  transition: transform 0.1s ease;
}

.glass-range::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

/* Savings stats grid */
.savings-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}

.stat-item-full {
  grid-column: span 2;
}

.stat-card-mini {
  padding: 12px;
  text-align: center;
}

.stat-card-mini .stat-lbl {
  font-size: 9px;
  color: var(--text-muted);
  margin-bottom: 4px;
  display: block;
}

.stat-card-mini .stat-val-bold {
  font-size: 16px;
  font-family: var(--font-display);
  font-weight: 700;
  color: white;
}

.stat-card-mini .stat-val-gold {
  color: var(--gold-light);
  font-size: 20px;
}

.stat-card-mini .pl-badge {
  display: inline-block;
  margin-top: 4px;
  font-size: 10px;
  padding: 2px 8px;
}

/* Savings chart lines */
.savings-cash-line {
  stroke-dasharray: 4,4;
}

.savings-gold-area {
  fill: url(#gold-gradient-fade);
  opacity: 0.15;
}

/* ==========================================================================
   Gold Compass Additions (Metal tabs, mini grid, bottom-sheet modal)
   ========================================================================== */

/* Metal selector tab bar */
.metal-tabs-bar {
  display: flex;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  padding: 4px;
  border-radius: var(--radius-md);
  margin-bottom: 12px;
}

.metal-tab-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 700;
  padding: 8px 4px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.metal-tab-btn.active {
  background: var(--gold-gradient);
  color: var(--bg-darkest);
}

/* Home mini cards grid */
.mini-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}

.mini-card {
  padding: 10px 8px;
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-radius: var(--radius-sm);
}

.mini-name {
  font-size: 8px;
  color: var(--text-secondary);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mini-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.mini-price {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
}

.mini-change {
  font-family: var(--font-display);
  font-size: 9px;
  font-weight: 700;
}

.mini-change.positive {
  color: var(--positive);
}

.mini-change.negative {
  color: var(--negative);
}

/* Sliding bottom sheet modal overlay */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(5, 6, 8, 0.75);
  backdrop-filter: blur(8px);
  z-index: 99999;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  display: flex;
  align-items: flex-end;
}

.modal-overlay.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.modal-sheet {
  width: 100%;
  max-height: 80%;
  background: var(--bg-darker);
  border-top: 1px solid var(--border-glow);
  border-top-left-radius: var(--radius-lg);
  border-top-right-radius: var(--radius-lg);
  box-shadow: 0 -10px 40px rgba(0,0,0,0.8), var(--gold-glow);
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay.open .modal-sheet {
  transform: translateY(0);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.modal-header h3 {
  font-size: 14px;
}

.close-btn {
  color: var(--text-secondary);
}

.close-btn:hover {
  color: white;
}

/* Weekend special and extra elements */
.weekend-tab-btn {
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 10px;
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-family: var(--font-display);
}

.weekend-tab-btn.active {
  background: var(--gold-gradient);
  color: var(--bg-darkest);
  border-color: transparent;
}

#optout-noti-link:hover {
  opacity: 0.8;
}

.macro-dashboard-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.macro-dashboard-grid .ticker-card {
  padding: 10px 14px;
}

/* Mobile Responsive Engine (Native Smartphone Optimization) */
@media (max-width: 500px) {
  body {
    background-color: var(--bg-darkest);
    overflow-y: auto;
    display: block;
  }
  .web-wrapper {
    padding: 0;
    height: auto;
    min-height: 100vh;
    display: block;
  }
  .phone-frame {
    width: 100vw;
    height: auto;
    min-height: 100vh;
    border: none;
    border-radius: 0;
    box-shadow: none;
  }
  .notch {
    display: none;
  }
  .app-viewport {
    height: auto;
    min-height: 100vh;
  }
  .app-main {
    padding-bottom: max(140px, env(safe-area-inset-bottom, 140px));
  }
  .modal-overlay {
    position: fixed !important;
  }
  .nav-bar {
    position: fixed !important;
  }
}

@media (min-width: 501px) {
  .modal-overlay {
    position: absolute !important;
  }
  .nav-bar {
    position: absolute !important;
  }
}



@keyframes nice-spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(720deg); }
}
.spin-anim {
  animation: nice-spin 1s cubic-bezier(0.4, 0.0, 0.2, 1);
}

/* Notification Modal Styles */
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}
.noti-item {
  padding: 16px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  cursor: pointer;
  transition: background 0.2s;
}
.noti-item:hover {
  background: rgba(255,255,255,0.05);
}
.noti-item:last-child {
  border-bottom: none;
}
.noti-item-title {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 4px;
  line-height: 1.4;
}
.noti-item-meta {
  font-size: 11px;
  color: var(--text-secondary);
  display: flex;
  gap: 8px;
  align-items: center;
}
.noti-badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ff5252;
  display: inline-block;
}

/* ============================================================ */
/* SNS Share Buttons                                            */
/* ============================================================ */
.share-sns-btn {
  transition: transform 0.15s ease, opacity 0.15s ease, box-shadow 0.15s ease;
}
.share-sns-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(212, 175, 55, 0.25);
  opacity: 0.9;
}
.share-sns-btn:active {
  transform: scale(0.95);
}

/* Copy success toast */
.copy-toast {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(212, 175, 55, 0.95);
  color: #000;
  padding: 10px 24px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  z-index: 99999;
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
}
.copy-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Thick Range Slider Styling */
.thick-slider {
  -webkit-appearance: none;
  width: 100%;
  background: transparent;
}
.thick-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  height: 24px;
  width: 56px;
  border-radius: 12px;
  background: var(--gold-primary);
  cursor: pointer;
  margin-top: -6px;
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.5);
}
.thick-slider::-webkit-slider-runnable-track {
  width: 100%;
  height: 12px;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  border: 1px solid rgba(212, 175, 55, 0.3);
}
.thick-slider:focus {
  outline: none;
}
