html.cg-sheet-open { overflow: hidden; }

.cg-sheet {
  --sheet-paper: #fbf4e9;
  --sheet-ink: #2b2422;
  --sheet-wine: #6f2639;
  --sheet-muted: #635552;
  --sheet-rule: #cec2b9;
  --sheet-serif: var(--serif, "Iowan Old Style", Baskerville, Georgia, serif);
  --sheet-sans: var(--sans, Inter, "Helvetica Neue", Arial, sans-serif);
  --sheet-inset: clamp(26px, 6vw, 66px);
  position: fixed;
  inset: 0;
  width: min(728px, calc(100% - 36px));
  max-width: none;
  max-height: calc(100vh - 50px);
  max-height: min(91dvh, 1000px);
  margin: auto;
  padding: 0;
  overflow: auto;
  overscroll-behavior: contain;
  background-color: var(--sheet-paper);
  color: var(--sheet-ink);
  color-scheme: light;
  border: 1px solid #ab9c94;
  border-radius: 1px;
  box-shadow: 0 19px 72px #24131240;
  font: 400 15px/1.55 var(--sheet-sans);
  text-align: left;
}
.cg-sheet::backdrop { background: rgb(34 23 24 / 60%); backdrop-filter: blur(2px); }
.cg-sheet, .cg-sheet *, .cg-sheet *::before, .cg-sheet *::after { box-sizing: border-box; }
.cg-sheet [hidden] { display: none !important; }
.cg-sheet button, .cg-sheet a { font: inherit; }
.cg-sheet button { cursor: pointer; }

.cg-sheet-bar {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 54px;
  padding: 4px max(18px, calc(var(--sheet-inset) - 10px)) 4px var(--sheet-inset);
  border-bottom: 1px solid var(--sheet-rule);
  background: var(--sheet-paper);
}
.cg-sheet-brand { color: var(--sheet-wine); font: italic 23px/1.1 var(--sheet-serif); letter-spacing: -.045em; }
.cg-sheet .cg-sheet-close {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--sheet-wine);
  font: 300 30px/1 var(--sheet-sans);
}
.cg-sheet .cg-sheet-close:hover { background: #efdfd8; }
.cg-sheet-screen {
  padding: 28px var(--sheet-inset) 35px;
  background-image: linear-gradient(to right, transparent calc(var(--sheet-inset) - 19px), #a657642c calc(var(--sheet-inset) - 19px), #a657642c calc(var(--sheet-inset) - 18px), transparent calc(var(--sheet-inset) - 18px));
}
.cg-sheet .cg-sheet-heading { position: static; display: block; margin: 0 0 23px; padding: 0; border: 0; background: none; color: inherit; }
.cg-sheet .cg-sheet-kicker { margin: 0 0 8px; color: var(--sheet-wine); font: 650 10px/1.5 var(--sheet-sans); letter-spacing: .15em; text-transform: uppercase; }
.cg-sheet .cg-sheet-title {
  margin: 0;
  padding: 0;
  max-width: 17ch;
  text-wrap: balance;
  color: var(--sheet-ink);
  font: 400 clamp(38px, 6vw, 60px)/1.03 var(--sheet-serif);
  letter-spacing: -.055em;
}
.cg-sheet .cg-sheet-title:focus { outline: none; }
.cg-sheet .cg-sheet-intro { margin: 12px 0 0; max-width: 59ch; color: var(--sheet-muted); font-size: 14px; line-height: 1.6; }

.cg-sheet-menu { display: grid; border-top: 1px solid var(--sheet-rule); }
.cg-sheet .cg-sheet-menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  margin: 0;
  padding: 18px 0;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--sheet-rule);
  border-radius: 0;
  color: var(--sheet-ink);
  text-align: left;
}
.cg-sheet-menu-lines { display: grid; gap: 6px; }
.cg-sheet-menu-name { font: 400 clamp(25px, 4vw, 32px)/1.1 var(--sheet-serif); letter-spacing: -.04em; }
.cg-sheet-menu-hint { color: var(--sheet-muted); font-size: 13px; line-height: 1.4; }
.cg-sheet-menu-arrow { color: var(--sheet-wine); font-size: 25px; }
.cg-sheet-menu-item:hover .cg-sheet-menu-name { color: var(--sheet-wine); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .13em; }

