:root {
  --bg-top: #f6fbff;
  --bg-bottom: #dceffd;
  --card: #ffffff;
  --line: #d9e4ef;
  --ink: #132238;
  --muted: #5f7087;
  --primary: #0d92ff;
  --primary-dark: #0068c0;
  --danger: #b64040;
  --ok: #12795d;
  --warn: #b06f00;
}

* {
  box-sizing: border-box;
}

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

body {
  background: radial-gradient(circle at 0% 0%, #ffffff 0%, var(--bg-top) 38%, var(--bg-bottom) 100%);
  color: var(--ink);
  font-family: Manrope, sans-serif;
}

h2 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: 1rem;
}

label {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--muted);
}

input {
  width: 100%;
  margin-top: 0.3rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.65rem 0.75rem;
  font: inherit;
}

input:focus {
  outline: 2px solid #7dc3ff;
  outline-offset: 1px;
}

.app-shell {
  padding: 1rem;
}

.topbar {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.9rem;
}

.topbar-actions {
  align-items: center;
  display: flex;
  gap: 0.55rem;
}

.brand {
  align-items: center;
  display: flex;
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  gap: 0.6rem;
}

.brand-mark {
  background: linear-gradient(140deg, #0d92ff, #29c3a0);
  border-radius: 0.45rem;
  box-shadow: 0 8px 14px rgb(13 146 255 / 25%);
  display: inline-block;
  height: 1.05rem;
  width: 1.05rem;
}

.status-pill {
  background: #eef6ff;
  border: 1px solid #cae3ff;
  border-radius: 999px;
  color: #1764a6;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.35rem 0.65rem;
}

.store-link {
  background: linear-gradient(135deg, #17a34a, #0c7f37);
  border: 1px solid #0c7f37;
  border-radius: 999px;
  color: #fff;
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 0.38rem 0.72rem;
  text-decoration: none;
}

.store-link:hover {
  filter: brightness(0.97);
}

.layout {
  display: grid;
  gap: 0.85rem;
  grid-template-columns: 360px 1fr;
  min-height: calc(100vh - 88px);
}

.sidebar {
  display: grid;
  gap: 0.85rem;
  max-height: calc(100vh - 100px);
  overflow: auto;
  padding-right: 0.2rem;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 10px 24px rgb(14 35 61 / 6%);
  padding: 0.85rem;
}

.muted {
  color: var(--muted);
  font-size: 0.82rem;
  margin: 0.5rem 0 0.8rem;
}

.stack-form {
  display: grid;
  gap: 0.65rem;
}

.signup-box {
  margin-top: 0.85rem;
}

.signup-box summary {
  color: var(--primary-dark);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 700;
}

.signup-box[open] summary {
  margin-bottom: 0.7rem;
}

.btn {
  background: #eef4fb;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 700;
  padding: 0.6rem 0.8rem;
}

.btn:hover {
  filter: brightness(0.98);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), #3bb4ff);
  border: 1px solid #0f90f7;
  color: #fff;
}

.btn-danger {
  background: #fff2f2;
  border-color: #f3c6c6;
  color: var(--danger);
}

.inline-actions {
  display: flex;
  gap: 0.5rem;
}

.user-summary {
  font-size: 0.9rem;
  font-weight: 700;
  margin-top: 0;
}

.notice {
  border-radius: 10px;
  font-size: 0.8rem;
  font-weight: 700;
  margin-top: 0.7rem;
  padding: 0.6rem;
}

.notice.info {
  background: #edf5ff;
  color: #0d4f8b;
}

.notice.success {
  background: #ebfbf4;
  color: var(--ok);
}

.notice.error {
  background: #fff3f3;
  color: var(--danger);
}

.notice.warn {
  background: #fff8e8;
  color: var(--warn);
}

.hidden {
  display: none;
}

.section-head {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.6rem;
}

.section-head .action-link {
  background: none;
  border: none;
  color: var(--primary-dark);
  cursor: pointer;
  font-size: 0.76rem;
  font-weight: 700;
  padding: 0;
}

.badge {
  background: #f0f8ff;
  border: 1px solid #cae3ff;
  border-radius: 999px;
  color: #0f6cbf;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 0.2rem 0.5rem;
}

.list {
  display: grid;
  gap: 0.45rem;
  list-style: none;
  margin: 0.7rem 0 0;
  max-height: 230px;
  overflow: auto;
  padding: 0;
}

.list li {
  background: #f8fbff;
  border: 1px solid #d9e9f7;
  border-radius: 10px;
  padding: 0.58rem;
}

.list .name {
  color: var(--ink);
  cursor: pointer;
  font-size: 0.86rem;
  font-weight: 700;
}

.list .meta {
  color: var(--muted);
  font-size: 0.76rem;
  margin-top: 0.15rem;
}

.list .row {
  align-items: center;
  display: flex;
  gap: 0.4rem;
  justify-content: space-between;
}

.list .action-link {
  background: none;
  border: none;
  color: var(--primary-dark);
  cursor: pointer;
  font-size: 0.76rem;
  font-weight: 700;
  padding: 0;
}

.list .action-link.remove {
  color: var(--danger);
}

.detail-body {
  display: grid;
  gap: 0.55rem;
}

.detail-title {
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 800;
}

.detail-subtitle {
  color: var(--muted);
  font-size: 0.8rem;
}

.detail-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.chip {
  background: #eef6ff;
  border: 1px solid #cfe3f8;
  border-radius: 999px;
  color: #1b537f;
  display: inline-block;
  font-size: 0.73rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
}

.detail-text {
  color: #314861;
  font-size: 0.82rem;
  line-height: 1.4;
}

.detail-grid {
  display: grid;
  gap: 0.45rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.detail-kv {
  background: #f8fbff;
  border: 1px solid #d9e9f7;
  border-radius: 9px;
  padding: 0.45rem;
}

.detail-kv .k {
  color: var(--muted);
  display: block;
  font-size: 0.72rem;
}

.detail-kv .v {
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 700;
}

.detail-images {
  display: grid;
  gap: 0.45rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.detail-image {
  aspect-ratio: 1 / 1;
  border: 1px solid #d9e9f7;
  border-radius: 10px;
  object-fit: cover;
  width: 100%;
}

.map-panel {
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  position: relative;
}

#map {
  height: 100%;
  min-height: calc(100vh - 115px);
  width: 100%;
}

@media (max-width: 980px) {
  .topbar {
    flex-wrap: wrap;
    gap: 0.45rem;
  }

  .topbar-actions {
    margin-left: auto;
  }

  .layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    max-height: none;
    overflow: visible;
    order: 2;
    padding-right: 0;
  }

  .map-panel {
    min-height: 56vh;
    order: 1;
  }

  #map {
    min-height: 56vh;
  }

  .detail-grid {
    grid-template-columns: 1fr;
  }

  .detail-images {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
