

/* Shared chevron geometry must match site.css. */
.ui-chevron {
  display: inline-block;
  flex: none;
  width: .35rem;
  height: .35rem;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
}
.ui-chevron-left {
  transform: rotate(135deg);
}


.ui-drop {
  position: relative;
  display: grid;
  place-items: center;
  gap: .4rem;
  padding: 2rem 1rem;
  text-align: center;
  border: 1.5px dashed var(--muted);
  background: var(--ui-surface);
  transition: border-color .15s ease, background-color .15s ease;
}
.ui-upload .ui-drop-input {
  display: block;
  width: 100%;
  max-width: 100%;
}
/* The box already shows a focus ring; a visible input ring would duplicate it. */
.ui-upload .ui-drop-input:focus-visible {
  outline: none;
}
/* Hide the native file input only after JavaScript adds is-enhanced; no-JS upload stays visible. */
.ui-upload.is-enhanced .ui-drop-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}
.ui-drop-title {
  font-size: 1.05rem;
}
.ui-drop-hint {
  margin: 0;
  color: var(--muted);
  font-size: .85rem;
}
/* Keep :has() selectors separate so unsupported selectors cannot discard the fallback rule. */
.ui-drop:has(.ui-drop-input:focus-visible) {
  outline: 3px solid var(--ui-focus);
  outline-offset: 2px;
}
@supports not selector(:has(*)) {
  .ui-drop:focus-within {
    outline: 3px solid var(--ui-focus);
    outline-offset: 2px;
  }
}
/* Use :user-invalid only after interaction; retain the server error style without JavaScript. */
.ui-drop:has(.ui-drop-input:user-invalid) {
  border-style: solid;
  border-width: 2px;
  border-color: var(--ui-error);
}
.ui-drop.is-over {
  border-color: var(--ink);
  border-style: solid;
  background: var(--paper);
}
/* Show invalid state by shape as well as colour. */
.ui-upload.is-invalid .ui-drop {
  border-style: solid;
  border-width: 2px;
  border-color: var(--ui-error);
}

.ui-uploads {
  width: 100%;
  list-style: none;
  margin: .75rem 0 0;
  padding: 0;
  display: grid;
  gap: .5rem;
}
.ui-uploads:empty {
  margin: 0;
}
.ui-uploads li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: .35rem .8rem;
  padding: .7rem .8rem;
  border: 1px solid var(--line);
  font-size: .85rem;
}
.ui-upload-meta {
  white-space: nowrap;
}
.ui-upload-status:not(:empty)::before {
  content: " \00b7 ";
}
.ui-uploads li.is-failed {
  border-width: 2px;
  border-color: var(--ui-error);
  /* Wrap server error text so long messages fit narrow screens. */
  grid-template-columns: minmax(0, 1fr);
}
.ui-uploads li.is-failed .ui-upload-meta {
  white-space: normal;
}
.ui-upload-name {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  overflow-wrap: anywhere;
}
.ui-uploads progress {
  grid-column: 1 / -1;
  width: 100%;
  height: .4rem;
  appearance: none;
  border: 0;
  background: var(--line);
}
.ui-uploads progress::-webkit-progress-bar {
  background: var(--line);
}
.ui-uploads progress::-webkit-progress-value {
  background: var(--ink);
}
.ui-uploads progress::-moz-progress-bar {
  background: var(--ink);
}


.ui-error {
  display: flex;
  gap: .35rem;
  margin: .5rem 0 0;
  color: var(--ui-error);
  font-size: .8rem;
  font-weight: 700;
}
.ui-error::before {
  content: "!";
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 1rem;
  height: 1rem;
  background: var(--ui-error);
  color: var(--paper);
  font-size: .7rem;
}

/* Shared component selectors stay rooted under .ui-* to avoid leaking across themes. */


.ui-pill {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .16rem .55rem;
  font-size: .74rem;
  font-weight: 700;
  border: 1px solid var(--ink);
  white-space: nowrap;
}
.ui-pill::before {
  content: "";
  width: .5rem;
  height: .5rem;
  border: 1.5px solid currentColor;
  border-radius: 50%;
}
.ui-pill-new {
  background: var(--ink);
  color: var(--paper);
}
.ui-pill-new::before {
  background: var(--paper);
  border-color: var(--paper);
}
.ui-pill-review {
  border-style: dashed;
}
.ui-pill-review::before {
  border-style: dotted;
}
.ui-pill-sent::before {
  background: linear-gradient(90deg, currentColor 50%, transparent 50%);
}
.ui-pill-prod::before {
  background: currentColor;
}
.ui-pill-done {
  border-color: var(--ui-line-strong);
  color: var(--muted);
}
.ui-pill-done::before {
  border-radius: 0;
  width: .55rem;
  height: .3rem;
  border-width: 0 0 2px 2px;
  transform: rotate(-45deg) translateY(-.08rem);
}

