.css-gradient-gallery-page {
  background: #fff;
}

.gradient-gallery,
.gradient-gallery * {
  box-sizing: border-box;
}

.gradient-gallery [hidden] {
  display: none !important;
}

.gradient-gallery {
  --gradient-gallery-ink: #172033;
  --gradient-gallery-muted: #667085;
  --gradient-gallery-line: #e6eaf0;
  --gradient-gallery-soft: #f8fafc;
  --gradient-gallery-blue-soft: #effaff;
  --gradient-gallery-pink-soft: #fff0fa;
  color: var(--gradient-gallery-ink);
  padding: 12px 0 40px;
}

.gradient-gallery__app {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 440px);
  gap: 18px;
  align-items: start;
  margin-top: 12px;
}

.gradient-gallery__main,
.gradient-gallery__side {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.gradient-gallery__tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin-bottom: 10px;
  padding: 2px 0 14px;
  scrollbar-gutter: stable;
}

.gradient-gallery__tab {
  flex: 0 0 auto;
  min-height: 38px;
  padding: 8px 13px;
  border: 1px solid #d9e1ea;
  border-radius: 999px;
  background: #fff;
  color: #344054;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.gradient-gallery__tab.is-active {
  border-color: var(--accent-color);
  background: var(--gradient-gallery-blue-soft);
  color: #0277bd;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent-color) 18%, transparent);
}

.gradient-gallery__count {
  margin-bottom: 8px;
  color: var(--gradient-gallery-muted);
  font-size: 13px;
  font-weight: 800;
}

.gradient-gallery__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.gradient-gallery__card {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 10px;
  border: 1px solid #edf1f5;
  border-radius: 8px;
  background: #fff;
  color: var(--gradient-gallery-ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.gradient-gallery__card:hover,
.gradient-gallery__card:focus-visible {
  border-color: var(--accent-color);
  box-shadow: 0 8px 22px rgba(16, 24, 40, 0.08);
  transform: translateY(-1px);
}

.gradient-gallery__card.is-active {
  border-color: var(--accent-color);
  background: var(--gradient-gallery-blue-soft);
}

.gradient-gallery__swatch {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 8px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.38);
}

.gradient-gallery__card-name {
  font-size: 13px;
  font-weight: 800;
  line-height: 1.45;
}

.gradient-gallery__card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.gradient-gallery__tag {
  padding: 3px 7px;
  border-radius: 999px;
  background: #fff0fa;
  color: var(--main-color);
  font-size: 11px;
  font-weight: 800;
}

.gradient-gallery__empty {
  grid-column: 1 / -1;
  margin: 0;
  padding: 14px;
  border: 1px dashed color-mix(in srgb, var(--accent-color) 46%, transparent);
  border-radius: 8px;
  background: var(--gradient-gallery-blue-soft);
  color: #0277bd;
  font-weight: 800;
}

.gradient-gallery__settings-grid {
  align-items: stretch;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.gradient-gallery__settings-grid > .omoshiro-tool__setting-card.gradient-gallery__setting-row {
  display: flex;
  flex-direction: row;
  gap: 10px;
  align-items: center;
  justify-content: flex-start;
  padding: 10px 12px;
}

.gradient-gallery__settings-grid > .gradient-gallery__setting-row > .omoshiro-tool__setting-label {
  flex: 0 0 auto;
  margin: 0;
  white-space: nowrap;
}

.gradient-gallery__settings-grid > .gradient-gallery__setting-row > .omoshiro-tool__radio-list {
  display: flex;
  flex: 0 1 auto;
  flex-wrap: wrap;
  justify-content: flex-start;
}

.gradient-gallery__option-note {
  font-size: 0.78em;
  font-weight: 800;
}

.gradient-gallery__settings-grid .omoshiro-tool__radio span {
  display: inline-flex;
  align-items: baseline;
  white-space: nowrap;
}

.gradient-gallery__range-row {
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 88px;
  gap: 10px;
  align-items: center;
  min-width: 0;
}

.gradient-gallery__range-row input[type="range"] {
  appearance: none;
  width: 100%;
  height: 28px;
  background: transparent;
  accent-color: var(--accent-color);
}

.gradient-gallery__range-row input[type="range"]::-webkit-slider-runnable-track {
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent-color), color-mix(in srgb, var(--accent-color) 28%, #fff));
}

.gradient-gallery__range-row input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 18px;
  height: 18px;
  margin-top: -5px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: var(--accent-color);
  box-shadow: 0 2px 8px rgba(16, 24, 40, 0.18);
}

.gradient-gallery__range-row input[type="range"]::-moz-range-track {
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent-color), color-mix(in srgb, var(--accent-color) 28%, #fff));
}

.gradient-gallery__range-row input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: var(--accent-color);
  box-shadow: 0 2px 8px rgba(16, 24, 40, 0.18);
}

