:root {
  --bg: #f6f8fb;
  --panel: #ffffff;
  --soft: #f3f6fa;
  --line: #e3e8ef;
  --text: #18253f;
  --muted: #66758f;
  --accent: #2d5bd1;
  --accent-dark: #2448a8;
  --success: #16a34a;
  --danger: #ef4444;
  --shadow: 0 2px 10px rgba(18, 37, 63, 0.04);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Be Vietnam Pro", sans-serif;
  color: var(--text);
  overflow-x: hidden;
  background: #f6f8fb;
}

.app-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 20px 0 32px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.domestic-strip,
.chart-card,
.board-card {
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.hero-card {
  background:
    radial-gradient(circle at top left, rgba(45, 91, 209, 0.12), transparent 34%),
    linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.hero-title {
  margin: 0;
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.08;
  letter-spacing: -0.04em;
}

.hero-description {
  margin: 12px 0 0;
  max-width: 880px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.7;
}

.hero-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.hero-chip {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 8px 14px;
  border: 1px solid rgba(45, 91, 209, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  color: #1d2f55;
  font-size: 14px;
  font-weight: 700;
}

.eyebrow {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.brand-title {
  margin: 0;
  line-height: 1.15;
  font-size: clamp(24px, 4vw, 34px);
}

.brand-block {
  min-width: 0;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.site-logo {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  object-fit: cover;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  background: #fff;
}

.topbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
}

.nav-btn,
.ghost-link {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px 16px;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.18s ease, background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease;
  background: #fff;
  color: var(--text);
}

.nav-btn:hover,
.ghost-link:hover {
  transform: translateY(-1px);
}

.page-stack {
  display: grid;
  gap: 12px;
}

.domestic-strip,
.board-card,
.chart-card {
  border-radius: 8px;
  padding: 18px;
}

.domestic-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

.domestic-copy {
  min-width: 0;
}

.domestic-metric {
  display: grid;
  justify-items: end;
  gap: 8px;
  text-align: right;
}

.domestic-title {
  margin: 0;
  font-size: clamp(26px, 4vw, 38px);
  line-height: 1.12;
  letter-spacing: -0.03em;
}

.domestic-date {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
}

.domestic-label {
  display: block;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}

.domestic-price-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.domestic-price {
  font-size: clamp(34px, 5vw, 48px);
  line-height: 1;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.04em;
}

.domestic-unit {
  font-size: clamp(18px, 2vw, 24px);
  font-weight: 700;
  color: #41506b;
}

.domestic-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  padding: 7px 12px;
  border-radius: 6px;
  color: #fff;
  font-size: 14px;
  font-weight: 800;
}

.up-badge {
  background: var(--success);
}

.down-badge {
  background: var(--danger);
}

.neutral-badge {
  background: #64748b;
}

.chart-card {
  overflow: hidden;
}

.tradingview-widget-container {
  margin-top: 18px;
  height: 64vh;
  min-height: 620px;
  position: relative;
}

.tradingview-widget-container__widget {
  height: 100%;
}

.chart-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92) 0%, rgba(247, 250, 255, 0.96) 100%),
    repeating-linear-gradient(-45deg, rgba(47, 99, 232, 0.05) 0 14px, rgba(47, 99, 232, 0.08) 14px 28px);
  color: var(--muted);
  font-weight: 700;
  text-align: center;
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
}

.section-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.section-head h3 {
  margin: 0;
  font-size: 18px;
  line-height: 1.2;
}

