:root {
    --bg: #10141b;
    --bg-2: #181e28;
    --bg-3: #222a38;
    --line: #2c3646;
    --text: #e7edf5;
    --muted: #93a0b3;
    --accent: #8eb6ff;
    --good: #3ecf8e;
    --bad: #ff6b7a;
    --warn: #ffc14d;
    color-scheme: dark;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
}

.bp-body {
    font-family: "Segoe UI", system-ui, sans-serif;
    min-height: 100vh;
    min-height: 100dvh;
}

.bp-body input,
.bp-body select,
.bp-body textarea {
    font-size: 16px;
}

.bp-body .form-control,
.bp-body .form-select {
    background: #0e131b;
    color: var(--text);
    border-color: var(--line);
}

.bp-body .form-control:focus,
.bp-body .form-select:focus {
    background: #0e131b;
    color: var(--text);
    border-color: var(--accent);
    box-shadow: 0 0 0 0.2rem rgba(142, 182, 255, 0.2);
}

.bp-recur-row {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 4fr) minmax(0, 4fr);
    gap: 8px;
    margin-bottom: 12px;
}

.bp-recur-row .form-label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bp-recur-row .form-control,
.bp-recur-row .form-select {
    width: 100%;
    min-width: 0;
}

.bp-body .form-label {
    color: var(--muted);
    font-size: 13px;
    margin-bottom: 4px;
}

.bp-body .btn-primary {
    background: #3d7eff;
    border-color: #3d7eff;
}

.bp-body .btn-primary:hover,
.bp-body .btn-primary:focus {
    background: #5b92ff;
    border-color: #5b92ff;
}

.bp-body .btn-outline-light {
    border-color: var(--line);
    color: var(--text);
}

.bp-body .btn-outline-danger {
    color: #ffb4bc;
    border-color: #6d3640;
}

.bp-app {
    max-width: 1100px;
    margin: 0 auto;
    padding: 12px 12px calc(92px + env(safe-area-inset-bottom));
}

.bp-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.bp-top-actions {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.bp-lang,
.bp-login-lang .bp-lang {
    height: 44px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: var(--bg-2);
    color: var(--text);
    padding: 0 8px;
    font: inherit;
    font-size: 14px;
}

.bp-login-lang {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 8px;
}

.bp-kicker {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.bp-top h1,
.bp-login h1,
.bp-setup-title {
    margin: 2px 0 0;
    font-size: 34px;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.03em;
    line-height: 1.1;
}

.bp-top h1.is-low { color: var(--bad); }

.bp-muted { color: var(--muted); }

.bp-hint {
    color: var(--muted);
    font-size: 13px;
    margin: 8px 0 12px;
}

.bp-icon-btn,
.bp-handle,
.bp-nudge button,
.bp-day,
.bp-tab,
.bp-choice-btn,
.bp-symbol,
.bp-chip-btn,
.bp-tagpick,
.bp-plan,
.bp-card-main {
    font: inherit;
    color: inherit;
}

.bp-icon-btn {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: var(--bg-2);
    display: grid;
    place-items: center;
    flex: 0 0 auto;
}

.bp-icon-btn svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: var(--text);
    stroke-width: 1.7;
    stroke-linecap: round;
}

.bp-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin: 12px 0;
}

.bp-stat {
    text-align: left;
    background: var(--bg-2);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 10px 12px;
    min-height: 64px;
}

.bp-stat strong {
    display: block;
    font-size: 16px;
    font-variant-numeric: tabular-nums;
}

.bp-stat span {
    color: var(--muted);
    font-size: 12px;
}

.bp-stat.is-low {
    border-color: rgba(255, 107, 122, 0.7);
    background: rgba(255, 107, 122, 0.1);
}

.bp-stat.is-low strong { color: var(--bad); }

.bp-tabs {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    margin-bottom: 12px;
}

.bp-tab svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    pointer-events: none;
}

.bp-tab svg.bp-squares {
    stroke: none;
}

