/* Clean, list-first, score-led: white ground, one deep teal, bold sans names,
   a ringed score out of 10 on every row, pill filters. */
:root {
  --bg: #ffffff; --surface: #f3f6f6; --ink: #0f1a1a; --muted: #5f6e6e; --faint: #98a4a4;
  --line: #e7ecec; --brand: #0b5d63; --brand-ink: #ffffff; --tint: #e4f1f1;
  --good: #14804a; --warn: #a06c00; --hot: #c4432b;
  --sans: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c1313; --surface: #162020; --ink: #edf3f3; --muted: #94a3a3; --faint: #687777;
    --line: #223030; --brand: #5cc6c4; --brand-ink: #062a2c; --tint: #133031;
    --good: #55cc8e; --warn: #e2b14c; --hot: #f2826c;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 15.5px/1.45 var(--sans); -webkit-font-smoothing: antialiased;
  padding: env(safe-area-inset-top) 0 calc(env(safe-area-inset-bottom) + 64px);
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 6px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

.top, main { max-width: 620px; margin: 0 auto; padding: 0 20px; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding-top: 26px; padding-bottom: 16px; }
h1 { font: 800 1.55rem/1.1 var(--sans); letter-spacing: -0.035em; margin: 0; white-space: nowrap; color: var(--brand); }

/* Location chip */
.pill {
  border: 1px solid var(--line); background: var(--bg); border-radius: 999px; padding: 7px 13px 7px 11px;
  font-size: .84rem; font-weight: 600; color: var(--ink);
  max-width: 50vw; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: border-color .15s, background .15s;
}
.pill::before {
  content: ""; display: inline-block; width: 13px; height: 13px; margin-right: 5px; vertical-align: -2px; background: var(--brand);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2a7 7 0 0 0-7 7c0 5.2 7 13 7 13s7-7.8 7-13a7 7 0 0 0-7-7zm0 9.5a2.5 2.5 0 1 1 0-5 2.5 2.5 0 0 1 0 5z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2a7 7 0 0 0-7 7c0 5.2 7 13 7 13s7-7.8 7-13a7 7 0 0 0-7-7zm0 9.5a2.5 2.5 0 1 1 0-5 2.5 2.5 0 0 1 0 5z'/%3E%3C/svg%3E") center / contain no-repeat;
}
.pill:hover { border-color: var(--faint); }
.pill.unset { background: var(--tint); border-color: transparent; color: var(--brand); }

/* Add box */
.add {
  display: flex; gap: 8px; align-items: flex-end; background: var(--surface);
  border: 1.5px solid transparent; border-radius: 16px; padding: 5px 5px 5px 16px; transition: border-color .15s, background .15s;
}
.add:focus-within { border-color: var(--brand); background: var(--bg); }
.add textarea { flex: 1; border: 0; outline: 0; background: transparent; resize: none; padding: 10px 0; max-height: 160px; min-width: 0; }
.add textarea::placeholder, .field input::placeholder, .field textarea::placeholder, #search::placeholder { color: var(--faint); }
.add button, .btn {
  border: 1.5px solid var(--brand); background: var(--brand); color: var(--brand-ink); font-weight: 700; font-size: .9rem;
  border-radius: 999px; padding: 9px 18px; white-space: nowrap; transition: opacity .15s;
}
.add button { border-radius: 12px; }
.add button:hover, .btn:hover { opacity: .88; }
.btn.ghost { background: transparent; color: var(--brand); border-color: var(--line); }
.btn.danger { background: transparent; border-color: transparent; color: var(--muted); padding-inline: 4px 12px; font-weight: 600; }
.btn.danger:hover { color: var(--hot); }
.btn:disabled, .add button:disabled { opacity: .35; cursor: default; }

.jobs { display: grid; gap: 6px; margin-top: 10px; }
.job { display: flex; gap: 10px; align-items: center; font-size: .86rem; font-weight: 500; padding: 9px 12px; border-radius: 12px; background: var(--surface); color: var(--muted); }
.job.ok { color: var(--good); } .job.bad { color: var(--hot); }
.job button { margin-left: auto; border: 0; background: none; color: var(--faint); font-size: 1.1rem; line-height: 1; padding: 0 2px; }
.spin { width: 13px; height: 13px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--brand); animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Tabs */
.tabs { display: flex; gap: 26px; margin: 22px 0 0; border-bottom: 1px solid var(--line); }
.tabs button {
  border: 0; background: none; padding: 0 0 11px; margin-bottom: -1px; color: var(--faint);
  font: 700 1rem var(--sans); letter-spacing: -0.01em; border-bottom: 2.5px solid transparent; transition: color .15s;
}
.tabs button:hover { color: var(--ink); }
.tabs button[aria-selected="true"] { color: var(--brand); border-bottom-color: var(--brand); }
.tabs span { font-weight: 600; font-size: .78rem; color: var(--faint); margin-left: 2px; font-variant-numeric: tabular-nums; }

/* Filter chips: one scrollable row */
.controls {
  display: flex; gap: 8px; align-items: center; padding: 14px 20px 6px; margin: 0 -20px;
  overflow-x: auto; scrollbar-width: none; font-size: .84rem;
}
.controls::-webkit-scrollbar { display: none; }
.controls > * { flex: none; }
.select select, .chips button, #search {
  border: 1px solid var(--line); background: var(--bg); color: var(--ink); border-radius: 999px;
  padding: 7px 13px; font-size: .84rem; font-weight: 600; transition: border-color .15s, background .15s, color .15s;
}
.select select {
  appearance: none; -webkit-appearance: none; cursor: pointer; padding-right: 28px;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(-45deg, transparent 50%, currentColor 50%);
  background-size: 5px 5px; background-position: right 16px center, right 11px center; background-repeat: no-repeat;
}
.select select:hover, .chips button:hover { border-color: var(--faint); }
.chips { display: flex; gap: 6px; }
.chips button { min-width: 40px; }
.chips button[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
#search { flex: 1 0 120px; min-width: 120px; font-weight: 500; outline: 0; }
#search:focus { border-color: var(--brand); }

.discover { margin-top: 10px; padding: 14px 16px; border-radius: 16px; background: var(--tint); display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; font-size: .9rem; }
.discover p { margin: 0; flex: 1 1 220px; color: var(--ink); }

/* The list */
.list { list-style: none; margin: 0; padding: 0; }
.card {
  display: grid; grid-template-columns: 1fr auto; column-gap: 14px;
  padding: 17px 0 16px; border-bottom: 1px solid var(--line); cursor: pointer;
}
.card .main { min-width: 0; }
.card h2 { margin: 0; font: 700 1.08rem/1.3 var(--sans); letter-spacing: -0.015em; overflow-wrap: anywhere; }
.rank { font-variant-numeric: tabular-nums; }
.sub { color: var(--muted); font-size: .88rem; margin-top: 2px; overflow-wrap: anywhere; }
.sub::first-letter { text-transform: uppercase; }

/* Score ring */
.score {
  width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; align-self: start; margin-top: 1px;
  font-weight: 700; font-size: .98rem; letter-spacing: -0.02em; font-variant-numeric: tabular-nums;
  border: 1.5px solid color-mix(in srgb, currentColor 38%, transparent);
}
.s-hi { color: var(--good); } .s-mid { color: var(--warn); } .s-lo { color: var(--hot); }

.facts { display: flex; flex-wrap: wrap; align-items: center; column-gap: 12px; row-gap: 4px; margin-top: 7px; font-size: .83rem; color: var(--muted); }
.facts:empty { display: none; }
.tag { white-space: nowrap; font-weight: 500; }
.tag.d-easy, .tag.d-mid, .tag.d-hard { color: var(--ink); }
.tag.d-easy::before, .tag.d-mid::before, .tag.d-hard::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; background: var(--good); }
.tag.d-mid::before { background: var(--warn); } .tag.d-hard::before { background: var(--hot); }
.tag.buzz, .tag.keen { background: var(--tint); color: var(--brand); border-radius: 999px; padding: 2px 9px; font-weight: 700; font-size: .76rem; }
.tag.stars { color: var(--brand); letter-spacing: .05em; }
.tag.dim { color: var(--faint); font-weight: 400; }
.blurb { font-size: .87rem; color: var(--muted); margin-top: 6px; overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }

