/* ============ Design tokens ============
   Color:
   --ink        #1F3A3D  深墨綠 (主色，帳冊封面感)
   --ink-soft   #48605D  副文字
   --paper      #F6F2E7  暖白紙張
   --paper-alt  #ECE4D0  紙張陰影/次要底色
   --brass      #B8862B  黃銅（強調/按鈕）
   --brass-deep #8C6A22
   --red        #9A3324  硃紅（過年紅包專用強調色）
   --line       #D9CFB6  分隔線
   Type:
   Noto Serif TC  -> 標題／數字帳冊感
   Noto Sans TC   -> 內文／表單
*/

:root {
  --ink: #1F3A3D;
  --ink-soft: #48605D;
  --paper: #F6F2E7;
  --paper-alt: #ECE4D0;
  --brass: #B8862B;
  --brass-deep: #8C6A22;
  --red: #9A3324;
  --line: #D9CFB6;
  --radius: 3px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Noto Sans TC', sans-serif;
  min-height: 100vh;
}

h1, h2, h3 {
  font-family: 'Noto Serif TC', serif;
  margin: 0;
  color: var(--ink);
}

button, input, select, textarea {
  font-family: inherit;
  font-size: 15px;
}

/* ============ Layout: rail + stage ============ */
body {
  display: flex;
  min-height: 100vh;
}

.rail {
  width: 132px;
  flex-shrink: 0;
  background: var(--ink);
  color: var(--paper);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 28px 0 16px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.rail-mark {
  font-family: 'Noto Serif TC', serif;
  font-size: 28px;
  text-align: center;
  color: var(--brass);
  border: 1px solid var(--brass);
  width: 44px;
  height: 44px;
  line-height: 44px;
  border-radius: 50%;
  margin: 0 auto 32px;
}

.rail-tab {
  background: none;
  border: none;
  color: rgba(246,242,231,0.62);
  padding: 16px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  border-left: 3px solid transparent;
  transition: color .15s ease, border-color .15s ease, background .15s ease;
}

.rail-tab-glyph {
  font-family: 'Noto Serif TC', serif;
  font-size: 22px;
  width: 38px;
  height: 38px;
  line-height: 38px;
  text-align: center;
  border: 1px solid rgba(246,242,231,0.3);
  border-radius: 50%;
}

.rail-tab-label {
  font-size: 13px;
  letter-spacing: 0.05em;
}

.rail-tab:hover {
  color: var(--paper);
  background: rgba(246,242,231,0.06);
}

.rail-tab.is-active {
  color: var(--paper);
  border-left-color: var(--brass);
  background: rgba(184,134,43,0.14);
}

.rail-tab.is-active .rail-tab-glyph {
  border-color: var(--brass);
  color: var(--brass);
}

.stage {
  flex: 1;
  min-width: 0;
  padding: 44px 48px 80px;
  max-width: 920px;
}

.panel { display: none; }
.panel.is-active { display: block; }

.panel-head {
  border-bottom: 1px solid var(--line);
  padding-bottom: 18px;
  margin-bottom: 24px;
}

.panel-head h1 {
  font-size: 30px;
  font-weight: 700;
}

.panel-sub {
  margin: 6px 0 0;
  color: var(--ink-soft);
  font-size: 14px;
}

/* ============ Toolbar ============ */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}

.toolbar select,
.toolbar input[type="search"] {
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
}

.toolbar input[type="search"] {
  flex: 1;
  min-width: 180px;
}

.btn {
  padding: 9px 18px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  font-weight: 500;
}

.btn-primary {
  background: var(--brass);
  color: #fff;
  border-color: var(--brass-deep);
}
.btn-primary:hover { background: var(--brass-deep); }

.btn-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--ink);
}
.btn-ghost:hover { background: var(--paper-alt); }

.btn-danger {
  background: transparent;
  border-color: var(--red);
  color: var(--red);
}
.btn-danger:hover { background: rgba(154,51,36,0.08); }

/* ============ Stat strip ============ */
.stat-strip {
  display: flex;
  gap: 24px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}

.stat-chip {
  border-left: 2px solid var(--brass);
  padding-left: 10px;
}

.stat-chip .num {
  font-family: 'Noto Serif TC', serif;
  font-size: 22px;
  display: block;
}

.stat-chip .label {
  font-size: 12px;
  color: var(--ink-soft);
}

/* ============ Ledger list (outings) ============ */
.ledger {
  border-top: 1px solid var(--line);
}

