:root{
  --bg:#0b1220;
  --card:#0f1b33;
  --card2:#0c172b;
  --text:#e5e7eb;
  --muted:#9aa4b2;
  --stroke:rgba(255,255,255,.08);
  --accent:#22c55e;
  --accentText:#06240f;
  --btn:#1f2a44;
  --btnText:#e5e7eb;
  --shadow: 0 18px 40px rgba(0,0,0,.35);
  --radius: 18px;
  --skeleton: rgba(255,255,255,.08);
  --skeletonShine: rgba(255,255,255,.18);
  --fab-offset: 56px;
}

*{box-sizing:border-box}
body{
  margin:0;
  background:var(--bg);
  color:var(--text);
  font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Inter,Roboto,Arial,sans-serif;
  -webkit-font-smoothing: antialiased;
  line-height:1.35;
}

.wrap{
  max-width: 640px;
  margin: 0 auto;
  padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
}

.top{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.brand h1{
  margin:0;
  font-size: 18px;
  letter-spacing: -.2px;
}
.brand p{
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.brand a,
.pill a{
  color: inherit;
  text-decoration: underline;
}

.chip{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding: 7px 10px;
  border-radius:999px;
  background: rgba(255,255,255,.06);
  border:1px solid var(--stroke);
  color: var(--muted);
  font-size: 12px;
  white-space:nowrap;
  height: 30px;
}

a.chip,
a.chip:visited{
  color: var(--muted);
  text-decoration: none;
  cursor: pointer;
}

a.chip:hover{
  color: var(--text);
}

.fab{
  position: fixed;
  right: 16px;
  bottom: calc(var(--fab-offset) + env(safe-area-inset-bottom));
  z-index: 20;
  padding: 10px 14px;
  height: auto;
  font-size: 13px;
  box-shadow: 0 10px 24px rgba(0,0,0,.25);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

.fab.is-visible{
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.fab:hover{
  border-color: rgba(56,189,248,.35);
  box-shadow: 0 14px 30px rgba(56,189,248,.18);
}

.grid{
  display:grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.info-tabs{
  display:grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 6px 0 12px;
}

.info-tab{
  appearance: none;
  border:1px solid var(--stroke);
  background: rgba(255,255,255,.06);
  color: var(--muted);
  cursor: pointer;
  justify-content: center;
  width: 100%;
}

.info-tab:hover{
  color: var(--text);
}

.info-tab.is-active{
  border-color: rgba(56,189,248,.35);
  color: var(--text);
  box-shadow: 0 10px 22px rgba(56,189,248,.12);
}

.info-panel{
  position: fixed;
  inset: 0;
  display:flex;
  align-items:flex-end;
  justify-content:center;
  padding: 12px 12px calc(12px + env(safe-area-inset-bottom));
  background: rgba(2,6,23,.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
  z-index: 30;
}

.info-panel.is-open{
  opacity: 1;
  pointer-events: auto;
}

.info-sheet{
  width: 100%;
  max-width: 640px;
  background: var(--card);
  border:1px solid var(--stroke);
  border-radius: 18px 18px 14px 14px;
  box-shadow: var(--shadow);
  transform: translateY(16px);
  transition: transform .2s ease;
  padding: 14px 16px 16px;
}

.info-panel.is-open .info-sheet{
  transform: translateY(0);
}

.info-sheet-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.info-sheet-title{
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -.2px;
}

.info-close{
  appearance: none;
  border:1px solid var(--stroke);
  background: rgba(255,255,255,.06);
  color: var(--muted);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  cursor: pointer;
}

.info-sheet-body{
  color: var(--muted);
  font-size: 13px;
}

.info-sheet-body p{
  margin: 0 0 8px;
}

.info-sheet-body p:last-child{
  margin-bottom: 0;
}

.info-sheet-body ul{
  margin: 0;
  padding-left: 18px;
}

.info-sheet-body li{
  margin: 0 0 6px;
}

.info-sheet-body li:last-child{
  margin-bottom: 0;
}

body.info-open .fab{
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
}

.skeleton-card{
  pointer-events: none;
}

.skeleton-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 10px;
}

.skeleton{
  position: relative;
  overflow: hidden;
  background: var(--skeleton);
  border-radius: 12px;
}

.skeleton::after{
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, var(--skeletonShine), transparent);
  animation: shimmer 1.4s infinite;
}

@keyframes shimmer{
  0%{ transform: translateX(-100%); }
  60%{ transform: translateX(100%); }
  100%{ transform: translateX(100%); }
}

@media (prefers-reduced-motion: reduce){
  .skeleton::after{ animation: none; }
}

.cityGrid{
  gap: 10px;
}

.cityItem{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 12px;
  padding: 14px 16px;
  border-radius: calc(var(--radius) + 2px);
  background: var(--card2);
  border:1px solid var(--stroke);
  box-shadow: var(--shadow);
  color: var(--text);
  text-decoration: none;
}

.cityItem:hover{
  color: var(--text);
  border-color: rgba(34,197,94,.35);
}

.cityName{
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -.2px;
}

.cityMeta{
  color: var(--muted);
  font-size: 12px;
}

.card{
  background: var(--card);
  border:1px solid var(--stroke);
  border-radius: calc(var(--radius) + 6px);
  padding: 16px;
  box-shadow: var(--shadow);
  overflow:hidden;
  position: relative;
  scroll-margin-top: 12px;
  transition: border-color .2s ease, box-shadow .2s ease;
}

.card.is-active{
  border-color: rgba(56,189,248,.45);
  box-shadow: 0 20px 44px rgba(56,189,248,.18), var(--shadow);
}

.card.is-target{
  border-color: rgba(56,189,248,.65);
  animation: targetPulse 1.6s ease;
}

@keyframes targetPulse{
  0%{ box-shadow: 0 0 0 0 rgba(56,189,248,.35), var(--shadow); }
  60%{ box-shadow: 0 0 0 14px rgba(56,189,248,0), var(--shadow); }
  100%{ box-shadow: var(--shadow); }
}

.cardHeader{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.pill{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding: 7px 10px;
  border-radius:999px;
  background: rgba(255,255,255,.06);
  border:1px solid var(--stroke);
  color: var(--muted);
  font-size: 12px;
}

.title{
  margin: 8px 0 6px;
  font-size: 22px;
  line-height: 1.1;
  letter-spacing: -.3px;
}

.lead{
  margin:0;
  color: var(--muted);
  font-size: 13px;
}

.row{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin-top: 12px;
}

.badge{
  flex: 1 1 160px;
  min-width: 160px;
  background: rgba(255,255,255,.05);
  border:1px solid var(--stroke);
  border-radius: 14px;
  padding: 10px 12px;
}

.badge .t{
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 4px;
}
.badge .v{
  font-size: 14px;
  font-weight: 800;
}

.actions{
  margin-top: 12px;
  display:flex;
  flex-direction:column;
  gap:10px;
}

.btn{
  width:100%;
  border: 1px solid var(--stroke);
  background: var(--btn);
  color: var(--btnText);
  border-radius: 16px;
  padding: 14px 14px;
  font-size: 15px;
  font-weight: 800;
  cursor:pointer;
  box-shadow: 0 8px 24px rgba(0,0,0,.22);
  display:flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  user-select:none;
  -webkit-tap-highlight-color: transparent;
}

a.btn{
  text-decoration: none;
}
.btn:active{ transform: translateY(1px); }

.btn.primary{
  background: var(--accent);
  color: var(--accentText);
  border-color: rgba(34,197,94,.35);
  box-shadow: 0 12px 28px rgba(34,197,94,.22);
}

.btn.ghost{
  background: transparent;
  box-shadow:none;
}

.btn.disabled,
.btn:disabled{
  opacity: .6;
  cursor: not-allowed;
  box-shadow: none;
}

.price-old{
  font-size: 12px;
  font-weight: 700;
  opacity: .75;
  text-decoration: line-through;
}

.hint{
  margin-top: 12px;
  padding: 12px 12px;
  border-radius: 14px;
  border: 1px solid rgba(34,197,94,.35);
  background: rgba(34,197,94,.10);
  color: var(--text);
  font-size: 13px;
  display:flex;
  gap:10px;
  align-items:flex-start;
}

.hint .icon{
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  display:grid;
  place-items:center;
  border-radius: 8px;
  background: rgba(34,197,94,.18);
  border: 1px solid rgba(34,197,94,.25);
  font-size: 14px;
  line-height:1;
}

.footer{
  margin-top: 14px;
  color: rgba(154,164,178,.85);
  font-size: 12px;
  text-align:center;
  padding-bottom: 6px;
}

.footer a{
  color: inherit;
  text-decoration: underline;
}

.doc-grid{
  display: grid;
  gap: 12px;
}

@media (min-width: 720px){
  .doc-grid{
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .doc-span{
    grid-column: 1 / -1;
  }
}

.card.doc{
  background: linear-gradient(180deg, rgba(19,30,58,.96) 0%, rgba(12,20,40,.96) 100%);
}

.doc-head{
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.doc-icon{
  width: 30px;
  height: 30px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: rgba(56,189,248,.16);
  border: 1px solid rgba(56,189,248,.28);
  color: #dbeafe;
  font-size: 14px;
}

.card.doc h2{
  margin: 0;
  font-size: 16px;
  letter-spacing: -.2px;
}

.doc-sub{
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.doc-lines{
  display: grid;
  gap: 0;
}

.doc-line{
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  font-size: 13px;
}

.doc-line:last-child{
  border-bottom: none;
}

.doc-line .label{
  color: var(--muted);
}

.doc-line .value{
  color: var(--text);
  font-weight: 600;
  text-align: right;
}

@media (max-width: 520px){
  .doc-line{
    flex-direction: column;
    align-items: flex-start;
  }
  .doc-line .value{
    text-align: left;
  }
}

.doc-list{
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0;
  color: var(--muted);
  font-size: 13px;
}

.doc-list li{
  padding: 10px 12px 10px 30px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  position: relative;
}

.doc-list li:last-child{
  border-bottom: none;
}

.doc-list li::before{
  content: '';
  position: absolute;
  left: 12px;
  top: 16px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(56,189,248,.7);
}

.doc-box{
  margin-top: 6px;
  border-radius: 14px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.06);
  overflow: hidden;
}

.doc-note{
  color: rgba(154,164,178,.9);
  font-size: 12px;
  margin-top: 8px;
}

.error{
  background: #2b1220;
  border: 1px solid rgba(239,68,68,.35);
  color: #fecaca;
  padding: 12px;
  border-radius: 14px;
  font-size: 13px;
  margin-top: 12px;
  white-space: pre-wrap;
}
