/* R1 の作り直し（trips）2026-10-08。app.css の後に読む */

/* ==========================================================================
   1. 出張レポート（b8）— js/trip-report.js
   ========================================================================== */
.trip-report-overlay.rp {
  position: fixed; inset: 0; z-index: 2000; background: var(--bg); color: var(--ink);
  display: flex; flex-direction: column; overflow: hidden;
}
.rp-head {
  flex: none; height: 46px; margin-top: var(--safe-top); display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; padding: 0 16px;
}
.rp-head button { background: none; border: 0; padding: 8px 0; font: inherit; font-size: 16px; color: var(--ink); cursor: pointer; white-space: nowrap; }
.rp-back { justify-self: start; font-weight: 500; }
.rp-share { justify-self: end; font-weight: 600 !important; }
.rp-title { font-size: 16px; font-weight: 700; margin: 0; }
.rp-scroll { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 0 16px 28px; }
.rp-seg.ui-seg { margin: 6px 0 0; }
.rp-paper {
  margin: 14px 4px 0; background: var(--card); color: var(--ink); border-radius: 6px; padding: 18px 18px 14px;
  box-shadow: 0 10px 30px -14px rgba(0,0,0,.35), 0 0 0 1px var(--line);
}
.rp-label { font-size: 9.5px; font-weight: 600; letter-spacing: .14em; color: var(--t2); }
.rp-name { font-size: 20px; font-weight: 700; letter-spacing: -.3px; margin: 8px 0 4px; line-height: 1.3; overflow-wrap: anywhere; }
.rp-sub { font-size: 11.5px; color: var(--t2); line-height: 1.6; font-variant-numeric: tabular-nums; }
.rp-rule { height: 1px; background: var(--ink); margin: 12px 0 4px; }
.rp-pane { display: none; }
.rp-pane.on { display: block; }
.rp-h { display: none; font-size: 13px; font-weight: 700; margin: 18px 0 4px; }
.rp-r {
  display: grid; grid-template-columns: 48px 1fr auto; gap: 8px; align-items: baseline; padding: 9px 0; border-bottom: 1px solid var(--line);
  font-size: 12.5px; font-variant-numeric: tabular-nums;
}
.rp-r:last-child { border-bottom: 0; }
.rp-c1 { color: var(--t2); white-space: nowrap; }
.rp-c2 { min-width: 0; overflow-wrap: anywhere; }
.rp-c3 { text-align: right; white-space: nowrap; }
.rp-r.b .rp-c2, .rp-r.b .rp-c3 { font-weight: 700; }
.rp-r.t3 .rp-c2, .rp-r.t3 .rp-c3 { color: var(--t3); }
.rp-empty { font-size: 13px; color: var(--t2); padding: 14px 0 6px; }
.rp-bar { padding-bottom: calc(max(var(--safe-bottom), 16px) + 10px); }

