:root{
  --bg:#0D0D0D;
  --surface:#121212;
  --surface2:#161616;
  --text:#EAEAEA;
  --muted:#AFAFAF;
  --gold:#B08D57; /* muted bronze */
  --gold2:#8C6A3D;
  --bad:#ff5c7a;
  --shadow: 0 16px 40px rgba(0,0,0,.45);
  --r: 18px;
  --r2: 24px;
  --topbar-h: calc(max(12px, env(safe-area-inset-top, 0px)) + 49px);
}

*{box-sizing:border-box}
html,body{height:100%; background:var(--bg)}
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
  /* cohesive premium dark base (no extra layers) */
  background: var(--bg);
  color:var(--text);
  -webkit-font-smoothing: antialiased;
}

.topbar{
  position:fixed; top:0; left:0; right:0; z-index:999;
  padding: max(12px, env(safe-area-inset-top)) 16px 12px;
  display:flex; align-items:center; justify-content:space-between;
  background: #111;
  border-bottom:1px solid rgba(255,255,255,.06);
}
.brand-title{font-weight:800; letter-spacing:.2px}
.brand-sub{font-size:12px; color:var(--muted); margin-top:2px}

.iconbtn{
  outline: none;
  -webkit-tap-highlight-color: transparent;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 6px;
  color: #fff;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 14px;
}
.iconbtn:focus{
  outline: none;
  box-shadow: none;
  border-color: rgba(255,255,255,0.2);
}
.iconbtn:focus-visible{
  outline: none;
  box-shadow: none;
}
.icon{font-size:22px; line-height:1}

.chip{
  border:1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.03);
  color: var(--text);
  border-radius: 999px;
  padding:10px 12px;
  font-weight:850;
  font-size:12px;
  max-width: 170px;
  overflow:hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chip.on{border-color: rgba(176,141,87,.40); background: rgba(176,141,87,.10)}

.app{padding: calc(var(--topbar-h) + 14px) 14px 92px 14px; transition: opacity .18s ease}
body.view-detail .app{padding-top: 0}
body.loading .app{opacity:0}
body.loading .bottomnav{opacity:0}


.hero{
  position:relative;
  border-radius: var(--r2);
  padding:16px 18px;
  overflow:hidden;

  /* make hero feel like a true top section */
  min-height: 168px;
  display:flex;
  flex-direction:column;
  align-items:stretch;
  justify-content:flex-end;
  padding-bottom: 22px;

  /* hero background image (top section only) */
  background-image: url('/assets/hero-bg.jpg');
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
}

/* overlay to keep the background subtle + readable */
.hero::before{
  content:"";
  position:absolute; inset:0;
  background: linear-gradient(
    to bottom,
    rgba(0,0,0,0.35) 0%,
    rgba(0,0,0,0.55) 50%,
    rgba(0,0,0,0.78) 100%
  );
  pointer-events:none;
}

.hero > *{ position:relative; }

.cta{
  width:100%;
  border:0;
  border-radius: 22px;
  padding: 14px 16px; /* slightly reduced height */
  font-weight:900;
  font-size:18px;
  letter-spacing:.2px;
  color:#0B0B0B;
  background: #C8A96A;
  display:flex;
  gap:10px;
  align-items:center;
  justify-content:center;
}
.ctaPlus{font-size:20px; line-height:1; font-weight:900}

.section{margin-top:16px}
.section-head{display:flex; align-items:baseline; justify-content:space-between; margin: 6px 2px 10px 2px}
.section-title{font-weight:900; letter-spacing:.2px}
.link{border:0; background:transparent; color:var(--gold); font-weight:800}

.hscroll{
  display:flex; gap:12px;
  overflow-x:auto;
  padding-bottom:6px;
  scroll-snap-type:x mandatory;
}
.cardmini{
  scroll-snap-align:start;
  min-width: 180px;
  border:1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.03);
  border-radius: 6px;
  overflow:hidden;
  padding:0;
}
.thumb{ width:100%; aspect-ratio:3/2; background:rgba(255,255,255,.04); display:block; background-size:cover; background-position:center; background-repeat:no-repeat; margin:0; padding:0; border-radius:6px 6px 0 0; }
.cardmini .thumb{ width:100%; aspect-ratio:3/2; background-size:cover; background-position:center; background-repeat:no-repeat; border-radius:6px 6px 0 0; margin:0; display:block; }
.thumbImg,
.heroimgTag,
.previewImg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.thumbEmpty,
.heroimgEmpty {
  background: rgba(255,255,255,.04);
}
.cardmini .meta{padding:10px}
.starsline{color: var(--gold); letter-spacing: 1px; font-size: 14px}
.ratingTap{color: var(--gold)}
.subline{font-size:12px; color:var(--muted); margin-top:4px}

