/* Japan 2026-2027 Family Travel Hub — Winter Japan Rail & Field Guide Theme */
:root {
  --bg: #F5F7FA;
  --surface: #FFFFFF;
  --surface-subtle: #EDF1F6;
  --ink: #122031;
  --muted: #526277;
  --accent: #C83E2B;
  --accent-soft: #FDF0EE;
  --teal: #0F766E;
  --teal-soft: #EAF7F5;
  --amber: #B45309;
  --amber-soft: #FEF4E6;
  --slate-blue: #1D4E89;
  --slate-blue-soft: #EBF3FC;
  --border: #D9E1EC;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --font-display: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

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

html {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  margin: 0;
  color: var(--ink);
  letter-spacing: -0.02em;
}

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

.tabular {
  font-variant-numeric: tabular-nums;
}

/* ── Login Gate ── */
.gate-shell {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 18% 15%, rgba(200, 62, 43, 0.08), transparent 42%),
    radial-gradient(circle at 82% 85%, rgba(15, 118, 110, 0.08), transparent 45%),
    var(--bg);
}

.gate-card {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
}

.gate-mark {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 14px;
}

.gate-card h1 {
  font-size: 1.55rem;
  line-height: 1.2;
  margin-bottom: 8px;
}

.gate-card p {
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 0.94rem;
}

.gate-error {
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid rgba(200, 62, 43, 0.25);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 0.88rem;
  margin-bottom: 16px;
}

.field-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 6px;
}

.text-input {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: 0.96rem;
  transition: border-color 0.15s ease;
}

.text-input:focus {
  outline: 2px solid var(--slate-blue);
  outline-offset: 1px;
  border-color: var(--slate-blue);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 0.9rem;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.btn:focus-visible {
  outline: 2px solid var(--slate-blue);
  outline-offset: 2px;
}

.btn-primary {
  background: var(--ink);
  color: #FFFFFF;
}

.btn-primary:hover {
  background: #1D324C;
}

.btn-accent {
  background: var(--accent);
  color: #FFFFFF;
}

.btn-accent:hover {
  background: #AD3423;
}

.btn-outline {
  background: var(--surface);
  border-color: var(--border);
  color: var(--ink);
}

.btn-outline:hover {
  background: var(--surface-subtle);
}

.btn-sm {
  padding: 6px 11px;
  font-size: 0.82rem;
}

.btn-full {
  width: 100%;
  margin-top: 14px;
}

/* ── Top Navigation Bar ── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

.brand-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  white-space: nowrap;
}

.brand-sub {
  font-size: 0.82rem;
  color: var(--muted);
  white-space: nowrap;
}

.nav-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  max-width: 100%;
  scrollbar-width: none;
}

.nav-tabs::-webkit-scrollbar {
  display: none;
}

.nav-tab {
  background: transparent;
  border: 1px solid transparent;
  color: var(--muted);
  padding: 8px 13px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.88rem;
  white-space: nowrap;
  cursor: pointer;
}

.nav-tab:hover {
  color: var(--ink);
  background: var(--surface-subtle);
}

.nav-tab[aria-selected="true"] {
  background: var(--ink);
  color: #FFFFFF;
}

/* ── Main Container & Hero ── */
.main-wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 24px 20px 64px;
}

.hero-strip {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  padding-bottom: 20px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.hero-strip h1 {
  font-size: clamp(1.45rem, 3vw, 2rem);
  line-height: 1.15;
  margin-bottom: 6px;
}

.hero-sub {
  margin: 0;
  color: var(--muted);
  font-size: 0.94rem;
}

.countdown-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
  font-size: 0.86rem;
  white-space: nowrap;
}

.view-panel {
  display: none;
}

.view-panel.is-active {
  display: block;
}

/* ── Section Toolbar ── */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.chip-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.chip {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.83rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}

.chip:hover {
  border-color: var(--ink);
  color: var(--ink);
}

.chip.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #FFFFFF;
}

/* Expand / Collapse All toggle label pattern (modern-web-guidance accordion) */
[command="--toggle-all"][aria-expanded="true"] .expand-label,
[command="--toggle-all"][aria-expanded="false"] .collapse-label {
  display: none;
}

