:root {
  --ink: #1b1f23;
  --muted: #5b6470;
  --border: #e1e4e8;
  --bg: #fafbfc;
  --for: #1a7f37;
  --for-bg: #e6f4ea;
  --against: #b42318;
  --against-bg: #fbe9e7;
  /* Brand colours */
  --primary: #131240;
  --primary-bg: #ececf3;
  --secondary: #ff9f1c;
  --secondary-bg: #fff3e0;
  --accent: var(--primary);
  /* A bill's outcome once it's concluded — succeeded (enacted) vs failed (defeated,
     withdrawn, or otherwise fallen) — distinct from --for/--against above, which are
     about stance on an argument, not a bill's own fate. */
  --failed: #ca3c25;
  --failed-bg: #f9e8e5;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

header {
  background: #fff;
  border-bottom: 3px solid var(--secondary);
}

.header-inner {
  max-width: 880px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

header a.brand {
  display: inline-block;
  line-height: 0;
}

header a.brand img {
  height: 34px;
  width: auto;
}

#site-nav { display: flex; align-items: center; gap: 22px; }
#site-nav a { color: var(--ink); text-decoration: none; font-size: 0.92rem; font-weight: 600; }
#site-nav a:hover { color: var(--primary); }

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--primary);
  margin: 4px 0;
}

@media (max-width: 680px) {
  .nav-toggle { display: block; }
  #site-nav {
    display: none;
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    gap: 2px;
    padding-top: 10px;
  }
  #site-nav.open { display: flex; }
  #site-nav a { padding: 8px 0; width: 100%; }
}

main {
  max-width: 880px;
  margin: 0 auto;
  padding: 24px;
  flex: 1;
  width: 100%;
}

footer {
  border-top: 1px solid var(--border);
  background: #fff;
  margin-top: 40px;
}
.footer-inner {
  max-width: 880px;
  margin: 0 auto;
  padding: 20px 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 0.85rem;
}
.footer-inner a { color: var(--muted); text-decoration: none; }
.footer-inner a:hover { color: var(--primary); text-decoration: underline; }

.breadcrumb {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 16px;
}
.breadcrumb a { color: var(--accent); text-decoration: none; }

h1 { font-size: 1.6rem; margin-bottom: 4px; }
h2 { font-size: 1.2rem; margin-top: 2em; }
h3 { font-size: 1rem; }

.meta { color: var(--muted); font-size: 0.9rem; margin-bottom: 1.5em; }

.ai-overview {
  background: var(--secondary-bg);
  border: 1px solid var(--secondary);
  border-radius: 8px;
  padding: 4px 18px 10px;
  margin: 1em 0 1.5em;
}
.ai-overview-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--primary);
  margin-top: 12px;
}
.ai-overview p { font-size: 0.95rem; }
.ai-overview h4 { margin: 1em 0 0.3em; font-size: 0.85rem; color: var(--primary); }

