@import url('https://fonts.googleapis.com/css2?family=Baloo+2:wght@500;700&family=Nunito:wght@400;600;700&display=swap');

:root {
  --bg-sky: #d8f1f0;
  --bg-cream: #fff8e8;
  --bg-coral: #ffd3c2;
  --ink-main: #325962;
  --ink-soft: #53777d;
  --card: #fffcf4;
  --line-soft: #f4cdb5;
  --accent-main: #ff8f70;
  --accent-deep: #f16e52;
  --accent-blue: #5bb8c8;
  --shadow-soft: 0 14px 30px rgba(50, 89, 98, 0.14);
  --shadow-pop: 0 12px 20px rgba(241, 110, 82, 0.24);
}

* {
  box-sizing: border-box;
}

body {
  font-family: 'Nunito', sans-serif;
  text-align: center;
  margin: 0;
  padding: 0;
  color: var(--ink-main);
  background:
    radial-gradient(circle at 12% 18%, rgba(255, 255, 255, 0.8) 0%, rgba(255, 255, 255, 0) 25%),
    radial-gradient(circle at 86% 8%, rgba(255, 255, 255, 0.72) 0%, rgba(255, 255, 255, 0) 24%),
    linear-gradient(160deg, var(--bg-sky) 0%, var(--bg-cream) 46%, var(--bg-coral) 100%);
  min-height: 100vh;
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: calc(env(safe-area-inset-top) + 64px);
  border-radius: 0 0 20px 20px;
  border: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.34);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.44) 0%, rgba(255, 255, 255, 0.22) 56%, rgba(255, 255, 255, 0) 100%);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.26);
  z-index: 997;
  pointer-events: none;
}

header {
  background:
    linear-gradient(130deg, rgba(91, 184, 200, 0.95), rgba(91, 184, 200, 0.85)),
    linear-gradient(240deg, rgba(255, 143, 112, 0.95), rgba(255, 143, 112, 0.8));
  color: #ffffff;
  padding: 78px 20px 34px;
  border-bottom-left-radius: 34px;
  border-bottom-right-radius: 34px;
  box-shadow: var(--shadow-soft);
}

header h1 {
  margin: 0;
  font-family: 'Baloo 2', cursive;
  font-size: clamp(2.3rem, 4.8vw, 3.4rem);
  font-weight: 700;
  letter-spacing: 0.6px;
  text-shadow: 0 4px 10px rgba(0, 0, 0, 0.18);
}

header p {
  margin-top: 8px;
  margin-bottom: 0;
  font-size: 1.08rem;
  font-weight: 600;
  opacity: 0.95;
}

.top-nav {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 16px 0 28px;
  flex-wrap: wrap;
}

.top-nav a {
  text-decoration: none;
  color: #ffffff;
  font-family: 'Baloo 2', cursive;
  font-size: 1.03rem;
  letter-spacing: 0.3px;
  background: linear-gradient(135deg, var(--accent-main), #ffaf73);
  border: 2px solid rgba(255, 255, 255, 0.65);
  padding: 9px 18px;
  border-radius: 999px;
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
  box-shadow: 0 6px 14px rgba(241, 110, 82, 0.3);
}

.top-nav-dropdown {
  display: none;
  width: min(94%, 430px);
  margin: 12px auto 24px;
  position: relative;
}

.top-nav-dropdown select {
  width: 100%;
  margin: 0;
  color: #ffffff;
  font-family: 'Baloo 2', cursive;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  background: linear-gradient(135deg, var(--accent-main), #ffaf73);
  border: 2px solid rgba(255, 255, 255, 0.68);
  border-radius: 999px;
  padding: 10px 36px 10px 18px;
  box-shadow: 0 6px 14px rgba(241, 110, 82, 0.3);
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.top-nav-dropdown::before {
  content: '▾';
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(255, 255, 255, 0.95);
  font-size: 1rem;
  pointer-events: none;
  transition: transform 0.2s ease;
}

.top-nav-dropdown:hover select,
.top-nav-dropdown:focus-within select {
  transform: translateY(-2px);
  filter: saturate(1.08);
  box-shadow: 0 10px 18px rgba(241, 110, 82, 0.34);
}

.top-nav-dropdown:hover::before,
.top-nav-dropdown:focus-within::before {
  transform: translateY(-46%);
}

.theme-toggle {
  position: fixed;
  top: 12px;
  right: 14px;
  z-index: 999;
  color: #ffffff;
  font-family: 'Baloo 2', cursive;
  font-size: 0.95rem;
  letter-spacing: 0.3px;
  background: linear-gradient(135deg, #4ca8ba, #5fc89e);
  border: 2px solid rgba(255, 255, 255, 0.75);
  padding: 8px 14px;
  border-radius: 999px;
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
  box-shadow: 0 6px 14px rgba(74, 157, 171, 0.26);
  width: auto;
  min-width: 0;
  min-height: 0;
  display: inline-block;
  white-space: nowrap;
}

.brand-mark {
  position: fixed;
  top: 12px;
  left: 14px;
  z-index: 998;
  display: inline-block;
  text-decoration: none;
  color: #ffffff;
  font-family: 'Baloo 2', cursive;
  font-size: 1.28rem;
  font-weight: 700;
  letter-spacing: 0.7px;
  background: transparent;
  border: none;
  padding: 4px 2px;
  border-radius: 0;
  box-shadow: none;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  transition: opacity 0.2s ease, color 0.2s ease;
  white-space: nowrap;
}

.top-nav a:hover {
  transform: translateY(-2px);
  filter: saturate(1.08);
  box-shadow: 0 10px 18px rgba(241, 110, 82, 0.34);
}

.theme-toggle:hover {
  transform: translateY(-2px);
  filter: saturate(1.08);
  box-shadow: 0 10px 18px rgba(74, 157, 171, 0.32);
}

.brand-mark:hover {
  transform: none;
  filter: none;
  box-shadow: none;
  opacity: 0.88;
}

.theme-toggle:focus-visible {
  outline: 3px solid rgba(255, 255, 255, 0.75);
  outline-offset: 2px;
}

.brand-mark:focus-visible {
  outline: 3px solid rgba(255, 255, 255, 0.75);
  outline-offset: 2px;
}

.card,
section {
  background: var(--card);
  margin: 20px auto;
  padding: 22px;
  width: 95%;
  max-width: 860px;
  border-radius: 18px;
  border: 2px solid rgba(244, 205, 181, 0.75);
  box-shadow: var(--shadow-soft);
  text-align: left;
}

.card h2,
section h2 {
  margin-top: 0;
  margin-bottom: 14px;
  color: var(--ink-main);
  font-family: 'Baloo 2', cursive;
  font-size: 1.9rem;
  letter-spacing: 0.3px;
}

.card p {
  font-size: 1rem;
  line-height: 1.62;
  color: var(--ink-soft);
}

.card a {
  color: var(--accent-deep);
  text-decoration: none;
  font-weight: 700;
  background: rgba(255, 143, 112, 0.14);
  padding: 4px 8px;
  border-radius: 8px;
  transition: background 0.2s ease, color 0.2s ease;
}

.card a:hover {
  background: var(--accent-main);
  color: #ffffff;
}

.about-box,
.tutorial-box {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.75), rgba(255, 251, 240, 0.92));
}

.data-tools-box {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(246, 253, 255, 0.94));
  border-style: dashed;
  border-color: rgba(91, 184, 200, 0.45);
}

.data-tools-box h2,
.data-tools-box p {
  text-align: center;
}

.data-tools-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.data-tools-actions button {
  min-width: 190px;
}

.print-summary-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 190px;
  text-decoration: none;
  color: #ffffff;
  font-family: 'Baloo 2', cursive;
  font-size: 1rem;
  font-weight: 700;
  padding: 10px 16px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent-main), var(--accent-deep));
  box-shadow: var(--shadow-pop);
}

