/* ============================================================
   investments.css — Investment Tracker screen styles
   FinResolver · finresolver.in
   ============================================================ */

/* ── Screen wrapper ─────────────────────────────────────────── */
#investmentScreen {
  display: none;
  position: relative; z-index: 1;
  max-width: 1400px; margin: 0 auto;
  padding: 1.75rem 1.5rem 5rem;
  overflow-x: hidden;
}

/* ── Page header ────────────────────────────────────────────── */
.inv-page-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1.75rem; gap: 1rem; flex-wrap: wrap;
}
.inv-page-title {
  font-family: var(--font-head); font-size: 1.4rem; font-weight: 800;
}
.inv-page-title span { color: var(--accent4); }

.inv-header-actions { display: flex; gap: .65rem; flex-wrap: wrap; }

/* ── Summary strip ──────────────────────────────────────────── */
.inv-summary-strip {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: .85rem; margin-bottom: 1.75rem;
}
.inv-sum-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1rem 1.2rem;
  position: relative; overflow: hidden;
  animation: fadeUp .35s ease both;
  transition: transform .15s, border-color .2s;
}
.inv-sum-card:hover { transform: translateY(-2px); }
.inv-sum-card::after {
  content: ''; position: absolute; top: 0; left: 0; right: 0;
  height: 3px; background: var(--card-accent, var(--accent4));
}
.inv-sum-label { font-size: .63rem; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; margin-bottom: .3rem; }
.inv-sum-value { font-family: var(--font-head); font-size: 1.2rem; font-weight: 700; color: var(--card-color, var(--text)); }
.inv-sum-sub   { font-size: .6rem; color: var(--muted); margin-top: .15rem; }
.inv-sum-change { font-size: .68rem; font-weight: 600; margin-top: .25rem; }
.inv-sum-change.pos { color: var(--accent); }
.inv-sum-change.neg { color: var(--accent2); }

/* ── Tab bar ────────────────────────────────────────────────── */
.inv-tabs {
  display: flex; gap: .4rem; margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border); padding-bottom: 0;
  flex-wrap: wrap;
}
.inv-tab {
  padding: .5rem 1rem; font-size: .72rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .5px;
  cursor: pointer; border-radius: var(--radius) var(--radius) 0 0;
  border: 1px solid transparent; border-bottom: none;
  color: var(--muted); background: transparent;
  transition: color .2s, background .2s, border-color .2s;
  position: relative; bottom: -1px;
}
.inv-tab:hover { color: var(--text); }
.inv-tab.active {
  color: var(--accent4); background: var(--surface);
  border-color: var(--border); border-bottom-color: var(--surface);
}
.inv-tab-count {
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(77,171,247,.15); color: var(--accent4);
  border-radius: 10px; font-size: .6rem; padding: .1rem .4rem;
  margin-left: .3rem; min-width: 18px;
}

/* ── Main layout: full-width holdings, side panel below ──────── */
.inv-body {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  align-items: start;
  min-width: 0;
}


/* ── Holdings table card ────────────────────────────────────── */
.inv-holdings-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow-x: auto; overflow-y: hidden;
  animation: fadeUp .35s ease both;
  min-width: 0;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.inv-holdings-card::-webkit-scrollbar        { height: 5px; }
.inv-holdings-card::-webkit-scrollbar-track  { background: transparent; }
.inv-holdings-card::-webkit-scrollbar-thumb  { background: var(--border); border-radius: 4px; }
.inv-holdings-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 1.3rem; border-bottom: 1px solid var(--border);
  gap: .75rem; flex-wrap: wrap;
}
.inv-holdings-head-right {
  display: flex; align-items: center; gap: .5rem;
}
.inv-add-inline-btn {
  background: rgba(0,229,160,.1); border: 1px solid rgba(0,229,160,.3);
  color: var(--accent); border-radius: 7px; padding: .3rem .75rem;
  font-size: .72rem; font-weight: 700; cursor: pointer; white-space: nowrap;
  transition: background .15s;
}
.inv-add-inline-btn:hover { background: rgba(0,229,160,.2); }
.inv-holdings-title {
  font-family: var(--font-head); font-size: .9rem; font-weight: 700;
}
.inv-search {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 8px; padding: .35rem .75rem;
  color: var(--text); font-family: var(--font-mono); font-size: .75rem;
  width: 180px; outline: none; transition: border-color .2s;
}
.inv-search:focus { border-color: var(--accent4); }

