﻿/* =========================
   Local Fonts
========================= */
@font-face {
  font-family: "SukhumvitSet";
  src: url("Fonts/SukhumvitSet-Thin.woff2") format("woff2"), url("Fonts/SukhumvitSet-Thin.ttf") format("truetype");
  font-weight: 100;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "SukhumvitSet";
  src: url("Fonts/SukhumvitSet-Light.woff2") format("woff2"), url("Fonts/SukhumvitSet-Light.ttf") format("truetype");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "SukhumvitSet";
  src: url("Fonts/SukhumvitSet-Text.woff2") format("woff2"), url("Fonts/SukhumvitSet-Text.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "SukhumvitSet";
  src: url("Fonts/SukhumvitSet-Medium.woff2") format("woff2"), url("Fonts/SukhumvitSet-Medium.ttf") format("truetype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "SukhumvitSet";
  src: url("Fonts/SukhumvitSet-SemiBold.woff2") format("woff2"), url("Fonts/SukhumvitSet-SemiBold.ttf") format("truetype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "SukhumvitSet";
  src: url("Fonts/SukhumvitSet-Bold.woff2") format("woff2"), url("Fonts/SukhumvitSet-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* =========================
   Theme Tokens
========================= */
:root {
  /* MaliBills design tokens */
  --bg: #fffaf0;
  --surface: #fffdf8;
  --surface-warm: #fff8ec;
  --surface-soft: #fff4df;
  --glass-rgb: 255, 250, 240;
  --text: #1d1d1f;
  --subtle: #77716a;
  --muted: #77716a;
  --accent: #ff4b2b;
  --accent-hover: #ec3717;
  --accent-soft: rgba(255, 75, 43, 0.14);
  --accent-line: rgba(255, 75, 43, 0.32);
  --accent-deep: #ec3717;
  --orange: #f4a261;
  --gold: #d9a43a;
  --border: rgba(120, 84, 58, 0.16);
  --border-soft: rgba(29, 29, 31, 0.14);
  --border-strong: #1d1d1f;
  --success: #52c41a;
  --line: #06c755;
  --danger: #ff4d4f;
  --shadow: 0 14px 34px rgba(45, 28, 20, 0.08);
  --shadow-soft: 0 10px 28px rgba(45, 28, 20, 0.06);
  --shadow-pixel: 0 3px 0 var(--ink-sh, #2b1a12);
  --shadow-pixel-lg: 0 4px 0 var(--ink-sh, #2b1a12);
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --max-width: 1180px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --duration-slow: 420ms;
}

/* ============ DARK THEME — token overrides (see notes in root style.css) ============ */
html[data-theme="dark"] {
  --bg: #14110d;
  --surface: #1e1a14;
  --surface-soft: #272019;
  --surface-warm: #241e17;
  --glass-rgb: 26, 22, 16;
  --text: #f3ece0;
  --subtle: #b0a596;
  --muted: #8f8576;
  --accent: #e2675f;
  --accent-hover: #ec7b73;
  --accent-soft: rgba(226, 103, 95, 0.20);
  --accent-line: rgba(226, 103, 95, 0.34);
  --accent-deep: #ef8d86;
  --gold: #e6bd5c;
  --card-border: rgba(255, 238, 214, 0.14);
  --border: rgba(255, 238, 214, 0.16);
  --border-soft: rgba(255, 238, 214, 0.14);
  --border-warm: rgba(255, 238, 214, 0.14);
  --border-strong: #f3ece0;
  color-scheme: dark;
}

/* =========================
   Base
========================= */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  max-width: 100%;
  overflow-x: hidden;
  scroll-behavior: smooth;
  scroll-padding-top: 110px;
}

body {
  max-width: 100%;
  overflow-x: hidden;
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at top left, color-mix(in srgb, var(--accent) 6%, transparent), transparent 30%),
    radial-gradient(circle at bottom right, rgba(217, 164, 58, 0.10), transparent 34%),
    var(--bg);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  animation: pageEnter var(--duration-slow) var(--ease);
}

/* Fade only — no transform on <body> (would break position:fixed bottom nav). */
@keyframes pageEnter {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Thai keeps the SukhumvitSet face (Inter has no Thai glyphs) */
body.lang-th,
html[lang="th"] body {
  font-family: "SukhumvitSet", "Sarabun", "Noto Sans Thai", system-ui, sans-serif;
  line-height: 1.65;
}

body.lang-th h1,
body.lang-th h2,
body.lang-th h3 {
  letter-spacing: 0;
}

html[lang="th"] body {
  letter-spacing: 0;
  line-height: 1.6;
  word-break: normal;
  overflow-wrap: anywhere;
}

html[lang="th"] h1,
html[lang="th"] h2,
html[lang="th"] h3,
html[lang="th"] h4,
html[lang="th"] p,
html[lang="th"] a,
html[lang="th"] button,
html[lang="th"] label,
html[lang="th"] input,
html[lang="th"] textarea,
html[lang="th"] select,
html[lang="th"] [data-i18n] {
  letter-spacing: 0;
  text-transform: none;
}

html[lang="th"] .eyebrow,
html[lang="th"] .section-kicker,
html[lang="th"] .mini-label,
html[lang="th"] .quick-stats span,
html[lang="th"] .budget-grid span {
  letter-spacing: 0.01em;
  text-transform: none;
}

html[lang="th"] .btn,
html[lang="th"] .status-pill,
html[lang="th"] .pill,
html[lang="th"] [data-i18n] {
  white-space: normal;
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled,
input:disabled,
textarea:disabled,
select:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

input,
textarea,
select {
  width: 100%;
  min-height: 52px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  padding: 13px 14px;
  outline: none;
  transition:
    border-color 180ms var(--ease),
    box-shadow 180ms var(--ease),
    background 180ms var(--ease);
}

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

input:focus,
textarea:focus,
select:focus {
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent) 13%, transparent);
}

label {
  display: grid;
  gap: 8px;
  color: #66574e;
  font-size: 14px;
  font-weight: 700;
}

.hidden {
  display: none !important;
}

/* =========================
   Header + Navigation
========================= */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  width: 100%;
  min-height: 66px;
  margin: 0;
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
  gap: 16px;
  border: 0;
  border-bottom: 2px solid rgba(29, 29, 31, 0.08);
  border-radius: 0;
  background: rgba(var(--glass-rgb), 0.88);
  box-shadow: none;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  font-size: clamp(26px, 4vw, 38px);
  font-weight: 800;
  letter-spacing: -0.07em;
  line-height: 1;
  color: var(--text);
}

.logo-text span {
  color: var(--orange);
}

.brand-logo {
  width: 42px;
  height: 42px;
  object-fit: contain;
  border-radius: 12px;
}

.desktop-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  min-width: 0;
  gap: 8px;
}

.desktop-nav a {
  min-width: 0;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
  transition:
    color 180ms var(--ease),
    background 180ms var(--ease),
    transform 180ms var(--ease);
}

.desktop-nav a:hover,
.desktop-nav a[aria-current="page"] {
  color: var(--text);
  background: var(--accent-soft);
}

.profile-icon-btn,
.nav-auth.profile-icon-btn {
  width: 40px;
  min-width: 40px;
  padding: 0;
  border: 1px solid var(--accent-line);
  color: var(--accent-deep);
  background: var(--accent-soft);
  font-size: 18px;
}

.lang-toggle,
.language-toggle {
  min-height: 40px;
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 3px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(var(--glass-rgb), 0.82);
  box-shadow: inset 0 1px 0 rgba(var(--glass-rgb), 0.78);
  transition:
    border-color 180ms var(--ease),
    background 180ms var(--ease),
    transform 180ms var(--ease);
}

.lang-toggle:hover,
.language-toggle:hover {
  border-color: var(--accent-line);
  transform: translateY(-1px);
}

.lang-option {
  min-width: 38px;
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  transition:
    color 180ms var(--ease),
    background 180ms var(--ease),
    box-shadow 180ms var(--ease);
}

.lang-option.active {
  color: #ffffff;
  background: var(--accent);
  box-shadow: 0 7px 16px color-mix(in srgb, var(--accent) 26%, transparent);
}

/* Single-button language toggle (matches MaliBills) */
.single-lang-toggle {
  width: auto;
  min-width: 50px;
  min-height: 40px;
  margin: 0;
  padding: 0 16px;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  background: var(--surface);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.02em;
  box-shadow: 0 6px 16px rgba(45, 28, 20, 0.06);
  transition:
    color 180ms var(--ease),
    background 180ms var(--ease),
    border-color 180ms var(--ease),
    transform 180ms var(--ease),
    box-shadow 180ms var(--ease);
}

.single-lang-toggle:hover,
.single-lang-toggle:focus-visible {
  color: var(--accent);
  border-color: var(--accent-line);
  background: var(--surface-soft);
  box-shadow: 0 8px 18px rgba(45, 28, 20, 0.07);
  outline: none;
}

.single-lang-toggle:active {
  transform: translateY(1px) scale(0.99);
}

.bottom-nav {
  display: none;
}

/* =========================
   Buttons
========================= */
.btn {
  min-height: 50px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 22px;
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  font-weight: 900;
  letter-spacing: -0.01em;
  line-height: 1;
  white-space: nowrap;
  transition:
    transform 180ms var(--ease),
    box-shadow 180ms var(--ease),
    background 180ms var(--ease),
    border-color 180ms var(--ease);
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(1px) scale(0.99);
}

.btn-primary {
  color: #ffffff;
  border-color: var(--border-strong);
  background: linear-gradient(180deg, var(--accent), var(--accent));
  box-shadow: 0 4px 0 var(--ink-sh, var(--ink)), 0 10px 20px color-mix(in srgb, var(--accent) 12%, transparent);
}

.btn-primary:hover {
  filter: brightness(1.03);
  box-shadow: 0 5px 0 var(--ink-sh, var(--ink)), 0 12px 24px color-mix(in srgb, var(--accent) 14%, transparent);
}

.btn-primary:active {
  box-shadow: 0 2px 0 var(--ink-sh, var(--ink)), 0 7px 14px color-mix(in srgb, var(--accent) 10%, transparent);
}

.btn-secondary {
  color: var(--text);
  border-color: var(--border-soft);
  background: var(--surface);
  box-shadow: 0 8px 20px rgba(45, 28, 20, 0.05);
}

.btn-secondary:hover {
  border-color: rgba(29, 29, 31, 0.24);
  background: var(--surface-soft);
}

.btn-ghost {
  color: var(--muted);
  border-color: var(--border);
  background: transparent;
}

.btn-ghost.danger {
  color: var(--danger);
  border-color: rgba(220, 38, 38, 0.18);
  background: rgba(254, 226, 226, 0.55);
}

.btn-line {
  color: white;
  background: var(--line);
  box-shadow: 0 12px 24px rgba(6, 199, 85, 0.18);
}

.line-share-btn,
.auth-google-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
}

.share-icon,
.auth-icon {
  width: 22px;
  height: 22px;
  object-fit: contain;
  flex: 0 0 auto;
}

.button-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.button-row.compact .btn {
  min-height: 42px;
  padding-inline: 14px;
  border-radius: 14px;
  font-size: 13px;
}

/* =========================
   Shared Components
========================= */
.home-app,
.planner-app {
  width: min(var(--max-width), calc(100% - 28px));
  margin: 0 auto;
}

.home-app {
  padding: 34px 0 84px;
}

.planner-app {
  padding: 34px 0 92px;
}

.planner-shell {
  width: min(1320px, calc(100% - 28px));
  margin: 0 auto;
  padding: 24px 0 92px;
  display: grid;
  grid-template-columns: 176px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

/* The section tab list (.planner-tabbar / .planner-tab) is shared with
   MaliBills: see "APP SHELL" in /ui-kit.css. */

.section {
  margin-top: clamp(34px, 7vw, 74px);
}

.app-card,
.panel,
.feature-card,
.history-card,
.empty-state {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, var(--surface), var(--surface-warm));
  box-shadow: var(--shadow-pixel);
}

.panel {
  padding: clamp(20px, 3vw, 26px);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  margin: 0 0 16px;
  padding: 7px 12px;
  border: 1px solid var(--accent-soft);
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.section-heading {
  max-width: 720px;
  margin-bottom: 20px;
}

.section-heading h2,
.panel-heading h2,
.empty-state h2 {
  margin: 0;
  color: var(--text);
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.07;
  letter-spacing: -0.045em;
}

.section-heading p,
.panel p,
.empty-state p,
.form-status,
.small-muted {
  color: var(--muted);
}

.panel-heading {
  margin-bottom: 18px;
}

.split-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.stacked-form {
  display: grid;
  gap: 16px;
}

.form-grid {
  display: grid;
  gap: 14px;
}

.form-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-status {
  min-height: 22px;
  margin: 0;
  font-size: 14px;
}

.status-pill,
.pill {
  width: fit-content;
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 11px;
  border-radius: 999px;
  color: var(--accent-deep);
  background: var(--accent-soft);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

/* =========================
   Home
========================= */
.home-hero {
  min-height: min(680px, calc(100vh - 130px));
  display: grid;
  grid-template-columns: minmax(0, 1.04fr) minmax(300px, 0.72fr);
  gap: clamp(26px, 6vw, 70px);
  align-items: center;
  padding: clamp(28px, 6vw, 64px);
}

.home-hero-copy h1 {
  max-width: 760px;
  margin: 0;
  color: var(--text);
  font-size: clamp(48px, 8vw, 88px);
  line-height: 0.98;
  letter-spacing: -0.07em;
}

html[lang="th"] .home-hero-copy h1,
html[lang="th"] .planner-hero .planner-title,
html[lang="th"] .login-intro h1,
html[lang="th"] .section-heading h2,
html[lang="th"] .preview-section h2,
html[lang="th"] .panel-heading h2,
html[lang="th"] .empty-state h2,
html[lang="th"] .share-layout h2,
html[lang="th"] .suggestion-header h2,
html[lang="th"] .place-modal-heading h2 {
  /* Thai inherits each heading's EN font-size; only line-height is relaxed so
     stacked Thai vowels/tone marks aren't clipped. (No font-size override, so TH
     headings render at the same size as their EN counterparts.) */
  max-width: 100%;
  line-height: 1.25;
  letter-spacing: 0;
  text-wrap: balance;
}

.home-hero-copy > p:not(.eyebrow) {
  max-width: 620px;
  margin: 20px 0 28px;
  color: #66574e;
  font-size: clamp(17px, 2vw, 21px);
  line-height: 1.65;
}

.hero-visual {
  position: relative;
  min-height: 420px;
  display: grid;
  place-items: center;
}

.hero-panda {
  width: min(360px, 82%);
  filter: drop-shadow(0 22px 28px rgba(45, 28, 20, 0.1));
}

.floating-trip-card {
  position: absolute;
  right: 0;
  bottom: 24px;
  width: min(250px, 72%);
  padding: 16px;
  border: 2px solid rgba(35, 25, 20, 0.85);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: 4px 4px 0 color-mix(in srgb, var(--accent) 16%, transparent);
}

.floating-trip-card span,
.floating-trip-card small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.floating-trip-card strong {
  display: block;
  margin: 6px 0;
  font-size: 20px;
  line-height: 1.15;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
}

.feature-card {
  min-height: 268px;
  padding: 20px;
  transition:
    transform 180ms var(--ease),
    box-shadow 180ms var(--ease);
}

.feature-card:hover {
  transform: translateY(-2px);
  box-shadow: 6px 7px 0 color-mix(in srgb, var(--accent) 12%, transparent);
}

.feature-card img {
  width: 92px;
  height: 92px;
  margin-bottom: 16px;
  object-fit: contain;
}

.feature-card h3 {
  margin: 0 0 8px;
  font-size: 21px;
  line-height: 1.15;
  letter-spacing: -0.035em;
}

.feature-card p {
  margin: 0;
  color: var(--muted);
}

.preview-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.6fr);
  gap: 28px;
  align-items: center;
  padding: clamp(24px, 5vw, 42px);
}

.preview-section h2 {
  max-width: 680px;
  margin: 0 0 14px;
  font-size: clamp(30px, 5vw, 54px);
  line-height: 1.04;
  letter-spacing: -0.05em;
}

.preview-section p:not(.eyebrow) {
  max-width: 560px;
  margin: 0 0 22px;
  color: var(--muted);
}

.phone-preview {
  position: relative;
  min-height: 330px;
  display: grid;
  place-items: center;
}

.phone-screen {
  width: min(260px, 82vw);
  min-height: 300px;
  padding: 24px;
  border: 10px solid #1d1d1f;
  border-radius: 36px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.phone-screen strong {
  display: block;
  margin: 14px 0 8px;
  font-size: 26px;
  line-height: 1.08;
}

.mini-budget {
  margin-top: 28px;
  padding: 14px;
  border-radius: 18px;
  background: var(--accent-soft);
}

.mini-budget span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.phone-preview img {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 142px;
  filter: drop-shadow(0 14px 22px rgba(45, 28, 20, 0.1));
}

/* =========================
   Planner
========================= */
.planner-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 230px;
  gap: 22px;
  align-items: center;
  padding: clamp(24px, 5vw, 46px);
}

.planner-hero .planner-title {
  max-width: 820px;
  margin: 0 0 12px;
  font-size: clamp(40px, 7vw, 78px);
  line-height: 1;
  letter-spacing: -0.065em;
}

.planner-hero p:not(.eyebrow) {
  max-width: 700px;
  margin: 0 0 22px;
  color: #66574e;
  font-size: 17px;
}

.planner-hero-art img {
  width: 210px;
  margin-left: auto;
  object-fit: contain;
}

.quick-stats,
.budget-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

/* Cross-app "Split on MaliBills" action under the budget grid */
.budget-split {
  margin-top: 16px;
  display: grid;
  gap: 8px;
  justify-items: start;
}
.budget-split .btn { width: 100%; }
.budget-split .small-muted { margin: 0; }

.quick-stats div,
.budget-grid div {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.quick-stats span,
.budget-grid span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.quick-stats strong,
.budget-grid strong {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 20px;
}

.empty-state {
  margin-top: 18px;
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-style: dashed;
}

.empty-state img {
  width: 88px;
  height: 88px;
  object-fit: contain;
}

.empty-state h2 {
  font-size: clamp(24px, 4vw, 34px);
}

.empty-state p {
  margin: 6px 0 0;
}

.planner-grid {
  margin-top: 22px;
  display: grid;
  grid-template-columns: minmax(280px, 0.62fr) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.planner-sidebar,
.planner-main {
  display: grid;
  gap: 22px;
  min-width: 0;
}

.planner-shell .planner-main {
  gap: 14px;
}

.planner-dashboard {
  margin-top: 0;
  grid-template-columns: minmax(260px, 0.38fr) minmax(0, 1fr);
  gap: 14px;
}

.planner-tools,
.planner-content {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.planner-shell .panel,
.planner-shell .empty-state {
  padding: 16px;
  border-radius: 22px;
}

.planner-shell .planner-hero {
  padding: 20px 22px;
  grid-template-columns: minmax(0, 1fr) 150px;
  gap: 16px;
}

.planner-shell .planner-hero .planner-title {
  font-size: clamp(32px, 4.5vw, 54px);
  letter-spacing: -0.05em;
}

.planner-shell .planner-hero p:not(.eyebrow) {
  margin-bottom: 14px;
  font-size: 15px;
}

.planner-shell .planner-hero-art img {
  width: 145px;
}

.planner-shell .panel-heading {
  margin-bottom: 12px;
}

.planner-shell .panel-heading h2,
.planner-shell .suggestion-header h2,
.planner-shell .share-layout h2 {
  font-size: clamp(20px, 2.5vw, 28px);
  letter-spacing: -0.035em;
}

.compact-card {
  box-shadow: 0 10px 28px rgba(45, 28, 20, 0.06);
}

.compact-form {
  gap: 12px;
}

.compact-form label {
  gap: 6px;
  font-size: 13px;
}

.compact-form input,
.compact-form textarea,
.compact-form select,
.planner-shell .province-select {
  min-height: 44px;
  padding: 10px 12px;
  border-radius: 14px;
}

.compact-form textarea {
  min-height: 84px;
}

.planner-shell .btn {
  min-height: 42px;
  padding: 0 16px;
  border-radius: 15px;
  font-size: 13px;
}

.planner-shell .form-grid {
  gap: 10px;
}

.planner-shell .quick-stats,
.planner-shell .budget-grid {
  gap: 10px;
}

.planner-shell .quick-stats div,
.planner-shell .budget-grid div {
  padding: 12px;
  border-radius: 16px;
}

.planner-shell .quick-stats strong,
.planner-shell .budget-grid strong {
  font-size: 17px;
}

.mini-login-prompt {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.mini-login-prompt h2 {
  margin: 0 0 4px;
  font-size: 18px;
  line-height: 1.18;
}

.mini-login-prompt p {
  margin: 0;
}

.budget-panel {
  background: linear-gradient(135deg, var(--surface-warm), #ffffff);
}

.budget-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.share-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 120px;
  gap: 16px;
  align-items: center;
}

.share-layout h2 {
  margin: 0 0 8px;
  font-size: clamp(28px, 4vw, 42px);
  letter-spacing: -0.045em;
}

.share-layout img {
  width: 120px;
  object-fit: contain;
}

.share-link-box {
  margin: 16px 0;
}

.activities-list {
  display: grid;
  gap: 18px;
}

.day-group {
  display: grid;
  gap: 12px;
}

.day-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.day-heading h3 {
  margin: 0;
  font-size: 20px;
}

.day-heading span {
  color: var(--muted);
  font-weight: 800;
}

.activity-card {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: 0 8px 22px rgba(45, 28, 20, 0.04);
}

.activity-card-top,
.activity-card-bottom {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.activity-card h3 {
  margin: 5px 0 0;
  font-size: 23px;
  line-height: 1.14;
  letter-spacing: -0.035em;
}

.activity-time {
  color: var(--accent-deep);
  font-size: 13px;
  font-weight: 800;
}

.activity-card p {
  margin: 0;
  color: var(--muted);
}

.activity-card-bottom {
  align-items: center;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.activity-card-bottom strong {
  font-size: 19px;
}

/* ---- Activity reordering (drag handle, up/down buttons, drag states) ---- */
.activity-card-lead {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
}
.activity-card[draggable="true"] .drag-handle {
  cursor: grab;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.1;
  letter-spacing: -3px;
  padding-top: 3px;
  user-select: none;
  touch-action: none;
}
.activity-card[draggable="true"]:active { cursor: grabbing; }
.activity-card.dragging {
  opacity: 0.5;
  box-shadow: 0 10px 28px rgba(45, 28, 20, 0.14);
}
.activity-card.drag-over {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft), 0 8px 22px rgba(45, 28, 20, 0.06);
}
.reorder-controls {
  display: inline-flex;
  flex-direction: column;
  gap: 3px;
  margin-right: 2px;
}
.reorder-btn {
  width: 30px;
  height: 22px;
  display: grid;
  place-items: center;
  padding: 0;
  font-size: 10px;
  color: var(--muted);
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: color 160ms var(--ease), background 160ms var(--ease), border-color 160ms var(--ease);
}
.reorder-btn:hover {
  color: var(--accent-deep);
  background: var(--accent-soft);
  border-color: var(--accent-line);
}

.empty-itinerary,
.mini-empty {
  display: grid;
  place-items: center;
  gap: 8px;
  padding: 26px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  text-align: center;
}

.empty-itinerary img,
.mini-empty img {
  width: 92px;
  height: 92px;
  object-fit: contain;
}

.empty-itinerary h3,
.mini-empty p {
  margin: 0;
}

.history-list {
  display: grid;
  gap: 12px;
}

.history-card {
  padding: 16px;
  display: grid;
  gap: 14px;
  box-shadow: none;
}

.history-card h3 {
  margin: 0 0 4px;
  font-size: 18px;
}

.history-card p,
.history-card small {
  margin: 0;
  color: var(--muted);
}

.history-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* =========================
   My Profile page
========================= */
.profile-app {
  max-width: 920px;
  margin: 0 auto;
  padding: 28px 18px 64px;
  display: grid;
  gap: 20px;
}

.profile-shell {
  display: grid;
  gap: 20px;
}

.profile-hero {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 22px;
}

.profile-hero-copy {
  flex: 1;
  min-width: 0;
}

.profile-hero-copy h1 {
  margin: 2px 0 4px;
  font-size: 24px;
}

.profile-hero-copy p {
  margin: 0;
}

.profile-avatar {
  width: 64px;
  height: 64px;
  flex: none;
  display: grid;
  place-items: center;
  font-size: 30px;
  border-radius: 50%;
  background: var(--brand-soft, #ffe9d6);
  color: var(--brand, #f08a3c);
}

.profile-gate {
  display: grid;
  place-items: center;
  gap: 14px;
  text-align: center;
  padding: 40px 24px;
  max-width: 520px;
  margin: 24px auto;
}

.profile-gate img {
  width: 120px;
  height: 120px;
  object-fit: contain;
}

.profile-gate h1 {
  margin: 0 0 6px;
  font-size: 22px;
}

.profile-gate p {
  margin: 0 0 14px;
  color: var(--muted);
}

.profile-trip-list .history-card {
  border: 1px solid var(--border);
}

/* Compact, equal-width action buttons (View / Edit / Delete). */
.profile-trip-list .history-actions .btn {
  flex: 0 0 auto;
  width: 104px;
  padding: 8px 10px;
  font-size: 14px;
  text-align: center;
}

@media (max-width: 560px) {
  .profile-hero {
    flex-wrap: wrap;
  }

  .profile-hero #logoutButton {
    width: 100%;
  }
}

/* =========================
   Suggested Places
========================= */
.suggestion-section {
  overflow: hidden;
}

.suggestion-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 0.46fr);
  gap: 16px;
  align-items: end;
  margin-bottom: 16px;
}

.suggestion-header h2 {
  margin: 0;
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.05;
  letter-spacing: -0.045em;
}

.province-filter {
  gap: 7px;
}

.province-select {
  min-height: 48px;
  border-radius: 16px;
  background:
    linear-gradient(180deg, var(--surface), #ffffff) padding-box,
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 28%, transparent), rgba(240, 229, 220, 0.7)) border-box;
}

.suggestion-filters {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  padding-bottom: 2px;
  overflow-x: auto;
  scrollbar-width: none;
}

.suggestion-filters::-webkit-scrollbar {
  display: none;
}

.suggestion-chip {
  min-height: 36px;
  padding: 0 13px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(var(--glass-rgb), 0.86);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
  transition:
    color 180ms var(--ease),
    background 180ms var(--ease),
    border-color 180ms var(--ease),
    transform 180ms var(--ease);
}

.suggestion-chip:hover,
.suggestion-chip.active {
  color: var(--accent-deep);
  border-color: color-mix(in srgb, var(--accent) 34%, transparent);
  background: var(--accent-soft);
}

.suggestion-chip:hover {
  transform: translateY(-1px);
}

.suggestion-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}

.suggestion-card {
  min-width: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 20px;
  color: inherit;
  background: var(--surface);
  text-align: left;
  cursor: pointer;
  box-shadow: 0 7px 18px rgba(45, 28, 20, 0.04);
  transition:
    border-color 180ms var(--ease),
    box-shadow 180ms var(--ease),
    transform 180ms var(--ease),
    background 180ms var(--ease);
}

.suggestion-card:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent);
  outline-offset: 2px;
}

.suggestion-head {
  display: grid;
  grid-template-columns: 66px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

/* Keyless Google map preview inside each card. The iframe is non-interactive
   (pointer-events disabled) so a click anywhere on the card opens the modal;
   the map is panned/zoomed in the modal instead. */
.suggestion-card:hover {
  border-color: color-mix(in srgb, var(--accent) 36%, transparent);
  background: linear-gradient(180deg, #ffffff, var(--surface-warm));
  box-shadow: 0 14px 28px rgba(45, 28, 20, 0.08);
  transform: translateY(-2px);
}

.suggestion-thumb {
  position: relative;
  width: 62px;
  height: 62px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 18px;
  background: var(--accent-soft);
}

.suggestion-thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: var(--surface-warm);
  z-index: 1;
}

/* Panda placeholder reads better contained than cropped. */
.suggestion-thumb img.is-fallback {
  object-fit: contain;
  padding: 4px;
}

.suggestion-emoji-fallback {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--surface);
  font-size: 25px;
  box-shadow: inset 0 0 0 1px rgba(240, 229, 220, 0.85);
}

.suggestion-info {
  min-width: 0;
}

.suggestion-title,
.suggestion-location,
.suggestion-summary {
  margin: 0;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
}

.suggestion-title {
  color: var(--text);
  font-size: 15px;
  font-weight: 800;
  line-height: 1.25;
  line-clamp: 1;
  -webkit-line-clamp: 1;
}

.suggestion-location {
  margin-top: 3px;
  color: #66574e;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.25;
  line-clamp: 1;
  -webkit-line-clamp: 1;
}

.suggestion-summary {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
  line-clamp: 2;
  -webkit-line-clamp: 2;
}

.suggestion-empty {
  min-height: 118px;
  display: grid;
  place-items: center;
  gap: 10px;
  padding: 20px;
  border: 1px dashed var(--border);
  border-radius: 20px;
  background: var(--surface);
  text-align: center;
}

.suggestion-empty p {
  margin: 0;
  color: var(--muted);
  font-weight: 800;
}

.suggestion-more {
  margin-top: 14px;
}

/* =========================
   Place Modal
========================= */
body.modal-open {
  overflow: hidden;
}

.place-modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(45, 28, 20, 0.28);
  backdrop-filter: blur(12px);
}

.place-modal.hidden {
  display: none;
}

.place-modal-card {
  position: relative;
  width: min(520px, 100%);
  max-height: min(780px, calc(100vh - 36px));
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: 0 28px 70px rgba(45, 28, 20, 0.2);
}

.place-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(240, 229, 220, 0.85);
  border-radius: 999px;
  color: var(--text);
  background: rgba(var(--glass-rgb), 0.9);
  font-size: 24px;
  line-height: 1;
  box-shadow: var(--shadow-soft);
}

