:root {
  --ink: #0f2027;
  --muted: #6b7c80;
  --line: #e1e9e8;
  --bg-soft: #f5faf9;
  --bg-card: #ffffff;
  --accent: #0d9488;
  --accent-dark: #0a766c;
  --accent-tint: #e1f5f2;
  --danger: #d9491f;
  --radius: 12px;
  --radius-lg: 20px;
  --shadow: 0 1px 2px rgba(15, 32, 39, 0.04), 0 4px 14px rgba(15, 32, 39, 0.06);
  --shadow-hover: 0 4px 10px rgba(15, 32, 39, 0.06), 0 10px 26px rgba(15, 32, 39, 0.1);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg-soft);
  margin: 0;
  -webkit-font-smoothing: antialiased;
}

h1, h2 {
  letter-spacing: -0.5px;
}

button {
  font-family: inherit;
  cursor: pointer;
}

input, select, textarea {
  font-family: inherit;
  font-size: 15px;
}

/* ---------- Landing / sign-in ---------- */

.split {
  display: flex;
  min-height: 100vh;
}

.split .pane {
  flex: 1;
  min-width: 0;
}

.split .left {
  background: #fff;
  display: flex;
  flex-direction: column;
  padding: 36px 44px;
}

.split .left .brand {
  font-size: 20px;
  font-weight: 800;
}

.split .left .mid {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: 100%;
  max-width: 380px;
  margin: 0 auto;
  padding: 28px 0;
}

.split .left h1 {
  font-size: 32px;
  font-weight: 800;
  line-height: 1.15;
  margin: 0 0 10px;
}

.split .left .sub {
  font-size: 15px;
  color: var(--muted);
  margin: 0 0 24px;
  line-height: 1.5;
}

.split .left .hint {
  font-size: 12px;
  color: var(--muted);
  margin: 10px 0 0;
}

.split .left .foot {
  font-size: 12px;
  color: var(--muted);
}

.split .right {
  background: linear-gradient(160deg, #14b8a6, #0a655c 85%);
  color: #fff;
}

.split .right .inner {
  max-width: 420px;
  margin: 0 auto;
  padding: 36px 44px;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.split .right h2 {
  font-size: 26px;
  font-weight: 800;
  line-height: 1.2;
  margin: 0 0 12px;
  color: #fff;
}

.split .right .rsub {
  font-size: 15px;
  color: rgba(255, 255, 255, 0.82);
  line-height: 1.55;
  margin: 0 0 24px;
}

.rfeat {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.rfeat li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  font-size: 14.5px;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.95);
}

.rfeat .emoji {
  font-size: 18px;
  flex-shrink: 0;
}

.btn-google {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  justify-content: center;
  padding: 12px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: #fff;
  font-weight: 600;
  font-size: 14.5px;
  color: var(--ink);
  box-shadow: var(--shadow);
}

.btn-google:hover {
  box-shadow: var(--shadow-hover);
}

@media (max-width: 760px) {
  .split {
    flex-direction: column;
  }
  .split .right {
    order: -1;
    padding: 8px 0;
  }
  .split .right .inner {
    padding: 24px 28px;
  }
  .split .left {
    padding: 28px;
  }
}

/* ---------- App shell ---------- */

#app-shell {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  padding-bottom: 84px;
  position: relative;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: #fff;
  position: sticky;
  top: 0;
  z-index: 5;
}

.topbar .brand-small {
  font-weight: 800;
  font-size: 15px;
}

.view {
  padding: 20px 18px 8px;
}

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

.view-header h1 {
  font-size: 24px;
  margin: 0;
}

.progress-text {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--muted);
}

/* ---------- Buttons ---------- */

.btn-primary, .btn-secondary, .btn-icon {
  border-radius: var(--radius);
  border: none;
  font-weight: 600;
}

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

.btn-primary:hover {
  background: var(--accent-dark);
}

.btn-secondary {
  background: var(--accent-tint);
  color: var(--accent-dark);
  border: 1px solid transparent;
}

.btn-secondary:hover {
  border-color: var(--accent);
}

.btn-small {
  padding: 9px 14px;
  font-size: 13.5px;
}

.btn-icon {
  background: transparent;
  font-size: 18px;
  padding: 6px;
  line-height: 1;
}

.btn-icon:hover {
  background: var(--accent-tint);
}

/* ---------- Checklist ---------- */

.checklist-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-bottom: 18px;
}

.checklist-group h3 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 0 0 8px;
}

.checklist-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 11px 12px;
  margin-bottom: 6px;
  box-shadow: var(--shadow);
}

.checklist-item input[type="checkbox"] {
  width: 19px;
  height: 19px;
  accent-color: var(--accent);
  flex-shrink: 0;
}

.checklist-item label {
  flex: 1;
  font-size: 14.5px;
}

