/*
 * RV Elevation Planner Lite - Weather Center inspired interface
 * UI-only stylesheet. No route, map, Places, REST, or calculation logic changed.
 */

.rvep-app,
.rvep-app *,
.rvep-app *:before,
.rvep-app *:after{box-sizing:border-box}

.rvep-app{
  --navy:#1f2c75;
  --green:#145634;
  --green-btn:#2f845a;
  --dark:#555;
  --ink:#111;
  --line:#eee;
  --panel:#fff;
  --page:#f7f7f7;
  --soft:#f1f1f1;
  width:100%;
  max-width:760px;
  margin:0 auto 24px;
  background:var(--page);
  overflow:hidden;
  box-shadow:0 10px 25px rgba(0,0,0,.12);
  font-family:Arial,Helvetica,sans-serif;
  color:var(--ink);
  -webkit-text-size-adjust:100%;
  text-size-adjust:100%;
  touch-action:manipulation;
}

/* Compact navy header, visually aligned with Travel Weather Center */
.rvep-hero{
  height:48px;
  min-height:48px;
  box-sizing:border-box;
  margin:0;
  padding:5px 7px;
  display:flex;
  align-items:center;
  justify-content:center;
  text-align:center;
  background:var(--navy);
  color:#fff;
  border-radius:0;
  box-shadow:none;
}
.rvep-hero>div{width:100%}
.rvep-kicker{display:none}
.rvep-hero h2{
  margin:0;
  font-size:20px;
  line-height:1.05;
  font-weight:900;
  letter-spacing:0;
}
.rvep-hero p{
  margin:3px auto 0;
  max-width:620px;
  font-size:10px;
  line-height:1.15;
  font-weight:800;
  opacity:.96;
}

.rvep-key-warning{
  margin:0;
  padding:9px 10px;
  background:#fff3cd;
  border:0;
  border-left:5px solid #d98200;
  border-bottom:1px solid var(--line);
  border-radius:0;
  font-size:13px;
  line-height:1.35;
}

/* Route search panel */
.rvep-form{
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(0,1fr);
  grid-template-areas:
    "origin destination"
    "analyze swap";
  gap:6px;
  margin:0;
  padding:8px;
  background:var(--panel);
  border:0;
  border-bottom:1px solid var(--line);
  border-radius:0;
  box-shadow:none;
}
.rvep-form label{
  display:block;
  min-width:0;
  margin:0;
  color:var(--green);
  font-size:13px;
  line-height:1.15;
  font-weight:900;
}
.rvep-form label:first-of-type{grid-area:origin}
.rvep-form label:nth-of-type(2){grid-area:destination}
.rvep-analyze{grid-area:analyze}
.rvep-swap{grid-area:swap}