.gradient-gallery__number {
  text-align: right;
}

.gradient-gallery__stop-visual-block {
  display: grid;
  gap: 8px;
  margin: 12px 0 14px;
}

.gradient-gallery__stop-visual-head {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}

.gradient-gallery__stop-visual-head .omoshiro-tool__setting-label {
  margin: 0;
}

.gradient-gallery__stop-visual-head .omoshiro-tool__button {
  min-height: 36px;
  padding: 7px 12px;
}

.gradient-gallery__stops {
  margin-top: 12px;
}

.gradient-gallery__stop-visual {
  display: grid;
  gap: 8px;
  padding: 12px 18px;
  border: 1px solid #edf1f5;
  border-radius: 8px;
  background: #fff;
}

.gradient-gallery__stop-track {
  position: relative;
  height: 52px;
  border: 1px solid #d9e1ea;
  border-radius: 8px;
  cursor: crosshair;
  touch-action: none;
}

.gradient-gallery__stop-handle {
  position: absolute;
  top: 50%;
  width: 22px;
  height: 60px;
  padding: 0;
  border: 2px solid #fff;
  border-radius: 999px;
  background: var(--stop-color, #fff);
  box-shadow: 0 0 0 2px #172033, 0 6px 14px rgba(16, 24, 40, 0.18);
  transform: translate(-50%, -50%);
  cursor: grab;
  touch-action: none;
}

.gradient-gallery__stop-handle:active {
  cursor: grabbing;
}

.gradient-gallery__stop-handle.is-active {
  box-shadow: 0 0 0 3px var(--accent-color), 0 8px 18px rgba(16, 24, 40, 0.22);
}

.gradient-gallery__stop-scale {
  display: flex;
  justify-content: space-between;
  color: var(--gradient-gallery-muted);
  font-size: 11px;
  font-weight: 800;
}

.gradient-gallery__stop-list {
  display: grid;
  gap: 10px;
}

.gradient-gallery__stop-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid #edf1f5;
  border-radius: 8px;
  background: var(--gradient-gallery-soft);
}

.gradient-gallery__stop-card.is-active {
  border-color: var(--accent-color);
  background: var(--gradient-gallery-blue-soft);
}

.gradient-gallery__stop-head {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
}

.gradient-gallery__stop-title {
  margin: 0;
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
}

.gradient-gallery__stop-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.gradient-gallery__mini-button {
  min-height: 32px;
  padding: 6px 9px;
  border: 1px solid #d9e1ea;
  border-radius: 8px;
  background: #fff;
  color: #344054;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.gradient-gallery__mini-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.gradient-gallery__stop-grid {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) 92px auto;
  gap: 8px;
  align-items: center;
  min-width: 0;
}

.gradient-gallery__percent-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 5px;
  align-items: center;
  color: var(--gradient-gallery-muted);
  font-size: 13px;
  font-weight: 800;
}

.gradient-gallery__color {
  width: 52px;
  height: 42px;
  padding: 2px;
  border: 1px solid #d9e1ea;
  border-radius: 8px;
  background: #fff;
}

.gradient-gallery__shape-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: -8px;
}

.gradient-gallery__side .omoshiro-tool__preview-subtitle {
  margin-bottom: 0;
}

.gradient-gallery__shape-option {
  display: inline-flex;
  cursor: pointer;
}

.gradient-gallery__shape-option input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
  pointer-events: none;
}

.gradient-gallery__shape-option span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 7px 13px;
  border: 1px solid #d9e1ea;
  border-radius: 8px;
  background: #fff;
  color: var(--gradient-gallery-ink);
  font-size: 13px;
  font-weight: 800;
}

.gradient-gallery__shape-option input:checked + span {
  border-color: var(--accent-color);
  background: var(--gradient-gallery-blue-soft);
  color: var(--gradient-gallery-ink);
}

.gradient-gallery__preview-stage {
  display: grid;
  place-items: center;
  min-height: 320px;
  padding: 30px 18px;
  overflow: hidden;
  border: 1px solid #edf1f5;
  border-radius: 8px;
  background: #ffffff;
}

