:root {
  --bg: #fafaf8; --card: #fff; --text: #1d1d1b; --muted: #6b6b66;
  --line: #e4e4de; --accent: #1f5fbf; --star: #e8a200; --err: #b3261e;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #151514; --card: #1e1e1c; --text: #ececE8; --muted: #9a9a93;
          --line: #33332f; --accent: #6ea2f0; --star: #f0b429; --err: #f2766e; }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; }
header { border-bottom: 1px solid var(--line); padding: 14px max(16px, env(safe-area-inset-right)) 14px max(16px, env(safe-area-inset-left)); padding-top: max(14px, env(safe-area-inset-top)); }
.notice { margin: 0; padding: 10px max(16px, env(safe-area-inset-right)) 10px max(16px, env(safe-area-inset-left));
  padding-top: max(10px, env(safe-area-inset-top)); text-align: center; font-size: .9rem;
  background: var(--card); background: color-mix(in srgb, var(--accent) 12%, var(--bg));
  border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.notice a { font-weight: 600; }
.notice + header { padding-top: 14px; }
.brand { color: var(--text); text-decoration: none; font-weight: 700; font-size: 1.15rem; }
.brand span { color: var(--muted); font-weight: 400; font-size: .9rem; margin-left: 6px; }
main { max-width: 960px; margin: 0 auto; padding: 20px max(16px, env(safe-area-inset-right)) calc(48px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); }
a { color: var(--accent); }
.filters { display: flex; gap: 10px; flex-wrap: wrap; margin: 0 -16px 12px; padding: 10px 16px; position: sticky; top: 0; z-index: 5; background: var(--bg); border-bottom: 1px solid var(--line); }
input, select, textarea, button { font: inherit; font-size: 16px; color: var(--text); background: var(--card);
  border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; min-height: 44px; }
.filters input { flex: 1 1 220px; }
.filters select { flex: 1 1 220px; }
.count { color: var(--muted); margin: 0 0 12px; font-size: .9rem; }
.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.card { display: flex; gap: 12px; align-items: center; padding: 12px; background: var(--card);
  border: 1px solid var(--line); border-radius: 10px; text-decoration: none; color: inherit; }
.card:hover { border-color: var(--accent); }
.card:active { background: var(--bg); }
.card > div { min-width: 0; }
.avatar { width: 56px; height: 68px; border-radius: 6px; object-fit: cover; background: var(--line); flex: none; }
.card h3 { margin: 0; font-size: 1rem; }
.sub { margin: 2px 0 0; color: var(--muted); font-size: .85rem; }
.rating { margin-top: 4px; font-size: .85rem; color: var(--muted); }
.stars { color: var(--star); letter-spacing: 1px; }
.profile { display: flex; gap: 16px; align-items: center; margin-bottom: 20px; }
.profile .avatar { width: 96px; height: 116px; }
.profile h1 { margin: 0; font-size: 1.5rem; }
form.review { background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  padding: 14px; margin-bottom: 24px; display: grid; gap: 10px; }
form.review h2 { margin: 0; font-size: 1.05rem; }
textarea { min-height: 90px; resize: vertical; width: 100%; }
button.primary { background: var(--accent); color: #fff; border-color: var(--accent); cursor: pointer; font-weight: 600; }
.back { display: inline-block; padding: 10px 0; }
.star-picker { display: flex; gap: 4px; }
.star { flex: 1; max-width: 64px; font-size: 28px; line-height: 1; padding: 6px 0; color: var(--line); cursor: pointer; }
.star.on { color: var(--star); border-color: var(--star); }
button:disabled { opacity: .6; cursor: default; }
.err { color: var(--err); margin: 0; min-height: 1.2em; font-size: .9rem; }
.review-item { border-top: 1px solid var(--line); padding: 12px 0; }
.review-item p { margin: 6px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.meta { color: var(--muted); font-size: .85rem; overflow-wrap: anywhere; }
.review-item strong, .sub, .card h3, .profile h1 { overflow-wrap: anywhere; }
.empty { color: var(--muted); }

@media (max-width: 520px) {
  main { padding-top: 12px; }
  .grid { grid-template-columns: 1fr; gap: 10px; }
  .profile { gap: 12px; }
  .profile .avatar { width: 80px; height: 98px; }
  .profile h1 { font-size: 1.25rem; }
  .brand span { display: none; }
}
