:root {
  --tw-ink: #0f1722;
  --tw-ink-soft: #4a5568;
  --tw-line: #e2e8f0;
  --tw-bg: #f7f9fc;
  --tw-accent: #1f4e8c;
  --tw-accent-dark: #163a69;
  --tw-error-bg: #fdecec;
  --tw-error: #b42318;
  --tw-ok-bg: #ecfdf3;
  --tw-ok: #067647;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  color: var(--tw-ink);
  background: var(--tw-bg);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ---------- Header ---------- */
.tw-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 28px;
  background: #fff;
  border-bottom: 1px solid var(--tw-line);
}
.tw-header__brand {
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.01em;
  color: var(--tw-ink);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.tw-logo { height: 30px; width: auto; display: block; }
.tw-brand-suffix { color: var(--tw-ink-soft); font-weight: 500; }
.tw-header__right { display: flex; align-items: center; gap: 16px; }
.tw-header__investor { color: var(--tw-ink-soft); font-size: 0.9rem; }
.tw-header__logout {
  border: 1px solid var(--tw-line);
  background: #fff;
  color: var(--tw-ink-soft);
  padding: 7px 14px;
  border-radius: 8px;
  cursor: pointer;
  font: inherit;
  font-size: 0.85rem;
}
.tw-header__logout:hover { border-color: var(--tw-accent); color: var(--tw-accent); }
.tw-header__cta {
  background: var(--tw-accent);
  color: #fff;
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
}
.tw-header__cta:hover { background: var(--tw-accent-dark); }
.tw-header__secondary {
  border: 1px solid var(--tw-line);
  background: #fff;
  color: var(--tw-accent);
  text-decoration: none;
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
}
.tw-header__secondary:hover { border-color: var(--tw-accent); background: var(--tw-bg); }

/* ---------- Full disclaimer at the bottom of the data room ---------- */
.disclaimer-bottom {
  margin-top: 40px;
  padding-top: 8px;
  border-top: 1px solid var(--tw-line);
}
.disclaimer-bottom__text {
  white-space: pre-line;
  font-size: 0.8rem;
  line-height: 1.6;
  color: var(--tw-ink-soft);
}

/* ---------- Footer ---------- */
.gate-footer {
  margin-top: auto;
  padding: 22px 28px;
  text-align: center;
  font-size: 0.8rem;
  color: var(--tw-ink-soft);
  border-top: 1px solid var(--tw-line);
}

/* ---------- Gate / share cards ---------- */
.gate-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}
.gate-card {
  width: 100%;
  max-width: 420px;
  background: #fff;
  border: 1px solid var(--tw-line);
  border-radius: 14px;
  padding: 34px 30px;
  box-shadow: 0 8px 30px rgba(15, 23, 34, 0.05);
}
.gate-card__title { margin: 0 0 8px; font-size: 1.4rem; }
.gate-card__subtitle { margin: 0 0 22px; color: var(--tw-ink-soft); line-height: 1.5; font-size: 0.92rem; }

.gate-form { display: flex; flex-direction: column; gap: 16px; }
.gate-field { display: flex; flex-direction: column; gap: 6px; }
.gate-field label { font-size: 0.82rem; font-weight: 500; color: var(--tw-ink-soft); }
.gate-field input {
  padding: 11px 12px;
  border: 1px solid var(--tw-line);
  border-radius: 9px;
  font: inherit;
  font-size: 0.95rem;
}
.gate-field input:focus { outline: none; border-color: var(--tw-accent); }

