:root {
  color-scheme: light;
  --bg: #f4f7f6;
  --surface: #ffffff;
  --text: #111827;
  --muted: #4b5563;
  --border: #e5e7eb;
  --accent: #0f766e;
  --accent-soft: #ccfbf1;
  --success: #15803d;
  --warning: #0f766e;
  --error: #dc2626;
  --shadow: 0 18px 35px rgba(15, 118, 110, 0.08);
  --confidence-high: #16a34a;
  --confidence-mid: #eab308;
  --confidence-low: #dc2626;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
}

a {
  color: inherit;
  text-decoration: none;
}

.main-content {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px 80px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(244, 247, 246, 0.96);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(6px);
}

.nav {
  max-width: 1120px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.logo {
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 0.2px;
  display: flex;
  align-items: flex-end;
  gap: 0;
}

.logo img {
  height: 64px;
  width: auto;
  display: block;
}

.logo-text {
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: 1.2px;
  background: linear-gradient(135deg, var(--accent) 0%, #14b8a6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-transform: uppercase;
  margin-left: 14px;
  margin-bottom: 12px;
}

.nav-links,
.nav-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.nav-links a {
  color: var(--muted);
  font-size: 0.95rem;
}

.nav-links a.active {
  color: var(--text);
  font-weight: 600;
}

/* Dashboard link: even spacing from left nav items and search bar */
.nav-links a.nav-link-dashboard {
  color: var(--accent);
  font-weight: 600;
  margin: 0 16px;
}
.nav-links a.nav-link-dashboard:hover {
  color: #0d9488;
}
.nav-links a.nav-link-dashboard.active {
  color: var(--accent);
  font-weight: 700;
  background: rgba(15, 118, 110, 0.1);
  padding: 6px 12px;
  margin: -6px 4px;
  border-radius: 8px;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  padding: 6px;
  cursor: pointer;
}

.nav-toggle span {
  width: 22px;
  height: 2px;
  background: var(--text);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  font-size: 0.95rem;
  white-space: nowrap;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 10px 20px rgba(15, 118, 110, 0.15);
}

.btn:hover {
  transform: translateY(-1px);
}

.btn.ghost {
  background: transparent;
  color: var(--accent);
  box-shadow: none;
}

.btn:disabled,
.btn.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  pointer-events: auto;
}
.btn:disabled:hover,
.btn.disabled:hover {
  transform: none;
}

.hero {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 40px;
  padding: 80px 0 40px;
}

.hero-content h1 {
  font-size: clamp(2.2rem, 3vw, 3rem);
  margin-bottom: 12px;
}

.hero-subtitle {
  color: var(--muted);
  margin-bottom: 24px;
}

.hero-actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.hero-note {
  margin-top: 16px;
  color: var(--muted);
  font-size: 0.95rem;
}

.hero-media {
  position: relative;
  border-radius: 24px;
  overflow: hidden;
  min-height: 320px;
  box-shadow: var(--shadow);
}

.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.hero-media-caption {
  position: absolute;
  bottom: 16px;
  left: 16px;
  background: rgba(15, 118, 110, 0.88);
  color: #fff;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.85rem;
}

.hero-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 28px;
  box-shadow: var(--shadow);
}

.hero-card ul {
  padding-left: 20px;
  margin: 16px 0;
}

.hero-card-footer {
  font-size: 0.85rem;
  color: var(--muted);
}

.section {
  padding: 60px 0;
}

.section-tight-vertical {
  padding-top: 24px;
  padding-bottom: 0;
  margin-bottom: -32px;
}

.section.muted {
  background: #e6f4f1;
  border-radius: 32px;
  padding: 60px 40px;
}

.section.muted.section-muted-tight-top {
  padding-top: 12px;
}

.section.muted.section-tighter-top {
  padding-top: 4px;
}

.section-header {
  margin-bottom: 32px;
}

.section-header h2 {
  margin-bottom: 8px;
}

.section-header p {
  color: var(--muted);
}

.grid {
  display: grid;
  gap: 24px;
}

.grid.two-col {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.grid.three-col {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  align-items: start;
}

.grid.products-grid {
  align-items: stretch;
}
.grid.products-grid .card {
  display: flex;
  flex-direction: column;
}
.grid.products-grid .card .card-image {
  flex-shrink: 0;
}
.grid.products-grid .card .feature-list,
.grid.products-grid .card p:last-of-type {
  margin-bottom: 0;
}

.grid.three-col .alert-card {
  display: grid;
  grid-template-rows: 
    minmax(50px, max-content) 
    minmax(50px, max-content) 
    minmax(60px, max-content) 
    minmax(80px, max-content) 
    minmax(100px, max-content) 
    minmax(50px, max-content);
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 24px;
  box-shadow: var(--shadow);
}

.card-image {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: 16px;
  margin-bottom: 16px;
}

.card.mini {
  box-shadow: none;
}

.feature-list {
  padding-left: 20px;
}

.alert-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 22px;
  display: grid;
  grid-template-rows: 50px 50px 60px 150px 160px 50px;
  gap: 12px;
  align-content: start;
  height: 100%;
}

.alert-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  margin: 0;
}

.alert-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  overflow: hidden;
}

.alert-card > p:first-of-type {
  margin: 0;
  align-self: start;
  overflow: hidden;
}

.alert-meta {
  display: grid;
  gap: 6px;
  font-size: 0.85rem;
  margin: 0;
  align-content: start;
}

.alert-card ul {
  padding-left: 20px;
  margin: 0;
  display: flex;
  flex-direction: column;
  justify-content: start;
  align-content: start;
  overflow: hidden;
}

.alert-notes-wrapper {
  display: grid;
  gap: 8px;
  margin: 0;
  align-content: start;
  overflow: hidden;
}

.alert-title {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-weight: 600;
}

.ticker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--text);
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 1.05rem;
  letter-spacing: 0.04em;
}

.alert-card a.ticker {
  text-decoration: none;
}

.company {
  font-size: 0.92rem;
}

.alert-time {
  font-size: 0.8rem;
  color: var(--muted);
  display: block;
  align-self: start;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  margin: 0;
}

.alert-card ul {
  padding-left: 20px;
  margin: 0;
}


.meta-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.meta-row:last-child {
  margin-bottom: 8px;
}

.meta-label {
  min-width: 88px;
  text-align: right;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.7rem;
  color: var(--muted);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 600;
}

