.btn-xs {
  padding: .1rem .3rem;
  font-size: .75rem;
  border-radius: .2rem;
}

/* 支出単位一覧 */
#expense-bill-app.expense-bill-screen {
  margin: -1rem -0.75rem 0;
  min-height: calc(100vh - 56px);
  background: #f3f0e9;
  color: #17171c;
}

#expense-bill-app .expense-bill-shell {
  width: min(1320px, calc(100vw - 32px));
  margin: 0 auto;
}

#expense-bill-app .expense-bill-year-strip,
#expense-bill-app .expense-bill-month-strip {
  border-bottom: 1px solid #e5e1d9;
  background: #fff;
}

#expense-bill-app .expense-bill-year-strip__inner {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr) 136px;
  align-items: center;
  min-height: 88px;
  gap: 24px;
  padding: 18px 0 10px;
}

#expense-bill-app .expense-bill-year-control {
  display: flex;
  align-items: center;
  gap: 8px;
}

#expense-bill-app .expense-bill-year-label {
  min-width: 42px;
  text-align: center;
  font-size: 15px;
  font-weight: 750;
}

#expense-bill-app .expense-bill-icon-btn,
#expense-bill-app .expense-bill-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: #f3f3f5;
  color: #626670;
  text-decoration: none;
}

#expense-bill-app .expense-bill-icon-btn {
  width: 32px;
  height: 32px;
  border-radius: 9px;
}

#expense-bill-app .expense-bill-icon-btn:hover,
#expense-bill-app .expense-bill-action-btn:hover {
  background: #e9e9ec;
  color: #202126;
}

#expense-bill-app .expense-bill-month-bars {
  height: 54px;
  gap: 28px;
  padding: 0;
}

#expense-bill-app .expense-bill-month-bar {
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

#expense-bill-app .expense-bill-month-bars .ds-month-bars__track {
  height: 36px;
  align-items: flex-end;
}

#expense-bill-app .expense-bill-month-bars .ds-month-bars__fill {
  min-height: 1px;
  border-radius: 2px 2px 0 0;
  background: #c7c2ba;
}

#expense-bill-app .expense-bill-month-bars .ds-month-bars__fill--current {
  background: #4f46e5;
}

#expense-bill-app .expense-bill-month-bars .ds-month-bars__label {
  margin-top: 4px;
  color: #9fa3aa;
  font-size: 10px;
}

#expense-bill-app .expense-bill-month-bars .ds-month-bars__label--current {
  color: #4f46e5;
  font-weight: 700;
}

#expense-bill-app .expense-bill-basis-switch {
  justify-self: end;
  display: inline-flex;
  padding: 3px;
  border-radius: 9px;
  background: #f2f2f4;
}

#expense-bill-app .expense-bill-segment-btn {
  padding: 4px 14px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #6b6f77;
  font-size: 12px;
  font-weight: 650;
}

#expense-bill-app .expense-bill-segment-btn.active {
  background: #17171c;
  color: #fff;
}

#expense-bill-app .expense-bill-inline-error {
  color: #a31d1d;
  font-size: 12px;
}

#expense-bill-app .expense-bill-link-btn {
  border: 0;
  background: transparent;
  color: #4f46e5;
  font-weight: 700;
}

#expense-bill-app .expense-bill-month-strip__inner {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr) 180px;
  align-items: center;
  min-height: 54px;
}

#expense-bill-app .expense-bill-month-summary {
  display: flex;
  justify-content: center;
  align-items: baseline;
  gap: 16px;
}

#expense-bill-app .expense-bill-month-range {
  font-size: 15px;
  font-weight: 750;
  white-space: nowrap;
}

#expense-bill-app .expense-bill-total {
  color: #e51a27;
  font-weight: 750;
  white-space: nowrap;
}

#expense-bill-app .expense-bill-month-actions {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 8px;
}

#expense-bill-app .expense-bill-subtle-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 13px;
  border-radius: 9px;
  background: #f3f3f5;
  color: #626670;
  font-size: 12px;
  font-weight: 650;
  text-decoration: none;
}

#expense-bill-app .expense-bill-body {
  padding: 28px 0 40px;
}

#expense-bill-app .expense-bill-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 15px;
}

#expense-bill-app .expense-bill-active-filters {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: -3px 0 14px;
  color: #777b84;
  font-size: 12px;
}

#expense-bill-app .expense-bill-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 9px;
  border-radius: 999px;
  background: #e9e7ff;
  color: #4338ca;
  font-weight: 700;
}

#expense-bill-app .expense-bill-filter-chip .btn-close {
  width: 7px;
  height: 7px;
  padding: 2px;
  font-size: 8px;
}

#expense-bill-app .expense-bill-main-grid {
  display: grid;
  grid-template-columns: 238px minmax(0, 1fr);
  align-items: start;
  gap: 18px;
}

#expense-bill-app .expense-bill-content {
  min-width: 0;
}

#expense-bill-app .expense-bill-sidebar-panel {
  overflow: hidden;
  border-radius: 13px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(20, 18, 14, 0.08);
}

#expense-bill-app .expense-bill-sidebar-label {
  padding: 14px 15px 9px;
  color: #989ba2;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

#expense-bill-app .expense-bill-store-list {
  max-height: 620px;
  overflow-y: auto;
  padding: 0 8px 8px;
}

#expense-bill-app .expense-bill-store-row {
  display: block;
  width: 100%;
  padding: 9px 8px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #4d5058;
  text-align: left;
}

#expense-bill-app .expense-bill-store-row:hover {
  background: #f6f5f2;
}

#expense-bill-app .expense-bill-store-row.active {
  background: #eeecff;
  color: #4338ca;
}

#expense-bill-app .expense-bill-store-row__main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

#expense-bill-app .expense-bill-store-row__name {
  overflow: hidden;
  min-width: 0;
  font-size: 12px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#expense-bill-app .expense-bill-store-row__name i {
  margin-right: 4px;
  color: #9b9da4;
}

#expense-bill-app .expense-bill-store-row strong {
  flex: 0 0 auto;
  font-size: 11px;
}

#expense-bill-app .expense-bill-store-bar {
  display: block;
  height: 3px;
  margin-top: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8e7e4;
}

#expense-bill-app .expense-bill-store-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #6366f1;
}

#expense-bill-app .expense-bill-store-status {
  margin: 0;
  padding: 12px 15px 16px;
  color: #8b8e96;
  font-size: 12px;
}

#expense-bill-app .expense-bill-store-status.is-error {
  display: grid;
  gap: 6px;
  color: #a31d1d;
}

#expense-bill-app .expense-bill-store-status button {
  width: max-content;
  padding: 0;
  border: 0;
  background: transparent;
  color: #4f46e5;
  font-weight: 700;
}

#expense-bill-app .expense-bill-kicker {
  display: block;
  margin-bottom: 2px;
  color: #989ba2;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.16em;
}

#expense-bill-app .expense-bill-heading {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

#expense-bill-app .expense-bill-add-btn,
#expense-bill-app .expense-bill-empty-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-radius: 9px;
  background: #17171c;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

#expense-bill-app .expense-bill-add-btn {
  min-height: 36px;
  padding: 0 15px;
}

#expense-bill-app .expense-bill-panel {
  overflow: hidden;
  border-radius: 13px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(20, 18, 14, 0.08);
}

#expense-bill-app .expense-bill-panel__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  padding: 0 20px;
  color: #777b84;
  font-size: 13px;
}

#expense-bill-app .expense-bill-table-head,
#expense-bill-app .expense-bill-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
}

#expense-bill-app .expense-bill-table-head {
  padding: 0 20px 10px;
  border-bottom: 1px solid #ece9e1;
  color: #9da1a9;
  font-size: 11px;
  font-weight: 700;
  grid-template-columns: minmax(0, 1fr) 125px 72px;
}

#expense-bill-app .expense-bill-table-head span:nth-child(2) {
  text-align: right;
}

#expense-bill-app .expense-bill-date-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 35px;
  padding: 0 20px;
  border-bottom: 1px solid #ece9e1;
  background: #fdfbf7;
  color: #292a2f;
  font-size: 13px;
  font-weight: 750;
}

#expense-bill-app .expense-bill-date-header__subtotal {
  color: #e51a27;
  font-size: 12px;
}

#expense-bill-app .expense-bill-card {
  border-bottom: 1px solid #ededee;
  background: #fff;
}

#expense-bill-app .expense-bill-card:last-child {
  border-bottom: 0;
}

#expense-bill-app .expense-bill-card.is-expanded {
  background: #fffefd;
}

#expense-bill-app .expense-bill-row {
  min-height: 56px;
  padding: 10px 16px 10px 20px;
}

#expense-bill-app .expense-bill-row-link {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 125px;
  align-items: center;
  gap: 12px;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

#expense-bill-app .expense-bill-row-link:hover {
  color: inherit;
}

#expense-bill-app .expense-bill-main {
  min-width: 0;
}

#expense-bill-app .expense-bill-store-line {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

#expense-bill-app .expense-bill-store {
  overflow: hidden;
  font-size: 14px;
  font-weight: 780;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#expense-bill-app .expense-bill-subline {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 10px;
  margin-top: 3px;
  min-width: 0;
}

#expense-bill-app .expense-bill-summary,
#expense-bill-app .expense-bill-payment-summary,
#expense-bill-app .expense-bill-note {
  overflow: hidden;
  color: #8c9098;
  font-size: 12px;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#expense-bill-app .expense-bill-note i {
  margin-right: 3px;
}

#expense-bill-app .expense-bill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 5px;
}

#expense-bill-app .expense-bill-tag {
  border: 1px solid color-mix(in srgb, var(--tag-color) 42%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--tag-color) 10%, white);
  padding: 2px 7px;
  color: color-mix(in srgb, var(--tag-color) 68%, #1f2024);
  font-size: 10px;
  font-weight: 700;
}

#expense-bill-app .expense-bill-friend-badge,
#expense-bill-app .expense-bill-owner-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

#expense-bill-app .expense-bill-friend-badge {
  padding: 3px 7px;
  background: #fff3dd;
  color: #a85a09;
}

#expense-bill-app .expense-bill-payment-summary {
  color: #50535a;
  font-size: 12px;
  font-weight: 650;
}

#expense-bill-app .expense-bill-payment-count {
  color: #a1a4aa;
  font-size: 10px;
}

#expense-bill-app .expense-bill-amount {
  text-align: right;
}

#expense-bill-app .expense-bill-amount strong {
  display: block;
  color: #e51a27;
  font-size: 14px;
}

#expense-bill-app .expense-bill-amount small {
  color: #a0a3aa;
  font-size: 10px;
}

#expense-bill-app .expense-bill-expand-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 44px;
  min-height: 44px;
  width: auto;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  background: #f3f3f5;
  color: #626670;
  flex-shrink: 0;
}

#expense-bill-app .expense-bill-expand-btn:hover {
  background: #e9e9ec;
  color: #202126;
}

#expense-bill-app .expense-bill-action-label {
  font-size: 11px;
  font-weight: 700;
}

#expense-bill-app .expense-bill-details {
  margin: 0 20px 14px;
  overflow: hidden;
  border: 1px solid #e8e5de;
  border-radius: 10px;
  background: #faf9f6;
}

#expense-bill-app .expense-bill-details__head,
#expense-bill-app .expense-bill-detail-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(120px, 180px) 60px 106px 106px 56px;
  align-items: center;
  gap: 14px;
  padding: 0 14px;
}

#expense-bill-app .expense-bill-details__head {
  min-height: 34px;
  border-bottom: 1px solid #e8e5de;
  color: #777b83;
  font-size: 11px;
  font-weight: 750;
}

#expense-bill-app .expense-bill-details__head span:nth-child(3),
#expense-bill-app .expense-bill-details__head span:nth-child(4),
#expense-bill-app .expense-bill-details__head span:nth-child(5) {
  text-align: right;
}

#expense-bill-app .expense-bill-detail-row {
  min-height: 48px;
  border-bottom: 1px solid #ece9e3;
  font-size: 12px;
}

#expense-bill-app .expense-bill-detail-row:last-child {
  border-bottom: 0;
}

#expense-bill-app .expense-bill-detail-main {
  min-width: 0;
}

#expense-bill-app .expense-bill-detail-name {
  display: block;
  overflow: hidden;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#expense-bill-app .expense-bill-detail-quantity,
#expense-bill-app .expense-bill-detail-unit-price,
#expense-bill-app .expense-bill-detail-category {
  color: #92959c;
  font-size: 11px;
}

