/* Base, chrome, controls and overlays. Screens live in screens.css. Source: DESIGN.md. */

*,
*::before,
*::after { box-sizing: border-box; }

html { background: var(--bg); scroll-padding-top: calc(var(--toolbar-h) + 24px); }

html,
body { margin: 0; min-height: 100%; }

body {
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.44;
  font-weight: 400;
  letter-spacing: -0.374px;
  font-feature-settings: "ss03";
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body.is-modal,
body.is-menu { overflow: hidden; }

button,
input,
select,
textarea { font: inherit; color: inherit; letter-spacing: inherit; }

button { background: none; border: 0; padding: 0; margin: 0; cursor: pointer; }
input { border: 0; background: transparent; margin: 0; }
a { color: inherit; text-decoration: none; }
p, h1, h2, h3, ul { margin: 0; }
ul { padding: 0; list-style: none; }
th { font-weight: 400; }

:focus { outline: none; }
:focus-visible { outline: 2px solid var(--blue-focus); outline-offset: 2px; }
::selection { background: var(--selection); }

.tnum { font-variant-numeric: tabular-nums; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 90;
  padding: 8px 14px;
  border-radius: var(--r-pill);
  background: var(--canvas);
  color: var(--blue);
  font-size: 14px;
}
.skip:focus { top: 8px; }

.icon { display: inline-flex; width: 24px; height: 24px; flex: 0 0 auto; }
.icon svg { display: block; width: 100%; height: 100%; }
.icon-sm { width: 16px; height: 16px; }
.icon-xs { width: 12px; height: 12px; }
.icon-lg { width: 28px; height: 28px; }

/* ---------- dashboard shell: sidebar + content column ---------- */

.shell { min-height: 100vh; }

.sidebar {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  width: var(--sidebar-w);
  padding: 24px 16px;
  border-right: 1px solid var(--hairline);
  background: var(--parchment);
  overflow-y: auto;
}

.side-mark {
  align-self: flex-start;
  padding: 0 12px;
  color: var(--ink);
  font-size: 21px;
  line-height: 1.19;
  font-weight: 600;
  letter-spacing: 0.231px;
}

.side-search { margin: 24px 0 20px; }

.side-nav { display: flex; flex-direction: column; gap: 2px; }

.side-link {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 0 12px;
  border-radius: var(--r-compact);
  color: var(--ink-80);
  font-size: 14px;
  line-height: 1.29;
  letter-spacing: -0.224px;
  transition: background 160ms linear, color 160ms linear;
}

.side-link .icon { width: 17px; height: 17px; }
.side-link:hover { background: var(--hover); color: var(--ink); }
.side-link[aria-current="page"] { background: var(--ink); color: var(--on-ink); }
.side-link[aria-current="true"] { color: var(--ink); font-weight: 600; }
.side-link:focus-visible { outline-offset: 0; }

/* Movimentações: one parent with its four subsections indented under it */
.side-group { display: flex; flex-direction: column; gap: 2px; }
.side-children { display: flex; flex-direction: column; gap: 1px; padding-left: 41px; }
.side-sublink {
  display: flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: var(--r-compact);
  color: var(--ink-48);
  font-size: 13px;
  line-height: 1.29;
  transition: background 160ms linear, color 160ms linear;
}
.side-sublink:hover { background: var(--hover); color: var(--ink); }
.side-sublink[aria-current="page"] { background: var(--ink); color: var(--on-ink); }
.side-sublink:focus-visible { outline-offset: 0; }

/* Subsection links at the top of a Movimentações screen (same look as the configurator chips) */
.movement-nav {
  display: flex;
  gap: 8px;
  margin: 0 calc(-1 * var(--side));
  padding: 2px var(--side) 4px;
  overflow-x: auto;
  scrollbar-width: none;
}
.movement-nav::-webkit-scrollbar { display: none; }
.movement-link {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  padding: 12px 16px;
  border: 1px solid var(--hairline);
  border-radius: var(--r-pill);
  background: var(--canvas);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.29;
  letter-spacing: -0.224px;
  white-space: nowrap;
}
.movement-link:hover { border-color: var(--hairline-strong); }
.movement-link[aria-current="page"] { border: 2px solid var(--blue-focus); padding: 11px 15px; }

.side-foot {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: auto;
  padding: 24px 4px 0;
}

.side-foot .pill { width: 100%; }

.source-note {
  display: flex;
  flex-direction: column;
  gap: 2px;
  color: var(--ink-48);
  font-size: 12px;
  line-height: 1.33;
  letter-spacing: -0.12px;
}

.source-line { color: var(--ink-80); }
.source-flag { color: var(--warn); font-weight: 600; }

/* appearance switch: System / Light / Dark (radio group styled as compact chips) */
.theme-switch { min-width: 0; margin: 0; padding: 0; border: 0; }
.theme-legend {
  margin-bottom: 6px;
  padding: 0;
  color: var(--ink-48);
  font-size: 12px;
  line-height: 1.33;
  letter-spacing: -0.12px;
}
.theme-options { display: flex; gap: 4px; }
.theme-option { position: relative; flex: 1 1 0; min-width: 0; }
.theme-option input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}
.theme-option span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 8px;
  border: 1px solid var(--hairline);
  border-radius: var(--r-pill);
  background: var(--canvas);
  color: var(--ink-80);
  font-size: 12px;
  line-height: 1;
  letter-spacing: -0.12px;
  transition: border-color 160ms linear;
}
.theme-option:hover span { border-color: var(--hairline-strong); }
.theme-option input:checked + span { border: 2px solid var(--blue-focus); color: var(--ink); font-weight: 600; }
.theme-option input:focus-visible + span { outline: 2px solid var(--blue-focus); outline-offset: 2px; }
.mobile-theme { display: none; }
/* Style switch (DESIGN.md section 12): same radio chips, each with a tiny preview of the style's shape. */
.style-switch { margin-top: -4px; }
.style-option span { gap: 5px; padding: 0 4px; }
.style-swatch { display: inline-block; flex: 0 0 auto; width: 8px; height: 8px; }
.style-swatch[data-swatch="original"] { border-radius: 50%; background: var(--green); }
.style-swatch[data-swatch="typesafe"] { border: 1px solid var(--ink); background: var(--canvas); box-shadow: 2px 2px 0 var(--ink); }
.style-swatch[data-swatch="figma"] { width: 10px; border-radius: 2px; background: var(--swatch-figma); transform: rotate(-8deg); }

