:root {
  --bg: #f6f4ef;
  --card: #ffffff;
  --ink: #26221c;
  --muted: #6f6759;
  --brand: #1f513f;
  --brand-2: #2e7257;
  --accent: #b7791f;
  --line: #e4ded2;
  --radius: 14px;
  --shadow: 0 2px 10px rgba(38, 34, 28, .07);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
}
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }
h1 { font-size: 1.7rem; margin: 1.2rem 0 .4rem; }
h2 { font-size: 1.15rem; margin: 0 0 .6rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
img { max-width: 100%; display: block; }

/* ---------- gate ---------- */
.gate {
  position: fixed; inset: 0; z-index: 50;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(160deg, #1f513f 0%, #143529 60%, #0d241c 100%);
  padding: 20px;
}
.gate-card {
  background: var(--card); border-radius: 18px; box-shadow: 0 20px 60px rgba(0,0,0,.35);
  padding: 40px 36px; max-width: 400px; width: 100%; text-align: center;
}
.gate-icon { font-size: 2.6rem; }
.gate-card h1 { margin: .4rem 0 .2rem; font-size: 1.5rem; }
.gate-sub { color: var(--muted); margin: 0 0 1.4rem; font-size: .95rem; }
.gate-card label { display: block; text-align: left; font-weight: 600; font-size: .9rem; margin-bottom: .4rem; }
.gate-card input {
  width: 100%; padding: 12px 14px; font-size: 1.3rem; letter-spacing: .35em; text-align: center;
  border: 2px solid var(--line); border-radius: 10px; margin-bottom: .9rem;
}
.gate-card input:focus { outline: none; border-color: var(--brand-2); }
.gate-card button {
  width: 100%; padding: 12px; font-size: 1rem; font-weight: 600; color: #fff;
  background: var(--brand); border: 0; border-radius: 10px; cursor: pointer;
}
.gate-card button:hover { background: var(--brand-2); }
.gate-error { color: #b3261e; font-size: .9rem; margin: .6rem 0 0; }
.gate-foot { color: var(--muted); font-size: .8rem; margin-top: 1.2rem; }
.gate-card.shake { animation: shake .35s; }
@keyframes shake { 20%,60% { transform: translateX(-8px); } 40%,80% { transform: translateX(8px); } }

/* ---------- header ---------- */
.site-header { background: var(--brand); color: #fff; box-shadow: var(--shadow); }
.header-inner { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; padding-top: 12px; padding-bottom: 12px; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand-icon { font-size: 1.7rem; }
.brand-title { font-weight: 700; font-size: 1.05rem; }
.brand-sub { font-size: .78rem; opacity: .85; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-left: auto; }
.tab {
  background: transparent; border: 0; color: #fff; opacity: .8; font-size: .92rem;
  padding: 8px 14px; border-radius: 8px; cursor: pointer;
}
.tab:hover { opacity: 1; background: rgba(255,255,255,.12); }
.tab.active { opacity: 1; background: rgba(255,255,255,.18); font-weight: 600; }
.lock-btn {
  background: rgba(255,255,255,.12); border: 0; color: #fff; padding: 8px 12px;
  border-radius: 8px; cursor: pointer; font-size: .85rem;
}
.lock-btn:hover { background: rgba(255,255,255,.25); }

/* ---------- home ---------- */
.hero { display: grid; grid-template-columns: 2fr 1fr; gap: 14px; margin-top: 20px; }
.hero-sv, .hero-map { width: 100%; border: 0; border-radius: var(--radius); box-shadow: var(--shadow); }
.hero-sv { height: 380px; }
.hero-map { height: 330px; }
.hero-side { display: flex; flex-direction: column; gap: 8px; }
.hero-link { color: var(--brand); font-size: .9rem; text-align: center; }

.facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 18px 0; }
.fact { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px; text-align: center; }
.fact-n { font-weight: 700; font-size: 1.15rem; color: var(--brand); }
.fact-l { font-size: .8rem; color: var(--muted); }

.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 14px 0; }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.ref-list { padding-left: 18px; margin: 0; }
.ref-list li { margin-bottom: .5rem; }

.gallery-h { margin-top: 26px; }
.gallery { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.gallery figure { margin: 0; }
.gallery img { border-radius: var(--radius); box-shadow: var(--shadow); aspect-ratio: 4/3; object-fit: cover; }
.gallery figcaption { font-size: .78rem; color: var(--muted); margin-top: 4px; }

/* ---------- responsibilities ---------- */
.resp ul { padding-left: 20px; margin: 0; }
.resp li { margin-bottom: .55rem; }
.resp.tenant { border-top: 4px solid var(--accent); }
.resp.owner { border-top: 4px solid var(--brand); }
.emergency { border-left: 5px solid #b3261e; margin-top: 4px; }

/* ---------- forms ---------- */
.form label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 12px; }
.form input, .form select, .form textarea {
  width: 100%; margin-top: 4px; padding: 10px 12px; font-size: .95rem; font-family: inherit;
  border: 1.5px solid var(--line); border-radius: 8px; background: #fdfcfa;
}
.form input:focus, .form select:focus, .form textarea:focus { outline: none; border-color: var(--brand-2); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.form button {
  background: var(--brand); color: #fff; border: 0; border-radius: 8px;
  padding: 12px 24px; font-size: 1rem; font-weight: 600; cursor: pointer;
}
.form button:hover { background: var(--brand-2); }
.form-msg { margin-top: .8rem; font-weight: 600; }
.form-msg.ok { color: var(--brand-2); }
.form-msg.err { color: #b3261e; }

/* ---------- board ---------- */
.board-head { display: flex; align-items: center; gap: 14px; }
.board-head h1 { flex: 1; }
.ghost-btn {
  background: transparent; border: 1.5px solid var(--brand); color: var(--brand);
  border-radius: 8px; padding: 8px 14px; cursor: pointer; font-size: .9rem;
}
.ghost-btn:hover { background: var(--brand); color: #fff; }
.board-legend { display: flex; gap: 8px; margin: 6px 0 14px; flex-wrap: wrap; }
.board { display: flex; flex-direction: column; gap: 12px; }

.issue { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; }
.issue-top { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.issue-title { font-weight: 700; font-size: 1.02rem; flex: 1; }
.issue-meta { font-size: .82rem; color: var(--muted); margin: 2px 0 8px; }
.issue-desc { margin: 0 0 10px; white-space: pre-wrap; }
.badge { font-size: .75rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.s-new { background: #fde8e8; color: #9b1c1c; }
.s-review { background: #fdf3d7; color: #8a5a00; }
.s-progress { background: #dbeafe; color: #1e429f; }
.s-done { background: #def7e4; color: #14603a; }
.p-Emergency { background: #9b1c1c; color: #fff; }
.p-Urgent { background: #b7791f; color: #fff; }
.p-Normal { background: #e4ded2; color: #4a443a; }

.issue-owner {
  background: #f2f7f4; border-left: 4px solid var(--brand); border-radius: 8px;
  padding: 10px 14px; margin-top: 8px; font-size: .92rem;
}
.issue-owner .who-when { color: var(--muted); font-size: .82rem; margin-top: 4px; }

.issue-update { margin-top: 10px; }
.issue-update summary { cursor: pointer; color: var(--brand); font-size: .88rem; font-weight: 600; }
.issue-update .form { box-shadow: none; border: 1px dashed var(--line); padding: 14px; margin-top: 8px; }

/* ---------- footer ---------- */
.site-footer { margin-top: 40px; padding: 18px 0; background: var(--brand); color: rgba(255,255,255,.85); font-size: .85rem; }

@media (max-width: 820px) {
  .hero, .cols, .grid2 { grid-template-columns: 1fr; }
  .facts { grid-template-columns: repeat(2, 1fr); }
  .gallery { grid-template-columns: repeat(2, 1fr); }
  .hero-sv { height: 280px; }
  .tabs { margin-left: 0; }
}
