/* BullBD Version2 — mobile-first design system */
:root {
  --bg: #f3f6f3;
  --bg-elevated: #ffffff;
  --ink: #10241c;
  --ink-muted: #5a6f64;
  --forest: #0b3d2e;
  --forest-mid: #145c44;
  --mint: #1faa74;
  --mint-soft: rgba(31, 170, 116, 0.12);
  --coral: #d64545;
  --coral-soft: rgba(214, 69, 69, 0.12);
  --flat: #7a8a82;
  --amber: #d4a017;
  --amber-soft: rgba(212, 160, 23, 0.14);
  --line: rgba(16, 36, 28, 0.1);
  --shadow: 0 10px 30px rgba(11, 61, 46, 0.08);
  --radius: 14px;
  --radius-sm: 10px;
  --nav-h: 64px;
  --header-h: 56px;
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Outfit", system-ui, sans-serif;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(1200px 420px at 10% -10%, rgba(31, 170, 116, 0.18), transparent 55%),
    radial-gradient(900px 380px at 100% 0%, rgba(11, 61, 46, 0.12), transparent 50%),
    linear-gradient(180deg, #e8efe9 0%, var(--bg) 28%, #eef2ee 100%);
  background-attachment: fixed;
  padding-bottom: calc(var(--nav-h) + var(--safe-bottom) + 12px);
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}

img {
  max-width: 100%;
  display: block;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--header-h);
  backdrop-filter: blur(12px);
  background: linear-gradient(180deg, rgba(11, 61, 46, 0.96), rgba(11, 61, 46, 0.9));
  color: #f4faf6;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.site-header__inner {
  max-width: 720px;
  margin: 0 auto;
  height: 100%;
  padding: 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none !important;
}

.brand__mark {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background:
    linear-gradient(135deg, #2dd4a0 0%, #145c44 55%, #0b3d2e 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25), 0 4px 12px rgba(0, 0, 0, 0.25);
  position: relative;
}

.brand__mark::after {
  content: "";
  position: absolute;
  inset: 7px 6px 7px 12px;
  border-right: 2px solid rgba(255, 255, 255, 0.9);
  border-bottom: 2px solid rgba(255, 255, 255, 0.9);
  transform: skewX(-12deg);
}

.brand__text {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}

.brand__name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

.brand__tag {
  font-size: 0.68rem;
  opacity: 0.75;
  font-weight: 500;
}

.header-link {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 5px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #e8f5ee;
  text-decoration: none !important;
  white-space: nowrap;
}

.header-links {
  display: flex;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: min(62vw, 280px);
  scrollbar-width: none;
}

.header-links::-webkit-scrollbar {
  display: none;
}

@media (min-width: 480px) {
  .header-links {
    max-width: none;
    gap: 6px;
  }

  .header-link {
    font-size: 0.78rem;
    padding: 6px 10px;
  }
}

.page {
  max-width: 720px;
  margin: 0 auto;
  padding: 12px 12px 24px;
}

.hero-panel {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  background:
    linear-gradient(145deg, rgba(11, 61, 46, 0.96), rgba(20, 92, 68, 0.92)),
    repeating-linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.03) 0 1px,
      transparent 1px 18px
    );
  color: #f3faf6;
  box-shadow: var(--shadow);
  padding: 14px 14px 12px;
  margin-bottom: 12px;
}

.hero-panel::before {
  content: "";
  position: absolute;
  width: 180px;
  height: 180px;
  right: -40px;
  top: -50px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(45, 212, 160, 0.35), transparent 70%);
  pointer-events: none;
}

.hero-panel__top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  position: relative;
  z-index: 1;
}

.hero-kicker {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.7;
  font-weight: 600;
  margin: 0 0 4px;
}