@media print {
  @page { size: A4; margin: 15mm; }
  :root, :root[data-theme] {
    --bg: #fff; --card: #fff; --ink: #000; --t2: #444; --t3: #777; --line: #ccc; --s1: #fff;
    color-scheme: light;
  }
  html, body, body.rp-open { height: auto !important; overflow: visible !important; background: #fff !important; position: static !important; }
  body.rp-open > *:not(.trip-report-overlay) { display: none !important; }
  .trip-report-overlay.rp { position: static; display: block; overflow: visible; background: #fff; }
  .rp-head, .rp-seg, .rp-bar { display: none !important; }
  .rp-scroll { overflow: visible; padding: 0; }
  .rp-paper { box-shadow: none; margin: 0; padding: 0; border-radius: 0; }
  .rp-pane { display: block !important; break-inside: auto; }
  .rp-h { display: block; break-after: avoid; }
  .rp-r { break-inside: avoid; font-size: 11pt; }
  .rp-label { font-size: 8pt; } .rp-name { font-size: 18pt; } .rp-sub { font-size: 9.5pt; }
}

/* ==========================================================================
   3. ルート最適化のシート（b4）— body 直下に移して、タブバー（z 400）より上に出す
   ========================================================================== */
body > .route-sheet { z-index: 700; }
.route-sheet-in { max-height: 92vh; }
.route-sheet-in .modal-header { flex: none; }
.route-sheet-in .route-hero { padding: 2px 0 0; gap: 2px; }
.route-sheet-in .route-hero .ui-hero-title { font-size: 26px; }
.route-sheet-in #trip-optimize-seg { margin: 14px 0 0 !important; }
.trip-optimize-hotel { gap: 12px; }
.r1-toggle-input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.trip-optimize-hotel:has(.r1-toggle-input:focus-visible) { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 8px; }
.trip-optimize-hotel:has(.r1-toggle-input:disabled) { cursor: default; }
.trip-optimize-hotel .r1-toggle-label { min-width: 2.5em; text-align: right; }
#trip-optimize-note.ui-banner { margin: 12px 0 0; font-size: 14px; }
#trip-optimize-note .s { white-space: nowrap; }
.trip-route-result { margin: 4px 0 0; }
.trip-route-legs.ui-rows { margin: 0; padding: 0; }
a.trip-route-leg.ui-row { color: var(--ink); font-size: inherit; min-height: 60px; padding: 8px 0; gap: 14px; align-items: center; display: flex; }
.trip-route-leg .ui-row-r { white-space: nowrap; }
.route-sheet-in .bottom-bar { flex: none; }

/* ==========================================================================
   4. 蚤の市 — カレンダー（d3）・一覧
   ========================================================================== */
.flea-add-top { width: 44px; height: 44px; display: inline-flex !important; align-items: center; justify-content: center; padding: 0 !important; margin-right: -10px; }
.flea-calendar { margin: 0; }
.flea-cal-header { display: flex; align-items: flex-end; gap: 6px; margin: 4px 4px 10px; justify-content: flex-start; }
.flea-cal-head-l { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.flea-cal-title { font-size: var(--fs-title); font-weight: 700; letter-spacing: -.6px; line-height: 1.15; }
.flea-cal-nav { width: 40px; height: 40px; border-radius: 20px; border: 0; background: var(--s1); color: var(--ink); font-size: 20px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex: none; }
.flea-cal-weekdays { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; font-size: 11px; font-weight: 600; color: var(--t2); margin: 0 0 6px; }
.flea-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.flea-cal-day {
  aspect-ratio: 1; border-radius: 10px; background: var(--s1); color: var(--ink); border: 0; padding: 0; margin: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; position: relative;
  font: inherit; font-size: 14px; font-weight: 500; font-variant-numeric: tabular-nums; opacity: 1; cursor: default;
}
.flea-cal-day.other-month { background: transparent; }
button.flea-cal-day { cursor: pointer; }
button.flea-cal-day:active { transform: scale(.96); }
.flea-cal-day.has-event { font-weight: 600; }
.flea-cal-day.has-event::after { content: ''; position: absolute; bottom: 5px; width: 4px; height: 4px; border-radius: 2px; background: var(--ink); }
/* 今日の印はオレンジ（R1：TODAY の印だけはオレンジ可）。文字は墨 */
.flea-cal-day.today { background: var(--accent); color: var(--on-accent); font-weight: 700; }
.flea-cal-day.today::after { background: var(--on-accent); }
/* 選んだ日：墨地に反転文字 */
.flea-cal-day.selected { background: var(--ink); color: var(--on-ink); font-weight: 700; }
.flea-cal-day.selected::after { background: var(--on-ink); }
.flea-cal-day.today.selected { box-shadow: inset 0 0 0 3px var(--accent); }
.flea-cal-events { border-top: 0; padding-top: 0; }
.flea-cal-hint { text-align: left; }
.flea-day-sec.ui-sec { padding-left: 4px; padding-right: 4px; }
.flea-day-sec .ui-sec-title { display: flex; flex-wrap: wrap; column-gap: 2px; }
.flea-day-rain { display: flex; align-items: center; gap: 6px; padding-top: 2px !important; }
.flea-day-rain svg { flex: none; color: var(--t2); }
.flea-day-rows .ui-row, .flea-list-rows .ui-row { align-items: center; }
.flea-day-rows .ui-row-end, .flea-list-rows .ui-row-end { gap: 0; }
/* 一覧（行） */
.flea-list-rows .flea-item { display: flex; padding: 10px 0; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: none; margin: 0; box-shadow: none; }
.flea-list-rows .flea-item:hover { background: none; }
.flea-list-rows .row-x { align-self: center; }
#flea-list-body .ui-empty { margin-left: 0; margin-right: 0; }

/* ==========================================================================
   5. パッキング（b6）— js/packing-list.js
   ========================================================================== */
#trip-packing-container .ui-sec, #trip-packing-container .ui-bar, #trip-packing-container .ui-note { padding-left: 0; padding-right: 0; }
#trip-packing-container .ui-rows { margin-left: 0; margin-right: 0; }
#trip-packing-container .ui-btns, #trip-packing-container .ui-fields { padding-left: 0; padding-right: 0; }
.pk-bar { padding-top: 8px; }
.pk-rows { margin-top: 6px; }
.pk-row { cursor: pointer; }
.pk-mark { display: inline-flex; align-items: center; justify-content: flex-end; min-width: 24px; color: var(--ink); }
.pk-mark.t3 { color: var(--t3); font-weight: 500; }
.pk-mark svg { display: block; }
.pk-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.pk-hint { padding-top: 8px !important; }

/* 11. 左スワイプの「削除」：ダークでは --err が明るいので、文字は背景色にして読めるようにする */
.swipe-del { color: var(--bg); }

/* ==========================================================================
   6. AI のチャット（b7）— main.css の旧 .trip-chat-*（外枠＋泡の二重枠）を消す
   ========================================================================== */
.trip-chat-messages.ui-chat { max-height: none; overflow: visible; border: 0; border-radius: 0; background: none; margin: 0; padding: 14px 0 0; }
.trip-chat-msg, .trip-chat-user, .trip-chat-assistant {
  margin: 0; padding: 0; border: 0; border-radius: 0; background: none; max-width: none; color: inherit;
  display: flex; flex-direction: column; align-items: flex-start;
}
.trip-chat-msg.trip-chat-user { align-items: flex-end; }
.trip-chat-role { display: none; }
.trip-chat-text {
  max-width: 290px; border-radius: 22px; padding: 12px 16px; font-size: 15px; line-height: 1.6; background: var(--s1); color: var(--ink);
  overflow-wrap: anywhere; word-break: normal;
}
.trip-chat-user .trip-chat-text { background: var(--ink); color: var(--on-ink); }
.trip-chat-text code { background: var(--s2); color: inherit; padding: 1px 5px; border-radius: 5px; font-size: .92em; }
.trip-chat-user .trip-chat-text code { background: rgba(127,127,127,.3); }
.trip-chat-typing .trip-chat-text { color: var(--t2); font-style: normal; }
.trip-chat-welcome.ui-note { text-align: left; padding: 0; }
.trip-chat-input-area.ui-input-wrap { flex-direction: row; gap: 0; }
.trip-chat-input-area .trip-chat-input { border: 0; border-radius: 0; background: transparent; font-size: var(--fs-input); }
.trip-chat-input-area .trip-chat-input:focus { border: 0; }
#trip-chat-send { align-self: center; }
#trip-chat-send:disabled { color: var(--t3); cursor: default; }

/* ==========================================================================
   7. 収支（b5）— js/trip-dashboard.js ＋ 目標と実績（app.js renderTripTargets）
   ========================================================================== */
#trip-dashboard-container .ui-kpis.td-kpis { margin: 18px 0 0; }
#trip-dashboard-container .ui-kpi-v { font-size: 19px; }
#trip-dashboard-container .td-sec.ui-sec { padding-left: 0; padding-right: 0; }
#trip-dashboard-container .ui-bars, #trip-targets-container .ui-bars { margin-left: 0; margin-right: 0; }
#trip-dashboard-container .td-empty { padding-left: 0; padding-right: 0; }
.td-bars .ui-bars-row, .tg-row { grid-template-columns: 92px 1fr 84px; }
.tg-row { grid-template-columns: 84px 1fr 56px 32px; }
.tg-row > :last-child.row-x, .tg-row > .row-x { width: 32px; height: 32px; justify-self: end; }
.tg-row .tg-done { color: var(--ink); font-weight: 600; }
.tg-row .tg-notes { grid-column: 1 / -1; font-size: 12px; color: var(--t2); margin-top: -6px; white-space: normal; text-align: left; }
.tg-row > .ui-bars-track { overflow: visible; }
.tg-empty { padding-left: 0 !important; padding-right: 0 !important; padding-top: 4px !important; }
.target-add-form.tg-add { display: grid; grid-template-columns: minmax(0, 1fr) 116px auto; gap: 8px; align-items: end; margin: 14px 0 0; padding: 0; background: none; border: 0; }
.tg-add .ui-input-wrap select { min-width: 0; text-overflow: ellipsis; }
.tg-add .ui-input-wrap input { min-width: 0; width: 100%; }
.tg-add .ui-btn.sm { height: 50px; border-radius: 25px; }

/* ==========================================================================
   8. 渡航書類（app.js openTravelDocs / loadTravelDocs）
   ========================================================================== */
#travel-docs-body .td-pick { margin-top: 4px; }
#travel-docs-body .td-pick .ui-row-s { font-size: 11px; font-weight: 600; letter-spacing: .08em; }
#travel-docs-body .td-countries .ui-row { min-height: 52px; }
#travel-docs-body .travel-docs-country-btn.active .ui-row-t { font-weight: 700; }
#travel-docs-body .td-custom { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: end; margin: 12px 0 4px; }
#travel-docs-body .td-custom .ui-btn.sm { height: 50px; border-radius: 25px; }
#travel-docs-body .td-res-sec { padding-top: 22px; }
#travel-docs-body .td-visa { margin-top: 6px; }
#travel-docs-body .td-foot { padding-top: 16px; }
#travel-docs-body .ui-skel { margin-top: 16px; }

/* ==========================================================================
   9. 出張を作成：VISA の注意を 1 行の帯に（app.js setupTripVisaCheck）
   ========================================================================== */
#trip-visa-warning.ui-banner { margin: 12px 0 14px; width: 100%; }
#trip-visa-warning.ui-banner .s { white-space: nowrap; background: none; border: 0; padding: 0; font: inherit; font-size: 13px; color: inherit; cursor: pointer; }

/* ==========================================================================
   10. 蚤の市を探す（flea-finder.js）：文字からオレンジを外す（オレンジはピン・今いる場所・今日の印だけ）
   ========================================================================== */
.ff-link { color: var(--ink); font-weight: 600; }
.ff-foot a { color: var(--ink); text-decoration: underline; text-underline-offset: 2px; }
.ff-date.we small { color: var(--ink); font-weight: 700; }
/* 日付の小さな札：ダークでも見えるよう、線ではなく面で */
.ff-date { background: var(--s1); border: 0; color: var(--ink); }
.ff-date.more { background: transparent; }

/* ==========================================================================
   11. 出張の詳細：題名は大きな見出し（ui-hero）だけに出す（b3）。上のバーの題名は見せない
       （textContent は残す：上に重ねた画面の「‹ 戻る」の文言に使う）
   ========================================================================== */
#trip-detail-modal > .modal > .modal-header .modal-title { visibility: hidden; }
#trip-research-btn .ui-lead.mark svg { display: block; }
#trip-visa-warning.ui-banner { padding: 6px 16px; border-radius: 22px; margin-bottom: 0; font-size: 15px; line-height: 1.4; }
#trip-visa-warning.ui-banner > .t { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#travel-docs-body .td-res-sec:not(:first-child) .ui-sec-title { font-size: 13px; font-weight: 700; color: var(--t2); letter-spacing: .02em; }
#travel-docs-body .td-res-sec:not(:first-child) { padding-top: 20px; padding-bottom: 0; }
#travel-docs-body #travel-docs-result .ui-row { min-height: 50px; }
