:root {
  color-scheme: light;
  --bg: #f1f5f7;
  --card: #fff;
  --ink: #142b36;
  --muted: #536a75;
  --line: #dce6ea;
  --accent: #136568;
  --positive: #136344;
  --negative: #a22d42;
  --warning: #793d05;
  font-family: 'Segoe UI', system-ui, sans-serif;
  font-variant-numeric: tabular-nums;
  background: var(--bg);
  color: var(--ink);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body, h1, h2, p { margin: 0; }
button, select, input { font: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.shell { width: min(100%, 1080px); margin: auto; padding: 22px 16px 40px; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
h1 { font-size: 24px; line-height: 1.1; letter-spacing: -.04em; }
h2 { font-size: 15px; font-weight: 700; }
.quiet { background: #e5eeef; color: var(--accent); border: 0; border-radius: 9px; padding: 8px 12px; min-height: 39px; font-size: 13px; font-weight: 650; }
.quiet:hover { background: #d8e6e8; }
.quiet:disabled { opacity: .6; cursor: wait; }
.status { font-size: 12px; line-height: 1.5; color: var(--muted); margin-bottom: 17px; }
.status.warning { color: var(--warning); }
.controls { display: grid; gap: 10px; margin-bottom: 12px; align-items: end; }
.controls label { display: grid; gap: 4px; min-width: 0; color: var(--muted); font-size: 12px; font-weight: 650; }
.controls select, .controls input {
  width: 100%; min-width: 0; height: 41px; padding: 7px 10px; border: 1px solid #cbd9de;
  border-radius: 9px; background: var(--card); color: var(--ink); font-size: 14px;
}
.dates { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
#month { justify-self: start; }
.overview { display: grid; gap: 12px; align-items: start; }
.card { min-width: 0; border: 1px solid var(--line); border-radius: 15px; background: var(--card); padding: 16px; }
.equity h2 { color: var(--muted); }
.total { font-size: clamp(26px, 8vw, 44px); font-weight: 750; letter-spacing: -.045em; margin: 4px 0; overflow-wrap: anywhere; }
.muted, .empty { font-size: 13px; color: var(--muted); line-height: 1.45; }
.empty { padding: 15px 0 2px; }
#chart { display: block; width: 100%; height: 208px; margin: 8px 0 0; }
#notes { margin-top: 9px; }
.count { display: inline-block; margin-left: 4px; font-size: 12px; color: var(--muted); }
.journal { margin-top: 12px; }
.item { padding: 11px 0; border-bottom: 1px solid var(--line); }
.item:last-child { border-bottom: 0; }
.item-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; font-size: 14px; }
.item-head strong:first-child { overflow-wrap: anywhere; min-width: 0; }
.amount { flex: none; text-align: right; white-space: nowrap; }
.item-sub { margin-top: 4px; overflow-wrap: anywhere; color: var(--muted); font-size: 12px; line-height: 1.4; }
.estimate { color: var(--warning); }
.positive { color: var(--positive); }
.negative { color: var(--negative); }
details summary { list-style: none; cursor: pointer; }
details summary::-webkit-details-marker { display: none; }
details summary .item-head strong:first-child::before { content: '›'; color: var(--accent); display: inline-block; margin-right: 6px; }
details[open] summary .item-head strong:first-child::before { transform: rotate(90deg); }
.trade-detail { margin-top: 8px; border-left: 2px solid var(--line); padding-left: 8px; }
#more { margin-top: 12px; }
@media (min-width: 620px) {
  .shell { padding: 27px 24px 48px; }
  .controls { grid-template-columns: minmax(14ch, 1fr) auto auto; }
  .overview { grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); }
}
