
:root{
  --ink:#17202a;
  --muted:#5f6b76;
  --paper:#f7f4ee;
  --panel:#F4F6E4; /* was #ffffff */
  --line:#d8d3c8;
  --strict:#173b2d;
  --broad:#9a6a32;
  --all:#355c7d;
  --timeline:#14261e;
}
*{box-sizing:border-box}
html,body{
  height:100%;margin:0;
  font-family:system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
  color:var(--ink);background:var(--paper)
}
body{display:grid;grid-template-rows:auto 1fr}

/* header layout */
header {
  padding: 14px 20px;
  background: #14261e;
  color: white;
  display: flex;
  gap: 18px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 14px; /* Space between the image and the title/subtitle */
}

header h1 {
  font-size: 20px;
  margin: 0;
}

header .sub {
  font-size: 12px;
  opacity: .78;
}

.metrics {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.metric {
  font-size: 12px;
  line-height: 1.15;
}

.metric strong {
  display: block;
  font-size: 17px;
}

.about-guide-btn{
  appearance:none;
  -webkit-appearance:none;
  display:inline-block;
  padding:4px 7px;
  border:1px solid rgba(255,255,255,.22);
  border-radius:4px;
  background:#c7d0c8;
  color:#29493c;
  font-family:inherit;
  font-size:10px !important;
  font-weight:600;
  line-height:1.05;
  text-align:center;
  text-decoration:none;
  white-space:nowrap;
  cursor:pointer;
  box-shadow:none;
}

.about-guide-btn:hover,
.about-guide-btn:focus{
  background:#d3dad4;
  color:#203d32;
  border-color:rgba(255,255,255,.34);
  outline:none;
}
#modal-splash {
  z-index: 999;
}
/* end header layout */

.app{
  display:grid;
  grid-template-columns:minmax(0,1fr) 390px;
  min-height:0
}
.map-wrap{position:relative;min-width:0;min-height:0}
#map{height:100%;min-height:600px;background:#d7e2dc}

