:root{
  --green:#5eb8bb;
  --green-dark:#3f9598;
  --green-soft:#e4f3f3;
  --bg:#f3f8f8;
  --card:#ffffff;
  --ink:#1f2a2a;
  --muted:#6b7c7c;
  --line:#e1ecec;
  --shadow:0 8px 24px rgba(30,110,112,.10);
  --radius:18px;
  font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
}

*{box-sizing:border-box}
html,body{margin:0;padding:0}
body{
  background:var(--bg);
  color:var(--ink);
  font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
  -webkit-font-smoothing:antialiased;
}
.app{max-width:760px;margin:0 auto;min-height:100vh;display:flex;flex-direction:column}

/* ---------- Hero ---------- */
.hero{
  position:sticky;top:0;z-index:20;
  padding:calc(env(safe-area-inset-top) + 16px) 16px 12px;
  background:linear-gradient(180deg,#ffffff 0%, #ffffff 70%, rgba(255,255,255,.92) 100%);
  border-bottom:1px solid var(--line);
  backdrop-filter:saturate(1.2) blur(8px);
}
.brand{display:flex;align-items:center;gap:12px;margin-bottom:14px}
.logo{
  width:44px;height:44px;border-radius:13px;flex:0 0 auto;
  background:linear-gradient(145deg,var(--green),var(--green-dark));
  color:#fff;display:flex;align-items:center;justify-content:center;
  box-shadow:0 6px 16px rgba(94,184,187,.40);
}
.titles h1{font-size:20px;line-height:1.1;margin:0;letter-spacing:-.2px}
.titles p{font-size:13px;color:var(--muted);margin:3px 0 0}

.searchbar{
  display:flex;align-items:center;gap:8px;
  background:rgba(255,255,255,.75);
  border:1px solid var(--line);
  border-radius:14px;padding:11px 12px;
  box-shadow:var(--shadow);
  backdrop-filter:blur(10px);
}
.search-ico{color:var(--green);flex:0 0 auto}
.searchbar input{
  border:0;outline:0;background:transparent;width:100%;
  font-size:16px;color:var(--ink);font-family:inherit;
}
.searchbar input::placeholder{color:#9aa8a2}
.clear{border:0;background:#eef3f1;color:#5a6b64;width:24px;height:24px;border-radius:50%;font-size:18px;line-height:1;cursor:pointer}

.filters{display:flex;gap:8px;margin-top:12px;overflow-x:auto;-webkit-overflow-scrolling:touch}
.chip{
  border:1px solid var(--line);background:#fff;color:var(--muted);
  padding:7px 14px;border-radius:999px;font-size:13px;font-family:inherit;
  white-space:nowrap;cursor:pointer;transition:.15s;
}
.chip.active{background:var(--green-soft);border-color:var(--green);color:var(--green-dark);font-weight:bold}

/* ---------- Results ---------- */
.results{flex:1;padding:14px 16px 120px;display:flex;flex-direction:column;gap:10px}
.card{
  background:var(--card);
  border:1px solid var(--line);
  border-radius:var(--radius);
  padding:14px 16px;
  box-shadow:var(--shadow);
}
.card .name{font-size:15px;font-weight:bold;line-height:1.3;margin:0 0 10px;color:var(--ink)}
.codes{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
.tag{
  display:inline-flex;flex-direction:column;
  background:var(--green-soft);border:1px solid #c4e6e6;
  border-radius:10px;padding:6px 10px;min-width:84px;
}
.tag .k{font-size:10px;letter-spacing:.4px;color:var(--green-dark);text-transform:uppercase}
.tag .v{font-size:14px;font-weight:bold;color:var(--ink)}
.tag.muted{background:#f1f4f3;border-color:var(--line)}
.tag.muted .k{color:var(--muted)}
.tag.price{background:#fff;border-color:#c4e6e6;margin-left:auto}
.tag.price .v{color:var(--green-dark)}
.tag.region{background:#eef6ff;border-color:#cfe0f2}
.tag.region .k{color:#3a6ea5}
.tag.region .v{color:#1f3a5f;text-transform:capitalize}

.empty{
  text-align:center;color:var(--muted);padding:48px 20px;
}
.empty .big{font-size:40px;margin-bottom:8px}
.empty .hint{font-size:14px;margin-top:6px}

mark{background:#fff2a8;color:inherit;border-radius:3px;padding:0 1px}

/* ---------- Toolbar ---------- */
.toolbar{
  position:fixed;left:0;right:0;bottom:0;z-index:25;
  max-width:760px;margin:0 auto;
  display:flex;align-items:center;justify-content:space-between;gap:10px;
  padding:10px 14px calc(env(safe-area-inset-bottom) + 10px);
  background:rgba(255,255,255,.86);border-top:1px solid var(--line);
  backdrop-filter:blur(12px);
}
.meta{display:flex;flex-direction:column;line-height:1.2}
#count{font-size:13px;font-weight:bold;color:var(--ink)}
.updated{font-size:11px;color:var(--muted)}
.actions{display:flex;gap:8px}
.btn{
  border:0;border-radius:12px;padding:11px 14px;font-size:14px;font-family:inherit;
  font-weight:bold;cursor:pointer;transition:.15s;
}
.btn.primary{background:var(--green);color:#fff;box-shadow:0 6px 16px rgba(94,184,187,.40)}
.btn.primary:active{background:var(--green-dark)}
.btn.ghost{background:#eef3f1;color:#4a5a53}
.btn:disabled{opacity:.5;cursor:not-allowed}

/* ---------- Overlay ---------- */
.overlay{
  position:fixed;inset:0;z-index:50;display:flex;align-items:center;justify-content:center;
  background:rgba(20,40,33,.45);backdrop-filter:blur(4px);padding:24px;
}
.sheet{
  background:#fff;border-radius:22px;padding:26px 22px;width:100%;max-width:340px;text-align:center;
  box-shadow:0 20px 50px rgba(0,0,0,.25);
}
.sheet h2{font-size:17px;margin:14px 0 4px}
.sheet p{font-size:13px;color:var(--muted);margin:0 0 16px;min-height:18px}
.spinner{
  width:40px;height:40px;border-radius:50%;margin:0 auto;
  border:4px solid var(--green-soft);border-top-color:var(--green);
  animation:spin 1s linear infinite;
}
@keyframes spin{to{transform:rotate(360deg)}}
.progress{height:8px;background:#eef3f1;border-radius:999px;overflow:hidden;margin-bottom:16px}
.bar{height:100%;width:0;background:linear-gradient(90deg,var(--green),var(--green-dark));transition:width .2s}

@media (prefers-color-scheme: dark){
  :root{--bg:#0f1717;--card:#162020;--ink:#e8efef;--muted:#9fb0b0;--line:#243030;--green-soft:#16322f;--shadow:0 8px 24px rgba(0,0,0,.4)}
  .hero{background:linear-gradient(180deg,#121b1b,#121b1b);border-bottom-color:var(--line)}
  .searchbar{background:rgba(28,40,40,.7)}
  .chip{background:#162020}
  .toolbar{background:rgba(16,24,24,.9)}
  .btn.ghost{background:#1f2a2a;color:#cfe0de}
  .tag.price{background:#162020}
  mark{background:#3a4a1f;color:#fff}
}

/* Icono personalizado */
.logo{
  background:transparent;
  box-shadow:none;
  overflow:hidden;
}
.logo img{
  width:44px;
  height:44px;
  display:block;
  border-radius:13px;
}