.stage-timeline {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 1em 0 2em;
  padding: 0;
  list-style: none;
}
.stage-timeline li {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 4px 10px;
  font-size: 0.8rem;
  color: var(--muted);
}
.stage-timeline li.house-lords { border-left: 3px solid #b00; }
.stage-timeline li.house-commons { border-left: 3px solid var(--accent); }
.stage-timeline li.current {
  background: var(--secondary-bg);
  border-color: var(--secondary);
  color: var(--primary);
  font-weight: 600;
}
.stage-timeline li a { color: inherit; text-decoration: none; }
.stage-timeline li a:hover { text-decoration: underline; }

.columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
@media (max-width: 700px) {
  .columns { grid-template-columns: 1fr; }
}

.stance-col h3 { margin-top: 0; }
.stance-col.for h3 { color: var(--for); }
.stance-col.against h3 { color: var(--against); }

.argument {
  background: #fff;
  border: 1px solid var(--border);
  border-left-width: 4px;
  border-radius: 6px;
  padding: 10px 12px;
  margin-bottom: 10px;
  font-size: 0.92rem;
}
.argument.for { border-left-color: var(--for); }
.argument.against { border-left-color: var(--against); }
.argument .speaker { font-weight: 600; font-size: 0.85rem; }
a.speaker { color: var(--ink); text-decoration: none; }
a.speaker:hover { text-decoration: underline; }
.argument .tags { margin-top: 6px; }

.tag-chip {
  display: inline-block;
  background: var(--secondary-bg);
  color: var(--primary);
  border-radius: 10px;
  padding: 1px 8px;
  font-size: 0.75rem;
  margin: 2px 4px 0 0;
  text-decoration: none;
}
.tag-chip:hover { background: var(--secondary); color: var(--primary); }

.badge {
  display: inline-block;
  border-radius: 10px;
  padding: 1px 8px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.badge.for { background: var(--for-bg); color: var(--for); }
.badge.against { background: var(--against-bg); color: var(--against); }
.badge.party {
  background: #fff;
  border: 1px solid var(--party-colour, var(--border));
  color: var(--party-colour, var(--muted));
}
.badge-scope {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  margin-left: 4px;
}

.party-breakdown { margin: 1em 0 1.5em; }
.party-breakdown-caption {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
  margin-bottom: 8px;
}
.party-row {
  display: grid;
  grid-template-columns: 140px 1fr 170px;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
  font-size: 0.85rem;
}
.party-name {
  border-left: 4px solid var(--border);
  padding-left: 8px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.party-bar {
  display: flex;
  height: 10px;
  border-radius: 5px;
  overflow: hidden;
  background: var(--border);
}
.party-bar-for { background: var(--for); }
.party-bar-against { background: var(--against); }
.party-n { color: var(--muted); white-space: nowrap; }
.party-count { color: var(--muted); }
@media (max-width: 600px) {
  .party-row { grid-template-columns: 1fr; gap: 2px; }
  .party-bar { order: 2; }
}

table { width: 100%; border-collapse: collapse; margin: 1em 0; }
th, td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--border); font-size: 0.9rem; }
th { color: var(--muted); font-weight: 600; font-size: 0.8rem; text-transform: uppercase; }

a { color: var(--accent); }

.issue-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 14px;
  margin-bottom: 8px;
  text-decoration: none;
  color: var(--ink);
}
.issue-row:hover { background: #f3f6f9; }
/* A concluded bill's outcome — navy "royal assent" for one that succeeded (the
   logo's own navy), a red/brick for one that failed (defeated, withdrawn, or
   otherwise fallen) — rather than the orange used for one still in progress. */
.issue-row.succeeded { border-left: 3px solid var(--primary); }
.issue-row.failed { border-left: 3px solid var(--failed); }
.issue-counts { font-size: 0.8rem; color: var(--muted); white-space: nowrap; }
.issue-counts .for { color: var(--for); }
.issue-counts .against { color: var(--against); }

.issue-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
  margin: 1em 0;
}
.issue-card {
  display: block;
  background: #fff;
  border: 1px solid var(--border);
  border-top: 3px solid var(--secondary);
  border-radius: 8px;
  padding: 14px 16px;
  text-decoration: none;
  color: var(--ink);
}
.issue-card:hover { background: #fffaf2; }
/* A concluded bill's outcome — navy "royal assent" for one that succeeded (the
   logo's own navy), a red/brick for one that failed (defeated, withdrawn, or
   otherwise fallen) — rather than the orange used for one still in progress. */
.issue-card.succeeded { border-top-color: var(--primary); }
.issue-card.succeeded:hover { background: var(--primary-bg); }
.issue-card.failed { border-top-color: var(--failed); }
.issue-card.failed:hover { background: var(--failed-bg); }
.issue-card h3 { margin: 0 0 6px; color: var(--primary); }
.issue-card h3 a { color: var(--primary); text-decoration: none; }
.issue-card h3 a:hover { text-decoration: underline; }
.issue-card p { margin: 0 0 10px; font-size: 0.88rem; color: var(--ink); }

.variant-list {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
}
.variant-list li { padding: 6px 0; font-size: 0.88rem; border-bottom: 1px dotted var(--border); }
.variant-list li:last-child { border-bottom: none; }

details.variant-disclosure {
  margin-top: 10px;
  border-top: 1px solid var(--border);
  padding-top: 6px;
}
details.variant-disclosure summary {
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  list-style: none;
}
details.variant-disclosure summary::-webkit-details-marker { display: none; }
details.variant-disclosure summary::before { content: "▸ "; }
details.variant-disclosure[open] summary::before { content: "▾ "; }
details.variant-disclosure summary:hover { color: var(--primary); }

details.ai-sitting-summary {
  margin: 0 0 10px;
}
details.ai-sitting-summary:last-child { margin-bottom: 0; }
details.ai-sitting-summary summary {
  cursor: pointer;
  list-style: none;
  font-weight: 600;
}
details.ai-sitting-summary summary::-webkit-details-marker { display: none; }
details.ai-sitting-summary summary::before { content: "▸ "; color: var(--muted); }
details.ai-sitting-summary[open] summary::before { content: "▾ "; }
details.ai-sitting-summary summary:hover { color: var(--primary); }
details.ai-sitting-summary p { margin: 6px 0 0; }

.show-more-toggle {
  margin-top: 10px;
}
.show-more-toggle summary {
  cursor: pointer;
  list-style: none;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--primary);
}
.show-more-toggle summary::-webkit-details-marker { display: none; }
.show-more-toggle summary::before { content: "▸ "; }
.show-more-toggle[open] summary::before { content: "▾ "; }

.amendment-text {
  margin-top: 8px;
  padding: 10px 14px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.9rem;
}
.amendment-text p { margin: 4px 0; }

.debate-pager {
  display: flex;
  justify-content: space-between;
  margin: 10px 0 1.5em;
  padding: 8px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  font-size: 0.88rem;
}

