:root {
  --bg: #FAF9F5;
  --card: #FFFFFF;
  --ink: #141413;
  --muted: #75726B;
  --line: #E8E5DC;
  --accent: #D97757;
  --accent-soft: #F5E8E2;
  --ok: #7A9B76;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Inter", -apple-system, system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.55;
  min-height: 100vh;
}

.page {
  max-width: 680px;
  margin: 0 auto;
  padding: 32px 20px 40px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  min-height: 100vh;
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-family: "Source Serif 4", Georgia, serif;
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.5px;
}

.logo .six { color: var(--accent); }

.chip {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 12px;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 32px 28px;
  box-shadow: 0 1px 2px rgba(20, 20, 19, 0.04);
}

h1 {
  font-family: "Source Serif 4", Georgia, serif;
  font-size: 34px;
  font-weight: 600;
  letter-spacing: -0.5px;
  line-height: 1.2;
  margin-bottom: 12px;
}

.muted { color: var(--muted); }

.plan {
  list-style: none;
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.plan li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
}

.plan li::before {
  content: "○";
  color: var(--muted);
  font-size: 15px;
}

.plan li.done {
  background: var(--accent-soft);
  border-color: transparent;
}

.plan li.done::before {
  content: "✓";
  color: var(--accent);
  font-weight: 700;
}

.foot {
  margin-top: auto;
  text-align: center;
  font-size: 14px;
  color: var(--muted);
}

a.logo { text-decoration: none; color: inherit; }

.topright { display: flex; align-items: center; gap: 8px; }
.topright form { margin: 0; }
.btn-chip { cursor: pointer; font-family: inherit; }
.btn-chip:hover { border-color: var(--accent); color: var(--accent); }

.card.slim {
  width: 100%;
  max-width: 420px;
  margin: 8vh auto 0;
}

.form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 20px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
}

.field input {
  font: inherit;
  font-size: 17px;
  color: var(--ink);
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  outline: none;
}

.field input:focus {
  border-color: var(--accent);
  background: var(--card);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.btn {
  font: inherit;
  font-size: 17px;
  font-weight: 600;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 12px;
  cursor: pointer;
  margin-top: 4px;
}

.btn:hover { filter: brightness(0.95); }

.error {
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 10px;
  padding: 10px 14px;
  margin-top: 14px;
  font-size: 15px;
}

.dash-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

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

.addform {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin: 20px 0 6px;
  padding: 14px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.in {
  font: inherit;
  font-size: 16px;
  color: var(--ink);
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  outline: none;
}

.in:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.in-sym { width: 110px; text-transform: uppercase; font-weight: 600; }
.in-num { width: 110px; }
.in-xs { width: 56px; }
.addpct { display: flex; align-items: center; gap: 4px; color: var(--muted); }

.btn-inline { margin: 0; padding: 9px 18px; font-size: 16px; }

.tlist { margin-top: 16px; display: flex; flex-direction: column; gap: 10px; }

.trow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
}

.tmain { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }

.sym { font-weight: 600; font-size: 18px; min-width: 64px; }

.price {
  font-family: "Source Serif 4", Georgia, serif;
  font-size: 22px;
  font-weight: 600;
}

.delta {
  font-size: 15px;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 999px;
}

.delta.up { color: var(--ok); background: rgba(122, 155, 118, 0.14); }
.delta.down { color: var(--accent); background: var(--accent-soft); }
.delta.hot { outline: 2px solid currentColor; }

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

.tside { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.rowform {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
}

.rowform label { display: flex; align-items: center; gap: 5px; }
.rowform .in { font-size: 14px; padding: 5px 8px; }
.rowform .in-num { width: 84px; }

.danger:hover { border-color: var(--accent); color: var(--accent); }

.empty { margin-top: 16px; }

.avatar {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--line);
  color: var(--ink);
  font-weight: 600;
  font-size: 16px;
  overflow: hidden;
}

.avatar img { width: 100%; height: 100%; object-fit: contain; background: #fff; }

.avatar-sm { width: 26px; height: 26px; flex-basis: 26px; font-size: 12px; }

.tid { display: flex; flex-direction: column; min-width: 96px; }
.tid .sym { min-width: 0; }
.tname { font-size: 13px; color: var(--muted); max-width: 180px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.tmain { align-items: center; }

.sugwrap { position: relative; }

.suggest {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 20;
  min-width: 360px;
  max-width: 90vw;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(20, 20, 19, 0.10);
  overflow: hidden;
}

.sug {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  cursor: pointer;
  font-size: 15px;
}

.sug:hover, .sug.active { background: var(--accent-soft); }
.sug b { min-width: 56px; }
.sugname { color: var(--ink); flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sugex { color: var(--muted); font-size: 12px; white-space: nowrap; }

@media (max-width: 560px) {
  .suggest { min-width: 82vw; }
}

.navlink { text-decoration: none; }
.navlink:hover { border-color: var(--accent); color: var(--accent); }

/* тикер: карточка = строка + панель графика */
.titem {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
}

.titem .trow { border: none; background: transparent; }

.chartpanel { border-top: 1px solid var(--line); padding: 12px 16px 14px; }

.ranges { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }

.ranges button {
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 12px;
  cursor: pointer;
}

.ranges button:hover { border-color: var(--accent); color: var(--accent); }
.ranges button.active { background: var(--accent-soft); border-color: transparent; color: var(--ink); }

.chart-note { font-size: 13px; color: var(--muted); margin-left: 6px; }

.chartbox { position: relative; margin-top: 10px; }
.chartbox svg { display: block; width: 100%; }

.tip {
  position: absolute;
  pointer-events: none;
  background: var(--ink);
  color: var(--bg);
  font-size: 13px;
  padding: 5px 10px;
  border-radius: 8px;
  white-space: nowrap;
  z-index: 10;
}

.chart-toggle.on { background: var(--accent-soft); border-color: transparent; color: var(--ink); }

/* сделки */
.totals { font-size: 14px; color: var(--muted); display: flex; gap: 8px; flex-wrap: wrap; }
.totals b { font-weight: 600; }
.totals .pos { color: var(--ok); }
.totals .neg { color: var(--accent); }

.in-xs2 { width: 84px; }
.in-date { width: 150px; color: var(--ink); }
.feenote { font-size: 12px; color: var(--muted); flex-basis: 100%; }

.trade {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
}

.trade.closed { opacity: 0.75; }
.trade .sym { font-size: 16px; }
.tradeinfo { font-size: 15px; color: var(--ink); }
.tradeinfo .ago { margin-left: 4px; }
.open-chip { background: var(--accent-soft); border-color: transparent; }
.closeform { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 6px 8px; }

/* журнал */
.loglist { margin-top: 16px; display: flex; flex-direction: column; gap: 4px; }

.logrow {
  display: flex;
  gap: 12px;
  align-items: baseline;
  flex-wrap: wrap;
  padding: 7px 10px;
  border-radius: 8px;
  font-size: 14px;
}

.logrow:nth-child(odd) { background: var(--bg); }
.logts { color: var(--muted); font-size: 13px; min-width: 118px; }
.loguser { font-weight: 600; min-width: 48px; }
.logaction { min-width: 120px; }
.logdetails { color: var(--muted); }
.lognote { font-size: 13px; margin-top: 14px; }
