:root {
  color-scheme:light;
  --ink:#242633;
  --muted:#555d6b;
  --line:#dce1e8;
  --paper:#f5f6f9;
  --white:#fff;
  --accent:#b6002a;
  --gold:#fff;
  font-family:system-ui,sans-serif;
  color:var(--ink);
  background:var(--paper);
}
* {
  box-sizing:border-box;
}
body {
  margin:0;
}
a {
  color:var(--accent);
  text-underline-offset:3px;
}
button,input,select,textarea {
  font:inherit;
}
button,a.button {
  cursor:pointer;
}
button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible,summary:focus-visible {
  outline:2px solid #36547c;
  outline-offset:3px;
}
.shell {
  display:grid;
  grid-template-columns:242px minmax(0,1fr);
  min-height:100vh;
}
.sidebar {
  position:sticky;
  top:0;
  height:100vh;
  background:#fff;
  color:#242633;
  display:flex;
  flex-direction:column;
  padding:24px 16px;
  overflow:auto;
}
.brand {
  color:inherit;
  text-decoration:none;
  display:flex;
  align-items:center;
  gap:10px;
  font-family:Arial,sans-serif;
  font-size:20px;
  line-height:1.04;
  margin:2px 0 30px;
}
.mark {
  font-size:29px;
  color:#fff;
  background:var(--gold);
  border-radius:5px;
  width:36px;
  height:39px;
  display:grid;
  place-items:center;
  flex:none;
}
.brand-small,.nav-label,.eyebrow,.topline {
  font-family:system-ui,sans-serif;
  letter-spacing:.13em;
  font-size:10px;
  font-weight:750;
}
.brand-small {
  display:block;
  color:#4e5767;
  margin-top:6px;
}
.nav-label {
  color:#4e5767;
  margin:16px 8px 7px;
}
.navlink,.tree a {
  display:block;
  border-radius:5px;
  padding:9px 8px;
  color:inherit;
  text-decoration:none;
  font-size:14px;
}
.navlink span {
  width:24px;
  display:inline-block;
  color:#b6002a;
}
.navlink:hover,.navlink.active,.tree a:hover,.tree .current {
  background:#fae9ee;
}
.tree {
  padding-left:14px;
  overflow-wrap:anywhere;
  color:#444c5d;
}
.tree a {
  font-size:13px;
}
.profile {
  padding-top:20px;
  margin-top:auto;
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  align-items:center;
  font-size:12px;
}
.avatar {
  display:grid;
  place-items:center;
  border-radius:50%;
  width:30px;
  height:30px;
  background:#f9e2e9;
  color:#fff;
  font-weight:800;
}
.profile small {
  display:block;
  color:#555d6b;
}
.logout {
  background:transparent;
  border-color:#dce1e8;
  padding:4px 6px;
  font-size:11px;
}
.topline {
  min-height:57px;
  padding:0 clamp(18px,4vw,54px);
  display:flex;
  align-items:center;
  justify-content:space-between;
  border-bottom:1px solid var(--line);
  color:var(--muted);
}
.topline a {
  text-decoration:none;
}
.content {
  padding:32px clamp(18px,4vw,54px) 48px;
  max-width:1510px;
  margin:auto;
}
.heading {
  display:flex;
  justify-content:space-between;
  align-items:end;
  gap:20px;
  margin:0 0 24px;
}
.heading h1 {
  font-family:Arial,sans-serif;
  font-weight:500;
  font-size:clamp(33px,5vw,57px);
  line-height:1.05;
  margin:8px 0 8px;
  overflow-wrap:anywhere;
}
.heading p {
  margin:0;
  color:var(--muted);
  max-width:66ch;
}
.eyebrow {
  color:#b6002a;
}
.back {
  display:inline-block;
  margin-bottom:18px;
}
.panel {
  border:1px solid var(--line);
  background:var(--white);
  border-radius:9px;
  margin-bottom:18px;
  min-width:0;
}
.stack>.panel {
  margin-bottom:0;
}
.panel-title {
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:15px 18px;
  border-bottom:1px solid var(--line);
}
h2,h3 {
  font-family:Arial,sans-serif;
  font-weight:normal;
  margin:0;
}
h2 {
  font-size:23px;
}
h3 {
  font-size:20px;
}
.section,.filters {
  padding:18px;
}
.section h2 {
  margin-bottom:14px;
}
.filters,.stack {
  display:grid;
  gap:14px;
  align-content:start;
}
.grid {
  display:grid;
  gap:12px;
}
.five {
  grid-template-columns:repeat(5,minmax(0,1fr));
}
.three {
  grid-template-columns:repeat(3,minmax(0,1fr));
}
.two {
  grid-template-columns:repeat(2,minmax(0,1fr));
}
.searchline {
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:12px;
  align-items:end;
}
.searchline.hudoc {
  grid-template-columns:minmax(0,1fr) minmax(100px,140px) auto;
}
.actions {
  display:flex;
  align-items:center;
  gap:9px;
  flex-wrap:wrap;
}
.actions form {
  display:block;
}
.source-actions {
  margin-bottom:18px;
}
label {
  display:grid;
  gap:5px;
  font-size:13px;
  font-weight:650;
  color:var(--ink);
}
input,select,textarea {
  background:#fff;
  border:1px solid #c4cbd6;
  border-radius:5px;
  padding:8px 9px;
  min-width:0;
  width:100%;
  color:var(--ink);
}
textarea {
  min-height:100px;
  resize:vertical;
}
.check {
  display:flex;
  align-items:center;
  gap:6px;
}
.check input {
  width:auto;
}
small,.quiet,.muted {
  color:var(--muted);
}
summary {
  cursor:pointer;
  font-size:14px;
  font-weight:650;
  color:var(--accent);
}
details[open]>summary {
  margin-bottom:13px;
}
button,.button {
  color:#fff;
  background:var(--accent);
  border:1px solid var(--accent);
  border-radius:5px;
  padding:8px 12px;
  font-weight:650;
  font-size:13px;
  text-decoration:none;
  display:inline-block;
  white-space:nowrap;
}
.button.secondary,button.secondary {
  background:#fff;
  border-color:#c4cbd6;
  color:var(--accent);
}
button:hover,.button:hover {
  filter:brightness(.91);
}
.badge {
  display:inline-block;
  border-radius:999px;
  padding:3px 8px;
  background:#edf1f7;
  color:#b6002a;
  font-size:11px;
  font-weight:650;
  max-width:100%;
  overflow-wrap:anywhere;
}
.table-scroll {
  overflow:auto;
}
table {
  width:100%;
  border-collapse:collapse;
  text-align:left;
  font-size:13px;
}
th {
  font-size:11px;
  text-transform:uppercase;
  letter-spacing:.075em;
  color:var(--muted);
  background:#f3f5f9;
}
td,th {
  padding:11px 17px;
  border-bottom:1px solid var(--line);
}
td strong {
  display:block;
}
td small {
  display:block;
  margin-top:3px;
}
td a {
  text-decoration:none;
}
td a:hover {
  text-decoration:underline;
}
.open {
  font-size:18px;
}
.nowrap {
  white-space:nowrap;
}
.pagination {
  display:flex;
  gap:8px;
  padding:10px 16px;
}
.pagination:empty {
  display:none;
}
.empty {
  text-align:center;
  padding:36px 18px;
}
.empty h3 {
  margin-top:8px;
}
.empty p {
  color:var(--muted);
}
.empty-icon {
  display:inline-grid;
  place-items:center;
  width:38px;
  height:38px;
  border-radius:5px;
  background:#fae9ee;
  color:var(--accent);
}
.case-layout {
  display:grid;
  grid-template-columns:minmax(0,1.55fr) minmax(255px,1fr);
  gap:16px;
}
.entry {
  padding:14px 0;
  border-top:1px solid var(--line);
  overflow-wrap:anywhere;
}
.entry-top {
  display:flex;
  justify-content:space-between;
  gap:8px;
  font-size:13px;
}
.entry h3 {
  margin-top:8px;
}
.prose {
  white-space:pre-wrap;
}
.tagline,.authority {
  margin:8px 0;
}
.section details {
  padding-top:12px;
  border-top:1px solid var(--line);
}
.citation {
  margin-top:14px;
}
.citation [role=status] {
  font-size:12px;
  margin-left:7px;
}
.metadata {
  font-size:13px;
  overflow-wrap:anywhere;
}
.metadata dt {
  font-weight:650;
  margin-top:8px;
}
.metadata dd {
  margin-left:0;
  color:var(--muted);
}
.outline {
  list-style:none;
  padding:0;
}
.outline li {
  padding:8px 0;
  border-bottom:1px solid var(--line);
}
.alert {
  padding:10px 14px;
  background:#f9ebe0;
  border:1px solid #dfb8a3;
  color:#713922;
  border-radius:5px;
  margin:12px;
}
.narrow {
  max-width:720px;
}
@media(max-width:980px) {
  .five {
    grid-template-columns:repeat(3,minmax(0,1fr));
  }
  .case-layout {
    grid-template-columns:1fr;
  }
  .shell {
    grid-template-columns:193px minmax(0,1fr);
  }
}
@media (max-height: 400px) {
  .sidebar {
    position: static;
    align-self: start;
    height: auto;
    overflow: visible;
  }
}
@media(max-width:680px) {
  .shell {
    display:block;
  }
  .sidebar {
    position:static;
    height:auto;
    padding:12px 16px;
  }
  .brand {
    margin:0 0 6px;
  }
  .sidebar nav {
    display:flex;
    align-items:center;
    flex-wrap:wrap;
    gap:3px;
  }
  .sidebar .nav-label {
    display:none;
  }
  .tree {
    display:flex;
    flex-wrap:wrap;
    padding:0;
  }
  .profile {
    padding-top:7px;
  }
  .topline {
    min-height:42px;
  }
  .content {
    padding-top:20px;
  }
  .heading {
    display:block;
  }
  .heading .button {
    margin-top:12px;
  }
  .five,.three {
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
  .searchline,.searchline.hudoc {
    grid-template-columns:1fr;
  }
  .searchline button {
    justify-self:start;
  }
}
@media(max-width:370px) {
  .two,.three,.five {
    grid-template-columns:1fr;
  }
}

/* RUG house colour with a course-workspace layout. */
:root {
  --rug-red: #dc002d;
  --course-blue: #223d62;
  font-family: Arial, sans-serif;
}
.shell { border-top: 5px solid var(--rug-red); }
.sidebar { border-right: 1px solid var(--line); }
.brand { font-weight: 750; }
.mark { background: var(--rug-red); }
.avatar, .logout { color: var(--accent); }
.topline {
  background: var(--course-blue);
  color: #fff;
  min-height: 49px;
}
.topline a { color: #fff; }
.top-separator { margin: 0 6px; opacity: .7; }
.heading h1 { font-weight: 750; font-size: clamp(30px,4vw,47px); letter-spacing: -.025em; }
h2, h3 { font-weight: 700; }
.panel { box-shadow: 0 2px 5px #223d6209; }
.assignee { background: #fae9ee; margin: 4px 2px 0 0; }
.allocation-list { padding-left: 18px; color: var(--muted); font-size: 13px; line-height: 1.7; }
.library-search { grid-template-columns: minmax(0,1fr) minmax(150px,210px) auto; }
@media (max-width: 680px) { .library-search { grid-template-columns: 1fr; } }

/* In-case PDF reading and shared annotation. */
.pdf-reader [hidden] { display: none !important; }
.reader-heading p { color: var(--muted); margin: -5px 0 15px; }
.reader-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(208px, 28%);
  gap: 18px;
}
.reader-main, .reader-notes { min-width: 0; }
.reader-toolbar { margin-bottom: 8px; }
.reader-toolbar button:disabled { opacity: .5; cursor: default; }
.reader-page-field { display: flex; align-items: center; }
.reader-page-field input { width: 5em; }
[data-page-total], [data-reader-status] { font-size: 13px; color: var(--muted); }
[data-reader-status]:empty, [data-highlight-status]:empty { display: none; }
.reader-stage {
  background: #e9edf3;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: auto;
  height: 540px;
  height: clamp(360px, 75vh, 1100px);
  scrollbar-gutter: stable both-edges;
}
.reader-pages {
  position: relative;
  width: min(100%, 1050px);
  margin: 0 auto;
}
.reader-sheet + .reader-sheet { margin-top: 12px; }
.reader-sheet {
  position: relative;
  width: 100%;
  background-color: #fff;
  isolation: isolate;
}
.reader-sheet canvas { position: absolute; inset: 0; display: block; }
.pdf-overlays, .textLayer { position: absolute; inset: 0; }
.pdf-overlays { pointer-events: none; z-index: 1; }
.pdf-mark { position: absolute; background: #ffc40055; border-radius: 2px; }
.pdf-mark-active { outline: 1px solid #a25700; background: #ffc40093; }
.pdf-mark-draft { outline: 1px solid #3d608b; background: #4e91dc45; }
.reader-pages.drawing .reader-sheet { touch-action: none; }
.reader-pages.drawing .reader-sheet, .reader-pages.drawing .textLayer span { cursor: crosshair; }
.reader-notes h3 { font-size: 17px; }
.reader-highlight-list { max-height: min(65vh, 900px); overflow: auto; }
.reader-highlight, .reader-draft { border-top: 1px solid var(--line); margin-top: 10px; padding-top: 10px; }
.reader-highlight p, .reader-quote { margin: 6px 0; font-size: 14px; overflow-wrap: anywhere; }
.reader-draft textarea { min-height: 56px; }
.reader-quote { max-height: 100px; overflow: auto; }
[data-highlight-status] { font-size: 13px; color: var(--muted); }

/* Text geometry follows the PDF.js TextLayer custom properties. */
.textLayer {
  z-index: 2;
  overflow: clip;
  text-align: initial;
  line-height: 1;
  letter-spacing: normal;
  word-spacing: normal;
  text-size-adjust: none;
  forced-color-adjust: none;
  transform-origin: 0 0;
  --min-font-size: 1;
  --text-scale-factor: calc(var(--total-scale-factor) * var(--min-font-size));
  --min-font-size-inv: calc(1 / var(--min-font-size));
}
.textLayer :is(span, br) {
  position: absolute;
  color: transparent;
  white-space: pre;
  cursor: text;
  transform-origin: 0 0;
  user-select: text;
}
.textLayer > :not(.markedContent), .textLayer .markedContent span:not(.markedContent) {
  --font-height: 0;
  --scale-x: 1;
  --rotate: 0deg;
  font-size: calc(var(--text-scale-factor) * var(--font-height));
  transform: rotate(var(--rotate)) scaleX(var(--scale-x)) scale(var(--min-font-size-inv));
}
.textLayer .markedContent { display: contents; }
.textLayer ::selection { background: #4e91dc66; }
@media (max-width: 800px) {
  .reader-grid { grid-template-columns: 1fr; }
}

.memorial-menu { width: 100%; margin-top: 12px; }
.memorial-menu > summary,
.memorial-tree summary,
.memorial-tree a { display: block; padding: 8px; border-radius: 5px; }
.memorial-menu > summary,
.memorial-tree summary { display: list-item; margin-bottom: 0; }
.memorial-tree a { font-size: 13px; overflow-wrap: anywhere; }
.memorial-tree a.current,
.memorial-tree a:hover,
.memorial-tree summary:hover,
.memorial-menu > summary:hover { background: #fae9ee; }
.memorial-children { margin-inline-start: 9px; padding-inline-start: 5px; border-inline-start: 1px solid var(--line); }
.section .memorial-tree details { border-top: 0; padding-top: 0; }
.argument-detail > summary { font-size: 18px; }
.argument-detail .badge { margin-left: 6px; }
.argument-children { margin-top: 14px; padding-left: 14px; border-left: 2px solid var(--line); }
.argument-children h4 { margin: 8px 0; }

.timeline-tools { justify-content: space-between; margin-bottom: 18px; }
.timeline-layout { display: grid; grid-template-columns: minmax(170px, 240px) minmax(0, 1fr); gap: 24px; align-items: start; }
.timeline-index { position: sticky; top: 18px; max-height: 85vh; overflow: auto; padding: 16px; }
.timeline-index h2 { font-size: 18px; margin-bottom: 12px; }
.timeline-index-year { font-weight: 700; }
.timeline-index ul { list-style: none; padding-left: 12px; margin: 7px 0 14px; border-left: 1px solid var(--line); }
.timeline-index li { margin-bottom: 8px; font-size: 13px; overflow-wrap: anywhere; }
.timeline-year { margin-bottom: 22px; scroll-margin-top: 20px; }
.timeline-year > h2 { margin-bottom: 12px; }
.timeline-events { list-style: none; margin: 0 0 0 5px; padding: 0 0 0 18px; border-left: 2px solid #d6dfe9; }
.timeline-event { position: relative; scroll-margin-top: 20px; }
.timeline-event::before { content: ''; position: absolute; left: -24px; top: 20px; width: 10px; height: 10px; border-radius: 50%; background: var(--rug-red); }
.timeline-event:target > article { border-color: var(--rug-red); }
.timeline-meta { color: var(--course-blue); font-weight: 700; font-size: 13px; margin-bottom: 8px; }
.timeline-meta .badge { margin-inline-start: 6px; }
.timeline-note { margin-top: 14px; padding-top: 4px; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.timeline-note .actions { font-size: 13px; }
.timeline-note details { margin-top: 12px; }
@media (max-width: 780px) {
  .timeline-layout { grid-template-columns: 1fr; gap: 12px; }
  .timeline-index { position: static; max-height: 220px; }
}

/* Research links stay distinct from the workspace's RUG-red controls. */
a[href^="/principles/"]:not(.button, .navlink) { color: #592d78; }
a[href^="/argument/"]:not(.button, .navlink) { color: #006164; }
.reader-highlight .research-link {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
}
.research-link-kind {
  flex: none;
  padding: 2px 5px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  background: #f1e9f6;
}
a[href^="/argument/"] .research-link-kind { background: #e4f2f1; }

[data-research-kind="admissibility"] { --research-ink: #174a84; --research-tint: #e7eef9; }
[data-research-kind="merits"] { --research-ink: #006164; --research-tint: #e4f2f1; }
[data-research-kind="mixed"] { --research-ink: #694809; --research-tint: #f8edcf; }
[data-research-kind="general"] { --research-ink: #49596b; --research-tint: #ebeff3; }
a.research-link[data-research-kind],
.argument-detail > summary[data-research-kind] { color: var(--research-ink, #592d78); }
[data-research-kind] .research-link-kind { background: var(--research-tint, #f1e9f6); min-width: 20px; text-align: center; }

.research-legend { margin: 18px 3px 0; padding: 12px 8px; border-top: 1px solid var(--line); }
.research-legend h2 { font-size: 13px; margin: 0 0 8px; }
.research-legend ul { display: grid; gap: 5px; list-style: none; padding: 0; margin: 0; }
.research-legend li { display: flex; gap: 7px; align-items: center; font-size: 12px; color: var(--research-ink, #592d78); }
@media (max-width: 680px) {
  .research-legend { margin-top: 8px; padding: 8px 0; }
  .research-legend ul { display: flex; flex-wrap: wrap; gap: 5px 12px; }
}

.legal-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; margin: 12px 0 24px; }
.legal-grid .legal-card { display: grid; align-content: start; gap: 10px; margin: 0; }
.legal-card h3 { overflow-wrap: anywhere; }
@media (max-width: 760px) { .legal-grid { grid-template-columns: 1fr; } }

.annotation-choices {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}
.annotation-choices legend { font-weight: 700; margin-bottom: 6px; }
.annotation-choices > div, .section-selection, .section-path {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.annotation-choices label { display: inline-flex; position: relative; cursor: pointer; }
.annotation-choices input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.annotation-choices span {
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--white);
}
.annotation-choices input:checked + span { background: var(--course-blue); color: #fff; border-color: var(--course-blue); }
.annotation-choices input:focus-visible + span { outline: 2px solid var(--course-blue); outline-offset: 2px; }
[data-section-picker] [hidden] { display: none !important; }
.section-selection { margin-bottom: 6px; color: var(--muted); font-size: 13px; }
.section-selection button { text-align: left; overflow-wrap: anywhere; }
.section-picker, .highlight-options { padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; }
.highlight-options > :not(summary), .section-path { margin-top: 10px; }
.section-path button { padding: 4px 8px; }
.section-path [aria-current] { color: var(--course-blue); border-color: var(--course-blue); }
.section-folders { display: grid; gap: 4px; margin-top: 10px; }
.section-folders button { text-align: left; overflow-wrap: anywhere; }
.section-current { display: flex; align-items: center; gap: 8px; padding: 6px 0; }
.section-current input { width: auto; }
#note-form { scroll-margin-top: 72px; }

.research-group {
  margin-top: 10px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
}
.research-group > summary { color: var(--course-blue); }
.research-group > summary .badge { margin-left: 5px; }
.archive-action { margin: 10px 0; }
.archive-action button { font-size: 12px; padding: 4px 8px; }

.read-status { margin: 6px 0 0; }
.read-status [hidden] { display: none; }
.read-status .check { font-weight: normal; }
.draft-layout {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(0, 2.4fr) minmax(230px, 1.3fr);
  gap: 14px;
  align-items: start;
}
.draft-outline a {
  display: block;
  padding: 6px 5px;
  text-decoration: none;
  overflow-wrap: anywhere;
}
.draft-outline [aria-current] { background: #e9edf3; font-weight: bold; border-radius: 4px; }
.latex-source { min-height: 340px; font-family: ui-monospace, monospace; line-height: 1.55; }
.draft-layout .stack { min-width: 0; }
.draft-layout details form { margin-top: 12px; }
@media (max-width: 1250px) {
  .draft-layout { grid-template-columns: minmax(170px, 1fr) minmax(0, 2.5fr); }
  .draft-layout > aside { grid-column: 2; }
}
@media (max-width: 740px) {
  .draft-layout { grid-template-columns: minmax(0,1fr); }
  .draft-layout > aside { grid-column: auto; }
}
.draft-outline details { margin: 3px 0; }
.draft-outline details > div { margin-left: 10px; padding-left: 7px; border-left: 1px solid var(--line); }
.draft-outline summary { padding: 5px 0; }
.doctrine-topics { display: grid; grid-template-columns: repeat(auto-fit,minmax(170px,1fr)); gap: 10px; margin-top: 12px; }
.doctrine-topics article { min-width: 0; padding: 12px; border: 1px solid var(--line); border-radius: 6px; }
.doctrine-topics h3 { margin: 0 0 6px; }