.hero-title {
  font-family: var(--font-display);
  font-size: 1.55rem;
  margin: 0;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.hero-updated {
  font-size: 0.72rem;
  opacity: 0.75;
  margin-top: 6px;
}

.hero-change {
  text-align: right;
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1.25;
}

.hero-change.is-up { color: #7dffc4; }
.hero-change.is-down { color: #ffb4b4; }
.hero-change.is-flat { color: #d5e4dc; }

.hero-metrics {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 14px;
}

.metric {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  padding: 8px 8px 7px;
  text-align: center;
}

.metric__label {
  display: block;
  font-size: 0.65rem;
  opacity: 0.7;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.metric__value {
  display: block;
  font-weight: 700;
  font-size: 0.92rem;
  margin-top: 2px;
}

.breadth {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 10px;
}

.breadth__item {
  font-size: 0.78rem;
  font-weight: 600;
  text-align: center;
  padding: 6px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.15);
}

.breadth__item.is-up { color: #7dffc4; }
.breadth__item.is-down { color: #ffb4b4; }
.breadth__item.is-flat { color: #d5e4dc; }

#dsex-chart {
  position: relative;
  z-index: 1;
  height: 160px;
  margin-top: 12px;
  border-radius: 10px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.18);
}

.panel {
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 12px;
  overflow: hidden;
}

.panel__head {
  padding: 12px 12px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.panel__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}

.filters {
  padding: 0 10px 10px;
}

.filter-row {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 6px;
  scrollbar-width: none;
}

.filter-row::-webkit-scrollbar {
  display: none;
}

.chip {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #f7faf7;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--forest);
  text-decoration: none !important;
}

.chip.is-active,
.chip:hover {
  background: var(--forest);
  border-color: var(--forest);
  color: #fff;
}

.chip--sector {
  font-size: 0.72rem;
  max-width: 140px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fav-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px 10px;
  font-size: 0.82rem;
}

.fav-toolbar label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-weight: 500;
}

.fav-count {
  display: none;
  font-size: 0.72rem;
  font-weight: 700;
  color: #8a6500;
  background: var(--amber-soft);
  padding: 3px 8px;
  border-radius: 999px;
}

.quote-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.quote-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.82rem;
  min-width: 360px;
}

.quote-table thead th {
  position: sticky;
  top: 0;
  background: #f0f5f1;
  z-index: 3;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-muted);
  font-weight: 700;
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.quote-table thead th a {
  color: inherit;
  text-decoration: none;
}

.quote-table thead th.is-sorted a {
  color: var(--forest);
}

.quote-table tbody td {
  padding: 11px 8px;
  border-bottom: 1px solid rgba(16, 36, 28, 0.06);
  vertical-align: middle;
  font-weight: 600;
}

.quote-table tbody tr:active {
  background: rgba(11, 61, 46, 0.04);
}

.quote-table tbody tr.row-fav {
  background: var(--amber-soft);
}

.quote-table .col-fav { width: 36px; text-align: center; }
.quote-table .col-pos { width: 28px; text-align: center; color: var(--ink-muted); font-weight: 500; }
.quote-table .col-num { text-align: right; font-variant-numeric: tabular-nums; }

.is-up { color: var(--mint); }
.is-down { color: var(--coral); }
.is-flat { color: var(--flat); }

.code-link {
  font-weight: 700;
  letter-spacing: 0.01em;
}

.fav-btn {
  appearance: none;
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 1.15rem;
  line-height: 1;
  padding: 4px;
  color: var(--flat);
}

.fav-btn.fav-active {
  color: var(--amber);
}

.empty-state {
  padding: 28px 16px;
  text-align: center;
  color: var(--ink-muted);
}

.stub-card {
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px 18px;
  box-shadow: var(--shadow);
  text-align: center;
}

.stub-card h1 {
  font-family: var(--font-display);
  margin: 0 0 8px;
  font-size: 1.4rem;
}

.stub-card p {
  margin: 0 0 16px;
  color: var(--ink-muted);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 999px;
  border: 0;
  background: var(--forest);
  color: #fff;
  font-weight: 600;
  font-family: var(--font-body);
  text-decoration: none !important;
}

.ad-slot {
  max-width: 720px;
  margin: 12px auto;
  min-height: 90px;
  overflow: hidden;
  text-align: center;
}

.ad-slot--mid {
  margin: 10px auto 14px;
}

.ad-slot--footer {
  margin: 16px auto 8px;
}

.site-footer {
  max-width: 720px;
  margin: 8px auto 0;
  padding: 8px 16px 20px;
  text-align: center;
  color: var(--ink-muted);
}

.site-footer__brand {
  margin: 0;
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--forest);
}

.site-footer__note {
  margin: 4px 0 0;
  font-size: 0.72rem;
}

.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  height: calc(var(--nav-h) + var(--safe-bottom));
  padding: 6px 8px var(--safe-bottom);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
  box-shadow: 0 -8px 24px rgba(11, 61, 46, 0.06);
}

.bottom-nav__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--ink-muted);
  text-decoration: none !important;
  border-radius: 12px;
  min-height: 48px;
}

.bottom-nav__item.is-active {
  color: var(--forest);
  background: var(--mint-soft);
}

