:root {
  --olive: #3a4d1e;
  --olive-mid: #4f6828;
  --gold: #a89050;
  --gold-lt: #c8b97a;
  --cream: #f5f0e8;
  --cream-dk: #ede6d6;
  --sage: #607040;
  --ink: #1f1f1f;
  --danger: #a24a3a;
  --card-bg: #fff;

  --display: 'Cinzel', Georgia, serif;
  --body: 'EB Garamond', Georgia, serif;
  --mono: 'IBM Plex Mono', monospace;
}

:root[data-theme="dark"] {
  --cream: #1c1f17;
  --cream-dk: #262b1e;
  --sage: #93a37c;
  --ink: #e8e4d8;
  --card-bg: #262b1e;
  --gold-lt: #a3915f;
}
:root[data-theme="dark"] .weather-day { background: rgba(0,0,0,0.18); }
:root[data-theme="dark"] .row input[type="text"],
:root[data-theme="dark"] .row select { color: var(--ink); }
:root[data-theme="dark"] .row select {
  background-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='12'%20height='8'%20viewBox='0%200%2012%208'%3E%3Cpath%20d='M1%201l5%205%205-5'%20stroke='%23c8b97a'%20stroke-width='1.6'%20fill='none'%20stroke-linecap='round'%20stroke-linejoin='round'/%3E%3C/svg%3E");
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--olive);
  color: var(--ink);
  font-family: var(--body);
  -webkit-tap-highlight-color: transparent;
}

body { min-height: 100vh; min-height: 100svh; }

.app {
  max-width: 720px;
  margin: 0 auto;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  padding-bottom: 76px;
  background: var(--cream);
  box-shadow: 0 0 80px rgba(0,0,0,0.4);
}

/* Header */
.app-header {
  background: var(--olive);
  padding: calc(26px + env(safe-area-inset-top)) 20px 16px;
  border-bottom: 2px solid var(--gold);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.theme-toggle {
  background: transparent;
  border: 1px solid var(--gold);
  color: var(--gold-lt);
  border-radius: 50%;
  width: 44px;
  height: 44px;
  min-width: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}
.theme-toggle:active { transform: scale(0.94); }
.brand { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.brand-mark {
  color: var(--gold-lt);
  flex-shrink: 0;
}
.app-header h1 {
  font-family: var(--display);
  font-weight: 700;
  font-size: 19px;
  letter-spacing: 0.04em;
  margin: 0;
  color: var(--cream);
}
.brand-sub {
  margin: 3px 0 0;
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
  font-family: var(--display);
}
.sync-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-left: 4px;
  vertical-align: middle;
  background: transparent;
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}
.sync-dot.syncing {
  background: var(--gold-lt);
  animation: syncPulse 1s ease-in-out infinite;
}
.sync-dot.synced {
  background: #7fbf7f;
  box-shadow: 0 0 0 3px rgba(127,191,127,0.22);
}
.sync-dot.sync-error { background: var(--danger); }
.sync-dot.pending { background: var(--gold); box-shadow: 0 0 0 3px rgba(168,144,80,0.22); }
@keyframes syncPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(1.35); }
}

/* Main / panes */
.app-main { flex: 1; padding: 24px 20px 40px; }

.pane-head { margin-bottom: 18px; }

@keyframes paneIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.pane { animation: paneIn 0.32s ease; }
.pane-head h2 {
  font-family: var(--display);
  font-weight: 700;
  font-size: 22px;
  color: var(--olive);
  margin: 0 0 6px;
}
.pane-head h2::after {
  content: '';
  display: block;
  width: 34px;
  height: 2px;
  background: linear-gradient(to right, var(--gold), transparent);
  margin-top: 8px;
}
.pane-head p {
  margin: 0;
  color: var(--sage);
  font-size: 14.5px;
  font-style: italic;
}

