:root {
  --bg: #F3F5F4;  /* soft grey-green, calm on phones */
  --ink: #1f2428;
  --muted: #5b6770;
  --card: #F1F4F3;
  --border: #d7dde3;
  --chip: #ffffff;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
}

.sub strong {
  color: var(--muted);
  font-weight: 700;
  letter-spacing: 0.2px;
}

.wrap {
  max-width: 860px;
  margin: 0 auto;
  padding: 18px 16px;
}

.kicker {
  margin: 0;
  color: var(--muted);
  letter-spacing: 0.02em;
}

h1 {
  margin: 6px 0 6px;
  font-size: 1.8rem;
  line-height: 1.2;
}

.sub {
  margin: 0 0 14px;
  color: var(--muted);
}

.note {
  border: 1px solid var(--border);
  background: #fff;
  padding: 10px 12px;
  border-radius: 12px;
  margin: 12px 0 12px;
}

/* Ask (silent start) */
.ask-details { margin: 10px 0 8px; text-align: center; }

.ask-summary {
  list-style: none;
  cursor: pointer;
  display: inline-block;
  margin: 0 auto;
  padding: 14px 36px;
  min-width: 200px;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  background: #ffffff;
  color: var(--ink);
  font-size: 1.1rem;
  text-align: center;
}

.ask-title {
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 10px;
  letter-spacing: 0.2px;
}

.ask-prompts {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.ask-prompts button {
  width: 100%;
  text-align: left;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #F9FAFA;
  letter-spacing: 0.3px;
  line-height: 1.4;
  font-size: 1rem;
  color: var(--ink);
}

.ask-input {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 12px;
}

.ask-input input {
  flex: 1;
  padding: 12px 14px;
  font-size: 1.08rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background-color: #F2F4F3;
}

.ask-input input::placeholder {
  font-size: 1.05rem;
  color: var(--muted);
  letter-spacing: 0.2px;
}

.ask-input input:focus {
  outline: none;
  border-color: #B8C6C1;
}

.ask-input button {
  min-height: 44px;
  width: 85%;
  align-self: center;
  background-color: #B8C6C1;
  color: #2F2F2F;
  border: none;
  padding: 12px 26px 12px 20px;
  font-size: 17px;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  letter-spacing: 0.3px;
}

.ask-input button:hover {
  opacity: 0.9;
}

.ask-answer {
  margin-top: 14px;
}

.ask-summary:hover,
.ask-summary:focus {
  border-color: #b8c2ca;
}

.ask-details .note,
.ask-details .chips,
.ask-details .muted-line {
  text-align: left;
}

.ask-summary::-webkit-details-marker {
  display: none;
}

.ask-details[open] .ask-summary {
  border-color: #b8c2ca;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 12px;
}

.chips button {
  background: #FFFFFF;
  border: 1px solid #B8C6C1;
  border-radius: 999px;
  padding: 0.7rem 1rem;
  font: inherit;
  color: #2b2b2b;
  cursor: pointer;
}

.chips button:hover,
.chips button:focus {
  background: #F3F5F4;
  border-color: #aebdb7;
}

.chip {
  display: inline-block;
  padding: 8px 10px;
  background: var(--chip);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--ink);
  text-decoration: none;
  font-size: 0.95rem;
}

.chip:focus,
.chip:hover,
.ask-summary:focus,
.ask-summary:hover {
  border-color: #b8c2ca;
}

.muted-line {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.hint {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.listen-btn {
  margin: 8px 0 12px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--muted);
  font-size: 0.95rem;
  cursor: pointer;
}

.listen-btn:hover,
.listen-btn:focus {
  border-color: #b8c2ca;
  color: var(--ink);
}

.divider {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 16px 0 10px;
}

.browse-label {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 0.95rem;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
}

.sub span + span::before {
  content: " • ";
  color: var(--muted);
}

a.card {
  text-decoration: none;
  color: inherit;
  display: block;
  background: #F7F9F8;
  border-color: #cfd7dc;
  box-shadow: 0 1px 0 rgba(0,0,0,0.03);
}

a.card:active {
  opacity: 0.92;
}

.horse-title {
  font-size: 1.38rem;
  font-weight: 700;
  line-height: 1.18;
  letter-spacing: 0.3px;
  margin-bottom: 8px;
}

/* Tighten card spacing without affecting Ask UI elsewhere */
.card .sub {
  margin: 6px 0 0;
}

.card .muted-line {
  margin-top: 6px;
}

.runner-title {
  margin: 0 0 4px 0;
}

.card-details { padding: 0; }

.card-summary {
  list-style: none;
  cursor: pointer;
  padding: 14px;
  font-weight: 600;
  color: var(--muted);
}

.row-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.runner-title {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 1.45rem;
  font-weight: 700;
  line-height: 1.18;
  color: var(--ink);
  margin: 0 0 8px 0;
  word-break: break-word;
}

.silks {
  flex: 0 0 auto;
  width: 110px;
  height: auto;
  max-height: 64px;
  object-fit: contain;
  display: block;
}

@media (max-width: 380px) {
  .silks { width: 84px; max-height: 56px; }
  .runner-title { font-size: 1.32rem; }
}

.card-summary::-webkit-details-marker {
  display: none;
}

.card-summary::after {
  content: "›";
  float: right;
  color: var(--muted);
}

.card-details[open] .card-summary {
  color: var(--ink);
  border-bottom: 1px solid var(--border);
  margin-bottom: 10px;
}

.card-details[open] .card-summary::after {
  content: "⌄";
}

.card-details > *:not(summary) {
  padding: 0 14px;
}

h2 { margin: 0 0 8px; font-size: 1.25rem; }
h3 { margin: 14px 0 6px; font-size: 1.02rem; }

.back {
  display: inline-block;
  margin-top: 10px;
  color: var(--muted);
  text-decoration: none;
}

details summary {
  cursor: pointer;
  margin-top: 10px;
  font-weight: 600;
}

.footer {
  padding: 18px 0 28px;
  color: var(--muted);
}

.ask-card {
  background: #F7F9F8;
  border: 1px solid #D9E2DE;
  border-radius: 16px;
  padding: 1.25rem;
  margin: 2rem 0;
}

.listen-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
}

.quiet-button {
  display: inline-block;
  background: #FFFFFF;
  border: 1px solid #B8C6C1;
  border-radius: 999px;
  padding: 0.8rem 1.1rem;
  font: inherit;
  font-size: 0.98rem;
  color: #2b2b2b;
  cursor: pointer;
  line-height: 1.2;
}

.quiet-button:hover,
.quiet-button:focus {
  background: #F3F5F4;
  border-color: #aebdb7;
}
