.sw-app {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 320px);
  gap: 20px;
  align-items: start;
}
.sw-app h2 { margin: 0; font-size: 1rem; letter-spacing: -0.02em; }
.sw-stage, .sw-panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  min-width: 0;
}
.sw-stage {
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.sw-stage-head, .sw-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  width: 100%;
}
.sw-stage-head .btn { margin-left: auto; }
.sw-wheel-wrap {
  position: relative;
  width: min(100%, 480px);
  aspect-ratio: 1;
  margin-top: 10px;
}
#sw-canvas { display: block; width: 100%; height: 100%; border-radius: 50%; }
.sw-pointer {
  position: absolute;
  z-index: 2;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  border-left: 13px solid transparent;
  border-right: 13px solid transparent;
  border-top: 28px solid var(--text);
}
.sw-hub {
  position: absolute;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  width: 62px;
  height: 62px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 2px solid var(--card);
  background: var(--accent);
  color: var(--accent-contrast);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(var(--shadow-color), 0.18);
}
.sw-hub:hover { background: var(--accent-hover); }
.sw-spin { justify-content: center; min-height: 48px; width: min(100%, 270px); }
.sw-status { margin: 0; text-align: center; font-size: 0.88rem; overflow-wrap: anywhere; }
.sw-shortcut { margin: 0; color: var(--muted); font-size: 0.76rem; }
.sw-shortcut kbd { font-size: inherit; padding: 1px 5px; }
.sw-editor { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.sw-panel { padding: 16px; }
.sw-panel-head { margin-bottom: 12px; }
.sw-caption { color: var(--muted); font-size: 0.76rem; font-weight: 500; }
#sw-entries { resize: vertical; min-height: 210px; font-family: var(--sans); line-height: 1.7; font-size: 0.88rem; }
.sw-note { margin: 10px 0; font-size: 0.76rem; line-height: 1.6; color: var(--muted); }
.sw-error { margin: 8px 0; color: var(--bad); font-size: 0.8rem; }
.sw-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.sw-actions .btn, .sw-stage-head .btn { min-height: 40px; }
.sw-save-note { margin-bottom: 0; padding-top: 10px; border-top: 1px solid var(--border); }
.sw-settings summary { cursor: pointer; font-weight: 600; font-size: 0.88rem; }
.sw-settings-body { display: flex; flex-direction: column; gap: 14px; padding-top: 16px; }
.sw-settings .field label { font-size: 0.8rem; }
.sw-settings .select { font-family: inherit; font-size: 0.85rem; }
.sw-check { display: flex; align-items: start; gap: 8px; font-size: 0.8rem; cursor: pointer; }
.sw-check input { margin-top: 5px; width: 16px; height: 16px; flex-shrink: 0; accent-color: var(--accent); }
.sw-last-result { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; width: 100%; padding-top: 14px; border-top: 1px solid var(--border); }
.sw-last-result > div:first-child { min-width: 0; flex: 1; }
.sw-last-result strong, .sw-last-result .sw-caption { display: block; overflow-wrap: anywhere; }
.sw-history { grid-column: 1 / -1; }
.sw-history-list { margin: 0; padding: 0; list-style: none; max-height: 280px; overflow-y: auto; }
.sw-history-list li { display: flex; align-items: baseline; gap: 12px; padding: 10px 0; border-top: 1px solid var(--border); font-size: 0.88rem; }
.sw-history-list .sw-history-name { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.sw-history-list time { color: var(--muted); font-size: 0.74rem; flex-shrink: 0; }
.sw-dialog {
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  width: min(480px, calc(100vw - 32px));
  max-height: calc(100dvh - 40px);
  overflow-y: auto;
  box-shadow: 0 12px 40px rgba(var(--shadow-color), 0.18);
}
.sw-dialog::backdrop { background: rgba(0, 0, 0, 0.55); }
.sw-dialog h2 { font-size: 1rem; color: var(--muted); }
.sw-winner-name { font-size: clamp(1.6rem, 4vw, 2.4rem); font-weight: 800; letter-spacing: -0.03em; color: var(--accent); margin: 14px 0; line-height: 1.25; overflow-wrap: anywhere; }
.sw-dialog .sw-actions { margin-top: 20px; }
.sw-dialog .sw-actions .btn-primary { margin-left: auto; }
.sw-app button:disabled { opacity: 0.5; cursor: not-allowed; }
.sw-app textarea:disabled, .sw-app select:disabled { opacity: 0.65; }
.sw-stage:fullscreen { border: 0; border-radius: 0; justify-content: center; width: 100vw; height: 100dvh; overflow-y: auto; background: var(--bg); }
.sw-stage:fullscreen .sw-stage-head { position: absolute; top: 16px; left: 20px; width: calc(100% - 40px); }
.sw-stage:fullscreen .sw-wheel-wrap { width: min(70dvh, 72vw, 760px); margin-top: 40px; }
.sw-stage:fullscreen .sw-shortcut { display: none; }
.sw-stage:fullscreen .sw-last-result { width: min(700px, 100%); }
@media (max-width: 1100px) {
  .sw-app { grid-template-columns: minmax(0, 1fr); }
  .sw-editor { display: grid; grid-template-columns: minmax(0, 1fr) minmax(220px, 0.85fr); align-items: start; }
}
@media (max-width: 600px) {
  .sw-app { gap: 14px; }
  .sw-stage { padding: 16px; }
  .sw-editor { display: flex; }
  .sw-stage-head h2 { font-size: 0.95rem; }
  .sw-shortcut { display: none; }
  .sw-app .btn-sm { min-height: 44px; }
  .sw-panel { padding: 14px; }
  .sw-history-list time { max-width: 90px; text-align: right; }
  .sw-stage:fullscreen .sw-stage-head { left: 16px; width: calc(100% - 32px); }
  .sw-stage:fullscreen .sw-wheel-wrap { width: min(66dvh, 90vw); }
}
@media (prefers-reduced-motion: reduce) {
  #sw-canvas { transition: none; }
}