/* Forms / rows */
.row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.row input[type="text"],
.row select {
  flex: 1 1 160px;
  background: var(--card-bg);
  border: 1px solid var(--gold-lt);
  color: var(--ink);
  padding: 11px 14px;
  border-radius: 2px;
  font-family: var(--body);
  font-size: 16px;
  min-width: 0;
  min-height: 44px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.row input[type="text"]:focus,
.row select:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(168, 144, 80, 0.2);
}
.row select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='12'%20height='8'%20viewBox='0%200%2012%208'%3E%3Cpath%20d='M1%201l5%205%205-5'%20stroke='%23a89050'%20stroke-width='1.6'%20fill='none'%20stroke-linecap='round'%20stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 11px 8px;
  padding-right: 36px;
}
.row button {
  background: var(--olive);
  color: var(--cream);
  border: none;
  padding: 11px 18px;
  border-radius: 2px;
  font-family: var(--display);
  font-weight: 600;
  font-size: 12.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 44px;
  transition: transform 0.12s ease;
}
.row button:active { transform: scale(0.98); }

.btn-primary {
  background: var(--olive);
  color: var(--cream);
  border: none;
  padding: 11px 18px;
  border-radius: 2px;
  font-family: var(--display);
  font-weight: 600;
  font-size: 12.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  min-height: 44px;
  transition: transform 0.12s ease;
}
.btn-primary:active { transform: scale(0.98); }
.btn-primary:disabled { background: var(--cream-dk); color: var(--sage); cursor: not-allowed; }

.btn-ghost {
  background: transparent;
  color: var(--olive);
  border: 1px solid var(--gold);
  padding: 11px 16px;
  border-radius: 2px;
  font-family: var(--display);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  min-height: 44px;
  transition: transform 0.12s ease;
  cursor: pointer;
}
.btn-ghost:active { transform: scale(0.98); }
.btn-ghost:disabled { color: var(--sage); border-color: var(--cream-dk); cursor: not-allowed; }

.route-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }

#booking-add {
  white-space: normal;
  line-height: 1.3;
  text-align: center;
  flex: 1 1 100%;
}

.hint {
  font-size: 13px;
  color: var(--sage);
  margin-top: 10px;
  line-height: 1.6;
  font-style: italic;
}

