:root {
    --bg: #111413;
    --panel: #1a1e1c;
    --panel2: #202622;
    --line: #2d352f;
    --text: #f0f3ed;
    --muted: #929e94;
    --mint: #b9edc9;
    --yellow: #f4d891;
    --red: #f1a69d;
    --radius: 20px;
    font-family: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color-scheme: dark
}

* {
    box-sizing: border-box
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-size: 14px
}

button,
input,
select,
textarea {
    font: inherit
}

button,
a,
input,
select,
textarea {
    -webkit-tap-highlight-color: transparent
}

button {
    cursor: pointer
}

button:disabled {
    opacity: .45;
    cursor: not-allowed
}

button:focus-visible,
a:focus-visible {
    outline: 2px solid var(--mint);
    outline-offset: 3px
}

button {
    color: inherit
}

a {
    color: var(--mint)
}

button svg {
    pointer-events: none
}

svg.icon {
    width: 19px;
    height: 19px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex-shrink: 0
}

.shell {
    display: grid;
    grid-template-columns: 232px 1fr;
    min-height: 100vh
}

.sidebar {
    border-right: 1px solid var(--line);
    padding: 30px 18px;
    position: fixed;
    width: 232px;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    background: var(--bg);
    z-index: 10
}

.brand {
    font-size: 27px;
    letter-spacing: -1.6px;
    font-weight: 750;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 12px;
    margin-bottom: 36px
}

.brand-mark {
    display: grid;
    place-items: center;
    background: var(--mint);
    color: #18231a;
    border-radius: 11px;
    width: 35px;
    height: 35px
}

.brand small {
    font-size: 10px;
    letter-spacing: 1px;
    color: var(--muted);
    margin-left: auto;
    font-weight: 500
}

.wsbox {
    margin-bottom: 28px
}

.wslabel,
.eyebrow {
    font-size: 10px;
    letter-spacing: 1.8px;
    text-transform: uppercase;
    font-weight: 650;
    color: var(--muted)
}

.wslabel {
    padding: 0 12px;
    margin-bottom: 10px
}

.workspace {
    display: flex;
    gap: 10px;
    width: 100%;
    border: 1px solid var(--line);
    padding: 12px;
    background: var(--panel);
    border-radius: 12px;
    align-items: center
}

.workspace select {
    width: 100%;
    border: 0;
    padding: 0;
    background: transparent;
    min-width: 0
}

.workspace .emoji {
    font-size: 22px
}

.nav {
    display: flex;
    flex-direction: column;
    gap: 5px
}

.nav button {
    display: flex;
    align-items: center;
    gap: 12px;
    background: none;
    border: 0;
    padding: 13px 14px;
    color: var(--muted);
    text-align: left;
    border-radius: 10px
}

.nav button.active {
    background: var(--mint);
    color: #17251b;
    font-weight: 650
}

.nav button:hover:not(.active) {
    background: var(--panel);
    color: var(--text)
}

.nav .count {
    margin-left: auto;
    font-size: 11px;
    border-radius: 5px;
    padding: 1px 5px;
    background: #2c3c30;
    color: var(--mint)
}

.nav button.active .count {
    background: #9fd5af;
    color: #193522
}

.sidebar-bottom {
    margin-top: auto
}

.sidebar-note {
    padding: 16px;
    background: linear-gradient(125deg, #252d26, #1b201c);
    border: 1px solid var(--line);
    border-radius: 15px;
    line-height: 1.6;
    color: var(--muted);
    font-size: 12px;
    margin: 24px 0
}

.sidebar-note strong {
    color: var(--mint);
    display: block;
    margin-bottom: 5px
}

.user {
    border-top: 1px solid var(--line);
    padding: 18px 6px 0;
    display: flex;
    align-items: center;
    gap: 10px
}

.avatar {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #454436;
    color: #f4d891;
    font-weight: 650
}

.user-name {
    font-size: 12px;
    flex: 1
}

.user-name small {
    display: block;
    font-size: 10px;
    color: var(--muted);
    margin-top: 3px
}

.main {
    grid-column: 2;
    min-width: 0;
    padding: 0 36px 40px;
    max-width: 1660px;
    width: 100%;
    margin: auto
}

.topbar {
    height: 91px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--line);
    gap: 12px
}

.breadcrumb {
    color: var(--muted);
    font-size: 12px;
    flex: 1;
    display: flex;
    gap: 10px;
    align-items: center
}

.breadcrumb strong {
    color: var(--text);
    font-weight: 500
}

.topbar .badge {
    font-size: 10px;
    letter-spacing: .4px;
    background: var(--panel);
    border: 1px solid var(--line);
    padding: 6px 9px;
    border-radius: 6px;
    color: var(--muted)
}

.controls {
    display: flex;
    align-items: center;
    gap: 10px
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid var(--line);
    background: var(--panel);
    border-radius: 9px;
    min-height: 39px;
    padding: 9px 14px;
    font-size: 12px;
    font-weight: 550;
    white-space: nowrap
}

.btn:hover {
    background: var(--panel2);
    border-color: #536457
}

.btn.primary {
    background: var(--mint);
    border-color: var(--mint);
    color: #1c3022
}

.btn.primary:hover {
    background: #d2f5dc
}

.btn.ghost {
    background: none
}

.btn.danger {
    color: var(--red)
}

.btn.small {
    min-height: 30px;
    padding: 5px 9px;
    font-size: 11px
}

.btn.square {
    padding: 8px
}

.btn .icon {
    width: 16px;
    height: 16px
}

.pagehead {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 20px;
    margin: 32px 0 25px
}

.pagehead h1 {
    margin: 8px 0 7px;
    font-size: 32px;
    line-height: 1.2;
    letter-spacing: -1.1px;
    font-weight: 580
}

.pagehead p {
    color: var(--muted);
    margin: 0;
    line-height: 1.6;
    font-size: 12px
}

.pagehead .controls {
    flex-shrink: 0
}

.pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border-radius: 6px;
    font-size: 10px;
    padding: 5px 8px;
    color: var(--mint);
    background: #26392c
}

.pill.warn {
    background: #3e3421;
    color: var(--yellow)
}

.pill.bad {
    background: #3c2926;
    color: var(--red)
}

.toolbar {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 20px
}