#expense-bill-app .expense-bill-detail-quantity,
#expense-bill-app .expense-bill-detail-unit-price {
  text-align: right;
  white-space: nowrap;
}

#expense-bill-app .expense-bill-detail-mobile-label {
  display: none;
}

#expense-bill-app .expense-bill-detail-category {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#expense-bill-app .expense-bill-detail-amount {
  text-align: right;
}

#expense-bill-app .expense-bill-owner-badge {
  justify-content: center;
  padding: 3px 7px;
  background: #e8f0ff;
  color: #365ea8;
}

#expense-bill-app .expense-bill-owner-badge.is-friend {
  background: #fff3dd;
  color: #a85a09;
}

#expense-bill-app .expense-bill-owner-badge.is-split {
  background: #e8f7ee;
  color: #257148;
}

#expense-bill-app .expense-bill-state {
  min-height: 250px;
}

#expense-bill-app .expense-bill-empty-action {
  min-height: 34px;
  margin-top: 16px;
  padding: 0 14px;
}

#expense-bill-app .expense-bill-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  padding: 18px;
  border-top: 1px solid #ededee;
}

@media (max-width: 991.98px) {
  #expense-bill-app .expense-bill-main-grid {
    display: block;
  }

  #expense-bill-app .expense-bill-sidebar {
    margin-bottom: 12px;
  }

  #expense-bill-app .expense-bill-sidebar-panel {
    padding: 10px;
  }

  #expense-bill-app .expense-bill-sidebar-label {
    padding: 0 2px 8px;
  }

  #expense-bill-app .expense-bill-store-scroll {
    display: flex;
    gap: 7px;
    overflow-x: auto;
    padding: 1px 1px 4px;
    scrollbar-width: thin;
  }

  #expense-bill-app .expense-bill-store-chip {
    flex: 0 0 auto;
    padding: 7px 10px;
    border: 1px solid #e1dfda;
    border-radius: 999px;
    background: #fff;
    color: #555861;
    font-size: 11px;
    font-weight: 700;
  }

  #expense-bill-app .expense-bill-store-chip span {
    margin-left: 5px;
    color: #92959c;
  }

  #expense-bill-app .expense-bill-store-chip.active {
    border-color: #4f46e5;
    background: #4f46e5;
    color: #fff;
  }

  #expense-bill-app .expense-bill-store-chip.active span {
    color: #e5e7ff;
  }

  #expense-bill-app .expense-bill-year-strip__inner,
  #expense-bill-app .expense-bill-month-strip__inner {
    display: block;
    padding: 14px 0;
  }

  #expense-bill-app .expense-bill-month-bars {
    margin-top: 12px;
    gap: 11px;
  }

  #expense-bill-app .expense-bill-basis-switch,
  #expense-bill-app .expense-bill-month-actions {
    margin-top: 12px;
  }

  #expense-bill-app .expense-bill-month-summary {
    justify-content: flex-start;
    flex-wrap: wrap;
    margin: 11px 0;
    gap: 6px 14px;
  }

  #expense-bill-app .expense-bill-month-actions {
    justify-content: space-between;
  }

  #expense-bill-app .expense-bill-table-head {
    display: none;
  }

  #expense-bill-app .expense-bill-row {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px 8px;
    padding: 10px 10px 10px 16px;
  }

  #expense-bill-app .expense-bill-row-link {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "main amount";
    gap: 6px 12px;
  }

  #expense-bill-app .expense-bill-main { grid-area: main; }
  #expense-bill-app .expense-bill-amount { grid-area: amount; }

  #expense-bill-app .expense-bill-summary,
  #expense-bill-app .expense-bill-payment-summary {
    white-space: normal;
  }

  #expense-bill-app .expense-bill-details {
    margin: 0 12px 14px;
  }

  #expense-bill-app .expense-bill-details__head {
    display: none;
  }

  #expense-bill-app .expense-bill-detail-row {
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 5px 12px;
    padding: 11px 12px;
  }

  #expense-bill-app .expense-bill-detail-category {
    grid-column: 1 / -1;
    white-space: normal;
  }

  #expense-bill-app .expense-bill-detail-quantity,
  #expense-bill-app .expense-bill-detail-unit-price {
    text-align: left;
  }

  #expense-bill-app .expense-bill-detail-mobile-label {
    display: block;
    margin-bottom: 1px;
    color: #a4a7ad;
    font-size: 9px;
  }

  #expense-bill-app .expense-bill-detail-amount {
    grid-column: 3;
    grid-row: 1;
  }

  #expense-bill-app .expense-bill-owner-badge {
    grid-column: 3;
    grid-row: 3;
  }
}

@media (max-width: 575.98px) {
  #expense-bill-app .expense-bill-shell {
    width: min(100% - 22px, 1120px);
  }

  #expense-bill-app .expense-bill-month-range {
    font-size: 13px;
  }

  #expense-bill-app .expense-bill-body {
    padding-top: 20px;
  }

  #expense-bill-app .expense-bill-heading {
    font-size: 20px;
  }

  #expense-bill-app .expense-bill-add-btn {
    padding: 0 11px;
  }

  #expense-bill-app .expense-bill-panel__meta,
  #expense-bill-app .expense-bill-date-header {
    padding-right: 16px;
    padding-left: 16px;
  }

  #expense-bill-app .expense-bill-store-line {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  #expense-bill-app .expense-bill-action-label {
    display: inline;
  }
}

/* Recurring expense module */
.recurring-screen {
  max-width: 1240px;
  margin: 0 auto;
  padding: 36px 28px 80px;
}

.recurring-page-header,
.recurring-header-actions,
.recurring-title-block,
.recurring-actions {
  display: flex;
  align-items: center;
}

.recurring-page-header {
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
}

.recurring-title-block {
  gap: 12px;
}

.recurring-title-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(99, 102, 241, 0.12);
  color: var(--ds-brand-accent);
  font-size: 1.25rem;
}

.recurring-title-block h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0;
}

.recurring-title-block p {
  margin: 4px 0 0;
  color: var(--ds-text-secondary);
  font-size: 0.875rem;
}

.recurring-header-actions {
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.recurring-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 18px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-size: 0.875rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.recurring-btn--primary {
  background: var(--ds-brand-accent);
  color: #fff;
  box-shadow: 0 2px 10px rgba(99, 102, 241, 0.28);
}

.recurring-btn--warning {
  background: #fbbf24;
  color: #1c1c1e;
  box-shadow: 0 2px 8px rgba(251, 191, 36, 0.3);
}

.recurring-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 22px;
}

.recurring-kpi-card,
.recurring-table-card,
.recurring-form-card,
.recurring-detail-card {
  background: var(--ds-bg-card);
  border-radius: 16px;
  box-shadow: var(--ds-card-shadow);
}

.recurring-kpi-card {
  padding: 24px 26px;
}

.recurring-kpi-label {
  display: block;
  margin-bottom: 12px;
  color: var(--ds-text-muted);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.recurring-kpi-card strong {
  display: block;
  color: var(--ds-text-primary);
  font-size: 2.25rem;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.recurring-kpi-card p {
  margin: 12px 0 0;
  color: var(--ds-text-muted);
  font-size: 0.8125rem;
}

.recurring-kpi-card p span {
  font-weight: 700;
}

.recurring-kpi-value--danger {
  color: var(--ds-color-danger-text) !important;
}

.recurring-kpi-value--success {
  color: var(--ds-color-success-text) !important;
}

.recurring-mini-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 700;
  white-space: nowrap;
}

.recurring-mini-badge--danger {
  background: var(--ds-color-danger-bg);
  color: var(--ds-color-danger-text);
}

.recurring-mini-badge--success {
  background: var(--ds-color-success-bg);
  color: var(--ds-color-success-text);
}

.recurring-mini-badge--warning {
  background: var(--ds-color-warning-bg);
  color: var(--ds-color-warning-text);
}

.recurring-mini-badge--subscription {
  background: #ccfbf1;
  color: #0f766e;
}

.recurring-kpi-card--link {
  display: block;
  text-decoration: none;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.recurring-kpi-card--link:hover {
  box-shadow: var(--ds-card-shadow-hover, var(--ds-card-shadow));
  transform: translateY(-1px);
}

.recurring-filter-tabs {
  display: inline-flex;
  gap: 3px;
  padding: 4px;
  margin-bottom: 18px;
  border-radius: 11px;
  background: #e4e1d8;
}

.recurring-filter-tab {
  padding: 7px 18px;
  border-radius: 8px;
  color: var(--ds-text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
}

.recurring-filter-tab.is-active {
  background: #111115;
  color: #fff;
  font-weight: 700;
}

.recurring-table-card {
  overflow: hidden;
}

.recurring-table-scroll {
  overflow-x: auto;
}

.recurring-table {
  width: 100%;
  min-width: 1060px;
  border-collapse: collapse;
}

.recurring-table th {
  padding: 13px 20px;
  background: #f8f7f4;
  color: var(--ds-text-muted);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.recurring-table td {
  padding: 15px 20px;
  border-top: 1px solid #f2f0eb;
  vertical-align: middle;
}

.recurring-row--due {
  background: rgba(251, 191, 36, 0.08);
}

.recurring-row--reduction {
  background: rgba(239, 68, 68, 0.06);
}

.recurring-row--inactive {
  color: var(--ds-text-muted);
  background: #f8f8f7;
}

.recurring-status {
  display: inline-flex;
  padding: 5px 11px;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
}

.recurring-status--active {
  background: #eef2ff;
  color: #4338ca;
}

.recurring-status--generated,
.recurring-status--success {
  background: var(--ds-color-success-bg);
  color: var(--ds-color-success-text);
}

.recurring-status--due,
.recurring-status--warning {
  background: var(--ds-color-warning-bg);
  color: var(--ds-color-warning-text);
}

.recurring-status--reduction,
.recurring-status--danger {
  background: var(--ds-color-danger-bg);
  color: var(--ds-color-danger-text);
}

.recurring-status--inactive {
  background: var(--ds-color-neutral-bg);
  color: var(--ds-color-neutral-text);
}

.recurring-template-title {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.recurring-template-title > span:first-child {
  min-width: 0;
  overflow: hidden;
  color: var(--ds-text-primary);
  font-size: 0.9375rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recurring-template-cell p,
.recurring-template-cell small,
.recurring-payment-cell small,
.recurring-date-cell small {
  display: block;
  margin-top: 3px;
  color: var(--ds-text-muted);
  font-size: 0.75rem;
}

.recurring-money {
  color: var(--ds-text-primary);
  font-size: 0.9375rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.recurring-category-pill {
  display: inline-block;
  max-width: 180px;
  overflow: hidden;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--ds-color-neutral-bg);
  color: var(--ds-color-neutral-text);
  font-size: 0.75rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recurring-payment-cell span,
.recurring-date-cell span {
  color: var(--ds-text-primary);
  font-size: 0.875rem;
  font-weight: 600;
}

.recurring-actions {
  justify-content: flex-end;
  gap: 5px;
}

.recurring-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 30px;
  min-height: 30px;
  padding: 5px 9px;
  border: 1px solid var(--ds-border-color);
  border-radius: 8px;
  background: var(--ds-color-neutral-bg);
  color: var(--ds-text-secondary);
  font-size: 0.75rem;
  font-weight: 700;
  text-decoration: none;
}

.recurring-action--generate {
  background: var(--ds-brand-accent);
  color: #fff;
  border-color: var(--ds-brand-accent);
}

.recurring-action--danger {
  background: var(--ds-color-danger-bg);
  color: var(--ds-color-danger);
  border-color: #fecaca;
}

.recurring-empty-state {
  padding: 28px;
  color: var(--ds-text-muted);
  text-align: center;
}

@media (max-width: 900px) {
  .recurring-screen {
    padding: 24px 16px 64px;
  }

  .recurring-page-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .recurring-header-actions {
    justify-content: flex-start;
    width: 100%;
  }

  .recurring-kpi-grid {
    grid-template-columns: 1fr;
  }
}

.recurring-page-header--compact {
  max-width: 920px;
  margin-left: auto;
  margin-right: auto;
}

.recurring-screen--form {
  max-width: 980px;
}

.recurring-btn--secondary {
  background: var(--ds-bg-card);
  color: var(--ds-text-primary);
  border-color: var(--ds-border-color);
}

.recurring-form-card {
  max-width: 920px;
  margin: 0 auto;
  padding: 0;
  overflow: hidden;
}

.recurring-form-section {
  padding: 24px 28px;
  border-bottom: 1px solid var(--ds-border-color);
}

.recurring-form-section:last-of-type {
  border-bottom: 0;
}

.recurring-form-section h2 {
  margin: 0 0 18px;
  color: var(--ds-text-primary);
  font-size: 0.875rem;
  font-weight: 800;
}

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

.recurring-field label {
  display: block;
  margin-bottom: 7px;
  color: var(--ds-text-secondary);
  font-size: 0.8125rem;
  font-weight: 700;
}

.recurring-field label span {
  color: var(--ds-color-danger);
}

.recurring-field small {
  display: block;
  margin-top: 6px;
  color: var(--ds-text-muted);
  font-size: 0.75rem;
}

.recurring-field .form-control,
.recurring-field .form-select {
  min-height: 40px;
  border-color: var(--ds-border-color);
  border-radius: 9px;
}

.recurring-field-error {
  margin-top: 6px;
  color: var(--ds-color-danger-text);
  font-size: 0.75rem;
}

.recurring-check-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
}

.recurring-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--ds-border-color);
  border-radius: 10px;
  background: var(--ds-color-neutral-bg);
  font-size: 0.875rem;
  font-weight: 700;
}

.recurring-form-actions {
  display: flex;
  gap: 10px;
  padding: 24px 28px;
  background: #f8f7f4;
}

.recurring-alert {
  margin: 24px 28px 0;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 0.875rem;
}

.recurring-alert--danger {
  background: var(--ds-color-danger-bg);
  color: var(--ds-color-danger-text);
}

.recurring-allocation-row {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(160px, 1fr) auto;
  align-items: end;
  gap: 18px;
}

.recurring-allocation-row .allocation-remove {
  white-space: nowrap;
}

@media (max-width: 720px) {
  .recurring-form-grid {
    grid-template-columns: 1fr;
  }

  .recurring-allocation-row {
    grid-template-columns: 1fr;
  }

  .recurring-form-actions {
    flex-direction: column;
  }
}

.recurring-screen--preview,
.recurring-screen--history,
.recurring-screen--delete {
  max-width: 980px;
}

.recurring-preview-summary {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  max-width: 920px;
  margin: 0 auto 18px;
  padding: 26px 28px;
}

.recurring-preview-summary strong {
  display: block;
  color: var(--ds-text-primary);
  font-size: 1.25rem;
  font-weight: 800;
}

.recurring-preview-summary p {
  margin: 8px 0 0;
  color: var(--ds-text-secondary);
}

.recurring-preview-amount {
  text-align: right;
}

.recurring-preview-amount strong {
  color: var(--ds-color-danger-text);
  font-size: 2rem;
  font-variant-numeric: tabular-nums;
}

.recurring-preview-card {
  max-width: 920px;
  margin: 0 auto;
  overflow: hidden;
}

.recurring-detail-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--ds-border-color);
}

.recurring-detail-heading h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
}

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

