/* LegisLiner: a pull-request-style review of a bill against the consolidated
   Acts. Interface in Noto Sans, Act text in Martel (the parl.ca serif). */

:root {
  --red: #8c1d24;
  --fg: #1f2328;
  --muted: #59636e;
  --border: #d1d9e0;
  --border-soft: #eef1f4;
  --subtle: #f6f8fa;
  --hover: #eef1f4;
  --link: #0969da;
  --del-bg: #ffebe9;
  --del-gutter: #ffd7d5;
  --del-fg: #cf222e;
  --ins-bg: #dafbe1;
  --ins-gutter: #ccf5d6;
  --ins-fg: #1a7f37;
  --sans: "Noto Sans", -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --serif: Martel, Georgia, "Times New Roman", serif;
}

body {
  margin: 0;
  background: #fff;
  color: var(--fg);
  font: 14px/1.5 var(--sans);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a {
  color: var(--link);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
[hidden] {
  display: none !important;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.container {
  box-sizing: border-box;
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 24px;
}
input,
select,
button {
  font: inherit;
  color: var(--fg);
}
input,
select {
  height: 32px;
  box-sizing: border-box;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
}
input {
  padding: 0 12px;
}
select {
  padding: 0 8px;
  background: var(--subtle);
}
button {
  cursor: pointer;
}
:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 1px;
}
svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Banner */
.banner {
  background: var(--red);
  color: #fff;
  padding: 12px 24px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 20px;
}
.banner .name {
  font-size: 18px;
  font-weight: 700;
}
#form {
  flex: 1 1 420px;
  display: flex;
  gap: 8px;
  min-width: 0;
}
#form input {
  flex: 1;
  min-width: 0;
  border-color: rgba(255, 255, 255, 0.35);
}
#form button {
  height: 32px;
  padding: 0 16px;
  border: 1px solid #fff;
  border-radius: 6px;
  background: #fff;
  color: var(--red);
  font-weight: 600;
}
#status {
  margin: 10px 0 0;
  color: var(--muted);
}
#status:empty {
  display: none;
}

/* Bill heading, like a pull request's */
.billhead {
  padding-top: 20px;
}
h1 {
  margin: 0;
  font-size: 28px;
  font-weight: 400;
  line-height: 1.3;
}
h1 .number {
  color: var(--muted);
  font-weight: 300;
}
.meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 10px 0 16px;
  color: var(--muted);
}
.meta b {
  color: var(--fg);
  font-weight: 600;
}
.pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 999px;
  background: #1f883d;
  color: #fff;
  font-weight: 500;
}
.pill.assented {
  background: #8250df;
}
.assent {
  margin: -6px 0 14px;
  color: var(--muted);
}
.tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
}
.tabs button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 8px 10px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: none;
  color: var(--muted);
  white-space: nowrap;
}
.tabs button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}
.tabs button[aria-current="page"] {
  color: var(--fg);
  font-weight: 600;
  border-bottom-color: #fd8c73;
}
.counter {
  padding: 0 6px;
  border-radius: 999px;
  background: #e6eaef;
  color: var(--fg);
  font-size: 12px;
  font-weight: 500;
}
.counter:empty {
  display: none;
}