.toolbar .search {
    flex: 1;
    min-width: 160px
}

.segmented {
    display: flex;
    gap: 4px;
    padding: 4px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 9px
}

.segmented button {
    border: 0;
    background: none;
    color: var(--muted);
    padding: 6px 11px;
    border-radius: 6px;
    font-size: 11px
}

.segmented button.active {
    background: #35473a;
    color: var(--mint)
}

input,
select,
textarea {
    border: 1px solid var(--line);
    background: #171c18;
    border-radius: 8px;
    color: var(--text);
    padding: 10px 11px;
    outline: none;
    min-width: 0
}

input:focus,
select:focus,
textarea:focus {
    border-color: #7aa989
}

input::placeholder,
textarea::placeholder {
    color: #6f7c72
}

input[type=checkbox] {
    accent-color: var(--mint);
    width: 16px;
    height: 16px
}

input[type=color] {
    padding: 4px;
    height: 39px;
    width: 58px
}

label {
    font-size: 11px;
    color: var(--muted);
    display: flex;
    flex-direction: column;
    gap: 7px
}

label.check {
    flex-direction: row;
    align-items: center;
    font-size: 12px;
    color: var(--text)
}

.stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin: 20px 0 24px
}

.stat {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 15px;
    padding: 19px;
    position: relative;
    overflow: hidden
}

.stat.main-stat {
    background: #b9edc9;
    color: #172b1e;
    border-color: #b9edc9
}

.stat-label {
    font-size: 11px;
    display: flex;
    align-items: center;
    gap: 7px;
    color: var(--muted)
}

.main-stat .stat-label,
.main-stat .stat-foot {
    color: #42674c
}

.stat-value {
    font-size: 29px;
    font-weight: 550;
    letter-spacing: -1px;
    margin: 16px 0 12px
}

.stat-value small {
    font-size: 12px;
    letter-spacing: 0;
    font-weight: 400
}

.stat-foot {
    font-size: 10px;
    color: var(--muted)
}

.stat .mini-icon {
    position: absolute;
    right: 18px;
    top: 17px;
    color: var(--muted)
}

.main-stat .mini-icon {
    color: #42674c
}

.grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px
}

.card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 23px;
    min-width: 0
}

.card.wide {
    grid-column: 1/-1
}

.card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 20px
}

.card h2 {
    font-size: 14px;
    font-weight: 550;
    margin: 0
}

.card-head small,
.muted {
    color: var(--muted);
    font-size: 11px
}

.card-head .drag-handle {
    color: #627267;
    cursor: grab;
    font-size: 17px
}

.card.dragging,
.shopcard.dragging {
    opacity: .35
}

.card-sub {
    font-size: 11px;
    color: var(--muted);
    margin-top: 5px
}

.chart {
    height: 190px;
    display: flex;
    align-items: flex-end;
    gap: 5px;
    position: relative;
    padding: 12px 0 24px;
    border-bottom: 1px solid var(--line);
    background: repeating-linear-gradient(to top, transparent 0, transparent 45px, #ffffff05 46px, #ffffff05 47px)
}

.bar-column {
    flex: 1;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-direction: column;
    min-width: 0;
    position: relative
}

.bar {
    border-radius: 5px 5px 2px 2px;
    width: 75%;
    min-height: 2px;
    background: var(--mint);
    transition: height .3s
}

.bar-column:hover .bar {
    background: #e7f5c9
}

.bar-column span {
    position: absolute;
    bottom: -20px;
    font-size: 9px;
    color: var(--muted)
}

.chart-caption {
    display: flex;
    justify-content: space-between;
    color: var(--muted);
    font-size: 10px;
    margin-top: 14px
}

.donut-layout {
    display: flex;
    align-items: center;
    gap: 28px;
    padding: 8px 0
}

.donut {
    position: relative;
    flex: 0 0 150px;
    height: 150px;
    border-radius: 50%;
    display: grid;
    place-items: center
}

.donut:after {
    content: '';
    position: absolute;
    inset: 22px;
    border-radius: 50%;
    background: var(--panel)
}

.donut-center {
    position: relative;
    z-index: 1;
    text-align: center
}

.donut-center strong {
    font-size: 18px;
    font-weight: 550;
    display: block
}

.donut-center small {
    color: var(--muted);
    font-size: 10px
}

.legend {
    flex: 1;
    min-width: 0
}

.legend-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    margin: 12px 0
}

.legend-row .dot {
    width: 7px;
    height: 7px;
    border-radius: 50%
}

.legend-row .label {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis
}

.legend-row .value {
    font-size: 11px
}

.legend-row small {
    color: var(--muted);
    min-width: 30px;
    text-align: right
}

.rank {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 17px 0
}

.rank-icon {
    width: 33px;
    height: 33px;
    background: #303b32;
    border-radius: 10px;
    display: grid;
    place-items: center;
    color: var(--mint);
    font-size: 13px
}

.rank-body {
    flex: 1;
    min-width: 0
}

.rank-top {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    gap: 10px;
    margin-bottom: 8px
}

.track {
    height: 5px;
    background: #303831;
    border-radius: 10px;
    overflow: hidden
}

.track i {
    display: block;
    height: 100%;
    background: var(--mint);
    border-radius: 10px;
    max-width: 100%
}

.track i.over {
    background: var(--red)
}

.recent-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 0;
    border-bottom: 1px solid var(--line)
}

.recent-row:last-child {
    border: 0
}

.recent-row .info {
    flex: 1
}

.recent-row strong {
    font-size: 12px;
    font-weight: 500
}

.recent-row small {
    display: block;
    font-size: 10px;
    color: var(--muted);
    margin-top: 4px
}

.recent-row .amount {
    font-size: 12px
}

.empty {
    text-align: center;
    padding: 35px 15px;
    color: var(--muted);
    line-height: 1.7;
    font-size: 12px
}

.empty .empty-icon {
    font-size: 28px;
    display: block;
    margin-bottom: 12px
}

.empty h3 {
    font-size: 15px;
    color: var(--text);
    font-weight: 500
}

.empty .btn {
    margin-top: 12px
}

.notice {
    padding: 12px 15px;
    border-radius: 10px;
    background: #263329;
    color: var(--mint);
    line-height: 1.6;
    font-size: 12px;
    margin-bottom: 18px
}