.recurring-preview-grid section {
  padding: 22px 24px;
  border-right: 1px solid var(--ds-border-color);
}

.recurring-preview-grid section:last-child {
  border-right: 0;
}

.recurring-preview-grid h3 {
  margin: 0 0 14px;
  color: var(--ds-text-primary);
  font-size: 0.875rem;
  font-weight: 800;
}

.recurring-preview-grid dl {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 9px 12px;
  margin: 0;
  font-size: 0.8125rem;
}

.recurring-preview-grid dt {
  color: var(--ds-text-muted);
  font-weight: 700;
}

.recurring-preview-grid dd {
  margin: 0;
  color: var(--ds-text-primary);
  font-weight: 600;
  min-width: 0;
  overflow-wrap: anywhere;
}

.recurring-form-actions--plain {
  background: transparent;
  border-top: 1px solid var(--ds-border-color);
}

.recurring-blocked-card {
  display: flex;
  gap: 14px;
  margin: 0 24px 24px;
  padding: 16px;
  border-radius: 12px;
  background: var(--ds-color-warning-bg);
  color: var(--ds-color-warning-text);
}

.recurring-blocked-card i {
  font-size: 1.25rem;
}

.recurring-blocked-card strong {
  display: block;
  margin-bottom: 12px;
}

@media (max-width: 820px) {
  .recurring-preview-summary,
  .recurring-preview-grid {
    display: block;
  }

  .recurring-preview-amount {
    margin-top: 18px;
    text-align: left;
  }

  .recurring-preview-grid section {
    border-right: 0;
    border-bottom: 1px solid var(--ds-border-color);
  }
}

.recurring-history-summary {
  max-width: 920px;
  margin: 0 auto 18px;
  padding: 18px 22px;
}

.recurring-history-summary strong {
  display: block;
  color: var(--ds-text-primary);
  font-size: 1rem;
  font-weight: 800;
}

.recurring-history-summary p {
  margin: 6px 0 0;
  color: var(--ds-text-secondary);
  font-size: 0.875rem;
}

.recurring-history-table {
  min-width: 760px;
}

.recurring-title-icon--danger {
  background: var(--ds-color-danger-bg);
  color: var(--ds-color-danger);
}

.recurring-delete-card {
  max-width: 720px;
  margin: 0 auto;
  padding: 28px;
}

.recurring-delete-card h2 {
  margin: 16px 0 8px;
  font-size: 1.25rem;
  font-weight: 800;
}

.recurring-delete-card p {
  margin: 0;
  color: var(--ds-text-secondary);
}

.recurring-delete-note {
  margin-top: 14px !important;
  color: var(--ds-color-danger-text) !important;
  font-weight: 700;
}

.recurring-btn--danger {
  background: var(--ds-color-danger);
  color: #fff;
  border-color: var(--ds-color-danger);
}

#dashboard-app.dashboard-screen {
  margin: -1rem -0.75rem 0;
  min-height: calc(100vh - 56px);
  background: #f1eee7;
  color: #111115;
}

#dashboard-app .dashboard-shell {
  width: min(1240px, calc(100vw - 56px));
  margin: 0 auto;
  padding: 40px 0 80px;
}

#dashboard-app .dashboard-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}

#dashboard-app .dashboard-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 5px;
}

#dashboard-app .dashboard-title-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(79, 70, 229, 0.1);
  color: #4f46e5;
  font-size: 15px;
  font-weight: 700;
}

#dashboard-app h1 {
  margin: 0;
  color: #111115;
  font-size: 22px;
  font-weight: 800;
  line-height: 1.2;
}

#dashboard-app .dashboard-subtitle {
  margin: 0 0 0 48px;
  color: #8c8998;
  font-size: 13.5px;
}

#dashboard-app .dashboard-controls,
#dashboard-app .dashboard-legend,
#dashboard-app .dashboard-card-head,
#dashboard-app .dashboard-card-head--split,
#dashboard-app .dashboard-yoy-kpis,
#dashboard-app .dashboard-payment-row,
#dashboard-app .dashboard-card-row,
#dashboard-app .dashboard-breakdown-row-main {
  display: flex;
  align-items: center;
}

#dashboard-app .dashboard-controls {
  gap: 10px;
}

#dashboard-app .dashboard-segment {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border-radius: 11px;
  background: #e4e1d8;
}

#dashboard-app .dashboard-segment button {
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #71717a;
  padding: 7px 16px;
  font-size: 13px;
  font-weight: 600;
}

#dashboard-app .dashboard-segment button.active {
  background: #111115;
  color: #fff;
}

#dashboard-app .dashboard-select-wrap {
  position: relative;
}

#dashboard-app .dashboard-select {
  min-width: 104px;
  appearance: none;
  border: 1.5px solid #e4e1d9;
  border-radius: 9px;
  background: #fff;
  color: #111115;
  padding: 8px 32px 8px 12px;
  font-size: 13.5px;
  font-weight: 500;
}

#dashboard-app .dashboard-select-caret {
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  color: #71717a;
  font-size: 10px;
  pointer-events: none;
}

#dashboard-app .dashboard-month-nav {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  border: 1.5px solid #e4e1d9;
  border-radius: 9px;
  background: #fff;
  padding: 3px 6px;
}

#dashboard-app .dashboard-month-nav strong {
  min-width: 88px;
  text-align: center;
  font-size: 13px;
}

#dashboard-app .dashboard-month-nav button {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 7px;
  background: #f1eee7;
  color: #4f46e5;
  font-size: 20px;
  line-height: 1;
}

#dashboard-app .dashboard-month-nav button:disabled {
  color: #c4c0b8;
  cursor: not-allowed;
}

#dashboard-app .dashboard-loading {
  margin-bottom: 18px;
  border-radius: 12px;
  background: #fff;
  color: #71717a;
  padding: 12px 16px;
  font-size: 13px;
}

#dashboard-app .dashboard-error {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
  border: 1px solid #fecaca;
  border-radius: 12px;
  background: #fff5f5;
  color: #991b1b;
  padding: 12px 16px;
  font-size: 13px;
}

#dashboard-app .dashboard-error button {
  border: 0;
  background: transparent;
  color: #4f46e5;
  font-weight: 700;
}

#dashboard-app .dashboard-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

#dashboard-app .dashboard-kpi,
#dashboard-app .dashboard-card {
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

#dashboard-app .dashboard-kpi {
  padding: 22px 24px;
}

#dashboard-app .dashboard-kpi p,
#dashboard-app .dashboard-card-subtitle,
#dashboard-app .dashboard-yoy-kpis p {
  color: #a1a1aa;
}

#dashboard-app .dashboard-kpi p {
  margin: 0 0 10px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
}

#dashboard-app .dashboard-kpi strong {
  display: block;
  color: #111115;
  font-size: 28px;
  font-weight: 700;
  line-height: 1;
}

#dashboard-app .dashboard-kpi--danger strong,
#dashboard-app .is-negative {
  color: #dc2626;
}

#dashboard-app .is-positive {
  color: #15803d;
}

#dashboard-app .dashboard-kpi span {
  display: block;
  margin-top: 8px;
  color: #a1a1aa;
  font-size: 11.5px;
}

#dashboard-app .dashboard-card {
  padding: 28px;
  margin-bottom: 20px;
}

#dashboard-app .dashboard-card-head {
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 26px;
}

#dashboard-app .dashboard-card-head--split {
  align-items: flex-start;
}

#dashboard-app .dashboard-card h2,
#dashboard-app .dashboard-card-head h2 {
  margin: 0;
  color: #111115;
  font-size: 14px;
  font-weight: 700;
}

#dashboard-app .dashboard-card-head p,
#dashboard-app .dashboard-card-subtitle {
  margin: 3px 0 0;
  font-size: 12px;
}

#dashboard-app .dashboard-legend {
  gap: 16px;
  color: #71717a;
  font-size: 11.5px;
}

#dashboard-app .dashboard-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

#dashboard-app .dashboard-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 2px;
}

#dashboard-app .dashboard-legend-dot--current { background: #4f46e5; }
#dashboard-app .dashboard-legend-dot--actual,
#dashboard-app .dashboard-legend-dot--previous { background: #c8c4bc; }
#dashboard-app .dashboard-legend-dot--future { background: #eeece7; }

#dashboard-app .dashboard-legend-dot.is-current { background: #4f46e5; }
#dashboard-app .dashboard-legend-dot.is-previous { background: #c8c4bc; }
#dashboard-app .dashboard-legend-dot.is-last-year { background: #a1a1aa; }
#dashboard-app .dashboard-legend .is-no-data { color: #a1a1aa; }
#dashboard-app .dashboard-legend .is-no-data .dashboard-legend-dot { background: #eeece7; }

#dashboard-app .dashboard-cumulative-chart {
  position: relative;
  height: 220px;
}

#dashboard-app .dashboard-cumulative-chart svg {
  width: 100%;
  height: 100%;
  display: block;
}

#dashboard-app .dashboard-cumulative-hover-target {
  cursor: crosshair;
}

#dashboard-app .dashboard-cumulative-hover-line {
  stroke: #c4c0b8;
  stroke-width: 1;
  stroke-dasharray: 3 3;
}

#dashboard-app .dashboard-cumulative-hover-dot {
  stroke: #fff;
  stroke-width: 1.5;
}

#dashboard-app .dashboard-cumulative-hover-dot.is-current { fill: #4f46e5; }
#dashboard-app .dashboard-cumulative-hover-dot.is-previous { fill: #c8c4bc; }
#dashboard-app .dashboard-cumulative-hover-dot.is-last-year { fill: #a1a1aa; }

