/* ── Design tokens（與 globals.css 同步） ── */
:root {
  --color-primary:        #1a1a1a;
  --color-primary-hover:  #333;
  --color-primary-light:  #f6f4f0;
  --color-accent:         #185FA5;
  --color-accent-light:   #E6F1FB;
  --color-border:         #e8e6e0;
  --color-border-hover:   #bbb;
  --color-text-primary:   #1a1a1a;
  --color-text-secondary: #666;
  --color-text-muted:     #bbb;
  --color-bg:             #fafaf8;
  --color-surface:        #fff;
  --color-trip:           #615559;
  --color-trip-light:     #EDE9E8;
  --color-inspo:          #A580BB;
  --color-inspo-light:    #F7EDFD;
  --color-tool:           #E07840;
  --color-tool-light:     #FAEADE;
  --font-display: 'Zen Maru Gothic', 'Noto Sans TC', sans-serif;
  --font-body:    'Noto Sans TC', -apple-system, BlinkMacSystemFont, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-font-smoothing: antialiased; }
body { background: var(--color-bg); font-family: var(--font-body); color: var(--color-text-primary); font-size: 15px; }

/* ── Typography scale（對齊 aimigo globals.css）──
   22px  H1        衣櫃說明大標題（.intro-h1）
   16px  H2        衣櫃說明小標題（.intro-h2）
   15px  Title     卡片/目的地標題（.result-grid-dest, .logo-main）
   14px  Body      閱讀段落文字（.intro-p, .copy-snippet-text）
   13px  UI        導覽、操作按鈕、衣服名稱（.nav-item, .cloth-name）
   12px  Secondary 次要說明（.cloth-brand, .filter-chip）
   11px  Small     標籤、muted 標籤（.tag, .setup-section-label）
   10px  Micro     nav group、footer、slot 標籤（.nav-group-label）
──────────────────────────────────────────────── */

/* ── Layout ── */
.shell { display: flex; flex-direction: column; height: 100vh; overflow: hidden; }

/* ── Top nav ── */
.topnav { background: var(--color-surface); border-bottom: 0.5px solid var(--color-border); display: flex; align-items: center; height: 48px; padding: 0 16px; gap: 12px; flex-shrink: 0; z-index: 200; }
.topnav-back { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--color-text-secondary); text-decoration: none; flex-shrink: 0; white-space: nowrap; transition: color 0.15s; }
.topnav-back:hover { color: var(--color-text-primary); }
.topnav-back i { font-size: 11px; }
.topnav-logo { font-size: 14px; font-weight: 500; font-family: var(--font-display); color: var(--color-text-primary); flex-shrink: 0; white-space: nowrap; }
.topnav-divider { width: 0.5px; height: 16px; background: var(--color-border); flex-shrink: 0; }
.topnav-tabs { display: flex; align-items: center; height: 100%; }
.topnav-tab { display: flex; align-items: center; gap: 5px; padding: 0 11px; height: 100%; font-size: 13px; color: var(--color-text-secondary); cursor: pointer; border: none; background: none; border-bottom: 2px solid transparent; transition: all 0.15s; font-family: inherit; white-space: nowrap; }
.topnav-tab:hover { color: var(--color-text-primary); }
.topnav-tab.active { color: var(--color-text-primary); font-weight: 500; border-bottom-color: var(--color-text-primary); }
.topnav-tab.featured { color: var(--color-tool); }
.topnav-tab.featured.active { border-bottom-color: var(--color-tool); }
.topnav-tab i { font-size: 12px; }

/* ── Sidebar (hidden, kept for reference) ── */
.sidebar { display: none; }
.logo { padding: 0 20px 20px; border-bottom: 0.5px solid var(--color-border); margin-bottom: 16px; }
.logo-main { font-size: 15px; font-weight: 500; font-family: var(--font-display); }
.logo-sub { font-size: 11px; color: var(--color-text-muted); margin-top: 4px; letter-spacing: 0.04em; }
.nav-section { padding: 0 12px; flex: 1; }
.nav-group-label { font-size: 10px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--color-text-muted); padding: 0 8px; margin-bottom: 4px; margin-top: 12px; }
.nav-item { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 8px; cursor: pointer; color: var(--color-text-secondary); font-size: 13px; transition: all 0.15s; margin-bottom: 0; border: none; background: none; width: 100%; text-align: left; font-family: inherit; }
.nav-item:hover { background: var(--color-primary-light); color: var(--color-text-primary); }
.nav-item.active { background: var(--color-primary-light); color: var(--color-text-primary); font-weight: 500; }
.nav-item.featured { color: var(--color-tool); }
.nav-item.featured:hover { color: var(--color-tool); }
.nav-item.featured.active { color: var(--color-tool); }
.nav-count { margin-left: auto; font-size: 11px; background: var(--color-bg); color: var(--color-text-muted); padding: 0 8px; border-radius: 999px; }

/* ── Main content ── */
.main { flex: 1; overflow-y: auto; background: var(--color-bg); }
.page { display: none; padding: 32px; }
#page-intro { padding-left: 64px; padding-right: 64px; }
.page.active { display: block; }
.page-header { display: flex; align-items: baseline; gap: 8px; margin-bottom: 24px; }
.page-title { font-size: 20px; font-weight: 500; font-family: var(--font-display); }
.page-subtitle { font-size: 13px; color: var(--color-text-muted); }

/* ── Filter chips ── */
.filter-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; align-items: center; }
.filter-chip { padding: 4px 12px; border-radius: 999px; font-size: 13px; border: 0.5px solid var(--color-border); color: var(--color-text-secondary); cursor: pointer; background: transparent; transition: all 0.15s; font-family: inherit; }
.filter-chip:hover { border-color: var(--color-border-hover); color: var(--color-text-primary); }
.filter-chip.active { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }
.total-count { font-size: 12px; color: var(--color-text-muted); flex-shrink: 0; padding-left: 8px; }

/* 衣櫃總覽：filter-row 在 page-nav 內橫向排列 */
#wardrobe-nav .filter-row {
  flex: 1;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
  margin: 0;
  padding: 0;
  background: transparent;
  border: none;
  gap: 6px;
}
#wardrobe-nav .filter-row::-webkit-scrollbar { display: none; }
#wardrobe-nav .filter-chip { flex-shrink: 0; }

