.service-worksheet { display: grid; gap: 14px; }
.worksheet-form {
  padding: clamp(16px, 3vw, 28px);
  border: 1px solid var(--line);
  border-radius: 14px;
}
.worksheet-form { background: var(--card); }
.worksheet-form h3 { margin: 0 0 12px; }
.worksheet-example {
  padding-inline: clamp(16px, 3vw, 28px);
  border-radius: 8px;
}
.worksheet-example summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
  cursor: pointer;
  font-size: .9rem;
  font-weight: 650;
}
.worksheet-example summary::-webkit-details-marker { display: none; }
.worksheet-example[open] { padding-bottom: 16px; }
.worksheet-example[open] summary .icon { transform: rotate(180deg); }
.worksheet-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  margin: 18px 0 0;
}
.worksheet-example .worksheet-grid > div {
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.worksheet-grid dt, .worksheet-field label, .worksheet-method legend {
  display: block;
  font-size: .85rem;
  font-weight: 650;
  color: var(--ink);
}
.worksheet-grid dd { margin: 5px 0 0; color: var(--muted); }
.worksheet-field :is(input[type="text"], input[type="number"], textarea, select) {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 44px;
  margin-top: 6px;
  padding: 9px 12px;
  border: 1px solid var(--control-line);
  border-radius: 7px;
  background: var(--control-fill);
  color: var(--ink);
  font: inherit;
  line-height: 1.5;
}
.worksheet-field textarea { resize: vertical; }
.worksheet-time:not(:has(option[value="custom"]:checked)) .worksheet-custom-time { display: none; }
.worksheet-method { min-width: 0; margin: 0; padding: 0; border: 0; }
.worksheet-duration-option { min-width: 0; margin: 0; padding: 0; border: 0; }
.worksheet-form .button { cursor: pointer; font-family: inherit; }
.worksheet-form [hidden], .worksheet-print-value, .worksheet-print-label,
[aria-expanded="true"] > .worksheet-show, [aria-expanded="false"] > .worksheet-hide { display: none; }
.worksheet-table { width: 100%; }
.worksheet-actions, .worksheet-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
@media screen {
  .worksheet-actions {
    justify-content: space-between;
    gap: 10px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
  }
  .worksheet-actions:has(> button[hidden]) { display: none; }
  .worksheet-row-actions { gap: 2px; }
  .worksheet-row-actions .button, .worksheet-planning-toggle, .worksheet-quiet {
    min-height: 40px;
    gap: 5px;
    padding: 6px 8px;
    font-size: .8rem;
    color: var(--muted);
    background: transparent;
  }
  .worksheet-row-actions .button:hover { color: var(--ink); background: var(--wash); }
  .worksheet-row-actions .button:focus-visible, .worksheet-planning-toggle:focus-visible, .worksheet-quiet:focus-visible { outline-offset: 1px; }
  .worksheet-row-actions .icon, .worksheet-planning-toggle .icon, .worksheet-quiet .icon { width: 16px; height: 16px; }
  .worksheet-form button[aria-expanded="true"] .icon { transform: rotate(180deg); }
  .worksheet-table, .worksheet-table tbody { display: block; }
  .worksheet-table { margin-top: 18px; }
  .worksheet-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }
  .worksheet-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    padding-block: 14px;
    border-top: 1px solid var(--line);
  }
  .worksheet-row td { min-width: 0; padding: 0; }
  .worksheet-row-tools {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
  }
  .worksheet-row-heading {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    margin: 0;
    font-size: 1rem;
    overflow-wrap: anywhere;
  }
  .worksheet-row-number {
    display: grid;
    flex: 0 0 auto;
    min-width: 32px;
    height: 32px;
    padding-inline: 5px;
    place-items: center;
    border-radius: 8px;
    background: var(--wash);
    color: var(--green);
    font-size: .8rem;
    font-variant-numeric: tabular-nums;
  }
  .worksheet-service-label { position: absolute; clip-path: inset(50%); }
  [data-service-summary]:not(:empty) + .worksheet-untitled { display: none; }
  .worksheet-row-meta:not(:empty) { display: block; margin-top: 2px; color: var(--muted); font-size: .82rem; font-weight: 400; }
  .worksheet-service, .worksheet-location-fields, .worksheet-duration-list, .worksheet-duration-option { display: grid; gap: 12px; }
  .worksheet-duration-option:not(:first-child) { padding-top: 12px; border-top: 1px solid var(--line); }
  .worksheet-duration-option > .worksheet-planning-field { grid-column: 1 / -1; }
  .worksheet-time:has(> .worksheet-help) {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, max-content) 34px minmax(0, 1fr);
    align-items: center;
    column-gap: 6px;
  }
  .worksheet-time:has(> .worksheet-help) > label:first-child { display: contents; }
  .worksheet-time:has(> .worksheet-help) > label > select { grid-column: 1 / -1; grid-row: 2; }
  .worksheet-time > .worksheet-custom-time { grid-column: 1 / -1; }
  .worksheet-help { grid-column: 2; grid-row: 1; }
  .worksheet-help summary {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 6px;
    color: var(--green);
    cursor: help;
  }
  .worksheet-help summary::-webkit-details-marker { display: none; }
  .worksheet-help summary .icon { width: 18px; height: 18px; }
  .worksheet-help summary:is(:hover, :focus-visible) { background: var(--wash); }
  .worksheet-help summary:focus-visible { outline-offset: 1px; }
  .worksheet-help::details-content { content-visibility: visible; }
  .worksheet-help p {
    position: absolute;
    z-index: 2;
    inset-block-start: 46px;
    inset-inline-start: 12px;
    width: min(calc(100% - 24px), 23rem);
    margin: 0;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: var(--card);
    box-shadow: 0 5px 16px #243c3324;
    color: var(--ink);
    font-size: .85rem;
  }
  .worksheet-help:not([open]) > p { display: none; }
  .worksheet-help:not([data-dismissed]):has(> summary:focus-visible) > p { display: block; }
  .worksheet-duration-option:has(> [data-remove-duration]:not([hidden])) { grid-template-columns: minmax(0, 1fr) auto; }
  .worksheet-remove-duration {
    align-self: end;
    width: 44px;
    min-height: 44px;
    padding: 0;
    color: #fff;
    background: #a63737;
  }
  .worksheet-remove-duration:hover { background: #852b2b; }
  .worksheet-remove-duration:focus-visible { outline-color: #852b2b; outline-offset: 2px; }
  .worksheet-remove-duration .icon { width: 18px; height: 18px; }
  .worksheet-quiet, .worksheet-planning-toggle { padding-inline: 0; color: var(--green); }
  .worksheet-quiet:hover, .worksheet-planning-toggle:hover { text-decoration: underline; }
  .worksheet-planning-toggle, [data-toggle-location] { width: 100%; justify-content: space-between; text-align: start; }
  .worksheet-planning:has([aria-expanded="true"]),
  .worksheet-duration-option > .worksheet-planning-field,
  .worksheet-location:has([aria-expanded="true"]) {
    padding: 12px;
    border-radius: 8px;
    background: var(--card-hover);
  }
  .worksheet-planning:has([aria-expanded="true"]) { padding-top: 4px; }
  .worksheet-planning-toggle:not([hidden]) + .worksheet-field { margin-top: 4px; }
  .worksheet-options > .button { margin: 6px 16px 0 0; }
  .worksheet-location { padding-top: 12px; border-top: 1px solid var(--line); }
  .worksheet-location h4 { margin-bottom: 10px; }
  .worksheet-location:has([data-toggle-location]:not([hidden])) h4 { display: none; }
  .worksheet-location-fields:not([hidden]) { margin-top: 8px; }
  .worksheet-location-fields p { margin-top: 8px; font-size: .82rem; }
  .worksheet-field :is(input[type="text"], input[type="number"], textarea, select) { background: var(--card); font-weight: 400; }
  .worksheet-price-input { position: relative; display: block; }
  .worksheet-price-input > span {
    position: absolute;
    inset-block: 0;
    inset-inline-start: 12px;
    display: grid;
    place-items: center;
    color: var(--muted);
  }
  .worksheet-price-input > input[type="text"] { padding-inline-start: 28px; }
  .worksheet-custom-time { margin-top: 8px; }
  .worksheet-method-options { margin-top: 4px; }
  .worksheet-method-options label {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 36px;
    cursor: pointer;
    font-weight: 400;
  }
  .worksheet-method-options input {
    flex: 0 0 auto;
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: var(--green);
  }
  .worksheet-field :is(input, textarea, select):focus-visible { outline-offset: 2px; }
  .worksheet-field textarea { height: 4.1em; }
  .worksheet-row[data-planning-collapsed] .worksheet-planning-field,
  .worksheet-row[data-collapsed] > :not(.worksheet-service),
  .worksheet-row[data-collapsed] .worksheet-planning,
  .worksheet-row[data-collapsed] .worksheet-field { display: none; }
}
@media screen and (hover: hover) {
  .worksheet-help:not([data-dismissed]):hover > p { display: block; }
}
@media screen and (max-width: 459px) {
  .worksheet-actions .button { width: 100%; }
}
@media screen and (min-width: 390px) {
  .worksheet-duration-option { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: end; }
  .worksheet-duration-option:has(> [data-remove-duration]:not([hidden])) { grid-template-columns: repeat(2, minmax(0, 1fr)) auto; }
}
@media screen and (max-width: 389px) {
  .worksheet-duration-option > .worksheet-field:first-of-type { grid-column: 1 / -1; }
}
@media (min-width: 620px) {
  .worksheet-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .worksheet-wide { grid-column: 1 / -1; }
}
@media screen and (min-width: 620px) {
  .worksheet-location-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
}
@media print {
  @page { margin: .6in; }
  body > :not(main),
  main > :not(article),
  main > article > :not(.article-layout),
  .article-layout > :not(.article-content),
  .article-content > :not(#service-menu-worksheet),
  .service-worksheet > :not(.worksheet-form),
  .worksheet-form > :is(h3, p, .worksheet-actions),
  .worksheet-row-tools, .worksheet-planning-toggle, .worksheet-quiet, .worksheet-remove-duration, .worksheet-help,
  .worksheet-location-fields p { display: none; }
  body, main > article.surface-cream { color: #151515; background: white; }
  .article-layout { display: block; width: 100%; max-width: none; padding: 0; }
  #service-menu-worksheet { padding: 0; }
  #service-menu-worksheet h2 { margin-bottom: 12pt; font-size: 18pt; }
  .worksheet-form { padding: 0; border: 0; background: white; }
  .worksheet-table { border-collapse: collapse; table-layout: fixed; color: #151515; font-size: 9.5pt; line-height: 1.35; }
  .worksheet-table thead { display: table-header-group; }
  .worksheet-table th, .worksheet-table td {
    padding: 5pt 6pt;
    border: 1px solid #999;
    text-align: start;
    vertical-align: top;
    overflow-wrap: anywhere;
  }
  .worksheet-table th { background: #eef0ee; font-weight: 700; }
  .worksheet-table th:nth-child(1) { width: 34%; }
  .worksheet-table th:nth-child(n+2) { width: 22%; }
  .worksheet-table td { height: 22pt; }
  .worksheet-table td.worksheet-options { padding: 0; }
  .worksheet-duration-option { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .worksheet-duration-option > .worksheet-field { min-width: 0; padding: 5pt 6pt; overflow-wrap: anywhere; }
  .worksheet-duration-option > .worksheet-field ~ .worksheet-field { border-left: 1px solid #999; }
  .worksheet-duration-option + .worksheet-duration-option { border-top: 1px solid #999; }
  .worksheet-duration-option legend, .worksheet-duration-option[data-skip-print] { display: none; }
  .worksheet-row { break-inside: avoid; }
  .worksheet-row[hidden]:not([data-skip-print]) { display: table-row; }
  .worksheet-row[data-skip-print] { display: none; }
  .worksheet-field:not(.worksheet-method) label > span:not(.worksheet-price-input),
  .worksheet-method legend, .worksheet-method-options input,
  .worksheet-method-options label:not(:has(input:checked:not([value="undecided"]))) { display: none; }
  .worksheet-method-options label { color: inherit; font: inherit; }
  .worksheet-time:has(option[value=""]:checked, option[value="custom"]:checked) select { display: none; }
  .worksheet-field :is(input[type="text"], input[type="number"], textarea, select) {
    min-height: 0;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    resize: none;
  }
  .worksheet-field select { appearance: none; }
  .worksheet-price-input { display: flex; }
  .worksheet-price-input:has(input:placeholder-shown) > span { display: none; }
  .worksheet-custom-time input::placeholder { color: transparent; }
  .worksheet-form[data-print-ready] .worksheet-field label { display: none; }
  .worksheet-form[data-print-ready] .worksheet-print-value:not(:empty) { display: block; margin-bottom: 2pt; white-space: pre-wrap; }
  .worksheet-field:has([data-service-name]) { font-weight: 700; }
  .worksheet-location { margin-top: 12pt; break-inside: avoid; font-size: 9.5pt; }
  .worksheet-location[data-skip-print] { display: none; }
  .worksheet-location h4 { margin-bottom: 4pt; }
  .worksheet-location .worksheet-location-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8pt; }
  .worksheet-print-label { display: block; }
}