#dashboard-app .dashboard-cumulative-tooltip {
  position: absolute;
  top: 6px;
  transform: translateX(-50%);
  min-width: 140px;
  background: #26241f;
  color: #f5f2ea;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 11px;
  line-height: 1.5;
  pointer-events: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
  z-index: 1;
}

#dashboard-app .dashboard-cumulative-tooltip-day {
  margin: 0 0 4px;
  font-weight: 600;
  color: #fff;
}

#dashboard-app .dashboard-cumulative-tooltip-row {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

#dashboard-app .dashboard-cumulative-tooltip-row span {
  flex: 1;
  color: #d4d0c6;
}

#dashboard-app .dashboard-cumulative-tooltip-row strong {
  font-weight: 600;
}

#dashboard-app .dashboard-cumulative-axis .domain {
  stroke: #e4e0d6;
}

#dashboard-app .dashboard-cumulative-axis .tick line {
  stroke: #f0ede5;
}

#dashboard-app .dashboard-cumulative-axis-x .tick line {
  stroke: transparent;
}

#dashboard-app .dashboard-cumulative-axis text {
  fill: #a8a397;
  font-size: 10px;
  font-family: inherit;
}

#dashboard-app .dashboard-cumulative-line {
  fill: none;
  stroke-width: 2.5;
}

#dashboard-app .dashboard-cumulative-line.is-current {
  stroke: #4f46e5;
}

#dashboard-app .dashboard-cumulative-line.is-previous {
  stroke: #c8c4bc;
  stroke-dasharray: 6 4;
}

#dashboard-app .dashboard-cumulative-line.is-last-year {
  stroke: #a1a1aa;
  stroke-dasharray: 2 3;
}

/* D3 で全面レンダリングする棒グラフ（月別/日別/YoY）共通のスタイル。
   移行済みのグラフから使う（前年比較はまだ移行前の .dashboard-yoy-* を使用）。 */
#dashboard-app .dashboard-bar-chart-d3 {
  position: relative;
  height: 220px;
}

#dashboard-app .dashboard-bar-chart-d3 svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* 日別支出トレンドは月別と違い、コンテナ幅に合わせて縮めず横スクロールする
   （SVG 自体の幅は dailyChartWidth を inline style で明示、CSS 側は
   overflow だけ担当）。 */
#dashboard-app .dashboard-bar-chart-d3-scroll {
  overflow-x: auto;
  overflow-y: hidden;
}

#dashboard-app .dashboard-bar-axis .domain {
  stroke: #e4e0d6;
}

#dashboard-app .dashboard-bar-axis .tick line {
  stroke: #f0ede5;
}

#dashboard-app .dashboard-bar-axis-x .tick line {
  stroke: transparent;
}

#dashboard-app .dashboard-bar-axis text {
  fill: #a8a397;
  font-size: 10px;
  font-family: inherit;
}

#dashboard-app .dashboard-bar-group {
  cursor: pointer;
}

#dashboard-app .dashboard-bar-hit {
  fill: transparent;
}

#dashboard-app .dashboard-bar-d3 {
  fill: #c8c4bc;
}

#dashboard-app .dashboard-bar-d3.is-current {
  fill: #4f46e5;
}

#dashboard-app .dashboard-bar-d3.is-future {
  fill: #eeece7;
}

#dashboard-app .dashboard-bar-amount-d3 {
  fill: #71717a;
  font-size: 10.5px;
  text-anchor: middle;
}

#dashboard-app .dashboard-bar-tooltip {
  position: absolute;
  top: 6px;
  transform: translateX(-50%);
  min-width: 100px;
  background: #26241f;
  color: #f5f2ea;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 11px;
  line-height: 1.5;
  text-align: center;
  pointer-events: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
  z-index: 1;
}

#dashboard-app .dashboard-bar-tooltip-title {
  margin: 0 0 2px;
  color: #d4d0c6;
}

#dashboard-app .dashboard-bar-tooltip strong {
  font-weight: 600;
}

#dashboard-app .dashboard-bar-tooltip-row {
  display: flex;
  align-items: center;
  gap: 6px;
  text-align: left;
  white-space: nowrap;
}

#dashboard-app .dashboard-bar-tooltip-row span {
  flex: 1;
  color: #d4d0c6;
}

#dashboard-app .dashboard-bar-tooltip-diff {
  margin: 4px 0 0;
  color: #d4d0c6;
}

#dashboard-app .dashboard-month-yoy {
  min-height: 130px;
}

#dashboard-app .dashboard-yoy-kpis {
  gap: 10px;
}

#dashboard-app .dashboard-yoy-kpis > div {
  border-radius: 12px;
  background: #f8f7f4;
  padding: 12px 18px;
}

#dashboard-app .dashboard-yoy-kpis p {
  margin: 0 0 5px;
  font-size: 10px;
  font-weight: 600;
}

#dashboard-app .dashboard-yoy-kpis strong {
  color: #111115;
  font-size: 18px;
}

#dashboard-app .dashboard-yoy-diff {
  border: 1px solid #fecaca;
  background: #fff5f5;
}

#dashboard-app .dashboard-legend--inline {
  margin-bottom: 18px;
}

#dashboard-app .dashboard-yoy-group-d3 {
  cursor: pointer;
}

#dashboard-app .dashboard-yoy-hit {
  fill: transparent;
}

#dashboard-app .dashboard-yoy-bar-d3-previous {
  fill: #c8c4bc;
}

#dashboard-app .dashboard-yoy-bar-d3-current {
  fill: #4f46e5;
}

#dashboard-app .dashboard-yoy-diff-label-d3 {
  fill: #a1a1aa;
  font-size: 10.5px;
  text-anchor: middle;
}

#dashboard-app .dashboard-yoy-diff-label-d3.is-negative {
  fill: #dc2626;
}

#dashboard-app .dashboard-yoy-diff-label-d3.is-positive {
  fill: #15803d;
}

#dashboard-app .dashboard-breakdown-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 308px;
  gap: 20px;
}

#dashboard-app .dashboard-breakdown-body {
  display: flex;
  align-items: flex-start;
  gap: 28px;
  margin-top: 24px;
}

#dashboard-app .dashboard-donut {
  position: relative;
  width: 160px;
  height: 160px;
  flex-shrink: 0;
}

#dashboard-app .dashboard-donut--sm {
  width: 144px;
  height: 144px;
  margin: 18px auto 20px;
}

#dashboard-app .dashboard-donut svg {
  display: block;
  width: 100%;
  height: 100%;
}

#dashboard-app .dashboard-donut-track {
  fill: none;
  stroke-width: 22;
}

#dashboard-app .dashboard-donut--sm .dashboard-donut-track {
  stroke-width: 20;
}

#dashboard-app .dashboard-donut-track {
  stroke: #f0ede5;
}

#dashboard-app .dashboard-donut-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

#dashboard-app .dashboard-donut-center span {
  color: #a1a1aa;
  font-size: 10px;
  font-weight: 600;
}

#dashboard-app .dashboard-donut-center strong {
  color: #111115;
  font-size: 17px;
  font-weight: 700;
}

#dashboard-app .dashboard-breakdown-list {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 11px;
  min-width: 0;
}

#dashboard-app .dashboard-breakdown-row-main {
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 5px;
}

#dashboard-app .dashboard-breakdown-row-main span,
#dashboard-app .dashboard-payment-row span,
#dashboard-app .dashboard-card-row span {
  min-width: 0;
  overflow: hidden;
  color: #3f3f46;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 500;
}

#dashboard-app .dashboard-breakdown-row-main i,
#dashboard-app .dashboard-payment-row i,
#dashboard-app .dashboard-card-row i {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}

#dashboard-app .dashboard-breakdown-row-main span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

#dashboard-app .dashboard-breakdown-row-main strong,
#dashboard-app .dashboard-payment-row strong,
#dashboard-app .dashboard-card-row strong {
  color: #111115;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

#dashboard-app .dashboard-breakdown-row-main em,
#dashboard-app .dashboard-payment-row em,
#dashboard-app .dashboard-card-row em {
  color: #a1a1aa;
  font-size: 11px;
  font-style: normal;
}

#dashboard-app .dashboard-progress {
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: #f0ede5;
}

#dashboard-app .dashboard-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
}

#dashboard-app .dashboard-payment-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#dashboard-app .dashboard-payment-row {
  gap: 9px;
}

#dashboard-app .dashboard-payment-row span {
  flex: 1;
}

#dashboard-app .dashboard-payment-row em {
  min-width: 38px;
  text-align: right;
}

#dashboard-app .dashboard-card-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-top: 24px;
}

#dashboard-app .dashboard-card-row {
  gap: 14px;
}

#dashboard-app .dashboard-card-row span {
  width: 128px;
  flex-shrink: 0;
}

#dashboard-app .dashboard-card-row .dashboard-progress {
  flex: 1;
  height: 8px;
}

#dashboard-app .dashboard-card-row strong {
  min-width: 96px;
  text-align: right;
}

#dashboard-app .dashboard-card-row em {
  min-width: 42px;
  text-align: right;
}

#dashboard-app .dashboard-store-total {
  color: #52525b;
  font-size: 13px;
  white-space: nowrap;
}

#dashboard-app .dashboard-store-list {
  max-height: 520px;
  overflow-y: auto;
  padding-right: 4px;
}

#dashboard-app .dashboard-store-row span {
  width: clamp(220px, 22vw, 500px);
}

#dashboard-app .dashboard-empty {
  margin: 0;
  color: #a1a1aa;
  font-size: 13px;
}

@media (max-width: 991.98px) {
  #dashboard-app .dashboard-shell {
    width: min(100% - 28px, 720px);
    padding: 28px 0 56px;
  }

  #dashboard-app .dashboard-header,
  #dashboard-app .dashboard-card-head,
  #dashboard-app .dashboard-card-head--split,
  #dashboard-app .dashboard-breakdown-body {
    display: block;
  }

  #dashboard-app .dashboard-controls,
  #dashboard-app .dashboard-yoy-kpis {
    margin-top: 16px;
  }

  #dashboard-app .dashboard-kpis,
  #dashboard-app .dashboard-breakdown-grid {
    grid-template-columns: 1fr 1fr;
  }

  #dashboard-app .dashboard-breakdown-grid {
    display: grid;
  }

  #dashboard-app .dashboard-donut {
    margin: 20px auto;
  }
}

@media (max-width: 767.98px) {
  #dashboard-app .dashboard-kpis,
  #dashboard-app .dashboard-breakdown-grid {
    grid-template-columns: 1fr;
  }

  #dashboard-app .dashboard-controls,
  #dashboard-app .dashboard-yoy-kpis {
    flex-wrap: wrap;
  }

  #dashboard-app .dashboard-card {
    padding: 20px;
  }

  #dashboard-app .dashboard-cumulative-axis text,
  #dashboard-app .dashboard-bar-axis text {
    font-size: 9px;
  }

  #dashboard-app .dashboard-card-row {
    display: grid;
    grid-template-columns: 9px minmax(0, 1fr) auto;
  }

  #dashboard-app .dashboard-card-row .dashboard-progress,
  #dashboard-app .dashboard-card-row em {
    grid-column: 2 / 4;
  }

  #dashboard-app .dashboard-card-row span {
    width: auto;
  }

  #dashboard-app .dashboard-store-list {
    max-height: none;
    overflow-y: visible;
    padding-right: 0;
  }
}

#expense-app .category-scroll {
  overflow-x: auto;
  white-space: nowrap;
}

#expense-app .category-item {
  cursor: pointer;
}

#expense-app .category-item.active {
  background-color: var(--ds-brand-selected-bg);
  font-weight: 600;
}

#expense-app.expense-list-screen {
  margin: -1rem -0.75rem 0;
  min-height: calc(100vh - 56px);
  background: #f1eee7;
  color: #15151a;
}

#expense-app .expense-list-shell {
  width: min(1185px, calc(100vw - 32px));
  margin: 0 auto;
}

#expense-app .expense-year-strip,
#expense-app .expense-month-strip {
  background: #fff;
  border-bottom: 1px solid #e4e0d8;
}

#expense-app .expense-year-strip__inner {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr) 136px;
  align-items: center;
  min-height: 88px;
  gap: 24px;
  padding: 18px 0 10px;
}

#expense-app .expense-year-control {
  display: flex;
  align-items: center;
  gap: 8px;
}

#expense-app .expense-year-label {
  font-size: 15px;
  font-weight: 700;
}

