#npc-dialogue {
  --npc-ink:#fffdf6;
  --npc-rule:rgb(241 237 219 / 31%);
  --npc-surface:rgb(17 25 22 / 50%);
  position:fixed;
  inset:auto max(17px,env(safe-area-inset-right)) max(86px,calc(env(safe-area-inset-bottom) + 72px),calc(var(--npc-keyboard,0px) + 8px)) auto;
  width:min(365px,calc(100vw - 26px));
  max-width:none;
  height:414px;
  max-height:min(calc(100dvh - 105px),calc(var(--npc-visible,100dvh) - 20px));
  margin:0;
  padding:0;
  overflow:hidden;
  border:1px solid var(--npc-rule);
  border-radius:17px;
  background:var(--npc-surface);
  color:var(--npc-ink);
  box-shadow:0 10px 32px #151b173d;
  backdrop-filter:blur(3px);
  -webkit-backdrop-filter:blur(3px);
  touch-action:pan-y;
}
#npc-dialogue[open] {display:flex;flex-direction:column}
#npc-dialogue::backdrop {background:#18241b20}
#npc-dialogue button,#npc-dialogue input {color:inherit;font:inherit}
#npc-dialogue button {cursor:pointer;touch-action:manipulation}
#npc-dialogue button:focus-visible,#npc-dialogue input:focus-visible {outline:2px solid #f5d89c;outline-offset:1px}
.npc-heading {
  display:flex;
  flex:none;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  padding:10px 10px 10px 15px;
  border-bottom:1px solid var(--npc-rule);
  background:rgb(16 22 20 / 33%);
}
#npc-role {margin:0 0 2px;color:#efebd8;font-size:.77rem;font-weight:560}
#npc-name {margin:0;font-size:1.19rem;line-height:1.2;outline:none}
#npc-dialogue .npc-close {
  align-self:center;
  width:42px;
  height:42px;
  border:0;
  border-radius:50%;
  background:transparent;
  font-size:1.55rem;
  line-height:1;
}
.npc-close:hover {background:#ffffff20!important}
.npc-scroll {
  flex:1;
  min-height:32px;
  padding:13px 14px;
  overflow:auto;
  overscroll-behavior:contain;
  touch-action:pan-y;
  user-select:text;
  -webkit-user-select:text;
}
.npc-messages {display:flex;flex-direction:column;gap:7px;list-style:none;padding:0;margin:0}
.npc-messages li {display:flex;align-items:flex-start;flex-direction:column}
.npc-messages p {
  max-width:94%;
  padding:7px 10px;
  margin:0;
  border-radius:2px 11px 11px;
  background:rgb(16 23 19 / 56%);
  font-size:.93rem;
  line-height:1.5;
  white-space:pre-wrap;
  overflow-wrap:anywhere;
  word-break:keep-all;
}
.npc-messages [data-speaker="user"] {align-items:flex-end}
.npc-messages [data-speaker="user"] p {border-radius:11px 2px 11px 11px;background:rgb(43 69 51 / 80%)}
.npc-controls {
  flex:none;
  padding:9px 12px 12px;
  border-top:1px solid var(--npc-rule);
  background:rgb(16 22 20 / 35%);
}
.npc-suggestions {display:flex;flex-wrap:wrap;gap:5px;margin-bottom:7px}
#npc-dialogue .npc-suggestions button {
  padding:5px 9px;
  min-height:33px;
  border:1px solid #e8e8ce68;
  border-radius:16px;
  background:rgb(21 32 24 / 47%);
  font-size:.81rem;
  line-height:1.3;
  text-align:left;
  overflow-wrap:anywhere;
}
#npc-dialogue .npc-suggestions button:hover {background:rgb(66 80 59 / 85%)}
.npc-status {margin:0 2px 6px;font-size:.82rem;color:#f8efd5}
.npc-status:empty,.npc-suggestions:empty {display:none}
.npc-form {display:grid;grid-template-columns:minmax(0,1fr) auto;gap:7px}
#npc-question,#npc-dialogue .npc-send {min-height:43px;border-radius:9px}
#npc-dialogue #npc-question {
  min-width:0;
  padding:6px 10px;
  border:1px solid #e1e3cc82;
  background:rgb(15 21 18 / 56%);
  font-size:16px;
  user-select:text;
  -webkit-user-select:text;
}
#npc-question::placeholder {color:#dfdfd1}
#npc-dialogue .npc-send {
  padding:5px 12px;
  border:1px solid #f2efda95;
  background:#ede9d8;
  color:#2c3b30;
  font-size:.9rem;
  font-weight:650;
}
#npc-dialogue .npc-send:disabled {color:#ecefdfb8;background:rgb(52 64 51 / 66%);border-color:#e6e5d345;cursor:default}
@media(max-width:510px) {
  #npc-dialogue {
    width:calc(100vw - 20px);
    right:10px;
    bottom:max(9px,env(safe-area-inset-bottom),calc(var(--npc-keyboard,0px) + 7px));
    height:min(407px,66dvh);
    max-height:calc(var(--npc-visible,100dvh) - 16px);
  }
}
@media(max-height:490px) {
  #npc-dialogue {bottom:max(8px,calc(var(--npc-keyboard,0px) + 5px));max-height:calc(var(--npc-visible,100dvh) - 14px)}
}
#npc-dialogue.npc-compact .npc-heading {padding-block:3px}
#npc-dialogue.npc-compact .npc-heading > div {display:flex;align-items:baseline;gap:8px}
#npc-dialogue.npc-compact .npc-controls {padding-block:6px}
#npc-dialogue.npc-compact .npc-suggestions {
  flex-wrap:nowrap;
  overflow:auto;
  scrollbar-width:thin;
  overscroll-behavior:contain;
  touch-action:pan-x;
}
#npc-dialogue.npc-compact .npc-suggestions button {flex:none}