.place-modal-image {
  position: relative;
  min-height: 190px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(circle at 24% 18%, color-mix(in srgb, var(--accent) 20%, transparent), transparent 12rem),
    linear-gradient(135deg, var(--surface-warm), var(--surface));
}

.place-modal-image img {
  width: min(240px, 56vw);
  height: 178px;
  object-fit: contain;
  filter: drop-shadow(0 16px 24px rgba(45, 28, 20, 0.12));
  z-index: 1;
}

.place-modal-gallery {
  position: relative;
  width: 100%;
  min-height: 230px;
  display: grid;
  place-items: center;
}

.place-modal-primary-image {
  width: 100% !important;
  height: 230px !important;
  object-fit: cover !important;
  padding: 0;
  filter: none !important;
}

.place-modal-thumbs {
  position: absolute;
  left: 14px;
  bottom: 14px;
  z-index: 2;
  display: flex;
  gap: 7px;
}

.place-modal-thumbs img {
  width: 44px !important;
  height: 44px !important;
  object-fit: cover !important;
  border: 2px solid rgba(var(--glass-rgb), 0.92);
  border-radius: 13px;
  background: var(--surface);
  filter: none !important;
  box-shadow: var(--shadow-soft);
}

/* Clickable real-photo thumbnails (Wikimedia gallery). */
.place-modal-thumb[data-gallery-src] {
  cursor: pointer;
  transition: border-color 140ms var(--ease), transform 140ms var(--ease);
}

