/* ============================================
   Tripflare Custom Styles
   ============================================ */

:root {
  --brand-color: #2563eb;
  --brand-light: #dbeafe;
  --brand-border: #93c5fd;
  --danger-color: #dc2626;
  --danger-soft-bg: #fef2f2;
  --danger-soft-border: #fecaca;
  --success-color: #16a34a;
  --border-radius: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,.1), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md: 0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.06);
  --surface-strong: rgba(255,255,255,.72);
  --surface-overlay: rgba(0,0,0,.6);
}

[data-theme="dark"] {
  --brand-light: rgba(37, 99, 235, .18);
  --brand-border: rgba(147, 197, 253, .35);
  --danger-soft-bg: rgba(220, 38, 38, .16);
  --danger-soft-border: rgba(248, 113, 113, .32);
  --surface-strong: rgba(17,25,40,.72);
  --surface-overlay: rgba(15, 23, 42, .72);
}

/* ---- Layout ---- */
body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background-color .2s ease, color .2s ease;
  overflow-wrap: anywhere;
}

main.container {
  flex: 1;
  padding-top: 1.25rem;
  padding-bottom: 2.5rem;
}

footer.container-fluid {
  border-top: 1px solid var(--pico-muted-border-color);
  padding: 1rem;
  text-align: center;
}

/* ---- Nav ---- */
nav.container-fluid {
  border-bottom: 1px solid var(--pico-muted-border-color);
  position: sticky;
  top: 0;
  background: var(--pico-background-color);
  z-index: 100;
  padding-inline: 1rem;
}

.brand {
  font-size: 1rem;
  text-decoration: none;
}

.brand strong {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  min-width: 0;
  flex-wrap: wrap;
}

.brand-icon {
  width: 1.15rem;
  height: 1.15rem;
  display: block;
}

.nav-icon-link {
  display: flex;
  align-items: center;
  padding: .25rem;
  margin-right: .35rem;
  text-decoration: none;
  color: var(--pico-color);
  opacity: .75;
  transition: opacity .15s;
}

.nav-icon-link:hover {
  opacity: 1;
}

.nav-icon {
  width: 1.5rem;
  height: 1.5rem;
  display: block;
}

.inline-icon {
  width: .95rem;
  height: .95rem;
  display: inline-block;
  vertical-align: -0.14em;
  flex-shrink: 0;
}

.action-icon {
  width: 1rem;
  height: 1rem;
  display: block;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--pico-muted-border-color) 75%, transparent);
  background: color-mix(in srgb, var(--pico-card-background-color) 78%, transparent);
  color: color-mix(in srgb, var(--pico-color) 82%, var(--brand-color));
  backdrop-filter: blur(12px);
  box-shadow: 0 10px 24px rgba(15, 23, 42, .08);
  margin: 0;
  min-width: 2.5rem;
  transition: transform .18s ease, border-color .18s ease, background-color .18s ease, color .18s ease;
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
  transform: translateY(-1px);
  color: #f97316;
  border-color: color-mix(in srgb, #fb923c 45%, var(--pico-muted-border-color));
  background: color-mix(in srgb, #fff7ed 60%, var(--pico-card-background-color));
  box-shadow: 0 14px 30px rgba(249, 115, 22, .18);
}

[data-theme="dark"] .theme-toggle {
  background: color-mix(in srgb, #0f172a 70%, var(--pico-card-background-color));
  border-color: color-mix(in srgb, #334155 72%, transparent);
  color: #e2e8f0;
  box-shadow: 0 12px 28px rgba(2, 6, 23, .4);
}

[data-theme="dark"] .theme-toggle:hover,
[data-theme="dark"] .theme-toggle:focus-visible {
  color: #fb923c;
  border-color: color-mix(in srgb, #fb923c 35%, #475569);
  background: color-mix(in srgb, #1e293b 78%, #0f172a);
  box-shadow: 0 16px 36px rgba(249, 115, 22, .18);
}

.theme-toggle-icon-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1rem;
  height: 1rem;
}

.theme-toggle-icon {
  width: 1.05rem;
  height: 1.05rem;
  display: block;
}

.theme-toggle-label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.nav-logout-form {
  margin: 0;
  flex-shrink: 0;
}

.nav-logout-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  min-width: 2.5rem;
  padding: 0;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--danger-soft-border) 70%, transparent);
  background: color-mix(in srgb, var(--danger-soft-bg) 72%, var(--pico-card-background-color));
  color: var(--danger-color);
  box-shadow: none;
  transition: transform .18s ease, border-color .18s ease, background-color .18s ease;
  margin: 0;
}

.nav-logout-button:hover,
.nav-logout-button:focus-visible {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--danger-color) 35%, var(--danger-soft-border));
  background: color-mix(in srgb, var(--danger-soft-bg) 88%, transparent);
  color: var(--danger-color);
}

