:root {
  --ink: #25211d;
  --muted: #6f675e;
  --paper: #fbf7ef;
  --panel: rgba(255, 252, 246, 0.92);
  --line: #ddcbb3;
  --accent: #8f4f32;
  --accent-deep: #63331f;
  --secondary: #627264;
  --gold: #b68a3a;
  --danger: #a33a2d;
  --shadow: 0 24px 60px rgba(79, 55, 32, 0.14);
  --radius: 26px;
}

body[data-theme="disney"] {
  --ink: #15223d;
  --muted: #5f6680;
  --paper: #f8fbff;
  --panel: rgba(255, 255, 255, 0.94);
  --line: #cfdaf2;
  --accent: #2f5fb3;
  --accent-deep: #183d7f;
  --secondary: #8f3d88;
  --gold: #f0b429;
  --danger: #b3261e;
  --shadow: 0 24px 60px rgba(35, 67, 140, 0.16);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: "Josefin Sans", Arial, sans-serif;
  background:
    radial-gradient(
      circle at top left,
      rgba(182, 138, 58, 0.18),
      transparent 34rem
    ),
    linear-gradient(135deg, #fbf7ef 0%, #f3eadc 42%, #efe0cb 100%);
  min-height: 100vh;
}

body[data-theme="disney"] {
  font-family: "Nunito", "Josefin Sans", Arial, sans-serif;
  background:
    radial-gradient(
      circle at top left,
      rgba(240, 180, 41, 0.3),
      transparent 30rem
    ),
    radial-gradient(
      circle at top right,
      rgba(47, 95, 179, 0.18),
      transparent 28rem
    ),
    linear-gradient(135deg, #f8fbff 0%, #edf4ff 46%, #f6eefc 100%);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 56px;
}

.hero {
  text-align: center;
  padding: 34px 20px 28px;
}

.hero-eyebrow,
.section-kicker {
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 0.72rem;
  color: var(--accent);
  font-weight: 600;
}

.hero h1 {
  margin: 0;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 600;
  font-size: clamp(3rem, 9vw, 6.75rem);
  line-height: 0.92;
}

body[data-theme="disney"] .hero h1 {
  font-family: "Nunito", Arial, sans-serif;
  font-weight: 700;
  letter-spacing: -0.05em;
}

.hero p {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 1rem;
  letter-spacing: 0.08em;
}

.status-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.status-pill,
.count-pill,
.person-badge {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 8px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.56);
  color: var(--muted);
  font-size: 0.85rem;
}

.person-badge {
  min-height: 26px;
  padding: 5px 9px;
  margin-top: 7px;
  font-size: 0.74rem;
}

.status-pill.connected {
  color: #36523e;
  border-color: rgba(54, 82, 62, 0.25);
  background: rgba(98, 114, 100, 0.12);
}

.status-pill.error {
  color: var(--danger);
  border-color: rgba(163, 58, 45, 0.25);
  background: rgba(163, 58, 45, 0.08);
}

.panel {
  background: var(--panel);
  border: 1px solid color-mix(in srgb, var(--line), transparent 14%);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(18px, 3vw, 30px);
  margin: 22px 0;
  backdrop-filter: blur(8px);
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 18px;
}

.suitcase-heading-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.compact-button {
  padding: 8px 14px;
  min-height: 34px;
}

.section-heading h2,
.modal-header h2 {
  margin: 0;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1;
}

body[data-theme="disney"] .section-heading h2,
body[data-theme="disney"] .modal-header h2 {
  font-family: "Nunito", Arial, sans-serif;
  font-weight: 700;
}

.add-form {
  display: grid;
  grid-template-columns: auto minmax(180px, 0.85fr) minmax(260px, 1.6fr) auto;
  gap: 12px;
  align-items: center;
}

.field-label,
.planner-filter label,
.modal-field label {
  color: var(--muted);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 600;
}

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

.add-form input,
.add-form select,
.planner-filter select,
.modal-field select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.76);
  color: var(--ink);
  padding: 13px 14px;
  outline: none;
}