#expense-app .expense-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 31px;
  height: 31px;
  border: 0;
  border-radius: 8px;
  background: #f5f5f7;
  color: #5d626b;
  line-height: 1;
}

#expense-app .expense-icon-btn:hover {
  background: #ececef;
  color: #202126;
}

#expense-app .expense-month-bars {
  height: 54px;
  gap: 34px;
  padding-top: 0;
}

#expense-app .expense-month-bars .ds-month-bars__track {
  height: 36px;
  align-items: flex-end;
}

#expense-app .expense-month-bars .ds-month-bars__fill {
  border-radius: 2px 2px 0 0;
  background: #c7c2ba;
  min-height: 1px;
}

#expense-app .expense-month-bars .ds-month-bars__fill--current {
  background: #4f46e5;
}

#expense-app .expense-month-bars .ds-month-bars__label {
  margin-top: 4px;
  font-size: 10px;
  color: #9fa3aa;
}

#expense-app .expense-month-bars .ds-month-bars__label--current {
  color: #4f46e5;
}

#expense-app .expense-basis-switch {
  justify-self: end;
  display: inline-flex;
  padding: 3px;
  border-radius: 8px;
  background: #f2f2f4;
}

.expense-view-switch {
  display: inline-flex;
  gap: 2px;
  margin-bottom: 10px;
  padding: 3px;
  border-radius: 8px;
  background: #f2f2f4;
}

.expense-view-switch__btn {
  border: 0;
  border-radius: 6px;
  padding: 5px 14px;
  background: transparent;
  color: #6b6f77;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.expense-view-switch__btn:hover {
  color: #17171c;
  text-decoration: none;
}

.expense-view-switch__btn.active {
  background: #111116;
  color: #fff;
}

#expense-app .expense-segment-btn {
  border: 0;
  border-radius: 6px;
  padding: 4px 14px;
  background: transparent;
  color: #6b6f77;
  font-size: 12px;
  font-weight: 600;
}

#expense-app .expense-segment-btn.active {
  background: #111116;
  color: #fff;
}

#expense-app .expense-month-strip__inner {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr) 180px;
  align-items: center;
  min-height: 52px;
}

#expense-app .expense-month-summary {
  display: flex;
  justify-content: center;
  align-items: baseline;
  gap: 16px;
  min-width: 0;
}

#expense-app .expense-month-range {
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
}

#expense-app .expense-total {
  color: #f01420;
  font-weight: 700;
}

#expense-app .expense-month-actions {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 8px;
}

#expense-app .expense-export-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 31px;
  padding: 0 13px;
  border-radius: 8px;
  background: #f5f5f7;
  color: #626771;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
}

#expense-app .expense-list-body {
  padding: 26px 0 34px;
}

#expense-app .expense-main-grid {
  display: grid;
  grid-template-columns: 212px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

#expense-app .expense-sidebar {
  min-width: 0;
}

#expense-app .expense-sidebar-panel {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(20, 18, 14, 0.08);
  overflow: hidden;
}

#expense-app .expense-sidebar-panel + .expense-sidebar-panel {
  margin-top: 12px;
}

#expense-app .expense-category-row {
  padding: 12px 16px 10px;
  border-bottom: 1px solid #f0ede5;
  cursor: pointer;
}

#expense-app .expense-category-row:last-child {
  border-bottom: 0;
}

#expense-app .expense-category-row.active {
  font-weight: 700;
}

#expense-app .expense-category-row__main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

#expense-app .expense-category-row__name {
  display: flex;
  align-items: center;
  min-width: 0;
  font-size: 13px;
  white-space: nowrap;
}

#expense-app .expense-category-row__amount {
  color: #f01420;
  font-size: 12px;
  white-space: nowrap;
}

#expense-app .expense-sidebar-label {
  padding: 14px 16px 6px;
  color: #8f949d;
  font-size: 11px;
  font-weight: 700;
}

#expense-app .expense-tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 6px 16px 16px;
}

#expense-app .expense-tag-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

#expense-app .expense-content {
  min-width: 0;
}

#expense-app .expense-list-panel {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(20, 18, 14, 0.08);
  overflow: hidden;
}

#expense-app .expense-list-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px 10px;
  min-height: 42px;
  color: #7a7f89;
  font-size: 13px;
}

#expense-app .expense-date-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 32px;
  padding: 0 20px;
  border-bottom: 1px solid #ece9e1;
  background: #fffdfa;
  color: #23252a;
  font-size: 13px;
  font-weight: 700;
}

#expense-app .expense-date-group-header__subtotal {
  color: #f01420;
  font-size: 12px;
}

#expense-app .expense-list-table-head,
#expense-app .expense-list-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px;
  align-items: center;
  min-height: 52px;
  padding: 8px 20px;
  border-bottom: 1px solid #f0f0f1;
}

#expense-app .expense-list-table-head {
  min-height: 0;
  padding-top: 0;
  padding-bottom: 10px;
  border-bottom: 1px solid #ece9e1;
  color: #9da1a9;
  font-size: 11px;
  font-weight: 700;
}

#expense-app .expense-list-table-head span:last-child {
  text-align: right;
}

#expense-app .expense-list-row {
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}

#expense-app .expense-list-row:hover {
  background: #fafafb;
}

#expense-app .expense-list-row:last-child {
  border-bottom: 0;
}

#expense-app .expense-item-main {
  min-width: 0;
}

#expense-app .expense-item-name {
  overflow: hidden;
  color: #14161b;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#expense-app .expense-item-quantity,
#expense-app .expense-item-store {
  color: #a6a9af;
  font-size: 12px;
  font-weight: 500;
}

#expense-app .expense-category-pill {
  display: inline-flex;
  align-items: center;
  max-width: 190px;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

#expense-app .expense-item-amount {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  color: #f01420;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
}

#expense-app .expense-owner-badge {
  margin-top: 2px;
  border-radius: 999px;
  padding: 2px 6px;
  background: #fff4df;
  color: #b35c00;
  font-size: 10px;
}

#expense-app .expense-owner-badge--split {
  background: #e9f7ef;
  color: #21834a;
}

#expense-app .expense-empty-state {
  min-height: 232px;
}

#expense-app .expense-active-filters {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 12px;
}

#expense-app .expense-active-filters__label {
  color: #7c818a;
}

#expense-app .expense-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  background: #fff;
  padding: 5px 9px;
  color: #4e535c;
}

#expense-app .expense-filter-chip .btn-close {
  width: 6px;
  height: 6px;
  padding: 2px;
  font-size: 8px;
}

#expense-app .expense-inline-error {
  color: #a31d1d;
  font-size: 12px;
}

#expense-app .expense-link-btn {
  border: 0;
  background: transparent;
  color: #4f46e5;
  font-weight: 700;
}

@media (max-width: 991.98px) {
  #expense-app .expense-year-strip__inner,
  #expense-app .expense-month-strip__inner,
  #expense-app .expense-main-grid,
  #expense-app .expense-list-table-head {
    display: block;
  }

  #expense-app .expense-year-strip__inner,
  #expense-app .expense-month-strip__inner {
    padding: 14px 0;
  }

  #expense-app .expense-month-bars {
    margin-top: 12px;
    gap: 12px;
  }

  #expense-app .expense-basis-switch,
  #expense-app .expense-month-actions {
    margin-top: 12px;
  }

  #expense-app .expense-month-summary {
    justify-content: flex-start;
    margin: 10px 0;
  }

  #expense-app .expense-sidebar {
    margin-bottom: 14px;
  }

  #expense-app .expense-list-table-head {
    display: none;
  }

  #expense-app .expense-list-row {
    padding: 10px 16px;
  }

  #expense-app .expense-item-amount {
    align-items: flex-end;
  }
}

/* 品目単位一覧 — latest visual refresh */
#expense-app .expense-item-list-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 15px;
}

#expense-app .expense-item-list-kicker {
  display: block;
  margin-bottom: 2px;
  color: #989ba2;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .16em;
}

#expense-app .expense-item-list-heading {
  margin: 0;
  color: #17171c;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -.02em;
}

#expense-app .expense-item-list-add {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 36px;
  padding: 0 15px;
  border-radius: 9px;
  background: #17171c;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

#expense-app .expense-list-panel {
  border-radius: 14px;
  box-shadow: 0 1px 4px rgba(20, 18, 14, .08);
}

#expense-app .expense-list-meta {
  min-height: 48px;
  padding: 0 20px;
}

#expense-app .expense-list-table-head,
#expense-app .expense-list-row {
  grid-template-columns: minmax(0, 1fr) 150px;
  gap: 12px;
}

#expense-app .expense-list-table-head span:last-child {
  text-align: right;
}

#expense-app .expense-list-row {
  min-height: 52px;
  padding-top: 8px;
  padding-bottom: 8px;
}

#expense-app .expense-item-subline {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 8px;
  margin-top: 4px;
}

#expense-app .expense-item-subline .expense-category-pill {
  max-width: min(220px, 55vw);
}

#expense-app .expense-item-store,
#expense-app .expense-item-quantity {
  color: #92959d;
  font-size: 10.5px;
  font-weight: 500;
}

#expense-app .expense-item-amount strong {
  color: #e51a27;
  font-size: 13px;
}

#expense-app .expense-item-amount small {
  color: #a0a3aa;
  font-size: 9.5px;
  font-weight: 500;
}

#expense-app .expense-owner-badge {
  display: inline-flex;
  align-items: center;
  margin-top: 4px;
}

@media (max-width: 991.98px) {
  #expense-app .expense-list-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "main amount";
    gap: 8px 12px;
    min-height: 0;
    padding: 12px 16px;
  }

  #expense-app .expense-item-main { grid-area: main; }

  #expense-app .expense-item-amount {
    grid-area: amount;
    align-items: flex-end;
    margin-top: 0;
  }
}

@media (max-width: 575.98px) {
  #expense-app .expense-item-list-heading { font-size: 20px; }
  #expense-app .expense-item-list-add { padding: 0 11px; }
  #expense-app .expense-list-meta { padding-right: 16px; padding-left: 16px; }
  #expense-app .expense-date-group-header { padding-right: 16px; padding-left: 16px; }
  #expense-app .expense-item-subline .expense-category-pill { max-width: calc(100vw - 140px); }
}

/* 商品管理ワークベンチ */
.product-workbench {
  max-width: 1240px;
}

.product-workbench__header .ds-page-title {
  display: flex;
  align-items: center;
  font-size: 22px;
}

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

.product-summary__card {
  position: relative;
  overflow: hidden;
}

.product-summary__card::after {
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: var(--ds-brand-accent);
  content: '';
  opacity: .72;
}

.product-summary__hint {
  color: var(--ds-text-muted);
  font-size: .75rem;
}

.product-filter-panel__heading,
.product-results-heading,
.product-mobile-card__topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--ds-space-md);
}

.product-filter-panel__heading {
  margin-bottom: var(--ds-space-md);
}

.product-filter-panel__heading h2,
.product-results-heading h2 {
  margin: 0;
  color: var(--ds-text-primary);
  font-size: 1rem;
  font-weight: 700;
}

.product-filter-panel__heading p,
.product-results-heading p {
  margin: .25rem 0 0;
  color: var(--ds-text-secondary);
  font-size: .8125rem;
}

.product-clear-link {
  flex: none;
  color: var(--ds-brand-accent);
  font-size: .8125rem;
  font-weight: 600;
  text-decoration: none;
}

.product-clear-link:hover {
  text-decoration: underline;
}

.product-filter-form {
  display: grid;
  grid-template-columns: minmax(240px, 1.4fr) minmax(180px, 1fr) minmax(180px, 1fr) auto;
  align-items: end;
  gap: var(--ds-space-md);
}

.product-filter-form .form-label {
  margin-bottom: var(--ds-space-xs);
  color: var(--ds-text-secondary);
  font-size: .75rem;
  font-weight: 600;
}

.product-filter-form .form-control,
.product-filter-form .form-select,
.product-filter-form .input-group-text {
  min-height: 42px;
  border-color: var(--ds-border-color);
}

.product-filter-form .input-group-text {
  background: var(--ds-bg-subtle);
  color: var(--ds-text-muted);
}

.product-filter-form__submit {
  min-height: 42px;
  white-space: nowrap;
}

.product-active-filters {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--ds-space-xs);
  margin-top: var(--ds-space-md);
  padding-top: var(--ds-space-md);
  border-top: 1px solid var(--ds-border-color);
}