.bottom-nav__icon {
  font-size: 1rem;
  line-height: 1;
}

@media (min-width: 640px) {
  .page {
    padding-top: 18px;
  }

  .hero-title {
    font-size: 1.85rem;
  }

  #dsex-chart {
    height: 200px;
  }

  .quote-table {
    font-size: 0.88rem;
  }
}

@keyframes fade-up {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero-panel,
.panel {
  animation: fade-up 0.45s ease both;
}

.panel {
  animation-delay: 0.08s;
}

/* ===== Company details (Feature 2) ===== */
.company-hero {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  background:
    linear-gradient(145deg, rgba(11, 61, 46, 0.96), rgba(20, 92, 68, 0.9));
  color: #f3faf6;
  padding: 14px 14px 16px;
  margin-bottom: 10px;
  box-shadow: var(--shadow);
}

.company-hero.is-up {
  background: linear-gradient(145deg, #0b3d2e, #147a52);
}
.company-hero.is-down {
  background: linear-gradient(145deg, #3d1a1a, #7a2e2e);
}
.company-hero.is-flat {
  background: linear-gradient(145deg, #1e2e28, #355248);
}

.company-hero__top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.back-link {
  font-size: 0.78rem;
  font-weight: 600;
  color: rgba(243, 250, 246, 0.85);
  text-decoration: none !important;
  padding: 4px 0;
}

.company-fav {
  color: rgba(255, 255, 255, 0.75) !important;
  font-size: 1.35rem !important;
}
.company-fav.fav-active {
  color: #f5c542 !important;
}

.company-hero .hero-title {
  font-size: 1.7rem;
}

.company-hero__name {
  margin: 4px 0 0;
  font-size: 0.88rem;
  opacity: 0.82;
  font-weight: 500;
}

.company-hero__price {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px;
}

.company-hero__ltp {
  font-family: var(--font-display);
  font-size: 1.65rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.company-hero__chg {
  font-weight: 700;
  font-size: 0.95rem;
  opacity: 0.92;
}

.full-detail-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 12px;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: #f3faf6;
  font-size: 0.8rem;
  font-weight: 700;
  text-decoration: none !important;
  position: relative;
  z-index: 1;
}

.full-detail-btn:hover {
  background: rgba(255, 255, 255, 0.24);
}

.share-tools {
  display: none;
}

.code-rail {
  margin: 0 0 8px;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--line);
}

.code-rail__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 6px;
  font-size: 0.78rem;
  line-height: 1.35;
}

.code-rail__row--sec {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid rgba(16, 36, 28, 0.08);
}

.code-rail__code {
  font-weight: 800;
  color: var(--forest);
  text-decoration: none !important;
  letter-spacing: 0.01em;
}

.code-rail__arrows {
  font-weight: 800;
  color: var(--forest);
  margin-right: 2px;
}

.code-rail__links {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0;
  min-width: 0;
}

.code-rail__pipe {
  margin: 0 5px;
  color: rgba(16, 36, 28, 0.25);
  font-weight: 400;
}

.code-rail__link {
  color: #c43c3c;
  font-weight: 700;
  text-decoration: none !important;
}

.code-rail__link:active {
  opacity: 0.75;
}

.code-rail__link.is-active {
  color: var(--forest);
  pointer-events: none;
}

.code-rail__jump {
  appearance: none;
  margin-left: auto;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid rgba(11, 61, 46, 0.18);
  background: rgba(11, 61, 46, 0.06);
  color: var(--forest);
  font-family: inherit;
  font-size: 0.7rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.company-hero .hero-title a {
  color: inherit;
  text-decoration: none !important;
}

.tab-bar {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding: 2px 2px 10px;
  margin: 0 -2px 4px;
  scrollbar-width: none;
}
.tab-bar::-webkit-scrollbar { display: none; }

.tab-bar__item {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.85);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--forest);
  display: inline-flex;
  align-items: center;
  text-decoration: none !important;
}
.tab-bar__item.is-active {
  background: var(--forest);
  border-color: var(--forest);
  color: #fff;
}

.company-panel .panel__body {
  padding: 12px;
}

.kv-list__meta {
  font-size: 0.72rem;
  color: var(--ink-muted);
  margin-bottom: 12px;
  font-weight: 500;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}

.stat-card {
  background: #f4f8f5;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px;
}
.stat-card.is-up { background: var(--mint-soft); }
.stat-card.is-down { background: var(--coral-soft); }

.stat-card__label {
  display: block;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-muted);
  font-weight: 700;
}
.stat-card__value {
  display: block;
  margin-top: 4px;
  font-weight: 700;
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
}
.stat-card__value small {
  font-size: 0.75rem;
  font-weight: 600;
  opacity: 0.8;
}

