/* ============================================================================
   golf.lettuce.courses — shared design system
   Structure:
     1. Tokens (colors, spacing, type)
     2. Base
     3. Global header + Lettuce-flights-style profile dropdown + mobile drawer
     4. Buttons, chips, badges
     5. Cards (real-photo + fallback gradient), grids
     6. Panels, stats, forms
     7. Map + sidebar utilities
     8. iMessage / Business Chat frame
     9. Footer
    10. Utilities
   ========================================================================= */

/* -------- 1. Tokens ------------------------------------------------------- */
:root {
	--ink: #0a1a12;
	--ink-2: #142b1e;
	--soft: #4a6a5a;
	--muted: #7c9587;
	--line: rgba(10, 40, 24, 0.10);
	--line-2: rgba(10, 40, 24, 0.18);
	--fairway: #2f8a52;
	--fairway-2: #1f6b3d;
	--fairway-3: #0e4a29;
	--flag: #e14b3a;
	--flag-2: #c73a2a;
	--sand: #f2e7cf;
	--sky: #cfe8f7;
	--cream: #faf8f2;
	--card: #ffffff;
	--shadow: 0 30px 80px rgba(10, 40, 24, 0.14);
	--shadow-sm: 0 8px 22px rgba(10, 40, 24, 0.08);
	--radius: 22px;
	--radius-sm: 14px;
	--nav-h: 62px;
	--safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* -------- 2. Base --------------------------------------------------------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
	margin: 0;
	font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
	color: var(--ink);
	line-height: 1.55;
	background:
		radial-gradient(900px 560px at 85% -8%, rgba(47, 138, 82, 0.14), transparent 60%),
		radial-gradient(820px 540px at -10% 10%, rgba(207, 232, 247, 0.45), transparent 62%),
		linear-gradient(180deg, #f6fbf5, var(--cream) 55%, #fff);
	-webkit-font-smoothing: antialiased;
	min-height: 100vh;
	overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
button { font-family: inherit; }
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 20px; }
@media (min-width: 700px) { .wrap { padding: 0 28px; } }
h1, h2, h3, h4 { font-family: Fraunces, 'Times New Roman', serif; letter-spacing: -0.025em; margin: 0 0 14px; font-weight: 700; color: var(--ink); }
h1 { font-size: clamp(2.4rem, 5.6vw, 4.4rem); line-height: 0.98; letter-spacing: -0.035em; }
h2 { font-size: clamp(1.8rem, 3.4vw, 2.6rem); line-height: 1.05; }
h3 { font-size: 1.15rem; letter-spacing: -0.015em; }
h4 { font-size: 1rem; }
p { color: var(--soft); margin: 0 0 14px; }
small { color: var(--soft); }

/* -------- 3. Header, dropdown, drawer ------------------------------------- */
.site {
	position: sticky; top: 0; z-index: 50;
	border-bottom: 1px solid var(--line);
	backdrop-filter: saturate(140%) blur(14px);
	-webkit-backdrop-filter: saturate(140%) blur(14px);
	background: rgba(250, 248, 242, 0.86);
}
.nav {
	display: flex; align-items: center; gap: 10px;
	padding: 10px 0;
	min-height: var(--nav-h);
}
.brand {
	display: inline-flex; align-items: center; gap: 11px;
	text-decoration: none; font-weight: 800; font-size: 1rem;
	color: var(--ink); flex: 0 0 auto;
}
.mark {
	width: 38px; height: 38px; border-radius: 14px;
	display: inline-flex; align-items: center; justify-content: center;
	color: #fff;
	background: linear-gradient(145deg, var(--fairway-3), var(--fairway));
	box-shadow: 0 12px 24px rgba(14, 74, 41, 0.32), inset 0 -2px 0 rgba(0,0,0,0.18);
	flex-shrink: 0;
}
.mark svg { width: 22px; height: 22px; display: block; }
.brand-copy { display: flex; flex-direction: column; line-height: 1.1; }
.brand-copy b { font-weight: 800; letter-spacing: -0.01em; }
.brand-copy small { color: var(--soft); font-weight: 500; letter-spacing: 0.06em; font-size: 0.66rem; text-transform: uppercase; }
@media (max-width: 460px) { .brand-copy small { display: none; } }

.nav-links {
	display: none; gap: 4px; margin: 0 auto; padding: 4px;
	background: rgba(255, 255, 255, 0.55);
	border: 1px solid var(--line);
	border-radius: 999px;
}
.nav-links a {
	padding: 8px 14px; border-radius: 999px;
	text-decoration: none; color: var(--soft); font-weight: 600; font-size: 0.9rem;
	transition: color 0.15s, background 0.15s;
}
.nav-links a:hover { color: var(--ink); }
.nav-links a.active { color: #fff; background: var(--ink); }
@media (min-width: 960px) { .nav-links { display: inline-flex; } }

.nav-actions { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; }
@media (min-width: 960px) { .nav-actions { margin-left: 0; } }

/* Profile pill (matches lettuce.flights aesthetic) */
.profile-btn {
	display: inline-flex; align-items: center; gap: 0;
	padding: 3px; border-radius: 999px;
	background: #fff; border: 1px solid var(--line);
	cursor: pointer; color: var(--ink); font-weight: 600; font-size: 0.88rem;
	transition: box-shadow 0.15s, transform 0.15s, border-color 0.15s;
}
.profile-btn:hover { box-shadow: var(--shadow-sm); border-color: var(--line-2); }
.profile-btn .hamb { display: none; }
.profile-btn .pfp {
	width: 32px; height: 32px; border-radius: 50%;
	background: linear-gradient(135deg, var(--fairway), var(--fairway-2));
	color: #fff; display: grid; place-items: center;
	font-family: Fraunces, serif; font-size: 0.95rem; font-weight: 700;
	box-shadow: inset 0 -1px 0 rgba(0,0,0,0.15);
}
.profile-btn .pfp.guest { background: linear-gradient(135deg, #eafce8, #cfe9d5); color: var(--fairway-2); font-size: 1.1rem; }

/* Dropdown pane */
.profile-menu {
	position: absolute; top: calc(100% + 8px); right: 0;
	min-width: 280px;
	background: #fff;
	border: 1px solid var(--line);
	border-radius: 18px;
	box-shadow: 0 24px 60px rgba(10, 40, 24, 0.18);
	padding: 8px;
	z-index: 60;
	opacity: 0; transform: translateY(-6px);
	pointer-events: none;
	transition: opacity 0.14s, transform 0.14s;
}
.profile-menu[data-open="true"] { opacity: 1; transform: translateY(0); pointer-events: auto; }
.profile-menu .who {
	padding: 12px 14px 10px;
	border-bottom: 1px solid var(--line);
	margin-bottom: 6px;
}
.profile-menu .who b { display: block; font-family: Fraunces, serif; font-size: 1.05rem; }
.profile-menu .who small { color: var(--soft); font-size: 0.82rem; }
.profile-menu a, .profile-menu button {
	display: flex; align-items: center; gap: 10px;
	padding: 10px 14px; border-radius: 12px;
	text-decoration: none; color: var(--ink); font-size: 0.92rem;
	background: transparent; border: 0; width: 100%; text-align: left;
	cursor: pointer;
}
.profile-menu a:hover, .profile-menu button:hover { background: rgba(47,138,82,0.08); color: var(--fairway-2); }
.profile-menu .sep { height: 1px; background: var(--line); margin: 6px 4px; }
.profile-menu .ico { width: 18px; height: 18px; color: var(--soft); flex-shrink: 0; }
.profile-menu .kbd { margin-left: auto; font-size: 0.72rem; color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.profile-menu .lettuce-eco { display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px; padding: 6px; background: linear-gradient(135deg, #f2f9f0, #eef7ff); border-radius: 12px; margin: 6px 4px; }
.profile-menu .lettuce-eco a { padding: 8px 10px; border-radius: 10px; font-size: 0.8rem; font-weight: 600; text-align: center; color: var(--fairway-2); }
.profile-menu .lettuce-eco a:hover { background: rgba(255,255,255,0.7); }

/* Menu rows that only appear inside the profile menu on small screens (mobile
   sees a single unified menu — no separate drawer). */
.profile-menu .mobile-only-link,
.profile-menu .mobile-only { display: none; }
@media (max-width: 959px) {
  .profile-menu .mobile-only-link { display: flex; }
  .profile-menu .mobile-only { display: block; }
}

/* Mobile: turn the profile dropdown into a proper bottom-sheet so it feels
   like a native app menu instead of a squished desktop pop-over. */
@media (max-width: 720px) {
  .profile-menu {
    position: fixed;
    left: 0; right: 0; bottom: 0; top: auto;
    min-width: 0; width: 100%;
    max-height: 80dvh;
    padding: 10px 10px calc(18px + var(--safe-bottom));
    border-radius: 22px 22px 0 0;
    border: 0;
    box-shadow: 0 -30px 80px rgba(10, 40, 24, 0.28);
    transform: translateY(20px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .profile-menu[data-open="true"] { transform: translateY(0); }
  /* Grab handle affordance so it reads as a bottom sheet. */
  .profile-menu::before {
    content: "";
    display: block;
    width: 40px; height: 4px; border-radius: 3px;
    background: rgba(10, 40, 24, 0.18);
    margin: 6px auto 10px;
  }
  .profile-menu a,
  .profile-menu button { padding: 14px 16px; font-size: 1rem; border-radius: 14px; }
  .profile-menu .who { padding: 14px 16px; }
  .profile-menu .lettuce-eco { grid-template-columns: repeat(2, 1fr); gap: 6px; padding: 10px; }
  .profile-menu .lettuce-eco a { padding: 12px 10px; font-size: 0.9rem; }
  /* Scrim */
  .profile-menu-scrim {
    position: fixed; inset: 0;
    background: rgba(10, 26, 18, 0.42);
    backdrop-filter: blur(2px);
    z-index: 55;
    opacity: 0; pointer-events: none;
    transition: opacity 0.18s;
  }
  .profile-menu-scrim.on { opacity: 1; pointer-events: auto; }
}

.menu-anchor { position: relative; }

/* Mobile: the primary nav-links collapse; the hamburger inside .profile-btn
   opens a single unified menu. There is no separate slide-in drawer. */
/* Legacy drawer styles retained for backwards compatibility but hidden — the
   nav now uses a single unified profile menu on mobile. */
.drawer-btn { display: none !important; }
.drawer { display: none !important; }

@media (min-width: 960px) { .nav-actions .nav-only-mobile { display: none; } }

/* -------- 4. Buttons, chips, badges --------------------------------------- */
.btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	padding: 11px 18px; border-radius: 999px; font-weight: 600; text-decoration: none;
	border: 1px solid var(--line); background: #fff; color: var(--ink); font-size: 0.94rem;
	transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
	cursor: pointer;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.btn.primary { background: linear-gradient(135deg, var(--fairway), var(--fairway-2)); color: #fff; border-color: transparent; box-shadow: 0 10px 26px rgba(31, 107, 61, 0.28); }
.btn.dark { background: var(--ink); color: #fff; border-color: transparent; }
.btn.ghost { background: transparent; }
.btn.ghost.on-dark { color: #eaf4ec; border-color: rgba(255,255,255,0.18); }
.btn.sm { padding: 8px 14px; font-size: 0.86rem; }
.btn.lg { padding: 14px 24px; font-size: 1rem; }
.btn.block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.chip {
	display: inline-flex; align-items: center; gap: 6px;
	padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line);
	background: #fff; font-size: 0.85rem; color: var(--ink); cursor: pointer;
	transition: border-color 0.12s, color 0.12s;
	white-space: nowrap;
}
.chip:hover { border-color: var(--fairway); color: var(--fairway-2); }
.chip.active { background: var(--ink); color: #fff; border-color: transparent; }
.chip.ai { background: linear-gradient(135deg, #eafce8, #e2f0fd); border-color: transparent; color: var(--fairway-2); font-weight: 600; }

.badge {
	display: inline-flex; align-items: center; gap: 6px;
	padding: 3px 10px; border-radius: 999px;
	background: rgba(47,138,82,0.12); color: var(--fairway-2);
	font-size: 0.76rem; font-weight: 600; letter-spacing: 0.02em;
}
.badge.flag { background: rgba(225,75,58,0.12); color: var(--flag-2); }
.badge.plus { background: linear-gradient(135deg, #eafce8, #e2f0fd); color: var(--fairway-2); }
.badge.beta { background: rgba(0, 122, 255, 0.12); color: #0653b6; }

.eyebrow {
	display: inline-flex; align-items: center; gap: 8px;
	padding: 6px 12px; border-radius: 999px;
	background: rgba(47, 138, 82, 0.10); color: var(--fairway-2);
	font-weight: 600; font-size: 0.8rem; letter-spacing: 0.02em;
	border: 1px solid rgba(47, 138, 82, 0.18);
}
.eyebrow .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--flag); box-shadow: 0 0 0 4px rgba(225, 75, 58, 0.15); }
.eyebrow.dark { background: rgba(255,255,255,0.08); color: #cfe8d5; border-color: rgba(255,255,255,0.14); }

/* -------- 5. Cards, real photos, grids ------------------------------------ */
.card {
	background: #fff; border: 1px solid var(--line); border-radius: 20px;
	overflow: hidden; transition: transform 0.2s, box-shadow 0.2s;
	display: flex; flex-direction: column;
	text-decoration: none; color: var(--ink);
}
.card:hover { transform: translateY(-3px); box-shadow: 0 20px 40px rgba(10,40,24,0.10); }

.card .photo {
	position: relative; aspect-ratio: 4 / 3;
	background: #eef1ec;
	overflow: hidden;
}
.card .photo img {
	width: 100%; height: 100%; object-fit: cover;
	display: block;
	transition: transform 0.4s ease;
}
.card:hover .photo img { transform: scale(1.03); }
.card .photo .tag {
	position: absolute; top: 12px; left: 12px; z-index: 3;
	background: rgba(255,255,255,0.94);
	padding: 5px 10px; border-radius: 999px;
	font-size: 0.72rem; font-weight: 700; color: var(--ink);
	letter-spacing: 0.02em; text-transform: uppercase;
	backdrop-filter: blur(6px);
	box-shadow: 0 2px 8px rgba(10,40,24,0.15);
	pointer-events: none;
}
.card .photo .save {
	position: absolute; top: 12px; right: 12px; z-index: 3;
	width: 34px; height: 34px; border-radius: 50%;
	background: rgba(255,255,255,0.92); backdrop-filter: blur(6px);
	display: grid; place-items: center; cursor: pointer;
	border: 0; font-size: 1rem;
	transition: background 0.15s, color 0.15s;
	box-shadow: 0 2px 8px rgba(10,40,24,0.18);
}
.card .photo .save.on { background: var(--flag); color: #fff; }

.card .meta { padding: 16px 18px 18px; }
.card .meta .row { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.card .meta h3 { margin-bottom: 2px; font-size: 1.05rem; }
.card .meta .loc { color: var(--soft); font-size: 0.87rem; }
.card .meta .rate { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; font-size: 0.9rem; }
.card .meta .info { display: flex; gap: 12px; color: var(--soft); font-size: 0.82rem; margin-top: 10px; flex-wrap: wrap; }
.card .meta .info span::before { content: "•"; margin-right: 8px; opacity: 0.5; }
.card .meta .info span:first-child::before { display: none; margin: 0; }
.card .price { margin-top: 12px; display: flex; justify-content: space-between; align-items: baseline; }
.card .price b { font-family: Fraunces, serif; font-size: 1.2rem; }
.card .price small { color: var(--soft); }

/* Photo skeleton while /api/golf/photo redirect is being followed */
.card .photo.loading { background: linear-gradient(100deg, #eef1ec 30%, #f8faf6 45%, #eef1ec 60%); background-size: 200% 100%; animation: shimmer 1.4s infinite linear; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* Fallback style-based gradient (only shown when photo fetch fails) */
.ph { background: radial-gradient(220px 100px at 30% 78%, var(--sand) 60%, transparent 62%), radial-gradient(140px 60px at 70% 40%, var(--sand) 55%, transparent 60%), linear-gradient(160deg, #cfeacf, #86c199 55%, #3e8f5c); }
.ph.ocean { background: radial-gradient(240px 90px at 30% 82%, #f2e7cf 55%, transparent 60%), linear-gradient(180deg, #b6d4ea 0%, #6fb383 45%, #2f8a52 100%); }
.ph.desert { background: radial-gradient(200px 80px at 60% 70%, #78b489 55%, transparent 60%), linear-gradient(160deg, #f6d9a4, #e6b673 55%, #c99051); }
.ph.mountain { background: radial-gradient(300px 120px at 50% 20%, #dfe9ee 55%, transparent 58%), linear-gradient(180deg, #8fb0c4 0%, #7ea896 50%, #3e7a56 100%); }
.ph.links { background: radial-gradient(160px 60px at 40% 62%, var(--sand) 55%, transparent 60%), linear-gradient(180deg, #d7e8ea 0%, #9ac2a4 50%, #5c9b6a 100%); }
.ph.forest { background: linear-gradient(180deg, #cfe6d4 0%, #4d8a5a 50%, #204d34 100%); }
.ph.night { background: radial-gradient(4px 4px at 20% 22%, #fff, transparent 60%), radial-gradient(3px 3px at 60% 34%, #fff, transparent 60%), radial-gradient(4px 4px at 82% 18%, #fff, transparent 60%), linear-gradient(180deg, #0d2340 0%, #143d2b 100%); }

.grid { display: grid; gap: 20px; grid-template-columns: repeat(1, 1fr); }
@media (min-width: 640px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 980px) { .grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1200px) { .grid.g4 { grid-template-columns: repeat(4, 1fr); } }

/* -------- 6. Panels, stats, forms, sections ------------------------------- */
section { padding: 40px 0; }
@media (min-width: 700px) { section { padding: 64px 0; } }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.link-more { text-decoration: none; color: var(--fairway-2); font-weight: 600; white-space: nowrap; }
.lede { font-size: 1.05rem; color: var(--soft); max-width: 620px; }

.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow-sm); }
.panel h3 { margin-bottom: 6px; }
.dark-panel { background: linear-gradient(160deg, #0a2818, #143d2b); color: #eaf4ec; border-radius: var(--radius); padding: 30px; box-shadow: var(--shadow); }
.dark-panel p { color: rgba(234, 244, 236, 0.8); }
.dark-panel h2, .dark-panel h3 { color: #fff; }

.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 640px) { .stats { grid-template-columns: repeat(4, 1fr); } }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 16px; }
.stat b { display: block; font-family: Fraunces, serif; font-size: 1.9rem; color: var(--ink); line-height: 1; }
.stat small { display: block; color: var(--soft); margin-top: 6px; font-size: 0.78rem; letter-spacing: 0.06em; text-transform: uppercase; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 0.78rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.field input, .field select, .field textarea {
	font: inherit; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px;
	background: #fff; color: var(--ink); outline: none;
	transition: border-color 0.12s, box-shadow 0.12s;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--fairway); box-shadow: 0 0 0 3px rgba(47,138,82,0.15); }

.search-input {
	display: flex; align-items: center; gap: 10px;
	padding: 14px 16px; border-radius: 14px;
	background: #fff; border: 1px solid var(--line);
	box-shadow: var(--shadow-sm);
}
.search-input input { flex: 1; border: 0; outline: 0; font: inherit; font-size: 1rem; background: transparent; color: var(--ink); }
.search-input svg { flex: 0 0 auto; color: var(--fairway-2); }

/* -------- 7. Map & sidebar ------------------------------------------------ */
.map-shell {
	display: grid; grid-template-columns: 1fr; grid-template-rows: 1fr auto;
	height: calc(100dvh - var(--nav-h)); overflow: hidden;
}
@media (min-width: 900px) { .map-shell { grid-template-columns: 420px 1fr; grid-template-rows: 1fr; } }
.map-sidebar {
	background: #fff;
	border-top: 1px solid var(--line);
	overflow: hidden;
	display: flex; flex-direction: column;
	max-height: 46dvh;
}
@media (min-width: 900px) { .map-sidebar { order: -1; max-height: none; border-top: 0; border-right: 1px solid var(--line); } }
.map-sidebar-head { padding: 14px 16px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.map-sidebar-list { flex: 1; min-height: 0; overflow-y: auto; padding: 12px 12px calc(20px + var(--safe-bottom)); display: flex; flex-direction: column; gap: 10px; -webkit-overflow-scrolling: touch; }
#map { height: 100%; width: 100%; background: #eaf3ea; }

.mini-card { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 12px; width: 100%; min-width: 0; min-height: 90px; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; text-decoration: none; color: var(--ink); background: #fff; transition: border-color .12s, transform .12s; align-items: stretch; flex-shrink: 0; }
.mini-card:hover { border-color: var(--fairway); transform: translateY(-1px); }
.mini-card .thumb { width: 88px; height: 88px; min-height: 88px; background-color: #eef1ec; background-size: cover; background-position: center; flex-shrink: 0; align-self: stretch; }
.mini-card .body { padding: 10px 12px 12px 0; min-width: 0; overflow: hidden; display: flex; flex-direction: column; justify-content: center; gap: 2px; }
.mini-card b { display: block; font-size: 0.98rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-card small { display: block; color: var(--soft); font-size: 0.8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-card .r { display: flex; gap: 8px; justify-content: space-between; margin-top: 4px; align-items: baseline; }
.mini-card .r b { font-family: Fraunces, serif; font-size: 1rem; white-space: nowrap; }
.mini-card .r span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }

.leaflet-popup-content { font-family: Inter, sans-serif; }
.leaflet-popup-content-wrapper { border-radius: 14px; }

/* Map header (mobile) */
.map-topbar {
	display: none;
	padding: 8px 12px;
	background: rgba(255,255,255,0.94);
	border-bottom: 1px solid var(--line);
	gap: 8px; align-items: center;
	backdrop-filter: blur(10px);
}
@media (max-width: 899px) { .map-topbar { display: flex; } }
.map-topbar .search-input { flex: 1; padding: 10px 12px; box-shadow: none; }

/* -------- 8. iMessage / Business Chat frame ------------------------------- */
.imsg-frame { max-width: 340px; margin: 0 auto; background: #111; border-radius: 44px; padding: 10px; box-shadow: 0 40px 100px rgba(10,40,24,0.28), 0 0 0 1px rgba(255,255,255,0.06); position: relative; }
.imsg-inner { background: #fff; border-radius: 34px; overflow: hidden; position: relative; height: 620px; display: flex; flex-direction: column; }
.imsg-notch { position: absolute; top: 14px; left: 50%; transform: translateX(-50%); width: 100px; height: 26px; background: #111; border-radius: 14px; z-index: 5; }
.imsg-head { text-align: center; padding: 40px 12px 10px; border-bottom: 1px solid rgba(0,0,0,0.06); background: rgba(247,247,250,0.94); backdrop-filter: blur(10px); }
.imsg-head .avatar-lg { width: 46px; height: 46px; border-radius: 50%; background: linear-gradient(135deg, var(--fairway), var(--fairway-2)); display: inline-flex; align-items: center; justify-content: center; margin-bottom: 4px; }
.imsg-head .avatar-lg svg { width: 26px; height: 26px; }
.imsg-head b { display: block; font-family: Inter, sans-serif; font-size: 0.9rem; color: #111; letter-spacing: -0.01em; }
.imsg-head small { display: block; color: #8a8a8f; font-size: 0.72rem; margin-top: 2px; }
.imsg-body { flex: 1; padding: 12px 10px 70px; display: flex; flex-direction: column; gap: 4px; background: #fff; overflow-y: auto; }
.imsg-day { text-align: center; color: #8a8a8f; font-size: 0.7rem; margin: 6px 0 6px; }
.imsg-day b { color: #111; font-weight: 600; }
.imsg-bubble { max-width: 78%; padding: 8px 13px; border-radius: 18px; font-size: 0.88rem; line-height: 1.38; word-wrap: break-word; }
.imsg-bubble.in { background: #e9e9eb; color: #111; align-self: flex-start; border-bottom-left-radius: 5px; }
.imsg-bubble.out { background: linear-gradient(135deg, #2ea1ff, #007aff); color: #fff; align-self: flex-end; border-bottom-right-radius: 5px; }
.imsg-tail { font-size: 0.68rem; color: #8a8a8f; margin: 2px 8px -2px; text-align: right; }
.imsg-input { position: absolute; left: 10px; right: 10px; bottom: 10px; display: flex; gap: 8px; align-items: center; background: #fff; border-radius: 22px; padding: 4px 6px 4px 14px; border: 1px solid rgba(0,0,0,0.1); }
.imsg-input input { flex: 1; border: 0; outline: 0; padding: 8px 0; font-size: 0.88rem; background: transparent; font-family: inherit; }
.imsg-input button { width: 30px; height: 30px; border-radius: 50%; background: linear-gradient(135deg, #2ea1ff, #007aff); color: #fff; border: 0; cursor: pointer; font-size: 1rem; display: inline-flex; align-items: center; justify-content: center; }

/* -------- 9. Footer ------------------------------------------------------- */
footer { padding: 60px 0 40px; border-top: 1px solid var(--line); background: #fff; margin-top: 40px; }
.foot { display: grid; gap: 30px; grid-template-columns: 1fr; }
@media (min-width: 800px) { .foot { grid-template-columns: 1.4fr 1fr 1fr 1fr; } }
.foot h4 { font-family: Inter, sans-serif; font-size: 0.78rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--soft); margin: 0 0 12px; }
.foot ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.foot a { color: var(--ink); text-decoration: none; opacity: 0.82; font-size: 0.94rem; }
.foot a:hover { opacity: 1; color: var(--fairway-2); }
.legal { margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; color: var(--soft); font-size: 0.85rem; }

/* -------- 10. Utilities --------------------------------------------------- */
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }
.mt-2 { margin-top: 6px; } .mt-4 { margin-top: 12px; } .mt-6 { margin-top: 20px; } .mt-8 { margin-top: 30px; }
.mb-2 { margin-bottom: 8px; }
.hscroll { display: flex; gap: 8px; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; padding-bottom: 4px; }
.hscroll::-webkit-scrollbar { display: none; }
.hscroll > * { flex-shrink: 0; }
.hide-mobile { display: none; }
@media (min-width: 800px) { .hide-mobile { display: initial; } }
.hide-desktop { display: initial; }
@media (min-width: 800px) { .hide-desktop { display: none; } }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