/* Sticky toolbar */
.toolbar {
  position: sticky;
  top: 0;
  z-index: 3;
  background: #fff;
  border-bottom: 1px solid var(--border);
}
.toolbar-row {
  padding-top: 8px;
  padding-bottom: 8px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.toolbar-left,
.toolbar-right {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.toolbar-left {
  color: var(--muted);
}
.toolbar-left b {
  color: var(--fg);
  font-weight: 600;
}
.toolbar-right label {
  color: var(--muted);
}
button.icon {
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--subtle);
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
button.icon[aria-pressed="true"] {
  background: #e6eaef;
}

/* Acts view: tree and one Act */
.layout {
  padding-top: 16px;
  padding-bottom: 48px;
  display: flex;
  align-items: flex-start;
  gap: 24px;
  flex: 1;
}
.tree {
  flex: 0 0 300px;
  position: sticky;
  top: 64px;
  max-height: calc(100vh - 80px);
  overflow: auto;
}
#filter {
  width: 100%;
  margin-bottom: 8px;
}
.tree button {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  width: 100%;
  padding: 5px 8px;
  border: 0;
  border-radius: 6px;
  background: none;
  text-align: left;
}
.tree button:hover {
  background: var(--hover);
}
.actitem .chev {
  flex: none;
  margin-top: 4px;
  color: var(--muted);
}
.actitem .title {
  flex: 1;
}
.actitem .count {
  flex: none;
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}
.actitem[aria-current="true"] {
  background: #e6eaef;
  font-weight: 600;
}
.actitem[aria-current="true"] .count {
  font-weight: 400;
}
.changes {
  margin: 2px 0 6px 13px;
  padding-left: 6px;
  border-left: 1px solid var(--border);
}
.changeitem {
  gap: 8px;
  font-size: 13px;
}
.changeitem .cl {
  flex: none;
  width: 58px;
  font: 12px/1.7 var(--mono);
  color: var(--muted);
}
.changeitem[aria-current="true"] {
  background: var(--subtle);
  box-shadow: inset 2px 0 0 var(--red);
  font-weight: 600;
}
.changeitem[aria-current="true"] .cl {
  color: var(--fg);
}
.tree .empty {
  padding: 6px 8px;
  color: var(--muted);
}
.main {
  flex: 1;
  min-width: 0;
}
.layout.notree .tree {
  display: none;
}

/* The Act, like one file in a pull request */
.card {
  border: 1px solid var(--border);
  border-radius: 6px;
}
.cardhead {
  position: sticky;
  top: 49px;
  z-index: 2;
  background: var(--subtle);
  border-bottom: 1px solid var(--border);
  border-radius: 6px 6px 0 0;
  padding: 8px 12px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
}
.cardhead b {
  font-weight: 600;
}
.cardhead code {
  font: 12px var(--mono);
  color: var(--muted);
}
.cardhead .muted {
  font-size: 12px;
  color: var(--muted);
}
.cardhead .spacer {
  flex: 1;
}
.cardhead a {
  font-size: 12px;
}
.cardnote {
  margin: 0;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
}

.expand,
.hunk {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  box-sizing: border-box;
  padding: 4px 12px;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: var(--subtle);
  font: 12px/1.6 var(--mono);
  color: var(--muted);
  text-align: left;
}
.expand {
  background: #eef4fb;
}
.expand:hover {
  background: #ddf4ff;
  color: var(--fg);
}
.hunk {
  padding-left: 106px;
}
.text {
  font: 15px/1.75 var(--serif);
  color: #000;
}
.text > :last-child {
  border-bottom: 0;
  border-radius: 0 0 6px 6px;
}
.row {
  display: grid;
  grid-template-columns: 76px 18px minmax(0, 1fr);
  border-bottom: 1px solid var(--border-soft);
  scroll-margin-top: 110px;
}
.row .gutter {
  padding: 6px 8px;
  background: var(--subtle);
  border-right: 1px solid var(--border);
  font: 12px/1.9 var(--mono);
  text-align: right;
  overflow-wrap: anywhere;
}
.row .gutter a {
  color: var(--link);
}
.row .marker {
  font: 12px/2.4 var(--mono);
  text-align: center;
  color: var(--muted);
  user-select: none;
}
.row.added {
  background: var(--ins-bg);
}
.row.added .gutter {
  background: var(--ins-gutter);
}
.row.added .marker {
  color: var(--ins-fg);
}
.row.removed {
  background: var(--del-bg);
}
.row.removed .gutter {
  background: var(--del-gutter);
}
.row.removed .marker {
  color: var(--del-fg);
}
.row[data-change] {
  cursor: pointer;
}
.row.selected {
  box-shadow: inset 3px 0 0 var(--red);
}
.row.selected:not(.added):not(.removed) {
  background: #f2f4f6;
}
.row.selected .gutter a {
  color: var(--fg);
  font-weight: 600;
}
.line {
  padding: 6px 16px 6px 4px;
  white-space: pre-wrap;
  min-width: 0;
}
.line.mnote {
  font: 600 12px/1.5 var(--sans);
  padding-bottom: 0;
}
.line.heading {
  font: 700 15px/1.5 var(--sans);
  text-align: center;
}
del,
ins {
  color: #000;
}
del {
  background: var(--del-bg);
  text-decoration: line-through;
}
ins {
  background: var(--ins-bg);
  text-decoration: underline;
}
.line.added {
  text-decoration: underline;
}
.line.added ins {
  background: none;
}
.line.removed {
  text-decoration: line-through;
}
.line.removed del {
  background: none;
}

/* Not in Act text and coordinating amendments */
.listview {
  padding-top: 16px;
  padding-bottom: 48px;
}
.listview > * {
  max-width: 1100px;
}
.listview h2 {
  margin: 20px 0 8px;
  font-size: 16px;
  font-weight: 600;
}
.listview h2:first-child {
  margin-top: 0;
}
.listview .muted {
  color: var(--muted);
}
.notice {
  border: 1px solid var(--border);
  border-radius: 6px;
  margin-bottom: 8px;
}
.notice summary {
  padding: 8px 12px;
  background: var(--subtle);
  border-radius: 6px;
  cursor: pointer;
}
.notice[open] summary {
  border-bottom: 1px solid var(--border);
  border-radius: 6px 6px 0 0;
}
.notice summary code {
  font: 600 12px var(--mono);
  margin-right: 6px;
}
.record {
  padding: 10px 12px;
}
.record p {
  margin: 0 0 6px;
}
.record .text {
  border: 1px solid var(--border);
  border-radius: 6px;
}

.footer {
  margin-top: auto;
  border-top: 1px solid var(--border);
  padding: 16px 24px;
  font-size: 12px;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px 24px;
}

@media (max-width: 800px) {
  .container {
    padding: 0 12px;
  }
  .layout {
    flex-direction: column;
  }
  .tree {
    position: static;
    flex: none;
    width: 100%;
    max-height: 50vh;
  }
  .cardhead {
    top: 0;
  }
  .row {
    grid-template-columns: 58px 14px minmax(0, 1fr);
  }
  .hunk {
    padding-left: 12px;
  }
}

@media print {
  .banner,
  .tabs,
  .toolbar,
  .tree,
  .expand,
  .footer {
    display: none !important;
  }
  .cardhead {
    position: static;
  }
  .row.selected {
    box-shadow: none;
  }
  del,
  ins,
  .row.added,
  .row.removed {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}
.text:empty {
  display: none;
}
