:root {
  --bg: #666666;
  --bg-2: #454545;
  --ink: #ffffff;
  --muted: #6cdac1;
  --glass: #555;
  --glass-line: #888;
  --lime: #6cdac1;
  --green: #079876;
  --sage: #9ebb9a;
  --gold: #f2c75c;
  --radius: 14px;
  --font: "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body { height: 100%; margin: 0; }

body {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  overflow: hidden;
  background: #454545;
  color: var(--ink);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.topbar {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 116px;
  padding: 25px max(16px, env(safe-area-inset-right)) 10px max(16px, env(safe-area-inset-left));
  border-bottom: 5px solid var(--glass-line);
  background: #045c48;
}

.brand { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; min-width: 0; }
.brand-mark { display: grid; place-items: center; width: 282px; height: 82px; flex: none; border-radius: 50%; }
.brand-mark img { width: 200px; height: 80px; object-fit: contain; }
.brand-copy { display: flex; flex-direction: column; min-width: 0; }
.brand-kicker {
    font-family: "quicksand", sans-serif;
    font-weight: 700;
    font-size: 1.4225rem;
    padding-top: 5px;
    color: #32c8a5;
    text-transform: uppercase;    
}
.brand-title { font-family: "quicksand", sans-serif;
    font-weight: 700;
    font-size: 1.4225rem;
    padding-top: 5px;
    color: #fff; }

.stats { display: flex; gap: 28px; margin: 0; }
.stats div { display: flex; flex-direction: column-reverse; align-items: flex-end; }
.stats dt { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.stats dd { margin: 0; font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }

.stage { position: relative; flex: 1; min-height: 0; overflow: hidden; }

#field {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  cursor: grab;
  outline: none;
  user-select: none;
  -webkit-user-select: none;
  box-shadow: rgba(0, 0, 0, 0.35) 0px 5px 15px;
    
    
}
#field.is-pointer { cursor: pointer; }
#field.is-dragging { cursor: grabbing; }
#field:focus-visible { box-shadow: inset 0 0 0 2px var(--lime); }

.search {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  width: min(560px, calc(100% - 28px));
  z-index: 5;
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
  height: 48px;
  border-radius: 999px;
  background: var(--glass);
  border: 1px solid var(--glass-line);
  backdrop-filter: blur(14px) saturate(1.3);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.search-box:focus-within { border-color: var(--lime); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35), 0 0 0 3px rgba(198, 255, 106, 0.2); }

.search-icon { width: 20px; height: 20px; margin-left: 16px; flex: none; color: var(--muted); }

#search {
  flex: 1;
  min-width: 0;
  height: 100%;
  padding: 0 12px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 16px;
}
#search::placeholder { color: var(--ink); }
#search::-webkit-search-cancel-button { display: none; }

.clear {
  display: grid;
  place-items: center;
  width: 32px; height: 32px;
  margin-right: 8px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: var(--ink);
  cursor: pointer;
}
.clear[hidden], .controls button[hidden] { display: none; }
.clear:hover { background: rgba(255, 255, 255, 0.2); }
.clear svg { width: 16px; height: 16px; }

.results {
  list-style: none;
  margin: 8px 0 0;
  padding: 6px;
  max-height: min(60vh, 420px);
  overflow-y: auto;
  border-radius: var(--radius);
  background: rgba(8, 20, 13, 0.94);
  border: 1px solid var(--glass-line);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5);
}
.results li {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 9px 12px;
  border-radius: 10px;
  cursor: pointer;
}
.results li[aria-selected="true"], .results li:hover { background: rgba(198, 255, 106, 0.14); }
.results .r-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.results .r-detail { font-size: 13px; color: var(--muted); }
.results .r-empty { cursor: default; color: var(--muted); }
.results .r-empty:hover { background: none; }
.results mark { background: none; color: var(--lime); }

.panel {
  position: absolute;
  left: 14px;
  bottom: 14px;
  z-index: 4;
  width: min(360px, calc(100% - 28px));
  max-height: 46%;
  overflow-y: auto;
  padding: 16px 18px 16px;
  border-radius: var(--radius);
  background: var(--glass);
  border: 1px solid var(--glass-line);
  backdrop-filter: blur(14px) saturate(1.3);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.45);
  animation: rise 0.2s ease-out;
}
.panel[hidden] { display: none; }
.panel h2 { margin: 0 40px 4px 0; font-size: 18px; line-height: 1.25; overflow-wrap: anywhere; }
.panel-meta { margin: 0 0 10px; font-size: 13px; color: var(--muted); }
.panel-close { position: absolute; top: 10px; right: 6px; }