.nav-logout-button .action-icon {
  width: .95rem;
  height: .95rem;
  flex-shrink: 0;
}

[data-theme="dark"] .nav-logout-button {
  background: color-mix(in srgb, rgba(127, 29, 29, .5) 60%, var(--pico-card-background-color));
  border-color: color-mix(in srgb, rgba(248, 113, 113, .32) 75%, transparent);
}

/* ---- Auth ---- */
.auth-container {
  max-width: 480px;
  margin: 0 auto;
  padding-top: 1rem;
}

.auth-container hgroup {
  text-align: center;
  margin-bottom: 2rem;
}

.auth-switch {
  text-align: center;
  margin-top: 1rem;
  font-size: .9rem;
}

.auth-provider-stack {
  display: grid;
  gap: .75rem;
}

.auth-provider-button {
  width: 100%;
}

.auth-provider-button-apple {
  background: #111827;
  border-color: #111827;
}

.auth-provider-button-apple:hover,
.auth-provider-button-apple:focus-visible {
  background: #000;
  border-color: #000;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: .75rem;
  color: var(--pico-muted-color);
  font-size: .85rem;
  margin: 1rem 0;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--pico-muted-border-color);
}

.auth-divider span {
  white-space: nowrap;
}

.error-msg {
  color: var(--danger-color);
  background: var(--danger-soft-bg);
  border: 1px solid var(--danger-soft-border);
  border-radius: var(--border-radius);
  padding: .75rem 1rem;
  margin-bottom: 1rem;
}

.success-msg {
  color: var(--success-color);
  background: color-mix(in srgb, #dcfce7 88%, transparent);
  border: 1px solid color-mix(in srgb, #86efac 72%, transparent);
  border-radius: var(--border-radius);
  padding: .75rem 1rem;
  margin-bottom: 1rem;
}

[data-theme="dark"] .success-msg {
  background: color-mix(in srgb, rgba(20, 83, 45, .7) 68%, transparent);
  border-color: color-mix(in srgb, rgba(74, 222, 128, .35) 75%, transparent);
  color: #bbf7d0;
}

.section-eyebrow {
  margin: 0 0 .35rem;
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: .75rem;
  color: var(--brand-color);
  font-weight: 700;
}

.account-page {
  display: grid;
  gap: 1rem;
}

.account-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.account-page-header h1 {
  margin: 0;
}

.account-page-lead {
  margin: .5rem 0 0;
  color: var(--pico-muted-color);
}

.account-card {
  background: var(--pico-card-background-color);
  border: 1px solid var(--pico-muted-border-color);
  border-radius: var(--border-radius);
  padding: 1.1rem;
  box-shadow: var(--shadow);
  margin: 0;
}

.account-card h2 {
  margin-top: 0;
  margin-bottom: .75rem;
}

.account-meta {
  display: grid;
  gap: .85rem;
  margin: 0;
}

.account-meta div {
  display: grid;
  gap: .2rem;
}

.account-meta dt {
  color: var(--pico-muted-color);
  font-size: .85rem;
}

.account-meta dd {
  margin: 0;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.account-actions {
  display: grid;
  gap: .75rem;
}

.account-inline-note {
  margin: .75rem 0 0;
  color: var(--pico-muted-color);
  font-size: .9rem;
}

.account-theme-toggle {
  width: auto;
  min-width: 3rem;
}

.account-logout-form {
  margin: 0;
}

/* ---- Hero ---- */
.hero {
  padding: 1rem 0 2rem;
  text-align: center;
}

.hero h1 {
  font-size: 2rem;
  margin-bottom: .5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: .8rem;
  line-height: 1.2;
}

.hero-logo {
  width: 2rem;
  height: 2rem;
  color: var(--brand-color);
}

.hero-tagline {
  font-size: 1.1rem;
  color: var(--pico-muted-color);
  margin-bottom: 1rem;
  overflow-wrap: anywhere;
}

.hero-desc {
  font-size: 1rem;
  color: var(--pico-muted-color);
  margin-bottom: 2rem;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: stretch;
  margin-bottom: 3rem;
}

.hero-actions > * {
  width: 100%;
}

.hero-features {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-top: 2rem;
}

.feature-card {
  background: var(--pico-card-background-color);
  border: 1px solid var(--pico-muted-border-color);
  border-radius: var(--border-radius);
  padding: 1.5rem;
  text-align: center;
}

.feature-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border-radius: 999px;
  background: var(--brand-light);
  color: var(--brand-color);
  margin-bottom: .5rem;
}

.feature-icon-svg {
  width: 1.4rem;
  height: 1.4rem;
}

.feature-card h3 {
  margin: .5rem 0;
  font-size: 1.1rem;
}

.feature-card p {
  color: var(--pico-muted-color);
  font-size: .9rem;
  margin: 0;
  overflow-wrap: anywhere;
}

/* ---- Trip List ---- */
.trips-header {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  gap: 1rem;
}

.trips-header h1 {
  margin: 0;
  overflow-wrap: anywhere;
}

.trips-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-bottom: 2rem;
}

/* ---- Trip Card ---- */
.trip-card {
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform .15s, box-shadow .15s;
  margin: 0;
}

.trip-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.trip-card-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

.trip-card-cover {
  height: 160px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  position: relative;
  overflow: hidden;
}

.trip-card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.trip-card-cover-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: rgba(255,255,255,.92);
}