.ledger-row {
  display: grid;
  grid-template-columns: 96px 100px 1fr 120px;
  gap: 16px;
  align-items: start;
  padding: 14px 4px;
  border-bottom: 1px dashed var(--line);
  cursor: pointer;
}

.ledger-row:hover { background: var(--paper-alt); }

.ledger-date {
  font-family: 'Noto Serif TC', serif;
  font-size: 15px;
  white-space: nowrap;
}
.ledger-date .weekday { color: var(--ink-soft); font-size: 12px; margin-left: 4px; }

.ledger-cat {
  font-size: 12px;
  color: var(--brass-deep);
  border: 1px solid var(--brass);
  border-radius: 999px;
  padding: 2px 10px;
  height: fit-content;
  white-space: nowrap;
}

.ledger-main .item-name {
  font-weight: 700;
  margin-bottom: 2px;
}
.ledger-main .item-meta {
  font-size: 13px;
  color: var(--ink-soft);
}

.seq-badge {
  font-size: 11px;
  color: var(--ink-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 7px;
  margin-left: 6px;
}

.ledger-price {
  text-align: right;
  font-family: 'Noto Serif TC', serif;
}
.ledger-price .participants {
  display: block;
  font-family: 'Noto Sans TC', sans-serif;
  font-size: 12px;
  color: var(--ink-soft);
}

/* ============ 旅遊行程：年份分組 + 橫向卡片 ============ */
.trip-year-group {
  margin-bottom: 32px;
}

.trip-year-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  border-bottom: 2px solid var(--brass);
  padding-bottom: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.trip-year-num {
  font-family: 'Noto Serif TC', serif;
  font-size: 38px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1;
}

.trip-year-unit {
  font-family: 'Noto Serif TC', serif;
  font-size: 20px;
  color: var(--ink);
}

.trip-year-meta {
  font-size: 14px;
  color: var(--ink-soft);
}

.trip-year-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.trip-card {
  flex: 0 1 260px;
  min-width: 220px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  background: #fff;
  cursor: pointer;
  transition: box-shadow .15s ease, transform .15s ease;
}

.trip-card:hover {
  box-shadow: 0 6px 16px rgba(31,58,61,0.12);
  transform: translateY(-2px);
}

.trip-dates {
  font-family: 'Noto Serif TC', serif;
  color: var(--ink-soft);
  font-size: 13px;
}

.trip-title {
  font-size: 20px;
  font-weight: 700;
  margin: 4px 0 8px;
}

.trip-title.trip-domestic { color: #0B6FD6; }   /* 國內：鮮豔藍 */
.trip-title.trip-abroad   { color: #E8720C; }   /* 國外：鮮豔橘 */

.trip-visit-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.trip-visit-badge {
  font-size: 11px;
  background: var(--brass);
  color: #fff;
  border-radius: 999px;
  padding: 2px 9px;
}
.trip-visit-badge.trip-visit-first {
  background: var(--ink-soft);
}

.trip-tag {
  font-size: 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 1px 9px;
  color: var(--ink-soft);
  display: inline-block;
}
.trip-tag-note {
  margin-bottom: 6px;
}

.trip-meta {
  font-size: 13px;
  color: var(--ink-soft);
  margin-top: 6px;
  line-height: 1.6;
}

/* ============ Red envelope ============ */
.envelope-year {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 18px;
  overflow: hidden;
}

.envelope-year-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--paper-alt);
  padding: 12px 18px;
  cursor: pointer;
}

.envelope-year-head h3 {
  font-size: 20px;
}

.envelope-year-total {
  font-family: 'Noto Serif TC', serif;
  color: var(--red);
  font-size: 18px;
}

.envelope-year-body {
  padding: 14px 18px;
  display: none;
}
.envelope-year.is-open .envelope-year-body { display: block; }

.envelope-side {
  margin-bottom: 12px;
}
.envelope-side-title {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 6px;
}
.envelope-side-title.side-husband { color: #0B6FD6; }  /* 老公家：鮮豔藍 */
.envelope-side-title.side-wife    { color: #8E24AA; }  /* 老婆家：鮮豔紫 */

.envelope-entry-row {
  display: flex;
  justify-content: space-between;
  padding: 5px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 14px;
}

.entry-extra {
  font-size: 12px;
  color: var(--ink-soft);
  margin-left: 8px;
  border-left: 1px solid var(--line);
  padding-left: 8px;
}

.envelope-denoms {
  margin-top: 10px;
  font-size: 12px;
  color: var(--ink-soft);
}

.envelope-return-summary {
  margin-top: 8px;
  font-size: 13px;
  color: var(--brass-deep);
  font-weight: 600;
}

/* ============ Empty state ============ */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--ink-soft);
}

/* ============ Modal ============ */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(31,58,61,0.45);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 16px;
  overflow-y: auto;
  z-index: 100;
}
.modal[hidden] { display: none; }