.notice.warn {
    background: #352f22;
    color: var(--yellow)
}

.table-wrap {
    overflow-x: auto
}

table {
    border-collapse: collapse;
    width: 100%;
    text-align: left
}

th {
    font-size: 10px;
    letter-spacing: .5px;
    font-weight: 500;
    color: var(--muted);
    padding: 12px 12px;
    border-bottom: 1px solid var(--line);
    white-space: nowrap
}

td {
    font-size: 12px;
    padding: 17px 12px;
    border-bottom: 1px solid var(--line)
}

tbody tr:last-child td {
    border: 0
}

tbody tr:hover {
    background: #ffffff03
}

.shop-name {
    display: flex;
    align-items: center;
    gap: 10px
}

.subline {
    font-size: 10px;
    color: var(--muted);
    margin-top: 5px
}

.right {
    text-align: right
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 15px
}

.product {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px
}

.product-top {
    display: flex;
    justify-content: space-between;
    align-items: center
}

.product-emoji {
    background: #29382d;
    width: 45px;
    height: 45px;
    border-radius: 13px;
    display: grid;
    place-items: center;
    font-size: 25px
}

.product h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 550;
    line-height: 1.5
}

.product .qty {
    font-size: 24px;
    font-weight: 500
}

.product .qty small {
    font-size: 12px;
    color: var(--muted)
}

.product-bottom {
    display: flex;
    gap: 7px;
    margin-top: auto
}

.product-list {
    display: flex;
    flex-direction: column;
    gap: 10px
}

.product-list .product {
    display: grid;
    grid-template-columns: 48px 1fr auto auto;
    align-items: center
}

.product-list .product-top {
    display: contents
}

.product-list .product-top>.btn {
    display: none
}

.product-list .product>small {
    display: none
}

.board {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px
}

.board-column {
    background: #171c18;
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 14px;
    min-height: 340px
}

.column-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 5px 18px;
    font-size: 12px
}

.column-title span {
    color: var(--muted);
    font-size: 10px
}

.shopcard {
    background: var(--panel2);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 11px;
    cursor: grab
}

.shopcard h3 {
    font-size: 13px;
    font-weight: 550;
    margin: 8px 0
}

.shopcard .controls {
    margin-top: 14px;
    gap: 5px;
    flex-wrap: wrap
}

.shopcard select {
    font-size: 10px;
    padding: 6px;
    flex: 1
}

.drop-active {
    outline: 1px dashed var(--mint);
    background: #26352a
}

.settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px
}

.formgrid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px
}

.formgrid .full {
    grid-column: 1/-1
}

.form-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 24px
}

.category-row,
.member-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--line)
}

.category-row>span:nth-child(2),
.member-row>span:nth-child(2) {
    flex: 1;
    font-size: 12px
}

.category-row .emoji {
    font-size: 19px
}

.member-row small {
    color: var(--muted);
    font-size: 10px
}

.audit-row {
    font-size: 11px;
    padding: 11px 0;
    border-bottom: 1px solid var(--line);
    color: var(--muted)
}

.audit-row strong {
    color: var(--text);
    font-weight: 500
}

.audit-row small {
    display: block;
    margin-top: 5px;
    font-size: 10px
}

.fxnote {
    font-size: 10px;
    color: var(--muted);
    margin-top: 16px;
    line-height: 1.7
}

.dropzone {
    border: 1px dashed #647968;
    background: radial-gradient(ellipse at center, #24372a 0, transparent 80%);
    border-radius: 18px;
    text-align: center;
    padding: 55px 20px
}

.scan-icon {
    margin: auto auto 20px;
    background: #334f3c;
    color: var(--mint);
    width: 64px;
    height: 64px;
    border-radius: 20px;
    display: grid;
    place-items: center
}

.scan-icon .icon {
    width: 29px;
    height: 29px
}

.dropzone h2 {
    font-size: 20px;
    font-weight: 500
}

.dropzone p {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.8
}

.dropzone .controls {
    justify-content: center;
    margin: 24px 0
}

.steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-top: 20px
}

.step {
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 20px;
    font-size: 12px;
    line-height: 1.7
}

.step .num {
    color: var(--mint);
    font-size: 10px;
    letter-spacing: 1px
}

.step h3 {
    font-size: 13px;
    font-weight: 500
}

.step p {
    color: var(--muted);
    font-size: 11px
}

.scanpreview {
    width: 100%;
    max-height: 250px;
    object-fit: contain;
    border-radius: 12px;
    background: #111
}

.loading {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid #526556;
    border-top-color: var(--mint);
    border-radius: 50%;
    animation: spin 1s linear infinite
}

@keyframes spin {
    to {
        transform: rotate(360deg)
    }
}

dialog {
    background: #1a201c;
    border: 1px solid #425147;
    border-radius: 20px;
    color: var(--text);
    width: min(960px, calc(100% - 28px));
    max-height: 90dvh;
    padding: 0;
    box-shadow: 0 30px 100px #0008
}

dialog::backdrop {
    background: #050907bd;
    backdrop-filter: blur(5px)
}

.modal-head {
    padding: 23px 26px;
    border-bottom: 1px solid var(--line);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    background: #1a201c;
    z-index: 2
}

.modal-head h2 {
    font-size: 18px;
    font-weight: 500;
    margin: 0
}

.modal-body {
    padding: 25px
}

.modal-body .editor-items {
    overflow: auto;
    margin: 20px 0
}

.editor-items table {
    min-width: 680px
}

.editor-items td {
    padding: 7px 4px
}

.editor-items input,
.editor-items select {
    width: 100%;
    padding: 9px 6px;
    font-size: 11px
}

.editor-items th {
    padding: 8px 4px
}

.editor-items .item-name {
    min-width: 160px
}

.raw {
    white-space: pre-wrap;
    font: 12px/1.7 monospace;
    color: var(--muted);
    max-height: 200px;
    overflow: auto
}

.modal-error {
    color: var(--red);
    font-size: 12px;
    white-space: pre-wrap;
    margin: 15px 0
}

.toast {
    position: fixed;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%);
    max-width: 90%;
    padding: 13px 22px;
    border-radius: 12px;
    background: var(--mint);
    color: #183422;
    box-shadow: 0 15px 40px #0006;
    z-index: 100;
    font-size: 12px
}

