/* Shared by this article's embeds. Colors match the blog theme (embed.js sets data-theme). */
:root {
  color-scheme: light;
  --bg: #fffdf8;
  --card: #fffdf8;
  --fg: #1d1b17;
  --sub: #4f4b43;
  --muted: #6a655b;
  --line: #e6e0d3;
  --soft: #f5f1e8;
  --c: #2a78d6;
  --l: #eb6834;
  --b: #1baf7a;
  --o: #6250d6;
  --hl: #fff1b8;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #1f1f25;
  --card: #1f1f25;
  --fg: #ebe7de;
  --sub: #c8c4bb;
  --muted: #a39f96;
  --line: #2e2e35;
  --soft: #24242b;
  --c: #3987e5;
  --l: #d95926;
  --b: #199e70;
  --o: #9085e9;
  --hl: #4a3f12;
}
* {
  box-sizing: border-box;
}
html {
  background: transparent;
}
body {
  margin: 0;
  color: var(--fg);
  font-family:
    "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic",
    Meiryo, sans-serif;
  font-size: 16px;
  line-height: 1.75;
  font-feature-settings: "palt";
}
p {
  margin: 0 0 14px;
}
.sub {
  color: var(--sub);
}
.small {
  font-size: 0.85rem;
  color: var(--sub);
}
.num {
  font-variant-numeric: tabular-nums;
}
button {
  font: inherit;
  color: var(--fg);
}
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 22px;
  margin: 0;
}
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  font-size: 0.82rem;
  color: var(--sub);
  margin: 0 0 14px;
}
.legend span::before {
  content: "";
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  margin-right: 6px;
  background: var(--k);
  vertical-align: -1px;
}
.answer {
  display: none;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px dashed var(--line);
}
.verdict {
  font-weight: 700;
}
.pill {
  font-size: 0.9rem;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--soft);
  cursor: pointer;
}
#tip {
  position: fixed;
  pointer-events: none;
  z-index: 10;
  background: var(--fg);
  color: var(--bg);
  font-size: 0.8rem;
  line-height: 1.5;
  padding: 8px 10px;
  border-radius: 8px;
  max-width: 260px;
  opacity: 0;
  transition: opacity 0.1s;
}

/* dials */
.dial h3 {
  margin: 0 0 4px;
  font-size: 1.05rem;
}
.formula {
  font-size: 0.9rem;
  background: var(--soft);
  border-radius: 10px;
  padding: 10px 12px;
  margin: 12px 0;
  overflow-x: auto;
  white-space: nowrap;
}
.formula b {
  color: var(--fg);
}
.sliders {
  display: grid;
  gap: 12px;
  margin: 14px 0;
}
.sl label {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.86rem;
}
.sl label span:last-child {
  font-weight: 700;
}
.sl .hint {
  font-size: 0.75rem;
  color: var(--muted);
}
input[type="range"] {
  width: 100%;
  accent-color: var(--b);
  margin: 4px 0 0;
}
.result {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin: 10px 0;
}
.result .val {
  font-size: 2.4rem;
  font-weight: 800;
  line-height: 1.1;
}
.result .side {
  font-size: 0.85rem;
  color: var(--sub);
}
.gauge2 {
  position: relative;
  height: 34px;
  margin: 6px 0 4px;
}
.gauge2 .base {
  position: absolute;
  top: 14px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--line);
}
.gauge2 .seg {
  position: absolute;
  top: 11px;
  height: 8px;
  border-radius: 4px;
  background: var(--b);
  opacity: 0.3;
}
.gauge2 .mk {
  position: absolute;
  top: 7px;
  width: 16px;
  height: 16px;
  margin-left: -8px;
  border-radius: 50%;
  background: var(--b);
  box-shadow: 0 0 0 2px var(--card);
  transition: left 0.15s;
}
.gauge2 .ref {
  position: absolute;
  top: 4px;
  width: 2px;
  height: 22px;
  margin-left: -1px;
  background: var(--fg);
}
.gauge2 .ref span {
  position: absolute;
  top: 22px;
  transform: translateX(-50%);
  font-size: 0.7rem;
  color: var(--sub);
  white-space: nowrap;
}
.seg-ctl {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
}
.seg-ctl button {
  border: 0;
  background: transparent;
  padding: 8px 14px;
  white-space: nowrap;
  cursor: pointer;
  font-size: 0.86rem;
}
.seg-ctl button[aria-pressed="true"] {
  background: var(--fg);
  color: var(--bg);
}
.switches {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin: 14px 0 6px;
  font-size: 0.88rem;
}
.switches label {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}
.switches input {
  width: 18px;
  height: 18px;
  accent-color: var(--fg);
}
.stackbar {
  display: flex;
  gap: 2px;
  height: 30px;
  margin: 8px 0 4px;
}
.stackbar i {
  display: block;
  height: 100%;
  background: var(--k);
  transition: width 0.2s;
}
.stackbar i:first-child {
  border-radius: 4px 0 0 4px;
}
.stackbar i:last-child {
  border-radius: 0 4px 4px 0;
}
.stackbar i.gone {
  background: repeating-linear-gradient(
    45deg,
    var(--line) 0 4px,
    transparent 4px 8px
  );
}
.dial-note {
  font-size: 0.85rem;
  color: var(--sub);
  min-height: 3em;
  margin: 8px 0 0;
}

/* guess */
.guess .gv {
  font-size: 2rem;
  font-weight: 800;
  text-align: center;
}
.guess .go {
  display: block;
  margin: 14px auto 0;
}
.guess .answer .row {
  display: grid;
  grid-template-columns: 11em 1fr;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  margin: 6px 0;
}
.guess .answer .row .bar {
  height: 16px;
  border-radius: 0 4px 4px 0;
  background: var(--k);
}
.guess .answer .row .bar span {
  display: block;
  padding-left: calc(100% + 6px);
  white-space: nowrap;
  line-height: 16px;
  font-size: 0.78rem;
}
.guess.done .go,
.guess.done input,
.guess.done label {
  display: none;
}
.guess.done .answer {
  display: block;
}

/* search */
.search input[type="search"] {
  width: 100%;
  font: inherit;
  font-size: 1rem;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--soft);
  color: var(--fg);
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 4px;
}
.chips button {
  font-size: 0.8rem;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  cursor: pointer;
}
.hits {
  margin-top: 12px;
}
.hit {
  display: grid;
  grid-template-columns: 3.4em 1fr auto;
  gap: 2px 12px;
  align-items: baseline;
  padding: 10px 0;
  border-top: 1px dotted var(--line);
}
.hit .rk {
  color: var(--muted);
  font-size: 0.8rem;
  text-align: right;
}
.hit .nm {
  font-weight: 600;
}
.hit .v {
  font-weight: 700;
  white-space: nowrap;
}
.hit .meta {
  grid-column: 2 / 4;
  font-size: 0.78rem;
  color: var(--sub);
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  align-items: center;
}
.hit .meta .k::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--k);
  margin-right: 5px;
}
.count {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 8px;
}

@media (max-width: 560px) {
  .guess .answer .row {
    grid-template-columns: 8em 1fr;
  }
}
