:root {
  color-scheme: light;
  --ink: #17231f;
  --muted: #64706a;
  --paper: #f5f0e4;
  --paper-deep: #e8dfcd;
  --white: #fffdf7;
  --green: #243d36;
  --green-mid: #3f5d52;
  --green-pale: #dce6de;
  --red: #9e3c32;
  --red-dark: #702820;
  --gold: #b18a43;
  --line: #c8bda8;
  --shadow: 0 18px 45px rgb(35 45 39 / 12%);
  font-family: "Yu Gothic UI", "Hiragino Kaku Gothic ProN", "BIZ UDPGothic", system-ui, sans-serif;
  color: var(--ink);
  background: #e5e0d3;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background-color: var(--paper);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22'%3E%3Cpath d='M0 0H22M0 0V22' fill='none' stroke='%23243d36' stroke-opacity='.035'/%3E%3C/svg%3E");
  background-size: 22px 22px;
}

a {
  color: inherit;
}

button,
input,
select {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid #d5a844;
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  z-index: 20;
  top: 0.6rem;
  left: 0.6rem;
  padding: 0.7rem 1rem;
  color: white;
  background: var(--green);
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1rem 0;
}

.wordmark {
  display: inline-flex;
  gap: 0.7rem;
  align-items: center;
  color: var(--green);
  font-family: "Yu Mincho", "Hiragino Mincho ProN", serif;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-decoration: none;
}

.mini-books {
  display: flex;
  align-items: end;
  width: 2.15rem;
  height: 1.9rem;
  padding: 0.22rem;
  border: 1px solid #3b564d;
  border-radius: 0.18rem 0.18rem 0.38rem 0.18rem;
  background: #f7f1e2;
  box-shadow: inset 0 -3px #d3c4a9;
}

.mini-books i {
  display: block;
  width: 0.42rem;
  margin-right: 0.08rem;
  border: 1px solid #243d36;
  background: var(--red);
}

.mini-books i:nth-child(1) {
  height: 1.08rem;
}

.mini-books i:nth-child(2) {
  height: 1.32rem;
  background: var(--green-mid);
}

.mini-books i:nth-child(3) {
  height: 0.92rem;
  background: var(--gold);
}

.site-header nav {
  display: flex;
  gap: 0.35rem;
  align-items: center;
}

.site-header nav a {
  padding: 0.55rem 0.72rem;
  border-radius: 0.35rem;
  color: #4c5853;
  font-size: 0.84rem;
  font-weight: 700;
  text-decoration: none;
}

.site-header nav a:hover {
  color: var(--green);
  background: rgb(36 61 54 / 8%);
}

.home {
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto 4rem;
}

.search-library {
  position: relative;
  display: grid;
  grid-template-columns: minmax(14rem, 0.8fr) minmax(19rem, 1.15fr);
  gap: 1rem 3rem;
  min-height: 32rem;
  padding: clamp(1.5rem, 4vw, 3.2rem);
  overflow: hidden;
  border: 1px solid #20352f;
  border-radius: 0.35rem 0.35rem 1.4rem 0.35rem;
  color: #f8f3e7;
  background-color: var(--green);
  box-shadow: var(--shadow);
}

.search-library::before,
.search-library::after {
  position: absolute;
  content: "";
}

.search-library::before {
  inset: 1rem;
  border: 1px solid rgb(255 255 255 / 10%);
  border-radius: 0.2rem 0.2rem 1rem 0.2rem;
  pointer-events: none;
}

.search-library::after {
  right: -4rem;
  bottom: -4rem;
  width: 14rem;
  height: 14rem;
  border: 1.5rem solid rgb(177 138 67 / 12%);
  border-radius: 50%;
}

.product-heading {
  position: relative;
  z-index: 2;
  align-self: center;
  padding-bottom: 11rem;
}

.eyebrow,
.section-heading p,
.content-heading p,
.saved-drawer header p {
  margin: 0 0 0.45rem;
  color: #ad9b77;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.product-heading h1 {
  max-width: 13ch;
  margin: 0;
  font-family: "Yu Mincho", "Hiragino Mincho ProN", serif;
  font-size: clamp(2rem, 4vw, 2.45rem);
  line-height: 1.35;
  letter-spacing: 0.04em;
}

