:root {
  color-scheme: light;
  --rail: #191a31;
  --rail-ink: #c2c3d9;
  --ground: #f5f5fa;
  --paper: #fff;
  --ink: #222339;
  --muted: #62647d;
  --line: #e9e8f2;
  --action: #563dd4;
  --action-strong: #4630bb;
  --violet: #eee9ff;
  --radius: 15px;
  font-family: 'Segoe UI Variable', 'Segoe UI', system-ui, sans-serif;
  font-synthesis: none;
  color: var(--ink);
  background: var(--ground);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 300px; min-height: 100dvh; font-size: .94rem; line-height: 1.5; }
button, input, select { font: inherit; }
button, a, input, select { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .66; }
a { color: inherit; text-decoration: none; }
svg { width: 1.25rem; height: 1.25rem; flex: none; vertical-align: middle; }
h1, h2, h3, p, ul { margin: 0; }
h1, h2, h3 { line-height: 1.16; }
h1, h2 { letter-spacing: -.027em; }
p { color: var(--muted); }
::selection { background: #dcd4ff; color: #24195f; }
:focus-visible { outline: 2px solid #6953da; outline-offset: 3px; }
main:focus { outline: none; }
.skip { position: fixed; z-index: 20; left: 1rem; top: .6rem; padding: .6rem 1rem; color: var(--ink); background: white; transform: translateY(-160%); }
.skip:focus { transform: none; }

.layout { min-height: 100dvh; display: grid; grid-template-columns: 222px minmax(0, 1fr); }
.rail { position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; gap: 3rem; padding: 29px 18px 23px; background: var(--rail); color: #fff; }
.rail :focus-visible { outline-color: #c5b8ff; }
.brand { display: flex; align-items: center; gap: 11px; margin-left: 10px; width: max-content; }
.brand strong, .auth-brand strong { display: block; font-size: 1.16rem; letter-spacing: .055em; line-height: 1.24; }
.brand small { display: block; margin-top: 2px; color: var(--rail-ink); font-size: .74rem; }
.mark { display: inline-grid; flex: none; place-items: center; width: 40px; height: 40px; background: #7760f7; border-radius: 11px; color: white; }
.mark svg { width: 24px; height: 24px; stroke: none; fill: currentColor; }
.rail-nav { display: grid; gap: 5px; }
.rail-nav a, .rail-action { display: flex; align-items: center; gap: 12px; min-height: 46px; padding: 0 12px; border-radius: 9px; color: var(--rail-ink); font-weight: 600; font-size: .88rem; }
.rail-nav a[aria-current="page"] { color: #fff; background: #383158; }
.rail-nav a[aria-current="page"] svg { color: #cbbdff; }
.rail-nav a:hover, .rail-action:hover { color: #fff; background: #302b4a; }
.rail-foot { margin-top: auto; display: grid; gap: 12px; }
.rail-action { border: 0; background: none; text-align: left; }
.rail-security { padding: 16px 12px 0; border-top: 1px solid #3c3c55; color: var(--rail-ink); display: flex; align-items: center; gap: 8px; font-size: .75rem; }
.rail-security svg { width: 16px; height: 16px; color: #a998f4; }
.work { min-width: 0; }
.topbar { min-height: 75px; padding: 0 clamp(24px, 3.5vw, 52px); background: var(--paper); border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.top-trail, .top-actions, .profile { display: flex; align-items: center; gap: 14px; }
.top-trail { font-weight: 660; font-size: .88rem; }
.top-actions { gap: 18px; }
.profile { gap: 3px; }
.profile::before { content: ''; width: 1px; height: 30px; background: var(--line); margin-right: 12px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: #eae4ff; color: #4d35b9; display: grid; place-items: center; font-weight: 750; }
.demo-label { color: #604c9a; background: #f0ebfb; padding: 4px 8px; border-radius: 5px; font-size: .68rem; white-space: nowrap; }
.mobile-mark, .bottom-nav { display: none; }
.work main { width: min(100%, 1430px); margin: 0 auto; padding: 39px clamp(24px, 3.5vw, 52px) 48px; }
.page-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 26px; }
.page-heading h1 { font-size: clamp(2rem, 3.4vw, 3rem); font-weight: 750; }
.page-heading p { margin-top: 6px; max-width: 65ch; }
.date-chip { display: flex; align-items: center; gap: 8px; font-size: .82rem; font-weight: 650; color: #514d69; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 8px 11px; white-space: nowrap; }
.date-chip svg { color: #6b54ca; width: 16px; height: 16px; }

.button, .hero-button { min-height: 43px; padding: 0 13px; border-radius: 8px; border: 1px solid transparent; display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-size: .86rem; font-weight: 680; text-align: center; width: fit-content; }
.button svg, .hero-button svg { width: 17px; height: 17px; }
.primary, .quick { color: #fff; background: var(--action); }
.primary:hover, .quick:hover { background: var(--action-strong); }
.secondary { color: var(--ink); background: #f4f2fb; border-color: #ece8f7; }
.secondary:hover { background: #ebe6fa; }
.destructive { color: #fff; background: #a1294b; }
.destructive:hover { background: #81203c; }
.icon-button { width: 38px; height: 38px; display: inline-grid; place-items: center; border: 0; border-radius: 8px; background: transparent; color: #595776; }
.icon-button:hover, .icon-button[aria-expanded="true"] { background: #f0ecfa; color: var(--action); }
.menu-anchor { position: relative; flex: none; }
.popover { position: absolute; top: calc(100% + 5px); right: 0; min-width: 185px; padding: 5px; background: var(--paper); border-radius: 10px; box-shadow: 0 7px 24px #20203e29; z-index: 5; }
.menu-item { display: flex; width: 100%; min-height: 40px; align-items: center; gap: 9px; padding: 7px 10px; border: 0; border-radius: 6px; background: transparent; text-align: left; color: var(--ink); font-size: .86rem; white-space: nowrap; }
.menu-item svg { width: 16px; height: 16px; color: #65578c; }
.menu-item:hover { background: #f2eefb; }
.menu-item.danger, .menu-item.danger svg { color: #a1294b; }
.textlink, .text-button { display: inline-flex; align-items: center; gap: 7px; width: fit-content; min-height: 36px; padding: 0; background: none; border: 0; color: var(--action-strong); font-size: .84rem; font-weight: 680; }
.textlink:hover, .text-button:hover { text-decoration: underline; text-underline-offset: 3px; }
.textlink svg, .text-button svg { width: 16px; height: 16px; }
.subtle { color: #5c5378; }

.dashboard-grid { display: grid; grid-template-columns: 1.34fr 1fr; gap: 18px; }
.daily { position: relative; isolation: isolate; display: grid; overflow: hidden; min-height: 291px; border-radius: var(--radius); background: #392689; color: white; }
.daily-content { align-self: center; padding: 28px clamp(25px, 3vw, 38px); }
.daily-content h2 { font-size: clamp(1.75rem, 3vw, 2.5rem); font-weight: 730; }
.daily-content p { color: #e3dafa; margin-top: 10px; font-weight: 500; }
.daily-stats { display: flex; flex-wrap: wrap; gap: 8px 21px; margin: 23px 0; font-size: .84rem; font-weight: 660; }
.daily-stats span { display: inline-flex; align-items: center; gap: 7px; }
.dot { width: 8px; height: 8px; border-radius: 50%; }
.open-dot { background: #ffc2a7; }
.done-dot { background: #8ce2c4; }
.hero-button { color: #382581; background: #f6f2ff; }
.hero-button:hover { background: #e9dfff; }
.hero-button:focus-visible { outline-color: white; }
.daily-art { position: absolute; z-index: -1; width: 340px; height: 340px; right: -129px; bottom: -115px; transform: rotate(-36deg) scaleY(.72); pointer-events: none; }
.daily-art i, .daily-art b, .daily-art em { position: absolute; border: 1px solid #aa95fb66; border-radius: 50%; }
.daily-art i:nth-child(1) { inset: 0; }
.daily-art i:nth-child(2) { inset: 27px; }
.daily-art i:nth-child(3) { inset: 55px; }
.daily-art b { inset: 84px; background: #5b3dc1; }
.daily-art em { width: 12px; height: 12px; background: #e0d4ff; border: 0; top: 76px; left: 20px; box-shadow: 0 3px 16px #d7c7ff6e; }
.panel { min-width: 0; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); }
.next { padding: 17px 18px 12px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-bottom: 10px; }
.panel-title, .area-top { display: flex; align-items: center; gap: 10px; }
.panel-title h2, .area-top h2, .list-toolbar h2 { font-size: 1.12rem; font-weight: 725; }
.iconbox { width: 36px; height: 36px; display: inline-grid; place-items: center; border-radius: 9px; flex: none; }
.iconbox svg { width: 18px; height: 18px; }
.violet { color: #563bc9; background: #f0ebff; }
.iris { color: #5142ad; background: #ebe7fa; }
.mint { color: #176958; background: #e2f4ed; }
.peach { color: #a34934; background: #fbece6; }
.data-list { list-style: none; padding: 0; }
.data-row { min-height: 56px; display: flex; align-items: center; gap: 11px; padding: 7px 0; border-top: 1px solid var(--line); }
.row-text { min-width: 0; display: grid; flex: 1; }
.row-text strong { font-size: .87rem; line-height: 1.28; overflow-wrap: anywhere; font-weight: 690; }
.row-text small, .inbox-list small { color: var(--muted); font-size: .75rem; margin-top: 3px; overflow-wrap: anywhere; }
.check-control { width: 32px; min-height: 40px; display: grid; place-items: center; padding: 0; background: none; border: 0; border-radius: 8px; flex: none; }
.check-control span { display: grid; place-items: center; width: 19px; height: 19px; border: 1px solid #887aa7; border-radius: 5px; }
.check-control:hover span { border-color: var(--action); background: var(--violet); }
.check-control[aria-pressed="true"] span { color: white; background: var(--action); border-color: var(--action); }
.check-control svg { width: 14px; height: 14px; }
.completed .row-text strong { color: var(--muted); text-decoration: line-through; }
.due, .pill { flex: none; padding: 3px 7px; border-radius: 5px; font-weight: 650; font-size: .71rem; font-variant-numeric: tabular-nums; white-space: nowrap; background: #f1eff7; color: #5a5370; }
.due.urgent { background: #fbeddf; color: #8a4629; }
.pill.good { background: #e2f5ed; color: #166451; }
.mobile-due { display: none; }
.next-foot { border-top: 1px solid var(--line); padding-top: 3px; }
.panel-empty { min-height: 100px; border-top: 1px solid var(--line); display: grid; align-items: center; font-size: .85rem; }

.section-heading { margin: 30px 0 12px; }
.section-heading h2 { font-size: 1.26rem; }
.areas { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 17px; }
.area { min-height: 142px; padding: 15px 16px; display: grid; align-content: start; transition: border-color .16s ease-out, background-color .16s ease-out; }
.area:hover { border-color: #bdafea; background: #fcfaff; }
.area-top { margin-bottom: 12px; }
.area-top h3 { font-weight: 680; font-size: .9rem; }
.area-arrow { margin-left: auto; color: #574c79; }
.area-arrow svg { width: 17px; height: 17px; }
.area > strong { font-size: 1.04rem; letter-spacing: -.013em; font-weight: 730; }
.area > small { font-size: .77rem; color: var(--muted); margin-top: 3px; }

.inner-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(240px, 1fr); gap: 18px; align-items: start; }
.account-section { margin-bottom: 20px; }
.account-heading { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 0; }
.account-card { padding: 12px 14px 8px; }
.account-card .area-top { margin: 0; }
.account-card h3 { overflow-wrap: anywhere; }
.account-card .text-button { margin-top: 5px; }
.bank-summary { display: grid; gap: 3px; margin: 12px 0; }
.bank-summary strong { font-size: 1.3rem; font-variant-numeric: tabular-nums; }
.bank-summary span, .bank-summary small { font-size: .8rem; color: var(--muted); }
.bank-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 5px 10px; margin-top: 10px; }
.statement-toolbar { flex-wrap: wrap; }
.statement-toolbar h2 { display: flex; align-items: center; gap: 8px; }
.account-filter { display: flex; align-items: center; gap: 6px; max-width: 100%; color: var(--muted); font-size: .78rem; }
.account-filter select { min-width: 0; max-width: min(27ch, 60vw); min-height: 36px; padding: 4px 7px; border: 1px solid #d8d4e8; border-radius: 7px; color: var(--ink); background: #f8f7fc; }
.statement-pagination, .statement-pagination > div { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.statement-pagination { justify-content: space-between; border-top: 1px solid var(--line); padding-top: 10px; color: var(--muted); font-size: .8rem; font-variant-numeric: tabular-nums; }
.list-panel { padding: 17px 20px 12px; }
.list-toolbar { min-height: 49px; display: flex; justify-content: space-between; align-items: center; gap: 10px; padding-bottom: 11px; }
.count { color: #57479c; background: var(--violet); font-variant-numeric: tabular-nums; display: grid; place-items: center; border-radius: 6px; min-width: 25px; padding: 2px 6px; font-size: .8rem; font-weight: 700; }
.managed .data-row { min-height: 63px; }
.side-panel { padding: 19px; }
.side-panel h3 { margin: 16px 0 7px; }
.side-panel .pill { display: inline-block; }
.side-panel p { margin: 12px 0 6px; font-size: .86rem; }
.empty { display: grid; justify-items: center; gap: 8px; text-align: center; padding: 32px 12px; border-top: 1px solid var(--line); }
.empty h3 { font-size: 1.02rem; }
.empty p { font-size: .85rem; max-width: 46ch; }
.filters { padding: 3px; display: flex; gap: 3px; border: 1px solid var(--line); border-radius: 9px; background: #f8f7fc; flex-wrap: wrap; }
.filters button { font-size: .78rem; font-weight: 650; padding: 6px 9px; min-height: 34px; border: 0; background: transparent; color: #5b5575; border-radius: 6px; }
.filters button[aria-pressed="true"], .filters button:hover { background: #ede7fb; color: #4732af; }

dialog { width: min(485px, calc(100% - 24px)); max-height: calc(100dvh - 30px); padding: 0; background: white; color: var(--ink); border: 0; border-radius: var(--radius); box-shadow: 0 18px 60px #17122d4d; }
dialog::backdrop { background: #1b173d89; }
dialog[open] { animation: appear .18s cubic-bezier(.2,.8,.3,1) both; }
@keyframes appear { from { transform: translateY(8px); opacity: .75; } to { transform: none; opacity: 1; } }
.dialog-head { padding: 19px 21px 12px; display: flex; justify-content: space-between; gap: 10px; align-items: start; }
.dialog-head h2 { padding-top: 4px; font-size: 1.38rem; }
.dialog-head p { margin-top: 6px; font-size: .86rem; }
.dialog-head .icon-button { margin: -3px -5px 0 0; flex: none; }
.dialog-content, dialog .form-fields { padding: 2px 21px 20px; }
.dialog-footer { display: flex; flex-wrap: wrap; justify-content: end; gap: 8px; padding-top: 6px; }
.form-fields { display: grid; gap: 13px; }
.form-fields label { font-size: .84rem; font-weight: 680; display: block; }
.form-fields input, .form-fields select { display: block; width: 100%; color: var(--ink); background: #f8f7fc; border: 1px solid #d8d4e8; border-radius: 8px; min-height: 45px; margin: 5px 0 0; padding: 7px 9px; font-size: 1rem; font-weight: 500; }
.form-fields input[readonly] { color: var(--muted); background: #f0eef6; }
.form-fields input::placeholder { color: #706985; }
.form-fields input:focus, .form-fields select:focus { caret-color: var(--action); outline: 2px solid #7560d9; outline-offset: 1px; }
.form-fields small, .optional { display: inline-block; color: var(--muted); font-weight: 500; font-size: .75rem; margin: 4px 0 0; }
.optional { margin: 0 0 0 3px; }
.form-fields .file-label { padding: 12px; border-radius: 9px; border: 1px dashed #a697d1; background: #f8f5ff; }
.file-label > span { margin-left: 8px; }
.file-label input { width: 100%; border: none; background: transparent; padding: 5px 0 0; font-size: .82rem; }
.file-label input::file-selector-button { padding: 7px; border: 0; border-radius: 5px; background: #e9e1fc; color: #46339e; font: inherit; margin-right: 5px; }
.form-error { background: #ffeff2; padding: 8px 11px; color: #8f2445; border-radius: 7px; font-size: .84rem; }
.install-steps { display: grid; gap: 12px; }
.install-steps strong { color: var(--ink); }
.inbox-list li { display: grid; padding: 9px 0; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.loading { padding: 30px; color: var(--muted); }
.auth-layout { min-height: 100dvh; padding: 28px 13px; display: grid; justify-items: center; align-content: center; gap: 19px; }
.auth-brand { display: flex; align-items: center; gap: 9px; }
.auth-brand span:last-child { color: var(--muted); font-size: .8rem; margin-left: 2px; }
.auth-card { width: min(100%, 460px); padding: clamp(18px, 5vw, 30px); background: #fff; border: 1px solid var(--line); border-radius: var(--radius); display: grid; gap: 12px; }
.auth-card h1 { font-size: clamp(1.62rem, 6vw, 2rem); }
.auth-card > p { margin-bottom: 4px; }
.auth-card .primary[type="submit"] { width: 100%; margin-top: 3px; }
.secret { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px; padding: 6px 8px; border-radius: 7px; background: #f3edfd; overflow-wrap: anywhere; }
.secret code { min-width: 0; font-size: .83rem; }
.recover { list-style: none; padding: 7px 9px; display: grid; gap: 5px; border-radius: 7px; background: #f3edfd; }
#toast { pointer-events: none; visibility: hidden; position: fixed; z-index: 25; right: 18px; bottom: 18px; margin-left: 18px; max-width: 37ch; background: #272044; color: #fff; border-radius: 9px; padding: 10px 13px; box-shadow: 0 7px 20px #23204533; font-size: .88rem; }
#toast.shown { visibility: visible; }
#toast.failure { background: #8b2342; }

@media (max-width: 1090px) {
  .layout { grid-template-columns: 191px minmax(0, 1fr); }
  .rail { padding-inline: 13px; }
  .daily-art { right: -174px; }
  .dashboard-grid { grid-template-columns: 1.15fr 1fr; }
}
@media (max-width: 840px) {
  .layout { grid-template-columns: 64px minmax(0, 1fr); }
  .rail { align-items: stretch; padding-inline: 9px; }
  .brand { margin: 0 auto; }
  .brand > span:last-child, .rail-nav span, .rail-action span, .rail-security span { position: absolute; clip-path: inset(50%); width: 1px; height: 1px; overflow: hidden; white-space: nowrap; }
  .rail-nav a, .rail-action, .rail-security { justify-content: center; padding-inline: 0; }
}
@media (max-width: 680px) {
  .layout { display: block; }
  .rail { display: none; }
  .topbar { min-height: 60px; padding: max(8px, env(safe-area-inset-top)) 13px 8px; }
  .top-trail, .top-actions { gap: 8px; }
  .top-trail > span:nth-child(2) { display: none; }
  .mobile-mark { display: inline-flex; }
  .mark { width: 34px; height: 34px; border-radius: 9px; }
  .mark svg { width: 21px; height: 21px; }
  .avatar, .profile::before { display: none; }
  .profile .icon-button { width: 42px; height: 42px; }
  .work main { padding: 23px 13px calc(86px + env(safe-area-inset-bottom)); }
  .page-heading { flex-wrap: wrap; align-items: start; gap: 11px; margin-bottom: 17px; }
  .page-heading h1 { font-size: 2rem; }
  .page-heading p { font-size: .87rem; }
  .date-chip { padding: 5px 8px; font-size: .74rem; }
  .dashboard-grid, .inner-grid { grid-template-columns: 1fr; gap: 12px; }
  .daily { min-height: 234px; }
  .daily-content { padding: 24px 20px; }
  .daily-content p { font-size: .89rem; }
  .daily-stats { margin: 16px 0; }
  .daily-art { right: -130px; bottom: -143px; }
  .next { padding-inline: 13px; }
  .section-heading { margin-top: 23px; }
  .areas { gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .area { min-height: 123px; padding: 11px; }
  .area-top { margin-bottom: 8px; gap: 8px; }
  .area > strong { font-size: .94rem; }
  .area > small { font-size: .72rem; }
  .area .iconbox { width: 30px; height: 30px; }
  .account-card { padding: 8px; }
  .account-card .area-top { gap: 5px; }
  .account-card .iconbox { width: 25px; height: 25px; }
  .account-card .iconbox svg { width: 15px; height: 15px; }
  .account-card .more { width: 32px; }
  .bottom-nav { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); position: fixed; bottom: 0; left: 0; right: 0; z-index: 8; background: #fff; border-top: 1px solid var(--line); padding: 3px max(3px, env(safe-area-inset-right)) calc(3px + env(safe-area-inset-bottom)) max(3px, env(safe-area-inset-left)); }
  .bottom-nav a { position: relative; display: grid; justify-items: center; align-content: center; gap: 2px; padding: 2px; min-height: 51px; color: #5f5b77; font-size: .65rem; font-weight: 650; }
  .bottom-nav a[aria-current="page"] { color: var(--action-strong); }
  .bottom-nav a[aria-current="page"]::before { position: absolute; top: 0; left: calc(50% - 9px); content: ''; width: 18px; height: 2px; border-radius: 0 0 3px 3px; background: var(--action); }
  .bottom-nav a:focus-visible { outline-offset: -3px; }
  .list-panel { padding-inline: 11px; }
  .managed .data-row { gap: 7px; }
  .list-toolbar:has(.filters) { flex-wrap: wrap; }
  .mail-row { flex-wrap: wrap; }
  .mail-row .row-text { flex-basis: 45%; }
  .mail-row .pill { font-size: .66rem; }
  .iconbox { width: 32px; height: 32px; }
  .menu-item, .button, .hero-button, .check-control { min-height: 44px; }
  .icon-button { width: 44px; height: 44px; }
  #toast { bottom: calc(66px + env(safe-area-inset-bottom)); }
}
@media (max-width: 375px) {
  .compact-due { display: none; }
  .mobile-due { display: inline; }
  .mail-row .row-text { flex-basis: 43%; }
  .mail-row .pill { order: 1; margin: -8px 0 4px 39px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