/* ── Itinerary Cards ── */
.itinerary-list {
  display: grid;
  gap: 14px;
}

.day-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 20px;
}

.day-card[hidden] {
  display: none;
}

.day-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.day-date-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.day-date {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 3px 10px;
  border-radius: 6px;
  white-space: nowrap;
}

.region-tag {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--slate-blue);
  background: var(--slate-blue-soft);
  padding: 3px 9px;
  border-radius: 6px;
  white-space: nowrap;
}

.status-badge {
  font-size: 0.78rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 6px;
  white-space: nowrap;
}

.status-confirmed, .status-paid {
  background: var(--teal-soft);
  color: var(--teal);
}

.status-unpaid, .status-tentative {
  background: var(--amber-soft);
  color: var(--amber);
}

.day-title {
  font-size: 1.08rem;
  margin-bottom: 8px;
}

.day-meta {
  display: grid;
  gap: 6px;
  font-size: 0.9rem;
  color: var(--ink);
  margin-bottom: 12px;
}

.meta-row {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 10px;
  align-items: baseline;
}

.meta-key {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
}

.ref-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.ref-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  font-size: 0.8rem;
  cursor: pointer;
  white-space: nowrap;
}

.ref-pill:hover {
  border-color: var(--ink);
}

.ref-pill strong {
  color: var(--ink);
}

.ref-pill span {
  color: var(--muted);
}

/* ── Modern Native <details> Accordion for "Why / Reasoning" ── */
.why-details {
  border-top: 1px dashed var(--border);
  padding-top: 10px;
}

.why-details > summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.5ch;
  cursor: pointer;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--slate-blue);
  user-select: none;
}

.why-details > summary::-webkit-details-marker {
  display: none;
}

.why-details > summary::before {
  content: "";
  inline-size: 1em;
  block-size: 1em;
  flex-shrink: 0;
  background-color: currentColor;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") no-repeat center / contain;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") no-repeat center / contain;
  rotate: -90deg;
}

.why-details[open] > summary::before {
  rotate: 0deg;
}

@media (prefers-reduced-motion: no-preference) {
  .why-details > summary::before {
    transition: rotate 0.2s ease;
  }
}

.why-details::details-content {
  interpolate-size: allow-keywords;
  overflow: clip;
  contain: layout;
}

.why-details:not([open])::details-content {
  block-size: 0;
}

@media (prefers-reduced-motion: no-preference) {
  .why-details::details-content {
    transition: block-size, content-visibility, display;
    transition-duration: 0.25s;
    transition-timing-function: ease-in-out;
    transition-behavior: allow-discrete;
  }
}

.why-body {
  margin-top: 8px;
  padding: 12px 14px;
  background: var(--slate-blue-soft);
  border-left: 3px solid var(--slate-blue);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 0.9rem;
  color: var(--ink);
  max-width: 76ch;
}

/* ── Responsive Data Tables (modern-web-guidance responsive-table) ── */
.table-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 20px;
}

.table-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.table-card-head h2 {
  font-size: 1.08rem;
}

.table-wrapper {
  overflow: auto;
  max-inline-size: 100%;
  max-block-size: min(640px, 75vh);
  container-type: inline-size;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.table-wrapper:focus-visible {
  outline: 2px solid var(--slate-blue);
  outline-offset: 2px;
}

.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.88rem;
  text-align: left;
}