.content {
  min-height: 100vh;
  margin-left: var(--sidebar-w);
  background: var(--bg);
}

.mobile-status { display: none; }

/* quiet sticky toolbar over the content column */

.toolbar {
  position: sticky;
  top: 0;
  z-index: 25;
  height: var(--toolbar-h);
  border-bottom: 1px solid var(--line-soft);
  background: var(--toolbar-bg);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
}

.toolbar-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  height: 100%;
  max-width: calc(var(--col) + 2 * var(--side));
  margin: 0 auto;
  padding: 0 var(--side);
}

.toolbar-title {
  flex: 1;
  min-width: 0;
  font-size: 21px;
  line-height: 1.19;
  font-weight: 600;
  letter-spacing: 0.231px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.toolbar-trail { display: flex; align-items: center; gap: 16px; }

.toolbar-updated {
  color: var(--ink-48);
  font-size: 12px;
  line-height: 1;
  letter-spacing: -0.12px;
  white-space: nowrap;
}

.toolbar .nav-add { display: none; }
.icon-circle.is-busy .icon { animation: spin 0.8s linear infinite; }

.chip-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 36px;
  padding: 0 4px;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.29;
  letter-spacing: -0.224px;
  white-space: nowrap;
}

.chip-link .icon { width: 12px; height: 12px; color: var(--blue); }
.chip-link:hover { color: var(--blue); }
.chip-link[hidden] { display: none; }

/* mobile bottom tab bar */

.tab-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  display: none;
  justify-content: space-around;
  padding: 4px 4px calc(4px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--hairline);
  background: var(--tabbar-bg);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  overflow-x: auto;
  scrollbar-width: none;
}

.tab {
  display: flex;
  flex: 1 0 64px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: 48px;
  border-radius: var(--r-compact);
  color: var(--ink-48);
}

.tab .icon { width: 22px; height: 22px; }

.tab-label {
  font-size: 10px;
  line-height: 1.2;
  letter-spacing: 0;
}

.tab[aria-current="page"] { color: var(--green-text); }
.tab[aria-current="page"] .tab-label { font-weight: 600; }
.tab:focus-visible { outline-offset: -2px; }

/* search pill (sidebar and Entries) */

.pill-search {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 14px;
  border: 1px solid var(--line-soft);
  border-radius: var(--r-pill);
  background: var(--canvas);
  color: var(--ink-48);
}

.pill-search .icon { width: 15px; height: 15px; }

.pill-search input {
  flex: 1;
  min-width: 0;
  height: 100%;
  color: var(--ink);
  font-size: 14px;
  letter-spacing: -0.224px;
  outline: none;
}