.place-modal-thumb[data-gallery-src]:hover {
  transform: translateY(-2px);
}

.place-modal-thumb.active {
  border-color: var(--accent, #e8743b) !important;
}

.place-modal-photo-credit {
  position: absolute;
  right: 12px;
  top: 12px;
  z-index: 2;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  text-decoration: none;
}

.place-modal-photo-credit:hover {
  background: rgba(0, 0, 0, 0.7);
}

.place-modal-emoji {
  position: absolute;
  right: 24px;
  bottom: 20px;
  width: 62px;
  height: 62px;
  display: grid;
  place-items: center;
  border-radius: 22px;
  background: rgba(var(--glass-rgb), 0.84);
  font-size: 30px;
  box-shadow: var(--shadow-soft);
}

.place-modal-content {
  padding: 24px;
}

/* Interactive keyless Google map + deep link inside the place modal. */
.place-modal-map {
  margin-top: 16px;
}

.place-modal-map-label {
  margin: 0 0 8px;
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
}

.place-modal-map-frame {
  display: block;
  width: 100%;
  height: 220px;
  border: 1px solid var(--border);
  border-radius: 16px;
}

.place-modal-maps-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  padding: 9px 14px;
  border-radius: 999px;
  color: var(--accent-deep, var(--accent));
  background: var(--accent-soft, var(--surface-warm));
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.place-modal-maps-link:hover {
  background: #ffe6d6;
  text-decoration: underline;
}

.place-modal-heading h2 {
  margin: 0;
  font-size: clamp(28px, 5vw, 40px);
  line-height: 1.05;
  letter-spacing: -0.045em;
}

.place-detail-list {
  display: grid;
  gap: 10px;
  margin: 18px 0 22px;
}

.place-detail-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  padding: 13px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
}