.list{display:flex; flex-direction:column; gap:10px}

.emptyCard{
  display:flex;
  gap:14px;
  align-items:center;
  padding:14px;
  border-radius: 6px;
  background: rgba(255,255,255,.03);
  border:1px solid rgba(255,255,255,.08);
  width: 100%;
  box-sizing: border-box;
  margin-left: 0;
  margin-right: 0;
}
.emptyIcon{
  width:44px; height:44px;
  border-radius: 6px;
  display:grid; place-items:center;
  background: rgba(200,169,106,.10);
  border:1px solid rgba(200,169,106,.25);
  color:#C8A96A;
}
.emptyIcon svg{width:22px; height:22px; stroke: currentColor}
.emptyTitle{font-weight:950; letter-spacing:.2px}
.emptySub{margin-top:4px; font-size:12px; color: var(--muted); line-height:1.35}

.emptyCenter{
  padding:16px;
  border-radius: 6px;
  background: rgba(255,255,255,.03);
  border:1px solid rgba(255,255,255,.08);
  color: var(--muted);
  font-size:13px;
  text-align:center;
}

.insightsRow{display:flex; gap:10px}
.insightCard{
  flex:1;
  padding:12px;
  border-radius: 6px;
  background: #1C1C1E;
  display:flex;
  gap:10px;
  align-items:center;
}
.insightIcon{width:28px; display:grid; place-items:center; color:#C8A96A}
.insightIcon svg{width:18px; height:18px; stroke: currentColor}
.insightText{font-size:12px; color: var(--muted); line-height:1.2}

.rowitem{
  display:flex; gap:12px; align-items:center; justify-content:space-between;
  border:1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.03);
  border-radius: 6px;
  padding:10px;
}
.rowitem .band{width:68px; height:68px; border-radius: 6px; background: rgba(255,255,255,.04); background-size:cover; background-position:center; flex:0 0 68px}
.rowitem .rowMid{flex:1; min-width:0; display:flex; flex-direction:column; justify-content:center; gap:2px}
.rowitem .rowBrand{font-size:12px; color:var(--gold); font-weight:700; overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
.rowitem .rowName{font-size:12px; color:#ddd; font-weight:400; overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
.rowitem .rowCountry{font-size:11px; color:var(--muted); overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
.rowitem .rowRight{display:flex; flex-direction:column; justify-content:center; align-items:flex-end; gap:2px; flex-shrink:0}
.rowitem .rowStars{color:var(--gold); font-size:13px; letter-spacing:1px}
.rowitem .rowStrength{font-size:11px; color:var(--muted); text-transform:uppercase; font-weight:700}
.rowitem .rowDate{font-size:11px; color:var(--muted)}

.statsmini{
  padding:0;
  border:0;
  background: transparent;
}
/* legacy stat tiles (unused on home after Quick Insights redesign) */
.stat{display:none}
.stat .v{font-size:18px; font-weight:900; margin-top:4px}

.bottomnav{
  position:fixed; left:0; right:0; bottom:0;
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
  display:flex; gap:10px;
  background: rgba(11,11,11,.74);
  backdrop-filter: blur(10px);
  border-top:1px solid rgba(255,255,255,.06);
  z-index: 1000;
}
.navbtn{
  flex:1;
  border:1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.03);
  color:var(--text);
  border-radius: 16px;
  padding:12px 10px;
  font-weight:850;
}
.navbtn.active{border-color: rgba(176,141,87,.40); background: rgba(176,141,87,.10)}

.viewhead{
  display:grid;
  grid-template-columns: minmax(70px, auto) minmax(0, 1fr) minmax(70px, auto);
  align-items:center;
  gap:8px;
  margin-bottom:10px;
}
.detailhead{position:relative}
.overflowMenu{
  position:absolute;
  top:56px;
  right:0;
  width: 180px;
  border-radius: 6px;
  border:1px solid rgba(255,255,255,.10);
  background:#151515;
  box-shadow: var(--shadow);
  padding:6px;
  z-index:50;
}
.menuItem{
  width:100%;
  text-align:left;
  padding:12px 12px;
  border-radius: 6px;
  border:0;
  background: transparent;
  color: var(--text);
  font-weight:850;
}
.menuItem:hover{background: rgba(255,255,255,.04)}
.dangerItem{color:#ff8aa0}
.back{
  border:1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.03);
  color:var(--text);
  border-radius: 14px;
  padding:10px 10px;
  font-weight:850;
}
.viewtitle{font-weight:900; text-align:center; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;}

.grid{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap:10px;
}
.tile{
  border:1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.03);
  border-radius: 6px;
  overflow:hidden;
  display:flex;
  flex-direction:column;
  padding:0;
  margin:0;
}
.tile .tilePhoto{
  width:100%;
  aspect-ratio:3/2;
  background:rgba(255,255,255,.04);
  background-size:cover;
  background-position:center;
  background-repeat:no-repeat;
  display:block;
  flex-shrink:0;
  margin:0;
  padding:0;
}
.tile .tilePhoto img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
  margin:0;
  padding:0;
}
.tile .tileBar{
  background:rgba(10,10,10,.88);
  padding:6px 8px 7px;
  display:flex;
  flex-direction:column;
  gap:1px;
  margin:0;
}
.tile .tileBarName{
  font-size:11px;
  font-weight:700;
  color:#e0e0e0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  line-height:1.2;
}
.tile .tileBarStars{
  font-size:11px;
  color:#B08D57;
  letter-spacing:.5px;
  line-height:1.2;
}