.pill.classification.sector {
  background: #fef9c3;
  color: #a16207;
}

.pill.classification.macro {
  background: #ffedd5;
  color: #c2410c;
}

.pill.classification.company-specific {
  background: #dbeafe;
  color: #1d4ed8;
}

.pill.classification.technical {
  background: #dcfce7;
  color: #15803d;
}

.pill.classification.structural {
  background: #fee2e2;
  color: #dc2626;
}

.pill.classification.earnings {
  background: #ede9fe;
  color: #5b21b6;
}

.pill.confidence.high {
  background: #dcfce7;
  color: var(--confidence-high);
}

.pill.confidence.medium {
  background: #fef9c3;
  color: var(--confidence-mid);
}

.pill.confidence.low {
  background: #fee2e2;
  color: var(--confidence-low);
}

.confidence-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.confidence-value {
  font-weight: 600;
  min-width: 46px;
  margin-left: 4px;
  /* Gradient color: 0% = red (0deg), 50% = yellow (60deg), 100% = green (120deg) */
  /* Simple linear mapping: hue = confidence * 1.2 */
  --hue: calc(var(--confidence, 50) * 1.2);
  color: hsl(var(--hue), 85%, 45%);
  text-shadow: 0 0.5px 0 rgba(0, 0, 0, 0.4);
}

.confidence-scale {
  position: relative;
  height: 8px;
  width: 140px;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    var(--confidence-low) 0%,
    var(--confidence-mid) 50%,
    var(--confidence-high) 100%
  );
}

.confidence-dot {
  position: absolute;
  top: 50%;
  left: calc(var(--confidence, 50) * 1%);
  transform: translate(-50%, -50%);
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid var(--text);
}

.move {
  font-weight: 700;
}

.move.positive {
  color: var(--success);
}

.move.negative {
  color: var(--error);
}

.move.neutral {
  color: var(--muted);
}

.move-price {
  font-weight: 500;
  opacity: 0.9;
}

.alert-note {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 0;
}

.alert-card .alert-note:last-of-type {
  margin-bottom: 0;
}

.alert-asterisk {
  display: inline;
  font-size: 0.9rem;
  color: var(--muted);
  font-weight: 600;
  margin-left: auto;
}

.sample-alert-disclaimer {
  font-size: 0.75rem;
  color: #9ca3af;
  text-align: center;
  margin: 16px 0 0 0;
  padding: 0;
}

.legend-group {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px 24px;
  box-shadow: var(--shadow);
}

.legend-group h4 {
  margin: 0 0 12px;
  font-size: 0.95rem;
}

.legend-items {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.legend-confidence {
  display: grid;
  gap: 8px;
  max-width: 260px;
}

.legend-scale {
  width: 100%;
  height: 10px;
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-width: 2px;
}

.legend-note {
  margin-top: 12px;
  margin-bottom: 0;
  font-size: 0.85rem;
  color: var(--muted);
  font-style: italic;
}

.pricing-grid .pricing-card {
  position: relative;
}

.pricing-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 28px;
  text-align: left;
  box-shadow: var(--shadow);
}

.pricing-card.featured {
  border-color: var(--accent);
}

.pricing-card.selected {
  border-color: var(--accent);
  box-shadow: 0 18px 35px rgba(15, 118, 110, 0.12);
}

.badge {
  display: inline-block;
  background: var(--accent-soft);
  color: var(--accent);
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.8rem;
  margin-bottom: 12px;
}

.price {
  font-size: 2rem;
  font-weight: 700;
  margin: 12px 0;
}

.price span {
  font-size: 1rem;
  color: var(--muted);
  font-weight: 400;
}

.trial-note {
  font-size: 0.85rem;
  color: var(--accent);
  font-weight: 600;
  margin: -8px 0 12px;
  text-align: center;
}

.newsletter-cta {
  background: linear-gradient(135deg, #0f766e 0%, #0d9488 50%, #14b8a6 100%);
  border-radius: 24px;
  padding: 48px 40px;
}

.newsletter-cta-inner {
  max-width: 560px;
  margin: 0 auto;
}

.newsletter-cta-content h3 {
  margin: 0 0 12px;
  font-size: 1.5rem;
  color: #fff;
}

.newsletter-cta-content p {
  margin: 0 0 24px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 1rem;
}

.newsletter-form {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.newsletter-form input[type="email"] {
  flex: 1;
  min-width: 200px;
  padding: 14px 18px;
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  background: #fff;
}

.newsletter-form input[type="email"]::placeholder {
  color: #9ca3af;
}

.newsletter-form .btn {
  background: #fff;
  color: #0f766e;
  font-weight: 600;
  padding: 14px 24px;
  white-space: nowrap;
}

.newsletter-form .btn:hover {
  background: #f4f7f6;
  color: #0d9488;
}

.newsletter-form.compact input[type="email"] {
  min-width: 160px;
  padding: 10px 14px;
}

.newsletter-form.compact .btn {
  padding: 10px 18px;
}

.footer-newsletter {
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
  position: relative;
  overflow: visible;
}

.footer-newsletter::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-top: 20px;
  width: 400px;
  height: 400px;
  background-image: url("/static/Klarion Capital Logo.png");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  opacity: 0.2;
  pointer-events: none;
  z-index: 0;
}

.footer-newsletter-headline {
  margin: 0 0 12px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  position: relative;
  z-index: 1;
}

.footer-newsletter .newsletter-form {
  display: flex;
  gap: 8px;
  position: relative;
  z-index: 1;
}

.cta-free-review {
  background: linear-gradient(135deg, #0f766e 0%, #0d9488 60%, #0f766e 100%);
  border-radius: 24px;
  padding: 48px 40px;
  margin-bottom: 32px;
  text-align: center;
}
.cta-free-review-extra-top {
  margin-top: 24px;
}
.cta-free-review-tight-bottom {
  margin-bottom: 0;
}
.cta-free-review-inner {
  max-width: 520px;
  margin: 0 auto;
}
.cta-free-review-inner h3 {
  margin: 0 0 12px;
  font-size: 1.75rem;
  color: #fff;
}
.cta-free-review-inner p {
  margin: 0 0 24px;
  color: rgba(255, 255, 255, 0.92);
  font-size: 1.05rem;
  line-height: 1.5;
}
.cta-free-review .btn-cta-large {
  display: inline-block;
  padding: 14px 28px;
  font-size: 1.05rem;
  font-weight: 600;
  background: #fff;
  color: var(--accent);
  border: none;
  border-radius: 10px;
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
  transition: transform 0.15s, box-shadow 0.15s;
}
.cta-free-review .btn-cta-large:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.section.newsletter-cta + .section.cta {
  margin-top: 32px;
}

.cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  background: var(--surface);
  border-radius: 24px;
  padding: 36px;
  border: 1px solid var(--border);
}

.page-hero {
  padding: 60px 0 0;
}
.page-hero-tight {
  padding-top: 20px;
}

.page-hero h1 {
  margin-bottom: 0;
  font-size: clamp(2rem, 3vw, 2.5rem);
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.75rem;
  color: var(--muted);
}

.form {
  display: grid;
  gap: 16px;
}

.form label {
  display: grid;
  gap: 8px;
  font-weight: 500;
}

.form input,
.form textarea {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font: inherit;
}

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

.password-input-wrapper .password-input {
  padding-right: 40px;
  width: 100%;
}

.password-toggle {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  transition: color 0.2s ease;
}

.password-toggle:hover {
  color: var(--text);
}

.password-toggle:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

.eye-icon {
  width: 20px;
  height: 20px;
  display: block;
}

.eye-closed {
  display: none;
}

.password-toggle.active .eye-open {
  display: none;
}

.password-toggle.active .eye-closed {
  display: block;
}

.form input.error,
.form textarea.error {
  border-color: var(--error);
  background: #fef2f2;
}

.form-help {
  display: block;
  color: var(--muted);
  font-size: 0.85rem;
  margin-top: 4px;
}

.form-error {
  color: var(--error);
  font-size: 0.85rem;
}

.optional {
  font-weight: 400;
  color: var(--muted);
  font-size: 0.9em;
}

.alert.success {
  padding: 12px 16px;
  border-radius: 12px;
  background: #ecfdf5;
  color: var(--success);
  margin-bottom: 16px;
}

.note {
  color: var(--muted);
  font-size: 0.95rem;
}

.table-scroll {
  overflow-x: auto;
}

.feature-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
}