.place-detail-row > span {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--accent-soft);
}

.place-detail-row strong {
  display: block;
  margin-bottom: 2px;
  font-size: 13px;
}

.place-detail-row p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.modal-actions {
  display: grid;
  grid-template-columns: 1fr 0.54fr;
  gap: 10px;
}

/* =========================
   Login Page
========================= */
.login-app {
  width: min(1040px, calc(100% - 28px));
  min-height: calc(100vh - 96px);
  margin: 0 auto;
  padding: clamp(34px, 7vw, 70px) 0 94px;
  display: grid;
  align-items: center;
}

.login-shell {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(320px, 0.72fr);
  gap: clamp(24px, 5vw, 56px);
  align-items: center;
}

.login-intro {
  display: grid;
  gap: 22px;
}

.back-link,
.login-meta a,
.text-button {
  width: fit-content;
  border: 0;
  color: var(--accent-deep);
  background: transparent;
  font-size: 14px;
  font-weight: 800;
}

.back-link:hover,
.login-meta a:hover,
.text-button:hover {
  color: var(--text);
}

.login-logo {
  width: 86px;
  height: 86px;
  object-fit: contain;
  border-radius: 24px;
  background: var(--accent-soft);
  box-shadow: var(--shadow-soft);
}

.login-intro h1 {
  max-width: 620px;
  margin: 0;
  font-size: clamp(44px, 8vw, 74px);
  line-height: 0.98;
  letter-spacing: -0.065em;
}

