[data-sf-template] .btp-card {
  --btp-accent: color-mix(in srgb, var(--sf-color-brand-default) 67%, var(--sf-color-text-primary));
  box-sizing: border-box;
  display: grid;
  gap: 16px;
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--sf-color-line-default);
  border-radius: var(--sf-radius-lg);
  background: var(--sf-color-surface-raised);
  color: var(--sf-color-text-primary);
  box-shadow: var(--sf-shadow-sm);
  font-family: var(--sf-font-body);
  scroll-margin-top: 96px;
}
[data-sf-template] .btp-heading { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
[data-sf-template] .btp-heading h2 { margin: 0; font: 800 22px / 1.2 var(--sf-font-heading); }
[data-sf-template] .btp-demo { padding: 3px 8px; border-radius: var(--sf-radius-pill); background: var(--sf-color-surface-sunken); color: var(--sf-color-text-secondary); font-size: 12px; font-weight: 600; }
[data-sf-template] .btp-card form { display: grid; gap: 14px; }
[data-sf-template] .btp-card fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
[data-sf-template] .btp-card legend { margin-bottom: 10px; padding: 0; font-size: 15px; font-weight: 700; }
[data-sf-template] .btp-people { display: grid; gap: 8px; }
[data-sf-template] :is(.btp-person, .btp-amount) { position: relative; display: block; cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
[data-sf-template] :is(.btp-person, .btp-amount) input { position: absolute; width: 1px; height: 1px; opacity: 0; }
[data-sf-template] .btp-person-card {
  box-sizing: border-box;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 20px;
  align-items: center;
  gap: 12px;
  min-height: 76px;
  padding: 10px 12px;
  border: 1px solid var(--sf-color-line-default);
  border-radius: var(--sf-radius-md);
  background: var(--sf-color-surface-raised);
}
[data-sf-template] .btp-avatar { position: relative; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: var(--sf-color-surface-sunken); font-weight: 700; }
[data-sf-template] .btp-avatar::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: url("assets/tip-portraits.jpg") left 22% / 200% auto no-repeat; }
[data-sf-template] .btp-avatar-cook::after { background-position: right 20%; }
[data-sf-template] .btp-person-info { display: grid; gap: 2px; min-width: 0; overflow-wrap: anywhere; }
[data-sf-template] .btp-person-info strong { font-size: 15px; }
[data-sf-template] .btp-person-info span { color: var(--sf-color-text-secondary); font-size: 13px; }
[data-sf-template] .btp-radio { box-sizing: border-box; width: 20px; height: 20px; border: 1px solid var(--sf-color-line-strong); border-radius: 50%; }
[data-sf-template] .btp-person input:checked + span .btp-radio { border: 6px solid var(--btp-accent); }
[data-sf-template] :is(.btp-person, .btp-amount) input:checked + span { border-color: var(--btp-accent); outline: 1px solid var(--btp-accent); outline-offset: -2px; }
[data-sf-template] .btp-person input:focus-visible + span, [data-sf-template] .btp-amount input:focus-visible + span,
[data-sf-template] .btp-button:focus-visible { outline: 2px solid var(--btp-accent); outline-offset: 3px; }
[data-sf-template] .btp-payment { display: grid; gap: 12px; padding-top: 14px; border-top: 1px solid var(--sf-color-line-default); }
[data-sf-template] .btp-amounts { display: flex; flex-wrap: wrap; gap: 8px; }
[data-sf-template] .btp-amount > span {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 44px;
  padding: 6px 13px;
  border: 1px solid var(--sf-color-line-strong);
  border-radius: var(--sf-radius-pill);
  background: var(--sf-color-surface-raised);
  font-size: 15px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
[data-sf-template] .btp-amount input:checked + span { color: var(--btp-accent); }
[data-sf-template] .btp-custom { display: flex; align-items: center; min-width: 0; min-height: 48px; padding-inline: 14px; border: 1px solid var(--sf-color-line-strong); border-radius: var(--sf-radius-md); }
[data-sf-template] .btp-custom:focus-within { border-color: var(--btp-accent); outline: 1px solid var(--btp-accent); outline-offset: -2px; }
[data-sf-template] .btp-custom input { width: 100%; min-width: 0; min-height: 46px; padding: 0; border: 0; outline: none; background: transparent; color: inherit; font: inherit; font-size: 16px; appearance: textfield; }
[data-sf-template] .btp-custom input::-webkit-inner-spin-button { appearance: none; }
[data-sf-template] .btp-note { margin: 0; color: var(--sf-color-text-secondary); font-size: 13px; }
[data-sf-template] .btp-button { width: 100%; min-height: 46px; border: 0; padding: 8px 14px; border-radius: var(--sf-radius-pill); background: var(--btp-accent); color: var(--sf-color-text-inverse); font: inherit; font-size: 15px; font-weight: 750; cursor: pointer; touch-action: manipulation; }
[data-sf-template] .btp-button:disabled { background: var(--sf-color-surface-sunken); color: var(--sf-color-text-secondary); cursor: default; }
@media (hover: hover) and (pointer: fine) {
  [data-sf-template] :is(.btp-person:hover .btp-person-card, .btp-amount:hover > span) { border-color: var(--btp-accent); }
  [data-sf-template] .btp-button:not(:disabled):hover { background: color-mix(in srgb, var(--btp-accent) 85%, var(--sf-color-text-primary)); }
}
@media (max-width: 1300px) {
  [data-sf-template] .btp-amounts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1024px) {
  [data-sf-template] .kz-order-card:has(> [data-sf-slot="order-lines"] #tips-preview) > [data-sf-slot="order-lines"] {
    /* The frame sets display: contents inline on its slot wrapper. */
    display: flex !important;
    flex-direction: column;
    grid-area: 2 / 3 / 6;
    gap: 16px;
    min-width: 0;
  }
  [data-sf-template] .kz-order-card:has(#tips-preview) .bo-lines { grid-area: auto; position: static; }
  [data-sf-template] .kz-order-card .btp-card { padding: 24px; }
}
@media (max-width: 1023px) {
  [data-sf-template] .btp-card { margin-block-start: 16px; }
}
