.sheet-layer {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  align-items: end;
  justify-items: center;
}

.sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 5, 8, 0.6);
  opacity: 0;
  transition: opacity 260ms var(--ease-in);
}

.sheet-layer.is-visible .sheet-backdrop {
  opacity: 1;
}

.sheet-layer.is-closing .sheet-backdrop {
  opacity: 0;
  transition: opacity 240ms var(--ease-out);
}

.sheet {
  position: relative;
  width: min(560px, 100vw);
  max-height: calc(100dvh - var(--statusbar-h) - 24px);
  overflow-y: auto;
  padding: 8px 24px calc(24px + env(safe-area-inset-bottom));
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 16px 16px 0 0;
  background: #121821;
  transform: translateY(100%);
  transition: transform 300ms var(--ease-in);
  overscroll-behavior: contain;
}

.sheet.is-open {
  transform: translateY(0);
}

.sheet-layer.is-closing .sheet {
  transform: translateY(100%);
  transition: transform 240ms var(--ease-out);
}

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

.sheet__handle {
  width: 100%;
  height: 24px;
  touch-action: none;
}

.sheet__handle::before {
  content: '';
  display: block;
  width: 40px;
  height: 4px;
  margin: 6px auto 0;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.18);
}

.sheet__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.sheet__title {
  margin: 0;
  font-size: var(--fs-title);
  font-weight: 600;
}

.editor {
  display: grid;
  gap: 16px;
}

.field {
  display: grid;
  gap: 6px;
}

.field__label {
  font-size: 13px;
  color: var(--muted);
}

.field__error,
.editor__general {
  min-height: 0;
  margin: 0;
  font-size: 12.5px;
  color: var(--amber);
}

.field__error:empty,
.editor__general:empty {
  display: none;
}

.input {
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 16px;
  color-scheme: dark;
}

.input:focus {
  outline: none;
  border-color: var(--accent);
}

.segmented {
  display: flex;
  gap: 2px;
  padding: 3px;
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.segmented__btn {
  flex: 1;
  min-height: 44px;
  border: 0;
  border-radius: 6px;
  background: none;
  font-size: 14px;
  color: var(--muted);
}

.segmented__btn[aria-checked='true'] {
  background: var(--bg);
  color: var(--text);
}

.swatches {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 6px;
}

.swatch {
  aspect-ratio: 1;
  min-height: 44px;
  border: 2px solid transparent;
  border-radius: 50%;
  background: var(--c) content-box;
  padding: 4px;
  transition: transform var(--dur) var(--ease-in);
}

.swatch[aria-pressed='true'] {
  border-color: var(--text);
}

.swatch:active {
  transform: scale(0.92);
}

.editor__dates {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.editor__actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 4px;
}

.btn-ghost {
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: none;
  color: var(--muted);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom));
  z-index: 120;
  padding: 12px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #1a222d;
  font-size: 14px;
  transform: translateX(-50%);
  animation: toast-in 240ms var(--ease-in) both;
}

.toast.is-leaving {
  opacity: 0;
  transform: translate(-50%, 8px);
  transition: opacity 200ms var(--ease-out), transform 200ms var(--ease-out);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translate(-50%, 8px);
  }
}

.is-lifted {
  opacity: 0.35;
}

.drag-ghost {
  position: fixed;
  z-index: 110;
  margin: 0;
  pointer-events: none;
  background: #1a222d;
  border-style: solid;
  border-color: rgba(108, 195, 240, 0.4);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.45);
  transform-origin: center;
  transform: scale(1.03);
  will-change: transform;
}

.drag-ghost.is-returning {
  transition: transform 200ms var(--ease-out), opacity 200ms var(--ease-out);
  opacity: 0;
}

.is-drop-target {
  background: rgba(108, 195, 240, 0.1);
  box-shadow: inset 0 0 0 1px rgba(108, 195, 240, 0.45);
}

@media (max-width: 560px) {
  .swatches {
    grid-template-columns: repeat(5, 1fr);
  }
}
