/* Folio's look from the iOS Theme: warm paper, white cards, teal and navy. */
:root {
  --bg: #F4F3EF; --card: #FFFFFF; --tile: #F1F0EC; --inactive: #FAF9F6; --hairline: #E8E6E0;
  --text: #1C1C1E; --muted: #6E6E73; --accent: #0E9AA7; --navy: #232A5C;
  --positive: #1F9D63; --negative: #D9473F; --pending: #C9780A;
  --series-0: #0E9AA7; --series-1: #4F5BD5; --series-2: #D9762B; --series-3: #B24C8E; --series-4: #1F9D63; --series-5: #2F7FD8;
  --radius: 22px; --shadow: 0 4px 12px rgba(0,0,0,.05);
  --rounded: ui-rounded, "SF Pro Rounded", system-ui, sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0E0F13; --card: #1A1C22; --tile: #262932; --inactive: #16181D; --hairline: #2C2F38; --text: #F2F2F5; --muted: #9A9AA2;
    --accent: #5EEAD4; --navy: #C7CCF5; --positive: #4ADE80; --negative: #F87171; --pending: #FBBF24; --shadow: none; }
}
* { box-sizing: border-box; }
body { margin: 0; font: 14px/1.45 system-ui, -apple-system, sans-serif; background: var(--bg); color: var(--text); display: flex; min-height: 100vh; font-variant-numeric: tabular-nums; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
h1 { font: 700 26px/1.2 var(--rounded); margin: 0; }
h2 { font: 600 17px/1.3 var(--rounded); margin: 0; }
h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 0 0 8px; }
.muted { color: var(--muted); font-size: 13px; }
.small { font-size: 12px; }
.positive { color: var(--positive); }
.negative { color: var(--negative); }

/* Sidebar */
.sidebar { width: 220px; flex: none; padding: 20px 14px; display: flex; flex-direction: column; gap: 18px; position: sticky; top: 0; height: 100vh; border-right: 1px solid var(--hairline); }
.brand { display: flex; align-items: center; gap: 10px; font: 700 20px var(--rounded); color: var(--navy); padding: 0 8px; }
.brand-mark { width: 30px; height: 30px; flex: none; }
#nav { display: flex; flex-direction: column; gap: 2px; }
#nav a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 12px; color: var(--muted); font-weight: 500; }
#nav a:hover { background: var(--tile); color: var(--text); }
#nav a.active { background: var(--card); color: var(--text); box-shadow: var(--shadow); font-weight: 600; }
#nav a.active .nav-icon { color: var(--accent); }
.nav-icon { width: 20px; text-align: center; }
#sync-status { margin-top: auto; }
#sync-status a { display: flex; gap: 8px; align-items: center; font-size: 12px; color: var(--muted); padding: 8px 10px; border-radius: 10px; }
#sync-status a:hover { background: var(--tile); }
#sync-status a.bad { color: var(--negative); }
.spinner { display: inline-block; }
.busy .spinner { animation: spin 1s linear infinite; color: var(--accent); }
@keyframes spin { to { transform: rotate(360deg); } }
body.demo .sidebar::after { content: "Made-up demo data"; font-size: 11px; color: var(--pending); padding: 0 10px; }

/* Pages */
main { flex: 1; min-width: 0; padding: 28px 32px 60px; }
body { overflow-x: hidden; }
.page { max-width: 1180px; margin: 0 auto; display: flex; flex-direction: column; gap: 18px; }
.page.narrow { max-width: 720px; }
.page-head { display: flex; align-items: center; gap: 14px; }
.back { color: var(--accent); font-weight: 500; margin-bottom: -8px; }
.columns { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
.main-column, .side-column { display: flex; flex-direction: column; gap: 18px; }
.side-column { position: sticky; top: 28px; }
@media (max-width: 1000px) { .columns { grid-template-columns: 1fr; } .side-column { position: static; } }
.card { background: var(--card); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); position: relative; }
.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty strong { color: var(--text); font-size: 16px; }