.feature-table th,
.feature-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  border-right: 1px solid #e2e8f0;
  text-align: left;
  font-size: 0.95rem;
}

.feature-table th:last-child,
.feature-table td:last-child {
  border-right: none;
}

.feature-table thead th {
  background: #d8f3ef;
  font-weight: 600;
}

.feature-table tbody tr:nth-child(even) td {
  background: #f8fbfa;
}

.feature-table tbody td:first-child {
  color: #1e293b;
  font-weight: 500;
}

.flash-wrap {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.flash {
  padding: 12px 16px;
  border-radius: 12px;
  background: #f1f5f9;
  color: var(--text);
}

.flash-success {
  background: #ecfdf5;
  color: var(--success);
}

.flash-warning {
  background: #e6f4f1;
  color: var(--warning);
}

.flash-error {
  background: #fef2f2;
  color: var(--error);
}

.pct-change {
  font-weight: 600;
  white-space: nowrap;
}
.pct-change.pct-positive {
  color: var(--confidence-high, #16a34a);
}
.pct-change.pct-negative {
  color: var(--error);
}
.pct-change.pct-zero {
  color: var(--muted);
}

/* Dashboard: Market Summary (uses profit-summary-* for uniform text) */
.market-summary {
  margin-bottom: 12px;
}
.market-summary-index-link {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}
.market-summary-index-link:hover {
  text-decoration: underline;
}
.market-summary:last-child {
  margin-bottom: 0;
}

.profit-summary {
  margin-bottom: 0;
  overflow: visible;
}
.profit-summary-body {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 32px;
  margin-top: 0;
  overflow: visible;
}
/* When market summary is present: left column (market + portfolio) | chart on right */
.profit-summary-body.has-top-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 32px;
  align-items: start;
}
.profit-summary-body.has-top-row .profit-summary-left {
  min-width: 0;
}
.profit-summary-left {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.profit-summary-left .market-summary {
  margin-bottom: 0;
}
.profit-summary-tabs-wrap {
  margin-top: 16px;
}
.profit-summary-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 12px;
}
.profit-summary-tab {
  padding: 8px 16px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--muted);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  border-radius: 4px 4px 0 0;
}
.profit-summary-tab:hover {
  color: var(--text);
}
.profit-summary-tab.active {
  color: #0f766e;
  border-bottom-color: #0f766e;
}
.profit-summary-tab-panel.hidden {
  display: none;
}
.portfolio-chart-container.hidden {
  display: none;
}
.portfolio-chart-container {
  min-width: 220px;
}
.profit-summary-left .profit-summary-fields-wrap {
  margin-top: 0;
}
.profit-summary-body.has-top-row .profit-summary-chart-wrap {
  flex-shrink: 0;
  align-self: flex-start;
  margin: 0;
}
@media (max-width: 640px) {
  .profit-summary-body.has-top-row {
    grid-template-columns: 1fr;
  }
}
.profit-summary-fields-wrap {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.profit-summary-title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
}
.profit-summary-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 28px;
  align-items: flex-start;
}
.profit-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, auto);
  gap: 8px 28px;
  align-items: start;
  padding-top: 12px;
}
.profit-summary-gain {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-self: flex-start;
}
.profit-summary-chart-wrap {
  flex-shrink: 0;
  align-self: center;
  position: relative;
  z-index: 10;
  overflow: visible;
  margin-left: auto;
  margin-right: 0;
  min-width: 220px;
}
.profit-summary-body:not(.has-top-row) .profit-summary-chart-wrap {
  margin-top: -48px;
}
.profit-summary-chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  margin-top: 6px;
  font-size: 0.75rem;
  color: var(--muted);
}
.profit-summary-chart-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}
.profit-summary-chart-legend-swatch {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  flex-shrink: 0;
}

