:root {
  --ink: #1b1b1a; --soft: #3f3f3c; --muted: #6d6c67; --rule: #dcdad3; --faint: #f4f2ec;
  --paper: #fffefb; --link: #1d4f7a; --yes: #285b2e; --no: #8a2a20;
  --serif: Charter, "Bitstream Charter", "Iowan Old Style", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root { --ink: #e7e5de; --soft: #c9c6bd; --muted: #9b998f; --rule: #3a3935; --faint: #22211e;
          --paper: #171614; --link: #8db8de; --yes: #8cc493; --no: #e3907f; }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 17px/1.55 var(--serif); }
main { max-width: 44rem; margin: 0 auto; padding: 1.5rem 1rem 4rem; }
html[data-lang=both] main { max-width: 74rem; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
h1, h2, h3, h4, h5 { line-height: 1.25; font-weight: 600; margin: 0; }

/* Languages. The interface (.ui) is in the page's language (cy/ or en/). Texts of the Record (.bi, .pair)
   carry both languages: the page's own is shown, or both side by side as printed, what was said on the left
   and its translation on the right, and Welsh first for headings. A text printed in one language only (.solo) is always shown. */
html[lang=cy] .ui > [lang=en], html[lang=en] .ui > [lang=cy],
html[data-lang=en] :is(.bi, .pair) > [lang=cy]:not(.solo),
html[data-lang=cy] :is(.bi, .pair) > [lang=en]:not(.solo) { display: none; }
html[data-lang=both] .bi { display: inline-flex; flex-direction: column; }
html[data-lang=both] .pair { display: grid; grid-template-columns: 1fr 1fr; column-gap: 2.25rem; }
html[data-lang=both] .pair > [lang=cy] { grid-column: 1; }
html[data-lang=both] .pair > [lang=en] { grid-column: 2; }
html[data-lang=both] .pair > .orig { grid-column: 1; }
html[data-lang=both] .pair > .tr { grid-column: 2; }
/* section headings and the sitting's opening and closing go one above the other, Welsh first; headings have
   one page reference under them */
html[data-lang=both] :is(.pair.title, .pair.e-sitting_opened, .pair.e-sitting_closed) { display: block; }
html[data-lang=both] :is(.pair.title, .pair.e-sitting_opened, .pair.e-sitting_closed) > * + * { margin-top: .2rem; }
html[lang=cy][data-lang=both] .pair.heads > .meta[lang=en],
html[lang=en][data-lang=both] .pair.heads > .meta[lang=cy] { display: none; }
html[data-lang=both] .pair.heads > .meta { grid-column: 1 / -1; }
.plang { font: italic 12px var(--sans); color: var(--muted); }
html[data-lang=both] .plang { display: none; }
.spoken { display: none; }
html[data-lang=en] .spoken:is([data-orig=cy], [data-orig=mixed]),
html[data-lang=cy] .spoken:is([data-orig=en], [data-orig=mixed]) { display: inline; }

/* top bar */
.bar { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; justify-content: space-between; align-items: center;
       padding: .6rem 1rem; border-bottom: 1px solid var(--rule); font: 14px/1.4 var(--sans); }
.bar nav { display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; }
.switch { display: flex; gap: 1rem; align-items: center; }
.switch a { font-weight: 600; }
.switch button { display: none; font: inherit; font-size: 13px; color: var(--muted); background: none;
                 border: 1px solid var(--rule); border-radius: 3px; padding: .15rem .6rem; cursor: pointer; }
html.js .switch button { display: inline-block; }
.switch button[aria-pressed=true] { color: var(--ink); background: var(--faint); }

/* landing page: the two languages side by side, Welsh first */
main.landing { max-width: 56rem; display: grid; grid-template-columns: 1fr 1fr; gap: 2rem 3rem;
               padding-top: 18vh; }
main.landing h1 { font-size: 1.85rem; }
main.landing .enter { font: 600 17px var(--sans); margin-top: 1.5rem; }

/* headings and summaries */
.kicker { font: 600 12px/1.4 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
          margin: 1rem 0 .4rem; }
header.sitting { border-bottom: 2px solid var(--ink); padding-bottom: 1rem; margin-bottom: 1.5rem; }
header.sitting h1 { font-size: 1.85rem; font-weight: 600; }
.meta { font: 14px/1.4 var(--sans); color: var(--muted); margin: .35rem 0 0; }
.summary { margin: 0 0 2rem; }
.summary > h2, h2.proc, main > section > h2 { font: 600 13px/1.4 var(--sans); letter-spacing: .08em;
  text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--rule); padding-bottom: .3rem;
  margin: 0 0 .5rem; }
h2.proc { margin-top: 2.5rem; }
.years { font-family: var(--sans); font-size: 15px; display: flex; gap: 1rem; margin: 0 0 1.5rem; }
main > section { margin-bottom: 2.25rem; }
main > section[id^=y] > h2 { font: 600 1.5rem/1.2 var(--serif); letter-spacing: 0; text-transform: none;
  color: var(--ink); border-bottom: 2px solid var(--ink); padding-bottom: .35rem; }
main > section > h2 a { color: inherit; }

ol.toc { list-style: none; margin: 0; padding: 0; }
ol.toc li { display: grid; grid-template-columns: 2.5rem 1fr; padding: .15rem 0; }
ol.toc ol.toc { font-size: .9em; margin: .15rem 0 .25rem; }
ol.toc ol.toc li { grid-template-columns: 2.25rem 1fr; padding: .05rem 0; }
ol.toc .pg { font: 13px/1.9 var(--sans); color: var(--muted); font-variant-numeric: tabular-nums; }
.nv { font: 12px var(--sans); color: var(--muted); margin-left: .4rem; white-space: nowrap; }

table { border-collapse: collapse; width: 100%; font-size: 15px; }
th { font: 600 12px/1.4 var(--sans); color: var(--muted); text-align: left; border-bottom: 1px solid var(--rule);
     padding: .3rem .5rem .3rem 0; }
td { border-bottom: 1px solid var(--rule); padding: .4rem .5rem .4rem 0; vertical-align: top; }
.num { text-align: right; font-variant-numeric: tabular-nums; width: 3.5rem; }
td.num { font-family: var(--sans); font-size: 14px; }
td.hands { text-align: right; font: italic 14px var(--sans); color: var(--muted); }
td.v { white-space: nowrap; padding-left: 1rem; }
th.res { padding-left: 1rem; }
td.res { font: 600 13px var(--sans); white-space: nowrap; padding-left: 1rem; width: 7rem; }
tr.grp th { font: 600 15px/1.35 var(--serif); color: var(--ink); padding-top: .9rem; }
tr.grp th a { color: inherit; }
table.sittings td.d { width: 12.5rem; }
table.sittings td.biz { color: var(--soft); font-size: 15px; }
.sep { color: var(--muted); }
table.byvote td.d { width: 10rem; }
table.byvote td.d .nv { display: block; margin-left: 0; }
table.byvote td.biz { font-size: 14px; }

/* month picker: each year with its months beneath it */
.picker { display: grid; grid-template-columns: repeat(auto-fit, minmax(7.5rem, 1fr)); gap: 1rem 1.25rem;
          font: 13px/1.5 var(--sans); margin: 1rem 0; }
.picker .year { display: block; font-size: 15px; font-weight: 600; margin-bottom: .2rem; }
.picker .ms { display: grid; grid-template-columns: repeat(3, 1fr); }
.picker .ms > span { color: var(--muted); opacity: .6; }
tr[id^="m"] { scroll-margin-top: .5rem; }

/* calendar */
.months { display: grid; grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); gap: 1.25rem 1.5rem; }
table.cal { font: 12px var(--sans); table-layout: fixed; }
table.cal caption { font: 600 13px var(--sans); text-align: left; padding-bottom: .25rem; }
table.cal th { font: 10px var(--sans); text-align: center; padding: 0 0 .2rem; border: 0; }
table.cal td { border: 0; padding: .05rem; text-align: center; color: var(--muted); height: 1.85rem;
               vertical-align: middle; }
table.cal td a { display: block; line-height: calc(1.75rem - 2px); border: 1px solid var(--link); border-radius: 3px;
                 color: var(--link); font-weight: 600; }
table.cal small { font-size: 9px; vertical-align: super; margin-left: 1px; }
table.cal td.voted a { background: var(--link); color: var(--paper); font-weight: 600; }
table.cal td.nh { color: var(--ink); font-style: italic; }
.calkey { margin-bottom: 1rem; line-height: 2; }
.calkey span { display: inline-block; line-height: 1.4; margin-right: .75rem; }
.calkey .held { padding: .1rem .4rem; border: 1px solid var(--link); border-radius: 3px; color: var(--link); }
.calkey .held.voted { background: var(--link); color: var(--paper); }
html[data-lang=both] .sep { display: block; height: .35rem; overflow: hidden; color: transparent; }
.r-adopted .res, td.res.r-adopted, .res.r-adopted { color: var(--yes); }
.r-rejected .res, td.res.r-rejected, .res.r-rejected { color: var(--no); }

/* proceedings */
section.item.d0 { margin-top: 2.75rem; }
section.item.d0 > .title > * { font-size: 1.4rem; }
section.item.d1 { margin-top: 2rem; }
section.item.d1 > .title > * { font-size: 1.12rem; }
section.item.d2 > .title > * { font-size: 1rem; font-style: italic; }
.pair > * { margin: 0; min-width: 0; }
.pair.heads > .who { margin-bottom: .2rem; }
.pair.heads > .meta { margin-top: .35rem; }
.pair.heads > .mhead { margin-bottom: .5rem; }
section.item > .pair.heads:has(> .meta) { margin-bottom: .75rem; }
.pair p { margin: 0 0 .7rem; }
.contribution { margin: 1.1rem 0 0; }
.who { margin: 0 0 .2rem; }
.who .name { font-weight: 700; }
.who .role, .who .note, .spoken { font: 13.5px/1.4 var(--sans); color: var(--muted); }
.who .role { margin-left: .2rem; }
.spoken, .who .note { font-style: italic; margin-left: .3rem; }
.qno { font: 600 13px var(--sans); color: var(--muted); margin-right: .35rem; font-variant-numeric: tabular-nums; }
.k-chair .who .name { font-weight: 600; }
.ann { font-style: italic; color: var(--muted); }
blockquote.quote, .pair.quote { margin: .4rem 0 .9rem 1.5rem; font-size: .95em; }
p.time { font: 12px var(--sans); color: var(--muted); font-variant-numeric: tabular-nums; margin: 1.2rem 0 .4rem;
         display: flex; align-items: center; gap: .6rem; }
p.time::after { content: ""; flex: 1; border-top: 1px solid var(--rule); }
.event { font-style: italic; color: var(--soft); margin: .8rem 0; }
.event.e-outcome { font-style: normal; font-weight: 600; color: var(--ink); }
.event.e-sitting_opened, .event.e-sitting_closed { margin: 1.25rem 0; }
.event.e-sitting_closed { border-top: 1px solid var(--rule); padding-top: 1rem; }

.motion { margin: 1rem 0; padding: .6rem 0 .1rem 1rem; border-left: 3px solid var(--ink); background: var(--faint); }
.motion .mhead { font: 14px/1.4 var(--sans); color: var(--soft); margin: 0 0 .5rem; padding-right: 1rem; }
.motion .mhead b { color: var(--ink); }
.motion .instr > * { font-style: italic; }
.motion .pair { padding-right: 1rem; }
.motion .res { font-weight: 600; }

.division { margin: 1.25rem 0; padding: .7rem 0 .2rem; border-top: 1px solid var(--ink); }
.division + .division { margin-top: .5rem; }
.dhead { margin: 0; font-weight: 700; }
.dhead a { color: inherit; }
.dhead .by { font: 400 13.5px var(--sans); color: var(--muted); margin-left: .5rem; }
.tally { font: 15px/1.6 var(--sans); margin: .2rem 0 .3rem; display: flex; flex-wrap: wrap;
         gap: .1rem 1.1rem; }
.tally .n { color: var(--muted); }
.tally .n b { color: var(--ink); font-variant-numeric: tabular-nums; }
.tally .method { color: var(--muted); font-style: italic; }
.tally .res { font-weight: 600; min-width: 5.5rem; }
.division .outcome > * { font-style: italic; color: var(--soft); margin: .2rem 0; }
.division details { margin-top: .5rem; }
.division summary { font: 13px var(--sans); color: var(--link); cursor: pointer; }
.lists { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: .5rem 1.5rem; margin-top: .5rem; }
.lists h5 { font: 600 12px var(--sans); text-transform: uppercase; letter-spacing: .06em; color: var(--muted);
            margin: 0 0 .25rem; }
.lists ul { list-style: none; margin: 0; padding: 0; font-size: 14.5px; line-height: 1.45; }

footer { margin-top: 3rem; border-top: 1px solid var(--rule); padding-top: .75rem; font: 13px/1.5 var(--sans);
         color: var(--muted); }
a.src { font: 12px var(--sans); color: var(--muted); white-space: nowrap; }
footer.rights { margin-top: 1.5rem; }
footer.rights p { margin: 0 0 .5rem; }

/* search */
.search-title { font-size: 1.85rem; margin-bottom: 1rem; }
#search .q { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin: 0; font-family: var(--sans); }
#search .q label { flex-basis: 100%; font-size: 14px; color: var(--muted); }
#search input[type=search] { flex: 1; min-width: 12rem; }
#search :is(input, select), #search button, #more { font: 15px var(--sans); color: var(--ink); background: var(--paper);
  border: 1px solid var(--rule); border-radius: 3px; padding: .35rem .5rem; }