.modal-card {
  background: var(--paper);
  border-radius: var(--radius);
  width: 100%;
  max-width: 620px;
  padding: 28px 40px 32px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.25);
}

.modal-card-wide { max-width: 920px; }

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.modal-close {
  background: none;
  border: none;
  font-size: 16px;
  cursor: pointer;
  color: var(--ink-soft);
}

#outing-form label, #trip-form label, #envelope-form label {
  display: block;
  font-size: 13px;
  color: var(--ink-soft);
  margin-bottom: 12px;
}

#outing-weekday-display {
  background: var(--paper-alt);
  color: var(--ink-soft);
}

#outing-form input, #outing-form select, #outing-form textarea,
#trip-form input, #trip-form select, #trip-form textarea,
#envelope-form input {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.form-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
}

.form-actions-right {
  display: flex;
  gap: 10px;
}

/* map picker */
.map-field { margin-bottom: 12px; }
.map-search-row {
  display: flex;
  gap: 8px;
}
.map-search-row input { flex: 1; }
#outing-map {
  height: 220px;
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.map-hint {
  font-size: 12px;
  color: var(--ink-soft);
  margin: 6px 0 2px;
}
.map-coords {
  font-size: 12px;
  color: var(--brass-deep);
  margin: 2px 0 0;
}

.price-currency-row {
  display: flex;
  gap: 8px;
}
.price-currency-row input { flex: 1; }
.price-currency-row select { flex: 0 0 90px; width: auto; }

/* red envelope entries editor */
.entries-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 6px 0 8px;
}
.entries-head-actions {
  display: flex;
  gap: 8px;
}
.entry-edit-row {
  display: grid;
  grid-template-columns: 76px 1fr 76px 76px 76px 76px 1fr 24px;
  gap: 5px;
  margin-bottom: 8px;
  align-items: center;
}
.entry-edit-row-head {
  font-size: 11px;
  color: var(--ink-soft);
  margin-bottom: 4px;
}
.entry-stats-row {
  border-top: 2px solid var(--ink);
  padding-top: 6px;
  margin-top: 4px;
  font-size: 13px;
  font-weight: 700;
}
.entry-stats-label {
  color: var(--ink-soft);
  font-weight: 400;
  font-size: 12px;
}
.entry-edit-row input, .entry-edit-row select {
  padding: 6px 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 12px;
  width: 100%;
}
.entry-side.side-husband { color: #0B6FD6; font-weight: 600; }
.entry-side.side-wife    { color: #8E24AA; font-weight: 600; }
.entry-remove {
  background: none;
  border: none;
  color: var(--red);
  cursor: pointer;
  font-size: 16px;
}

/* ============ 財：帳戶卡片 ============ */
.account-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 18px;
}
.account-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 16px;
  min-width: 140px;
  cursor: pointer;
  background: #fff;
  transition: box-shadow .15s ease;
}
.account-card:hover { box-shadow: 0 4px 12px rgba(31,58,61,0.1); }
.account-card.is-active { border-color: var(--brass); box-shadow: 0 0 0 1px var(--brass); }
.account-card .account-name {
  font-size: 13px;
  color: var(--ink-soft);
}
.account-card .account-balance {
  font-family: 'Noto Serif TC', serif;
  font-size: 20px;
  font-weight: 700;
  margin-top: 2px;
}
.account-detail {
  background: var(--paper-alt);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 18px;
  font-size: 13px;
}
.account-detail-row {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  border-bottom: 1px dashed var(--line);
}

.checkbox-row {
  display: flex !important;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--ink-soft);
}
.checkbox-row input[type="checkbox"] { width: auto; margin: 0; }

/* 帳戶管理清單 */
.account-edit-item {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  margin-bottom: 10px;
}
.account-edit-item .form-row { margin-bottom: 8px; }
.account-sub-row {
  display: grid;
  grid-template-columns: 1fr 100px auto 24px;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}
.account-sub-row input {
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 12px;
}

.section-subhead {
  font-family: 'Noto Serif TC', serif;
  font-size: 20px;
  margin: 30px 0 4px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

/* ============ 險：子項目編輯列 ============ */
.insurance-sub-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1.3fr 28px;
  gap: 8px;
  margin-bottom: 8px;
  align-items: center;
}
.insurance-sub-row input {
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 13px;
  width: 100%;
}
.insurance-sub-tag {
  display: inline-block;
  font-size: 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 10px;
  margin: 0 6px 6px 0;
  color: var(--ink-soft);
}