.checklist-item.checked label {
  color: var(--muted);
  text-decoration: line-through;
}

.item-delete-btn {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 14px;
  padding: 4px 6px;
}

.item-delete-btn:hover {
  color: var(--danger);
}

.add-item-form {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  background: var(--bg-card);
  padding: 12px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.add-item-form input[type="text"] {
  flex: 1 1 140px;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.add-item-form select {
  padding: 10px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.empty-state {
  color: var(--muted);
  font-size: 14px;
  text-align: center;
  padding: 28px 12px;
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* ---------- Trips ---------- */

.trips-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.trip-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  box-shadow: var(--shadow);
}

.trip-card:hover {
  box-shadow: var(--shadow-hover);
}

.trip-card .trip-emoji {
  font-size: 28px;
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-tint);
  border-radius: var(--radius);
  flex-shrink: 0;
}

.trip-card .trip-info {
  flex: 1;
  min-width: 0;
}

.trip-card .trip-name {
  font-weight: 700;
  font-size: 15.5px;
}

.trip-card .trip-meta {
  font-size: 13px;
  color: var(--muted);
  margin-top: 2px;
}

/* ---------- Trip detail ---------- */

.detail-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 16px 12px 8px;
}

.detail-title {
  flex: 1;
  min-width: 0;
}

.detail-title h1 {
  font-size: 19px;
  margin: 0;
}

.detail-meta {
  font-size: 12.5px;
  color: var(--muted);
  margin: 2px 0 0;
}

.subtabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 0 18px 14px;
}

.subtab-btn {
  flex-shrink: 0;
  border: none;
  background: var(--bg-card);
  color: var(--muted);
  padding: 8px 13px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow);
}

.subtab-btn.active {
  background: var(--accent);
  color: #fff;
}

.subview {
  padding: 0 18px 20px;
}

/* ---------- Places (hotels / restaurants / activities) ---------- */

.places-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}

.place-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 13px 14px;
  box-shadow: var(--shadow);
}

.place-card .place-name {
  font-weight: 700;
  font-size: 15px;
}

.place-card .place-line {
  font-size: 13px;
  color: var(--muted);
  margin-top: 3px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.place-card a {
  color: var(--accent-dark);
}

.place-card .place-notes {
  font-size: 13px;
  margin-top: 6px;
}

.place-card .place-actions {
  display: flex;
  gap: 14px;
  margin-top: 8px;
}

.place-card .place-actions button {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
  padding: 0;
}

.place-card .place-actions button:hover {
  color: var(--accent-dark);
}

.place-form, .info-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--bg-card);
  padding: 14px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-top: 12px;
}

.place-form input, .place-form textarea,
.info-form input, .info-form textarea {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  width: 100%;
}

.form-row {
  display: flex;
  gap: 10px;
}

.form-row input {
  flex: 1;
  min-width: 0;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* ---------- Info tab ---------- */

.info-form fieldset {
  border: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.info-form legend {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  padding: 0;
  margin-bottom: 2px;
}

/* ---------- Share tab ---------- */

.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  margin-bottom: 12px;
}

.check-row input {
  width: 17px;
  height: 17px;
  accent-color: var(--accent);
}

.share-preview {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px;
  font-family: inherit;
  font-size: 13.5px;
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0 0 14px;
  min-height: 90px;
}

/* ---------- Bottom nav ---------- */

.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  max-width: 480px;
  margin: 0 auto;
  background: #fff;
  border-top: 1px solid var(--line);
  display: flex;
  padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
  gap: 4px;
}

.nav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
  padding: 6px 0;
  border-radius: var(--radius);
}

.nav-btn span {
  font-size: 20px;
}

.nav-btn.active {
  color: var(--accent-dark);
  background: var(--accent-tint);
}

/* ---------- Modal ---------- */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 32, 39, 0.45);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 20;
}

.modal {
  background: #fff;
  width: 100%;
  max-width: 480px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: 22px 20px calc(22px + env(safe-area-inset-bottom));
  max-height: 88vh;
  overflow-y: auto;
}

.modal h2 {
  font-size: 18px;
  margin: 0 0 14px;
}

#trip-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#trip-form input {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  width: 100%;
}

.emoji-picker {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.emoji-picker button {
  width: 40px;
  height: 40px;
  font-size: 19px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: #fff;
}

.emoji-picker button.selected {
  background: var(--accent-tint);
  border-color: var(--accent);
}

@media (min-width: 480px) {
  .modal-overlay {
    align-items: center;
  }
  .modal {
    border-radius: var(--radius-lg);
  }
}

/* ---------- Toast ---------- */

.toast {
  position: fixed;
  bottom: 96px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: #fff;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 13.5px;
  z-index: 30;
  box-shadow: var(--shadow-hover);
}
