.comfort-dialog {
  color-scheme: dark;
  width: min(440px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  margin: auto;
  padding: 0;
  overflow: hidden;
  border: 1px solid #aa725b;
  border-radius: 10px;
  background: #24273c;
  color: #f3e9e2;
  font: 14px/1.65 var(--font);
}
.comfort-dialog[open] {
  display: flex;
  flex-direction: column;
}
.comfort-dialog::backdrop {
  background: #090c18cb;
}
.comfort-dialog * {
  box-sizing: border-box;
}
.comfort-dialog button {
  font: inherit;
  min-height: 44px;
  padding: 9px 13px;
  border: 1px solid #48455e;
  border-radius: 6px;
  color: #f3e9e2;
  background: #303247;
  cursor: pointer;
}
.comfort-dialog button:hover {
  border-color: #f0bd9f;
}
.comfort-dialog :focus-visible {
  outline: 3px solid #f4ce82;
  outline-offset: 3px;
}
.comfort-dialog .primary {
  background: #d97757;
  color: #17131a;
  border-color: #d97757;
  font-weight: 700;
}
.comfort-dialog .panel-header {
  padding: 20px 22px 0;
  flex: none;
}
.comfort-dialog .title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.comfort-dialog h2 {
  font-size: 22px;
  line-height: 1.3;
  margin: 0;
  color: #f0bd9f;
}
.comfort-dialog .title-row button {
  width: 40px;
  font-size: 23px;
  border-color: transparent;
  background: transparent;
  padding: 0;
}
.comfort-dialog nav {
  display: flex;
  gap: 4px;
  background: #171c2e;
  border: 1px solid #48455e;
  border-radius: 7px;
  padding: 4px;
  margin: 15px 0 0;
}
.comfort-dialog nav button {
  flex: 1;
  background: transparent;
  border-color: transparent;
  font-size: 13px;
  min-height: 36px;
  padding: 6px;
}
.comfort-dialog nav button[aria-pressed="true"] {
  background: #403443;
  color: #f0bd9f;
  border-color: #805c57;
}
.comfort-dialog .panel-content {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0 22px 14px;
}
.comfort-dialog .scope {
  font-size: 11px;
  color: #c1b7cc;
  margin: 18px 0 14px;
}
.comfort-dialog fieldset {
  border: 0;
  margin: 0;
  padding: 0;
}
.comfort-dialog legend {
  font-size: 15px;
  font-weight: 650;
  margin-bottom: 10px;
}
.comfort-dialog .segmented {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 7px;
}
.comfort-dialog .segmented label {
  position: relative;
  cursor: pointer;
  min-width: 0;
}
.comfort-dialog .segmented input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}
.comfort-dialog .segmented span {
  display: block;
  text-align: center;
  padding: 10px 4px;
  border: 1px solid #777086;
  border-radius: 6px;
  font-size: 13px;
  min-height: 44px;
}
.comfort-dialog .segmented input:checked + span {
  border-color: #d97757;
  background: #493440;
  color: #ffd6bf;
  box-shadow: inset 0 0 0 1px #d97757;
}
.comfort-dialog .segmented input:focus-visible + span {
  outline: 3px solid #f4ce82;
  outline-offset: 3px;
}
.comfort-dialog .effective {
  font-size: 13px;
  color: #f0bd9f;
  margin: 12px 0 4px;
}
.comfort-dialog .muted {
  font-size: 12px;
  line-height: 1.6;
  color: #c1b7cc;
}
.comfort-dialog .setting-row {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid #48455e;
  padding: 14px 0;
}
.comfort-dialog .setting-row > div {
  min-width: 0;
}
.comfort-dialog .setting-row label {
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.comfort-dialog .setting-row p {
  font-size: 12px;
  color: #c1b7cc;
  margin: 2px 0 0;
}
.comfort-dialog .switch-hit {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  flex: none;
}
.comfort-dialog .setting-row input {
  appearance: none;
  width: 44px;
  height: 26px;
  margin: 0;
  position: relative;
  border-radius: 20px;
  border: 1px solid #868096;
  background: #4b4859;
  cursor: pointer;
}
.comfort-dialog .setting-row input::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #eee4df;
  left: 3px;
  top: 3px;
}
.comfort-dialog .setting-row input:checked {
  background: #d97757;
  border-color: #d97757;
}
.comfort-dialog .setting-row input:checked::after {
  left: 21px;
  background: #1a1b2e;
}
.comfort-dialog .setting-row input:disabled {
  opacity: 0.5;
  cursor: default;
}
.comfort-dialog .preview {
  padding: 14px;
  background: #1a1b2e;
  border: 1px solid #48455e;
  border-radius: 7px;
}
.comfort-dialog .preview > div:first-child {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.comfort-dialog .preview b {
  font-size: 12px;
}
.comfort-dialog .preview > div > span {
  font-size: 11px;
  color: #c1b7cc;
}
#comfort-preview-stage {
  height: 86px;
  position: relative;
  display: flex;
  gap: 20px;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.comfort-dialog canvas {
  width: 70px;
  height: 55px;
}
.comfort-dialog .merge-label {
  font-size: 15px !important;
  color: #f0bd9f !important;
  font-weight: 700;
}
.comfort-dialog .particle {
  display: none;
  position: absolute;
  font-size: 28px !important;
  color: #ffc98f !important;
}
.comfort-dialog .p1 {
  left: 22%;
  top: 13%;
}
.comfort-dialog .p2 {
  left: 45%;
  top: 5%;
}
.comfort-dialog .p3 {
  left: 27%;
  top: 67%;
}
.comfort-dialog .preview button {
  width: 100%;
  min-height: 36px;
  font-size: 12px;
}
.comfort-dialog .preview p {
  font-size: 11px;
  margin: 8px 0 0;
}
.comfort-dialog .footnote {
  margin: 14px 0;
}
.comfort-dialog .storage-note {
  font-size: 12px;
  border-top: 1px solid #48455e;
  padding-top: 12px;
  color: #c1b7cc;
}
.comfort-dialog .storage-note.error {
  background: #49313a;
  border: 1px solid #b4775f;
  border-radius: 5px;
  padding: 10px;
  color: #f5cbb8;
}
.comfort-dialog .storage-note button {
  display: block;
  font-size: 12px;
  min-height: 34px;
  margin-top: 8px;
}
.comfort-dialog .reset-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 6px;
}
.comfort-dialog .text-button {
  background: none;
  border-color: transparent;
  color: #f0bd9f;
  padding: 8px 0;
  font-size: 12px;
}
.comfort-dialog .panel-footer {
  padding: 12px 22px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  border-top: 1px solid #48455e;
  background: #24273c;
  flex: none;
}
.comfort-dialog .panel-footer span {
  font-size: 10px;
  color: #c1b7cc;
  max-width: 150px;
}
.comfort-dialog .panel-footer button {
  font-size: 13px;
  white-space: nowrap;
}
#comfort-rules {
  padding-top: 16px;
}
#comfort-rules p {
  font-size: 14px;
}
#comfort-rules > button {
  width: 100%;
  margin: 15px 0;
}
.comfort-dialog h3 {
  font-size: 18px;
  margin: 0 0 12px;
}
.comfort-dialog [hidden] {
  display: none !important;
}
.comfort-dialog .preview-animate.shake {
  animation: comfort-shake 0.3s ease-out;
}
.comfort-dialog .preview-animate.dust .particle {
  display: block;
  animation: comfort-dust 0.6s ease-out both;
}
.comfort-dialog .preview-animate.pop .merge-label {
  animation: comfort-pop 0.5s ease-out;
}
@keyframes comfort-shake {
  25% {
    transform: translateX(2px);
  }
  75% {
    transform: translateX(-2px);
  }
}
@keyframes comfort-dust {
  from {
    opacity: 1;
    transform: translateY(2px);
  }
  to {
    opacity: 0;
    transform: translateY(-9px);
  }
}
@keyframes comfort-pop {
  from {
    opacity: 0.4;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
body.comfort-reduced *,
body.comfort-reduced *::before,
body.comfort-reduced *::after {
  animation: none !important;
  transition: none !important;
  scroll-behavior: auto !important;
}
@media (max-width: 370px) {
  .comfort-dialog .panel-header {
    padding: 14px 16px 0;
  }
  .comfort-dialog .panel-content {
    padding: 0 16px 10px;
  }
  .comfort-dialog .panel-footer {
    padding: 10px 16px;
  }
  .comfort-dialog .panel-footer span {
    max-width: 110px;
  }
  .comfort-dialog .panel-footer button {
    font-size: 12px;
  }
  .comfort-dialog .setting-row {
    padding: 12px 0;
  }
}
