:root {
  --primary-navy: #1B2A4A;
  --accent-blue: #3A7CA5;
  --bg-gray: #F6F4EE;
  --card-bg: #FFFFFF;
  --text-main: #2C3E50;
  --text-muted: #8C96A6;
  --macha-green: #5B7B53;
  --border-color: #E8E5DA;
  --tip-bg: #FAF6ED;
  --tip-border: #E8D8B8;
  --tip-accent: #D4A359;
  --pink-badge: #D97076;
  --hanko-red: #C0392B;
}

/* 🌙 深色模式色調 */
body.dark-mode {
  --primary-navy: #6FA2D9;
  --accent-blue: #5C9CE6;
  --bg-gray: #0D1527;
  --card-bg: #16233B;
  --text-main: #F6F4EE;
  --text-muted: #94A3B8;
  --border-color: #233554;
  --tip-bg: #1E2D4A;
  --tip-border: #3A4F7C;
  --tip-accent: #EEDFA3;
  background-image: radial-gradient(#233554 0.8px, transparent 0.8px);
}

body.dark-mode .flight-card-title,
body.dark-mode .hotel-card-title,
body.dark-mode .day-card-title,
body.dark-mode .timeline-time,
body.dark-mode .modal-title,
body.dark-mode .converter-title,
body.dark-mode .checklist-section h3 {
  color: #FFFFFF !important;
}

body.dark-mode .flight-item, 
body.dark-mode .hotel-item, 
body.dark-mode .jp-phrase-item,
body.dark-mode .expense-item,
body.dark-mode .ticket-table tr:nth-child(even) {
  background-color: #121E33;
  color: #F6F4EE;
}

body.dark-mode .timeline-title { color: #FFFFFF; }
body.dark-mode .calc-input, 
body.dark-mode .seat-input,
body.dark-mode .search-bar-input,
body.dark-mode .date-input,
body.dark-mode #memoInput,
body.dark-mode #aiInput { 
  background-color: #121E33; 
  color: #FFFFFF; 
  border-color: #3A4F7C; 
}

body.dark-mode .search-bar-input::placeholder {
  color: #94A3B8;
}

body.dark-mode .converter-card {
  background-color: #182642;
  border-color: #2C3E50;
}

body.dark-mode .tab-btn {
  background-color: #16233B;
  color: #CBD5E1;
  border-color: #233554;
}

body.dark-mode .tab-btn.active {
  background-color: #3A7CA5 !important;
  border-color: #3A7CA5 !important;
  color: #FFFFFF !important;
  box-shadow: 0 3px 10px rgba(58, 124, 165, 0.4);
}

body.dark-mode .badge-hotel {
  background-color: #2B3E66;
  color: #FFFFFF;
}

body.dark-mode .ticket-table th {
  background-color: #233554;
  color: #FFFFFF;
}

body {
  font-family: "Zen Maru Gothic", "Noto Sans JP", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-gray);
  background-image: radial-gradient(#E2DDD3 0.8px, transparent 0.8px);
  background-size: 20px 20px;
  color: var(--text-main);
  margin: 0;
  padding: max(12px, env(safe-area-inset-top)) 12px max(30px, env(safe-area-inset-bottom)) 12px;
  line-height: 1.6;
  transition: background-color 0.3s ease, color 0.3s ease;
  overflow-x: hidden;
  max-width: 100vw;
}

.app-container {
  max-width: 850px;
  margin: 0 auto;
  padding-bottom: 30px;
}

.auth-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: #1B2A4A;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.auth-card {
  background: white;
  border-radius: 20px;
  padding: 35px 25px;
  max-width: 360px;
  width: 100%;
  text-align: center;
  box-shadow: 0 12px 35px rgba(27,42,74,0.2);
}
.auth-title { font-size: 19px; font-weight: 800; color: #1B2A4A; margin-bottom: 8px; }
.auth-input { width: 100%; padding: 12px; border: 2px solid #E8E5DA; border-radius: 10px; font-size: 18px; box-sizing: border-box; margin-bottom: 12px; text-align: center; letter-spacing: 3px; outline: none; font-family: inherit; }
.auth-input:focus { border-color: var(--accent-blue); }
.auth-btn { width: 100%; padding: 12px; background-color: #1B2A4A; color: white; border: none; border-radius: 10px; font-size: 15px; font-weight: 700; cursor: pointer; font-family: inherit; }
.auth-error { color: #f44336; font-size: 13px; font-weight: bold; margin-top: 10px; display: none; }

/* Header 結構 */
.app-header {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
  background: linear-gradient(135deg, rgba(27, 42, 74, 0.55) 0%, rgba(27, 42, 74, 0.3) 100%), url('../sakura.jpg') no-repeat !important;
  background-position: center 22% !important;
  background-size: 100% auto !important;
  border: 1px solid rgba(255, 255, 255, 0.25) !important;
  padding: 12px 14px;
  border-radius: 16px;
  color: white;
  box-shadow: 0 4px 15px rgba(27, 42, 74, 0.15);
  position: relative;
  overflow: hidden;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6) !important;
}

.header-main-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  z-index: 1;
  flex-wrap: wrap;
}

.app-title {
  font-size: 16px;
  font-weight: 800;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.banner-group {
  display: flex;
  gap: 5px;
  align-items: center;
  flex-wrap: wrap;
  margin-left: auto;
  max-width: 100%;
}

.travel-banner {
  font-size: 11px;
  font-weight: 700;
  background-color: rgba(255, 255, 255, 0.18);
  color: #FFFDE7;
  padding: 3px 8px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  backdrop-filter: blur(4px);
  max-width: 100%;
  box-sizing: border-box;
  border: 1px solid rgba(255, 255, 255, 0.22) !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08) !important;
}

.weather-banner {
  background-color: rgba(255, 255, 255, 0.25);
  color: #FFFFFF;
}

.header-btns {
  display: flex;
  gap: 5px;
  z-index: 1;
  width: 100%;
  justify-content: space-between;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 2px;
}
.header-btns::-webkit-scrollbar { display: none; }

@media (min-width: 600px) {
  .header-btns {
    justify-content: flex-end;
    gap: 8px;
  }
}

.hdr-btn {
  background-color: rgba(255, 255, 255, 0.18);
  color: #FFFFFF;
  border: 1px solid rgba(255, 255, 255, 0.25);
  padding: 5px 10px;
  border-radius: 10px;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.hdr-btn.accent-btn {
  background-color: #EEDFA3;
  color: #3E3214;
  border: none;
}

.hdr-btn.mode-btn {
  background-color: #81C784;
  color: #1B331E;
  border: none;
}

.search-box-wrapper {
  margin-bottom: 12px;
}
.search-bar-input {
  width: 100%;
  padding: 9px 14px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  font-size: 13.5px;
  font-family: inherit;
  box-sizing: border-box;
  background-color: var(--card-bg);
  color: var(--text-main);
  outline: none;
  box-shadow: 0 2px 6px rgba(0,0,0,0.02);
  transition: border-color 0.2s ease;
}
.search-bar-input:focus {
  border-color: var(--accent-blue);
}

.collapsible-header { cursor: pointer; user-select: none; }

.flight-card, .hotel-card {
  background: var(--card-bg);
  border-radius: 14px;
  padding: 14px 16px;
  box-shadow: 0 2px 8px rgba(27, 42, 74, 0.03);
  margin-bottom: 12px;
  border: 1px solid var(--border-color);
  transition: background-color 0.3s ease;
}

.flight-card-title, .hotel-card-title { font-size: 15px; font-weight: 700; color: var(--primary-navy); display: flex; align-items: center; justify-content: space-between; }

.collapsible-body {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.3s ease-out, opacity 0.25s ease-out;
  opacity: 0;
}
.collapsible-body.open {
  grid-template-rows: 1fr;
  opacity: 1;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--border-color);
}
.collapsible-inner { overflow: hidden; }

.flight-grid, .hotel-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 600px) { .flight-grid, .hotel-grid { grid-template-columns: 1fr 1fr; } }

.flight-item, .hotel-item { background-color: #FBF9F5; padding: 10px 12px; border-radius: 10px; font-size: 12.5px; }
.flight-item.outbound { border-left: 4px solid var(--accent-blue); }
.flight-item.inbound { border-left: 4px solid var(--pink-badge); }
.hotel-item { border-left: 4px solid var(--macha-green); }
.hotel-item.hakata { border-left: 4px solid var(--primary-navy); }
.flight-route, .hotel-name { font-weight: 700; color: var(--primary-navy); margin-bottom: 4px; font-size: 13.5px; }
.map-link { color: var(--accent-blue); text-decoration: underline; font-weight: 600; display: inline-flex; align-items: center; gap: 2px; }

.tab-nav-wrapper {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 99;
}
.tab-nav-wrapper::after {
  content: "";
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: 28px;
  background: linear-gradient(to right, rgba(246, 244, 238, 0), var(--bg-gray));
  pointer-events: none;
  z-index: 100;
}
body.dark-mode .tab-nav-wrapper::after {
  background: linear-gradient(to right, rgba(13, 21, 39, 0), var(--bg-gray));
}

.tab-nav {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 10px 0;
  margin-bottom: 20px;
  -webkit-overflow-scrolling: touch;
  background-color: rgba(246, 244, 238, 0.82) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(232, 229, 218, 0.6) !important;
  transition: background-color 0.3s ease;
}
.tab-nav::-webkit-scrollbar { display: none; }
.tab-btn { background: var(--card-bg); border: 1px solid var(--border-color); color: var(--text-main); padding: 8px 15px; border-radius: 20px; font-size: 13px; font-weight: 700; cursor: pointer; white-space: nowrap; transition: all 0.2s ease; flex-shrink: 0; font-family: inherit; }
.tab-btn.active { background: #1B2A4A; color: #FFFFFF; border-color: #1B2A4A; box-shadow: 0 3px 8px rgba(27,42,74,0.22); }
.tab-btn.tab-past { background-color: #E8E5DA !important; color: #9E998A !important; border-color: #DDD8C9 !important; box-shadow: none !important; }
.tab-btn.tab-past.active { background-color: #7D786A !important; color: #FFFFFF !important; border-color: #6E695C !important; }

.day-content { display: none; }
.day-content.active { display: block; animation: fadeIn 0.25s ease-in-out; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

.day-card { background: var(--card-bg); border-radius: 16px; padding: 22px; box-shadow: 0 2px 8px rgba(27, 42, 74, 0.03); border: 1px solid var(--border-color); margin-bottom: 20px; transition: background-color 0.3s ease; }
.day-card-header { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; border-bottom: 1px solid var(--border-color); padding-bottom: 12px; margin-bottom: 15px; }
.day-card-title { font-size: 17px; font-weight: 700; color: var(--primary-navy); display: flex; align-items: center; gap: 6px; }
.badge-hotel { background-color: var(--primary-navy); color: #FFFFFF; font-size: 11px; padding: 4px 10px; border-radius: 12px; font-weight: 500; display: inline-flex; align-items: center; gap: 4px; }

.day-route-banner {
  display: flex;
  align-items: center;
  gap: 6px 4px;
  flex-wrap: wrap;
  background: var(--tip-bg);
  border: 1px dashed var(--tip-border);
  padding: 8px 12px;
  border-radius: 10px;
  margin-bottom: 20px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer !important;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
  position: relative;
}
.day-route-banner:hover {
  border-color: var(--accent-blue) !important;
  box-shadow: 0 4px 12px rgba(58, 124, 165, 0.18) !important;
  background: rgba(232, 229, 218, 0.65) !important;
}
.day-route-banner:active { transform: scale(0.98) !important; }

.route-chip {
  background: var(--card-bg) !important;
  border: 1.5px solid var(--primary-navy) !important;
  color: var(--primary-navy) !important;
  font-weight: 800 !important;
  padding: 3px 10px !important;
  border-radius: 8px !important;
  box-shadow: 0 2px 4px rgba(27, 42, 74, 0.05) !important;
}
.route-arrow { color: var(--accent-blue) !important; font-weight: 900 !important; }
.route-map-badge {
  margin-left: auto;
  background: var(--accent-blue);
  color: #FFFFFF;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 10px;
  white-space: nowrap;
  flex-shrink: 0;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
}

.timeline-item {
  display: flex;
  gap: 12px;
  margin-bottom: 32px;
  position: relative;
  padding-left: 14px;
}
.timeline-item::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 10px;
  bottom: -32px;
  width: 2px;
  background: var(--border-color);
}
.timeline-item:last-child { margin-bottom: 0; }
.timeline-item:last-child::before { display: none; }
.timeline-item::after {
  content: "";
  position: absolute;
  left: -1px;
  top: 7px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent-blue);
  border: 2px solid var(--card-bg);
}

@keyframes redPulse {
  0% { box-shadow: 0 0 0 0 rgba(192, 57, 43, 0.6); }
  70% { box-shadow: 0 0 0 8px rgba(192, 57, 43, 0); }
  100% { box-shadow: 0 0 0 0 rgba(192, 57, 43, 0); }
}

.timeline-item.active-item::after {
  animation: redPulse 2s infinite !important;
  background: #C0392B !important;
  border: 2px solid #FFFFFF !important;
}

.timeline-connector-icon {
  position: absolute;
  left: 22px;                       
  top: calc(50% + 25px);           
  transform: translate(-50%, -50%);
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  line-height: 1;
  z-index: 2;
  pointer-events: none;
  user-select: none;
}

.timeline-time { font-size: 14px; font-weight: 700; color: var(--primary-navy); width: 50px; flex-shrink: 0; padding-top: 1px; }
.timeline-body { flex: 1; }
.timeline-title { font-size: 15px; font-weight: 700; margin-bottom: 6px; color: var(--text-main); display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }

.transit-badge { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 4px; color: #FFFFFF; line-height: 1.2; vertical-align: middle; white-space: nowrap; }
.tb-shinkansen { background-color: #0072CE; }
.tb-express { background-color: #D32F2F; }
.tb-jr { background-color: #2E7D32; }
.tb-subway-k { background-color: #E65100; }
.tb-subway-n { background-color: #00897B; }
.tb-tram { background-color: #1976D2; }
.tb-nishitetsu { background-color: #7B1FA2; }
.tb-bus { background-color: #616161; }
.tb-ropeway { background-color: #8D6E63; }

.nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
  background-color: #E3F2FD;
  color: #1976D2;
  text-decoration: none;
  margin-left: 4px;
}

.options-grid { display: grid; grid-template-columns: 1fr; gap: 10px; margin-top: 8px; }
@media (min-width: 600px) { .options-grid { grid-template-columns: 1fr 1fr; } }

.option-box {
  position: relative;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 12px;
  line-height: 1.5;
  border: 1px solid var(--border-color);
  transition: all 0.25s ease;
}
.option-box.opt-dimmed {
  opacity: 0.38;
  filter: grayscale(85%);
  background-color: #E8E5DA !important;
  border-color: #D6D2C4 !important;
}
body.dark-mode .option-box.opt-dimmed {
  background-color: #233554 !important;
  border-color: #1E2D4A !important;
}
.option-box.opt-dimmed .option-title {
  text-decoration: line-through;
  color: var(--text-muted) !important;
}
.option-box.opt-selected {
  border-width: 2px !important;
  border-color: var(--accent-blue) !important;
  box-shadow: 0 3px 10px rgba(58, 124, 165, 0.15);
}
.option-box.opt-selected::after {
  content: "選択中";
  position: absolute;
  bottom: 6px;
  right: 10px;
  font-size: 10px;
  font-weight: 900;
  color: var(--accent-blue);
  background: rgba(58, 124, 165, 0.12);
  padding: 1px 6px;
  border-radius: 4px;
  letter-spacing: 0.5px;
  pointer-events: none;
}
.opt-check-label {
  position: absolute;
  top: 8px;
  right: 10px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(0, 0, 0, 0.08);
  padding: 2px 7px;
  border-radius: 12px;
  color: var(--text-muted);
  user-select: none;
  transition: all 0.2s ease;
}
body.dark-mode .opt-check-label {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.15);
  color: var(--text-muted);
}
.opt-check-label:hover { background: rgba(0, 0, 0, 0.1); }
.opt-checkbox {
  width: 12px !important;
  height: 12px !important;
  margin: 0 !important;
  cursor: pointer;
  accent-color: var(--primary-navy);
}
.option-box.opt-selected .opt-check-label {
  background: var(--accent-blue);
  color: #ffffff;
  border-color: var(--accent-blue);
}

.option-box.opt-a { background-color: #F4FBF7; border-color: #C8E6C9; }
.option-box.opt-b { background-color: #F0F4F8; border-color: #BBDEFB; }
body.dark-mode .option-box.opt-a { background-color: #193322; border-color: #2E5B3D; }
body.dark-mode .option-box.opt-b { background-color: #1A2D4A; border-color: #2D4C73; }

.option-title {
  font-weight: 700;
  margin-bottom: 3px;
  padding-right: 55px;
}
.opt-a .option-title { color: #2E7D32; }
.opt-b .option-title { color: #1565C0; }
body.dark-mode .opt-a .option-title { color: #81C784; }
body.dark-mode .opt-b .option-title { color: #64B5F6; }

.driver-tip {
  position: relative !important;
  background-color: var(--tip-bg) !important;
  border: 1px dashed var(--tip-border) !important;
  border-left: 1px dashed var(--tip-border) !important;
  padding: 12px 14px !important;
  border-radius: 12px !important;
  font-size: 12.5px !important;
  color: var(--text-main) !important;
  margin-top: 10px !important;
}

.driver-tip::before {
  content: "POINT";
  position: absolute;
  top: -9px;
  left: 14px;
  background: var(--tip-accent);
  color: #FFFFFF;
  font-size: 9px;
  font-weight: 900;
  padding: 1px 7px;
  border-radius: 4px;
  letter-spacing: 1px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

body.dark-mode .rain-tip-banner {
  background-color: #1A2D4A !important;
  border-color: #2D4C73 !important;
  color: #90CAF9 !important;
}

.status-tag { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 6px; border-radius: 4px; margin-bottom: 4px; }

.status-confirmed {
  position: relative !important;
  background-color: #FFF5F5 !important;
  color: #C0392B !important;
  border: 1px solid #F5C6CB !important;
  border-radius: 8px !important;
  padding: 4px 10px 4px 26px !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  display: inline-flex !important;
  align-items: center !important;
  transform: rotate(-1.8deg) !important;
  box-shadow: 0 2px 5px rgba(192, 57, 43, 0.08) !important;
}

.status-confirmed::before {
  content: "済";
  position: absolute !important;
  left: 3px !important;
  top: 50% !important;
  transform: translateY(-50%) rotate(-14deg) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 21px !important;
  height: 21px !important;
  border: 1.8px solid rgba(192, 57, 43, 0.8) !important;
  border-radius: 50% !important;
  color: rgba(192, 57, 43, 0.85) !important;
  font-size: 11px !important;
  font-weight: 900 !important;
  line-height: 1 !important;
  background-color: rgba(255, 255, 255, 0.3) !important;
  mix-blend-mode: multiply !important; 
  opacity: 0.85 !important;
  pointer-events: none !important;
  z-index: 2;
}

.status-pending {
  background-color: #FFF3E0;
  color: #EF6C00;
  border: 1px solid #FFE0B2;
  animation: amberPulse 2s infinite;
}
.status-now {
  background-color: #FDEDEC;
  color: #C0392B;
  border: 1px solid #F5B7B1;
}

.ticket-table { 
  width: 100%; 
  border-collapse: collapse; 
  font-size: 11.5px;
  margin-top: 10px; 
}
.ticket-table th, .ticket-table td { 
  border: 1px solid var(--border-color); 
  padding: 6px 3px;
  text-align: center; 
  vertical-align: middle;
}
.ticket-table th { 
  background-color: var(--primary-navy); 
  color: white; 
  font-weight: 700; 
}

.ticket-table th:nth-child(1), .ticket-table td:nth-child(1) { white-space: nowrap; }
.ticket-table th:nth-child(2), .ticket-table td:nth-child(2) { line-height: 1.2; padding: 4px 2px; }
.ticket-table th:nth-child(3), .ticket-table td:nth-child(3) { white-space: nowrap; font-weight: 700; }
.ticket-table th:nth-child(4), .ticket-table td:nth-child(4) { text-align: left; word-break: break-word; }

.seat-col { display: none; }
.seat-col.show { display: table-cell; }

.seat-input {
  width: 75px;
  padding: 4px 6px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 11.5px;
  font-family: inherit;
  background: var(--card-bg);
  color: var(--text-main);
}

.date-input {
  padding: 6px 8px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 12.5px;
  font-family: inherit;
  background: var(--card-bg);
  color: var(--text-main);
}

.checklist-section { margin-bottom: 20px; }
.checklist-section h3 { font-size: 15px; color: var(--primary-navy); border-bottom: 2px solid var(--macha-green); padding-bottom: 5px; margin-bottom: 10px; }
.check-item { display: flex; align-items: center; padding: 8px 0; border-bottom: 1px dashed var(--border-color); font-size: 14px; }
.check-item input[type="checkbox"] { width: 18px; height: 18px; margin-right: 12px; accent-color: var(--primary-navy); cursor: pointer; }
.check-item label { cursor: pointer; flex: 1; display: flex; justify-content: space-between; align-items: center; }
.check-item input[type="checkbox"]:checked + label { text-decoration: line-through; color: var(--text-muted); }

.location-tag { font-size: 11px; padding: 2px 6px; border-radius: 4px; background-color: #E3F2FD; color: #1976D2; font-weight: 600; }
.location-tag.carry { background-color: #FCE4EC; color: #C2185B; }
.reset-btn { background-color: #f44336; color: white; border: none; padding: 10px 15px; border-radius: 10px; font-size: 13px; font-weight: bold; cursor: pointer; margin-top: 15px; width: 100%; font-family: inherit; }

.converter-card { background: var(--tip-bg); border: 1px solid var(--border-color); border-radius: 18px !important; padding: 15px; margin-bottom: 20px; box-shadow: 0 4px 16px rgba(27, 42, 74, 0.04) !important; }
.converter-title { font-size: 15px; font-weight: 700; color: var(--primary-navy); margin-bottom: 10px; }
.calc-input { padding: 8px 12px; border-radius: 8px; border: 1px solid var(--border-color); font-size: 15px; width: 100px; font-weight: 600; font-family: inherit; }
.calc-result { font-size: 18px; font-weight: 800; color: var(--hanko-red); margin-left: auto; }
.quick-yen-btns { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.q-btn { background: var(--card-bg); border: 1px solid var(--border-color); color: var(--accent-blue); padding: 5px 12px; border-radius: 16px; font-size: 12px; font-weight: 700; cursor: pointer; font-family: inherit; }

.expense-list { margin-top: 12px; }
.expense-item { display: flex; justify-content: space-between; align-items: center; padding: 8px 10px; border-bottom: 1px dashed var(--border-color); font-size: 13px; background: var(--card-bg); border-radius: 6px; margin-bottom: 6px; }
.expense-total-box { margin-top: 12px; padding-top: 10px; border-top: 2px solid var(--primary-navy); font-weight: 800; display: flex; justify-content: space-between; font-size: 14.5px; color: var(--hanko-red); flex-wrap: wrap; gap: 6px; }

.jp-phrase-item { background: #FBF9F5; border-left: 4px solid var(--accent-blue); border-radius: 8px; padding: 10px 12px; margin-bottom: 10px; }
.jp-header-row { display: flex; justify-content: space-between; align-items: center; }
.jp-hk { font-weight: 700; font-size: 13.5px; color: var(--primary-navy); }
.jp-btn-group { display: flex; gap: 4px; }
.jp-speak-btn { background: #E3F2FD; color: #1976D2; border: none; padding: 4px 10px; border-radius: 12px; font-size: 12px; font-weight: 700; cursor: pointer; font-family: inherit; }
.jp-big { font-size: 22px; font-weight: 800; color: var(--text-main); margin: 4px 0; letter-spacing: 0.5px; }
.jp-romaji { font-size: 12px; color: var(--text-muted); font-style: italic; }

.modal-overlay { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(27,42,74,0.75); z-index: 9999; padding: 20px; align-items: center; justify-content: center; }
.modal-content { background: var(--card-bg); border-radius: 16px; max-width: 500px; width: 100%; padding: 20px; box-shadow: 0 12px 30px rgba(0,0,0,0.3); max-height: 90vh; overflow-y: auto; }
.modal-header { display: flex; justify-content: space-between; align-items: center; border-bottom: 2px solid var(--primary-navy); padding-bottom: 10px; margin-bottom: 15px; }
.modal-title { font-size: 18px; font-weight: 800; color: var(--primary-navy); }
.modal-close { background: none; border: none; font-size: 24px; font-weight: 700; cursor: pointer; color: #888; }
.taxi-card-box { background: #1B2A4A; color: #FFF; padding: 18px; border-radius: 12px; margin-bottom: 15px; }
.taxi-card-big { font-size: 25px; font-weight: 800; line-height: 1.4; color: #FFEB3B; letter-spacing: 0.5px; }
.copy-btn { background: var(--accent-blue); color: white; border: none; padding: 8px 14px; border-radius: 8px; font-weight: 700; font-size: 13px; cursor: pointer; margin-top: 8px; display: inline-block; font-family: inherit; }

@media print {
  .auth-overlay, .app-header, .tab-nav-wrapper, .header-btns, .q-btn, .reset-btn, .nav-btn, .jp-speak-btn, .copy-btn, .search-box-wrapper, .floating-memo-btn { display: none !important; }
  .collapsible-body { grid-template-rows: 1fr !important; opacity: 1 !important; display: block !important; }
  .day-content { display: block !important; page-break-after: always; }
  body { background: white !important; color: black !important; background-image: none !important; padding: 0 !important; }
  .day-card, .flight-card, .hotel-card, .converter-card { box-shadow: none !important; border: 1px solid #ccc !important; }
}

.form-grid-2x2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  align-items: center;
  width: 100%;
  box-sizing: border-box;
}
.form-grid-2x2 .full-width { grid-column: span 2; }

.calc-input, .date-input, select.calc-input {
  width: 100% !important;
  box-sizing: border-box;
  height: 38px !important;
  font-size: 13.5px;
}

.grid-btn {
  width: 100%;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  border-radius: 8px;
  box-sizing: border-box;
}

input[type="date"],
select.calc-input,
.calc-input,
.date-input {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  height: 38px !important;
  min-height: 38px !important;
  max-height: 38px !important;
  line-height: 38px !important;
  padding: 0 8px !important;
  font-size: 13px !important;
  border: 1px solid var(--border-color) !important;
  border-radius: 8px !important;
  box-sizing: border-box !important;
  background-color: var(--card-bg);
  color: var(--text-main);
  margin: 0 !important;
  width: 100% !important;
}

.tab-btn:active, .hdr-btn:active, .q-btn:active, .auth-btn:active {
  transform: scale(0.95) !important;
  transition: transform 0.1s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.pwa-banner {
  background: #EEDFA3;
  color: #3E3214;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.phrase-card {
  background: var(--card-bg);
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 12px;
  border: 1px solid var(--border-color);
  box-shadow: 0 2px 8px rgba(27, 42, 74, 0.03);
}

.phrase-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  user-select: none;
  font-size: 15px;
  font-weight: 700;
  color: var(--primary-navy);
}

@media (min-width: 900px) {
  .app-container { max-width: 1180px; }
  .top-cards-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }
  .top-cards-group .top-info-card:last-child { grid-column: span 2; }
  .tab-nav { justify-content: center; flex-wrap: nowrap; overflow-x: auto; }
  .tab-btn { padding: 8px 10px; font-size: 12.5px; }
  #checklistContainer { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
  .jp-tab-dashboard { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
  .jp-tab-dashboard .full-width-section { grid-column: span 2; }
}

.ticket-table tbody tr { transition: background-color 0.15s ease; }
.ticket-table tbody tr:active { background-color: var(--tip-bg) !important; }

/* 📝 右下角隨畫面飄浮備忘錄 */
.floating-memo-btn {
  position: fixed;
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  right: 20px;
  background: var(--primary-navy);
  color: #FFFFFF;
  border: 2px solid rgba(255, 255, 255, 0.25);
  padding: 10px 16px;
  border-radius: 30px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(27, 42, 74, 0.35);
  z-index: 9998;
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: inherit;
  transition: transform 0.15s ease, background-color 0.2s ease;
}
.floating-memo-btn:active { transform: scale(0.92); }

.memo-badge {
  width: 8px;
  height: 8px;
  background-color: #E74C3C;
  border-radius: 50%;
  display: none;
  box-shadow: 0 0 0 2px #FFFFFF;
}
.memo-badge.has-content { display: inline-block; }

.memo-popup-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(27, 42, 74, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 9999;
  padding: 20px;
  align-items: flex-end;
  justify-content: flex-end;
}

@media (min-width: 600px) {
  .memo-popup-overlay { align-items: center; justify-content: center; }
}

.memo-popup-card {
  background: var(--card-bg);
  border-radius: 20px;
  padding: 18px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
  border: 1px solid var(--border-color);
  animation: memoUp 0.2s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

@keyframes memoUp {
  from { opacity: 0; transform: translateY(20px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* 🏷️ 優惠券 3 欄縮圖相簿 */
.qr-thumb-card {
  position: relative;
  background: var(--tip-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-sizing: border-box;
}

.qr-thumb-img-wrapper {
  width: 100%;
  height: 85px;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  background: #E8E5DA;
  display: flex;
  align-items: center;
  justify-content: center;
}

.qr-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* 🖼️ 放大彈窗 (iPhone 螢幕完美適應，防止超出關閉唔到) */
#imageModal .modal-content {
  max-width: 92vw !important;
  max-height: 82vh !important;
  padding: 12px !important;
  text-align: center;
  border-radius: 18px !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: space-between !important;
  box-sizing: border-box !important;
}

#imageModalImg {
  width: auto !important;
  max-width: 100% !important;
  max-height: 65vh !important;
  object-fit: contain !important;
  border-radius: 10px;
  margin: 8px 0;
  display: block;
}

/* VJW 貼紙樣式 */
.vjw-item-box {
  background: var(--tip-bg);
  border: 1px solid var(--border-color);
  padding: 10px 12px;
  border-radius: 10px;
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.vjw-label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 700;
}
.vjw-value {
  font-size: 14px;
  font-weight: 800;
  color: var(--primary-navy);
  word-break: break-all;
}

/* 🌌 Cyber 流光霓虹邊框 (📍進行中行程專用) */
@keyframes cyberGlow {
  0% {
    border-color: var(--accent-blue);
    box-shadow: 0 0 8px rgba(58, 124, 165, 0.3), inset 0 0 8px rgba(58, 124, 165, 0.1);
  }
  50% {
    border-color: #64B5F6;
    box-shadow: 0 0 16px rgba(100, 181, 246, 0.75), inset 0 0 12px rgba(100, 181, 246, 0.2);
  }
  100% {
    border-color: var(--accent-blue);
    box-shadow: 0 0 8px rgba(58, 124, 165, 0.3), inset 0 0 8px rgba(58, 124, 165, 0.1);
  }
}

.timeline-item.active-item .timeline-body {
  border: 1.5px solid var(--accent-blue) !important;
  animation: cyberGlow 2.5s infinite ease-in-out !important;
  border-radius: 12px !important;
  padding: 10px 12px !important;
  background: rgba(58, 124, 165, 0.04) !important;
}

/* 🎫 車票表格手機/桌面響應式最佳化 */
.ticket-table {
  width: 100%;
  table-layout: fixed; /* 鎖死欄位比例，防止任何欄位被擠壓成單字 */
  border-collapse: collapse;
}

.ticket-table th, 
.ticket-table td {
  padding: 6px 3px;
  font-size: 11px;
  vertical-align: middle;
  text-align: center;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* 📱 手機版欄寬劃分 (總共 100%) */
.ticket-table th:nth-child(1), .ticket-table td.td-date { width: 17%; }
.ticket-table th:nth-child(2), .ticket-table td.td-time { width: 23%; }
.ticket-table th:nth-child(3), .ticket-table td.td-route { width: 32%; }
.ticket-table th:nth-child(4), .ticket-table td.td-type { width: 28%; text-align: left; }

.ticket-table .tbl-part {
  display: inline-block;
  white-space: nowrap;
}

/* 💻 桌面版 (螢幕 >= 768px)：隱藏換行，恢復單行展示 */
@media (min-width: 768px) {
  .ticket-table {
    table-layout: auto;
  }
  .hide-on-desktop {
    display: none !important;
  }
  .ticket-table th:nth-child(1), .ticket-table td.td-date { width: auto; }
  .ticket-table th:nth-child(2), .ticket-table td.td-time { width: auto; }
  .ticket-table th:nth-child(3), .ticket-table td.td-route { width: auto; }
  .ticket-table th:nth-child(4), .ticket-table td.td-type { width: auto; }
}

/* ☰ 側邊欄 Drawer 樣式 */
.sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 9998;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.sidebar-overlay.active {
  opacity: 1;
  visibility: visible;
}

.sidebar-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 280px;
  max-width: 80vw;
  height: 100vh;
  background: var(--card-bg, #ffffff);
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
  z-index: 9999;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

.sidebar-drawer.active {
  transform: translateX(0);
}

.sidebar-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color, #eee);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sidebar-title {
  font-weight: 800;
  font-size: 15px;
  color: var(--text-color, #333);
}

.sidebar-close-btn {
  background: none;
  border: none;
  font-size: 18px;
  font-weight: bold;
  color: var(--text-muted, #888);
  cursor: pointer;
  padding: 4px 8px;
}

.sidebar-body {
  padding: 16px 20px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.sidebar-group-title {
  font-size: 11px;
  font-weight: 800;
  color: var(--text-muted, #888);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.sidebar-select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border-color, #ccc);
  background: var(--bg-color, #f9f9f9);
  color: var(--text-color, #333);
  font-size: 13px;
  font-weight: 600;
  outline: none;
}

.sidebar-btn {
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  margin-bottom: 6px;
  border-radius: 10px;
  border: 1px solid var(--border-color, #eee);
  background: var(--bg-color, #f5f5f5);
  color: var(--text-color, #333);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.sidebar-btn:active {
  opacity: 0.8;
}

.sidebar-btn.danger-text {
  color: #d32f2f;
  background: #ffebee;
  border-color: #ffcdd2;
}