.actions { grid-column: 1 / -1; display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; align-items: center; }
.actions a, .actions button {
  text-decoration: none; border: 1px solid var(--line); background: var(--bg); color: var(--ink);
  border-radius: 999px; padding: 6px 14px; font-size: .82rem; font-weight: 600; transition: border-color .15s, opacity .15s;
}
.actions a:hover, .actions button:hover { border-color: var(--faint); }
.actions .primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.actions .primary:hover { opacity: .88; border-color: var(--brand); }

.empty { text-align: center; color: var(--muted); padding: 60px 12px; }
.empty h3 { color: var(--ink); font: 700 1.25rem var(--sans); letter-spacing: -0.02em; margin: 0 0 6px; }
.empty p { margin: 4px auto; max-width: 40ch; font-size: .92rem; }

/* Sheets */
.sheet { border: 0; padding: 0; background: var(--bg); color: var(--ink); width: min(560px, 100vw); max-width: 100vw; max-height: min(92dvh, 900px); border-radius: 22px; margin: auto; box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .45); }
.sheet::backdrop { background: rgba(8, 20, 20, .5); }
@media (max-width: 640px) { .sheet { margin: auto 0 0; border-radius: 22px 22px 0 0; width: 100vw; } }
.sheet form { padding: 24px 22px calc(20px + env(safe-area-inset-bottom)); display: grid; gap: 18px; }
.sheet header { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.sheet header > div:first-child { flex: 1; min-width: 0; }
.sheet h2 { margin: 0; font: 800 1.45rem/1.15 var(--sans); letter-spacing: -0.03em; overflow-wrap: anywhere; }
.sheet .actions { margin: 0; }
.sheet .actions a { padding: 8px 16px; font-size: .86rem; }
.x { border: 0; background: var(--surface); color: var(--muted); width: 32px; height: 32px; font-size: 1.25rem; line-height: 1; flex: none; border-radius: 50%; }
.x:hover { color: var(--ink); }
.field { display: grid; gap: 7px; font-size: .82rem; font-weight: 700; color: var(--ink); min-width: 0; }
.field input, .field select, .field textarea {
  border: 1.5px solid transparent; background: var(--surface); color: var(--ink); border-radius: 12px;
  padding: 10px 13px; font-size: .96rem; font-weight: 400; width: 100%; min-width: 0; outline: 0; transition: border-color .15s, background .15s;
}
.field input:focus, .field textarea:focus { border-color: var(--brand); background: var(--bg); }
.field textarea { min-height: 76px; resize: vertical; line-height: 1.45; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.seg { display: flex; gap: 4px; background: var(--surface); border-radius: 12px; padding: 4px; }
.seg button { flex: 1; border: 0; background: none; border-radius: 9px; padding: 7px 0; color: var(--muted); font-size: .86rem; font-weight: 600; transition: background .15s, color .15s; }
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed="true"] { background: var(--brand); color: var(--brand-ink); }
.info { background: var(--surface); border-radius: 16px; padding: 14px 16px; font-size: .9rem; display: grid; gap: 8px; }
.info b { font-weight: 700; }
.why { display: grid; gap: 8px; font-size: .82rem; color: var(--muted); }
.why div { display: grid; grid-template-columns: 140px 1fr 40px; gap: 10px; align-items: center; }
.bar { height: 6px; border-radius: 3px; background: var(--surface); overflow: hidden; } .bar i { display: block; height: 100%; border-radius: 3px; background: var(--brand); }
.sources { margin: 0; padding: 0; list-style: none; display: grid; gap: 4px; font-size: .9rem; font-weight: 400; }
.sources a { color: var(--brand); text-decoration: none; overflow-wrap: anywhere; }
.sources a:hover { text-decoration: underline; }
.foot { display: flex; gap: 8px; justify-content: space-between; align-items: center; flex-wrap: wrap; padding-top: 2px; }
.foot > div { display: flex; gap: 6px; align-items: center; }
.hint { font-size: .82rem; color: var(--muted); margin: 0; line-height: 1.5; font-weight: 400; }
.hint code { background: var(--surface); padding: 1px 5px; border-radius: 4px; font-size: .88em; overflow-wrap: anywhere; }
.textlink { color: var(--brand); font-weight: 600; text-decoration: none; } .textlink:hover { text-decoration: underline; }
#signin::backdrop { background: var(--bg); }
.err { color: var(--hot); font-size: .86rem; margin: 0; }
.err:empty { display: none; }
details summary { cursor: pointer; font-size: .88rem; font-weight: 700; color: var(--brand); list-style: none; }
details summary::-webkit-details-marker { display: none; }
details summary::after { content: " +"; }
details[open] summary::after { content: " –"; }

@media (max-width: 420px) {
  .top, main { padding: 0 16px; }
  .controls { margin: 0 -16px; padding-inline: 16px; }
  h1 { font-size: 1.4rem; }
  .tabs { gap: 22px; }
  .why div { grid-template-columns: 120px 1fr 36px; }
}