/* External tooltip for portfolio pie - appended to body, always on top */
.portfolio-chart-tooltip {
  position: fixed;
  z-index: 99999;
  padding: 8px 12px;
  background: rgba(15, 23, 42, 0.95);
  color: #fff;
  border-radius: 8px;
  font-size: 0.85rem;
  line-height: 1.4;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  pointer-events: none;
  transform: translate(-50%, -100%);
  margin-top: -8px;
  white-space: nowrap;
  transition: opacity 0.15s ease;
}
.portfolio-chart-tooltip-line {
  display: block;
}
.portfolio-chart-tooltip-sub {
  font-size: 0.8em;
  color: rgba(255, 255, 255, 0.85);
  margin-top: 2px;
}
.section-tight-top {
  padding-top: 16px;
}
.section-tighter-top {
  padding-top: 8px;
}
.section-tight-bottom {
  padding-bottom: 16px;
}
.ticker-company-name {
  font-size: 0.6em;
  font-weight: 500;
  color: var(--muted);
  margin-left: 0.25em;
}
.profit-summary-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.profit-summary-label {
  font-size: 0.85rem;
  color: var(--muted);
}
.profit-summary-value {
  font-weight: 600;
  font-size: 1.1rem;
}

.ticker-link {
  color: var(--accent);
  font-weight: 600;
}
.ticker-link:hover {
  text-decoration: underline;
}

.ticker-loading-panel {
  margin-bottom: 24px;
}
.ticker-loading-intro {
  color: var(--muted);
  font-size: 0.95rem;
  margin: 0 0 20px;
}
.ticker-loading-steps {
  list-style: none;
  margin: 0;
  padding: 0;
}
.ticker-step {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
}
.ticker-step:last-child {
  border-bottom: none;
}
.ticker-step-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  font-weight: 700;
  color: var(--muted);
}
.ticker-step-loading .ticker-step-icon {
  width: 20px;
  height: 20px;
  border: 2px solid var(--accent);
  border-top-color: transparent;
  border-radius: 50%;
  animation: ticker-step-spin 0.8s linear infinite;
}
.ticker-step-loading .ticker-step-label {
  color: var(--text);
}
.ticker-step-done .ticker-step-icon {
  color: var(--success);
  font-size: 1.1rem;
}
.ticker-step-done .ticker-step-label {
  color: var(--muted);
}
.ticker-step-error .ticker-step-icon {
  color: var(--error);
}
.ticker-step-error .ticker-step-label {
  color: var(--error);
}
@keyframes ticker-step-spin {
  to { transform: rotate(360deg); }
}
.ticker-content-hidden {
  display: none;
}
.ticker-loading-complete {
  display: none;
}

.ticker-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

.ticker-summary-tabs {
  display: flex;
  gap: 4px;
  margin: -4px 0 16px;
  border-bottom: 1px solid var(--border);
}
.ticker-tab {
  padding: 8px 16px;
  font-size: 0.9rem;
  font-weight: 500;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}
.ticker-tab:hover {
  color: var(--text);
}
.ticker-tab.active {
  color: #0f766e;
  border-bottom-color: #0f766e;
}
.ticker-tab-panel.hidden {
  display: none;
}
.ticker-subsection {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted);
  margin: 16px 0 8px;
}
.ticker-subsection:first-child {
  margin-top: 0;
}
.ticker-data-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.ticker-data-list li {
  padding: 6px 0;
  font-size: 0.95rem;
  color: var(--text);
  border-bottom: 1px solid var(--border);
}
.ticker-data-list li:last-child {
  border-bottom: none;
}
.ticker-data-date {
  font-weight: 500;
  color: var(--text);
  min-width: 100px;
  display: inline-block;
}
.ticker-data-amount {
  font-weight: 600;
  color: #0f766e;
}
.dividends-chart-wrap {
  min-height: 200px;
  margin: 12px 0;
}
.ticker-dividends-below {
  display: flex;
  gap: 32px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}
.ticker-dividends-last {
  flex: 0 0 auto;
  min-width: 140px;
}
.ticker-dividend-last {
  margin: 0;
  font-size: 1rem;
}
.ticker-dividend-last .ticker-data-amount {
  font-weight: 700;
  font-size: 1.1rem;
}
.ticker-dividend-total-pct {
  margin: 4px 0 0;
  font-size: 0.9rem;
  color: var(--muted);
}
.ticker-data-pct {
  color: var(--muted);
  font-size: 0.95rem;
}
.ticker-dividends-upcoming {
  flex: 1;
  min-width: 180px;
}

.ticker-price-card .ticker-price {
  font-size: 1.75rem;
  font-weight: 700;
  margin: 0 0 8px;
}
.ticker-price-card .ticker-meta {
  color: var(--muted);
  font-size: 0.95rem;
  margin: 0;
}
.ticker-price-stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 12px 20px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.ticker-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.ticker-stat-label {
  font-size: 0.8rem;
  color: var(--muted);
}
.ticker-stat span:last-child {
  font-weight: 600;
  font-size: 0.95rem;
}
.ticker-chart-card .chart-wrap {
  min-height: 200px;
  margin: 12px 0;
}

.ticker-overview-card {
  position: relative;
}
.ticker-overview-refresh {
  position: absolute;
  top: 16px;
  right: 16px;
}
.ticker-overview-refresh.ticker-refresh-loading svg {
  animation: ticker-step-spin 0.8s linear infinite;
}
.ticker-overview-refresh:disabled.ticker-refresh-loading,
.ticker-overview-refresh.ticker-refresh-loading {
  pointer-events: none;
  opacity: 0.8;
}