.toast.error {
    background: #efb5aa
}

.auth-screen {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 25px;
    background: radial-gradient(ellipse at 50% 30%, #283f2e, transparent 60%)
}

.auth-card {
    width: min(460px, 100%);
    text-align: center;
    padding: 45px;
    border: 1px solid var(--line);
    border-radius: 24px;
    background: var(--panel)
}

.auth-card h1 {
    font-size: 40px;
    font-weight: 500;
    letter-spacing: -2px
}

.auth-card p {
    color: var(--muted);
    line-height: 1.8;
    font-size: 13px
}

.auth-card .brand-mark {
    margin: auto;
    width: 50px;
    height: 50px
}

.auth-card .btn {
    margin: 10px auto
}

.mobile-brand {
    display: none
}

.periodcustom {
    display: flex;
    gap: 8px
}

.periodcustom input {
    font-size: 11px
}

.hidden {
    display: none !important
}

details {
    margin: 15px 0;
    color: var(--muted);
    font-size: 11px
}

summary {
    cursor: pointer
}

body.modal-open {
    overflow: hidden
}

.budget-edit {
    display: flex;
    gap: 8px
}

.budget-edit input {
    width: 100px
}

.view-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 18px 0;
    font-size: 12px
}

.view-header span {
    color: var(--muted)
}

@media(min-width:1400px) {
    .grid {
        grid-template-columns: repeat(3, minmax(0, 1fr))
    }

    .card[data-card=trend] {
        grid-column: span 2
    }

    .product-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr))
    }
}

@media(max-width:1100px) {
    .sidebar {
        width: 195px;
        padding: 25px 12px
    }

    .shell {
        grid-template-columns: 195px 1fr
    }

    .main {
        padding: 0 22px 30px
    }

    .stats {
        gap: 10px
    }

    .stat {
        padding: 15px
    }

    .stat-value {
        font-size: 24px
    }

    .product-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr))
    }

    .donut-layout {
        gap: 15px
    }

    .donut {
        flex-basis: 125px;
        height: 125px
    }

    .settings-grid {
        grid-template-columns: 1fr
    }

    .topbar .badge {
        display: none
    }

    .pagehead .controls {
        flex-wrap: wrap;
        justify-content: flex-end
    }

    .pagehead h1 {
        font-size: 28px
    }

    .board {
        gap: 10px
    }

    .shopcard {
        padding: 12px
    }
}

@media(max-width:760px) {
    .shell {
        display: block
    }

    .sidebar {
        position: fixed;
        bottom: 0;
        top: auto;
        width: 100%;
        height: 70px;
        padding: 6px 5px calc(5px + env(safe-area-inset-bottom));
        border-right: 0;
        border-top: 1px solid var(--line);
        background: #171d19ed;
        backdrop-filter: blur(15px)
    }

    .sidebar>.brand,
    .sidebar>.wsbox,
    .sidebar-bottom,
    .nav button[data-view=settings] {
        display: none
    }

    .nav {
        flex-direction: row;
        justify-content: space-around;
        gap: 0
    }

    .nav button {
        flex-direction: column;
        gap: 5px;
        padding: 8px 7px;
        font-size: 9px;
        border-radius: 9px
    }

    .nav button.active {
        background: #2a3c2f;
        color: var(--mint)
    }

    .nav .count {
        display: none
    }

    .main {
        padding: 0 16px 100px
    }

    .topbar {
        height: 71px;
        gap: 8px
    }

    .breadcrumb {
        display: none
    }

    .mobile-brand {
        display: flex;
        align-items: center;
        gap: 7px;
        flex: 1;
        font-size: 19px;
        font-weight: 600;
        letter-spacing: -1px
    }

    .mobile-brand select {
        font-size: 11px;
        max-width: 130px;
        border: 0;
        background: none;
        padding: 6px
    }

    .topbar .btn {
        min-height: 34px;
        padding: 8px 10px;
        font-size: 10px
    }

    .topbar .btn .label {
        display: none
    }

    .topbar select {
        font-size: 10px;
        padding: 8px
    }

    .pagehead {
        margin: 25px 0 20px;
        align-items: flex-start
    }

    .pagehead h1 {
        font-size: 26px
    }

    .pagehead p {
        font-size: 11px
    }

    .pagehead .controls {
        max-width: 150px
    }

    .pagehead .controls select {
        width: 100%;
        font-size: 11px
    }

    .stats {
        grid-template-columns: 1fr 1fr;
        margin: 16px 0;
        gap: 10px
    }

    .stat {
        border-radius: 12px;
        padding: 16px
    }

    .stat-value {
        font-size: 26px;
        margin: 15px 0 9px
    }

    .stat-label {
        font-size: 10px
    }

    .stat-foot {
        font-size: 9px
    }

    .grid {
        grid-template-columns: 1fr;
        gap: 13px
    }

    .card {
        padding: 20px;
        border-radius: 16px
    }

    .card.wide {
        grid-column: auto
    }

    .chart {
        height: 170px
    }

    .product-grid {
        gap: 10px
    }

    .product {
        padding: 14px;
        gap: 10px
    }

    .product h3 {
        font-size: 12px
    }

    .product-bottom {
        flex-wrap: wrap
    }

    .product .qty {
        font-size: 20px
    }

    .product-grid .btn {
        font-size: 10px;
        padding: 6px 8px
    }

    .toolbar {
        gap: 8px
    }

    .toolbar input,
    .toolbar select {
        font-size: 11px;
        padding: 9px
    }

    .toolbar .segmented button {
        font-size: 10px;
        padding: 5px 8px
    }

    .board {
        grid-template-columns: 1fr;
        gap: 15px
    }

    .board-column {
        min-height: 120px
    }

    .shopcard {
        padding: 16px
    }

    .shopcard .controls {
        flex-wrap: nowrap
    }

    .steps {
        grid-template-columns: 1fr;
        gap: 10px
    }

    .step {
        padding: 16px
    }

    .step h3 {
        margin: 6px 0
    }

    .step p {
        margin: 4px 0
    }

    .dropzone {
        padding: 30px 15px
    }

    .formgrid {
        gap: 12px
    }

    .modal-body {
        padding: 18px
    }

    .modal-head {
        padding: 18px
    }

    .modal-head h2 {
        font-size: 16px
    }

    dialog {
        max-height: 94dvh;
        border-radius: 16px
    }

    .periodcustom {
        width: 100%
    }

    .periodcustom input {
        width: 50%
    }

    .product-list .product {
        grid-template-columns: 35px 1fr auto
    }

    .product-list .product-bottom {
        grid-column: 2/-1
    }

    .product-list .product-emoji {
        width: 35px;
        height: 35px;
        font-size: 20px
    }

    .toast {
        bottom: 90px
    }

    .auth-card {
        padding: 30px
    }

    .fxnote {
        font-size: 9px
    }

    th,
    td {
        padding: 12px 8px
    }

    .table-wrap {
        margin: 0 -8px
    }

    .controls {
        gap: 7px
    }
}