#npc-chat-panel {display:flex;flex-direction:column;flex:1;min-height:0}
.npc-tabs {
  display:flex;flex:none;gap:4px;padding:4px 10px;
  border-bottom:1px solid var(--npc-rule);background:rgb(16 22 20 / 36%);
}
#npc-dialogue .npc-tabs button {
  min-height:35px;padding:4px 13px;border:1px solid transparent;border-radius:18px;
  color:#eeefdf;background:transparent;font:600 .86rem/1.25 system-ui,sans-serif;
}
#npc-dialogue .npc-tabs button[aria-selected=true] {background:#e9ebdb;color:#293d31}
#npc-quest-tab[data-ready=true]::after {content:"";display:inline-block;margin-left:6px;width:8px;height:8px;border-radius:50%;background:#d88f45}
#npc-quest-panel {
  flex:1;min-height:0;overflow:auto;overscroll-behavior:contain;
  padding:12px;touch-action:pan-y;scrollbar-width:thin;
}
.npc-quest-paper {
  color:#29382e;background:#f8f6eaf5;border:1px solid #cbc9b5;border-radius:11px;
  padding:14px 15px;overflow-wrap:anywhere;word-break:keep-all;
}
.npc-quest-status {margin:0 0 3px;font-size:.79rem;line-height:1.3;color:#46634c;font-weight:650}
.npc-quest-title {margin:0;font:700 1.2rem/1.35 system-ui,sans-serif}
.npc-quest-title:focus {outline:0}
.npc-quest-copy {margin:9px 0 12px;font-size:.94rem;line-height:1.52}
.npc-quest-steps {padding:10px 0;margin:0;list-style:none;border-block:1px dashed #c6cabb}
.npc-quest-steps li {position:relative;padding-left:22px;font-size:.87rem;line-height:1.45}
.npc-quest-steps li+li {margin-top:5px}
.npc-quest-steps li::before {content:"";position:absolute;left:0;top:.38em;width:10px;height:10px;border:1px solid #7c8673;border-radius:50%}
.npc-quest-steps [data-done=true]::before {content:"✓";top:.18em;width:14px;height:14px;line-height:13px;text-align:center;color:white;background:#42654c;border-color:#42654c;font-size:.68rem}
.npc-quest-reward {margin:9px 0;color:#505d50;font-size:.81rem;line-height:1.45}
#npc-dialogue .npc-quest-action {
  width:100%;min-height:42px;padding:7px 11px;border:1px solid #314d3a;border-radius:9px;
  color:#fffdf2;background:#35553e;font-size:.92rem;font-weight:670;
}
#npc-dialogue .npc-quest-action:hover {background:#284833}
#npc-dialogue .npc-quest-action:focus-visible {outline-color:#5e7959;outline-offset:2px}
#npc-quest-panel[data-status=completed] .npc-quest-status {color:#305d3d}
#npc-quest-panel[data-status=completed] .npc-quest-status::before {content:"✓";margin-right:5px}
#quest-journal {border-top:1px solid #c9c8bb;margin-top:5px}
#quest-journal summary {cursor:pointer;padding:10px 0;font-size:.84rem;font-weight:650}
#quest-journal summary:focus-visible {outline:2px solid #527450}
#map-panel:has(#quest-journal[open]) {width:min(298px,calc(100vw - 28px));padding:12px}
#map-panel:has(#quest-journal[open]) #map {max-height:min(11dvh,70px)}
#quest-journal[open] {text-align:left}
#quest-journal[open] summary {padding:9px 4px 3px}
.quest-stamp-count {margin:3px 4px 8px;color:#405b44;font-size:.87rem;font-weight:650}
.quest-list {list-style:none;padding:0;margin:0}
.quest-list li + li {border-top:1px solid #d4d7cb}
.quest-list .quest-person-button {
  display:grid;position:relative;width:100%;padding:8px 4px 8px 34px;min-height:48px;
  color:#293c2e;background:transparent;text-align:left;border:0;border-radius:6px;cursor:pointer;
}
.quest-list .quest-person-button:hover {background:#e8ecdf}
.quest-list strong {font:650 .92rem/1.4 system-ui,sans-serif}
#map-panel .quest-list small {margin:1px 0 0;color:#4d6050;font-size:.81rem;line-height:1.35}
#map-panel .quest-list .quest-list-next {color:#394c3b}
#map-panel .quest-list .quest-list-gift {color:#526143}
.quest-list .quest-person-button::before {
  content:"";position:absolute;left:3px;top:12px;width:21px;height:21px;
  border-radius:50%;border:1.5px dashed #87927e;
}
.quest-list [data-status=active] .quest-person-button::before {border:2px solid #5d7960}
.quest-list [data-status=ready] .quest-person-button::before {background:#d49a50;border:3px double #785a37}
.quest-list [data-status=completed] .quest-person-button::before {content:"✓";border:3px double #496c50;background:#e0e9dc;color:#385e40;text-align:center;line-height:16px;font-size:14px;font-weight:700}
#quest-notice {
  position:absolute;z-index:4;left:50%;top:max(110px,calc(env(safe-area-inset-top) + 99px));transform:translateX(-50%);
  width:max-content;max-width:min(440px,calc(100% - 36px));padding:8px 14px;margin:0;
  color:#fcf8e9;background:rgb(35 55 42 / 93%);border:1px solid #c9d9bc90;border-radius:14px;
  box-shadow:0 3px 12px #2228203a;font-size:.88rem;text-align:center;pointer-events:none;
}
#quest-notice:empty,#tour:has(dialog[open]) #quest-notice,#tour:has(#map-panel:not([hidden])) #quest-notice {display:none}
#npc-dialogue.npc-compact .npc-tabs {padding-block:1px}
#npc-dialogue.npc-compact .npc-tabs button {min-height:31px}
#npc-dialogue.npc-compact #npc-quest-panel {padding:6px 9px}
#npc-dialogue.npc-compact .npc-quest-paper {padding:10px 13px}
@media (max-height:360px) {
  #npc-dialogue.npc-compact #npc-chat-panel .npc-suggestions {display:none}
}

#npc-dialogue .npc-quest-gift, .quest-list .quest-gift-button {
  min-height:42px;padding:7px 11px;border:1px solid #53715b;border-radius:8px;
  color:#294331;background:#edf2e6;font:630 .85rem/1.35 system-ui,sans-serif;cursor:pointer;
}
#npc-dialogue .npc-quest-gift {display:block;width:100%;margin:0 0 8px}
.quest-list .quest-gift-button {margin:0 4px 8px 34px}
#npc-dialogue .npc-quest-gift[hidden],.quest-list .quest-gift-button[hidden] {display:none}
#npc-dialogue .npc-quest-gift:hover,.quest-list .quest-gift-button:hover {background:#dde9d9}
#npc-dialogue .npc-quest-gift:focus-visible,.quest-list button:focus-visible,#homebrew-card button:focus-visible {
  outline:2px solid #517451;outline-offset:2px;
}
.quest-reward-feedback {margin:3px 4px 0;color:#344e39;font-size:.83rem;line-height:1.4}
.quest-reward-feedback:empty {display:none}
#homebrew-card {
  box-sizing:border-box;position:fixed;inset:0;width:min(390px,calc(100vw - 24px));height:fit-content;
  max-height:calc(100dvh - 24px);margin:auto;padding:20px 23px;overflow:auto;overscroll-behavior:contain;
  border:1px solid #c0c3a7;border-radius:14px;background:#fbf8ed;color:#263c31;
  box-shadow:0 14px 48px #17231e4a;font:400 .94rem/1.6 system-ui,sans-serif;word-break:keep-all;
  touch-action:pan-y;user-select:text;
}
#homebrew-card::backdrop {background:#14231d73}
.brew-card-head {display:flex;align-items:center;justify-content:space-between;gap:8px}
.brew-card-head p {margin:0;color:#556b57;font-size:.8rem;font-weight:650}
.brew-card-head button {
  width:42px;height:42px;margin:-8px -10px 0 0;border:0;border-radius:50%;
  color:#364c3d;background:transparent;font:400 1.55rem/1 system-ui,sans-serif;cursor:pointer;
}
#homebrew-title {margin:4px 0 16px;font:650 1.65rem/1.3 Georgia,"Nanum Myeongjo",serif;letter-spacing:-.04em}
.brew-card-ratio {display:grid;grid-template-columns:repeat(3,1fr);margin:0;padding:10px 0;border-block:1px solid #b9c4ad}
.brew-card-ratio div {padding-inline:9px;text-align:center}
.brew-card-ratio div+div {border-inline-start:1px solid #d1d7c7}
.brew-card-ratio dt {color:#4a6050;font-size:.79rem}
.brew-card-ratio dd {margin:0;font-size:1.17rem;font-weight:700}
.brew-card-ratio dd small {font-size:.75rem;font-weight:530}
.brew-card-steps {margin:6px 0 0;padding:0;list-style:none}
.brew-card-steps li {padding:8px 0;border-bottom:1px solid #dce0cf}
.brew-card-steps strong {font-size:.86rem}
.brew-card-steps p {margin:2px 0 0}
.brew-card-tip {margin:12px 0 2px;color:#50604a;font-size:.86rem}