.gradient-gallery__preview-box {
  display: grid;
  place-items: center;
  width: 360px;
  max-width: 100%;
  height: 240px;
  border-radius: 20px;
  color: #fff;
  font-size: 18px;
  font-weight: 800;
  text-align: center;
  box-shadow: 0 16px 36px rgba(16, 24, 40, 0.14);
}

.gradient-gallery__preview-box.is-button {
  max-width: 320px;
  height: 58px;
  border-radius: 999px;
  text-shadow: 0 1px 5px rgba(16, 24, 40, 0.4), 0 0 1px rgba(255, 255, 255, 0.55);
}

.gradient-gallery__preview-box.is-circle {
  width: 220px;
  height: 220px;
  border-radius: 50%;
}

.gradient-gallery__preview-grid input[type="color"] {
  width: 100%;
  height: 42px;
  padding: 2px;
  border: 1px solid #d9e1ea;
  border-radius: 8px;
  background: #fff;
}

.gradient-gallery__class-label {
  display: grid;
  gap: 6px;
  color: var(--gradient-gallery-ink);
  font-size: 13px;
  font-weight: 800;
}

.gradient-gallery__code,
.gradient-gallery__guide-code {
  width: 100%;
  margin: 0;
  padding: 12px;
  overflow-x: auto;
  border: 1px solid #d9e1ea;
  border-radius: 8px;
  background: #101828;
  color: #f8fafc;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.65;
  white-space: pre;
}

.gradient-gallery__copy-message {
  margin: 0;
}

.gradient-gallery__mini-heading {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
}

.gradient-gallery__guide-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.gradient-gallery__guide-code {
  margin-top: 10px;
  background: #172033;
}

.gradient-gallery button:focus-visible,
.gradient-gallery input:focus-visible,
.gradient-gallery select:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent-color) 24%, transparent);
  outline-offset: 2px;
}

@media (max-width: 1100px) {
  .gradient-gallery__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .gradient-gallery__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .gradient-gallery__app,
  .gradient-gallery__guide-grid {
    grid-template-columns: 1fr;
  }

  .gradient-gallery .gradient-gallery__side.omoshiro-tool__side-panel {
    position: static;
  }
}

@media (max-width: 640px) {
  .gradient-gallery__settings-grid,
  .gradient-gallery__preview-grid {
    grid-template-columns: 1fr;
  }

  .gradient-gallery__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    max-height: 420px;
    overflow-y: auto;
    padding-right: 4px;
    overscroll-behavior: contain;
  }

  .gradient-gallery__card {
    gap: 6px;
    padding: 8px;
  }

  .gradient-gallery__swatch {
    aspect-ratio: 1.2 / 1;
  }

  .gradient-gallery__card-name {
    font-size: 12px;
  }

  .gradient-gallery__card-tags {
    gap: 4px;
  }

  .gradient-gallery__tag {
    padding: 2px 6px;
    font-size: 10px;
  }

  .gradient-gallery__range-row {
    grid-template-columns: minmax(0, 1fr) 74px;
  }

  .gradient-gallery__stop-grid {
    grid-template-columns: 44px minmax(0, 1fr) 76px;
  }

  .gradient-gallery__stop-card {
    grid-template-columns: 1fr;
    position: relative;
    padding-right: 46px;
  }

  .gradient-gallery__stop-grid .gradient-gallery__mini-button {
    position: absolute;
    top: 8px;
    right: 8px;
    min-height: 28px;
    padding: 4px 7px;
    font-size: 11px;
  }

  .gradient-gallery__stop-visual-head .omoshiro-tool__button {
    width: auto;
    min-width: 104px;
    flex: 0 0 auto;
  }

  .gradient-gallery__settings-grid .omoshiro-tool__radio {
    min-height: 34px;
    padding: 6px 8px;
    font-size: 12px;
  }

  .gradient-gallery__settings-grid > .gradient-gallery__setting-row > .omoshiro-tool__radio-list {
    flex-wrap: nowrap;
    gap: 6px;
  }

  .gradient-gallery__color {
    width: 44px;
  }

  .gradient-gallery__number {
    text-align: left;
  }

  .gradient-gallery__preview-stage {
    min-height: 280px;
    padding: 18px 12px;
  }

  .gradient-gallery__preview-box {
    width: 100% !important;
    height: min(220px, 62vw) !important;
  }

  .gradient-gallery__preview-box.is-button {
    width: 100% !important;
    max-width: 100%;
    height: 56px !important;
  }

  .gradient-gallery__preview-box.is-circle {
    width: min(220px, 62vw) !important;
    height: min(220px, 62vw) !important;
  }
}