.login-intro p:not(.eyebrow),
.login-helper-card p {
  max-width: 560px;
  margin: 12px 0 0;
  color: #66574e;
  font-size: 17px;
}

.login-helper-card {
  max-width: 560px;
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: rgba(var(--glass-rgb), 0.72);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(14px);
}

.login-helper-card img {
  width: 92px;
  height: 92px;
  object-fit: contain;
}

.login-helper-card strong {
  display: block;
  font-size: 18px;
}

.login-card {
  padding: clamp(22px, 4vw, 32px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: rgba(var(--glass-rgb), 0.9);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.login-card .btn {
  width: 100%;
}

.auth-google-btn {
  border-color: var(--border);
  color: var(--text);
  background: var(--surface);
  box-shadow: 0 8px 18px rgba(45, 28, 20, 0.05);
}

.auth-google-btn:hover {
  border-color: color-mix(in srgb, var(--accent) 34%, transparent);
  background: var(--accent-soft);
}

.auth-inline-link {
  margin: 0;
  color: var(--muted);
  text-align: center;
  font-size: 14px;
}

.auth-inline-link a {
  color: var(--accent-deep);
  font-weight: 800;
}

.login-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.text-button {
  padding: 0;
}

.auth-message {
  min-height: 24px;
  margin: 0;
  color: var(--accent-deep);
  font-size: 14px;
  font-weight: 700;
}

.login-profile-strip {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.login-profile-strip .btn {
  width: auto;
  min-height: 40px;
  padding-inline: 14px;
  border-radius: 14px;
}

/* =========================
   Toast
========================= */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 80;
  max-width: min(420px, calc(100% - 28px));
  padding: 12px 16px;
  border-radius: 999px;
  color: white;
  background: var(--text);
  box-shadow: 0 16px 36px rgba(45, 28, 20, 0.2);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 20px);
  transition:
    opacity 200ms var(--ease),
    transform 200ms var(--ease);
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* =========================
   Responsive
========================= */
@media (max-width: 1080px) {
  .feature-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .planner-shell {
    width: min(var(--max-width), calc(100% - 28px));
    grid-template-columns: 1fr;
  }



  .planner-grid,
  .home-hero,
  .preview-section,
  .login-shell {
    grid-template-columns: 1fr;
  }

  .planner-hero {
    grid-template-columns: 1fr;
  }

  .planner-hero-art {
    display: none;
  }
}

@media (max-width: 760px) {
  body {
    padding-bottom: 88px;
  }

  html {
    scroll-padding-top: 96px;
  }

  .app-header {
    top: 8px;
    min-height: 62px;
    border-radius: 24px;
  }

  .brand span {
    font-size: 19px;
  }

  .brand-logo {
    width: 44px;
    height: 44px;
  }

  .desktop-nav a {
    display: none;
  }

  .desktop-nav {
    margin-left: auto;
  }

  .bottom-nav {
    position: fixed;
    left: 50%;
    bottom: 12px;
    z-index: 60;
    width: min(430px, calc(100% - 24px));
    min-height: 64px;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 4px;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: 24px;
    background: rgba(var(--glass-rgb), 0.94);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
    transform: translateX(-50%);
  }

  .bottom-nav a {
    min-width: 0;
    display: grid;
    place-items: center;
    border-radius: 18px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
  }

  .bottom-nav a[aria-current="page"],
  .bottom-nav a:hover {
    color: var(--accent-deep);
    background: var(--accent-soft);
  }

  .home-app,
  .planner-app,
  .planner-shell,
  .login-app {
    width: min(430px, calc(100% - 24px));
    padding-top: 24px;
  }

  .home-hero,
  .preview-section,
  .planner-hero,
  .panel,
  .empty-state,
  .login-card,
  .login-helper-card {
    border-radius: 24px;
  }

  .home-hero,
  .planner-hero,
  .preview-section {
    padding: 24px;
  }

  .home-hero-copy h1,
  .planner-hero .planner-title,
  .login-intro h1 {
    font-size: clamp(42px, 14vw, 58px);
    letter-spacing: -0.055em;
  }

  html[lang="th"] .home-hero-copy h1,
  html[lang="th"] .planner-hero .planner-title,
  html[lang="th"] .login-intro h1,
  html[lang="th"] .section-heading h2,
  html[lang="th"] .preview-section h2,
  html[lang="th"] .panel-heading h2,
  html[lang="th"] .empty-state h2,
  html[lang="th"] .share-layout h2,
  html[lang="th"] .suggestion-header h2 {
    line-height: 1.25;
  }

  html[lang="th"] .desktop-nav a,
  html[lang="th"] .bottom-nav a,
  html[lang="th"] .btn {
    font-size: 0.85rem;
  }

  .login-shell {
    gap: 22px;
  }

  .login-helper-card {
    grid-template-columns: 72px minmax(0, 1fr);
    padding: 16px;
  }

  .login-helper-card img {
    width: 72px;
    height: 72px;
  }

  .login-profile-strip {
    align-items: stretch;
    flex-direction: column;
  }

  .login-profile-strip .btn {
    width: 100%;
  }

  .suggestion-header {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .suggestion-grid {
    display: flex;
    gap: 12px;
    margin-inline: -20px;
    padding: 2px 20px 8px;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
  }

  .suggestion-grid::-webkit-scrollbar {
    display: none;
  }

  .suggestion-card {
    flex: 0 0 260px;
    scroll-snap-align: start;
  }

  .place-modal {
    align-items: end;
    padding: 10px;
  }

  .place-modal-card {
    max-height: calc(100vh - 20px);
    border-radius: 26px;
  }

  .place-modal-content {
    padding: 20px;
  }

  .modal-actions {
    grid-template-columns: 1fr;
  }

  .hero-visual {
    min-height: 300px;
  }

  .floating-trip-card {
    right: 12px;
    bottom: 6px;
  }

  .feature-grid,
  .quick-stats,
  .budget-grid,
  .form-grid.two,
  .share-layout {
    grid-template-columns: 1fr;
  }

  .feature-card {
    min-height: 0;
  }

  .feature-card img {
    width: 78px;
    height: 78px;
  }

  .empty-state {
    align-items: flex-start;
    flex-direction: column;
  }

  .button-row .btn,
  .sticky-mobile-action {
    width: 100%;
  }

  .activity-card-top,
  .activity-card-bottom,
  .split-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .activity-card-bottom .button-row {
    width: 100%;
  }

  .activity-card-bottom .btn {
    flex: 1 1 0;
  }
}

@media (max-width: 430px) {
  .lang-toggle,
  .language-toggle {
    min-width: 78px;
  }

  .btn {
    white-space: normal;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* =========================
   Site Footer (shared cross-links)
========================= */
.site-footer {
  text-align: center;
  padding: 2.5rem 1rem;
  border-top: 2px solid var(--border-soft);
  font-size: 14px;
  color: var(--subtle);
}
.site-footer span { color: var(--accent); font-weight: 700; }
.site-footer a { color: var(--accent); font-weight: 700; text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }

/* Keep the footer clear of the fixed mobile bottom-nav */
@media (max-width: 760px) {
  .site-footer { padding-bottom: 96px; }
}

/* =========================
   Voting
========================= */
.activity-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.vote-btn {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 13px;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  background: var(--surface);
  font-size: 14px;
  font-weight: 800;
  transition:
    color 180ms var(--ease),
    background 180ms var(--ease),
    border-color 180ms var(--ease),
    transform 180ms var(--ease),
    box-shadow 180ms var(--ease);
}

.vote-btn:hover {
  border-color: var(--accent-line);
  transform: translateY(-1px);
}

.vote-btn:active {
  transform: translateY(1px) scale(0.98);
}

.vote-btn.voted {
  color: #ffffff;
  border-color: var(--border-strong);
  background: linear-gradient(180deg, var(--accent), var(--accent));
  box-shadow: var(--shadow-pixel);
}

.vote-btn .vote-count {
  font-variant-numeric: tabular-nums;
}

/* =========================
   Checklist
========================= */
.checklist-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  margin-bottom: 14px;
}

.checklist-form input {
  min-height: 44px;
  border-radius: 14px;
}

.checklist-form .btn {
  min-height: 44px;
}

.checklist-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.checklist-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
}

.checklist-toggle {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px;
  border: 0;
  background: transparent;
  color: var(--text);
  font-weight: 700;
  text-align: left;
}

.checklist-box {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border: 2px solid var(--accent-line);
  border-radius: 8px;
  background: var(--surface);
  color: #ffffff;
  font-size: 15px;
  font-weight: 900;
  line-height: 1;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

.checklist-item.checked .checklist-box {
  border-color: var(--accent);
  background: var(--accent);
}

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

.checklist-delete {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--danger);
  background: var(--surface);
  font-size: 20px;
  line-height: 1;
}

.checklist-delete:hover {
  background: rgba(254, 226, 226, 0.55);
}

.mini-empty-text {
  margin: 0;
  padding: 14px;
  color: var(--muted);
  text-align: center;
  font-weight: 700;
}

/* =========================
   Share link labels + read-only mode
========================= */
.share-link-label {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.share-link-label > span {
  color: #66574e;
  font-size: 13px;
  font-weight: 800;
}

.view-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  padding: 12px 16px;
  border: 1.5px solid var(--accent-line);
  border-radius: var(--radius-md);
  background: var(--accent-soft);
  color: var(--accent-deep);
  font-weight: 800;
}

body.view-only #trip-editor,
body.view-only #activity-form,
body.view-only #suggested-places,
body.view-only #share,
body.view-only .mini-login-prompt,
body.view-only #trip-history,
body.view-only .edit-only {
  display: none !important;
}

/* Viewers can still vote, but cannot toggle/edit the checklist. */
body.view-only .checklist-toggle {
  pointer-events: none;
}

/* =========================
   Print / PDF export
========================= */
/* =========================
   Print / Save-as-PDF — premium itinerary layout
========================= */
@page {
  margin: 15mm 14mm 16mm;
}

@media print {
  /* Hide app chrome and all editing UI — keep only the trip content. */
  .app-header,
  .bottom-nav,
  .planner-tabbar,
  .site-footer,
  .toast,
  .view-banner,
  .planner-hero-art,
  #noTripState,
  #trip-editor,
  #trip-history,
  .mini-login-prompt,
  #activity-form,
  #suggested-places,
  #share,
  #checklistForm,
  .checklist-delete,
  .activity-actions,
  .vote-btn,
  .empty-itinerary img {
    display: none !important;
  }

  html,
  body {
    background: #ffffff !important;
    color: var(--text) !important;
    animation: none !important;
    font-family: "SukhumvitSet", "Sukhumvit Set", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .planner-app,
  .planner-shell,
  .planner-grid,
  .planner-dashboard,
  .planner-main,
  .planner-content,
  .planner-tools {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    gap: 0 !important;
    background: transparent !important;
  }

  /* Branded letterhead at the top of the first page. */
  .planner-main::before {
    content: "Chamiz · Trips";
    display: block;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--accent);
    border-bottom: 1.5px solid color-mix(in srgb, var(--accent) 28%, transparent);
    padding-bottom: 9px;
    margin: 0 0 20px;
  }

  /* Generic section shell. */
  .planner-main > section,
  .panel,
  .app-card {
    margin: 0 0 18px !important;
    padding: 0 !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
  }

  /* Keep short sections whole; long ones may flow across pages (handled below). */
  #overview,
  #budget,
  #checklist {
    break-inside: avoid;
  }

  /* ---- Overview header ---- */
  #overview {
    margin-bottom: 22px !important;
  }
  .planner-hero-copy {
    display: block !important;
  }
  #overview .eyebrow {
    color: #d9a43a !important;
    font-size: 11px !important;
    letter-spacing: 2px !important;
    text-transform: uppercase !important;
    margin: 0 0 4px !important;
  }
  #plannerTitle {
    font-size: 30px !important;
    line-height: 1.15 !important;
    font-weight: 700 !important;
    color: var(--text) !important;
    margin: 0 0 6px !important;
  }
  #plannerSubtitle {
    color: #77716a !important;
    font-size: 13px !important;
    margin: 0 0 16px !important;
  }
  .quick-stats {
    display: flex !important;
    gap: 12px !important;
    margin: 0 !important;
  }
  .quick-stats > div {
    flex: 1 1 0 !important;
    border: 1px solid #ece3d4 !important;
    border-radius: 14px !important;
    background: var(--surface-warm) !important;
    padding: 12px 16px !important;
    text-align: left !important;
  }
  .quick-stats > div span {
    display: block !important;
    font-size: 10px !important;
    letter-spacing: 1.4px !important;
    text-transform: uppercase !important;
    color: #968d80 !important;
    margin-bottom: 4px !important;
  }
  .quick-stats > div strong {
    display: block !important;
    font-size: 17px !important;
    font-weight: 700 !important;
    color: var(--text) !important;
    line-height: 1.2 !important;
  }

  /* ---- Section headings (itinerary / budget / checklist) ---- */
  .panel-heading,
  .split-heading {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 12px !important;
    padding: 0 0 10px !important;
    margin: 0 0 14px !important;
    border-bottom: 1.5px solid color-mix(in srgb, var(--accent) 16%, transparent) !important;
    break-after: avoid;
  }
  .panel-heading .eyebrow {
    display: none !important;
  }
  .panel-heading h2 {
    position: relative !important;
    font-size: 19px !important;
    font-weight: 700 !important;
    color: var(--accent) !important;
    margin: 0 !important;
    padding-left: 12px !important;
  }
  .panel-heading h2::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 0.9em;
    border-radius: 2px;
    background: #d9a43a;
  }
  .panel-heading .small-muted {
    display: none !important;
  }
  .status-pill {
    background: color-mix(in srgb, var(--accent) 8%, transparent) !important;
    color: var(--accent) !important;
    border: 1px solid color-mix(in srgb, var(--accent) 18%, transparent) !important;
    border-radius: 999px !important;
    padding: 3px 12px !important;
    font-size: 11px !important;
    font-weight: 600 !important;
    white-space: nowrap !important;
  }

  /* ---- Itinerary ---- */
  #itinerary {
    break-inside: auto;
  }
  .day-group {
    break-inside: auto;
    margin: 0 0 14px !important;
    padding: 0 !important;
    border: none !important;
    background: transparent !important;
  }
  .day-heading {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    background: var(--surface-soft) !important;
    border: 1px solid #efe2cb !important;
    border-radius: 10px !important;
    padding: 8px 14px !important;
    margin: 0 0 8px !important;
    break-after: avoid;
  }
  .day-heading h3 {
    font-size: 14px !important;
    font-weight: 700 !important;
    color: var(--accent-hover) !important;
    margin: 0 !important;
  }
  .day-heading span {
    font-size: 13px !important;
    font-weight: 700 !important;
    color: var(--text) !important;
  }
  .activity-card {
    display: block !important;
    break-inside: avoid;
    gap: 0 !important;
    margin: 0 0 8px !important;
    padding: 11px 14px 11px 16px !important;
    border: 1px solid #e9e1d3 !important;
    border-left: 3px solid #d9a43a !important;
    border-radius: 10px !important;
    background: var(--surface) !important;
    box-shadow: none !important;
  }
  .activity-card-top {
    display: flex !important;
    flex-direction: row !important;
    align-items: flex-start !important;
    justify-content: space-between !important;
    gap: 10px !important;
  }
  .activity-time {
    display: inline-block !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    color: var(--accent) !important;
    letter-spacing: 0.3px !important;
    margin-bottom: 2px !important;
  }
  .activity-card-top h3 {
    font-size: 14.5px !important;
    font-weight: 600 !important;
    color: var(--text) !important;
    margin: 0 !important;
  }
  .activity-card p {
    font-size: 12px !important;
    color: #6c655d !important;
    margin: 6px 0 0 !important;
    line-height: 1.5 !important;
  }
  .activity-card-bottom {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-end !important;
    margin-top: 6px !important;
    padding-top: 0 !important;
    border-top: none !important;
  }
  .activity-card-bottom strong {
    font-size: 13px !important;
    font-weight: 700 !important;
    color: var(--text) !important;
  }

  /* ---- Budget ---- */
  .budget-grid {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 12px !important;
  }
  .budget-grid > div {
    flex: 1 1 40% !important;
    border: 1px solid #ece3d4 !important;
    border-radius: 12px !important;
    background: var(--surface-warm) !important;
    padding: 12px 16px !important;
    break-inside: avoid;
  }
  .budget-grid > div span {
    display: block !important;
    font-size: 10px !important;
    letter-spacing: 1.2px !important;
    text-transform: uppercase !important;
    color: #968d80 !important;
    margin-bottom: 4px !important;
  }
  .budget-grid > div strong {
    display: block !important;
    font-size: 18px !important;
    font-weight: 700 !important;
    color: var(--accent) !important;
  }

  /* ---- Checklist ---- */
  .checklist-list {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 6px 18px !important;
  }
  .checklist-item {
    break-inside: avoid;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    background: transparent !important;
  }
  .checklist-toggle {
    display: flex !important;
    align-items: center !important;
    gap: 9px !important;
    padding: 5px 0 !important;
    background: transparent !important;
    border: none !important;
    width: 100% !important;
  }
  .checklist-box {
    flex: none !important;
    width: 15px !important;
    height: 15px !important;
    border: 1.5px solid #c3b9a8 !important;
    border-radius: 4px !important;
    font-size: 11px !important;
    line-height: 13px !important;
    text-align: center !important;
    color: var(--accent) !important;
  }
  .checklist-item.checked .checklist-box {
    background: color-mix(in srgb, var(--accent) 10%, transparent) !important;
    border-color: var(--accent) !important;
  }
  .checklist-text {
    font-size: 12.5px !important;
    color: var(--text) !important;
  }
  .checklist-item.checked .checklist-text {
    color: #968d80 !important;
    text-decoration: line-through !important;
  }
}


