/* Monlly — boje i tipografija po DOKUMENTACIJA v0.2 */
:root {
  --ink: #101a17;
  --muted: #6b6f6a;
  --line: #e7e2d8;
  --paper: #f7f5f0;
  --card: #ffffff;
  --accent: #1d3a30;
  --accent-dark: #10211b;
  --green: #1d5a41;
  --gold: #b08d4f;
  --chat: #ece7dd;
  --radius: 20px;
  --shadow: 0 1px 2px rgba(16, 26, 23, 0.04), 0 10px 30px rgba(16, 26, 23, 0.06);
  --topbar: rgba(250, 249, 246, 0.88);
  --hover: #f0ece3;
  --display: "Iowan Old Style", "Palatino Linotype", Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

body { min-height: 100vh; }

/* --- zaglavlje ---------------------------------------------------------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: calc(12px + env(safe-area-inset-top)) 16px 12px;
  background: var(--topbar);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.brand { display: flex; align-items: center; gap: 10px; }

.mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--accent-dark);
  color: #fff;
  font-weight: 700;
}

.brand-text h1 { margin: 0; font-size: 16px; letter-spacing: -0.2px; }
.brand-text p { margin: 0; font-size: 11px; color: var(--muted); }

.ghost {
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 13px;
  cursor: pointer;
}

.ghost:hover { background: var(--hover); }

main {
  max-width: 760px;
  margin: 0 auto;
  padding: 16px 16px calc(110px + env(safe-area-inset-bottom));
}

/* --- pretraga ----------------------------------------------------------- */
.search {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 16px;
  box-shadow: var(--shadow);
}

@media (min-width: 620px) {
  .search { grid-template-columns: 1fr 1fr; }
  .search .field:first-child { grid-column: 1 / -1; }
}

.field { display: flex; flex-direction: column; gap: 6px; }

.field span {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--muted);
}

.field span b { color: var(--ink); text-transform: none; letter-spacing: 0; }

.field input[type="search"],
.field select {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  font-size: 15px;
  color: var(--ink);
  font-family: inherit;
}

.field input[type="search"]:focus,
.field select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

.field input[type="range"] { width: 100%; accent-color: var(--accent); }

/* --- obavještenja / stanja ---------------------------------------------- */
.notice {
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 4px solid #c98a1f;
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}

.notice h2 { margin: 0 0 8px; font-size: 17px; }
.notice p { margin: 0; font-size: 14px; line-height: 1.55; color: var(--muted); }

.notice-hint {
  margin-top: 12px !important;
  padding: 10px 12px;
  background: var(--paper);
  border: 1px dashed var(--line);
  border-radius: 10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px !important;
  color: var(--ink) !important;
  white-space: pre-wrap;
}

.resultbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 20px 4px 12px;
}

.resultbar p { margin: 0; font-size: 13px; letter-spacing: 0.7px; text-transform: uppercase; color: var(--muted); }

.badge {
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #e8f1ff;
  color: var(--accent);
  border: 1px solid #d3e2fb;
}

