:root {
  --bg: #f6f6f4;
  --surface: #ffffff;
  --surface-2: #f0efec;
  --text: #17181a;
  --muted: #62656b;
  --border: #e2e1dc;
  --accent: #ff5a1f;
  --accent-ink: #ffffff;
  --accent-soft: #fff0e9;
  --header: #15171a;
  --header-text: #f4f4f2;
  --star: #f5a623;
  --good: #1f8a4c;
  --good-soft: #e6f4ec;
  --bad: #c62828;
  --bad-soft: #fdecec;
  --warn: #a15c00;
  --warn-soft: #fff4e0;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 4px 16px rgba(0,0,0,.05);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1012; --surface: #17191c; --surface-2: #1f2226; --text: #ececea; --muted: #9a9ea5;
    --border: #2a2d32; --accent-soft: #3a1d12; --header: #0a0b0c; --good-soft: #10291c; --bad-soft: #341517;
    --warn-soft: #33250f; --good: #4cc47f; --bad: #ff6b6b; --warn: #f0a940; --shadow: none;
  }
}
:root[data-theme="dark"] {
  --bg: #0f1012; --surface: #17191c; --surface-2: #1f2226; --text: #ececea; --muted: #9a9ea5;
  --border: #2a2d32; --accent-soft: #3a1d12; --header: #0a0b0c; --good-soft: #10291c; --bad-soft: #341517;
  --warn-soft: #33250f; --good: #4cc47f; --bad: #ff6b6b; --warn: #f0a940; --shadow: none;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.55 Inter, system-ui, -apple-system, sans-serif; }
a { color: inherit; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .4em; letter-spacing: -0.01em; }
h1 { font-size: clamp(28px, 5vw, 44px); font-weight: 800; }
h2 { font-size: 22px; font-weight: 700; }
h3 { font-size: 17px; font-weight: 700; }
p { margin: 0 0 1em; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
main { min-height: 70vh; padding-top: 28px; padding-bottom: 60px; outline: none; }

/* header */
.site-header { background: var(--header); color: var(--header-text); position: sticky; top: 0; z-index: 10;
  border-bottom: 3px solid transparent; border-image: repeating-linear-gradient(90deg, #fff 0 8px, #111 8px 16px) 3; }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 60px; }
.brand { font-weight: 800; font-size: 19px; text-decoration: none; display: flex; align-items: center; gap: 10px; letter-spacing: -0.02em; }
.brand-mark { width: 22px; height: 22px; border-radius: 6px; background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Crect width='32' height='32' rx='6' fill='%23ff5a1f'/%3E%3Crect x='7' y='7' width='6' height='6' fill='white'/%3E%3Crect x='19' y='7' width='6' height='6' fill='white'/%3E%3Crect x='13' y='13' width='6' height='6' fill='white'/%3E%3Crect x='7' y='19' width='6' height='6' fill='white'/%3E%3Crect x='19' y='19' width='6' height='6' fill='white'/%3E%3Crect x='7' y='7' width='18' height='18' fill='none' stroke='white' stroke-width='1.5'/%3E%3C/svg%3E") center/100% no-repeat; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-tag { font-size: 11px; font-weight: 500; letter-spacing: 0; opacity: .65; margin-top: 2px; }
@media (max-width: 520px) { .brand-tag { display: none; } }
.nav { display: flex; align-items: center; gap: 18px; font-size: 14px; }
.nav a:not(.btn) { text-decoration: none; opacity: .8; }
.nav a:not(.btn):hover { opacity: 1; }
@media (max-width: 720px) { .nav a:not(.btn) { display: none; } }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--border); background: var(--surface);
  color: var(--text); padding: 10px 16px; border-radius: 10px; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; }
.btn:hover { border-color: var(--muted); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { filter: brightness(1.05); border-color: var(--accent); }
.btn-sm { padding: 7px 12px; font-size: 13px; }
.btn-danger { color: var(--bad); border-color: var(--bad-soft); }
.btn-danger:hover { border-color: var(--bad); }
.btn[disabled] { opacity: .6; cursor: wait; }

/* hero */
.hero { padding: 16px 0 24px; max-width: 760px; }
.hero p { font-size: 17px; color: var(--muted); }
.statline { display: flex; gap: 24px; flex-wrap: wrap; margin-top: 12px; font-size: 14px; color: var(--muted); }
.statline b { color: var(--text); font-size: 18px; }

/* filters */
.filters { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; margin: 8px 0 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.chip { border: 1px solid var(--border); background: var(--surface); border-radius: 999px; padding: 6px 12px; font: inherit; font-size: 13px; cursor: pointer; color: var(--text); }
.chip[aria-pressed="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }
@media (max-width: 720px) { .filters { grid-template-columns: 1fr 1fr; } .filters .search { grid-column: 1 / -1; } }

input, select, textarea { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: var(--accent); }
textarea { min-height: 160px; resize: vertical; }

/* cards */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
@media (max-width: 400px) { .grid { grid-template-columns: 1fr; } }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.team-card { display: flex; flex-direction: column; gap: 10px; text-decoration: none; transition: border-color .15s, transform .15s; }
.team-card:hover { border-color: var(--muted); transform: translateY(-1px); }
.team-card h3 { margin: 0; }
.team-card .meta { font-size: 13px; color: var(--muted); }
.team-card .foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: auto; padding-top: 8px; border-top: 1px solid var(--border); font-size: 13px; }

.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font-size: 11px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; padding: 3px 8px; border-radius: 6px; background: var(--surface-2); color: var(--muted); }
.flag { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 4px 9px; border-radius: 6px; background: var(--bad-soft); color: var(--bad); }
.flag.warn { background: var(--warn-soft); color: var(--warn); }
.ok { display: inline-flex; font-size: 12px; font-weight: 600; padding: 4px 9px; border-radius: 6px; background: var(--good-soft); color: var(--good); }

.stars { color: var(--star); letter-spacing: 1px; white-space: nowrap; }
.stars .off { color: var(--border); }
.rating-inline { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.no-reviews { color: var(--muted); font-style: italic; }

/* team page */
.back { display: inline-block; margin-bottom: 14px; font-size: 14px; color: var(--muted); text-decoration: none; }
.team-head { display: grid; grid-template-columns: 1fr auto; gap: 20px; align-items: start; margin-bottom: 20px; }
@media (max-width: 720px) { .team-head { grid-template-columns: 1fr; } }
.team-facts { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 14px; color: var(--muted); margin: 8px 0; }
.summary-grid { display: grid; grid-template-columns: 240px 1fr 1fr; gap: 14px; margin-bottom: 28px; }
@media (max-width: 860px) { .summary-grid { grid-template-columns: 1fr; } }
.big-score { font-size: 52px; font-weight: 800; line-height: 1; letter-spacing: -0.03em; }
.bar-row { display: grid; grid-template-columns: 130px 1fr 32px; align-items: center; gap: 10px; font-size: 13px; margin-bottom: 8px; }
.bar { height: 8px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.issue-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }

.review { margin-bottom: 14px; }
.review-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.review-body { white-space: pre-wrap; }
.review-scores { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 12px; color: var(--muted); margin: 8px 0 10px; }
.response { margin-top: 12px; padding: 12px 14px; border-left: 3px solid var(--accent); background: var(--surface-2); border-radius: 0 8px 8px 0; }
.response .label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }

/* forms */
.form { max-width: 720px; }
.form .card { margin-bottom: 16px; }
.field { margin-bottom: 16px; }
.field label, .field .label { display: block; font-weight: 600; margin-bottom: 6px; }
.field .hint { font-size: 13px; color: var(--muted); margin-top: 4px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 600px) { .row { grid-template-columns: 1fr; } }
.star-input { display: inline-flex; flex-direction: row-reverse; gap: 2px; }
.star-input input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.star-input label { font-size: 28px; line-height: 1; cursor: pointer; color: var(--border); margin: 0; font-weight: 400; }
.star-input label:hover, .star-input label:hover ~ label, .star-input input:checked ~ label { color: var(--star); }
.star-input input:focus-visible + label { outline: 2px solid var(--accent); border-radius: 4px; }
.rating-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.rating-row:last-child { border-bottom: 0; }
.rating-row .desc { font-size: 13px; color: var(--muted); }
.checks { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
@media (max-width: 600px) { .checks { grid-template-columns: 1fr; } }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400 !important; cursor: pointer; }
.check input { width: 18px; height: 18px; margin: 2px 0 0; flex: none; accent-color: var(--accent); }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.seg label { margin: 0; padding: 9px 18px; cursor: pointer; font-weight: 600; }
.seg input { position: absolute; opacity: 0; }
.seg input:checked + span { color: var(--accent); }
.seg label:has(input:checked) { background: var(--accent-soft); }
.errors { background: var(--bad-soft); color: var(--bad); border-radius: 10px; padding: 12px 16px; margin-bottom: 16px; }
.errors ul { margin: 0; padding-left: 18px; }
.success { text-align: center; padding: 40px 20px; }
.notice { background: var(--warn-soft); color: var(--text); border-radius: 10px; padding: 12px 16px; font-size: 14px; margin-bottom: 16px; }

/* team combobox */
.combo { position: relative; }
.combo input.chosen { padding-right: 36px; background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5' stroke='%231f8a4c' stroke-width='2.6' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") right 12px center/18px no-repeat; }
.combo-list { position: absolute; z-index: 5; left: 0; right: 0; top: calc(100% + 4px); margin: 0; padding: 4px; list-style: none;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.12); max-height: 320px; overflow-y: auto; }
.combo-list [role=option] { display: flex; flex-direction: column; gap: 1px; padding: 8px 10px; border-radius: 7px; cursor: pointer; }
.combo-list [role=option]:hover, .combo-list [aria-selected=true] { background: var(--accent-soft); }
.combo-name { font-weight: 600; }
.combo-name mark { background: none; color: var(--accent); }
.combo-meta { font-size: 12px; color: var(--muted); }
.combo-empty { padding: 10px; color: var(--muted); font-size: 14px; }
.counter { font-size: 13px; color: var(--muted); margin-top: 6px; font-variant-numeric: tabular-nums; }
.counter.met { color: var(--good); }

/* guide */
.prose { max-width: 760px; }
.prose h2 { margin-top: 32px; }
.prose li { margin-bottom: 6px; }
.checklist { list-style: none; padding: 0; }
.checklist li { padding-left: 28px; position: relative; margin-bottom: 10px; }
.checklist li::before { content: ""; position: absolute; left: 0; top: 3px; width: 16px; height: 16px; border: 2px solid var(--accent); border-radius: 4px; }

.site-footer { border-top: 1px solid var(--border); padding: 24px 0 40px; color: var(--muted); font-size: 13px; }
.empty { text-align: center; padding: 60px 20px; color: var(--muted); }

/* ---------- team pages and owner tools ---------- */
html { scroll-padding-top: 80px; }
.center { text-align: center; }
.section { margin: 28px 0; }
.verified { display: inline-flex; align-items: center; font-size: 11px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase;
  padding: 3px 8px; border-radius: 6px; background: var(--good-soft); color: var(--good); }
.team-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
@media (max-width: 720px) { .team-actions { align-items: stretch; text-align: center; } }
.team-facts a { color: var(--text); }
.about { margin-bottom: 8px; }
.about p:last-child { margin-bottom: 0; }
.car-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.car-card h3 { margin: 8px 0 4px; }
.car-card p { margin: 0; }

.form.narrow { max-width: 480px; margin: 0 auto; }
.notice.good { background: var(--good-soft); }
.linklike { background: none; border: 0; padding: 0; font: inherit; color: inherit; text-decoration: underline; cursor: pointer; }
.row-card { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.inline-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.manage { max-width: 860px; }
.manage > .card { margin-bottom: 16px; }
.manage-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.manage-head h1 { margin: 0; }
.subnav { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; position: sticky; top: 63px; z-index: 4; background: var(--bg); padding: 8px 0; }
.subnav a { text-decoration: none; font-size: 14px; font-weight: 600; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); }
.subnav .count { color: var(--muted); font-weight: 500; }
.section-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.row3 { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 14px; }
@media (max-width: 600px) { .row3 { grid-template-columns: 1fr 1fr; } .row3 .field:first-child { grid-column: 1 / -1; } }
.car-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 0; border-bottom: 1px solid var(--border); }
.car-row:last-child { border-bottom: 0; }
.car-form { background: var(--surface-2); border-radius: 10px; padding: 14px; margin: 10px 0; }
.btn[disabled] { opacity: .4; cursor: default; }
.owner-review { padding: 16px 0; border-bottom: 1px solid var(--border); }
.owner-review:last-child { border-bottom: 0; }
.owner-review summary { cursor: pointer; color: var(--muted); margin-top: 6px; }
.member-list { list-style: none; padding: 0; margin: 0 0 12px; }
.member-list li { padding: 6px 0; }
.soon { background: var(--surface-2); box-shadow: none; }
.soon p { margin: 0; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; z-index: 50;
  background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: 999px; font-weight: 600; font-size: 14px; transition: opacity .2s, transform .2s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (prefers-reduced-motion: reduce) { .toast { transition: none; } }