.data-import-status {
  margin-top: 14px;
  margin-bottom: 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink-soft);
}

.expense-import-tools {
  margin-bottom: 16px;
  padding: 14px;
  border-radius: 14px;
  border: 1px dashed rgba(91, 184, 200, 0.45);
  background: linear-gradient(180deg, rgba(246, 253, 255, 0.92), rgba(255, 251, 240, 0.96));
}

.expense-import-tools p {
  margin-top: 0;
  margin-bottom: 10px;
  text-align: center;
}

.expense-import-row {
  margin-bottom: 0;
}

.expense-import-row select {
  width: 100%;
  min-width: 250px;
}

.about-box h2,
.tutorial-box h2,
.about-box p,
.tutorial-box p {
  text-align: center;
}

.tutorial-box p {
  margin-bottom: 20px;
}

.tutorial-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}

.tutorial-link {
  display: block;
  background: linear-gradient(165deg, #ffffff, #fff3e4);
  border: 2px dashed rgba(241, 110, 82, 0.3);
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 8px 14px rgba(0, 0, 0, 0.08);
  text-align: left;
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.tutorial-link strong {
  display: block;
  color: var(--accent-deep);
  font-family: 'Baloo 2', cursive;
  font-size: 1.15rem;
  margin-bottom: 6px;
}

.tutorial-link span {
  display: block;
  color: var(--ink-soft);
  line-height: 1.5;
}

.tutorial-link:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 18px rgba(0, 0, 0, 0.12);
}

input {
  margin: 8px 0;
  padding: 10px 12px;
  border-radius: 12px;
  border: 2px solid var(--line-soft);
  width: 100%;
  max-width: 420px;
  font-size: 1rem;
  font-family: 'Nunito', sans-serif;
  color: var(--ink-main);
  background: #fffdf8;
}

select {
  margin: 8px 0;
  padding: 10px 12px;
  border-radius: 12px;
  border: 2px solid var(--line-soft);
  font-size: 1rem;
  font-family: 'Nunito', sans-serif;
  color: var(--ink-main);
  background: #fffdf8;
}

input:focus {
  outline: none;
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(91, 184, 200, 0.2);
}

select:focus {
  outline: none;
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(91, 184, 200, 0.2);
}

button {
  background: linear-gradient(135deg, var(--accent-main), var(--accent-deep));
  border: none;
  padding: 10px 16px;
  color: #ffffff;
  font-family: 'Baloo 2', cursive;
  font-size: 1rem;
  font-weight: 700;
  border-radius: 12px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
  box-shadow: var(--shadow-pop);
}

button:hover {
  transform: translateY(-1px) scale(1.02);
  filter: brightness(1.03);
}

button:active {
  transform: scale(0.97);
}

ul,
ol {
  padding: 0;
  list-style: none;
  text-align: left;
}

ol {
  padding-left: 20px;
}

ol li {
  margin: 10px 0;
  line-height: 1.45;
}

li {
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.9), rgba(255, 245, 233, 0.95));
  margin: 8px auto;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid rgba(244, 205, 181, 0.85);
  width: 100%;
  max-width: 520px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

li button {
  background: linear-gradient(135deg, #ff7b7b, #ff5e72);
  padding: 6px 12px;
  font-size: 0.82rem;
  border-radius: 8px;
  box-shadow: none;
  width: auto;
  min-height: 36px;
  min-width: 0;
  flex-shrink: 0;
  white-space: nowrap;
}

.input-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-bottom: 15px;
}

.input-row input[type="text"],
.input-row input[type="number"] {
  flex: 1 1 150px;
  max-width: 210px;
}

