:is(.roof-worksheet-library, .roof-record) {
  --worksheet-ink: #112638;
  --worksheet-link: #08547f;
  --worksheet-edge: #becdd5;
  box-sizing: border-box;
  width: min(100%, 75rem);
  max-width: 75rem;
  margin-inline: auto;
  padding: clamp(1.25rem, 4vw, 3.5rem);
  background: #f1f5f7;
  color: var(--worksheet-ink);
  color-scheme: light;
  font: 400 1rem/1.57 system-ui, sans-serif;
  overflow-wrap: break-word;
}
:is(.roof-worksheet-library, .roof-record) * { box-sizing: border-box; }
:is(.roof-worksheet-library, .roof-record) [hidden] { display: none !important; }
:is(.roof-worksheet-library, .roof-record) :is(h1, h2, h3) {
  color: var(--worksheet-ink);
  font-family: inherit;
  line-height: 1.14;
  letter-spacing: -.033em;
  text-transform: none;
  margin: .5em 0;
}
:is(.roof-worksheet-library, .roof-record) h1 { font-size: clamp(2.1rem, 5.1vw, 4.1rem); }
:is(.roof-worksheet-library, .roof-record) h2 { font-size: clamp(1.45rem, 2.6vw, 2.05rem); }
:is(.roof-worksheet-library, .roof-record) h3 { font-size: clamp(1.08rem, 2vw, 1.32rem); }
:is(.roof-worksheet-library, .roof-record) p { max-width: 76ch; color: #294358; }
:is(.roof-worksheet-library, .roof-record) a {
  color: var(--worksheet-link);
  text-decoration: underline;
  text-decoration-thickness: .075em;
  text-underline-offset: .18em;
}
:is(.roof-worksheet-library, .roof-record) a:hover { text-decoration-thickness: .14em; }
:is(.roof-worksheet-library, .roof-record) :is(a, input, select, textarea, button):focus-visible {
  outline: 3px solid #007ca2;
  outline-offset: 3px;
}
:is(.roof-worksheet-library, .roof-record) [id] { scroll-margin-block-start: 8rem; }

.roof-worksheet-library .worksheet-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(14rem, 1fr);
  align-items: stretch;
  overflow: hidden;
  color: #f4faff;
  background: linear-gradient(125deg, #112e47, #193f57);
  border-radius: 1.1rem;
}
.roof-worksheet-library .worksheet-hero .worksheet-intro {
  min-width: 0;
  padding: clamp(1.2rem, 4vw, 3rem);
  align-self: center;
}
.roof-worksheet-library .worksheet-hero :is(h1,h2,h3,p) { color: #eef8ff; }
.roof-worksheet-library .worksheet-hero a { color: #b4e7ff; }
.roof-worksheet-library .worksheet-hero figure {
  position: relative;
  display: grid;
  align-content: stretch;
  margin: 0;
  min-height: 13rem;
}
.roof-worksheet-library .worksheet-hero figure img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.roof-worksheet-library .worksheet-hero figcaption {
  position: absolute;
  inset: auto .7rem .7rem;
  width: fit-content;
  max-width: calc(100% - 1.4rem);
  padding: .4rem .65rem;
  border-radius: .35rem;
  color: #fff;
  background: #102638e8;
  font-size: .84rem;
}
.roof-worksheet-library .worksheet-controls {
  display: flex;
  flex-wrap: wrap;
  gap: .8rem 1.25rem;
  align-items: end;
  margin-block: 1.5rem .75rem;
  padding: clamp(.9rem, 2vw, 1.35rem);
  background: #fff;
  border: 1px solid var(--worksheet-edge);
  border-radius: .7rem;
}
.roof-worksheet-library .worksheet-controls label {
  flex: 1 1 14rem;
  display: block;
  min-width: 0;
  color: var(--worksheet-ink);
  font-weight: 650;
}
.roof-worksheet-library .worksheet-controls :is(input,select), .roof-record [data-copy-url] {
  display: block;
  width: 100%;
  min-height: 2.75rem;
  margin-top: .3rem;
  padding: .55rem .7rem;
  background: #fff;
  color: var(--worksheet-ink);
  border: 1px solid #698496;
  border-radius: .35rem;
  font: 400 1rem/1.4 system-ui, sans-serif;
}
.roof-worksheet-library [data-worksheet-count], .roof-record [data-copy-status] { font-weight: 600; }
.roof-worksheet-library [data-worksheet-empty] { padding: 1rem; border-left: .22rem solid #437895; background: #fff; }
.roof-worksheet-library .worksheet-group { margin-block: clamp(1.5rem, 4vw, 3rem); }
.roof-worksheet-library .worksheet-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr));
  gap: .85rem;
}
.roof-worksheet-library .worksheet-card {
  position: relative;
  padding: 1rem 1.1rem;
  min-width: 0;
  background: #fff;
  border: 1px solid var(--worksheet-edge);
  border-radius: .65rem;
}
.roof-worksheet-library .worksheet-card h3 { margin: .1rem 0 .4rem; }
.roof-worksheet-library .worksheet-card p { margin-bottom: .1rem; font-size: .96rem; }
.roof-worksheet-library .worksheet-card h3 a::after { content: ''; position: absolute; inset: 0; }
.roof-worksheet-library .worksheet-card:focus-within { outline: 3px solid #007ca2; outline-offset: 2px; }
.roof-worksheet-library .worksheet-card:hover { border-color: #447792; }

.roof-record .worksheet-intro {
  margin-block: .75rem 1.5rem;
  padding-left: clamp(.9rem, 2.3vw, 1.65rem);
  border-left: .3rem solid #2d6b92;
}
.roof-record .worksheet-intro h1 { max-width: 26ch; }
.roof-record .worksheet-example {
  margin-block: 1rem;
  padding: .85rem 1.1rem;
  background: #e4edf2;
  color: var(--worksheet-ink);
  border-inline-start: .2rem solid #79a1b8;
}
.roof-record .worksheet-example p { margin-block: .35rem; }
.roof-record .worksheet-paper {
  margin-block: 1.5rem;
  padding: clamp(1rem, 3vw, 2rem);
  border: 1px solid #b2c3cd;
  border-top: .25rem solid #25475f;
  border-radius: .48rem;
  background: #fff;
  box-shadow: 0 .4rem 1.25rem #213e5610;
}
.roof-record .worksheet-paper label { display: block; margin-block: 1rem; font-weight: 650; }
.roof-record .worksheet-paper textarea { min-height: 5rem; }
:is(.roof-worksheet-library, .roof-record) .worksheet-actions {
  display: flex; flex-wrap: wrap; gap: .65rem 1rem; align-items: center; margin-block: 1rem;
}
.roof-record .worksheet-actions button, :is(.roof-worksheet-library, .roof-record) a.worksheet-packet {
  min-height: 2.75rem;
  display: inline-flex; align-items: center; justify-content: center;
  padding: .55rem .95rem; margin: 0;
  font: 650 1rem/1.3 system-ui,sans-serif;
  border: 1px solid #254b66; border-radius: .4rem;
  background: #173a55; color: #fff;
  text-decoration: none; cursor: pointer;
}
.roof-record .worksheet-actions [data-copy-worksheet], :is(.roof-worksheet-library, .roof-record) a.worksheet-packet {
  color: var(--worksheet-link); background: #fff;
}
.roof-record [data-copy-fallback] { max-width: 46rem; }
.roof-record [data-copy-status]:empty { margin: 0; }
@media (max-width: 44rem) {
  .roof-worksheet-library .worksheet-hero { grid-template-columns: 1fr; }
  .roof-worksheet-library .worksheet-hero figure { min-height: 0; max-height: 12rem; }
  .roof-worksheet-library .worksheet-hero img { max-height: 12rem; }
}
@media print {
  :is(.roof-worksheet-library, .roof-record) {
    background: #fff; color: #000; padding: 0; width: auto; max-width: none;
    font: 10pt/1.35 system-ui, sans-serif;
  }
  :is(.roof-worksheet-library, .roof-record) :is(h1,h2,h3,p,a,label) { color: #111; }
  .roof-record h1 { font-size: 21pt; max-width: none; }
  .roof-record h2 { font-size: 14pt; }
  .roof-record .worksheet-intro { border: 0; padding: 0; margin: 0; }
  .roof-record .worksheet-example { background: transparent; margin: .4rem 0; padding: 0 .6rem; }
  .roof-record .worksheet-paper { background: #fff; box-shadow: none; padding: .45rem .6rem; margin: .6rem 0; }
  .roof-record .worksheet-paper label { break-inside: avoid; margin: .5rem 0; }
  .roof-record.dw-ready .worksheet-paper .dw-print-value { min-height: 2.5em; }
  .roof-record :is(.worksheet-actions,[data-copy-fallback],[data-copy-status],.worksheet-packet,.dw-screen) { display: none !important; }
  .roof-worksheet-library :is(.worksheet-actions,[data-worksheet-enhance],.worksheet-hero figure,.worksheet-packet) { display: none !important; }
  .roof-worksheet-library .worksheet-hero { display: block; background: #fff; }
  .roof-worksheet-library .worksheet-hero :is(h1,h2,h3,p,a) { color: #111; }
  .roof-worksheet-library .worksheet-card { break-inside: avoid; }
}