.inv-table-wrap {
  overflow-x: hidden;
  overflow-y: auto;
  max-height: 480px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.inv-table-wrap::-webkit-scrollbar       { width: 5px; }
.inv-table-wrap::-webkit-scrollbar-track { background: transparent; }
.inv-table-wrap::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
.inv-table {
  width: 100%; min-width: 720px; border-collapse: collapse; font-size: .75rem;
  table-layout: fixed;
}
/* Fixed column widths — name gets the remainder */
.inv-table th:nth-child(2) { width: 95px; }   /* Category */
.inv-table th:nth-child(3) { width: 110px; }  /* Live Price */
.inv-table th:nth-child(4) { width: 145px; }  /* Qty / Avg Price */
.inv-table th:nth-child(5) { width: 100px; }  /* Cost Basis */
.inv-table th:nth-child(6) { width: 100px; }  /* Cur. Value */
.inv-table th:nth-child(7) { width: 105px; }  /* P&L */
.inv-table th:nth-child(8) { width: 75px; }   /* Return */
.inv-table th:nth-child(9) { width: 90px; }   /* Actions */
/* Tighter horizontal padding for the actions cell so buttons fit */
.inv-table th:nth-child(9),
.inv-table td:nth-child(9) { padding-left: .4rem; padding-right: .5rem; }
/* Sticky header so column labels stay visible when scrolling the table */
.inv-table thead th {
  position: sticky; top: 0; z-index: 2;
  background: var(--surface);
}
.inv-table th {
  padding: .65rem 1rem; text-align: left;
  font-size: .6rem; text-transform: uppercase; letter-spacing: .8px;
  color: var(--muted); border-bottom: 1px solid var(--border);
  white-space: nowrap; cursor: pointer; user-select: none;
}
.inv-table th:hover { color: var(--text); }
.inv-table th.sorted { color: var(--accent4); }
.inv-table td {
  padding: .7rem 1rem; border-bottom: 1px solid rgba(35,45,63,.5);
  white-space: nowrap;
}
.inv-table tr { transition: background .15s; cursor: pointer; }
.inv-table tr:hover td { background: rgba(77,171,247,.04); }
.inv-table tr.selected td { background: rgba(77,171,247,.08); }
.inv-table tr.selected td:first-child { border-left: 3px solid var(--accent4); }
.inv-table tr.inv-no-ticker td { background: rgba(255,209,102,.04); }
.inv-table tr.inv-no-ticker td:first-child { border-left: 3px solid rgba(255,209,102,.45); }
.inv-table tr:last-child td { border-bottom: none; }
.inv-no-ticker-badge {
  display: inline-flex; align-items: center; gap: .2rem;
  font-size: .55rem; font-weight: 600; color: var(--accent3);
  background: rgba(255,209,102,.12); border: 1px solid rgba(255,209,102,.3);
  border-radius: 10px; padding: .08rem .35rem; margin-top: .18rem;
}

.inv-ticker-cell { display: flex; align-items: flex-start; gap: .6rem; min-width: 0; }
.inv-ticker-cell > div:last-child { min-width: 0; } /* text wrapper — allows flex shrink */
.inv-ticker-icon {
  width: 30px; height: 30px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: .7rem; font-weight: 700; flex-shrink: 0;
}
.inv-ticker-name { font-weight: 600; font-size: .78rem; white-space: normal; word-break: break-word; }
.inv-ticker-sub  { font-size: .6rem; color: var(--muted); margin-top: .05rem; }

.cat-badge {
  display: inline-flex; align-items: center;
  font-size: .58rem; padding: .18rem .5rem; border-radius: 12px;
  font-weight: 600; white-space: nowrap;
}
.cat-stock    { background: rgba(0,229,160,.1);  color: var(--accent);  border: 1px solid rgba(0,229,160,.2);  }
.cat-mf       { background: rgba(77,171,247,.1); color: var(--accent4); border: 1px solid rgba(77,171,247,.2); }
.cat-bond     { background: rgba(255,209,102,.1);color: var(--accent3); border: 1px solid rgba(255,209,102,.2); }
.cat-realestate { background: rgba(167,139,250,.1);color: var(--purple);  border: 1px solid rgba(167,139,250,.2); }
.cat-gold     { background: rgba(240,180,41,.1); color: #f0b429;        border: 1px solid rgba(240,180,41,.2);  }
.cat-epf      { background: rgba(6,182,212,.1);  color: #06b6d4;        border: 1px solid rgba(6,182,212,.2);   }
.cat-esop     { background: rgba(192,132,252,.1);color: #c084fc;        border: 1px solid rgba(192,132,252,.2); }
.cat-others   { background: rgba(255,107,107,.1);color: var(--accent2); border: 1px solid rgba(255,107,107,.2); }

.inv-change-pos { color: var(--accent);  font-weight: 600; }
.inv-change-neg { color: var(--accent2); font-weight: 600; }
.inv-change-neu { color: var(--muted); }

.inv-live-dot {
  display: inline-block; width: 6px; height: 6px;
  border-radius: 50%; background: var(--accent);
  margin-right: .3rem; animation: pulse-dot 2s infinite;
}
@keyframes pulse-dot {
  0%,100% { opacity:1; transform: scale(1); }
  50%      { opacity:.5; transform: scale(.85); }
}

.inv-empty-state {
  padding: 3rem; text-align: center; color: var(--muted);
}
.inv-empty-icon { font-size: 2.5rem; margin-bottom: .75rem; }
.inv-empty-title { font-family: var(--font-head); font-size: 1rem; font-weight: 700; margin-bottom: .4rem; }
.inv-empty-sub   { font-size: .75rem; }

/* ── Side panel — horizontal row below the holdings table ─────── */
.inv-side-panel {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1rem;
  min-width: 0;
}
/* Allocation bar card — spans full width */
.inv-alloc-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 1.2rem 1.3rem;
  animation: fadeUp .4s ease both;
  grid-column: 1 / -1;
}
.inv-card-title {
  font-family: var(--font-head); font-size: .82rem; font-weight: 700;
  margin-bottom: 1rem; display: flex; align-items: center; gap: .5rem;
}

/* Stacked horizontal bar */
.inv-alloc-bar {
  display: flex; width: 100%; height: 10px; border-radius: 6px;
  overflow: hidden; margin-bottom: 1rem; gap: 2px;
}
.inv-alloc-seg {
  height: 100%; border-radius: 3px; transition: opacity .2s, transform .2s;
  cursor: pointer; min-width: 2px;
}
.inv-alloc-seg:hover { opacity: .8; }
.inv-alloc-seg.inv-alloc-active { opacity: 1; transform: scaleY(1.35); border-radius: 4px; }
.inv-alloc-seg.inv-alloc-dim   { opacity: .25; }

/* Legend chips — horizontal wrapping */
.inv-alloc-legend {
  display: flex; flex-wrap: wrap; gap: .5rem .75rem;
}
.inv-alloc-item {
  display: flex; align-items: center; gap: .35rem;
  font-size: .7rem; background: var(--surface2, var(--bg));
  border: 1px solid var(--border); border-radius: 20px;
  padding: .25rem .6rem; cursor: pointer;
  transition: opacity .2s, border-color .2s, box-shadow .2s;
}
.inv-alloc-item:hover { border-color: var(--accent4); }
.inv-alloc-item.inv-alloc-active {
  border-color: var(--text); box-shadow: 0 0 0 1px var(--text);
  opacity: 1;
}
.inv-alloc-item.inv-alloc-dim { opacity: .3; }
.inv-alloc-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.inv-alloc-name { color: var(--text); font-weight: 500; }
.inv-alloc-val { color: var(--text); font-weight: 600; font-size: .68rem; }
.inv-alloc-pct { color: var(--muted); font-size: .63rem; }

/* Live price ticker panel */
.inv-live-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 1.2rem 1.3rem;
  animation: fadeUp .45s ease both;
}
.inv-live-list { display: flex; flex-direction: column; gap: .5rem; }
.inv-live-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: .5rem .65rem; border-radius: 8px;
  background: var(--surface2); border: 1px solid var(--border);
  transition: border-color .2s;
}
.inv-live-item:hover { border-color: var(--accent4); }
.inv-live-ticker { font-weight: 700; font-size: .72rem; }
.inv-live-name   { font-size: .58rem; color: var(--muted); }
.inv-live-right  { text-align: right; }
.inv-live-price  { font-weight: 600; font-size: .75rem; }
.inv-live-chg    { font-size: .6rem; font-weight: 600; }

.inv-refresh-btn {
  width: 100%; margin-top: .75rem; padding: .45rem;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 8px; color: var(--muted); font-family: var(--font-mono);
  font-size: .68rem; cursor: pointer; transition: all .2s;
}
.inv-refresh-btn:hover { border-color: var(--accent4); color: var(--accent4); }

/* ── Detail panel (bottom) ──────────────────────────────────── */
.inv-detail-panel {
  background: var(--surface); border: 1px solid var(--border);
  border-top: 3px solid var(--accent4);
  border-radius: var(--radius-lg); overflow: hidden;
  animation: fadeUp .25s ease both;
}
.inv-detail-panel.hidden { display: none; }

.inv-detail-tabs {
  display: flex; border-bottom: 1px solid var(--border);
  padding: 0 1.3rem;
}
.inv-detail-tab {
  padding: .65rem .9rem; font-size: .68rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .5px;
  cursor: pointer; color: var(--muted);
  border-bottom: 2px solid transparent;
  transition: color .2s, border-color .2s;
}
.inv-detail-tab.active { color: var(--accent4); border-bottom-color: var(--accent4); }
.inv-detail-tab:hover  { color: var(--text); }

.inv-detail-body { padding: 1.2rem 1.3rem; }

/* Chart section */
.inv-price-chart-wrap { height: 200px; margin-bottom: 1rem; position: relative; }

/* Financials table */
.inv-fin-table {
  width: 100%; border-collapse: collapse; font-size: .72rem;
}
.inv-fin-table th {
  padding: .55rem .75rem; text-align: right;
  font-size: .6rem; text-transform: uppercase; letter-spacing: .5px;
  color: var(--muted); border-bottom: 1px solid var(--border);
}
.inv-fin-table th:first-child { text-align: left; }
.inv-fin-table td {
  padding: .55rem .75rem; border-bottom: 1px solid rgba(35,45,63,.5);
  text-align: right;
}
.inv-fin-table td:first-child { text-align: left; font-weight: 600; }
.inv-fin-table tr:last-child td { border-bottom: none; }

/* News list */
.inv-news-list { display: flex; flex-direction: column; gap: .6rem; }
.inv-news-item {
  display: flex; gap: .75rem; padding: .7rem .85rem;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 10px; text-decoration: none;
  transition: border-color .2s, transform .15s;
}
.inv-news-item:hover { border-color: var(--accent4); transform: translateX(3px); }
.inv-news-source {
  font-size: .58rem; text-transform: uppercase; letter-spacing: .5px;
  color: var(--accent4); margin-bottom: .2rem; font-weight: 600;
}
.inv-news-title { font-size: .72rem; color: var(--text); line-height: 1.4; }
.inv-news-time  { font-size: .6rem; color: var(--muted); margin-top: .2rem; }
.inv-news-badge {
  flex-shrink: 0; width: 36px; height: 36px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; background: var(--surface);
}

/* Loading spinner inside panels */
.inv-loading {
  display: flex; align-items: center; justify-content: center;
  padding: 2rem; color: var(--muted); font-size: .75rem; gap: .6rem;
}
.inv-spinner {
  width: 16px; height: 16px; border: 2px solid var(--border);
  border-top-color: var(--accent4); border-radius: 50%;
  animation: spin .7s linear infinite;
}

/* ── Broker selector ──────────────────────────────────────── */
.inv-broker-section { margin-bottom: 1rem; }
.inv-broker-label {
  font-size: .65rem; text-transform: uppercase; letter-spacing: .7px;
  color: var(--muted); font-weight: 600; margin-bottom: .6rem;
}
.inv-broker-grid {
  display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: .75rem;
}
.inv-broker-card {
  display: flex; flex-direction: column; align-items: center; gap: .3rem;
  padding: .55rem .6rem; min-width: 64px; cursor: pointer;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 10px; transition: border-color .18s, background .18s, box-shadow .18s;
  user-select: none;
}
.inv-broker-card:hover  { border-color: var(--accent4); background: rgba(77,171,247,.06); }
.inv-broker-card.active { border-color: var(--accent4); background: rgba(77,171,247,.1); box-shadow: 0 0 0 1px var(--accent4); }
.inv-broker-icon {
  width: 36px; height: 36px; border-radius: 8px;
  background: var(--bk, #6b7a99);
  color: #fff; font-weight: 700; font-size: .8rem;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; font-family: var(--font-head);
}
.inv-broker-card span {
  font-size: .6rem; color: var(--muted); font-weight: 500;
  text-align: center; white-space: nowrap; max-width: 70px;
  overflow: hidden; text-overflow: ellipsis;
}
.inv-broker-card.active span { color: var(--accent4); }

/* Instructions box */
.inv-broker-steps-box {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 10px; padding: .9rem 1.1rem;
  font-size: .72rem; line-height: 1.65;
}
.inv-broker-steps-box:empty { display: none; }
.inv-broker-steps-title {
  font-family: var(--font-head); font-weight: 700; font-size: .8rem;
  margin-bottom: .65rem;
}
.inv-broker-steps-section { margin-bottom: .75rem; }
.inv-broker-steps-section:last-child { margin-bottom: 0; }
.inv-broker-steps-sub {
  font-weight: 600; font-size: .68rem; color: var(--muted);
  text-transform: uppercase; letter-spacing: .5px; margin-bottom: .35rem;
}
.inv-broker-steps-list {
  margin: 0; padding-left: 1.3rem; display: flex; flex-direction: column; gap: .2rem;
}
.inv-broker-steps-list li { color: var(--text); }
.inv-broker-steps-list code {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 4px; padding: .05rem .35rem; font-size: .67rem;
}
.inv-broker-steps-note {
  margin-top: .6rem; font-size: .66rem; color: var(--accent3);
  font-family: var(--font-mono);
}
.inv-broker-detected {
  font-size: .7rem; color: var(--accent); margin-bottom: .65rem;
  padding-bottom: .5rem; border-bottom: 1px solid var(--border);
}

/* ── Add / Edit Investment Modal ────────────────────────────── */
.inv-modal-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,.65); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  padding: 1.5rem;
}
.inv-modal-overlay.hidden { display: none; }

