:root {
  --bg: #0f1419;
  --bg-soft: #182029;
  --panel: #1c2732;
  --text: #f2f5f7;
  --muted: #93a1af;
  --line: rgba(255, 255, 255, 0.08);
  --accent: #2f9e7d;
  --accent-2: #3db892;
  --danger: #d96868;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  --radius: 18px;
  --font: "Segoe UI", "SF Pro Text", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(47, 158, 125, 0.18), transparent 55%),
    radial-gradient(900px 500px at 100% 0%, rgba(61, 120, 184, 0.16), transparent 50%),
    var(--bg);
}
body.page-map {
  display: grid;
  grid-template-columns: minmax(280px, 360px) 1fr;
  height: 100vh;
  overflow: hidden;
  background: var(--bg);
}
h1 {
  margin: 0.2rem 0 0.6rem;
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}
p { margin: 0; }
.eyebrow {
  margin: 0;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-2);
}
.muted { color: var(--muted); line-height: 1.45; }
.tiny-text { font-size: 0.85rem; }
.error {
  color: #ffb4b4;
  background: rgba(217, 104, 104, 0.15);
  border: 1px solid rgba(217, 104, 104, 0.35);
  border-radius: 12px;
  padding: 0.7rem 0.9rem;
  margin: 0.8rem 0;
}
label {
  display: block;
  margin-bottom: 0.4rem;
  color: var(--muted);
  font-size: 0.9rem;
}
input[type="password"], input[type="text"] {
  width: 100%;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  border-radius: 12px;
  padding: 0.85rem 0.95rem;
  font: inherit;
  outline: none;
}
input:focus {
  border-color: rgba(47, 158, 125, 0.7);
  box-shadow: 0 0 0 3px rgba(47, 158, 125, 0.18);
}
button, .primary-btn, .ghost-btn {
  font: inherit;
  cursor: pointer;
  border-radius: 12px;
  border: 0;
}
.primary-btn, button[type="submit"] {
  background: linear-gradient(180deg, var(--accent-2), var(--accent));
  color: #04140f;
  font-weight: 650;
  padding: 0.9rem 1.1rem;
  width: 100%;
}
.primary-btn:disabled { opacity: 0.55; cursor: not-allowed; }
.ghost-btn {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
  padding: 0.85rem 1rem;
  width: 100%;
}
.tiny { width: auto; padding: 0.55rem 0.8rem; font-size: 0.85rem; }
.page-login, .page-share {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.25rem;
}
.page-share-minimal {
  min-height: 100vh;
  margin: 0;
  display: grid;
  place-items: center;
  background: #0f1419;
}
.page-share-minimal .spinner {
  width: 42px;
  height: 42px;
  border: 3px solid rgba(255, 255, 255, 0.15);
  border-top-color: #3db892;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.login-card, .share-panel {
  width: min(100%, 420px);
  background: color-mix(in srgb, var(--panel) 92%, transparent);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
}
.login-card form { margin-top: 1rem; display: grid; gap: 0.75rem; }
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1rem;
  border-right: 1px solid var(--line);
  background: var(--bg-soft);
  overflow: auto;
}
.sidebar-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
}
.create-box, .links-box {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.9rem;
}
.row { display: flex; gap: 0.5rem; }
.row input { flex: 1; }
.section-title {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 0.7rem;
}
.links-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.65rem;
}
.link-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.75rem;
  background: rgba(0, 0, 0, 0.15);
}
.link-item h3 { margin: 0 0 0.35rem; font-size: 1rem; }
.link-meta { color: var(--muted); font-size: 0.8rem; margin-bottom: 0.55rem; }
.link-url {
  display: block;
  font-size: 0.78rem;
  color: #9fd7c4;
  word-break: break-all;
  margin-bottom: 0.65rem;
}
.link-actions { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.link-actions button {
  width: auto;
  padding: 0.45rem 0.65rem;
  font-size: 0.8rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}
.link-actions button.danger {
  color: #ffb4b4;
  border-color: rgba(217, 104, 104, 0.35);
}
.map { width: 100%; height: 100%; background: #101820; }
.leaflet-container { font: inherit; }
@media (max-width: 860px) {
  body.page-map {
    grid-template-columns: 1fr;
    grid-template-rows: auto 55vh;
    height: auto;
    min-height: 100vh;
    overflow: auto;
  }
  .sidebar { border-right: 0; border-bottom: 1px solid var(--line); }
  .map { min-height: 55vh; }
}
