@import url("https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Playfair+Display:wght@600;700&display=swap");

:root {
  --navy: #063d68;
  --navy-deep: #032c4c;
  --blue: #087fb3;
  --aqua: #77d4d7;
  --aqua-soft: #e9f8f7;
  --orange: #ff6b35;
  --cream: #f6f4ed;
  --ink: #123047;
  --muted: #6d7f8c;
  --line: #dce6e8;
  --white: #fff;
  --shadow: 0 20px 50px rgba(4, 49, 79, 0.1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: #f8faf8; font-family: "DM Sans", sans-serif; }
button, input, select { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.eyebrow { color: var(--blue); font-size: .72rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; }
.eyebrow.light { color: #a9eced; }

.welcome { min-height: 100vh; display: grid; grid-template-columns: 1.12fr .88fr; background: white; }
.welcome-art { position: relative; overflow: hidden; display: flex; align-items: center; min-height: 100vh; padding: 8vw; color: white; background: radial-gradient(circle at 75% 20%, rgba(119,212,215,.4), transparent 30%), linear-gradient(145deg, var(--navy-deep), #076d91 70%, #38a9b0); }
.welcome-art::after { content: ""; position: absolute; inset: 0; opacity: .25; background-image: linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px), linear-gradient(90deg,rgba(255,255,255,.05) 1px, transparent 1px); background-size: 36px 36px; mask-image: linear-gradient(to right, transparent, black); }
.hero-copy { position: relative; z-index: 2; max-width: 650px; }
.hero-logo { width: 118px; margin-bottom: 40px; filter: drop-shadow(0 10px 16px rgba(0,0,0,.18)); }
.hero-copy h1, .planner-head h1, .section-bar h2, .route-title h2, .auth-box h2 { font-family: "Playfair Display", serif; }
.hero-copy h1 { margin: 16px 0 24px; font-size: clamp(3.2rem, 5.5vw, 6rem); line-height: .98; letter-spacing: -.04em; }
.hero-copy > p { max-width: 560px; font-size: 1.12rem; line-height: 1.7; color: rgba(255,255,255,.78); }
.trust-row { display: flex; flex-wrap: wrap; gap: 24px; margin-top: 48px; color: #d8f5f3; font-size: .86rem; font-weight: 600; }
.welcome-orb { position: absolute; border-radius: 50%; border: 1px solid rgba(255,255,255,.18); }
.orb-one { width: 420px; height: 420px; right: -140px; bottom: -120px; box-shadow: 0 0 0 60px rgba(255,255,255,.03), 0 0 0 130px rgba(255,255,255,.025); }
.orb-two { width: 180px; height: 180px; right: 10%; top: 12%; background: rgba(255,255,255,.04); }
.welcome-panel { display: grid; place-items: center; padding: 40px; background: linear-gradient(180deg, #fff, #f8fbfa); }
.auth-box { width: min(420px, 100%); text-align: center; }
.auth-logo { width: 74px; margin-bottom: 12px; }
.auth-box h2 { margin: 10px 0 8px; font-size: 2.35rem; color: var(--navy); }
.auth-box form { margin-top: 30px; text-align: left; }
label, .avatar-field > span { display: block; color: var(--ink); font-size: .82rem; font-weight: 700; }
input[type="text"], input[type="email"], select { width: 100%; margin-top: 8px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px; outline: none; background: white; color: var(--ink); transition: .2s; }
input:focus, select:focus { border-color: var(--aqua); box-shadow: 0 0 0 4px rgba(119,212,215,.18); }
.auth-box label + label { margin-top: 18px; }
.avatar-field { margin: 22px 0; }
.avatar-row { display: flex; gap: 10px; margin-top: 10px; }
.avatar { width: 48px; height: 48px; padding: 0; border-radius: 50%; border: 1px solid var(--line); background: white; font-size: 1.3rem; }
.avatar.selected { border: 2px solid var(--orange); background: #fff5ef; transform: translateY(-2px); }
.primary { border: 0; border-radius: 10px; padding: 14px 20px; color: white; background: linear-gradient(135deg, var(--orange), #fa8448); font-weight: 700; box-shadow: 0 10px 20px rgba(255,107,53,.2); }
.primary:hover { transform: translateY(-1px); box-shadow: 0 14px 24px rgba(255,107,53,.25); }
.primary:disabled { cursor: not-allowed; opacity: .45; transform: none; }
.wide { width: 100%; display: flex; align-items: center; justify-content: center; gap: 10px; }
.text-button { margin-top: 18px; border: 0; background: none; color: var(--blue); font-weight: 700; }
.fine-print { margin-top: 30px; color: #98a6ae; font-size: .68rem; }

.app { min-height: 100vh; }
.topbar { height: 76px; display: flex; align-items: center; gap: 48px; padding: 0 clamp(24px, 5vw, 80px); border-bottom: 1px solid var(--line); background: rgba(255,255,255,.94); position: sticky; top: 0; z-index: 1000; backdrop-filter: blur(12px); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--navy); text-decoration: none; font-family: "Playfair Display", serif; font-size: 1.32rem; font-weight: 700; }
.brand img { width: 48px; height: 48px; object-fit: contain; }
.topbar nav { display: flex; align-self: stretch; gap: 28px; }
.nav-link { position: relative; border: 0; background: none; color: var(--muted); font-size: .88rem; font-weight: 700; }
.admin-link { display: flex; align-items: center; text-decoration: none; }
.nav-link.active { color: var(--navy); }
.nav-link.active::after { content: ""; position: absolute; height: 3px; left: 0; right: 0; bottom: 0; border-radius: 3px 3px 0 0; background: var(--orange); }
.count { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px; margin-left: 4px; border-radius: 10px; color: white; background: var(--orange); font-size: .68rem; }
.profile { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.profile-copy { display: flex; flex-direction: column; text-align: right; font-size: .78rem; }
.profile-copy span { color: var(--muted); font-size: .67rem; }
.profile-avatar { width: 43px; height: 43px; border: 1px solid #c8e5e3; border-radius: 50%; background: var(--aqua-soft); font-size: 1.2rem; }
main { width: min(1480px, calc(100% - 48px)); margin: 0 auto; padding-bottom: 80px; }
.planner-head { display: flex; align-items: center; justify-content: space-between; padding: 60px 0 30px; }
.planner-head h1 { margin: 7px 0 5px; color: var(--navy); font-size: clamp(2.2rem, 4vw, 3.6rem); letter-spacing: -.03em; }
.planner-head p { margin: 0; color: var(--muted); }
.weather-pill { display: flex; align-items: center; gap: 13px; padding: 12px 18px; border-radius: 14px; background: var(--aqua-soft); }
.weather-pill > span { font-size: 1.5rem; }
.weather-pill div { display: flex; flex-direction: column; font-size: .77rem; }
.weather-pill small { color: var(--muted); }
.control-card { padding: 24px; border: 1px solid var(--line); border-radius: 16px; background: white; box-shadow: var(--shadow); }
.control-grid { display: grid; grid-template-columns: 1.35fr .85fr 1fr auto; align-items: end; gap: 18px; }
.field { position: relative; }
.field label { min-height: 18px; }
.field label strong { float: right; color: var(--orange); }
.field small { display: block; margin-top: 7px; color: var(--muted); font-size: .68rem; }
.input-shell { display: flex; align-items: center; margin-top: 8px; padding-left: 14px; border: 1px solid var(--line); border-radius: 10px; }
.input-shell input { min-width: 0; margin: 0; border: 0; box-shadow: none; }
.input-shell button { width: 40px; border: 0; background: none; color: var(--blue); font-size: 1.25rem; }
.location-suggestions { position: absolute; z-index: 1200; top: 76px; left: 0; right: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: white; box-shadow: var(--shadow); }
.location-suggestion { width: 100%; display: grid; grid-template-columns: 28px 1fr; gap: 8px; padding: 11px 13px; border: 0; border-bottom: 1px solid #edf1f1; background: white; text-align: left; }
.location-suggestion:last-child { border-bottom: 0; }
.location-suggestion:hover, .location-suggestion:focus { background: var(--aqua-soft); outline: none; }
.location-suggestion span { grid-row: 1/3; color: var(--blue); font-size: 1rem; }
.location-suggestion strong { color: var(--navy); font-size: .76rem; }
.location-suggestion small { color: var(--muted); font-size: .64rem; }
select { appearance: none; background-image: linear-gradient(45deg,transparent 50%,var(--muted) 50%),linear-gradient(135deg,var(--muted) 50%,transparent 50%); background-position: calc(100% - 18px) 19px,calc(100% - 13px) 19px; background-size: 5px 5px; background-repeat: no-repeat; }
input[type="range"] { width: 100%; margin: 18px 0 2px; accent-color: var(--orange); }
.range-labels { display: flex; justify-content: space-between; color: var(--muted); font-size: .65rem; }
.search { min-height: 48px; white-space: nowrap; }
.quick-regions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; padding-top: 18px; border-top: 1px solid #edf1f1; }
.region-chip, .category-chip { border: 1px solid var(--line); border-radius: 20px; padding: 7px 12px; color: var(--muted); background: white; font-size: .72rem; font-weight: 700; }
.region-chip:hover, .region-chip.active, .category-chip.active { color: var(--navy); border-color: var(--aqua); background: var(--aqua-soft); }
.workspace { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(340px, .72fr); align-items: start; gap: 28px; margin-top: 40px; }
.section-bar, .route-title { display: flex; justify-content: space-between; align-items: center; }
.section-bar h2, .route-title h2 { margin: 6px 0 0; color: var(--navy); font-size: 1.65rem; }
.view-actions { display: flex; gap: 8px; }
.secondary, .icon-button { padding: 9px 13px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: white; font-size: .75rem; font-weight: 700; }
.icon-button.active { color: white; border-color: var(--navy); background: var(--navy); }
.category-filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 20px 0; }
.places-list { display: flex; flex-direction: column; gap: 14px; }
.places-list.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.place-card { display: grid; grid-template-columns: 190px minmax(0,1fr) auto; min-height: 160px; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: white; transition: .2s; }
.place-card:hover { border-color: #aed9d7; transform: translateY(-2px); box-shadow: 0 12px 28px rgba(4,49,79,.08); }
.place-card.selected { border-color: var(--orange); box-shadow: 0 0 0 2px rgba(255,107,53,.1); }
.place-image { position: relative; min-height: 160px; overflow: hidden; background: var(--aqua-soft); }
.place-image img { width: 100%; height: 100%; object-fit: cover; transition: .4s; }
.place-card:hover .place-image img { transform: scale(1.04); }
.place-distance { position: absolute; left: 10px; bottom: 10px; padding: 6px 9px; border-radius: 7px; background: rgba(3,44,76,.88); color: white; font-size: .68rem; font-weight: 700; }
.place-content { min-width: 0; padding: 18px; }
.place-meta { display: flex; align-items: center; gap: 8px; color: var(--blue); font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.place-content h3 { margin: 7px 0 5px; color: var(--navy); font-family: "Playfair Display", serif; font-size: 1.24rem; }
.place-location { color: var(--muted); font-size: .76rem; }
.place-description { display: -webkit-box; margin: 10px 0 0; overflow: hidden; color: #647784; font-size: .75rem; line-height: 1.5; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.place-actions { display: flex; flex-direction: column; justify-content: center; gap: 8px; padding: 15px; border-left: 1px solid #eef2f2; }
.select-place { min-width: 96px; padding: 9px 12px; border: 1px solid var(--blue); border-radius: 8px; color: var(--blue); background: white; font-size: .7rem; font-weight: 700; }
.place-card.selected .select-place { color: white; border-color: var(--orange); background: var(--orange); }
.website-link { color: var(--muted); text-align: center; text-decoration: none; font-size: .67rem; }
.places-list.grid .place-card { grid-template-columns: 1fr; }
.places-list.grid .place-image { height: 190px; }
.places-list.grid .place-actions { flex-direction: row; border-top: 1px solid #eef2f2; border-left: 0; }
.route-column { position: sticky; top: 96px; }
.route-card { padding: 22px; border: 1px solid var(--line); border-radius: 16px; background: white; box-shadow: var(--shadow); }
.badge { padding: 6px 10px; border-radius: 14px; color: var(--blue); background: var(--aqua-soft); font-size: .68rem; font-weight: 700; }
#map { height: 285px; margin: 20px -22px 0; background: #deefec; z-index: 1; }
.map-fallback { height: 100%; display: grid; place-items: center; padding: 30px; color: var(--muted); text-align: center; background: radial-gradient(circle at 20% 30%,#bde3dd,transparent 28%),linear-gradient(135deg,#e7f4f0,#cce4e2); }
.route-stats { display: grid; grid-template-columns: repeat(3,1fr); border-bottom: 1px solid var(--line); }
.route-stats div { display: grid; grid-template-columns: auto 1fr; column-gap: 7px; padding: 17px 8px; }
.route-stats span { grid-row: 1/3; color: var(--orange); }
.route-stats strong { color: var(--navy); font-size: .86rem; }
.route-stats small { color: var(--muted); font-size: .58rem; }
.route-list { max-height: 330px; overflow: auto; padding: 10px 0; }
.route-placeholder { display: flex; align-items: center; gap: 12px; padding: 18px 5px; color: var(--muted); font-size: .74rem; line-height: 1.45; }
.route-placeholder span { display: grid; place-items: center; flex: 0 0 38px; height: 38px; border: 1px dashed var(--aqua); border-radius: 50%; color: var(--blue); font-size: 1.2rem; }
.route-item { display: grid; grid-template-columns: 26px 1fr auto; align-items: center; gap: 8px; padding: 10px 4px; }
.route-number { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; color: white; background: var(--navy); font-size: .64rem; font-weight: 700; }
.route-item strong { display: block; color: var(--navy); font-size: .76rem; }
.route-item small { color: var(--muted); font-size: .62rem; }
.route-remove { border: 0; color: #99a8b0; background: none; }
#save-button { margin-top: 9px; }
.route-note { margin: 12px 0 0; text-align: center; color: var(--muted); font-size: .61rem; }
.empty-state { padding: 70px 20px; text-align: center; color: var(--muted); }
.empty-state > div { font-size: 2rem; color: var(--aqua); }
.empty-state h3 { margin-bottom: 6px; color: var(--navy); }
.toast { position: fixed; left: 50%; bottom: 28px; z-index: 2000; transform: translate(-50%, 30px); padding: 12px 18px; border-radius: 10px; opacity: 0; pointer-events: none; color: white; background: var(--navy-deep); font-size: .78rem; box-shadow: var(--shadow); transition: .25s; }
.toast.show { opacity: 1; transform: translate(-50%,0); }
.leaflet-popup-content-wrapper { border-radius: 10px; font-family: "DM Sans",sans-serif; }

@media (max-width: 1100px) {
  .welcome { grid-template-columns: 1fr; }
  .welcome-art { min-height: 58vh; padding: 70px 8vw; }
  .welcome-panel { min-height: 65vh; }
  .hero-copy h1 { font-size: clamp(3rem,9vw,5rem); }
  .control-grid { grid-template-columns: 1fr 1fr; }
  .search { width: 100%; }
  .workspace { grid-template-columns: 1fr; }
  .route-column { position: static; }
  #map { height: 360px; }
}
@media (max-width: 720px) {
  main { width: min(100% - 28px,1480px); }
  .topbar { height: 66px; padding: 0 14px; gap: 14px; }
  .brand span, .profile-copy, .topbar nav .nav-link:first-child, .topbar nav .admin-link { display: none; }
  .brand img { width: 42px; }
  .topbar nav { margin-left: auto; }
  .profile { margin-left: 0; }
  .planner-head { padding-top: 36px; }
  .weather-pill { display: none; }
  .control-grid { grid-template-columns: 1fr; }
  .place-card { grid-template-columns: 110px minmax(0,1fr); }
  .place-image { min-height: 180px; }
  .place-actions { grid-column: 1/-1; flex-direction: row; border-top: 1px solid #eef2f2; border-left: 0; }
  .places-list.grid { grid-template-columns: 1fr; }
  .section-bar { align-items: flex-end; }
  .view-actions .secondary { display: none; }
  .welcome-art { min-height: 68vh; }
  .hero-logo { width: 90px; margin-bottom: 25px; }
  .trust-row { gap: 12px; margin-top: 28px; flex-direction: column; }
  .welcome-panel { padding: 50px 24px; }
}
