:root {
  --ink: #1c1712;
  --muted: #6e655b;
  --line: #e3d9c8;
  --paper: #f6f1e7;
  --paper-2: #efe6d6;
  --card: #fffdf8;
  --side: #17140f;
  --side-text: #efe7da;
  --copper: #9a4e2c;
  --copper-soft: #f3e2d4;
  --up: #1d6b45;
  --down: #9d342c;
  --up-bg: #e5f3eb;
  --down-bg: #f8e6e3;
  --shadow: 0 16px 40px rgba(40, 28, 16, 0.06);
  --serif: "Fraunces", Georgia, serif;
  --sans: "Outfit", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 360;
  letter-spacing: 0.01em;
}
button, input, select { font: inherit; color: inherit; }
a { color: inherit; }

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.shell {
  display: grid;
  grid-template-columns: 232px 1fr;
  min-height: 100vh;
}

.side {
  background: var(--side);
  color: var(--side-text);
  padding: 28px 18px 22px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}
.brand {
  text-decoration: none;
  font-family: var(--serif);
  font-size: 28px;
  line-height: 0.95;
  font-weight: 520;
  padding: 0 8px 22px;
}
.brand em { font-style: italic; color: #e4b089; }
.brand small {
  display: block;
  margin-top: 8px;
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #b7aa9a;
  font-weight: 480;
}
.side nav { display: flex; flex-direction: column; gap: 2px; }
.side nav a {
  text-decoration: none;
  padding: 8px 10px;
  border-radius: 8px;
  color: #d9d0c3;
  font-size: 15px;
}
.side nav a.active,
.side nav a:hover { background: #2a241c; color: white; }
.fine {
  margin-top: auto;
  color: #9c9082;
  font-size: 12px;
  line-height: 1.45;
  padding: 12px 8px 0;
}

.work { min-width: 0; }
.top {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 18px 28px 0;
}
#search { position: relative; flex: 1; }
#q {
  width: 100%;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 12px 18px;
  outline: none;
}
#q:focus { border-color: #c4a182; }
.suggest {
  position: absolute;
  z-index: 5;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.suggest button {
  display: flex;
  width: 100%;
  justify-content: space-between;
  gap: 12px;
  text-align: left;
  background: transparent;
  border: 0;
  padding: 10px 14px;
  cursor: pointer;
}
.suggest button:hover { background: var(--paper-2); }
.suggest b { font-weight: 580; }
.suggest span { color: var(--muted); font-size: 13px; }
.clock { margin: 0; color: var(--muted); font-size: 13px; white-space: nowrap; }

main { padding: 22px 28px 64px; }
.kicker {
  margin: 0 0 6px;
  color: var(--copper);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 12px;
}
h1 {
  font-family: var(--serif);
  font-weight: 520;
  font-size: 42px;
  line-height: 1.05;
  margin: 0 0 8px;
}
.lead { margin: 0 0 18px; color: var(--muted); max-width: 68ch; line-height: 1.5; }
.warn, .note {
  border-radius: 12px;
  padding: 10px 12px;
  margin: 0 0 16px;
  line-height: 1.45;
  font-size: 14px;
}
.warn { background: #f8efe2; color: #6a4a28; }
.note { background: var(--paper-2); color: #4d463e; }

.row { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 16px; }
.pill {
  border-radius: 999px;
  padding: 6px 10px;
  background: var(--card);
  border: 1px solid var(--line);
  font-size: 13px;
}
.pill.on { background: #e7f4ec; border-color: #b7d8c4; }
.pill.off { background: #f4f0ea; color: var(--muted); }

.grid { display: grid; gap: 14px; }
.grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.two { grid-template-columns: 1.3fr 0.7fr; }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 16px;
  box-shadow: var(--shadow);
}
.card h2, .card h3 { margin: 0 0 8px; font-size: 16px; font-weight: 580; }
.stat .label { color: var(--muted); font-size: 13px; }
.stat .value {
  font-family: var(--serif);
  font-size: 28px;
  margin-top: 4px;
}
.stat .sub { color: var(--muted); font-size: 13px; margin-top: 2px; }
.hero-temp {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 18px;
  align-items: center;
  margin-bottom: 14px;
}
.temp {
  width: 168px;
  height: 168px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 50% 50%, var(--card) 0 58%, transparent 59%),
    conic-gradient(from 220deg, #9d342c, #d08a3a, #e6d3a1, #7eaa72, #1d6b45);
  box-shadow: inset 0 0 0 10px var(--paper);
}
.temp strong {
  font-family: var(--serif);
  font-size: 42px;
  font-weight: 520;
}
.temp span { display: block; text-align: center; color: var(--muted); margin-top: -6px; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th {
  text-align: left;
  font-weight: 480;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 8px 8px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
td { padding: 9px 8px; border-bottom: 1px solid #f0e9dc; vertical-align: middle; }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: #fbf7f0; }
.name { font-weight: 580; }
.sym { color: var(--muted); font-size: 12px; }
.num, td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.up { color: var(--up); }
.down { color: var(--down); }
.badge {
  display: inline-block;
  border-radius: 999px;
  padding: 2px 7px;
  font-size: 11px;
  background: var(--copper-soft);
  color: var(--copper);
  margin-left: 6px;
}
.badge.green { background: var(--up-bg); color: var(--up); }

.filters {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.filters label, .stack label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.filters input, .filters select, .stack input {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
}
.filters button, .tabs button, .text-btn {
  border: 0;
  background: var(--ink);
  color: white;
  border-radius: 10px;
  padding: 9px 12px;
  cursor: pointer;
}
.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.tabs button { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.tabs button.on { background: var(--ink); color: white; }

.news-list { list-style: none; margin: 0; padding: 0; }
.news-list li { padding: 10px 0; border-bottom: 1px solid #f0e9dc; }
.news-list a { text-decoration: none; font-weight: 480; }
.news-list a:hover { text-decoration: underline; }
.meta { color: var(--muted); font-size: 12px; margin-top: 3px; }

.split { display: grid; grid-template-columns: 1.4fr 0.8fr; gap: 14px; }
.chart-wrap svg { width: 100%; height: auto; display: block; }
.chart-wrap text { font-family: var(--sans); }
.side-buy { color: var(--up); font-weight: 580; }
.side-sell { color: var(--down); font-weight: 580; }
.rules { margin: 0; padding-left: 18px; }
.rules li { margin: 6px 0; line-height: 1.45; }
.decision {
  background: #f8f1e4;
  border-left: 3px solid var(--copper);
  padding: 12px 14px;
  border-radius: 0 12px 12px 0;
  margin-bottom: 14px;
}
.loading { color: var(--muted); padding: 40px 0; font-family: var(--serif); font-size: 28px; }
.ficha-top { display: flex; justify-content: space-between; gap: 18px; align-items: flex-end; }
.summary { max-width: 78ch; line-height: 1.55; color: #3f3832; }

@media (max-width: 1100px) {
  .grid.four, .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid.three, .split, .grid.two, .hero-temp { grid-template-columns: 1fr; }
}
@media (max-width: 800px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: relative; height: auto; padding: 16px; }
  .side nav { flex-direction: row; overflow: auto; }
  .side nav a { white-space: nowrap; }
  .fine { display: none; }
  .brand { padding-bottom: 12px; }
  main, .top { padding-left: 16px; padding-right: 16px; }
  h1 { font-size: 34px; }
  .clock { display: none; }
}