/* Chips */
.chips { display: flex; gap: 6px; flex-wrap: wrap; position: relative; }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-bottom: 14px; }
.chip { border: 1px solid var(--hairline); background: none; border-radius: 999px; padding: 7px 14px; color: var(--muted); font-weight: 500; cursor: pointer; white-space: nowrap; }
.chip.selected { background: var(--tile); border-color: transparent; color: var(--text); font-weight: 600; }
.chips.spans { margin-top: 12px; display: grid; grid-template-columns: repeat(6, 1fr); }
.chips.spans .chip { padding: 6px 0; }
/* The sliding capsule behind a newly selected chip (chips() with a glide key). */
.chips.gliding .chip.selected { background: none; }
.chip-glider { position: absolute; border-radius: 999px; background: var(--tile); pointer-events: none; }
.chips.gliding .chip { position: relative; }
/* Headline figures whose digits roll (rollingNumber in chart.js). */
.figure.rolling { white-space: nowrap; }
.figure.rolling .slot { display: inline-block; position: relative; }
.figure.rolling .glyph { display: inline-block; }
.figure.rolling .glyph.leaving { position: absolute; left: 0; top: 0; }

/* Chart */
.chart-head .figure { font: 700 32px/1.15 var(--rounded); }
.change { font-weight: 600; font-size: 14px; }
.change .caption { color: var(--muted); font-weight: 400; }
.plot { position: relative; height: 200px; margin-top: 14px; cursor: crosshair; }
.plot svg { width: 100%; height: 100%; display: block; overflow: hidden; }
.plot .line { fill: none; stroke: var(--accent); stroke-width: 2.25; stroke-linejoin: round; }
.plot .baseline { stroke: var(--muted); stroke-opacity: .45; stroke-dasharray: 3 4; stroke-width: 1; }
.plot .rule { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--hairline); pointer-events: none; }
.plot .dot { position: absolute; width: 11px; height: 11px; margin: -5.5px 0 0 -5.5px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2.5px var(--card); pointer-events: none; }
.axis { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-top: 4px; }
.chart-empty { height: 200px; display: grid; place-items: center; color: var(--muted); }