.stat-tip {
  display: block;
  margin-top: 4px;
  font-size: 0.68rem;
  font-weight: 500;
  line-height: 1.3;
  color: var(--ink-muted);
}

.stat-tip--block {
  margin: 8px 0 0;
  padding: 0 2px;
}

.status-strip {
  margin: 8px 0 6px;
  padding: 6px 10px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.company-hero .status-strip.is-up,
.company-hero .status-strip.is-down,
.company-hero .status-strip.is-flat {
  color: inherit;
}

.status-strip__title {
  display: block;
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.status-strip__detail {
  display: block;
  margin-top: 2px;
  font-size: 0.7rem;
  font-weight: 500;
  opacity: 1;
}

.company-hero .status-strip.is-up {
  background: rgba(0, 0, 0, 0.2);
  border-color: rgba(125, 255, 196, 0.28);
}

.company-hero .status-strip.is-up .status-strip__title {
  color: #9dffd0;
}

.company-hero .status-strip.is-up .status-strip__detail {
  color: rgba(243, 250, 246, 0.72);
}

.company-hero .status-strip.is-down {
  background: rgba(0, 0, 0, 0.2);
  border-color: rgba(255, 180, 180, 0.28);
}

.company-hero .status-strip.is-down .status-strip__title {
  color: #ffc9c9;
}

.company-hero .status-strip.is-down .status-strip__detail {
  color: rgba(243, 250, 246, 0.72);
}

.company-hero .status-strip.is-flat {
  background: rgba(0, 0, 0, 0.2);
  border-color: rgba(255, 255, 255, 0.16);
}

.company-hero .status-strip.is-flat .status-strip__title {
  color: #e2ece6;
}

.company-hero .status-strip.is-flat .status-strip__detail {
  color: rgba(243, 250, 246, 0.72);
}

.day-range {
  margin: 12px 0 14px;
  padding: 10px 10px 12px;
  border-radius: var(--radius-sm);
  background: rgba(11, 61, 46, 0.04);
  border: 1px solid var(--line);
}

.day-range__labels {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 0.7rem;
  color: var(--ink-muted);
  line-height: 1.25;
}

.day-range__labels strong {
  color: var(--ink);
  font-size: 0.85rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.day-range__mid {
  text-align: center;
  flex: 1;
  font-weight: 600;
  color: var(--forest-mid);
}

.day-range__right {
  text-align: right;
}

.day-range__track {
  position: relative;
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(214, 69, 69, 0.25), rgba(122, 138, 130, 0.2), rgba(31, 170, 116, 0.35));
}

.day-range__dot {
  position: absolute;
  top: 50%;
  width: 16px;
  height: 16px;
  margin-left: -8px;
  margin-top: -8px;
  border-radius: 50%;
  background: var(--forest);
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(16, 36, 28, 0.35);
}

.day-range__dot.is-up { background: var(--mint); }
.day-range__dot.is-down { background: var(--coral); }
.day-range__dot.is-flat { background: var(--flat); }

.stat-grid--extra {
  margin-top: 10px;
}

.company-extras {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 10px 0 4px;
}

.company-extras__panel .panel__head--compact a {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--forest-mid);
  text-decoration: none !important;
}

.extra-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.extra-list li {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(16, 36, 28, 0.06);
  font-size: 0.82rem;
}

.extra-list li:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.extra-list strong {
  color: var(--forest);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.company-extras__news .news-card {
  margin-bottom: 8px;
}

.company-extras__news .news-card:last-child {
  margin-bottom: 0;
}

.kv {
  margin: 0;
  display: grid;
  gap: 0;
}
.kv > div {
  display: grid;
  grid-template-columns: 42% 1fr;
  gap: 8px;
  padding: 10px 2px;
  border-bottom: 1px solid rgba(16, 36, 28, 0.07);
  font-size: 0.86rem;
}
.kv dt {
  margin: 0;
  color: var(--ink-muted);
  font-weight: 500;
}
.kv dd {
  margin: 0;
  font-weight: 650;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.section-title {
  margin: 18px 0 10px;
  font-family: var(--font-display);
  font-size: 1.02rem;
  letter-spacing: -0.02em;
  color: var(--forest);
}

.profile-block {
  margin-bottom: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: linear-gradient(120deg, rgba(11, 61, 46, 0.06), rgba(31, 170, 116, 0.08));
  border: 1px solid var(--line);
}
.profile-block__name {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.05rem;
}
.profile-block__meta {
  margin: 4px 0 0;
  font-size: 0.78rem;
  color: var(--ink-muted);
  font-weight: 500;
}

.data-block + .data-block {
  margin-top: 8px;
  padding-top: 4px;
  border-top: 1px solid var(--line);
}

/* ===== Money tab (financial) ===== */
.money-tab {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.money-intro {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.4;
  color: var(--ink-muted);
  font-weight: 500;
}

.money-jump {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  margin: 0 -2px;
  padding-bottom: 2px;
}

.money-jump::-webkit-scrollbar { display: none; }

.money-jump a {
  flex: 0 0 auto;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(11, 61, 46, 0.06);
  border: 1px solid rgba(11, 61, 46, 0.12);
  color: var(--forest);
  font-size: 0.72rem;
  font-weight: 700;
  text-decoration: none !important;
  display: inline-flex;
  align-items: center;
}

.money-snap {
  margin: 0;
}

.money-block {
  padding: 10px;
  border-radius: var(--radius-sm);
  background: rgba(11, 61, 46, 0.03);
  border: 1px solid var(--line);
  scroll-margin-top: calc(var(--header-h) + 8px);
}

.money-block__head {
  margin-bottom: 8px;
}

.money-block__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1rem;
  letter-spacing: -0.02em;
  color: var(--forest);
}

.money-block__tip {
  margin: 2px 0 0;
  font-size: 0.7rem;
  color: var(--ink-muted);
  font-weight: 500;
  line-height: 1.35;
}

.money-empty {
  margin: 0;
  padding: 10px 4px;
  color: var(--ink-muted);
  font-size: 0.82rem;
}

.div-cards {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.div-card {
  padding: 10px;
  border-radius: 10px;
  background: var(--bg-elevated);
  border: 1px solid rgba(16, 36, 28, 0.08);
}

.div-card.is-latest {
  border-color: rgba(11, 61, 46, 0.22);
  box-shadow: 0 4px 14px rgba(11, 61, 46, 0.06);
}

.div-card__year {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 6px;
}

.div-card__vals {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.div-card__vals span {
  display: block;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-muted);
  font-weight: 700;
}

.div-card__vals strong {
  display: block;
  margin-top: 2px;
  font-size: 1.05rem;
  font-variant-numeric: tabular-nums;
  color: var(--forest);
}

.div-card__meta {
  margin-top: 8px;
  font-size: 0.7rem;
  color: var(--ink-muted);
  font-weight: 500;
}

.money-more {
  margin-top: 8px;
}

.money-more summary {
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--forest-mid);
  padding: 6px 2px;
  list-style: none;
}

.money-more summary::-webkit-details-marker { display: none; }

.money-more summary::before {
  content: "▸ ";
}

.money-more[open] summary::before {
  content: "▾ ";
}

.data-table--money {
  min-width: 0;
  font-size: 0.76rem;
}

.data-table--money th,
.data-table--money td {
  padding: 7px 6px;
}

.data-table--money tr.is-latest-row td {
  background: rgba(31, 170, 116, 0.08);
}

.fy-group + .fy-group {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(16, 36, 28, 0.08);
}

.fy-group__title {
  margin: 0 0 6px;
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--ink);
}

.data-table--qtr {
  min-width: 480px;
}

.data-table--qtr .is-up {
  color: var(--mint);
  font-weight: 700;
}

.data-table--qtr .is-down {
  color: var(--coral);
  font-weight: 700;
}

.data-table--hold {
  min-width: 420px;
}

.hold-cell {
  vertical-align: top;
}

.hold-cell__pct {
  display: block;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  line-height: 1.2;
}

.hold-badge {
  display: inline-flex;
  align-items: center;
  margin-top: 3px;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 0.62rem;
  font-weight: 700;
  line-height: 1.3;
  white-space: nowrap;
}

.hold-badge--green {
  background: #e8f7ee;
  border: 1px solid #c6eed8;
  color: #18794e;
}

.hold-badge--red {
  background: #fdeaea;
  border: 1px solid #f8caca;
  color: #b42318;
}

.hold-badge--gray {
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  color: #374151;
}

.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0 -4px;
  padding: 0 4px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
  min-width: 320px;
}
.data-table th,
.data-table td {
  padding: 9px 8px;
  border-bottom: 1px solid rgba(16, 36, 28, 0.07);
  text-align: left;
  font-weight: 600;
  white-space: nowrap;
}
.data-table th {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-muted);
  background: #f0f5f1;
}
.data-table .num,
.data-table th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.pill {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--mint-soft);
  color: var(--forest-mid);
  font-size: 0.65rem;
  font-weight: 700;
}