.ticker-overview-intro {
  color: var(--muted);
  font-size: 0.95rem;
  margin: 0 0 20px;
  line-height: 1.6;
}
.ticker-overview-sections {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin: 16px 0 24px;
}
.ticker-overview-section h4 {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 8px;
  color: var(--text);
}
.ticker-overview-body {
  margin: 0;
  line-height: 1.7;
  color: var(--text);
}
.ticker-overview-freeform {
  margin: 16px 0 24px;
  line-height: 1.75;
  color: var(--text);
}
.ticker-overview-freeform h2,
.ticker-overview-freeform h3 {
  font-size: 1rem;
  font-weight: 600;
  margin: 24px 0 8px;
  color: var(--text);
}
.ticker-overview-freeform h2:first-child,
.ticker-overview-freeform h3:first-child {
  margin-top: 0;
}
.ticker-overview-freeform p {
  margin: 0 0 12px;
}
.ticker-overview-freeform ul,
.ticker-overview-freeform ol {
  margin: 8px 0 12px;
  padding-left: 1.5em;
}
.ticker-overview-freeform li {
  margin-bottom: 4px;
}
.ticker-overview-freeform strong {
  font-weight: 600;
}
.ticker-overview-disclaimer {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 20px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.company-overview {
  line-height: 1.7;
  margin: 0;
  color: var(--text);
}
.headlines-list {
  list-style: none;
  padding: 0;
  margin: 12px 0 0;
}
.headlines-list li {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
}
.headlines-list li:last-child {
  border-bottom: none;
}
.headlines-list a {
  color: var(--accent);
  font-weight: 500;
  flex: 1 1 auto;
}
.headlines-list a:hover {
  text-decoration: underline;
}
.headline-publisher,
.headline-date {
  font-size: 0.85rem;
  color: var(--muted);
}

.demo-credentials {
  background: #f1f5f9;
  padding: 12px 16px;
  border-radius: 12px;
  margin: 12px 0;
}

.site-footer {
  position: relative;
  border-top: 1px solid var(--border);
  padding: 40px 24px;
  overflow: visible;
}

.footer-inner {
  position: relative;
  z-index: 1;
  max-width: 1120px;
  margin: 0 auto;
  display: grid;
  gap: 20px;
  overflow: visible;
}

.footer-brand {
  position: relative;
  overflow: visible;
}

.footer-brand::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-top: 20px;
  width: 400px;
  height: 400px;
  background-image: url("/static/Klarion Capital Logo.png");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  opacity: 0.2;
  pointer-events: none;
  z-index: 0;
}

/* Hide footer-brand logo when newsletter is present (newsletter has its own logo) */
.footer-newsletter ~ .footer-brand::after {
  display: none;
}

.footer-brand p {
  position: relative;
  z-index: 1;
}

.footer-links-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.footer-links-row .footer-links {
  margin: 0;
}

.footer-feedback-wrap .feedback-form-trigger {
  margin-left: auto;
  flex-shrink: 0;
}

.footer-feedback-wrap .feedback-form-body {
  display: none;
  margin-top: 20px;
  padding: 20px;
  border-top: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
  position: relative;
  z-index: 2;
}

.footer-feedback-wrap.expanded .feedback-form-trigger {
  display: none;
}

.footer-feedback-wrap.expanded .feedback-form-body {
  display: block;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  color: var(--muted);
}

@media (max-width: 900px) {
  .cta {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 600px) {
  .newsletter-form {
    flex-direction: column;
  }
  .newsletter-form input[type="email"] {
    min-width: 100%;
  }
}

@media (max-width: 768px) {
  .nav-links,
  .nav-actions {
    display: none;
  }

  .nav-toggle {
    display: flex;
  }

  body.nav-open .nav-links {
    display: flex;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 12px;
    padding: 16px 24px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
  }

  body.nav-open .nav-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: absolute;
    top: 188px;
    left: 0;
    right: 0;
    padding: 0 24px 16px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
  }

  body.nav-open .ticker-search-wrap {
    width: 100%;
  }
}

/* User Menu Dropdown */
/* Ticker search (navbar) */
.ticker-search-wrap {
  position: relative;
  width: 220px;
  display: flex;
  align-items: center;
}
.ticker-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 1;
}
.ticker-search-wrap:focus-within .ticker-search-icon {
  opacity: 0;
}
.ticker-search-input {
  width: 100%;
  padding: 9px 14px 9px 38px;
  font-size: 0.9rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s, padding 0.2s ease;
}
.ticker-search-wrap:focus-within .ticker-search-input {
  padding-left: 14px;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(15, 118, 110, 0.15);
}
.ticker-search-input::placeholder {
  color: var(--muted);
}
.ticker-search-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  min-width: 280px;
  max-height: 320px;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
  z-index: 100;
}
.ticker-search-dropdown.is-open {
  display: block;
}
.ticker-search-dropdown[aria-hidden="false"] {
  display: block;
}
.ticker-search-dropdown[aria-hidden="true"] {
  display: none;
}
.ticker-search-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: 100%;
  padding: 10px 14px;
  text-align: left;
  font-size: 0.9rem;
  color: var(--text);
  background: none;
  border: none;
  cursor: pointer;
  transition: background 0.1s;
  gap: 2px;
}
.ticker-search-item .ticker-search-item-symbol {
  font-weight: 600;
  color: var(--text);
}
.ticker-search-item .ticker-search-item-name {
  font-size: 0.8rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.ticker-search-item:hover,
.ticker-search-item[aria-selected="true"] {
  background: var(--accent-soft);
}
.ticker-search-item:not(:last-child) {
  border-bottom: 1px solid var(--border);
}

.user-menu {
  position: relative;
  display: inline-block;
}

/* Add invisible bridge to prevent gap when moving mouse */
.user-menu::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  height: 6px;
  background: transparent;
  z-index: 99;
}

.user-menu-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.dropdown-arrow {
  font-size: 0.7rem;
  transition: transform 0.2s ease;
}

.user-menu:hover .dropdown-arrow,
.user-menu.active .dropdown-arrow {
  transform: rotate(180deg);
}

.user-menu-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 2px);
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  min-width: 180px;
  z-index: 100;
  overflow: hidden;
  padding-top: 4px;
  padding-bottom: 4px;
}

.user-menu:hover .user-menu-dropdown,
.user-menu.active .user-menu-dropdown {
  display: block;
}

.user-menu-dropdown a {
  display: block;
  padding: 12px 16px;
  color: var(--text);
  font-size: 0.95rem;
  transition: background 0.2s ease;
}

.user-menu-dropdown a:hover {
  background: var(--accent-soft);
}

.user-menu-dropdown a:not(:last-child) {
  border-bottom: 1px solid var(--border);
}

/* Admin Database Inspector */
.admin-db-inspector {
  background: var(--surface);
  border-radius: 16px;
  padding: 32px;
  box-shadow: var(--shadow);
}

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

.admin-newsletter {
  max-width: 720px;
}

.admin-newsletter .newsletter-subject {
  width: 100%;
  padding: 12px 14px;
  font-size: 1rem;
}

.admin-newsletter .newsletter-editor {
  min-height: 280px;
  background: #fff;
  border-radius: 8px;
  margin-bottom: 16px;
}

.admin-newsletter .ql-container {
  min-height: 240px;
}

.admin-newsletter .newsletter-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.admin-newsletter .newsletter-delete-form {
  display: none;
}

.admin-newsletter-list .newsletter-delete-inline {
  display: inline;
}

