.glass {
  background: var(--glass);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--glass-line);
  box-shadow: inset 0 1px 0 var(--glass-hi), inset 0 -.5px 0 rgba(255, 255, 255, .05), var(--shadow);
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass {
    background: var(--glass-solid);
  }
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
}

.pad {
  padding: 16px;
}

.btn {
  height: 52px;
  border-radius: 999px;
  padding: 0 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 600;
  font-size: 16px;
  white-space: nowrap;
  transition: transform .18s var(--ease), opacity .18s var(--ease);
}

.btn:active {
  transform: scale(.96);
}

.btn[disabled],
.btn.is-busy {
  opacity: .5;
  pointer-events: none;
}

.btn-primary {
  color: var(--on-accent);
  background: var(--accent);
  box-shadow: 0 8px 22px rgba(0, 0, 0, .22);
}

.btn-secondary {
  color: var(--text);
  background: var(--btn-2);
}

.btn-ghost {
  color: var(--text-2);
  background: transparent;
}

.btn-danger {
  color: var(--danger);
  background: color-mix(in srgb, var(--danger) 12%, transparent);
}

.btn-block {
  width: 100%;
}

.btn-sm {
  height: 40px;
  padding: 0 16px;
  font-size: 15px;
}

.btn-row {
  display: flex;
  gap: 10px;
}

.btn-row > .btn {
  flex: 1;
  min-width: 0;
  padding: 0 14px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.icon-btn {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: var(--fill);
  color: var(--text-2);
  flex: none;
  transition: transform .18s var(--ease);
}

.icon-btn:active {
  transform: scale(.94);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  background: var(--fill);
  color: var(--text-2);
}

.chip::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: .9;
}

.chip.plain::before {
  display: none;
}

.chip.ok {
  color: var(--success);
  background: color-mix(in srgb, var(--success) 13%, transparent);
}

.chip.pre {
  color: var(--warn);
  background: color-mix(in srgb, var(--warn) 13%, transparent);
}

.chip.out {
  color: var(--hint);
}

.chip.bad {
  color: var(--danger);
  background: color-mix(in srgb, var(--danger) 12%, transparent);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.sec-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.sec-head .h2 {
  flex: 1;
}

.sec-link {
  color: var(--hint);
  font-size: 14px;
  font-weight: 600;
}

.list {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 22px;
  overflow: hidden;
}

.row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 58px;
  padding: 10px 14px;
  position: relative;
  transition: background .18s var(--ease);
}

button.row:active {
  background: var(--fill);
}

.row + .row::before {
  content: "";
  position: absolute;
  top: 0;
  left: 56px;
  right: 0;
  height: 1px;
  background: var(--line);
}

.row-main {
  flex: 1;
  min-width: 0;
}

.row-title {
  display: block;
  font-weight: 600;
  font-size: 15.5px;
}

.row-sub {
  display: block;
  color: var(--hint);
  font-size: 13px;
}

.row-end {
  color: var(--hint);
  font-size: 15px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.chev {
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--hint);
  border-bottom: 2px solid var(--hint);
  transform: rotate(-45deg);
  opacity: .7;
  flex: none;
  margin-right: 4px;
}

.field {
  width: 100%;
  height: 52px;
  border-radius: var(--r-field);
  padding: 0 16px;
  background: var(--fill);
  border: 1px solid transparent;
  outline: none;
  font-size: 16px;
  transition: border-color .18s var(--ease), background .18s var(--ease);
}

.field:focus {
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  background: var(--fill-2);
}

.field-row {
  display: flex;
  gap: 8px;
}

.field-row .field {
  flex: 1;
}

.opts {
  display: grid;
  gap: 8px;
}

.opt {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 64px;
  padding: 10px 14px;
  border-radius: 20px;
  background: var(--card);
  border: 1px solid var(--line);
  transition: transform .18s var(--ease), background .18s var(--ease), box-shadow .18s var(--ease);
}

.opt:active {
  transform: scale(.985);
}

.opt.is-on {
  background: color-mix(in srgb, var(--accent) 14%, var(--card));
  box-shadow: inset 0 0 0 2px var(--accent);
}

