/* stocks.westwald.io — mobile-first app shell */
:root {
  --bg: #0d1220;
  --card: #17203a;
  --card-edge: #26335c;
  --text: #eef2ff;
  --muted: #96a1c0;
  --accent: #6c8cff;
  --accent-deep: #4a63d8;
  --green: #34d399;
  --red: #f87171;
  --amber: #f5c66b;
  --radius: 20px;
  --bar-bg: rgba(13, 18, 32, .92);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background:
    radial-gradient(1100px 520px at 50% -8%, #1c2650 0%, rgba(28, 38, 80, 0) 70%) fixed,
    var(--bg);
  color: var(--text);
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: pageIn .3s ease;
}

/* App bar */
.appbar {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 18px;
  background: var(--bar-bg);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255, 255, 255, .07);
  z-index: 20;
}
.appbar-title { font-size: 20px; font-weight: 800; letter-spacing: -.4px; }
.appbar-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.appbar-actions { display: flex; gap: 10px; align-items: center; }
.icon-btn--menu { font-style: normal; font-family: inherit; font-size: 18px; }
.icon-btn {
  width: 38px; height: 38px; flex: none;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .14);
  background: rgba(255, 255, 255, .05);
  color: var(--text);
  font-size: 17px; font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  touch-action: manipulation;
  display: flex; align-items: center; justify-content: center;
}
.icon-btn--info {
  font-style: italic;
  font-family: Georgia, serif;
}
.icon-btn:active { transform: scale(.93); }

/* Panels */
.panels {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 18px 16px 28px;
}
.panel {
  display: none;
  max-width: 680px;
  margin: 0 auto;
  background: linear-gradient(160deg, #1d2745 0%, var(--card) 55%, #141c33 100%);
  border: 1px solid var(--card-edge);
  border-radius: var(--radius);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .06);
  padding: 24px 22px;
}
.panel.active { display: block; animation: panelIn .28s ease; }
@keyframes panelIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

.stock-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.ticker {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-weight: 800; font-size: 20px; letter-spacing: 1px;
}
.panel h2 { margin: 0 0 4px; font-size: clamp(22px, 6vw, 28px); letter-spacing: -.4px; line-height: 1.2; }
.tagline { margin: 0 0 16px; font-size: 14px; color: var(--muted); line-height: 1.55; }

.stance {
  font-size: 10.5px; font-weight: 800; letter-spacing: 1.2px; text-transform: uppercase;
  padding: 5px 11px; border-radius: 999px; border: 1px solid currentColor; flex: none;
}
.stance--bull { color: var(--green); }
.stance--neutral { color: var(--amber); }
.stance--bear { color: var(--red); }