/* The generated separator has empty alt text so screen readers skip it. */
.ui-crumbs {
  font-size: .8rem;
  color: var(--muted);
  margin-bottom: .6rem;
}
.ui-crumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.ui-crumbs li:not(:first-child)::before {
  content: "/";
  content: "/" / "";
  margin-right: .4rem;
}
.ui-crumbs a {
  text-decoration: none;
  font-weight: 700;
  color: var(--ink);
}


.ui-tabs {
  display: flex;
  gap: 1.4rem;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
}
.ui-tabs a {
  font: 700 .88rem Arial, Helvetica, sans-serif;
  border-bottom: 2px solid transparent;
  padding: .6rem 0;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
}
.ui-tabs a[aria-current="page"] {
  color: var(--ink);
  border-bottom-color: var(--ink);
}


.ui-pager {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-top: 1.2rem;
  font-size: .85rem;
  font-weight: 700;
  flex-wrap: wrap;
}
.ui-pager .ui-pager-status {
  color: var(--muted);
}
.ui-pager .ui-pager-link {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: .4rem .65rem;
  font: 700 .78rem Arial, Helvetica, sans-serif;
  border: 1px solid var(--ink);
  background: var(--paper);
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
  transition: color .25s ease;
}
.ui-pager .ui-pager-link::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--ui-surface);
  transform: translateY(101%);
  transition: transform .3s ease;
}
.ui-pager .ui-pager-link:hover {
  color: var(--ink);
}
.ui-pager .ui-pager-link:hover::before {
  transform: translateY(0);
}
.ui-pager .ui-pager-link:focus-visible {
  outline: 3px solid var(--ui-focus);
  outline-offset: 2px;
}


.ui-table-scroll {
  overflow-x: auto;
  border-top: 1px solid var(--ink);
}
.ui-table-scroll:focus-visible {
  outline: 3px solid var(--ui-focus);
  outline-offset: 2px;
}
.ui-table {
  width: 100%;
  min-width: 36rem;
  border-collapse: collapse;
  font-size: .88rem;
  font-variant-numeric: tabular-nums;
}
.ui-table.ui-table-kv {
  min-width: 0;
  max-width: 36rem;
}
/* Keep amounts near labels rather than at the far edge of wide tables. */
.ui-table.ui-table-kv td:last-child {
  text-align: right;
}
.ui-table th,
.ui-table td {
  text-align: left;
  padding: .7rem .75rem;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.ui-table thead th {
  background: var(--paper);
  font-size: .74rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}
.ui-table .ui-nowrap {
  white-space: nowrap;
}
.ui-table .ui-wide {
  min-width: 18rem;
}
.ui-table th.ui-right,
.ui-table td.ui-right {
  text-align: right;
}
.ui-table th a {
  text-decoration: none;
  color: inherit;
  display: inline-flex;
  gap: .3rem;
}
.ui-table th[aria-sort="ascending"] a,
.ui-table th[aria-sort="descending"] a {
  color: var(--ink);
}
.ui-table tbody tr:hover {
  background: var(--ui-surface);
}
.ui-table caption {
  caption-side: bottom;
  text-align: left;
  padding-top: .6rem;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .11em;
  text-transform: uppercase;
  color: var(--muted);
}


.ui-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  margin: 0;
}
.ui-facts div {
  background: var(--paper);
  padding: .8rem .9rem;
  display: grid;
  gap: .2rem;
}
.ui-facts dt {
  font-size: .72rem;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: .06em;
  text-transform: uppercase;
}
.ui-facts dd {
  margin: 0;
  font-weight: 700;
}


.ui-dialog {
  border: 1px solid var(--ink);
  padding: 0;
  max-width: min(30rem, calc(100vw - 32px));
  background: var(--paper);
  color: var(--ink);
}
.ui-dialog::backdrop {
  background: rgba(27, 27, 27, .45);
}
.ui-dialog form {
  display: grid;
  gap: 1rem;
  padding: 1.4rem;
}
.ui-dialog h2 {
  margin: 0;
  font-size: 1.4rem;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -.04em;
  text-wrap: balance;
}
.ui-dialog p {
  margin: 0;
}