.opt-radio {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--fill-2);
  flex: none;
  display: grid;
  place-items: center;
}

.opt.is-on .opt-radio {
  border-color: var(--accent);
}

.opt.is-on .opt-radio::after {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
}

.skel {
  position: relative;
  overflow: hidden;
  background: var(--fill);
  border-radius: 16px;
}

.skel::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .07), transparent);
  animation: shimmer 1.4s infinite;
}

@keyframes shimmer {
  to {
    transform: translateX(100%);
  }
}

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  padding: 40px 12px 20px;
}

.empty .h3 {
  margin-top: 6px;
}

.empty .hint {
  max-width: 290px;
}

.empty .btn {
  margin-top: 10px;
}

.rich {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: var(--text-2);
  font-size: 15.5px;
  line-height: 1.5;
}

.rich b {
  color: var(--text);
  font-weight: 650;
}

.rich code {
  font-family: var(--font-mono);
  font-size: .9em;
  padding: 1px 6px;
  border-radius: 7px;
  background: var(--fill-2);
}

.rich pre {
  font-family: var(--font-mono);
  font-size: 13.5px;
  margin: 6px 0;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--fill);
  white-space: pre-wrap;
}

.rich blockquote {
  margin: 6px 0;
  padding: 4px 0 4px 12px;
  border-left: 3px solid var(--accent);
}

.spoiler {
  border-radius: 6px;
  background: var(--fill-2);
  color: transparent;
  cursor: pointer;
  transition: color .3s var(--ease), background .3s var(--ease);
}

.spoiler .emo {
  opacity: 0;
}

.spoiler.is-open {
  background: transparent;
  color: inherit;
}

.spoiler.is-open .emo {
  opacity: 1;
}

.sheets {
  position: relative;
  z-index: 60;
}

.sheet-wrap {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.sheet-scrim {
  position: absolute;
  inset: 0;
  background: var(--scrim);
  opacity: 0;
  transition: opacity .32s var(--ease);
}

.sheet {
  position: relative;
  width: 100%;
  max-width: 480px;
  max-height: calc(100% - var(--top) - 40px);
  display: flex;
  flex-direction: column;
  border-radius: var(--r-sheet) var(--r-sheet) 0 0;
  border-bottom: 0;
  transform: translateY(105%);
  transition: transform .42s var(--ease-out);
  will-change: transform;
}

.sheet-wrap.is-open .sheet-scrim {
  opacity: 1;
}

.sheet-wrap.is-open .sheet {
  transform: none;
}

.sheet.is-dragging {
  transition: none;
}

.sheet-grab {
  flex: none;
  padding: 10px 0 4px;
  touch-action: none;
}

.sheet-grab::before {
  content: "";
  display: block;
  width: 38px;
  height: 5px;
  margin: 0 auto;
  border-radius: 3px;
  background: var(--fill-2);
}

.sheet-body {
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 8px var(--gutter) calc(var(--bottom) + 20px);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
}

.sheet-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sheet-title .h3 {
  flex: 1;
}

.note {
  padding: 12px 14px;
  border-radius: 16px;
  font-size: 14.5px;
  background: var(--fill);
  color: var(--text-2);
}

.note.bad {
  color: var(--danger);
  background: color-mix(in srgb, var(--danger) 10%, transparent);
}

.note.ok {
  color: var(--success);
  background: color-mix(in srgb, var(--success) 12%, transparent);
}

.toast {
  position: fixed;
  z-index: 80;
  left: 50%;
  bottom: calc(var(--bottom) + var(--dock-h) + 22px);
  max-width: min(calc(100% - 32px), 420px);
  padding: 12px 18px;
  border-radius: 999px;
  font-size: 14.5px;
  font-weight: 600;
  transform: translate(-50%, 16px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s var(--ease), transform .35s var(--spring);
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.toast.is-on {
  opacity: 1;
  transform: translate(-50%, 0);
}

body.no-dock .toast {
  bottom: calc(var(--bottom) + 104px);
}

.gate {
  min-height: 70vh;
  display: grid;
  place-items: center;
}

.spinner {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2.5px solid currentColor;
  border-right-color: transparent;
  animation: spin .8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
