/* EXPENSE PAGE */
.expense-page { padding: 0; }
.expense-mode-switch {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px;
  padding: 4px; margin-bottom: 14px; border: 1px solid var(--paper3);
  border-radius: 12px; background: var(--paper2);
}
.expense-mode-tab {
  min-height: 44px; padding: 8px 10px; border: none; border-radius: 9px;
  background: transparent; color: var(--ink2); font: 700 13px/1.2 inherit;
  cursor: pointer; transition: background-color 180ms ease-out, color 180ms ease-out, box-shadow 180ms ease-out;
}
.expense-mode-tab.active { background: white; color: var(--accent); box-shadow: 0 2px 6px rgba(15,25,35,0.10); }
.expense-mode-tab:focus-visible { outline: 3px solid rgba(212,80,42,0.35); outline-offset: 2px; }
.expense-mode-panel[hidden] { display: none; }
.expense-focus-card {
  background: white; border-radius: var(--radius); padding: 16px;
  margin-bottom: 14px; box-shadow: var(--shadow); border: 1px solid rgba(200,216,232,0.65);
}
.expense-focus-top { display:flex; justify-content:space-between; align-items:flex-start; gap:12px; margin-bottom:12px; }
.expense-focus-label { font-size:11px; color:var(--ink3); font-weight:800; letter-spacing:0.06em; }
.expense-focus-title { font-size:16px; font-weight:800; color:var(--ink); margin-top:2px; }
.expense-focus-amount { text-align:right; flex-shrink:0; }
.expense-focus-jpy { font-size:24px; font-weight:800; color:var(--accent); font-family:'Outfit', sans-serif; line-height:1.1; }
.expense-focus-twd { font-size:11px; color:var(--ink3); margin-top:2px; }
.expense-focus-stats { display:grid; grid-template-columns:repeat(3, 1fr); gap:7px; margin-bottom:12px; }
.expense-focus-stat { background:var(--paper); border-radius:12px; padding:9px 6px; text-align:center; min-width:0; }
.expense-focus-stat span { display:block; font-size:15px; font-weight:800; color:var(--ink); font-family:'Outfit', sans-serif; word-break:break-all; }
.expense-focus-stat small { display:block; font-size:10px; color:var(--ink3); margin-top:2px; }
.expense-recent-title { font-size:11px; color:var(--ink3); font-weight:800; margin-bottom:6px; }
.expense-recent-row { display:flex; align-items:center; justify-content:space-between; gap:8px; padding:7px 0; border-top:1px solid var(--paper2); font-size:12px; }
.expense-recent-name { color:var(--ink2); min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.expense-recent-amt { color:var(--ink); font-weight:800; flex-shrink:0; }
.expense-recent-empty { font-size:12px; color:var(--ink3); padding:8px 0 2px; text-align:center; }
.expense-actor-card {
  background:white; border-radius:var(--radius); padding:12px 14px; margin-bottom:14px;
  box-shadow:var(--shadow); border:1px solid rgba(200,216,232,0.65);
  display:flex; align-items:center; justify-content:space-between; gap:10px;
}
.expense-actor-label { font-size:13px; font-weight:800; color:var(--ink); }
.expense-actor-sub { font-size:10px; color:var(--ink3); margin-top:2px; line-height:1.35; }
.expense-actor-options { display:flex; gap:6px; flex-wrap:wrap; justify-content:flex-end; }
.expense-actor-chip {
  min-height:36px; padding:4px 9px 4px 5px; border-radius:999px; border:1.5px solid var(--paper3);
  background:var(--paper); color:var(--ink2); font-size:12px; font-weight:800; font-family:inherit; cursor:pointer;
  display:inline-flex; align-items:center; gap:6px;
}
.expense-actor-chip.active { background:var(--accent); border-color:var(--accent); color:white; }
.expense-actor-chip img {
  width:26px; height:26px; border-radius:50%; object-fit:cover; flex-shrink:0;
  border:1.5px solid rgba(255,255,255,0.75); background:white;
}
.expense-actor-badge {
  display:inline-flex; align-items:center; max-width:74px; padding:2px 6px; border-radius:999px;
  background:#eef4fb; color:#1a5c9a; font-size:10px; font-weight:800; white-space:nowrap;
  overflow:hidden; text-overflow:ellipsis; vertical-align:middle;
}
.expense-actor-avatar {
  display:inline-flex; width:22px; height:22px; border-radius:50%; overflow:hidden;
  border:1.5px solid white; box-shadow:0 0 0 1px rgba(26,92,154,0.18);
  background:var(--paper2); flex-shrink:0; vertical-align:middle;
}
.expense-actor-avatar img { width:100%; height:100%; object-fit:cover; display:block; }
.total-card { 
  background: linear-gradient(135deg, #0f1923 0%, #1a3a5c 100%); color: white; border-radius: var(--radius); 
  padding: 20px; margin-bottom: 16px; 
  box-shadow: 0 6px 24px rgba(15,25,35,0.2);
}
.total-label { font-size: 11px; opacity: 0.55; margin-bottom: 6px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }
.total-amount { font-size: 32px; font-weight: 700; font-family: 'Outfit', sans-serif; }
.total-twd { font-size: 14px; opacity: 0.65; margin-top: 4px; }
.quick-expense-card {
  background: white; border-radius: var(--radius); padding: 14px 16px;
  margin-bottom: 14px; box-shadow: var(--shadow); border: 1px solid rgba(200,216,232,0.65);
}
.quick-expense-head { display:flex; justify-content:space-between; align-items:center; gap:10px; margin-bottom:10px; }
.quick-expense-title { font-size:14px; font-weight:700; color:var(--ink); }
.quick-expense-sub { font-size:10px; color:var(--ink3); white-space:nowrap; }
.quick-expense-grid { display:grid; grid-template-columns:1.2fr 0.8fr; gap:8px; }
.quick-expense-wide { grid-column:1 / -1; }
.quick-expense-input, .quick-expense-select {
  width:100%; min-width:0; min-height:44px; padding:10px 11px; border:1.5px solid var(--paper3);
  border-radius:10px; background:var(--paper); color:var(--ink); font-family:inherit;
  font-size:14px; outline:none; box-sizing:border-box;
}
.quick-expense-input:focus, .quick-expense-select:focus { border-color:var(--accent); background:white; }
.quick-expense-amount { font-size:20px; font-weight:700; font-family:'Outfit', sans-serif; }
.quick-expense-hidden-select { display:none; }
.quick-pick-group { padding:2px 0 1px; }
.quick-pick-label { font-size:11px; color:var(--ink3); font-weight:800; margin:2px 0 6px; }
.quick-pick-grid { display:grid; grid-template-columns:repeat(3, 1fr); gap:7px; }
.quick-pick-grid-pay { grid-template-columns:repeat(3, 1fr); }
.quick-pick-chip {
  min-height:44px; padding:8px 6px; border-radius:12px; border:1.5px solid var(--paper3);
  background:var(--paper); color:var(--ink2); font-size:12px; font-weight:800; font-family:inherit;
  cursor:pointer; white-space:nowrap;
}
.quick-pick-chip.active { background:var(--accent); border-color:var(--accent); color:white; box-shadow:0 6px 18px rgba(212,80,42,0.22); }
.quick-pick-chip:active { transform:scale(0.98); }
.quick-expense-add {
  width:100%; min-height:44px; padding:11px 12px; border:none; border-radius:10px; background:var(--accent);
  color:white; font-size:14px; font-weight:700; font-family:inherit; cursor:pointer;
}
.quick-expense-add:active { opacity:0.85; transform:scale(0.99); }
.quick-expense-add:disabled { opacity:0.58; cursor:wait; transform:none; }

/* Phase 2: mobile itinerary controls */
.itinerary-risk-summary { margin: 0 0 12px; padding: 11px 12px; border-radius: 12px; font-size: 12px; line-height: 1.45; }
.itinerary-risk-summary.safe { background: #e7f6f2; color: #075e57; }
.itinerary-risk-summary.warning { background: #fff2dc; color: #7b4300; }
.itinerary-risk-summary strong, .itinerary-risk-summary span { display: block; }
.itinerary-risk-summary span { margin-top: 4px; }
.itinerary-inline-risk { margin: 7px 34px 0 0; padding: 6px 8px; border-radius: 8px; background: #fff2dc; color: #7b4300; font-size: 10px; line-height: 1.4; }
.itinerary-more-btn { position: absolute; top: 8px; right: 8px; width: 44px; height: 44px; border: 0; border-radius: 12px; background: rgba(228,236,244,0.94); color: var(--ink2); font-size: 16px; font-weight: 800; cursor: pointer; }
.itinerary-more-btn:focus-visible { outline: 3px solid rgba(212,80,42,0.38); outline-offset: 2px; }
.itinerary-status { display: inline-flex; align-items: center; min-height: 26px; margin: 7px 36px 0 0; padding: 3px 8px; border-radius: 99px; font-size: 10px; font-weight: 800; }
.itinerary-status.completed { background: #e7f6f2; color: #075e57; }
.itinerary-status.skipped { background: var(--paper2); color: var(--ink2); }
.tl-item.is-completed .tl-card, .tl-item.is-completed .transport-card { opacity: .68; }
.tl-item.is-skipped .tl-card, .tl-item.is-skipped .transport-card { opacity: .48; filter: grayscale(.55); }
.tl-item.is-dragging, .tl-item.is-touch-dragging { opacity: .7; transform: scale(.985); }
.itinerary-drop-target { outline: 3px solid var(--accent) !important; outline-offset: 3px; }
.itinerary-action-sub { margin-top: 3px; color: var(--ink3); font-size: 12px; }
.itinerary-action-close { width: 44px; height: 44px; border: 0; border-radius: 12px; background: var(--paper2); color: var(--ink2); font-size: 16px; }
.itinerary-action-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 16px 0; }
.itinerary-action-grid button, .itinerary-move-row button { min-height: 46px; padding: 9px 10px; border: 1px solid var(--paper3); border-radius: 12px; background: white; color: var(--ink2); font: 700 13px inherit; }
.itinerary-action-label { display: block; margin: 4px 0 7px; color: var(--ink2); font-size: 12px; font-weight: 800; }
.itinerary-move-row { display: grid; grid-template-columns: minmax(0,1fr) auto auto; gap: 7px; }
.itinerary-move-row select { min-width: 0; min-height: 46px; padding: 9px; border: 1.5px solid var(--paper3); border-radius: 12px; background: white; color: var(--ink); font: 600 13px inherit; }
.itinerary-delete-action { width: 100%; min-height: 46px; margin-top: 16px; border: 0; border-radius: 12px; background: #fff0f0; color: #a82d2d; font: 800 13px inherit; }

@media (prefers-reduced-motion: reduce) {
  .tl-item, .tl-card, .transport-card { scroll-behavior: auto !important; transition: none !important; }
}
.quick-expense-hint { font-size:10px; color:var(--ink3); margin-top:7px; line-height:1.45; }
.receipt-entry-card {
  background:white; border-radius:var(--radius); padding:14px 16px; margin-bottom:14px;
  box-shadow:var(--shadow); border:1px solid rgba(200,216,232,0.65);
}
.receipt-entry-head { display:flex; justify-content:space-between; align-items:flex-start; gap:10px; margin-bottom:10px; }
.receipt-entry-title { font-size:14px; font-weight:800; color:var(--ink); }
.receipt-entry-sub { font-size:11px; color:var(--ink3); line-height:1.5; margin-top:3px; }
.receipt-entry-actions { display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.receipt-entry-actions button {
  min-height:46px; border-radius:12px; border:1.5px solid var(--paper3);
  background:var(--paper); color:var(--ink2); font-size:13px; font-weight:800; font-family:inherit; cursor:pointer;
}
.receipt-entry-actions button:first-child { background:var(--accent); border-color:var(--accent); color:white; }
.receipt-entry-card .receipt-result { margin-top:10px; }
.day-expense-card { background: white; border-radius: var(--radius); padding: 14px 16px; margin-bottom: 10px; box-shadow: var(--shadow); border: 1px solid rgba(200,216,232,0.5); }
.day-exp-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.day-exp-title { font-size: 14px; font-weight: 600; }
.day-exp-total { font-size: 16px; font-weight: 700; color: var(--green); font-family: 'Outfit', sans-serif; }
.shop-row { display: flex; justify-content: space-between; align-items: center; padding: 5px 0; font-size: 12px; border-top: 1px solid var(--paper2); }
.shop-name { color: var(--ink2); flex: 1; }
.shop-amt { font-weight: 600; }
/* Editable shop amount */
.shop-amt-input {
  width: 72px; padding: 2px 6px; border: 1.5px solid var(--paper3); border-radius: 6px;
  font-size: 12px; font-weight: 500; font-family: inherit; text-align: right;
  background: var(--paper); color: var(--ink); outline: none;
}
.shop-amt-input:focus { border-color: var(--accent); background: white; }
.ai-badge {
  font-size: 9px; background: #e0f2f1; color: #0a6b62; border-radius: 99px;
  padding: 2px 7px; font-weight: 700; margin-left: 6px; vertical-align: middle;
}
.ai-estimating {
  font-size: 11px; color: var(--ink3); text-align: center; padding: 10px;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}

/* ── EXPENSE PAGE v2 ── */
.exp2-day-card {
  background: white; border-radius: 18px;
  border: 1px solid rgba(200,216,232,0.5); margin-bottom: 10px; overflow: hidden;
  box-shadow: var(--shadow);
}
.exp2-day-header {
  padding: 12px 14px 10px; border-bottom: 1px solid var(--paper2);
  display: flex; justify-content: space-between; align-items: flex-start;
}
.exp2-day-meta { font-size: 11px; color: var(--ink3); margin-bottom: 2px; font-weight: 500; }
.exp2-day-city { font-size: 14px; font-weight: 600; color: var(--ink); }
.exp2-day-jpy  { font-size: 20px; font-weight: 700; color: var(--ink); text-align: right; line-height: 1.2; }
.exp2-day-ntd  { font-size: 11px; color: var(--ink3); text-align: right; }
.exp2-ai-badge { font-size: 9px; background: #e8f0eb; color: #3a6b3a; border-radius: 99px; padding: 2px 6px; font-weight: 600; margin-left: 4px; vertical-align: middle; }

.exp2-item-list { padding: 0 14px; }
.exp2-item-row {
  display: block; padding: 0; border-bottom: 1px solid var(--paper2);
}
.exp2-item-summary { padding: 10px 0; cursor: pointer; border-radius: 10px; }
.exp2-item-summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.exp2-item-summary:active { background: var(--paper); }
.exp2-item-primary { display: flex; align-items: flex-start; gap: 8px; }
.exp2-item-secondary { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 6px; padding-left: 28px; }
.exp2-item-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; min-width: 0; }
.exp2-item-row.saved {
  background: rgba(92,138,90,0.12);
  box-shadow: 0 0 0 8px rgba(92,138,90,0.12);
  border-radius: 8px;
  transition: background 0.25s, box-shadow 0.25s;
}
.exp2-item-row:last-child { border-bottom: none; }
.exp2-item-icon { font-size: 16px; width: 20px; text-align: center; flex-shrink: 0; line-height: 1.35; }
.exp2-item-name {
  flex: 1; min-width: 0; font-size: 14px; font-weight: 600; color: var(--ink);
  line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; overflow-wrap: anywhere;
}
.exp2-pay-badge { font-size: 10px; padding: 2px 7px; border-radius: 99px; font-weight: 500; flex-shrink: 0; white-space: nowrap; }
.exp2-pay-cash  { background: #e8f5e9; color: #2e7d32; }
.exp2-pay-card  { background: #e3f2fd; color: #1565c0; }
.exp2-pay-paypay{ background: #ffeaea; color: #c62828; }
.exp2-item-amt  { font-size: 14px; font-weight: 700; color: var(--ink); text-align: right; white-space: nowrap; flex-shrink: 0; font-variant-numeric: tabular-nums; }
.exp2-item-amt-twd { color: #b05a00; }
.exp2-item-del  { font-size: 15px; color: var(--ink3); cursor: pointer; width: 34px; height: 34px; flex-shrink: 0; line-height: 1; background: var(--paper); border: 1px solid var(--paper2); border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.exp2-actor-identity { display: inline-flex; align-items: center; gap: 5px; min-width: 0; font-size: 11px; color: var(--ink3); }
.exp2-actor-identity .expense-actor-avatar { flex-shrink: 0; }
.exp2-receipt-toggle { display: block; margin: -3px 0 7px 28px; padding: 4px 7px; border: 0; background: transparent; color: var(--accent); font: 600 11px/1.2 inherit; cursor: pointer; }
.exp2-edit-panel { margin: 2px 0 12px; padding: 13px; background: var(--paper); border: 1px solid var(--paper3); border-radius: 12px; }
.exp2-edit-panel[hidden] { display: none; }
.exp2-edit-title { font-size: 15px; font-weight: 700; color: var(--ink); margin-bottom: 11px; }
.exp2-edit-label { display: block; margin: 11px 0 6px; font-size: 11px; font-weight: 600; color: var(--ink3); }
.exp2-edit-input { width: 100%; min-height: 42px; padding: 9px 10px; box-sizing: border-box; border: 1px solid var(--paper3); border-radius: 9px; background: white; color: var(--ink); font-size: 14px; font-family: inherit; outline: none; }
.exp2-edit-input:focus { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(92,138,90,.12); }
.exp2-edit-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.exp2-edit-chip { min-height: 36px; padding: 6px 10px; border: 1px solid var(--paper3); border-radius: 99px; background: white; color: var(--ink2); font-size: 12px; font-family: inherit; cursor: pointer; }
.exp2-edit-chip.active { border-color: var(--accent); background: var(--accent); color: white; font-weight: 600; }
.exp2-edit-actor { display: inline-flex; align-items: center; gap: 6px; }
.exp2-edit-actor img { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; }
.exp2-edit-actions { display: grid; grid-template-columns: auto 1fr 1fr; gap: 7px; margin-top: 14px; }
.exp2-edit-actions button { min-height: 42px; padding: 8px 10px; border-radius: 9px; font-size: 12px; font-weight: 600; font-family: inherit; cursor: pointer; }
.exp2-delete-btn { border: 1px solid #e3b8b8; background: #fff5f5; color: #b33a3a; }
.exp2-cancel-btn { border: 1px solid var(--paper3); background: white; color: var(--ink2); }
.exp2-save-btn { border: 1px solid var(--accent); background: var(--accent); color: white; }

.exp2-add-btn {
  margin: 8px 14px; min-height: 44px; padding: 9px;
  background: var(--accent); color: white; border: none;
  border-radius: 10px; font-size: 13px; font-weight: 600;
  width: calc(100% - 28px); cursor: pointer; font-family: inherit;
  transition: opacity 0.15s;
}
.exp2-add-btn:active { opacity: 0.82; }

.exp2-add-form {
  display: none; margin: 0 14px 10px;
  background: var(--paper2); border-radius: 12px; padding: 12px;
}
.exp2-add-form.open { display: block; }
.exp2-add-row { display: flex; gap: 6px; align-items: center; margin-bottom: 8px; }
.exp2-add-row:last-child { margin-bottom: 0; }
.exp2-finput {
  flex: 1; min-width: 0; min-height: 40px; padding: 7px 9px;
  border: 1px solid var(--paper3); border-radius: 9px;
  font-size: 13px; font-family: inherit; background: white;
  color: var(--ink); outline: none;
}
.exp2-fselect {
  min-height: 40px; padding: 7px 5px; border: 1px solid var(--paper3); border-radius: 9px;
  font-size: 13px; background: white; color: var(--ink); outline: none; cursor: pointer;
}
.exp2-confirm-btn {
  width: 100%; min-height: 40px; padding: 9px; background: var(--accent); color: white;
  border: none; border-radius: 9px; font-size: 13px; font-weight: 600;
  cursor: pointer; font-family: inherit; margin-top: 4px;
}

.exp2-hotel-block {
  margin: 0 14px 12px; padding: 10px 12px;
  background: #fff8f0; border-radius: 10px;
  border: 1px solid #f0d0a0;
}
.exp2-hotel-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.exp2-hotel-label { font-size: 11px; font-weight: 600; color: #b05a00; }
.exp2-hotel-sub   { font-size: 10px; font-weight: 400; color: #c07030; }
.exp2-hotel-amt   { font-size: 14px; font-weight: 700; color: #b05a00; }
.exp2-hotel-row   { display: flex; align-items: center; gap: 6px; }
.exp2-hotel-prefix{ font-size: 11px; color: #b05a00; font-weight: 600; flex-shrink: 0; }
.exp2-hotel-input {
  flex: 1; min-width: 0; min-height: 40px; padding: 6px 8px;
  border: 1px solid #f0d0a0; border-radius: 8px;
  font-size: 13px; font-family: inherit; background: white; color: var(--ink); outline: none;
}

