/* =========================================================
   JSRay Studio · UI styles (the studio chrome, not the
   highlighted code itself which is themed by --jr-* vars).
   ========================================================= */

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  font: 14px/1.5 -apple-system, "Segoe UI", "PingFang SC",
        "Helvetica Neue", sans-serif;
  background: var(--jr-bg);
  color: var(--jr-fg);
  transition: background 200ms ease, color 200ms ease;
  min-height: 100vh;
}

/* --- Header --------------------------------------------------------------- */
.studio-header {
  max-width: 1280px;
  margin: 0 auto;
  padding: 48px 32px 24px;
}
.studio-header .brand {
  font-size: 11px;
  letter-spacing: 0.2em;
  opacity: 0.5;
  margin-bottom: 8px;
}
.studio-header h1 {
  margin: 0 0 6px;
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.studio-header p {
  margin: 0;
  opacity: 0.6;
  font-size: 13.5px;
}
.studio-nav {
  margin-top: 18px;
  font-size: 13px;
}
.studio-nav a {
  color: inherit;
  text-decoration: none;
  opacity: 0.55;
}
.studio-nav a:hover { opacity: 1; }

/* --- Toolbar -------------------------------------------------------------- */
.studio {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 32px 96px;
}
.studio-toolbar {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 14px 16px;
  margin-bottom: 20px;
  border-radius: 10px;
  background: rgba(127,127,127,0.08);
}
.toolbar-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.6;
}
.toolbar-field input {
  background: rgba(127,127,127,0.12);
  color: inherit;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 8px 10px;
  font: inherit;
  font-size: 13px;
  text-transform: none;
  letter-spacing: 0;
  min-width: 200px;
  outline: none;
}
.toolbar-field input:focus { border-color: rgba(127,127,127,0.35); }

.toolbar-tabs {
  display: inline-flex;
  background: rgba(127,127,127,0.12);
  padding: 3px;
  border-radius: 8px;
}
.toolbar-tabs .tab {
  background: transparent;
  color: inherit;
  border: 0;
  padding: 7px 16px;
  border-radius: 6px;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  opacity: 0.6;
}
.toolbar-tabs .tab.active {
  background: rgba(127,127,127,0.25);
  opacity: 1;
}

.toolbar-actions {
  margin-left: auto;
  display: flex;
  gap: 8px;
}
.btn {
  background: rgba(127,127,127,0.15);
  color: inherit;
  border: 0;
  padding: 9px 16px;
  border-radius: 7px;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
}
.btn:hover { background: rgba(127,127,127,0.25); }
.btn.primary {
  background: var(--jr-fn-decl);
  color: var(--jr-bg);
  font-weight: 600;
}
.btn.primary:hover { filter: brightness(1.05); }
.btn.ghost { background: transparent; box-shadow: inset 0 0 0 1px rgba(127,127,127,0.25); }

/* --- Body grid ------------------------------------------------------------ */
.studio-body {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 20px;
}
@media (max-width: 900px) {
  .studio-body { grid-template-columns: 1fr; }
}

/* --- Picker list ---------------------------------------------------------- */
.pickers {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 78vh;
  overflow-y: auto;
  padding-right: 6px;
}
.picker-group {
  margin-top: 14px;
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  opacity: 0.45;
  padding: 0 6px;
}
.picker-group:first-child { margin-top: 0; }
.picker-row {
  display: grid;
  grid-template-columns: 36px 1fr 88px;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: 7px;
  font-size: 13px;
}
.picker-row:hover { background: rgba(127,127,127,0.06); }
.picker-row label {
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.picker-row .meta {
  font-size: 10.5px;
  opacity: 0.45;
  letter-spacing: 0.05em;
}
.picker-row input[type="color"] {
  width: 32px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
  overflow: hidden;
}
.picker-row input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.picker-row input[type="color"]::-webkit-color-swatch { border: 1px solid rgba(127,127,127,0.2); border-radius: 4px; }
.picker-row .hex {
  font-family: ui-monospace, "JetBrains Mono", Menlo, monospace;
  font-size: 11.5px;
  background: rgba(127,127,127,0.12);
  border: 0;
  color: inherit;
  padding: 5px 8px;
  border-radius: 4px;
  text-align: center;
  outline: none;
  width: 88px;
}
.picker-row .hex:focus { background: rgba(127,127,127,0.25); }

/* --- Preview pane --------------------------------------------------------- */
.preview { display: flex; flex-direction: column; gap: 12px; }
.preview-tabs {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  background: rgba(127,127,127,0.08);
  border-radius: 8px;
  align-self: flex-start;
}
.preview-tabs .ptab {
  background: transparent;
  color: inherit;
  border: 0;
  padding: 6px 12px;
  border-radius: 5px;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  opacity: 0.55;
}
.preview-tabs .ptab.active {
  background: rgba(127,127,127,0.22);
  opacity: 1;
}
.preview-pane pre {
  margin: 0;
  min-height: 60vh;
}
