:root {
  --bg: #0e1116;
  --surface: #161a22;
  --surface2: #1e2330;
  --border: #2a3040;
  --text: #f0f2f5;
  --muted: #8b93a5;
  --primary: #22c55e;
  --primary-dark: #16a34a;
  --danger: #ef4444;
  --radius: 14px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.4;
}

.wrap {
  max-width: 640px;
  margin: 0 auto;
  padding: 0 max(16px, env(safe-area-inset-left)) 0 max(16px, env(safe-area-inset-right));
}

.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: max(14px, env(safe-area-inset-top)) 0 14px;
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar .wrap { display: flex; flex-direction: column; gap: 2px; }
.brand { font-size: 20px; font-weight: 700; }
.tag { font-size: 13px; color: var(--muted); }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  margin-top: 16px;
}

h2 { margin: 0 0 12px; font-size: 17px; }

form .row { display: flex; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
form label {
  flex: 1 1 140px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}
form label.full { margin-bottom: 14px; }

input, select {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  padding: 12px;
  font-size: 16px; /* 16px prevents iOS Safari auto-zoom on focus */
  min-height: 44px; /* comfortable tap target */
  width: 100%;
}
input:focus, select:focus { outline: 2px solid var(--primary); outline-offset: 1px; }

button {
  width: 100%;
  background: var(--primary);
  color: #052e16;
  font-weight: 700;
  font-size: 16px;
  border: none;
  border-radius: 999px;
  padding: 14px;
  min-height: 48px;
  cursor: pointer;
}
button:active { background: var(--primary-dark); }
button:disabled { opacity: 0.5; }

.hint { font-size: 12px; color: var(--muted); margin: 10px 0 0; }

.board-header { display: flex; justify-content: space-between; align-items: center; }
.count { font-size: 12px; color: var(--primary); font-weight: 600; }

.board { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.empty { color: var(--muted); font-size: 14px; text-align: center; padding: 20px 0; margin: 0; }

.post {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
}
.post-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.post-code {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 1.5px;
  font-variant-numeric: tabular-nums;
}
.badge-stack { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.post-badge {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(34,197,94,0.15);
  color: var(--primary);
  font-weight: 600;
  white-space: nowrap;
}
.post-meta { font-size: 12px; color: var(--muted); margin-top: 6px; display: flex; justify-content: space-between; gap: 8px; }
.post-note { font-size: 13px; margin-top: 6px; color: var(--text); }
.post-actions { display: flex; gap: 8px; margin-top: 12px; }
.copy-btn, .report-btn {
  flex: 1;
  border-radius: 8px;
  padding: 10px;
  min-height: 40px;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
}
.copy-btn { border-color: var(--primary); color: var(--primary); }
.report-btn { color: var(--muted); }
.report-btn:active { color: var(--danger); border-color: var(--danger); }

footer {
  padding: 20px 0 max(24px, env(safe-area-inset-bottom));
  font-size: 11px;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 380px) {
  .card { padding: 14px; }
  .post-code { font-size: 18px; }
}

.seo-section h2 { font-size: 18px; margin-bottom: 10px; }
.seo-section h3 { font-size: 15px; margin: 18px 0 10px; color: var(--muted); }
.seo-section p { font-size: 14px; color: var(--text); line-height: 1.6; }

.faq { display: flex; flex-direction: column; gap: 8px; }

.faq details {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
}

.faq summary {
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.faq summary::-webkit-details-marker { display: none; }

.faq summary::after {
  content: "+";
  font-size: 18px;
  color: var(--primary);
  margin-left: 10px;
}

.faq details[open] summary::after { content: "−"; }

.faq details p {
  font-size: 13px;
  color: var(--muted);
  margin: 10px 0 0;
  line-height: 1.5;
}