.inv-modal {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); width: 100%; max-width: 560px;
  max-height: 90vh; display: flex; flex-direction: column;
  animation: fadeUp .25s ease both;
}
.inv-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.inv-modal-title {
  font-family: var(--font-head); font-size: 1rem; font-weight: 700;
}
.inv-modal-body { padding: 1.4rem 1.5rem; overflow-y: auto; flex: 1; min-height: 0; }
.inv-modal-footer {
  display: flex; justify-content: flex-end; gap: .65rem;
  padding: 1rem 1.5rem; border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.inv-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .85rem; min-width: 0; }
.inv-form-field { display: flex; flex-direction: column; gap: .35rem; min-width: 0; }
.inv-form-field.full { grid-column: 1 / -1; }
.inv-form-label {
  font-size: .62rem; text-transform: uppercase;
  letter-spacing: .6px; color: var(--muted); font-weight: 600;
}
.inv-form-input {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 8px; padding: .55rem .8rem;
  color: var(--text); font-family: var(--font-mono); font-size: .8rem;
  outline: none; transition: border-color .2s;
}
.inv-form-input:focus { border-color: var(--accent4); }
.inv-form-input::placeholder { color: var(--muted); }
.inv-form-select { appearance: none; cursor: pointer; }

/* Category selector pills */
.inv-cat-selector {
  display: flex; gap: .4rem; flex-wrap: wrap; margin-top: .1rem;
}
.inv-cat-pill {
  padding: .3rem .75rem; border-radius: 20px; border: 1px solid var(--border);
  font-size: .65rem; font-weight: 600; cursor: pointer;
  transition: all .15s; color: var(--muted); background: var(--surface2);
}
.inv-cat-pill:hover { border-color: var(--accent4); color: var(--text); }
.inv-cat-pill.active-stock    { background: rgba(0,229,160,.1);  color: var(--accent);  border-color: rgba(0,229,160,.4);  }
.inv-cat-pill.active-mf       { background: rgba(77,171,247,.1); color: var(--accent4); border-color: rgba(77,171,247,.4); }
.inv-cat-pill.active-bond     { background: rgba(255,209,102,.1);color: var(--accent3); border-color: rgba(255,209,102,.4); }
.inv-cat-pill.active-fd       { background: rgba(255,209,102,.1);color: var(--accent3); border-color: rgba(255,209,102,.4); }
.inv-cat-pill.active-realestate{ background: rgba(167,139,250,.1);color: var(--purple);  border-color: rgba(167,139,250,.4);}
.inv-cat-pill.active-gold     { background: rgba(240,180,41,.1);  color: #f0b429;        border-color: rgba(240,180,41,.4);  }
.inv-cat-pill.active-epf      { background: rgba(6,182,212,.1);   color: #06b6d4;        border-color: rgba(6,182,212,.4);   }
.inv-cat-pill.active-esop     { background: rgba(192,132,252,.1); color: #c084fc;        border-color: rgba(192,132,252,.4); }
.inv-cat-pill.active-others   { background: rgba(255,107,107,.1);color: var(--accent2); border-color: rgba(255,107,107,.4);}

.inv-ticker-hint {
  font-size: .62rem; color: var(--muted); margin-top: .3rem;
}
.inv-ticker-hint a { color: var(--accent4); text-decoration: none; }
.inv-ticker-hint a:hover { text-decoration: underline; }

/* Preview quote box */
.inv-quote-preview {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 10px; padding: .75rem 1rem; margin-top: .75rem;
  display: none;
}
.inv-quote-preview.show { display: flex; align-items: center; gap: 1rem; }
.inv-quote-ticker { font-family: var(--font-head); font-size: 1rem; font-weight: 800; }
.inv-quote-price  { font-weight: 600; font-size: .85rem; }
.inv-quote-name   { font-size: .65rem; color: var(--muted); }

/* Duplicate-ticker warning inside quote preview */
.inv-dup-warn {
  display: flex; align-items: center; justify-content: space-between;
  gap: .75rem; width: 100%; flex-wrap: wrap;
  font-size: .75rem;
}
.inv-dup-icon { font-size: .85rem; }
.inv-dup-edit-btn {
  background: rgba(77,171,247,.12); border: 1px solid rgba(77,171,247,.35);
  color: var(--accent4); border-radius: 6px; padding: .25rem .7rem;
  font-size: .7rem; font-weight: 700; cursor: pointer; white-space: nowrap;
  transition: background .15s; flex-shrink: 0;
}
.inv-dup-edit-btn:hover { background: rgba(77,171,247,.25); }

/* ── Mobile-only elements: hidden by default, shown in ≤700px block ── */
.inv-mobile-card-body { display: none; }

/* ── Responsive ─────────────────────────────────────────────── */
/* ══════════════════════════════════════════════════════════
   RESPONSIVE — Investment Tracker
══════════════════════════════════════════════════════════ */

/* ── Tablet (≤1200px) ── */
@media (max-width: 1200px) {
  .inv-summary-strip { grid-template-columns: repeat(3, 1fr); }
}

/* ── Small tablet (≤900px) ── */
@media (max-width: 900px) {
  .inv-summary-strip { grid-template-columns: repeat(2, 1fr); }
  .inv-side-panel    { grid-template-columns: 1fr; }
  .inv-table th:nth-child(5),
  .inv-table td:nth-child(5) { display: none; } /* cost basis */
}

/* ── Mobile (≤700px): card-style rows replace the table ── */
@media (max-width: 700px) {

  /* Page header */
  #investmentScreen { padding: 1rem .75rem 5rem; }
  .inv-page-header  { flex-direction: column; align-items: stretch; gap: .6rem; }
  .inv-page-title   { font-size: 1.1rem; }
  .inv-header-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .4rem;
  }
  .inv-header-actions .btn,
  .inv-header-actions .btn-import {
    width: 100%; text-align: center; justify-content: center;
    font-size: .72rem; padding: .45rem .5rem;
  }

  /* Summary strip: 2 cols */
  .inv-summary-strip { grid-template-columns: 1fr 1fr; gap: .5rem; }
  .inv-sum-value     { font-size: 1rem; }

  /* Category tabs: wrap onto multiple lines — no horizontal scroll */
  .inv-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
    border-bottom: none;
    padding-bottom: .25rem;
  }
  .inv-tab {
    flex-shrink: 0;
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: .3rem .8rem;
    font-size: .65rem;
    background: var(--surface2);
  }
  .inv-tab.active {
    background: rgba(77,171,247,.15);
    border-color: var(--accent4);
    color: var(--accent4);
  }

  /* Holdings head: stack title + search */
  .inv-holdings-head       { flex-direction: column; align-items: stretch; gap: .5rem; }
  .inv-holdings-head-right { width: 100%; }
  .inv-search              { flex: 1; }

  /* ── Card-style rows — replace dense table on mobile ── */
  /* Hide all table columns except Name+Category (col 1,2) */
  .inv-table { min-width: unset; font-size: .8rem; }
  .inv-table thead { display: none; } /* hide header row entirely */

  /* Show only name cell — hide all others */
  .inv-table td { display: none; padding: 0; border: none; }
  .inv-table td:nth-child(1) { display: block; padding: 0; }

  /* Each row becomes a card */
  .inv-table tr {
    display: block;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 10px;
    margin: 0 0 .5rem;
    padding: .75rem;
    cursor: pointer;
    transition: border-color .2s;
  }
  .inv-table tr:hover,
  .inv-table tr.selected { border-color: var(--accent4); background: rgba(77,171,247,.06); }
  .inv-table tr.selected { border-left: 3px solid var(--accent4); }
  .inv-table tr:last-child td { border-bottom: none; }

  /* Name cell: show full card content via JS-injected data attributes */
  .inv-table td:nth-child(1) { width: 100%; }
  .inv-ticker-cell { align-items: center; }
  .inv-ticker-name { font-size: .82rem; }

  /* Card body: inject extra info rows using CSS content from data-* */
  /* We'll do this via a custom class added in JS */
  .inv-mobile-card-body {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: .45rem;
    gap: .5rem;
    flex-wrap: wrap;
  }
  .inv-mobile-stat {
    display: flex; flex-direction: column; gap: .1rem;
  }
  .inv-mobile-stat-label {
    font-size: .55rem; text-transform: uppercase;
    letter-spacing: .5px; color: var(--muted);
  }
  .inv-mobile-stat-val {
    font-size: .78rem; font-weight: 600;
  }
  .inv-mobile-edit-btn {
    background: var(--surface); border: 1px solid var(--border);
    color: var(--accent4); border-radius: 8px;
    padding: .35rem .65rem; font-size: .7rem;
    cursor: pointer; flex-shrink: 0;
    transition: border-color .2s, background .2s;
  }
  .inv-mobile-edit-btn:hover { background: rgba(77,171,247,.1); border-color: var(--accent4); }

  /* Detail panel */
  .inv-detail-tabs    { overflow-x: auto; white-space: nowrap; scrollbar-width: none; }
  .inv-detail-tabs::-webkit-scrollbar { display: none; }
  .inv-detail-body    { padding: .85rem; }

  /* Modal full-screen on mobile */
  .inv-modal-overlay  { padding: 0; align-items: flex-end; }
  .inv-modal {
    max-width: 100%; width: 100%;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    max-height: 92vh;
  }
  .inv-form-grid      { grid-template-columns: 1fr; }

  /* Financials table */
  .inv-fin-table th, .inv-fin-table td { font-size: .62rem; padding: .4rem .45rem; }

  /* Side panel full width */
  .inv-side-panel     { grid-template-columns: 1fr; }
  .inv-alloc-card,
  .inv-live-card      { padding: .85rem 1rem; }

  /* Card layout doesn't need horizontal scroll */
  .inv-holdings-card { overflow-x: hidden; }
  /* Reset white-space on the visible card cell so sub-text can wrap */
  .inv-table td:nth-child(1) { white-space: normal; }
  /* Restore readable font size for name in card layout */
  .inv-ticker-name { font-size: .82rem; }

  /* Lots table: fixed layout so columns never push past the wrapper width */
  .inv-lots-table { table-layout: fixed; min-width: unset; width: 100%; }
  .inv-lots-table th:nth-child(1), .inv-lots-table td:nth-child(1) { width: 38%; min-width: unset; }
  .inv-lots-table th:nth-child(2), .inv-lots-table td:nth-child(2) { width: 22%; min-width: unset; }
  .inv-lots-table th:nth-child(3), .inv-lots-table td:nth-child(3) { width: auto; min-width: unset; }
  .inv-lots-table th:nth-child(5), .inv-lots-table td:nth-child(5) { width: 28px; }
  /* Inputs fill their fixed-width cells */
  .inv-lots-table .inv-form-input { width: 100%; box-sizing: border-box; }
  /* Hide Notes column */
  .inv-lots-table th:nth-child(4),
  .inv-lots-table td:nth-child(4) { display: none; }
  /* Modal body padding on mobile */
  .inv-modal-body { padding: 1rem; }
}

/* ── Toast (shared, in case app.css doesn't define it) ─────── */
.toast { display:flex; align-items:center; gap:.6rem; position:fixed; bottom:1.5rem; right:1.5rem; z-index:9999; background:var(--surface2); border:1px solid var(--border); border-radius:10px; padding:.65rem 1.1rem; font-size:.78rem; box-shadow:0 4px 20px rgba(0,0,0,.3); animation:fadeUp .25s ease; pointer-events:none; }
.toast.success { border-color:rgba(0,229,160,.3); color:var(--accent); }
.toast.error   { border-color:rgba(255,107,107,.3); color:var(--accent2); }
.toast.hide    { animation:fadeOut .3s ease forwards; }

/* ══════════════════════════════════════════════════════════
   Purchase Records (lots) — inside Add/Edit modal
═══════════════════════════════════════════════════════════ */
.inv-lots-section { grid-column: 1 / -1; min-width: 0; }

.inv-lots-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: .55rem;
}
.inv-btn-add-lot {
  background: rgba(0,229,160,.1); border: 1px solid rgba(0,229,160,.3);
  color: var(--accent); border-radius: 6px; padding: .28rem .7rem;
  font-size: .7rem; font-weight: 600; cursor: pointer; white-space: nowrap;
  transition: background .15s;
}
.inv-btn-add-lot:hover { background: rgba(0,229,160,.2); }

