/* The RAINBOW tab of the Skin Creator (rainbow-creator.js + rainbow-studio.js),
   in the page's own parchment-and-brass look. */

.gc-hidden { display: none !important; }

/* The shared tab row: two or three tabs, equal widths, one line at any width. */
#gcTabs.gc-tabs {
  margin-bottom: .6rem;
  grid-template-columns: none;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
}

/* With a tab row the panel has one more child, so its rows follow the open tab:
   STANDARD keeps the colour list as the stretching row; a tab panel stretches
   on its own tab. */
.skin-panel-right[data-creator-tab="standard"] {
  grid-template-rows: auto auto minmax(0, 1fr) auto auto auto;
}
.skin-panel-right[data-creator-tab]:not([data-creator-tab="standard"]) {
  grid-template-rows: auto minmax(0, 1fr);
}

/* ---------- the Rainbow panel ---------- */
.rc-panel {
  min-height: 0;
  min-width: 0;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: .8rem;
  padding: .2rem .15rem .2rem 0;
  scrollbar-width: thin;
  overscroll-behavior: contain;
}
.rc-widget { min-width: 0; }

.rainbow-studio {
  display: flex;
  flex-direction: column;
  min-width: 0;
  color: var(--ink, #3d3326);
  font-family: var(--font-body, 'Cormorant Garamond', serif);
  font-size: .95rem;
}
.rainbow-studio *,
.rainbow-studio *::before,
.rainbow-studio *::after { box-sizing: border-box; }
.rainbow-studio [hidden] { display: none !important; }
.rainbow-studio h2,
.rainbow-studio h3,
.rainbow-studio p { margin: 0; }

.rb-content { display: flex; flex-direction: column; gap: .7rem; min-width: 0; }
.rb-header { display: grid; gap: .2rem; }
.rainbow-studio h2 {
  font-family: var(--font-display, 'Cinzel', serif);
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-light, #5a4d3a);
}
.rainbow-studio h3 {
  font-family: var(--font-display, 'Cinzel', serif);
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.rb-lede,
.rb-access {
  color: var(--ink-light, #5a4d3a);
  font-size: .8rem;
  line-height: 1.3;
}
.rb-access:empty { display: none; }
.rb-feedback {
  padding: .4rem .55rem;
  border-left: 3px solid var(--brass, #b58b4a);
  background: rgba(181, 139, 74, .12);
  color: var(--ink, #3d3326);
  font-size: .82rem;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

/* labels: the page's small Cinzel capitals */
.rb-field { display: grid; gap: .3rem; min-width: 0; }
.rb-field > span,
.rb-colour-label > span,
.rc-access legend {
  font-family: var(--font-display, 'Cinzel', serif);
  font-size: .54rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-light, #5a4d3a);
}

/* inputs: the same as the saved-skins panel */
.rainbow-studio input[type=text],
.rainbow-studio input[type=number],
.rainbow-studio select {
  width: 100%;
  min-width: 0;
  min-height: 36px;
  padding: .4rem .5rem;
  border: 1px solid rgba(116, 98, 67, .45);
  border-radius: 0;
  background: rgba(247, 240, 222, .72);
  color: #30291f;
  font: inherit;
  font-size: .92rem;
}
.rainbow-studio select option { background: #f2ead8; color: #30291f; }
.rainbow-studio input[type=color] {
  width: 30px;
  height: 28px;
  flex: none;
  padding: 1px;
  border: 1px solid var(--ivory-deeper, #b8a98a);
  background: rgba(255, 255, 255, .3);
  cursor: pointer;
}
.rainbow-studio input:user-invalid { border-color: #b85b54; }

.rb-design-picker { display: flex; align-items: end; gap: .45rem; min-width: 0; }
.rb-design-picker > .rb-field { flex: 1; }
.rb-design-picker > .rb-button { flex: none; min-height: 36px; }

.rb-editor { min-width: 0; margin: 0; padding: 0; border: 0; display: grid; gap: .7rem; }
.rb-editor > legend {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}
.rb-editor:disabled { opacity: .55; }
.rb-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; align-items: end; }
.rb-speed { grid-column: 1 / -1; }
.rb-speed .rb-lede { font-size: .75rem; }

/* the ten colour areas, compact for a 260-320 px column */
.rb-colours {
  display: grid;
  border-top: 1px solid rgba(184, 169, 138, .7);
}
.rb-colour-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 78px;
  gap: .5rem;
  align-items: center;
  min-height: 38px;
  padding-top: .25rem;
}
.rb-colour-label { display: flex; align-items: center; justify-content: space-between; gap: .4rem; min-width: 0; }
.rb-area-button {
  min-width: 0;
  padding: .35rem 0;
  border: 0;
  background: none;
  color: var(--ink, #3d3326);
  font-family: var(--font-display, 'Cinzel', serif);
  font-size: .56rem;
  letter-spacing: .08em;
  text-align: left;
  text-transform: uppercase;
  cursor: pointer;
  overflow-wrap: anywhere;
}
.rb-area-button:enabled:hover,
.rb-area-button[aria-expanded=true] { color: var(--brass, #b58b4a); }
.rb-area-button:disabled { cursor: default; }
.rainbow-studio .rb-colour-row input[type=text],
.rainbow-studio .rb-cycle-stop input[type=text] {
  min-height: 30px;
  padding: .25rem .35rem;
  font: .74rem ui-monospace, Consolas, monospace;
}

.rb-cycle-overview {
  display: flex;
  align-items: end;
  gap: .4rem;
  padding: .2rem 0 .45rem;
  border-bottom: 1px solid rgba(184, 169, 138, .7);
}
.rb-cycle-swatches { display: flex; flex-wrap: wrap; gap: .25rem; flex: 1; min-width: 0; }
.rb-cycle-swatch {
  display: grid;
  justify-items: center;
  gap: 1px;
  color: var(--ink-light, #5a4d3a);
  font: .62rem ui-monospace, Consolas, monospace;
}
.rainbow-studio .rb-cycle-swatch input[type=color] { width: 24px; height: 24px; }
.rb-cycle-overview .rb-stop-add { flex: none; min-height: 28px; padding: .2rem .45rem; margin-bottom: .9rem; font-size: .5rem; }
.rb-cycle-editor {
  display: grid;
  gap: .35rem;
  margin: .2rem 0 .45rem;
  padding: .45rem;
  border: 1px solid rgba(184, 169, 138, .65);
  background: rgba(255, 255, 255, .18);
}
.rb-cycle-stop { display: grid; grid-template-columns: 16px 30px minmax(0, 1fr) 30px; gap: .35rem; align-items: center; }
.rb-stop-number { color: var(--ink-light, #5a4d3a); font-size: .72rem; text-align: center; }
.rb-cycle-stop .rb-stop-remove { min-height: 30px; padding: 0; font-family: inherit; font-size: 1rem; letter-spacing: 0; }
.rb-cycle-hint { color: var(--ink-light, #5a4d3a); font-size: .76rem; line-height: 1.25; }

/* buttons: the page's .creator-action / .creator-action-primary */
.rb-button {
  min-height: 36px;
  padding: .45rem .5rem;
  border: 1px solid var(--ink-light, #5a4d3a);
  border-radius: 0;
  background: transparent;
  color: var(--ink, #3d3326);
  font-family: var(--font-display, 'Cinzel', serif);
  font-size: .54rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  cursor: pointer;
}
.rb-button.rb-primary { background: var(--ink, #3d3326); color: var(--cream, #f2ead8); border-color: var(--ink, #3d3326); }
.rb-button:hover:enabled { border-color: var(--brass, #b58b4a); box-shadow: inset 0 -2px 0 var(--brass, #b58b4a); }
.rb-button:disabled { opacity: .42; cursor: not-allowed; }
.rb-button:focus-visible,
.rb-area-button:focus-visible,
.rainbow-studio input:focus-visible,
.rainbow-studio select:focus-visible,
.rc-staff input:focus-visible,
.rc-panel .creator-action:focus-visible { outline: 2px solid var(--brass, #b58b4a); outline-offset: 2px; }

/* the actions stay in reach while the colours scroll */
.rb-footer {
  position: sticky;
  bottom: 0;
  z-index: 1;
  display: grid;
  gap: .4rem;
  margin-top: .7rem;
  padding: .6rem 0 .3rem;
  border-top: 1px solid rgba(184, 169, 138, .7);
  background: linear-gradient(180deg, #e2d7bc, #ddd1b2);
  box-shadow: 0 -8px 12px -10px rgba(48, 41, 31, .45);
}
.rb-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .4rem; }
.rb-actions .rb-button { min-height: 38px; }
.rc-island-note {
  padding: .3rem .5rem;
  border-left: 3px solid var(--brass, #b58b4a);
  background: rgba(181, 139, 74, .14);
  color: var(--ink, #3d3326);
  font-size: .8rem;
  line-height: 1.25;
}

/* the save dialog */
.rb-save-dialog {
  width: min(360px, calc(100vw - 32px));
  max-width: calc(100vw - 32px);
  padding: 1.1rem;
  border: 1px solid var(--brass, #b58b4a);
  background: linear-gradient(150deg, #ece3cf, #dcd0b0);
  color: var(--ink, #3d3326);
  font-family: var(--font-body, 'Cormorant Garamond', serif);
  box-shadow: 0 18px 48px rgba(0, 0, 0, .55);
}
.rb-save-dialog::backdrop { background: rgba(9, 16, 12, .72); }
.rb-save-dialog form { display: grid; gap: .8rem; }
.rb-save-dialog h3 { font-size: .8rem; }
.rb-save-feedback { color: var(--ink-light, #5a4d3a); font-size: .82rem; line-height: 1.3; }
.rb-save-feedback:empty { display: none; }
.rb-dialog-actions { display: flex; justify-content: flex-end; gap: .45rem; }
.rb-dialog-actions .rb-button { min-width: 84px; }

/* ---------- signed out ---------- */
.rc-signed-out { display: grid; gap: .6rem; padding: .6rem 0; }
.rc-signed-out-text { margin: 0; color: var(--ink, #3d3326); font-size: .95rem; line-height: 1.35; }
.rc-sign-in { display: grid; place-items: center; text-align: center; text-decoration: none; }

/* ---------- staff card ---------- */
.rc-staff {
  display: grid;
  gap: .5rem;
  padding: .6rem;
  border: 1px solid rgba(184, 169, 138, .65);
  background: rgba(255, 255, 255, .18);
}
.rc-staff .panel-label { margin: 0; }
.rc-check,
.rc-radio { display: flex; align-items: center; gap: .45rem; font-size: .92rem; cursor: pointer; }
.rc-check input,
.rc-radio input { width: 16px; height: 16px; margin: 0; accent-color: var(--ink, #3d3326); }
.rc-access { display: grid; gap: .3rem; margin: 0; padding: 0; border: 0; min-width: 0; }
.rc-access legend { padding: 0; margin-bottom: .2rem; }
.rc-stats { margin: 0; color: var(--ink-light, #5a4d3a); font-size: .82rem; }
.rc-staff .creator-action { min-height: 36px; }
.rc-staff-status { margin: 0; }
.rc-staff-status:empty { display: none; }
.rc-staff-status.is-error { color: #a8463e; }

/* ---------- narrow screens ---------- */
@media (max-width: 900px) {
  .rc-panel { overflow: visible; }
}
@media (max-width: 560px) {
  .rb-fields { gap: .45rem; }
  .rb-colour-row { grid-template-columns: minmax(0, 1fr) 84px; }
}
@media (pointer: coarse) {
  .rb-button,
  .rb-actions .rb-button,
  .rc-staff .creator-action { min-height: 44px; }
  .rb-cycle-swatch { min-width: 34px; }
  .rainbow-studio .rb-cycle-swatch input[type=color] { width: 34px; height: 34px; }
  .rb-cycle-overview .rb-stop-add { min-height: 40px; margin-bottom: 1rem; }
  .rb-colour-row { min-height: 46px; }
  .rainbow-studio input[type=color] { width: 36px; height: 34px; }
}