.muted {
  color: var(--ink-muted);
  font-size: 0.82rem;
}
.note {
  margin: 10px 2px 0;
  font-size: 0.72rem;
}

.company-jump {
  text-align: center;
  font-size: 0.78rem;
  color: var(--ink-muted);
  margin: 14px 0 0;
}

.depth-wrap {
  font-size: 0.8rem;
}
.depth-html {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 8px;
}
.depth-html table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.75rem;
}
.depth-html td,
.depth-html th {
  padding: 4px 6px;
  border: 1px solid rgba(16, 36, 28, 0.08);
}

@media (min-width: 640px) {
  .stat-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  .company-hero .hero-title {
    font-size: 2rem;
  }
}

/* ===== Charts (Feature 3) ===== */
.tab-bar__item--accent {
  border-color: rgba(31, 170, 116, 0.45);
  background: var(--mint-soft);
}

.chart-panel {
  overflow: hidden;
}

.chart-meta {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--ink-muted);
}

.chart-canvas {
  height: 320px;
  width: 100%;
  background:
    linear-gradient(180deg, #f7faf8 0%, #ffffff 40%);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.chart-note {
  padding: 0 12px 12px;
}

.sub-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 14px;
  margin: 14px 0 0;
  font-size: 0.8rem;
  font-weight: 600;
}

