/* Components page: raw controls + wireframes below (no window chrome) */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  background: transparent;
  color: #1e293b;
  overflow-x: hidden;
  overflow-y: visible;
}

body {
  font-family: system-ui, "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  padding: 20px 16px 48px;
}

.components-page {
  max-width: 320px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 36px;
}

.component-showcase__name {
  margin: 0 0 10px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(15, 23, 42, 0.75);
}

/* Live component preview (no faux window) */
.component-demo {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 12px 0 4px;
  background: transparent;
}

.component-demo--tall {
  min-height: 120px;
  align-items: center;
}

/* —— Knob —— */
.ui-knob {
  --size: 72px;
  width: var(--size);
  height: var(--size);
  border-radius: 50%;
  background: linear-gradient(145deg, #f1f5f9, #cbd5e1);
  border: 2px solid rgba(15, 23, 42, 0.2);
  box-shadow:
    inset 0 2px 4px rgba(255, 255, 255, 0.9),
    0 2px 6px rgba(0, 0, 0, 0.12);
  position: relative;
}

.ui-knob__indicator {
  position: absolute;
  top: 8px;
  left: 50%;
  width: 3px;
  height: 18px;
  margin-left: -1.5px;
  background: #334155;
  border-radius: 2px;
  transform-origin: 50% calc(var(--size) / 2 - 8px);
  transform: rotate(42deg);
}

/* —— Dropdown —— */
.ui-select-wrap {
  width: 100%;
  max-width: 140px;
}

.ui-select {
  width: 100%;
  padding: 6px 28px 6px 10px;
  font-size: 12px;
  border: 1px solid rgba(15, 23, 42, 0.25);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.6);
  color: inherit;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23334155' d='M3 4.5L6 8l3-3.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
}

/* —— Vertical slider —— */
.ui-vslider {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  justify-content: center;
  padding: 8px 0;
}

.ui-vslider input[type="range"] {
  width: 120px;
  height: 24px;
  transform: rotate(-90deg);
  transform-origin: center center;
  accent-color: #475569;
  cursor: pointer;
}

/* —— Switch —— */
.ui-switch {
  position: relative;
  width: 44px;
  height: 24px;
  border-radius: 12px;
  background: #94a3b8;
  border: none;
  cursor: pointer;
  padding: 0;
  transition: background 0.15s ease;
}

.ui-switch[aria-checked="true"] {
  background: #3b82f6;
}

.ui-switch__thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: transform 0.15s ease;
}

.ui-switch[aria-checked="true"] .ui-switch__thumb {
  transform: translateX(20px);
}