.inv-lots-table-wrap {
  overflow-x: auto; border: 1px solid var(--border); border-radius: 8px;
  max-height: 240px; overflow-y: auto; max-width: 100%;
}
.inv-lots-table {
  width: 100%; border-collapse: collapse; font-size: .75rem;
  table-layout: auto;
}
.inv-lots-table thead th {
  background: var(--surface2); padding: .4rem .55rem;
  text-align: left; font-size: .6rem; text-transform: uppercase;
  letter-spacing: .6px; color: var(--muted); white-space: nowrap;
  position: sticky; top: 0; z-index: 1;
}
.inv-lots-table tbody tr:not(:last-child) td { border-bottom: 1px solid var(--border); }
.inv-lots-table td { padding: .3rem .45rem; vertical-align: middle; }
.inv-lots-table .inv-form-input {
  padding: .3rem .5rem; font-size: .75rem; border-radius: 5px;
  min-width: 0;
}
.inv-lots-table td:nth-child(1) { min-width: 130px; }
.inv-lots-table td:nth-child(2) { min-width: 70px; }
.inv-lots-table td:nth-child(3) { min-width: 100px; }
.inv-lots-table td:nth-child(4) { width: 100%; }
.inv-lots-table td:nth-child(5) { width: 28px; }

.inv-lot-del-btn {
  background: rgba(255,107,107,.08); border: 1px solid rgba(255,107,107,.2);
  color: var(--accent2); border-radius: 5px; width: 22px; height: 22px;
  font-size: .65rem; cursor: pointer; display: flex; align-items: center;
  justify-content: center; transition: background .15s;
}
.inv-lot-del-btn:hover:not(:disabled) { background: rgba(255,107,107,.2); }
.inv-lot-del-btn:disabled { opacity: .3; cursor: not-allowed; }

.inv-lots-summary {
  margin-top: .5rem; padding: .45rem .75rem;
  background: var(--surface2); border: 1px solid var(--border); border-radius: 7px;
  font-size: .7rem; color: var(--muted);
}
.inv-lots-summary strong { color: var(--accent4); font-weight: 700; }

/* ── Missing utility used in overview tab inline icon ───────── */
.inv-ticker-icon {
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px; font-weight: 700; flex-shrink: 0;
  font-family: var(--font-mono);
}

/* ── Detail body padding fix ────────────────────────────────── */
.inv-detail-body { padding: 1.2rem 1.3rem; min-height: 120px; }

/* duplicate 600px block removed */


