.dr-dialog {
  --dr-ink: #15222c;
  --dr-paper: #fbf5e8;
  --dr-muted: #625d51;
  --dr-gold: #d4ad72;
  --dr-rule: #d9d0be;
  position: fixed;
  inset: 0;
  width: min(690px, calc(100vw - 40px));
  max-width: none;
  max-height: min(90dvh, 960px);
  margin: auto;
  padding: 0;
  overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid #d7c49e;
  border-radius: 14px;
  color: var(--dr-ink);
  background: var(--dr-paper);
  color-scheme: light;
  box-shadow: 0 25px 110px #070e17a3;
  text-align: left;
  font: 400 16px/1.55 "DM Sans", Arial, sans-serif;
  scrollbar-color: #b9aa8c var(--dr-paper);
}
.dr-dialog:not([open]), .dr-dialog [hidden] { display: none !important; }
.dr-dialog::backdrop { background: rgba(10, 18, 28, .79); backdrop-filter: blur(5px); }
.dr-dialog *, .dr-dialog *::before, .dr-dialog *::after { box-sizing: border-box; }
.dr-dialog :is(h2, h3, p, ul) { margin: 0; }
.dr-dialog button, .dr-dialog input, .dr-dialog select { font: inherit; }
.dr-dialog button { cursor: pointer; }
.dr-dialog [tabindex="-1"]:focus { outline: none; }
.dr-dialog :is(button, input, select, summary):focus-visible { outline: 3px solid #987345; outline-offset: 3px; }
.dr-dialog input[aria-invalid="true"], .dr-dialog select[aria-invalid="true"] { border-color: #af473c; }
.dr-shell { padding: 22px clamp(22px, 6vw, 52px) 36px; }
.dr-top { display: flex; justify-content: space-between; align-items: center; padding-bottom: 14px; border-bottom: 1px solid var(--dr-rule); }
.dr-sign { display: inline-flex; align-items: center; gap: 6px; color: #233a38; font: 600 1.63rem/1 "Cormorant Garamond", Georgia, serif; letter-spacing: -.045em; }
.dr-sign img { filter: brightness(.49); margin-right: 2px; }
.dr-sign small { align-self: flex-end; margin-bottom: 4px; font: 650 .67rem/1 "DM Sans", Arial, sans-serif; letter-spacing: .16em; text-transform: uppercase; }
.dr-close { display: inline-grid; place-items: center; width: 37px; height: 37px; padding: 0; border: 1px solid #cfc5b1; border-radius: 50%; background: transparent; color: var(--dr-ink); }
.dr-close:hover { background: #eee5d6; }
.dr-icon { width: 19px; height: 19px; flex: none; }
.dr-intro { margin: 27px 0 23px; }
.dr-kicker { display: block; color: #755431; font-size: .68rem; line-height: 1.5; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.dr-dialog h2, .dr-dialog h3 { color: inherit; font: 500 clamp(2.75rem, 6.1vw, 4rem)/.97 "Cormorant Garamond", Georgia, serif; letter-spacing: -.04em; }
.dr-dialog h2 { margin: 7px 0 12px; overflow-wrap: anywhere; }
.dr-intro > p, .dr-reading section > p { color: var(--dr-muted); font-size: .93rem; line-height: 1.62; }
.dr-form { display: grid; gap: 20px; }
.dr-field { position: relative; display: flex; flex-direction: column; align-items: stretch; gap: 7px; color: var(--dr-ink); font-size: .84rem; font-weight: 650; }
.dr-field > span:first-child small { margin-left: 5px; color: var(--dr-muted); font-size: .73rem; font-weight: 400; }
.dr-field :is(input[type="text"], select) {
  appearance: auto;
  display: block; width: 100%; min-width: 0; min-height: 45px; margin: 0; padding: 9px 11px;
  border: 1px solid #bcb29e; border-radius: 5px; color: var(--dr-ink); background: #fffaf1;
  font-family: "DM Sans", Arial, sans-serif; font-size: 1rem; font-weight: 400; line-height: 1.4;
}
.dr-field input::placeholder { color: #767267; opacity: 1; }
.dr-field input:disabled { background: #e9e3d8; border-color: #d6cfbf; color: #746d60; cursor: not-allowed; }
.dr-two { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 16px; align-items: start; }
.dr-clock {
  display: grid; grid-template-columns: minmax(0,1fr) auto minmax(0,1fr) auto;
  align-items: center; gap: 4px; min-width: 0; padding: 0; margin: 0; border: none;
}
.dr-clock input[type="text"] { padding-inline: 3px; text-align: center; font-variant-numeric: tabular-nums; }
.dr-period { display: flex; margin-left: 3px; }
.dr-period label { position: relative; }
.dr-period input {
  position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer;
}
.dr-period span {
  display: grid; place-items: center; min-width: 45px; min-height: 46px; padding-inline: 5px;
  border: 1px solid #bcb29e; color: var(--dr-ink); font-size: .85rem; font-weight: 600;
}
.dr-period label:first-child span { border-radius: 6px 0 0 6px; }
.dr-period label:last-child span { border-radius: 0 6px 6px 0; border-left: 0; }
.dr-period input:checked + span { background: var(--dr-ink); border-color: var(--dr-ink); color: var(--dr-paper); }
.dr-period input:focus-visible + span { outline: 3px solid #987345; outline-offset: 2px; }
.dr-period input[aria-invalid="true"] + span { border-color: #af473c; }
.dr-clock:disabled .dr-period { opacity: .45; }
.dr-clock:disabled .dr-period input { cursor: not-allowed; }
.dr-check { display: inline-flex; align-items: center; gap: 6px; width: fit-content; min-height: 26px; color: var(--dr-muted); font-size: .79rem; font-weight: 400; cursor: pointer; }
.dr-check input { width: 16px; height: 16px; margin: 0; accent-color: #2b4844; }
.dr-location { min-width: 0; }
.dr-dialog .dr-hint, .dr-private, .dr-preview small { display: block; color: var(--dr-muted); font-size: .77rem; line-height: 1.52; font-weight: 400; }
.dr-dialog .dr-text { display: inline-block; padding: 4px 0; border: none; border-radius: 0; background: transparent; color: #644829; font-size: .82rem; font-weight: 650; line-height: 1.55; text-decoration: underline; text-decoration-color: #baa787; text-underline-offset: 4px; }
.dr-dialog .dr-text:hover { color: #251e16; text-decoration-color: currentColor; }
.dr-location > .dr-text { margin-top: 4px; }
.dr-suggestions { position: absolute; z-index: 4; left: 0; right: 0; top: 73px; max-height: 216px; overflow-y: auto; background: #fffaf1; border: 1px solid #a59983; border-radius: 5px; box-shadow: 0 8px 20px #17202826; }
.dr-suggestions [role="option"] { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 2px 12px; padding: 8px 12px; border-bottom: 1px solid #e8dece; cursor: pointer; }
.dr-suggestions [role="option"]:hover, .dr-suggestions [aria-selected="true"] { background: #e9e3d3; }
.dr-suggestions [role="option"] small { color: var(--dr-muted); font-weight: 400; overflow-wrap: anywhere; }
.dr-topics { display: inline-flex; flex-wrap: wrap; gap: 7px; }
.dr-topics button { min-width: 65px; min-height: 38px; padding: 5px 15px; border: 1px solid #bfb49f; border-radius: 22px; background: transparent; color: #524d43; font-size: .85rem; font-weight: 550; }
.dr-topics button:hover { border-color: #695a44; }
.dr-topics button[aria-pressed="true"] { color: var(--dr-paper); background: #24343a; border-color: #24343a; }
.dr-error, .dr-dialog p.dr-boundary { border-left: 3px solid #a96444; border-radius: 2px; padding: 9px 12px; background: #f4e7d5; color: #703527; font-size: .85rem; }
.dr-primary { display: flex; justify-content: center; align-items: center; gap: 12px; width: 100%; min-height: 50px; padding: 12px 18px; background: var(--dr-ink); color: #fff6e6; border: 1px solid var(--dr-ink); border-radius: 6px; font-weight: 600 !important; }
.dr-primary:hover { background: #2b424b; }
.dr-form .dr-private { margin-top: -10px; text-align: center; }
.dr-results-intro { margin-bottom: 20px; }
.dr-meta { overflow-wrap: anywhere; }
.dr-master { display: grid; grid-template-columns: 74px minmax(0,1fr); gap: 17px; align-items: start; padding: 23px; border-radius: 8px; background: #1a2a32; color: var(--dr-paper); }
.dr-seal { display: grid; place-items: center; width: 74px; height: 81px; color: #dfc18d; border: 1px solid #8f7855; border-radius: 50% 50% 4px 4px; font: 500 2.8rem/1 Georgia, "Noto Serif CJK SC", serif; }
.dr-master .dr-kicker { color: #e0c499; }
.dr-dialog .dr-master h3 { margin: 5px 0 8px; font-size: 2.35rem; }
.dr-master p { font-size: .9rem; line-height: 1.6; color: #e7e1d4; }
.dr-section { padding: 23px 0 20px; border-bottom: 1px solid var(--dr-rule); }
.dr-dialog .dr-section h3, .dr-dialog .dr-preview h3 { margin-bottom: 6px; font-size: clamp(1.9rem,5vw,2.4rem); line-height: 1.05; }
.dr-pillars { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); margin: 13px 0 7px; border-top: 1px solid #c7baa4; border-bottom: 1px solid #c7baa4; }
.dr-pillar { display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 3px; padding: 11px 2px; border-right: 1px solid var(--dr-rule); text-align: center; }
.dr-pillar:last-child { border-right: none; }
.dr-pillar-day { background: #eee4d1; }
.dr-pillar > span { color: #6b604e; font-size: .68rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; }
.dr-pillar strong { font: 500 clamp(1.5rem,4.5vw,2.25rem)/1.22 Georgia, "Noto Serif CJK SC", serif; }
.dr-pillar small { color: #514b40; font-size: .8rem; }
.dr-pillar em { font-size: .65rem; line-height: 1.25; color: var(--dr-muted); font-style: normal; }
.dr-details { margin-top: 10px; color: var(--dr-muted); font-size: .78rem; }
.dr-details summary { width: fit-content; padding: 5px 0; color: #604c34; font-weight: 600; cursor: pointer; }
.dr-details > div { padding: 7px 0; }
.dr-details ul { padding-left: 18px; }
.dr-details li { margin: 3px 0; }
.dr-elements { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); margin: 13px 0 7px; gap: 5px; }
.dr-element { display: flex; flex-direction: column; gap: 2px; align-items: center; padding: 8px 2px; background: #f1ebde; border-radius: 3px; color: var(--dr-ink); }
.dr-element { border-top: 2px solid var(--el-c); }
.dr-element span { font-size: .69rem; }
.dr-element strong { font-size: .85rem; }
.dr-e-wood { --el-c: #3c6552; } .dr-e-fire { --el-c: #a04c37; } .dr-e-earth { --el-c: #88642f; } .dr-e-metal { --el-c: #65656b; } .dr-e-water { --el-c: #3a607b; }
.dr-chapter .dr-topics { margin: 9px 0 15px; }
.dr-reading .dr-chapter .dr-question { margin: 10px 0 7px; font-weight: 600; color: var(--dr-ink); }
.dr-reading .dr-outlook .dr-hint { margin: 5px 0 8px; overflow-wrap: anywhere; color: #755431; }
.dr-more { margin-top: 12px; }
.dr-more span { display: inline-block; margin-left: 4px; }
#dr-extra p { margin-top: 9px; color: var(--dr-muted); font-size: .9rem; }
.dr-preview { margin: 21px 0 13px; padding: 17px 19px; border-left: 3px solid #ac8753; background: #f1e8d7; }
.dr-preview h3 { margin-top: 6px; }
.dr-preview small { margin-top: 8px; }
.dr-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 22px; margin-top: 15px; }
.dr-secondary { min-height: 40px; padding: 7px 13px; border: 1px solid #a0937b; border-radius: 5px; background: transparent; color: var(--dr-ink); font-size: .87rem !important; }
.dr-secondary:hover { background: #eee5d4; }
.dr-part, .dr-form-actions { display: contents; }
.dr-mobile-progress, .dr-step-back, .dr-next-label, .dr-place-copy { display: none; }
.dr-jumps { display: flex; margin: 0 0 17px; border-block: 1px solid var(--dr-rule); }
.dr-jumps button { flex: 1; min-height: 46px; padding: 3px; border: 0; background: transparent; font-size: .82rem; font-weight: 600; line-height: 1.25; color: #645236; }
.dr-jumps button + button { border-left: 1px solid var(--dr-rule); }
.dr-jumps button:hover { background: #f0eadb; }

@media (max-width: 750px) {
  .dr-dialog {
    width: 100%; height: 100%; height: 100dvh; max-height: none; max-width: none;
    margin: 0; border: 0; border-radius: 0; scroll-padding-block: 14px;
  }
  .dr-shell {
    max-width: 550px; margin-inline: auto;
    padding: max(9px, env(safe-area-inset-top)) clamp(17px, 5.8vw, 30px) max(28px, env(safe-area-inset-bottom));
  }
  .dr-top { padding-bottom: 8px; }
  .dr-close { width: 44px; height: 44px; }
  .dr-intro { margin: 24px 0 20px; }
  .dr-intro h2 { font-size: clamp(2.6rem, 12vw, 4rem); }
  .dr-shell:has([data-step="2"]) .dr-birth-copy { display: none; }
  .dr-shell:has([data-step="2"]) .dr-place-copy { display: block; }
  .dr-mobile-progress { display: grid; gap: 8px; color: #705637; font-size: .75rem; font-weight: 650; }
  .dr-track { height: 3px; border-radius: 3px; background: linear-gradient(to right, #87693b 0 49%, transparent 49% 51%, #dcd1bc 51%); }
  [data-step="2"] .dr-track { background: linear-gradient(to right, #87693b 0 49%, transparent 49% 51%, #87693b 51%); }
  .dr-form { gap: 17px; }
  .dr-two { grid-template-columns: 1fr; gap: 16px; }
  .dr-check { min-height: 44px; }
  .dr-form-actions { display: flex; align-items: stretch; gap: 10px; }
  .dr-step-back { min-width: 68px; }
  .dr-form[data-step="1"] .dr-next-label, .dr-form[data-step="2"] .dr-step-back { display: inline; }
  .dr-form[data-step="1"] :is([data-part="2"], .dr-read-label), .dr-form[data-step="2"] [data-part="1"] { display: none; }
  .dr-field :is(input[type="text"], select), .dr-period span { min-height: 48px; }
  .dr-dialog .dr-text, .dr-topics button, .dr-details summary, .dr-secondary { min-height: 44px; }
  .dr-suggestions [role="option"] { min-height: 46px; }
  .dr-suggestions { position: static; margin-top: -3px; max-height: min(220px, 42dvh); }
}
@media (max-width: 520px) {
  .dr-master { grid-template-columns: 49px minmax(0,1fr); gap: 11px; padding: 16px 13px; }
  .dr-seal { width: 49px; height: 58px; font-size: 2.05rem; }
  .dr-pillars .dr-pillar em { font-size: .6rem; }
}
@media (max-width: 355px) {
  .dr-two { grid-template-columns: 1fr; }
  .dr-shell { padding-inline: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  .dr-dialog *, .dr-dialog *::before, .dr-dialog *::after { scroll-behavior: auto !important; }
}
