/* bhoos — Developer Utility. Clean, intentional, one accent. Borders, not shadows. */

:root {
  --bg:       #f7f7f5;
  --surface:  #ffffff;
  --border:   #e4e4e0;
  --border-2: #f0f0ee;
  --text:     #111110;
  --text-2:   #6f6f69;
  --accent:   #5b47e0;
  --accent-h: #4535c7;
  --tint:     #eeecfc;
  --tint-bd:  #c4bcf5;
  --success:  #1a7f4b;
  --danger:   #c23b22;
  --code-bg:  #f0f0ee;
  --code-fg:  #2d2d2d;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
.mono { font-family: "JetBrains Mono", ui-monospace, monospace; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-h); }

/* ---------- shorten page ---------- */
main.center {
  max-width: 520px; margin: 0 auto; min-height: 100vh;
  display: flex; flex-direction: column; justify-content: center;
  padding: 3rem 1.5rem;
}
.brand h1 { font-size: 28px; font-weight: 700; margin: 0; color: var(--text); }
.brand p { margin: .35rem 0 0; color: var(--text-2); font-size: 15px; }

.field { width: 100%; margin-top: 1.8rem; }
.url-input, .custom-input {
  width: 100%; height: 48px; padding: 14px 16px;
  border: 1px solid var(--border); border-radius: 8px; background: var(--surface);
  font-family: "JetBrains Mono", monospace; font-size: 14px; color: var(--text);
  transition: border-color 150ms ease;
}
.url-input::placeholder, .custom-input::placeholder { color: var(--text-2); }
.url-input:focus, .custom-input:focus { outline: 0; border-color: var(--accent); }
.custom-input { height: 42px; margin-top: .7rem; }

.label { font-size: 13px; color: var(--text-2); margin: 0 0 8px; }

.toggles { display: flex; flex-wrap: wrap; gap: 8px; }
.toggle {
  cursor: pointer; user-select: none;
  background: var(--bg); color: var(--text-2);
  border: 1px solid var(--border); border-radius: 6px;
  padding: 6px 12px; font-size: 13px; transition: all 150ms ease;
}
.toggle:hover { color: var(--text); }
.toggle.on { background: var(--tint); color: var(--accent); border-color: var(--tint-bd); }

.btn {
  position: relative; overflow: hidden;
  width: 100%; height: 48px; margin-top: 1.8rem; cursor: pointer;
  background: var(--accent); color: #fff; border: 0; border-radius: 8px;
  font-family: "Inter", sans-serif; font-size: 15px; font-weight: 500;
  transition: background 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}
.btn:hover { background: var(--accent-h); box-shadow: 0 2px 8px rgba(91,71,224,.3); }
.btn:active { transform: scale(.99); box-shadow: none; }
.btn:disabled { cursor: wait; }
.btn .progress {
  position: absolute; left: 0; bottom: 0; height: 2px; width: 0; background: rgba(255,255,255,.8);
}
.btn.loading .progress { animation: progress 1.2s ease-in-out infinite; }
@keyframes progress { 0% { width: 0; left: 0; } 50% { width: 60%; } 100% { width: 0; left: 100%; } }

/* output */
.result {
  margin-top: 1.2rem; background: var(--code-bg);
  border: 1px solid var(--border); border-radius: 8px; padding: 16px;
  animation: fadeUp 200ms ease;
}
@keyframes fadeUp { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.result .url { font-family: "JetBrains Mono", monospace; font-size: 20px; color: var(--text); word-break: break-all; }
.result .meta { font-size: 13px; color: var(--text-2); margin: .35rem 0 1rem; }
.result .actions { display: flex; align-items: center; gap: 12px; }
.btn-outline {
  cursor: pointer; background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: 8px; padding: 7px 14px; font-size: 14px;
  transition: box-shadow 150ms ease;
}
.btn-outline:hover { box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.link-arrow { color: var(--accent); font-size: 14px; }
.qr { margin-left: auto; border: 1px solid var(--border); border-radius: 6px; background: #fff; padding: 4px; }

.error {
  margin-top: 1.2rem; background: #fbeeea; border: 1px solid #eccabf;
  border-radius: 8px; padding: 12px 14px; color: var(--danger); font-size: 14px;
}

.footer { text-align: center; color: var(--text-2); font-size: 13px; margin-top: 40px; }

/* ---------- stats page ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 24px;
}
.bignum { font-size: 40px; font-weight: 600; color: var(--text); line-height: 1; }
.kv dt { font-size: 12px; color: var(--text-2); margin-top: 1rem; }
.kv dd { margin: .15rem 0 0; word-break: break-all; }

/* ---------- dashboard ---------- */
body.dash { height: 100vh; overflow: hidden; }
.topbar {
  height: 48px; display: flex; align-items: center; gap: 12px;
  border-bottom: 1px solid var(--border); background: var(--surface); padding: 0 16px; font-size: 14px;
}
.topbar .crumb { color: var(--text); font-weight: 500; }
.topbar .sep, .topbar .muted { color: var(--text-2); }
.topbar .spacer { flex: 1; }

.shell { display: flex; height: calc(100vh - 48px); }
.sidebar { width: 300px; flex: 0 0 300px; border-right: 1px solid var(--border); background: var(--surface); overflow-y: auto; }
.sidebar .head { font-size: 12px; color: var(--text-2); text-transform: uppercase; letter-spacing: .06em; padding: 20px 16px 8px; }
.url-row { padding: 12px 16px; border-bottom: 1px solid var(--border-2); cursor: pointer; border-left: 3px solid transparent; transition: background 150ms ease; }
.url-row:hover { background: var(--bg); }
.url-row.active { background: var(--tint); border-left: 3px solid var(--accent); }
.url-row .u { font-family: "JetBrains Mono", monospace; font-size: 13px; color: var(--text); }
.url-row .m { font-size: 12px; color: var(--text-2); margin-top: 2px; }
.badge {
  float: right; font-family: "JetBrains Mono", monospace; font-size: 12px;
  color: var(--accent); background: var(--tint); border-radius: 100px; padding: 4px 8px;
}
.empty { color: var(--text-2); text-align: center; padding: 40px 16px; font-size: 14px; }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.globe-card {
  position: relative; margin: 24px 24px 0; flex: 1;
  border: 1px solid var(--border); border-radius: 10px; background: var(--surface); overflow: hidden;
}
#globe-canvas { width: 100%; height: 100%; display: block; background: var(--bg); }
.globe-overlay {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: var(--text-2); font-size: 14px; transition: opacity 200ms ease; pointer-events: none;
}

.stats-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 24px; }
.stat { border: 1px solid var(--border); border-radius: 10px; background: var(--surface); padding: 20px 24px; }
.stat .v { font-size: 28px; font-weight: 600; color: var(--text); }
.stat .l { font-size: 12px; color: var(--text-2); margin-top: 2px; }

/* floating info card over globe */
.info-card {
  position: fixed; z-index: 40; pointer-events: none;
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  padding: 12px 14px; box-shadow: 0 4px 16px rgba(0,0,0,.08);
  transform: translate(-50%, -120%); transition: opacity 200ms ease; min-width: 170px;
}
.info-card .loc { font-size: 14px; font-weight: 500; color: var(--text); }
.info-card .row { font-family: "JetBrains Mono", monospace; font-size: 12px; color: var(--text-2); margin-top: 2px; }

#logs-data { display: none; }