.badge-demo { background: #fdf4e3; color: #8a5a12; border-color: #f0e1c4; }
.badge-error { background: #fdeceb; color: #9a2f26; border-color: #f3cfcb; }

/* --- kartice ------------------------------------------------------------ */
.grid { display: grid; grid-template-columns: 1fr; gap: 14px; }

@media (min-width: 640px) { .grid { grid-template-columns: repeat(2, 1fr); } }

.card {
  display: block;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.card:hover { transform: translateY(-2px); box-shadow: 0 2px 4px rgba(20, 27, 35, 0.07), 0 16px 32px rgba(20, 27, 35, 0.09); }
.card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.cover {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  /* visina = 2/3 širine: slika se lakše pregleda nego uska traka */
  aspect-ratio: 3 / 2;
  height: auto;
}

.house-emoji { font-size: 62px; filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.18)); }

/* prava slika oglasa preko gradijenta (naslovna iz baze) */
.cover.has-photo { overflow: hidden; }

.coverImg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.cover.has-photo .cover-city {
  color: #fff;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

.fav-star {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: #b98a00;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(14, 23, 38, 0.22);
}

.fav-star.on { background: #fff3cc; }
.fav-star:active { transform: scale(0.94); }

.cover-city {
  position: absolute;
  left: 10px;
  bottom: 10px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: #fff;
  background: rgba(0, 0, 0, 0.28);
  padding: 4px 9px;
  border-radius: 999px;
}

.card-body { padding: 12px 14px 16px; }
.card-body .price { margin: 0 0 4px; font-size: 18px; font-weight: 800; letter-spacing: -0.3px; }
.card-body h2 { margin: 0 0 6px; font-size: 15px; font-weight: 500; line-height: 1.35; color: var(--ink); }
.meta { margin: 0 0 10px; font-size: 14px; color: var(--muted); }
.agency {
  display: flex; align-items: center; gap: 7px; flex-wrap: wrap;
  margin: 0; font-size: 14px; font-weight: 600; color: var(--green);
}
.agency-dot {
  display: grid; place-items: center;
  width: 24px; height: 24px; border-radius: 6px;
  background: #14261f; color: #f4efe4;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 10px; font-weight: 600; letter-spacing: 0.02em;
}
.agency-ok { font-weight: 700; }
.owner-badge {
  font-size: 12px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--hover);
  color: var(--ink);
}
.agency-handle { font-size: 13px; font-weight: 500; color: var(--muted); }
.agentsSearch { margin: 0 0 14px; }

.empty { margin: 28px 0; text-align: center; color: var(--muted); font-size: 14px; }

/* --- detalj oglasa ------------------------------------------------------ */
.detail-cover {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 3 / 2;
  height: auto;
  border-radius: 20px;
  background: linear-gradient(160deg, #a9c3d8, #d9cdb8);
  box-shadow: var(--shadow);
}

.detail-cover .house { font-size: 120px; filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.2)); }

.detail-price { margin: 18px 0 4px; font-size: 30px; font-weight: 800; letter-spacing: -0.8px; }
.detail-title { margin: 0 0 4px; font-size: 17px; font-weight: 700; }
.detail-sub { margin: 0 0 16px; font-size: 13.5px; color: var(--muted); }

.statsRow { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 18px; }

.statBox {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 8px;
  text-align: center;
}

.statBox b { display: block; font-size: 18px; font-weight: 700; }
.statBox span { font-size: 12px; color: var(--muted); }

.detail-desc { margin: 0 0 18px; font-size: 15px; line-height: 1.6; }

.agencyCard {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.agencyCardText { display: flex; flex-direction: column; gap: 2px; min-width: 0; }

.agencyPhoto {
  width: 44px; height: 44px; border-radius: 10px; object-fit: cover;
  flex: none; border: 1px solid var(--line);
}

.agency-photo {
  width: 24px; height: 24px; border-radius: 6px; object-fit: cover; flex: none;
}

.agencyCard b { font-size: 16px; }
.agencyCard span { font-size: 12.5px; color: var(--muted); }

/* --- zakazivanje -------------------------------------------------------- */
.page-title { margin: 4px 0 20px; font-size: 26px; font-weight: 800; letter-spacing: -0.6px; }

.label {
  margin: 0 0 10px;
  font-size: 11px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--muted);
}

.chips { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 22px; }

.chip {
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  border-radius: 999px;
  padding: 12px 20px;
  font-size: 15px;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(20, 27, 35, 0.04);
}

.chip:hover { border-color: #c9d2dc; }

.chip-active {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
  color: #fff;
  font-weight: 600;
}

.chip-disabled { opacity: 0.38; text-decoration: line-through; cursor: not-allowed; }

.hint { margin: 0; font-size: 14.5px; line-height: 1.55; color: var(--muted); }

/* --- fiksna dugmad ------------------------------------------------------ */
.actionbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  display: flex;
  gap: 10px;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: var(--topbar);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
}

.btn {
  flex: 1;
  border: none;
  border-radius: 14px;
  padding: 16px 18px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
}

.btn.primary { background: var(--accent); color: #fff; }
.btn.primary:hover { background: #1a5fd0; }
.btn.primary:disabled { background: #9db7dd; cursor: default; }

.btn.ghost-btn { background: var(--card); border: 1px solid var(--line); color: var(--ink); flex: 0 0 34%; }

footer {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 16px 30px;
  color: var(--muted);
  font-size: 12px;
}

footer p { margin: 0; }

footer .promoNote { margin-top: 6px; color: var(--accent-dark); font-weight: 500; }

/* --- nove stavke: forma i panel ---------------------------------------- */
.topActions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }

@media (max-width: 520px) {
  .topActions { gap: 6px; }
  .topActions .ghost { padding: 7px 10px; font-size: 12px; }
}

.detailPhoto { width: 100%; height: 100%; object-fit: cover; border-radius: 20px; }

/* sve slike oglasa u detaljima: traka ispod naslovne */
.photoStrip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 10px 2px 2px;
  scroll-snap-type: x mandatory;
}

.photoStrip::-webkit-scrollbar { height: 4px; }

.stripImg {
  flex: 0 0 auto;
  width: 96px;
  aspect-ratio: 3 / 2;
  height: auto;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--line);
  cursor: pointer;
  scroll-snap-align: start;
}

.stripImg.is-active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(29, 58, 48, 0.18);
}