.ui-toast {
  background: var(--ink);
  color: var(--paper);
  padding: .8rem 1rem;
  font-weight: 700;
  font-size: .88rem;
  display: flex;
  gap: 1rem;
  align-items: center;
  animation: ui-toast-in .25s ease-out both;
}
.ui-toast button {
  font: inherit;
  color: var(--paper);
  background: none;
  border: 0;
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
}
.ui-toast button:focus-visible {
  outline: 3px solid var(--paper);
  outline-offset: 2px;
}
@keyframes ui-toast-in {
  from {
    transform: translateY(.6rem);
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ui-toast {
    animation: none;
  }
  .ui-pager .ui-pager-link,
  .ui-pager .ui-pager-link::before {
    transition: none;
  }
}

@media (forced-colors: active) {
  .ui-pill,
  .ui-tabs a[aria-current="page"] {
    border-color: CanvasText;
  }
}


.ui-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.ui-form > button {
  align-self: flex-start;
}
.ui-field {
  display: grid;
  gap: .3rem;
  min-width: 0;
}
.ui-field label,
.ui-fieldset legend {
  font-size: .82rem;
  font-weight: 700;
}
.ui-fieldset legend {
  padding: 0;
  margin-bottom: .3rem;
}
/* Empty generated-content alt hides the asterisk; native required announces the constraint. */
.ui-required::after {
  content: " *" / "";
  color: var(--ui-error);
}
.ui-field input,
.ui-field select,
.ui-field textarea {
  display: block;
  width: 100%;
  min-width: 0;
  padding: .55rem .6rem;
  border: 1px solid var(--muted);
  border-radius: var(--ui-radius);
  background: var(--ui-surface);
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
  line-height: 1.2;
}
.ui-field textarea {
  min-height: 7rem;
  resize: vertical;
}
.ui-field input:focus-visible,
.ui-field select:focus-visible,
.ui-field textarea:focus-visible {
  outline: 3px solid var(--ui-focus);
  outline-offset: 2px;
}
.ui-field [aria-invalid="true"] {
  border-color: var(--ui-error);
  box-shadow: inset 0 0 0 1px var(--ui-error);
}
.ui-field input:user-invalid {
  border-color: var(--ui-error);
  box-shadow: inset 0 0 0 1px var(--ui-error);
}
.ui-field select:user-invalid {
  border-color: var(--ui-error);
  box-shadow: inset 0 0 0 1px var(--ui-error);
}
.ui-field textarea:user-invalid {
  border-color: var(--ui-error);
  box-shadow: inset 0 0 0 1px var(--ui-error);
}
.ui-hint {
  margin: 0;
  color: var(--muted);
  font-size: .8rem;
  line-height: 1.4;
}
.ui-field-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
}


.ui-select {
  position: relative;
}
.ui-field .ui-select select {
  appearance: none;
  -webkit-appearance: none;
  background-image: none;
  padding-right: 2.25rem;
}
.ui-select .ui-chevron {
  position: absolute;
  top: 50%;
  right: .9rem;
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}

.ui-choice {
  min-width: 0;
}
.ui-check {
  display: flex;
  align-items: flex-start;
  gap: .6rem;
  padding-block: .6rem;
  line-height: 1.4;
  cursor: pointer;
}
.ui-check input {
  flex: none;
  width: 1.1rem;
  height: 1.1rem;
  margin: .15rem 0 0;
  accent-color: var(--ink);
}
.ui-check input:focus-visible {
  outline: 3px solid var(--ui-focus);
  outline-offset: 2px;
}
.ui-check input:user-invalid {
  outline: 2px solid var(--ui-error);
  outline-offset: 2px;
}
.ui-fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

/* Show notice states by shape and weight as well as colour. */
.ui-notice {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .25rem .6rem;
  margin: 0 0 1rem;
  padding: .6rem .9rem;
  border: 1px solid var(--ink);
  font-size: .92rem;
  line-height: 1.5;
}
.ui-form > .ui-notice {
  margin: 0;
}
.ui-notice-title {
  font-weight: 700;
}
.ui-notice-info {
  border-left-width: 4px;
}
.ui-notice-success::before {
  content: "\2713";
  align-self: center;
  font-weight: 700;
}
.ui-notice-error {
  border: 2px solid var(--ui-error);
  color: var(--ui-error);
  font-weight: 700;
}
.ui-notice-error::before {
  content: "!";
  display: inline-grid;
  place-items: center;
  align-self: center;
  flex: none;
  width: 1rem;
  height: 1rem;
  background: var(--ui-error);
  color: var(--paper);
  font-size: .7rem;
}