.pill-search input::placeholder { color: var(--ink-48); }
.pill-search input::-webkit-search-cancel-button { -webkit-appearance: none; }
.pill-search:focus-within { outline: 2px solid var(--blue-focus); outline-offset: 2px; }

.pill-search.is-large { height: 44px; padding: 0 18px; gap: 10px; }
.pill-search.is-large .icon { width: 17px; height: 17px; }
.pill-search.is-large input { font-size: 17px; letter-spacing: -0.374px; }

/* ---------- buttons ---------- */

.pill,
.btn-fill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 22px;
  border: 1px solid var(--blue);
  border-radius: var(--r-pill);
  background: var(--blue);
  color: var(--on-accent);
  font-size: 17px;
  line-height: 1.18;
  font-weight: 400;
  letter-spacing: -0.374px;
  white-space: nowrap;
  transition: transform 120ms var(--ease), background 160ms linear;
}

.pill:hover,
.btn-fill:hover { background: var(--green-hover); border-color: var(--green-hover); }

.pill-ghost { background: transparent; color: var(--blue); }
.pill-ghost:hover { background: var(--blue); color: var(--on-accent); }

.pill-sm { padding: 6px 14px; font-size: 14px; line-height: 1.29; letter-spacing: -0.224px; }

.pill-hero,
.btn-save {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 14px 28px;
  border-radius: var(--r-pill);
  background: var(--blue);
  color: var(--on-accent);
  font-size: 18px;
  line-height: 1.24;
  font-weight: 300;
  letter-spacing: 0;
  transition: transform 120ms var(--ease);
}

.text-link {
  display: inline-flex;
  align-items: center;
  color: var(--blue);
  font-size: 17px;
  line-height: 1.24;
  letter-spacing: -0.374px;
}

.text-link.is-nav::after { content: "\00a0\203a"; }
.text-link:hover { text-decoration: underline; }
.text-link.is-sm { font-size: 14px; letter-spacing: -0.224px; }

.capsule {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  border: 3px solid var(--divider);
  border-radius: var(--r-capsule);
  background: var(--pearl);
  color: var(--ink-80);
  font-size: 14px;
  line-height: 1.29;
  letter-spacing: -0.224px;
  transition: transform 120ms var(--ease);
}

.capsule.is-block { width: 100%; padding: 11px 14px; }

.icon-circle {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--chip);
  color: var(--ink);
}

.icon-circle .icon { width: 17px; height: 17px; }
.icon-circle.is-sm { width: 36px; height: 36px; }

.text-danger {
  color: var(--neg);
  font-size: 17px;
  line-height: 1.24;
  letter-spacing: -0.374px;
}

.pill:active,
.btn-fill:active,
.pill-hero:active,
.btn-save:active,
.capsule:active,
.chip:active,
.chip-filter:active,
.icon-circle:active,
.stepper-btn:active,
.text-danger:active { transform: scale(0.95); }

.pill:disabled,
.btn-fill:disabled,
.pill-hero:disabled,
.btn-save:disabled,
.stepper-btn:disabled { opacity: 0.4; cursor: default; transform: none; }

/* configurator chips (replace every segmented control) */

.chips-scroll {
  margin: 0 calc(-1 * var(--side));
  padding: 2px var(--side) 4px;
  overflow-x: auto;
  scrollbar-width: none;
}

.chips-scroll::-webkit-scrollbar { display: none; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips-scroll .chips { flex-wrap: nowrap; width: max-content; }

.chip,
.chip-filter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 16px;
  border: 1px solid var(--hairline);
  border-radius: var(--r-pill);
  background: var(--canvas);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.29;
  letter-spacing: -0.224px;
  white-space: nowrap;
  transition: transform 120ms var(--ease), border-color 160ms linear;
}

.chip:hover,
.chip-filter:hover { border-color: var(--hairline-strong); }

.chip[aria-checked="true"] {
  border: 2px solid var(--blue-focus);
  padding: 11px 15px;
}

.chip-filter .chip-value { color: var(--ink-48); }
.chip-filter .icon { width: 12px; height: 12px; color: var(--blue); }

/* toggle and stepper */

.toggle {
  position: relative;
  flex: 0 0 auto;
  width: 51px;
  height: 31px;
  border-radius: var(--r-pill);
  background: var(--toggle-off);
  transition: background 200ms var(--ease);
}

.toggle[aria-checked="true"] { background: var(--blue); }

.toggle-knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 27px;
  height: 27px;
  border-radius: 50%;
  background: var(--knob);
  transition: transform 200ms var(--ease);
}

