.emotion-wheel-app {
  --ew-ink: #16324b;
  --ew-muted: #596873;
  --ew-line: #dbe4ed;
  color: var(--ew-ink);
  padding-bottom: 32px;
}

body:has(.emotion-wheel-app) #title-block-header h1 {
  color: #16324b;
}

.emotion-wheel-app *, .emotion-wheel-app *::before, .emotion-wheel-app *::after { box-sizing: border-box; }
.emotion-wheel-app [hidden] { display: none !important; }
.ew-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; align-items: start; }
.ew-stage, .ew-editor { min-width: 0; background: #fff; border: 1px solid var(--ew-line); border-radius: 14px; box-shadow: 0 5px 16px rgba(15, 23, 42, 0.045); }
.ew-stage { text-align: center; padding: 24px 16px 18px; }
.ew-categories { display: flex; flex-wrap: wrap; justify-content: center; gap: 7px; margin: 0 auto 20px; max-width: 720px; }
.ew-category { display: inline-flex; align-items: center; gap: 7px; min-height: 40px; padding: 7px 12px; border: 1px solid var(--ew-line); border-radius: 7px; background: #fff; color: var(--ew-ink); font: inherit; font-size: 0.85rem; cursor: pointer; }
.ew-category::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--ew-category-color, #b8c6d1); }
.ew-category:hover { background: #f0f5f9; }
.ew-category[aria-pressed="true"] { border-color: var(--ew-ink); background: #edf3f7; box-shadow: inset 0 0 0 1px var(--ew-ink); }
.ew-wheel-wrap { position: relative; container-type: inline-size; width: min(100%, 720px); aspect-ratio: 1; margin: 0 auto 16px; overflow: hidden; }
#ew-wheel { display: block; width: 100%; height: 100%; overflow: visible; transform-origin: center; }
.ew-sector { stroke: #fff; stroke-opacity: 0.8; stroke-width: 1.8; }
.ew-selected { stroke: #16324b; stroke-width: 5; stroke-linejoin: round; }
.ew-wheel-label { fill: #1e3545; font-family: inherit; font-size: 20px; font-weight: 400; }
.ew-family-label { fill: #183348; font-family: inherit; font-size: 23px; font-weight: 600; }
.ew-group-label { fill: #1e3545; font-family: inherit; font-size: 21px; font-weight: 400; }
.ew-pointer { position: absolute; z-index: 2; top: 0; left: 50%; width: 24px; height: 30px; transform: translateX(-50%); background: var(--ew-ink); clip-path: polygon(0 0, 100% 0, 50% 100%); filter: drop-shadow(0 2px 2px #fff); }
.ew-button { display: inline-flex; align-items: center; justify-content: center; gap: 18px; min-height: 44px; border: 1px solid var(--ew-ink); border-radius: 7px; padding: 10px 18px; background: var(--ew-ink); color: white; font: inherit; font-size: 0.95rem; font-weight: 600; cursor: pointer; transition: background 150ms ease; }
.ew-button:hover { background: #24577c; }
.ew-button:disabled { cursor: default; opacity: 0.55; }
.ew-spin { min-width: 208px; margin-bottom: 20px; }
.ew-spin span { font-size: 1.4rem; line-height: 1; }
.ew-result { color: var(--ew-ink); font-size: 0.95rem; margin: 13px 0 0; overflow-wrap: anywhere; }
.ew-result:empty { display: none; }
.ew-editor { padding: 22px 20px 16px; }
.ew-editor fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.ew-editor label { display: block; font-size: 0.78rem; font-weight: 600; margin-bottom: 5px; }
.ew-editor input, .ew-editor select { width: 100%; min-width: 0; height: 42px; padding: 8px 10px; border: 1px solid #bdcbd5; border-radius: 6px; background: #fff; color: var(--ew-ink); font: inherit; font-size: 0.9rem; }
.ew-add-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 10px; margin-top: 11px; }
.ew-editor-status { font-size: 0.78rem; color: var(--ew-muted); margin: 9px 0; }
.ew-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.ew-word-list { max-height: 430px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #bccbd5 transparent; margin-top: 20px; padding-right: 6px; overscroll-behavior: contain; }
.ew-group { margin: 0 0 17px; }
.ew-group h2 { display: flex; align-items: center; gap: 7px; margin: 0 0 10px; padding: 0; border: 0; font-size: 0.88rem; color: var(--ew-ink); }
.ew-group h2::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--ew-group-color); }
.ew-group h3 { margin: 12px 0 6px; padding: 0; font-size: 0.74rem; font-weight: 400; color: var(--ew-muted); }
.ew-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ew-chip { display: inline-flex; align-items: center; max-width: 100%; border: 1px solid #16324b12; border-radius: 5px; background: var(--ew-group-pale); font-size: 0.76rem; line-height: 1.2; }
.ew-chip span { min-width: 0; padding: 5px 0 5px 8px; overflow-wrap: anywhere; }
.ew-chip button { flex-shrink: 0; align-self: stretch; width: 29px; min-height: 31px; padding: 0; border: 0; border-radius: 0 5px 5px 0; background: transparent; color: #3a4b56; font: inherit; font-size: 1.1rem; cursor: pointer; }
.ew-chip button:hover { background: #16324b14; color: #132e42; }
.ew-chip button:disabled { opacity: 0.35; cursor: default; }
.ew-editor-footer { display: flex; justify-content: space-between; gap: 12px; padding-top: 14px; border-top: 1px solid var(--ew-line); }
.ew-text-button { min-height: 32px; border: 0; padding: 0; background: transparent; color: #24577c; font: inherit; font-size: 0.8rem; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.ew-text-button:disabled { opacity: 0.45; cursor: default; }
.emotion-wheel-app :is(button, input, select):focus-visible { outline: 3px solid #2980b9; outline-offset: 3px; }
.ew-reveal { position: absolute; z-index: 3; inset: 3%; display: grid; place-items: center; border-radius: 50%; background: rgba(16, 32, 45, 0.16); color: var(--ew-ink); font-family: inherit; overflow: hidden; }
.ew-reveal-content { position: relative; width: 90%; text-align: center; pointer-events: none; animation: ew-appear 450ms ease-out both; }
.ew-reveal-content h2 { margin: 0; padding: 0; border: 0; color: var(--ew-ink); font-family: inherit; font-size: clamp(1.7rem, 9cqw, 4.5rem); line-height: 1.1; overflow-wrap: anywhere; text-shadow: 0 0 3px #fff, 0 2px 12px #fff; }
.ew-close { position: absolute; z-index: 2; top: 14%; right: 14%; width: 44px; height: 44px; border: 1px solid var(--ew-line); border-radius: 50%; background: #fff; color: var(--ew-ink); font: inherit; font-size: 1.8rem; line-height: 1; cursor: pointer; }
.ew-close:hover { background: #eef4f8; }
#ew-fireworks { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
@keyframes ew-appear { from { opacity: 0; transform: scale(0.92); } to { opacity: 1; transform: scale(1); } }
@media (max-width: 1200px) { .ew-layout { grid-template-columns: minmax(0, 1fr); } .ew-stage { padding-top: 22px; } .ew-editor { width: min(100%, 720px); justify-self: center; } .ew-word-list { max-height: 320px; } }
@media (max-width: 991px) { body:has(.emotion-wheel-app) #title-block-header { padding-top: 48px; } }
@media (max-width: 575px) { .ew-stage { padding: 16px 4px; } .ew-layout { gap: 18px; } .ew-pointer { width: 17px; height: 22px; } .ew-wheel-wrap { margin-bottom: 12px; } .ew-editor { padding: 20px 16px 14px; } .ew-chip button { width: 36px; min-height: 36px; } }
@media (prefers-reduced-motion: reduce) { .emotion-wheel-app *, .emotion-wheel-app *::before, .emotion-wheel-app *::after { animation: none !important; transition: none !important; } }