.input-row input[type="date"] {
  flex: 1 1 200px;
  max-width: 210px;
}

.input-row input[type="datetime-local"] {
  flex: 1 1 220px;
  max-width: 240px;
}

.input-row button {
  flex: 0 0 auto;
  width: auto;
}

.trip-range-apply-wrap {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

.trip-range-apply-wrap select {
  min-width: 250px;
}

.itinerary-page .trip-range-apply-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  width: 100%;
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
}

.itinerary-page .trip-range-apply-wrap select {
  width: 100%;
  min-width: 0;
  max-width: none;
}

.itinerary-page .trip-range-apply-wrap .select-with-arrow {
  position: relative;
  width: 100%;
}

.itinerary-page .trip-range-apply-wrap .select-with-arrow::after {
  content: '▾';
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink-soft);
  font-size: 0.95rem;
  pointer-events: none;
}

.itinerary-page .trip-range-apply-wrap .select-with-arrow select {
  padding-right: 34px;
}

.itinerary-page .trip-range-apply-wrap button {
  white-space: nowrap;
  min-width: clamp(130px, 16vw, 210px);
}

.quick-destination-wrap {
  margin-top: -2px;
  margin-bottom: 8px;
}

.quick-destination-title {
  margin: 2px 0 6px;
  text-align: center;
  color: var(--ink-soft);
  font-size: 0.92rem;
  font-weight: 400;
}

.quick-destination-wrap input[type="text"] {
  flex: 1 1 220px;
  max-width: 260px;
}

.quick-destination-wrap input[type="date"] {
  flex: 1 1 160px;
  max-width: 180px;
}

.quick-destination-wrap.hidden {
  display: none;
}

.quick-destination-title.hidden {
  display: none;
}

.trip-range-source {
  margin-top: 0;
  margin-bottom: 10px;
  text-align: center;
  color: var(--ink-soft);
  font-weight: 400;
}

.trip-range-source strong {
  font-weight: 700;
}

#calendar {
  max-width: 100%;
  margin: 0 auto;
  background: #fffdf8;
  border-radius: 14px;
  border: 2px solid var(--line-soft);
  padding: 10px;
}

#destinationMap {
  width: 100%;
  height: 360px;
  border-radius: 14px;
  border: 2px solid rgba(91, 184, 200, 0.4);
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}

.leaflet-popup-content-wrapper {
  border-radius: 10px;
}

.leaflet-popup-content {
  margin: 10px 12px;
  font-family: 'Nunito', sans-serif;
  color: #2f4f57;
}

.fc .fc-toolbar-title {
  font-family: 'Baloo 2', cursive;
  color: var(--ink-main);
}

.fc .fc-button {
  background: linear-gradient(135deg, var(--accent-main), var(--accent-deep));
  border: none;
}

.fc .fc-daygrid-event {
  border: none;
  background: linear-gradient(135deg, var(--accent-blue), #76c6b7);
}

.destination-item {
  text-align: center;
}

.conversion-page {
  background:
    radial-gradient(circle at 12% 14%, rgba(194, 234, 239, 0.64) 0%, rgba(194, 234, 239, 0) 28%),
    radial-gradient(circle at 88% 10%, rgba(255, 222, 204, 0.62) 0%, rgba(255, 222, 204, 0) 26%),
    linear-gradient(160deg, #dff4f4 0%, #fff9ed 52%, #ffddcf 100%);
}

.conversion-controls {
  margin-bottom: 10px;
}

.conversion-result {
  margin-top: 4px;
  margin-bottom: 8px;
  text-align: center;
  color: #24505a;
  font-weight: 700;
  font-size: 1.04rem;
}

.rates-table-wrap {
  overflow-x: auto;
}

.rates-table {
  width: 100%;
  border-collapse: collapse;
  border: 2px solid rgba(91, 184, 200, 0.32);
  border-radius: 12px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.82);
}

.rates-table th,
.rates-table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(91, 184, 200, 0.2);
}

.rates-table th {
  font-family: 'Baloo 2', cursive;
  color: #27535d;
  background: rgba(91, 184, 200, 0.16);
}

.rates-table tr:last-child td {
  border-bottom: none;
}

/* Page-specific moods while keeping one palette */
.home-page {
  background:
    radial-gradient(circle at 15% 20%, rgba(255, 255, 255, 0.82) 0%, rgba(255, 255, 255, 0) 26%),
    radial-gradient(circle at 80% 10%, rgba(255, 225, 209, 0.62) 0%, rgba(255, 225, 209, 0) 28%),
    linear-gradient(160deg, #d7f0ef 0%, #fff9ed 48%, #ffd6c6 100%);
}

.home-page .tutorial-link:nth-child(1) {
  border-color: rgba(91, 184, 200, 0.42);
}

.home-page .tutorial-link:nth-child(2) {
  border-color: rgba(241, 110, 82, 0.45);
}

.home-page .tutorial-link:nth-child(3) {
  border-color: rgba(132, 194, 110, 0.42);
}

.home-page .tutorial-link:nth-child(4) {
  border-color: rgba(236, 160, 81, 0.45);
}

.print-summary-page {
  background:
    radial-gradient(circle at 16% 18%, rgba(255, 255, 255, 0.78) 0%, rgba(255, 255, 255, 0) 28%),
    linear-gradient(160deg, #e6f5f3 0%, #fff9ed 56%, #ffd9cc 100%);
}

.print-summary-page .card {
  page-break-inside: avoid;
}

.print-summary-item,
.print-empty-item {
  display: block;
  text-align: left;
}

.print-meta-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.84), rgba(247, 253, 255, 0.95));
}

.print-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 8px 20px;
}

.print-meta-grid p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.96rem;
}

.print-empty-item {
  justify-content: center;
  text-align: center;
}