.detail{
  border:1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.03);
  border-radius: 6px;
  overflow:hidden;
}
.detail .heroimg{height:260px; background: rgba(255,255,255,.04); background-size:cover; background-position:center}
.detail .body{padding:14px}
.detail .pill{
  display:inline-flex; gap:8px; align-items:center;
  padding:8px 10px;
  border-radius: 999px;
  background: rgba(176,141,87,.10);
  border:1px solid rgba(176,141,87,.22);
  color: var(--text);
  font-weight:850;
  font-size:12px;
}
.detail .muted{color:var(--muted); font-size:12px; margin-top:10px; line-height:1.5}

/* Detail compact layout (fixed-feel, no wrapping) */
.detailCompact{display:flex; flex-direction:column; gap:8px}
.detailRow{line-height:1.2}
.detailFacts{font-weight:900; font-size:13px}
.detailDecisions{font-size:12px; color: var(--muted)}
.detailTags{display:flex; gap:6px; overflow:hidden; white-space:nowrap}
.tagPill{
  flex:0 0 auto;
  max-width: 140px;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  background: rgba(201,168,76,0.15);
  color: #c9a84c;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 12px;
  border: 1px solid rgba(201,168,76,0.3);
}
.detailNote{
  font-size:12px;
  color: var(--muted);
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.detailNote.empty{opacity:0}
.detailDate{font-size:11px; color: rgba(255,255,255,.55)}

.detail .actionLink{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:100%;
  margin-top:12px;
  padding:12px 14px;
  border-radius: 6px;
  border:1px solid rgba(200,169,106,.30);
  background: rgba(200,169,106,.10);
  color:#C8A96A;
  font-weight:900;
  text-decoration:none;
}

.danger{border:1px solid rgba(255,92,122,.40); background: rgba(255,92,122,.14); color:var(--text); padding:10px 10px; border-radius: 6px; font-weight:850}

.dlg button:focus,
.dlg button:focus-visible,
dialog button:focus,
dialog button:focus-visible {
  outline: none;
  box-shadow: none;
  -webkit-tap-highlight-color: transparent;
}

/* Dialog */
.dlg{
  width: min(520px, calc(100% - 20px));
  border:1px solid rgba(255,255,255,.10);
  border-radius: 6px;
  background: rgba(16,16,16,.96);
  color: var(--text);
  box-shadow: var(--shadow);
}
.dlg::backdrop{background: rgba(0,0,0,.55)}
.dlgform{display:flex; flex-direction:column}
.dlghead{display:flex; align-items:center; justify-content:space-between; padding:14px 14px 10px 14px}
.dlgtitle{font-weight:900}
.dlgfoot{display:flex; gap:10px; padding:12px 14px 14px 14px}

/* Rating breakdown modal */
.ratingModal{background:#151515}
.ratingModal::backdrop{background: rgba(0,0,0,.43); backdrop-filter: blur(4px)}
.divider{height:1px; background: rgba(255,255,255,.06); margin:0 14px}
.ratingRows{display:flex; flex-direction:column; gap:12px; padding:0 2px}
.ratingRow{display:flex; align-items:center; justify-content:space-between; gap:12px}
.ratingLabel{font-weight:850; letter-spacing:.2px}
.ratingStars{display:flex; gap:4px; color:#C8A96A}
.ratingStars button{border:0; background:transparent; padding:0; color:inherit; font-size:16px; line-height:1}
.ratingStars .off{opacity:.28}
.ratingOverall{margin-top:12px; padding-top:12px; border-top:1px solid rgba(255,255,255,.06)}
.ratingMeta{margin-top:10px; color:var(--muted); font-size:12px; line-height:1.5}
.primary{
  flex:1;
  border:0;
  border-radius: 18px;
  padding:14px 12px;
  font-weight:900;
  background: linear-gradient(135deg, var(--gold), #d3b27c);
  color:#0B0B0B;
}
.ghost{
  flex:1;
  border:1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.03);
  color:var(--text);
  border-radius: 18px;
  padding:14px 12px;
  font-weight:900;
}

/* Bottom sheet (detail actions) */
.sheetBackdrop{
  position:fixed;
  inset:0;
  background: rgba(0,0,0,.60);
  display:flex;
  align-items:flex-end;
  justify-content:center;
  z-index:9998;
}
.sheetBackdrop[hidden]{display:none}
.actionSheet{
  width: min(560px, 100%);
  background:#121212;
  border-radius: 24px 24px 0 0;
  box-shadow: var(--shadow);
  padding: 10px 14px 18px 14px;
  transform: translateY(110%);
  transition: transform .22s ease;
}
.sheetBackdrop.open .actionSheet{transform: translateY(0)}
.sheetHandle{
  width: 46px;
  height: 5px;
  border-radius: 999px;
  background: rgba(255,255,255,.12);
  margin: 4px auto 12px auto;
}
.sheetItem{
  width:100%;
  height:56px;
  border-radius: 6px;
  border:1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.02);
  color: var(--text);
  font-weight:900;
  text-align:left;
  padding: 0 16px;
  margin-top:10px;
}
.sheetDelete{color: rgba(255, 138, 160, .92)}
.sheetCancel{color: rgba(255,255,255,.78)}

.cameraWrap{padding:0 14px 10px 14px}
.video,.canvas,.photo{
  width:100%;
  aspect-ratio: 3/2;
  border-radius: 6px;
  background: rgba(255,255,255,.04);
  overflow:hidden;
}
.camControls{display:flex; gap:10px; margin-top:10px}
.camControls .ghost{border-radius: 6px}
.cap{flex:1; border:0; border-radius: 6px; padding:14px; font-weight:900; background: rgba(255,255,255,.06); color:var(--text)}

.quick{padding: 3px 14px 7px 14px; display:flex; flex-direction:column; gap:8px}
.row{display:flex; justify-content:space-between; align-items:center; gap:12px}
.label{font-size:12px; color:var(--muted); font-weight:850}
.field input{
  width:100%;
  margin-top:8px;
  border:1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.03);
  color: var(--text);
  border-radius: 6px;
  padding:12px 12px;
  outline:none;
  font-size:16px; /* prevent iOS Safari auto-zoom */
}

.req{color:#ff5c7a; font-weight:900; font-size:12px}
.validation{min-height:16px; font-size:12px; color: var(--muted); margin-top:-6px}
.validation.error{color:#ff8aa0}

.details{border:0; margin:4px 0}
.details > summary{list-style:none; cursor:pointer; color: var(--gold); font-weight:850; font-size:13px}
.details > summary::-webkit-details-marker{display:none}
.details-body{margin-top:10px; display:flex; flex-direction:column; gap:12px}

.chips{display:flex; flex-wrap:wrap; gap:8px; margin-top:10px}
.chipTag{border:1px solid rgba(255,255,255,.10); background: rgba(255,255,255,.03); color: var(--text); padding:8px 10px; border-radius:999px; font-size:12px; font-weight:850}
.chipTag button{border:0; background:transparent; color:var(--muted); margin-left:6px; font-weight:900}

.select{border:1px solid rgba(255,255,255,.10); background: rgba(255,255,255,.03); color: var(--text); border-radius: 6px; padding:10px 10px; font-weight:850; font-size:14px}

.optionGrid{display:flex; flex-wrap:wrap; gap:6px; margin-top:7px}
.opt { background: rgba(255,255,255,0.06); color: #888; border: 1px solid rgba(255,255,255,0.08); border-radius: 6px; padding: 6px 12px; font-size: 13px; cursor: pointer; }
.opt.on { background: rgba(201,168,76,0.3); color: #c9a84c; border: 1.5px solid #c9a84c; font-weight: 700; }

.stars{display:flex; gap:8px}
.starbtn{
  width:36px; height:36px;
  border-radius: 6px;
  border:1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.03);
  color: var(--gold);
  font-size:18px;
}

.seg{display:flex; gap:8px}
.segbtn { background: rgba(255,255,255,0.06); color: #888; border: 1px solid rgba(255,255,255,0.08); border-radius: 6px; padding: 6px 16px; font-size: 13px; cursor: pointer; }
.segbtn.active { background: rgba(201,168,76,0.3); color: #c9a84c; border: 1.5px solid #c9a84c; font-weight: 700; }

.toggle{
  border:1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.03);
  color:var(--text);
  padding:10px 12px;
  border-radius: 6px;
  font-weight:900;
  min-width: 90px;
}
.toggle.on{border-color: rgba(176,141,87,.40); background: rgba(176,141,87,.10)}

/* Splash */
.splash{
  position:fixed; inset:0;
  background: var(--bg);
  display:grid; place-items:center;
  z-index:9999;
  transition: opacity .35s ease, transform .35s ease;
}
.splash[hidden]{display:none}
.splash-inner{display:flex; flex-direction:column; align-items:center; justify-content:center; text-align:center; margin-top:-80px}
.splash-mark{font-size:44px; font-weight:900; letter-spacing:.6px}
.splash-tag{margin-top:8px; color:var(--muted)}


.kpiGrid2{
  display:grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px 12px;
  margin: 2px 0 1px 0;
}

.statsHero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  border-radius: 10px;
  padding: 16px 20px;
  margin-bottom: 8px;
}
.statsHeroNum { font-size: 42px; font-weight: 700; color: #c9a84c; line-height: 1; }
.statsHeroText { text-align: right; }
.statsHeroLabel { font-size: 11px; color: #888; text-transform: uppercase; letter-spacing: 0.8px; }
.statsHeroSub { font-size: 13px; color: #ddd; margin-top: 4px; }

.statsMiniRow {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 8px;
}
.statsMiniCard {
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  border-radius: 10px;
  padding: 12px;
}
.statsMiniValue { font-size: 20px; font-weight: 700; color: #c9a84c; line-height: 1; margin-bottom: 3px; }
.statsMiniValueMuted { font-size: 13px; color: #888; font-weight: 500; }
.statsMiniLabel { font-size: 10px; color: #888; text-transform: uppercase; letter-spacing: 0.8px; }
.kpiCard{
  border:1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.03);
  border-radius: 6px;
  padding:12px 32px 12px 12px;
  display:flex;
  gap:12px;
  align-items:center;
  min-width: 0;
  position: relative;
}
.bubble{
  width:52px;
  height:52px;
  flex: 0 0 52px;
  aspect-ratio: 1 / 1;
  border-radius: 999px;
  background: rgba(255,255,255,.04);
  display:grid;
  place-items:center;
  font-weight:950;
  font-size:16px;
  line-height:1;
  color: var(--gold);
  letter-spacing:.2px;
  overflow:hidden;
}
.kpiTitle2{font-weight:900; font-size:13px}
.kpiSub2{font-size:12px; color: var(--muted); margin-top:2px}

.barSection{margin-top:0}
#statsSectionsWrap{display:flex; flex-direction:column; gap:0}
.barTitle{font-weight:900; letter-spacing:.2px; margin: 6px 2px 8px 2px}
.barRow{width:100%; display:grid; grid-template-columns: 120px 1fr 26px; gap:10px; align-items:center; border:0; background: transparent; padding:8px 2px; color: var(--text); text-align:left}
.barLabel{font-size:12px; color: var(--muted); overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
.barSection[data-section-id="strength"] .barLabel{text-transform:capitalize}
.barTrack{height:10px; border-radius:999px; background: rgba(255,255,255,.06); overflow:hidden}
.barFill{height:100%; background: rgba(176,141,87,.55)}
.barValue{font-size:12px; color: var(--muted); text-align:right}
.barRow[hidden]{display:none}
.barHint{font-size:11px; color: var(--muted); margin: 6px 2px 0 2px}

.collapsibleSection { margin: 8px 0; border: 1px solid rgba(255,255,255,0.08); border-radius: 6px; overflow: hidden; }
.collapsibleHeader { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; cursor: pointer; min-height: 48px; }
.collapsibleLabel { font-size: 14px; color: #c9a84c; font-weight: 600; }
.collapsibleToggle { background: transparent; border: none; color: #c9a84c; font-size: 18px; cursor: pointer; padding: 0; line-height: 1; transition: transform 0.2s ease; }
.collapsibleToggle .chevron { display:inline-block; width:10px; height:10px; border-right:2px solid #c9a84c; border-bottom:2px solid #c9a84c; transform:rotate(45deg); transition:transform .2s ease; }
.collapsibleToggle.open .chevron { transform:rotate(-135deg); }
.collapsibleToggle.open { transform: rotate(180deg); transition: transform 0.2s ease; }
.collapsibleBody { padding: 10px 14px 14px; }
.collapsibleBody[hidden] { display: none; }

.collViewBtn { width: 36px; height: 36px; background: none; border: none; color: #555; cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 0; -webkit-tap-highlight-color: transparent; }
.collViewBtn.active { color: #c9a84c; }
.filterBtn { background: transparent; border: none; cursor: pointer; font-size: 18px; color: #c9a84c; padding: 4px 8px; display:flex; align-items:center; }
.filterBtn path { fill: #c9a84c; stroke: #c9a84c; }
.filterBtn.active path { fill: #888; stroke: #888; }
.filterBackdrop { position:fixed; inset:0; background:rgba(0,0,0,.60); display:flex; align-items:flex-end; justify-content:center; z-index:9998; opacity:0; transition:opacity .22s ease; }
.filterBackdrop.open { opacity:1; }
.filterSheet { width:min(560px,100%); max-height:80vh; background:#121212; border-radius:24px 24px 0 0; box-shadow:var(--shadow); padding:10px 14px 18px; transform:translateY(110%); transition:transform .22s ease; display:flex; flex-direction:column; }
.filterBackdrop.open .filterSheet { transform:translateY(0); }
.filterBody { overflow-y:auto; flex:1; padding:4px 0; }
.filterGroup { margin-bottom:12px; }
.filterGroupTitle { font-size:11px; color:#888; text-transform:uppercase; letter-spacing:.05em; margin-bottom:6px; }
.filterChips { display:flex; flex-wrap:wrap; gap:6px; }

.collectionList { display: flex; flex-direction: column; gap: 12px; }

@media (min-width: 520px){
  .grid{grid-template-columns: repeat(4, 1fr)}
}

/* ── Detail screen ───────────────────────────────────────── */
/* Hide old header bar on detail view */
[data-view="detail"] .detailhead { display: none; }

.detailHeroWrap { position: relative; width: 100%; aspect-ratio: 3/2; overflow: hidden; border-radius: 6px 6px 0 0; }
.detailHeroWrap .heroimgTag { width: 100%; height: 100%; object-fit: cover; display: block; }
.detailHeroEmpty { background: #1a1a1a; }
.detailOverlayBack { position: absolute; top: 12px; left: 12px; background: rgba(0,0,0,0.55); border: none; border-radius: 20px; padding: 6px 14px; color: #fff; font-size: 13px; cursor: pointer; z-index: 10; }
.detailOverlayMenu { position: absolute; top: 12px; right: 12px; background: rgba(0,0,0,0.55); border: none; border-radius: 20px; padding: 6px 12px; color: #fff; font-size: 16px; cursor: pointer; z-index: 10; }

.detailRatingRow { text-align: center; padding: 6px 0 1px; font-size: 22px; color: #c9a84c; }
.detailRatingRow .ratingTap { color: #c9a84c; }
.detailDateLine { text-align: center; font-size: 12px; color: #888; margin-bottom: 1px; }
.detailDivider { height: 1px; background: rgba(255,255,255,0.08); margin: 4px 0; }
.detailSpecsGrid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 1px 0; }
.detailSpecItem { display: flex; flex-direction: column; gap: 1px; }
.detailSpecLabel { font-size: 11px; color: #888; text-transform: uppercase; letter-spacing: 0.05em; }
.detailSpecValue { font-size: 14px; color: #dddddd; font-weight: 500; }
.detailSectionLabel { font-size: 11px; color: #888; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 4px; }
.detailTagRow { display: flex; flex-wrap: wrap; gap: 4px; }
.tagPillCustom { background: rgba(201,168,76,0.15); color: #c9a84c; border-radius: 6px; }
.detailDecisionRow { display: flex; justify-content: space-between; align-items: center; padding: 2px 0; }
.detailDecisionLabel { font-size: 11px; color: #888; text-transform: uppercase; letter-spacing: 0.05em; }
.detailDecisionValue { font-size: 14px; font-weight: 600; }
.detailYes { color: #4caf7d; }
.detailNo { color: #e05c5c; }
.detailNoteText { font-size: 14px; color: #ccc; line-height: 1.5; padding: 2px 0; }

.statsEditBtn { border:1px solid rgba(255,255,255,.10); background:rgba(255,255,255,.03); color:var(--text); border-radius:6px; padding:10px 10px; font-weight:850; cursor:pointer; }
.statsDragHandle { display:none; color: #444; font-size: 16px; cursor: grab; padding: 4px 6px; transition: color 0.2s; }
.statsEditMode .statsDragHandle { display:block; color: #c9a84c; font-size: 20px; font-weight: 900; }
.statsEditMode .kpiCard { border: 1px solid rgba(201,168,76,0.3); cursor: grab; position: relative; }
.kpiCard .statsDragHandle { position: absolute; bottom: 8px; right: 6px; }
.barSection .statsDragHandle { margin-right: 2px; margin-bottom: 2px; }
.barSection { border: none; border-radius: 6px; padding: 8px; margin-bottom: 0; }
.statsEditMode .barSection { border: 1px solid rgba(201,168,76,0.3); cursor: grab; }
.statsDragging { opacity: 0.5; border-color: rgba(201,168,76,0.6); }
.statsDragOver { border: 1px dashed rgba(201,168,76,0.5); background: rgba(201,168,76,0.08); }
.aboutBody { display: flex; flex-direction: column; align-items: center; padding: 16px 20px; gap: 12px; }
.aboutLogo { font-size: 32px; font-weight: 800; color: #f0ece4; letter-spacing: 4px; }
.aboutVersion { font-size: 12px; color: #555; }
.aboutDivider { width: 100%; height: 1px; background: rgba(255,255,255,0.08); }
.aboutPhoto { width: 100%; height: 180px; border-radius: 6px; background: url('/assets/ryan_cigar.jpeg') right 40% / 140% no-repeat; }
.aboutQuote { font-size: 13px; color: #888; text-align: center; line-height: 1.7; font-style: italic; padding: 0 8px; }
.aboutCopyright { font-size: 11px; color: #444; }
.dateField {
  -webkit-appearance: none;
  appearance: none;
}
.dateField::-webkit-calendar-picker-indicator {
  filter: invert(1) opacity(0.5);
  cursor: pointer;
}
.star { font-size: inherit; }
.star-full { color: #c9a84c; }
.star-empty { color: #444; }
.star-half { position: relative; display: inline-block; }
.star-half-fill { color: #c9a84c; position: absolute; left: 0; top: 0; width: 50%; overflow: hidden; }
.star-half-empty { color: #444; }
.calendarSection { background: #1a1a1a; border-radius: 6px; padding: 16px 16px 4px 16px; margin-bottom: 0; }
.calendarHeader { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.calendarTitle { font-size: 15px; font-weight: 700; color: #fff; }
.calendarNav { background: transparent; border: none; color: #c9a84c; font-size: 18px; cursor: pointer; padding: 4px 8px; }
.calendarDay.hasCigars { cursor: pointer; }
.calendarGrid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.calendarDayHeader { text-align: center; font-size: 11px; color: #555; padding: 4px 0; }
.calendarDay { text-align: center; padding: 4px 2px; min-height: 36px; border-radius: 4px; position: relative; }
.calendarDay.today { background: rgba(255,255,255,0.06); }
.calendarDay.otherMonth { opacity: 0.3; }
.calendarDayNum { font-size: 12px; color: #ccc; }
.calendarDots { display: flex; justify-content: center; gap: 2px; margin-top: 2px; }
.calendarDot { width: 5px; height: 5px; border-radius: 50%; background: #c9a84c; }
.yearGrid { display: grid; grid-template-columns: repeat(53, 1fr); gap: 2px; }
.yearCell { width: 100%; aspect-ratio: 1; border-radius: 2px; background: #1a1a1a; }
.calToggleBtn { background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.08); border-radius: 6px; color: #888; font-size: 12px; padding: 4px 10px; cursor: pointer; }
.calToggleActive { background: rgba(201,168,76,0.3); border: 1.5px solid #c9a84c; color: #c9a84c; font-weight: 700; }

/* ── Map dialog ───────────────────────────────────────── */
.mapDlg { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); width: calc(100vw - 32px); max-width: 480px; height: 88vh; max-height: 640px; margin: 0; padding: 0; border: 1px solid rgba(255,255,255,0.1); border-radius: 12px; background: #111; overflow: hidden; }
.mapDlg::backdrop { background: rgba(0,0,0,0.6); }
.mapDlgInner { display: flex; flex-direction: column; width: 100%; height: 100%; overflow: hidden; }
.mapTopBar { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; background: #1a1a1a; flex-shrink: 0; }
.mapSearchRow { display: flex; gap: 8px; align-items: center; }
.mapSearchField { flex: 1; background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.12); border-radius: 6px; padding: 10px 12px; color: #fff; font-size: 16px; outline: none; -webkit-appearance: none; }
.mapSearchBtn { background: rgba(255,255,255,0.06); border: 1px solid #c9a84c; border-radius: 6px; padding: 0 12px; height: 42px; color: #c9a84c; font-size: 13px; font-weight: 700; cursor: pointer; white-space: nowrap; -webkit-tap-highlight-color: transparent; }
.mapToggleRow { display: flex; gap: 6px; align-items: center; }
.mapViewBtn { flex: 1; background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.12); border-radius: 6px; padding: 8px 0; color: #888; font-size: 12px; cursor: pointer; text-align: center; -webkit-tap-highlight-color: transparent; }
.mapViewBtn.active { color: #c9a84c; border-color: #c9a84c; background: rgba(201,168,76,0.12); font-weight: 700; }
.mapCloseBtn { background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.12); border-radius: 6px; width: 38px; height: 38px; display: flex; align-items: center; justify-content: center; color: #888; font-size: 16px; cursor: pointer; flex-shrink: 0; -webkit-tap-highlight-color: transparent; }
.mapArea { position: relative; flex: 1; min-height: 0; }
.mapPickerFill { position: absolute; inset: 0; }
.mapHint { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); background: rgba(0,0,0,0.7); border-radius: 20px; padding: 6px 14px; font-size: 12px; color: #aaa; pointer-events: none; z-index: 1000; }
.mapAutocomplete { position: absolute; top: 0; left: 12px; right: 12px; background: #1e1e1e; border: 1px solid #333; border-radius: 6px; max-height: 180px; overflow-y: auto; z-index: 1001; }
.mapAutocomplete[hidden] { display: none; }
.mapAcItem { padding: 10px 12px; font-size: 13px; color: #ccc; cursor: pointer; border-bottom: 1px solid rgba(255,255,255,0.06); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mapAcItem:last-child { border-bottom: none; }
.mapAcItem:active { background: rgba(201,168,76,0.15); }
.mapBottomBar { padding: 12px; background: #1a1a1a; flex-shrink: 0; }
.mapConfirmBtn { width: 100%; background: #c9a84c; border: none; border-radius: 6px; padding: 14px; color: #1a1100; font-size: 15px; font-weight: 700; cursor: pointer; }
.statsMapZoom { position: absolute; bottom: 12px; right: 12px; display: flex; flex-direction: column; gap: 4px; z-index: 1000; }
.statsMapZoomBtn { width: 36px; height: 36px; background: rgba(26,26,26,0.85); border: 1px solid #333; color: #c9a84c; font-size: 20px; border-radius: 6px; cursor: pointer; display: flex; align-items: center; justify-content: center; -webkit-tap-highlight-color: transparent; }

/* Detail screen map preview: trap Leaflet's internal z-index so it does not escape above the bottom nav */
[data-view="detail"] .detailMapWrap { position: relative; z-index: 0; isolation: isolate; }
[data-view="detail"] .detailMapWrap .leaflet-container { z-index: 0; }

/* ── Year bar chart ───────────────────────────────────── */
.yearBarChart { display: flex; justify-content: space-between; gap: 4px; padding: 8px 0 0 0; }
.yearBarCol { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.yearBarCount { font-size: 10px; color: #888; height: 14px; line-height: 14px; }
.yearBarTrack { width: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 80px; }
.yearBarFill { width: 70%; min-width: 8px; border-radius: 3px 3px 0 0; background: #c9a84c; }
.yearBarLabel { font-size: 10px; color: #888; margin-top: 4px; }

/* ── Age gate ─────────────────────────────────────────── */
.ageGate {
  position: fixed;
  inset: 0;
  z-index: 100000;
  background: #111;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(24px, env(safe-area-inset-top)) 24px max(24px, env(safe-area-inset-bottom));
  overflow-y: auto;
}
html.age-verified .ageGate { display: none !important; }
.ageGateInner {
  width: 100%;
  max-width: 420px;
  text-align: center;
  color: #EAEAEA;
}
.ageGateBrand {
  font-size: 56px;
  font-weight: 900;
  color: #c9a84c;
  letter-spacing: 0.6px;
  line-height: 1;
}
.ageGateBrandSub {
  font-size: 14px;
  color: #888;
  margin-top: 6px;
  letter-spacing: 0.3px;
}
.ageGateBody {
  margin-top: 36px;
  font-size: 15px;
  line-height: 1.6;
  color: #d8d8d8;
  padding: 0 4px;
}
.ageGateConfirm {
  display: block;
  width: 100%;
  margin-top: 32px;
  padding: 16px 18px;
  background: #c9a84c;
  color: #111;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.3px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 8px 24px rgba(201, 168, 76, 0.18);
}
.ageGateConfirm:active { transform: translateY(1px); }
.ageGateFine {
  margin-top: 14px;
  font-size: 12px;
  line-height: 1.5;
  color: #888;
  padding: 0 8px;
}
.ageGateUnder {
  display: block;
  margin: 22px auto 0;
  background: none;
  border: none;
  color: #888;
  font-size: 13px;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  padding: 6px 12px;
  -webkit-tap-highlight-color: transparent;
}
.ageGateBlocked {
  margin-top: 48px;
  padding: 0 4px;
}
.ageGateBlockedMsg {
  font-size: 16px;
  line-height: 1.6;
  color: #d8d8d8;
}

/* ── Profile footer links ─────────────────────────────── */
.profileLinkRow {
  display: flex;
  align-items: center;
  margin-top: 28px;
  padding: 0 8px;
}
.profileLink {
  flex: 1;
  background: none;
  border: none;
  font-size: 13px;
  text-align: center;
  cursor: pointer;
  padding: 6px 4px;
  text-decoration: underline;
  text-underline-offset: 3px;
  opacity: 0.85;
  -webkit-tap-highlight-color: transparent;
}
.profileLink:active { opacity: 0.6; }
.profileLinkDelete { color: #e05c5c; }
.profileLinkAbout { color: #c9a84c; }

.accountDeletedToast {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  color: #c9a84c;
  padding: 14px 22px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  z-index: 100001;
  box-shadow: 0 16px 40px rgba(0,0,0,.6);
}
.accountDeletedToast[hidden] { display: none; }