.table-capture-btn {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  border-radius: 8px;
  padding: 10px 12px;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.live-stamp {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.table-wrap {
  margin-top: 14px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.watermark-table {
  position: relative;
  isolation: isolate;
}

.watermark-table::after {
  content: attr(data-watermark);
  position: absolute;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%) rotate(-18deg);
  font-size: clamp(26px, 4vw, 56px);
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(24, 37, 63, 0.07);
  white-space: nowrap;
  pointer-events: none;
  z-index: 2;
}

.watermark-table table {
  position: relative;
  z-index: 1;
}

.market-status-line {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.market-status-line strong {
  color: var(--text);
}

.domestic-table-wrap {
  margin-top: 8px;
}

.pepper-card {
  background: linear-gradient(180deg, #ffffff 0%, #fbfefb 100%);
}

.pepper-head {
  align-items: flex-start;
}

.pepper-summary {
  margin: 10px 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  line-height: 1.7;
}

.pepper-summary strong {
  font-size: 22px;
  color: #0f172a;
}

.pepper-side {
  display: grid;
  gap: 12px;
  justify-items: end;
}

.pepper-select-wrap {
  display: grid;
  gap: 8px;
  min-width: 220px;
}

.pepper-select-wrap span {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.pepper-select {
  appearance: none;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #f2f8f2 100%);
  color: var(--text);
  font: inherit;
  font-weight: 700;
  padding: 12px 14px;
  outline: none;
}

.pepper-select:focus {
  border-color: #4aa35f;
  box-shadow: 0 0 0 4px rgba(74, 163, 95, 0.12);
}

.domestic-table {
  min-width: 100%;
}

table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
}

th,
td {
  padding: 12px 10px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

th {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

tbody tr:hover {
  background: #f9fbff;
}

.strong-cell {
  font-size: 16px;
  font-weight: 800;
  color: #0f172a;
}

.cell-sub {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.up-text {
  color: var(--success);
  font-weight: 700;
}

.down-text {
  color: var(--danger);
  font-weight: 700;
}

.month-cell {
  display: inline-flex;
  flex-direction: column;
  gap: 8px;
  min-width: 64px;
}

.month-bar {
  display: block;
  width: 68px;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, #16a34a 0 38%, #ef4444 38% 100%);
}

.empty-state {
  margin-top: 16px;
  padding: 18px;
  border-radius: 12px;
  background: var(--soft);
  color: var(--muted);
}

.error-box {
  color: var(--danger);
}

@media (max-width: 900px) {
  .domestic-strip,
  .section-head,
  .pepper-head {
    flex-direction: column;
    align-items: stretch;
  }

  .domestic-header {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
  }

  .domestic-metric {
    justify-items: start;
    text-align: left;
  }

  .pepper-side,
  .pepper-select-wrap {
    width: 100%;
    min-width: 0;
    justify-items: stretch;
  }

  .section-actions {
    width: 100%;
    justify-content: stretch;
  }

}

@media (max-width: 980px) {
  .app-shell {
    width: calc(100% - 14px);
    padding-top: 8px;
    padding-bottom: 24px;
    min-width: 0;
  }

  .tradingview-widget-container {
    height: 56vh;
    min-height: 420px;
  }

  .domestic-strip,
  .chart-card,
  .board-card {
    padding: 16px;
    border-radius: 8px;
    min-width: 0;
  }

  .eyebrow {
    margin-bottom: 4px;
    font-size: 11px;
  }

  .brand-title {
    font-size: 24px;
  }

  .brand-row {
    gap: 10px;
  }

  .site-logo {
    width: 42px;
    height: 42px;
    border-radius: 12px;
  }

  .domestic-title {
    font-size: 24px;
    line-height: 1.1;
  }

  .hero-title {
    font-size: 28px;
  }

  .hero-description {
    font-size: 15px;
    line-height: 1.65;
  }

  .hero-chip {
    width: 100%;
    justify-content: flex-start;
    border-radius: 14px;
  }

  .domestic-price {
    font-size: 34px;
  }

  .domestic-unit {
    font-size: 18px;
  }

  .ghost-link {
    width: auto;
    min-width: max-content;
    padding: 9px 12px;
    text-align: center;
    white-space: nowrap;
    flex: 0 0 auto;
    font-size: 14px;
  }

  .section-head h3 {
    font-size: 20px;
    line-height: 1.25;
  }

  .live-stamp {
    width: 100%;
    justify-content: flex-start;
    white-space: normal;
    min-height: 0;
    font-size: 12px;
    padding: 8px 12px;
  }

  .table-capture-btn {
    width: 100%;
    text-align: center;
  }

  .table-wrap {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    margin-top: 12px;
    padding-bottom: 6px;
    border-radius: 14px;
    scrollbar-width: thin;
    width: 100%;
    max-width: 100%;
  }

  table,
  .domestic-table {
    min-width: 100%;
  }

  table thead {
    display: table-header-group;
  }

  .domestic-table th,
  .domestic-table td {
    padding: 12px 10px;
  }

  .month-cell {
    align-items: flex-start;
    max-width: 100%;
    min-width: 56px;
    gap: 6px;
  }

  .month-bar {
    width: 44px;
  }

  .strong-cell {
    font-size: 17px;
  }

  .cell-sub {
    margin-top: 2px;
    font-size: 12px;
  }

  .desktop-market-table table {
    min-width: 720px;
  }

  .desktop-market-table th,
  .desktop-market-table td {
    padding: 10px 8px;
    white-space: nowrap;
    background: #fff;
    font-size: 13px;
  }

  .desktop-market-table th:first-child,
  .desktop-market-table td:first-child {
    position: sticky;
    left: 0;
    z-index: 2;
    background: linear-gradient(90deg, #ffffff 0%, #ffffff 82%, rgba(255, 255, 255, 0.94) 100%);
    box-shadow: 10px 0 16px rgba(17, 34, 68, 0.08);
  }

  .desktop-market-table th:first-child {
    z-index: 4;
  }

  .desktop-market-table th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #f9fbff;
  }

  .pepper-summary {
    line-height: 1.5;
  }

  .pepper-summary strong {
    font-size: 20px;
  }

  .pepper-select {
    width: 100%;
  }

}