.toggle[aria-checked="true"] .toggle-knob { transform: translateX(20px); }

.stepper { display: inline-flex; align-items: center; gap: 14px; }

.stepper-btn {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--chip);
  color: var(--ink);
  font-size: 20px;
  line-height: 1;
  transition: transform 120ms var(--ease);
}

.stepper-value {
  min-width: 24px;
  text-align: center;
  font-size: 17px;
  line-height: 1.24;
  font-weight: 600;
  letter-spacing: -0.374px;
}

/* ---------- menus (listbox popovers) ---------- */

.menu-anchor { position: relative; }

.menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 45;
  min-width: 220px;
  max-height: min(60vh, 520px);
  padding: 8px;
  overflow-y: auto;
  border: 1px solid var(--hairline);
  border-radius: var(--r-card);
  background: var(--canvas);
  animation: rise 200ms var(--ease);
}

.menu-left { right: auto; left: 0; }

.menu button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  min-height: 40px;
  padding: 8px 12px;
  border-radius: var(--r-compact);
  color: var(--ink);
  font-size: 17px;
  line-height: 1.24;
  text-align: left;
}

.menu button:hover { background: var(--parchment); }
.menu button[aria-selected="true"] { color: var(--blue); }
.menu button:focus-visible { outline-offset: -2px; }
.menu .icon { width: 14px; height: 14px; }
.menu-check { width: 14px; }

/* ---------- overlays: sheet, action sheet, popover ---------- */

.overlay { position: fixed; inset: 0; z-index: 50; }

.backdrop {
  position: absolute;
  inset: 0;
  background: var(--scrim);
  opacity: 0;
  transition: opacity 320ms var(--ease);
}

.backdrop.is-open,
.overlay.is-open .backdrop { opacity: 1; }

.sheet {
  position: fixed;
  z-index: 60;
  left: 50%;
  top: 50%;
  display: flex;
  flex-direction: column;
  width: min(560px, calc(100% - 48px));
  max-height: 86vh;
  border: 1px solid var(--hairline);
  border-radius: var(--r-card);
  background: var(--canvas);
  overflow: hidden;
  opacity: 0;
  transform: translate(-50%, calc(-50% + 24px));
  transition: transform 320ms var(--ease), opacity 320ms var(--ease);
}

.sheet-small { width: min(460px, calc(100% - 48px)); }
.sheet.is-open { opacity: 1; transform: translate(-50%, -50%); }

.grabber { display: none; }

.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 20px 8px 32px;
}

.sheet-title {
  font-size: 21px;
  line-height: 1.19;
  font-weight: 600;
  letter-spacing: 0.231px;
}

.sheet-body { flex: 1 1 auto; overflow-y: auto; padding: 16px 32px 32px; }

.sheet-foot {
  padding: 16px 32px 24px;
  border-top: 1px solid var(--divider);
  display: flex;
  justify-content: flex-end;
}

.sheet-foot[hidden] { display: none; }

/* action sheet (mobile) and popover (desktop) */

.action-sheet {
  position: fixed;
  z-index: 60;
  left: 50%;
  top: 50%;
  width: min(340px, calc(100% - 32px));
  padding: 24px;
  border: 1px solid var(--hairline);
  border-radius: var(--r-card);
  background: var(--canvas);
  opacity: 0;
  transform: translate(-50%, calc(-50% + 24px));
  transition: transform 320ms var(--ease), opacity 320ms var(--ease);
}

.overlay.is-open .action-sheet { opacity: 1; transform: translate(-50%, -50%); }

.overlay[data-popover] .backdrop { background: transparent; }

.action-sheet.is-popover {
  left: 12px;
  top: 12px;
  width: 300px;
  padding: 20px;
  transform: translateY(-6px);
}

.overlay.is-open .action-sheet.is-popover { transform: none; }

.action-sheet.is-popover::before {
  content: "";
  position: absolute;
  top: -7px;
  left: var(--arrow-x, 24px);
  width: 12px;
  height: 12px;
  margin-left: -6px;
  border-top: 1px solid var(--hairline);
  border-left: 1px solid var(--hairline);
  background: var(--canvas);
  transform: rotate(45deg);
}

.action-sheet.is-popover[data-placement="above"]::before {
  top: auto;
  bottom: -7px;
  transform: rotate(225deg);
}

.action-title {
  color: var(--ink);
  font-size: 17px;
  line-height: 1.24;
  font-weight: 600;
  letter-spacing: -0.374px;
}

