:root {
  --green: #1E4D3B;
  --green-dark: #133528;
  --green-soft: #E3F0E8;
  --gold: #D4A62A;
  --gold-soft: #FBF1D6;
  --gold-text: #5A4408;
  --cream: #F6F4EE;
  --sand: #E9E4D6;
  --line: #E4DFD2;
  --ink: #14213D;
  --muted: #5B6170;
  --red-soft: #FBE4E1;
  --red-text: #8A2418;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--cream); color: var(--ink);
  font-family: Inter, system-ui, -apple-system, sans-serif; font-size: 16px;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--green); }
button, input, select, textarea { font: inherit; color: inherit; }

#app { display: flex; flex-direction: column; height: 100dvh; max-width: 720px; margin: 0 auto; background: var(--cream); }

.top { background: var(--green); color: #fff; padding: calc(12px + var(--safe-t)) 16px 12px; flex-shrink: 0; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; }
.brand strong { display: block; font-family: 'DM Serif Display', serif; font-weight: 400; font-size: 22px; line-height: 1.1; }
.brand small { display: block; font-size: 12px; color: #D6E5DC; }

#view { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; outline: none; }
.pad { padding: 16px; display: flex; flex-direction: column; gap: 16px; }

.tabs { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); background: #fff; border-top: 1px solid var(--line); padding: 4px 4px calc(6px + var(--safe-b)); flex-shrink: 0; }
.tabs a { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 0; min-height: 48px; font-size: 11px; color: var(--muted); text-decoration: none; }
.tabs a.on { color: var(--green); font-weight: 600; }
.tabs svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

h1, h2, h3 { margin: 0; }
.h-serif { font-family: 'DM Serif Display', serif; font-weight: 400; }
.section-title { font-size: 18px; font-weight: 600; display: flex; justify-content: space-between; align-items: baseline; }
.section-title a { font-size: 14px; font-weight: 500; text-decoration: none; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

.hero { background: var(--green); color: #fff; border-radius: 18px; overflow: hidden; text-decoration: none; display: block; }
.hero img { width: 100%; height: 180px; object-fit: cover; display: block; }
.hero .in { padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.kicker { font-size: 11px; letter-spacing: 1.2px; text-transform: uppercase; color: #E8C766; font-weight: 600; }
.hero h2 { font-family: 'DM Serif Display', serif; font-weight: 400; font-size: 24px; line-height: 1.15; }
.hero p { margin: 0; font-size: 14px; color: #D6E5DC; line-height: 1.5; }

.card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 14px; color: var(--ink); text-decoration: none; display: block; }
.list { display: flex; flex-direction: column; gap: 10px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.row { display: flex; align-items: center; gap: 12px; }
.post-row { display: flex; gap: 12px; align-items: center; }
.post-row img { width: 72px; height: 72px; border-radius: 10px; object-fit: cover; flex-shrink: 0; background: var(--sand); }
.post-row .t { font-weight: 600; font-size: 15px; line-height: 1.3; }
.dot { width: 10px; height: 10px; border-radius: 5px; background: #2E8B57; flex-shrink: 0; }
.chip { display: inline-block; font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 10px; }
.chip.ok { background: var(--green-soft); color: var(--green); }
.chip.wait { background: var(--gold-soft); color: var(--gold-text); }
.chip.no { background: var(--red-soft); color: var(--red-text); }

.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 18px; border-radius: 14px; border: none; background: var(--gold); color: var(--ink); font-weight: 600; font-size: 16px; text-decoration: none; cursor: pointer; }
.btn.ghost { background: #fff; border: 1px solid #D5CFBF; }
.btn.green { background: var(--green); color: #fff; }
.btn.small { min-height: 40px; font-size: 14px; padding: 0 14px; }
.btn[disabled] { opacity: .6; }

label.f { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 600; }
.f input, .f select, .f textarea { min-height: 48px; border: 1px solid #D5CFBF; border-radius: 12px; padding: 10px 14px; background: #fff; font-weight: 400; font-size: 16px; }
.f textarea { min-height: 120px; resize: vertical; }
.err { color: var(--red-text); font-size: 14px; }
.seg { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); background: var(--sand); border-radius: 14px; padding: 4px; }
.seg button { min-height: 44px; border: none; border-radius: 10px; background: transparent; font-weight: 600; color: var(--muted); }
.seg button.on { background: #fff; color: var(--green); }

/* Tekst iz WordPressa */
.article { padding: 16px 16px 32px; line-height: 1.7; font-size: 17px; }
.article h1 { font-family: 'DM Serif Display', serif; font-weight: 400; font-size: 30px; line-height: 1.15; margin-bottom: 12px; }
.article img, .article video { max-width: 100%; height: auto; border-radius: 12px; }
.article iframe { width: 100%; aspect-ratio: 16 / 9; height: auto; border: 0; border-radius: 12px; }
.article figure { margin: 16px 0; }
.article blockquote { margin: 16px 0; padding: 4px 16px; border-left: 3px solid var(--gold); color: #3B4252; }
.article table { width: 100%; border-collapse: collapse; display: block; overflow-x: auto; }
.article td, .article th { border: 1px solid var(--line); padding: 6px 8px; }
.article .wp-block-button__link { display: inline-block; background: var(--gold); color: var(--ink); padding: 10px 16px; border-radius: 12px; text-decoration: none; font-weight: 600; }
.back { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 16px; text-decoration: none; font-weight: 500; }

/* Muhabet */
.chat { display: flex; flex-direction: column; height: 100%; }
.rooms { display: flex; gap: 8px; padding: 10px 12px; overflow-x: auto; background: #fff; border-bottom: 1px solid var(--line); flex-shrink: 0; }
.rooms a { flex-shrink: 0; min-height: 40px; display: inline-flex; align-items: center; padding: 0 14px; border-radius: 20px; font-size: 14px; font-weight: 600; text-decoration: none; border: 1px solid #D5CFBF; background: #fff; color: var(--green); }
.rooms a.on { background: var(--green); color: #fff; border-color: var(--green); }
.msgs { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.m { max-width: 82%; padding: 9px 13px; font-size: 15px; line-height: 1.4; word-wrap: break-word; }
.m.mine { align-self: flex-end; background: var(--green); color: #fff; border-radius: 18px 18px 4px 18px; }
.m-other { align-self: flex-start; max-width: 82%; display: flex; flex-direction: column; gap: 3px; }
.m-other .who { font-size: 12px; font-weight: 600; color: var(--muted); padding-left: 4px; }
.m-other .m { max-width: 100%; background: #fff; border: 1px solid var(--line); border-radius: 18px 18px 18px 4px; }
.bot { align-self: center; max-width: 92%; background: var(--gold-soft); border: 1px solid #E8C766; color: var(--gold-text); border-radius: 12px; padding: 10px 12px; font-size: 13px; line-height: 1.4; }
.compose { display: flex; gap: 8px; padding: 10px 12px; background: #fff; border-top: 1px solid var(--line); flex-shrink: 0; }
.compose input { flex: 1; min-height: 46px; border: 1px solid #D5CFBF; border-radius: 23px; padding: 0 16px; background: var(--cream); font-size: 16px; }
.compose button { width: 46px; height: 46px; border-radius: 23px; border: none; background: var(--gold); display: flex; align-items: center; justify-content: center; }
.compose svg { width: 20px; height: 20px; fill: none; stroke: var(--ink); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.empty { text-align: center; padding: 40px 16px; color: var(--muted); }
.spinner { width: 28px; height: 28px; border: 3px solid var(--sand); border-top-color: var(--green); border-radius: 50%; animation: spin 0.8s linear infinite; margin: 40px auto; }
@keyframes spin { to { transform: rotate(360deg); } }

#toast { position: fixed; left: 50%; bottom: calc(90px + var(--safe-b)); transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 12px; font-size: 14px; max-width: 90vw; opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 10; }
#toast.show { opacity: 1; }

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