.product-active-filters__label {
  margin-right: var(--ds-space-xs);
  color: var(--ds-text-muted);
  font-size: .75rem;
  font-weight: 600;
}

.product-filter-chip,
.product-scope,
.product-category-badge,
.product-missing-state,
.product-usage-count {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  border-radius: 999px;
  font-size: .75rem;
  line-height: 1.35;
}

.product-filter-chip {
  padding: .3rem .65rem;
  background: var(--ds-brand-selected-bg);
  color: var(--ds-brand-selected);
  font-weight: 600;
}

.product-results-heading {
  margin-bottom: var(--ds-space-sm);
}

.product-page-number {
  color: var(--ds-text-muted);
  font-size: .75rem;
}

.product-table-card {
  overflow: hidden;
}

.product-table {
  table-layout: fixed;
}

.product-table thead th {
  padding: .75rem 1rem;
  border-bottom-color: var(--ds-border-color);
  background: var(--ds-bg-subtle);
  color: var(--ds-text-secondary);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .02em;
}

.product-table thead th:nth-child(1) { width: 27%; }
.product-table thead th:nth-child(2) { width: 19%; }
.product-table thead th:nth-child(3) { width: 18%; }
.product-table thead th:nth-child(4) { width: 13%; }
.product-table thead th:nth-child(5) { width: 9%; }
.product-table thead th:nth-child(6) { width: 14%; }

.product-table tbody td {
  padding: .85rem 1rem;
  border-color: var(--ds-border-color);
  vertical-align: middle;
}

.product-table tbody tr:last-child td {
  border-bottom: 0;
}

.product-table tbody tr:hover {
  background: var(--ds-color-neutral-bg);
}

.product-name {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--ds-text-primary);
  font-size: .9rem;
  font-weight: 700;
  line-height: 1.45;
}

.product-name__label {
  display: -webkit-box;
  overflow: hidden;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.product-image-preview {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
}

.product-image-preview__trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #71717a;
}

.product-image-preview__trigger:hover,
.product-image-preview__trigger:focus-visible {
  background: #f4f2ec;
  color: #111115;
}

.product-image-preview__panel {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 0.4rem);
  z-index: 1080;
  width: 180px;
  padding: 0.35rem;
  border: 1px solid #e4e1d9;
  border-radius: 0.65rem;
  background: #fff;
  box-shadow: 0 0.5rem 1.5rem rgb(0 0 0 / 18%);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translate(-50%, 0.25rem);
  transition: opacity 120ms ease, transform 120ms ease, visibility 120ms ease;
}

.product-image-preview:hover .product-image-preview__panel,
.product-image-preview:focus-within .product-image-preview__panel {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}

.product-image-preview__panel img {
  display: block;
  width: 100%;
  max-height: 180px;
  border-radius: 0.4rem;
  object-fit: contain;
}

@media (min-width: 992px) {
  .product-table-card,
  .product-table-card .table-responsive {
    overflow: visible;
  }
}

.product-scope {
  padding: .2rem .5rem;
  font-weight: 700;
  white-space: nowrap;
}

.product-scope--store {
  background: #eef2ff;
  color: #4f46e5;
}

.product-scope--group {
  background: #ecfdf5;
  color: #047857;
}

.product-scope--global {
  background: #f3f4f6;
  color: #4b5563;
}

.product-scope-name {
  display: block;
  overflow: hidden;
  margin-top: .3rem;
  color: var(--ds-text-secondary);
  font-size: .75rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.product-category-badge {
  padding: .25rem .55rem;
  background: #f5f3ff;
  color: #6d28d9;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.product-missing-state {
  gap: .25rem;
  color: var(--ds-color-warning-text);
  font-weight: 600;
}

.product-price {
  color: var(--ds-text-primary);
  font-size: .86rem;
  font-variant-numeric: tabular-nums;
  font-weight: 650;
}

.product-usage-count {
  justify-content: center;
  min-width: 2rem;
  padding: .2rem .5rem;
  background: var(--ds-bg-subtle);
  color: var(--ds-text-secondary);
  font-variant-numeric: tabular-nums;
  font-weight: 650;
}

.product-actions {
  display: flex;
  justify-content: flex-end;
  gap: .4rem;
}

.product-actions .btn {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  min-height: 34px;
}

.product-delete-action {
  width: 34px;
  justify-content: center;
  padding-right: 0;
  padding-left: 0;
}

.product-mobile-list {
  display: grid;
  gap: var(--ds-space-sm);
}

.product-mobile-card {
  padding: var(--ds-space-md);
}

.product-mobile-card .product-name {
  margin: .7rem 0 0;
  font-size: 1rem;
  -webkit-line-clamp: 3;
}

.product-mobile-card__usage {
  color: var(--ds-text-muted);
  font-size: .75rem;
  font-variant-numeric: tabular-nums;
}

.product-mobile-card__details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--ds-space-sm);
  margin: var(--ds-space-md) 0 0;
  padding-top: var(--ds-space-md);
  border-top: 1px solid var(--ds-border-color);
}

.product-mobile-card__details dt {
  margin-bottom: .35rem;
  color: var(--ds-text-muted);
  font-size: .68rem;
  font-weight: 600;
}

.product-mobile-card__details dd {
  margin: 0;
}

.product-mobile-card__actions {
  justify-content: flex-start;
  margin-top: var(--ds-space-md);
}

.product-mobile-card__actions .product-delete-action {
  width: auto;
  padding-right: .5rem;
  padding-left: .5rem;
}

.product-empty-state {
  padding: 3rem var(--ds-space-lg);
  text-align: center;
}

.product-empty-state__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  margin-bottom: var(--ds-space-md);
  border-radius: 50%;
  background: var(--ds-bg-subtle);
  color: var(--ds-text-muted);
  font-size: 1.35rem;
}

.product-empty-state h3 {
  margin-bottom: .4rem;
  color: var(--ds-text-primary);
  font-size: 1rem;
  font-weight: 700;
}

.product-empty-state p {
  margin-bottom: var(--ds-space-md);
  color: var(--ds-text-secondary);
  font-size: .84rem;
}

.product-pagination {
  margin-top: var(--ds-space-lg);
}

.product-workbench :is(a, button, input, select):focus-visible {
  outline: 3px solid rgba(99, 102, 241, .35);
  outline-offset: 2px;
  box-shadow: none;
}

/* 商品管理: カード型リンク化した「カテゴリ未設定」統計カード */
.product-summary__card-link {
  display: flex;
  flex-direction: column;
  gap: inherit;
  color: inherit;
  text-decoration: none;
}

.product-summary__card:has(.product-summary__card-link) {
  transition: transform .15s ease, box-shadow .15s ease;
}

.product-summary__card:has(.product-summary__card-link:hover),
.product-summary__card:has(.product-summary__card-link:focus-visible) {
  transform: translateY(-2px);
  box-shadow: var(--ds-shadow-md, 0 8px 20px rgba(0, 0, 0, .08));
}

.product-summary__card-link .product-summary__hint i {
  margin-left: .2rem;
  font-size: .68rem;
  opacity: .7;
}

/* レシートの切り取り線 — このワークベンチが実際に扱っているのは
   スキャンしたレシートから起こされた未整理な商品名の束、という素材感を
   絞り込みパネルと一覧の継ぎ目に一度だけ差し込む */
.product-perforation {
  height: 0;
  margin: calc(var(--ds-space-lg) * -1 + 10px) 0 calc(var(--ds-space-lg) - 10px);
  border-top: 1.5px dashed var(--ds-border-color);
  background-image: radial-gradient(circle, var(--ds-bg-page) 2.5px, transparent 2.6px);
  background-size: 14px 3px;
  background-position: center;
  background-repeat: repeat-x;
}

/* 商品名: 別名が確定した商品はそれを主表示にし、別名整理待ち（レシート OCR
   由来のカタカナ表記ゆれ）だけを控えめなトーン＋等幅フォントで
   「未確認」だと分かるようにする。整理不要な既存の商品名は通常表示のまま。 */
.product-name__label--pending {
  color: #6d6458;
  font-family: ui-monospace, 'SF Mono', 'Roboto Mono', Consolas, 'Noto Sans JP', monospace;
  font-weight: 600;
  letter-spacing: .01em;
  border-bottom: 1px dashed #c9c0ab;
}

.product-name__original {
  display: block;
  margin-top: .2rem;
  color: var(--ds-text-muted);
  font-size: .72rem;
}

.product-alias-badge {
  display: inline-flex;
  align-items: center;
  flex: none;
  padding: .15rem .5rem;
  border-radius: 999px;
  font-size: .68rem;
  font-weight: 700;
  white-space: nowrap;
}

.product-alias-badge--review {
  background: var(--ds-color-warning-bg);
  color: var(--ds-color-warning-text);
}

.product-alias-badge--scan {
  background: #f1efe6;
  color: #7a705c;
  font-family: ui-monospace, 'SF Mono', 'Roboto Mono', Consolas, 'Noto Sans JP', monospace;
  letter-spacing: .03em;
}

.product-mobile-card .product-name__original {
  margin: -.3rem 0 .5rem;
}

.product-alias-suggestion [data-alias-generate] {
  border-color: #d8d2c2;
  color: #6d6458;
  font-size: .78rem;
}

.product-alias-suggestion [data-alias-generate]:hover {
  border-color: var(--ds-brand-accent);
  color: var(--ds-brand-accent);
}

/* Store master-data workbench */
.store-workbench { max-width: 1440px; }
.store-workbench__header, .store-results-heading, .store-filter-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.store-header-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .5rem; }
.store-summary { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.store-summary__card { color: inherit; transition: transform .15s ease, box-shadow .15s ease; }
.store-summary__card:hover { color: inherit; transform: translateY(-2px); box-shadow: var(--ds-shadow-md); }
.store-summary__card > span:last-child { color: var(--ds-text-muted); font-size: .78rem; }
.store-filter-heading h2, .store-results-heading h2 { font-size: 1.05rem; margin: 0; }
.store-filter-heading p, .store-results-heading p { color: var(--ds-text-muted); margin: .25rem 0 0; }
.store-filter-form { display: grid; grid-template-columns: minmax(14rem, 2fr) repeat(3, minmax(10rem, 1fr)) auto; gap: .75rem; align-items: end; margin-top: 1rem; }
.store-bulk-toolbar { display: flex; align-items: center; gap: .75rem; padding: .75rem 1rem; margin-bottom: .75rem; border-radius: var(--ds-radius-md); background: var(--ds-surface-subtle); border: 1px solid var(--ds-border); }
.store-bulk-toolbar select { max-width: 15rem; }
.store-table th:first-child, .store-table td:first-child { width: 2.5rem; text-align: center; }
.store-table th:last-child, .store-table td:last-child { width: 9rem; }
.store-mobile-list { display: grid; gap: .75rem; }
.store-mobile-card { padding: 1rem; }
.store-mobile-details { display: grid; gap: .6rem; margin: 1rem 0; }
.store-mobile-details div { display: flex; justify-content: space-between; gap: 1rem; border-bottom: 1px solid var(--ds-border); padding-bottom: .45rem; }
.store-mobile-details dt { color: var(--ds-text-muted); font-size: .78rem; font-weight: 600; }
.store-mobile-details dd { margin: 0; text-align: right; font-size: .88rem; }
.store-empty { padding: 3rem 1rem; text-align: center; }
.store-empty > i { font-size: 2rem; color: var(--ds-text-muted); }
@media (max-width: 991.98px) {
  .store-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .store-filter-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .store-filter-form button { grid-column: 1 / -1; }
}
@media (max-width: 575.98px) {
  .store-workbench__header, .store-results-heading, .store-filter-heading { flex-direction: column; }
  .store-header-actions { justify-content: flex-start; }
  .store-filter-form { grid-template-columns: 1fr; }
  .store-filter-form button { grid-column: auto; }
  .store-bulk-toolbar { align-items: stretch; flex-direction: column; }
  .store-bulk-toolbar select { max-width: none; }
}

/* Duplicate Store cleanup workbench */
.store-duplicate-workbench { max-width: 1200px; }
.store-duplicate-list { display: grid; gap: 1rem; }
.store-duplicate-card__pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; align-items: stretch; }
.store-duplicate-card__store { height: 100%; padding: .75rem; border: 1px solid var(--ds-border); border-radius: var(--ds-radius-md); background: var(--ds-surface-subtle); }
.store-duplicate-card__details > div { display: grid; grid-template-columns: minmax(7rem, 42%) minmax(0, 1fr); gap: .5rem; padding: .2rem 0; }
.store-duplicate-card__details dt { color: var(--ds-text-muted); font-weight: 500; }
.store-duplicate-card__details dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 767.98px) {
  .store-duplicate-card__pair { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 991.98px) {
  .product-filter-form {
    grid-template-columns: 1fr 1fr;
  }

  .product-filter-form__search {
    grid-column: 1 / -1;
  }

  .product-filter-form__submit {
    align-self: end;
  }
}

@media (max-width: 767.98px) {
  .product-workbench {
    padding: var(--ds-space-md);
  }

  .product-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--ds-space-sm);
  }

  .product-summary__card {
    padding: var(--ds-space-md);
  }

  .product-summary__hint {
    display: none;
  }
}