.product-heading > p:last-child {
  max-width: 29rem;
  margin: 1rem 0 0;
  color: #d7ddd8;
  font-size: 0.94rem;
  line-height: 1.9;
}

.law-library {
  position: absolute;
  z-index: 1;
  bottom: 2.1rem;
  left: clamp(1.4rem, 4vw, 3.2rem);
  width: min(38%, 23rem);
  height: 14rem;
}

.book-row {
  position: absolute;
  bottom: 1rem;
  left: 0;
  display: flex;
  gap: 0.3rem;
  align-items: end;
}

.law-book {
  position: relative;
  display: block;
  width: 2.7rem;
  height: 9.5rem;
  border: 1px solid #162923;
  border-radius: 0.15rem 0.35rem 0.2rem 0.15rem;
  background: #8d352f;
  box-shadow:
    inset 0.35rem 0 rgb(255 255 255 / 9%),
    0.3rem 0.45rem 0 rgb(14 28 23 / 30%);
  transform: rotate(-2deg);
}

.law-book::before,
.law-book::after {
  position: absolute;
  right: 0.28rem;
  left: 0.28rem;
  height: 0.14rem;
  background: #caaa64;
  content: "";
}

.law-book::before {
  top: 0.7rem;
}

.law-book::after {
  bottom: 0.7rem;
}

.law-book i {
  position: absolute;
  top: 1.4rem;
  left: 50%;
  color: #f7e8be;
  font-family: "Yu Mincho", serif;
  font-size: 0.9rem;
  font-style: normal;
  writing-mode: vertical-rl;
  transform: translateX(-50%);
}

.law-book.book-b {
  height: 11rem;
  background: #455e54;
  transform: rotate(1deg);
}

.law-book.book-c {
  height: 8.8rem;
  background: #a17d3c;
  transform: rotate(-1deg);
}

.law-book.book-d {
  height: 10.2rem;
  background: #4e6760;
  transform: rotate(2deg);
}

.law-book.book-e {
  height: 7.8rem;
  background: #76352f;
}

.reading-desk {
  position: absolute;
  right: 0;
  bottom: 1.2rem;
  width: 11rem;
  height: 7rem;
  border-bottom: 0.8rem solid #6f4e31;
  transform: rotate(2deg);
}

.desk-page {
  position: absolute;
  bottom: 0.8rem;
  width: 5.45rem;
  height: 5.4rem;
  border: 1px solid #bbaa8b;
  background: #fbf5e7;
  box-shadow: 0 0.35rem 0.7rem rgb(0 0 0 / 18%);
}

.left-page {
  left: 0;
  border-radius: 0.2rem 0 0 0.4rem;
  transform: skewY(-4deg);
}

.right-page {
  right: 0;
  border-radius: 0 0.2rem 0.4rem 0;
  transform: skewY(4deg);
}

.page-line {
  position: absolute;
  z-index: 2;
  right: 1.1rem;
  bottom: 4.6rem;
  width: 3.7rem;
  height: 0.12rem;
  background: #9e9480;
  box-shadow:
    0 0.7rem #9e9480,
    0 1.4rem #9e9480;
}

.line-two {
  right: auto;
  left: 1.1rem;
  width: 3.2rem;
}

.page-tab {
  position: absolute;
  z-index: 3;
  top: 0.25rem;
  right: 1.3rem;
  padding: 0.28rem 0.35rem 0.7rem;
  color: white;
  background: var(--red);
  font-size: 0.58rem;
  writing-mode: vertical-rl;
}

.search-form {
  position: relative;
  z-index: 3;
  align-self: center;
  padding: clamp(1.15rem, 3vw, 2rem);
  border: 1px solid #d7c9aa;
  border-radius: 0.25rem 0.25rem 0.9rem 0.25rem;
  color: var(--ink);
  background: #f8f2e5;
  box-shadow: 0.65rem 0.7rem 0 #162c25;
}

.mode-tabs {
  display: flex;
  gap: 0.4rem;
  margin: 0 0 1.2rem;
  padding: 0;
  border: 0;
}