.data-table caption {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

.data-table thead {
  position: sticky;
  inset-block-start: 0;
  z-index: 2;
}

.data-table thead th {
  background: var(--surface-subtle);
  color: var(--ink);
  font-weight: 700;
  padding: 11px 12px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.data-table tbody th {
  position: sticky;
  inset-inline-start: 0;
  z-index: 1;
  background: var(--surface);
  font-weight: 700;
  padding: 11px 12px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  vertical-align: top;
}

.data-table tbody td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.data-table tbody tr:last-child th,
.data-table tbody tr:last-child td {
  border-bottom: 0;
}

.data-table .num {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.plan-table {
  --col-2: "Route & Transport";
  --col-3: "Accommodation";
  --col-4: "Status";
}

.budget-table {
  --col-2: "Category";
  --col-3: "Dates";
  --col-4: "Status";
  --col-5: "PHP";
  --col-6: "JPY / Notes";
}

@container (width < 680px) {
  .data-table,
  .data-table thead,
  .data-table tbody,
  .data-table tr,
  .data-table th,
  .data-table td {
    display: block;
  }

  .data-table thead {
    display: none;
  }

  .data-table tbody tr {
    margin-block-end: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
  }

  .data-table tbody th {
    position: sticky;
    inset-block-start: 0;
    z-index: 2;
    background: var(--surface-subtle);
    border-bottom: 1px solid var(--border);
    white-space: normal;
  }

  .data-table tbody td {
    border-bottom: 1px solid var(--surface-subtle);
    text-align: left;
  }

  .data-table .num {
    text-align: left;
  }

  .data-table td:nth-child(2)::before { content: var(--col-2) ": "; font-weight: 700; color: var(--muted); }
  .data-table td:nth-child(3)::before { content: var(--col-3) ": "; font-weight: 700; color: var(--muted); }
  .data-table td:nth-child(4)::before { content: var(--col-4) ": "; font-weight: 700; color: var(--muted); }
  .data-table td:nth-child(5)::before { content: var(--col-5) ": "; font-weight: 700; color: var(--muted); }
  .data-table td:nth-child(6)::before { content: var(--col-6) ": "; font-weight: 700; color: var(--muted); }
}

/* ── Contacts & Checklist Grid ── */
.two-col {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 16px;
}

.info-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 20px;
}

.info-card h3 {
  font-size: 1rem;
  margin-bottom: 12px;
}

.contact-list {
  display: grid;
  gap: 10px;
}

.contact-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--surface-subtle);
}

.contact-item:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.contact-name {
  font-weight: 600;
  font-size: 0.9rem;
}

.contact-extra {
  font-size: 0.82rem;
  color: var(--muted);
}

.clean-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 8px;
  font-size: 0.9rem;
}

/* ── Reminders & Family Notes ── */
.reminder-list {
  display: grid;
  gap: 10px;
  margin-bottom: 24px;
}

.reminder-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
}

.reminder-item.is-done {
  opacity: 0.62;
  background: var(--surface-subtle);
}

.reminder-item.is-done .rem-title {
  text-decoration: line-through;
}

.rem-check {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  accent-color: var(--teal);
  cursor: pointer;
}

.rem-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.rem-due {
  font-size: 0.78rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 5px;
  background: var(--surface-subtle);
  color: var(--ink);
  white-space: nowrap;
}

.rem-due.urgency-high {
  background: var(--accent-soft);
  color: var(--accent);
}

.rem-due.urgency-medium {
  background: var(--amber-soft);
  color: var(--amber);
}

.rem-title {
  font-weight: 700;
  font-size: 0.95rem;
}

.rem-detail {
  margin: 4px 0 0;
  font-size: 0.87rem;
  color: var(--muted);
}

.note-form {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}

.note-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.notes-list {
  display: grid;
  gap: 10px;
}

.note-card {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.note-meta {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--slate-blue);
  margin-bottom: 4px;
}

.note-text {
  font-size: 0.9rem;
  margin: 0;
}

/* ── Budget & Cost Analysis ── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 18px;
}

.kpi-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 6px;
}

.kpi-value {
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  margin-bottom: 4px;
}

.kpi-value.is-teal { color: var(--teal); }
.kpi-value.is-amber { color: var(--amber); }

.kpi-sub {
  font-size: 0.8rem;
  color: var(--muted);
}

.bar-chart {
  display: grid;
  gap: 12px;
}

.bar-row {
  display: grid;
  gap: 5px;
}

.bar-label-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.86rem;
  font-weight: 600;
}

.bar-track {
  height: 10px;
  border-radius: 999px;
  background: var(--surface-subtle);
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: 999px;
}

.converter-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

/* ── Single Shared Toast Stack (Zero Overlap Rule) ── */
#appToastStack {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 40vh;
  overflow-y: auto;
  pointer-events: none;
}

.app-toast {
  pointer-events: auto;
  background: var(--ink);
  color: #FFFFFF;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(18, 32, 49, 0.22);
}

@media (max-width: 640px) {
  .meta-row {
    grid-template-columns: 1fr;
    gap: 2px;
  }
  .note-form-row,
  .converter-grid {
    grid-template-columns: 1fr;
  }
}