#search button, #more { background: var(--faint); cursor: pointer; }
.filters { display: flex; flex-wrap: wrap; gap: .6rem 1rem; align-items: end; margin-top: .75rem;
           font: 13px/1.4 var(--sans); color: var(--muted); }
.filters label { display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.filters select { max-width: 13rem; }
.filters .check { flex-direction: row; align-items: center; gap: .4rem; flex-basis: 100%; }
#status { font: 600 14px var(--sans); margin: 1.5rem 0 0; }
.hit { border-top: 1px solid var(--rule); padding: .7rem 0 .1rem; margin-top: .7rem; }
.hit p { margin: 0 0 .4rem; overflow-wrap: anywhere; }
mark { background: #f6e27a; color: #1b1b1a; padding: 0 .1em; }
:is(.pair, blockquote.quote, .event):target { background: var(--faint); outline: 2px solid var(--link); outline-offset: 4px; }

@media (max-width: 700px) {
  body { font-size: 16px; }
  /* the items voted on go on a line of their own under each sitting */
  table.byvote tr { display: grid; grid-template-columns: 1fr repeat(3, 3.75rem); border-bottom: 1px solid var(--rule); }
  table.byvote :is(th, td) { border: 0; }
  table.byvote th:last-child { display: none; }
  table.byvote td.d { width: auto; }
  table.byvote .num { width: auto; }
  table.byvote td.biz { grid-column: 1 / -1; padding-top: 0; }
  html[data-lang=both] .pair { grid-template-columns: 1fr; }
  html[data-lang=both] .pair > [lang=en] { grid-column: 1; margin-top: .4rem; }
  html[data-lang=both] .pair > [lang=cy] { grid-column: 1; }
  html[data-lang=both] .pair > .orig { grid-column: 1; margin-top: 0; }
  html[data-lang=both] .pair > .tr { grid-column: 1; margin-top: .4rem; }
  main.landing { grid-template-columns: 1fr; padding-top: 3rem; }
  table.sittings td.d { width: auto; }
  td.v { white-space: normal; }
}
@media print {
  .bar { display: none; }
}
