#items { display: grid; gap: .9rem; margin-top: 1.3rem; }
.quote-item {
  min-inline-size: 0; margin: 0; border: 1px solid #a7b9c1;
  border-radius: .3rem; background: #fff;
}
.quote-item:focus-within { border-color: #53798a; }
.item-heading {
  display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center;
  column-gap: .75rem; padding: .7rem .9rem; min-height: 3.5rem;
  border-radius: .25rem; background: #f3f7f9; color: #273e49; list-style: none;
}
.item-heading::-webkit-details-marker { display: none; }
.item-heading::after {
  content: ""; grid-area: 1 / 3; width: .55rem; height: .55rem;
  border: solid currentColor; border-width: 0 .125rem .125rem 0; transform: rotate(45deg);
}
.item-editor[open] > .item-heading {
  background: #e2ecf1; border-bottom: 1px solid #b8c9d1; border-radius: .25rem .25rem 0 0;
}
.item-editor[open] > .item-heading::after { transform: rotate(225deg); }
.item-number { grid-area: 1 / 1; font-weight: 700; }
.subtotal { grid-area: 1 / 2; text-align: right; font-size: 1rem; font-variant-numeric: tabular-nums; }
.item-name { grid-column: 1 / -1; font-weight: 600; }
.item-name:empty, .item-editor[open] > summary .item-name { display: none; }
.item-body { padding: .85rem .9rem .65rem; }
.item-body .extra { margin-bottom: 0; border-bottom: 0; }
.item-body .remove { display: block; margin-left: auto; }
.reveal-for-focus::details-content { transition: none; }
@media (hover: hover) { .item-heading:hover { background: #e1ebef; } }
@media screen and (prefers-reduced-motion: no-preference) {
  .item-heading::after { transition: transform 150ms ease-out; }
  .item-heading { transition: background-color 130ms ease-out; }
}
.extra { margin: .75rem 0; border-block: 1px solid #aabdc7; }
.extra summary {
  display: flex; align-items: center; justify-content: space-between; gap: .8rem;
  min-height: 3.5rem; padding: .65rem .6rem; list-style: none; font-weight: 700;
  color: #283e49; cursor: pointer;
}
.extra summary::-webkit-details-marker { display: none; }
.extra summary::after {
  content: ""; flex: none; width: .55rem; height: .55rem; margin: -.25rem .4rem 0 0;
  border: solid currentColor; border-width: 0 .125rem .125rem 0; transform: rotate(45deg);
}
.extra[open] > summary::after { transform: rotate(225deg); margin-block-start: .25rem; }
.extra[open] > summary { background: #e0ebf1; }
@media (hover: hover) { .extra summary:hover { background: #dbe8ef; } }
.extra-body { padding: .85rem .6rem 1rem; }
.extra label + label { margin-top: .65rem; }
.tax-options label { display: flex; gap: .65rem; align-items: center; padding: .5rem .75rem; min-height: 3rem; margin-bottom: .5rem; border: 1px solid var(--field-edge); border-radius: .3rem; background: white; cursor: pointer; font-weight: 400; }
.tax-options input { width: 1.25rem; min-height: auto; height: 1.25rem; flex: none; accent-color: var(--accent); }
.tax-options label:has(:checked) { border-color: #53798a; background: #f4f9fb; }
#tax-summary p { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem; margin-bottom: .4rem; }
.numbers { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,2fr); gap: .75rem; margin-top: .7rem; }
.numbers input { text-align: right; }
.grand-total { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .5rem; }
#add-item { width: 100%; min-height: 3.5rem; margin: .7rem 0 1.25rem; color: var(--accent); border-color: var(--accent); }
.grand-total { border-top: 2px solid var(--ink); padding-top: .8rem; }
.grand-total strong { font-size: 1.5rem; font-variant-numeric: tabular-nums; }
#hangul { text-align: right; }
.invoice-action { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.invoice-action button { width: 100%; min-height: 3.5rem; color: var(--accent); border-color: var(--accent); }
.invoice-action button + button { margin-top: .5rem; }
.billing-choice { margin: 0 0 .8rem; }
.billing-choice > div { display: flex; flex-wrap: wrap; gap: .5rem; }
.billing-choice label {
  display: flex; flex: 1 1 auto; align-items: center; gap: .5rem; min-height: 3rem;
  margin: 0; padding: .45rem .7rem; border: 1px solid var(--field-edge); border-radius: .3rem;
  background: white; font-weight: 400; cursor: pointer;
}
.billing-choice label:has(:checked) { border-color: #53798a; background: #e5eff4; }
.billing-choice input { width: 1.2rem; min-height: 0; height: 1.2rem; flex: none; padding: 0; accent-color: var(--accent); }
#billing-options > label { margin-bottom: .8rem; }
.billing-amount { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .4rem; margin-block: .65rem; }
#sheets svg { display: block; width: 100%; height: auto; background: white; stroke: none; }
#sheets svg + svg { margin-top: 1rem; }
#fallback a { display: inline-flex; min-height: 3rem; align-items: center; }
@container (max-width: 18rem) { .numbers { grid-template-columns: 1fr; } }
@media print {
  #sheets svg { width: 180mm; margin: 15mm auto 0; break-inside: avoid; }
  #sheets svg + svg { break-before: page; margin-top: 15mm; }
}
