/* ============================================================
   Tabidori - Stylesheet
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary: #0D7377;
  --primary-dark: #0A5C60;
  --primary-light: #EBF5F5;
  --primary-border: rgba(13,115,119,0.28);
  --secondary: #059669;
  --premium-color: #C27A10;
  --premium-bg: #FEF8ED;

  --status-planning: #0D7377; --status-planning-bg: #EBF5F5;
  --status-ongoing: #059669;  --status-ongoing-bg: #ECFDF5;
  --status-memory: #7C3AED;   --status-memory-bg: #F5F3FF;

  --bg: #F9F7F4;
  --surface: #FFFFFF;
  --surface-2: #F5F2EE;
  --surface-hover: #EEEBE6;
  --border: #E5E0D8;
  --text: #1C1917;
  --text-2: #44403C;
  --text-muted: #78716C;
  --red: #EF4444;  --red-bg: #FEF2F2;

  --shadow-xs: 0 1px 2px rgba(28,25,23,0.06);
  --shadow-sm: 0 1px 3px rgba(28,25,23,0.08), 0 1px 2px rgba(28,25,23,0.05);
  --shadow: 0 4px 8px rgba(28,25,23,0.08);
  --shadow-lg: 0 10px 25px rgba(28,25,23,0.10);
  --shadow-xl: 0 20px 40px rgba(28,25,23,0.12);

  --r-sm: 6px; --r: 10px; --r-lg: 16px; --r-full: 9999px;
  --trans: 0.18s ease;
}

html { scroll-behavior: smooth; }
body {
  font-family: 'Noto Sans JP', -apple-system, sans-serif;
  background: var(--bg); color: var(--text); line-height: 1.6; font-size: 14px;
  -webkit-font-smoothing: antialiased;
}
a { text-decoration: none; color: inherit; }
button { font-family: inherit; }
input, textarea, select { font-family: inherit; }

::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: var(--r-full); }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: var(--r-sm); border: none;
  cursor: pointer; font-size: 14px; font-weight: 500;
  transition: all var(--trans); white-space: nowrap; user-select: none;
}
.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 1px 3px rgba(37,99,235,0.25); }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(37,99,235,0.3); }
.btn-primary:active { transform: none; }
.btn-outline { background: transparent; color: var(--text-2); border: 1px solid var(--border); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.btn-ghost { background: transparent; color: var(--text-muted); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: #DC2626; }
.btn-premium { background: linear-gradient(135deg, #F59E0B, #D97706); color: #fff; box-shadow: 0 2px 8px rgba(245,158,11,0.3); }
.btn-premium:hover { box-shadow: 0 4px 16px rgba(245,158,11,0.4); transform: translateY(-1px); }
.icon-btn {
  width: 30px; height: 30px; border: none; border-radius: var(--r-sm);
  background: transparent; color: var(--text-muted); cursor: pointer;
  display: flex; align-items: center; justify-content: center; font-size: 13px;
  transition: all var(--trans);
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn.danger:hover { background: var(--red-bg); color: var(--red); }

/* ===== HEADER ===== */
.header {
  position: sticky; top: 0; z-index: 200;
  background: rgba(255,255,255,0.96); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border); box-shadow: var(--shadow-xs);
}
.header-inner {
  max-width: 1280px; margin: 0 auto; padding: 0 24px;
  height: 60px; display: flex; align-items: center; gap: 20px;
}
.logo {
  display: flex; align-items: center; gap: 8px;
  color: var(--text); font-family: 'Cormorant Garamond', serif;
  font-weight: 600; font-size: 20px;
  letter-spacing: 0.01em; flex-shrink: 0; text-decoration: none;
}
.logo i { font-size: 19px; }
.nav { display: flex; align-items: center; gap: 2px; flex: 1; }
.nav-link {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 12px; border-radius: var(--r-sm); color: var(--text-2);
  font-weight: 500; font-size: 13px; transition: all var(--trans);
}
.nav-link:hover { color: var(--text); background: var(--surface-2); }
.nav-link.premium { color: var(--premium-color); }
.nav-link.premium:hover { background: var(--premium-bg); }
.header-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.premium-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: var(--r-full);
  background: linear-gradient(135deg, #F59E0B, #D97706);
  color: #fff; font-size: 11px; font-weight: 700;
}