@media (max-width: 575.98px) {
  .product-workbench__header .ds-page-title {
    font-size: 1.25rem;
  }

  .product-summary {
    grid-template-columns: 1fr;
  }

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

  .product-filter-panel .ds-card-body {
    padding: var(--ds-space-md);
  }

  .product-filter-panel__heading,
  .product-results-heading {
    align-items: flex-start;
  }

  .product-filter-form {
    grid-template-columns: 1fr;
  }

  .product-filter-form__search {
    grid-column: auto;
  }

  .product-filter-form__submit {
    width: 100%;
  }

  .product-active-filters__label {
    width: 100%;
  }

  .product-mobile-card__details {
    grid-template-columns: 1fr;
  }
}
.store-group-header { align-items: flex-start; gap: 1rem; }
.store-group-pending-toggle { cursor: pointer; }
.store-group-toolbar .ds-card-body { padding: 1rem; }
.store-group-card__summary { align-items: center; background: transparent; border: 0; color: inherit; display: flex; justify-content: space-between; padding: 1.1rem 1.25rem; text-align: left; width: 100%; }
.store-group-card__summary strong { display: block; font-size: 1.05rem; }
.store-group-card__summary small { color: var(--bs-secondary-color); display: block; margin-top: .25rem; }
.store-group-card__summary[aria-expanded="true"] .bi-chevron-down { transform: rotate(180deg); }
.store-group-card__summary .bi-chevron-down { transition: transform .2s ease; }
.store-group-card__panel { border-top: 1px solid var(--bs-border-color); padding: 1.25rem; }
.store-group-card__actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.store-group-member-grid { display: grid; gap: .65rem; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.store-group-member, .candidate-row { align-items: center; background: var(--bs-tertiary-bg); border: 1px solid var(--bs-border-color); border-radius: .65rem; color: inherit; display: flex; gap: .65rem; justify-content: space-between; padding: .7rem .8rem; text-decoration: none; }
.store-group-member span, .candidate-row span { min-width: 0; }
.candidate-row small { color: var(--bs-secondary-color); display: block; }
.candidate-list { display: grid; gap: .5rem; }
.store-group-match { border-color: var(--bs-primary); box-shadow: 0 0 0 .15rem rgba(var(--bs-primary-rgb), .12); }
.store-group-impact { display: grid; gap: .5rem; }
.store-group-impact div { display: grid; grid-template-columns: 8rem 1fr; }
.store-group-impact dt { color: var(--bs-secondary-color); font-weight: 500; }
.store-group-impact dd { margin: 0; }
.store-group-empty { padding: 2rem; text-align: center; }

/* Web expense Category picker */
.product-category-field { position: relative; }
.product-category-enhancement { display: none; }
.product-category-field--enhanced .product-category-enhancement { display: block; }
.product-category-field--enhanced .product-category-native { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
/* トリガーボタンは「絞り込む」ボタンなどの隣に並ぶが、押した先で開く
   カテゴリ選択ポップアップ（検索欄 .82rem・分類ツリー .8rem）とは別の役割
   （現在値の表示）なので、ポップアップ側の文字サイズに揃える。ネイティブ
   input/select はブラウザ都合で16px未満にするとiOS Safariが自動拡大する
   ため対象外（この行はボタン要素なので影響を受けない）。 */
.product-category-trigger.ef-category-trigger { min-height: 42px; font-size: .82rem; }
.product-category-picker { left: 0; right: auto; width: min(480px, 92vw); }
.product-category-picker__none { margin-bottom: .4rem; }
/* The filter panel's category field sits at the right edge of a wide grid;
   anchoring the popup by its left edge (the default above) pushes it past
   the viewport's right edge. Anchor by the right edge here instead so it
   opens toward the left, where the grid has room. */
.product-filter-panel .product-category-field .ef-category-picker { left: auto; right: 0; }
.product-category-picker[hidden], .product-category-field .ef-category-picker-backdrop[hidden],
.product-category-field .ef-category-picker__current[hidden] { display: none; }
.ef-category-picker__select[aria-current="true"] { background: #eef2ff; color: #3730a3; font-weight: 600; }
.ef-category-cell { position: relative; min-width: 0; }
.ef-item-card.ef-item-card--picker-open { position: relative; z-index: 1070; overflow: visible; }
.ef-category-picker-backdrop { display: block; position: fixed; z-index: 1070; inset: 0; background: transparent; }
.ef-category-cell--unclassified .ef-category-trigger { border-color: #d97706; background: #fffbeb; }
.ef-category-trigger { display: flex; align-items: center; gap: .35rem; width: 100%; min-height: 38px; padding: .35rem .5rem; border: 1.5px solid #e4e1d9; border-radius: 7px; background: #fff; font-size: .78rem; text-align: left; overflow: hidden; }
.ef-category-trigger__label { min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ef-category-trigger__badge { flex: 0 0 auto; padding: .1rem .3rem; border-radius: 999px; background: #eef2ff; color: #4f46e5; font-size: .62rem; line-height: 1.2; white-space: nowrap; }
.ef-category-picker { position: absolute; z-index: 1080; top: calc(100% + .4rem); right: 0; width: min(410px, 90vw); max-height: 68vh; display: flex; flex-direction: column; border: 1px solid #e5e7eb; border-radius: .8rem; background: #fff; box-shadow: 0 18px 50px rgba(15,23,42,.2); }
.ef-category-picker__header, .ef-category-picker__footer, .ef-category-picker__search-wrap { padding: .6rem .65rem; background: #fff; }
.ef-category-picker__header { display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid #e5e7eb; }
.ef-category-picker__header strong { font-size: .95rem; }
.ef-category-picker__current { display: flex; align-items: center; gap: .45rem; min-width: 0; padding: .35rem .65rem; border-bottom: 1px solid #f3f4f6; background: #fafafa; color: #6b7280; font-size: .68rem; }
.ef-category-picker__current span { flex: 0 0 auto; }
.ef-category-picker__current strong { min-width: 0; overflow: hidden; color: #374151; font-size: .7rem; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.ef-category-picker__header button { border: 0; background: transparent; font-size: 1.15rem; }
.ef-category-picker__recommendations { border-bottom: 1px solid #f3f4f6; }
.ef-category-picker__recommendations-toggle { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: .5rem .65rem; border: 0; background: #fafafa; color: #4b5563; font-size: .78rem; text-align: left; }
.ef-category-picker__evidence, .ef-category-picker__frequent { display: flex; flex-wrap: wrap; gap: .35rem; padding: .5rem .65rem; border-bottom: 1px solid #f3f4f6; }
.ef-category-picker__evidence span, .ef-category-picker__frequent span { width: 100%; color: #6b7280; font-size: .75rem; }
.ef-category-picker__evidence button, .ef-category-picker__frequent button { border: 1px solid #c7d2fe; border-radius: 999px; background: #eef2ff; color: #3730a3; padding: .22rem .45rem; font-size: .74rem; }
.ef-category-picker__search { width: 100%; padding: .42rem .55rem; border: 1.5px solid #e4e1d9; border-radius: 7px; font-size: .82rem; }
.ef-category-picker__tree { overflow-y: auto; min-height: 200px; padding: .25rem 0; }
.ef-category-picker__node { display: flex; align-items: center; min-height: 30px; padding-right: .5rem; }
.ef-category-picker__expand, .ef-category-picker__expand-spacer { width: 28px; flex: 0 0 28px; border: 0; background: transparent; font-size: .8rem; }
.ef-category-picker__select { flex: 1; border: 0; background: transparent; padding: .35rem .4rem; font-size: .8rem; text-align: left; }
.ef-category-picker__select:hover { background: #f5f3ff; }
.ef-category-picker__empty { padding: 1rem; color: #6b7280; text-align: center; }
.ef-category-picker__footer { border-top: 1px solid #e5e7eb; }
.ef-category-picker__footer button { width: 100%; border: 1.5px solid #e4e1d9; border-radius: 7px; background: #fff; padding: .42rem; font-size: .8rem; }
.ef-unclassified-summary { display: flex; align-self: flex-start; flex-wrap: wrap; gap: .3rem; align-items: center; margin-bottom: .5rem; padding: .3rem .55rem; border-radius: 999px; background: #fffbeb; color: #92400e; font-size: .75rem; }
.ef-unclassified-save-note { margin: 0; color: #92400e; font-size: .78rem; text-align: center; }
.ef-unclassified-summary button, .ef-category-batch button { border: 0; background: transparent; color: #4338ca; text-decoration: underline; }
.ef-category-default-update, .ef-category-batch { padding: .35rem .75rem; font-size: .8rem; }
@media (max-width: 767.98px) {
  .ef-category-picker-backdrop { background: rgba(15,23,42,.42); }
  .ef-category-picker { position: fixed; inset: auto 0 0; width: 100%; max-height: 88vh; border-radius: 1rem 1rem 0 0; }
  .ef-category-picker__tree { min-height: 120px; }
  .ef-category-picker__search-wrap { position: sticky; top: 0; z-index: 1; }
  .ef-category-picker__footer { position: sticky; bottom: 0; z-index: 1; }
}
@media (max-width: 575.98px) {
  .store-group-header { align-items: stretch; flex-direction: column; }
  .store-group-header .btn { width: 100%; }
  .store-group-card__actions { align-items: stretch; flex-direction: column; }
  .store-group-member, .candidate-row { align-items: flex-start; flex-wrap: wrap; }
  .store-group-impact div { grid-template-columns: 1fr; }
}

/* ── 消費足跡（#88） ───────────────────────────────────────── */
#footprint-app.footprint-screen {
  /* ナビ下の1画面に収め、ページ全体の縦スクロールを出さない */
  margin: -1rem -0.75rem -1rem;
  height: calc(100vh - 56px);
  max-height: calc(100vh - 56px);
  overflow: hidden;
  background: #f1eee7;
  color: #111115;
  display: flex;
  flex-direction: column;
}

#footprint-app .footprint-shell {
  width: min(1400px, calc(100vw - 24px));
  max-width: 100%;
  margin: 0 auto;
  padding: 20px 0 16px;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

#footprint-app .footprint-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  flex-wrap: wrap;
  flex: 0 0 auto;
}

#footprint-app .footprint-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 5px;
}

#footprint-app .footprint-title-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(14, 165, 233, 0.12);
  color: #0284c7;
  font-size: 15px;
  font-weight: 700;
}

#footprint-app h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
  line-height: 1.2;
}

#footprint-app .footprint-subtitle {
  margin: 0 0 0 48px;
  color: #8c8998;
  font-size: 13.5px;
}

#footprint-app .footprint-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

#footprint-app .footprint-segment {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border-radius: 11px;
  background: #e4e1d8;
}

#footprint-app .footprint-segment button {
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #5b5868;
  padding: 0.35rem 0.7rem;
  font-size: 0.82rem;
  font-weight: 600;
}

#footprint-app .footprint-segment button.active {
  background: #fff;
  color: #111115;
  box-shadow: 0 1px 2px rgba(17, 17, 21, 0.08);
}

#footprint-app .footprint-select-wrap {
  position: relative;
}

#footprint-app .footprint-select {
  appearance: none;
  border: 1px solid #d8d4ca;
  border-radius: 10px;
  background: #fff;
  padding: 0.4rem 1.8rem 0.4rem 0.75rem;
  font-size: 0.85rem;
  font-weight: 600;
}

#footprint-app .footprint-select-caret {
  position: absolute;
  right: 0.65rem;
  top: 50%;
  transform: translateY(-50%);
  color: #8c8998;
  font-size: 0.7rem;
  pointer-events: none;
}

#footprint-app .footprint-month-nav {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  border: 1px solid #d8d4ca;
  border-radius: 10px;
  background: #fff;
  padding: 0.25rem 0.45rem;
}

#footprint-app .footprint-month-nav button {
  border: 0;
  background: transparent;
  color: #111115;
  width: 1.6rem;
  height: 1.6rem;
  font-size: 1.1rem;
  line-height: 1;
}

#footprint-app .footprint-month-nav button:disabled {
  opacity: 0.35;
}

#footprint-app .footprint-month-nav strong {
  font-size: 0.88rem;
  min-width: 6.5rem;
  text-align: center;
}

#footprint-app .footprint-error,
#footprint-app .footprint-loading {
  flex: 0 0 auto;
  margin-bottom: 0.75rem;
  border-radius: 14px;
  background: #fff;
  padding: 1.1rem 1.2rem;
  color: #5b5868;
}

#footprint-app .footprint-empty,
#footprint-app .footprint-map-empty {
  border-radius: 14px;
  background: #fff;
  padding: 1.1rem 1.2rem;
  color: #5b5868;
}

#footprint-app .footprint-panels {
  display: grid;
  grid-template-columns: minmax(0, 2.35fr) minmax(0, 1fr);
  gap: 1rem;
  align-items: stretch;
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
}

#footprint-app .footprint-map-panel,
#footprint-app .footprint-timeline {
  min-width: 0;
  min-height: 0;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

#footprint-app .footprint-timeline-scroll {
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  max-width: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 0.15rem;
}

#footprint-app .footprint-panel-head,
#footprint-app .footprint-timeline-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.55rem;
  flex: 0 0 auto;
  min-width: 0;
}

#footprint-app .footprint-panel-head h2,
#footprint-app .footprint-timeline-head h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 750;
  min-width: 0;
}

#footprint-app .footprint-panel-head p,
#footprint-app .footprint-timeline-head p {
  margin: 0;
  color: #8c8998;
  font-size: 0.82rem;
  flex: 0 1 auto;
  white-space: nowrap;
}

#footprint-app .footprint-map {
  flex: 1 1 auto;
  min-height: 0;
  height: auto;
  border-radius: 14px;
  overflow: hidden;
  background: #e8eef3;
  box-shadow: 0 1px 2px rgba(17, 17, 21, 0.04);
}

#footprint-app .footprint-map .leaflet-control-attribution {
  font-size: 0.62rem;
  padding: 0 4px;
  opacity: 0.45;
  background: rgba(255, 255, 255, 0.55);
}