/* ================= DARK-MODE AUDIT FIXES for malitrip ================= */
/* text colors that were dark (invisible on the dark bg) */
html[data-theme="dark"] .home-hero-copy > p:not(.eyebrow),
html[data-theme="dark"] .login-helper-card p,
html[data-theme="dark"] .login-intro p:not(.eyebrow),
html[data-theme="dark"] .planner-hero p:not(.eyebrow),
html[data-theme="dark"] .share-link-label > span,
html[data-theme="dark"] .suggestion-location,
html[data-theme="dark"] label { color: var(--subtle); }
html[data-theme="dark"] .place-modal-maps-link { color: var(--accent); }
/* panels/chips that had a hardcoded light background */
html[data-theme="dark"] .budget-panel,
html[data-theme="dark"] .province-select,
html[data-theme="dark"] .suggestion-card:hover { background: var(--surface-soft); }
html[data-theme="dark"] .place-modal-maps-link:hover,
html[data-theme="dark"] .profile-avatar { background: rgba(230,189,92,0.12); }

/* Merpy circles (2026-10-03): plan a trip with a circle / send it to the circle's chat */
.circle-plan-btn { justify-self: start; }
.circle-chip { margin: -4px 0 0; font-weight: 700; color: var(--accent); }
.circle-send-btn { display: inline-flex; align-items: center; gap: 8px; }
.circle-send-btn .share-icon { width: 22px; height: 22px; }