.rvep-input-wrap{position:relative;margin-top:5px}
.rvep-form input{
  display:block;
  width:100%;
  min-width:0;
  max-width:100%;
  margin:0;
  padding:9px 38px 9px 8px;
  border:1px solid #ddd;
  border-radius:0;
  background:#fff;
  color:#111;
  font-family:Arial,Helvetica,sans-serif;
  font-size:16px!important;
  line-height:1.25!important;
  font-weight:700;
  -webkit-appearance:none;
  appearance:none;
  outline:none;
}
.rvep-form input:focus{border-color:#9ab7a8;box-shadow:0 0 0 1px rgba(47,132,90,.10)}
.rvep-form input::placeholder{color:#555;opacity:.84}

.rvep-form button,
.rvep-actions button{
  border:0;
  border-radius:10px;
  padding:9px 10px;
  font-family:Arial,Helvetica,sans-serif;
  font-size:14px;
  line-height:1.15;
  font-weight:900;
  cursor:pointer;
  box-shadow:none;
  transition:filter .15s ease;
}
.rvep-analyze{
  width:100%;
  background:var(--green-btn)!important;
  color:#fff!important;
}
.rvep-form .rvep-swap{
  width:100%;
  min-height:38px;
  align-self:end;
  background:var(--dark)!important;
  color:#fff!important;
  font-size:0;
}
.rvep-form .rvep-swap:after{
  content:"Swap Route";
  font-size:14px;
  font-weight:900;
}
.rvep-form button:hover,.rvep-actions button:hover{filter:brightness(1.06)}

/* Clear X remains subtle inside each input */
.rvep-clear-place{
  position:absolute!important;
  right:5px;
  top:50%;
  transform:translateY(-50%)!important;
  width:30px!important;
  height:30px!important;
  min-width:30px!important;
  min-height:30px!important;
  padding:0!important;
  margin:0!important;
  border:0!important;
  border-radius:50%!important;
  background:transparent!important;
  color:#666!important;
  font:500 24px/28px Arial,sans-serif!important;
  text-align:center!important;
  box-shadow:none!important;
  cursor:pointer!important;
  z-index:3;
}
.rvep-clear-place:hover,.rvep-clear-place:focus{background:#f1f1f1!important;color:#222!important;outline:none}
.rvep-clear-place[hidden]{display:none!important}

/* Status summary matches the white summary strip in Travel Weather Center */
.rvep-status{
  max-width:calc(100% - 16px);
  min-height:0;
  margin:7px 8px;
  padding:7px 9px;
  overflow:hidden;
  background:rgba(255,255,255,.96);
  color:#111;
  border-radius:0;
  box-shadow:0 2px 8px rgba(0,0,0,.12);
  font-size:13px;
  line-height:1.3;
  font-weight:900;
}
.rvep-status:empty{display:none}
.rvep-status.error{display:block;color:#9b1c1c;background:#ffe9e9;border-left:5px solid #c62828}

/* Large map-first layout */
.rvep-map{
  position:relative;
  width:100%;
  height:60vh;
  min-height:415px;
  max-height:620px;
  overflow:hidden;
  background:#ddd;
  border:0;
  border-radius:0;
}
.rvep-map-placeholder{
  display:flex;
  height:100%;
  padding:24px;
  align-items:center;
  justify-content:center;
  text-align:center;
  color:#555;
  font-size:14px;
  font-weight:800;
}

/* Google map location button */
.rvep-map-location-control{margin:0 10px 10px 0}
.rvep-my-location{
  appearance:none;
  border:0;
  background:#fff;
  color:var(--green);
  border-radius:12px;
  padding:10px 12px;
  font:900 14px/1.1 Arial,Helvetica,sans-serif;
  box-shadow:0 2px 9px rgba(0,0,0,.24);
  cursor:pointer;
  display:flex;
  align-items:center;
  gap:7px;
}
.rvep-my-location:hover{background:#f7f7f7}
.rvep-my-location:disabled{opacity:.7;cursor:wait}
.rvep-my-location span{font-size:16px;transform:rotate(-35deg);display:inline-block}

/* Route option section */
.rvep-route-choices{
  margin:0;
  padding:8px;
  background:#fff;
  border:0;
  border-top:1px solid var(--line);
  border-radius:0;
  box-shadow:none;
}
.rvep-choice-heading{
  display:flex;
  justify-content:space-between;
  gap:8px;
  margin:0;
  padding:0 0 6px;
  color:var(--green);
  font-size:13px;
  font-weight:900;
}
.rvep-choice-list{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:6px}
.rvep-route-choices button,
.rvep-route-choices .rvep-choice-card.single-route{
  box-sizing:border-box;
  width:100%;
  min-height:0;
  margin:0;
  padding:9px;
  display:block;
  text-align:left;
  color:#111;
  background:#f1f1f1;
  border:1px solid transparent;
  border-radius:0;
  box-shadow:none;
  cursor:pointer;
  transform:none;
  transition:background .15s ease,border-color .15s ease;
}
.rvep-route-choices button:hover{background:#e9f2ed;transform:none;box-shadow:none}
.rvep-route-choices button.active{background:#e1f0e7;border-color:var(--green-btn);box-shadow:none}
.rvep-route-choices .rvep-choice-card.single-route{cursor:default;border-color:#e5e5e5;background:#f7f7f7}
.rvep-choice-top{display:flex;justify-content:space-between;align-items:flex-start;gap:8px;margin-bottom:7px}
.rvep-choice-title{display:flex;flex-direction:column;gap:2px;min-width:0}
.rvep-choice-route-label{font-size:10px;line-height:1.2;font-weight:900;letter-spacing:.05em;text-transform:uppercase;color:#666}
.rvep-choice-name{display:block;overflow-wrap:anywhere;font-size:14px;font-weight:900;color:#111}
.rvep-choice-badges{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:4px}
.rvep-choice-badges em,.rvep-choice-name em{
  font-style:normal;
  font-size:10px;
  background:#fff;
  color:#555;
  border-radius:9px;
  padding:4px 6px;
  font-weight:900;
  white-space:nowrap;
}
.rvep-choice-badges em.flat,.rvep-choice-name em{background:var(--green-btn);color:#fff}
.rvep-choice-metrics{display:grid;grid-template-columns:1fr 1fr;gap:5px 8px;color:#666;font-size:11px}
.rvep-choice-metrics span{display:block}
.rvep-choice-metrics b{color:#111;font-size:12px}

.rvep-compare-summary{
  display:flex;
  align-items:center;
  gap:9px;
  margin:7px 8px;
  padding:8px 9px;
  background:#fff;
  border:0;
  border-radius:0;
  box-shadow:0 2px 8px rgba(0,0,0,.12);
}
.rvep-compare-summary strong,.rvep-compare-summary span{display:block}
.rvep-compare-summary span{font-size:12px;color:#555;margin-top:2px}
.rvep-compare-icon{width:32px;height:32px;display:flex;align-items:center;justify-content:center;border-radius:50%;background:var(--green-btn);color:#fff;font-weight:900;flex:0 0 32px}

/* Analysis/result cards */
.rvep-results{background:#fff;padding:10px 8px 14px;border-top:1px solid var(--line)}
.rvep-result-heading{display:flex;align-items:center;justify-content:space-between;gap:8px;margin:0 0 8px}
.rvep-result-heading h3{margin:2px 0 0;font-size:20px;line-height:1.1}
.rvep-kicker-dark{font-size:10px;letter-spacing:.08em;font-weight:900;color:var(--green)}
.rvep-flattest-badge{background:var(--green-btn);color:#fff;font-weight:900;border-radius:9px;padding:6px 8px;font-size:11px;white-space:nowrap}
.rvep-stats{display:grid;grid-template-columns:repeat(5,1fr);gap:6px;margin:0 0 9px}
.rvep-stats div{background:#f1f1f1;border-radius:0;padding:8px;text-align:center}
.rvep-stats strong{display:block;font-size:17px;line-height:1.1}
.rvep-stats span{font-size:10px;color:#555;font-weight:700}
.rvep-grid{display:grid;grid-template-columns:2fr 1fr;gap:8px}
.rvep-grid section,.rvep-results>section{background:#fff;border:1px solid #eee;border-radius:0;padding:9px;margin-bottom:8px}
.rvep-grid canvas{width:100%;display:block}
.rvep-grid h3,.rvep-results h3{margin:0 0 7px;font-size:16px}
.rvep-grid ul{padding-left:18px}
.rvep-table{display:grid;gap:5px}
.rvep-table>div{display:flex;justify-content:space-between;gap:8px;background:#f1f1f1;padding:7px 8px;border-radius:0}
.rvep-table span{color:#555}
.rvep-actions{display:flex;align-items:center;gap:6px;margin:7px 0}
.rvep-actions button{background:var(--green-btn);color:#fff}
.rvep-source-note{margin:0;padding:9px 10px;background:#fff;color:#666;border-top:1px solid #eee;font-size:11px;line-height:1.35}

/* Places autocomplete */
.rvep-place-field{position:relative;min-width:0}
.rvep-autocomplete{
  position:absolute;
  z-index:10020;
  left:0;
  right:0;
  top:calc(100% + 4px);
  max-height:310px;
  overflow-y:auto;
  background:#fff;
  border:1px solid #ddd;
  border-radius:0;
  box-shadow:0 12px 30px rgba(0,0,0,.18);
}
.rvep-autocomplete button{
  display:block!important;
  width:100%!important;
  min-height:0!important;
  margin:0!important;
  padding:10px 11px!important;
  border:0!important;
  border-bottom:1px solid #eee!important;
  border-radius:0!important;
  background:#fff!important;
  color:#111!important;
  text-align:left!important;
  box-shadow:none!important;
  transform:none!important;
}
.rvep-autocomplete button:last-child{border-bottom:0!important}
.rvep-autocomplete button:hover,.rvep-autocomplete button.active{background:#eef5f1!important}
.rvep-autocomplete strong{display:block;font-size:14px;line-height:1.25;color:var(--green)}
.rvep-autocomplete small{display:block;margin-top:2px;font-size:12px;line-height:1.3;color:#666;font-weight:500;white-space:normal}

.rvep-results[hidden],.rvep-route-choices[hidden],[hidden]{display:none!important}

@media(max-width:760px){
  .rvep-grid{grid-template-columns:1fr}
  .rvep-stats{grid-template-columns:repeat(3,1fr)}
  .rvep-choice-list{display:grid;grid-template-columns:1fr}
}

@media(max-width:520px){
  .rvep-app{margin-bottom:0;box-shadow:none}
  .rvep-hero{height:45px;min-height:45px;box-sizing:border-box;padding:5px 7px}
  .rvep-hero h2{font-size:17px}
  .rvep-hero p{font-size:9px;margin-top:2px}
  .rvep-form{padding:7px;gap:6px}
  .rvep-form label{font-size:12px}
  .rvep-form input{font-size:16px!important;padding:8px 36px 8px 7px}
  .rvep-form button{font-size:13px;padding:8px 9px}
  .rvep-form .rvep-swap:after{font-size:13px}
  .rvep-status{font-size:13px}
  .rvep-map{height:59vh;min-height:405px;max-height:none}
  .rvep-map-location-control{margin:0 8px 8px 0}
  .rvep-my-location{padding:9px 10px;font-size:13px}
  .rvep-choice-heading{flex-direction:column;gap:2px}
  .rvep-choice-top{flex-direction:row;gap:8px}
  .rvep-choice-badges{justify-content:flex-end;max-width:48%}
  .rvep-choice-name{font-size:14px;line-height:1.25}
  .rvep-compare-summary{align-items:flex-start}
  .rvep-result-heading{align-items:flex-start;flex-direction:column}
  .rvep-stats{grid-template-columns:1fr 1fr}
  .rvep-table>div{flex-direction:column;gap:2px}
  .rvep-autocomplete{position:absolute;top:calc(100% + 4px);max-height:260px}
  .rvep-autocomplete button{padding:11px!important}
  .rvep-clear-place{right:4px;width:30px!important;height:30px!important;font-size:24px!important}
}