@media(prefers-reduced-motion:reduce) {
    * {
        animation: none !important;
        transition: none !important
    }
}

.card-move {
    display: none
}

@media(max-width:760px) {
    .card-move {
        display: flex
    }

    .card-head .drag-handle {
        display: none
    }
}
.toolbar .segmented { max-width:100%; overflow-x:auto; } .toolbar .segmented button { flex-shrink:0; }

/* Shared sizing rules: long names must not widen their grid or flex parent. */
.nav-mobile { display: none; }
.topbar > *, .pagehead > *, .toolbar > *, .controls > *,
.formgrid > *, .settings-grid > *, .product > *, .card-head > *,
.recent-row > *, .member-row > *, .category-row > * { min-width: 0; }
.rank-icon, .avatar, .product-emoji { flex-shrink: 0; }
.recent-row .info { min-width: 0; }
.recent-row strong, .shop-name, .product h3, .shopcard h3,
.member-row span, .category-row span, .breadcrumb strong,
.eyebrow, .notice, .fxnote, .audit-row, .modal-error {
    overflow-wrap: anywhere;
}
.rank-top > :last-child, .recent-row .amount, .legend-row .value {
    flex-shrink: 0;
    font-variant-numeric: tabular-nums;
}
.card-head, .controls, .form-footer { flex-wrap: wrap; }
.card-head h2 { line-height: 1.45; }
.card-head > small { line-height: 1.5; }
.formgrid input:not([type=checkbox]):not([type=color]),
.formgrid select, .formgrid textarea { width: 100%; max-width: 100%; }
.form-footer .btn { white-space: normal; text-align: center; line-height: 1.45; }
.modal-head { gap: 12px; }
.modal-head h2 { min-width: 0; overflow-wrap: anywhere; line-height: 1.4; }
.modal-head > button { flex-shrink: 0; }
.stat-value { overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.shop-name > div { min-width: 0; }
.subline { line-height: 1.6; }
.pill { max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
.rank-top { flex-wrap: wrap; line-height: 1.5; }
.raw { overflow-wrap: anywhere; }
input[type=checkbox] { flex-shrink: 0; }
.btn { max-width: 100%; }
@media (min-width: 761px) and (max-width: 1050px) {
    .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .grid, .board { grid-template-columns: minmax(0, 1fr); }
    .product-list .product { grid-template-columns: 48px minmax(0, 1fr) auto; }
    .product-list .product-bottom { grid-column: 2 / -1; }
}
@media (max-width: 760px) {
    .main { padding: 0 16px calc(100px + env(safe-area-inset-bottom)); }
    .sidebar {
        height: auto;
        min-height: calc(72px + env(safe-area-inset-bottom));
        padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
    }
    .nav { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); }
    .nav button {
        width: 100%; min-width: 0; min-height: 56px;
        padding: 8px 1px; gap: 6px; font-size: 10px;
        justify-content: center; text-align: center; white-space: nowrap;
    }
    .nav-desktop { display: none; }
    .nav-mobile { display: inline; }
    .topbar { gap: 6px; }
    .mobile-brand { min-width: 0; gap: 6px; font-size: 20px; }
    .mobile-brand select { width: 100%; max-width: 160px; text-overflow: ellipsis; }
    .topbar > .btn, .topbar > #currency { flex-shrink: 0; }
    .topbar > #currency { width: 65px; }
    .topbar > .btn { width: 38px; min-height: 40px; padding: 8px; }
    .pagehead { flex-wrap: wrap; gap: 16px; margin: 24px 0 20px; }
    .pagehead > :first-child { flex: 1 1 180px; }
    .pagehead h1 { font-size: 28px; letter-spacing: -.7px; }
    .pagehead p { font-size: 12px; line-height: 1.6; }
    .pagehead .controls { max-width: none; flex: 1 1 125px; }
    .pagehead .controls select { min-height: 44px; font-size: 13px; }
    .pagehead .controls > .btn { width: 100%; min-height: 44px; }
    .toolbar { gap: 10px; }
    .toolbar .search { flex: 1 1 100%; width: 100%; min-width: 0; }
    .toolbar > select { flex: 1 1 150px; max-width: 100%; }
    .toolbar > .btn { min-height: 42px; }
    .expense-toolbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; }
    .expense-toolbar .search { grid-column: 1 / -1; }
    .expense-toolbar > .btn { min-height: 44px; }
    .toolbar .segmented { flex-wrap: wrap; overflow: visible; }
    .toolbar .segmented button { min-height: 34px; flex: 1 1 auto; }
    .view-header { gap: 12px; flex-wrap: wrap; line-height: 1.6; }
    .card { padding: 18px; }
    .card-head { align-items: flex-start; }
    .card-head h2 { font-size: 15px; flex: 1 1 130px; }
    .card-head small { font-size: 11px; }
    .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .stat { padding: 14px; }
    .stat-value { font-size: clamp(20px, 5.8vw, 28px); letter-spacing: -.6px; line-height: 1.25; }
    .stat-foot { font-size: 10px; line-height: 1.5; }
    .stat-label { line-height: 1.45; padding-right: 20px; }
    .stat .mini-icon { right: 12px; top: 14px; }
    .recent-row { flex-wrap: wrap; gap: 10px; }
    .recent-row .info { flex: 1 1 100px; }
    .recent-row .amount { white-space: nowrap; }
    .donut-layout { flex-direction: column; align-items: stretch; gap: 12px; }
    .donut { flex: 0 0 150px; width: 150px; height: 150px; align-self: center; }
    .legend-row { gap: 7px; font-size: 12px; }
    .legend-row .value { font-size: 12px; }
    .legend-row .dot { flex-shrink: 0; }
    .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .product { min-width: 0; padding: 14px; }
    .product-bottom > .btn { flex: 1 1 100%; min-height: 38px; }
    .product-grid .btn { font-size: 11px; }
    .product h3 { font-size: 14px; }
    .product-list .product { grid-template-columns: 35px minmax(0, 1fr) auto; }
    .product-list .product-bottom { flex-wrap: wrap; }
    .product-list .product-bottom > .btn { flex: 1 1 auto; }
    .shopcard .controls { flex-wrap: wrap; }
    .shopcard select { min-height: 40px; font-size: 12px; flex: 1 1 140px; }
    .formgrid { grid-template-columns: minmax(0, 1fr); }
    .formgrid .full { grid-column: 1; }
    .formgrid label { font-size: 12px; line-height: 1.5; }
    .formgrid input:not([type=checkbox]):not([type=color]),
    .formgrid select, .formgrid textarea { font-size: 16px; min-height: 44px; }
    .form-footer { gap: 10px; }
    .form-footer > .btn { flex: 1 1 130px; min-height: 44px; }
    .settings-grid .form-footer > .btn { width: 100%; }
    .member-row, .category-row { gap: 10px; }
    .member-row > span, .category-row > span:nth-child(2) { min-width: 0; }
    .dropzone { padding: 24px 0; }
    .dropzone h2 { font-size: 24px; line-height: 1.3; }
    .dropzone .controls { justify-content: center; }
    .dropzone .controls > .btn { flex: 1 1 120px; min-height: 44px; }
    .dropzone select { max-width: 100%; }
    .fxnote { font-size: 11px; line-height: 1.7; }
    .periodcustom { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .periodcustom input { width: 100%; font-size: 13px; }
    .periodcustom > .btn { grid-column: 1 / -1; }
    dialog { width: calc(100% - 16px); max-height: calc(100dvh - 24px); }
    .modal-head, .modal-body { padding: 16px; }
    .modal-head h2 { font-size: 18px; }
    .modal-head > .btn { width: 40px; height: 40px; }
    .auth-card { padding: 28px 20px; }
    .auth-card h1 { font-size: 34px; }
    .toast { bottom: calc(88px + env(safe-area-inset-bottom)); line-height: 1.5; }
    /* Receipt history: no horizontal scrolling to see the amount or action. */
    .expense-table, .receipt-detail-table { overflow: visible; margin: 0; }
    .expense-table table, .expense-table tbody,
    .receipt-detail-table table, .receipt-detail-table tbody { display: block; width: 100%; }
    .expense-table thead, .receipt-detail-table thead { display: none; }
    .expense-table tr {
        display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        gap: 14px 12px; padding: 18px 0; border-bottom: 1px solid var(--line);
    }
    .expense-table tr:first-child { padding-top: 0; }
    .expense-table tr:last-child { border-bottom: 0; padding-bottom: 0; }
    .expense-table td { padding: 0; border: 0; min-width: 0; font-size: 13px; }
    .expense-table td[data-label]::before,
    .receipt-detail-table td[data-label]::before {
        content: attr(data-label); display: block;
        font-size: 11px; color: var(--muted); margin-bottom: 6px; font-weight: 400;
    }
    .expense-merchant { grid-column: 1 / -1; }
    .expense-merchant .shop-name { align-items: flex-start; font-size: 15px; line-height: 1.45; }
    .expense-merchant .rank-icon { width: 36px; height: 36px; }
    .expense-merchant .subline { font-size: 11px; margin-top: 6px; }
    .expense-date .subline { display: inline; margin-left: 4px; font-size: inherit; }
    .expense-total { text-align: left; font-weight: 650; font-variant-numeric: tabular-nums; }
    .expense-action { display: flex; align-items: flex-end; justify-content: flex-end; }
    .expense-action > .btn { min-height: 40px; width: 100%; }
    .receipt-detail-table tr {
        display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px; padding: 16px 0; border-bottom: 1px solid var(--line);
    }
    .receipt-detail-table td { min-width: 0; padding: 0; border: 0; overflow-wrap: anywhere; }
    .receipt-detail-table td:first-child { grid-column: 1 / -1; font-size: 15px; }
    /* Each editor row becomes a labelled item card; handlers still use the same inputs. */
    .modal-body .editor-items { overflow: visible; }
    .editor-items table, .editor-items tbody { display: block; width: 100%; min-width: 0; }
    .editor-items thead { display: none; }
    .editor-items tr {
        position: relative; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px; padding: 16px; padding-top: 55px; margin-bottom: 14px;
        border: 1px solid var(--line); border-radius: 14px; background: var(--bg);
    }
    .editor-items td { padding: 0; border: 0; min-width: 0; }
    .editor-items td::before {
        content: attr(data-label); display: block; color: var(--muted);
        font-size: 12px; margin-bottom: 7px;
    }
    .editor-items td.item-name, .editor-items td:nth-child(8) { grid-column: 1 / -1; min-width: 0; }
    .editor-items td.item-name { grid-row: 1; }
    .editor-items input, .editor-items select { min-width: 0 !important; font-size: 16px; min-height: 44px; padding: 10px; }
    .editor-items input[type=checkbox] { width: 22px; min-height: 22px; height: 22px; }
    .editor-items td:last-child { position: absolute; top: 10px; right: 12px; }
    .editor-items td:last-child::before { display: none; }
    .editor-items td:last-child .btn { min-height: 34px; min-width: 34px; }
}
@media (max-width: 359px) {
    .main { padding-left: 12px; padding-right: 12px; }
    .card { padding: 15px; }
    .mobile-brand { font-size: 18px; }
    .topbar > .btn { width: 34px; }
    .product-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
    .stat-number { display: block; white-space: nowrap; font-size: clamp(17px, 4.8vw, 24px); letter-spacing: -.7px; }
    .stat-currency { display: block; margin-top: 5px; font-size: 12px; letter-spacing: 0; }
    .product-list .product > .pill { grid-column: 2 / -1; justify-self: start; }
    .product-list .product > .qty { white-space: nowrap; }
    .product-list .product > .qty small { white-space: normal; }
}

/* Space-led header and compact everyday actions. */
.space-brand { font-size: 18px; letter-spacing: -.3px; padding: 0 6px; }
.space-topbar { height: auto; min-height: 94px; padding: 18px 0; gap: 16px; }
.space-switch {
    flex: 1; min-width: 0; display: flex; gap: 12px; align-items: center;
    border: 0; background: none; text-align: left; padding: 0; color: var(--text);
}
.space-avatar {
    flex: 0 0 44px; width: 44px; height: 44px; display: grid; place-items: center;
    background: var(--panel2); border: 1px solid var(--line); border-radius: 14px; font-size: 25px;
}
.space-title { display: flex; flex-direction: column; min-width: 0; gap: 5px; }
.space-title small { font-size: 9px; letter-spacing: 1.5px; color: var(--muted); }
.space-title strong { font-size: 21px; font-weight: 600; line-height: 1.25; overflow-wrap: anywhere; }
.space-switch > .icon { width: 14px; height: 14px; color: var(--muted); flex-shrink: 0; }
.header-actions { display: flex; flex-shrink: 0; align-items: center; gap: 8px; }
.currency-trigger {
    border: 1px solid var(--line); border-radius: 12px; background: var(--panel);
    color: var(--mint); height: 42px; padding: 0 13px; font-size: 12px; font-weight: 650;
}
.header-actions .btn { width: 42px; height: 42px; border-radius: 12px; }
.choice-list, .currency-choices { display: grid; gap: 10px; }
.space-choice, .currency-choice {
    display: flex; align-items: center; gap: 12px; width: 100%; padding: 16px;
    border: 1px solid var(--line); border-radius: 14px; background: var(--bg); text-align: left;
}
.space-choice.selected, .currency-choice.selected { border-color: var(--mint); background: #25392b; }
.space-choice > span { font-size: 26px; }
.space-choice strong { flex: 1; min-width: 0; overflow-wrap: anywhere; font-weight: 550; }
.currency-choice strong { width: 46px; color: var(--mint); }
.currency-choice span { flex: 1; color: var(--muted); font-size: 13px; }
.product-tools { display: flex; align-items: center; gap: 3px; }
.product-tools .btn { min-width: 36px; min-height: 36px; padding: 7px; }
.product-list .product-top > .product-tools { display: flex; grid-column: 1/-1; justify-content: flex-end; }
.extra-fields {
    margin: 0; padding: 14px 0; border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line); color: var(--text);
}
.extra-fields > summary { font-size: 13px; line-height: 1.6; }
.extra-fields > summary > span { display: block; margin-left: 16px; font-size: 11px; color: var(--muted); }
.extra-fields > .formgrid { margin-top: 18px; }
.budget-month { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, .65fr); gap: 10px; }
.budget-month select { min-width: 0; width: 100%; }
.shopping-hint { color: var(--muted); font-size: 12px; margin: 0 0 18px; line-height: 1.6; }
.compact-board { align-items: start; }
.compact-board .board-column { padding: 12px; min-height: 130px; }
.compact-board .column-title { padding: 8px 4px 16px; font-weight: 600; }
.compact-shopcard {
    display: flex; align-items: flex-start; gap: 8px;
    padding: 12px 8px; margin: 0; border: 0; border-top: 1px solid var(--line);
    border-radius: 0; background: none; cursor: default; min-width: 0;
}
.shop-grip {
    touch-action: none; user-select: none; -webkit-user-select: none;
    border: 0; background: none; color: var(--muted); padding: 8px 0; cursor: grab;
    flex: 0 0 22px; min-height: 40px; align-self: center;
}
.shop-grip .icon { width: 16px; stroke-width: 4; }
.shop-check {
    flex: 0 0 26px; width: 26px; height: 26px; margin-top: 5px; border-radius: 8px;
    border: 1px solid #627567; background: none; padding: 3px; color: var(--mint);
}
.shop-check.checked { background: var(--mint); color: #172b1e; border-color: var(--mint); }
.shop-check .icon { width: 18px; height: 18px; }
.shop-item-body { flex: 1; min-width: 0; }
.shop-item-name {
    display: block; width: 100%; background: none; padding: 4px 0; border: 0;
    text-align: left; font-size: 14px; font-weight: 550; line-height: 1.4; overflow-wrap: anywhere;
}
.shop-item-body > small { display: block; color: var(--muted); font-size: 11px; line-height: 1.5; margin: 3px 0; overflow-wrap: anywhere; }
.compact-shopcard .shop-status {
    border: 0; background: none; padding: 5px 0; width: 100%; max-width: 160px;
    min-height: 30px; font-size: 11px; color: var(--muted);
}
.shop-row-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; flex-shrink: 0; }
.shop-row-actions .btn { padding: 7px; min-height: 36px; }
.shop-empty { padding: 14px 4px; font-size: 11px; color: var(--muted); line-height: 1.6; }
.touch-dragging { background: #314b38; border-radius: 12px; opacity: .75; }
.shopping-dragging { user-select: none; -webkit-user-select: none; }
.compact-board .drop-active { outline: 2px dashed var(--mint); outline-offset: 2px; background: #243b2b; }
@media (min-width: 1101px) and (max-width: 1399px) {
    .compact-board { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
    .space-topbar { min-height: 92px; padding: 16px 0; gap: 10px; }
    .space-switch { gap: 9px; }
    .space-avatar { flex-basis: 36px; width: 36px; height: 36px; border-radius: 11px; font-size: 22px; }
    .space-title small { font-size: 8px; letter-spacing: 1px; }
    .space-title strong { font-size: 18px; }
    .space-switch > .icon { width: 11px; }
    .header-actions { gap: 6px; }
    .currency-trigger { height: 40px; padding: 0 10px; font-size: 11px; }
    .header-actions .btn { width: 38px; height: 40px; min-height: 40px; padding: 9px; }
    .pagehead { margin-top: 22px; }
    .product-list .product > .product-top { display: contents; }
    .product-list .product-tools { grid-column: 1/-1; grid-row: auto; }
    .product-list .product > .product-top > .product-emoji { grid-row: 1; }
    .product-list .product > h3 { grid-row: 1; grid-column: 2; }
    .product-list .product > .qty { grid-row: 1; grid-column: 3; }
    .product-list .product > .product-bottom { grid-column: 1/-1; }
    .product-bottom > .btn { flex: 1 1 auto; }
    .compact-board { gap: 12px; }
    .compact-board .board-column { padding: 10px 12px; }
    .compact-shopcard { padding: 10px 0; gap: 9px; }
    .shop-item-name { font-size: 14px; }
    .shop-row-actions { max-width: 72px; }
    .shop-row-actions .btn { white-space: normal; font-size: 10px; }
}

/* Compact rows and one clear action in page headings. */
.pagehead-add { display: grid; grid-template-columns: minmax(0, 1fr) 44px; align-items: start; gap: 16px; }
.pagehead-add .controls { width: 44px; max-width: 44px; margin-top: 6px; }
.pagehead .add-icon { width: 44px; height: 44px; min-height: 44px; padding: 10px; border-radius: 13px; }
.pagehead .add-icon .icon { width: 21px; height: 21px; }
.pagehead-add > :first-child { min-width: 0; }
.space-symbol { display: inline-grid; place-items: center; color: var(--mint); }
.space-symbol .icon { width: 24px; height: 24px; }
.space-avatar { color: var(--mint); background: var(--accent-soft); border-color: var(--accent-line); }
.space-avatar .icon { width: 23px; height: 23px; }
.space-choice > .space-symbol { flex: 0 0 40px; width: 40px; height: 40px; border-radius: 12px; background: var(--panel2); }
.compact-shopcard { align-items: center; gap: 8px; }
.compact-shopcard .shop-grip { align-self: center; margin: 0; }
.compact-shopcard .shop-item-body { align-self: center; }
.compact-shopcard .shop-item-name { padding: 0; line-height: 1.45; font-size: 13px; }
.compact-shopcard .shop-item-body > small { margin: 5px 0 0; font-size: 11px; }
.compact-shopcard .shop-row-actions { display: flex; flex-direction: row; align-items: center; align-self: center; max-width: none; gap: 2px; }
.compact-shopcard .shop-row-actions .btn { flex: 0 0 32px; width: 32px; min-width: 32px; min-height: 36px; padding: 7px; }
.compact-shopcard .advance-item { color: var(--mint); }
.compact-board .column-title { padding-bottom: 12px; }
.compact-board .board-column { min-height: 100px; }
.stock-list { display: grid; gap: 8px; }
.stock-row {
    display: flex; align-items: center; gap: 10px; min-width: 0;
    border: 1px solid var(--line); background: var(--panel); padding: 12px; border-radius: 14px;
}
.stock-row-emoji { display: grid; place-items: center; flex: 0 0 32px; width: 32px; height: 32px; font-size: 22px; }
.stock-row-body { flex: 1; min-width: 0; }
.stock-row-name { display: block; border: 0; background: none; padding: 0; text-align: left; font-size: 13px; font-weight: 550; line-height: 1.5; overflow-wrap: anywhere; }
.stock-row-body > small { display: block; color: var(--muted); font-size: 11px; line-height: 1.5; margin-top: 4px; overflow-wrap: anywhere; }
.stock-expiry { display: block; color: var(--muted); font-size: 10px; margin-top: 3px; }
.stock-expiry.expired { color: var(--red); }
.stock-row-actions { display: flex; align-items: center; gap: 2px; flex-shrink: 0; }
.stock-row-actions .btn { width: 32px; min-width: 32px; min-height: 36px; padding: 7px; }
.scan-card { padding: 20px; }
.scan-card .dropzone { padding: 36px 22px; background: var(--accent-soft); border-color: var(--accent-line); }
.scan-card .dropzone h2 { font-size: 23px; line-height: 1.4; }
.scan-card .dropzone .controls { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 24px 0 18px; }
.scan-card .dropzone .controls > .btn { min-width: 0; min-height: 46px; padding: 10px; font-size: 12px; }
.scan-formats { display: block; color: var(--muted); font-size: 11px; line-height: 1.6; }
.scan-icon, .product-emoji, .rank-icon { background: var(--accent-soft); color: var(--mint); }
/* Workspace accents are independent of expense category colors. */
.btn.primary, .stat.main-stat { background: var(--mint); border-color: var(--mint); color: #17231b; }
.btn.primary:hover { filter: brightness(1.06); background: var(--mint); }
.main-stat .stat-label, .main-stat .stat-foot, .main-stat .mini-icon { color: #354b3c; }
.nav button.active, .nav button.active:hover { background: var(--accent-soft); color: var(--mint); }
.nav button.active .count { background: var(--accent-soft); color: var(--mint); }
.space-choice.selected, .currency-choice.selected { background: var(--accent-soft); border-color: var(--mint); }
.segmented button.active, .pill, .notice:not(.warn) { background: var(--accent-soft); color: var(--mint); }
.compact-board .drop-active, .touch-dragging { background: var(--accent-soft); }
input:focus, select:focus, textarea:focus { border-color: var(--mint); }
@media (max-width: 760px) {
    .pagehead-add { display: grid; grid-template-columns: minmax(0, 1fr) 44px; flex-wrap: unset; align-items: start; }
    .pagehead-add .controls { flex: none; max-width: 44px; }
    .pagehead-add h1 { font-size: 28px; }
    .stock-row { padding: 12px 10px; gap: 7px; }
    .stock-row-emoji { flex-basis: 26px; width: 26px; font-size: 21px; }
    .stock-row-actions .btn { width: 30px; min-width: 30px; min-height: 38px; padding: 6px; }
    .compact-shopcard { gap: 7px; padding: 12px 0; }
    .compact-shopcard .shop-row-actions .btn { width: 30px; min-width: 30px; flex-basis: 30px; }
    .scan-card { padding: 14px; }
    .scan-card .dropzone { padding: 28px 16px; }
    .scan-card .dropzone h2 { font-size: 21px; }
    .scan-card .dropzone .controls { gap: 8px; }
    .scan-card .dropzone .controls > .btn { padding: 10px 6px; font-size: 11px; gap: 6px; }
}