.stat-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
  margin-bottom: 18px;
}
.stat {
  background: rgba(255, 255, 255, .03);
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 12px; padding: 10px 13px;
}
.stat .k { font-size: 10.5px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.stat .v { font-size: 15px; font-weight: 700; }
.stat .v small { display: block; font-size: 11.5px; font-weight: 400; color: var(--muted); margin-top: 2px; }
.v--up { color: var(--green); }
.v--down { color: var(--red); }

.panel h3 {
  font-size: 12px; font-weight: 800; letter-spacing: 1.6px; text-transform: uppercase;
  color: var(--accent); margin: 20px 0 10px;
}
.panel p.body { margin: 0 0 10px; font-size: 14.5px; line-height: 1.65; color: #dbe2f7; }
ul.tight { margin: 0; padding-left: 20px; font-size: 14.5px; line-height: 1.62; color: #dbe2f7; }
ul.tight li { margin-bottom: 8px; }
ul.tight li::marker { color: var(--accent); font-weight: 700; }
ul.bull li::marker { color: var(--green); }
ul.bear li::marker { color: var(--red); }
.panel strong { color: #fff; }

.guidance {
  background: rgba(108, 140, 255, .07);
  border: 1px solid rgba(108, 140, 255, .3);
  border-radius: 12px; padding: 12px 15px;
  font-size: 14px; line-height: 1.6; color: #dbe2f7;
}
.guidance strong { color: #fff; }

.sources { margin-top: 16px; padding-top: 12px; border-top: 1px solid rgba(255, 255, 255, .08); }
.sources .k { font-size: 10.5px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.sources a {
  display: block; font-size: 13px; color: var(--accent);
  text-decoration: none; margin-bottom: 6px; word-break: break-all;
  touch-action: manipulation;
}

/* Back-to-top FAB */
.fab {
  position: fixed;
  right: 16px;
  bottom: calc(20px + env(safe-area-inset-bottom));
  width: 48px; height: 48px;
  border-radius: 50%;
  border: 1px solid rgba(108, 140, 255, .5);
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  color: #fff; font-size: 20px; font-weight: 700;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(74, 99, 216, .5);
  opacity: 0; transform: translateY(8px); pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
  z-index: 30;
  touch-action: manipulation;
}
.fab.show { opacity: 1; transform: none; pointer-events: auto; }
.fab:active { transform: scale(.93); }

/* Stock picker rows */
.pick-list { display: flex; flex-direction: column; gap: 8px; }
.pick-row {
  display: flex; align-items: center; gap: 14px;
  width: 100%;
  background: rgba(255, 255, 255, .03);
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 14px;
  padding: 12px 14px;
  color: var(--text);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  touch-action: manipulation;
}
.pick-row:active { transform: scale(.98); }
.pick-row.current {
  border-color: rgba(108, 140, 255, .6);
  background: rgba(108, 140, 255, .12);
}
.pick-ticker {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-weight: 800; font-size: 14px; color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  border-radius: 9px; padding: 8px 10px; min-width: 62px; text-align: center;
  flex: none;
}
.pick-name { flex: 1; font-weight: 600; font-size: 15px; }
.pick-name small { display: block; font-weight: 400; color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.pick-check {
  flex: none;
  width: 26px; height: 26px; border-radius: 50%;
  display: none; align-items: center; justify-content: center;
  background: var(--green); color: #0d1220;
  font-size: 15px; font-weight: 800;
}
.pick-row.current .pick-check { display: flex; }

/* Info bottom sheet */
.sheet-backdrop {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, .55);
  opacity: 0; pointer-events: none;
  transition: opacity .25s ease;
  z-index: 40;
}
.sheet-backdrop.open { opacity: 1; pointer-events: auto; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0;
  max-width: 680px; margin: 0 auto;
  max-height: 70dvh;
  overflow-y: auto;
  background: #141b31;
  border-top: 1px solid rgba(255, 255, 255, .1);
  border-radius: 20px 20px 0 0;
  padding: 10px 22px calc(24px + env(safe-area-inset-bottom));
  transform: translateY(100%);
  transition: transform .3s cubic-bezier(.32, .72, .35, 1);
  z-index: 41;
}
.sheet.open { transform: none; }
.sheet-handle {
  width: 40px; height: 4px; border-radius: 2px;
  background: rgba(255, 255, 255, .2);
  margin: 6px auto 14px;
}
.sheet-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 6px;
}
.sheet-head h2 { margin: 0; font-size: 18px; letter-spacing: -.3px; }
.sheet p { font-size: 14px; line-height: 1.65; color: #c9d2ec; }
.sheet p.fine { color: var(--muted); font-size: 12.5px; }

/* Shared cross-project nav (identical on leetcode/jobs/stocks) */
.ww-nav {
  position: sticky;
  top: 0;
  z-index: 200;
  flex: none;
  display: flex;
  justify-content: center;
  padding: calc(8px + env(safe-area-inset-top)) 0 8px;
  background: rgba(10, 14, 26, .9);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.ww-nav-inner {
  width: 100%;
  max-width: 680px;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 0 10px;
}
.ww-nav a {
  color: #96a1c0;
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
  padding: 10px 14px;
  border-radius: 999px;
  white-space: nowrap;
  touch-action: manipulation;
  transition: background .2s ease, color .2s ease, transform .12s ease;
}
.ww-nav a:active { transform: scale(.96); }
.ww-nav a.active {
  color: #fff;
  background: rgba(108, 140, 255, .2);
}
.ww-nav .ww-home {
  font-size: 17px;
  padding: 8px 12px;
  color: #c9d2ec;
}

/* Page-load + entrance motion */
@keyframes pageIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes riseIn {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}