/* Accounts */
.group-head { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.group-head .right { text-align: right; }
.group-total { font: 600 17px var(--rounded); }
.rows > * + * { border-top: 1px solid var(--hairline); }
.account-row { display: flex; align-items: center; gap: 12px; padding: 11px 6px; border-radius: 12px; }
.account-row:hover { background: var(--tile); }
.account-row.inactive { background: var(--inactive); opacity: .85; }
.account-row .title { font-weight: 500; }
.account-row .right { text-align: right; }
.balance { font-weight: 600; }
.grow { flex: 1; min-width: 0; }
.grow > div { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile { display: inline-grid; place-items: center; flex: none; background: var(--tile); line-height: 1; }
.tile.letter { font-family: var(--rounded); font-weight: 700; }
.logo { border-radius: 50%; border: .5px solid var(--hairline); flex: none; object-fit: cover; }
.link-row { width: 100%; border: 0; background: none; color: var(--accent); padding: 12px; cursor: pointer; font-weight: 500; text-align: center; }
.summary-line { display: flex; justify-content: space-between; margin-top: 16px; font-weight: 500; }
.summary-line.total { border-top: 1px solid var(--hairline); padding-top: 14px; }
.breakdown { margin-top: 8px; }
.stack { display: flex; height: 10px; border-radius: 5px; overflow: hidden; gap: 2px; margin-bottom: 8px; }
.legend-row { display: grid; grid-template-columns: 10px 1fr auto auto; gap: 8px; align-items: center; font-size: 13px; padding: 3px 0; }
.legend-row .value { min-width: 84px; text-align: right; }
.swatch { width: 10px; height: 10px; border-radius: 3px; }
.account-head h1 { font-size: 24px; }

/* Transactions */
.tx-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; align-items: start; }
.tx-layout:has(.detail:not([hidden])) { grid-template-columns: minmax(0, 1fr) 360px; }
@media (max-width: 1000px) { .tx-layout:has(.detail:not([hidden])) { grid-template-columns: 1fr; } }
.tx-main { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.tx-main { container-type: inline-size; }
@container (max-width: 640px) { .toolbar .search { flex-basis: 100%; } .toolbar .tool { flex: 1; justify-content: center; } }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; }
.search { flex: 1; min-width: 0; height: 40px; background: var(--card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%238E8E93' stroke-width='1.8' stroke-linecap='round'%3E%3Ccircle cx='7' cy='7' r='5'/%3E%3Cpath d='m11 11 3.5 3.5'/%3E%3C/svg%3E") no-repeat 13px center / 15px; border: 1px solid var(--hairline); border-radius: 12px; padding: 0 14px 0 36px; outline: none; }
.search:focus { border-color: color-mix(in srgb, var(--accent) 50%, transparent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 12%, transparent); }
.tool { height: 40px; background: var(--card); border: 1px solid var(--hairline); border-radius: 12px; padding: 0 14px; cursor: pointer; display: flex; align-items: center; gap: 6px; font-weight: 500; }
.tool:hover { background: var(--tile); }
.badge { background: var(--accent); color: var(--card); border-radius: 999px; font-size: 11px; font-weight: 700; padding: 1px 6px; }
.summary-bar { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 4px 16px; color: var(--muted); font-size: 13px; padding: 2px 18px 0; }
.summary-bar strong { color: var(--text); font-weight: 600; }
.totals { display: flex; gap: 16px; }
.notice { background: var(--tile); border-radius: 12px; padding: 10px 14px; font-size: 13px; }
.link { border: 0; background: none; color: var(--accent); cursor: pointer; padding: 0; font-weight: 500; }
.tx-layout .card { padding: 4px 8px 8px; }
/* The list runs edge to edge: tinted day bands, hairlines between rows. overflow: clip rounds the corners without breaking sticky headers. */
.tx-main .card { container-type: inline-size; padding: 0; overflow: clip; }
/* Day headers stay on screen while their day scrolls past. */
.day-head { position: sticky; top: 0; z-index: 1; display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; font-weight: 600; color: var(--muted); padding: 9px 18px; background: color-mix(in srgb, var(--tile) 65%, var(--card)); }
.day-head span:last-child { font-weight: 500; }
.tx-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 18px; border: 0; background: none; text-align: left; cursor: pointer; }
.tx-row + .tx-row, .tx-row + .link-row { border-top: 1px solid var(--hairline); }
.tx-row:hover { background: var(--tile); }
.tx-row.selected { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.tx-text { flex: 1; min-width: 0; }
.title-line { display: flex; align-items: center; gap: 6px; min-width: 0; }
.tx-row .title { font-size: 15px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.tx-row .sub, .tx-row .note { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tx-row .sub > span + span::before { content: " · "; }
.tx-row .note { font-style: italic; }
.flag { flex: none; color: var(--muted); font-size: 13px; line-height: 1; }
.flag.edited { color: var(--accent); }
.tx-col { display: none; font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tx-row:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
/* The category cell looks like text until hovered, then like a menu button (as in Monarch). */
.cat-button { align-items: center; gap: 4px; margin: -5px 0 -5px -9px; padding: 5px 8px; border: 1px solid transparent; border-radius: 9px; background: none; color: var(--muted); font-size: 13px; text-align: left; cursor: pointer; min-width: 0; }
.cat-button .cat-name, .cat-picker-button .cat-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chevron { flex: none; font-size: 12px; line-height: 1; opacity: 0; transform: translateY(-2px); }
.tx-row:hover .cat-button, .cat-button:focus-visible, .cat-button.open { border-color: var(--hairline); background: var(--card); color: var(--text); }
.tx-row:hover .cat-button .chevron, .cat-button:focus-visible .chevron, .cat-button.open .chevron, .cat-picker-button .chevron { opacity: .7; }
.cat-picker-button { display: flex; align-items: center; gap: 6px; width: 100%; text-align: left; cursor: pointer; }
.cat-picker-button.open { border-color: color-mix(in srgb, var(--accent) 50%, transparent); }
/* Category menu */
.picker { position: fixed; z-index: 20; display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--hairline); border-radius: 14px; box-shadow: 0 12px 40px rgba(0,0,0,.18); overflow: hidden; }
.picker-search { flex: none; margin: 8px; height: 36px; border: 1px solid color-mix(in srgb, var(--accent) 50%, transparent); border-radius: 10px; padding: 0 12px 0 34px; outline: none; background: var(--card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%238E8E93' stroke-width='1.8' stroke-linecap='round'%3E%3Ccircle cx='7' cy='7' r='5'/%3E%3Cpath d='m11 11 3.5 3.5'/%3E%3C/svg%3E") no-repeat 11px center / 14px; }
.picker-list { overflow-y: auto; padding: 0 8px 8px; overscroll-behavior: contain; }
.picker-group { position: sticky; top: 0; z-index: 1; font-size: 12px; font-weight: 600; color: var(--muted); padding: 7px 10px; margin-top: 6px; border-radius: 8px; background: color-mix(in srgb, var(--tile) 65%, var(--card)); }
.picker-group:first-child { margin-top: 0; }
.picker-option { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: none; border-radius: 8px; padding: 7px 10px; text-align: left; cursor: pointer; }
.picker-option.active { background: var(--tile); }
.picker-option.current { font-weight: 600; }
.picker-icon { width: 20px; text-align: center; flex: none; }
.picker-option .check { color: var(--accent); }
.picker-empty { color: var(--muted); padding: 16px 10px; text-align: center; font-size: 13px; }
.tx-amount { flex: none; min-width: 90px; text-align: right; font-size: 15px; font-weight: 600; }
.tx-row.pending .tx-amount { color: var(--muted); }
/* Wide lists: category and account as columns. */
@container (min-width: 720px) {
  .tx-col { display: block; flex: 0 0 22%; }
  .tx-col.account { flex-basis: 20%; }
  .tx-col.cat-button { display: flex; }
  .tx-row .sub > .stacked { display: none; }
  .tx-row .sub > span + span::before { content: none; }
  .tx-amount { min-width: 110px; }
}
.amount.strong { font-weight: 600; }
.pill { flex: none; border-radius: 999px; padding: 1px 8px; font-size: 11px; font-weight: 600; line-height: 16px; }
.pill.pending { color: var(--pending); background: color-mix(in srgb, var(--pending) 13%, transparent); }
.detail { position: sticky; top: 28px; }
.detail .card { padding: 22px; }
.close { position: absolute; top: 12px; right: 14px; border: 0; background: var(--tile); border-radius: 50%; width: 28px; height: 28px; cursor: pointer; color: var(--muted); font-size: 18px; line-height: 1; }
.detail-head { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; margin-bottom: 18px; }
.amount.big { font: 700 34px var(--rounded); }
.fields { display: flex; flex-direction: column; }
.field { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 10px; padding: 10px 0; border-top: 1px solid var(--hairline); font-size: 13px; }
.field .label { color: var(--muted); }
.field .value { overflow-wrap: anywhere; display: flex; flex-wrap: wrap; gap: 6px; }
.field a { color: var(--accent); }
.notes { white-space: pre-wrap; }
.tag { display: inline-flex; align-items: center; gap: 5px; background: var(--tile); border-radius: 999px; padding: 1px 9px; }
.dot { width: 8px; height: 8px; border-radius: 50%; }
.statuses { background: var(--tile); border-radius: 12px; padding: 10px 12px; margin: 12px 0; font-size: 13px; display: flex; flex-direction: column; gap: 4px; }
.record .field { color: var(--muted); }

/* Filters */
dialog.filters { border: 0; border-radius: var(--radius); padding: 0; width: min(640px, 94vw); max-height: 86vh; background: var(--card); color: var(--text); box-shadow: 0 20px 60px rgba(0,0,0,.25); display: none; }
dialog.filters[open] { display: flex; flex-direction: column; }
dialog::backdrop { background: rgba(14,15,19,.35); }
dialog header, dialog footer { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; gap: 10px; }
dialog header { border-bottom: 1px solid var(--hairline); }
dialog footer { border-top: 1px solid var(--hairline); justify-content: flex-end; }
dialog footer button { border: 1px solid var(--hairline); background: none; border-radius: 12px; padding: 8px 16px; cursor: pointer; }
.filter-body { overflow: auto; padding: 8px 20px 20px; display: flex; flex-direction: column; gap: 20px; }
.filter-body section { margin-top: 10px; }
.inline { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.inline input, .inline select, .pick-search { border: 1px solid var(--hairline); border-radius: 10px; padding: 6px 10px; background: var(--card); }
.inline input[type=number] { width: 110px; }
.pick-search { width: 100%; margin-bottom: 6px; }
.pick-list { max-height: 200px; overflow: auto; border: 1px solid var(--hairline); border-radius: 12px; padding: 4px 10px; }
.pick-group { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; padding: 8px 0 2px; }
.pick { display: flex; gap: 8px; align-items: center; padding: 4px 0; cursor: pointer; }
.segmented { display: inline-flex; background: var(--tile); border-radius: 10px; padding: 2px; }
.segmented button { border: 0; background: none; border-radius: 8px; padding: 5px 12px; cursor: pointer; color: var(--muted); }
.segmented button.selected { background: var(--card); color: var(--text); font-weight: 600; box-shadow: var(--shadow); }
.tristates { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px 20px; }
.tristate { display: flex; justify-content: space-between; align-items: center; }
button.primary { background: var(--accent); color: #fff; border: 0; border-radius: 12px; padding: 9px 18px; font-weight: 600; cursor: pointer; }
button.primary:disabled { opacity: .5; cursor: default; }

/* Sync */
.status { display: flex; gap: 16px; align-items: center; }
.status h2 { font-size: 22px; }
.status p { margin: 4px 0 0; }
.status-icon { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; font-size: 22px; color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); flex: none; }
.status-icon.busy { animation: spin 1.4s linear infinite; }
.status-icon.bad { color: var(--negative); background: color-mix(in srgb, var(--negative) 14%, transparent); }
progress { width: 100%; margin-top: 16px; accent-color: var(--accent); }
.actions { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.actions button:not(.primary) { border: 1px solid var(--hairline); background: none; border-radius: 12px; padding: 8px 16px; cursor: pointer; }
.facts { display: flex; flex-direction: column; margin-top: 8px; }
.fact { display: flex; justify-content: space-between; gap: 16px; padding: 9px 0; border-top: 1px solid var(--hairline); }
.fact:first-child { border-top: 0; }

@media (max-width: 760px) {
  body { flex-direction: column; }
  .sidebar { width: auto; height: auto; position: sticky; top: 0; z-index: 5; background: var(--bg); flex-direction: row; align-items: center; gap: 8px; padding: 8px 10px; border-right: 0; border-bottom: 1px solid var(--hairline); }
  #nav { flex-direction: row; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; } #nav a { padding: 6px 8px; white-space: nowrap; }
  .brand, body.demo .sidebar::after { display: none; }
  #sync-status { margin: 0; flex: none; } #sync-status a { font-size: 0; gap: 0; padding: 8px; } #sync-status .spinner { font-size: 16px; }
  .figures { grid-template-columns: repeat(3, minmax(0, 1fr)); } .stat strong { font-size: 17px; }
  .day-head { top: 49px; }
  .field { grid-template-columns: 90px minmax(0, 1fr); }
  main { padding: 18px 14px 40px; }
}

/* Reports and Forecast */
.page-head.spread { justify-content: space-between; }
.period-nav { display: flex; align-items: center; justify-content: space-between; text-align: center; }
button.round { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--hairline); background: none; cursor: pointer; font-size: 20px; line-height: 1; color: var(--accent); }
button.round:disabled { opacity: .3; cursor: default; }
.figures { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 16px 0 6px; }
.stat { display: flex; flex-direction: column; gap: 2px; }
.stat strong { font: 700 20px var(--rounded); }
.bar-chart svg { width: 100%; height: auto; display: block; margin-top: 10px; }
.bars .zero { stroke: var(--hairline); }
.bars .tick { font-size: 11px; fill: var(--muted); }
.bars .tick.on { fill: var(--text); font-weight: 600; }
.bars .hit { cursor: pointer; }
.chart-nav { display: flex; justify-content: space-between; margin-top: 4px; }
.link:disabled { opacity: .35; cursor: default; }
.breakdown-body { display: grid; grid-template-columns: 180px 1fr; gap: 20px; align-items: start; margin-top: 10px; }
@media (max-width: 700px) { .breakdown-body { grid-template-columns: 1fr; } }
.donut { width: 100%; max-width: 180px; }
.donut-label { font-size: 11px; fill: var(--muted); }
.donut-total { font: 700 18px var(--rounded); fill: var(--text); }
.category-row { display: flex; align-items: center; gap: 12px; width: 100%; border: 0; background: none; padding: 8px 6px; border-radius: 12px; cursor: pointer; text-align: left; }
.category-row:hover { background: var(--tile); }
.category-row .line { display: flex; justify-content: space-between; gap: 8px; }
.bar-line { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.bar { flex: 1; height: 5px; border-radius: 3px; background: var(--tile); overflow: hidden; }
.bar span { display: block; height: 100%; border-radius: 3px; }
.summary-link { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; border-top: 1px solid var(--hairline); background: none; padding: 12px 2px; cursor: pointer; text-align: left; }
.summary-link span:first-child { flex: 1; font-weight: 500; }
.summary-link:disabled { opacity: .5; cursor: default; }
.chev { color: var(--muted); }
h3.spaced { margin-top: 18px; }
.chips.spans.five { grid-template-columns: repeat(5, 1fr); }
.pill.danger { display: inline-block; color: var(--negative); background: color-mix(in srgb, var(--negative) 13%, transparent); padding: 4px 12px; margin-top: 10px; }
.controls { margin-top: 14px; }
.stepper { display: inline-flex; align-items: center; gap: 10px; }
.stepper button { width: 28px; height: 28px; border-radius: 8px; border: 1px solid var(--hairline); background: none; cursor: pointer; }
.stepper button:disabled { opacity: .35; }
.slider { display: block; margin-top: 14px; }
.slider .line { display: flex; justify-content: space-between; }
.slider input { width: 100%; accent-color: var(--accent); }
.setting { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 16px; }
input.money { width: 130px; border: 1px solid var(--hairline); border-radius: 10px; padding: 6px 10px; background: var(--card); }

/* Editing */
.name-edit { font: 600 17px/1.3 var(--rounded); text-align: center; border: 1px solid transparent; border-radius: 10px; padding: 4px 8px; background: none; width: 100%; }
.name-edit:hover, .name-edit:focus { border-color: var(--hairline); background: var(--card); outline: none; }
.inline-select { border: 1px solid var(--hairline); border-radius: 10px; padding: 5px 8px; background: var(--card); max-width: 100%; min-width: 0; }
.tag-picker { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-picker .tag { border: 1px solid var(--hairline); background: none; cursor: pointer; color: var(--muted); }
.tag-picker .tag.on { background: var(--tile); border-color: transparent; color: var(--text); font-weight: 600; }
.notes-edit { width: 100%; border: 1px solid var(--hairline); border-radius: 10px; padding: 6px 8px; background: var(--card); resize: vertical; font: inherit; }
.edits { margin-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.edits h3 { margin: 0; }
.edit { background: var(--tile); border-radius: 12px; padding: 10px 12px; font-size: 13px; }
.edit.conflict { background: color-mix(in srgb, var(--pending) 12%, var(--card)); }
.edit.failed { background: color-mix(in srgb, var(--negative) 10%, var(--card)); }
.edit-actions { display: flex; gap: 8px; margin-top: 8px; }
.edit-actions button { border: 1px solid var(--hairline); background: var(--card); border-radius: 10px; padding: 5px 12px; cursor: pointer; }
.icon.edited { color: var(--accent); }
.plot .selection { position: absolute; top: 0; bottom: 0; background: color-mix(in srgb, var(--accent) 14%, transparent); border-left: 1px solid var(--accent); border-right: 1px solid var(--accent); pointer-events: none; }
.chips.spans.with-custom { grid-template-columns: repeat(7, 1fr); }
@media (max-width: 1000px) {
  .detail:not([hidden]) { position: fixed; left: 0; right: 0; bottom: 0; top: auto; max-height: 82vh; overflow: auto; z-index: 20; padding: 0 8px 8px; }
  .detail .card { box-shadow: 0 -8px 30px rgba(0,0,0,.18); }
}