.newsletter-row-actions,
.portfolio-row-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

.portfolio-delete-inline {
  display: inline;
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.btn-icon:hover {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent);
}
.btn-icon svg {
  flex-shrink: 0;
}
.btn-icon-ghost {
  background: transparent;
  border-color: transparent;
}
.btn-icon-ghost:hover {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: transparent;
}
.btn-icon-danger:hover {
  background: #fef2f2;
  color: var(--error);
  border-color: transparent;
}
.btn-icon.btn-icon-danger:hover {
  border-color: var(--error);
}
.btn-icon-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.btn-icon-primary:hover {
  background: #0d5c55;
  color: #fff;
  border-color: #0d5c55;
}

.admin-newsletter-list .newsletter-list-header {
  margin-bottom: 20px;
}

.admin-newsletter-list .newsletter-table {
  font-size: 0.9rem;
}

.admin-newsletter-list .newsletter-table td,
.admin-newsletter-list .newsletter-table th {
  padding: 12px;
}

.admin-newsletter-list .newsletter-title-link {
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
}
.admin-newsletter-list .newsletter-title-link:hover {
  color: var(--accent);
  text-decoration: underline;
}

.status {
  font-size: 0.85rem;
  padding: 2px 8px;
  border-radius: 6px;
}

.status-draft {
  background: var(--accent-soft);
  color: var(--accent);
}

.status-sent {
  background: #dcfce7;
  color: var(--success);
}

.link-back {
  color: var(--accent);
  font-size: 0.95rem;
}

.link-back:hover {
  text-decoration: underline;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: #0d9488;
  color: #fff;
}

.table-selector {
  margin-bottom: 32px;
}

.table-selector label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text);
}

.table-selector select {
  width: 100%;
  max-width: 400px;
  padding: 10px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.95rem;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}

.table-info {
  margin-bottom: 24px;
}

.table-info h2 {
  margin: 0 0 8px 0;
  font-size: 1.5rem;
  color: var(--text);
}

.table-stats {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0;
}

.table-wrapper {
  overflow-x: auto;
  margin-bottom: 24px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.data-table th {
  background: var(--accent-soft);
  padding: 12px;
  text-align: left;
  font-weight: 600;
  color: var(--accent);
  border-bottom: 2px solid var(--accent);
  position: sticky;
  top: 0;
}

.data-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}

.data-table tr:hover {
  background: var(--accent-soft);
}

.null-value {
  color: var(--muted);
  font-style: italic;
}

.truncated {
  display: block;
  max-width: 300px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.data-table pre {
  margin: 0;
  font-size: 0.85rem;
  max-width: 400px;
  overflow-x: auto;
  background: #f8f9fa;
  padding: 4px 8px;
  border-radius: 4px;
}

.data-table-editable .cell-input {
  width: 100%;
  min-width: 80px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.9rem;
  font-family: inherit;
}

.data-table-editable .cell-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(15, 118, 110, 0.2);
}

.data-table-editable .cell-input-json {
  min-height: 48px;
  font-family: ui-monospace, monospace;
  font-size: 0.8rem;
}

.data-table-editable .pk-value {
  color: var(--muted);
  font-size: 0.85rem;
}

.data-table-editable .row-view-mode .cell-value {
  display: block;
}

.data-table-editable .row-view-mode .cell-input {
  display: none;
}

.data-table-editable .row-view-mode .edit-row-btn {
  display: inline-block;
}

.data-table-editable .row-view-mode .row-save-form {
  display: none;
}

.data-table-editable .row-edit-mode .cell-value {
  display: none;
}

.data-table-editable .row-edit-mode .cell-input {
  display: block;
}

.data-table-editable .row-edit-mode .edit-row-btn {
  display: none;
}

.data-table-editable .row-edit-mode .row-save-form {
  display: inline;
}

.data-table-editable .row-actions {
  white-space: nowrap;
  vertical-align: middle;
}

.data-table-editable .row-actions form {
  display: inline;
  margin-right: 8px;
}

.data-table-editable .row-actions form:last-of-type {
  margin-right: 0;
}

.btn-small {
  padding: 6px 12px;
  font-size: 0.8rem;
}

.btn-danger {
  background: var(--error);
  color: #fff;
}

.btn-danger:hover {
  background: #b91c1c;
  color: #fff;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 24px;
}

.page-info {
  color: var(--muted);
  font-size: 0.9rem;
}

.no-selection,
.no-data {
  text-align: center;
  padding: 48px;
  color: var(--muted);
}

