
:root { color-scheme: dark; --bg:#0b3037; --bg2:#134e5e; --fg:#eef9fa; --muted:rgba(238,249,250,.66); --line:rgba(190,244,248,.22); --panel:rgba(19,78,94,.34); --panel2:rgba(11,48,55,.42); --accent:#d8fbff; --accent2:#65dbe6; --positive:#42c082; --danger:#ff6b86; }
* { box-sizing:border-box; }
body {
  margin:0;
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  background:
    radial-gradient(circle at 18% 8%, rgba(116,219,230,.18), transparent 28%),
    radial-gradient(circle at 82% 14%, rgba(223,255,255,.10), transparent 26%),
    linear-gradient(145deg,#08252b 0%,#0b3037 43%,#134e5e 100%);
  color:var(--fg);
  min-height:100vh;
}
body::before {
  content:"";
  position:fixed;
  inset:0;
  pointer-events:none;
  background:
    linear-gradient(115deg,rgba(255,255,255,.045),transparent 22%,rgba(255,255,255,.025) 48%,transparent 74%),
    repeating-linear-gradient(86deg,rgba(255,255,255,.018) 0 1px,transparent 1px 7px);
  mix-blend-mode:screen;
}
a { color:inherit; text-decoration:none; }
.topbar { display:grid; gap:12px; padding:14px 14px; background:rgba(8,37,43,.52); border-bottom:1px solid var(--line); position:sticky; top:0; z-index:10; backdrop-filter:blur(24px) saturate(140%); }
.brand { display:block; width:100%; text-align:center; color:var(--muted); font-weight:750; font-size:13px; letter-spacing:.08em; }
nav { display:grid; grid-template-columns:repeat(3, minmax(0, 1fr)); gap:6px; }
nav a, .button, button {
  border:1px solid var(--line);
  background:rgba(216,251,255,.10);
  color:var(--fg);
  padding:11px 13px;
  border-radius:18px;
  font-weight:700;
  cursor:pointer;
  font-size:14px;
  min-height:42px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.22),0 12px 30px rgba(0,0,0,.18);
  backdrop-filter:blur(18px) saturate(145%);
}
nav a.active, .button, button { background:rgba(216,251,255,.82); border-color:rgba(226,253,255,.7); color:#06252b; }
.secondary { background:rgba(216,251,255,.10); color:var(--fg); border-color:var(--line); }
.danger { background:rgba(255,107,134,.12); color:var(--danger); border-color:rgba(255,107,134,.34); }
main { width:min(100% - 20px, 880px); margin:16px auto 44px; }
.hero { display:grid; gap:12px; align-items:stretch; margin-bottom:18px; }
.hero > div, .panel, .account-card, .position-card {
  background:linear-gradient(145deg,rgba(255,255,255,.15),rgba(255,255,255,.045)),var(--panel);
  border:1px solid var(--line);
  border-radius:28px;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.26),inset 0 -1px 0 rgba(255,255,255,.08),0 22px 55px rgba(0,0,0,.26);
  backdrop-filter:blur(26px) saturate(150%);
}
.hero > div { padding:20px; text-align:center; }
.hero span, small, .muted { color:var(--muted); }
h1 { margin:8px 0 10px; font-size:30px; letter-spacing:0; line-height:1.08; }
h2 { margin:0; }
p { color:var(--muted); margin:0; }
.goal { display:flex; flex-direction:column; gap:9px; }
.goal b { font-size:26px; }
.progress { height:10px; background:rgba(255,255,255,.12); border-radius:999px; overflow:hidden; margin-top:5px; box-shadow:inset 0 1px 2px rgba(0,0,0,.24); }
.progress i { display:block; height:100%; background:linear-gradient(90deg,#d84f63 0%,#e8bd67 48%,#7fe6d2 100%); }
.section-head, .detail-head, .actions, .bottom-actions { display:flex; justify-content:center; align-items:center; gap:10px; margin:16px 0; flex-wrap:wrap; }
.section-head { justify-content:space-between; flex-wrap:nowrap; }
.icon-button { width:36px; height:36px; min-height:36px; padding:0; border-radius:18px; font-size:15px; }
.detail-head { text-align:center; }
.detail-head > div { width:100%; }
.grid { display:grid; grid-template-columns:repeat(2, minmax(0, 1fr)); gap:10px; }
.account-card { position:relative; padding:12px; display:grid; text-align:center; align-content:stretch; justify-items:stretch; overflow:hidden; box-shadow:none; }
.dashboard-editing .account-card { border-color:rgba(216,251,255,.46); }
.account-card.dragging { opacity:.55; border-color:var(--accent); }
.account-link { min-height:94px; display:grid; align-content:center; justify-items:center; gap:5px; padding:18px 8px 8px; }
.dashboard-editing .account-link { pointer-events:none; }
.account-link strong { display:block; font-size:17px; line-height:1.15; overflow-wrap:anywhere; }
.account-link b { color:var(--positive); font-size:19px; font-weight:800; line-height:1.1; }
.account-link span { color:var(--muted); font-size:13px; line-height:1.1; }
.account-card span, .position-card span { color:var(--muted); font-size:14px; }
.edit-button, .drag-handle { position:absolute; top:7px; width:28px; height:28px; min-height:28px; padding:0; border-radius:14px; background:rgba(216,251,255,.16); border:1px solid var(--line); color:var(--fg); font-size:14px; line-height:1; backdrop-filter:blur(18px); }
.edit-button, .drag-handle { display:none; }
.dashboard-editing .edit-button, .dashboard-editing .drag-handle { display:inline-flex; align-items:center; justify-content:center; }
.edit-button { right:7px; }
.drag-handle { left:7px; cursor:grab; touch-action:none; }
.drag-handle:active { cursor:grabbing; }
.position-grid { display:grid; gap:10px; }
.position-card { padding:16px; display:grid; gap:12px; text-align:center; justify-items:center; }
.position-card.negative { border-color:rgba(255,107,134,.42); background:linear-gradient(145deg,rgba(255,107,134,.18),rgba(255,255,255,.04)); }
.position-card strong { display:block; font-size:18px; line-height:1.2; overflow-wrap:anywhere; }
.position-card small { overflow-wrap:anywhere; }
.amounts { text-align:center; display:flex; flex-direction:column; gap:6px; white-space:nowrap; }
.amounts b { font-size:22px; color:var(--positive); }
.amounts.negative b, .amounts.negative span, .account-link.negative b, .account-link.negative span { color:var(--danger); }
.amounts.big b { font-size:32px; }
.panel { padding:14px; overflow:auto; }
.narrow { max-width:560px; margin-inline:auto; }
.stack { display:grid; gap:14px; }
.field { display:grid; gap:7px; }
label { font-weight:650; }
input, textarea, select { width:100%; border:1px solid var(--line); border-radius:18px; padding:12px 12px; font:inherit; background:rgba(8,37,43,.38); color:var(--fg); min-height:44px; box-shadow:inset 0 1px 0 rgba(255,255,255,.12); }
input:focus, textarea:focus, select:focus { outline:2px solid rgba(101,219,230,.34); border-color:var(--accent2); }
.field small { display:block; color:var(--muted); font-weight:400; margin-top:4px; }
.empty { background:var(--panel2); border:1px dashed var(--line); border-radius:24px; padding:24px; color:var(--muted); text-align:center; }
.bottom-actions .button, .bottom-actions button { width:100%; max-width:320px; }
.danger-zone { margin-top:8px; }
@media (min-width: 760px) {
  main { width:min(100% - 48px, 980px); margin-top:28px; }
  .topbar { display:grid; padding:16px 28px; }
  nav { display:flex; flex-wrap:wrap; justify-content:flex-end; }
  .hero { grid-template-columns:1fr minmax(260px, 340px); }
  .grid { grid-template-columns:repeat(auto-fill, minmax(190px, 1fr)); }
  .position-grid { grid-template-columns:repeat(auto-fill, minmax(220px, 1fr)); }
  h1 { font-size:36px; }
  .bottom-actions .button, .bottom-actions button { width:auto; }
}