/* ============ 險：月結總覽 ============ */
.month-group {
  margin-bottom: 22px;
}
.month-group-year {
  font-family: 'Noto Serif TC', serif;
  font-size: 22px;
  font-weight: 700;
  margin: 14px 0 6px;
}
.month-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 10px;
  overflow: hidden;
}
.month-card-head {
  display: grid;
  grid-template-columns: 56px 1fr 160px;
  gap: 10px;
  align-items: center;
  background: var(--paper-alt);
  padding: 10px 16px;
  cursor: pointer;
}
.month-col-month { font-weight: 700; text-align: right; }
.month-col-desc { text-align: left; color: var(--ink-soft); font-size: 13px; }
.month-col-total { text-align: right; font-family: 'Noto Serif TC', serif; color: var(--brass-deep); }
.month-card-head .month-total {
  font-family: 'Noto Serif TC', serif;
  color: var(--brass-deep);
}
.month-card-body {
  display: none;
  padding: 10px 16px;
}
.month-card.is-open .month-card-body { display: block; }
.month-row {
  display: grid;
  grid-template-columns: 1fr 140px 90px 100px 1fr;
  gap: 8px;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 13px;
}
.month-row input[type="date"] {
  padding: 4px 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 12px;
  width: 100%;
}
.month-row-bulk {
  text-align: right;
  margin-top: 8px;
}

/* ============ 險：保單卡片 ============ */
.insurance-group {
  margin-bottom: 28px;
}
.insurance-group-title {
  font-family: 'Noto Serif TC', serif;
  font-size: 20px;
  border-bottom: 2px solid var(--brass);
  padding-bottom: 6px;
  margin-bottom: 12px;
}
.insurance-item-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin-bottom: 12px;
  background: #fff;
}
.insurance-item-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
  cursor: pointer;
}
.insurance-item-title { font-weight: 700; font-size: 15px; }
.insurance-sub-line {
  padding: 3px 10px;
  border-radius: var(--radius);
  margin-bottom: 4px;
  display: block;
}
.insurance-item-meta { font-size: 12px; color: var(--ink-soft); margin-top: 4px; }
.insurance-item-note { font-size: 12px; color: var(--brass-deep); margin-top: 4px; }
.installment-table {
  margin-top: 10px;
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  display: none;
}
.insurance-item-card.is-open .installment-table { display: table; }
.insurance-renewal-row.is-open .installment-table { display: table; }

.insurance-renewal-list { margin-top: 6px; }
.insurance-renewal-row {
  border-top: 1px dashed var(--line);
  padding: 8px 0;
}
.insurance-renewal-row-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  font-size: 13px;
  flex-wrap: wrap;
}
.insurance-renewal-row-head > span:first-child {
  flex: 1;
  min-width: 240px;
}
.insurance-renewal-note {
  font-size: 12px;
  color: var(--brass-deep);
  margin-top: 4px;
}
.insurance-renewal-row-body { padding-top: 6px; }
.installment-table th, .installment-table td {
  text-align: left;
  padding: 5px 8px;
  border-bottom: 1px dashed var(--line);
}
.installment-synced { color: var(--ink-soft); }
.month-delay-btn {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: none;
  color: var(--ink-soft);
  cursor: pointer;
}
.installment-sync-btn {
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid var(--brass);
  background: none;
  color: var(--brass-deep);
  cursor: pointer;
}

/* ============ Responsive ============ */
@media (max-width: 720px) {
  body { flex-direction: column; }
  .rail {
    width: 100%;
    height: auto;
    position: static;
    flex-direction: row;
    padding: 14px 12px;
    overflow-x: auto;
    gap: 4px;
  }
  .rail-mark { display: none; }
  .rail-tab { flex-direction: row; padding: 8px 12px; border-left: none; border-bottom: 3px solid transparent; }
  .rail-tab.is-active { border-left: none; border-bottom-color: var(--brass); }
  .rail-tab-glyph { width: 28px; height: 28px; line-height: 28px; font-size: 16px; }
  .stage { padding: 24px 16px 60px; }
  .ledger-row { grid-template-columns: 1fr; gap: 4px; }
  .ledger-price { text-align: left; }
  .form-row { grid-template-columns: 1fr; }
  .entry-edit-row { grid-template-columns: 1fr 1fr; }
  .entry-edit-row-head { display: none; }
  .entry-remove { justify-self: end; }
}