.field textarea {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  font-size: 15px;
  font-family: inherit;
  color: var(--ink);
  resize: vertical;
}

.field input[type="number"],
.field input[type="text"] {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  font-size: 15px;
  font-family: inherit;
  color: var(--ink);
}

.twoCols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }

.photoRow { display: flex; gap: 12px; align-items: center; margin-bottom: 22px; }

.photoAdd {
  display: grid;
  place-items: center;
  width: 112px;
  height: 112px;
  border: 2px dashed #c3ccd6;
  border-radius: 14px;
  color: var(--accent);
  font-weight: 600;
  font-size: 13.5px;
  cursor: pointer;
  text-align: center;
  padding: 8px;
}

.photoAdd:hover { border-color: var(--accent); background: #f6f9ff; }

.photoPreview { width: 112px; height: 112px; object-fit: cover; border-radius: 14px; border: 1px solid var(--line); }

.formError {
  margin: 14px 0 0;
  padding: 12px 14px;
  background: #fdeceb;
  border: 1px solid #f3cfcb;
  border-radius: 12px;
  color: #9a2f26;
  font-size: 14px;
}

.formOk {
  margin: 14px 0 0;
  padding: 12px 14px;
  background: #e8f6ee;
  border: 1px solid #cbe8d7;
  border-radius: 12px;
  color: #17663c;
  font-size: 14px;
}

.panelStats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 22px; }

.requests { display: grid; gap: 12px; }

.requestCard {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 16px;
  box-shadow: var(--shadow);
}