.cover-placeholder-icon {
  width: 3rem;
  height: 3rem;
}

.trip-card-badge {
  position: absolute;
  top: .5rem;
  right: .5rem;
  background: var(--surface-overlay);
  color: white;
  font-size: .75rem;
  padding: .2rem .5rem;
  border-radius: 4px;
}

.trip-card-body {
  padding: 1rem;
}

.trip-card-body h3 {
  margin: 0 0 .25rem;
  font-size: 1.1rem;
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow-wrap: anywhere;
}

.trip-card-dates {
  font-size: .85rem;
  color: var(--pico-muted-color);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .5rem;
  margin: 0 0 .5rem;
}

.trip-card-desc {
  font-size: .85rem;
  color: var(--pico-muted-color);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  margin: 0;
}

/* ---- Trip Detail ---- */
.trip-detail {}

.trip-hero {
  position: relative;
  margin-bottom: 1.5rem;
}

.trip-hero-cover {
  width: 100%;
  border-radius: var(--border-radius);
  overflow: hidden;
  margin-bottom: 1.5rem;
  background: var(--pico-muted-border-color);
}

.trip-hero-cover img {
  width: 100%;
  height: auto;
  max-height: 260px;
  object-fit: contain;
  object-position: center;
  display: block;
  margin: 0 auto;
}

.trip-hero-info h1 {
  margin-bottom: .5rem;
  overflow-wrap: anywhere;
}

.trip-dates {
  display: flex;
  align-items: flex-start;
  flex-direction: column;
  flex-wrap: wrap;
  gap: .5rem;
  color: var(--pico-muted-color);
  margin-bottom: .75rem;
}

.trip-duration {
  background: var(--brand-light);
  color: var(--brand-color);
  font-size: .8rem;
  padding: .2rem .6rem;
  border-radius: 999px;
  font-weight: 600;
}

.trip-desc {
  color: var(--pico-muted-color);
  overflow-wrap: anywhere;
}

.trip-hero-actions {
  display: flex;
  flex-direction: column;
  gap: .75rem;
  margin-top: 1rem;
  flex-wrap: wrap;
  align-items: stretch;
}

.trip-hero-actions > * {
  width: 100%;
}

/* ---- Day Tabs ---- */
.day-tabs-wrapper {
  overflow-x: auto;
  margin-bottom: 2rem;
  -webkit-overflow-scrolling: touch;
}

.day-tabs {
  display: flex;
  gap: .5rem;
  min-width: max-content;
  padding-bottom: .5rem;
  border-bottom: 2px solid var(--pico-muted-border-color);
}

.day-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: .5rem 1rem;
  border-radius: var(--border-radius) var(--border-radius) 0 0;
  text-decoration: none;
  color: var(--pico-muted-color);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color .15s;
  white-space: nowrap;
}

.day-tab:hover {
  color: var(--brand-color);
}

.day-tab.active {
  color: var(--brand-color);
  border-bottom-color: var(--brand-color);
  font-weight: 600;
}