.chips, .extras { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.extras { margin-top: 8px; flex-direction: column; flex-wrap: nowrap; gap: 3px; font-size: 13px; color: var(--muted); }
.chips button {
  padding: 5px 10px;
  border: 1px solid rgba(198, 255, 106, 0.35);
  border-radius: 999px;
  background: rgba(198, 255, 106, 0.1);
  color: var(--lime);
  font: inherit;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}
.chips button:hover { background: rgba(198, 255, 106, 0.22); }

.controls {
  position: absolute;
  right: max(14px, env(safe-area-inset-right));
  bottom: 14px;
  z-index: 4;
  display: flex;
  flex-direction: column;
  gap: 1px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid #c5c5c5;
  background: #c5c5c5;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}
.controls button {
  display: grid;
  place-items: center;
  width: 44px; height: 44px;
  border: 0;
  background: rgba(7, 152, 118, 0.78);
  color: var(--ink);
  cursor: pointer;
}
.controls button:hover { background: rgba(4, 92, 72, 0.9); }
.controls button:active { background: rgba(4, 92, 72, 0.25); }
.controls svg { width: 20px; height: 20px; }

.legend {
  position: absolute;
  right: 74px;
  bottom: 14px;
  z-index: 3;
  font-size: 12px;
  pointer-events: none;
}
.legend .export {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px solid rgba(136, 136, 136, 0.45);
  border-radius: 999px;
  background: #079876;
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  pointer-events: auto;
}
.legend .export:hover:not(:disabled) { background: rgba(136, 136, 136, 0.9); color:#c5c5c5;}
.legend .export:disabled { opacity: 0.6; cursor: progress; }
.legend .export svg { width: 14px; height: 14px; }

.hint {
  position: absolute;
  left: 14px;
  bottom: 14px;
  width: max-content;
  max-width: calc(100% - 28px);
  margin: 0;
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--glass);
  border: 1px solid var(--glass-line);
  font-size: 13px;
  color: var(--ink);
  pointer-events: none;
  transition: opacity 0.6s;
  z-index: 3;
}
.hint.is-hidden { opacity: 0; }

.tooltip {
  position: absolute;
  left: 0; top: 0;
  z-index: 6;
  max-width: 290px;
  padding: 9px 13px;
  border-radius: 10px;
  background: rgba(6, 16, 10, 0.96);
  border: 1px solid rgba(198, 255, 106, 0.4);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  pointer-events: none;
  will-change: transform;
}
.tooltip[hidden] { display: none; }
.tooltip strong { display: block; font-size: 14px; line-height: 1.3; overflow-wrap: anywhere; }
.tooltip span { display: block; margin-top: 1px; font-size: 12px; color: var(--lime); font-variant-numeric: tabular-nums; }
.tooltip .logo {
  display: grid;
  place-items: center;
  margin-bottom: 8px;
  padding: 8px;
  border-radius: 8px;
  background: #fff;
}
.tooltip .logo img {
  display: block;
  max-width: 240px;
  max-height: 110px;
  width: auto;
  height: auto;
}
.tooltip span.amount { margin-top: 4px; color: var(--ink); }

.goal-toast {
  position: absolute;
  top: 70px;
  left: 50%;
  z-index: 6;
  max-width: calc(100% - 28px);
  padding: 10px 22px;
  border-radius: 999px;
  background: var(--lime);
  color: #0a1a0f;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45), 0 0 28px rgba(198, 255, 106, 0.55);
  pointer-events: none;
  animation: toast-pop 0.4s cubic-bezier(0.2, 1.4, 0.4, 1) both;
  transform: translateX(-50%);
}
.goal-toast[hidden] { display: none; }

@keyframes toast-pop { from { opacity: 0; transform: translateX(-50%) scale(0.7); } }

.status {
  position: absolute;
  inset: 0;
  z-index: 7;
  display: grid;
  place-items: center;
  margin: 0;
  background: var(--bg);
  color: var(--muted);
  transition: opacity 0.4s;
}
.status.is-done { opacity: 0; pointer-events: none; }
.status.is-error { color: var(--gold); padding: 24px; text-align: center; }

@keyframes rise { from { opacity: 0; transform: translateY(10px); } }

@media (max-width: 1160px) {
  .panel:not([hidden]) ~ .legend { display: none; }
    
 .brand-mark { width: 252px; height: 72px;}
.brand-mark img { width: 190px; height: 80px; }
.brand-kicker {
     font-size: 1.2225rem;   
}
.brand-title { font-family: "quicksand", sans-serif;
   font-size: 1.2225rem; }
}

@media (max-width: 760px) {
  .stats { gap: 4px; }
   .stats dt { font-size: 8px; }
  .stats dd { font-size: 10px; }
  .stats div:last-child { display: none; }
  .legend { display: none; }
  .hint { display: none; }
  .panel { left: 10px; right: 10px; width: auto; bottom: 10px; max-height: 38%; }
  .controls { bottom: auto; top: 70px; right: 10px; flex-direction: row; }
  .controls button { width: 40px; height: 40px; }
    
.brand-mark { width: 132px; height: 82px;}
.brand-mark img { width: 150px; height: 50px; }
.brand-kicker {
     font-size: 0.7225rem;   
}
.brand-title { font-family: "quicksand", sans-serif;
   font-size: 0.7225rem; }
    
.topbar {
 gap: 6px;
  padding: 5px;
}    
    
}

@media (max-width: 480px) {
  .brand-kicker1 { display: none; }
  .stats1 { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