/* —— Button —— */
.ui-btn {
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: none;
  border-radius: 6px;
  background: linear-gradient(180deg, #64748b, #475569);
  color: #f8fafc;
  cursor: pointer;
  box-shadow: 0 2px 0 #334155;
}

.ui-btn:active {
  transform: translateY(1px);
  box-shadow: 0 1px 0 #334155;
}

/* —— XY pad —— */
.ui-xypad {
  width: 100px;
  height: 100px;
  border-radius: 6px;
  background: linear-gradient(180deg, #e2e8f0, #cbd5e1);
  border: 1px solid rgba(15, 23, 42, 0.2);
  position: relative;
  cursor: crosshair;
}

.ui-xypad__dot {
  position: absolute;
  width: 14px;
  height: 14px;
  margin: -7px 0 0 -7px;
  border-radius: 50%;
  background: #3b82f6;
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
  left: 62%;
  top: 38%;
}

/* —— Stepped control (bonus surface) —— */
.ui-steps {
  display: flex;
  gap: 4px;
}

.ui-steps__step {
  width: 22px;
  height: 28px;
  border-radius: 4px;
  border: 1px solid rgba(15, 23, 42, 0.2);
  background: rgba(255, 255, 255, 0.5);
  cursor: pointer;
}

.ui-steps__step.is-on {
  background: #334155;
  border-color: #334155;
}

/* —— Wireframe block (below live control) —— */
.component-wireframe {
  margin-top: 14px;
  padding: 14px;
  background: #fff;
  border: 2px solid #000;
  border-radius: 4px;
}

.component-wireframe__canvas {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
}

.component-wireframe__canvas--knob .wf {
  width: 48px;
  height: 48px;
  border: 2px solid #000;
  border-radius: 50%;
}

.component-wireframe__canvas--knob .wf::after {
  content: "";
  display: block;
  width: 2px;
  height: 14px;
  margin: 4px auto 0;
  background: #000;
}

.component-wireframe__canvas--select .wf {
  width: 100%;
  max-width: 120px;
  height: 28px;
  border: 2px solid #000;
  border-radius: 4px;
}

.component-wireframe__canvas--vslider .wf {
  width: 8px;
  height: 64px;
  border: 2px solid #000;
  border-radius: 2px;
  position: relative;
}

.component-wireframe__canvas--vslider .wf::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 30%;
  width: 16px;
  height: 6px;
  margin-left: -8px;
  border: 2px solid #000;
  background: #fff;
}

.component-wireframe__canvas--switch .wf {
  width: 40px;
  height: 20px;
  border: 2px solid #000;
  border-radius: 10px;
  position: relative;
}

.component-wireframe__canvas--switch .wf::after {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  border: 2px solid #000;
  border-radius: 50%;
  top: 1px;
  left: 2px;
  background: #fff;
}

.component-wireframe__canvas--button .wf {
  width: 72px;
  height: 28px;
  border: 2px solid #000;
  border-radius: 4px;
}

.component-wireframe__canvas--xypad .wf {
  width: 72px;
  height: 72px;
  border: 2px solid #000;
  border-radius: 4px;
  position: relative;
}

.component-wireframe__canvas--xypad .wf::after {
  content: "";
  position: absolute;
  width: 10px;
  height: 10px;
  border: 2px solid #000;
  border-radius: 50%;
  left: 55%;
  top: 35%;
  margin: -5px 0 0 -5px;
}

.component-wireframe__canvas--steps .wf {
  display: flex;
  gap: 4px;
}

.component-wireframe__canvas--steps .wf span {
  width: 16px;
  height: 22px;
  border: 2px solid #000;
}

.wireframe-legend {
  margin: 12px 0 0;
  font-size: 0.68rem;
  line-height: 1.45;
  color: #334155;
  text-align: center;
}

.wireframe-legend strong {
  color: #0f172a;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* —— Component list page (shell / inventory) —— */
.components-list-body {
  padding: 16px 14px 32px;
}

.components-list-page {
  max-width: 22rem;
  margin: 0 auto;
}

.components-list-page__title {
  margin: 0 0 12px;
  font-size: 1rem;
  font-weight: 600;
  color: #0f172a;
}

.components-shell-note {
  margin: 0 0 10px;
  font-size: 0.72rem;
  line-height: 1.5;
  color: #475569;
}

.components-shell-note code {
  font-size: 0.68rem;
  word-break: break-all;
}

.components-shell-note--secondary {
  margin-bottom: 16px;
  font-weight: 500;
  color: #334155;
}

.components-mockup-list {
  margin: 0;
  padding-left: 1.25rem;
  font-size: 0.82rem;
  line-height: 1.85;
  color: #1e293b;
}

.components-mockup-list__link {
  color: #2563eb;
  font-weight: 600;
}

.components-mockup-list__link:hover {
  text-decoration: underline;
}

.components-mockup-list__link:focus-visible {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
  border-radius: 2px;
}

/* —— Single mockup page —— */
.components-page--single {
  gap: 0;
  max-width: 320px;
}

.component-back-link {
  margin: 0 0 8px;
  font-size: 0.72rem;
}

.component-back-link a {
  color: #2563eb;
}

.component-back-link a:hover {
  text-decoration: underline;
}
