* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg: #fafafa;
  --fg: #1a1a1a;
  --muted: #666;
  --accent: #0066cc;
  --border: #e0e0e0;
  --card-bg: #ffffff;
  --shadow: 0 1px 3px rgba(0,0,0,0.1);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  background: var(--bg);
  color: var(--fg);
  line-height: 1.6;
}

.preview-banner {
  background: #fff3cd;
  border-bottom: 1px solid #ffc107;
  padding: 0.75rem 2rem;
  font-size: 0.875rem;
  text-align: center;
}

.preview-banner a {
  color: var(--accent);
  text-decoration: none;
}

.preview-banner a:hover {
  text-decoration: underline;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem;
}

header {
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

header h1 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

header .meta {
  font-size: 0.875rem;
  color: var(--muted);
}

.grid {
  display: block;
}

.day-cards-container {
  max-width: 800px;
  margin: 0 auto;
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1.5rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow);
}

.card h2 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.card h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.25rem;
  color: var(--muted);
}

input[type="text"],
input[type="date"],
input[type="password"],
select,
textarea {
  width: 100%;
  padding: 0.5rem 0.75rem;
  font-size: 0.9375rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--card-bg);
  margin-bottom: 1rem;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(0,102,204,0.1);
}

textarea {
  min-height: 80px;
  resize: vertical;
}

button {
  padding: 0.5rem 1rem;
  font-size: 0.9375rem;
  font-weight: 500;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  margin-right: 0.5rem;
  margin-bottom: 0.5rem;
}

.btn-primary {
  background: var(--accent);
  color: white;
}

.btn-primary:hover {
  background: #0052a3;
}

.btn-secondary {
  background: var(--border);
  color: var(--fg);
}

.btn-secondary:hover {
  background: #d0d0d0;
}

.btn-danger {
  background: #dc3545;
  color: white;
}

.btn-danger:hover {
  background: #c82333;
}

.day-card {
  cursor: pointer;
  transition: box-shadow 0.2s, border-color 0.2s;
}

.day-card:hover {
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  border-color: var(--accent);
}

.day-card.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(0,102,204,0.2);
}

.day-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.day-date {
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.day-title {
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.day-route {
  font-size: 0.875rem;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.day-mode {
  display: inline-block;
  padding: 0.125rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: 2px;
  background: var(--border);
  margin-right: 0.5rem;
}

.mode-flight { background: #e3f2fd; color: #1565c0; }
.mode-train { background: #e8f5e9; color: #2e7d32; }
.mode-ferry { background: #e0f7fa; color: #00838f; }
.mode-car { background: #fff3e0; color: #ef6c00; }
.mode-bus { background: #f3e5f5; color: #7b1fa2; }
.mode-walk { background: #fafafa; color: #616161; }
.mode-multi { background: #fce4ec; color: #c2185b; }

.day-lodging {
  font-size: 0.875rem;
  margin-top: 0.5rem;
}

.day-lodging strong {
  color: var(--fg);
}

.day-notes {
  font-size: 0.875rem;
  color: var(--muted);
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.day-activities {
  font-size: 0.875rem;
  margin-top: 0.5rem;
}

.day-activities li {
  margin-left: 1.25rem;
  margin-bottom: 0.25rem;
}

.map-container {
  height: 400px;
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 1rem;
}

.map-container.small {
  height: 250px;
}

#overview-map {
  height: 500px;
}

.autocomplete-wrapper {
  position: relative;
}

.autocomplete-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 4px 4px;
  max-height: 200px;
  overflow-y: auto;
  z-index: 1000;
  box-shadow: var(--shadow);
}

.autocomplete-results div {
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  font-size: 0.875rem;
}

.autocomplete-results div:hover {
  background: var(--border);
}

.json-preview {
  background: #1a1a1a;
  color: #f0f0f0;
  padding: 1rem;
  border-radius: 4px;
  font-family: 'Monaco', 'Menlo', monospace;
  font-size: 0.8125rem;
  overflow-x: auto;
  white-space: pre-wrap;
  max-height: 600px;
  overflow-y: auto;
}

.login-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.login-box {
  background: var(--card-bg);
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
  max-width: 400px;
  width: 90%;
}

.login-box h2 {
  margin-bottom: 1.5rem;
  text-align: center;
}

.login-box input {
  margin-bottom: 1rem;
}

.hidden {
  display: none !important;
}

.loading {
  text-align: center;
  padding: 2rem;
  color: var(--muted);
}

.error {
  color: #dc3545;
  font-size: 0.875rem;
  margin-bottom: 1rem;
}

.success {
  color: #28a745;
  font-size: 0.875rem;
  margin-bottom: 1rem;
}

.trip-link {
  background: var(--border);
  padding: 0.75rem;
  border-radius: 4px;
  font-family: monospace;
  font-size: 0.875rem;
  word-break: break-all;
  margin-bottom: 1rem;
}

.trip-link a {
  color: var(--accent);
  text-decoration: none;
}

.trip-link a:hover {
  text-decoration: underline;
}

.day-map-small {
  height: 150px;
  width: 100%;
  border-radius: 4px;
  margin-top: 1rem;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--bg);
}

.day-map-small:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  border-color: var(--accent);
}

.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.modal-content {
  background: var(--card-bg);
  border-radius: 8px;
  padding: 1rem;
  max-width: 90vw;
  max-height: 90vh;
  position: relative;
}

.modal-map {
  width: 80vw;
  height: 60vh;
  border-radius: 4px;
}

.modal-close {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 2rem;
  height: 2rem;
  font-size: 1.25rem;
  cursor: pointer;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover {
  background: var(--border);
}

.back-to-overview {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 50px;
  padding: 0.75rem 1.5rem;
  font-size: 0.875rem;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  z-index: 1000;
  transition: transform 0.2s;
}

.back-to-overview:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
