:root { color-scheme: light; }
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: #faf9f7;
  color: #2b2620;
}
.topbar {
  background: #fff;
  border-bottom: 1px solid #ece7de;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar .brand { font-weight: 700; font-size: 16px; }
.topbar a { font-size: 13px; color: #8a6d2f; text-decoration: none; font-weight: 600; }
.wrap { max-width: 1100px; margin: 0 auto; padding: 24px 20px 60px; }
.title { font-size: 20px; font-weight: 700; margin: 0 0 4px; }
.subtitle { font-size: 13px; color: #766f63; margin: 0 0 20px; }
.status { font-size: 13px; color: #8a8378; margin-bottom: 16px; }

.tab-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.tab-row button {
  background: #fff; border: 1px solid #ddd6c8; color: #4a453c;
  padding: 7px 14px; border-radius: 999px; font-size: 12.5px; font-weight: 600; cursor: pointer;
}
.tab-row button.selected { background: #2b2620; border-color: #2b2620; color: #fff; }
.tab-row button .dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: #6fae6f; margin-right: 6px; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}
.card {
  background: #fff;
  border: 1px solid #ece7de;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.card-media { position: relative; }
.card img { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; background: #f0ede6; }
.score-badge {
  position: absolute; top: 10px; right: 10px;
  background: rgba(43,38,32,0.82); color: #fff;
  font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px;
}
.card-body { padding: 14px 16px 18px; }
.caption { font-size: 15px; font-weight: 600; margin-bottom: 6px; }
.meta { font-size: 12.5px; color: #766f63; line-height: 1.6; }
.meta strong { color: #4a453c; }
.tag-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.tag { font-size: 11px; padding: 3px 9px; border-radius: 999px; background: #f4efe4; color: #8a6d2f; font-weight: 600; }

/* Admin */
.admin-login {
  max-width: 360px; margin: 60px auto; background: #fff; border: 1px solid #ece7de;
  border-radius: 14px; padding: 24px; text-align: center;
}
.admin-login input {
  width: 100%; padding: 10px 12px; margin: 10px 0; border: 1px solid #ddd6c8; border-radius: 8px; font-size: 14px;
}
.admin-login button, .save-btn {
  background: #2b2620; color: #fff; border: none; padding: 10px 18px;
  border-radius: 8px; font-weight: 600; cursor: pointer; font-size: 13px;
}
.admin-login .note { font-size: 12px; color: #8a8378; margin-top: 10px; }
.admin-card { background: #fff; border: 1px solid #ece7de; border-radius: 14px; overflow: hidden; margin-bottom: 24px; display: flex; flex-wrap: wrap; }
.admin-card img { width: 260px; height: 260px; object-fit: cover; flex-shrink: 0; }
.admin-card-body { padding: 18px 20px; flex: 1; min-width: 260px; }
.rate-row { margin-bottom: 16px; }
.rate-label { font-size: 13px; font-weight: 700; margin-bottom: 6px; display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.rate-label span.hint { font-weight: 400; color: #8a8378; }
.seg { display: flex; gap: 6px; }
.seg button {
  width: 38px; height: 38px; border-radius: 8px; border: 1px solid #ddd6c8; background: #fff;
  font-weight: 700; cursor: pointer; font-size: 14px; color: #4a453c;
}
.seg button.selected { background: #d9a441; border-color: #d9a441; color: #fff; }
.participation-toggle { display: flex; align-items: center; gap: 8px; }
.total-line {
  display: flex; justify-content: space-between; align-items: center;
  border-top: 1px solid #ece7de; padding-top: 12px; margin-top: 4px;
}
.total-line .num { font-size: 22px; font-weight: 700; }
.existing-ratings { margin-top: 14px; font-size: 12px; color: #766f63; }
.existing-ratings table { width: 100%; border-collapse: collapse; margin-top: 6px; }
.existing-ratings th, .existing-ratings td { text-align: left; padding: 4px 6px; border-bottom: 1px solid #f0ede6; }

.error {
  padding: 14px 16px; background: #fbeaea; border: 1px solid #f0c9c9;
  border-radius: 10px; color: #a13d3d; font-size: 13px;
}
.hidden { display: none !important; }