.bp-tab svg.bp-squares rect:nth-child(1) { fill: #5b8def; }
.bp-tab svg.bp-squares rect:nth-child(2) { fill: #e0a100; }
.bp-tab svg.bp-squares rect:nth-child(3) { fill: #3ecf8e; }
.bp-tab svg.bp-squares rect:nth-child(4) { fill: #ff6b7a; }

.bp-tab {
    display: grid;
    place-items: center;
}

.bp-line-key {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    margin: 8px 0 0;
}

.bp-line-key span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--muted);
    font-size: 13px;
}

.bp-line-key i {
    width: 14px;
    height: 4px;
    border-radius: 99px;
    display: inline-block;
}

.bp-acc-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.bp-acc-row .bp-plan {
    flex: 1;
    margin: 0;
}

.bp-acc-row .bp-plan.is-on {
    outline: 2px solid var(--accent);
}

.bp-acc-row input {
    width: 22px;
    height: 22px;
    flex: 0 0 auto;
}

.bp-acc-create {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.bp-acc-create .form-control { flex: 1; }

.bp-tab,
.bp-choice-btn,
.bp-seg button {
    border: 1px solid var(--line);
    background: transparent;
    border-radius: 999px;
    min-height: 40px;
    padding: 8px 10px;
}

.bp-tab.is-on,
.bp-choice-btn.is-on,
.bp-seg button.is-on,
.bp-tagpick.is-on {
    background: #243044;
    border-color: var(--accent);
    color: white;
}

#bp-item-tags .bp-tagpick.is-on {
    background: var(--tag, var(--accent));
    color: var(--tag-ink, #10141b);
    border-color: transparent;
    box-shadow: 0 0 0 2px #10141b, 0 0 0 5px var(--tag, #ffffff);
    font-weight: 700;
}

.bp-choice,
.bp-seg,
.bp-templates,
.bp-tagpicks {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.bp-chip-btn,
.bp-tagpick {
    border: 1px solid var(--line);
    background: var(--bg-3);
    border-radius: 999px;
    min-height: 36px;
    padding: 6px 12px;
}

.bp-cal-sticky {
    background: var(--bg);
    padding-bottom: 8px;
}

.bp-monthbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}

.bp-monthbar h2 {
    margin: 0;
    font-size: 18px;
}

.bp-monthbar button,
.bp-linkish {
    border: 0;
    background: transparent;
    color: var(--accent);
    min-height: 40px;
    min-width: 40px;
}

.bp-dow,
.bp-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 3px;
}

.bp-dow span {
    text-align: center;
    color: var(--muted);
    font-size: 11px;
    padding-bottom: 4px;
}

.bp-day {
    appearance: none;
    border: 0;
    background: var(--bg-2);
    border-radius: 10px;
    min-height: 58px;
    padding: 4px 3px 3px;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.bp-day-num {
    font-size: 12px;
    font-weight: 650;
}

.bp-day-bal {
    font-size: 11px;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}

.bp-dots {
    display: flex;
    gap: 3px;
    min-height: 8px;
    margin-top: auto;
}

.bp-dot {
    width: 7px;
    height: 7px;
    border-radius: 99px;
    display: inline-block;
}

.bp-day.is-out { opacity: 0.42; }
.bp-day.is-today .bp-day-num { color: var(--accent); }
.bp-day.is-selected { outline: 2px solid var(--accent); }
.bp-day.is-low { background: rgba(255, 107, 122, 0.16); }
.bp-day.is-low .bp-day-bal { color: #ffb4bc; }
.bp-day.is-drop { outline: 2px solid #f4f7fb; }

.bp-cal-panes,
.bp-cal-sort {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

.bp-cal-panes { margin: 14px 0 8px; }
.bp-cal-sort { margin: 0 0 8px; }

.bp-cal-panes .bp-tab,
.bp-cal-sort .bp-tab {
    color: var(--muted);
}

.bp-cal-panes .bp-tab.is-on,
.bp-cal-sort .bp-tab.is-on {
    color: white;
}

.bp-agenda-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
    margin: 0 0 8px;
}

.bp-agenda-head h2 {
    margin: 0;
    font-size: 16px;
}

.bp-agenda-head strong {
    font-variant-numeric: tabular-nums;
}

.bp-probe-day {
    margin-top: 16px;
}

.bp-probe-day:empty {
    display: none;
}

.bp-card {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-2);
    border-radius: 14px;
    padding: 8px;
    margin-bottom: 8px;
}

.bp-swatch {
    width: 14px;
    height: 28px;
    border-radius: 7px;
    flex: 0 0 auto;
}

.bp-handle {
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 10px;
    background: #10141b;
    color: var(--muted);
    touch-action: none;
    flex: 0 0 auto;
}

.bp-card-main {
    flex: 1;
    min-width: 0;
    background: transparent;
    border: 0;
    text-align: left;
    padding: 0;
}

.bp-card-title,
.bp-plan-title {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 650;
}

.bp-card-meta,
.bp-plan-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    color: var(--muted);
    font-size: 12px;
}

.bp-meta-icons {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex: 0 0 auto;
}

.bp-meta-icons svg {
    width: 15px;
    height: 15px;
    display: block;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.bp-meta-icons svg .bp-fill {
    fill: currentColor;
    stroke: none;
}

.bp-meta-icons .is-once { color: #5b8def; }
.bp-meta-icons .is-recur { color: #e0a100; }
.bp-meta-icons .is-plan { color: #9ec1ff; }
.bp-meta-icons .is-lock { color: #f4f7fb; }

.bp-meta-text {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bp-nudge {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.bp-nudge button {
    width: 36px;
    height: 26px;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: #10141b;
}

.bp-amt {
    font-variant-numeric: tabular-nums;
    font-weight: 650;
}

.bp-amt.is-in { color: var(--good); }
.bp-amt.is-out { color: #ffb4bc; }

.bp-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 14px;
    color: var(--muted);
    font-size: 12px;
    margin: 4px 0 8px;
}

.bp-legend i {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 99px;
    margin-right: 6px;
}

.bp-chart-scroll {
    overflow-x: auto;
    overscroll-behavior-x: contain;
    border-radius: 16px;
    background: var(--bg-2);
    border: 1px solid var(--line);
}

.bp-chart-scroll svg { display: block; }

.bp-zoom {
    display: block;
    width: 100%;
    margin: 14px 0 2px;
    accent-color: var(--accent, #8eb6ff);
    height: 36px;
    touch-action: pan-y;
}

.bp-dots {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 10px 0 0;
    color: var(--muted);
    font-size: 13px;
    cursor: pointer;
    user-select: none;
}

.bp-dots input {
    -webkit-appearance: none;
    appearance: none;
    width: 42px;
    height: 24px;
    margin: 0;
    flex: 0 0 auto;
    border-radius: 99px;
    border: 1px solid var(--line);
    background: #2a3140;
    position: relative;
    cursor: pointer;
}

.bp-dots input::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #93a0b3;
}

.bp-dots input:checked {
    background: #3d5f99;
    border-color: #5b8def;
}

.bp-dots input:checked::after {
    transform: translateX(18px);
    background: #f4f7fb;
}

.bp-dots input:focus-visible {
    outline: 2px solid #8eb6ff;
    outline-offset: 2px;
}

.bp-chart-scroll.is-nodots .bp-marker-dot,
.bp-chart-scroll.is-nodots .bp-marker-hit {
    display: none;
}

.bp-chart-tools {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin: 0 0 8px;
}

.bp-chart-tools button,
.bp-seg button {
    min-width: 44px;
}

.bp-chart-tools .form-select {
    flex: 1 1 160px;
    min-height: 40px;
}

.bp-compare-row {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1 1 100%;
    min-width: 0;
}

.bp-compare-row .form-select {
    flex: 1;
    min-width: 0;
}

.bp-compare-info {
    width: 40px;
    height: 40px;
    min-height: 40px;
    flex: 0 0 auto;
    padding: 4px;
}

.bp-compare-info svg {
    width: 22px;
    height: 22px;
}

.bp-compare-hint {
    flex: 1 1 100%;
    margin: 0;
}

.bp-compare-note {
    color: var(--warn);
    font-size: 13px;
    margin: 0 0 8px;
    min-height: 1.2em;
}

.bp-grid { touch-action: pan-y; }

.bp-grid-stage {
    position: relative;
    overflow: hidden;
}

.bp-grid.is-leave {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    pointer-events: none;
}

.bp-grid.is-enter-next,
.bp-grid.is-leave-next,
.bp-grid.is-enter-prev,
.bp-grid.is-leave-prev {
    animation-duration: 0.28s;
    animation-timing-function: cubic-bezier(0.22, 0.61, 0.36, 1);
    animation-fill-mode: both;
}

.bp-grid.is-enter-next { animation-name: bp-cal-enter-next; }
.bp-grid.is-leave-next { animation-name: bp-cal-leave-next; }
.bp-grid.is-enter-prev { animation-name: bp-cal-enter-prev; }
.bp-grid.is-leave-prev { animation-name: bp-cal-leave-prev; }

@keyframes bp-cal-enter-next {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

@keyframes bp-cal-leave-next {
    from { transform: translateX(0); }
    to { transform: translateX(-100%); }
}

@keyframes bp-cal-enter-prev {
    from { transform: translateX(-100%); }
    to { transform: translateX(0); }
}

@keyframes bp-cal-leave-prev {
    from { transform: translateX(0); }
    to { transform: translateX(100%); }
}

@media (prefers-reduced-motion: reduce) {
    .bp-grid.is-enter-next,
    .bp-grid.is-leave-next,
    .bp-grid.is-enter-prev,
    .bp-grid.is-leave-prev {
        animation: none;
    }
}

.bp-amt {
    border: 0;
    background: transparent;
    padding: 0;
    font: inherit;
    font-variant-numeric: tabular-nums;
    font-weight: 650;
}

.bp-marker-hit { cursor: pointer; }
.bp-marker-dot { stroke-width: 2; }
.bp-marker-stem,
.bp-marker-flag,
.bp-marker-label { pointer-events: none; }

.bp-plan {
    width: 100%;
    display: flex;
    gap: 10px;
    align-items: center;
    text-align: left;
    background: var(--bg-2);
    border: 0;
    border-radius: 14px;
    padding: 12px;
    margin-bottom: 8px;
}

.bp-plan-copy { flex: 1; min-width: 0; }

.bp-section {
    margin: 22px 0 10px;
    font-size: 16px;
}

.bp-tag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-bottom: 8px;
}

.bp-tag-row .form-control {
    flex: 1 1 140px;
}

.bp-tag-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: transparent;
    color: var(--muted);
    display: grid;
    place-items: center;
    padding: 0;
    font: inherit;
}

.bp-icon-pick {
    flex: 1 1 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.bp-icon-pick button {
    min-width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: transparent;
    color: inherit;
    display: grid;
    place-items: center;
    padding: 0 8px;
    font: inherit;
    font-size: 13px;
}

.bp-ico {
    width: 18px;
    height: 18px;
    display: block;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.bp-tagpick .bp-ico,
.bp-meta-ico {
    color: var(--tag, currentColor);
}

#bp-item-tags .bp-tagpick.is-on .bp-ico {
    color: var(--tag-ink, #10141b);
}

.bp-meta-ico {
    display: inline-flex;
    flex: 0 0 auto;
}

.bp-tagpick .bp-ico {
    width: 20px;
    height: 20px;
}

.bp-project-flag {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--muted);
    font-size: 13px;
    min-height: 36px;
}

.bp-tag-row input[type="color"] {
    width: 52px;
    height: 40px;
    padding: 0;
    border: 0;
    background: transparent;
}

.bp-tag-del {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: transparent;
    color: var(--bad);
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    padding: 0;
}

.bp-tag-del svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.bp-project-rules {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin: 0 0 16px;
}

.bp-project-label {
    margin: 0 0 6px;
    font-size: 13px;
    color: var(--text);
}

.bp-project-rule .bp-seg {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.bp-day-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 6px;
    margin-top: 8px;
}

.bp-day-grid button {
    min-height: 36px;
    border: 1px solid var(--line);
    background: transparent;
    border-radius: 10px;
    color: inherit;
    font: inherit;
    padding: 0;
}

.bp-day-grid button.is-on {
    background: #243044;
    border-color: var(--accent);
    color: white;
}

.bp-fabs {
    position: fixed;
    right: 16px;
    bottom: calc(16px + env(safe-area-inset-bottom));
    z-index: 20;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
}

.bp-fab {
    width: 56px;
    height: 56px;
    border: 0;
    border-radius: 50%;
    background: #3d7eff;
    color: white;
    font-size: 34px;
    line-height: 1;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
    display: grid;
    place-items: center;
    padding: 0;
}

.bp-fab-quick {
    width: 48px;
    height: 48px;
    background: #e0a100;
    color: #1c1400;
}

.bp-fab-quick svg {
    width: 26px;
    height: 26px;
    display: block;
}

.bp-fab-quick .bp-bolt { fill: currentColor; }

.bp-fab-quick .bp-plus {
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
}

.bp-quick-every {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
    gap: 8px;
    margin: 4px 0 12px;
}

.bp-quick-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 76px 118px 32px;
    gap: 6px;
    margin-bottom: 8px;
}

.bp-quick-row .form-control {
    min-width: 0;
    padding-left: 8px;
    padding-right: 8px;
}

.bp-quick-x {
    border: 0;
    background: transparent;
    color: var(--muted);
    font-size: 22px;
    line-height: 1;
    padding: 0;
}

#bp-quick-add { margin-bottom: 10px; }

.bp-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 30;
}

.bp-sheet {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 40;
    max-height: min(92dvh, 820px);
    overflow: auto;
    background: var(--bg-2);
    border-radius: 18px 18px 0 0;
    padding: 12px 16px calc(18px + env(safe-area-inset-bottom));
    box-shadow: 0 -16px 40px rgba(0, 0, 0, 0.45);
}

.bp-sheet h2 { margin: 0; font-size: 20px; }

.bp-sheet-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 12px;
}

#bp-editor {
    top: 0;
    bottom: 0;
    height: 100dvh;
    max-height: none;
    border-radius: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding-top: 0;
}

#bp-editor .bp-sheet-bar {
    flex: 0 0 auto;
    margin: 0 -16px 0;
    padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
    background: var(--bg-2);
    border-bottom: 1px solid var(--line);
}

#bp-editor .bp-sheet-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    padding-top: 12px;
}

.bp-pair {
    display: grid;
    grid-template-columns: minmax(0, 7fr) minmax(0, 3fr);
    gap: 8px;
    margin-bottom: 12px;
    position: relative;
    z-index: 4;
}

.bp-name-wrap { position: relative; min-width: 0; }

.bp-pair .bp-name,
.bp-pair .bp-amt-field { min-width: 0; width: 100%; }

.bp-name-list {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 4px);
    z-index: 5;
    max-height: 200px;
    overflow: auto;
    overscroll-behavior: contain;
    touch-action: pan-y;
    -webkit-overflow-scrolling: touch;
    margin: 0;
    padding: 4px;
    background: #222a38;
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
}

.bp-name-list button {
    display: block;
    width: 100%;
    text-align: left;
    border: 0;
    background: transparent;
    color: var(--text);
    border-radius: 8px;
    min-height: 40px;
    padding: 8px 10px;
    font: inherit;
    touch-action: pan-y;
}

.bp-name-list button:hover,
.bp-name-list button:focus,
.bp-name-list button:active {
    background: #243044;
}

.bp-body input[type="search"] {
    -webkit-appearance: none;
    appearance: none;
}

.bp-body input[type="search"]::-webkit-search-decoration,
.bp-body input[type="search"]::-webkit-search-cancel-button,
.bp-body input[type="search"]::-webkit-search-results-button,
.bp-body input[type="search"]::-webkit-search-results-decoration {
    display: none;
}

.bp-switches {
    display: grid;
    gap: 8px;
    margin-bottom: 12px;
}

.bp-switch {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: stretch;
    min-height: 48px;
    padding: 4px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #0e131b;
}

.bp-switch-handle {
    position: absolute;
    top: 4px;
    bottom: 4px;
    left: 4px;
    width: calc(50% - 4px);
    border-radius: 999px;
    background: var(--bad);
    transition: transform 0.18s ease, background 0.18s ease;
    pointer-events: none;
}

.bp-switch button {
    position: relative;
    z-index: 1;
    border: 0;
    background: transparent;
    color: var(--muted);
    font: inherit;
    font-size: 15px;
    font-weight: 600;
    border-radius: 999px;
    min-height: 40px;
    padding: 6px 8px;
}

.bp-switch button.is-on {
    color: #10141b;
    font-weight: 700;
}

.bp-switch-dir:has([data-dir="in"].is-on) .bp-switch-handle {
    transform: translateX(100%);
    background: var(--good);
}

.bp-switch-flow .bp-switch-handle {
    background: #5b8def;
}

.bp-switch-flow:has([data-flow="recurring"].is-on) .bp-switch-handle {
    transform: translateX(100%);
    background: #e0a100;
}

.bp-symbol {
    min-height: 46px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: transparent;
    color: var(--muted);
    display: grid;
    place-items: center;
    padding: 6px;
}

.bp-symbol svg {
    width: 26px;
    height: 26px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    pointer-events: none;
}

.bp-symbol svg .bp-fill {
    fill: var(--bg-2);
    stroke: currentColor;
}

.bp-symbol.is-once svg .bp-fill,
#bp-status-info svg .bp-fill {
    fill: currentColor;
    stroke: none;
}

#bp-status-info.is-on {
    background: var(--bg-3);
    color: var(--text);
    border-color: var(--accent);
}

.bp-symbol.is-out { color: var(--bad); border-color: rgba(255, 107, 122, 0.75); }
.bp-symbol.is-out.is-on { background: var(--bad); color: #1a1014; }
.bp-symbol.is-in { color: var(--good); border-color: rgba(62, 207, 142, 0.75); }
.bp-symbol.is-in.is-on { background: var(--good); color: #062216; }
.bp-symbol.is-once { color: #5b8def; border-color: rgba(91, 141, 239, 0.8); }
.bp-symbol.is-once.is-on { background: #5b8def; color: #061226; }
.bp-symbol.is-recur { color: #e0a100; border-color: rgba(224, 161, 0, 0.85); }
.bp-symbol.is-recur.is-on { background: #e0a100; color: #1c1400; }
.bp-symbol.is-plan { color: var(--accent); border-color: rgba(142, 182, 255, 0.75); }
.bp-symbol.is-plan.is-on { background: var(--accent); color: #10141b; }
.bp-symbol.is-lock { color: #f4f7fb; border-color: rgba(244, 247, 251, 0.45); }
.bp-symbol.is-lock.is-on { background: #f4f7fb; color: #151922; }
.bp-symbol.is-on { font-weight: 700; }

.bp-date-row {
    display: flex;
    gap: 8px;
    align-items: flex-end;
    margin-bottom: 12px;
}

.bp-date-field { flex: 0 0 calc(50% - 4px); min-width: 0; }
.bp-date-field input { width: 100%; }
.bp-date-side {
    flex: 1 1 auto;
    display: flex;
    gap: 6px;
    min-width: 0;
}
.bp-date-side .bp-symbol { flex: 1 1 0; min-width: 0; }

.bp-mini {
    display: block;
    margin: 0 0 4px;
    color: var(--muted);
    font-size: 12px;
}

.bp-body input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
    opacity: 0.85;
}

.bp-add-note {
    border: 0;
    background: transparent;
    color: var(--accent);
    padding: 0 0 12px;
    min-height: 36px;
}

.bp-colors {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 16px;
}

.bp-colors label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    color: var(--muted);
    font-size: 12px;
}

.bp-colors input[type="color"] {
    width: 100%;
    height: 40px;
    border: 0;
    background: transparent;
    padding: 0;
}

.bp-alert {
    background: rgba(255, 107, 122, 0.12);
    color: #ffd0d5;
    border-radius: 12px;
    padding: 10px 12px;
    margin: 0 0 12px;
}

.bp-pop {
    position: fixed;
    z-index: 25;
    width: min(240px, calc(100vw - 16px));
    background: #222a38;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 10px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
}

.bp-pop strong,
.bp-pop span { display: block; }

.bp-pop span {
    color: var(--muted);
    font-size: 13px;
    margin: 4px 0 8px;
}

.bp-pop-actions { display: flex; gap: 8px; }

.bp-toast {
    position: fixed;
    left: 50%;
    bottom: calc(84px + env(safe-area-inset-bottom));
    transform: translateX(-50%) translateY(12px);
    background: #f4f7fb;
    color: #151922;
    border-radius: 999px;
    padding: 10px 14px;
    max-width: min(420px, calc(100% - 24px));
    z-index: 50;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease, transform 0.15s ease;
}

.bp-toast.is-on {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.bp-ghost {
    position: fixed;
    z-index: 45;
    pointer-events: none;
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 650;
    max-width: 180px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
}

.bp-login {
    max-width: 420px;
    margin: 0 auto;
    padding: 48px 20px;
}

.bp-login-foot { margin-top: 16px; }

.bp-login a { color: var(--accent); }

body.bp-sheet-open { overflow: hidden; }

body.bp-dragging,
body.bp-dragging * { user-select: none; }

body.bp-dragging .bp-chart-scroll { touch-action: none; }

body.is-setup #bp-match-btn,
body.is-setup .bp-fab,
body.is-setup .bp-tabs,
body.is-setup .bp-stats,
body.is-setup .bp-icon-btn,
body.bp-sheet-open .bp-fab { display: none; }

[hidden] { display: none !important; }

@media (min-width: 900px) {
    .bp-app { padding-top: 28px; }
    .bp-day { min-height: 84px; padding: 8px; }
    .bp-day-num { font-size: 14px; }
    .bp-day-bal { font-size: 13px; }
    .bp-sheet {
        top: 8vh;
        bottom: auto;
        width: min(520px, calc(100% - 32px));
        margin: 0 auto;
        border-radius: 18px;
        max-height: 84vh;
    }
    #bp-editor {
        left: 50%;
        right: auto;
        width: min(520px, calc(100% - 32px));
        margin: 0;
        transform: translateX(-50%);
        border-radius: 0 0 18px 18px;
    }
    .bp-cal-layout {
        display: grid;
        grid-template-columns: minmax(0, 1fr) 360px;
        gap: 18px;
        align-items: start;
    }
}