.ui-summary {
  display: grid;
  grid-template-columns: minmax(8rem, 12rem) minmax(0, 1fr);
  gap: .6rem 1.5rem;
  max-width: 48rem;
}
.ui-summary dt {
  font-weight: 800;
  color: var(--muted);
}
.ui-summary dd {
  margin: 0;
}

@media (max-width: 600px) {
  .ui-field-row {
    grid-template-columns: 1fr;
  }
  .ui-summary {
    grid-template-columns: 1fr;
    gap: .15rem;
  }
  .ui-summary dd {
    margin-bottom: .6rem;
  }
}


/* Visually hidden text remains available to screen readers. */
.ui-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
/* Step state uses shape and weight as well as colour. */
.ui-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem 2.5rem;
  margin: 0 0 2.5rem;
  padding: 0;
  list-style: none;
  counter-reset: step;
}
.ui-steps li {
  display: flex;
  align-items: center;
  gap: .6rem;
  color: var(--muted);
  font-size: .86rem;
  font-weight: 700;
}
.ui-steps li::before {
  counter-increment: step;
  content: counter(step);
  display: grid;
  place-items: center;
  flex: none;
  width: 1.8rem;
  height: 1.8rem;
  border: 1px solid var(--line);
  border-radius: 50%;
  font-size: .8rem;
}
.ui-steps li[aria-current="step"] {
  color: var(--ink);
}
.ui-steps li[aria-current="step"]::before {
  border-color: var(--ink);
  border-width: 2px;
}
.ui-steps li[data-done]::before {
  content: "\2713";
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}


.ui-price-total {
  margin: .3rem 0 0;
  font-size: var(--ui-price-size);
  font-weight: 700;
  letter-spacing: -.03em;
  line-height: 1;
}
.ui-price-note {
  margin: .3rem 0 0;
  color: var(--muted);
  font-size: .9rem;
}
.ui-price-discount {
  margin: .3rem 0 0;
  font-size: .9rem;
}
.ui-price-material {
  margin: .8rem 0 0;
  color: var(--muted);
  font-size: .9rem;
}

/* Keep spinner motion disabled for reduced-motion users. */
.ui-spinner {
  display: inline-block;
  width: 1.4rem;
  height: 1.4rem;
  border: 2px solid var(--line);
  border-top-color: var(--ink);
  border-radius: 50%;
  animation: ui-spin 1s linear infinite;
}
@keyframes ui-spin {
  to {
    transform: rotate(360deg);
  }
}
@media (prefers-reduced-motion: reduce) {
  .ui-spinner {
    animation: none;
  }
}

/* Swatches include visible names; selection is never conveyed by colour alone. */
.ui-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: .9rem;
}
.ui-swatch {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  padding: .5rem .9rem .5rem .5rem;
  border: 1px solid var(--line);
  cursor: pointer;
}
.ui-swatch:has(input:checked) {
  border-color: var(--ink);
}
.ui-swatch input {
  flex: none;
  width: 1.1rem;
  height: 1.1rem;
  margin: 0;
  accent-color: var(--ink);
}
.ui-swatch input:focus-visible {
  outline: 3px solid var(--ui-focus);
  outline-offset: 2px;
}
.ui-swatch-chip {
  display: inline-block;
  flex: none;
  width: 18px;
  height: 18px;
  border: 1px solid var(--ink);
  border-radius: 3px;
}
.ui-swatch-name {
  line-height: 1;
}
@media (max-width: 600px) {
  .ui-swatches {
    gap: .6rem;
  }
}


.ui-catalog-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
  margin: 0 0 1.5rem;
}
.ui-catalog-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 0 0 1rem;
}
.ui-catalog-label {
  margin: 0 0 .5rem;
  font-size: .78rem;
  font-weight: 700;
  color: var(--muted);
}
@media (max-width: 700px) {
  .ui-catalog-pair {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ui-drop,
  .ui-drop-input {
    transition: none;
  }
}

@media (forced-colors: active) {
  .ui-chevron {
    border-color: CanvasText;
  }
}

/* Link and button variants share one style while retaining their native semantics. */

.ui-btn {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.72rem 1rem;
  font: 700 0.86rem Arial, Helvetica, sans-serif;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  cursor: pointer;
  text-decoration: none;
  transition: color 0.25s ease;
  white-space: nowrap;
}

.ui-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--paper);
  transform: translateY(101%);
  transition: transform 0.3s ease;
}

.ui-btn:hover {
  color: var(--ink);
}

.ui-btn:hover::before {
  transform: translateY(0);
}