/* Weather */
.weather-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.weather-card {
  border-radius: 4px;
  padding: 18px 14px;
  color: var(--cream);
  background: linear-gradient(165deg, var(--olive-mid), var(--olive));
  border: 1px solid var(--gold);
  position: relative;
  overflow: hidden;
}
.weather-card::before {
  content: '';
  position: absolute; top: 0; left: 10px; right: 10px;
  height: 2px; background: var(--gold);
}
.weather-card.dest {
  background: linear-gradient(165deg, #8a6a3c, #5c4726);
}
.weather-card h3 {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(12px, 3.4vw, 14px);
  letter-spacing: 0.05em;
  margin: 6px 0 10px;
  color: var(--gold-lt);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.weather-time {
  margin: -4px 0 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(245, 240, 232, 0.18);
}
.wt-now {
  display: block;
  font-size: 12.5px;
  color: var(--cream);
  opacity: 0.95;
}
.wt-clock { font-family: var(--mono); letter-spacing: 0.02em; }
.wt-diff {
  display: block;
  font-size: 11px;
  color: var(--gold-lt);
  margin-top: 1px;
}
.weather-top { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.weather-icon { font-size: clamp(26px, 7.5vw, 34px); line-height: 1; }
.weather-now {
  font-size: clamp(26px, 7.5vw, 36px);
  font-family: var(--display);
  font-weight: 700;
  line-height: 1;
}
.weather-desc { font-size: 12px; opacity: 0.85; margin-bottom: 14px; font-style: italic; }
.weather-days { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 2px; margin: 0 -4px; scrollbar-width: none; }
.weather-days::-webkit-scrollbar { display: none; }
.weather-day {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  background: rgba(245,240,232,0.12);
  border-radius: 3px;
  padding: 10px 11px;
  min-width: 48px;
}
.weather-day .wd-label { font-size: 10px; opacity: 0.85; font-family: var(--display); letter-spacing: 0.04em; }
.weather-day .wd-icon { font-size: 15px; }
.weather-day .wd-temp { font-family: var(--mono); white-space: nowrap; }
.weather-day .wd-temp b { font-size: 13px; font-weight: 700; opacity: 1; }
.weather-day .wd-temp span { font-size: 10.5px; opacity: 0.6; margin-left: 2px; }
@media (max-width: 380px) {
  .weather-grid { gap: 6px; }
  .weather-card { padding: 14px 10px; }
}
@media (max-width: 600px) {
  .weather-days { flex-direction: column; overflow-x: visible; margin: 0; gap: 8px; }
  .weather-day { flex-direction: row; justify-content: space-between; width: 100%; padding: 9px 12px; }
  .weather-day .wd-label { width: 34px; text-align: left; }
  .weather-day .wd-icon { font-size: 14px; }
}

/* Place lists */
.place-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.place-item {
  background: var(--card-bg);
  border: 1px solid var(--cream-dk);
  border-left: 3px solid var(--gold);
  border-radius: 2px;
  padding: 12px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.place-item .p-name { font-weight: 600; font-size: 15.5px; color: var(--olive); font-family: var(--body); }
.place-item .p-meta { font-size: 11.5px; color: var(--sage); font-family: var(--display); text-transform: uppercase; letter-spacing: 0.04em; margin-top: 3px; }
.place-item button {
  background: transparent;
  border: 1px solid var(--gold);
  color: var(--olive);
  border-radius: 2px;
  padding: 8px 10px;
  font-family: var(--display);
  font-size: 11px;
  letter-spacing: 0.04em;
  cursor: pointer;
  flex-shrink: 0;
}

/* Route list */
.route-list { list-style: none; margin: 0 0 4px; padding: 0; counter-reset: stop; }
.route-list li {
  counter-increment: stop;
  background: var(--card-bg);
  border: 1px solid var(--cream-dk);
  border-radius: 2px;
  padding: 10px 14px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.route-list li::before {
  content: counter(stop);
  font-family: var(--display);
  color: var(--gold);
  border: 1px solid var(--gold);
  border-radius: 50%;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  flex-shrink: 0;
}
.route-list li span { flex: 1; font-size: 15px; }
.route-list li button {
  background: transparent;
  border: none;
  color: var(--sage);
  cursor: pointer;
  font-size: 12.5px;
  font-family: var(--display);
  letter-spacing: 0.03em;
}

/* Photo album */
.album-card {
  background: linear-gradient(135deg, var(--cream-dk), var(--card-bg));
  border: 1px solid var(--gold);
  border-left: 3px solid var(--gold);
  border-radius: 3px;
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
}
.album-card-icon { font-size: 28px; flex-shrink: 0; line-height: 1; }
.album-card-body { min-width: 0; }
.album-card-title {
  font-family: var(--display);
  font-weight: 600;
  font-size: 15px;
  color: var(--olive);
  letter-spacing: 0.02em;
}
.album-card-link {
  font-size: 11.5px;
  color: var(--sage);
  font-family: var(--mono);
  word-break: break-all;
  margin-top: 4px;
}

/* Itinerary */
.day-card {
  background: var(--card-bg);
  border: 1px solid var(--cream-dk);
  border-top: 2px solid var(--gold);
  border-left: 3px solid var(--gold);
  border-radius: 2px;
  padding: 16px;
  margin-bottom: 14px;
}
.day-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.day-title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.day-num {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--olive);
  border: 1.5px solid var(--gold);
  color: var(--gold-lt);
  font-family: var(--display);
  font-weight: 700;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.day-card-head h3 {
  font-family: var(--display);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: 0.03em;
  color: var(--olive);
  margin: 0;
}
.day-card-head button {
  background: none;
  border: none;
  font-size: 12px;
  font-family: var(--display);
  letter-spacing: 0.03em;
  cursor: pointer;
}
.day-card-actions { display: flex; gap: 14px; align-items: baseline; flex-shrink: 0; }
.author-tag {
  font-family: var(--display);
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--sage);
  background: var(--cream-dk);
  border-radius: 10px;
  padding: 3px 9px;
  flex-shrink: 0;
  white-space: nowrap;
}
.day-edit { color: var(--gold); }
.day-del { color: var(--danger); }
.day-card textarea {
  width: 100%;
  min-height: 140px;
  background: var(--cream);
  border: 1px solid var(--cream-dk);
  color: var(--ink);
  border-radius: 2px;
  padding: 10px 12px;
  font-family: var(--body);
  font-size: 15.5px;
  line-height: 1.55;
  resize: vertical;
  overflow: hidden;
}
.day-view {
  font-family: var(--body);
  font-size: 15.5px;
  line-height: 1.8;
  color: var(--ink);
  cursor: text;
  padding: 2px 2px;
}
.day-view .time-marker {
  font-family: var(--display);
  font-weight: 600;
  font-size: 12.5px;
  letter-spacing: 0.03em;
  color: var(--olive);
  background: var(--cream-dk);
  border-radius: 2px;
  padding: 1px 5px;
  margin-right: 2px;
  white-space: nowrap;
}
.day-view-empty { color: var(--sage); font-style: italic; }

.booking-title {
  font-family: var(--display);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.02em;
  color: var(--olive);
  background: transparent;
  border: none;
  border-bottom: 1px dashed var(--gold-lt);
  padding: 2px 0;
  flex: 1;
  min-width: 0;
  margin-right: 10px;
}
.booking-title:focus { outline: none; border-bottom-color: var(--gold); }
.booking-title::placeholder { color: var(--sage); font-style: italic; font-weight: 400; }
.empty-state {
  text-align: center;
  color: var(--sage);
  border: 1px dashed var(--gold-lt);
  border-radius: 2px;
  padding: 30px 16px;
  font-size: 14px;
  font-style: italic;
}
.empty-state .empty-icon {
  display: block;
  font-size: 26px;
  line-height: 1;
  margin-bottom: 10px;
  color: var(--gold);
  font-style: normal;
}

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 88px;
  transform: translateX(-50%) translateY(10px);
  background: var(--olive);
  color: var(--cream);
  border: 1px solid var(--gold);
  padding: 11px 20px;
  border-radius: 4px;
  font-family: var(--display);
  font-size: 12.5px;
  letter-spacing: 0.03em;
  text-align: center;
  max-width: 88%;
  box-shadow: 0 8px 28px rgba(0,0,0,0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 50;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
@media (min-width: 1024px) {
  .toast { bottom: 28px; }
}

/* Expenses & budget */
.budget-progress { margin-bottom: 18px; }
.budget-progress-bar {
  height: 10px;
  background: var(--cream-dk);
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--gold-lt);
}
.budget-progress-fill {
  height: 100%;
  background: linear-gradient(to right, var(--olive-mid), var(--olive));
  transition: width 0.4s ease, background-color 0.3s ease;
}
.budget-progress-fill.over-budget { background: var(--danger); }
.budget-progress-label {
  font-size: 12.5px;
  color: var(--sage);
  margin-top: 6px;
  font-family: var(--mono);
}

#expense-form .row { margin-bottom: 10px; }

.expense-list { list-style: none; margin: 0 0 4px; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.expense-item {
  background: var(--card-bg);
  border: 1px solid var(--cream-dk);
  border-left: 3px solid var(--gold);
  border-radius: 2px;
  padding: 12px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.expense-item .ex-amount {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 16px;
  color: var(--olive);
  white-space: nowrap;
}
.expense-item .ex-eur {
  font-family: var(--mono);
  font-weight: 400;
  font-size: 12px;
  color: var(--sage);
  margin-top: 1px;
}
.expense-item .ex-desc { font-size: 14.5px; margin-top: 2px; }
.expense-item .ex-meta {
  font-size: 11.5px;
  color: var(--sage);
  font-family: var(--display);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 3px;
}
.expense-item button {
  background: transparent;
  border: 1px solid var(--cream-dk);
  color: var(--danger);
  border-radius: 2px;
  padding: 8px 10px;
  font-family: var(--display);
  font-size: 11px;
  letter-spacing: 0.04em;
  cursor: pointer;
  flex-shrink: 0;
  min-height: 44px;
}

.balance-list {
  background: var(--card-bg);
  border: 1px solid var(--cream-dk);
  border-radius: 2px;
  padding: 4px 16px;
  margin-bottom: 14px;
}
.balance-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--cream-dk);
  font-size: 14.5px;
}
.balance-row:last-child { border-bottom: none; }
.balance-row span:last-child { font-family: var(--mono); font-weight: 700; }
.balance-pos { color: var(--olive); }
.balance-neg { color: var(--danger); }

.settle-list { display: flex; flex-direction: column; gap: 8px; }
.settle-row {
  background: var(--cream-dk);
  border-radius: 2px;
  padding: 10px 14px;
  font-size: 14px;
}
.settle-amount { font-family: var(--mono); font-weight: 700; color: var(--olive); float: right; }

/* Packing & task checklist */
.segment-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.chip {
  background: transparent;
  border: 1px solid var(--gold-lt);
  color: var(--olive);
  padding: 8px 16px;
  border-radius: 20px;
  font-family: var(--display);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  min-height: 44px;
  transition: background-color 0.15s ease, color 0.15s ease, transform 0.12s ease;
}
.chip:active { transform: scale(0.96); }
.chip.active { background: var(--olive); color: var(--cream); border-color: var(--olive); }
.checklist-list { list-style: none; margin: 0 0 4px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.checklist-item {
  background: var(--card-bg);
  border: 1px solid var(--cream-dk);
  border-left: 3px solid var(--gold);
  border-radius: 2px;
  padding: 4px 10px 4px 4px;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: opacity 0.2s ease;
}
.checklist-item.done { opacity: 0.55; }
.checklist-item.done .ci-text { text-decoration: line-through; }
.ci-check {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  cursor: pointer;
}
.ci-check input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: var(--olive);
  cursor: pointer;
}
.ci-body { flex: 1; min-width: 0; }
.ci-text { font-size: 14.5px; }
.ci-assignee {
  font-size: 11px;
  color: var(--sage);
  font-family: var(--display);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 2px;
}
.ci-del {
  background: transparent;
  border: 1px solid var(--cream-dk);
  color: var(--danger);
  border-radius: 2px;
  padding: 8px 10px;
  font-family: var(--display);
  font-size: 11px;
  letter-spacing: 0.04em;
  cursor: pointer;
  flex-shrink: 0;
  min-height: 44px;
}

/* Tab bar */
.tabbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  max-width: 720px;
  margin: 0 auto;
  background: var(--olive);
  border-top: 2px solid var(--gold);
  display: flex;
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  z-index: 10;
  box-shadow: 0 0 40px rgba(0,0,0,0.35);
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
  will-change: transform;
}
.tab-btn {
  flex: 1;
  background: none;
  border: none;
  color: rgba(245,240,232,0.55);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 8px 2px;
  font-family: var(--display);
  font-size: 9.5px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: 2px;
  transition: transform 0.12s ease;
}
.tab-btn:active { transform: scale(0.94); }
.tab-btn { position: relative; }
.tab-btn .tab-ico { display: block; }
.tab-btn.active { color: var(--gold-lt); }
.tab-btn.active::after {
  content: '';
  position: absolute;
  left: 50%; bottom: 2px;
  transform: translateX(-50%);
  width: 18px; height: 2px;
  background: var(--gold-lt);
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* ── Tablet: ~640–1023px. Still a bottom bar (a tablet is held, not sat
   at a desk), but bigger touch targets and more columns where lists allow
   it — useful when planning together with kids around one screen. ── */
@media (min-width: 640px) {
  .row button, .btn-primary, .btn-ghost {
    padding: 13px 20px;
    font-size: 13px;
  }
  .tab-btn { padding: 10px 4px; }
  .tab-btn .tab-ico { width: 21px; height: 21px; }
  .place-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
}

/* ── Desktop: 1024px+. A bottom tab bar reads as a mobile metaphor at this
   size, so it becomes a left sidebar instead; the app gets more room and
   the itinerary lays out in two columns. ── */
@media (min-width: 1024px) {
  .app {
    max-width: 1080px;
    display: grid;
    grid-template-areas: "header header" "nav main";
    grid-template-columns: 220px 1fr;
    grid-template-rows: auto 1fr;
    padding-bottom: 0;
  }
  .app-header { grid-area: header; }
  .app-main { grid-area: main; padding: 28px 32px 48px; }

  .tabbar {
    grid-area: nav;
    position: sticky;
    top: 20px;
    align-self: start;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    max-width: none;
    margin: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    border-top: none;
    border-right: 2px solid var(--gold);
    box-shadow: none;
    padding: 24px 12px;
  }
  .tab-btn {
    flex-direction: row;
    justify-content: flex-start;
    gap: 12px;
    padding: 12px 14px;
    font-size: 12px;
    border-radius: 3px;
  }
  .tab-btn.active { background: rgba(200,185,122,0.14); }
  .tab-btn.active::after {
    left: 0; bottom: auto; top: 6px; transform: none;
    width: 3px; height: calc(100% - 12px);
  }

  #plan-days {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    align-items: start;
  }
  #plan-days .day-card { margin-bottom: 0; }
  #plan-days .empty-state { grid-column: 1 / -1; }

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

/* ============================================================
   Print — AK Brand Guidelines print pass
   ============================================================
   Notes on what pure CSS can and cannot do here (see chat reply
   for details): the footer below uses position:fixed, which
   repeats per page in Chrome's print engine but isn't a
   guaranteed cross-browser standard. The print date is not
   included because CSS has no mechanism to read the current
   date — that needs one line of JS (beforeprint), left out here
   since only a CSS block was requested.
   ============================================================ */
@media print {
  @page { margin: 18mm 14mm; }

  /* Hide all interactive/app chrome: nav, forms, buttons, selects,
     sync indicator, icons — nothing clickable belongs on paper. */
  .app-header, .tabbar, .no-print,
  #checklist-form, .segment-chips, #segment-remove-row,
  #expense-form, #route-form, #route-paste-form, #plan-share-btn,
  #plan-share-status, #budget-limit, .row, .btn-primary, .btn-ghost,
  button, select, .sync-dot, .tab-ico, .brand-mark,
  .budget-progress, .pane-head p, .hint, .ci-del, .day-card-actions,
  .day-edit, .day-del, textarea {
    display: none !important;
  }

  html, body, .app {
    background: #fff !important;
    box-shadow: none !important;
    color: var(--ink);
  }
  .app {
    max-width: 100%;
    padding-bottom: 0;
    display: block !important; /* undo the desktop sidebar grid for print */
  }
  .app-main { padding: 8mm 0 14mm; }

  /* Branded print header — generated once at the top of the
     document (see note above re: per-page repetition). */
  .app::before {
    content: "ПЪТЕН ДНЕВНИК • ASEN KOSTOV";
    display: block;
    font-family: var(--display);
    font-size: 13px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--olive);
    border-bottom: 1px solid var(--gold);
    padding-bottom: 10px;
    margin-bottom: 16px;
  }

  /* Discreet footer, pinned per page in Chrome via position:fixed. */
  .app::after {
    content: "Генерирано през travelapp-glf.pages.dev • AK Brand Guidelines";
    position: fixed;
    left: 14mm;
    right: 14mm;
    bottom: 8mm;
    font-family: var(--body);
    font-style: italic;
    font-size: 9.5px;
    color: var(--sage);
    text-align: center;
    border-top: 1px solid var(--cream-dk);
    padding-top: 6px;
  }

  /* Headings olive, body text deep ink — matches on-screen palette,
     just without any dark fills. */
  .pane-head h2 { color: var(--olive); }
  .pane-head h2::after { background: var(--gold); }
  body { color: #2c2c2c; }

  /* Cards & rows: thin gold-lt borders instead of the heavier
     on-screen accent bars/shadows — cleaner and lighter on ink. */
  .day-card, .checklist-item, .expense-item, .balance-list,
  .settle-row, .place-item, .route-list li {
    background: #fff !important;
    border: 1px solid var(--gold-lt) !important;
    box-shadow: none !important;
    break-inside: avoid;
    page-break-inside: avoid;
  }
  .day-num { border-color: var(--gold-lt); background: #fff; color: var(--olive); }
  .expense-item .ex-amount, .settle-amount { color: var(--olive); }

  /* Checklist: clean tickable squares instead of OS checkbox widgets,
     reusing the existing .done class already set in the markup. */
  .ci-check input[type="checkbox"] { display: none; }
  .ci-check {
    width: 20px;
    height: 20px;
    border: 1.5px solid var(--olive);
    border-radius: 2px;
    position: relative;
  }
  .checklist-item.done .ci-check::after {
    content: "✓";
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--olive);
    font-weight: 700;
    font-size: 14px;
  }

  #plan-days, #checklist-packing, #checklist-tasks {
    display: block !important; /* undo any on-screen multi-column grid */
  }
}