.add-form input:focus,
.add-form select:focus,
.planner-filter select:focus,
.modal-field select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent), transparent 88%);
}

.add-form button,
.action-button,
.ghost-button {
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  color: #fff;
  background: var(--accent);
  transition:
    transform 160ms ease,
    background 160ms ease,
    opacity 160ms ease;
}

.add-form button:hover,
.action-button:hover,
.ghost-button:hover {
  transform: translateY(-1px);
  background: var(--accent-deep);
}

.ghost-button {
  color: var(--accent);
  background: transparent;
  border: 1px solid var(--line);
  padding: 8px 14px;
}

.ghost-button:hover {
  color: #fff;
}

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

.danger-outline:hover {
  background: var(--danger);
  border-color: var(--danger);
}

.suitcase-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.suitcase-list-collapsed {
  grid-template-columns: 1fr;
}

.suitcase-collapsed-card {
  width: 100%;
  text-align: left;
  border: 1px dashed color-mix(in srgb, var(--line), transparent 8%);
  border-radius: 20px;
  padding: 16px 18px;
  background: rgba(255, 255, 255, 0.48);
  color: var(--muted);
}

.suitcase-collapsed-card strong {
  display: block;
  margin-bottom: 5px;
  color: var(--ink);
}

.suitcase-collapsed-card span {
  display: block;
  line-height: 1.35;
}

.suitcase-group {
  border: 1px solid color-mix(in srgb, var(--line), transparent 24%);
  border-radius: 22px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.42);
}

.suitcase-group h3 {
  margin: 0 0 12px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.82rem;
}

.suitcase-group-items {
  display: grid;
  gap: 10px;
}

.suitcase-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 13px 14px;
  border: 1px solid color-mix(in srgb, var(--line), transparent 26%);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.62);
}

.suitcase-name {
  overflow-wrap: anywhere;
  line-height: 1.25;
}

.item-actions {
  display: inline-flex;
  gap: 7px;
}

.icon-button {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.75);
  color: var(--muted);
  border-radius: 999px;
  padding: 7px 10px;
  min-width: 38px;
}

.icon-button:hover {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent), transparent 65%);
}

.icon-button.delete:hover {
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger), transparent 65%);
}

.helper-text {
  color: var(--muted);
  line-height: 1.5;
  margin: -4px 0 22px;
}

.planner-heading {
  align-items: center;
}

.planner-filter {
  display: grid;
  gap: 7px;
  min-width: 220px;
}

.summary-actions {
  display: flex;
  align-items: end;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.planner-days {
  display: grid;
  gap: 16px;
}

.day-card {
  border: 1px solid color-mix(in srgb, var(--line), transparent 22%);
  border-radius: 22px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.58);
}

.day-top {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  align-items: start;
}

.day-number {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  font-weight: 600;
}

.day-meta {
  min-width: 0;
}

.day-date {
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
  font-weight: 600;
}

.day-title {
  margin-top: 4px;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.7rem;
  line-height: 1.05;
}

body[data-theme="disney"] .day-title {
  font-family: "Nunito", Arial, sans-serif;
  font-weight: 700;
}

.day-location {
  color: var(--muted);
  margin-top: 3px;
}

.details-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 0;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.4;
}

.details-row span:not(:last-child)::after {
  content: "•";
  color: var(--gold);
  margin: 0 10px;
}

.reminders {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.reminders span {
  border: 1px solid color-mix(in srgb, var(--gold), transparent 35%);
  border-radius: 999px;
  padding: 6px 10px;
  color: var(--accent-deep);
  background: color-mix(in srgb, var(--gold), transparent 86%);
  font-size: 0.82rem;
  font-weight: 600;
}

.day-actions {
  margin: 16px 0;
}

.action-button {
  white-space: nowrap;
  background: var(--secondary);
}

.outfit-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px;
}

