.page-tab-color {
  appearance: none;
  display: block;
  padding: 0;
  border: 2px solid color-mix(in srgb, var(--tab-text) 28%, transparent);
  box-shadow: inset 0 0 0 2px #ffffffa8;
}

.page-tab-palette {
  position: fixed;
  z-index: 120;
  width: min(290px, calc(100vw - 20px));
  max-height: calc(100dvh - 20px);
  overflow-y: auto;
  display: none;
  grid-template-columns: repeat(6, minmax(28px, 1fr));
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface, #fffefa);
  box-shadow: 0 12px 32px #17212435;
}

.page-tab-palette.open {
  display: grid;
}

.page-tab-color-option {
  position: relative;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  padding: 0;
  border: 1px solid #26323522;
  border-radius: 7px;
  box-shadow: inset 0 0 0 1px #ffffff80;
}

.page-tab-color-option:hover,
.page-tab-color-option:focus-visible {
  transform: scale(1.12);
  outline: 2px solid var(--teal);
  outline-offset: 1px;
}

.page-tab-color-option.selected::after {
  content: "✓";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #315b63;
  font-size: 12px;
  font-weight: 900;
}
.paper{background-color:var(--page-color,var(--paper))!important}.page-navigation #page-color-button{display:grid;place-items:center;padding:0}.page-color-swatch{display:block;width:16px;height:16px;border:1px solid color-mix(in srgb,var(--ink) 28%,transparent);border-radius:4px;background:var(--paper);box-shadow:inset 0 0 0 2px color-mix(in srgb,currentColor 5%,transparent)}.page-color-palette .page-tab-color-option:first-child{position:relative}.page-color-palette .page-tab-color-option:first-child::before{content:'×';position:absolute;inset:0;display:grid;place-items:center;color:var(--muted);font-size:15px;font-weight:700}

@media (max-width: 700px) {
  .page-navigation {
    gap: 4px;
  }

  .page-tabs {
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
  }

  .page-tabs::-webkit-scrollbar {
    display: none;
  }

  .page-tab {
    min-width: 74px;
    height: 28px;
    scroll-snap-align: start;
  }

  .page-tab-select {
    max-width: 116px;
    padding-left: 8px;
    padding-right: 21px;
    font-size: 10px;
  }

  .page-navigation .page-tab .page-tab-color {
    right: 6px;
    width: 10px;
    min-width: 10px;
    height: 10px;
    border-width: 1px;
    box-shadow: inset 0 0 0 1px #ffffffa8;
    opacity: 1;
  }

  .page-navigation > #add-page,
  .page-navigation > #copy-previous-page {
    flex: 0 0 30px;
    width: 30px;
    min-width: 30px;
    height: 30px;
    margin-left: 0;
    padding: 0;
  }

  .page-navigation > #add-page {
    overflow: hidden;
    font-size: 0;
  }

  .page-navigation > #add-page::after {
    content: "+";
    font-size: 20px;
  }

  .page-tab-name {
    width: 104px;
    height: 26px;
    font-size: 10px;
  }
}

@media (max-width: 380px) {
  .page-tab {
    min-width: 68px;
    height: 26px;
  }

  .page-tab-select {
    max-width: 96px;
    padding-left: 7px;
    padding-right: 18px;
    font-size: 10px;
  }

  .page-navigation .page-tab .page-tab-color {
    right: 5px;
    width: 9px;
    min-width: 9px;
    height: 9px;
  }

  .page-navigation > #add-page,
  .page-navigation > #copy-previous-page {
    flex-basis: 28px;
    width: 28px;
    min-width: 28px;
    height: 28px;
  }
}
