@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@600;700&family=Inter:wght@400;500;600;700;800&display=swap');

/* Same conventions as Tipsy Bets' own design system (crisp white base,
   hairline borders, soft shadows, Inter typography) — a light gold/green
   palette replaces the felt-green primary accent so the two sites read as
   siblings, not clones. IBM Plex Mono is kept, but only for numeric
   values (prices, scores) — a common, sensible touch for a trading site —
   not for headings or body copy the way the old dark-terminal build used
   it everywhere. */
:root{
  --bg:#FFFFFF;
  --surface:#FBF9F5;       /* barely-there warm white — gold undertone instead of Tipsy Bets' cool green one */
  --ink:#1A1712;           /* warm near-black */
  --gold:#A8813F;          /* primary accent — muted enough to stay readable on white, unlike a bright gold made for dark backgrounds */
  --gold-soft:#F6EEDC;     /* pale gold wash, used sparingly for highlights */
  --green:#1F7A4D;         /* hints of green, as requested — reserved for bullish/positive signals specifically, which also matches standard financial convention */
  --green-soft:#E8F5EE;
  --red:#C7423B;           /* bearish/negative — same red convention as Tipsy Bets */
  --line:rgba(26,23,18,0.10);
  --muted:rgba(26,23,18,0.56);
  --shadow-sm:0 1px 2px rgba(26,23,18,0.05), 0 1px 1px rgba(26,23,18,0.03);
  --shadow-md:0 4px 12px rgba(26,23,18,0.06), 0 2px 4px rgba(26,23,18,0.04);
  --radius:10px;
}

*{box-sizing:border-box;}
html{-webkit-text-size-adjust:100%; text-size-adjust:100%; overflow-x:hidden;}
html,body{margin:0; padding:0; background:var(--bg); color:var(--ink); font-family:'Inter',sans-serif; overflow-x:hidden;}
h1,h2{margin:0;}
button{font-family:inherit; cursor:pointer;}
.mono{font-family:'IBM Plex Mono',monospace;}