.day-num {
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.day-date {
  font-size: .85rem;
}

/* ---- Day Timeline ---- */
.day-timeline {}

.day-header {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.day-header h3 {
  margin: 0;
  overflow-wrap: anywhere;
}

.day-label {
  color: var(--pico-muted-color);
  margin: .25rem 0 0;
  overflow-wrap: anywhere;
}

/* ---- Spot Card ---- */
.spots-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.spots-empty {
  text-align: center;
  color: var(--pico-muted-color);
  padding: 2rem;
  background: var(--pico-card-background-color);
  border: 2px dashed var(--pico-muted-border-color);
  border-radius: var(--border-radius);
}

.spot-card {
  display: flex;
  gap: .75rem;
  background: var(--pico-card-background-color);
  border: 1px solid var(--pico-muted-border-color);
  border-radius: var(--border-radius);
  padding: .75rem;
  box-shadow: var(--shadow);
  transition: box-shadow .15s, transform .15s, border-color .15s;
  cursor: default;
}

.spot-card.is-editable {
  cursor: pointer;
}

.spot-card.is-editable:hover,
.spot-card.is-editable:focus-visible {
  box-shadow: 0 10px 24px rgba(15, 23, 42, .08);
  border-color: var(--brand-border);
  transform: translateY(-1px);
}

.spot-card.is-editable:focus-visible {
  outline: 2px solid var(--brand-color);
  outline-offset: 2px;
}

.spot-timeline-node {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 5.75rem;
}

.spot-time {
  color: var(--pico-muted-color);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .08rem;
  text-align: left;
  min-height: 2.7rem;
  width: 100%;
}

.spot-time.is-single {
  justify-content: center;
}

.spot-time.has-range {
  justify-content: flex-start;
}

.spot-time-start,
.spot-time-end {
  display: block;
  width: 100%;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.spot-time-start {
  font-size: .98rem;
  font-weight: 700;
  line-height: 1.15;
  color: var(--pico-color);
}

.spot-time-end {
  font-size: .78rem;
  font-weight: 500;
  line-height: 1.15;
  color: var(--pico-muted-color);
}

.spot-dot {
  width: 2.5rem;
  height: 2.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--brand-light);
  color: var(--brand-color);
  margin-top: .25rem;
}

.spot-dot-icon {
  width: 1.15rem;
  height: 1.15rem;
}

.spot-content {
  flex: 1;
  min-width: 0;
}

.spot-main {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
}

.spot-body {
  flex: 1;
  min-width: 0;
}

.spot-header {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-start;
  gap: .5rem;
  margin-bottom: .5rem;
}

.spot-name {
  margin: 0;
  font-size: 1rem;
  overflow-wrap: anywhere;
}

.spot-category {
  font-size: .75rem;
  color: var(--pico-muted-color);
  background: var(--pico-muted-background-color);
  padding: .1rem .4rem;
  border-radius: 4px;
}

.spot-time-range {
  font-size: .75rem;
  color: var(--pico-muted-color);
  margin-left: 0;
  display: inline-block;
  margin-top: .25rem;
}

.spot-actions {
  display: flex;
  gap: .25rem;
  flex-shrink: 0;
}

.spot-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem .5rem;
  margin: .25rem 0 .4rem;
}

.spot-meta-item {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: .2rem .55rem;
  border-radius: 999px;
  background: var(--pico-muted-background-color);
  color: var(--pico-muted-color);
  font-size: .78rem;
  overflow-wrap: anywhere;
}

.spot-cost-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: .5rem;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  padding: .25rem .4rem;
  cursor: pointer;
  border-radius: 4px;
  font-size: 1rem;
  line-height: 1;
  color: var(--pico-muted-color);
  transition: background .15s;
  margin: 0;
  width: auto;
  min-width: unset;
  text-decoration: none;
}

.icon-btn:hover {
  background: var(--pico-muted-background-color);
}

.icon-btn.danger:hover {
  background: var(--danger-soft-bg);
}

