
.ui-bottom-sheet-demo-list { margin: 16px 0 0; padding: 0; list-style: none; }
.ui-bottom-sheet-demo-list li { display: flex; justify-content: space-between; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--ui-border); }
.ui-bottom-sheet-demo-list span { color: var(--ui-muted); font-size: 14px; }
.ui-bottom-sheet-demo-field { box-sizing: border-box; display: block; width: 100%; height: 46px; margin-top: 6px; padding: 0 12px; border: 1px solid var(--ui-border); border-radius: var(--ui-radius-sm); background: var(--ui-surface); color: var(--ui-fg); font: 16px var(--ui-font); }


html:has(.ui-bottom-sheet[open]) { overflow: hidden; }
.ui-bottom-sheet-host { display: contents; }
.ui-bottom-sheet {
  position: fixed; inset: auto 0 var(--ui-bottom-sheet-kb, 0px) 0; box-sizing: border-box; flex-direction: column;
  width: min(var(--ui-bottom-sheet-w, 640px), 100vw); max-width: 100vw;
  height: calc(100dvh - var(--ui-bottom-sheet-kb, 0px) - max(12px, env(safe-area-inset-top))); max-height: none;
  margin: 0 auto; padding: 0; overflow: hidden; border: 1px solid var(--ui-border); border-bottom: 0; overscroll-behavior: contain;
  border-radius: calc(var(--ui-radius) + 8px) calc(var(--ui-radius) + 8px) 0 0; background: var(--ui-surface); color: var(--ui-fg);
  /* The shadow below is what shows when the sheet is pulled above its top stop. */
  box-shadow: var(--ui-shadow-lg), 0 160px 0 0 var(--ui-surface); font: 15px/1.5 var(--ui-font);
  transform: translateY(100%); will-change: transform;
  transition: transform .32s cubic-bezier(.22, 1, .36, 1), overlay .32s allow-discrete, display .32s allow-discrete;
}
.ui-bottom-sheet[open] { display: flex; transform: translateY(var(--ui-bottom-sheet-y, 50%)); }
@starting-style { .ui-bottom-sheet[open] { transform: translateY(100%); } }
.ui-bottom-sheet::backdrop { background: var(--ui-overlay); }
.ui-bottom-sheet-grip {
  display: grid; place-items: center; flex: none; width: 100%; height: 44px; padding: 0; border: 0; background: transparent;
  cursor: grab; touch-action: none; -webkit-touch-callout: none; user-select: none;
}
.ui-bottom-sheet-grip span { width: 40px; height: 5px; border-radius: 999px; background: var(--ui-strong); }
.ui-bottom-sheet-grip:focus-visible { outline: none; }
.ui-bottom-sheet-grip:focus-visible span { background: var(--ui-accent); box-shadow: var(--ui-focus); }
.ui-bottom-sheet-head {
  position: relative; display: flex; align-items: center; gap: 8px; flex: none; margin-top: -8px; padding: 0 8px 8px 20px;
  border-bottom: 1px solid var(--ui-border); touch-action: none; -webkit-touch-callout: none; user-select: none;
}
.ui-bottom-sheet-head h2 { flex: 1; min-width: 0; margin: 0; font-size: 17px; font-weight: 600; line-height: 1.3; }
.ui-bottom-sheet-close {
  display: grid; place-items: center; flex: none; width: 44px; height: 44px; padding: 0; border: 0; border-radius: var(--ui-radius-sm);
  background: transparent; color: var(--ui-muted); cursor: pointer;
}
@media (hover: hover) { .ui-bottom-sheet-close:hover { background: var(--ui-subtle); color: var(--ui-fg); } }
.ui-bottom-sheet-close:focus-visible { outline: none; box-shadow: var(--ui-focus); }
.ui-bottom-sheet-close svg { width: 18px; height: 18px; }
.ui-bottom-sheet-body {
  flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
  /* --hide is the part of the sheet below the screen at this stop, so that the end of a list can still be reached. */
  padding: 16px 20px calc(24px + env(safe-area-inset-bottom) + var(--ui-bottom-sheet-hide, 0px));
}
.ui-bottom-sheet-body > :first-child { margin-top: 0; }
.ui-bottom-sheet-body > :last-child { margin-bottom: 0; }
@media (prefers-reduced-motion: reduce) { .ui-bottom-sheet { transition: none; } }


.ui-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  height: 38px; padding: 0 16px; border: 1px solid transparent; border-radius: var(--ui-radius-sm);
  font: 500 14px/1 var(--ui-font); text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s;
  --b: var(--ui-accent); --bf: var(--ui-accent-fg); --bs: var(--ui-accent-soft);
}
.ui-btn:focus-visible { outline: none; box-shadow: var(--ui-focus); }
.ui-btn[disabled], .ui-btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; pointer-events: none; }
.ui-btn-neutral { --b: var(--ui-fg); --bf: var(--ui-bg); --bs: var(--ui-subtle); }
.ui-btn-danger { --b: var(--ui-danger); --bf: #fff; --bs: var(--ui-danger-soft); }
.ui-btn-solid { background: var(--b); color: var(--bf); }
.ui-btn-solid:hover { background: color-mix(in srgb, var(--b) 88%, var(--ui-fg)); }
.ui-btn-soft { background: var(--bs); color: var(--b); }
.ui-btn-soft:hover { background: color-mix(in srgb, var(--bs) 80%, var(--b)); }
.ui-btn-outline { background: transparent; color: var(--b); border-color: var(--ui-border); }
.ui-btn-outline:hover { border-color: var(--b); background: var(--bs); }
.ui-btn-ghost { background: transparent; color: var(--b); }
.ui-btn-ghost:hover { background: var(--bs); }
.ui-btn-sm { height: 30px; padding: 0 11px; font-size: 13px; }
.ui-btn-lg { height: 46px; padding: 0 22px; font-size: 16px; }
.ui-btn-full { display: flex; width: 100%; }
.ui-btn-spin { width: 1em; height: 1em; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: ui-btn-spin .7s linear infinite; }
@keyframes ui-btn-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .ui-btn-spin { animation-duration: 2s; } }