.sub-links a {
  color: var(--forest);
  text-decoration: none !important;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--line);
}

@media (min-width: 640px) {
  .chart-canvas {
    height: 380px;
  }
}

/* ===== News (Feature 4) ===== */
.news-hero {
  margin-bottom: 12px;
}

.news-feed {
  display: grid;
  gap: 10px;
}

.news-card {
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  animation: fade-up 0.4s ease both;
}

.news-card__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: linear-gradient(120deg, rgba(11, 61, 46, 0.08), rgba(31, 170, 116, 0.06));
  border-bottom: 1px solid var(--line);
}

.news-card__code {
  font-weight: 800;
  color: var(--forest);
  letter-spacing: 0.02em;
  text-decoration: none !important;
}

.news-card__date {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--ink-muted);
  white-space: nowrap;
}

.news-card__body {
  padding: 12px;
  font-size: 0.9rem;
  line-height: 1.45;
  font-weight: 500;
}

.news-card__body p {
  margin: 0;
}

.news-card__body p + p {
  margin-top: 8px;
}

.news-card__bn {
  color: var(--ink-muted);
  font-size: 0.86rem;
}

.news-card__foot {
  display: flex;
  gap: 12px;
  padding: 0 12px 12px;
  font-size: 0.75rem;
  font-weight: 700;
}

.news-card__foot a {
  color: var(--forest-mid);
  text-decoration: none !important;
}

.news-mark {
  background: rgba(212, 160, 23, 0.35);
  color: inherit;
  padding: 0 2px;
  border-radius: 3px;
}

.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 14px;
}

.pager__page {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ink-muted);
}

.btn--ghost {
  background: #fff;
  color: var(--forest);
  border: 1px solid var(--line);
  min-height: 38px;
  padding: 0 12px;
  font-size: 0.8rem;
}

.btn--ghost.is-disabled {
  opacity: 0.45;
  pointer-events: none;
}

/* ===== Movers / Gainers-Losers (Feature 5) ===== */
.movers-hero.is-up-tone {
  background:
    linear-gradient(145deg, rgba(11, 61, 46, 0.96), rgba(20, 122, 82, 0.92));
}
.movers-hero.is-down-tone {
  background:
    linear-gradient(145deg, rgba(61, 26, 26, 0.96), rgba(122, 46, 46, 0.9));
}

.movers-switch {
  display: inline-flex;
  gap: 4px;
  padding: 3px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.2);
  margin-bottom: 12px;
  position: relative;
  z-index: 1;
}

.movers-switch__btn {
  min-width: 88px;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 700;
  color: rgba(243, 250, 246, 0.75);
  text-decoration: none !important;
}

.movers-switch__btn.is-active {
  background: rgba(255, 255, 255, 0.95);
  color: var(--forest);
}

.movers-hero.is-down-tone .movers-switch__btn.is-active {
  color: #7a2e2e;
}