.spot-notes {
  font-size: .9rem;
  color: var(--pico-color);
  margin: .5rem 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.spot-url {
  font-size: .85rem;
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  margin: .25rem 0;
  flex-wrap: wrap;
  overflow-wrap: anywhere;
}

.field-help {
  display: block;
  margin-top: .35rem;
  color: var(--pico-muted-color);
  font-size: .8rem;
  line-height: 1.5;
}

.spot-images {
  display: flex;
  flex: 0 0 auto;
  margin-top: 0;
}

.spot-image-wrapper {
  position: relative;
  width: 88px;
  height: 88px;
  border-radius: .75rem;
  overflow: hidden;
}

.spot-image-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.spot-image-wrapper form {
  position: absolute;
  top: 4px;
  right: 4px;
  margin: 0;
  z-index: 1;
  width: 24px;
  height: 24px;
}

.spot-image-delete {
  position: relative;
  appearance: none;
  -webkit-appearance: none;
  box-sizing: border-box;
  background: rgba(15, 23, 42, .84);
  color: white;
  border: 1px solid rgba(255,255,255,.72);
  border-radius: 50%;
  width: 24px;
  height: 24px;
  min-width: 24px;
  min-height: 24px;
  aspect-ratio: 1 / 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0;
  min-width: unset;
  box-shadow: 0 2px 8px rgba(15, 23, 42, .28);
  backdrop-filter: blur(2px);
  transition: background-color .15s ease, transform .15s ease, box-shadow .15s ease;
}

.spot-image-delete:hover,
.spot-image-delete:focus-visible {
  transform: translateY(-1px);
  background: rgba(185, 28, 28, .92);
  box-shadow: 0 4px 10px rgba(15, 23, 42, .32);
}

.spot-image-delete-icon {
  width: 12px;
  height: 12px;
  display: block;
  transform: translateY(0.5px);
}

/* ---- Spot Form ---- */
.spot-form {
  background: var(--pico-card-background-color);
  border: 1px solid var(--pico-muted-border-color);
  border-radius: var(--border-radius);
  padding: 1rem;
  box-shadow: var(--shadow);
}

.spot-form.has-sticky-actions {
  padding-bottom: 1.5rem;
}

.spot-form-actions {
  display: flex;
  flex-direction: row;
  gap: .75rem;
  margin-top: 1rem;
  flex-wrap: wrap;
  align-items: center;
}

.spot-form-actions.is-sticky {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  position: fixed;
  left: 50%;
  bottom: calc(env(safe-area-inset-bottom, 0px) + .75rem);
  transform: translateX(-50%);
  width: min(calc(100vw - 1.5rem), 704px);
  padding: .75rem;
  margin: 0;
  border: 1px solid var(--pico-muted-border-color);
  border-radius: 1rem;
  background: color-mix(in srgb, var(--pico-card-background-color) 92%, white 8%);
  box-shadow: 0 16px 40px rgba(15, 23, 42, .16);
  backdrop-filter: blur(12px);
  z-index: 40;
  align-items: stretch;
}

.spot-form-actions > * {
  width: auto;
  flex: 0 0 auto;
}

.spot-form-actions button,
.spot-form-actions a[role="button"] {
  display: inline-flex;
  width: auto;
  min-width: fit-content;
  flex: 0 0 auto;
}

.spot-form-actions.is-sticky > * {
  width: 100%;
  min-width: 0;
  flex: none;
}

.spot-form-actions.is-sticky button,
.spot-form-actions.is-sticky a[role="button"] {
  display: flex;
  width: 100%;
  min-width: 0;
  margin: 0;
  align-items: center;
  justify-content: center;
}

.required {
  color: var(--danger-color);
}

.spot-editor-page {
  max-width: 720px;
}

.spot-editor-page.has-fixed-save {
  padding-bottom: 7rem;
}

.spot-editor-header {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.spot-editor-eyebrow {
  margin: 0 0 .35rem;
  color: var(--brand-color);
  font-size: .85rem;
  font-weight: 600;
}

.spot-editor-meta {
  margin: .4rem 0 0;
  color: var(--pico-muted-color);
  overflow-wrap: anywhere;
}

.spot-editor-section {
  margin-top: 1.5rem;
  padding: 1rem;
  border: 1px solid var(--pico-muted-border-color);
  border-radius: var(--border-radius);
  background: var(--pico-card-background-color);
  box-shadow: var(--shadow);
}

.spot-editor-section h2 {
  margin-bottom: .35rem;
}

.spot-editor-section p {
  margin-top: 0;
  color: var(--pico-muted-color);
  overflow-wrap: anywhere;
}

.spot-editor-images {
  margin-bottom: 1rem;
}

.spot-editor-image {
  width: 96px;
  height: 96px;
}

.spot-image-upload-shell {
  position: relative;
  width: min(100%, 320px);
}

.spot-image-upload-form {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: .75rem;
}

.spot-image-upload-trigger {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  margin: 0;
  border-radius: 1rem;
  border: 1px dashed var(--pico-muted-border-color);
  background: var(--pico-card-sectioning-background-color);
  overflow: hidden;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.spot-image-upload-trigger img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.spot-image-upload-trigger input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.spot-image-upload-trigger.has-image {
  border-style: solid;
}

.spot-image-upload-empty,
.spot-image-upload-overlay {
  position: absolute;
  inset: 0;
  margin: 0;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  line-height: 1.5;
}

.spot-image-upload-empty {
  color: var(--pico-muted-color);
}

.spot-image-upload-overlay {
  background: linear-gradient(180deg, rgba(15, 23, 42, 0) 0%, rgba(15, 23, 42, .78) 100%);
  color: white;
  justify-content: flex-end;
  padding-bottom: 1.1rem;
}

.spot-image-upload-trigger:hover .spot-image-upload-overlay,
.spot-image-upload-trigger:focus-within .spot-image-upload-overlay {
  background: linear-gradient(180deg, rgba(15, 23, 42, .08) 0%, rgba(15, 23, 42, .86) 100%);
}

.spot-image-upload-help {
  margin: 0;
}

.spot-image-delete-form {
  position: absolute;
  top: .5rem;
  right: .5rem;
  margin: 0;
  z-index: 1;
  width: 24px;
  height: 24px;
}

.spot-editor-danger {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: space-between;
  gap: 1rem;
}

/* ---- Shared View ---- */
.shared-view .shared-banner {
  background: var(--brand-light);
  border: 1px solid var(--brand-border);
  border-radius: var(--border-radius);
  padding: .75rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
  font-size: .9rem;
  color: var(--brand-color);
}

.shared-view .shared-banner span {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  flex-wrap: wrap;
  overflow-wrap: anywhere;
}

.trip-cost-summary {
  margin-bottom: 1.5rem;
  padding: 1rem;
  border: 1px solid var(--pico-muted-border-color);
  border-radius: var(--border-radius);
  background: var(--pico-card-background-color);
  box-shadow: var(--shadow);
}

.trip-cost-summary-header {
  display: flex;
  flex-direction: column;
  gap: .35rem;
  margin-bottom: 1rem;
}

.trip-cost-summary-header h2 {
  margin: 0;
  font-size: 1.05rem;
  display: inline-flex;
  align-items: center;
  gap: .45rem;
}

.trip-cost-summary-header h2 .inline-icon {
  width: 1.15rem;
  height: 1.15rem;
  vertical-align: middle;
}

.trip-cost-summary-header p {
  margin: 0;
  color: var(--pico-muted-color);
}

.trip-cost-summary-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: .75rem;
}

.trip-cost-card {
  margin: 0;
  padding: 1rem;
  border-radius: var(--border-radius);
  background: var(--pico-muted-background-color);
}

.trip-cost-card h3 {
  margin: 0 0 .35rem;
  font-size: .95rem;
}

.trip-cost-total,
.trip-cost-per-person {
  margin: 0;
  color: var(--pico-muted-color);
}

.success-msg {
  color: var(--success-color);
  background: color-mix(in srgb, var(--success-color) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--success-color) 30%, transparent);
  border-radius: var(--border-radius);
  padding: .75rem 1rem;
  margin-bottom: 1rem;
}

.invite-panel {
  margin-bottom: 1.5rem;
}

.member-list-section h2 {
  margin-bottom: .75rem;
}

.member-list {
  display: flex;
  flex-direction: column;
  gap: .75rem;
  margin-bottom: 1.5rem;
}

.member-card {
  display: flex;
  flex-direction: column;
  gap: .75rem;
  padding: 1rem;
  border: 1px solid var(--pico-muted-border-color);
  border-radius: var(--border-radius);
  background: var(--pico-card-background-color);
  box-shadow: var(--shadow);
}

.member-card p {
  margin: .2rem 0 0;
  color: var(--pico-muted-color);
  overflow-wrap: anywhere;
}

.member-card-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: .5rem;
}