.cg-sheet-form { display: block; margin: 0; padding: 0; background: none; color: inherit; }
.cg-sheet-field { min-width: 0; margin: 0 0 18px; padding: 0; border: none; }
.cg-sheet-label { display: block; float: none; width: auto; margin: 0 0 6px; padding: 0; font-size: 14px; line-height: 1.4; font-weight: 650; }
.cg-sheet-pills { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; }
.cg-sheet-radio { position: relative; display: flex; align-items: stretch; min-width: 0; cursor: pointer; }
.cg-sheet-radio-input { position: absolute; width: 1px; height: 1px; margin: 0; padding: 0; clip-path: inset(50%); }
.cg-sheet-pill {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  min-height: 44px;
  padding: 7px 3px;
  border-bottom: 1px solid var(--sheet-rule);
  color: var(--sheet-ink);
  font-size: 13px;
  line-height: 1.35;
}
.cg-sheet-pill::before {
  content: "";
  flex: none;
  width: 14px;
  height: 14px;
  border: 1px solid #88736e;
  border-radius: 50%;
}
.cg-sheet-radio-input:checked + .cg-sheet-pill { color: var(--sheet-wine); font-weight: 650; border-color: var(--sheet-wine); }
.cg-sheet-radio-input:checked + .cg-sheet-pill::before { background: var(--sheet-wine); border-color: var(--sheet-wine); box-shadow: inset 0 0 0 3px var(--sheet-paper); }
.cg-sheet-radio:hover .cg-sheet-pill { color: var(--sheet-wine); }
.cg-sheet .cg-sheet-optional { color: var(--sheet-muted); font-weight: 400; font-size: 12px; }
.cg-sheet .cg-sheet-text {
  display: block;
  width: 100%;
  min-height: 77px;
  max-height: 190px;
  margin: 0;
  padding: 5px 6px;
  resize: vertical;
  border: 0;
  border-bottom: 1px solid #a3978e;
  border-radius: 0;
  background: repeating-linear-gradient(to bottom, transparent 0 27px, var(--sheet-rule) 27px 28px) 0 4px / 100% 28px;
  color: var(--sheet-ink);
  font: 400 16px/28px var(--sheet-sans);
}
.cg-sheet-text::placeholder { color: #766763; opacity: 1; }

.cg-sheet-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 5px 18px; margin-top: 24px; }
.cg-sheet .cg-sheet-primary, .cg-sheet .cg-sheet-link, .cg-sheet .cg-sheet-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 45px;
  margin: 0;
  padding: 7px 0;
  background: none;
  border: 0;
  border-radius: 0;
  color: var(--sheet-wine);
  font: 600 13px/1.35 var(--sheet-sans);
}
.cg-sheet .cg-sheet-primary { padding: 10px 18px; border: 1px solid var(--sheet-wine); background: var(--sheet-wine); color: var(--sheet-paper); text-decoration: none; }
.cg-sheet .cg-sheet-primary:hover { background: #55182a; border-color: #55182a; }
.cg-sheet a.cg-sheet-primary + .cg-sheet-primary { background: transparent; color: var(--sheet-wine); }
.cg-sheet a.cg-sheet-primary + .cg-sheet-primary:hover { background: #f1dfdc; }
.cg-sheet .cg-sheet-link, .cg-sheet .cg-sheet-remove { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .25em; }
.cg-sheet .cg-sheet-status, .cg-sheet-confirm { color: var(--sheet-muted); font-size: 12px; line-height: 1.5; }
.cg-sheet-status { margin: 10px 0 0; }
.cg-sheet .cg-sheet-remove { margin-top: 3px; font-weight: 450; font-size: 12px; }
.cg-sheet-confirm { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-top: 8px; }

.cg-sheet-summary { margin: 0; border-block: 1px solid var(--sheet-rule); }
.cg-sheet-summary-row { display: grid; grid-template-columns: minmax(0, .95fr) minmax(0, 1.35fr); align-items: baseline; gap: 18px; padding: 12px 0; }
.cg-sheet-summary-row + .cg-sheet-summary-row { border-top: 1px solid var(--sheet-rule); }
.cg-sheet-summary-label { color: var(--sheet-muted); font-size: 12px; }
.cg-sheet-summary-value { margin: 0; color: var(--sheet-ink); font: 400 19px/1.4 var(--sheet-serif); white-space: pre-line; overflow-wrap: anywhere; }
.cg-sheet .cg-sheet-radio-input:focus-visible + .cg-sheet-pill,
.cg-sheet :is(button, a, textarea):focus-visible { outline: 2px solid var(--sheet-wine); outline-offset: 3px; }

@media (max-width: 540px) {
  .cg-sheet { --sheet-inset: 24px; width: calc(100% - 16px); max-height: calc(100dvh - 20px); }
  .cg-sheet-screen { padding-block: 21px 26px; background: none; }
  .cg-sheet .cg-sheet-title { font-size: clamp(38px, 10vw, 49px); }
  .cg-sheet-summary-row { display: block; }
  .cg-sheet-summary-value { margin-top: 4px; }
  .cg-sheet-pills { column-gap: 12px; }
}
@media (max-width: 370px) {
  .cg-sheet { --sheet-inset: 16px; }
  .cg-sheet-pills { grid-template-columns: 1fr; }
}
@media (forced-colors: active) {
  .cg-sheet-radio-input:checked + .cg-sheet-pill::before { background: Highlight; forced-color-adjust: none; }
}