.destinations-page {
  background:
    radial-gradient(circle at 8% 16%, rgba(177, 227, 233, 0.65) 0%, rgba(177, 227, 233, 0) 28%),
    radial-gradient(circle at 92% 14%, rgba(255, 214, 198, 0.68) 0%, rgba(255, 214, 198, 0) 24%),
    linear-gradient(165deg, #dbf2f1 0%, #fff8e9 52%, #ffdccc 100%);
}

.destinations-page .card {
  border-style: dashed;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.8), rgba(253, 247, 236, 0.94));
}

.itinerary-page {
  background:
    radial-gradient(circle at 18% 24%, rgba(255, 229, 213, 0.66) 0%, rgba(255, 229, 213, 0) 30%),
    radial-gradient(circle at 86% 10%, rgba(173, 228, 221, 0.64) 0%, rgba(173, 228, 221, 0) 26%),
    linear-gradient(160deg, #dcf2f0 0%, #fff7e5 50%, #ffd7c4 100%);
}

.itinerary-page #calendar {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(250, 255, 255, 0.94));
  border-color: rgba(91, 184, 200, 0.4);
  padding: 14px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.7);
}

.itinerary-page .fc .fc-button {
  box-shadow: 0 6px 12px rgba(74, 157, 171, 0.22);
}

.itinerary-page .fc .fc-toolbar-title {
  font-size: clamp(1.25rem, 2.2vw, 1.65rem);
  letter-spacing: 0.4px;
  color: var(--accent-deep);
}

.itinerary-page .fc .fc-daygrid-day-frame {
  min-height: 92px;
  padding: 4px;
}

.itinerary-page .fc-theme-standard td,
.itinerary-page .fc-theme-standard th {
  border-color: rgba(91, 184, 200, 0.26);
}

.itinerary-page .fc .fc-col-header-cell {
  background: rgba(91, 184, 200, 0.12);
}

.itinerary-page .fc a,
.itinerary-page .fc a:visited,
.itinerary-page .fc a:hover,
.itinerary-page .fc a:focus {
  background: transparent;
  color: inherit;
  padding: 0;
  border-radius: 0;
  text-decoration: none;
}

.itinerary-page .fc .fc-col-header-cell-cushion {
  color: #9b5443;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  font-size: 0.78rem;
}

.itinerary-page .fc .fc-daygrid-day-number {
  color: #9b5443;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 5px 7px;
}

.itinerary-page .fc .fc-col-header-cell-cushion,
.itinerary-page .fc .fc-col-header-cell-cushion:visited,
.itinerary-page .fc .fc-col-header-cell-cushion:hover,
.itinerary-page .fc .fc-daygrid-day-number,
.itinerary-page .fc .fc-daygrid-day-number:visited,
.itinerary-page .fc .fc-daygrid-day-number:hover {
  color: #9b5443;
  opacity: 1;
  text-decoration: none;
}

.itinerary-page .fc .fc-day-today {
  background: linear-gradient(180deg, rgba(255, 184, 157, 0.24), rgba(255, 184, 157, 0.08));
}

.itinerary-page .fc .fc-daygrid-event {
  border-radius: 8px;
  padding: 3px 6px;
  font-size: 0.8rem;
  line-height: 1.3;
  box-shadow: 0 3px 8px rgba(74, 157, 171, 0.2);
}

.itinerary-page .fc .fc-daygrid-event .fc-event-title {
  font-weight: 700;
}

.calendar-hover-tooltip {
  position: absolute;
  z-index: 2000;
  max-width: 280px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(91, 184, 200, 0.5);
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 10px 24px rgba(44, 88, 98, 0.22);
  color: #2b5059;
  font-size: 0.88rem;
  line-height: 1.4;
  pointer-events: none;
}

.calendar-tooltip-title {
  font-family: 'Baloo 2', cursive;
  font-size: 1rem;
  font-weight: 700;
  color: #22505a;
  margin-bottom: 4px;
}

.calendar-tooltip-line {
  color: #325962;
}

.itinerary-page #activityList .activity-address {
  display: block;
  margin-top: 2px;
  word-break: break-word;
  color: #3b6a74;
  font-size: 0.92rem;
  font-weight: 600;
}

.itinerary-page #activityList li {
  display: block;
  max-width: 640px;
}

.itinerary-page #activityList li button {
  margin-top: 8px;
}

.itinerary-page .activity-map-links {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.itinerary-page .activity-map-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(91, 184, 200, 0.16);
  color: #22505a;
  text-decoration: none;
  font-size: 0.84rem;
  font-weight: 700;
}

.itinerary-page .activity-map-links a:hover {
  background: rgba(91, 184, 200, 0.3);
}

.map-choice-popover {
  position: fixed;
  z-index: 2100;
  width: clamp(240px, 34vw, 320px);
  max-width: calc(100vw - 24px);
  border-radius: 12px;
  border: 1px solid rgba(91, 184, 200, 0.5);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 12px 28px rgba(44, 88, 98, 0.24);
  padding: 10px;
}

.map-choice-title {
  margin: 0 0 8px;
  color: #2a535d;
  font-size: 0.9rem;
  font-weight: 700;
}

.map-choice-actions {
  display: grid;
  gap: 6px;
}

.map-choice-btn {
  width: 100%;
  box-shadow: none;
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 0.9rem;
  white-space: normal;
  line-height: 1.3;
}

.map-choice-cancel {
  background: linear-gradient(135deg, #7f9aa1, #68868e);
}

.day-view-controls {
  margin-bottom: 10px;
}

.day-view-controls button {
  min-width: 112px;
}

.day-view-controls input[type="date"] {
  max-width: 250px;
}

@media screen and (min-width: 900px) {
  .itinerary-page .input-row {
    flex-wrap: nowrap;
    align-items: center;
  }

  .itinerary-page .trip-range-apply-wrap {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
  }
}

#dayViewList {
  margin-top: 4px;
}