/* ── Ambient Interactive Snow & 3D Festive Winter Hero ── */
#bgSnowCanvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.topbar,
.main-wrap {
  position: relative;
  z-index: 1;
}

.topbar {
  padding-top: env(safe-area-inset-top, 0px);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.festive-hero {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: linear-gradient(135deg, #0E1D34 0%, #163052 55%, #1E3E66 100%);
  border: 1px solid rgba(255, 255, 255, 0.14);
  margin-bottom: 24px;
  color: #FFFFFF;
}

.festive-hero.is-collapsed .festive-stage {
  display: none;
}

.festive-stage {
  width: 100%;
  height: clamp(210px, 30vw, 290px);
  display: block;
  cursor: grab;
  touch-action: pan-y;
}

.festive-stage:active {
  cursor: grabbing;
}

.festive-stage canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
}

.festive-overlay {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 16px 20px;
  background: linear-gradient(180deg, rgba(14, 29, 52, 0.15) 0%, rgba(14, 29, 52, 0.92) 100%);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.festive-overlay h1 {
  color: #FFFFFF;
  font-size: clamp(1.3rem, 2.8vw, 1.85rem);
  line-height: 1.15;
  margin-bottom: 4px;
}

.festive-overlay .hero-sub {
  color: #CBD5E1;
  font-size: 0.88rem;
}

.festive-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-glass {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #FFFFFF;
}

.btn-glass:hover {
  background: rgba(255, 255, 255, 0.22);
}

.festive-overlay .countdown-pill {
  background: rgba(200, 62, 43, 0.92);
  color: #FFFFFF;
}

/* ── Interactive 3D Calendar View ── */
.cal-legend {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  flex-shrink: 0;
}

.dot-flights { background: #1D4E89; }
.dot-fuji { background: #C83E2B; }
.dot-sapporo { background: #0F766E; }
.dot-niseko { background: #D97706; }
.dot-furano { background: #0284C7; }
.dot-manila { background: #475569; }
.dot-payment { background: #991B1B; }

.cal-months-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
  gap: 18px;
  perspective: 1100px;
  margin-bottom: 20px;
}

.cal-3d-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  transform-style: preserve-3d;
  transition: transform 0.22s ease-out, box-shadow 0.22s ease-out;
  box-shadow: 0 10px 26px rgba(18, 32, 49, 0.06);
}

.cal-month-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.cal-month-head h2 {
  font-size: 1.05rem;
}

.cal-month-sub {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
}

.cal-weekdays,
.cal-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.cal-weekdays span {
  text-align: center;
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--muted);
  padding-bottom: 6px;
}

.cal-cell {
  min-height: 54px;
  border-radius: 9px;
  border: 1px solid transparent;
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 4px 2px;
  color: var(--muted);
  font-size: 0.84rem;
  font-variant-numeric: tabular-nums;
}

.cal-cell.is-empty {
  pointer-events: none;
}

.cal-cell.is-marked {
  cursor: pointer;
  color: #FFFFFF;
  font-weight: 700;
  border-color: rgba(255, 255, 255, 0.22);
  box-shadow: 0 4px 10px rgba(18, 32, 49, 0.14);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.cal-cell.is-marked:hover {
  transform: translateY(-2px) translateZ(12px);
  box-shadow: 0 8px 16px rgba(18, 32, 49, 0.22);
}

.cal-cell.is-marked.is-selected {
  outline: 3px solid var(--ink);
  outline-offset: 2px;
  transform: translateY(-3px) translateZ(18px);
}

.cal-cell.reg-flights { background: #1D4E89; }
.cal-cell.reg-fuji { background: #C83E2B; }
.cal-cell.reg-sapporo { background: #0F766E; }
.cal-cell.reg-niseko { background: linear-gradient(135deg, #D97706, #B45309); }
.cal-cell.reg-furano { background: #0284C7; }
.cal-cell.reg-manila { background: #475569; }
.cal-cell.reg-payment {
  background: #FEF2F2;
  color: #991B1B;
  border: 1.5px dashed #C83E2B;
  box-shadow: none;
}

.cal-num {
  font-size: 0.88rem;
  line-height: 1.1;
}

.cal-tag {
  font-size: 0.62rem;
  font-weight: 700;
  line-height: 1.1;
  opacity: 0.95;
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cal-spotlight {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
}

.cal-spotlight-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

/* ── Native PWA Install Dialog ── */
.pwa-dialog {
  width: min(440px, calc(100vw - 32px));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 24px 60px rgba(18, 32, 49, 0.25);
}

.pwa-dialog::backdrop {
  background: rgba(18, 32, 49, 0.55);
  backdrop-filter: blur(4px);
}

.pwa-dialog h3 {
  font-size: 1.15rem;
  margin-bottom: 8px;
}

.pwa-dialog p {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 0.9rem;
}

.pwa-steps {
  margin: 0 0 18px;
  padding-left: 18px;
  display: grid;
  gap: 8px;
  font-size: 0.9rem;
}

/* ── Mobile Polish ── */
@media (max-width: 680px) {
  .topbar-inner {
    padding: 10px 14px;
    gap: 10px;
  }
  .main-wrap {
    padding: 16px 14px calc(72px + env(safe-area-inset-bottom, 0px));
  }
  .nav-tabs {
    order: 3;
    width: 100%;
    padding-top: 4px;
    border-top: 1px solid var(--surface-subtle);
  }
  .nav-tab {
    flex: 1 0 auto;
    text-align: center;
    padding: 9px 10px;
  }
  .cal-cell {
    min-height: 48px;
  }
}


/* ── Twilight Winter Photo Wallpaper & Frosted Glass Upgrade (v3) ── */
body.is-authed {
  background: #0D1B2E;
}

#bgWallpaper {
  position: fixed;
  inset: 0;
  z-index: 0;
  background-size: cover;
  background-position: center;
  background-image: url('/assets/img/fuji-winter.jpg');
  transition: background-image 0.55s ease, opacity 0.4s ease;
  pointer-events: none;
}

#bgWallpaper::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(10, 22, 40, 0.68) 0%,
    rgba(12, 26, 48, 0.78) 55%,
    rgba(10, 20, 36, 0.88) 100%
  );
}

#bgSnowCanvas {
  z-index: 1;
}

.topbar,
.main-wrap {
  z-index: 2;
}

.topbar {
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid rgba(255, 255, 255, 0.22);
}

.day-card,
.cal-3d-card,
.cal-spotlight,
.table-card,
.info-card,
.kpi-card,
.reminder-item {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-color: rgba(217, 225, 236, 0.9);
  box-shadow: 0 10px 28px rgba(6, 14, 28, 0.22);
}

.reminder-item.is-done {
  background: rgba(237, 241, 246, 0.85);
}

.toolbar > h2,
.cal-legend {
  color: #F1F5F9;
}

.toolbar .btn-outline {
  background: rgba(255, 255, 255, 0.94);
}

.chip {
  background: rgba(255, 255, 255, 0.92);
  border-color: rgba(255, 255, 255, 0.35);
  color: var(--ink);
}

.chip.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #FFFFFF;
}

/* ── Destination Highlight Photo Cards ── */
.highlights-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 22px;
}

.highlight-card {
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: var(--radius-md);
  overflow: hidden;
  padding: 0;
  background: #0F1D32;
  cursor: pointer;
  text-align: left;
  aspect-ratio: 16 / 10;
  box-shadow: 0 10px 24px rgba(6, 14, 28, 0.28);
  transition: transform 0.18s ease, border-color 0.18s ease;
}

.highlight-card:hover {
  transform: translateY(-3px);
  border-color: rgba(251, 191, 36, 0.75);
}

.highlight-card.is-active {
  border-color: #FBBF24;
  box-shadow: 0 0 0 2px #FBBF24, 0 12px 28px rgba(6, 14, 28, 0.35);
}

.highlight-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.highlight-caption {
  position: absolute;
  inset: auto 0 0 0;
  padding: 22px 12px 10px;
  background: linear-gradient(180deg, transparent 0%, rgba(10, 20, 36, 0.88) 100%);
  color: #FFFFFF;
}

.highlight-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.88rem;
  line-height: 1.2;
}

.highlight-dates {
  font-size: 0.74rem;
  color: #CBD5E1;
}

@media (max-width: 820px) {
  .highlights-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