.mode-tabs legend {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.mode-tabs label {
  flex: 1;
  cursor: pointer;
}

.mode-tabs input {
  position: absolute;
  opacity: 0;
}

.mode-tabs span {
  display: block;
  padding: 0.7rem;
  border: 1px solid #bcb19e;
  border-radius: 0.3rem;
  color: #5a625d;
  background: #eee6d6;
  font-size: 0.82rem;
  font-weight: 800;
  text-align: center;
}

.mode-tabs input:checked + span {
  border-color: var(--green);
  color: white;
  background: var(--green);
}

.mode-tabs input:focus-visible + span {
  outline: 3px solid #d5a844;
  outline-offset: 3px;
}

.query-line > label,
.filter-line > label {
  display: block;
  margin-bottom: 0.45rem;
  color: #526059;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.query-slot {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: stretch;
  overflow: hidden;
  border: 2px solid var(--green);
  border-radius: 0.28rem;
  background: white;
}

.search-mark {
  display: grid;
  place-items: center;
  width: 3rem;
  margin: 0.35rem;
  border: 1px solid #b64a3e;
  color: var(--red);
  font-family: "Yu Mincho", serif;
  font-weight: 800;
  background: #fff8ed;
}

.query-slot input {
  min-width: 0;
  padding: 1rem 0.55rem;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  font-size: 1rem;
}

.query-slot button {
  min-width: 7.3rem;
  border: 0;
  color: white;
  background: var(--red);
  font-weight: 800;
  cursor: pointer;
}

.query-slot button:hover {
  background: var(--red-dark);
}

.query-slot button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.filter-line {
  display: grid;
  grid-template-columns: 7.8rem minmax(0, 1fr);
  gap: 0.35rem 0.8rem;
  align-items: center;
  margin-top: 1rem;
}

.filter-line > label {
  grid-column: 1;
  margin: 0;
}

.filter-line select {
  grid-column: 1;
  padding: 0.62rem;
  border: 1px solid #aea491;
  border-radius: 0.25rem;
  color: var(--ink);
  background: white;
}

.examples {
  display: flex;
  grid-column: 2;
  grid-row: 1 / span 2;
  gap: 0.4rem;
  flex-wrap: wrap;
  align-self: end;
}

.examples button {
  padding: 0.52rem 0.62rem;
  border: 1px solid #c5b9a2;
  border-radius: 2rem;
  color: #526059;
  background: transparent;
  font-size: 0.72rem;
  cursor: pointer;
}

.examples button:hover {
  border-color: var(--green);
  color: var(--green);
  background: var(--green-pale);
}

.search-status {
  min-height: 1.4rem;
  margin: 1rem 0 0;
  color: #64716b;
  font-size: 0.78rem;
}

.search-form.is-loading .search-mark {
  animation: stamp 0.8s ease-in-out infinite alternate;
}

@keyframes stamp {
  from {
    transform: translateY(-2px);
  }
  to {
    transform: translateY(2px);
  }
}

.source-ribbon {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin: 1rem 0 2rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  border-radius: 0.3rem;
  background: rgb(255 253 247 / 70%);
}

.source-ribbon span {
  padding: 0.28rem 0.6rem;
  border-left: 3px solid var(--green-mid);
  color: #53605a;
  font-size: 0.72rem;
  font-weight: 800;
}

.source-ribbon a {
  margin-left: auto;
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 800;
}

.work-area {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 19rem;
  gap: 1.5rem;
  align-items: start;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 0.8rem;
  padding: 0 0.35rem;
}

.section-heading p,
.saved-drawer header p,
.content-heading p {
  color: var(--red);
}

.section-heading h2,
.saved-drawer h2 {
  margin: 0;
  font-family: "Yu Mincho", "Hiragino Mincho ProN", serif;
  font-size: 1.2rem;
}

.section-heading > span {
  color: var(--muted);
  font-size: 0.77rem;
}

.result-list {
  display: grid;
  gap: 0.85rem;
}

.empty-result,
.no-result {
  display: flex;
  gap: 1rem;
  align-items: center;
  min-height: 9rem;
  padding: 1.5rem;
  border: 1px dashed #aa9d86;
  border-radius: 0.25rem 0.25rem 0.85rem 0.25rem;
  color: #606962;
  background: rgb(255 253 247 / 55%);
}

.empty-seal,
.no-result > span {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 3.2rem;
  height: 3.2rem;
  border: 2px solid var(--red);
  border-radius: 50%;
  color: var(--red);
  font-family: "Yu Mincho", serif;
  font-weight: 800;
}

.empty-result h3,
.no-result h3 {
  margin: 0 0 0.35rem;
  color: var(--ink);
  font-family: "Yu Mincho", serif;
  font-size: 1rem;
}

.empty-result p,
.no-result p {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.75;
}

.law-card {
  position: relative;
  padding: 1.3rem 1.3rem 1.2rem 4.3rem;
  overflow: hidden;
  border: 1px solid #beb29f;
  border-radius: 0.25rem 0.25rem 0.9rem 0.25rem;
  background: var(--white);
  box-shadow: 0 0.45rem 1.2rem rgb(45 51 46 / 8%);
}

.law-card::after {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 1.1rem;
  height: 1.1rem;
  border-top: 1px solid #d4c9b6;
  border-left: 1px solid #d4c9b6;
  background: var(--paper);
  content: "";
}

.law-index {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  display: grid;
  place-items: center;
  width: 3.1rem;
  color: white;
  background: var(--green);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  writing-mode: vertical-rl;
}

.law-index::after {
  position: absolute;
  right: -0.5rem;
  top: 1rem;
  width: 0.5rem;
  height: 2rem;
  background: var(--red);
  content: "";
}

.law-head {
  display: flex;
  gap: 0.7rem;
  align-items: center;
  margin-bottom: 0.55rem;
  color: var(--muted);
  font-size: 0.72rem;
}

.law-state {
  padding: 0.22rem 0.45rem;
  border: 1px solid #b36d64;
  color: var(--red);
  font-weight: 800;
}

.law-state.is-current {
  border-color: #668578;
  color: var(--green-mid);
}

.law-card h3 {
  margin: 0;
  font-family: "Yu Mincho", "Hiragino Mincho ProN", serif;
  font-size: clamp(1.05rem, 2.2vw, 1.35rem);
  line-height: 1.55;
}

.law-aliases {
  margin: 0.42rem 0 0;
  color: #737a75;
  font-size: 0.72rem;
  line-height: 1.65;
}

.law-number {
  margin: 0.6rem 0;
  color: #444f49;
  font-size: 0.82rem;
  font-weight: 700;
}

.law-dates {
  display: flex;
  gap: 0.35rem 0.65rem;
  flex-wrap: wrap;
  margin: 0;
  font-size: 0.72rem;
}

.law-dates dt {
  color: #788079;
}

.law-dates dd {
  margin: 0;
  color: #35413b;
  font-variant-numeric: tabular-nums;
}

.law-matches {
  display: grid;
  gap: 0.45rem;
  margin-top: 1rem;
}

.law-matches blockquote {
  margin: 0;
  padding: 0.75rem 0.85rem;
  border-left: 3px solid var(--gold);
  color: #3d4943;
  background: #f3eddf;
  font-family: "Yu Mincho", "Hiragino Mincho ProN", serif;
  font-size: 0.82rem;
  line-height: 1.8;
}

.law-actions {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.law-actions a,
.law-actions button {
  padding: 0.58rem 0.75rem;
  border: 1px solid #9f9788;
  border-radius: 0.24rem;
  color: #37443e;
  background: transparent;
  font-size: 0.73rem;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.law-actions a {
  border-color: var(--green);
  color: white;
  background: var(--green);
}

.law-actions button:hover,
.law-actions button.is-saved {
  border-color: var(--red);
  color: var(--red);
  background: #f7e8e3;
}

.law-actions button.is-done {
  border-color: var(--green-mid);
  color: var(--green-mid);
  background: var(--green-pale);
}

.saved-drawer {
  position: sticky;
  top: 1rem;
  padding: 1.1rem;
  border: 1px solid #93856f;
  border-radius: 0.25rem 0.25rem 0.8rem 0.25rem;
  background: #e7dcc7;
  box-shadow:
    inset 0 0 0 0.38rem #d6c8ae,
    0 0.6rem 1.3rem rgb(45 51 46 / 10%);
}

.drawer-handle {
  width: 4rem;
  height: 0.35rem;
  margin: 0 auto 0.85rem;
  border-radius: 1rem;
  background: #9f8d70;
  box-shadow: inset 0 1px rgb(255 255 255 / 45%);
}

.saved-drawer header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0.25rem 0.75rem;
  border-bottom: 1px solid #b5a78f;
}

.saved-drawer header strong {
  display: grid;
  place-items: center;
  width: 2.3rem;
  height: 2.3rem;
  border: 2px solid var(--red);
  border-radius: 50%;
  color: var(--red);
  font-family: "Yu Mincho", serif;
}

.saved-stack {
  display: grid;
  gap: 0.55rem;
  max-height: 35rem;
  margin-top: 0.8rem;
  overflow: auto;
}

.empty-saved {
  margin: 0;
  padding: 1.2rem 0.55rem;
  color: #716b60;
  font-size: 0.76rem;
  line-height: 1.7;
}

.saved-slip {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 0.25rem 0.55rem;
  align-items: start;
  padding: 0.75rem;
  border: 1px solid #c5b9a3;
  border-radius: 0.2rem;
  background: #fffaf0;
  box-shadow: 0.2rem 0.25rem 0 rgb(123 102 67 / 14%);
}

.saved-slip > span {
  grid-row: 1 / span 2;
  padding: 0.22rem 0.28rem;
  color: white;
  background: var(--green-mid);
  font-size: 0.58rem;
  writing-mode: vertical-rl;
}

.saved-slip a {
  overflow: hidden;
  font-family: "Yu Mincho", serif;
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1.5;
  text-decoration-thickness: 1px;
}

.saved-slip small {
  grid-column: 2;
  overflow: hidden;
  color: #736f67;
  font-size: 0.64rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.remove-saved {
  grid-column: 3;
  grid-row: 1 / span 2;
  padding: 0.25rem;
  border: 0;
  color: #7d5049;
  background: transparent;
  font-size: 0.65rem;
  cursor: pointer;
}

.clear-button {
  width: 100%;
  margin-top: 0.75rem;
  padding: 0.55rem;
  border: 1px solid #a99a82;
  color: #6f6251;
  background: transparent;
  font-size: 0.7rem;
  cursor: pointer;
}

.official-note {
  margin: 1.5rem 0 0;
  padding: 0.85rem 1rem;
  border-left: 4px solid var(--red);
  color: #5f645f;
  background: rgb(255 253 247 / 65%);
  font-size: 0.75rem;
  line-height: 1.7;
}

.content-page,
.not-found {
  width: min(980px, calc(100% - 2rem));
  min-height: 67vh;
  margin: 1rem auto 4rem;
}

.content-heading {
  display: flex;
  gap: 1.2rem;
  align-items: center;
  padding: 1.5rem;
  border: 1px solid #20352f;
  border-radius: 0.25rem 0.25rem 0.9rem 0.25rem;
  color: white;
  background: var(--green);
}

.page-index {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 3.5rem;
  height: 3.5rem;
  border: 2px solid #d6b76f;
  color: #f4db9d;
  font-family: "Yu Mincho", serif;
  font-size: 1.25rem;
}

.content-heading h1 {
  margin: 0;
  font-family: "Yu Mincho", serif;
  font-size: clamp(1.35rem, 4vw, 2rem);
}

.instruction-grid,
.source-grid,
.privacy-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 1rem;
}

.instruction-grid section,
.source-ledger,
.privacy-grid section {
  padding: 1.25rem;
  border: 1px solid var(--line);
  border-radius: 0.25rem 0.25rem 0.7rem 0.25rem;
  background: var(--white);
}

.instruction-grid b {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border: 1px solid var(--red);
  border-radius: 50%;
  color: var(--red);
  font-family: "Yu Mincho", serif;
}

.instruction-grid h2,
.source-ledger h2,
.privacy-grid h2 {
  margin: 0.8rem 0 0.5rem;
  font-family: "Yu Mincho", serif;
  font-size: 1rem;
}

.instruction-grid p,
.source-ledger p,
.privacy-grid p {
  margin: 0.55rem 0 0;
  color: #5d6761;
  font-size: 0.8rem;
  line-height: 1.85;
}

.source-ledger a {
  color: var(--green-mid);
  font-weight: 800;
}

.page-cta,
.not-found a {
  display: inline-block;
  margin-top: 1rem;
  padding: 0.7rem 1rem;
  border-radius: 0.25rem;
  color: white;
  background: var(--red);
  font-size: 0.82rem;
  font-weight: 800;
  text-decoration: none;
}

.not-found {
  display: grid;
  place-content: center;
  text-align: center;
}

.not-found > span {
  color: #a89b84;
  font-family: "Yu Mincho", serif;
  font-size: 2rem;
}

.not-found h1 {
  margin: 0.45rem 0;
  font-family: "Yu Mincho", serif;
  font-size: 1.5rem;
}

.not-found p {
  color: var(--muted);
  font-size: 0.82rem;
}

.not-found a {
  justify-self: center;
}

.site-footer {
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  padding: 1.2rem max(1rem, calc((100% - 1180px) / 2));
  color: #d1d8d4;
  background: #1d312b;
  font-size: 0.7rem;
}

.site-footer a {
  color: #f1dfb5;
}

@media (max-width: 840px) {
  .search-library {
    grid-template-columns: 1fr;
    padding-bottom: 2rem;
  }

  .product-heading {
    padding: 0;
  }

  .law-library {
    position: relative;
    bottom: auto;
    left: auto;
    width: min(100%, 28rem);
    height: 11.5rem;
  }

  .law-book {
    height: 7.5rem;
  }

  .law-book.book-b {
    height: 9rem;
  }

  .law-book.book-c {
    height: 6.8rem;
  }

  .law-book.book-d {
    height: 8.2rem;
  }

  .law-book.book-e {
    height: 5.8rem;
  }

  .work-area {
    grid-template-columns: 1fr;
  }

  .saved-drawer {
    position: static;
  }

  .instruction-grid,
  .source-grid,
  .privacy-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 580px) {
  .site-header,
  .home,
  .content-page,
  .not-found {
    width: min(100% - 1rem, 1180px);
  }

  .site-header {
    align-items: flex-start;
  }

  .site-header nav {
    gap: 0;
  }

  .site-header nav a {
    padding: 0.5rem 0.38rem;
    font-size: 0.7rem;
  }

  .search-library {
    gap: 1rem;
    padding: 1rem;
  }

  .product-heading h1 {
    font-size: 1.8rem;
  }

  .law-library {
    height: 9rem;
    transform: scale(0.83);
    transform-origin: left bottom;
  }

  .search-form {
    padding: 0.85rem;
    box-shadow: 0.35rem 0.4rem 0 #162c25;
  }

  .mode-tabs span {
    padding: 0.6rem 0.3rem;
    font-size: 0.72rem;
  }

  .query-slot {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .search-mark {
    width: 2.4rem;
  }

  .query-slot button {
    grid-column: 1 / -1;
    min-height: 2.8rem;
  }

  .filter-line {
    grid-template-columns: 1fr;
  }

  .filter-line > label,
  .filter-line select,
  .examples {
    grid-column: 1;
    grid-row: auto;
  }

  .source-ribbon {
    gap: 0.35rem;
    flex-wrap: wrap;
  }

  .source-ribbon a {
    width: 100%;
    margin: 0.35rem 0 0;
  }

  .law-card {
    padding: 1rem 0.85rem 1rem 3.4rem;
  }

  .law-index {
    width: 2.5rem;
  }

  .law-actions {
    display: grid;
  }

  .law-actions a,
  .law-actions button {
    text-align: center;
  }

  .content-heading {
    padding: 1rem;
  }

  .page-index {
    width: 2.8rem;
    height: 2.8rem;
  }

  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
