:root {
  --bg: #0b0b0b;
  --panel: #111;
  --panel-2: #161616;
  --border: #222;
  --text: #fff;
  --muted: #9aa0a6;
  --accent: #22c55e;
  --header-h: 64px;
}

body[data-offer-type="sell"] { --accent: #22c55e; }
body[data-offer-type="rent_out"] { --accent: #3b82f6; }
body[data-offer-type="want_buy"] { --accent: #eab308; }
body[data-offer-type="want_rent"] { --accent: #f97316; }

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  font-family: system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
}

header {
  height: var(--header-h);
  padding: 12px 16px;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  position: relative;
  z-index: 10;
}

header .title {
  display: flex;
  align-items: center;
  gap: 12px;
}

header h1 {
  margin: 0;
  font-size: 18px;
}

.type-pill {
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06);
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.12);
  background: var(--panel-2);
  color: var(--text);
  cursor: pointer;
  text-decoration: none;
  font-weight: 600;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
}

.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #001;
}

.btn.ghost {
  background: transparent;
  border-color: rgba(255,255,255,0.18);
}

.layout {
  height: calc(100vh - var(--header-h));
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  overflow: hidden;
}

.map-wrap {
  position: relative;
  background: #050505;
}

#map {
  width: 100%;
  height: 100%;
}

.map-help {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.45);
  border: 1px solid rgba(255,255,255,0.08);
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 12px;
  color: var(--muted);
  z-index: 500;
  pointer-events: none;
}
/* Map help warning state when location is missing */
.map-help.is-missing {
  color: #ff6b6b;
  border-color: rgba(255,107,107,0.5);
  background: rgba(80,0,0,0.35);
  box-shadow: 0 0 12px rgba(255,0,0,0.25);
}

#gpsBtn {
  position: absolute;
  left: 12px;
  bottom: 12px;
  z-index: 600;
  width: 44px;
  height: 44px;
  border-radius: 22px;
  background: #0b84a5;
  color: #fff;
  border: none;
  cursor: pointer;
  font-weight: 700;
  box-shadow: 0 6px 18px rgba(0,0,0,0.25);
}

.form-panel {
  background: rgba(0,0,0,0.6);
  border-left: 1px solid rgba(255,255,255,0.08);
  padding: 16px;
  overflow-y: auto;
}

.panel-title {
  margin: 0 0 12px 0;
  font-size: 16px;
}

fieldset {
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 12px;
  margin: 0 0 12px 0;
  background: rgba(0,0,0,0.35);
}

legend {
  padding: 0 8px;
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

label {
  display: block;
  margin-top: 10px;
  font-size: 12px;
  color: var(--muted);
}
/* Required field marker (publish sell) */
.required-label { color: #f1b6b6; }
.req-mark { color: #ff6b6b; font-weight: 700; margin-left: 4px; }

input,
select,
textarea {
  width: 100%;
  padding: 10px;
  margin-top: 6px;
  background: var(--panel);
  color: var(--text);
  border: 1px solid #333;
  border-radius: 8px;
  font-size: 14px;
}

textarea { resize: vertical; min-height: 80px; }

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

.canon {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px;
  margin-top: 8px;
  border-radius: 8px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  font-size: 13px;
}

.actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.status {
  margin-top: 8px;
  font-size: 12px;
  color: #9f9;
}

#editBadge {
  display: none;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,200,0,0.08);
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.keys-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.keys-section label { margin-top: 8px; }

.keys-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.hidden { display: none; }

@media (max-width: 980px) {
  html, body { overflow: auto; }
  .layout {
    grid-template-columns: 1fr;
    height: auto;
  }
  .map-wrap { height: 45vh; min-height: 320px; }
  .form-panel { border-left: none; border-top: 1px solid rgba(255,255,255,0.08); }
  .keys-grid { grid-template-columns: 1fr; }
}

.proof-section .proof-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.proof-section .hint.small {
  font-size: 12px;
  color: #666;
}