.ui-btn.secondary {
  background: var(--paper);
  color: var(--ink);
}

.ui-btn.secondary::before {
  background: var(--ui-surface);
}

.ui-btn.quiet {
  border-color: transparent;
  background: transparent;
  color: var(--ink);
  padding-inline: 0;
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.ui-btn.quiet::before {
  display: none;
}

.ui-btn.danger {
  background: var(--paper);
  color: var(--ink);
  border-style: dashed;
}

.ui-btn.danger::before {
  background: var(--ink);
}

.ui-btn.danger:hover {
  color: var(--paper);
}

.ui-btn.small {
  padding: 0.4rem 0.65rem;
  font-size: 0.78rem;
}

.ui-btn[aria-disabled="true"] {
  pointer-events: none;
  opacity: 0.5;
}


.ui-eyebrow {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--muted);
}

/* The native details menu works without JavaScript. */
.ui-shell {
  display: grid;
  grid-template-columns: 15.5rem minmax(0, 1fr);
  min-height: 100vh;
}
.ui-shell-sidebar {
  border-right: 1px solid var(--line);
  padding: 1.4rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 1.6rem;
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  height: 100vh;
  overflow-y: auto;
}
.ui-shell-brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.06em;
  text-decoration: none;
}
.ui-shell-brand small {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-left: 0.2rem;
}
.ui-shell-mark {
  width: 1.6rem;
  height: 1.6rem;
  flex: none;
  background: var(--ink);
  color: var(--paper);
  display: grid;
  place-items: center;
  font-size: 0.72rem;
  letter-spacing: 0;
}
.ui-shell-nav {
  display: grid;
  gap: 0.1rem;
  font-size: 0.9rem;
}
.ui-shell-nav a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.6rem;
  text-decoration: none;
  font-weight: 700;
  border-left: 2px solid transparent;
}
.ui-shell-nav a:hover {
  background: var(--ui-surface);
}
.ui-shell-nav a[aria-current="page"] {
  border-left-color: var(--ink);
  background: var(--ui-surface);
}
.ui-shell-nav-secondary {
  font-size: 0.8rem;
  padding-top: 0.6rem;
  border-top: 1px solid var(--line);
}
.ui-shell-badge {
  min-width: 1.35rem;
  padding: 0 0.4rem;
  border: 1px solid var(--ink);
  font-size: 0.72rem;
  line-height: 1.25rem;
  text-align: center;
}
.ui-shell-foot {
  margin-top: auto;
  display: grid;
  gap: 0.8rem;
}
.ui-shell-topbar {
  display: none;
}
.ui-shell-content {
  min-width: 0;
}
.ui-shell-main {
  padding: clamp(1.25rem, 3vw, 2.5rem) clamp(16px, 3.5vw, 3rem) 4rem;
  display: grid;
  gap: 2rem;
  align-content: start;
  min-width: 0;
}
.ui-shell-main h1 {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  line-height: 0.98;
}
@media (max-width: 760px) {
  .ui-shell {
    grid-template-columns: 1fr;
  }
  .ui-shell-sidebar {
    display: none;
  }
  .ui-shell-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.7rem 16px;
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: env(safe-area-inset-top, 0px);
    background: var(--paper);
    z-index: 5;
  }
  .ui-shell-menu {
    position: relative;
  }
  .ui-shell-menu summary {
    list-style: none;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.88rem;
    border: 1px solid var(--ink);
    padding: 0.4rem 0.7rem;
  }
  .ui-shell-menu summary::-webkit-details-marker {
    display: none;
  }
  .ui-shell-menu[open] {
    position: fixed;
    inset: 0;
    z-index: 30;
    background: var(--paper);
    padding: 0.7rem 16px;
    overflow-y: auto;
  }
  .ui-shell-menu > :not(summary) {
    margin-top: 0.6rem;
  }
  .ui-shell-main {
    padding-inline: 16px;
  }
}

/* Preserve authored line breaks and wrap long message text on phones. */
.ui-thread-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.9rem;
}
.ui-thread-msg {
  border-left: 1px solid var(--ui-line-strong);
  padding: 0.2rem 0 0.2rem 0.9rem;
}
.ui-thread-own {
  border-left: 3px solid var(--ink);
}
.ui-thread-meta {
  margin: 0 0 0.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 0.8rem;
  font-size: 0.82rem;
}
.ui-thread-meta time {
  color: var(--muted);
}
.ui-thread-body {
  margin: 0;
  white-space: pre-line;
  overflow-wrap: anywhere;
}
.ui-thread-empty {
  margin: 0;
  color: var(--muted);
}
