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

.sg-main {
  padding-top: 22px;
  padding-bottom: 56px;
}

.sg-topbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 18px 22px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  margin-bottom: 18px;
}

.sg-topbar h1 {
  margin: 0 0 4px;
  font-size: 1.55rem;
}

.sg-topbar p {
  margin: 0;
  color: var(--ink-muted);
  font-size: 0.94rem;
}

.sg-badge {
  display: inline-flex;
  align-items: center;
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 700;
  background: #e9f5f1;
  color: #155e4a;
  border: 1px solid #b5ded1;
}

.sg-grid {
  display: grid;
  grid-template-columns: minmax(270px, 320px) minmax(0, 1fr) minmax(270px, 320px);
  gap: 18px;
  align-items: start;
}

.sg-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.sg-dropzone {
  border: 2px dashed #b9c7c1;
  border-radius: 12px;
  padding: 18px 14px;
  text-align: center;
  background: #f9fbfa;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.sg-dropzone.is-dragover,
.sg-dropzone:hover {
  border-color: var(--accent);
  background: #eef7f4;
}

.sg-dropzone strong {
  display: block;
  margin-bottom: 4px;
}

.sg-dropzone span {
  font-size: 0.83rem;
  color: var(--ink-muted);
}

.sg-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.sg-stage {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #eceae2;
  min-height: 460px;
  max-height: 680px;
  overflow: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.sg-canvas {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.14);
  cursor: crosshair;
}

.sg-canvas.is-zoomed {
  max-width: none;
}

.sg-specs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.sg-spec-pill {
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  background: #f3f5f4;
  border: 1px solid var(--line);
}

.sg-legend {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 360px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sg-legend-row {
  display: grid;
  grid-template-columns: 24px 26px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  cursor: pointer;
  font-size: 0.84rem;
  text-align: left;
}

.sg-legend-row.is-brush {
  border-color: var(--accent);
  background: #eef7f4;
}

.sg-sym {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-weight: 700;
  text-align: center;
  font-size: 0.9rem;
}

.sg-swatch {
  width: 24px;
  height: 18px;
  border-radius: 5px;
  border: 1px solid rgba(15, 23, 42, 0.22);
}

.sg-color-meta {
  min-width: 0;
}

.sg-color-code {
  font-weight: 700;
  color: var(--ink);
}

.sg-color-name {
  font-size: 0.77rem;
  color: var(--ink-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sg-color-count {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink-muted);
  text-align: right;
}

.sg-seo-section {
  margin-top: 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px;
}

.sg-seo-section h2 {
  margin-top: 0;
}

@media (max-width: 1080px) {
  .sg-grid {
    grid-template-columns: 1fr;
  }
}

.studio-dialog [hidden] {
  display: none;
}