.sidebar{
  background:var(--panel);border-left:1px solid var(--line);
  display:flex;flex-direction:column;min-height:0
}
.controls{
  padding:14px;border-bottom:1px solid var(--line);
  display:grid;gap:12px
}
.controls label{font-size:12px;font-weight:700;color:var(--muted)}
select,input[type="search"]{
  width:100%;padding:9px 10px;border:1px solid #c9c3b8;
  border-radius:7px;background:white;font:inherit
}
.note{font-size:12px;color:var(--muted);line-height:1.4}
.warning-note{border-left:3px solid #b78a4b;padding-left:9px}
.layer-summary{font-size:12px;line-height:1.45;margin-top:6px;color:#34423b}
.layer-about{
  font-size:12px;margin-top:7px;border:1px solid #e2ddd3;
  border-radius:7px;background:#fbfaf7
}
.layer-about summary{
  cursor:pointer;padding:8px 10px;font-weight:700;color:#425047
}
.layer-about>div{padding:0 10px 10px;line-height:1.45;color:var(--muted)}

#panel{padding:14px;overflow:auto;flex:1;border-top: .75px solid #768526; box-shadow: inset 0 20px 30px -15px rgba(153, 168, 52, 0.9);}
.panel-title{font-size:19px;margin:0 0 5px}
.kicker{
  font-size:11px;text-transform:uppercase;letter-spacing:.08em;
  color:var(--muted);font-weight:700
}
.holder-list{display:grid;gap:7px;margin-top:12px}
.holder{
  border:1px solid var(--line);border-radius:8px;padding:10px;
  background:#fff;cursor:pointer
}
.holder:hover{border-color:#94866f;background:#fbfaf7}
.holder .name{font-weight:750}
.holder .aliases{font-size:11px;color:#725b3f;margin-top:2px}
.holder .meta{font-size:12px;color:var(--muted);margin-top:3px}
.badge{
  display:inline-block;padding:2px 6px;border-radius:999px;
  font-size:10px;font-weight:700;margin-top:5px
}
.badge.strict{background:#d9e8df;color:#173b2d}
.badge.broad{background:#f0e4d5;color:#6a431b}
.stat-grid{
  display:grid;grid-template-columns:1fr 1fr;gap:8px;margin:12px 0
}
.stat{
  padding:9px;border:1px solid var(--line);
  border-radius:7px;background:#fbfaf7
}
.stat small{display:block;color:var(--muted)}
.stat strong{font-size:16px}
.section{margin-top:16px}
.section h3{
  font-size:13px;text-transform:uppercase;letter-spacing:.05em;
  margin:0 0 7px;color:var(--muted)
}
.row{
  padding:7px 0;border-top:1px solid #eee8de;
  font-size:13px;line-height:1.4
}
.row:first-child{border-top:0}
a{color:#315f4a}

.legend{
  background:white;padding:8px 10px;border-radius:6px;
  box-shadow:0 1px 5px #0002;font-size:12px;
  line-height:1.4;max-width:235px
}
.leaflet-top.leaflet-right .legend{
  margin-top:10px;
  margin-right:10px;
}
.legend i{
  display:inline-block;width:10px;height:10px;
  border-radius:50%;margin-right:5px
}

.timeline-shell{
  position:absolute;z-index:800;left:16px;right:16px;bottom:16px;
  background:rgba(20,38,30,.94);color:#fff;
  border:1px solid rgba(255,255,255,.16);
  border-radius:10px;padding:9px 10px 8px;
  box-shadow:0 2px 16px #0004;
  backdrop-filter:blur(4px)
}
.timeline-head{
  display:flex;justify-content:space-between;gap:12px;
  align-items:center;margin-bottom:7px;font-size:12px
}
.timeline-head strong{display:block}
.timeline-head span{display:block;opacity:.72;font-size:11px;margin-top:1px}
.opacity-control{
  display:flex;align-items:center;gap:7px;
  font-size:11px;white-space:nowrap
}
.opacity-control input{width:90px}
.timeline{
  display:flex;gap:6px;overflow-x:auto;
  padding:1px 0 3px;scrollbar-width:thin
}
.timeline button{
  flex:0 0 auto;border:1px solid rgba(255,255,255,.32);
  background:rgba(255,255,255,.08);color:#fff;
  border-radius:999px;padding:6px 10px;
  font-size:11px;cursor:pointer
}
.timeline button:hover{background:rgba(255,255,255,.18)}
.timeline button.active{
  background:#fff;color:#173127;border-color:#fff;font-weight:800
}
.timeline button.data-period::after{
  content:"1754";font-size:8px;margin-left:5px;
  vertical-align:super;color:#9a6a32
}

.version-footer{
  border-top:1px solid var(--line);padding:9px 12px;
  display:flex;justify-content:space-between;gap:10px;
  font-size:11px;color:var(--muted)
}
.version-footer a{white-space:nowrap}

@media(max-width:850px){
  body{display:block}
  .app{
    display:grid;grid-template-columns:1fr;
    grid-template-rows:60vh auto
  }
  .sidebar{border-left:0;border-top:1px solid var(--line)}
  #map{min-height:0}
  .timeline-shell{left:8px;right:8px;bottom:8px}
  .timeline-head{align-items:flex-start}
  .timeline-head span{display:none}
  .opacity-control input{width:70px}
}

@media(max-width:600px){
  .legend{
    max-width:190px;
    font-size:11px;
  }
}


/* v0-7 property pilot layer */
.property-control{
  padding-top:2px;
}
.property-toggle{
  display:flex;
  align-items:center;
  gap:8px;
  color:var(--ink)!important;
  font-size:13px!important;
  cursor:pointer;
}
.property-toggle input{
  width:auto;
  margin:0;
}
.property-pin-wrap{
  background:transparent;
  border:0;
}
.property-pin{
  display:block;
  font-size:20px;
  line-height:20px;
  text-shadow:0 1px 2px rgba(255,255,255,.95), 0 0 2px rgba(255,255,255,.95);
  transform:translate(-1px,-1px);
}
.property-pin.high{color:#6b2037}
.property-pin.approximate{color:#c36b16}
.property-confidence{
  display:inline-block;
  padding:2px 6px;
  border-radius:999px;
  font-size:10px;
  font-weight:700;
  margin-top:5px;
}
.property-confidence.high{
  background:#eadce1;
  color:#642039;
}
.property-confidence.approximate{
  background:#f5e5d5;
  color:#8a4c0f;
}
.property-source-note{
  font-size:11px;
  color:var(--muted);
  margin-top:3px;
}

/* v0-8 sidebar space fix
   Keeps both search boxes visible near the top and caps the controls area
   so the results panel always has usable vertical space on desktop. */
@media (min-width:851px){
  .sidebar{
    overflow:hidden;
  }

  /* Fixed desktop split:
     controls keep their own scroll and always occupy the same height;
     results/detail keeps its own scroll and receives the larger share. */
  .controls{
    flex:0 0 27.5%;
    height:27.5%;
    max-height:27.5%;
    min-height:0;
    overflow-y:auto;
    overscroll-behavior:contain;
    scrollbar-width:thin;
    padding:10px 12px;
    gap:9px;
    background:#fff; /* top panel */
  }

  /* Put the two primary search controls first within the controls pane. */
  .controls > div:has(#holderSearch){
    order:-2;
  }

  .controls > div:has(#propertySearch){
    order:-1;
  }

  #panel{
    flex:1 1 0;
    min-height:0;
    overflow:auto;
    padding:12px 14px;
  }
}



/* v0-26f Forced Arrivals layer */
.forced-arrivals-control{padding-top:2px}
.fa-legend-dot{display:inline-block;width:11px;height:11px;border-radius:50%;margin-right:5px;background:#0b6a75;border:2px solid #f7f4ee;vertical-align:-1px}
.fa-place-row{width:100%;display:flex;justify-content:space-between;gap:12px;align-items:flex-start;text-align:left;padding:9px 10px;margin:0 0 6px;border:1px solid var(--line);border-radius:7px;background:#fff;color:var(--ink);font:inherit;cursor:pointer}
.fa-place-row:hover,.fa-place-row:focus{border-color:#0b6a75;background:#f4faf9;outline:none}
.fa-place-row span:last-child{text-align:right;white-space:nowrap}
.fa-place-row small{display:block;margin-top:2px;color:var(--muted);font-size:11px;font-weight:400}
.fa-back{appearance:none;border:0;background:none;color:#315f4a;padding:0;margin:0 0 10px;font:inherit;font-weight:700;cursor:pointer}
.fa-back:hover,.fa-back:focus{text-decoration:underline;outline:none}
.fa-year-grid{border:1px solid var(--line);border-radius:7px;overflow:hidden;background:#fff}
.fa-year-row{display:flex;justify-content:space-between;gap:12px;padding:7px 9px;border-top:1px solid #eee8de;font-size:12px}
.fa-year-row:first-child{border-top:0}
.fa-year-row span{color:var(--muted);text-align:right}
.fa-voyage-row{font-size:12px}


/* FA004a forced-arrival load status */
.fa-status{font-weight:700;color:#315f4a;margin-top:3px}
.fa-status.fa-status-error{color:#9d2c2c}