/* ============ 險：分頁切換按鈕 ============ */
.subtabs {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  margin-right: 8px;
}
.subtab {
  background: #fff;
  border: none;
  padding: 9px 18px;
  cursor: pointer;
  color: var(--ink-soft);
  font-weight: 500;
}
.subtab + .subtab { border-left: 1px solid var(--line); }
.subtab.is-active { background: var(--ink); color: #fff; }

/* 月結總覽：年份可折疊 */
.month-group-year {
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
.month-group-year::before {
  content: '▸';
  font-size: 14px;
  color: var(--ink-soft);
  transition: transform .15s ease;
}
.month-group.is-open > .month-group-year::before { transform: rotate(90deg); }
.month-group > .month-card { display: none; }
.month-group.is-open > .month-card { display: block; }

/* 已繳清標示 */
.paid-off-badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  color: #00844a;
  margin-left: 8px;
}
.insurance-insured-head {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-soft);
  margin-top: 10px;
  padding-top: 6px;
  border-top: 1px solid var(--line);
}

/* ============ 險：險種明細行內編輯 ============ */
.insurance-sub-line.is-clickable { cursor: pointer; transition: filter .12s ease; }
.insurance-sub-line.is-clickable:hover { filter: brightness(0.96); }
.sub-note-dot { font-size: 9px; color: var(--brass-deep); margin-left: 8px; vertical-align: middle; }
.insurance-sub-editor {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 12px;
  margin: -1px 0 8px;
  font-weight: 400;
  cursor: default;
}
.insurance-sub-editor[hidden] { display: none; }
.sub-editor-row { display: grid; grid-template-columns: 1fr 2fr; gap: 8px; margin-bottom: 8px; }
.insurance-sub-editor input {
  width: 100%;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 13px;
  font-family: inherit;
}
.sub-editor-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.sub-editor-hint { font-size: 12px; color: var(--ink-soft); }

/* ============ 財：帳戶拖曳排序 ============ */
.account-edit-item { transition: box-shadow .12s ease; }
.account-edit-item.is-dragging { opacity: 0.4; }
.account-edit-item-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.acc-drag-handle {
  cursor: grab;
  color: var(--ink-soft);
  font-size: 18px;
  line-height: 1;
  padding-top: 10px;
  user-select: none;
}
.acc-drag-handle:active { cursor: grabbing; }
.acc-initial[readonly] { background: var(--paper-alt); color: var(--ink-soft); }

/* ============ 財：已結清切換、分類篩選提示 ============ */
.settle-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
  font-size: 12px;
  color: var(--ink-soft);
  cursor: pointer;
}
.settle-toggle input { width: auto; margin: 0; }
.sub-filter-banner {
  background: var(--paper-alt);
  border: 1px solid var(--brass);
  border-radius: var(--radius);
  padding: 8px 14px;
  margin-bottom: 12px;
  font-size: 13px;
}
.sub-filter-banner button {
  margin-left: 8px;
  background: none;
  border: 1px solid var(--brass);
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 12px;
  color: var(--brass-deep);
  cursor: pointer;
}
.account-detail-row.is-clickable { cursor: pointer; }
.account-detail-row.is-clickable:hover { background: rgba(184,134,43,0.12); }

/* ============ 財：月份切換列 / 信用卡勾選 / 左側按鈕群 ============ */
.month-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 16px; }
.month-tab {
  background: #fff; border: 1px solid var(--line); border-radius: 999px;
  padding: 5px 14px; font-size: 13px; color: var(--ink-soft); cursor: pointer;
}
.month-tab:hover { background: var(--paper-alt); }
.month-tab.is-active { background: var(--ink); border-color: var(--ink); color: #fff; }
.month-tab.is-current:not(.is-active) { border-color: var(--brass); color: var(--brass-deep); }
.sub-card-flag {
  display: inline-flex; align-items: center; gap: 4px; font-size: 12px;
  color: var(--ink-soft); white-space: nowrap; cursor: pointer;
}
.sub-card-flag input { width: auto; margin: 0; padding: 0; }
.form-actions-left { display: flex; gap: 8px; flex-wrap: wrap; }

/* ============ 提示訊息（toast） ============ */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px);
  background: var(--ink); color: #fff; padding: 10px 18px; border-radius: var(--radius);
  font-size: 14px; box-shadow: 0 8px 24px rgba(0,0,0,0.25);
  opacity: 0; pointer-events: none; transition: opacity .2s ease, transform .2s ease; z-index: 300; max-width: 90vw;
}
.toast.is-show { opacity: 1; transform: translate(-50%, 0); }