.action-line {
  margin-top: 4px;
  color: var(--ink-48);
  font-size: 14px;
  line-height: 1.43;
  letter-spacing: -0.224px;
  overflow-wrap: anywhere;
}

.action-amount {
  margin-top: 12px;
  font-size: 28px;
  line-height: 1.14;
  font-weight: 600;
  letter-spacing: 0.196px;
}

.action-error {
  margin-top: 12px;
  color: var(--neg);
  font-size: 14px;
  line-height: 1.43;
}

.action-buttons {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 17px;
  margin-top: 20px;
}

.action-destroy:disabled { opacity: 0.5; cursor: default; transform: none; }

/* success, toast, spinner */

.saved {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 56px 16px;
}

.check-pop {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--blue);
  color: var(--on-accent);
}

.check-draw {
  stroke-dasharray: 28;
  stroke-dashoffset: 28;
  animation: draw-check 600ms var(--ease) forwards;
}

.saved-label {
  font-size: 21px;
  line-height: 1.19;
  font-weight: 600;
  letter-spacing: 0.231px;
}

.toast-root {
  position: fixed;
  margin-left: calc(var(--sidebar-w) / 2);
  top: calc(var(--toolbar-h) + 12px);
  left: 50%;
  z-index: 80;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  transform: translateX(-50%);
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--r-pill);
  background: var(--ink);
  color: var(--on-ink);
  font-size: 14px;
  line-height: 1.29;
  letter-spacing: -0.224px;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 280ms var(--ease), transform 280ms var(--ease);
}

.toast.is-in { opacity: 1; transform: none; }
.toast-check { color: var(--on-ink); }

.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid color-mix(in srgb, currentColor 35%, transparent);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.noscript { margin: 24px; color: var(--ink-48); }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes draw-check { to { stroke-dashoffset: 0; } }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }

/* ---------- responsive chrome ---------- */

@media (max-width: 899px) {
  .sidebar { display: none; }
  .content { margin-left: 0; padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); }
  .tab-bar { display: flex; }
  .toolbar .nav-add { display: grid; }
  .toolbar-inner { gap: 8px; padding: 0 calc(var(--side) - 4px); }
  .toolbar-title { text-align: center; font-size: 17px; line-height: 1.24; letter-spacing: -0.374px; }
  .toolbar-trail { gap: 4px; }
  .toolbar-updated { display: none; }
  .mobile-status { display: flex; padding: 8px var(--side) 32px; }
  .mobile-theme { display: block; max-width: 360px; padding: 16px var(--side) 0; }
  .mobile-theme .theme-option span { min-height: 44px; font-size: 14px; }
  .style-switch.mobile-theme { margin-top: 16px; }
  .toast-root { margin-left: 0; }
}

@media (max-width: 833px) {
  .sheet,
  .sheet-small {
    left: 0;
    right: 0;
    top: auto;
    bottom: 0;
    width: 100%;
    max-height: 92vh;
    border-width: 1px 0 0;
    border-radius: var(--r-card) var(--r-card) 0 0;
    transform: translateY(24px);
  }

  .sheet.is-open { transform: none; }

  .grabber {
    display: block;
    flex: 0 0 auto;
    width: 36px;
    height: 5px;
    margin: 8px auto 0;
    border-radius: var(--r-pill);
    background: var(--grabber);
  }

  .sheet-head { padding: 8px 12px 4px 24px; }
  .sheet-body { padding: 12px 24px 24px; }
  .sheet-foot { padding: 12px 24px calc(16px + env(safe-area-inset-bottom)); }
  .sheet-foot .pill { width: 100%; }

  .action-sheet {
    left: 0;
    right: 0;
    top: auto;
    bottom: 0;
    width: 100%;
    padding: 24px 24px calc(24px + env(safe-area-inset-bottom));
    border-width: 1px 0 0;
    border-radius: var(--r-card) var(--r-card) 0 0;
    transform: translateY(24px);
  }

  .overlay.is-open .action-sheet { transform: none; }
  .action-buttons { flex-direction: column-reverse; align-items: stretch; gap: 8px; }
  .action-buttons .text-danger { min-height: 48px; }
  .action-buttons .capsule { padding: 11px 14px; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .pill:active,
  .btn-fill:active,
  .pill-hero:active,
  .btn-save:active,
  .capsule:active,
  .chip:active,
  .chip-filter:active,
  .icon-circle:active,
    .stepper-btn:active,
  .text-danger:active,
  .card-render:active { transform: none; }
  .sheet,
  .sheet.is-open,
  .action-sheet,
  .overlay.is-open .action-sheet { transition: none; }
}
