:root{
  --bg:#0b0f14;
  --edge:#203144;
  --card:#0f1b2b;
  --ink:#e9f2ff;
  --muted:#93a6bf;
  --pill:#0d2237;
}

*{box-sizing:border-box}
html,body{height:100%}

body{
  margin:0;
  background:radial-gradient(1200px 600px at 10% -20%, #0f1c2b 0%, #0b0f14 60%) no-repeat fixed;
  color:var(--ink);
  font-family:Inter,system-ui,-apple-system,Segoe UI,Roboto,Helvetica,Arial,sans-serif;
}

/* Slightly narrower to reduce chance of horizontal scroll in EMAD iframe */
.wrap{
  max-width:840px;
  margin:0 auto;
  padding:10px;
}

.app-header h1{
  margin:0;
  font-size:20px;
  font-weight:800;
}

.muted{
  color:var(--muted);
  margin:.25rem 0 0;
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
}

.muted .arrow{
  width:38px;
  height:auto;
  opacity:.95;
  transform: translateY(1px);
}

.status{
  color:var(--muted);
  font-size:12px;
  margin:.25rem 0 .5rem;
}

/* ===== Header layout + search ===== */
.header-row{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
}

.header-left{
  min-width:220px;
}

.header-right{
  flex:1;
  display:flex;
  justify-content:flex-end;
}

.search-block{
  width:min(420px, 100%);
  background:transparent;
}

.search-label{
  display:block;
  font-size:12px;
  font-weight:800;
  color:var(--muted);
  margin:2px 0 6px;
  letter-spacing:.2px;
}

.search-controls{
  display:flex;
  gap:8px;
  align-items:center;
}

.search-input{
  flex:1;
  width:100%;
  padding:10px 12px;
  border-radius:10px;
  border:1px solid var(--edge);
  background:rgba(13,34,55,.35);
  color:var(--ink);
  outline:none;
  font-weight:600;
  font-size:13px;
}

.search-input::placeholder{
  color:rgba(147,166,191,.8);
  font-weight:600;
}

.search-input:focus{
  border-color:rgba(233,242,255,.45);
  box-shadow:0 0 0 3px rgba(233,242,255,.08);
}

.search-clear{
  padding:10px 12px;
  border-radius:10px;
  border:1px solid var(--edge);
  background:rgba(13,34,55,.35);
  color:var(--ink);
  font-weight:900;
  font-size:12px;
  cursor:pointer;
  line-height:1;
}

.search-clear:disabled{
  opacity:.45;
  cursor:default;
}

.search-help{
  margin-top:6px;
  font-size:11px;
  color:rgba(147,166,191,.85);
}

@media (max-width:720px){
  .header-row{
    flex-direction:column;
    align-items:stretch;
  }
  .header-right{
    justify-content:stretch;
  }
  .search-block{
    width:100%;
  }
}

/* ===== Cards ===== */
.branch-grid{
  display:grid;
  gap:8px; /* slightly tighter vertical gap */
}

.card{
  background:var(--card);
  border:1px solid var(--edge);
  border-radius:12px;
  padding:10px 12px;
  display:grid;

  /* Left: branch label/address, Right: buttons  */
  grid-template-columns:minmax(200px, 1.7fr) minmax(140px, 1fr);
  column-gap:10px;
  align-items:center;
}

.badge{
  display:inline-block;
  max-width:100%;
  padding:6px 10px;
  font-weight:800;
  font-size:13px;
  letter-spacing:.2px;
  color:#0d2237;
  background:#eaf2ff;
  border:1px solid var(--edge);
  border-radius:999px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.addr{
  margin:.25rem 0 0;
  font-size:12px;
  color:var(--muted);
}

.actions{
  display:flex;
  gap:8px;
  justify-content:flex-end;
  flex-wrap:wrap;
}

.btn{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:7px 9px;
  background:var(--pill);
  color:var(--ink);
  border:1px solid rgba(0,0,0,.15);
  border-radius:9px;
  text-decoration:none;
  font-weight:700;
  font-size:13px;
}

.icon{
  display:inline-block;
  width:15px;
  height:15px;
}

/* icons unchanged */
.icon-android{
  background:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256"><path fill="%23e9f2ff" d="M48 96h24v80a16 16 0 1 1-32 0V96Zm168 0v80a16 16 0 1 1-32 0V96Zm-24-48a8 8 0 0 0-16 0v20.4A88.1 88.1 0 0 0 128 56a88.1 88.1 0 0 0-48 12.4V48a8 8 0 0 0-16 0v30.2A87.6 87.6 0 0 0 40 136v40a24 24 0 0 0 48 0v-40a40 40 0 0 1 80 0v40a24 24 0 0 0 48 0v-40a87.6 87.6 0 0 0-24-57.8Z"/></svg>') center/contain no-repeat;
}
.icon-ios{
  background:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256"><path fill="%23e9f2ff" d="M168 24a40 40 0 0 1-24 38a40 40 0 0 1 24-38Zm45.7 162.1c-8.7 20.9-19.2 35.7-31.2 44.5c-10.1 7.4-20.4 11-31 11c-7 0-14.6-2-22.8-6c-8.2-4-15.7-6-22.6-6c-7.2 0-14.9 2-23 6c-8.1 4-15.3 6-21.7 6c-10.8 0-21.4-3.5-31.8-10.6c-11.8-8.1-22.3-21.6-31.4-40.6C6.6 175.9 3 157.2 3 138c0-22 5.8-40.6 17.5-55.9C32.3 66.8 47 58.1 63.6 58.1c7.8 0 16.3 2 25.5 6c9.2 4 17.1 6 23.6 6c6.2 0 14-2 23.3-6c9.3-4 17.7-6 25.3-6c13.7 0 26 3.8 36.8 11.5c-14.5 8-24.3 18.8-29.5 32.5c-5.3 13.7-4.8 28.1 1.4 43.1c6.4 14.9 16.2 26.1 29.5 33.4Z"/></svg>') center/contain no-repeat;
}

/* Mobile: stack buttons under address, full width, no horizontal scroll */
@media (max-width:860px){
  .card{grid-template-columns:1fr}
  .actions{justify-content:stretch}
  .btn{flex:1; justify-content:center}
}

/* Cloudflare migration: replaced CodePen-hosted arrow image with text arrow. */
.muted .arrow{font-size:24px;line-height:1;color:#e9f2ff;font-weight:900;}