.topbar{
  background:var(--bg); border-bottom:1px solid var(--line);
  padding:16px 20px; display:flex; align-items:center; justify-content:space-between; gap:14px;
  max-width:820px; margin:0 auto;
}
.brand{display:flex; align-items:center; gap:11px;}
.cross-link{
  font-size:12px; font-weight:600; color:var(--gold);
  border:1px solid var(--line); padding:8px 14px; border-radius:8px; text-decoration:none;
  white-space:nowrap; transition:border-color 0.15s, color 0.15s;
}
.cross-link:hover{border-color:var(--gold);}
.brand-mark{
  width:34px; height:34px; border-radius:8px; background:linear-gradient(135deg,var(--gold),#C9A15C);
  display:flex; align-items:center; justify-content:center; font-family:'IBM Plex Mono',monospace;
  font-weight:700; color:#FFFFFF; font-size:13px; flex-shrink:0;
}
.brand h1{font-weight:700; font-size:15.5px; letter-spacing:-0.1px; color:var(--ink);}
.brand .sub{font-size:11px; color:var(--muted); margin:2px 0 0;}

.construction-notice{
  position:fixed; top:0; left:0; right:0; z-index:1100;
  max-width:820px; margin:0 auto;
  background:var(--gold); color:#FFFFFF; padding:12px 16px;
  display:flex; align-items:center; justify-content:space-between; gap:12px;
  box-shadow:var(--shadow-md);
  transform:translateY(-120%); transition:transform 0.4s ease-out;
}
.construction-notice.show{transform:translateY(0);}
.construction-notice-text{font-size:12.5px; line-height:1.4;}
.construction-notice button{
  background:rgba(255,255,255,0.2); border:none; color:#FFFFFF; width:26px; height:26px;
  border-radius:6px; flex-shrink:0; font-size:14px; font-weight:700;
}

.compliance-banner{
  background:#FDF3F2; border-bottom:1px solid rgba(199,66,59,0.2);
  color:#9A3530; padding:10px 20px; font-size:12px; line-height:1.5;
  max-width:820px; margin:0 auto;
}

main{max-width:820px; margin:0 auto; padding:24px 20px 40px;}

section{margin-bottom:28px;}
section h2{
  font-size:13px; text-transform:uppercase; letter-spacing:0.5px; font-weight:700;
  color:var(--gold); margin-bottom:12px; display:flex; align-items:center; gap:10px;
}
.source-tag{
  font-size:10.5px; text-transform:none; letter-spacing:0; color:var(--muted); font-weight:400;
}

.fred-grid{display:grid; grid-template-columns:repeat(2, 1fr); gap:10px;}
.fred-card{background:#FFFFFF; border:1px solid var(--line); border-radius:var(--radius); padding:12px 14px; box-shadow:var(--shadow-sm); transition:box-shadow 0.15s, transform 0.15s;}
.fred-card:hover{box-shadow:var(--shadow-md); transform:translateY(-1px);}
.fred-label{font-size:11px; color:var(--muted); margin-bottom:4px;}
.fred-value{font-family:'IBM Plex Mono',monospace; font-weight:700; font-size:19px; color:var(--ink);}
.fred-change{font-family:'IBM Plex Mono',monospace; font-size:11px; margin-top:2px;}
.fred-change.up{color:var(--green);}
.fred-change.down{color:var(--red);}
.sparkline{width:100%; height:40px; margin-top:8px; display:block;}
.loading{font-size:12px; color:var(--muted);}

.instrument-list{display:flex; flex-direction:column; gap:10px;}
.instrument-card{
  background:#FFFFFF; border:1px solid var(--line); border-radius:var(--radius); padding:14px 16px;
  box-shadow:var(--shadow-sm); transition:box-shadow 0.15s, transform 0.15s;
}
.instrument-card:hover{box-shadow:var(--shadow-md); transform:translateY(-1px);}
.instrument-name{font-weight:700; font-size:15px; color:var(--ink);}
.instrument-actions{display:flex; gap:8px; flex-wrap:wrap; margin-top:10px;}
.instrument-actions button{
  background:#FFFFFF; border:1px solid var(--line); color:var(--ink); font-size:12px;
  padding:7px 12px; border-radius:7px; font-weight:600; transition:border-color 0.15s, color 0.15s;
}
.instrument-actions button:hover{border-color:var(--gold); color:var(--gold);}
.instrument-actions button:disabled{opacity:0.5; cursor:default;}
.instrument-actions button.analyzing{animation:pulse 1.4s ease-in-out infinite;}
@keyframes pulse{0%,100%{opacity:1;} 50%{opacity:0.5;}}

.results{display:flex; flex-direction:column; gap:14px;}
.score-card{
  background:#FFFFFF; border:1px solid var(--line); border-radius:var(--radius); padding:16px 18px;
  box-shadow:var(--shadow-sm);
}
.score-card-top{display:flex; justify-content:space-between; align-items:flex-start; margin-bottom:10px;}
.score-card-title{font-weight:700; font-size:14px; color:var(--ink);}
.score-card-provider{font-size:10.5px; color:var(--muted); margin-top:2px;}
.bias-pill{
  font-size:10.5px; font-weight:700; padding:4px 10px;
  border-radius:999px; white-space:nowrap;
}
.bias-pill.bullish{background:var(--green-soft); color:var(--green); border:1px solid rgba(31,122,77,0.3);}
.bias-pill.bearish{background:#FDF0EF; color:var(--red); border:1px solid rgba(199,66,59,0.3);}
.bias-pill.neutral{background:var(--surface); color:var(--muted); border:1px solid var(--line);}

.score-number{font-family:'IBM Plex Mono',monospace; font-size:32px; font-weight:700; margin-bottom:8px; color:var(--ink);}
.score-detail-grid{display:grid; grid-template-columns:repeat(3,1fr); gap:8px; margin-bottom:10px;}
.score-detail{background:var(--surface); border:1px solid var(--line); border-radius:8px; padding:8px 10px;}
.score-detail-label{font-size:10px; color:var(--muted);}
.score-detail-value{font-family:'IBM Plex Mono',monospace; font-weight:700; font-size:14px; color:var(--ink);}
.key-drivers{font-size:13px; line-height:1.6; color:var(--ink); margin-bottom:8px;}
.score-note{font-size:10.5px; color:var(--muted); line-height:1.5;}

.results-empty{
  font-size:12.5px; color:var(--muted); text-align:center;
  padding:30px 0; border:1px dashed var(--line); border-radius:var(--radius);
}

.disclaimer{
  max-width:820px; margin:0 auto 40px; padding:0 20px 20px; font-size:11.5px; line-height:1.6; color:var(--muted);
}

@media (max-width: 600px){
  .fred-grid{grid-template-columns:1fr;}
  .score-detail-grid{grid-template-columns:1fr 1fr;}
}

.toast{
  position:fixed; left:50%; bottom:24px; transform:translateX(-50%) translateY(20px);
  background:var(--ink); color:#FFFFFF; padding:12px 20px; border-radius:999px;
  font-size:13px; font-weight:600; box-shadow:var(--shadow-md); opacity:0;
  pointer-events:none; transition:opacity 0.25s, transform 0.25s; z-index:1500; max-width:90%; text-align:center;
}
.toast.show{opacity:1; transform:translateX(-50%) translateY(0);}