.outfit-section {
  border: 1px solid color-mix(in srgb, var(--line), transparent 28%);
  border-radius: 18px;
  padding: 14px;
  background: color-mix(in srgb, var(--paper), transparent 28%);
}

.outfit-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 10px;
  font-size: 0.86rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--accent);
  font-weight: 600;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 34px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid color-mix(in srgb, var(--accent), transparent 78%);
  border-radius: 999px;
  padding: 7px 9px 7px 11px;
  background: rgba(255, 255, 255, 0.76);
  max-width: 100%;
}

.chip span {
  overflow-wrap: anywhere;
}

.chip small,
.summary-row small {
  color: var(--muted);
  font-size: 0.72rem;
}

.chip button {
  border: 0;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--accent), transparent 88%);
  color: var(--accent);
  line-height: 1;
  padding: 0;
}

.empty-state {
  color: var(--muted);
  font-style: italic;
  line-height: 1.4;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.summary-card {
  border: 1px solid color-mix(in srgb, var(--line), transparent 22%);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.58);
  padding: 16px;
}

.summary-card h3 {
  margin: 0 0 12px;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.65rem;
}

body[data-theme="disney"] .summary-card h3 {
  font-family: "Nunito", Arial, sans-serif;
  font-weight: 700;
}

.summary-list {
  display: grid;
  gap: 9px;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid color-mix(in srgb, var(--line), transparent 44%);
  padding-bottom: 8px;
}

.summary-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.summary-row strong {
  display: block;
  overflow-wrap: anywhere;
}

.summary-count {
  color: var(--accent);
  white-space: nowrap;
}

.reset-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(25, 22, 20, 0.48);
}

.modal-backdrop[hidden] {
  display: none;
}

.modal-card {
  width: min(720px, 100%);
  max-height: min(760px, calc(100vh - 40px));
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: var(--paper);
  padding: clamp(18px, 3vw, 28px);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.24);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 18px;
}

.modal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.modal-field {
  display: grid;
  gap: 7px;
}

.modal-item-list {
  display: grid;
  gap: 9px;
  padding: 12px;
  border: 1px solid color-mix(in srgb, var(--line), transparent 24%);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.52);
}

.modal-item-option {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.62);
}

.modal-item-option input {
  width: 18px;
  height: 18px;
}

.modal-item-option strong,
.modal-item-option small {
  display: block;
}

.modal-item-option small {
  color: var(--muted);
  margin-top: 2px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 20;
  max-width: min(420px, calc(100% - 36px));
  padding: 13px 15px;
  border-radius: 16px;
  color: #fff;
  background: rgba(37, 33, 29, 0.92);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition:
    opacity 180ms ease,
    transform 180ms ease;
  box-shadow: 0 18px 42px rgba(37, 33, 29, 0.22);
}

.toast.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 920px) {
  .add-form,
  .outfit-grid,
  .summary-grid,
  .suitcase-list {
    grid-template-columns: 1fr;
  }

  .field-label {
    margin-bottom: -6px;
  }
}

@media (max-width: 720px) {
  .section-heading,
  .planner-heading {
    flex-direction: column;
  }

  .suitcase-heading-actions {
    justify-content: flex-start;
  }

  .planner-filter,
  .modal-grid {
    width: 100%;
    grid-template-columns: 1fr;
  }

  .summary-actions {
    width: 100%;
    align-items: stretch;
    justify-content: flex-start;
  }
}

@media (max-width: 540px) {
  .app-shell {
    width: min(100% - 20px, 1180px);
    padding-top: 12px;
  }

  .hero {
    padding: 28px 8px 20px;
  }

  .panel {
    border-radius: 22px;
  }

  .suitcase-item {
    grid-template-columns: 1fr;
  }

  .item-actions {
    justify-content: flex-start;
  }
}

.backup-status {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.75rem;
  align-items: center;
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.55);
  color: var(--muted);
  font-size: 0.9rem;
}

.backup-status strong {
  color: var(--ink);
}

.backup-status span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.backup-status span::before {
  content: "•";
  color: var(--accent);
}