.requestHead { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.requestHead b { font-size: 15px; }

.status {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

.status-pending { background: #fdf4e3; color: #8a5a12; }
.status-confirmed { background: #e8f6ee; color: #127a4a; }
.status-declined { background: #fdeceb; color: #9a2f26; }

.requestActions { display: flex; gap: 8px; margin-top: 10px; }

.chipSmall { padding: 9px 16px; font-size: 13px; }
.chipSmall[disabled] { opacity: 0.45; cursor: default; }

/* --- poruke ------------------------------------------------------------- */

.convCard { cursor: pointer; }
.convLast { margin: 4px 0 0; color: var(--muted); font-size: 14px; }

.thread {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--chat);
  max-height: 55vh;
  overflow-y: auto;
}

.bubble {
  max-width: 78%;
  padding: 8px 12px;
  border-radius: 14px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.bubble p { margin: 0; font-size: 15px; line-height: 1.45; color: var(--ink); }
.bubble .orig { margin-top: 4px; font-size: 12px; color: var(--muted); font-style: italic; }
.bubble .stamp { display: block; margin-top: 2px; font-size: 11px; color: var(--muted); text-align: right; }
.bubble.mine { align-self: flex-end; background: var(--accent); }
.bubble.mine p { color: #ffffff; }
.bubble.mine .orig { color: #dbe8fb; }
.bubble.mine .stamp { color: #dbe8fb; }

.threadForm { display: flex; gap: 8px; margin-top: 10px; }
.threadForm input {
  flex: 1;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  font: inherit;
  background: var(--card);
  color: var(--ink);
}
.threadForm input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.threadForm .btn { white-space: nowrap; }

/* --- mreža agenata i agencije (4.4) ------------------------------------- */

.chipTop {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 2px 8px;
  border-radius: 8px;
  background: var(--gold);
  color: #3a2600;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.badgeVerified {
  padding: 2px 8px;
  border-radius: 8px;
  background: #e8f6ee;
  color: var(--green);
  font-size: 11px;
  font-weight: 700;
}

.networkNote { margin: 6px 0; font-size: 15px; color: var(--ink); }

.offerBlock { margin-top: 8px; }
.offerBox { margin-top: 8px; display: flex; flex-direction: column; gap: 8px; }
.offerBox textarea,
.requestForm input,
.requestForm textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  font: inherit;
  background: var(--card);
  color: var(--ink);
}
.offerBox .btn, .requestForm .btn { align-self: flex-start; }

.requestForm {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 10px 0 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
}

.agentCard .requestHead { align-items: center; }

/* --- spremljene pretrage „Javi mi nove" (4.5) ---------------------------- */

.savedActions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
}

.savedBox { margin: 0 0 14px; }

.sortChips { margin: 0 0 10px; }
.sortChips .chip { padding: 8px 14px; font-size: 13px; }
.savedList { display: flex; flex-direction: column; gap: 8px; }

.savedItem {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
}
.savedItem b { color: var(--ink); font-size: 15px; }
.savedItem .meta { margin: 2px 0 0; }
.savedItem button { flex-shrink: 0; }

/* --- tržišta (§6 GET /api/markets) -------------------------------------- */

.marketChips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 12px;
}

.marketChip {
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--muted);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}
.marketChip.active {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
  font-weight: 700;
}

/* --- agent (B) i firma (A) kartice — svijetli editorial sistem ---------- */
.kv-agent {
  display: block;
  width: 100%;
  min-width: 0;
  text-align: left;
  font: inherit;
  color: #111214;
  background: #ffffff;
  border: 1px solid #e4e4e7;
  border-radius: 10px;
  padding: 15px;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.kv-agent:hover, .kv-agent:focus-visible { border-color: #c9c9ce; box-shadow: 0 2px 8px rgba(14, 23, 38, 0.06); }
.kv-agent:focus-visible { outline: 2px solid #14261f; outline-offset: 2px; }

.kv-mono {
  display: grid; place-items: center;
  background: #f4f4f5; color: #3f4448;
  border: 1px solid #e4e4e7;
  font-family: Georgia, "Times New Roman", serif;
  border-radius: 6px; flex: none;
}
.kv-agent-mono { width: 52px; height: 52px; font-size: 18px; letter-spacing: 0.02em; }

.kv-agent-top { display: flex; align-items: center; gap: 13px; }
.kv-agent-id { min-width: 0; display: block; }
.kv-agent-name {
  display: flex; align-items: center; gap: 8px; flex-wrap: nowrap;
  font-size: 18px; font-weight: 650; letter-spacing: -0.01em; line-height: 1.3;
}
.kv-name-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kv-agent-sub {
  display: block; margin-top: 4px;
  font-size: 14px; color: #6b7280;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.kv-badge {
  display: inline-flex; align-items: center; gap: 5px;
  border: 1px solid #dcdce0; border-radius: 100px;
  padding: 4px 9px; font-size: 11px; letter-spacing: 0.05em;
  text-transform: uppercase; font-weight: 650; color: #3f4448; background: var(--card);
  white-space: nowrap; flex: none;
}
.kv-badge.solid { background: #f4f4f5; border-color: #dcdce0; color: #3f4448; }
.kv-dot { width: 5px; height: 5px; border-radius: 50%; background: #9ca3af; display: inline-block; }

.kv-agent-nums {
  display: flex; gap: 22px; margin-top: 13px; padding-top: 11px;
  border-top: 1px solid #efeff1;
}
.kv-agent-nums b { display: block; font-size: 24px; font-weight: 650; letter-spacing: -0.02em; }
.kv-agent-nums small {
  display: block; margin-top: 3px; font-size: 12px; letter-spacing: 0.08em;
  text-transform: uppercase; color: #6b7280;
}

.kv-eyebrow {
  font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase;
  color: #6b7280; font-weight: 650;
}

.kv-firm {
  background: var(--card); border: 1px solid #e4e4e7; border-radius: 8px; overflow: hidden;
}
.kv-firm-hero { padding: 16px; display: flex; gap: 12px; align-items: flex-start; }
.kv-firm-mono { width: 60px; height: 60px; border-radius: 12px; font-size: 24px; }
.kv-firm-id { min-width: 0; }
.kv-firm-name {
  display: flex; align-items: center; gap: 8px; flex-wrap: nowrap;
  margin: 4px 0 0; font-size: 21px; line-height: 1.2;
  letter-spacing: -0.03em; font-weight: 650;
}
.kv-firm-meta { margin: 6px 0 0; font-size: 14px; color: #6b7280; }

.kv-firm-cells {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid #e4e4e7; border-left: 1px solid #e4e4e7;
}
.kv-cell {
  padding: 14px 15px;
  border-right: 1px solid #e4e4e7; border-bottom: 1px solid #e4e4e7;
}
.kv-cell b { display: block; font-size: 27px; font-weight: 650; letter-spacing: -0.03em; }
.kv-cell small {
  display: block; margin-top: 4px; font-size: 12px; letter-spacing: 0.08em;
  text-transform: uppercase; color: #6b7280;
}

.kv-firm-cells .kv-cell { padding: 14px 12px; }

/* === Premium sloj 2026 ================================================== */

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI Variable Text", "Segoe UI",
    Roboto, "Helvetica Neue", Arial, sans-serif;
  letter-spacing: -0.006em;
}

/* --- zaglavlje ----------------------------------------------------------- */
.topbar {
  flex-wrap: wrap;
  row-gap: 6px;
  padding: calc(10px + env(safe-area-inset-top)) 16px 8px;
  border-bottom: 1px solid rgba(231, 226, 216, 0.9);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.6) inset;
}

.topActions {
  width: 100%;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 4px;
  row-gap: 6px;
  padding-bottom: 2px;
}

.topActions .ghost { white-space: nowrap; flex: none; }

/* Na telefonu zaglavlje ostaje dva reda: brend + jedna traka dugmadi.
   Traka se skroluje vodoravno umjesto da se lomi u tri reda. */
@media (max-width: 640px) {
  .topbar { row-gap: 4px; }

  .topActions {
    flex-wrap: nowrap;
    gap: 6px;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 4px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 16px), transparent);
    mask-image: linear-gradient(to right, #000 calc(100% - 16px), transparent);
  }

  .topActions::-webkit-scrollbar { display: none; }
  .topActions .ghost { flex: 0 0 auto; }

  /* „Nazad” je prvo dugme, uvijek vidljivo bez skrolovanja */
  #back { order: -1; }
}

.brand { flex: 1 1 auto; min-width: 0; }

.mark {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--accent-dark);
  font-family: var(--display);
  font-size: 19px;
  font-weight: 500;
  letter-spacing: 0.01em;
}

.brand-text h1 {
  font-family: var(--display);
  font-size: 19px;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.brand-text p { font-size: 10.5px; letter-spacing: 0.06em; text-transform: uppercase; }

.ghost {
  border: 1px solid transparent;
  background: transparent;
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 500;
  color: #454a45;
  transition: background 0.15s ease, color 0.15s ease;
}

.ghost:hover { background: var(--hover); color: var(--ink); }

/* --- uvod ---------------------------------------------------------------- */
.hero { padding: 26px 2px 18px; }

.eyebrow {
  margin: 0 0 10px;
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #8a8577;
  font-weight: 600;
}

.heroTitle {
  margin: 0 0 10px;
  font-family: var(--display);
  font-size: 34px;
  line-height: 1.05;
  letter-spacing: -0.02em;
  font-weight: 500;
  color: var(--ink);
}

.heroSub {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--muted);
  max-width: 44ch;
}

/* --- tržišta i pretraga -------------------------------------------------- */
.marketChips { gap: 8px; margin: 4px 0 16px; }

.marketChip {
  padding: 7px 14px;
  font-size: 12.5px;
  border-radius: 999px;
  background: transparent;
  border: 1px solid var(--line);
  color: #55594f;
}

.marketChip.active {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
  color: #fdfcf9;
  font-weight: 600;
}

.search {
  border-radius: 24px;
  padding: 18px;
  gap: 14px;
  border-color: #ece7dd;
  margin-bottom: 14px;
}

.filterBar { display: flex; align-items: center; gap: 8px; margin: 2px 0 12px; }

.filterBtn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  border-radius: 999px;
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.filterBtn:hover { background: var(--hover); }

.filterBtn.is-open {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
  color: #fdfcf9;
}

.filterBtn.is-active { border-color: var(--accent); }

.filterCount {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--accent);
  color: #fdfcf9;
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
}

.filterBtn.is-open .filterCount { background: rgba(253, 252, 249, 0.9); color: var(--accent-dark); }

.field span {
  font-size: 10px;
  letter-spacing: 0.14em;
  font-weight: 600;
  color: #8a8577;
}

.field input[type="search"],
.field input[type="text"],
.field input[type="number"],
.field select,
.field textarea {
  border-radius: 14px;
  border-color: #e9e4da;
  background: #fbfaf7;
  font-size: 15px;
  padding: 13px 14px;
}

.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(29, 58, 48, 0.1);
}

/* --- lista --------------------------------------------------------------- */
.resultbar { margin: 22px 4px 12px; }
.resultbar p { font-size: 10.5px; letter-spacing: 0.14em; font-weight: 600; }

.badge {
  background: #eef3ee;
  color: #2c5a46;
  border-color: #dbe6dd;
  font-size: 10.5px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 600;
}

.grid { gap: 16px; }

.card {
  border-radius: 22px;
  border-color: #ece7dd;
  box-shadow: 0 1px 2px rgba(16, 26, 23, 0.03), 0 12px 28px rgba(16, 26, 23, 0.05);
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 2px 4px rgba(16, 26, 23, 0.05), 0 20px 40px rgba(16, 26, 23, 0.09);
}

.card-body { padding: 14px 16px 17px; }

.card-body .price {
  font-family: var(--display);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.01em;
  margin-bottom: 6px;
}

.card-body h2 { font-size: 15px; font-weight: 500; line-height: 1.4; color: #2a322e; }
.meta { font-size: 12.5px; color: #7b7f76; }

.agency {
  font-size: 12.5px;
  font-weight: 500;
  color: #5f645c;
  gap: 6px;
  padding-top: 10px;
  border-top: 1px solid #f1ede5;
  margin: 0;
}

.agency-dot, .kv-mono {
  background: #f2efe8;
  border: 1px solid #e7e2d6;
  color: #4b5147;
  font-family: var(--display);
}

.agency-ok { color: #2c5a46; }

.cover-city {
  background: rgba(16, 26, 23, 0.55);
  backdrop-filter: blur(6px);
  font-size: 10px;
  letter-spacing: 0.12em;
  font-weight: 600;
  padding: 5px 10px;
}

.chipTop {
  background: #f4ead2;
  color: #6b4f16;
  border: 1px solid #e7d6a9;
  font-size: 10px;
  letter-spacing: 0.12em;
  border-radius: 6px;
  padding: 3px 8px;
}

/* --- detalj -------------------------------------------------------------- */
.detail-cover { border-radius: 24px; }

.detail-price {
  font-family: var(--display);
  font-size: 36px;
  font-weight: 500;
  letter-spacing: -0.02em;
  margin: 20px 0 6px;
}

.detail-title { font-size: 13px; letter-spacing: 0.02em; font-weight: 600; color: #4a504a; }
.detail-sub { font-size: 12.5px; color: #8a8577; letter-spacing: 0.04em; }

.statBox {
  border-radius: 16px;
  border-color: #ece7dd;
  background: #fbfaf7;
  padding: 14px 8px 12px;
}

.statBox b { font-family: var(--display); font-size: 20px; font-weight: 500; }
.statBox span { font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; color: #8a8577; }

.detail-desc { font-size: 15px; line-height: 1.65; color: #3c423d; }

.agencyCard {
  width: 100%;
  font: inherit;
  text-align: left;
  border-radius: 18px;
  border-color: #ece7dd;
  background: #fbfaf7;
  padding: 14px 16px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.agencyCard:hover { border-color: #d9d2c4; background: #fff; }

.agencyCard b { font-size: 15px; font-weight: 600; }
.agencyCard span { font-size: 12.5px; color: #7b7f76; }

.agencyChevron {
  margin-left: auto;
  color: #9a9486;
  font-size: 16px;
  flex: none;
}

/* --- stranice i kontrole ------------------------------------------------- */
.page-title {
  font-family: var(--display);
  font-size: 30px;
  font-weight: 500;
  letter-spacing: -0.02em;
  margin: 6px 0 18px;
}

.label { font-size: 10px; letter-spacing: 0.14em; font-weight: 600; color: #8a8577; }

.chip {
  padding: 10px 18px;
  font-size: 13.5px;
  border-radius: 999px;
  border-color: #e9e4da;
  color: #454a45;
}

.chip-active {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
  color: #fdfcf9;
  font-weight: 600;
}

.btn { border-radius: 16px; font-size: 14.5px; padding: 15px 18px; }
.btn.primary { background: var(--accent-dark); }
.btn.primary:hover { background: #17342b; }
.btn.ghost-btn { border-color: #e3ddd1; background: #fff; }

.actionbar { border-top-color: #ece7dd; }

.requestCard, .savedItem, .thread { border-radius: 18px; border-color: #ece7dd; }

/* --- profil agencije / agenta / firme ------------------------------------ */
.firmCard { display: grid; gap: 18px; }

.firm {
  background: var(--card);
  border: 1px solid #ece7dd;
  border-radius: 24px;
  padding: 20px;
  box-shadow: var(--shadow);
}

.firmHead { display: flex; gap: 14px; align-items: center; }

.firmLogo {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  overflow: hidden;
  flex: none;
  display: grid;
  place-items: center;
  background: #f2efe8;
  border: 1px solid #e7e2d6;
  font-family: var(--display);
  font-size: 24px;
  color: #4b5147;
}

.firmLogo img { width: 100%; height: 100%; object-fit: cover; }

.firmName {
  margin: 4px 0 0;
  font-family: var(--display);
  font-size: 25px;
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.firmMeta { margin: 6px 0 0; font-size: 13px; color: #7b7f76; }

.firmBadge {
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid #e7e2d6;
  background: #f6f3ec;
  color: #565c52;
  white-space: nowrap;
}

.firmBadge.ok { background: #eef3ee; border-color: #d5e4d8; color: #2c5a46; }

.firmStats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  margin: 18px 0 0;
  border: 1px solid #ece7dd;
  border-radius: 16px;
  overflow: hidden;
}

.firmStats div { padding: 14px 12px; border-right: 1px solid #ece7dd; }
.firmStats div:last-child { border-right: 0; }
.firmStats b {
  display: block;
  font-family: var(--display);
  font-size: 24px;
  font-weight: 500;
  letter-spacing: -0.02em;
}
.firmStats span { font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: #8a8577; }

.firmAbout { margin: 18px 0 0; font-size: 14.5px; line-height: 1.6; color: #3c423d; }

.firmContacts { display: grid; gap: 8px; margin-top: 18px; }

.firmContact {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid #ece7dd;
  border-radius: 14px;
  background: #fbfaf7;
  color: var(--ink);
  text-decoration: none;
  font-size: 14px;
  overflow: hidden;
}

.firmContact:hover { background: #fff; border-color: #d9d2c4; }
.firmContact i { font-style: normal; opacity: 0.7; flex: none; }
.firmContact span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.firmContact b { font-weight: 600; font-size: 13px; color: #7b7f76; margin-left: auto; flex: none; }

.firmActions { display: flex; gap: 10px; margin-top: 16px; }
.firmActions .btn { flex: 1; text-align: center; text-decoration: none; display: grid; place-items: center; }

.sectionTitle {
  margin: 26px 0 12px;
  font-family: var(--display);
  font-size: 20px;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.firmGrid { margin-bottom: 10px; }

/* --- agenti (lista) ------------------------------------------------------ */
.kv-agent {
  border-radius: 18px;
  border-color: #ece7dd;
  padding: 16px;
  box-shadow: 0 1px 2px rgba(16, 26, 23, 0.03);
}

.kv-agent-mono { width: 54px; height: 54px; font-size: 18px; border-radius: 14px; }
.kv-agent-name { font-size: 17px; font-weight: 600; }
.kv-agent-sub { font-size: 12.5px; color: #7b7f76; }
.kv-agent-nums b { font-family: var(--display); font-size: 22px; font-weight: 500; }
.kv-agent-nums small { font-size: 10px; letter-spacing: 0.1em; }
.kv-agent-photo { width: 54px; height: 54px; border-radius: 14px; object-fit: cover; flex: none; border: 1px solid #e7e2d6; }

/* --- forma --------------------------------------------------------------- */
.photoAdd {
  border-radius: 18px;
  border-color: #d9d2c4;
  background: #fbfaf7;
  color: #4a504a;
}

.photoPreview { border-radius: 18px; }

@media (min-width: 640px) {
  .heroTitle { font-size: 40px; }
  main { padding-top: 22px; }
}

@media (max-width: 420px) {
  .heroTitle { font-size: 30px; }
  .detail-price { font-size: 32px; }
  .firmName { font-size: 22px; }
}

/* --- profil agencije u panelu -------------------------------------------- */
.profileCard {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 16px;
  margin-bottom: 16px;
}

.profileHead { display: flex; gap: 14px; align-items: center; }

.profileAvatar {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  overflow: hidden;
  background: var(--paper);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}

.profileAvatar img { width: 100%; height: 100%; object-fit: cover; }
.profileAvatar .kv-mono { width: 100%; height: 100%; font-size: 22px; border-radius: 18px; }

.profileId { min-width: 0; }
.profileId b { display: block; font-size: 18px; line-height: 1.2; }
.profileId .eyebrow {
  margin: 0 0 2px;
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.profileId .meta { margin: 2px 0 0; font-size: 12.5px; color: var(--muted); }

.profileActions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.profileActions .chipSmall { cursor: pointer; }
.profileActions .btn { flex: 1 1 140px; }

.profileForm { margin-top: 14px; display: grid; gap: 10px; }
.profileForm .field input,
.profileForm .field textarea { width: 100%; }
.profileForm .field textarea { resize: vertical; }
.profileForm .profileActions { margin-top: 0; }

@media (min-width: 640px) {
  .profileForm { grid-template-columns: 1fr 1fr; }
  .profileForm .field:last-of-type,
  .profileForm .profileActions,
  .profileForm .hint { grid-column: 1 / -1; }
}
