/* Sill light panel. Reads the host theme tokens: --surface, --surface-raised,
   --surface-lifted, --ink, --muted, --muted-dim, --line, --line-strong. */

.sp-dock {
  --sl-ring: var(--line-strong, rgb(255 255 255 / 0.22));
  position: fixed;
  right: var(--gutter, 24px);
  bottom: 20px;
  z-index: 6;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 18px 0 14px;
  border: 0;
  border-radius: 999px;
  background: var(--surface, #16161b);
  color: var(--ink, #f5f5f7);
  font: 600 0.875rem/1 var(--sans, system-ui, -apple-system, 'Segoe UI', sans-serif);
  box-shadow: inset 0 0 0 1px var(--line-strong, rgb(255 255 255 / 0.22)), var(--elev-2, 0 4px 12px rgb(0 0 0 / 0.2));
  cursor: pointer;
}
.sp-dock-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff6df, #f2b65a 70%);
  box-shadow: 0 0 0 3px color-mix(in srgb, #f2b65a 22%, transparent);
}

.sp-panel {
  position: fixed;
  right: var(--gutter, 24px);
  bottom: 76px;
  z-index: 6;
  display: grid;
  gap: 14px;
  width: min(340px, calc(100vw - 32px));
  max-height: calc(100vh - 110px);
  overflow: auto;
  padding: 16px;
  border-radius: var(--radius-xl, 16px);
  background: var(--surface, #16161b);
  box-shadow: inset 0 0 0 1px var(--line, rgb(255 255 255 / 0.12)), 0 2px 4px rgb(0 0 0 / 0.06), 0 16px 32px -8px rgb(0 0 0 / 0.14), 0 40px 80px -16px rgb(0 0 0 / 0.18);
  font-size: 0.8125rem;
  overscroll-behavior: contain;
}
.sp-panel[hidden] { display: none; }
.sp-head { display: flex; align-items: center; justify-content: space-between; }
.sp-head h2 { font-size: 1.25rem; }
.sp-close {
  width: 36px; height: 36px;
  border: 0; border-radius: var(--radius-md, 8px);
  background: transparent; color: var(--muted, #a0a0a0);
  font-size: 1.25rem; cursor: pointer;
}
@media (hover: hover) { .sp-close:hover { background: var(--surface-raised, #1c1c22); color: var(--ink, #f5f5f7); } }

.sp-seg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: var(--radius-md, 8px); background: var(--surface-raised, #1c1c22); box-shadow: inset 0 0 0 1px var(--line, rgb(255 255 255 / 0.12)); }
.sp-seg-btn { min-height: 34px; border: 0; border-radius: var(--radius, 6px); background: transparent; color: var(--muted, #a0a0a0); font: 600 0.8125rem/1 var(--sans, system-ui, -apple-system, 'Segoe UI', sans-serif); cursor: pointer; }
.sp-seg-btn[aria-checked='true'] { background: var(--surface, #16161b); color: var(--ink, #f5f5f7); box-shadow: var(--elev-1, 0 1px 2px rgb(0 0 0 / 0.2)), inset 0 0 0 1px var(--line, rgb(255 255 255 / 0.12)); }

.sp-presets { display: flex; flex-wrap: wrap; gap: 6px; }
.sp-chip { min-height: 32px; padding: 0 12px; border: 0; border-radius: 999px; background: var(--surface-raised, #1c1c22); color: var(--ink, #f5f5f7); font: 500 0.8125rem/1 var(--sans, system-ui, -apple-system, 'Segoe UI', sans-serif); box-shadow: inset 0 0 0 1px var(--line, rgb(255 255 255 / 0.12)); cursor: pointer; }
@media (hover: hover) { .sp-chip:hover { background: var(--surface-lifted, #23232a); } }

.sp-padwrap { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; }
.sp-pad {
  position: relative;
  height: 84px;
  border-radius: var(--radius-md, 8px);
  background:
    linear-gradient(var(--line, rgb(255 255 255 / 0.12)) 0 0) 50% 0 / 1px 100% no-repeat,
    linear-gradient(var(--line, rgb(255 255 255 / 0.12)) 0 0) 0 50% / 100% 1px no-repeat,
    var(--surface-raised, #1c1c22);
  box-shadow: inset 0 0 0 1px var(--line, rgb(255 255 255 / 0.12));
  cursor: crosshair;
  touch-action: none;
}
.sp-pad-handle {
  position: absolute;
  left: var(--hx, 30%);
  top: var(--hy, 22%);
  width: 14px; height: 14px;
  margin: -7px 0 0 -7px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff6df, #f2b65a 70%);
  box-shadow: 0 0 0 2px var(--surface, #16161b), 0 0 0 3px var(--line-strong, rgb(255 255 255 / 0.22));
}

.sp-switch { display: inline-grid; grid-template-columns: auto auto; grid-template-rows: auto auto; column-gap: 8px; row-gap: 4px; align-items: center; justify-items: start; padding: 0; border: 0; background: none; color: var(--ink, #f5f5f7); font: 500 0.8125rem/1.2 var(--sans, system-ui, -apple-system, 'Segoe UI', sans-serif); cursor: pointer; text-align: left; }
.sp-switch-label { grid-column: 1 / -1; }
.sp-switch-track { position: relative; width: 36px; height: 22px; border-radius: 999px; background: var(--surface-lifted, #23232a); box-shadow: inset 0 0 0 1px var(--line-strong, rgb(255 255 255 / 0.22)); transition: background-color var(--duration-fast, 250ms) var(--ease-out, cubic-bezier(0.23, 1, 0.32, 1)); }
.sp-switch-thumb { position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--surface, #16161b); box-shadow: var(--elev-1, 0 1px 2px rgb(0 0 0 / 0.2)); transition: transform var(--duration-fast, 250ms) var(--ease-out, cubic-bezier(0.23, 1, 0.32, 1)); }
.sp-switch[aria-checked='true'] .sp-switch-track { background: var(--ink, #f5f5f7); }
.sp-switch[aria-checked='true'] .sp-switch-thumb { transform: translateX(14px); }
.sp-switch-state { color: var(--muted, #a0a0a0); }

.sp-rows { display: grid; gap: 10px; }
.sp-row { display: grid; grid-template-columns: 1fr auto; gap: 4px 8px; align-items: center; }
.sp-row[hidden] { display: none; }
.sp-row label { color: var(--muted, #a0a0a0); }
.sp-val { font: 500 0.75rem/1 var(--mono, ui-monospace, 'SF Mono', Consolas, monospace); font-variant-numeric: tabular-nums; color: var(--ink, #f5f5f7); }
.sp-row input { grid-column: 1 / -1; width: 100%; margin: 0; accent-color: var(--ink, #f5f5f7); }

.sp-foot { display: grid; grid-template-columns: auto 1fr; gap: 8px 12px; align-items: center; }
.sp-foot label { color: var(--muted, #a0a0a0); }
.sp-foot select { min-height: 32px; padding: 0 8px; border: 0; border-radius: var(--radius, 6px); background: var(--surface-raised, #1c1c22); color: var(--ink, #f5f5f7); font: 500 0.8125rem/1 var(--sans, system-ui, -apple-system, 'Segoe UI', sans-serif); box-shadow: inset 0 0 0 1px var(--line, rgb(255 255 255 / 0.12)); }
.sp-readout { font: 400 0.6875rem/1.4 var(--mono, ui-monospace, 'SF Mono', Consolas, monospace); color: var(--muted-dim, #8a8a8a); }
.sp-reset { justify-self: start; min-height: 32px; padding: 0 12px; border: 0; border-radius: var(--radius-md, 8px); background: transparent; color: var(--muted, #a0a0a0); font: 600 0.8125rem/1 var(--sans, system-ui, -apple-system, 'Segoe UI', sans-serif); box-shadow: inset 0 0 0 1px var(--line, rgb(255 255 255 / 0.12)); cursor: pointer; }

