:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #162033;
  background: #f3f6f8;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
.site-header {
  min-height: 4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  background: #0d3b35;
  color: white;
}
.brand { color: white; font-weight: 750; text-decoration: none; }
.site-header form { margin: 0; }
.link-button {
  border: 0;
  background: transparent;
  color: white;
  cursor: pointer;
  font: inherit;
}
.page-shell { width: min(48rem, calc(100% - 2rem)); margin: 4rem auto; }
.card {
  background: white;
  border: 1px solid #dce4e8;
  border-radius: 1rem;
  padding: clamp(1.5rem, 4vw, 3rem);
  box-shadow: 0 1rem 3rem rgba(20, 45, 55, 0.08);
}
.eyebrow {
  color: #167366;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
h1 { margin-top: 0.4rem; font-size: clamp(2rem, 6vw, 3.5rem); line-height: 1.05; }
p { line-height: 1.65; }
.status-list { margin: 2rem 0 0; }
.status-list div { display: flex; justify-content: space-between; gap: 1rem; padding: 0.9rem 0; border-top: 1px solid #e7edef; }
dt { font-weight: 700; }
dd { margin: 0; color: #52616b; text-align: right; }
.auth-card { max-width: 28rem; margin: 0 auto; }
.auth-card form { display: grid; gap: 0.75rem; }
.auth-card label { font-weight: 700; margin-top: 0.5rem; }
.auth-card input { width: 100%; padding: 0.8rem; border: 1px solid #aab8bf; border-radius: 0.5rem; font: inherit; }
.primary-button { margin-top: 0.75rem; padding: 0.85rem 1rem; border: 0; border-radius: 0.5rem; background: #167366; color: white; font: inherit; font-weight: 750; cursor: pointer; }
.error-message { padding: 0.75rem; border-radius: 0.5rem; background: #fff0f0; color: #9b1c1c; }
.messages { margin-bottom: 1.5rem; }
.message { margin: 0.5rem 0; padding: 0.8rem 1rem; border-radius: 0.5rem; }
.message-success { background: #e8f7f0; color: #126044; }
.message-error { background: #fff0f0; color: #9b1c1c; }
.page-heading { margin-bottom: 2rem; }
.page-heading h1 { margin-bottom: 0.5rem; }
.page-heading p:last-child { color: #52616b; margin-top: 0; }
.form-card { margin-bottom: 2.5rem; }
.form-card h2, .section-heading h2 { margin-top: 0; }
.ticker-form { display: flex; align-items: end; gap: 1rem; flex-wrap: wrap; }
.ticker-form > div { flex: 1 1 16rem; }
.ticker-form label { display: block; font-weight: 700; margin-bottom: 0.45rem; }
.ticker-form input { width: 100%; padding: 0.8rem; border: 1px solid #aab8bf; border-radius: 0.5rem; font: inherit; text-transform: uppercase; }
.field-error { color: #9b1c1c; font-size: 0.9rem; margin: 0.4rem 0 0; }
.stock-section { margin-top: 2.5rem; }
.section-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-bottom: 1rem; }
.muted, .stock-card small { color: #65747c; }
.stock-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: 1rem; }
.stock-card { display: grid; gap: 0.35rem; padding: 1.25rem; border: 1px solid #dce4e8; border-radius: 0.75rem; background: white; color: #162033; text-decoration: none; box-shadow: 0 0.5rem 1.5rem rgba(20, 45, 55, 0.05); }
.stock-card:hover { border-color: #167366; transform: translateY(-1px); }
.stock-card strong { color: #167366; font-size: 1.3rem; }
.empty-state { color: #52616b; }
.breadcrumb { margin-bottom: 2rem; }
.breadcrumb a { color: #167366; font-weight: 700; text-decoration: none; }
.detail-heading { display: flex; justify-content: space-between; align-items: end; gap: 1.5rem; }
.detail-heading h1 { margin-bottom: 0; }
.detail-heading p:last-child { margin-bottom: 0; }
.update-form { flex-shrink: 0; }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: 1rem; margin: 2rem 0; }
.stat-card { display: grid; gap: 0.6rem; padding: 1.25rem; border: 1px solid #dce4e8; border-radius: 0.75rem; background: white; }
.stat-card span { color: #65747c; font-size: 0.9rem; }
.stat-card strong { font-size: 1.15rem; }
.chart-card { padding: 1.5rem; }
.chart-container { position: relative; height: min(28rem, 60vw); min-height: 18rem; }
.table-wrapper { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td { padding: 0.8rem 0.6rem; border-top: 1px solid #e7edef; text-align: left; white-space: nowrap; }
.data-table th { color: #65747c; font-size: 0.85rem; }
@media (max-width: 42rem) {
  .detail-heading { align-items: start; flex-direction: column; }
  .update-form, .update-form .primary-button { width: 100%; }
  .page-shell { margin: 2rem auto; }
}