/* ===== PROFILE TRIGGER ===== */
.profile-trigger {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 10px; border-radius: var(--r-full);
  border: 1.5px solid var(--border); background: var(--surface);
  color: var(--text); font-size: 13px; font-weight: 500; cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.profile-trigger:hover { background: var(--surface-hover); border-color: var(--primary); }
.profile-trigger .fa-user-circle { font-size: 16px; color: var(--primary); }
.pd-caret { font-size: 10px; color: var(--text-muted); }

/* ===== PROFILE DROPDOWN ===== */
.profile-dropdown {
  position: absolute; z-index: 9999;
  width: 300px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 14px;
  box-shadow: 0 8px 32px rgba(0,0,0,.14);
  overflow: hidden;
}
.pd-header {
  display: flex; align-items: center; gap: 12px;
  padding: 16px;
}
.pd-avatar { font-size: 36px; color: var(--primary); }
.pd-username { font-size: 15px; font-weight: 700; color: var(--text); }
.pd-chip {
  display: inline-block; padding: 2px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 700; margin-top: 4px;
}
.pd-chip-free    { background: var(--surface-2); color: var(--text-muted); }
.pd-chip-tier1   { background: #EBF5F5; color: #0D7377; }
.pd-chip-tier2   { background: linear-gradient(135deg,#F59E0B,#D97706); color: #fff; }
.pd-divider { height: 1px; background: var(--border); }
.pd-section { padding: 12px 16px; }
.pd-label { font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 8px; }
.pd-name-row { display: flex; gap: 8px; }
.pd-name-input {
  flex: 1; padding: 7px 10px; border: 1.5px solid var(--border);
  border-radius: 8px; font-size: 13px; color: var(--text); background: var(--bg);
  outline: none;
}
.pd-name-input:focus { border-color: var(--primary); }
.pd-plan-current { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; font-size: 13px; color: var(--text-muted); }
.pd-upgrade { display: flex; flex-direction: column; gap: 8px; }
.pd-plan-btn {
  width: 100%; text-align: left; padding: 10px 12px; border-radius: 10px;
  border: 1.5px solid transparent; cursor: pointer; transition: all 0.15s;
}
.pd-standard { background: #EBF5F5; border-color: rgba(13,115,119,0.35); }
.pd-standard:hover { background: #D6EDED; border-color: #0D7377; }
.pd-premium  { background: linear-gradient(135deg,#FEF3C7,#FDE68A); border-color: #F59E0B; }
.pd-premium:hover  { background: linear-gradient(135deg,#FDE68A,#FCD34D); border-color: #D97706; }
.pd-plan-row { display: flex; justify-content: space-between; align-items: center; }
.pd-plan-name { font-size: 13px; font-weight: 700; color: var(--text); }
.pd-plan-price { font-size: 12px; font-weight: 700; color: var(--primary); }
.pd-premium .pd-plan-price { color: #D97706; }
.pd-plan-desc { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.pd-cancel-banner {
  background: #FEF3C7; border-left: 3px solid #F59E0B;
  padding: 10px 14px; font-size: 12px; color: #92400E; line-height: 1.5;
  display: flex; align-items: flex-start; gap: 8px;
}
.pd-cancel-banner i { color: #F59E0B; margin-top: 2px; flex-shrink: 0; }
.pd-manage-btn {
  width: 100%; margin-top: 10px; padding: 9px 12px; border-radius: 8px;
  border: 1.5px solid var(--border); background: var(--surface);
  color: var(--text-muted); font-size: 12px; font-weight: 600; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  transition: all 0.15s;
}
.pd-manage-btn:hover { border-color: var(--red, #EF4444); color: var(--red, #EF4444); background: #FEF2F2; }
.pd-manage-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.pd-logout-btn {
  width: 100%; padding: 8px; border-radius: 8px; border: none;
  background: none; color: var(--red, #EF4444); font-size: 13px; font-weight: 600;
  cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 6px;
  transition: background 0.15s;
}
.pd-logout-btn:hover { background: #FEF2F2; }

/* アカウント削除ボタン（プロフィールドロップダウン内） */
.pd-danger-section { padding-top: 4px; }
.pd-delete-btn {
  width: 100%; padding: 8px; border-radius: 8px; border: 1px solid #FCA5A5;
  background: none; color: #DC2626; font-size: 12px; font-weight: 500;
  cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 6px;
  transition: background 0.15s;
}
.pd-delete-btn:hover { background: #FEF2F2; }

/* アカウント削除確認モーダル */
.modal-box {
  background: #ffffff; border-radius: var(--r-lg);
  box-shadow: var(--shadow-xl); width: 100%; overflow: hidden;
  animation: modalIn 0.22s ease;
}
.delete-account-modal {
  max-width: 420px; padding: 32px 28px; text-align: center;
}
.delete-account-icon {
  font-size: 40px; color: #EF4444; margin-bottom: 12px;
}
.delete-account-title {
  font-size: 18px; font-weight: 700; color: #111827; margin: 0 0 16px;
}
.delete-account-body {
  text-align: left; font-size: 14px; color: #374151; margin-bottom: 20px;
}
.delete-account-body p { margin: 0 0 10px; line-height: 1.6; }
.delete-account-list {
  margin: 8px 0 12px 20px; padding: 0; line-height: 1.8; color: #6B7280;
}
.delete-account-confirm-label {
  font-weight: 600; color: #374151; margin-top: 14px !important;
}
.delete-account-input {
  width: 100%; padding: 8px 12px; border: 1.5px solid #FCA5A5;
  border-radius: 8px; font-size: 14px; margin-top: 6px; box-sizing: border-box;
  outline: none;
}
.delete-account-input:focus { border-color: #EF4444; }
.delete-account-actions {
  display: flex; gap: 10px; justify-content: center; margin-top: 20px;
}
.btn-danger {
  background: #EF4444; color: #fff; border: none; padding: 9px 20px;
  border-radius: 8px; font-size: 14px; font-weight: 600; cursor: pointer;
  display: flex; align-items: center; gap: 6px; transition: background 0.15s;
}
.btn-danger:hover { background: #DC2626; }
.btn-danger:disabled { opacity: 0.5; cursor: not-allowed; }

/* ===== HERO ===== */
.hero {
  background: linear-gradient(160deg, #0A4A4D 0%, #0D7377 50%, #0F8C89 100%);
  color: #fff; padding: 56px 24px 0; position: relative; overflow: hidden;
}
.hero-bg-orb {
  position: absolute; border-radius: 50%; pointer-events: none;
}
.hero-bg-orb:nth-child(1) {
  width: 420px; height: 420px; top: -120px; right: -80px;
  background: rgba(255,255,255,0.06);
}
.hero-bg-orb:nth-child(2) {
  width: 220px; height: 220px; bottom: 20px; left: -60px;
  background: rgba(255,255,255,0.04);
}
.hero-bg-icons {
  position: absolute; inset: 0; overflow: hidden; pointer-events: none;
}
.hero-bg-icons i {
  position: absolute; color: #fff;
}
.hero-bg-icons i:nth-child(1) { font-size: 110px; opacity: 0.07; top: 8%;  right: 8%; }
.hero-bg-icons i:nth-child(2) { font-size: 56px;  opacity: 0.05; top: 50%; right: 22%; }
.hero-bg-icons i:nth-child(3) { font-size: 40px;  opacity: 0.05; bottom: 30%; left: 12%; }
.hero-inner { max-width: 1280px; margin: 0 auto; position: relative; z-index: 1; padding-bottom: 40px; }
.hero-title { font-size: clamp(22px, 3vw, 32px); font-weight: 700; line-height: 1.35; margin-bottom: 8px; letter-spacing: -0.3px; }
.hero-subtitle { font-size: 15px; opacity: 0.85; }
.hero-wave { position: relative; height: 56px; z-index: 1; }
.hero-wave svg { display: block; width: 100%; height: 100%; }

/* ===== MAIN / CONTAINER ===== */
.main { padding: 28px 0 48px; }
.container { max-width: 1280px; margin: 0 auto; padding: 0 24px; }

/* ===== FILTER BAR ===== */
.filter-bar {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 24px; flex-wrap: wrap;
}
.filter-group { display: flex; gap: 10px; flex: 1; flex-wrap: wrap; }
.filter-input, .filter-select {
  padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--r-sm);
  background: var(--surface); color: var(--text); font-size: 13px;
  outline: none; transition: border-color var(--trans); min-width: 160px;
}
.filter-input:focus, .filter-select:focus {
  border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}
.filter-input::placeholder { color: var(--text-muted); }

/* ===== TRIP GRID ===== */
.trip-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 20px;
}
.trip-card {
  background: var(--surface); border-radius: var(--r-lg);
  border: 1px solid var(--border); overflow: hidden;
  box-shadow: var(--shadow-sm); transition: all 0.25s ease;
  position: relative; cursor: pointer;
}
.trip-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-xl); border-color: transparent; }
.trip-card-banner {
  height: 90px; position: relative; overflow: hidden;
  display: flex; align-items: flex-end; padding: 12px 14px;
}
.trip-card-banner::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0) 30%, rgba(0,0,0,0.45) 100%);
}
.trip-card-icon {
  position: absolute; right: 14px; top: 10px;
  font-size: 40px; opacity: 0.25; color: #fff;
}
.trip-card-body { padding: 14px 14px 10px; }
.trip-card-title {
  font-size: 15px; font-weight: 600; color: var(--text);
  margin-bottom: 4px; cursor: pointer; transition: color var(--trans);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.trip-card-title:hover { color: var(--primary); }
.trip-card-date { font-size: 12px; color: var(--text-muted); display: flex; align-items: center; gap: 4px; margin-bottom: 10px; }
.trip-card-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 14px; border-top: 1px solid var(--border); background: var(--surface-2);
}
.trip-card-actions {
  position: absolute; top: 10px; right: 10px; z-index: 5;
  display: flex; gap: 4px; opacity: 0; transition: opacity var(--trans);
}
.trip-card:hover .trip-card-actions { opacity: 1; }
.trip-card-actions button {
  width: 26px; height: 26px; border-radius: var(--r-sm); border: none;
  cursor: pointer; font-size: 11px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.92); color: var(--text-2);
  transition: all var(--trans);
}
.trip-card-actions .del-btn:hover { background: #FEE2E2; color: var(--red); }

/* ===== STATUS BADGE ===== */
.status-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 8px; border-radius: var(--r-full);
  font-size: 11px; font-weight: 600; white-space: nowrap;
}
.status-badge.planning { background: var(--status-planning-bg); color: var(--status-planning); }
.status-badge.ongoing  { background: var(--status-ongoing-bg);  color: var(--status-ongoing); }
.status-badge.memory   { background: var(--status-memory-bg);   color: var(--status-memory); }
.status-dot { width: 6px; height: 6px; border-radius: 50%; }
.planning .status-dot { background: var(--status-planning); }
.ongoing  .status-dot { background: var(--status-ongoing); }
.memory   .status-dot { background: var(--status-memory); }

/* ===== EMPTY STATE ===== */
.empty-state { text-align: center; padding: 80px 32px; color: var(--text-muted); }
.empty-state i { font-size: 56px; margin-bottom: 16px; opacity: 0.25; display: block; }
.empty-state h3 { font-size: 18px; color: var(--text-2); margin-bottom: 8px; }
.empty-state p { margin-bottom: 20px; font-size: 13px; }

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(15,23,42,0.5);
  backdrop-filter: blur(4px); z-index: 1000;
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.modal {
  background: var(--surface); border-radius: var(--r-lg);
  box-shadow: var(--shadow-xl); width: 100%; max-width: 460px; overflow: hidden;
  animation: modalIn 0.22s ease;
}
@keyframes modalIn { from { opacity: 0; transform: translateY(16px) scale(0.98); } to { opacity: 1; transform: none; } }
.modal-lg { max-width: 600px; }
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px; border-bottom: 1px solid var(--border);
}
.modal-header h2 { font-family: 'Cormorant Garamond', serif; font-size: 18px; font-weight: 600; display: flex; align-items: center; gap: 8px; letter-spacing: 0.01em; }
.modal-close {
  width: 30px; height: 30px; border-radius: var(--r-sm); border: none;
  background: transparent; cursor: pointer; display: flex; align-items: center;
  justify-content: center; color: var(--text-muted); font-size: 14px; transition: all var(--trans);
}
.modal-close:hover { background: var(--surface-2); color: var(--text); }
.modal-body { padding: 22px; max-height: calc(100vh - 200px); overflow-y: auto; }
.modal-footer {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 14px 22px; border-top: 1px solid var(--border); background: var(--surface-2);
}

/* ===== FORM ===== */
.form-group { margin-bottom: 16px; }
.form-group:last-child { margin-bottom: 0; }
.form-label {
  display: block; font-size: 11px; font-weight: 600;
  color: var(--text-2); text-transform: uppercase;
  letter-spacing: 0.5px; margin-bottom: 6px;
}
.form-input, .form-textarea, .form-select {
  width: 100%; padding: 9px 12px; border: 1px solid var(--border);
  border-radius: var(--r-sm); background: var(--surface);
  color: var(--text); font-size: 14px; outline: none; transition: border-color var(--trans);
}
.form-input:focus, .form-textarea:focus, .form-select:focus {
  border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}
.form-textarea { resize: vertical; min-height: 80px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.required { color: var(--red); }

/* Color picker */
.color-picker { display: flex; gap: 8px; flex-wrap: wrap; }
.color-opt {
  width: 28px; height: 28px; border-radius: 50%; cursor: pointer;
  transition: all var(--trans); border: 3px solid transparent; position: relative;
}
.color-opt:hover { transform: scale(1.15); }
.color-opt.active { outline: 2px solid var(--text); outline-offset: 2px; }

/* ===== PREMIUM MODAL ===== */
.premium-features { display: flex; flex-direction: column; gap: 12px; margin-bottom: 18px; }
.premium-feature {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px; border-radius: var(--r); background: var(--surface-2);
}
.premium-feature i { font-size: 20px; color: var(--premium-color); flex-shrink: 0; margin-top: 1px; }
.premium-feature h4 { font-size: 14px; font-weight: 600; margin-bottom: 2px; }
.premium-feature p { font-size: 12px; color: var(--text-2); }
.premium-price-box { text-align: center; padding: 16px; background: linear-gradient(135deg, #FEF3C7, #FDE68A); border-radius: var(--r); }
.premium-price-box .price { font-size: 30px; font-weight: 700; color: #92400E; }
.premium-price-box .period { font-size: 14px; color: #92400E; }

/* ===== TRIP PAGE HEADER ===== */
.trip-header {
  position: sticky; top: 60px; z-index: 150;
  background: var(--surface); border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-xs);
}
.trip-header-inner {
  padding: 0 16px; height: 50px;
  display: flex; align-items: center; gap: 10px;
}
.back-link {
  display: flex; align-items: center; gap: 4px; color: var(--text-muted);
  font-size: 13px; padding: 4px 8px; border-radius: var(--r-sm);
  transition: all var(--trans); flex-shrink: 0;
}
.back-link:hover { color: var(--primary); background: var(--primary-light); }
.trip-title-text {
  font-size: 15px; font-weight: 600; flex: 1;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.trip-header-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.trip-edit-btn {
  width: 26px; height: 26px; border-radius: var(--r-sm); border: 1px solid var(--border);
  background: transparent; cursor: pointer; display: flex; align-items: center;
  justify-content: center; color: var(--text-muted); font-size: 11px;
  transition: all var(--trans); flex-shrink: 0;
}
.trip-edit-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.trip-edit-note { font-size: 12px; color: var(--text-muted); margin-top: 10px; min-height: 18px; }
.packing-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: var(--r-sm);
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text-2); cursor: pointer; font-size: 13px;
  font-weight: 500; transition: all var(--trans); position: relative;
}
.packing-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.packing-count {
  position: absolute; top: -5px; right: -5px;
  min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: var(--r-full); background: var(--red); color: #fff;
  font-size: 9px; font-weight: 700; display: flex; align-items: center; justify-content: center;
}

/* Status selector */
.status-selector { position: relative; }
.status-select-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: var(--r-sm);
  border: 1px solid var(--border); background: var(--surface);
  cursor: pointer; font-size: 13px; font-weight: 500; transition: all var(--trans);
}
.status-select-btn:hover { background: var(--surface-2); }
.status-dropdown {
  position: absolute; top: calc(100% + 4px); right: 0;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r); box-shadow: var(--shadow-lg);
  min-width: 130px; z-index: 200; overflow: hidden; display: none;
}
.status-dropdown.open { display: block; animation: dropDown 0.15s ease; }
@keyframes dropDown { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.status-opt {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px; cursor: pointer; font-size: 13px; transition: background var(--trans);
}
.status-opt:hover { background: var(--surface-2); }
.status-opt.active { background: var(--primary-light); color: var(--primary); }

/* ===== DATE BAR ===== */
.date-bar-wrap {
  background: var(--surface); border-bottom: 2px solid var(--border);
  overflow-x: auto; scrollbar-width: none;
}
.date-bar-wrap::-webkit-scrollbar { display: none; }
.date-bar { display: flex; padding: 0 12px; min-width: max-content; }
.date-tab {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 8px 16px; cursor: pointer; border: none; background: transparent;
  border-bottom: 3px solid transparent; margin-bottom: -2px;
  min-width: 64px; color: var(--text-2); transition: all var(--trans);
  font-family: inherit;
}
.date-tab:hover { color: var(--text); background: var(--surface-2); }
.date-tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.date-tab .d-num { font-size: 17px; font-weight: 700; line-height: 1; }
.date-tab .d-name { font-size: 10px; margin-top: 1px; letter-spacing: 0.3px; }
.date-tab .d-badge {
  font-size: 9px; background: var(--primary-light); color: var(--primary);
  border-radius: var(--r-full); padding: 1px 5px; font-weight: 600; margin-top: 2px;
}

/* ===== TRIP LAYOUT ===== */
.trip-layout { display: flex; flex-direction: column; min-height: calc(100vh - 110px); overflow: visible; }
.trip-main { display: flex; height: 410px; flex-shrink: 0; min-height: 0; overflow: hidden; }

/* ===== ITINERARY PANEL ===== */
.itinerary-panel {
  width: 450px; flex-shrink: 0; display: flex; flex-direction: column;
  background: var(--surface); border-right: 1px solid var(--border); overflow: hidden;
}
.panel-header {
  padding: 10px 14px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  flex-shrink: 0;
}
.panel-header h3 { font-size: 11px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.itinerary-scroll { flex: 1; overflow-y: auto; padding: 8px; }
.itinerary-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px; border-radius: var(--r); cursor: pointer;
  transition: all var(--trans); position: relative;
}
.itinerary-item:hover { background: var(--surface-2); }
.itinerary-item.active { background: var(--primary-light); }
.item-time-col {
  width: 52px; flex-shrink: 0; text-align: center; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  border-radius: 4px; transition: background var(--trans); padding: 2px; gap: 1px;
}
.item-time-col:hover { background: rgba(37,99,235,0.07); }
.time-val {
  font-size: 11px; font-weight: 700; color: var(--text-muted);
  line-height: 1.2; transition: color var(--trans);
}
.item-time-col:hover .time-val { color: var(--primary); }
.time-end-val { font-size: 9px; color: var(--text-muted); opacity: 0.75; white-space: nowrap; }
.item-marker {
  width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0;
  background: var(--border); border: 2px solid var(--surface);
  box-shadow: 0 0 0 2px var(--border);
}
.itinerary-item.active .item-marker,
.itinerary-item:hover .item-marker {
  background: var(--primary); box-shadow: 0 0 0 2px var(--primary);
}
.item-text { flex: 1; min-width: 0; }
.item-title-text { font-size: 13px; font-weight: 500; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item-location-text { font-size: 11px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.item-alarm-icon { font-size: 10px; color: #F59E0B; margin-top: 1px; }
.item-ctrl { display: flex; gap: 2px; opacity: 0; transition: opacity var(--trans); }
.itinerary-item:hover .item-ctrl { opacity: 1; }
.item-ctrl button {
  width: 22px; height: 22px; border-radius: 4px; border: none;
  background: transparent; cursor: pointer; font-size: 11px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); transition: all var(--trans);
}
.item-ctrl button:hover { background: var(--border); }
.item-ctrl .del:hover { background: var(--red-bg); color: var(--red); }

.add-item-btn {
  width: 100%; margin-top: 4px; padding: 9px; border: 2px dashed var(--border);
  border-radius: var(--r); background: transparent; color: var(--text-muted);
  cursor: pointer; font-size: 13px; font-weight: 500;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  transition: all var(--trans);
}
.add-item-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.no-items { padding: 32px 16px; text-align: center; color: var(--text-muted); }
.no-items i { font-size: 28px; opacity: 0.3; margin-bottom: 8px; display: block; }
.no-items p { font-size: 12px; }

/* ===== INLINE EDITING ===== */
.inline-time-editor {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.inline-time-start, .inline-time-end {
  font-size: 10px; padding: 2px 3px; border: 1.5px solid var(--primary);
  border-radius: 3px; outline: none; width: 60px; font-family: inherit;
  background: var(--surface); color: var(--text); cursor: pointer;
}
.inline-time-start:focus, .inline-time-end:focus {
  box-shadow: 0 0 0 2px rgba(37,99,235,0.15);
}
.time-range-sep { font-size: 9px; color: var(--text-muted); line-height: 1; }
.inline-btn {
  width: 16px; height: 16px; border-radius: 3px; border: none;
  cursor: pointer; font-size: 8px;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--trans);
}
.inline-add-end { background: var(--primary-light); color: var(--primary); }
.inline-add-end:hover { background: var(--primary); color: #fff; }
.inline-rm-end { background: transparent; color: var(--text-muted); }
.inline-rm-end:hover { background: var(--red-bg); color: var(--red); }
.inline-title { cursor: text; border-radius: 3px; transition: color var(--trans); }
.inline-title:hover { color: var(--primary); }
.inline-title-input {
  font-size: 13px; font-weight: 500; color: var(--text);
  border: 1.5px solid var(--primary); border-radius: 3px;
  padding: 1px 5px; outline: none; width: 100%; font-family: inherit;
  background: var(--surface); box-shadow: 0 0 0 2px rgba(37,99,235,0.1);
}

/* ===== TIME RANGE IN EDIT PANEL ===== */
.time-range-toggle-btn {
  width: 18px; height: 18px; border-radius: 3px; border: 1px solid var(--border);
  background: transparent; cursor: pointer; font-size: 9px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); transition: all var(--trans); flex-shrink: 0;
}
.time-range-toggle-btn:hover {
  border-color: var(--primary); color: var(--primary); background: var(--primary-light);
}
.time-range-toggle-btn.active {
  border-color: var(--red); color: var(--red); background: var(--red-bg);
}
.time-end-row {
  display: flex; align-items: center; gap: 6px; padding: 4px 12px 8px;
  border-top: 1px dashed var(--border); margin-top: 2px;
}
.time-end-label { font-size: 12px; color: var(--text-muted); flex-shrink: 0; }
.time-end-row input { flex: 1; }

/* ===== EDIT PANEL ===== */
.edit-panel {
  flex: 1; display: flex; flex-direction: column;
  background: var(--surface-2); overflow: hidden;
}
.edit-panel-empty {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  color: var(--text-muted); gap: 12px; padding: 32px;
}
.edit-panel-empty i { font-size: 44px; opacity: 0.2; }
.edit-panel-empty p { font-size: 13px; text-align: center; }
.edit-panel-content { display: flex; flex-direction: column; height: 100%; }
.edit-panel-header {
  padding: 10px 14px; background: var(--surface);
  border-bottom: 1px solid var(--border); display: flex;
  align-items: center; justify-content: space-between; flex-shrink: 0;
}
.edit-panel-header h3 { font-size: 11px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.edit-panel-body { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; }

/* Edit fields */
.edit-field {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r); overflow: visible; transition: border-color var(--trans);
}
.edit-field:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,0.08); }
.edit-field-lbl {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 12px; background: var(--surface-2);
  border-bottom: 1px solid var(--border); font-size: 10px; font-weight: 700;
  color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px;
}
.edit-field-lbl i { color: var(--primary); width: 12px; font-size: 11px; }
.edit-field input, .edit-field textarea, .edit-field select {
  width: 100%; padding: 8px 12px; border: none; outline: none;
  background: transparent; font-family: inherit; font-size: 14px; color: var(--text);
}
.edit-field textarea { resize: vertical; min-height: 72px; }
.edit-field input[type="time"] { cursor: pointer; }

/* Alarm toggle */
.alarm-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 12px;
}
.alarm-row label {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; cursor: pointer; font-weight: 400;
  text-transform: none; letter-spacing: 0; color: var(--text);
}
.toggle-wrap { position: relative; width: 36px; height: 20px; flex-shrink: 0; display: block; cursor: pointer; }
.toggle-wrap input { opacity: 0; width: 0; height: 0; position: absolute; }
.toggle-track {
  position: absolute; inset: 0; background: var(--border);
  border-radius: var(--r-full); cursor: pointer; transition: background var(--trans);
}
.toggle-track::before {
  content: ''; position: absolute; width: 14px; height: 14px;
  border-radius: 50%; background: #fff; left: 3px; top: 3px;
  transition: transform var(--trans); box-shadow: var(--shadow-xs);
}
.toggle-wrap input:checked + .toggle-track { background: var(--primary); }
.toggle-wrap input:checked + .toggle-track::before { transform: translateX(16px); }

/* Packing items in edit panel */
.packing-items-wrap { padding: 8px 12px; display: flex; flex-direction: column; gap: 6px; }
.pack-item-row { display: flex; align-items: center; gap: 6px; }
.pack-item-row input[type="text"] {
  flex: 1; padding: 4px 8px; border: 1px solid var(--border);
  border-radius: 4px; font-size: 12px; font-family: inherit; outline: none;
}
.pack-item-row input[type="text"]:focus { border-color: var(--primary); }
.pack-item-row button {
  width: 20px; height: 20px; border-radius: 4px; border: none;
  background: transparent; cursor: pointer; font-size: 11px;
  color: var(--text-muted); display: flex; align-items: center; justify-content: center;
}
.pack-item-row button:hover { background: var(--red-bg); color: var(--red); }
.add-pack-item-btn {
  display: flex; align-items: center; gap: 5px;
  padding: 4px 12px 8px; background: transparent; border: none; border-top: 1px dashed var(--border);
  color: var(--text-muted); font-size: 12px; cursor: pointer;
  font-family: inherit; transition: color var(--trans); width: 100%; margin-top: 2px;
}
.add-pack-item-btn:hover { color: var(--primary); }

/* Packing input row in edit panel */
.add-pack-input-row {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 10px 8px; border-top: 1px dashed var(--border); margin-top: 2px;
}
.add-pack-input-row input {
  flex: 1; padding: 5px 8px; border: 1px solid var(--border);
  border-radius: var(--r-sm); font-size: 12px; font-family: inherit; outline: none;
  transition: border-color var(--trans);
}
.add-pack-input-row input:focus { border-color: var(--primary); }

/* Location search */
.location-search-wrap { position: relative; }
.location-suggestions {
  position: absolute; top: 100%; left: 0; right: 0; z-index: 100;
  background: var(--surface); border: 1px solid var(--border);
  border-top: none; border-radius: 0 0 var(--r) var(--r);
  box-shadow: var(--shadow-lg); max-height: 180px; overflow-y: auto; display: none;
}
.location-suggestions.open { display: block; }
.loc-suggest-item {
  padding: 8px 12px; cursor: pointer; font-size: 12px; transition: background var(--trans);
  display: flex; align-items: flex-start; gap: 8px;
}
.loc-suggest-item:hover { background: var(--primary-light); }
.loc-suggest-item i { color: var(--primary); flex-shrink: 0; margin-top: 3px; }
.loc-suggest-body { flex: 1; min-width: 0; }
.loc-suggest-name { font-weight: 500; line-height: 1.3; }
.loc-suggest-meta { display: flex; align-items: center; gap: 5px; margin-top: 2px; flex-wrap: wrap; }
.loc-suggest-type-badge {
  font-size: 9px; padding: 1px 5px; border-radius: var(--r-full);
  background: var(--primary-light); color: var(--primary); font-weight: 600; white-space: nowrap;
}
.loc-suggest-addr { font-size: 10px; color: var(--text-muted); }
.loc-addr-display {
  padding: 4px 12px 6px; font-size: 11px; color: var(--text-muted); line-height: 1.4;
}
.loc-addr-display:empty { display: none; }

/* Attachment */
.attach-wrap { padding: 10px 12px; position: relative; }
.attach-lock {
  position: absolute; inset: 0; z-index: 5; margin: 0;
  background: rgba(241,245,249,0.93); backdrop-filter: blur(4px);
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 8px; border-radius: var(--r);
  text-align: center;
}
.attach-lock i { font-size: 26px; color: #f59e0b; }
.attach-lock p { font-size: 12px; color: var(--text-muted); margin: 0; }
.attach-count-badge {
  font-size: 10px; color: var(--text-muted);
  background: var(--surface-2); border-radius: 8px;
  padding: 1px 6px; margin-left: 6px; font-weight: 400;
}
.attach-dropzone {
  border: 2px dashed var(--border); border-radius: var(--r);
  padding: 16px; text-align: center; color: var(--text-muted);
  font-size: 12px; cursor: pointer; transition: all var(--trans);
}
.attach-dropzone:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.attach-dropzone.uploading { opacity: 0.6; pointer-events: none; }
.attach-dropzone i { font-size: 20px; margin-bottom: 4px; display: block; }
.attach-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.attach-item { position: relative; display: inline-flex; }
.attach-thumb {
  width: 64px; height: 64px; object-fit: cover;
  border-radius: var(--r-sm); border: 1px solid var(--border); cursor: pointer;
}
.attach-file {
  display: flex; align-items: center; gap: 4px; padding: 4px 8px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 4px; font-size: 11px; cursor: pointer;
}
.attach-del-btn {
  position: absolute; top: -5px; right: -5px;
  width: 18px; height: 18px; border-radius: 50%;
  background: #ef4444; color: #fff; border: none;
  font-size: 8px; cursor: pointer; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity 0.15s; z-index: 2;
}
.attach-item:hover .attach-del-btn { opacity: 1; }

.edit-panel-footer {
  padding: 10px 14px; border-top: 1px solid var(--border); background: var(--surface);
  display: flex; justify-content: space-between; align-items: center; flex-shrink: 0;
}
.auto-save-hint { font-size: 11px; color: var(--text-muted); display: flex; align-items: center; gap: 4px; }

/* ===== MAP SECTION ===== */
.map-section {
  height: 500px; flex-shrink: 0; position: relative;
  border-top: 2px solid var(--border);
}
#map { width: 100%; height: 100%; }
.map-lock {
  position: absolute; inset: 0; z-index: 10;
  background: rgba(241,245,249,0.92); backdrop-filter: blur(6px);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 14px;
  pointer-events: none;
}
.map-lock-icon {
  width: 60px; height: 60px; border-radius: 50%;
  background: linear-gradient(135deg, #F59E0B, #D97706);
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; color: #fff; box-shadow: 0 4px 16px rgba(245,158,11,0.3);
}
.map-lock h3 { font-size: 15px; font-weight: 700; }
.map-lock p { font-size: 12px; color: var(--text-2); text-align: center; max-width: 260px; }

/* ===== PACKING LIST POPUP ===== */
.packing-overlay {
  position: fixed; inset: 0; z-index: 1100;
  background: rgba(0,0,0,0.25); display: none;
}
.packing-overlay.open { display: block; }
.packing-drawer {
  position: fixed; top: 60px; left: 0; bottom: 0; width: 360px;
  background: var(--surface); box-shadow: var(--shadow-xl);
  z-index: 1001; display: flex; flex-direction: column;
  transform: translateX(-100%); transition: transform 0.3s ease;
}
.packing-overlay.open .packing-drawer { transform: none; }
.packing-drawer-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px; border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.packing-drawer-header h2 { font-size: 16px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.packing-drawer-body { flex: 1; overflow-y: auto; padding: 16px; }
.packing-drawer-footer {
  padding: 10px 16px; border-top: 1px solid var(--border);
  background: var(--surface-2); flex-shrink: 0;
}

/* Preset selector */
.preset-section { margin-bottom: 18px; }
.preset-lbl { font-size: 10px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 8px; }
.preset-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.preset-chip {
  padding: 4px 12px; border-radius: var(--r-full); border: 1px solid var(--border);
  background: var(--surface); color: var(--text-2); cursor: pointer;
  font-size: 12px; font-family: inherit; transition: all var(--trans);
}
.preset-chip:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.preset-chip.active { border-color: var(--primary); background: var(--primary); color: #fff; }
.preset-chip.active:hover { border-color: var(--primary-dark); background: var(--primary-dark); color: #fff; }

/* Preset section header */
.preset-section-header {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px;
}
.preset-section-header .preset-lbl { margin-bottom: 0; }

/* Settings modal */
.settings-section-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 11px; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.6px;
  margin: 16px 0 10px;
}
.setting-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 0; border-bottom: 1px solid var(--border);
}
.setting-row:last-child { border-bottom: none; }
.setting-row label { font-size: 13px; line-height: 1.5; flex: 1; cursor: pointer; }
.setting-row label strong { display: block; font-weight: 600; margin-bottom: 2px; }
.setting-row label span { color: var(--text-muted); font-size: 12px; }
.setting-row .toggle-wrap { flex: none; }

/* Packing items */
.packing-items-list { display: flex; flex-direction: column; gap: 2px; margin-bottom: 16px; }
.pack-list-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: var(--r-sm); transition: background var(--trans);
}
.pack-list-item:hover { background: var(--surface-2); }
.pack-list-item input[type="checkbox"] { width: 15px; height: 15px; cursor: pointer; accent-color: var(--primary); flex-shrink: 0; }
.pack-item-name {
  flex: 1; font-size: 13px; cursor: pointer; transition: all var(--trans);
}
.pack-list-item.checked .pack-item-name { text-decoration: line-through; color: var(--text-muted); }
.from-itin-tag {
  font-size: 9px; padding: 1px 5px; border-radius: 2px;
  background: var(--primary-light); color: var(--primary); font-weight: 600;
  flex-shrink: 0; max-width: 100px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.from-preset-tag {
  font-size: 9px; padding: 1px 5px; border-radius: 2px;
  background: #ECFDF5; color: #059669; font-weight: 600;
  flex-shrink: 0; max-width: 80px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pack-del-btn {
  width: 20px; height: 20px; border-radius: 4px; border: none;
  background: transparent; cursor: pointer; color: var(--text-muted);
  font-size: 11px; display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: all var(--trans);
}
.pack-list-item:hover .pack-del-btn { opacity: 1; }
.pack-del-btn:hover { background: var(--red-bg); color: var(--red); }

.add-packing-row { display: flex; gap: 8px; margin-top: 8px; }
.add-packing-row input {
  flex: 1; padding: 8px 10px; border: 1px solid var(--border);
  border-radius: var(--r-sm); font-size: 13px; font-family: inherit; outline: none;
  transition: border-color var(--trans);
}
.add-packing-row input:focus { border-color: var(--primary); }

/* Settings toggle in packing */
.setting-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 0; border-top: 1px solid var(--border); margin-top: 6px;
}
.setting-row label { font-size: 12px; color: var(--text-2); cursor: pointer; line-height: 1.4; }
.setting-row label strong { display: block; font-weight: 600; font-size: 13px; color: var(--text); }

/* ===== PRESET EDIT MODAL ===== */
.preset-edit-group {
  margin-bottom: 18px; padding-bottom: 16px; border-bottom: 1px solid var(--border);
}
.preset-edit-group:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.preset-edit-group-header {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px;
}
.preset-edit-name { font-weight: 600; font-size: 14px; color: var(--text); }
.preset-edit-items { display: flex; flex-direction: column; gap: 5px; margin-bottom: 6px; }
.preset-edit-item-row { display: flex; align-items: center; gap: 6px; }
.preset-edit-item-row input {
  flex: 1; padding: 5px 8px; border: 1px solid var(--border);
  border-radius: var(--r-sm); font-size: 12px; font-family: inherit; outline: none;
  transition: border-color var(--trans);
}
.preset-edit-item-row input:focus { border-color: var(--primary); }

/* ===== MEMO PANEL ===== */
.memo-toggle-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: var(--r-sm);
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text-2); cursor: pointer; transition: all var(--trans);
  font-size: 13px; font-weight: 500; font-family: inherit; flex-shrink: 0;
}
.memo-toggle-btn:hover { background: var(--primary-light); border-color: var(--primary); color: var(--primary); }
.memo-toggle-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }

.memo-overlay {
  position: fixed; inset: 0; z-index: 1050;
  pointer-events: none;
}
.memo-overlay.open { pointer-events: auto; }
.memo-overlay.open::before {
  content: ''; position: fixed; inset: 0;
  background: rgba(0,0,0,0.2);
}
.memo-drawer {
  position: fixed; top: 60px; right: 0; bottom: 0; width: 380px;
  background: var(--surface); box-shadow: -4px 0 24px rgba(0,0,0,0.12);
  z-index: 1051; display: flex; flex-direction: column;
  transform: translateX(100%); transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
}
.memo-overlay.open .memo-drawer { transform: none; }
.memo-drawer-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px; border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.memo-drawer-header h2 { font-size: 16px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.memo-drawer-body { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.memo-hint {
  font-size: 12px; color: var(--text-muted); background: var(--surface-2);
  border-radius: var(--r-sm); padding: 8px 12px; line-height: 1.6; margin: 0;
}
.memo-drawer-body textarea {
  flex: 1; width: 100%; min-height: 400px; padding: 12px;
  border: 1px solid var(--border); border-radius: var(--r);
  font-family: 'Noto Sans JP', sans-serif; font-size: 13px;
  line-height: 1.7; resize: vertical; outline: none;
  background: var(--bg); color: var(--text);
  transition: border-color var(--trans);
}
.memo-drawer-body textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
.memo-drawer-footer {
  padding: 10px 16px; border-top: 1px solid var(--border);
  background: var(--surface-2); flex-shrink: 0;
  display: flex; align-items: center; justify-content: space-between;
}

@media (max-width: 600px) {
  .memo-drawer { width: 100%; top: 60px; }
}

/* ===== 使い方モーダル ===== */
.modal-howto { max-width: 600px; }

.howto-step {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 16px 0; border-bottom: 1px solid var(--border);
}
.howto-step:last-child { border-bottom: none; padding-bottom: 0; }

.howto-step-num {
  flex-shrink: 0; width: 26px; height: 26px;
  border-radius: 50%; background: var(--primary); color: #fff;
  font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  margin-top: 8px;
}
.howto-step-num.premium {
  background: linear-gradient(135deg, #F59E0B, #D97706);
  font-size: 14px;
}

.howto-step-icon {
  flex-shrink: 0; width: 42px; height: 42px; border-radius: var(--r);
  background: var(--primary-light); color: var(--primary);
  display: flex; align-items: center; justify-content: center; font-size: 18px;
}
.howto-step-icon.premium { background: #FEF3C7; color: #D97706; }

.howto-step-body { flex: 1; }
.howto-step-body h3 {
  font-size: 14px; font-weight: 700; margin: 0 0 4px;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.howto-step-body p {
  font-size: 13px; color: var(--text-2); line-height: 1.7; margin: 0;
}

.howto-premium-badge {
  font-size: 10px; font-weight: 700; padding: 2px 8px;
  border-radius: var(--r-full);
  background: linear-gradient(135deg, #F59E0B, #D97706); color: #fff;
}

/* ===== 公開バッジ・いいね表示 (trip header) ===== */
.trip-public-badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 600; padding: 3px 10px;
  border-radius: var(--r-full);
  background: #D1FAE5; color: #065F46;
  border: 1px solid #6EE7B7;
}

.trip-like-display {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 13px; color: #EF4444; font-weight: 600;
}
.trip-like-display i { font-size: 13px; }

/* ===== 公開設定: 可視性ラジオボタン ===== */
.visibility-options {
  display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px;
}
.visibility-option {
  display: block; cursor: pointer;
}
.visibility-option input[type="radio"] { display: none; }
.visibility-option-body {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: var(--r);
  border: 2px solid var(--border); background: var(--surface);
  transition: border-color 0.15s, background 0.15s;
}
.visibility-option-body i {
  font-size: 16px; color: var(--text-muted); width: 20px; text-align: center; flex-shrink: 0;
}
.visibility-option-body div { display: flex; flex-direction: column; gap: 2px; }
.visibility-option-body strong { font-size: 13px; font-weight: 600; color: var(--text); }
.visibility-option-body span { font-size: 11px; color: var(--text-muted); }
.visibility-option input[type="radio"]:checked + .visibility-option-body {
  border-color: var(--primary); background: var(--primary-light);
}
.visibility-option input[type="radio"]:checked + .visibility-option-body i { color: var(--primary); }

/* ===== GUEST INTRO SECTION ===== */
.guest-intro-head {
  text-align: center; padding: 40px 16px 32px;
}
.guest-intro-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(24px, 4vw, 36px); font-weight: 600;
  color: var(--text); margin-bottom: 10px; letter-spacing: -0.01em;
}
.guest-intro-sub {
  font-size: 15px; color: var(--text-2); max-width: 500px;
  margin: 0 auto 24px; line-height: 1.7;
}
.guest-intro-cta {
  display: flex; justify-content: center; gap: 12px; flex-wrap: wrap;
}
.guest-plans {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px; margin-bottom: 48px;
}
.guest-plan-card {
  background: var(--surface); border-radius: var(--r-lg);
  border: 1.5px solid var(--border); padding: 28px 24px;
  position: relative; transition: box-shadow 0.2s, transform 0.2s;
}
.guest-plan-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-3px); }
.guest-plan-card.featured {
  border-color: var(--amber-border, #F1C87A);
  box-shadow: 0 4px 24px rgba(194,122,16,0.12);
}
.guest-plan-badge {
  position: absolute; top: -11px; left: 50%; transform: translateX(-50%);
  background: linear-gradient(135deg, #D97706, #C27A10);
  color: #fff; font-size: 11px; font-weight: 700;
  padding: 3px 12px; border-radius: var(--r-full); white-space: nowrap;
}
.guest-plan-name {
  font-family: 'Cormorant Garamond', serif;
  font-size: 22px; font-weight: 600; color: var(--text); margin-bottom: 4px;
}
.guest-plan-price {
  font-family: 'Cormorant Garamond', serif;
  font-size: 32px; font-weight: 600; color: var(--primary);
  line-height: 1; margin-bottom: 20px;
}
.guest-plan-price span { font-size: 13px; font-family: 'Noto Sans JP', sans-serif; color: var(--text-muted); }
.guest-plan-features {
  list-style: none; display: flex; flex-direction: column; gap: 8px;
}
.guest-plan-features li {
  font-size: 13px; color: var(--text-2);
  display: flex; align-items: center; gap: 8px;
}
.guest-plan-features li .fa-check { color: var(--primary); font-size: 11px; }
@media (max-width: 700px) {
  .guest-plans { grid-template-columns: 1fr; }
}

/* ===== みんなの旅程セクション (トップページ) ===== */
.public-trips-section { margin-top: 48px; padding-top: 32px; border-top: 2px solid var(--border); }
.public-trips-header { margin-bottom: 20px; }
.public-trips-title {
  font-size: 20px; font-weight: 700; color: var(--text);
  display: flex; align-items: center; gap: 8px; margin-bottom: 4px;
}
#newTripsSection .public-trips-title i { color: #3B82F6; }
#popularTripsSection .public-trips-title i { color: #ef4444; }
.public-trips-desc { font-size: 13px; color: var(--text-muted); }
.public-trip-card {
  text-decoration: none; color: inherit; display: block;
  transition: transform 0.15s, box-shadow 0.15s;
}
.public-trip-card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,0,0,0.12); }
.public-trip-likes {
  margin-left: auto; font-size: 12px; color: #ef4444;
  display: flex; align-items: center; gap: 4px;
}

/* ===== 設定モーダル: 公開設定 ===== */
.settings-premium-tag {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 10px; font-weight: 700; padding: 2px 7px;
  border-radius: var(--r-full);
  background: linear-gradient(135deg, #F59E0B, #D97706); color: #fff;
  text-transform: none; letter-spacing: 0;
}

.public-url-row {
  margin: 8px 0 4px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--r); padding: 10px 12px;
}
.public-url-label {
  font-size: 11px; color: var(--text-muted); font-weight: 600;
  margin-bottom: 6px; display: flex; align-items: center; gap: 5px;
}
.public-url-box {
  display: flex; align-items: center; gap: 8px;
}
.public-url-text {
  font-size: 11px; color: var(--primary); word-break: break-all; flex: 1;
}

.premium-lock-row {
  display: flex; align-items: center; gap: 10px;
  padding: 12px; border-radius: var(--r);
  background: var(--premium-bg); border: 1px solid #FDE68A;
  font-size: 13px; color: var(--text-2);
  margin-top: 8px;
}
.premium-lock-row span { flex: 1; }

/* ===== TOAST ===== */
.toast-container { position: fixed; bottom: 20px; right: 20px; z-index: 2000; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: #1E293B; color: #fff; padding: 10px 16px;
  border-radius: var(--r); font-size: 13px; font-weight: 500;
  box-shadow: var(--shadow-lg); display: flex; align-items: center; gap: 8px;
  animation: toastIn 0.25s ease; max-width: 300px;
}
.toast.success { background: #065F46; }
.toast.error { background: #991B1B; }
.toast.info { background: #0A5C60; }
@keyframes toastIn { from { transform: translateX(100%); opacity: 0; } to { transform: none; opacity: 1; } }

/* ===== LEAFLET CUSTOM ===== */
.leaflet-popup-content-wrapper { border-radius: var(--r) !important; box-shadow: var(--shadow-lg) !important; }
.leaflet-popup-content { font-family: 'Noto Sans JP', sans-serif !important; font-size: 12px !important; }
.num-marker {
  width: 28px; height: 28px; border-radius: 50%; background: var(--primary);
  color: #fff; font-size: 12px; font-weight: 700; display: flex;
  align-items: center; justify-content: center; border: 2px solid #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

/* ===== AUTH MODALS ===== */

/* Non-dismissible login overlay — cursor stays default to signal no click-to-close */
.modal-overlay.auth-blocking { cursor: default; }

/* Brand logo inside auth modal header */
.auth-modal-brand {
  font-family: 'Cormorant Garamond', serif;
  font-size: 22px;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Subtitle text below brand in modal */
.auth-modal-sub {
  text-align: center;
  color: var(--text-2);
  font-size: 13px;
  margin-bottom: 16px;
}

/* Inline error box inside auth forms */
.auth-error {
  background: var(--red-bg);
  color: var(--red);
  border-radius: var(--r-sm);
  padding: 8px 12px;
  font-size: 13px;
  margin-top: 6px;
}

/* User name display in header (index + trip pages) */
.auth-user-info {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}

/* "Switch to login/register" link row in modal footer */
.auth-switch-link {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.6;
}
.auth-switch-link a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}
.auth-switch-link a:hover { text-decoration: underline; }

/* ===== 利用規約チェックボックス ===== */
.terms-agreement-group { margin-top: 4px; margin-bottom: 0; }
.terms-checkbox-label {
  display: flex; align-items: flex-start; gap: 10px; cursor: pointer;
  padding: 10px 12px; border-radius: var(--r-sm);
  border: 1px solid var(--border); background: var(--surface-2);
  transition: border-color var(--trans), background var(--trans);
}
.terms-checkbox-label:hover { border-color: var(--primary-border); background: var(--primary-light); }
.terms-checkbox-label:has(.terms-checkbox:checked) { border-color: var(--primary-border); background: var(--primary-light); }
.terms-checkbox { width: 16px; height: 16px; flex-shrink: 0; margin-top: 2px; accent-color: var(--primary); cursor: pointer; }
.terms-checkbox-text { font-size: 13px; color: var(--text-2); line-height: 1.5; }
.terms-link { color: var(--primary); text-decoration: none; font-weight: 500; }
.terms-link:hover { text-decoration: underline; }
@keyframes termsShake {
  0%,100% { transform: translateX(0); }
  15% { transform: translateX(-5px); }
  45% { transform: translateX(5px); }
  75% { transform: translateX(-3px); }
}
.terms-shake { animation: termsShake 0.5s ease; border-color: var(--red) !important; background: var(--red-bg) !important; }

/* ===== ゲストバナー ===== */
.guest-banner {
  background: linear-gradient(135deg, #0A4A4D 0%, #0D7377 100%);
  color: #fff;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 24px;
  font-size: 13px;
  flex-wrap: wrap;
}
.guest-banner > i { font-size: 15px; opacity: 0.85; flex-shrink: 0; }
.guest-banner > span { flex: 1; min-width: 160px; }
.guest-banner-actions { display: flex; gap: 8px; flex-shrink: 0; }
.guest-banner .btn-ghost { color: #fff; border-color: rgba(255,255,255,0.4); }
.guest-banner .btn-ghost:hover { background: rgba(255,255,255,0.12); border-color: rgba(255,255,255,0.7); }
@media (max-width: 600px) {
  .guest-banner { padding: 10px 16px; }
  .guest-banner-actions { width: 100%; }
  .guest-banner-actions .btn { flex: 1; justify-content: center; }
}

/* ===== サイトフッター ===== */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 16px 0;
  margin-top: auto;
}
.site-footer-inner {
  max-width: 1200px; margin: 0 auto; padding: 0 24px;
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
}
.site-footer-brand {
  font-size: 13px; font-weight: 700; color: var(--primary);
  display: flex; align-items: center; gap: 6px;
}
.site-footer-links {
  display: flex; gap: 16px; flex: 1;
}
.site-footer-links a {
  font-size: 12px; color: var(--text-muted); text-decoration: none;
  transition: color var(--trans);
}
.site-footer-links a:hover { color: var(--primary); }
.site-footer-copy { font-size: 12px; color: var(--text-muted); margin-left: auto; }

/* ===== terms.html 専用スタイル ===== */
.terms-main { max-width: 760px; margin: 0 auto; padding: 40px 20px 80px; }
.terms-breadcrumb { font-size: 12px; color: var(--text-muted); margin-bottom: 24px; }
.terms-breadcrumb a { color: var(--primary); text-decoration: none; }
.terms-breadcrumb a:hover { text-decoration: underline; }
.terms-page-title { font-family: 'Cormorant Garamond', serif; font-size: 36px; font-weight: 600; color: var(--text); margin-bottom: 6px; letter-spacing: -0.01em; }
.terms-page-date { font-size: 12px; color: var(--text-muted); margin-bottom: 32px; }
.terms-toc {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--r); padding: 20px 24px; margin-bottom: 40px;
}
.terms-toc h2 { font-size: 13px; font-weight: 700; color: var(--text-2); margin-bottom: 12px; text-transform: uppercase; letter-spacing: 0.05em; }
.terms-toc-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 24px; }
.terms-toc-cols a { font-size: 13px; color: var(--primary); text-decoration: none; line-height: 1.9; }
.terms-toc-cols a:hover { text-decoration: underline; }
.terms-section { margin-bottom: 48px; }
.terms-section-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 22px; font-weight: 600; color: var(--primary);
  border-bottom: 1.5px solid var(--primary); padding-bottom: 8px; margin-bottom: 20px;
  letter-spacing: 0.01em;
}
.terms-article { margin-bottom: 20px; }
.terms-article h3 { font-size: 15px; font-weight: 700; color: var(--text); margin-bottom: 8px; }
.terms-article p { font-size: 14px; color: var(--text-2); line-height: 1.8; margin-bottom: 8px; }
.terms-list { padding-left: 20px; margin: 8px 0; }
.terms-list li { font-size: 14px; color: var(--text-2); line-height: 1.8; margin-bottom: 4px; }
.terms-contact-box {
  background: var(--primary-light); border: 1px solid var(--primary-border);
  border-radius: var(--r); padding: 16px 20px;
  font-size: 14px; color: var(--text-2); line-height: 1.8;
}
.terms-footer-actions {
  display: flex; justify-content: center; margin-top: 48px; padding-top: 32px;
  border-top: 1px solid var(--border);
}
@media (max-width: 600px) {
  .terms-toc-cols { grid-template-columns: 1fr; }
  .terms-page-title { font-size: 22px; }
  .site-footer-inner { flex-direction: column; align-items: flex-start; gap: 8px; }
  .site-footer-copy { margin-left: 0; }
}

/* ===== 未ログイン時のログイン促進 ===== */
.premium-login-note {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  margin-top: 16px; padding: 12px 16px;
  background: var(--primary-light); border: 1px solid var(--primary-border);
  border-radius: 8px; color: var(--text-2); font-size: 14px; flex-wrap: wrap;
}
.premium-login-note i { color: var(--primary); }
.premium-login-note .btn { white-space: nowrap; }

/* ===== プランカード (2プラン対応プレミアムモーダル) ===== */
.premium-plan-cards {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 0 0 4px;
}
@media (max-width: 520px) { .premium-plan-cards { grid-template-columns: 1fr; } }

.premium-plan-card {
  border: 2px solid var(--border); border-radius: var(--r-lg);
  padding: 20px 14px 16px; display: flex; flex-direction: column;
  gap: 12px; position: relative; transition: border-color var(--trans), box-shadow var(--trans);
  background: var(--surface);
}
.premium-plan-card:hover { border-color: var(--primary); box-shadow: var(--shadow-md); }
.premium-plan-card.featured {
  border-color: var(--primary); background: var(--primary-light);
  box-shadow: 0 4px 16px rgba(13,115,119,0.15);
}

.premium-plan-badge {
  position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff; font-size: 11px; font-weight: 700;
  padding: 3px 12px; border-radius: var(--r-full); white-space: nowrap;
}

.premium-plan-name {
  font-size: 17px; font-weight: 800; color: var(--text); margin-top: 6px;
}

.premium-plan-price {
  font-size: 28px; font-weight: 800;
  color: var(--primary); line-height: 1;
}
.premium-plan-period { font-size: 14px; font-weight: 400; color: var(--text-2); }

.premium-plan-features {
  list-style: none; padding: 0; margin: 0; flex: 1; display: flex; flex-direction: column; gap: 6px;
}
.premium-plan-features li {
  font-size: 13px; color: var(--text-2);
  display: flex; align-items: center; gap: 8px;
}
.premium-plan-features li i.fa-check { color: #10B981; }
.premium-plan-features li i.fa-times { color: var(--text-muted); }
.premium-plan-features li.disabled { color: var(--text-muted); }

.btn-outline-premium {
  background: transparent;
  border: 2px solid var(--primary);
  color: var(--primary); padding: 8px 14px;
  border-radius: var(--r); font-size: 13px; font-weight: 600;
  cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
  transition: all var(--trans); width: 100%; justify-content: center;
}
.btn-outline-premium:hover { background: var(--primary); color: #fff; }

/* ===== 管理者パネル ===== */
.admin-panel-wrap { max-width: 820px; margin: 32px auto; padding: 0 20px 60px; }
.admin-panel-title { font-family: 'Cormorant Garamond', serif; font-size: 28px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.admin-panel-sub { font-size: 13px; color: var(--text-muted); margin-bottom: 24px; }

.admin-plan-table {
  width: 100%; border-collapse: collapse;
  background: var(--surface); border-radius: var(--r-lg);
  overflow: hidden; box-shadow: var(--shadow);
}
.admin-plan-table thead th {
  background: var(--surface-2); padding: 12px 16px;
  text-align: center; font-size: 13px; font-weight: 700; color: var(--text-2);
  border-bottom: 1px solid var(--border);
}
.admin-plan-table thead th:first-child { text-align: left; }
.admin-plan-table tbody td {
  padding: 14px 16px; border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.admin-plan-table tbody tr:last-child td { border-bottom: none; }
.admin-plan-table tbody td:first-child { font-size: 14px; font-weight: 600; color: var(--text); }
.admin-plan-table tbody td { text-align: center; }

/* トグルスイッチ */
.admin-toggle { position: relative; display: inline-block; width: 40px; height: 22px; }
.admin-toggle input { opacity: 0; width: 0; height: 0; }
.admin-toggle-slider {
  position: absolute; cursor: pointer; inset: 0;
  background: #CBD5E1; border-radius: 22px;
  transition: background 0.2s;
}
.admin-toggle-slider::before {
  content: ''; position: absolute;
  width: 16px; height: 16px; border-radius: 50%; background: #fff;
  left: 3px; top: 3px; transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.admin-toggle input:checked + .admin-toggle-slider { background: var(--primary); }
.admin-toggle input:checked + .admin-toggle-slider::before { transform: translateX(18px); }
.admin-toggle input:disabled + .admin-toggle-slider { opacity: 0.5; cursor: not-allowed; }

.admin-save-status {
  font-size: 12px; color: var(--text-muted);
  display: flex; align-items: center; gap: 6px; margin-top: 12px;
}
.admin-save-status.saving { color: var(--primary); }
.admin-save-status.saved { color: #10B981; }

.admin-access-denied {
  text-align: center; padding: 60px 20px; color: var(--text-2);
}
.admin-access-denied i { font-size: 40px; color: var(--text-muted); margin-bottom: 16px; display: block; }
.admin-access-denied h2 { font-size: 20px; font-weight: 700; margin-bottom: 8px; }
.plan-label { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: var(--r-full); margin-left: 6px; vertical-align: middle; background: var(--primary); color: #fff; }

/* Account info block inside settings modal */
.settings-account-info {
  padding: 8px 0 4px;
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.7;
}

/* ===== UTILITIES ===== */
.hidden { display: none !important; }
.divider { height: 1px; background: var(--border); margin: 12px 0; }

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .trip-main { flex-direction: column; height: auto; overflow: visible; }
  .itinerary-panel { width: 100%; height: 260px; border-right: none; border-bottom: 1px solid var(--border); }
  .map-section { height: 240px; }
  .trip-layout { height: auto; overflow: visible; }
  .edit-panel { height: 400px; }
}
@media (max-width: 768px) {
  /* ヘッダー：768px以下はアイコンのみ表示 */
  .nav-label { display: none; }
  .nav-link { padding: 6px 10px; }
}
@media (max-width: 600px) {
  /* ヘッダー：2行レイアウト */
  .auth-user-info { display: none !important; }   /* ユーザー名は非表示 */
  .header-inner { padding: 8px 12px 0; flex-wrap: wrap; height: auto; align-items: center; }
  .header-actions { width: 100%; gap: 6px; overflow: visible; flex-wrap: nowrap; padding: 4px 0 6px; border-top: 1px solid var(--border); justify-content: flex-end; }
  #loginBtn, #signupBtn { font-size: 12px; padding: 6px 12px; }

  /* ヒーロー */
  .hero { padding: 36px 16px 0; }
  .hero-title { font-size: 20px; }
  .hero-wave { height: 40px; }

  /* フィルターバー */
  .filter-bar { flex-direction: column; gap: 8px; }
  .filter-group { flex-direction: column; }
  .filter-bar > .btn { width: 100%; justify-content: center; }

  /* 旅行カード */
  .trip-grid { grid-template-columns: 1fr; }

  /* trip.html ヘッダー：2行レイアウト */
  .trip-header { height: auto; }
  .trip-header-inner { flex-wrap: wrap; padding: 6px 12px; gap: 0; height: auto; }
  /* 行1: 戻るボタン・タイトル・設定ボタン */
  .back-link       { order: 1; }
  .trip-title-text { order: 2; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .trip-like-display { order: 3; }
  .trip-public-badge { order: 3; }
  .trip-edit-btn   { order: 4; }
  /* 行2: メモ・持ち物・ステータス */
  .trip-header-right { order: 5; width: 100%; justify-content: flex-start; padding: 4px 0 2px; margin-top: 4px; border-top: 1px solid var(--border); gap: 6px; }

  /* 日付バー */
  .date-bar { padding: 6px 8px; }
  .date-btn { min-width: 54px; padding: 6px 8px; font-size: 11px; }

  /* レイアウト */
  .itinerary-panel { height: 300px; }
  .edit-panel { height: auto; min-height: 420px; }
  .packing-drawer { width: 100%; }
  .form-row { grid-template-columns: 1fr; }

  /* ボタン タッチターゲット確保 */
  .btn { min-height: 40px; }
  .btn-sm { min-height: 34px; }
}

/* ===== ATTACHMENT PREVIEW MODAL ===== */
.attach-preview-modal {
  background: var(--surface); border-radius: var(--r-lg);
  width: min(90vw, 860px); max-height: 90vh;
  display: flex; flex-direction: column;
  overflow: hidden; box-shadow: var(--shadow-xl);
}
.attach-preview-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.attach-preview-title {
  font-size: 14px; font-weight: 600; color: var(--text-1);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 60%;
}
.attach-preview-body {
  flex: 1; overflow: auto;
  display: flex; align-items: center; justify-content: center;
  background: #0f0f0f; min-height: 200px;
}
.attach-preview-img {
  max-width: 100%; max-height: calc(90vh - 60px);
  object-fit: contain; display: block;
}
.attach-preview-pdf {
  width: 100%; height: calc(90vh - 60px);
  border: none; display: block;
}
.attach-preview-file {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 40px; color: var(--text-2);
  background: var(--surface);
}

/* ===== SHARE MODE (settings modal) ===== */
.share-mode-row {
  margin-bottom: 12px; padding: 12px;
  background: var(--surface-2); border-radius: var(--r-md);
  border: 1px solid var(--border);
}
.share-mode-label {
  font-size: 11px; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.5px;
  margin-bottom: 8px; display: flex; align-items: center; gap: 6px;
}
.share-mode-options { display: flex; flex-direction: column; gap: 6px; }
.share-mode-opt { cursor: pointer; }
.share-mode-opt input[type="radio"] { display: none; }
.share-mode-body {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: var(--r-md);
  border: 1.5px solid var(--border); background: var(--surface);
  transition: all var(--trans);
}
.share-mode-opt input:checked + .share-mode-body {
  border-color: var(--primary); background: var(--primary-light);
}
.share-mode-body i { color: var(--text-muted); font-size: 14px; width: 16px; text-align: center; }
.share-mode-opt input:checked + .share-mode-body i { color: var(--primary); }
.share-mode-body div { display: flex; flex-direction: column; gap: 1px; }
.share-mode-body strong { font-size: 12px; color: var(--text-1); }
.share-mode-body span { font-size: 11px; color: var(--text-muted); }

/* ===== SHARED EDIT BANNER ===== */
.shared-edit-banner {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px; background: #F0FDF4;
  border-bottom: 1px solid #BBF7D0;
  color: #15803D; font-size: 13px; font-weight: 500;
}
.shared-edit-banner i { font-size: 15px; }

/* ===== VIEW MODE BANNER (旅行中) ===== */
.view-mode-banner {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px; background: var(--primary-light);
  border-bottom: 1px solid var(--primary-border);
  color: var(--primary-dark); font-size: 13px; font-weight: 500;
}
.view-mode-banner i { font-size: 15px; }
.view-mode-banner span { flex: 1; }
.view-mode-edit-btn {
  padding: 5px 12px; border-radius: var(--r-full);
  background: #fff; border: 1px solid var(--primary-border);
  color: var(--primary-dark); font-size: 12px; font-weight: 600;
  cursor: pointer; white-space: nowrap; font-family: inherit;
  display: flex; align-items: center; gap: 5px;
  transition: all var(--trans);
}
.view-mode-edit-btn:hover { background: var(--primary-dark); color: #fff; border-color: var(--primary-dark); }