.day-view-item {
  display: block;
  text-align: left;
}

.day-view-main {
  margin-bottom: 2px;
  color: #2d5660;
}

.packing-page {
  background:
    radial-gradient(circle at 12% 22%, rgba(199, 234, 186, 0.6) 0%, rgba(199, 234, 186, 0) 28%),
    radial-gradient(circle at 88% 9%, rgba(255, 221, 206, 0.64) 0%, rgba(255, 221, 206, 0) 26%),
    linear-gradient(160deg, #e2f5ea 0%, #fff9ea 50%, #ffdaca 100%);
}

.packing-page li {
  border-left: 5px solid rgba(132, 194, 110, 0.55);
}

.packing-check-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  flex: 1;
  min-width: 0;
}

.packing-checkbox {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  min-width: 22px;
  border-radius: 6px;
  border: 2px solid rgba(132, 194, 110, 0.7);
  background: #fffdf8;
  cursor: pointer;
  position: relative;
  transition: background 0.18s ease, border-color 0.18s ease;
  margin: 0;
}

.packing-checkbox:checked {
  background: linear-gradient(135deg, #84c26e, #5fa84e);
  border-color: #5fa84e;
}

.packing-checkbox:checked::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 2px;
  width: 8px;
  height: 12px;
  border: 2.5px solid #ffffff;
  border-top: none;
  border-left: none;
  transform: rotate(45deg);
}

.packing-item-name {
  flex: 1;
  min-width: 0;
  word-break: break-word;
  transition: color 0.2s ease, text-decoration 0.2s ease;
}

li.packing-checked {
  border-left-color: rgba(132, 194, 110, 0.28);
  opacity: 0.72;
}

li.packing-checked .packing-item-name {
  text-decoration: line-through;
  color: var(--ink-soft);
}

body.dark-mode .packing-checkbox {
  background: #122028;
  border-color: rgba(132, 194, 110, 0.55);
}

body.dark-mode .packing-checkbox:checked {
  background: linear-gradient(135deg, #5fa84e, #4a8a3c);
  border-color: #4a8a3c;
}

.packing-page .card {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(247, 255, 244, 0.95));
}

.packing-suggestions-card {
  border-style: dashed;
  border-color: rgba(91, 184, 200, 0.45);
}

.suggestion-actions {
  display: flex;
  justify-content: center;
  margin-bottom: 10px;
}

#suggestionList li {
  color: #2e4d56;
}

#suggestionList .suggestion-empty {
  justify-content: center;
  text-align: center;
}

.expenses-page {
  background:
    radial-gradient(circle at 14% 20%, rgba(255, 220, 199, 0.68) 0%, rgba(255, 220, 199, 0) 30%),
    radial-gradient(circle at 88% 14%, rgba(179, 223, 232, 0.62) 0%, rgba(179, 223, 232, 0) 24%),
    linear-gradient(160deg, #def1f0 0%, #fff7ea 50%, #ffd4c1 100%);
}

.expenses-page .card {
  border-style: solid;
  border-width: 2px;
  background:
    repeating-linear-gradient(
      to bottom,
      rgba(255, 255, 255, 0.96),
      rgba(255, 255, 255, 0.96) 24px,
      rgba(241, 110, 82, 0.04) 24px,
      rgba(241, 110, 82, 0.04) 26px
    );
}

.expense-members-card,
.expense-split-card {
  border-style: dashed;
}

.expenses-page li {
  border-right: 5px solid rgba(91, 184, 200, 0.45);
}

.split-summary-item {
  display: block;
  text-align: left;
}

.packing-page .card h2,
.destinations-page .card h2,
.expenses-page .card h2 {
  color: #244851;
}

.packing-page .input-row > button,
.expenses-page .input-row > button {
  color: #ffffff;
  background: linear-gradient(135deg, #ef795e, #cf4f38);
}

#packingList li,
#expenseList li {
  color: #2e4d56;
}

#expenseList li strong {
  color: #b84c35;
}

body.dark-mode {
  --ink-main: #e6f4f8;
  --ink-soft: #c8dce2;
  --card: #1b2a31;
  --line-soft: #47636d;
  --accent-main: #ff8f70;
  --accent-deep: #e26950;
  --accent-blue: #66c6d8;
  --shadow-soft: 0 14px 30px rgba(0, 0, 0, 0.35);
  --shadow-pop: 0 10px 16px rgba(0, 0, 0, 0.28);
  color: var(--ink-main);
  background:
    radial-gradient(circle at 14% 16%, rgba(74, 117, 127, 0.35) 0%, rgba(74, 117, 127, 0) 30%),
    radial-gradient(circle at 90% 10%, rgba(88, 131, 95, 0.3) 0%, rgba(88, 131, 95, 0) 28%),
    linear-gradient(160deg, #111d23 0%, #17282f 48%, #223037 100%);
}

body.dark-mode::before {
  border-bottom-color: rgba(208, 236, 242, 0.2);
  background: linear-gradient(180deg, rgba(26, 40, 47, 0.62) 0%, rgba(26, 40, 47, 0.36) 58%, rgba(26, 40, 47, 0) 100%);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.28);
}

body.dark-mode header {
  background:
    linear-gradient(130deg, rgba(34, 83, 94, 0.95), rgba(38, 98, 111, 0.9)),
    linear-gradient(240deg, rgba(143, 74, 63, 0.95), rgba(112, 62, 54, 0.86));
}

body.dark-mode .card,
body.dark-mode section {
  border-color: rgba(83, 121, 131, 0.9);
}