.movers-table .code-link {
  font-size: 0.9rem;
}

/* ===== Favorites / Recent (Feature 6) ===== */
.watch-switch {
  display: flex;
  gap: 6px;
  margin: 0 0 12px;
}

.watch-switch__btn {
  flex: 1;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.85);
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--forest);
  text-decoration: none !important;
}

.watch-switch__btn.is-active {
  background: var(--forest);
  border-color: var(--forest);
  color: #fff;
}

.watch-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 12px 12px 8px;
}

.sort-btn {
  appearance: none;
  border: 0;
  background: transparent;
  font: inherit;
  font-weight: 700;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: inherit;
  cursor: pointer;
  padding: 0;
}

.sort-btn.is-sorted {
  color: var(--forest);
}

.remove-link {
  color: var(--ink-muted);
  text-decoration: none !important;
  font-weight: 700;
  padding: 4px 6px;
}

.remove-link:hover {
  color: var(--coral);
}

#favTable .empty-state,
#recentTable + .empty-state {
  text-align: center;
}

/* ===== Upcoming events (Feature 7) ===== */
.site-header__inner {
  gap: 8px;
}

.site-header__inner .header-link + .header-link {
  margin-left: 0;
}

.filter-chip-note {
  margin: 0 0 10px;
  font-size: 0.8rem;
  color: var(--ink-muted);
  font-weight: 500;
}

.filter-chip-note a {
  color: var(--forest);
  font-weight: 700;
}

.events-feed {
  display: grid;
  gap: 16px;
}

.event-day__title {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 0.95rem;
  color: var(--forest);
  letter-spacing: -0.02em;
}

.event-card {
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 12px;
  margin-bottom: 8px;
}

.event-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.event-card__code {
  font-weight: 800;
  color: var(--forest);
  text-decoration: none !important;
  letter-spacing: 0.02em;
}

.event-card__type {
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 4px 8px;
  border-radius: 999px;
  background: #eef4f0;
  color: var(--forest-mid);
}

.event-card__type--agm { background: rgba(31, 170, 116, 0.15); }
.event-card__type--record { background: rgba(212, 160, 23, 0.18); color: #8a6500; }
.event-card__type--board { background: rgba(11, 61, 46, 0.1); }
.event-card__type--egm { background: rgba(214, 69, 69, 0.12); color: var(--coral); }
.event-card__type--dividend { background: rgba(31, 170, 116, 0.2); }

.event-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-top: 8px;
  font-size: 0.78rem;
  font-weight: 650;
  color: var(--ink-muted);
}

.event-card__details {
  margin-top: 8px;
  font-size: 0.84rem;
}

.event-card__details summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--forest);
  list-style: none;
}

.event-card__details summary::-webkit-details-marker {
  display: none;
}

.event-card__details p {
  margin: 8px 0 0;
  line-height: 1.45;
  color: var(--ink);
  font-weight: 500;
}

.event-card__foot {
  display: flex;
  gap: 12px;
  margin-top: 10px;
  font-size: 0.75rem;
  font-weight: 700;
}

.event-card__foot a {
  color: var(--forest-mid);
  text-decoration: none !important;
}

.ai-summary {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: rgba(11, 61, 46, 0.05);
  border: 1px solid var(--line);
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--ink-muted);
  font-weight: 500;
}

/* ===== Home dense list — maximize visible shares ===== */
.home-dense {
  --header-h: 48px;
  --quotes-head-h: 36px;
}

.home-dense .page {
  padding: 8px 8px 16px;
}

.home-dense .hero-panel {
  padding: 10px 10px 8px;
  margin-bottom: 8px;
  border-radius: 12px;
}

.home-dense .hero-title {
  font-size: 1.25rem;
}

.home-dense .hero-updated {
  margin-top: 2px;
  font-size: 0.65rem;
}

.home-dense .hero-metrics {
  margin-top: 8px;
  gap: 6px;
}

.home-dense .metric {
  padding: 5px 4px;
}

.home-dense .metric__label {
  font-size: 0.58rem;
}

.home-dense .metric__value {
  font-size: 0.78rem;
}

.home-dense .breadth {
  margin-top: 6px;
  gap: 6px;
}

.home-dense .breadth__item {
  padding: 4px;
  font-size: 0.7rem;
}

.home-dense #dsex-chart {
  height: 96px;
  margin-top: 8px;
}

.home-dense .panel {
  margin-bottom: 8px;
  border-radius: 12px;
}