@media (max-width: 768px) {
  .admin-db-inspector {
    padding: 20px;
  }
  
  .table-selector select {
    max-width: 100%;
  }
  
  .data-table {
    font-size: 0.8rem;
  }
  
@media (max-width: 600px) {
  .section.muted {
    padding: 40px 20px;
  }
  .hero {
    padding-top: 50px;
  }
  .feature-table th,
  .feature-table td {
    padding: 12px;
  }
  
  .account-settings {
    padding: 20px;
  }
  
  .info-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
}

/* Account Settings */
.account-settings {
  background: var(--surface);
  border-radius: 16px;
  padding: 32px;
  box-shadow: var(--shadow);
}

.settings-section {
  margin-bottom: 40px;
  padding-bottom: 40px;
  border-bottom: 1px solid var(--border);
}

.settings-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.settings-section h2 {
  margin: 0 0 24px 0;
  font-size: 1.3rem;
  color: var(--text);
}

.info-grid {
  display: grid;
  gap: 16px;
}

.info-item {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 20px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.info-item:last-child {
  border-bottom: none;
}

.info-label {
  font-weight: 600;
  color: var(--muted);
  font-size: 0.95rem;
  text-align: left;
}

.info-value {
  color: var(--text);
  font-size: 0.95rem;
}

@media (max-width: 768px) {
  .info-item {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  
  .info-label {
    text-align: left;
  }
}

/* Feedback form (visible when logged in) */
.feedback-form-section {
  margin-top: 8px;
  margin-bottom: 8px;
}

.feedback-form-section.section {
  padding-top: 12px;
  padding-bottom: 12px;
}

.feedback-form-card {
  max-width: 480px;
}

.feedback-form-trigger {
  width: 100%;
  justify-content: center;
}

.feedback-form-body {
  display: none;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.feedback-form-card.expanded .feedback-form-trigger {
  display: none;
}

.feedback-form-card.expanded .feedback-form-body {
  display: block;
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.feedback-form-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.feedback-form-intro {
  color: var(--muted);
  font-size: 0.95rem;
  margin: 0 0 16px;
}

.feedback-email-readonly {
  background: var(--bg);
  color: var(--muted);
  cursor: default;
}

/* Feedback form: consistent, attractive inputs */
.feedback-form label {
  display: grid;
  gap: 8px;
  font-weight: 500;
}

.feedback-form input,
.feedback-form select,
.feedback-form textarea {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font: inherit;
  font-size: 1rem;
  line-height: 1.5;
  min-height: 48px;
  box-sizing: border-box;
  background: var(--surface);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.feedback-form input[type="email"],
.feedback-form input[readonly] {
  height: 48px;
}

/* Product dropdown: content width, taller, rounded - use explicit class so it always applies */
.feedback-product-label {
  display: grid;
  gap: 8px;
  font-weight: 500;
}

.feedback-product-label .feedback-product-select,
.feedback-form .feedback-product-select,
.feedback-form-body .feedback-product-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  width: auto;
  min-width: 28ch;
  max-width: 100%;
  height: 52px;
  min-height: 52px;
  font-family: inherit;
  font-size: 1rem;
  line-height: 1.5;
  padding: 14px 40px 14px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  -webkit-border-radius: 12px;
  box-sizing: border-box;
  background-color: var(--surface);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%234b5563' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  cursor: pointer;
  overflow: hidden;
  justify-self: start;
}

.feedback-form input:focus,
.feedback-form select:focus,
.feedback-form textarea:focus,
.feedback-product-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.feedback-form textarea {
  resize: vertical;
  min-height: 80px;
  height: auto;
}

.feedback-form .form-optional {
  font-weight: 400;
  color: var(--muted);
  font-size: 0.9em;
}

.feedback-comment-label .feedback-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.feedback-comment-label .feedback-label-row .form-optional {
  order: 2;
}

.feedback-rating-label {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.feedback-stars {
  display: flex;
  gap: 6px;
  align-items: center;
}

/* Stars: ☆ in HTML; when .filled show ★ via ::after overlay */
.feedback-star {
  position: relative;
  display: inline-block;
  width: 2.75rem;
  height: 2.75rem;
  line-height: 2.75rem;
  text-align: center;
  cursor: pointer;
  padding: 0;
  font-size: 2.25rem;
  user-select: none;
  border: none;
  background: none;
  appearance: none;
  color: var(--border);
  transition: color 0.2s ease;
}

.feedback-star:hover:not(.filled) {
  color: #ca8a04;
}

.feedback-star.filled {
  color: transparent;
}

.feedback-star.filled::after {
  content: "★";
  position: absolute;
  left: 0;
  top: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #eab308;
  font-size: 2.25rem;
  line-height: 1;
  transition: color 0.2s ease;
}

.feedback-star:focus {
  outline: none;
}

.feedback-rating-hint {
  font-size: 0.85rem;
  color: var(--muted);
}

.feedback-rating-hint:empty {
  display: none;
}

/* Dashboard product menu – centered, larger, site theme with hover */
.main-content .dashboard-product-nav {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
  padding: 1.25rem 0 1.5rem;
  border-bottom: 1px solid var(--border);
}

.main-content .dashboard-product-nav a {
  padding: 0.65rem 1.35rem;
  border-radius: 8px;
  background: var(--surface);
  color: var(--accent);
  font-size: 1.1rem;
  font-weight: 600;
  border: 2px solid var(--accent);
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}

.main-content .dashboard-product-nav a:hover {
  background: var(--accent);
  color: var(--surface);
  border-color: var(--accent);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.main-content .dashboard-product-nav a:active {
  transform: translateY(0);
}

.dashboard-default {
  margin-top: 0;
}

/* Dashboard market news layout: 3 featured cards on top, full-width list below */
.dashboard-sections {
  display: block;
  width: 100%;
}
.dashboard-sections .section {
  width: 100%;
  max-width: 100%;
}
#market-news .card {
  width: 100% !important;
  max-width: none !important;
}
#market-news .market-news-featured {
  width: 100% !important;
  max-width: none !important;
  margin-bottom: 16px;
  border-collapse: separate;
  border-spacing: 14px 0;
  table-layout: fixed;
}
#market-news .market-news-featured .news-featured-cell {
  width: 33.33%;
  vertical-align: top;
  padding: 0;
}
#market-news .market-news-featured .news-featured-card-wrap {
  min-width: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
}
#market-news .market-news-featured .news-featured-cell .market-news-card {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
#market-news .market-news-featured .news-featured-cell .market-news-card .market-news-card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
}
#market-news .market-news-featured .news-featured-cell .news-summary-toggle {
  margin-top: auto;
  padding-top: 6px;
}
#market-news .market-news-featured .news-featured-cell > a.market-news-card {
  min-width: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
}
#market-news .market-news-list {
  width: 100% !important;
  max-width: none !important;
}
#market-news .market-news-list li {
  width: 100% !important;
}
@media (max-width: 640px) {
  #market-news .market-news-featured,
  #market-news .market-news-featured tbody,
  #market-news .market-news-featured tr {
    display: block !important;
  }
  #market-news .market-news-featured .news-featured-cell {
    display: block !important;
    width: 100% !important;
    margin-bottom: 14px;
  }
  #market-news .market-news-featured .news-featured-cell:last-child {
    margin-bottom: 0;
  }
  #market-news .market-news-featured {
    border-spacing: 0;
  }
}

.product-page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
  width: 100%;
}

.product-page-header .back-to-dashboard {
  flex-shrink: 0;
  align-self: center;
  font-size: 0.95rem;
  color: var(--accent);
  text-decoration: none;
}

.product-page-header .back-to-dashboard:hover {
  text-decoration: underline;
}

.back-to-dashboard {
  margin: 0 0 1rem;
  font-size: 0.95rem;
}

.back-to-dashboard a {
  color: var(--accent);
  text-decoration: none;
}

.back-to-dashboard a:hover {
  text-decoration: underline;
}

/* Market Scanner (delayed data, informational only) */
.scanner-disclosure {
  background: var(--accent-soft);
  border-left: 4px solid var(--accent);
}

.scanner-disclosure-text {
  margin: 0 0 0.5rem;
  font-size: 0.95rem;
}