body.dark-mode .card p,
body.dark-mode .tutorial-link span,
body.dark-mode .about-box p,
body.dark-mode .tutorial-box p {
  color: #d3e6eb;
}

body.dark-mode .about-box,
body.dark-mode .tutorial-box,
body.dark-mode .data-tools-box,
body.dark-mode .destinations-page .card,
body.dark-mode .packing-page .card,
body.dark-mode .expenses-page .card {
  background: linear-gradient(180deg, rgba(26, 42, 50, 0.96), rgba(22, 35, 42, 0.98));
}

body.dark-mode .tutorial-link,
body.dark-mode li {
  background: linear-gradient(155deg, rgba(30, 48, 56, 0.92), rgba(26, 40, 47, 0.96));
  border-color: rgba(86, 128, 139, 0.78);
}

body.dark-mode .tutorial-link strong,
body.dark-mode .card a {
  color: #ffd8c6;
}

body.dark-mode .print-summary-link {
  color: #ffffff;
}

body.dark-mode .packing-page .card h2,
body.dark-mode .destinations-page .card h2,
body.dark-mode .expenses-page .card h2,
body.dark-mode #packingList li,
body.dark-mode #expenseList li {
  color: #e9f7fb;
}

.traveler-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.traveler-check-option {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 2px solid rgba(91, 184, 200, 0.45);
  background: rgba(255, 255, 255, 0.7);
  font-family: 'Nunito', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink-main);
  cursor: pointer;
  user-select: none;
  transition: background 0.18s ease, border-color 0.18s ease;
  white-space: nowrap;
  width: auto;
}

.traveler-check-option:has(input:checked) {
  background: linear-gradient(135deg, rgba(91, 184, 200, 0.22), rgba(91, 184, 200, 0.12));
  border-color: var(--accent-blue);
}

.traveler-check-option input[type="checkbox"] {
  width: 15px;
  height: 15px;
  min-width: 15px;
  margin: 0;
  accent-color: var(--accent-blue);
  cursor: pointer;
}

body.dark-mode .traveler-check-option {
  background: rgba(24, 40, 48, 0.9);
  border-color: rgba(102, 198, 216, 0.34);
  color: #e9f7fb;
}

body.dark-mode .expense-split-members {
  color: #bfe4ec;
}

body.dark-mode #travelerSummaryText,
body.dark-mode #splitSummaryText,
body.dark-mode #expenseSplitHelpText {
  color: #5f7b84;
}

body.dark-mode #suggestionSourceText,
body.dark-mode #suggestionList li {
  color: #5f7b84;
}

body.dark-mode #expenseList li strong {
  color: #ffd6c6;
}

body.dark-mode .packing-page .input-row > button,
body.dark-mode .expenses-page .input-row > button {
  color: #ffffff;
  background: linear-gradient(135deg, #f08b6d, #db6348);
}

body.dark-mode .top-nav a {
  border-color: rgba(255, 255, 255, 0.82);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
}

body.dark-mode input,
body.dark-mode select,
body.dark-mode #calendar {
  background: #122028;
  color: var(--ink-main);
  border-color: rgba(86, 128, 139, 0.82);
}

body.dark-mode .itinerary-page #calendar {
  background: linear-gradient(180deg, rgba(14, 22, 27, 0.98), rgba(19, 30, 36, 0.97));
  border-color: rgba(146, 94, 80, 0.46);
  box-shadow: inset 0 0 0 1px rgba(255, 222, 210, 0.06);
}

body.dark-mode .itinerary-page .fc-theme-standard .fc-scrollgrid,
body.dark-mode .itinerary-page .fc-theme-standard .fc-scrollgrid-section > * {
  background: rgba(17, 27, 33, 0.96);
}

body.dark-mode .itinerary-page .fc .fc-daygrid-day-frame {
  background: rgba(20, 32, 38, 0.94);
}

body.dark-mode .top-nav-dropdown select {
  background: linear-gradient(135deg, var(--accent-main), #ffaf73);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.68);
}

body.dark-mode #destinationMap {
  border-color: rgba(86, 128, 139, 0.82);
}

body.dark-mode input:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(102, 198, 216, 0.22);
}

body.dark-mode select:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(102, 198, 216, 0.22);
}

body.dark-mode .fc .fc-toolbar-title,
body.dark-mode .fc .fc-col-header-cell-cushion,
body.dark-mode .fc .fc-daygrid-day-number {
  color: #5fa6bb;
}

body.dark-mode .fc-theme-standard td,
body.dark-mode .fc-theme-standard th {
  border-color: rgba(146, 94, 80, 0.72);
}

