:root {
  color-scheme: dark;
  --bg:#121316; --panel:#1d1e22; --panel-hi:#25262c; --edge:#383a42; --fg:#f2f2f4;
  --quiet:#b4b5c0; --dim:#9699a7; --button:#dedfe8; --ink:#1b1c22; --blue:#c4d2ff;
  font-family:system-ui,-apple-system,"Segoe UI",Arial,sans-serif;
}
* { box-sizing:border-box; }
[hidden] { display:none!important; }
body { margin:0; min-height:100vh; background:var(--bg); color:var(--fg); }
button,input,select,a { font:inherit; }
button,.button { -webkit-tap-highlight-color:transparent; }
button { cursor:pointer; }
button:disabled { opacity:.55; cursor:wait; }
:is(a,button,input,select,summary):focus-visible { outline:2px solid var(--blue); outline-offset:3px; }
h1,h2,p,ul { margin:0; }
ul { list-style:none; padding:0; }
.wrap { margin-inline:auto; max-width:1090px; padding-inline:clamp(16px,4vw,48px); }
.top { background:#17181b; border-bottom:1px solid #303137; padding-top:env(safe-area-inset-top,0px); }
.top-inner { min-height:64px; display:flex; align-items:center; gap:18px; }
.brand { display:inline-flex; align-items:center; gap:9px; font-size:22px; letter-spacing:-.055em; font-weight:700; white-space:nowrap; }
.brand i { width:23px; height:23px; display:block; position:relative; border-radius:7px; background:#e4e5ed; }
.brand i::before,.brand i::after { content:""; position:absolute; left:6px; top:7px; width:10px; height:4px; transform:skewY(-16deg); border:1px solid #23242a; border-radius:1px; }
.brand i::after { top:12px; background:#23242a; }
#cabinet { margin-left:auto; font-size:13px; color:var(--quiet); }
.minor { border:0; background:transparent; color:var(--blue); text-decoration:underline; text-underline-offset:4px; min-height:42px; padding:3px 0; font-size:14px; }
.entry { max-width:505px; padding:clamp(35px,6vw,65px) clamp(18px,4vw,40px); margin:clamp(36px,10vh,98px) auto 0; border:1px solid var(--edge); background:var(--panel); border-radius:26px; }
.entry-icon { display:grid; place-items:center; width:48px; height:48px; font-size:25px; color:var(--blue); background:#303440; border-radius:15px; margin:0 0 28px; }
.entry p { margin:12px 0 20px; color:var(--quiet); line-height:1.6; }
.entry .button { margin:6px 6px 0 0; }
h1 { font-size:clamp(29px,4vw,45px); line-height:1.07; letter-spacing:-.06em; font-weight:640; }
h2 { font-size:21px; letter-spacing:-.04em; line-height:1.2; font-weight:640; }
.today { font-size:13px; color:var(--quiet); line-height:1.5; margin-bottom:7px; }
.home-heading { display:flex; align-items:flex-end; justify-content:space-between; gap:20px; margin:34px 0 24px; }
.segments { display:flex; flex:none; gap:3px; background:#202126; border:1px solid #34353c; border-radius:13px; padding:3px; }
.segments button { min-width:85px; min-height:38px; padding:5px 13px; border-radius:10px; border:0; background:transparent; color:var(--quiet); font-weight:560; font-size:14px; }
.segments button[aria-pressed=true] { background:#41434d; color:#fafafd; box-shadow:0 1px 4px #111218; }
.button { display:inline-flex; gap:8px; align-items:center; justify-content:center; border:1px solid transparent; border-radius:12px; min-height:45px; padding:8px 16px; font-weight:620; font-size:14px; text-decoration:none; text-align:center; }
.primary { color:var(--ink); background:var(--button); }
.primary:hover { background:#f0f0f7; }
.secondary { color:var(--fg); background:#2c2d34; border-color:#4c4e59; }
.secondary:hover,.back:hover { background:#373941; }
.plus { font-size:23px; font-weight:380; line-height:.8; }
.top-grid { display:grid; grid-template-columns:minmax(0,1.15fr) minmax(0,1fr); gap:16px; }
.panel,.hero { border:1px solid var(--edge); border-radius:22px; background:var(--panel); min-width:0; }
.hero { background:linear-gradient(115deg,#2b2c33 5%,#272830 78%,#222329); position:relative; isolation:isolate; overflow:hidden; display:flex; align-items:center; }
.hero::before { content:""; z-index:-1; position:absolute; right:-185px; top:-130px; width:350px; height:480px; transform:rotate(-27deg); border-radius:46%; opacity:.47; background:repeating-radial-gradient(ellipse at 80% 49%,transparent 0 9px,#616473 9.7px 10.6px,transparent 11.3px 15.5px); }
.hero-content { padding:28px; }
.hero-label { font-size:14px; color:#d3d3dd; }
.balance-amount { display:block; margin:8px 0 6px; font-weight:580; line-height:1.05; font-size:clamp(30px,5vw,52px); letter-spacing:-.065em; font-variant-numeric:tabular-nums; overflow-wrap:anywhere; }
.hero-caption { font-size:13px; line-height:1.5; color:#b6b7c3; }
.hero .button { margin-top:24px; }
.accounts,.history { padding:23px; }
.accounts li { display:flex; align-items:center; gap:10px; padding:12px 0; border-bottom:1px solid #32333a; }
.accounts li:last-child,.history li:last-child { border-bottom:0; }
.acct { min-width:0; flex:1; }
.acct-name,.expense-title { display:block; font-size:15px; line-height:1.4; font-weight:560; overflow-wrap:anywhere; }
.acct-asof,.detail { display:block; margin-top:2px; color:var(--quiet); font-size:12px; line-height:1.45; overflow-wrap:anywhere; }
.acct-sum { font-size:14px; font-variant-numeric:tabular-nums; display:block; overflow-wrap:anywhere; text-align:right; }
.balance-edit { flex:none; min-width:42px; min-height:42px; border:1px solid #41434b; border-radius:11px; background:#27282f; color:#e5e6ee; font-size:17px; }
.balance-edit:hover { background:#34363e; }
.muted,.empty { color:var(--quiet); font-size:13px; line-height:1.55; }
#salary-note { border-top:1px solid var(--edge); margin-top:5px; padding-top:10px; }
.history { margin:16px 0 42px; }
.section-head { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:8px; margin-bottom:6px; }
.section-head p { font-size:13px; color:var(--quiet); }
.history li { display:flex; gap:12px; align-items:center; border-bottom:1px solid #32333a; padding:13px 0; }
.expense-icon { width:36px; height:36px; border-radius:11px; display:grid; place-items:center; background:#2e3039; color:#cbd0e2; font-size:17px; flex:none; }
.expense-copy { min-width:0; flex:1; }
.money { flex:none; font-size:15px; font-weight:600; font-variant-numeric:tabular-nums; max-width:40%; overflow-wrap:anywhere; text-align:right; }
.empty { padding:18px 0 4px; }
.notice { padding:12px 14px; border-radius:10px; background:#292c36; color:#dce3fa; font-size:14px; line-height:1.45; margin:10px 0; }
.notice.error { color:#ffcfca; background:#392829; }
.page { padding:28px 0 45px; }
.page-head { display:flex; align-items:center; gap:14px; margin:0 0 24px; }
.back { flex:none; width:44px; height:44px; border:1px solid #42444e; border-radius:13px; background:#25262c; color:var(--fg); font-size:20px; }
.choices { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; }
.choice { display:flex; text-align:left; align-items:flex-start; flex-direction:column; border-radius:18px; min-height:165px; padding:20px; border:1px solid var(--edge); background:var(--panel); color:var(--fg); }
.choice:hover { border-color:#676a78; }
.choice-main { background:#d4d6e0; color:#1c1d22; border-color:#d4d6e0; }
.choice-icon { font-size:27px; line-height:1; margin:0 0 25px; }
.choice strong { font-size:20px; font-weight:640; letter-spacing:-.035em; }
.choice small { font-size:13px; margin-top:5px; line-height:1.45; color:var(--quiet); }
.choice-main small { color:#444650; }
.help { margin-top:14px; }
.edit-grid { display:grid; grid-template-columns:minmax(200px,.8fr) minmax(0,1.2fr); gap:16px; align-items:start; }
.edit-grid.manual { grid-template-columns:minmax(0,590px); }
.shot { padding:18px; }
.shot summary { cursor:pointer; padding:5px 0 11px; font-weight:560; }
.shot img { display:block; max-width:100%; width:100%; max-height:410px; object-fit:contain; border-radius:10px; }
.shot .button { width:100%; margin:10px 0 6px; }
.form { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; padding:22px; }
.form label { display:flex; flex-direction:column; gap:6px; min-width:0; font-size:13px; color:#c8c9d2; font-weight:540; }
.form .full { grid-column:1/-1; }
.form input,.form select { width:100%; min-width:0; min-height:44px; padding:8px 10px; border:1px solid #454752; border-radius:10px; background:#191a1e; color:var(--fg); font-size:16px; }
.form input::placeholder { color:#9899a6; }
.form .notice { margin:0; }
.form [aria-invalid=true] { border-color:#de9c96; }
.form button[type=submit] { margin-top:2px; }
dialog { border:1px solid var(--edge); padding:0; border-radius:19px; width:min(390px,calc(100% - 28px)); max-height:90vh; overflow-y:auto; background:var(--panel); color:var(--fg); }
dialog::backdrop { background:#09090dbd; }
@media(max-width:740px) {
  .top-grid { grid-template-columns:1fr 1fr; gap:10px; }.accounts,.history,.hero-content {padding:17px;}
  .edit-grid { grid-template-columns:minmax(0,.8fr) minmax(0,1.2fr);gap:10px; }.form {padding:15px;}
}
@media(max-width:600px) {
  .top-inner {min-height:53px;gap:12px;}.brand {font-size:20px;}#cabinet {font-size:12px;}
  .home-heading {align-items:stretch; flex-direction:column;gap:15px;margin:22px 0 14px;}
  .segments {align-self:stretch;}.segments button {flex:1;min-height:40px;}
  .top-grid,.edit-grid,.choices {grid-template-columns:1fr;}.hero-content {padding:20px;}
  .balance-amount {font-size:clamp(30px,9vw,43px);}.hero .button {margin-top:16px;}
  .accounts,.history,.hero {border-radius:17px;}.history {margin-top:10px;}.history li {gap:9px;}
  .page {padding-top:19px;}.page-head {gap:10px;margin-bottom:17px;}
  .choice {min-height:85px;padding:14px 14px 14px 59px;position:relative;justify-content:center;}.choice-icon {position:absolute;left:20px;top:25px;}
  .choice strong {font-size:17px;}.choice small {margin-top:3px;}
  .shot {padding:13px;}.shot summary {min-height:40px;}.shot img {max-height:260px;}
}
@media(max-width:375px) {
  .form {grid-template-columns:1fr;}.top-inner {gap:9px;}.account-list li {gap:6px;}.money {font-size:13px;}
}
