#financeWorkspace .workspace-toolbar { justify-content: space-between; }
.ledger-space-picker { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; max-width: 100%; margin-left: 12px; font-size: 13px; color: #52647b; }
.ledger-space-caption { flex: 0 0 auto; }
.ledger-create-button { min-height: 32px; max-width: 100%; padding: 6px 10px; border: 1px solid #bcd5ff; border-radius: 6px; color: #246fd8; background: #eff5ff; font: inherit; cursor: pointer; }
.ledger-create-button:disabled { opacity: .5; cursor: wait; }
.ledger-create-button:focus-visible { outline: 2px solid #2878ff; outline-offset: 2px; }
.ledger-create-dialog { width: min(420px,calc(100vw - 32px)); max-height: calc(100vh - 40px); padding: 22px; border: 1px solid #d8e3f0; border-radius: 12px; background: #fff; box-shadow: 0 18px 70px #192b4a33; }
.ledger-create-dialog::backdrop { background: #17263c66; }
.ledger-create-dialog form { display: grid; gap: 16px; }
.ledger-create-dialog h2 { margin: 0; color: #344156; font-size: 18px; }
.ledger-create-dialog label { display: grid; gap: 8px; color: #52647b; font-size: 14px; }
.ledger-create-dialog input { width: 100%; min-width: 0; min-height: 40px; padding: 8px 10px; border: 1px solid #ccd9ea; border-radius: 7px; font-size: 15px; }
.ledger-create-dialog footer { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }
.ledger-create-dialog footer button { min-height: 34px; padding: 6px 12px; border: 1px solid #d8e3f0; border-radius: 6px; background: #fff; color: #4c607a; font-size: 14px; cursor: pointer; }
.ledger-create-dialog footer button.primary { border-color: #2878ff; background: #2878ff; color: #fff; }
.ledger-create-dialog input:focus-visible { outline: 2px solid #aacbff; border-color: #2878ff; }
.ledger-create-error { margin: 0; color: #c9434a; overflow-wrap: anywhere; font-size: 13px; }
.ledger-create-error:empty { display: none; }
.ledger-space-choices { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; max-width: 100%; }
.ledger-rename-button { flex: 0 0 auto; padding: 5px 7px; min-height: 30px; border: 1px solid #d8e3f0; border-radius: 6px; background: #fff; color: #52647b; font: inherit; font-size: 12px; cursor: pointer; }
.ledger-rename-button:disabled { opacity: .5; cursor: wait; }
#financeWorkspace .ledger-space-button,#shopDataWorkspace .ledger-space-button { min-width: 0; max-width: 100%; min-height: 32px; padding: 6px 10px; border: 1px solid #d8e3f0; border-radius: 6px; background: #fff; color: #4c607a; font: inherit; line-height: 1.4; white-space: normal; overflow-wrap: anywhere; cursor: pointer; }
#financeWorkspace .ledger-space-button:hover,#shopDataWorkspace .ledger-space-button:hover { border-color: #2878ff; color: #2878ff; background: #f0f6ff; }
#financeWorkspace .ledger-space-button[aria-pressed="true"],#shopDataWorkspace .ledger-space-button[aria-pressed="true"] { color: #fff; background: #2878ff; border-color: #2878ff; }
.ledger-space-button:focus-visible { outline: 2px solid #2878ff; outline-offset: 2px; }
@media(max-width:700px) { .ledger-space-picker { flex-basis: 100%; margin-left: 0; }.shop-data-workspace .workspace-toolbar>div:first-child { min-width: 0; max-width: 100%; } }
#financeWorkspace .fin-toolbar-actions { display: flex; gap: 8px; flex-wrap: wrap; }
#financeWorkspace button { padding: 6px 10px; min-height: 32px; background: #fff; border: 1px solid #d8e3f0; border-radius: 6px; color: #4c607a; cursor: pointer; }
#financeWorkspace button.primary { color: #fff; background: #2878ff; border-color: #2878ff; }
#financeWorkspace button:disabled { opacity: .5; cursor: default; }
.fin-summary { display: flex; align-items: stretch; gap: 24px; padding: 12px 16px; border: 1px solid #dce6f4; border-radius: 10px; background: #fff; margin-bottom: 16px; overflow-x: auto; }
.fin-total-item { flex: 0 0 auto; display: grid; align-content: center; gap: 4px; padding-right: 24px; border-right: 1px solid #e0e8f2; }.fin-total-item span,.fin-category-totals dt { font-size: 12px; color: #657991; white-space: nowrap; }
.fin-summary strong { font-size: 22px; font-variant-numeric: tabular-nums; color: #273c56; white-space: nowrap; }
.fin-category-totals { display: flex; flex: 1 0 auto; align-items: center; gap: 24px; margin: 0; }.fin-category-totals > div { flex: 1 0 auto; }.fin-category-totals dd { margin: 4px 0 0; font-size: 20px; font-weight: 600; color: #273c56; font-variant-numeric: tabular-nums; white-space: nowrap; }
.fin-board-scroll { overflow-x: auto; }.fin-board { display: grid; grid-template-columns: repeat(var(--fin-group-count,5),minmax(var(--fin-column-min,280px),1fr)); gap: 14px; align-items: start; padding-bottom: 12px; }
.fin-group { min-width: 0; border: 1px solid #dce6f4; border-radius: 10px; background: #fff; overflow: hidden; }.fin-group header { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 14px 10px; background: #f7faff; }
.fin-group h2 { margin: 0 0 5px; font-size: 14px; color: #52647b; }.fin-group-total { font-size: 18px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.fin-group header { flex-wrap: wrap; }
.fin-group-actions { display: flex; gap: 5px; flex-wrap: wrap; }
#financeWorkspace .fin-group-actions button { min-height: 28px; padding: 4px 6px; font-size: 12px; }
.fin-field-setting { display: flex; gap: 8px; margin-bottom: 10px; align-items: center; }
.fin-field-setting input { flex: 1; min-width: 0; }
.fin-field-setting button { flex: 0 0 auto; }
.fin-field-hint { font-size: 12px; line-height: 1.6; color: #657991; }
.fin-table-scroll { overflow-x: auto; }.fin-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.fin-table th,.fin-table td { border: 1px solid #e0e8f2; padding: 4px 6px; text-align: left; vertical-align: middle; }.fin-table th { font-weight: 500; color: #718298; background: #fbfcfe; }
.fin-table .fin-day,.fin-table .fin-amount { white-space: nowrap; }.fin-table .fin-amount { text-align: right; font-variant-numeric: tabular-nums; }.fin-note { min-width: 60px; overflow-wrap: anywhere; white-space: pre-wrap; }
.fin-table .fin-month-row>th,.fin-table .fin-month-row>td { background: #f0f5fc; font-weight: 600; }
#financeWorkspace .fin-month-heading { display: inline-flex; align-items: center; gap: 4px; min-height: 0; padding: 0; border: 0; border-radius: 2px; background: transparent; color: #31445f; font: inherit; font-weight: 600; text-align: left; }
#financeWorkspace button.fin-month-heading:hover { background: #e5efff; }
.fin-month-heading[aria-expanded]::before { content: "▸"; color: #647b99; }
.fin-month-heading[aria-expanded="true"]::before { content: "▾"; }
.fin-month-heading:focus-visible { outline: 2px solid #2878ff; outline-offset: -2px; }
.fin-month-label { flex: 0 0 auto; }
.fin-month-total { font-variant-numeric: tabular-nums; }
.fin-table tr[hidden] { display: none; }
.fin-entry-editable { cursor: pointer; }
.fin-entry-editable:hover,.fin-entry-editable:focus-within { background: #f0f6ff; }
#financeWorkspace .fin-entry-date { min-height: 0; padding: 0; border: 0; border-radius: 2px; background: transparent; color: inherit; font: inherit; }
#financeWorkspace .fin-entry-date:focus-visible { outline: 2px solid #2878ff; outline-offset: 2px; }
#financeWorkspace #finDelete { margin-right: auto; color: #c43c4b; border-color: #efc7cd; }
.fin-count { margin: 9px 10px; color: #8492a6; font-size: 12px; }.fin-empty { color: #8492a6; text-align: center; }
.fin-editor label { display: grid; gap: 6px; margin-bottom: 14px; font-size: 13px; }.fin-editor input,.fin-editor select,.fin-editor textarea { width: 100%; min-width: 0; padding: 9px 10px; border: 1px solid #d8e3f0; border-radius: 6px; font: inherit; color: #31445f; }.fin-editor textarea { min-height: 84px; resize: vertical; }
.fin-message { color: #b23d4b; font-size: 13px; overflow-wrap: anywhere; }
.fin-category-manager { padding: 20px; max-height: 85vh; overflow: auto; }
.fin-category-manager > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.fin-category-manager h2 { font-size: 18px; margin: 0 0 16px; }
.fin-category-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-top: 1px solid #e0e8f2; padding: 12px 0; }
.fin-category-row > div { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.fin-category-row > .fin-category-actions { flex: 0 0 auto; display: flex; flex-direction: column; gap: 6px; }
#financeWorkspace .fin-category-actions button { min-height: 26px; padding: 3px 6px; }
#financeWorkspace .fin-category-actions button:first-child { color: #2878ff; }
.fin-category-row small { display: block; margin-top: 5px; color: #657991; }
#financeWorkspace .fin-category-row button { color: #c43c4b; flex-shrink: 0; }
.fin-category-row > .fin-category-order { display: flex; flex: 0 0 auto; flex-direction: column; gap: 4px; }
#financeWorkspace .fin-category-row .fin-order-button { min-width: 54px; min-height: 30px; padding: 4px 6px; color: #52647b; font-size: 12px; touch-action: manipulation; }
.fin-category-row:focus-visible { outline: 2px solid #2878ff; outline-offset: -2px; }
@media(max-width:480px) {
  .fin-category-row { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 8px; }
  .fin-category-detail { grid-column: 1 / -1; grid-row: 1; }
  .fin-category-row > .fin-category-order { grid-column: 1; grid-row: 2; flex-direction: row; justify-self: start; }
  .fin-category-row > button { grid-column: 2; grid-row: 2; justify-self: end; }
}
.fin-order-footer { position: sticky; bottom: -20px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; background: #fff; border-top: 1px solid #e0e8f2; }
.fin-order-footer span { font-size: 12px; color: #657991; line-height: 1.5; }
.fin-order-footer button { flex-shrink: 0; }
@media(max-width:700px) { .fin-board { grid-template-columns: minmax(0,1fr); }.fin-board-scroll { overflow: visible; } }
@media(max-width:700px) {
  .fin-summary { flex-direction: column; gap: 12px; overflow: visible; }
  .fin-total-item { flex: none; min-width: 0; padding-right: 0; padding-bottom: 10px; border-right: 0; border-bottom: 1px solid #e0e8f2; }
  .fin-category-totals { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); flex: none; min-width: 0; width: 100%; gap: 12px; align-items: start; }
  .fin-category-totals>div { min-width: 0; }
  .fin-total-item span,.fin-category-totals dt { white-space: normal; overflow-wrap: anywhere; }
  .fin-summary strong,.fin-category-totals dd { white-space: normal; overflow-wrap: anywhere; }
  .fin-category-totals dd { font-size: 18px; }
}
