:root, :root[data-theme="dark"] {
  --canvas: #101012;
  --surface: #1a1a1e;
  --surface-raised: #242428;
  --surface-hover: #2d2d33;
  --line: #303035;
  --text: #f5f5f7;
  --muted: #a5a5af;
  --pink: #ff4b86;
  --lime: #bdF65a;
  --cyan: #55dbe6;
  --orange: #ffb46a;
  --radius: 20px;
  --ease: cubic-bezier(.16,1,.3,1);
  color-scheme: dark;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--canvas); color: var(--text); font-family: var(--font-sans); font-size: 15px; line-height: 1.45; font-optical-sizing: auto; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button, a { touch-action: manipulation; }
button { cursor: pointer; }
button { color: inherit; }
button:disabled { opacity: .45; cursor: wait; }
button:active:not(:disabled) { transform: scale(.975); }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--cyan); outline-offset: 4px; }
a { color: var(--cyan); text-underline-offset: 4px; }
input, textarea { caret-color: var(--pink); }
::selection { color: #101012; background: var(--lime); }
::-webkit-scrollbar { width: 7px; height: 7px; }
::-webkit-scrollbar-thumb { background: #42424a; border-radius: 8px; }
[hidden] { display: none !important; }
h1,h2,h3,p { margin: 0; }
h1 { font-size: 2rem; font-weight: 700; line-height: 1.12; letter-spacing: -.028em; }
h2 { font-size: 1.13rem; font-weight: 650; line-height: 1.25; letter-spacing: -.015em; }
h3 { font-size: 1rem; font-weight: 600; }
small { font-size: .78rem; }
.muted { color: var(--muted); }
.pink { color: var(--pink); }
.lime { color: var(--lime); }
.cyan { color: var(--cyan); }
.number { font-variant-numeric: tabular-nums; letter-spacing: -.025em; }
.icon { width: 21px; height: 21px; flex: 0 0 auto; vertical-align: middle; }
.skip-link { position: fixed; z-index: 500; left: 20px; top: -100px; padding: 12px 20px; background: var(--text); color: var(--canvas); border-radius: 10px; }
.skip-link:focus { top: 10px; }
.sidebar { position: fixed; z-index: 20; inset: 0 auto 0 0; width: 224px; padding: 35px 18px 20px; background: #161618; border-right: 1px solid #242427; display: flex; flex-direction: column; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--text); text-decoration: none; font-size: 1.9rem; font-weight: 750; letter-spacing: -.04em; padding: 0 13px; margin-bottom: 48px; }
.brand svg { width: 36px; height: 36px; display: block; }
.brand-dot { color: var(--pink); }
#navigation { display: flex; flex-direction: column; gap: 7px; }
.nav-item { display: flex; align-items: center; gap: 13px; padding: 13px 15px; min-height: 48px; border-radius: 12px; border: 0; color: var(--muted); background: transparent; text-align: left; font-weight: 500; width: 100%; }
.nav-item:hover { background: var(--surface-raised); color: var(--text); }
.nav-item.active { color: var(--text); background: #2b2b30; }
.nav-item.active .icon { color: var(--pink); }
.nav-divider { height: 1px; background: var(--line); margin: 14px 12px; }
.sidebar-bottom { margin-top: auto; }
.mini-goal { padding: 17px 14px; margin: 24px 2px; border-radius: 14px; background: #202024; }
.mini-goal .mini-top { display: flex; justify-content: space-between; font-size: .78rem; color: var(--muted); }
.mini-goal strong { display: block; margin: 8px 0 12px; font-size: 1.1rem; }
.progress-track { height: 5px; background: #3c2730; overflow: hidden; border-radius: 8px; }
.progress-track>span { display: block; height: 100%; background: var(--pink); border-radius: inherit; }
.profile { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; background: none; border: 0; padding: 8px; }
.profile strong { display: block; font-size: .85rem; font-weight: 500; }
.profile small { color: var(--muted); font-size: .7rem; }
.profile>.icon, #profile-chevron { margin-left: auto; }
.avatar { background: #34343c; color: #d6d6e4; width: 36px; height: 36px; display: grid; place-items: center; font-size: .8rem; border-radius: 50%; }
main { margin-left: 224px; padding: 39px 42px 22px; max-width: 1820px; }
.page-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 29px; }
#today-label { margin-top: 7px; color: var(--muted); font-size: .85rem; }
.header-actions { display: flex; align-items: center; gap: 12px; }
.button { display: inline-flex; justify-content: center; align-items: center; gap: 8px; min-height: 44px; border-radius: 11px; padding: 11px 17px; border: 0; background: var(--surface-raised); color: var(--text); font-weight: 550; font-size: .85rem; text-decoration: none; transition: background .18s, transform .18s var(--ease); }
.button:hover { background: var(--surface-hover); }
.button.primary { background: var(--pink); color: #18060d; font-weight: 650; }
.button.primary:hover { background: #ff72a0; }
.button.subtle { background: transparent; color: var(--muted); }
.button.subtle:hover { background: var(--surface-raised); color: var(--text); }
.button.small { min-height: 40px; padding: 8px 12px; font-size: .8rem; }
.button.danger { color: #ff8b98; }
.icon-button { width: 44px; height: 44px; display: inline-grid; place-items: center; border: 0; border-radius: 10px; background: transparent; color: var(--muted); flex: 0 0 auto; }
.icon-button:hover { background: var(--surface-raised); color: var(--text); }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 21px; flex-wrap: wrap; }
.month-picker { display: flex; align-items: center; gap: 5px; }
.month-picker strong { font-size: .95rem; min-width: 140px; text-align: center; font-weight: 550; text-transform: capitalize; }
.month-picker .icon-button { width: 35px; }
.segment { display: flex; background: #1e1e23; padding: 4px; border-radius: 10px; gap: 2px; }
.segment button { background: transparent; border: 0; color: var(--muted); min-height: 34px; padding: 6px 14px; border-radius: 7px; font-size: .78rem; }
.segment button.active { color: var(--text); background: #3a3a41; }
.section-note { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: .75rem; }
.status-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); display: inline-block; }
.status-dot.good { background: var(--lime); }
.panel { background: var(--surface); border-radius: var(--radius); padding: 25px; min-width: 0; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 22px; }
.panel-head .muted { font-size: .75rem; }
.dashboard-top { display: grid; grid-template-columns: minmax(310px,.9fr) minmax(400px,1.4fr); gap: 20px; }
.activity-panel { padding-bottom: 22px; }
.activity-ring { width: 245px; height: 245px; display: block; margin: 4px auto 16px; overflow: visible; }
.activity-ring .ring-track, .activity-ring .ring-value { fill: none; stroke-width: 15; }
.ring-value { stroke-linecap: round; transition: stroke-dashoffset 1.1s var(--ease); }
.ring-label { fill: var(--text); font-size: 39px; font-weight: 700; letter-spacing: -1px; }
.ring-caption { fill: var(--muted); font-size: 12px; }
.ring-arrow { font-size: 17px; font-weight: 700; fill: #1a1016; }
.activity-legend { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; text-align: center; }
.activity-legend .legend-title { font-size: .75rem; display: flex; align-items: center; justify-content: center; gap: 6px; }
.activity-legend strong { display: block; font-size: 1.05rem; margin-top: 5px; font-weight: 650; }
.activity-legend small { font-size: .7rem; color: var(--muted); }
.legend-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; display: inline-block; }
.chart-total { display: flex; align-items: baseline; gap: 12px; margin-top: -2px; }
.chart-total strong { font-size: 2.4rem; line-height: 1.2; font-weight: 650; letter-spacing: -.035em; }
.chart-total .currency { color: var(--muted); font-size: 1.55rem; font-weight: 400; }
.change { display: inline-flex; color: var(--lime); font-size: .72rem; font-weight: 500; background: #283321; padding: 4px 7px; border-radius: 6px; }
.change.neutral { color: var(--muted); background: var(--surface-raised); }
.chart-sub { color: var(--muted); font-size: .77rem; margin-top: 7px; }
.income-chart { width: 100%; display: block; overflow: visible; margin-top: 18px; aspect-ratio: 2.6; }
.chart-axis { font-family: var(--font-sans); font-size: 13px; fill: var(--muted); }
.chart-legend { display: flex; gap: 22px; font-size: .72rem; color: var(--muted); margin-top: 8px; }
.chart-legend span { display: flex; align-items: center; gap: 7px; }
.line-key { width: 18px; height: 3px; background: var(--pink); border-radius: 3px; }
.line-key.plan { height: 0; border-top: 2px dashed #7d7d88; background: transparent; }
.goal-message { display: flex; align-items: center; gap: 12px; padding: 15px 17px; background: #242426; border-radius: 12px; margin-top: 23px; }
.goal-message>.icon { color: var(--lime); width: 24px; height: 24px; }
.goal-message p { font-size: .8rem; }
.goal-message strong { color: var(--lime); font-weight: 600; }
.goal-message small { display: block; color: var(--muted); margin-top: 3px; font-size: .71rem; }
.stats-strip { display: grid; grid-template-columns: repeat(3,1fr); margin: 24px 0; background: var(--surface); border-radius: 16px; }
.stat-item { padding: 19px 23px; position: relative; }
.stat-item+.stat-item::before { content: ''; position: absolute; top: 23px; bottom: 23px; width: 1px; left: 0; background: var(--line); }
.stat-label { color: var(--muted); font-size: .76rem; display: flex; align-items: center; gap: 7px; }
.stat-label .icon { width: 15px; height: 15px; }
.stat-item strong { font-size: 1.4rem; font-weight: 600; display: block; margin-top: 7px; }
.stat-item small { color: var(--muted); font-size: .69rem; display: block; margin-top: 3px; }
.dashboard-bottom { display: grid; grid-template-columns: minmax(0,1.4fr) minmax(300px,.9fr); gap: 20px; }
.text-link { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); background: none; border: 0; font-size: .75rem; padding: 8px 0 8px 8px; min-height: 36px; }
.text-link:hover { color: var(--pink); }
.text-link .icon { width: 15px; }
.income-list { display: flex; flex-direction: column; }
.income-row { display: flex; align-items: center; gap: 12px; padding: 14px 0; border-top: 1px solid #2b2b30; min-width: 0; }
.income-row:first-child { border-top: none; padding-top: 0; }
.category-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px; flex: 0 0 auto; background: color-mix(in srgb,var(--category-color) 12%,transparent); color: var(--category-color); }
.category-icon .icon { width: 19px; height: 19px; }
.income-description { flex: 1; min-width: 0; }
.income-description strong { font-size: .85rem; font-weight: 500; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.income-description small { color: var(--muted); font-size: .71rem; display: block; margin-top: 3px; }
.income-amount { text-align: right; flex: 0 0 auto; }
.income-amount strong { font-size: .88rem; font-weight: 600; }
.income-amount small { color: var(--muted); font-size: .7rem; display: block; margin-top: 3px; }
.task-row { display: flex; align-items: flex-start; gap: 11px; padding: 14px 0; border-bottom: 1px solid #2b2b30; }
.task-row:last-child { border: 0; }
.task-check { display: grid; place-items: center; width: 44px; height: 44px; margin: -7px -6px -5px; background: transparent; border: 0; border-radius: 50%; flex: 0 0 auto; }
.task-check::before { content: ''; width: 20px; height: 20px; border: 1.5px solid #64646f; border-radius: 50%; grid-area: 1/1; }
.task-check:hover::before { border-color: var(--lime); }
.task-check.done::before { background: var(--lime); border-color: var(--lime); }
.task-check .icon { width: 14px; height: 14px; color: #142000; grid-area: 1/1; z-index: 1; }
.task-info { flex: 1; min-width: 0; }
.task-info strong { font-size: .82rem; font-weight: 450; }
.task-info small { display: flex; align-items: center; gap: 6px; color: var(--muted); margin-top: 4px; font-size: .69rem; flex-wrap: wrap; }
.task-info small .icon { width: 12px; height: 12px; }
.task-row.completed .task-info strong { text-decoration: line-through; color: var(--muted); }
.priority { color: var(--orange); }
.new-task-button { width: 100%; justify-content: flex-start; padding-left: 0; color: var(--muted); background: transparent; margin-top: 9px; }
.new-task-button .icon { width: 19px; }
.category-section { margin-top: 25px; }
.category-bars { display: flex; height: 9px; gap: 4px; overflow: hidden; border-radius: 5px; margin: 18px 0; }
.category-bars span { min-width: 5px; border-radius: 4px; }
.category-summary { display: flex; flex-wrap: wrap; gap: 20px; }
.category-summary>div { flex: 1; min-width: 130px; }
.category-summary .category-name { font-size: .75rem; color: var(--muted); display: flex; align-items: center; gap: 7px; }
.category-summary strong { display: block; font-size: 1rem; font-weight: 550; margin-top: 6px; }
#mobile-nav { display: none; }
.empty { text-align: center; padding: 32px 18px; color: var(--muted); }
.empty>.icon { width: 32px; height: 32px; margin-bottom: 15px; color: var(--pink); }
.empty h3 { color: var(--text); margin-bottom: 7px; }
.empty p { font-size: .83rem; max-width: 370px; margin: 0 auto 15px; }
.welcome { display: flex; justify-content: space-between; align-items: center; gap: 20px; background: #232020; border-radius: 16px; padding: 20px 24px; margin-bottom: 22px; }
.welcome h2 { font-size: 1rem; margin-bottom: 5px; }
.welcome p { color: var(--muted); font-size: .8rem; }
.welcome .actions { display: flex; gap: 8px; flex-wrap: wrap; }
input, select, textarea { width: 100%; background: #242429; color: var(--text); border: 1px solid #3b3b43; border-radius: 9px; min-height: 44px; padding: 10px 12px; outline: none; }
input::placeholder, textarea::placeholder { color: #a0a0ac; }
input:focus, select:focus, textarea:focus { border-color: var(--cyan); }
input[type=checkbox] { width: 20px; height: 20px; min-height: 20px; accent-color: var(--pink); }
.filters { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 20px; }
.filters select { width: auto; font-size: .8rem; min-width: 140px; }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: .82rem; text-align: left; }
th { color: var(--muted); font-weight: 450; font-size: .7rem; padding: 0 12px 15px; white-space: nowrap; border-bottom: 1px solid var(--line); }
td { padding: 16px 12px; border-bottom: 1px solid #29292f; }
td:first-child,th:first-child { padding-left: 0; }
td:last-child,th:last-child { padding-right: 0; }
tbody tr:last-child td { border-bottom: 0; }
td strong { font-weight: 500; }
td small { color: var(--muted); display: block; margin-top: 3px; font-size: .7rem; }
.status { font-size: .7rem; padding: 5px 8px; border-radius: 6px; display: inline-flex; background: #293522; color: var(--lime); white-space: nowrap; }
.status.pending { background: #3a3024; color: var(--orange); }
.status.cancelled { background: #333338; color: var(--muted); }
.table-total { display: flex; justify-content: space-between; color: var(--muted); font-size: .8rem; padding-top: 20px; margin-top: 5px; border-top: 1px solid var(--line); }
.table-total strong { color: var(--text); }
.two-columns { display: grid; grid-template-columns: 1.25fr 1fr; gap: 20px; }
.stack { display: flex; flex-direction: column; gap: 20px; }
.heatmap { display: grid; grid-template-columns: repeat(7,1fr); gap: 8px; margin-top: 20px; }
.heatmap-cell { aspect-ratio: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; border-radius: 8px; background: #242428; font-size: .8rem; min-width: 0; }
.heatmap-cell small { font-size: .7rem; color: inherit; opacity: .8; }
.heatmap-cell.earned { background: color-mix(in srgb, var(--pink) var(--strength), #251b20); color: #fff; }
.heatmap-day { text-align: center; color: var(--muted); font-size: .7rem; }
.bar-chart { display: flex; align-items: flex-end; gap: 12px; height: 200px; padding-top: 25px; }
.bar-item { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 10px; min-width: 0; }
.bar-item .bar { width: 100%; max-width: 60px; border-radius: 7px 7px 2px 2px; background: var(--pink); min-height: 3px; }
.bar-item small { font-size: .7rem; color: var(--muted); }
.bar-item b { font-weight: 500; font-size: .7rem; }
.calendar-grid { display: grid; grid-template-columns: repeat(7,minmax(0,1fr)); gap: 5px; }
.calendar-cell { min-height: 102px; padding: 9px; background: #212125; border-radius: 9px; text-align: left; border: 1px solid transparent; display: flex; flex-direction: column; gap: 5px; }
.calendar-cell:hover { background: var(--surface-hover); }
.calendar-cell.selected { border-color: var(--cyan); }
.calendar-cell.today .day-number { color: #071a1d; background: var(--cyan); }
.calendar-cell.faded { opacity: .35; }
.day-number { width: 25px; height: 25px; border-radius: 50%; display: grid; place-items: center; font-size: .8rem; }
.calendar-event { font-size: .7rem; background: #19373a; color: #9eeef4; padding: 3px 5px; border-radius: 4px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; max-width: 100%; }
.calendar-cell .day-amount { color: var(--lime); font-size: .7rem; margin-top: auto; }
.event-row { padding: 16px 0; border-bottom: 1px solid var(--line); display: flex; gap: 13px; }
.event-time { color: var(--cyan); font-size: .8rem; min-width: 44px; }
.event-row strong { display: block; font-weight: 500; font-size: .85rem; }
.event-row small { color: var(--muted); font-size: .7rem; }
.tasks-layout { max-width: 900px; }
.task-group { margin-bottom: 24px; }
.task-group h2 { margin-bottom: 16px; font-size: 1rem; }
.task-edit { background: none; border: 0; text-align: left; padding: 0; max-width: 100%; }
.task-edit:hover { color: var(--cyan); }
.settings-layout { max-width: 950px; }
.settings-section { margin-bottom: 20px; }
.settings-section p { color: var(--muted); font-size: .82rem; margin-top: 7px; }
.settings-section .panel-head { margin-bottom: 22px; }
.integration-heading { display: flex; align-items: center; gap: 12px; }
.integration-logo { width: 43px; height: 43px; border-radius: 12px; display: grid; place-items: center; font-weight: 600; font-size: 1.5rem; }
.integration-logo.yandex { background: #332226; color: #ff8088; }
.integration-logo.telegram { background: #18343c; color: #61daf4; }
.settings-fields, .form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 17px; }
label { display: block; font-size: .77rem; color: #c2c2cc; }
label>input, label>select, label>textarea { margin-top: 7px; }
.full { grid-column: 1/-1; }
.form-note { color: var(--muted); font-size: .73rem; margin-top: 12px; }
.form-note a { color: var(--cyan); }
.form-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 23px; flex-wrap: wrap; }
.toggle-row { display: flex; align-items: center; gap: 10px; font-size: .82rem; margin-top: 17px; }
.connection-state { font-size: .7rem; color: var(--muted); background: #29292f; border-radius: 6px; padding: 5px 8px; }
.connection-state.connected { color: var(--lime); background: #293522; }
.connection-result { font-size: .75rem; color: var(--muted); margin-top: 13px; white-space: pre-wrap; }
.warning-note { background: #322a20; color: #e8c7a4; padding: 13px 15px; border-radius: 10px; font-size: .77rem; margin-top: 18px; }
dialog { width: min(570px,calc(100% - 32px)); max-height: min(92dvh,900px); background: #1d1d22; color: var(--text); border: 0; border-radius: 22px; padding: 28px; box-shadow: 0 24px 90px #0008; overscroll-behavior: contain; }
dialog::backdrop { background: #0009; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 22px; }
.dialog-head h2 { font-size: 1.4rem; }
.dialog-head .icon-button { margin: -9px -10px -9px 0; }
.dialog-error { background: #42232e; color: #ffb9cf; padding: 11px; margin-top: 15px; border-radius: 8px; font-size: .8rem; }
#editor-content, #editor .form-grid > * { min-width: 0; }
#editor input, #editor select, #editor textarea { min-width: 0; max-width: 100%; }
#toast { position: fixed; left: calc(50% + 112px); transform: translateX(-50%); bottom: 27px; max-width: min(550px,calc(100% - 32px)); z-index: 200; background: #35353d; border: 0; padding: 13px 18px; border-radius: 13px; box-shadow: 0 12px 40px #0005; display: flex; align-items: center; gap: 16px; font-size: .83rem; }
#toast button { border: 0; background: transparent; color: var(--cyan); font-size: .8rem; }
.login-page { min-height: 100dvh; display: grid; place-items: center; padding: 25px; }
.login-panel { width: 100%; max-width: 380px; }
.login-panel .brand { justify-content: center; margin-bottom: 35px; }
.login-panel h1 { font-size: 1.8rem; text-align: center; }
.login-panel p { text-align: center; color: var(--muted); font-size: .85rem; margin: 12px 0 25px; }
.login-panel .button { width: 100%; margin-top: 20px; }
.offline { color: var(--orange); }
.skeleton { height: 380px; border-radius: var(--radius); background: var(--surface); }
@media (min-width:1600px) { main { padding-left: 60px; padding-right: 60px; } .activity-ring { width: 265px; height: 265px; } }
@media (max-width:1200px) { .sidebar { width: 200px; padding-inline: 14px; } main { margin-left: 200px; padding: 32px 26px 20px; } .dashboard-top { grid-template-columns: minmax(280px,.9fr) minmax(340px,1.3fr); gap: 16px; } .panel { padding: 21px; } .dashboard-bottom { grid-template-columns: 1.3fr 1fr; gap: 16px; } .activity-ring { width: 225px; height: 225px; } .chart-total strong { font-size: 2rem; } .goal-message { margin-top: 18px; } .stat-item { padding: 18px; } .two-columns { grid-template-columns: 1fr; } }
@media (max-width:1000px) and (min-width:761px) { .sidebar { width: 78px; padding-inline: 12px; } .brand { padding: 0 8px; } .brand>span:last-child,.nav-item>span,.sidebar-bottom { display:none; } .nav-item { padding: 14px; justify-content: center; } main { margin-left: 78px; } #toast { left:calc(50% + 39px); } .dashboard-top { grid-template-columns: minmax(280px,.9fr) minmax(340px,1.2fr); } }
@media (max-width:760px) {
  .sidebar { display: none; }
  html { height:100%; }
  body { min-height:100svh; }
  #shell { height:100vh; height:100dvh; display:grid; grid-template-rows:minmax(0,1fr) auto; overflow:hidden; }
  main { min-height:0; overflow-y:auto; overflow-x:hidden; overscroll-behavior-y:contain; margin:0; padding:calc(22px + env(safe-area-inset-top)) 20px 24px; }
  h1 { font-size: 1.9rem; }
  .page-header { align-items: flex-start; gap: 12px; margin-bottom: 23px; }
  #today-label { font-size: .76rem; margin-top: 6px; }
  .header-actions { gap: 5px; }
  .header-actions>.primary { width: 44px; height: 44px; padding: 0; border-radius: 50%; }
  .header-actions>.primary>span:last-child { display: none; }
  .dashboard-top,.dashboard-bottom,.two-columns { grid-template-columns: 1fr; gap: 17px; }
  .panel { padding: 21px; border-radius: 18px; }
  .activity-ring { width: 250px; height: 250px; margin-top: 0; margin-bottom: 18px; }
  .activity-panel .panel-head { margin-bottom: 6px; }
  .activity-legend strong { font-size: 1.05rem; }
  .activity-legend .legend-title { font-size: .72rem; }
  .activity-legend small { font-size: .7rem; }
  .chart-total strong { font-size: 2.15rem; }
  .chart-total .currency { font-size: 1.3rem; }
  .income-chart { aspect-ratio: 1.85; }
  .goal-message { margin-top: 19px; padding: 13px; }
  .goal-message small { font-size: .7rem; }
  .stats-strip { grid-template-columns: repeat(2,1fr); margin: 17px 0; }
  .stat-item { padding: 18px 19px; }
  .stat-item:nth-child(3),.stat-item:nth-child(4) { border-top: 1px solid var(--line); }
  .stat-item:nth-child(3)::before { display: none; }
  .stat-item strong { font-size: 1.3rem; }
  .toolbar { margin-bottom: 16px; gap: 8px; }
  .section-note { font-size: .7rem; }
  .month-picker { margin-left: -9px; }
  .month-picker strong { font-size: .88rem; min-width: 120px; }
  #mobile-nav { position: relative; z-index: 30; inset:auto; display: flex; justify-content: space-around; padding: 9px 7px max(9px, env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid #36363c; }
  #mobile-nav .nav-item { width: auto; min-width: 52px; flex-direction: column; justify-content: center; gap: 4px; padding: 4px 6px; background: none; min-height: 44px; font-size: .7rem; border-radius: 8px; }
  #mobile-nav .nav-item .icon { width: 21px; height: 21px; }
  #mobile-nav .nav-item.active { color: var(--pink); }
  #toast { left: 50%; bottom: calc(83px + env(safe-area-inset-bottom)); width: max-content; font-size: .78rem; }
  .welcome { display: block; padding: 18px; }
  .welcome .actions { margin-top: 14px; }
  .welcome .button { font-size: .75rem; }
  .category-summary { gap: 16px; }
  .category-summary>div { min-width: 100px; }
  .category-summary .category-name { font-size: .7rem; }
  .category-summary strong { font-size: .9rem; }
  .settings-fields { grid-template-columns: 1fr; }
  .form-grid { gap: 15px 12px; }
  .form-grid .mobile-full { grid-column: 1/-1; }
  .settings-section .panel-head { align-items: flex-start; }
  .integration-heading h2 { font-size: .95rem; }
  .integration-logo { width: 35px; height: 35px; border-radius: 9px; }
  .connection-state { font-size: .7rem; }
  .filters { gap: 8px; }
  .filters select { flex: 1; min-width: 0; width: 100%; font-size: .73rem; }
  .income-table thead,.income-table .desktop-cell { display: none; }
  .income-table td { padding: 14px 6px; }
  .income-table td:first-child { padding-left: 0; }
  .income-table .table-title { font-size: .8rem; }
  .income-table .table-amount { white-space: nowrap; text-align: right; font-size: .78rem; }
  .income-table .mobile-meta { display: block; font-size: .7rem; }
  .calendar-cell { min-height: 67px; padding: 3px; gap: 3px; border-radius: 7px; }
  .calendar-grid { gap: 3px; }
  .calendar-cell .day-number { width: 24px; height: 24px; font-size: .72rem; }
  .calendar-event { width: 5px; height: 5px; border-radius: 50%; padding: 0; color: transparent; background: var(--cyan); }
  .calendar-cell .day-amount { font-size: .7rem; text-align: center; }
  .calendar-panel { padding: 17px 12px; }
  .heatmap { gap: 5px; }
  .heatmap-cell { border-radius: 6px; font-size: .72rem; }
  .heatmap-cell small { font-size: .7rem; }
  dialog { position: fixed; inset: auto 0 0; width: 100%; max-width: 100%; max-height: 94dvh; margin: 0; overflow-x: hidden; overflow-y: auto; touch-action: pan-y pinch-zoom; border-radius: 24px 24px 0 0; padding: 25px 21px calc(24px + env(safe-area-inset-bottom)); }
  #editor input[type=date], #editor input[type=datetime-local] { display: block; -webkit-min-logical-width: 0; height: 44px; }
  .dialog-head h2 { font-size: 1.3rem; }
  input,select,textarea { font-size: 16px; }
  .login-page { padding-bottom: 30px; }
}
/* Home-screen iOS can resolve dvh shorter than the edge-to-edge app window. */
@media (max-width:760px) and (display-mode:standalone) {
  html, body { height:100vh; height:100lvh; min-height:100vh; min-height:100lvh; }
  #shell { height:100vh; height:100lvh; }
}
@media (min-width:761px) { .mobile-meta { display: none; } }
@media (prefers-reduced-motion:reduce) { *,*::before,*::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
@media (prefers-reduced-transparency:reduce) { #mobile-nav { background: var(--surface); backdrop-filter:none; -webkit-backdrop-filter:none; } dialog::backdrop { backdrop-filter:none; -webkit-backdrop-filter:none; background:#000c; } }
@media (prefers-contrast:more) { :root { --muted:#d0d0da; --line:#70707a; } .panel { border:1px solid var(--line); } }


/* A measured time canvas: one CSS pixel is one minute. */
.task-price { color:var(--lime); margin-left:8px; white-space:nowrap; }
.task-info small { flex-wrap:wrap; }
.calendar-toolbar { flex-wrap:wrap; }
.calendar-period { display:flex; align-items:center; gap:6px; }
.calendar-period strong { min-width:140px; text-align:center; font-size:.95rem; }
.calendar-toolbar .header-actions { margin-left:auto; flex-wrap:wrap; }
.schedule-panel { padding:0; overflow:hidden; }
.schedule-scroll { overflow:auto; max-height:650px; height:65dvh; min-height:360px; overscroll-behavior:contain; scrollbar-gutter:stable; }
.schedule-canvas { min-width:calc(58px + var(--day-count) * 106px); }
.schedule-header,.schedule-allday,.schedule-body { display:grid; grid-template-columns:58px repeat(var(--day-count),minmax(0,1fr)); }
.schedule-header { position:sticky; top:0; z-index:9; background:var(--surface-raised); min-height:45px; }
.schedule-header>span { color:var(--muted); display:grid; place-items:center; font-size:.7rem; }
.schedule-date { padding:14px 4px; text-align:center; border-left:1px solid var(--line); font-size:.75rem; font-variant-numeric:tabular-nums; }
.schedule-date.selected { color:var(--pink); font-weight:700; }
.schedule-allday { background:var(--surface); border-bottom:1px solid var(--line); }
.schedule-allday>span { font-size:.7rem; color:var(--muted); padding:10px 5px; }
.schedule-allday>div { border-left:1px solid var(--line); padding:4px; min-height:38px; }
.schedule-allday>div>span { display:block; font-size:.72rem; background:#183a40; color:#a9f3f8; margin:2px 0; border-radius:4px; padding:4px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.schedule-body { height:1440px; }
.schedule-hours,.schedule-day { position:relative; min-width:0; }
.schedule-hours>span { position:absolute; right:8px; font-size:.7rem; color:var(--muted); transform:translateY(-50%); font-variant-numeric:tabular-nums; }
.schedule-hours>span:first-child { transform:none; }
.schedule-day { border-left:1px solid var(--line); background:repeating-linear-gradient(to bottom,transparent 0,transparent 29px,#30303566 29px,#30303566 30px,transparent 30px,transparent 59px,var(--line) 59px,var(--line) 60px); }
.time-slot { position:absolute; width:100%; height:60px; border:0; border-radius:0; background:transparent; padding:0; min-height:0; }
.time-slot:hover { background:#ffffff06; }
.time-slot:focus-visible { outline:2px solid var(--pink); outline-offset:-3px; }
.schedule-item { position:absolute; z-index:2; border-radius:7px; background:#203c62; color:#d1e5ff; min-height:30px; overflow:hidden; }
.schedule-item.schedule-task { background:#203c62; color:#d1e5ff; }
.schedule-item.is-done { background:#2e431e; color:#ddf5bf; }
.schedule-item.is-done strong { text-decoration:line-through; }
.schedule-open { text-align:left; display:block; width:100%; height:100%; color:inherit; background:transparent; border:0; padding:12px 24px 12px 8px; border-radius:0; overflow:hidden; min-height:0; }
.schedule-open strong { display:block; font-size:.76rem; line-height:1.25; font-weight:600; overflow:hidden; text-overflow:ellipsis; }
.schedule-open small { display:block; font-size:.7rem; line-height:1.4; font-variant-numeric:tabular-nums; white-space:nowrap; }
.schedule-price { font-weight:600; }
.schedule-open:hover { background:#ffffff0a; }
.schedule-move { position:absolute; right:0; top:8px; width:24px; height:44px; min-height:0; padding:4px; color:inherit; border:0; background:transparent; cursor:grab; touch-action:none; }
.schedule-move svg { width:16px; height:22px; }
.schedule-edge { position:absolute; left:0; right:0; height:12px; min-height:0; border:0; border-radius:0; padding:0; background:transparent; cursor:ns-resize; touch-action:none; z-index:3; }
.schedule-edge::after { content:''; position:absolute; width:26px; height:3px; left:calc(50% - 13px); top:4px; background:currentColor; border-radius:2px; opacity:.65; }
.edge-start { top:0; } .edge-end { bottom:0; }
.schedule-edge:hover { background:#ffffff22; }
.schedule-item.dragging { z-index:12; outline:2px solid var(--lime); box-shadow:0 8px 24px #0008; opacity:.95; overflow:visible; }
.schedule-item.dragging .schedule-open { background:inherit; border-radius:7px; }
.schedule-item.saving { opacity:.5; pointer-events:none; }
.schedule-feedback { min-height:34px; padding:8px 20px; color:var(--lime); font-size:.75rem; }
.calendar-under { display:grid; grid-template-columns:1fr; gap:20px; margin-top:20px; }
.calendar-under .task-row:last-child { border-bottom:0; }
@media(max-width:760px) {
 .calendar-toolbar { gap:10px; }
 .calendar-toolbar .header-actions { width:100%; margin-left:0; justify-content:flex-start; }
 .calendar-toolbar .segment { margin-left:auto; }
 .calendar-period { gap:0; }
 .calendar-period strong { min-width:100px; font-size:.8rem; }
 .calendar-toolbar .segment button { padding-inline:9px; font-size:.75rem; }
 .schedule-panel { margin-inline:-12px; border-radius:12px; }
 .schedule-canvas { min-width:calc(50px + var(--day-count) * 138px); }
 .schedule-header,.schedule-allday,.schedule-body { grid-template-columns:50px repeat(var(--day-count),minmax(0,1fr)); }
 .schedule-scroll { height:62dvh; }
 .schedule-open { padding-right:44px; }
 .schedule-move { width:44px; padding-left:14px; }
 .schedule-edge { height:16px; }
 .schedule-edge::after { top:6px; }
 .schedule-open strong { font-size:.8rem; }
 .calendar-under { grid-template-columns:1fr; gap:16px; }
 .task-price { margin-left:0; }
}
.schedule-open { padding-top:8px; padding-bottom:8px; }
.schedule-open strong { white-space:nowrap; }
.schedule-item.compact .schedule-open { padding-top:6px; }
.schedule-item.compact .schedule-open small { display:block; }
.schedule-item.compact .schedule-move { top:8px; height:32px; }
@media(max-width:760px) {
 .calendar-toolbar { display:grid; grid-template-columns:minmax(0,1fr); }
 .calendar-toolbar .calendar-period { justify-content:center; }
 .calendar-toolbar .segment { margin-left:0; display:flex; }
 .calendar-toolbar .segment button { flex:1; }
 .calendar-toolbar .header-actions .button { flex:1; justify-content:center; }
 .calendar-toolbar .header-actions .button.primary { width:auto; padding:10px 14px; border-radius:12px; font-size:.8rem; }
 .calendar-toolbar .header-actions .button.primary .icon { display:inline-block; }
}

.schedule-item.compact .schedule-open { padding-top:8px; padding-bottom:8px; }
.schedule-item.compact .schedule-open small { display:inline; font-size:.7rem; }
.schedule-item.compact .schedule-price::before { content:' · '; }
.schedule-item.compact .schedule-edge { height:8px; }
.schedule-item.compact .schedule-edge::after { top:2px; }

.schedule-item.compact .schedule-meta { display:block; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; line-height:14px; font-size:.7rem; }
.schedule-open { align-content:start; }
.schedule-item.readonly .schedule-open { padding-right:8px; }
.schedule-open { display:flex; flex-direction:column; align-items:stretch; justify-content:flex-start; }
.connection-advanced { margin-top:14px; color:var(--muted); font-size:.8rem; }
.connection-advanced summary { cursor:pointer; min-height:44px; display:flex; align-items:center; }
.connection-advanced[open] summary { color:var(--text); }
.connection-advanced .settings-fields { margin:10px 0 20px; }
.task-context-menu { position:fixed; z-index:100; width:280px; max-width:calc(100vw - 16px); max-height:calc(100dvh - 16px); overflow:auto; padding:6px; background:var(--surface-raised); border-radius:12px; box-shadow:0 12px 40px #0008; }
.task-context-title { padding:8px 10px; color:var(--muted); font-size:.8rem; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.task-context-menu button { display:flex; align-items:center; gap:10px; width:100%; min-height:44px; padding:10px; border:0; border-radius:8px; background:transparent; text-align:left; font-size:.87rem; }
.task-context-menu button:hover, .task-context-menu button:focus-visible { background:var(--surface-hover); }
.task-context-menu button:focus-visible { outline-offset:-2px; }
.task-context-menu [data-action="delete-task"] { color:var(--pink); }
.task-context-divider { height:1px; margin:5px 10px; background:var(--line); }
.task-completion { position:fixed; z-index:250; width:64px; height:64px; margin:-32px 0 0 -32px; pointer-events:none; animation:task-completion-pop 770ms var(--ease) both; }
.task-completion svg { display:block; width:100%; height:100%; overflow:visible; }
.task-completion-fill { fill:var(--lime); }
.task-completion-wave { stroke:var(--lime); stroke-width:1.5; opacity:0; transform-box:fill-box; transform-origin:center; animation:task-completion-wave 650ms var(--ease) both; }
.task-completion-check { stroke:var(--canvas); stroke-width:3; stroke-linecap:round; stroke-linejoin:round; stroke-dasharray:1; stroke-dashoffset:0; animation:task-completion-draw 210ms 100ms ease-out both; }
@keyframes task-completion-pop { 0% { opacity:0; transform:scale(.55); } 22% { opacity:1; transform:scale(1.14); } 42%,76% { opacity:1; transform:scale(1); } 100% { opacity:0; transform:scale(.94); } }
@keyframes task-completion-wave { 0% { opacity:.8; transform:scale(.65); } 100% { opacity:0; transform:scale(1.4); } }
@keyframes task-completion-draw { from { stroke-dashoffset:1; } to { stroke-dashoffset:0; } }

/* Month, week and today share one concentric Activity composition. */
.income-rings { padding:8px 0 10px; }
.income-rings .activity-ring { margin:0 auto 18px; }
.income-goals { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; text-align:center; }
.income-goals .legend-title { display:flex; flex-wrap:wrap; align-items:center; justify-content:center; gap:4px; font-size:.76rem; }
.income-goals .legend-title>span { flex-basis:100%; font-size:.7rem; }
.income-goals strong { display:block; font-size:1rem; font-weight:650; margin-top:7px; }
.income-goals small { display:block; color:var(--muted); font-size:.74rem; margin-top:4px; }
.potential-income { display:flex; flex-wrap:wrap; align-items:baseline; gap:8px; margin-top:10px; }
.potential-income strong { font-weight:600; font-size:1.05rem; }
.potential-income span { font-size:.75rem; }
.chart-total { flex-wrap:wrap; }
.filters { display:grid; grid-template-columns:repeat(2,minmax(140px,240px)); align-items:stretch; }
.filters select { width:100%; min-width:0; height:44px; margin:0; }
@media(max-width:760px) {
  .stats-strip { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .stat-item { padding:16px 12px; }
  .stat-item:nth-child(3) { border-top:0; }
  .stat-item:nth-child(3)::before { display:block; }
  .stat-label { font-size:.69rem; gap:4px; }
  .stat-item strong { font-size:1.05rem; }
  .filters { grid-template-columns:repeat(2,minmax(0,1fr)); }
}

.event-title { display:block; padding:0; border:0; background:none; color:inherit; text-align:left; font-size:.85rem; font-weight:500; max-width:100%; overflow-wrap:anywhere; }
.event-row>div { min-width:0; flex:1; }
.event-row small { display:block; margin-top:4px; }
.event-row.completed .event-title { color:var(--lime); text-decoration:line-through; }

.calendar-entry { display:block; width:100%; padding:5px 7px; border:0; border-radius:5px; background:#203c62; color:#d1e5ff; font-size:.72rem; text-align:left; }
.calendar-entry.is-done { background:#2e431e; color:#ddf5bf; text-decoration:line-through; }

.calendar-cell .day-number { border:0; background:none; padding:0; color:inherit; }
.calendar-cell.today .day-number { color:#071a1d; background:var(--cyan); }
.calendar-entry.calendar-event { background:#203c62; color:#d1e5ff; }
.calendar-entry.calendar-event.is-done { background:#2e431e; color:#ddf5bf; }
@media(max-width:760px) {
  .calendar-cell { min-width:0; }
  .calendar-entry.calendar-event { width:100%; min-height:44px; height:auto; border-radius:4px; font-size:0; padding:0; }
}

.schedule-feedback:empty { display:none; }
.calendar-sync { display:flex; align-items:center; gap:10px; min-height:44px; margin-top:16px; }
.calendar-sync>.icon-button { margin-left:auto; }
.calendar-sync .connection-state { font-size:.72rem; }