#footprint-app .footprint-map-empty {
  flex: 1 1 auto;
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1.55;
}

#footprint-app .footprint-excluded-hint {
  flex: 0 0 auto;
  margin: 0 0 0.75rem;
  border: 1px solid #fde68a;
  border-radius: 10px;
  background: #fffbeb;
  color: #92400e;
  padding: 0.5rem 0.85rem;
  font-size: 0.8rem;
  line-height: 1.45;
}

#footprint-app .footprint-excluded-hint a {
  color: #9a3412;
  font-weight: 650;
}

#footprint-app .footprint-store-filter {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin: 0 0 0.55rem;
  border: 1px solid #bae6fd;
  border-radius: 10px;
  background: #f0f9ff;
  color: #0c4a6e;
  padding: 0.45rem 0.7rem;
  font-size: 0.78rem;
  flex: 0 0 auto;
}

#footprint-app .footprint-clear-filter {
  border: 1px solid #7dd3fc;
  border-radius: 8px;
  background: #fff;
  color: #0369a1;
  padding: 0.28rem 0.65rem;
  font-size: 0.8rem;
  font-weight: 650;
}

#footprint-app .footprint-error {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  color: #b91c1c;
}

#footprint-app .footprint-error button {
  border: 1px solid #fecaca;
  border-radius: 8px;
  background: #fef2f2;
  color: #b91c1c;
  padding: 0.3rem 0.7rem;
  font-size: 0.8rem;
}

#footprint-app .footprint-group {
  margin-bottom: 0.9rem;
}

#footprint-app .footprint-group-title {
  margin: 0 0 0.4rem;
  color: #5b5868;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

#footprint-app .footprint-entry {
  margin-bottom: 0.4rem;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(17, 17, 21, 0.04);
}

#footprint-app .footprint-entry-link {
  display: block;
  padding: 0.55rem 0.7rem;
  color: inherit;
  text-decoration: none;
}

#footprint-app .footprint-entry-link:hover {
  background: #fafaf7;
  border-radius: 10px;
}

#footprint-app .footprint-entry-main {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.65rem;
  min-width: 0;
}

#footprint-app .footprint-entry-meta {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

#footprint-app .footprint-entry-meta time {
  color: #8c8998;
  font-size: 0.65rem;
}

#footprint-app .footprint-entry-store {
  font-size: 0.8rem;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#footprint-app .footprint-entry-amount {
  flex: 0 0 auto;
  font-size: 0.8rem;
  font-weight: 750;
}

#footprint-app .footprint-entry-items {
  margin: 0.25rem 0 0;
  color: #6b7280;
  font-size: 0.68rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
  word-break: break-word;
}

@media (max-width: 991.98px) {
  #footprint-app.footprint-screen {
    height: auto;
    max-height: none;
    overflow: visible;
    margin: -1rem -0.75rem 0;
  }

  #footprint-app .footprint-shell {
    width: min(100vw - 16px, 1400px);
    max-width: 100%;
    padding: 24px 0 96px;
    display: block;
    overflow-x: hidden;
  }

  #footprint-app .footprint-subtitle {
    margin-left: 0;
  }

  #footprint-app .footprint-header {
    gap: 16px;
  }

  #footprint-app .footprint-panels {
    display: grid;
    grid-template-columns: 1fr;
    flex: none;
    min-height: 0;
    overflow: visible;
  }

  #footprint-app .footprint-map-panel,
  #footprint-app .footprint-timeline {
    display: block;
    min-height: 0;
    overflow-x: hidden;
  }

  #footprint-app .footprint-timeline-scroll {
    max-height: min(60vh, 480px);
    overflow-x: hidden;
    overflow-y: auto;
    padding-right: 0;
  }

  #footprint-app .footprint-map {
    height: 280px;
    min-height: 240px;
    flex: none;
  }

  #footprint-app .footprint-map-empty {
    min-height: 240px;
    flex: none;
  }
}

/* 商品グループ管理ワークベンチ */
.product-group-workbench {
  max-width: 1120px;
}

.product-group-summary {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.product-group-summary__link {
  display: flex;
  flex-direction: column;
  gap: var(--ds-space-xs);
  color: inherit;
  text-decoration: none;
}

.product-group-toolbar .ds-card-body {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--ds-space-md);
}

.product-group-toolbar .ds-filter-btn {
  display: inline-block;
  text-decoration: none;
}

.product-group-search-form {
  display: flex;
  align-items: center;
  gap: var(--ds-space-sm);
  flex: 1 1 260px;
  max-width: 380px;
}

.product-group-search-form .input-group-text {
  background: var(--ds-color-neutral-bg);
  color: var(--ds-text-muted);
  border-color: var(--ds-border-color);
}

.product-group-search-form .form-control {
  border-color: var(--ds-border-color);
}

.product-group-result-count {
  margin: 0 0 var(--ds-space-sm);
  color: var(--ds-text-muted);
  font-size: .8125rem;
}

.product-group-card__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--ds-space-sm);
  margin-bottom: var(--ds-space-sm);
}

.product-group-card__name {
  margin: 0;
  font-size: 1.0625rem;
  font-weight: 700;
}

.product-group-card__name a {
  color: var(--ds-text-primary);
  text-decoration: none;
}

.product-group-card__name a:hover {
  color: var(--ds-brand-accent);
}

.product-group-card__actions {
  display: flex;
  gap: 2px;
  flex: none;
}

.product-group-card__delete:hover {
  background: var(--ds-color-danger-bg);
  color: var(--ds-color-danger-text);
}

.product-group-card {
  height: 100%;
}

.product-group-card .ds-card-body {
  display: flex;
  flex-direction: column;
  padding: var(--ds-space-md) var(--ds-space-lg);
}

.product-group-card__meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--ds-space-sm);
  margin-bottom: var(--ds-space-sm);
}

.product-group-card__count {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--ds-text-muted);
  font-size: .75rem;
  font-variant-numeric: tabular-nums;
}

.product-group-card__empty {
  margin: 0 0 var(--ds-space-sm);
  color: var(--ds-text-muted);
  font-size: .8125rem;
}

.product-group-chips {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  overflow: hidden;
  margin-bottom: var(--ds-space-sm);
  -webkit-mask-image: linear-gradient(to right, #000 85%, transparent 100%);
  mask-image: linear-gradient(to right, #000 85%, transparent 100%);
}

.product-group-chip {
  display: inline-flex;
  align-items: center;
  flex: none;
  white-space: nowrap;
  border-radius: var(--ds-border-radius-sm);
  border: 1px solid var(--ds-border-color);
  background: var(--ds-color-neutral-bg);
  color: var(--ds-text-secondary);
  font-size: .75rem;
  line-height: 1.35;
  padding: 4px 8px;
}

.product-group-chip__store {
  color: var(--ds-text-muted);
}

.product-group-chip--generic {
  background: transparent;
  border-style: dashed;
  color: var(--ds-text-muted);
}

.product-group-card__viewall {
  margin-top: auto;
  padding-top: var(--ds-space-xs);
  color: var(--ds-brand-accent);
  font-size: .75rem;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.product-group-card__viewall:hover {
  text-decoration: underline;
}

@media (max-width: 575.98px) {
  .product-group-toolbar .ds-card-body {
    flex-direction: column;
    align-items: stretch;
  }

  .product-group-search-form {
    max-width: none;
  }
}

/* 商品グループ作成・編集フォーム */
.product-group-form {
  max-width: 760px;
}

.product-group-form__form {
  display: flex;
  flex-direction: column;
  gap: var(--ds-space-lg);
}

.product-group-form__basics {
  display: grid;
  gap: var(--ds-space-md);
}

.product-group-form__field .form-label {
  color: var(--ds-text-primary);
}

.product-group-form__section-heading {
  margin-bottom: var(--ds-space-md);
}

.product-group-form__section-heading h2 {
  margin: 0;
  color: var(--ds-text-primary);
  font-size: 1rem;
  font-weight: 700;
}

.product-group-form__section-heading p {
  margin: .25rem 0 0;
  color: var(--ds-text-secondary);
  font-size: .8125rem;
}

.product-group-form__filters {
  display: grid;
  grid-template-columns: minmax(200px, 1.4fr) minmax(160px, 1fr) minmax(160px, 1fr);
  gap: var(--ds-space-sm);
  margin-bottom: var(--ds-space-md);
}

.product-group-form__search .input-group-text {
  background: var(--ds-color-neutral-bg);
  color: var(--ds-text-muted);
  border-color: var(--ds-border-color);
}

.product-group-form__filters .form-control,
.product-group-form__filters .form-select {
  border-color: var(--ds-border-color);
}

.product-group-panel {
  border: 1px solid var(--ds-border-color);
  border-radius: var(--ds-border-radius-md);
  padding: var(--ds-space-sm) var(--ds-space-md);
  max-height: 260px;
  overflow-y: auto;
}

.product-group-panel--selected {
  max-height: none;
  overflow: visible;
  margin-bottom: var(--ds-space-sm);
  background: var(--ds-color-success-bg);
  border-color: #bbf0cf;
}

.product-group-panel--selected .product-group-panel__list {
  max-height: 140px;
  overflow-y: auto;
}

.product-group-panel__heading {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--ds-color-success-text);
  font-size: .8125rem;
  font-weight: 600;
  padding: var(--ds-space-xs) 0;
}

.product-group-panel__subheading {
  color: var(--ds-text-muted);
  font-size: .75rem;
  font-weight: 600;
  padding: var(--ds-space-xs) 0;
}

.product-group-panel .form-check {
  padding-top: 6px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--ds-border-color);
}

.product-group-panel .form-check:last-child {
  border-bottom: none;
}

.product-group-panel__store {
  color: var(--ds-text-muted);
  font-size: .8125rem;
}

.product-group-panel__empty {
  margin: var(--ds-space-sm) 0;
  color: var(--ds-text-muted);
  font-size: .8125rem;
}

.product-group-form__actions {
  display: flex;
  gap: var(--ds-space-sm);
}

@media (max-width: 575.98px) {
  .product-group-form__filters {
    grid-template-columns: 1fr;
  }
}