body.dark-mode .itinerary-page .fc .fc-col-header-cell {
  background: linear-gradient(180deg, rgba(45, 61, 69, 0.98), rgba(29, 40, 47, 0.99));
  box-shadow: inset 0 -1px 0 rgba(222, 240, 245, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

body.dark-mode .itinerary-page .fc a,
body.dark-mode .itinerary-page .fc a:visited,
body.dark-mode .itinerary-page .fc a:hover,
body.dark-mode .itinerary-page .fc a:focus {
  background: transparent;
  color: #5fa6bb;
  opacity: 1;
  text-decoration: none;
}

body.dark-mode .itinerary-page .fc .fc-daygrid-event a,
body.dark-mode .itinerary-page .fc .fc-daygrid-event a:visited,
body.dark-mode .itinerary-page .fc .fc-daygrid-event a:hover,
body.dark-mode .itinerary-page .fc .fc-daygrid-event a:focus {
  color: #ffffff;
}

body.dark-mode .itinerary-page .fc .fc-col-header-cell-cushion,
body.dark-mode .itinerary-page .fc .fc-daygrid-day-number {
  color: #5a9fb3;
  text-shadow: 0 1px 2px rgba(8, 20, 26, 0.42);
}

body.dark-mode .itinerary-page .fc .fc-col-header-cell-cushion,
body.dark-mode .itinerary-page .fc .fc-col-header-cell-cushion:visited,
body.dark-mode .itinerary-page .fc .fc-col-header-cell-cushion:hover,
body.dark-mode .itinerary-page .fc .fc-col-header-cell-cushion:focus,
body.dark-mode .itinerary-page .fc .fc-col-header-cell-cushion:active,
body.dark-mode .itinerary-page .fc .fc-daygrid-day-number,
body.dark-mode .itinerary-page .fc .fc-daygrid-day-number:visited,
body.dark-mode .itinerary-page .fc .fc-daygrid-day-number:hover,
body.dark-mode .itinerary-page .fc .fc-daygrid-day-number:focus,
body.dark-mode .itinerary-page .fc .fc-daygrid-day-number:active {
  color: #5a9fb3 !important;
  background: transparent !important;
  opacity: 1;
  text-decoration: none;
}

body.dark-mode .itinerary-page .fc .fc-daygrid-day:hover .fc-daygrid-day-number,
body.dark-mode .itinerary-page .fc .fc-daygrid-day:focus-within .fc-daygrid-day-number,
body.dark-mode .itinerary-page .fc .fc-daygrid-day:hover .fc-col-header-cell-cushion,
body.dark-mode .itinerary-page .fc .fc-daygrid-day:focus-within .fc-col-header-cell-cushion {
  color: #5a9fb3 !important;
  opacity: 1 !important;
}

body.dark-mode .itinerary-page .fc .fc-day-other .fc-daygrid-day-number {
  color: #5a9fb3 !important;
  opacity: 1 !important;
}

body.dark-mode .itinerary-page .fc .fc-day-today {
  background: linear-gradient(180deg, rgba(224, 122, 98, 0.26), rgba(224, 122, 98, 0.08));
}

body.dark-mode .itinerary-page .fc .fc-daygrid-event {
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

body.dark-mode .calendar-hover-tooltip {
  border-color: rgba(102, 198, 216, 0.56);
  background: rgba(19, 33, 41, 0.96);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.4);
  color: #e3f3f7;
}

body.dark-mode .calendar-tooltip-title,
body.dark-mode .calendar-tooltip-line {
  color: #e3f3f7;
}

body.dark-mode .itinerary-page #activityList .activity-address {
  color: #bfe4ec;
}

body.dark-mode .itinerary-page .activity-map-links a {
  background: rgba(90, 159, 179, 0.3);
  color: #e3f3f7;
}

body.dark-mode .itinerary-page .activity-map-links a:hover {
  background: rgba(90, 159, 179, 0.45);
}

body.dark-mode .map-choice-popover {
  border-color: rgba(102, 198, 216, 0.56);
  background: rgba(19, 33, 41, 0.97);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.42);
}

body.dark-mode .map-choice-title {
  color: #e3f3f7;
}