/* =========================
   Shared-link states, New trip, confirm (2026-10-04)
========================= */
/* While a friend's ?trip= link loads (or turns out dead), show only the
   status card: no Create form, no empty planner behind it. */
body.trip-loading .pl-views,
body.trip-missing .pl-views,
body.trip-loading .pl-right,
body.trip-missing .pl-right,
body.trip-loading #overview,
body.trip-missing #overview { display: none !important; }
body.trip-loading #noTripState,
body.trip-missing #noTripState { display: flex !important; }
body.trip-loading #noTripState img { animation: mtBob 1.2s ease-in-out infinite; }
@keyframes mtBob { 50% { transform: translateY(-6px); } }
@media (prefers-reduced-motion: reduce) { body.trip-loading #noTripState img { animation: none; } }

#trip-editor .panel-heading { position: relative; }
.new-trip-btn {
  position: absolute; top: 0; right: 0;
  min-height: 34px; padding: 0 12px; font-size: 13px;
}

.mt-confirm {
  position: fixed; inset: 0; z-index: 12000;
  display: grid; place-items: center; padding: 20px;
  background: rgba(23, 17, 13, 0.4);
}
.mt-confirm-card {
  width: min(100%, 380px); padding: 22px 20px 18px;
  background: var(--surface, #fff); color: var(--text, #2b1a12);
  border: 2px solid var(--ink, #2b1a12); border-radius: 18px;
  box-shadow: 0 4px 0 var(--ink-sh, var(--ink, #2b1a12));
}
.mt-confirm-card p { margin: 0 0 16px; font-size: 15px; line-height: 1.55; }
.mt-confirm-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mt-confirm-actions .btn { width: 100%; justify-content: center; }
.mt-confirm-actions .btn.danger { background: var(--danger, #e5484d); border-color: var(--ink, #2b1a12); color: #fff; }

/* Sticker icons in the section tabs + the form's "create a trip first" note */
.view-banner .tab-ic { display: inline-block; width: 20px; height: 20px; vertical-align: -4px; margin-right: 6px; }
.form-note {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px;
  margin: 0 0 12px; padding: 10px 12px;
  border: 1.5px dashed var(--line-strong, var(--border)); border-radius: 12px;
  color: var(--muted); font-size: 14px; font-weight: 600;
}
.form-note a { color: var(--accent-deep, var(--accent)); font-weight: 800; text-decoration: underline; }

/* Sticker icons replacing emoji (2026-10-04) */
.place-ic { display: inline-block; width: 1.15em; height: 1.15em; vertical-align: -0.2em; }
.suggestion-emoji-fallback .place-ic,
.place-modal-emoji .place-ic { width: 1em; height: 1em; }
.vote-ic { width: 18px; height: 18px; display: block; }
.place-detail-row > span .place-ic { width: 22px; height: 22px; }
.has-ic::before {
  content: ""; display: inline-block; width: 20px; height: 20px; margin-right: 8px;
  vertical-align: -5px; background: var(--ic) center / contain no-repeat; flex: none;
}

/* =========================
   Homepage look for the planner (2026-10-04): ink outlines + hard
   shadows on the inner pieces, Inter 900 titles, MaliTrip blue as the
   app colour (tabs, eyebrows, votes). Buttons stay the site red-orange.
========================= */
.new-trip-btn[hidden] { display: none !important; }
.planner-tools .form-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.planner-tools input[type="date"] { min-width: 0; width: 100%; }

#plannerTitle, .planner-main h2 {
  font-family: "Inter", "SukhumvitSet", var(--font-body); font-weight: 900; letter-spacing: -0.035em;
}
html[lang="th"] #plannerTitle, html[lang="th"] .planner-main h2 { letter-spacing: -0.005em; }
#plannerTitle { font-size: clamp(34px, 5vw, 64px); line-height: 1.02; }

.eyebrow { background: var(--app-soft) !important; color: var(--app) !important; border: 1.5px solid color-mix(in srgb, var(--app) 30%, transparent); }

.quick-stats div,
.budget-grid div,
.checklist-item,
.share-link-box,
.status-pill {
  border: 2px solid var(--edge) !important;
  box-shadow: var(--hard-sm) !important;
}
.quick-stats div, .budget-grid div { background: var(--surface) !important; border-radius: 16px !important; }
.quick-stats strong, .budget-grid strong { font-family: "Inter", var(--font-body); font-weight: 900; }
.day-heading h3 { font-weight: 900; }
.status-pill { box-shadow: none !important; background: var(--app-soft) !important; color: var(--text) !important; }

.vote-btn { border: 2px solid var(--edge) !important; box-shadow: var(--hard-sm) !important; background: var(--surface) !important; }
.vote-btn.voted { background: var(--app-soft) !important; }
.vote-btn:active { transform: translateY(2px); box-shadow: none !important; }


.suggestion-card:hover, .activity-card.dragging { box-shadow: 0 6px 0 var(--ink-sh, var(--ink)) !important; }
.view-banner { border: 2px solid var(--edge) !important; background: var(--app-soft) !important; color: var(--text) !important; box-shadow: var(--hard-sm); }
.suggestion-chip.active, .suggestion-chip[aria-pressed="true"] { background: var(--app) !important; color: var(--app-ink) !important; }
.form-note[hidden] { display: none !important; }

/* =========================
   MERPY-style planner layout (2026-10-04). The shared shell (.pl-grid,
   columns, trip label, + Add, tab list, glide and motion) is "APP SHELL" in
   /ui-kit.css + /app-shell.js, also used by MaliBills. Planner-only bits:
========================= */
#noTripState { display: none; }                  /* the summary + trip form already say it */
.pl-left .planner-hero { grid-template-columns: 1fr; padding: 22px; }
.pl-left .planner-hero-art { display: none; }
.pl-left #plannerTitle { font-size: clamp(28px, 2.6vw, 40px); }
.pl-left .quick-stats { grid-template-columns: 1fr; }

/* read-only viewers: only the views they can use */
body.view-only .planner-tab[data-target="overview"],
body.view-only .planner-tab[data-target="suggestions"],
body.view-only .planner-tab[data-target="share"] { display: none; }

@media (max-width: 1080px) {
  .pl-left .quick-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .pl-left .planner-hero { padding: 18px; }
}
@media print {
  .pl-views > [data-view] { display: block !important; }
  .pl-right, .pl-add-inline { display: none !important; }
  .planner-shell.pl-grid { display: block !important; }
}

/* cards lift a little on hover; votes press flat */
.vote-btn { transition: transform 140ms ease, box-shadow 140ms ease; }
.activity-card { transition: transform 260ms cubic-bezier(.22,1,.36,1), box-shadow 260ms cubic-bezier(.22,1,.36,1); }
.activity-card:hover { transform: translateY(-3px); }
@media (prefers-reduced-motion: reduce) {
  .activity-card { transition: none; }
  .activity-card:hover { transform: none; }
}

/* =========================
   Live places + search (2026-10-09)
========================= */
.place-search { display: block; margin: 4px 0 12px; }
.place-search input {
  width: 100%; min-height: 46px; padding: 10px 14px 10px 42px;
  font: inherit; font-size: 16px; font-weight: 600; color: var(--text);
  background: var(--surface);
  border: 2px solid var(--edge, var(--border)); border-radius: 14px;
}
.place-search { position: relative; }
.place-search::before {
  content: ""; position: absolute; left: 14px; top: 50%; width: 15px; height: 15px; margin-top: -9px;
  border: 2.5px solid var(--muted); border-radius: 50%; pointer-events: none;
}
.place-search::after {
  content: ""; position: absolute; left: 28px; top: 50%; width: 7px; height: 2.5px; margin-top: 6px;
  background: var(--muted); transform: rotate(45deg); border-radius: 2px; pointer-events: none;
}
.place-search input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.suggestion-search-head { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.suggestion-search-head p { margin: 0; font-weight: 800; color: var(--text); }

.suggestion-sticker {
  width: 100%; height: 100%; display: grid; place-items: center;
  background: var(--app-soft, var(--accent-soft));
}
.suggestion-sticker .place-ic { position: static; inset: auto; width: 36px; height: 36px; background: transparent; object-fit: contain; }
.live-chip {
  display: inline-block; padding: 1px 7px; margin-right: 2px; border-radius: 999px;
  font-size: 11px; font-weight: 800; letter-spacing: .01em; vertical-align: 1px;
  color: var(--text); background: var(--app-soft, var(--accent-soft)); border: 1px solid var(--line-strong, rgba(0,0,0,.15));
}
.live-loading, .osm-credit { grid-column: 1 / -1; margin: 6px 2px 0; font-size: 12.5px; font-weight: 700; color: var(--muted); }
.osm-credit a { color: inherit; text-decoration: underline; }
.suggestion-empty.is-loading p::after { content: ""; display: inline-block; width: 1em; animation: mtDots 1.2s steps(4) infinite; overflow: hidden; vertical-align: bottom; }
@keyframes mtDots { from { width: 0; } to { width: 1em; } }
.activity-map-link { font-size: 13px; font-weight: 800; color: var(--app-ink, var(--accent)); text-decoration: none; white-space: nowrap; }
.activity-map-link:hover { text-decoration: underline; }
.place-detail-row a { color: var(--app-ink, var(--accent)); font-weight: 700; }

/* Suggested-place chips (2026-10-10): one line each, with a sticker icon.
   The Thai rule "html[lang=th] [data-i18n] { white-space: normal }" plus the
   body's overflow-wrap: anywhere used to break "ทั้งหมด" letter by letter. */
.suggestion-filters { flex-wrap: wrap; overflow-x: visible; }
.suggestion-chip {
  flex: none; display: inline-flex; align-items: center; gap: 6px;
  white-space: nowrap !important; overflow-wrap: normal; word-break: keep-all;
  padding: 0 14px 0 10px;
}
.suggestion-chip span { white-space: nowrap !important; overflow-wrap: normal; }
.suggestion-chip .chip-ic { width: 20px; height: 20px; flex: none; }
@media (max-width: 700px) { .suggestion-grid { grid-template-columns: minmax(0, 1fr); } }

/* Place cards (2026-10-10): photo on top, text under it, in a grid instead of
   the old sideways strip. Phones get exactly two columns. The old ≤700px rule
   above made the list a horizontal flex scroller with 260px cards, which is
   what left the cards half off-screen and stretched tall. */
.suggestion-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); align-items: stretch; }
.suggestion-empty, .live-loading, .suggestion-search-head { grid-column: 1 / -1; }
.suggestion-card { padding: 8px; gap: 0; }
.suggestion-card .suggestion-head { display: flex; flex-direction: column; align-items: stretch; gap: 10px; }
.suggestion-card .suggestion-thumb { width: 100%; height: auto; aspect-ratio: 4 / 3; border-radius: 14px; }
.suggestion-card .suggestion-info { padding: 0 4px 4px; }
.suggestion-card .suggestion-title { line-clamp: 2; -webkit-line-clamp: 2; }
.suggestion-card .suggestion-title .place-ic { width: 18px; height: 18px; vertical-align: -3px; }
.suggestion-card .suggestion-sticker .place-ic { width: 44px; height: 44px; }
@media (max-width: 700px) {
  .suggestion-grid {
    display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px; margin-inline: 0; padding: 0; overflow: visible; scroll-snap-type: none;
  }
  .suggestion-card { flex: none; width: auto; padding: 6px; border-radius: 18px; }
  .suggestion-card .suggestion-head { gap: 8px; }
  .suggestion-card .suggestion-thumb { border-radius: 12px; }
  .suggestion-card .suggestion-info { padding: 0 3px 3px; }
  .suggestion-card .suggestion-title { font-size: 14px; }
  .suggestion-card .suggestion-location, .suggestion-card .suggestion-summary { font-size: 12px; }
  .suggestion-card .suggestion-title, .suggestion-card .suggestion-location, .suggestion-card .suggestion-summary { overflow-wrap: break-word; }
}

/* live places Retry (2026-10-10) */
.live-retry { margin-top: 4px; }
.live-retry-link { border: 0; background: none; padding: 0 2px; color: var(--app-ink, var(--accent)); font: inherit; font-weight: 800; text-decoration: underline; cursor: pointer; box-shadow: none; }

/* Day pickers (2026-10-21): a native <select> of the trip's days, so phones
   open their own picker. One on each place card (move it to another day), one
   in the "Add to trip" popup, and the form's Day field. On the card the
   field itself is the chip (space.css / soft.css already give every field its
   filled box); the calendar sticker and the chevron sit on top of it. */
.day-chip { position: relative; display: inline-flex; max-width: 100%; margin-top: 8px; }
.day-chip .day-chip-ic { position: absolute; left: 10px; top: 50%; width: 20px; height: 20px; margin-top: -10px; pointer-events: none; }
.day-chip::after {
  content: ""; position: absolute; right: 14px; top: 50%; width: 7px; height: 7px; margin-top: -6px;
  border: solid var(--muted); border-width: 0 2px 2px 0; transform: rotate(45deg); pointer-events: none;
}
.activity-card .day-chip select, .activity-card .day-chip input {
  appearance: none; -webkit-appearance: none; max-width: 100%; height: 38px; margin: 0; padding: 0 34px 0 38px;
  border-radius: 999px !important; color: var(--text); font: inherit; font-size: 13.5px; font-weight: 800; cursor: pointer;
}
.activity-card .day-chip input { padding-right: 12px; }
.place-modal-day { display: grid; gap: 8px; margin: 18px 0 4px; }
.place-modal-day > span { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; }
.place-modal-day .place-ic { width: 22px; height: 22px; }
.place-modal-day select, .place-modal-day input, #activityForm select#activityDate {
  width: 100%; min-height: 46px; font: inherit; font-size: 16px;   /* 16px: iOS doesn't zoom */
}
@media (max-width: 700px) {
  .activity-card .day-chip select, .activity-card .day-chip input { height: 42px; font-size: 16px; }   /* iOS zooms below 16px */
}