.scanner-meta {
  margin: 0;
  font-size: 0.875rem;
  color: var(--muted);
}

.scanner-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.scanner-controls h3 {
  margin: 0;
}

.scanner-lookback-nav {
  display: flex;
  gap: 0.5rem;
}

.scanner-lookback-nav a {
  padding: 0.4rem 0.75rem;
  border-radius: 6px;
  background: var(--border);
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 500;
}

.scanner-lookback-nav a:hover {
  background: var(--muted);
  color: var(--surface);
}

.scanner-lookback-nav a.active {
  background: var(--accent);
  color: var(--surface);
}

.scanner-direction {
  text-transform: capitalize;
  font-weight: 500;
}

.scanner-direction.scanner-up {
  color: var(--confidence-high);
}

.scanner-direction.scanner-down {
  color: var(--confidence-low);
}

.scanner-direction.scanner-flat {
  color: var(--muted);
}

/* Dashboard: Top movers – 2 rows × 5 columns */
.top-movers-grid {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: 16px;
}
.top-movers-col {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  grid-template-rows: auto auto;
  gap: 10px 12px;
}
.top-movers-heading {
  grid-column: 1 / -1;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-align: center;
  padding: 6px 12px;
  border-radius: 999px;
}
.top-movers-heading.top-movers-gainers {
  color: #15803d;
  background: rgba(22, 163, 74, 0.08);
}
.top-movers-heading.top-movers-losers {
  color: #b91c1c;
  background: rgba(185, 28, 28, 0.08);
}
.top-movers-cell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 12px 16px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: 0 2px 8px rgba(15, 118, 110, 0.04);
  text-decoration: none;
  color: inherit;
  font-size: 0.9rem;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}
a.top-movers-cell:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(15, 118, 110, 0.08);
  border-color: var(--accent);
}
.top-movers-cell.top-movers-empty {
  color: var(--muted);
  cursor: default;
  background: rgba(75, 85, 99, 0.04);
  border-style: dashed;
  box-shadow: none;
}
.top-movers-cell.top-movers-empty:hover {
  transform: none;
}
.top-movers-symbol {
  font-weight: 700;
  font-size: 1rem;
  color: var(--accent);
  min-width: 52px;
}
a.top-movers-cell:hover .top-movers-symbol {
  text-decoration: underline;
}
.top-movers-stats {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}
.top-movers-stats .pct-change {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.top-movers-price {
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 500;
}
@media (max-width: 640px) {
  .top-movers-col {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 380px) {
  .top-movers-col {
    grid-template-columns: 1fr;
  }
}

/* CSV Import Modal - direct child of body, high z-index to stay above all content */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.4);
  padding: 1rem;
}
.modal-overlay--closed {
  display: none !important;
}
.modal-dialog {
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
}
.modal-content {
  background: var(--surface);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
}
.modal-title {
  margin: 0 0 0.5rem;
  font-size: 1.25rem;
  font-weight: 600;
}
.modal-subtitle {
  margin: 0 0 1.25rem;
  font-size: 0.95rem;
  color: var(--muted);
}
.modal-footnote {
  margin: 1rem 0 0;
  font-size: 0.8rem;
  color: var(--muted);
}
.modal-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.25rem;
  flex-wrap: wrap;
}
.csv-import-loading-panel .ticker-loading-intro {
  color: var(--muted);
  font-size: 0.95rem;
}
.csv-import-loading-panel .ticker-step {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
}
.csv-import-loading-panel .ticker-step:last-child {
  border-bottom: none;
}
.csv-import-loading-panel .ticker-step-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  font-weight: 700;
  color: var(--muted);
}
.csv-import-loading-panel .ticker-step-loading .ticker-step-icon {
  width: 20px;
  height: 20px;
  border: 2px solid var(--accent);
  border-top-color: transparent;
  border-radius: 50%;
  animation: ticker-step-spin 0.8s linear infinite;
}
.csv-import-loading-panel .ticker-step-done .ticker-step-icon {
  color: var(--success);
  font-size: 1.1rem;
}
.csv-import-loading-panel .ticker-step-error .ticker-step-icon {
  color: var(--error);
}

.holding-cash-badge {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--muted);
}
.holding-category-badge {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--muted);
  margin-left: 0.35em;
  opacity: 0.9;
}
.holding-option-badge {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--muted);
  margin-left: 0.35em;
  opacity: 0.9;
}

.csv-import-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.csv-import-dropzone {
  position: relative;
  border: 2px dashed var(--border);
  border-radius: 10px;
  padding: 2rem;
  text-align: center;
  background: var(--bg);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.csv-import-dropzone:hover,
.csv-import-dropzone.drag-over {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.csv-import-file-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}
.csv-import-dropzone-content {
  pointer-events: none;
  color: var(--muted);
  font-size: 0.95rem;
}
.csv-import-dropzone-icon {
  display: block;
  font-size: 2rem;
  margin-bottom: 0.5rem;
}
.csv-import-label {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 0.25rem;
}
.csv-import-input {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
}
.csv-import-error {
  color: var(--error);
  font-size: 0.9rem;
  padding: 0.5rem 0;
}
.csv-import-helper {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 0.25rem;
}
/* Import from CSV button - match Add ticker / ghost button styling */
#csv-import-btn,
button.csv-import-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid var(--accent);
  background: transparent;
  color: var(--accent);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
  -webkit-appearance: none;
  appearance: none;
}
#csv-import-btn:hover,
button.csv-import-btn:hover {
  background: var(--accent-soft);
  color: var(--accent);
  transform: translateY(-1px);
}
/* Toast */
.toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  padding: 0.75rem 1.5rem;
  background: var(--text);
  color: var(--surface);
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 500;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  animation: toast-in 0.3s ease;
}
@keyframes toast-in {
  from { opacity: 0; transform: translateX(-50%) translateY(10px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}
/* Snapshot cards */
.snapshot-cards {
  display: grid;
  gap: 1rem;
  margin-top: 1rem;
}
.snapshot-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem 1.25rem;
}
.snapshot-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}
.snapshot-card-title {
  font-weight: 600;
  font-size: 1rem;
  margin: 0;
}
.snapshot-card-meta {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0;
}
.snapshot-card-totals {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 0.9rem;
  margin-top: 0.5rem;
}
.snapshot-card-totals span {
  color: var(--muted);
}