.member-role-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  max-width: 100%;
  padding: .2rem .55rem;
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 600;
  background: var(--pico-muted-background-color);
  color: var(--pico-muted-color);
}

.member-role-badge.owner {
  background: var(--brand-light);
  color: var(--brand-color);
}

.member-role-badge.editor {
  background: color-mix(in srgb, var(--success-color) 14%, transparent);
  color: var(--success-color);
}

/* ---- Form Container ---- */
.form-container {
  max-width: 640px;
  margin: 0 auto;
}

.form-actions {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

.form-actions > * {
  width: 100%;
}

.cover-editor-section {
  margin-top: 1.5rem;
  padding: 1rem;
  border: 1px solid var(--pico-muted-border-color);
  border-radius: var(--border-radius);
  background: var(--pico-card-background-color);
  box-shadow: var(--shadow);
}

.cover-image-upload-form {
  display: flex;
  flex-direction: column;
  gap: .75rem;
}

.cover-upload-trigger {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  margin: 0;
  border-radius: 1rem;
  border: 1px dashed var(--pico-muted-border-color);
  background: var(--pico-card-sectioning-background-color);
  overflow: hidden;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.cover-upload-trigger img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.cover-upload-trigger input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.cover-upload-trigger.has-image {
  border-style: solid;
}

.cover-upload-empty,
.cover-upload-overlay {
  position: absolute;
  inset: 0;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  line-height: 1.5;
}

.cover-upload-empty {
  color: var(--pico-muted-color);
}

.cover-upload-overlay {
  background: linear-gradient(180deg, rgba(15, 23, 42, 0) 0%, rgba(15, 23, 42, .78) 100%);
  color: white;
  justify-content: flex-end;
  padding-bottom: 1.1rem;
}

.cover-upload-trigger:hover .cover-upload-overlay,
.cover-upload-trigger:focus-within .cover-upload-overlay {
  background: linear-gradient(180deg, rgba(15, 23, 42, .08) 0%, rgba(15, 23, 42, .86) 100%);
}

/* ---- Danger Zone ---- */
.danger-zone {
  padding: 1.5rem;
  border: 1px solid var(--danger-soft-border);
  border-radius: var(--border-radius);
  background: var(--danger-soft-bg);
  overflow-wrap: anywhere;
}

.danger-zone form {
  margin: 0;
}

.danger-zone h3 {
  color: var(--danger-color);
  margin-bottom: 1rem;
}

/* ---- Empty State ---- */
.empty-state {
  text-align: center;
  padding: 2.5rem 1rem;
}

.empty-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 4.5rem;
  height: 4.5rem;
  margin-inline: auto;
  margin-bottom: 1rem;
  color: var(--brand-color);
  background: var(--brand-light);
  border-radius: 999px;
}

.empty-icon-svg {
  width: 2rem;
  height: 2rem;
}

.auth-logo {
  width: 1.6rem;
  height: 1.6rem;
  color: var(--brand-color);
}

/* ---- Share URL Box ---- */
.share-url-box {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  margin-bottom: 1.5rem;
}

.share-url-box input {
  flex: 1;
  margin: 0;
  min-width: 0;
}

.share-url-box button {
  flex-shrink: 0;
  margin: 0;
  width: 100%;
}

/* ---- Utility ---- */
a[role="button"].small,
button.small,
[type="submit"].small {
  --pico-form-element-spacing-vertical: .35rem;
  --pico-form-element-spacing-horizontal: .75rem;
  padding: .35rem .75rem;
  font-size: .85rem;
  line-height: 1.5;
}

/* ---- Responsive ---- */
@media (min-width: 601px) {
  main.container {
    padding-top: 2rem;
    padding-bottom: 4rem;
  }

  footer.container-fluid {
    padding: 1rem 2rem;
  }

  .hero {
    padding: 3rem 0;
  }

  .hero h1 {
    font-size: 3rem;
    display: inline-flex;
  }

  .hero-logo {
    width: 2.4rem;
    height: 2.4rem;
  }

  .hero-tagline {
    font-size: 1.4rem;
  }

  .hero-desc {
    font-size: 1.1rem;
  }

  .hero-actions {
    flex-direction: row;
    justify-content: center;
    align-items: center;
  }

  .hero-actions > * {
    width: auto;
  }

  .hero-features {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
  }

  .trips-header {
    flex-direction: row;
    align-items: center;
  }

  .account-page {
    gap: 1.25rem;
  }

  .account-page-header {
    align-items: center;
  }

  .trips-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
  }

  .trip-hero-cover img {
    max-height: 420px;
  }

  .trip-dates {
    flex-direction: row;
    align-items: center;
    gap: .75rem;
  }

  .trip-hero-actions {
    flex-direction: row;
    align-items: center;
  }

  .trip-hero-actions > * {
    width: auto;
  }

  .day-header {
    flex-direction: row;
    align-items: flex-start;
  }

  .spot-card {
    gap: 1rem;
    padding: 1rem;
  }

  .spot-timeline-node {
    min-width: 52px;
  }

  .spot-header {
    flex-direction: row;
  }

  .spot-time-range {
    margin-left: .5rem;
    margin-top: 0;
  }

  .spot-image-wrapper {
    width: 96px;
    height: 96px;
  }

  .spot-form {
    padding: 1.5rem;
  }

  .spot-form-actions {
    flex-direction: row;
  }

  .spot-form-actions.is-sticky {
    width: min(calc(100vw - 2rem), 688px);
  }

  .spot-form-actions > * {
    width: auto;
  }

  .spot-editor-header {
    flex-direction: row;
    align-items: flex-start;
  }

  .spot-editor-section {
    padding: 1.5rem;
  }

  .spot-editor-image {
    width: 120px;
    height: 120px;
  }

  .spot-image-upload-shell {
    width: min(100%, 360px);
  }

  .spot-editor-danger {
    flex-direction: row;
    align-items: center;
  }

  .shared-view .shared-banner {
    flex-direction: row;
    align-items: center;
  }

  .trip-cost-summary-header {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .trip-cost-summary-list {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  }

  .form-actions {
    flex-direction: row;
  }

  .form-actions > * {
    width: auto;
  }

  .empty-state {
    padding: 4rem 2rem;
  }

  .share-url-box {
    flex-direction: row;
  }

  .share-url-box button {
    width: auto;
  }

  .member-card {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .member-card-actions {
    flex-direction: row;
    align-items: center;
  }
}

@media (min-width: 769px) {
  nav.container-fluid {
    padding-inline: var(--pico-nav-element-spacing-horizontal);
  }

  nav.container-fluid > ul:last-child {
    gap: .5rem;
    flex-wrap: wrap;
    justify-content: flex-end;
  }
}

/* ---- Packing List ---- */
.packing-page {
  max-width: 600px;
  margin: 0 auto;
}

.packing-header {
  margin-bottom: 1.5rem;
}

.packing-header h1 {
  margin: .5rem 0 0;
  font-size: 1.5rem;
}

.packing-member-tabs {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
  margin-bottom: .6rem;
}

.packing-member-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.25rem;
  padding: .45rem .8rem;
  border-radius: 999px;
  border: 1px solid var(--pico-muted-border-color);
  background: var(--pico-card-background-color);
  color: var(--pico-color);
  text-decoration: none;
  font-size: .9rem;
}

.packing-member-tab.active {
  border-color: var(--brand-color);
  background: var(--brand-light);
  color: var(--brand-color);
}

.packing-owner-note {
  margin: 0 0 1rem;
  font-size: .9rem;
  color: var(--pico-muted-color);
}

.back-link {
  font-size: .875rem;
  color: var(--pico-muted-color);
  text-decoration: none;
}

.back-link:hover {
  color: var(--pico-color);
}

.packing-add-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: .5rem;
  margin-bottom: 1.5rem;
}