.turn {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.turn .speaker { font-weight: 600; }
.turn .text { white-space: pre-wrap; margin: 4px 0; }
.rebuttal-note {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 4px;
  font-style: italic;
}

.empty { color: var(--muted); font-style: italic; }
.mismatch-note { color: var(--secondary); font-weight: 600; }

.stage-group h3 { margin-top: 1.8em; }
.amendment-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 14px;
  margin-bottom: 8px;
}
.amendment-card .decision { font-size: 0.8rem; color: var(--muted); }
.amendment-card { border-left: 4px solid var(--border); }
.amendment-card.decision-agreed { border-left-color: var(--for); }
.amendment-card.decision-agreedondivision { border-left-color: var(--for); background: var(--for-bg); }
.amendment-card.decision-negativedondivision { border-left-color: var(--against); background: var(--against-bg); }
.amendment-card.decision-disagreed { border-left-color: var(--against); }
.amendment-card.decision-stoodpart { border-left-color: var(--for); }
.amendment-card.decision-removed { border-left-color: var(--against); background: var(--against-bg); }

.amendment-group-block { margin: 1.2em 0; }
.amendment-group-block h4 { margin: 0 0 6px; }

.amendment-group {
  border-top: 2px solid var(--border);
  padding-top: 10px;
  margin-top: 1.5em;
}
.amendment-group h3 { margin: 0 0 4px; }

.bill-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 1em 0;
}
.bill-filters input[type="text"],
.bill-filters select {
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.9rem;
}
.bill-filters button {
  padding: 6px 14px;
  border: none;
  border-radius: 6px;
  background: var(--primary);
  color: #fff;
  cursor: pointer;
  font-size: 0.9rem;
}
.bill-filters button:hover { opacity: 0.9; }

.hero {
  background: var(--primary);
  color: #fff;
}
.hero-inner {
  max-width: 880px;
  margin: 0 auto;
  padding: 48px 24px;
}
.hero-inner h1 {
  margin: 0 0 14px;
  font-size: 1.9rem;
  color: #fff;
}
.hero-inner p {
  margin: 0 0 18px;
  font-size: 1.05rem;
  line-height: 1.6;
  color: #e3e3ef;
  max-width: 640px;
}
.hero-cta {
  display: inline-block;
  color: var(--secondary);
  font-weight: 600;
  text-decoration: none;
}
.hero-cta:hover { text-decoration: underline; }
@media (max-width: 600px) {
  .hero-inner { padding: 32px 24px; }
  .hero-inner h1 { font-size: 1.5rem; }
}

.flash { padding: 0.75rem 1rem; border-radius: 6px; margin-bottom: 1rem; font-size: 0.95rem; }
.flash-success { background: #eafaf0; color: #1e7a42; border: 1px solid #b7e6c7; }
.flash-error { background: #fdecea; color: #a33a2f; border: 1px solid #f3c6c0; }

.contact-form { display: flex; flex-direction: column; gap: 0.75rem; max-width: 500px; }
.contact-form textarea, .contact-form input {
  font: inherit; font-size: 0.95rem; padding: 0.5rem 0.6rem; border: 1px solid var(--border); border-radius: 4px;
}
.contact-form button, .recaptcha-gate button {
  align-self: flex-start; padding: 0.5rem 1.25rem; border: none; border-radius: 4px;
  background: var(--primary); color: #fff; font-size: 0.95rem; cursor: pointer;
}
.contact-form button:hover, .recaptcha-gate button:hover { opacity: 0.9; }

.recaptcha-gate { max-width: 500px; padding: 1rem 1.25rem; border: 1px solid var(--border); border-radius: 6px; background: var(--bg); }
.recaptcha-gate p { margin-top: 0; }
.recaptcha-gate form { margin: 0; }

.cookie-notice {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  display: flex; flex-wrap: wrap; align-items: center; gap: 1rem;
  padding: 0.85rem 1.25rem; background: var(--primary); color: #fff;
  box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.15);
}
.cookie-notice p { margin: 0; flex: 1 1 320px; font-size: 0.9rem; }
.cookie-notice a { color: #fff; text-decoration: underline; }
.cookie-notice form { display: flex; gap: 0.6rem; flex: 0 0 auto; }
.cookie-notice button {
  flex: 0 0 auto; padding: 0.5rem 1.25rem; border: none; border-radius: 4px;
  font-size: 0.9rem; font-weight: 700; cursor: pointer;
  background: #fff; color: var(--primary);
}
.cookie-notice button:hover { background: #eee; }
.cookie-notice-reject {
  background: transparent; color: #fff; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.6);
}
.cookie-notice-reject:hover { background: rgba(255, 255, 255, 0.1); }

.breakdown { border-collapse: collapse; width: 100%; margin: 1em 0; font-size: 0.9rem; }
.breakdown th, .breakdown td { border: 1px solid var(--border); padding: 8px 10px; text-align: left; vertical-align: top; }
.breakdown th { background: var(--bg); }
