/* Calendar layout */
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}
.day-card {
  overflow: hidden;
}
.day-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.park-select-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.park-select-row select { flex: 1; }

.crowd-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 12px;
}
.crowd-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.crowd-item .park-label {
  display: flex;
  align-items: center;
  gap: 4px;
}
.crowd-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
}
.crowd-input {
  width: 52px !important;
  min-width: 52px !important;
  text-align: center;
  padding: 4px 6px !important;
  font-size: 14px !important;
  box-sizing: border-box !important;
  -moz-appearance: textfield;
}
.crowd-input::-webkit-inner-spin-button,
.crowd-input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  appearance: none;
  margin: 0;
  display: none;
}

/* Crowd level colors - always visible */
.crowd-1, .crowd-2 { background: #34c759 !important; color: white !important; }
.crowd-3 { background: #5ac85a !important; color: white !important; }
.crowd-4 { background: #8bc34a !important; color: white !important; }
.crowd-5 { background: #ff9500 !important; color: white !important; }
.crowd-6 { background: #ff8000 !important; color: white !important; }
.crowd-7 { background: #ff6600 !important; color: white !important; }
.crowd-8 { background: #ff3b30 !important; color: white !important; }
.crowd-9 { background: #e02020 !important; color: white !important; }
.crowd-10 { background: #990000 !important; color: white !important; }

.park-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}
.park-dot-mk { background: var(--mk-color); }
.park-dot-ep { background: var(--ep-color); }
.park-dot-hs { background: var(--hs-color); }
.park-dot-ak { background: var(--ak-color); }

.park-assigned {
  text-align: center;
  margin-bottom: 10px;
}
.park-mk { background: var(--mk-color) !important; color: white !important; }
.park-ep { background: var(--ep-color) !important; color: white !important; }
.park-hs { background: var(--hs-color) !important; color: white !important; }
.park-ak { background: var(--ak-color) !important; color: white !important; }
.park-wp { background: var(--wp-color) !important; color: white !important; }
.park-ds { background: var(--ds-color) !important; color: white !important; }
.park-rest { background: var(--rest-color) !important; color: white !important; }
.park-none { background: #ccc !important; color: white !important; }

.dining-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
}
.dining-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.stats-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.stat-box {
  text-align: center;
  min-width: 110px;
}

.day-weather {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Version list */
.version-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.version-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Optimizer results */
.opt-results {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

/* Itinerary */
.itin-pills {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: 16px;
}
.itin-pill {
  cursor: pointer;
  white-space: nowrap;
}
.tl-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.tl-time {
  width: 75px;
  flex-shrink: 0;
}
.tl-marker {
  width: 4px;
  min-height: 36px;
  flex-shrink: 0;
}
.tl-content { flex: 1; min-width: 0; }

/* AI Advisor */
.ai-container {
  display: flex;
  flex-direction: column;
  height: 550px;
}
.ai-chat {
  flex: 1;
  overflow-y: auto;
}
.ai-msg {
  margin-bottom: 12px;
  max-width: 85%;
}
.ai-msg.user {
  margin-left: auto;
}
.ai-msg.asst * { max-width: 100%; }
.ai-input-row { display: flex; gap: 8px; }
.ai-input-row input { flex: 1; }
.ai-prompts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

/* Rides */
.ride-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 12px;
}
.ride-card {
  border-left: 4px solid;
}
.ride-ll-ILL { background: #ff9500 !important; color: white !important; }
.ride-ll-LLMP { background: var(--primary) !important; color: white !important; }

/* Budget */
.budget-table {
  width: 100%;
  border-collapse: collapse;
}

/* Quick Log FAB */
.quick-log-fab {
  position: fixed;
  bottom: calc(80px + env(safe-area-inset-bottom, 0px));
  right: 72px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  font-size: 24px;
  border: none;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  z-index: 50;
  cursor: pointer;
  touch-action: manipulation;
  display: none;
  align-items: center;
  justify-content: center;
}
body.show-log-fab .quick-log-fab { display: flex; }

/* Live Log */
.live-plan-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 4px;
  border-bottom: 1px solid var(--bdr);
  font-size: 14px;
}
.live-plan-item.live-done { opacity: 0.5; text-decoration: line-through; }
.live-check { font-size: 16px; width: 20px; text-align: center; }
.live-log-entry {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 4px;
  border-bottom: 1px solid var(--bdr);
  font-size: 14px;
  flex-wrap: wrap;
}
.log-chip {
  display: inline-block;
  min-height: 36px;
  padding: 6px 14px;
  border-radius: 18px;
  border: 1px solid var(--bdr);
  background: var(--card);
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
  touch-action: manipulation;
}
.log-chip:active { background: var(--primary); color: white; }
.log-chip-done { opacity: 0.5; text-decoration: line-through; }
.log-status-btn {
  min-height: 44px;
  min-width: 70px;
  padding: 8px 12px;
  border-radius: 8px;
  border: 2px solid transparent;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  opacity: 0.4;
  touch-action: manipulation;
}
.log-status-btn.active { opacity: 1; border-color: white; box-shadow: 0 2px 8px rgba(0,0,0,0.2); }

/* Packing */
.pack-cat { margin-bottom: 20px; }
.pack-cat-removed { opacity: 0.6; border-top: 2px dashed var(--bdr); padding-top: 16px; margin-top: 24px; }
.pack-cat-removed h3 { color: var(--sec); }
.pack-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  cursor: pointer;
}
.pack-item.checked {
  text-decoration: line-through;
  opacity: 0.5;
}
.pack-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
}
.pack-actions {
  display: flex;
  gap: 2px;
  margin-left: 4px;
  opacity: 0;
  transition: opacity .15s;
}
.pack-item:hover .pack-actions { opacity: 1; }
.pack-action-btn {
  background: none;
  border: 1px solid var(--bdr);
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  padding: 1px 5px;
  line-height: 1.2;
  color: var(--sec);
  transition: all .15s;
}
.pack-action-btn:hover { background: var(--bdr); color: var(--text); }
.pack-action-delete:hover { background: #ff3b30; color: white; border-color: #ff3b30; }
.pack-qty { margin-left: auto; font-size: 12px; font-weight: 600; color: var(--primary); white-space: nowrap; padding-left: 12px; }
.pack-qty-input {
  background: var(--card) !important;
  color: var(--text) !important;
  padding: 2px 4px !important;
  border: 1px solid var(--bdr) !important;
  border-radius: 6px !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  width: 44px !important;
  min-height: auto !important;
  text-align: center !important;
  margin-left: auto !important;
  -moz-appearance: textfield !important;
}
.pack-qty-input::-webkit-inner-spin-button,
.pack-qty-input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.pack-progress { height: 6px; background: var(--bdr); border-radius: 3px; margin-bottom: 4px; overflow: hidden; }
.pack-progress-bar { height: 100%; background: var(--primary); border-radius: 3px; transition: width .3s; }
.packing-member-pill { padding: 5px 12px; border-radius: 16px; border: 1px solid var(--bdr); background: var(--card); color: var(--text); font-size: 13px; font-weight: 500; cursor: pointer; transition: all .15s; }
.packing-member-pill.active { background: var(--primary); color: white; border-color: var(--primary); }
.packing-member-pill:hover:not(.active) { background: var(--bdr); }
.packing-member-manage { font-size: 16px; font-weight: 700; padding: 4px 10px; }
.pack-move-select { font-size: 11px; padding: 1px 4px; border: 1px solid var(--bdr); border-radius: 4px; background: var(--card); color: var(--sec); cursor: pointer; max-width: 70px; }

/* Park hours compact */
.park-hrs {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Perks */
.perk-item {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

/* Session strip */
.session-strip {
  display: flex;
  gap: 2px;
  height: 28px;
  overflow: hidden;
  margin-bottom: 10px;
}
.session-block {
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  cursor: pointer;
  min-width: 28px;
  overflow: hidden;
  white-space: nowrap;
}
.session-add-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  cursor: pointer;
  flex-shrink: 0;
}

/* Planning Timeline */
.tl-progress {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 32px;
  position: relative;
  padding: 0 20px;
}
.tl-progress-line {
  flex: 1;
  height: 3px;
  position: relative;
}
.tl-progress-node {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
  cursor: pointer;
}
.tl-milestone {
  overflow: hidden;
  margin-bottom: 16px;
}
.tl-milestone-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  gap: 12px;
}
.tl-milestone-title {
  display: flex;
  align-items: center;
  gap: 8px;
}
.tl-milestone-body {
  display: none;
}
.tl-milestone.open .tl-milestone-body { display: block; }
.tl-check-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.tl-check-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  flex-shrink: 0;
  cursor: pointer;
}
.tl-check-item .tl-check-label { flex: 1; }
.tl-summary-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.tl-summary-stat {
  flex: 1;
  min-width: 100px;
  text-align: center;
}

/* Dashboard */
.dash-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}
.dash-card {
  text-align: center;
  position: relative;
  overflow: hidden;
}
.dash-bar {
  overflow: hidden;
}
.dash-bar-fill {
  height: 100%;
  transition: width 0.8s var(--ease-out);
  background-image: linear-gradient(90deg, currentColor, currentColor);
}

/* Walk time */
.walk-time {
  display: flex;
  align-items: center;
  gap: 6px;
}
.walk-time::before {
  content: '';
  width: 12px;
  height: 12px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%237A7067'%3E%3Cpath d='M13.5 5.5c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zM9.8 8.9L7 23h2.1l1.8-8 2.1 2v6h2v-7.5l-2.1-2 .6-3C14.8 12 16.8 13 19 13v-2c-1.9 0-3.5-1-4.3-2.4l-1-1.6c-.4-.6-1-1-1.7-1-.3 0-.5.1-.8.1L6 8.3V13h2V9.6l1.8-.7'/%3E%3C/svg%3E") center/contain no-repeat;
  flex-shrink: 0;
}

/* Zone flow */
.zone-strip {
  display: flex;
  gap: 2px;
  height: 20px;
  overflow: hidden;
  margin-bottom: 8px;
}
.zone-block {
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  min-width: 16px;
}

/* Gantt — horizontal 15-minute precision timeline */
.gantt-wrap {
  overflow-x: auto;
  margin-bottom: 20px;
}
.gantt-h-wrap {
  overflow-x: auto;
  overflow-y: auto;
  max-height: 700px;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 8px;
  position: relative;
}
.gantt-h-header {
  display: grid;
  position: sticky;
  top: 0;
  z-index: 4;
  background: var(--bg, #fff);
  border-bottom: 2px solid var(--border, #e5e7eb);
}
.gantt-h-corner {
  position: sticky;
  left: 0;
  z-index: 5;
  background: var(--bg, #fff);
  border-right: 2px solid var(--border, #e5e7eb);
}
.gantt-h-cell {
  text-align: center;
  font-size: 10px;
  font-weight: 600;
  padding: 4px 0;
  color: var(--sec, #666);
  border-right: 1px solid transparent;
  user-select: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1.1;
}
.gantt-h-hour {
  font-size: 11px;
  font-weight: 700;
  color: var(--text, #333);
  border-left: 1px solid var(--border, #e5e7eb);
}
.gantt-h-quarter {
  font-size: 0;
}
.gantt-h-tick {
  font-size: 8px;
  color: var(--sec, #999);
  opacity: 0.6;
}
.gantt-h-row {
  display: grid;
  position: relative;
  min-height: 52px;
  border-bottom: 1px solid var(--border, #e5e7eb);
  align-items: stretch;
}
.gantt-h-row:last-child { border-bottom: none; }
.gantt-h-day-label {
  position: sticky;
  left: 0;
  z-index: 3;
  background: var(--bg, #fff);
  border-right: 2px solid var(--border, #e5e7eb);
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 4px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}
.gantt-h-gridline {
  grid-row: 1;
  border-left: 1px solid var(--border, #e5e7eb);
  opacity: 0.2;
  pointer-events: none;
}
.gantt-h-gridline-hour {
  opacity: 0.5;
  border-left-width: 1px;
}
.gantt-block {
  grid-row: 1;
  border-radius: 4px;
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: center;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
  margin: 2px 0;
  min-height: 0;
  align-self: stretch;
}
.gantt-session {
  z-index: 1;
  opacity: 0.85;
  white-space: nowrap;
}
.gantt-event {
  z-index: 2;
  margin-top: 4px;
  margin-bottom: 4px;
}
.gantt-travel {
  z-index: 1;
  background: repeating-linear-gradient(
    -45deg,
    #9ca3af,
    #9ca3af 4px,
    #b0b8c4 4px,
    #b0b8c4 8px
  );
  opacity: 0.75;
  font-size: 9px;
  font-weight: 600;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
}
.gantt-time-range {
  font-size: 8px;
  font-weight: 400;
  opacity: 0.8;
  margin-top: 1px;
}
.gantt-clickable {
  cursor: pointer;
  transition: opacity 0.15s, transform 0.15s;
}
.gantt-clickable:hover {
  opacity: 0.9;
  transform: scaleY(1.06);
  z-index: 10 !important;
}

/* Budget enhanced */
.budget-cat {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.budget-cat-bar {
  flex: 1;
  max-width: 200px;
  height: 8px;
  margin: 0 12px;
  overflow: hidden;
}
.budget-cat-fill {
  height: 100%;
  transition: width 0.3s;
}

/* Wishlist / coordination */
.wish-item {
  display: flex;
  align-items: center;
  gap: 10px;
}
.wish-votes { display: flex; gap: 4px; }
.wish-vote-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Task assignments */
.task-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--bdr, #e5e7eb);
}
.task-row .task-check {
  width: 18px;
  height: 18px;
  cursor: pointer;
  margin-top: 2px;
}
.task-meta {
  display: flex;
  gap: 6px;
  align-items: center;
}
.task-assignee {
  font-size: 12px;
  padding: 2px 4px;
  border-radius: 6px;
}

/* Itinerary header */
.itin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 8px;
}
.itin-controls {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* ===== FORM SIZING SYSTEM =====
   3 tiers: default (full), narrow, compact.
   Default: inherits from layout.css + theme. Full-width in modals/forms.
   Narrow: medium fixed-width (trip name, group name).
   Compact: small inline inputs (crowds, constraints, ROI, budgets).
   Themes handle colors/fonts/borders. Responsive.css handles mobile overrides.
*/
.form-input-narrow {
  width: 240px;
  max-width: 100%;
}
.compact-input {
  width: 70px !important;
  font-size: 13px !important;
  padding: 4px 6px !important;
  text-align: center;
  box-sizing: border-box !important;
  -moz-appearance: textfield;
}
input[type="time"].compact-input {
  width: 105px !important;
  padding: 4px 6px !important;
  font-size: 13px !important;
}
.compact-input::-webkit-inner-spin-button,
.compact-input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.compact-select {
  font-size: 13px !important;
  padding: 4px 8px !important;
  min-width: auto !important;
  min-height: auto !important;
}
.form-textarea {
  width: 100%;
  min-height: 36px;
  resize: vertical;
  box-sizing: border-box;
}

/* Char cards */
.char-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.char-wishlist {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.char-wish-btn {
  cursor: pointer;
}

/* Tab content entrance */
.tab-content.active {
  animation: tabFadeIn 0.35s var(--ease-out);
}
@keyframes tabFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.tab-content.active .card,
.tab-content.active .day-card,
.tab-content.active .dash-card {
  animation: cardStagger 0.4s var(--ease-out) both;
}
.tab-content.active .card:nth-child(1),
.tab-content.active .day-card:nth-child(1),
.tab-content.active .dash-card:nth-child(1) { animation-delay: 0.02s; }
.tab-content.active .card:nth-child(2),
.tab-content.active .day-card:nth-child(2),
.tab-content.active .dash-card:nth-child(2) { animation-delay: 0.06s; }
.tab-content.active .card:nth-child(3),
.tab-content.active .day-card:nth-child(3),
.tab-content.active .dash-card:nth-child(3) { animation-delay: 0.1s; }
@keyframes cardStagger {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
.dash-bar-fill {
  animation: barGrow 1s var(--ease-out) 0.3s both;
}
@keyframes barGrow {
  from { transform: scaleX(0); transform-origin: left; }
  to { transform: scaleX(1); transform-origin: left; }
}
@keyframes sparkle-pulse {
  0%, 100% { opacity: 0.2; transform: scale(0.7) rotate(0deg); }
  50% { opacity: 1; transform: scale(1.3) rotate(15deg); }
}