.packing-add-input {
  min-width: 0;
  margin: 0;
}

.packing-add-form button {
  width: auto;
  margin: 0;
  white-space: nowrap;
  padding-inline: .9rem;
  align-self: start;
}

.packing-empty {
  text-align: center;
  padding: 2rem;
  color: var(--pico-muted-color);
  border: 2px dashed var(--pico-muted-border-color);
  border-radius: var(--border-radius);
}

.packing-list {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
  display: flex;
  flex-direction: column;
  gap: .25rem;
}

.packing-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: .75rem;
  padding: .6rem .75rem;
  border-radius: var(--border-radius);
  background: var(--pico-card-background-color);
  border: 1px solid var(--pico-muted-border-color);
}

.packing-item--checked {
  opacity: .6;
}

.packing-item-name {
  min-width: 0;
  font-size: .95rem;
  overflow-wrap: anywhere;
}

.packing-item--checked .packing-item-name {
  text-decoration: line-through;
  color: var(--pico-muted-color);
}

.packing-check-form,
.packing-delete-form {
  margin: 0;
  display: flex;
  align-items: center;
}

.packing-edit-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: .5rem;
  align-items: center;
  margin: 0;
}

.packing-edit-input {
  min-width: 0;
  margin: 0;
}

.packing-item-actions {
  display: flex;
  align-items: center;
  gap: .2rem;
}