/* ── Clothes grid ── */
.clothes-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(148px, 168px)); gap: 12px; }
.cloth-card { background: var(--color-surface); border: 0.5px solid var(--color-border); border-radius: 12px; overflow: hidden; cursor: pointer; transition: all 0.15s; position: relative; }
.cloth-card:hover { border-color: var(--color-border-hover); box-shadow: 0 4px 16px rgba(0,0,0,0.07); }
.cloth-card:hover .cloth-delete-btn { opacity: 1; }
.cloth-photo { width: 100%; aspect-ratio: 3/4; background: transparent; display: flex; align-items: center; justify-content: center; font-size: 40px; }
.cloth-photo img { width: 100%; height: 100%; object-fit: contain; }
.cloth-body { padding: 12px; }
.cloth-name { font-size: 14px; font-weight: 500; margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-family: var(--font-display); }
/* 本次行李小卡：允許換行最多 2 行 */
.trip-group-items .cloth-name { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; text-overflow: ellipsis; line-height: 1.4; }
.cloth-brand { font-size: 12px; color: var(--color-text-muted); margin-bottom: 8px; }
.cloth-tags { display: flex; gap: 4px; flex-wrap: wrap; }
.cloth-delete-btn { position: absolute; top: 8px; right: 8px; width: 24px; height: 24px; border-radius: 50%; background: rgba(0,0,0,0.3); border: none; cursor: pointer; font-size: 11px; color: #fff; display: flex; align-items: center; justify-content: center; z-index: 2; padding: 0; opacity: 0; transition: opacity 0.15s, background 0.15s; }
.cloth-delete-btn:hover { background: rgba(0,0,0,0.5); }
.cloth-mine-badge { font-size: 10px; padding: 0 4px; border-radius: 4px; background: var(--color-primary); color: #fff; font-weight: 500; white-space: nowrap; flex-shrink: 0; line-height: 1.6; }

/* ── Tags（衣服分類 pill） ── */
.tag { font-size: 11px; padding: 4px 8px; border-radius: 999px; font-weight: 500; }
.tag-type { background: var(--color-primary-light); color: var(--color-text-secondary); }

/* ── 新增衣物 Bottom Sheet ── */
.add-field { margin-bottom: 16px; }
.add-field-label { display: block; font-size: 12px; font-weight: 500; color: var(--color-text-secondary); margin-bottom: 8px; }
.add-field-input { width: 100%; height: 40px; border: 0.5px solid var(--color-border); border-radius: 8px; padding: 0 12px; font-size: 14px; font-family: inherit; background: var(--color-bg); color: var(--color-text-primary); outline: none; box-sizing: border-box; }
.add-field-input:focus { border-color: var(--color-primary); }
.add-chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.add-chip { font-size: 12px; padding: 4px 12px; border-radius: 999px; border: 0.5px solid var(--color-border); background: transparent; cursor: pointer; font-family: inherit; color: var(--color-text-secondary); transition: all 0.12s; }
.add-chip:hover { border-color: var(--color-border-hover); color: var(--color-text-primary); }
.add-chip.active { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }

/* ── Copy snippet（對齊 globals.css .copy-snippet-*） ── */
.copy-snippet-wrap { position: relative; background: var(--color-primary-light); border: 0.5px solid var(--color-border); border-radius: 8px; padding: 1rem 1rem 1rem 1rem; margin: 8px 0; }
.copy-snippet-text { font-size: 15px; line-height: 1.8; color: var(--color-text-secondary); white-space: pre-wrap; word-break: break-word; margin: 0; padding-right: 4rem; }
.copy-snippet-btn { position: absolute; top: 12px; right: 12px; font-size: 12px; padding: 4px 12px; border-radius: 8px; border: 0.5px solid var(--color-border); background: var(--color-surface); color: var(--color-text-secondary); cursor: pointer; transition: background 0.15s, color 0.15s; white-space: nowrap; font-family: inherit; }
.copy-snippet-btn:hover { background: var(--color-text-primary); color: #fff; border-color: var(--color-text-primary); }

/* ── Trip planner layout ── */
.trip-page { display: flex; flex-direction: column; gap: 0; }

/* ── Sticky nav bar ── */
.page-nav { position: sticky; top: 0; z-index: 100; background: var(--color-surface); border-bottom: 0.5px solid var(--color-border); display: flex; align-items: center; margin: -32px -32px 16px -32px; padding: 0 24px; height: 48px; flex-shrink: 0; }
.trip-nav { display: none; }
.trip-nav.visible { display: flex; }
.nav-left { display: flex; align-items: center; gap: 8px; flex: 1; overflow: hidden; }
.nav-dest-input { font-size: 13px; font-weight: 500; border: none; background: transparent; color: var(--color-text-primary); font-family: inherit; width: 72px; padding: 0; outline: none; }
.nav-divider { width: 0.5px; height: 24px; background: var(--color-border); margin: 0 8px; flex-shrink: 0; }
.nav-select { font-size: 12px; border: none; background: transparent; color: var(--color-text-secondary); font-family: inherit; cursor: pointer; padding: 0; outline: none; appearance: none; -webkit-appearance: none; }
.nav-num-input { font-size: 12px; font-weight: 500; border: none; background: transparent; color: var(--color-text-secondary); font-family: inherit; width: 28px; text-align: center; outline: none; padding: 0; cursor: text; -moz-appearance: textfield; }
.nav-num-input::-webkit-inner-spin-button, .nav-num-input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.nav-num-input:focus { color: var(--color-text-primary); }
.nav-select-wrap { display: flex; align-items: center; gap: 4px; padding: 4px 8px; border-radius: 8px; cursor: pointer; transition: background 0.15s; flex-shrink: 0; }
.nav-select-wrap:hover { background: var(--color-primary-light); }
.nav-select-wrap label { font-size: 10px; color: var(--color-text-muted); white-space: nowrap; cursor: pointer; }
.nav-arrow { font-size: 10px; color: var(--color-text-muted); }
.nav-detail-btn { font-size: 12px; color: var(--color-text-secondary); border: none; background: transparent; font-family: inherit; cursor: pointer; padding: 4px 8px; border-radius: 8px; white-space: nowrap; display: flex; align-items: center; gap: 4px; }
.nav-detail-btn:hover { background: var(--color-primary-light); }
.nav-info-chip { display: flex; flex-direction: column; align-items: center; padding: 4px 8px; flex-shrink: 0; }
.nav-info-chip .nav-info-label { font-size: 10px; color: var(--color-text-muted); line-height: 1; margin-bottom: 0; }
.nav-info-chip .nav-info-val { font-size: 12px; font-weight: 500; color: var(--color-text-secondary); line-height: 1; }
.nav-days-ctrl { display: flex; flex-direction: column; align-items: center; padding: 4px 8px; flex-shrink: 0; }
.nav-days-ctrl .nav-info-label { font-size: 10px; color: var(--color-text-muted); line-height: 1; margin-bottom: 0; }
.nav-days-row { display: flex; align-items: center; gap: 4px; }
.nav-stepper-btn { width: 20px; height: 20px; border: 0.5px solid var(--color-border); border-radius: 4px; background: var(--color-bg); font-size: 13px; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center; color: var(--color-text-secondary); padding: 0; font-family: inherit; }
.nav-stepper-btn:hover { background: var(--color-primary-light); border-color: var(--color-border-hover); color: var(--color-text-primary); }
.nav-days-val { font-size: 12px; font-weight: 500; color: var(--color-text-primary); min-width: 24px; text-align: center; }
.nav-regen-btn { font-size: 12px; font-weight: 500; color: #fff; background: var(--color-primary); border: none; font-family: inherit; cursor: pointer; padding: 8px 12px; border-radius: 8px; white-space: nowrap; flex-shrink: 0; }
.nav-regen-btn:hover { background: var(--color-primary-hover); }
.nav-right { display: flex; align-items: center; gap: 4px; flex-shrink: 0; margin-left: 8px; }
.nav-action-btn { font-size: 12px; font-weight: 500; border: 0.5px solid var(--color-border); background: transparent; font-family: inherit; cursor: pointer; padding: 8px 12px; border-radius: 8px; color: var(--color-text-secondary); white-space: nowrap; transition: all 0.15s; display: flex; align-items: center; gap: 4px; }
.nav-action-btn:hover { border-color: var(--color-border-hover); color: var(--color-text-primary); }
.nav-action-btn.active { background: var(--color-accent-light); color: var(--color-accent); border-color: var(--color-accent); }
.nav-action-btn.primary { color: var(--color-primary); border-color: var(--color-primary); }
.nav-action-btn.primary:hover { background: var(--color-primary-light); }
.nav-action-btn.danger { color: #c0392b; border-color: #e8cbc8; }
.nav-action-btn.danger:hover { background: #fdf0ef; border-color: #e8b4b0; }

/* ── Dropdowns ── */
.nav-dropdown { position: absolute; top: 48px; left: -32px; right: -32px; background: var(--color-surface); border-top: 0.5px solid var(--color-border); border-bottom: 0.5px solid var(--color-border); padding: 20px 32px; display: none; z-index: 200; box-shadow: 0 4px 16px rgba(0,0,0,0.06); max-height: 70vh; overflow-y: auto; }
.nav-dropdown.open { display: block; }
.luggage-dropdown { position: absolute; top: 48px; right: 0; background: var(--color-surface); border: 0.5px solid var(--color-border); border-top: none; border-radius: 0 0 12px 12px; padding: 16px; display: none; z-index: 99; min-width: min(720px, calc(100vw - 40px)); max-height: 65vh; overflow-y: auto; }
.luggage-dropdown.open { display: flex; flex-wrap: wrap; gap: 8px; align-content: flex-start; }

/* ── Settings form (legacy, kept for swap panels) ── */
.settings-mini { display: none; }
.mini-gen-btn { display: none; }

/* ── Setup form (行程設定) ── */
.trip-settings-row { display: flex; gap: 20px; align-items: stretch; }
.setup-form { background: var(--color-surface); border: 0.5px solid var(--color-border); border-radius: 12px; overflow: hidden; flex: 1; min-width: 0; }
/* insight-panel: right-side column in trip-settings-row */
.insight-panel { flex: 1; min-width: 0; overflow-y: auto; }

/* ── Hemisphere toggle ── */
.hemi-toggle { display: flex; gap: 4px; }
.hemi-btn { padding: 4px 12px; border: 0.5px solid var(--color-border); border-radius: 8px; background: transparent; font-size: 12px; color: var(--color-text-secondary); cursor: pointer; font-family: inherit; transition: all 0.15s; }
.hemi-btn.active { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }
.hemi-btn:hover:not(.active) { background: var(--color-primary-light); }

/* ── Insight dashboard (行李分析) ── */
.ins-title { font-size: 11px; font-weight: 500; color: var(--color-text-muted); letter-spacing: .08em; text-transform: uppercase; margin-bottom: 12px; }
.ins-row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin-bottom: 8px; }
.ins-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ins-card { background: var(--color-surface); border: 0.5px solid var(--color-border); border-radius: 12px; padding: 16px; }
.ins-card-label { font-size: 12px; color: var(--color-text-muted); margin-bottom: 8px; }
.ins-card-big { font-size: 26px; font-weight: 500; color: var(--color-text-primary); line-height: 1; }
.ins-card-big--sm { font-size: 18px; padding-top: 4px; }
.ins-card-big-unit { font-size: 14px; font-weight: 400; color: var(--color-text-muted); }
.ins-season-card { background: var(--color-surface); border: 0.5px solid var(--color-border); border-radius: 12px; padding: 16px; margin-bottom: 8px; }
.ins-season-badge { display: inline-block; font-size: 11px; font-weight: 500; background: #FAEADE; color: #7a3d12; padding: 4px 12px; border-radius: 20px; margin-bottom: 8px; }
.ins-season-text { font-size: 14px; color: var(--color-text-secondary); line-height: 1.7; }
.ins-chart-card { background: var(--color-surface); border: 0.5px solid var(--color-border); border-radius: 12px; padding: 16px; margin-bottom: 8px; }
.ins-chart-inner { display: flex; align-items: center; gap: 20px; }
.ins-legend { display: flex; flex-direction: column; gap: 8px; flex: 1; min-width: 0; }
.ins-legend-item { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--color-text-secondary); }
.ins-legend-dot { width: 8px; height: 8px; border-radius: 2px; flex-shrink: 0; }
.ins-legend-pct { font-weight: 500; color: var(--color-text-primary); margin-left: auto; font-size: 13px; padding-left: 8px; white-space: nowrap; }
.ins-tags-card { background: var(--color-surface); border: 0.5px solid var(--color-border); border-radius: 12px; padding: 16px; }
.ins-tags-card-label { font-size: 12px; color: var(--color-text-muted); margin-bottom: 8px; }
.ins-tag-list { display: flex; flex-direction: column; }
.ins-tag-row-item { display: flex; align-items: center; justify-content: space-between; font-size: 14px; padding: 4px 0; gap: 8px; }
.ins-tag-name { font-weight: 500; color: var(--color-text-primary); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--font-display); }
.ins-tag-meta { color: var(--color-text-muted); font-size: 13px; flex-shrink: 0; }
.ins-tag-divider { height: 0.5px; background: var(--color-border); }
.insight-title { font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--color-text-muted); margin-bottom: 8px; }
.insight-section { margin-bottom: 16px; }
.insight-section:last-child { margin-bottom: 0; }
.insight-item-row { margin-bottom: 8px; }
.insight-item-name { font-size: 13px; color: var(--color-text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.insight-item-meta { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.insight-bar-track { flex: 1; height: 4px; background: var(--color-border); border-radius: 999px; overflow: hidden; }
.insight-bar-fill { height: 100%; border-radius: 999px; transition: width 0.4s; }
.insight-item-count { font-size: 12px; color: var(--color-text-muted); flex-shrink: 0; white-space: nowrap; }
.insight-everyday-list { font-size: 13px; color: var(--color-text-secondary); line-height: 1.9; }
.insight-unused { font-size: 12px; color: var(--color-text-muted); margin-top: 8px; }
.insight-pie-wrap { display: flex; align-items: center; gap: 16px; }
.insight-pie { width: 80px; height: 80px; border-radius: 50%; flex-shrink: 0; border: 0.5px solid rgba(0,0,0,0.08); }
.insight-pie-legend { display: flex; flex-wrap: wrap; gap: 8px 12px; align-content: flex-start; }
.insight-pie-legend-item { display: flex; align-items: center; gap: 4px; }
.insight-pie-swatch { width: 12px; height: 12px; border-radius: 4px; flex-shrink: 0; border: 0.5px solid rgba(0,0,0,0.1); }
.insight-pie-pct { font-size: 12px; color: var(--color-text-secondary); }
.setup-section { padding: 8px 20px; border-bottom: 0.5px solid var(--color-border); }
.setup-section:last-of-type { border-bottom: none; }
.setup-section-label { font-size: 12px; font-weight: 600; letter-spacing: 0.07em; text-transform: uppercase; color: var(--color-text-muted); padding: 12px 0 4px; }
.setup-field { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 0.5px solid var(--color-border); }
.setup-field:last-child { border-bottom: none; }
.setup-field-label { font-size: 13px; color: var(--color-text-secondary); flex-shrink: 0; width: 56px; }
.setup-field-input { flex: 1; border: none; background: transparent; font-size: 15px; font-weight: 500; color: var(--color-text-primary); font-family: inherit; outline: none; min-width: 0; }
.setup-field-input::placeholder { color: var(--color-text-muted); font-weight: 400; font-size: 14px; }
.setup-field-input[type="date"] { font-size: 13px; font-weight: 400; color: var(--color-text-secondary); }
.setup-stepper-row { display: flex; align-items: center; justify-content: space-between; padding: 8px 0; border-bottom: 0.5px solid var(--color-border); }
.setup-stepper-row:last-child { border-bottom: none; }
.setup-stepper-label { font-size: 14px; color: var(--color-text-primary); }
.setup-stepper-ctrl { display: flex; align-items: center; gap: 2px; }
.setup-stepper-btn { width: 28px; height: 28px; border: 0.5px solid var(--color-border); border-radius: 6px; background: transparent; font-size: 16px; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center; color: var(--color-text-muted); padding: 0; font-family: inherit; transition: all 0.15s; flex-shrink: 0; }
.setup-stepper-btn:hover { background: var(--color-primary-light); border-color: var(--color-border-hover); color: var(--color-text-primary); }
/* 天數按鈕專用 — 黑底白字，跟重新產生一致 */
.setup-stepper-btn--primary { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }
.setup-stepper-btn--primary:hover { background: var(--color-primary-hover); border-color: var(--color-primary-hover); color: #fff; }
.setup-stepper-val { font-size: 15px; font-weight: 500; color: var(--color-text-primary); min-width: 44px; text-align: center; }
.color-filter-chips { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px 0; }
.color-chip { display: flex; align-items: center; gap: 4px; padding: 4px 8px; border-radius: 999px; border: 1.5px solid var(--color-border); background: var(--color-bg); font-size: 12px; color: var(--color-text-secondary); cursor: pointer; font-family: inherit; transition: all 0.12s; line-height: 1; }
.color-chip.active { border-color: var(--color-primary); background: var(--color-primary-light); color: var(--color-primary); font-weight: 500; }
.color-chip[data-family="all"] { padding: 4px 8px; }
.color-chip-dot { width: 12px; height: 12px; border-radius: 50%; border: 0.5px solid rgba(0,0,0,0.12); flex-shrink: 0; }
.limit-icons-row { display: flex; align-items: center; gap: 4px; flex: 1; margin: 0 12px; flex-wrap: wrap; min-width: 0; }
.limit-icons-row.limit-icons-warn { gap: 4px; }
.limit-warn-text { font-size: 11px; font-weight: 600; color: #c0392b; white-space: nowrap; }
.limit-val-warn { color: #c0392b !important; }
.gen-btn { width: calc(100% - 40px); margin: 16px 20px; padding: 12px; background: var(--color-primary); color: #fff; border: none; border-radius: 8px; font-size: 13px; font-weight: 500; cursor: pointer; font-family: var(--font-display); transition: background 0.15s; display: block; }
.gen-btn:hover { background: var(--color-primary-hover); }

/* ── Outfit result grid ── */
.result-empty { background: var(--color-surface); border: 0.5px solid var(--color-border); border-radius: 12px; padding: 48px 24px; text-align: center; color: var(--color-text-muted); font-size: 13px; }
.result-grid { background: var(--color-surface); border: 0.5px solid var(--color-border); border-radius: 12px; overflow: hidden; margin-bottom: 16px; }
.result-grid-header { display: flex; align-items: baseline; gap: 8px; padding: 16px; border-bottom: 0.5px solid var(--color-border); }
.result-grid-dest { font-size: 15px; font-weight: 500; font-family: var(--font-display); }
.result-days-wrap, .history-days-wrap { display: flex; flex-direction: column; }
.days-row { display: flex; width: 100%; }
.result-day-col { border-right: 0.5px solid var(--color-border); border-bottom: 0.5px solid var(--color-border); flex: 1; min-width: 0; overflow: hidden; container-type: inline-size; container-name: day-card; scroll-margin-top: 96px; }
.days-row .result-day-col:last-child { border-right: none; }

/* ── Notion toggle chevron ── */
details[open] > summary i.fa-chevron-right { transform: rotate(90deg); }

/* ── Collapsible ── */
.collapsible-header { display: flex; align-items: center; justify-content: space-between; cursor: pointer; padding: 16px 20px; background: var(--color-surface); border: 0.5px solid var(--color-border); border-radius: 12px; font-size: 14px; font-weight: 500; transition: border-color 0.15s; user-select: none; }
.collapsible-header:hover { border-color: var(--color-border-hover); }
.collapsible-header.open { border-radius: 12px 12px 0 0; border-bottom: none; }
.collapsible-arrow { font-size: 11px; color: var(--color-text-muted); transition: transform 0.2s; }
.collapsible-header.open .collapsible-arrow { transform: rotate(180deg); }
.collapsible-body { background: var(--color-surface); border: 0.5px solid var(--color-border); border-top: none; border-radius: 0 0 12px 12px; padding: 20px; display: none; }
.collapsible-body.open { display: block; }

/* ── 紙娃娃 ── */
.day-outfit-card { background: var(--color-surface); border: 0.5px solid var(--color-border); border-radius: 12px; overflow: hidden; container-type: inline-size; container-name: day-card; }
.day-outfit-header { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 0.5px solid var(--color-border); }
.day-outfit-title { font-size: 14px; font-weight: 500; }
.day-outfit-dest { display: none; }
.fav-btn { background: none; border: none; cursor: pointer; font-size: 15px; color: var(--color-text-muted); padding: 0 4px; transition: color 0.15s; line-height: 1; }
.fav-btn.active { color: #E07840; }
.doll-wrap { display: flex; align-items: flex-start; justify-content: center; padding: 20px 16px 24px; gap: 12px; }
.coat-area { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 88px; flex-shrink: 0; padding-top: 8px; }
.coat-slot { width: 80px; height: 80px; display: flex; align-items: center; justify-content: center; font-size: 28px; overflow: hidden; }
.coat-slot img { width: 100%; height: 100%; object-fit: contain; }
.coat-label { font-size: 10px; color: var(--color-text-muted); text-align: center; max-width: 84px; }
.doll-body { position: relative; width: min(100%, 260px); min-width: 188px; flex-shrink: 0; overflow: visible; }
.slot { position: absolute; display: flex; align-items: center; justify-content: center; border-radius: 8px; background: transparent; border: none; overflow: visible; }
.slot-emoji { font-size: 22px; opacity: 0.45; }
.slot img { position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 120%; height: auto; object-fit: contain; border-radius: 4px; }
.slot-name { position: absolute; top: calc(100% + 2px); left: 50%; transform: translateX(-50%); font-size: 12px; color: var(--color-text-muted); white-space: nowrap; pointer-events: none; min-width: 100px; text-align: center; z-index: 10; font-family: var(--font-display); }
.s-hat    { top: 0;    left: 25px;  width: 110px; height: 56px; }
.s-inner  { top: 60px; left: 5px;   width: 110px; height: 110px; }
.s-top    { top: 56px; left: 18px;  width: 110px; height: 110px; z-index: 2; }
.s-over   { top: 52px; left: 32px;  width: 110px; height: 110px; z-index: 3; }
.s-bottom { top: 170px;left: 10px;  width: 110px; height: 110px; z-index: 1; }
.s-bag    { top: 72px; right: -36px;width: 72px;  height: 72px;  transform: rotate(-22deg); z-index: 5; border-radius: 10px; }
.s-socks  { top: 286px;left: 6px;   width: 56px;  height: 30px;  z-index: 1; }
.s-shoes  { top: 292px;left: 10px;  width: 110px; height: 44px;  z-index: 2; }
.extras-area { display: flex; flex-direction: column; gap: 8px; align-items: center; width: 72px; flex-shrink: 0; padding-top: 8px; padding-left: 36px; }
.extra-item { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.extra-slot { width: 52px; height: 52px; border-radius: 8px; background: transparent; border: none; display: flex; align-items: center; justify-content: center; font-size: 20px; overflow: visible; }
.extra-slot img { width: 100%; height: 100%; object-fit: contain; }
.extra-label { font-size: 10px; color: var(--color-text-muted); text-align: center; max-width: 56px; }

/* ── 衣櫃說明（Notion 動態內容） ── */
.intro-wrap { max-width: 780px; padding: 36px 36px 56px; }
.intro-eyebrow { font-size: 11px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--color-text-muted); margin-bottom: 8px; }
.intro-h1 { font-size: 22px; font-weight: 700; color: var(--color-text-primary); margin: 0 0 32px; font-family: var(--font-display); }
.intro-section { margin-bottom: 28px; padding-top: 24px; border-top: 0.5px solid var(--color-border); }
.intro-section:first-of-type { border-top: none; padding-top: 0; }
.intro-h2 { font-size: 16px; font-weight: 700; color: var(--color-text-primary); margin: 0 0 8px; font-family: var(--font-display); }
.intro-p { font-size: 14px; color: var(--color-text-secondary); line-height: 1.75; margin: 0 0 12px; }
.intro-p:last-child { margin-bottom: 0; }
.intro-quote { background: var(--color-primary-light); border-radius: 8px; padding: 12px 16px; font-size: 14px; color: var(--color-text-secondary); line-height: 1.8; margin: 12px 0; }

/* ── Intro landing 版面 ── */
.intro-hero { margin-bottom: 28px; }
.intro-hero-badge { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 500; color: var(--color-tool); background: var(--color-tool-light); padding: 3px 10px; border-radius: 99px; margin-bottom: 12px; }
.intro-hero-title { font-family: var(--font-display); font-size: 24px; font-weight: 700; line-height: 1.25; margin: 0 0 8px; color: var(--color-text-primary); min-height: 1.5em; }
.intro-hero-sub { font-size: 13px; color: var(--color-text-secondary); line-height: 1.75; margin: 0; max-width: 560px; }
.intro-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 32px; }
.intro-card { background: var(--color-surface); border: 0.5px solid var(--color-border); border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; cursor: pointer; transition: all 0.15s; }
.intro-card:hover { border-color: var(--color-border-hover); box-shadow: 0 2px 12px rgba(0,0,0,0.06); }
.intro-card.featured { border-color: var(--color-tool); }
.intro-card-thumb { width: 100%; height: 96px; overflow: hidden; flex-shrink: 0; }
.intro-thumb-wardrobe { display: grid; grid-template-columns: repeat(4,1fr); gap: 4px; padding: 10px; background: var(--color-primary-light); }
.intro-thumb-wardrobe-item { background: #ddd8d1; border-radius: 4px; aspect-ratio: 3/4; }
.intro-thumb-wardrobe-item:nth-child(2) { background: #c8c0b8; }
.intro-thumb-wardrobe-item:nth-child(4) { background: #e0dbd4; }
.intro-thumb-wardrobe-item:nth-child(5) { background: #e8e4de; }
.intro-thumb-wardrobe-item:nth-child(7) { background: #d4cfc9; }
.intro-thumb-wardrobe-item:nth-child(8) { background: #ccc6bf; }
.intro-thumb-trip { display: grid; grid-template-columns: repeat(3,1fr); gap: 6px; padding: 12px; background: var(--color-tool-light); }
.intro-thumb-trip-head { font-size: 9px; color: #b85a20; font-weight: 600; margin-bottom: 5px; letter-spacing: 0.04em; }
.intro-thumb-trip-block { border-radius: 4px; margin-bottom: 4px; }
.intro-thumb-history { display: flex; flex-direction: column; gap: 6px; padding: 12px; background: var(--color-trip-light); }
.intro-thumb-history-row { background: var(--color-surface); border: 0.5px solid var(--color-border); border-radius: 6px; padding: 7px 10px; display: flex; align-items: center; justify-content: space-between; }
.intro-thumb-history-name { font-size: 10px; font-weight: 500; color: var(--color-text-secondary); }
.intro-thumb-history-days { font-size: 10px; color: var(--color-text-muted); }
.intro-thumb-history-dots { display: flex; gap: 3px; margin-top: 4px; }
.intro-thumb-history-dot { width: 10px; height: 10px; border-radius: 2px; }
.intro-card-body { padding: 16px 16px 18px; display: flex; flex-direction: column; gap: 8px; }
.intro-fname-row { display: flex; align-items: baseline; flex-wrap: wrap; }
.intro-fname { font-family: var(--font-display); font-size: 17px; font-weight: 700; line-height: 1.2; }
.intro-fname.blue { color: var(--color-accent); }
.intro-fname.orange { color: var(--color-tool); }
.intro-fname.brown { color: var(--color-trip); }
.intro-fstat { font-size: 12px; color: var(--color-text-muted); white-space: nowrap; }
.intro-fdesc { font-size: 12px; color: var(--color-text-secondary); line-height: 1.65; }
.intro-section-divider { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.intro-section-label { font-size: 10px; font-weight: 600; letter-spacing: 0.07em; color: var(--color-text-muted); text-transform: uppercase; white-space: nowrap; }
.intro-section-line { flex: 1; height: 0.5px; background: var(--color-border); }

/* ── 穿搭記錄 ── */
/* ── 穿搭記錄快速錨點列 ── */
.history-anchors, .result-anchors {
  display: flex;
  flex: 1;
  gap: 6px;
  flex-wrap: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  align-items: center;
}
.history-anchors::-webkit-scrollbar, .result-anchors::-webkit-scrollbar { display: none; }
.anchor-btn {
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 13px;
  border: 0.5px solid var(--color-border);
  color: var(--color-text-secondary);
  cursor: pointer;
  background: transparent;
  transition: all 0.15s;
  font-family: var(--font-display);
  white-space: nowrap;
  flex-shrink: 0;
}
.anchor-btn:hover { border-color: var(--color-border-hover); color: var(--color-text-primary); }
.anchor-btn.active { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }

.history-trip { background: var(--color-surface); border: 0.5px solid var(--color-border); border-radius: 12px; margin-bottom: 16px; overflow: hidden; scroll-margin-top: 96px; }
.history-trip-header { display: flex; align-items: baseline; gap: 8px; padding: 16px; border-bottom: 0.5px solid var(--color-border); }
.history-dest { font-size: 15px; font-weight: 500; font-family: var(--font-display); }
.history-date { font-size: 12px; color: var(--color-text-muted); margin-left: auto; }
.history-day-col { border-right: 0.5px solid var(--color-border); border-bottom: 0.5px solid var(--color-border); flex: 1; min-width: 0; overflow: hidden; container-type: inline-size; container-name: day-card; }
.days-row .history-day-col:last-child { border-right: none; }
.history-day-header { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 0.5px solid var(--color-border); }
.history-day-label { font-size: 16px; font-weight: 600; flex-shrink: 0; font-family: var(--font-display); }
.history-day-occasion { font-size: 13px; color: var(--color-text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex-shrink: 0; }
.day-note-inline { flex: 1; min-width: 0; font-size: 14px; border: none; background: transparent; color: var(--color-text-muted); font-family: inherit; outline: none; }
.day-note-inline::placeholder { color: var(--color-border-hover); }

/* ── Swap / wardrobe item controls ── */
.swap-select { display: block; width: 100%; font-size: 13px; padding: 4px 28px 4px 8px; border: 0.5px solid var(--color-border); border-radius: 8px; background: var(--color-bg); color: var(--color-text-secondary); font-family: inherit; cursor: pointer; appearance: none; background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'%3E%3Cpath fill='%23aaa' d='M233.4 406.6c12.5 12.5 32.8 12.5 45.3 0l192-192c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L256 338.7 86.6 169.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l192 192z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 8px center; background-size: 10px; height: 36px; }
.swap-select:focus { outline: none; border-color: var(--color-border-hover); }
.swap-select-wrap { display: none; }
.editing-mode .swap-select-wrap { display: block; }
.swap-section { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.swap-section-label { font-size: 12px; font-weight: 500; letter-spacing: 0.02em; color: var(--color-text-muted); white-space: nowrap; flex-shrink: 0; min-width: 48px; }
.trip-wardrobe-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.trip-group { margin-bottom: 16px; }
.trip-group-label { font-size: 13px; font-weight: 600; color: var(--color-text-secondary); margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.trip-group-items { display: flex; flex-wrap: wrap; overflow-x: visible; gap: 8px; align-items: flex-start; padding-bottom: 8px; }
.trip-add-btn { height: 28px; padding: 0 12px; border: 0.5px dashed var(--color-border); border-radius: 20px; background: transparent; color: var(--color-text-muted); font-size: 11px; cursor: pointer; font-family: inherit; white-space: nowrap; transition: all 0.15s; }
.trip-add-btn:hover { background: var(--color-primary-light); color: var(--color-text-secondary); border-style: solid; }
.trip-add-form { display: none; flex-wrap: wrap; gap: 8px; align-items: center; padding: 8px 12px; background: var(--color-primary-light); border-radius: 8px; margin-top: 8px; }
.trip-add-form.open { display: flex; }
.trip-add-form select { font-size: 12px; padding: 4px 6px; border: 0.5px solid var(--color-border); border-radius: 6px; background: var(--color-surface); font-family: inherit; cursor: pointer; color: var(--color-text-secondary); appearance: auto; }
.trip-add-controls { flex: 1; min-width: 0; max-width: 356px; display: flex; gap: 8px; align-items: center; }
.trip-add-select { flex: 1; min-width: 0; }
.trip-add-confirm { padding: 0 16px; border-radius: 8px; background: var(--color-primary); color: #fff; border: none; font-size: 13px; cursor: pointer; font-family: inherit; flex-shrink: 0; white-space: nowrap; transition: background 0.15s; }
.trip-add-confirm:hover { background: var(--color-primary-hover); }
.trip-add-cancel { height: 28px; padding: 0 8px; border-radius: 8px; background: transparent; color: var(--color-text-muted); border: none; font-size: 11px; cursor: pointer; font-family: inherit; }

/* 統一行內控制項高度（select + button 共用） */
.ctrl { height: 36px; box-sizing: border-box; }

/* 本次行李衣物卡片 */
.wardrobe-card { width: 96px; flex-shrink: 0; position: relative; background: var(--color-surface); border: 0.5px solid var(--color-border); border-radius: 12px; overflow: hidden; }
.wardrobe-card-img { position: relative; width: 100%; aspect-ratio: 1; background: var(--color-primary-light); display: flex; align-items: center; justify-content: center; }
.wardrobe-card-info { padding: 4px 8px; height: 68px; overflow: hidden; box-sizing: border-box; }
.wardrobe-card-remove { position: absolute; top: 4px; right: 4px; width: 20px; height: 20px; border-radius: 50%; background: rgba(0,0,0,0.18); border: none; cursor: pointer; font-size: 10px; color: #fff; display: flex; align-items: center; justify-content: center; z-index: 2; padding: 0; transition: background 0.15s; }
.wardrobe-card-remove:hover { background: rgba(0,0,0,0.42); }

/* ── Sidebar footer ── */
.sidebar-footer { padding: 0 16px; border-top: 0.5px solid var(--color-border); margin-top: 8px; padding-top: 12px; }
.sidebar-footer-line { font-size: 10px; color: var(--color-text-muted); line-height: 1.7; }
.sidebar-footer-link { font-size: 10px; color: var(--color-text-muted); line-height: 1.7; text-decoration: none; display: block; }
.sidebar-footer-link:hover { color: var(--color-text-secondary); }

/* ── Main footer (shared FA credit) ── */
.main-footer { font-size: 12px; color: var(--color-text-muted); text-align: center; padding: 20px 20px 28px; line-height: 1.7; }
.main-footer a { color: inherit; text-decoration: underline; }

/* ── Nav icon (FA replaces inline SVG) ── */
.nav-icon { font-size: 13px; }

/* ── Date input with FA calendar overlay ── */
.date-input-wrap { flex: 1; position: relative; min-width: 0; }
.date-input-wrap .setup-field-input { flex: none; width: 100%; box-sizing: border-box; padding-right: 24px; }
.date-input-icon { position: absolute; right: 0; top: 50%; transform: translateY(-50%); pointer-events: none; color: var(--color-text-muted); font-size: 12px; }
input.setup-field-input[type="date"]::-webkit-calendar-picker-indicator { opacity: 0; cursor: pointer; }

/* ── Nav chips group + mobile toggle ── */
.nav-mobile-panel { display: contents; }
.nav-mobile-page-label { display: none; }
.nav-chips-group { display: flex; align-items: center; gap: 8px; flex: 1; justify-content: center; }
.nav-right-divider { flex-shrink: 0; }
.nav-mobile-toggle { display: none; align-items: center; justify-content: center; margin-left: auto; width: 32px; height: 32px; border-radius: 8px; border: 0.5px solid var(--color-border); background: transparent; color: var(--color-text-secondary); font-size: 16px; cursor: pointer; font-family: inherit; flex-shrink: 0; transition: all 0.15s; letter-spacing: 0.05em; padding: 0; }
.nav-mobile-toggle:hover { background: var(--color-primary-light); border-color: var(--color-border-hover); }
.nav-mobile-toggle.active { background: var(--color-primary-light); border-color: var(--color-border-hover); color: var(--color-text-primary); }

/* ── Tab bar（手機底部導覽，桌機隱藏）── */
.tab-bar {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: calc(64px + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: var(--color-surface);
  border-top: 0.5px solid var(--color-border);
  z-index: 100;
  align-items: stretch;
}
.tab-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  gap: 4px;
  font-size: 10px;
  font-family: inherit;
  color: var(--color-text-muted);
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: none;
  padding: 8px 4px;
  transition: color 0.15s;
  line-height: 1;
  min-height: 44px;
}
.tab-item.active { color: var(--color-primary); }
.tab-item.featured { color: var(--color-tool); }
.tab-item.featured.active { color: var(--color-tool); }
.tab-item svg { flex-shrink: 0; }

/* ── First-visit tooltip ── */
.trip-tooltip {
  position: absolute;
  background: var(--color-primary);
  color: #fff;
  font-size: 11px;
  line-height: 1.4;
  padding: 8px 12px;
  border-radius: 8px;
  white-space: nowrap;
  pointer-events: none;
  z-index: 300;
  opacity: 0;
  transition: opacity 0.25s;
}
.trip-tooltip.visible { opacity: 1; }
.trip-tooltip::after {
  content: '';
  position: absolute;
  border: 5px solid transparent;
}
/* Sidebar: tooltip to the right of nav-item */
.nav-item { position: relative; }
.nav-item .trip-tooltip {
  left: calc(100% + 10px);
  top: 50%; transform: translateY(-50%);
}
.nav-item .trip-tooltip::after {
  right: 100%; top: 50%; transform: translateY(-50%);
  border-right-color: var(--color-primary);
}
/* Mobile: standalone fixed tooltip（tab bar 外，避免 iOS Safari overflow bug） */
#trip-tooltip-mobile {
  display: none;
  position: fixed;
  bottom: calc(80px + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-primary);
  color: #fff;
  font-size: 11px;
  line-height: 1.4;
  padding: 8px 12px;
  border-radius: 8px;
  white-space: nowrap;
  pointer-events: none;
  z-index: 500;
  opacity: 0;
  transition: opacity 0.25s;
}
#trip-tooltip-mobile.visible { opacity: 1; }
#trip-tooltip-mobile::after {
  content: '';
  position: absolute;
  top: 100%; left: 50%; transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--color-primary);
}

/* ── RWD 768px：側邊欄 → 底部 tab bar ── */
@media (max-width: 960px) {
  /* 顯示 tab bar */
  .tab-bar { display: flex; }

  /* Topnav：隱藏 tabs（底部 tab-bar 處理），只保留品牌列 */
  .topnav-divider-tabs, .topnav-tabs { display: none; }

  /* Shell 推到 safe area 下方（status bar / Dynamic Island） */
  .shell { padding-top: env(safe-area-inset-top, 0px); }

  /* 主內容留出 tab bar 空間 */
  .main { padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px)); }

  /* Page layout */
  .page { padding: 20px 16px; }
  /* Page-nav：固定置頂 */
  .page-nav { position: sticky; top: 0; height: 56px; padding: 0 12px; margin: -20px -16px 12px -16px; }
  .nav-dropdown { left: -16px; right: -16px; padding: 16px 16px; }
  /* Insight：mobile 顯示，改為自然高度（不限高） */
  .insight-panel { overflow-y: visible; max-height: none; }
  .setup-form { width: 100%; }
  /* 行程設定：縱向堆疊 */
  .trip-settings-row { flex-direction: column; }
  /* 本次行李：mobile 單欄，卡片橫向捲動 */
  .trip-wardrobe-grid { grid-template-columns: 1fr; }
  .trip-group-items { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  /* 紙娃娃：days-row 允許 wrap（讓 50%/100% 寬度生效）*/
  .days-row { flex-wrap: wrap; }
  /* 規劃：手機版 1 天/排（有換單品 UI，擠不下 2 欄）*/
  .result-day-col { flex: 0 0 100%; border-right: none; }
  /* 記錄：手機版 2 天/排（純瀏覽，無 swap UI）*/
  .history-day-col { flex: 0 0 50%; border-right: none; }
  .days-row .history-day-col:nth-child(odd) { border-right: 0.5px solid var(--color-border); }
  /* 手機版 mobile tooltip 顯示 */
  #trip-tooltip-mobile { display: block; }

  /* Trip nav：顯示 label + toggle button */
  .nav-mobile-toggle { display: flex; }
  .nav-mobile-page-label {
    display: block;
    font-size: 13px; font-weight: 500;
    color: var(--color-text-primary);
    white-space: nowrap; flex-shrink: 0;
    padding-right: 12px;
    border-right: 0.5px solid var(--color-border);
    margin-right: 4px;
  }

  /* Panel：預設隱藏，展開時絕對定位下拉 */
  .nav-mobile-panel {
    display: none;
    position: absolute;
    top: 100%; left: 0; right: 0;
    background: var(--color-surface);
    border-bottom: 0.5px solid var(--color-border);
    box-shadow: 0 4px 16px rgba(0,0,0,0.06);
    padding: 8px 12px;
    flex-direction: column;
    gap: 0;
    z-index: 99;
  }
  .trip-nav.mobile-expanded .nav-mobile-panel { display: flex; }

  .nav-mobile-panel .nav-chips-group { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; padding: 4px 0; flex: initial; justify-content: flex-start; }
  .nav-mobile-panel .nav-chips-group .nav-divider { display: none; }
  .nav-mobile-panel .nav-right { display: flex; flex-wrap: wrap; gap: 8px; border-top: 0.5px solid var(--color-border); padding: 8px 0 0; }
  .nav-mobile-panel .nav-right-divider { display: none; }

  /* 觸控按鈕最小高度 44px */
  .nav-action-btn, .nav-regen-btn { min-height: 44px; padding: 0 16px; font-size: 14px; border-radius: 8px; }

  /* Intro landing：hero 和卡片調整 */
  .intro-hero { margin-bottom: 24px; }
  .intro-cards { grid-template-columns: 1fr; gap: 10px; }
  .intro-card-thumb { height: 80px; }
}

/* ── RWD 640px：細部調整 ── */
@media (max-width: 640px) {
  /* 衣物格子：2 欄 */
  .clothes-grid { grid-template-columns: repeat(2, 1fr); }

  /* 刪除鈕：觸控裝置直接顯示 */
  .cloth-delete-btn { opacity: 0.65; }

  /* 篩選列：水平捲動，不換行 */
  .filter-row { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; -ms-overflow-style: none; }
  .filter-row::-webkit-scrollbar { display: none; }
  .filter-chip { flex-shrink: 0; }
  .total-count { display: none; }

  /* 下拉選單 + 加入按鈕：符合手指觸控尺寸 */
  .ctrl, .swap-select { height: 44px; border-radius: 8px; }
  .swap-select { font-size: 14px; padding: 8px 36px 8px 12px; background-size: 12px; background-position: right 12px center; }
  .swap-section { gap: 8px; margin-bottom: 8px; }
  .swap-section-label { font-size: 13px; min-width: 52px; }
  .trip-add-confirm { font-size: 14px; padding: 0 16px; }

  /* Bottom sheet：iPhone 底部安全區 */
  #add-sheet { padding-bottom: max(40px, env(safe-area-inset-bottom, 40px)) !important; }
}

/* ── Loading spinner ── */
@keyframes wardrobe-spin { to { transform: rotate(360deg); } }
.loading-wrap { padding: 48px 0; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.loading-spinner { width: 24px; height: 24px; border: 2px solid var(--color-border); border-top-color: var(--color-text-muted); border-radius: 50%; animation: wardrobe-spin 0.75s linear infinite; }
.loading-label { font-size: 12px; color: var(--color-text-muted); }

/* ── Repetition indicators ── */
.repeat-dot { position:relative; display:none; align-items:center; justify-content:center; width:16px; height:16px; border-radius:50%; background:#E67E22; color:#fff; font-size:10px; flex-shrink:0; cursor:default; line-height:1; }
.repeat-dot::after { content:attr(data-tip); position:absolute; bottom:calc(100% + 6px); left:50%; transform:translateX(-50%); background:rgba(30,30,30,0.88); color:#fff; font-size:11px; white-space:nowrap; padding:4px 8px; border-radius:6px; pointer-events:none; opacity:0; transition:opacity 0.15s; z-index:999; }
.repeat-dot:hover::after { opacity:1; }
.item-day-badge { position:absolute; bottom:4px; left:4px; font-size:10px; background:rgba(192,57,43,0.9); color:#fff; border-radius:999px; padding:0 4px; pointer-events:none; z-index:1; }
.repeat-warn { display:none; position:absolute; bottom:0; left:0; right:0; z-index:10; color:#c0392b; font-size:10px; text-align:center; padding:4px 8px; line-height:1.4; background:rgba(255,255,255,0.88); }

/* ── 上衣層等比例展開（container query + cqw）── */
/* 20cqw = 欄寬的 20%。窄格（欄 ≈ doll-body）效果同原本的 20%；
   寬格時 cqw 隨欄寬等比放大，inner/over 自然展開。
   !important 覆蓋 ssi() 的 inline style。 */
@container day-card (min-width: 0px) {
  .slot-inner { left: calc(50% - 66px - 20cqw) !important; }
  .slot-over  { left: calc(50% - 66px + 20cqw) !important; }
}
