.dj-page {
  --dj-text: #19313d;
  --dj-muted: #4b5e69;
  --dj-accent: #08685e;
  --dj-line: #cbdad8;
  --dj-tint: #edf6f3;
  color: var(--dj-text);
}

.dj-page [hidden] { display: none !important; }

.dj-page :focus-visible {
  outline: 3px solid #155cb0;
  outline-offset: 3px;
}

.dj-page .dj-guide a,
.dj-page .dj-tool a,
.dj-breadcrumb a { text-decoration: underline; text-underline-offset: .2em; }
.dj-page .dj-phone { font-weight: 700; }

.dj-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: .25em .5em;
  margin-bottom: 1.1rem;
  font-size: .88rem;
  color: var(--dj-muted);
}

.dj-tool {
  margin: 1.5rem 0 2.5rem;
  border: 1px solid var(--dj-line);
  border-radius: 16px;
  background: #fff;
  overflow-wrap: anywhere;
}

.dj-first-aid,
.dj-live-warning {
  padding: 1rem clamp(1rem, 4vw, 1.5rem);
  color: #632a15;
  background: #fff3e9;
}

.dj-first-aid { border-radius: 15px 15px 0 0; }
.dj-live-warning { border-top: 1px solid #e6cbb9; }
.dj-live-warning:empty { padding: 0; border: 0; }
.dj-live-warning[data-level="emergency"] { color: #781d27; background: #ffedee; }
.dj-first-aid p,
.dj-live-warning p { margin: .35rem 0; }
.dj-first-aid a,
.dj-live-warning a { color: inherit; }
.dj-first-aid strong,
.dj-live-warning strong { color: inherit; font-weight: 750; }

.dj-stage { padding: 1.25rem clamp(1rem, 4vw, 1.5rem); }
.dj-page .dj-stage h2 { margin: .35rem 0 .75rem; font-size: clamp(1.27rem, 3.4vw, 1.65rem); font-weight: 700; line-height: 1.4; }
.dj-page .dj-stage h3 { margin: 1.15rem 0 .65rem; font-size: 1.13rem; font-weight: 700; }
.dj-page .dj-stage p { margin: .5rem 0 1rem; }
.dj-page .dj-note { color: var(--dj-muted); font-size: .92rem; }
.dj-page #dj-intro > .dj-note { margin: .8rem 0 0; }
.dj-page .dj-kicker { color: var(--dj-accent); font-size: .88rem; font-weight: 700; }

.dj-progress-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: .25rem 1rem;
  font-weight: 700;
}

.dj-progress-meta + progress {
  display: block;
  width: 100%;
  height: .65rem;
  margin-top: .5rem;
  accent-color: var(--dj-accent);
}

.dj-stage fieldset { min-width: 0; margin: 0 0 1rem; padding: 0; border: 0; }
.dj-stage legend { margin: .25rem 0 .5rem; padding: 0; font-weight: 700; }

.dj-choices {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .55rem;
}

.dj-page .dj-choices label {
  display: flex;
  align-items: center;
  gap: .55rem;
  min-height: 48px;
  margin: 0;
  padding: .5rem .75rem;
  border: 1px solid var(--dj-line);
  border-radius: 8px;
  background: #fff;
  color: var(--dj-text);
  font-size: .98rem;
  line-height: 1.4;
  cursor: pointer;
}

.dj-page .dj-choices input {
  appearance: auto;
  position: static;
  flex: 0 0 auto;
  width: 1.15rem;
  height: 1.15rem;
  margin: 0;
  opacity: 1;
  accent-color: var(--dj-accent);
}

.dj-choices label:has(input:checked) { border-color: var(--dj-accent); background: var(--dj-tint); }
.dj-checks { grid-template-columns: repeat(auto-fit, minmax(min(100%, 10rem), 1fr)); }
.dj-warning-question { padding-top: .75rem; }
.dj-warning-question .dj-inline-warning { grid-column: 1 / -1; margin: 0; color: #781d27; }
.dj-context-pair,
.dj-summary,
.dj-counts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .65rem;
  margin: 0 0 1rem;
}

.dj-page :is(.dj-context-pair, .dj-habits) label { margin-bottom: .3rem; font-size: .95rem; }
.dj-page .dj-stage select { min-height: 44px; height: auto; padding-block: .45rem; font-size: 1rem; line-height: 1.4; }
.dj-habits > div + div { margin-top: .65rem; }

.dj-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
  margin-top: 1rem;
}

.dj-page .dj-tool button {
  min-height: 44px;
  width: auto;
  max-width: 100%;
  height: auto;
  padding: .55rem .95rem;
  border: 1px solid var(--dj-line);
  border-radius: 8px;
  background: #fff;
  color: var(--dj-text) !important;
  font: inherit;
  font-weight: 700;
  line-height: 1.4;
  text-transform: none;
  letter-spacing: normal;
  white-space: normal;
  transition: none;
}

.dj-page .dj-tool button.dj-primary { background: var(--dj-accent); border-color: var(--dj-accent); color: #fff !important; }
.dj-page .dj-tool button.dj-primary:hover:not(:disabled) { background: #06554d; }
.dj-page .dj-tool button:hover:not(:disabled):not(.dj-primary) { background: var(--dj-tint); }
.dj-page .dj-tool button:disabled { background: #e6eeee; border-color: var(--dj-line); color: #52646c !important; cursor: default; }
.dj-reset { padding: 0 clamp(1rem, 4vw, 1.5rem) 1.15rem; }

.dj-summary > div,
.dj-counts > div {
  padding: .65rem .85rem;
  border: 1px solid var(--dj-line);
  border-radius: 8px;
  background: #f9fbfa;
}

.dj-summary strong { display: block; color: var(--dj-accent); font-size: 1.5rem; }
.dj-page dd { margin: 0; }
.dj-counts dt { color: var(--dj-muted); font-size: .9rem; }
.dj-counts dd { font-weight: 700; }
.dj-pattern > div, .dj-compare > div { padding: .6rem 0; border-bottom: 1px solid var(--dj-line); }
.dj-pattern dt, .dj-compare dt { font-weight: 700; }
.dj-groups details { margin: .45rem 0; padding: .3rem .75rem; border: 1px solid var(--dj-line); border-radius: 8px; }
.dj-groups summary { display: list-item; min-height: 44px; padding-block: .45rem; font-weight: 700; cursor: pointer; }
.dj-groups ul, .dj-stage > ul { margin-bottom: .55rem; }
.dj-stage > ul:empty, .dj-stage #dj-copy-status:empty { display: none; }
.dj-page .dj-stage textarea { font-size: 1rem; }

.dj-guide { margin: 2.25rem 0; }
.dj-guide h2, .dj-guide h3 { font-weight: 700; }
.dj-guide h3 { margin: 1.1rem 0 .35rem; }
.dj-guide p { margin: .65rem 0; }
.dj-guide ul { margin: .65rem 0; }

@media (max-width: 450px) {
  .dj-choices:not(.dj-warning-question) { grid-template-columns: minmax(0, 1fr); }
  .dj-checks:not(.dj-warning-question) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dj-context-pair { grid-template-columns: minmax(0, 1fr); }
  .dj-actions button { flex: 1 1 auto; }
}

@media (prefers-reduced-motion: reduce) {
  .dj-page * { scroll-behavior: auto !important; transition: none !important; }
}