.home-dense .panel--quotes {
  overflow: visible;
}

.home-dense .quote-table-wrap--dense {
  overflow: visible;
}

.home-dense .panel__head {
  padding: 8px 10px 4px;
}

.home-dense .panel__title {
  font-size: 0.92rem;
}

.home-dense .filters {
  padding: 0 8px 6px;
}

.home-dense .chip {
  min-width: 28px;
  height: 28px;
  padding: 0 8px;
  font-size: 0.72rem;
}

.home-dense .chip--sector {
  font-size: 0.66rem;
  max-width: 110px;
}

.home-dense .panel__head--compact {
  position: sticky;
  top: var(--header-h);
  z-index: 4;
  padding: 6px 10px;
  gap: 8px;
  background: var(--bg-elevated);
  border-bottom: 1px solid rgba(16, 36, 28, 0.06);
}

.home-dense .quotes-head-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--ink-muted);
}

.home-dense .fav-inline {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  color: var(--forest);
}

.home-dense .quote-table--dense {
  font-size: 0.72rem;
  min-width: 0;
}

.home-dense .quote-table--dense thead th {
  top: calc(var(--header-h) + var(--quotes-head-h));
  padding: 5px 6px;
  font-size: 0.62rem;
  letter-spacing: 0.03em;
  background: #f0f5f1;
}

.home-dense .quote-table--dense tbody td {
  padding: 3px 6px;
  line-height: 1.15;
  border-bottom-color: rgba(16, 36, 28, 0.05);
}

.home-dense .quote-table--dense .col-fav {
  width: 22px;
  padding-left: 4px;
  padding-right: 2px;
}

.home-dense .quote-table--dense .fav-btn {
  font-size: 0.85rem;
  padding: 0;
  min-width: 20px;
  min-height: 20px;
}

.home-dense .quote-table--dense .code-link {
  font-size: 0.74rem;
  letter-spacing: 0;
}

/* ===== Share search ===== */
.header-search-btn {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.1);
  color: #e8f5ee;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  flex: 0 0 auto;
}

.header-search-btn:hover {
  background: rgba(255, 255, 255, 0.18);
}

.search-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(10, 28, 20, 0.55);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 12px;
  padding-top: max(12px, env(safe-area-inset-top));
}

.search-overlay[hidden] {
  display: none !important;
}

body.search-open {
  overflow: hidden;
}

.search-sheet {
  width: min(520px, 100%);
  max-height: min(78dvh, 640px);
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  margin-top: 8px;
}

.search-sheet__bar {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 10px;
  border-bottom: 1px solid var(--line);
}

.search-input {
  flex: 1;
  min-width: 0;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0 12px;
  font: inherit;
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
  background: #f7faf7;
}

.search-input:focus {
  outline: 2px solid rgba(31, 170, 116, 0.35);
  border-color: var(--mint);
}

.search-close {
  appearance: none;
  border: 0;
  background: #eef2ef;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  font-size: 0.95rem;
  cursor: pointer;
  color: var(--ink-muted);
  font-weight: 700;
}

.search-hint {
  margin: 0;
  padding: 8px 12px 0;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--ink-muted);
}

.search-results {
  list-style: none;
  margin: 0;
  padding: 6px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.search-result {
  border-radius: 10px;
}

.search-result.is-active,
.search-result:hover {
  background: var(--mint-soft);
}

.search-result__link {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 4px 10px;
  align-items: center;
  padding: 10px;
  text-decoration: none !important;
  color: inherit;
}

.search-result__code {
  font-weight: 800;
  color: var(--forest);
  letter-spacing: 0.02em;
  font-size: 0.9rem;
}

.search-result__name {
  grid-column: 2 / 3;
  font-size: 0.78rem;
  color: var(--ink-muted);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-result__meta {
  grid-column: 3;
  grid-row: 1 / 3;
  font-size: 0.75rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

@media (max-width: 380px) {
  .search-result__link {
    grid-template-columns: 1fr auto;
  }
  .search-result__name {
    grid-column: 1;
  }
  .search-result__meta {
    grid-row: 1 / 3;
  }
}

.home-dense .site-footer {
  padding-top: 4px;
  padding-bottom: 8px;
}

.home-dense .site-footer__note {
  display: none;
}

@media (min-width: 640px) {
  .home-dense #dsex-chart {
    height: 120px;
  }

  .home-dense .quote-table--dense {
    font-size: 0.78rem;
  }

  .home-dense .quote-table--dense tbody td {
    padding: 4px 8px;
  }
}