.packing-action-btn {
  color: var(--pico-color);
  opacity: .82;
}

.packing-action-btn:hover,
.packing-action-btn:focus-visible {
  opacity: 1;
}

.packing-action-btn .icon-btn-icon {
  width: 1rem;
  height: 1rem;
  display: block;
}

.packing-delete-btn {
  color: var(--danger-color);
  opacity: 1;
}

.packing-delete-btn:hover,
.packing-delete-btn:focus-visible {
  background: var(--danger-soft-bg);
}

@media (max-width: 768px) {
  .packing-item--editing {
    grid-template-columns: minmax(0, 1fr);
    justify-items: center;
  }

  .packing-item--editing .packing-check-form,
  .packing-item--editing .packing-item-actions {
    display: none;
  }

  .packing-item--editing .packing-edit-form {
    width: 100%;
    grid-template-columns: minmax(0, 1fr) auto;
    justify-items: stretch;
  }

  .packing-item--editing .packing-edit-input {
    width: 100%;
  }

  .packing-item--editing .packing-edit-form button {
    width: auto;
    min-width: 6rem;
    justify-self: start;
  }
}

.packing-checkbox {
  appearance: none;
  -webkit-appearance: none;
  box-sizing: border-box;
  inline-size: 1.6rem;
  block-size: 1.6rem;
  width: 1.6rem;
  height: 1.6rem;
  min-width: 1.6rem;
  min-height: 1.6rem;
  max-width: 1.6rem;
  max-height: 1.6rem;
  aspect-ratio: 1 / 1;
  border: 2px solid var(--pico-muted-border-color);
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
  padding: 0;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: border-color .15s, background .15s;
}

.packing-checkbox-box {
  display: block;
  position: relative;
  width: .7rem;
  height: .7rem;
  border-radius: 2px;
}

.packing-checkbox:hover {
  border-color: var(--brand-color);
}

.packing-checkbox--checked {
  background: var(--brand-color);
  border-color: var(--brand-color);
}

.packing-checkbox--checked .packing-checkbox-box::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 45%;
  width: .32rem;
  height: .55rem;
  border: 2px solid #fff;
  border-top: none;
  border-left: none;
  transform: translate(-50%, -50%) rotate(45deg);
}

.packing-checkbox--readonly {
  cursor: default;
}

.packing-checked-label {
  font-size: .8rem;
  color: var(--pico-muted-color);
  margin: 1rem 0 .5rem;
  text-transform: uppercase;
  letter-spacing: .05em;
}

/* ---- Trip Bottom Nav ---- */
.trip-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  background: var(--pico-background-color);
  border-top: 1px solid var(--pico-muted-border-color);
  z-index: 100;
  padding-bottom: env(safe-area-inset-bottom);
}

.trip-bottom-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .2rem;
  padding: .6rem .5rem;
  text-decoration: none;
  color: var(--pico-muted-color);
  font-size: .7rem;
  transition: color .15s;
}

.trip-bottom-nav-item:hover {
  color: var(--pico-color);
}

.trip-bottom-nav-item--active {
  color: var(--brand-color);
}

.trip-bottom-nav-icon {
  width: 1.4rem;
  height: 1.4rem;
  display: block;
}

/* フッターナビ分の余白 */
.trip-detail,
.packing-page {
  padding-bottom: 5rem;
}

.packing-trip-name {
  color: var(--pico-muted-color);
  font-size: .875rem;
  margin: .1rem 0 0;
}