.gate-button {
  margin-top: 6px;
  padding: 12px 16px;
  background: var(--tw-accent);
  color: #fff;
  border: none;
  border-radius: 9px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.gate-button:hover { background: var(--tw-accent-dark); }
.gate-button:disabled { opacity: 0.55; cursor: not-allowed; }

.gate-error, .gate-success {
  padding: 11px 13px;
  border-radius: 9px;
  font-size: 0.88rem;
  margin-bottom: 16px;
  line-height: 1.45;
}
.gate-error { background: var(--tw-error-bg); color: var(--tw-error); }
.gate-success { background: var(--tw-ok-bg); color: var(--tw-ok); }
.gate-devlink { color: var(--tw-accent); font-weight: 600; }

.gate-notice {
  background: var(--tw-bg);
  border: 1px solid var(--tw-line);
  border-radius: 9px;
  padding: 14px;
  font-size: 0.85rem;
  line-height: 1.55;
  color: var(--tw-ink-soft);
  white-space: pre-line;       /* preserve the paragraph breaks in the notice */
  max-height: 320px;
  overflow-y: auto;
}
.gate-checkbox {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 0.85rem;
  line-height: 1.45;
  color: var(--tw-ink-soft);
}
.gate-checkbox input { margin-top: 2px; }

/* ---------- App page ---------- */
.app-main {
  flex: 1;
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 44px 24px;
}
.app-title { margin: 0 0 6px; font-size: 1.6rem; }
.app-subtitle { margin: 0 0 30px; color: var(--tw-ink-soft); line-height: 1.5; }
.app-loading { color: var(--tw-ink-soft); }

.strategy-list { display: flex; flex-direction: column; gap: 18px; }
.strategy-card {
  background: #fff;
  border: 1px solid var(--tw-line);
  border-radius: 14px;
  padding: 24px 26px;
  box-shadow: 0 6px 24px rgba(15, 23, 34, 0.04);
}
.strategy-card__name { margin: 0 0 16px; font-size: 1.15rem; }
.strategy-card__links { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- App page: max width wider for tables/charts ---------- */
.app-main { max-width: 920px; }
.synced-stamp { color: var(--tw-ink-soft); font-size: 0.85rem; }

/* ---------- Strategy tabs ---------- */
.strategy-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--tw-line);
  margin-bottom: 24px;
}
.strategy-tab {
  appearance: none;
  border: none;
  background: none;
  font: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--tw-ink-soft);
  padding: 12px 18px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.strategy-tab:hover { color: var(--tw-ink); }
.strategy-tab.active {
  color: var(--tw-accent);
  border-bottom-color: var(--tw-accent);
}

.strategy-card__head { margin-bottom: 18px; }
.strategy-card__empty { color: var(--tw-ink-soft); }
.strategy-card__stale {
  margin: 14px 0 0;
  font-size: 0.82rem;
  color: #92400e;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 8px;
  padding: 8px 12px;
}

/* pos / neg coloring shared by metrics + monthly cells */
.pos { color: #067647; }
.neg { color: #b42318; }

/* ---------- Metric cards ---------- */
.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 22px;
}
.metric {
  background: var(--tw-bg);
  border: 1px solid var(--tw-line);
  border-radius: 10px;
  padding: 14px 16px;
}
.metric__label { font-size: 0.74rem; color: var(--tw-ink-soft); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.03em; }
.metric__value { font-size: 1.25rem; font-weight: 600; }

/* ---------- Section titles & text blocks ---------- */
.section-title {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--tw-ink-soft);
  margin: 26px 0 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--tw-line);
}
.text-block { margin-bottom: 8px; }
.text-block p { margin: 0 0 10px; line-height: 1.6; color: var(--tw-ink); font-size: 0.92rem; }
.text-block .section-title { margin-top: 0; }

/* ---------- General information ---------- */
.general-info {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1px;
  background: var(--tw-line);
  border: 1px solid var(--tw-line);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 4px;
}
.general-info__item {
  background: #fff;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.general-info__label { font-size: 0.72rem; color: var(--tw-ink-soft); text-transform: uppercase; letter-spacing: 0.03em; }
.general-info__value { font-size: 0.95rem; font-weight: 600; }

/* ---------- Disclaimer ---------- */
.disclaimer {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--tw-line);
}
.disclaimer p {
  margin: 0 0 8px;
  font-size: 0.72rem;
  line-height: 1.5;
  color: #8a96a3;
}

/* ---------- Chart ---------- */
.chart-wrap { position: relative; height: 260px; margin-bottom: 24px; }

/* ---------- Monthly heatmap table ---------- */
.monthly-wrap { overflow-x: auto; margin-bottom: 22px; }
.monthly-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
  white-space: nowrap;
}
.monthly-table th, .monthly-table td {
  padding: 6px 8px;
  text-align: right;
  border-bottom: 1px solid var(--tw-line);
}
.monthly-table thead th {
  color: var(--tw-ink-soft);
  font-weight: 600;
  text-align: right;
  border-bottom: 2px solid var(--tw-line);
}
.monthly-table td.yr, .monthly-table th:first-child { text-align: left; font-weight: 600; color: var(--tw-ink); }
.monthly-table .ytd { font-weight: 600; border-left: 1px solid var(--tw-line); }

/* ---------- Language toggle ---------- */
.lang-toggle {
  display: inline-flex;
  gap: 0;
  border: 1px solid var(--tw-line);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 18px;
}
.lang-btn {
  appearance: none;
  border: none;
  background: #fff;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--tw-ink-soft);
  padding: 7px 16px;
  cursor: pointer;
}
.lang-btn + .lang-btn { border-left: 1px solid var(--tw-line); }
.lang-btn:hover { background: var(--tw-bg); }
.lang-btn.active { background: var(--tw-accent); color: #fff; }

@media (max-width: 640px) {
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
}
