@import url('./fonts.css');

/* Shared with the phone Mini App: Golos Text, surfaces and interaction sizes. */
:root,
[data-theme='light'] {
  color-scheme: light;
  --bg: #fff;
  --surface: #fff;
  --surface2: #f4f4f6;
  --line: #ebebee;
  --text: #101217;
  --text2: #666a73;
  --text3: #9a9da5;
  --accent: #2b59e0;
  --btn: #151b2b;
  --accent-soft: #edf1fd;
  --green: #12804a;
  --green-soft: #e6f4ec;
  --amber: #935600;
  --amber-soft: #fdf2df;
  --red: #c62f2f;
  --red-soft: #fcebeb;
  --ink: #151b2b;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --card: var(--surface);
  --fg: var(--text);
  --muted: var(--text2);
  --blue: var(--accent);
  --soft: var(--accent-soft);
}
[data-theme='dark'] {
  color-scheme: dark;
  --bg: #0e0f12;
  --surface: #0e0f12;
  --surface2: #1b1d22;
  --line: #25272d;
  --text: #ecedf0;
  --text2: #a0a3ab;
  --text3: #6e717a;
  --accent: #7c9bff;
  --btn: #2f5be0;
  --accent-soft: #1b2340;
  --green: #4cc47f;
  --green-soft: #15301f;
  --amber: #f0aa45;
  --amber-soft: #35270f;
  --red: #ff7b7b;
  --red-soft: #3a1a1a;
  --ink: #1c2233;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.4 'Golos Text', system-ui, sans-serif; font-variant-numeric: tabular-nums; }
button, input, select, textarea { font: inherit; }
button, a, select { touch-action: manipulation; }
button { cursor: pointer; }
button:disabled { opacity: .5; cursor: wait; }
button:focus-visible, a:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 34px; line-height: 1.12; font-weight: 500; letter-spacing: -.035em; }
h2 { font-size: 17px; font-weight: 600; line-height: 1.4; }
h3 { font-size: 15px; font-weight: 600; line-height: 1.4; }
strong { font-weight: 600; }
small, .muted { color: var(--text2); font-size: 13px; line-height: 1.4; }
code { font: 13px 'JetBrains Mono', monospace; overflow-wrap: anywhere; }
svg { flex-shrink: 0; }
#app { max-width: 760px; margin: auto; padding: calc(20px + var(--safe-top)) 20px calc(100px + var(--safe-bottom)); }
#app > main { min-width: 0; }
.topbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 24px; }
.topbar > div { flex: 1; min-width: 0; }
.eyebrow { margin: 0 0 4px; color: var(--text2); font-size: 14px; font-weight: 400; letter-spacing: normal; text-transform: none; }
.heading small { display:block; margin:0 0 4px; font-size:14px; }
.topbar .header-actions { display:flex; align-items:center; gap:8px; flex:0 0 auto; }
.status-note { margin:0 0 20px; border-bottom:1px solid var(--line); color:var(--text2); font-size:13px; }
.status-note > summary { display:flex; align-items:center; gap:8px; min-height:44px; padding:8px 0; font-size:13px; font-weight:400; list-style:none; }
.status-note > summary::-webkit-details-marker { display:none; }
.status-note > summary::after { content:'⌄'; margin-left:auto; font-size:16px; }
.status-note[open] > summary::after { content:'⌃'; }
.status-note p { margin:0 0 12px; }
.toolbar { display:flex; align-items:center; flex-wrap:wrap; gap:8px; margin:0 0 20px; }
.toolbar > .button { width:auto; flex:1; min-width:0; margin:0; }
.toolbar > .icon-button { flex:0 0 44px; }
.period-label { color:var(--text2); font-size:13px; margin:0 0 12px; }
.icon-button { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; min-height: 44px; flex-shrink: 0; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--text); padding: 0; font-size: 22px; }
.icon-button svg, .nav svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 48px; margin-top: 12px; padding: 11px 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--text); font-size: 15px; font-weight: 500; line-height: 1.4; text-decoration: none; text-align: center; }
.button.primary { background: var(--btn); color: #fff; border-color: var(--btn); }
.button.danger { color: var(--red); background: var(--red-soft); border-color: transparent; }
.link-button { border: 0; background: none; color: var(--accent); padding: 4px; min-height: 44px; font-size: 14px; font-weight: 400; }
.demo, .notice { padding: 13px 14px; background: var(--accent-soft); color: var(--accent); font-size: 14px; line-height: 1.4; border-radius: 10px; }
.demo { margin-bottom: 20px; }
.demo strong { display: block; margin-bottom: 4px; }
.demo select { margin-top: 12px; }
main > .notice { margin-top: 20px; }
.hero { background: var(--ink); color: #fff; border-radius: 16px; padding: 18px; margin-bottom: 20px; overflow: hidden; }
.hero small { font-size: 14px; color: #ffffff99; }
.hero-value { font-size: 36px; line-height: 1.12; letter-spacing: -.035em; font-weight: 500; margin: 20px 0; overflow-wrap: anywhere; }
.hero p { font-size: 14px; color: #ffffff99; }
.hero-label { color:#ffffff99; font-size:14px; }
.hero-subrows { margin-top:18px; padding-top:14px; border-top:1px solid #ffffff24; }
.hero-subrows > div { display:flex; align-items:baseline; justify-content:space-between; gap:12px; padding:6px 0; font-size:14px; }
.hero-subrows span { min-width:0; color:#ffffff99; }
.hero-subrows strong { text-align:right; font-weight:500; }
.metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; margin-bottom: 20px; }
.metric { min-width: 0; padding: 16px; }
.metric:nth-child(even) { border-left: 1px solid var(--line); }
.metric strong { display: block; font-size: 23px; line-height: 1.3; margin-top: 6px; overflow-wrap: anywhere; }
.metric small { font-size: 12px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 24px 0 8px; }
.section-head h2 { font-size: 16px; }
.stack { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.card { min-width: 0; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--text); }
button.card { display: block; width: 100%; text-align: left; }
main .stack > button.card, main .stack > .card:has(.stock-row) { padding: 16px 0; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: none; }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 8px 12px; margin-bottom: 10px; }
.card-head h3 { min-width: 0; flex: 1; overflow-wrap: anywhere; }
.badge { display: inline-block; max-width: 100%; padding: 4px 8px; border-radius: 6px; font-size: 12px; font-weight: 400; line-height: 1.4; background: var(--surface2); color: var(--text2); white-space: normal; overflow-wrap: anywhere; }
.badge.done { background: var(--green-soft); color: var(--green); }
.badge.warning { background: var(--amber-soft); color: var(--amber); }
.items { font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
.card-foot { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 14px; }
.card-foot > * { min-width: 0; }
.card-foot > strong { text-align: right; overflow-wrap: anywhere; }
.card > .negative { margin-top: 12px; font-size: 13px; }
.positive { color: var(--green); }
.negative { color: var(--red); }
.search, .demo select, .operation-dialog select, .operation-dialog input { width: 100%; min-width: 0; min-height: 48px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--text); font-size: 16px; }
.search { margin: 0 0 12px; }
input::placeholder { color: var(--text3); }
.filters { display: flex; gap: 6px; overflow-x: auto; padding: 4px 0 12px; margin-bottom: 4px; }
.chip { min-height: 44px; padding: 7px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--text2); font-size: 13px; font-weight: 400; white-space: nowrap; }
.chip.active { background: var(--text); color: var(--bg); border-color: var(--text); }
.error { padding: 13px 14px; border: 0; border-radius: 10px; background: var(--red-soft); color: var(--red); font-size: 14px; line-height: 1.4; margin: 12px 0; scroll-margin: 90px 0 20px; }
.error p + p { margin-top: 8px; }
.empty { padding: 32px 16px; text-align: center; color: var(--text2); font-size: 14px; }
.empty strong { display: block; color: var(--text); font-size: 16px; margin-bottom: 8px; }
.nav { position: fixed; bottom: 0; left: 0; right: 0; display: flex; justify-content: center; background: var(--surface); border-top: 1px solid var(--line); padding: 8px 8px calc(10px + var(--safe-bottom)); z-index: 10; }
.nav button { display: flex; flex: 1; max-width: 155px; min-width: 0; min-height: 48px; align-items: center; justify-content: center; flex-direction: column; gap: 4px; padding: 0 2px; font-size: 11px; font-weight: 400; border: 0; background: none; color: var(--text3); }
.nav button.active { color: var(--text); font-weight: 600; }
dialog { border: 0; border-radius: 18px 18px 0 0; background: var(--surface); color: var(--text); width: 100%; max-width: 600px; max-height: 90dvh; margin: auto auto 0; padding: 0 20px calc(24px + var(--safe-bottom)); overflow: auto; overscroll-behavior: contain; scroll-padding-top: 84px; }
dialog::backdrop { background: #0007; }
.dialog-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 0 12px; margin-bottom: 12px; background: var(--surface); border-bottom: 1px solid var(--line); }
.dialog-head h2 { margin: 0; font-size: 21px; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
dialog .notice, dialog .muted { margin: 12px 0; }
dialog .card { background: var(--surface2); border-color: transparent; padding: 14px; margin: 14px 0; }
.data-row { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.data-row span { color: var(--text2); flex: 1; min-width: 0; }
.data-row strong { text-align: right; max-width: 65%; overflow-wrap: anywhere; }
.toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 0; font-size: 14px; line-height: 1.4; }
.toggle input { width: 20px; height: 20px; accent-color: var(--btn); flex-shrink: 0; }
.toggle span small { display: block; margin-top: 5px; }
.loading { padding: 70px 20px; text-align: center; color: var(--text2); }
.spinner { width: 26px; height: 26px; border: 3px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; margin: 0 auto 15px; }
.stock-list { display:flex; flex-direction:column; }
.stock-item { display:flex; align-items:center; gap:12px; width:100%; min-width:0; padding:15px 0; border:0; border-bottom:1px solid var(--line); border-radius:0; background:none; color:var(--text); text-align:left; }
.stock-item > div:first-child { flex:1; min-width:0; }
.stock-item h3, .stock-item strong { font-size:15px; font-weight:500; overflow-wrap:anywhere; }
.stock-item small { display:block; margin-top:4px; }
.stock-item .stock-qty { font-size:18px; font-weight:500; }
.stock-item > svg:last-child { width:16px; height:16px; color:var(--text2); }
.stock-item .stock-item-end { display:flex; align-items:center; gap:10px; }
.stock-detail-title { margin:0 0 16px; font-size:17px; line-height:1.4; font-weight:600; overflow-wrap:anywhere; }
.action-list { display:flex; flex-direction:column; margin:16px 0; }
.action-list > button, .action-list > .button { display:flex; align-items:center; justify-content:space-between; gap:12px; width:100%; min-height:48px; margin:0; padding:14px 0; border:0; border-bottom:1px solid var(--line); border-radius:0; background:none; color:var(--text); font-size:15px; font-weight:400; text-align:left; }
.action-list > button > svg:last-child { width:16px; color:var(--text2); }
.stock-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.stock-row > div:first-child { min-width: 0; flex: 1; }
.stock-row h3 { overflow-wrap: anywhere; }
.stock-row small { display: block; margin-top: 4px; }
.stock-qty { font-size: 23px; font-weight: 500; white-space: nowrap; text-align: right; }
.stock-qty small { display: inline; font-size: 13px; }
.stock-summary { margin-bottom: 20px; }
.stock-summary h2 { margin-bottom: 4px; }
.stock-summary > .muted { margin-bottom: 12px; }
.stock-summary > small { display: block; margin-top: 12px; }
.stock-summary .data-row strong { max-width: 58%; }
.stock-costs { display: grid; gap: 4px; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.stock-costs small { overflow-wrap: anywhere; }
.stock-warning { font-size: 13px; line-height: 1.4; color: var(--amber); margin: 12px 0 0; }
.stock-overview { margin-top: 16px; }
main > .muted { margin: 12px 0; }
.operation-dialog { padding: 0 20px calc(24px + var(--safe-bottom)); }
.operation-dialog > .card { padding: 0; margin: 0; border: 0; border-radius: 0; background: var(--surface); }
.operation-dialog label { display: flex; flex-direction: column; gap: 7px; margin: 16px 0; font-size: 14px; }
.operation-dialog label > span { font-weight: 500; }
.operation-dialog label .search { margin-bottom: 0; }
.operation-dialog select { max-width: 100%; white-space: normal; }
.operation-dialog .card .card { margin: 14px 0; }
.operation-dialog .card > p { margin: 12px 0; }
.operation-dialog .card > h3 { margin: 20px 0 12px; }
.operation-dialog .card .card > small { display: block; margin-top: 5px; }
details summary { padding: 12px 0; cursor: pointer; min-height: 44px; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } }
@media (min-width: 760px) { #app { padding-top: 32px; } }
@media (max-width: 359px) { #app { padding-left: 16px; padding-right: 16px; } .hero-value { font-size: 32px; } .metric { padding: 12px; } }
.chart-card{padding:20px 16px;overflow:hidden}.chart-card h2{font-size:20px;margin:0}.chart-periods{display:grid;grid-template-columns:repeat(4,1fr);gap:3px;padding:4px;background:var(--surface2);border-radius:12px;margin:16px 0}.chart-period{border:0;background:transparent;color:var(--muted);font:inherit;font-size:12px;min-height:40px;padding:4px;border-radius:8px}.chart-period.selected{background:var(--surface);color:var(--text);box-shadow:0 1px 4px #0002}.chart-dates{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin:12px 0}.chart-dates label{min-width:0;font-size:12px;color:var(--muted)}.chart-dates input{display:block;width:100%;min-width:0;box-sizing:border-box;margin-top:6px;font-size:14px;padding:10px 6px}.chart-totals{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin:22px 0}.chart-totals small{display:block;font-size:11px;color:var(--muted);margin-bottom:8px}.chart-totals strong{font-size:clamp(15px,4.5vw,21px);font-weight:500;overflow-wrap:anywhere}.chart-legend{display:flex;gap:20px;font-size:11px;color:var(--muted);margin-bottom:12px}.chart-legend span:before{content:'';display:inline-block;width:7px;height:7px;border-radius:50%;margin-right:6px;background:var(--accent)}.chart-legend .profit-dot:before{background:var(--green)}.finance-chart{width:100%;display:block;touch-action:pan-y}.chart-axis{fill:var(--muted);font-size:9px;font-family:inherit}.chart-grid{stroke:var(--line);stroke-dasharray:3 4;opacity:.6}.chart-zero{stroke:var(--muted);opacity:.5}.chart-cursor{stroke:var(--muted);stroke-dasharray:3 3}.chart-slider{width:100%;min-height:32px;accent-color:var(--accent);padding:0!important;border:0!important}.chart-readout{background:var(--surface2);border-radius:12px;padding:12px;margin:8px 0 12px}.chart-readout small{color:var(--muted);font-size:11px}.chart-readout .data-row{font-size:13px;padding:9px 0}.chart-timezone{color:var(--muted);font-size:10px}.chart-empty{text-align:center;padding:30px 8px;color:var(--muted)}.chart-empty small{display:block;margin-top:8px}.negative{color:var(--red)}

html,body,button,a,input,select,textarea,label,.finance-chart{touch-action:manipulation}

.chart-dates input{background:var(--surface2);color:var(--text);border:1px solid var(--line);border-radius:10px;min-height:46px;font-family:inherit}

/* Money is a single readable value, never an arbitrary stack of digits. */
.financial-metrics{display:block;padding:0 16px}.financial-metrics .metric{display:flex;align-items:baseline;justify-content:space-between;gap:12px;padding:16px 0;border:0}.financial-metrics .metric+.metric{border-top:1px solid var(--line)}.financial-metrics .metric strong{margin:0;font-size:clamp(18px,5.2vw,23px);white-space:nowrap;overflow-wrap:normal}.financial-metrics .metric small{font-size:13px;min-width:0}.chart-totals{grid-template-columns:1fr;gap:14px}.chart-totals>div{display:flex;justify-content:space-between;align-items:baseline;gap:12px}.chart-totals strong{white-space:nowrap;font-size:20px;overflow-wrap:normal}.chart-totals small{margin:0;min-width:0}.section-head>*{min-width:0}.section-head .link-button{flex-shrink:0}.hero-subrows strong{white-space:nowrap}.dialog-head h2{flex:1;min-width:0}.data-row span{overflow-wrap:anywhere}.button{white-space:normal;overflow-wrap:anywhere}.button>svg{width:20px;height:20px}.stock-warning>svg{width:16px;height:16px;vertical-align:-3px;margin-right:5px}
@media(max-width:359px){.chart-totals>div{display:block}.chart-totals strong{display:block;margin-top:6px}.financial-metrics{padding:0 12px}.financial-metrics .metric{gap:8px}.financial-metrics .metric strong{font-size:18px}}
.finance-hero{margin-top:20px}.finance-hero .data-row{border-color:#ffffff24}.finance-hero .data-row span{color:#ffffff99}.finance-hero .data-row strong{font-size:22px;color:white;max-width:none;white-space:nowrap}.finance-hero>small:last-child{display:block;font-size:12px;margin-top:14px}.finance-wallet{display:grid;grid-template-columns:minmax(0,1fr) auto 16px;gap:10px;align-items:center;width:100%;text-align:left;padding:18px 0;color:var(--text);border:0;border-bottom:1px solid var(--line);background:none}.finance-wallet h3{overflow-wrap:anywhere}.finance-wallet small{display:block;margin-top:4px}.finance-wallet strong{font-size:17px;white-space:nowrap}.finance-wallet svg{width:16px;height:16px;color:var(--text2)}.finance-panel{border-bottom:1px solid var(--line);padding:8px 0;margin-top:14px}.finance-panel>summary{position:relative;padding:14px 24px 14px 0;list-style:none}.finance-panel>summary::after{content:'⌄';position:absolute;right:4px;top:14px;color:var(--text2)}.finance-panel[open]>summary::after{content:'⌃'}.finance-panel>summary strong,.finance-panel>summary small{display:block}.finance-panel>summary small{margin-top:5px;font-size:12px}.finance-panel>summary::-webkit-details-marker{display:none}.finance-investor{padding:16px 0;border-top:1px solid var(--line)}.finance-investor p{font-size:13px;margin-top:8px;overflow-wrap:anywhere}.finance-investor>small{font-size:12px}.finance-confirm{padding:18px 0;border-top:1px solid var(--line);margin-top:20px}.finance-dialog .data-row strong{overflow-wrap:anywhere}.finance-avito .notice{margin:12px 0}.finance-avito .stock-warning{margin-bottom:10px}.finance-avito .data-row strong{white-space:nowrap}.finance-panel .data-row{align-items:baseline}.finance-hero .data-row{flex-wrap:wrap}
@media(max-width:359px){.finance-wallet{grid-template-columns:minmax(0,1fr) 16px}.finance-wallet strong{grid-column:1;grid-row:2}.finance-wallet svg{grid-column:2;grid-row:1/3}.nav button{font-size:10px}.finance-hero .data-row strong{font-size:20px}}
.select-caption{display:block;overflow-wrap:anywhere;white-space:normal;margin:6px 0 10px!important;font-size:12px!important;line-height:1.5;color:var(--text2)}[hidden]{display:none!important}button:focus-visible,a:focus-visible,summary:focus-visible{outline:2px solid var(--accent);outline-offset:3px}dialog{scrollbar-gutter:stable;scroll-padding-bottom:24px}.finance-wallet>div{min-width:0}.finance-confirm>p{overflow-wrap:anywhere}.access-users .button{text-align:left;justify-content:flex-start;line-height:1.5}
.finance-empty-value{font-size:26px;line-height:1.25;font-weight:500;margin:18px 0;max-width:16ch}.chart-dates input{font-size:16px}
