:root {
  --accent: #1a6f4f;
  --accent-soft: #e4f2ec;
  --border: #e3e6e8;
  --text: #1d2328;
  --muted: #6a737b;
  --chip-announced: #dff0e6;
  --chip-announced-text: #166c41;
  --chip-paid: #eef0f2;
  --chip-paid-text: #555f66;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: #fafbfc;
  line-height: 1.45;
}

.container { max-width: 1100px; margin: 0 auto; padding: 0 16px; }

.site-header {
  background: #fff;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 5;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  padding-bottom: 12px;
}

.logo { font-weight: 700; text-decoration: none; color: var(--text); font-size: 17px; }
.logo span { color: var(--muted); font-weight: 400; font-size: 13px; }

header nav a { margin-left: 14px; color: var(--accent); text-decoration: none; font-size: 14px; }
header nav a:hover { text-decoration: underline; }

main.container { padding-top: 18px; padding-bottom: 40px; }

h1 { font-size: 24px; margin: 6px 0 14px; }
h2 { font-size: 17px; margin: 28px 0 10px; }

.muted { color: var(--muted); font-size: 13px; }

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
}

.tabs { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.tabs a { padding: 7px 16px; text-decoration: none; color: var(--text); background: #fff; font-size: 14px; }
.tabs a.active { background: var(--accent); color: #fff; }

#search {
  flex: 1;
  min-width: 220px;
  padding: 7px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
}

.btn {
  display: inline-block;
  padding: 7px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
}
.btn:hover { border-color: var(--accent); color: var(--accent); }

.table-wrap {
  overflow-x: auto;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
}

table { border-collapse: collapse; width: 100%; font-size: 14px; min-width: 760px; }

th {
  text-align: left;
  padding: 9px 12px;
  background: #f6f8f9;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  white-space: nowrap;
}

td { padding: 9px 12px; border-bottom: 1px solid #f0f2f3; vertical-align: middle; }
tbody tr:hover { background: #f7faf9; }
tbody tr:last-child td { border-bottom: none; }

td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.date { white-space: nowrap; color: #333c42; }
td.amount { font-weight: 600; }

.strong { font-weight: 600; color: var(--text); text-decoration: none; }
a.strong:hover { color: var(--accent); }

.expand-btn {
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
  text-align: left;
}
.expand-btn:hover .name { color: var(--accent); }
.expand-btn .name { font-weight: 600; }

.caret {
  display: inline-block;
  width: 1em;
  margin-right: 2px;
  color: var(--accent);
  font-size: 11px;
  vertical-align: 1px;
}

/* раскрывающаяся строка с историей компании */
.detail-row td { background: #f4faf7; }
.detail-row:hover td { background: #f4faf7; }
.detail-cell { padding: 4px 12px 14px 44px; }
.detail-title { margin: 8px 0 6px; font-size: 13px; color: var(--muted); }
.detail-cell > .muted { margin: 8px 0 6px; }

.sub-table {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
}
.sub-table th {
  padding: 6px 10px;
  background: #e8f1ec;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  font-size: 12px;
}
.sub-table td { padding: 5px 10px; border-bottom: 1px solid #edf2ef; }
.sub-table tbody tr:last-child td { border-bottom: none; }
.sub-table .amount { font-weight: 600; }

.hidden { display: none !important; }

/* калькулятор */
.calc-form {
  max-width: 560px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px 20px;
  display: grid;
  gap: 14px;
}

.calc-form .field { display: grid; gap: 5px; }
.calc-form label { font-weight: 600; font-size: 14px; }
.calc-form select,
.calc-form input[type="number"] {
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font: inherit;
  width: 100%;
  max-width: 320px;
}
.calc-form select:focus,
.calc-form input[type="number"]:focus {
  outline: 2px solid var(--accent-soft);
  border-color: var(--accent);
}

.field-check { display: flex; align-items: center; gap: 8px; font-size: 15px; }
.field-check input { width: 17px; height: 17px; accent-color: var(--accent); }
.field-check label { font-weight: 600; }

.small { font-size: 12.5px; margin: 4px 0 0; }

.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  justify-self: start;
}
.btn-primary:hover { background: #14573f; color: #fff; }

.calc-error { color: #b3261e; font-size: 14px; }

.calc-result {
  max-width: 560px;
  margin-top: 18px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 6px 20px 16px;
}
.calc-result h2 { margin: 12px 0 4px; }

.calc-result dl { margin: 0; }
.calc-result dl > div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 0;
  border-bottom: 1px solid #f0f2f3;
  font-size: 14px;
}
.calc-result dl > div:last-child { border-bottom: none; }
.calc-result dt { color: var(--muted); }
.calc-result dd { margin: 0; font-variant-numeric: tabular-nums; white-space: nowrap; }
.calc-result .split { font-size: 13px; }
.calc-result .net { font-weight: 700; }
.calc-result .net dd { color: var(--accent); font-size: 18px; }

/* сравнение «акции vs недвижимость» */
.compare-result { margin-top: 20px; }
.compare-result h2 { font-size: 16px; }

.compare-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
  margin-top: 10px;
}

.compare-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 18px 12px;
}
.compare-card.winner {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}
.compare-card h3 {
  margin: 0 0 10px;
  font-size: 15px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.compare-card dl { margin: 0; }
.compare-card dl > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 5px 0;
  font-size: 13.5px;
  border-bottom: 1px solid #f0f2f3;
}
.compare-card dl > div:last-child { border-bottom: none; }
.compare-card dt { color: var(--muted); }
.compare-card dd { margin: 0; font-variant-numeric: tabular-nums; text-align: right; }
.compare-card .net dd { color: var(--accent); font-weight: 700; font-size: 17px; }

.bar { height: 6px; border-radius: 4px; background: #edf0f1; margin-top: 10px; overflow: hidden; }
.bar-inner { height: 100%; background: var(--accent); border-radius: 4px; }

.small-note { max-width: 900px; }

/* вход на пике */
.peaks-table td { white-space: nowrap; }
.peaks-table td.dd { color: #b3261e; font-weight: 600; }
.peaks-table .chip { margin-left: 6px; }
.peaks-table .muted { font-size: 12px; }
.peaks-table .sub { font-weight: 400; font-size: 12px; margin-top: 2px; }
.peaks-table .sub .gain { color: var(--accent); font-weight: 600; }

.ticker { color: var(--muted); font-size: 12px; margin-left: 6px; }
.ticker-lg { font-size: 15px; }

.chip {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 20px;
  font-size: 12px;
  white-space: nowrap;
}
.chip-announced { background: var(--chip-announced); color: var(--chip-announced-text); }
.chip-paid { background: var(--chip-paid); color: var(--chip-paid-text); }

.site-footer {
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 13px;
  padding: 16px 0;
  margin-top: 30px;
}
.site-footer a { color: var(--muted); }

@media (max-width: 640px) {
  h1 { font-size: 20px; }
  .header-inner { flex-wrap: wrap; gap: 6px; }
}