body.dark-mode .conversion-page {
  background:
    radial-gradient(circle at 16% 16%, rgba(52, 92, 103, 0.34) 0%, rgba(52, 92, 103, 0) 32%),
    radial-gradient(circle at 86% 10%, rgba(105, 79, 69, 0.28) 0%, rgba(105, 79, 69, 0) 28%),
    linear-gradient(160deg, #121d24 0%, #17272e 52%, #1f2d35 100%);
}

body.dark-mode .conversion-result {
  color: #bfe4ec;
}

body.dark-mode .itinerary-page .trip-range-apply-wrap .select-with-arrow::after {
  color: #d8edf3;
}

body.dark-mode .rates-table {
  background: rgba(22, 35, 42, 0.94);
  border-color: rgba(86, 128, 139, 0.64);
}

body.dark-mode .rates-table th,
body.dark-mode .rates-table td {
  color: #e5f4f8;
  border-bottom-color: rgba(86, 128, 139, 0.42);
}

body.dark-mode .rates-table th {
  background: rgba(51, 91, 102, 0.36);
}

body.dark-mode .day-view-main {
  color: #d8edf3;
}

body.dark-mode .fc .fc-button {
  background: linear-gradient(135deg, #de795e, #b75743);
}

body.dark-mode .theme-toggle {
  background: linear-gradient(135deg, #3e8fa1, #4daf8b);
  border-color: rgba(208, 236, 242, 0.86);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.34);
}

body.dark-mode .brand-mark {
  color: #e8f6fa;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.36);
}

body.dark-mode .destinations-page,
body.dark-mode .itinerary-page,
body.dark-mode .packing-page,
body.dark-mode .expenses-page,
body.dark-mode .print-summary-page,
body.dark-mode .home-page {
  background:
    radial-gradient(circle at 16% 18%, rgba(70, 110, 120, 0.35) 0%, rgba(70, 110, 120, 0) 30%),
    radial-gradient(circle at 90% 10%, rgba(120, 88, 75, 0.3) 0%, rgba(120, 88, 75, 0) 28%),
    linear-gradient(160deg, #101a20 0%, #16262c 50%, #1e2a31 100%);
}

@media print {
  @page {
    margin: 0.55in;
  }

  html,
  body {
    background: #ffffff;
    color: #1f2e33;
    font-size: 11pt;
  }

  body::before {
    display: none !important;
  }

  .theme-toggle,
  .brand-mark,
  .print-only-hidden {
    display: none !important;
  }

  header {
    padding: 0 0 10px;
    box-shadow: none;
    border-radius: 0;
    margin-bottom: 10px;
    color: #1f2e33;
    background: #ffffff;
    border-bottom: 2px solid #cfd8dc;
  }

  header h1 {
    font-size: 22pt;
    text-shadow: none;
  }

  header p {
    color: #4a5d63;
  }

  .card,
  section {
    width: 100%;
    max-width: none;
    margin: 10px 0;
    padding: 12px 14px;
    box-shadow: none;
    border: 1px solid #d6d6d6;
    background: #ffffff;
    break-inside: avoid;
  }

  .print-summary-page .card h2 {
    margin-bottom: 8px;
    font-size: 14pt;
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 4px;
  }

  li {
    background: #ffffff;
    border-color: #d6d6d6;
    color: #1f2e33;
    box-shadow: none;
    padding: 8px 10px;
    margin: 6px 0;
    border-radius: 8px;
    gap: 6px;
  }

  .print-summary-item,
  .print-empty-item {
    page-break-inside: avoid;
    break-inside: avoid;
    font-size: 10.5pt;
    line-height: 1.4;
  }

  .print-meta-card {
    margin-top: 0;
  }

  .print-meta-grid {
    grid-template-columns: 1fr 1fr;
  }

  .print-summary-link,
  button,
  input,
  select {
    box-shadow: none !important;
  }

  ul,
  ol {
    margin: 0;
  }

  .print-empty-item {
    padding: 10px;
    border-style: dashed;
  }
}

@media screen and (max-width: 768px) {
  .top-nav {
    display: none;
  }

  .top-nav-dropdown {
    display: block;
  }

  body::before {
    height: calc(env(safe-area-inset-top) + 58px);
    border-radius: 0 0 16px 16px;
  }

  header {
    padding: 58px 12px 22px;
    border-bottom-left-radius: 24px;
    border-bottom-right-radius: 24px;
  }

  .theme-toggle {
    top: 9px;
    right: 10px;
    width: auto;
    padding: 7px 12px;
    font-size: 0.88rem;
  }

  .brand-mark {
    top: 9px;
    left: 10px;
    font-size: 1.15rem;
    padding: 4px 2px;
  }

  .card,
  section {
    width: 94%;
    padding: 16px;
    margin: 14px auto;
  }

  .tutorial-links {
    grid-template-columns: 1fr;
  }

  .data-tools-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .data-tools-actions button {
    min-width: 0;
    width: 100%;
  }

  button:not(.theme-toggle) {
    font-size: 0.94rem;
    padding: 9px 13px;
    border-radius: 10px;
  }

  .trip-range-apply-wrap select,
  .trip-range-apply-wrap button {
    width: 100%;
  }

  .day-view-controls button,
  .day-view-controls input[type="date"] {
    width: 100%;
    max-width: none;
  }

  button:not(.theme-toggle):not(li button):not(.input-row button) {
    width: 100%;
    padding: 8px 12px;
  }

  .input-row {
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
  }

  .input-row input[type="text"],
  .input-row input[type="number"],
  .input-row input[type="date"],
  .input-row input[type="datetime-local"] {
    flex: 1;
    max-width: none;
    min-width: 0;
  }

  .input-row button {
    width: auto;
    flex-shrink: 0;
    padding: 8px 12px;
  }

  li button {
    padding: 5px 10px;
    font-size: 0.78rem;
  }

  li {
    max-width: none;
    font-size: 0.95rem;
  }

  #destinationMap {
    height: 300px;
  }
}

@media screen and (max-width: 430px) {
  body::before {
    height: calc(env(safe-area-inset-top) + 54px);
    border-radius: 0 0 14px 14px;
  }

  .theme-toggle {
    top: 7px;
    right: 8px;
  }

  .itinerary-page .trip-range-apply-wrap button {
    font-size: 0.88rem;
    padding: 7px 10px;
  }

  button:not(.theme-toggle) {
    font-size: 0.88rem;
    padding: 8px 10px;
    border-radius: 9px;
  }

  li button {
    font-size: 0.74rem;
    padding: 4px 8px;
  }

  .brand-mark {
    top: 7px;
    left: 8px;
  }

  header h1 {
    font-size: 2.1rem;
  }
}

/* ─── iPhone / iOS compatibility ─────────────────────────────── */

/* Prevent iOS from inflating font sizes on orientation change */
html {
  -webkit-text-size-adjust: 100%;
}

/* Remove blue tap flash on interactive elements */
body {
  -webkit-tap-highlight-color: transparent;
}

/* Safe area padding so content clears the home bar at the bottom */
body {
  padding-bottom: env(safe-area-inset-bottom);
}

/* Push header content below the notch */
header {
  padding-top: max(78px, calc(env(safe-area-inset-top) + 38px));
}

/* Keep the theme toggle button clear of the notch and right sensor housing */
.theme-toggle {
  top: max(10px, calc(env(safe-area-inset-top) + 2px));
  right: max(14px, calc(env(safe-area-inset-right) + 4px));
}

/* Keep the brand mark clear of the notch and left sensor housing */
.brand-mark {
  top: max(10px, calc(env(safe-area-inset-top) + 2px));
  left: max(14px, calc(env(safe-area-inset-left) + 4px));
}

/* Eliminate 300ms tap delay on all interactive elements */
button,
a,
input,
select,
label,
textarea {
  touch-action: manipulation;
}

/* Remove iOS default styling on form controls */
input,
select,
textarea {
  appearance: none;
  -webkit-appearance: none;
}

/* Ensure all buttons meet the recommended 44px minimum touch target */
button:not(.theme-toggle) {
  min-height: 44px;
}

/* Ensure nav links meet the 44px touch target */
.top-nav a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* On touch-only devices, disable hover transforms so they don't get stuck */
@media (hover: none) {
  .top-nav a:hover,
  .brand-mark:hover,
  .theme-toggle:hover,
  .card a:hover,
  .tutorial-link:hover,
  button:hover {
    transform: none;
    filter: none;
    box-shadow: var(--shadow-pop);
  }
}