:root {
  --bg: #0b0b0b;
  --bg-elev: #141414;
  --bg-card: #161616;
  --bg-reply: #1a1910;
  --yellow: #ffd500;
  --yellow-dim: #c9a800;
  --text: #f5f5f5;
  --muted: #a8a8a8;
  --border: #2a2a2a;
  --danger: #ff5a5a;
  --ok: #7d7d7d;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  --radius: 16px;
  --font: "Prompt", "Sarabun", "Noto Sans Thai", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  min-height: 100vh;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.site-header {
  background: #000;
  border-bottom: 3px solid var(--yellow);
}
.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}
.logo {
  height: 72px;
  width: auto;
  max-width: min(260px, 70vw);
  object-fit: contain;
  border-radius: 10px;
  flex-shrink: 0;
  background: var(--yellow);
}
.header-text { flex: 1 1 220px; min-width: 0; }
.eyebrow {
  margin: 0 0 2px;
  color: var(--yellow);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.04em;
}
h1 {
  margin: 0;
  font-size: clamp(1.25rem, 3vw, 1.75rem);
  font-weight: 700;
  line-height: 1.25;
}
.sub { margin: 4px 0 0; color: var(--muted); font-size: 0.92rem; }
.draft-badge {
  display: inline-block;
  background: var(--yellow);
  color: #111;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 8px 14px;
  border-radius: 999px;
  white-space: nowrap;
}

main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 20px 64px;
}

.callout {
  background: #201c00;
  border: 1px solid var(--yellow-dim);
  color: #ffe98a;
  padding: 14px 18px;
  border-radius: 12px;
  margin: 0 0 24px;
  font-size: 0.95rem;
}

.summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px 28px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  margin-bottom: 24px;
}
.score { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.score-num {
  font-size: 3rem;
  font-weight: 700;
  color: var(--yellow);
  line-height: 1;
}
.score-stars { color: var(--yellow); letter-spacing: 2px; font-size: 1.15rem; }
.score-count { color: var(--muted); font-weight: 500; }
.star-breakdown {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.star-breakdown li {
  background: #000;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.88rem;
  color: var(--text);
}
.star-breakdown li b { color: var(--yellow); font-weight: 600; }
.maps-link {
  margin-left: auto;
  color: #111;
  background: var(--yellow);
  text-decoration: none;
  font-weight: 600;
  padding: 10px 16px;
  border-radius: 999px;
  display: inline-block;
}
.maps-link:hover, .maps-link:focus { filter: brightness(1.08); }

.ideas {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-top: 3px solid var(--yellow);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 28px;
}
.ideas-head h2 {
  margin: 0 0 6px;
  font-size: 1.35rem;
  color: var(--yellow);
}
.ideas-head p { margin: 0 0 16px; color: var(--muted); }
.ideas-form textarea {
  width: 100%;
  background: #000;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  font-family: inherit;
  font-size: 1rem;
  resize: vertical;
  min-height: 96px;
}
.ideas-form textarea:focus {
  outline: 2px solid var(--yellow);
  border-color: var(--yellow);
}
.ideas-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 12px;
  flex-wrap: wrap;
}
.ideas-form button, .copy-btn {
  appearance: none;
  border: 0;
  background: var(--yellow);
  color: #111;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 10px 18px;
  border-radius: 999px;
  cursor: pointer;
}
.ideas-form button:hover, .copy-btn:hover { filter: brightness(1.08); }
.ideas-form button:disabled { opacity: 0.6; cursor: default; }
.ideas-status { margin: 0; color: var(--muted); font-size: 0.9rem; }
.ideas-status.is-error { color: #ffb4b4; }
.ideas-status.is-ok { color: #c8e6a0; }
.ideas-list {
  list-style: none;
  margin: 20px 0 0;
  padding: 0;
  display: grid;
  gap: 10px;
}
.idea-item {
  background: #000;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
}
.idea-item time {
  display: block;
  color: var(--yellow-dim);
  font-size: 0.8rem;
  margin-bottom: 4px;
}
.idea-item p { margin: 0; white-space: pre-wrap; word-break: break-word; }
.ideas-empty { color: var(--muted); font-size: 0.92rem; margin: 12px 0 0; }

.tabs {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 0;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}
.tab {
  appearance: none;
  background: #000;
  color: var(--text);
  border: 1px solid var(--border);
  font-family: inherit;
  font-weight: 600;
  font-size: 0.92rem;
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
}
.tab span {
  display: inline-block;
  margin-left: 4px;
  color: var(--muted);
  font-weight: 500;
}
.tab.is-active {
  background: var(--yellow);
  color: #111;
  border-color: var(--yellow);
}
.tab.is-active span { color: #333; }
.grid-meta { color: var(--muted); font-size: 0.9rem; margin: 8px 0 14px; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
  grid-auto-rows: 32.5rem;
  gap: 16px;
  align-items: stretch;
}
.card {
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-top: 3px solid var(--yellow);
  border-radius: var(--radius);
  padding: 16px 16px 14px;
  box-shadow: var(--shadow);
}
.card.is-answered {
  border-top-color: #555;
  background: #121212;
  opacity: 0.72;
  filter: grayscale(0.55);
}
.card-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: flex-start;
  margin-bottom: 8px;
  flex-shrink: 0;
}
.stars { color: var(--yellow); letter-spacing: 1px; font-size: 1rem; }
.stars .empty { color: #3a3a3a; }
.card-no { color: var(--muted); font-size: 0.8rem; }
.card-name {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.3;
}
.card-date { margin: 2px 0 10px; color: var(--muted); font-size: 0.82rem; flex-shrink: 0; }

.answered-badge {
  display: inline-block;
  background: #2a2a2a;
  color: #ddd;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 999px;
  margin: 0 0 10px;
  flex-shrink: 0;
}

.review, .reply-box {
  flex: 1 1 0;
  min-height: 0;
  overflow-y: auto;
  font-size: 0.92rem;
}
.review { color: var(--text); margin-bottom: 10px; }
.review.is-empty { color: var(--muted); font-style: italic; }
.review p, .reply-box p { margin: 0; white-space: pre-wrap; word-break: break-word; }

.reply-box {
  background: var(--bg-reply);
  border: 1px solid #3a3410;
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 10px;
}
.reply-label {
  display: block;
  color: var(--yellow);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}
.copy-btn { align-self: flex-start; flex-shrink: 0; margin-top: auto; }
.copy-btn.is-copied { background: #c8e6a0; }

.site-footer {
  border-top: 1px solid var(--border);
  padding: 18px 20px 28px;
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
}
.site-footer p { margin: 0; }

@media (max-width: 640px) {
  .logo { height: 58px; }
  .header-inner { padding: 14px 16px; gap: 12px; }
  .draft-badge { width: 100%; text-align: center; }
  .maps-link { margin-left: 0; width: 100%; text-align: center; }
  .grid { grid-auto-rows: 30rem; gap: 12px; }
  .score-num { font-size: 2.4rem; }
  main { padding: 18px 14px 48px; }
}
