/* The NPC dialog and the quest offer, after the owner's mockup (art/production/questoffer_mockup.webp, its ribbon
   close-up questoffer_ribbon.png; QUESTOFFER_BRIEF.md). Markup: src/questui/dialog.js; hosted in #questModal.
   Laid out at 1040x640 and scaled to the window by src/questui.js fitNpcDialog (--nd-scale); a window too small for
   that (a phone at 844x390) gets the compact layout (.nd-compact) at full size.
   - the frame: the shared window frame (panel_frame.webp as a nine-slice whose corner scrollwork stays in its corners)
   - left: the portrait in its scene, the name plate, the speech box and the menu (an icon, a label, a chevron per row)
   - right: the parchment, drawn in CSS (a warm paper gradient, a faint grain, a darker edge) until a painted panel exists
     (art ledger: ui/dialog/parchment), with dark ink; the ribbon plate, the tiles and the buttons are CSS too, never
     stretched art. The generic button rule (ui-layout.css) is outranked by #ui #questModal. */

#questUI #questModal.nd-open { display: block; padding: 0; background: radial-gradient(ellipse at 50% 50%, rgba(6, 4, 2, .38), rgba(4, 2, 1, .74)); }
/* While the dialog is open the quest layer sits above the HUD's own buttons (the phone's quest card and chat button). */
#questUI:has(> #questModal.nd-open) { z-index: 32; }
/* ...and the NPC's spoken line is in its speech box (src/questui.js showSpokenLine), so the floating subtitle, which
   would lie over the dialog, stays for screen readers only (as voice.css .voice-sr). */
#ui:has(#questModal.nd-open) #voiceSubtitle { position: fixed !important; width: 1px !important; height: 1px !important; padding: 0 !important; overflow: hidden !important; clip-path: inset(50%) !important; white-space: nowrap !important; backdrop-filter: none !important; }
.nd {
  --nd-ink: #2a1a0d; --nd-ink2: #5b4027; --nd-gold: #d9a74e; --nd-gold2: #f2cd7a; --nd-cream: #efe2c2;
  position: absolute; left: 50%; top: 50%; width: 1040px; height: 640px; box-sizing: border-box; transform: translate(-50%, -50%) scale(var(--nd-scale, 1)); transform-origin: 50% 50%;
  display: grid; grid-template-columns: 296px 12px minmax(0, 1fr); column-gap: 10px; padding: 12px 14px 14px;
  border: 22px solid transparent; border-image: url('assets/gen/ui/panel_frame.webp') 350 350 375 350 fill / 48px 48px 51px 48px stretch;
  background: linear-gradient(rgba(10, 7, 4, .6), rgba(8, 5, 3, .82)), url('assets/gen/ui/panel_bg.webp') 0 0 / 420px 420px;
  box-shadow: 0 26px 70px rgba(0, 0, 0, .78); color: var(--nd-cream); font: 17px/1.35 'EB Garamond', Georgia, serif; -webkit-font-smoothing: antialiased; pointer-events: auto;
}
.nd:focus { outline: none; }
/* The close medallion sits over the frame's top right corner, above everything. */
#ui #questModal .nd-close { position: absolute; z-index: 6; top: -19px; right: -19px; }

/* ---------------- left: the NPC ---------------- */
.nd-npc { display: flex; flex-direction: column; gap: 8px; min-width: 0; min-height: 0; }
.nd-portrait { position: relative; flex: 1 1 auto; min-height: 132px; margin: 0; overflow: hidden; border-radius: 3px; background: #120c08;
  box-shadow: 0 0 0 1px #0d0804, 0 0 0 2px rgba(214, 165, 82, .7), 0 0 0 3px #1a0f06, inset 0 0 26px rgba(0, 0, 0, .6); }
.nd-scene { position: absolute; inset: 0; overflow: hidden; }
.nd-scene img { display: block; width: 100%; height: 100%; object-fit: cover; transform: scale(var(--nd-zoom, 2.4)); filter: blur(1.4px) brightness(.6) saturate(.92) sepia(.12); }
.nd-portrait::after { content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse 80% 70% at 50% 38%, transparent 50%, rgba(8, 5, 2, .6)), linear-gradient(transparent 62%, rgba(10, 6, 3, .8)); }
.nd-figure { position: absolute; z-index: 1; left: 50%; bottom: -3%; height: 104%; width: auto; transform: translateX(-50%); filter: drop-shadow(0 8px 10px rgba(0, 0, 0, .6)) drop-shadow(0 0 1px rgba(0, 0, 0, .7)); }
.nd-p-painting .nd-paint { position: absolute; z-index: 1; left: 6%; right: 6%; bottom: 0; width: 88%; height: 94%; object-fit: contain; object-position: 50% 100%; filter: drop-shadow(0 8px 10px rgba(0, 0, 0, .6)); }
.nd-p-painted .nd-paint { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 18%; }
.nd-left { display: flex; flex-direction: column; gap: 8px; min-height: 0; }
.nd-plate { position: relative; flex: none; padding: 8px 10px 13px; border: 1.5px solid #c9973f; border-radius: 3px; text-align: center;
  background: linear-gradient(#2c1b0f, #190e07); box-shadow: inset 0 0 0 1px #0c0703, inset 0 0 0 3px rgba(201, 151, 63, .22), 0 2px 5px rgba(0, 0, 0, .5); }
.nd-name { margin: 0; color: var(--nd-gold2); font: 700 21px/1.1 Cinzel, Georgia, serif; letter-spacing: .03em; text-wrap: balance; text-shadow: 0 2px 2px #000; }
.nd-plate-orn { position: absolute; left: 22%; right: 22%; bottom: 3px; height: 9px;
  background: url('assets/gen/ui/questlog/divider_thin_c.webp') center / auto 100% no-repeat, linear-gradient(90deg, transparent, rgba(214, 167, 80, .75) 18%, rgba(214, 167, 80, .75) 82%, transparent) center / 100% 1px no-repeat; }
.nd-say { flex: none; max-height: 98px; margin: 0; padding: 9px 13px; overflow-y: auto; border: 1px solid rgba(201, 151, 63, .66); border-radius: 3px;
  background: linear-gradient(#20150c, #140c06); box-shadow: inset 0 0 14px rgba(0, 0, 0, .65); color: #f0e3c4; font: 17px/1.34 'EB Garamond', Georgia, serif; text-wrap: pretty; }
.nd-menu { display: flex; flex-direction: column; gap: 6px; min-height: 0; }
#ui #questModal .nd-row { display: grid; grid-template-columns: 38px minmax(0, 1fr) 12px; align-items: center; gap: 10px; width: 100%; min-height: 46px; margin: 0; padding: 3px 14px 3px 7px;
  border: 1px solid rgba(196, 150, 76, .55); border-image: none; border-radius: 4px; background: linear-gradient(#26180d, #150d06); box-shadow: inset 0 1px rgba(255, 230, 170, .06), 0 2px 4px rgba(0, 0, 0, .45);
  color: #ecdcb8; font: 19px/1.12 'EB Garamond', Georgia, serif; text-align: left; text-shadow: 0 1px 2px #000; cursor: pointer; transition: filter .14s, border-color .14s, box-shadow .14s; }
#ui #questModal .nd-row:hover { border-color: #e2b458; filter: brightness(1.12); }
#ui #questModal .nd-row.active { border-color: #f4c866; color: #fff4d6;
  background: radial-gradient(ellipse 70% 120% at 22% 50%, rgba(222, 158, 54, .38), transparent 72%), linear-gradient(#3c2612, #21140a);
  box-shadow: inset 0 0 0 1px rgba(255, 214, 130, .3), 0 0 14px rgba(238, 168, 58, .4), 0 2px 4px rgba(0, 0, 0, .45); }
#ui #questModal .nd-row:focus-visible, #ui #questModal .nd-qcard:focus-visible, #ui #questModal .nd-btn:focus-visible { outline: 2px solid #ffd66c; outline-offset: 2px; }
.nd-row-icon { display: grid; place-items: center; width: 38px; height: 38px; }
.nd-row-icon img { max-width: 38px; max-height: 38px; object-fit: contain; filter: drop-shadow(0 1px 2px #000); }
.nd-row-label { min-width: 0; overflow-wrap: anywhere; }
.nd-chev { justify-self: end; width: 9px; height: 9px; margin-right: 3px; border-top: 2.5px solid #b98a3e; border-right: 2.5px solid #b98a3e; transform: rotate(45deg); }
.nd-row.active .nd-chev { border-color: #ffd36a; filter: drop-shadow(0 0 3px rgba(255, 200, 90, .8)); }

/* The gold rail between the column and the parchment, a small diamond at each end. */
.nd-rail { position: relative; margin: 6px 0; border-radius: 2px; background: linear-gradient(90deg, #3d240d, #b98535 22%, #f8dd92 50%, #b07a2e 78%, #3d240d); box-shadow: 0 0 0 1px #140b05, 0 0 8px rgba(0, 0, 0, .6); }
.nd-rail::before, .nd-rail::after { content: ''; position: absolute; left: 50%; width: 14px; height: 14px; margin-left: -7px; transform: rotate(45deg); background: linear-gradient(135deg, #ffe7a0, #b67a26); box-shadow: 0 0 0 1px #2a1606, 0 0 0 3px rgba(20, 11, 4, .8); }
.nd-rail::before { top: -8px; } .nd-rail::after { bottom: -8px; }

/* ---------------- right: the parchment ---------------- */
.nd-right { display: flex; min-width: 0; min-height: 0; }
.nd-sheet { position: relative; flex: 1; display: flex; flex-direction: column; min-width: 0; min-height: 0; box-sizing: border-box; padding: 12px 28px 16px; border-radius: 3px; color: var(--nd-ink);
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .36 0 0 0 0 .25 0 0 0 0 .12 0 0 0 .11 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E"),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='600' height='600'%3E%3Cfilter id='s'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.012' numOctaves='3' seed='7'/%3E%3CfeColorMatrix values='0 0 0 0 .45 0 0 0 0 .3 0 0 0 0 .12 0 0 0 .16 -.03'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23s)'/%3E%3C/svg%3E"),
    radial-gradient(ellipse 75% 70% at 50% 42%, #f2e6ca 0%, #eadbb9 48%, #dcc79c 78%, #c9ad7b 100%);
  box-shadow: inset 0 0 0 1px rgba(110, 72, 28, .55), inset 0 0 44px rgba(120, 78, 30, .5), inset 0 0 8px rgba(90, 55, 20, .5), 0 0 0 2px #2a1709, 0 0 0 3px rgba(214, 165, 82, .65), 0 0 0 4px #1a0e06; }
.nd-head { position: relative; flex: none; display: flex; align-items: center; height: 70px; margin: -4px 0 0 -8px; }
.nd-banner { position: relative; z-index: 2; flex: none; width: auto; height: 82px; margin-top: 6px; filter: drop-shadow(0 3px 4px rgba(50, 26, 6, .5)); }
.nd-ribbon { position: relative; z-index: 1; display: flex; align-items: center; height: 40px; margin-left: -22px; padding: 0 46px 1px 38px; filter: drop-shadow(0 2px 3px rgba(45, 22, 6, .55)); }
.nd-ribbon::before, .nd-ribbon::after { content: ''; position: absolute; clip-path: polygon(0 0, calc(100% - 21px) 0, 100% 50%, calc(100% - 21px) 100%, 0 100%); }
.nd-ribbon::before { inset: 0; background: linear-gradient(180deg, #f9dc8c 0%, #c38b31 42%, #8a5a1c 60%, #e8bc62 100%); }
.nd-ribbon::after { inset: 3px 3px 3px 0; background: linear-gradient(180deg, #52231a 0%, #33130c 52%, #43190f 100%); box-shadow: inset 0 0 0 1px rgba(255, 196, 110, .28); }
.nd-ribbon span { position: relative; z-index: 1; color: #f6cf6c; font: 700 18px/1 Cinzel, Georgia, serif; letter-spacing: .07em; white-space: nowrap; text-shadow: 0 1px 0 #170603, 0 0 9px rgba(255, 186, 70, .3); }
.nd-title { flex: none; margin: 4px 0 0; color: #1c1107; font: 700 44px/1.02 Cinzel, Georgia, serif; letter-spacing: .005em; text-wrap: balance; text-shadow: 0 1px 0 rgba(255, 246, 222, .55); }
.nd-title.long { font-size: 36px; } .nd-title.longer { font-size: 30px; }
/* A quest's kind, level and place, at the right of the header. */
.nd-meta { display: grid; justify-items: end; gap: 3px; min-width: 0; margin: 4px 0 0 auto; padding-left: 12px; color: #6a4c2a; font: 700 13px/1.15 Cinzel, Georgia, serif; letter-spacing: .07em; text-align: right; }
.nd-meta span:first-child { color: #8a5a1a; }
.nd-meta-main span:first-child { color: #9a5f10; }
.nd-scroll { flex: 1 1 auto; min-height: 0; margin-right: -14px; padding-right: 14px; overflow-y: auto; overscroll-behavior: contain; scrollbar-color: #9b7442 rgba(90, 60, 25, .12); scrollbar-width: thin; }
.nd-scroll::-webkit-scrollbar { width: 7px; } .nd-scroll::-webkit-scrollbar-thumb { border-radius: 4px; background: #9b7442; }
.nd-sheet.nd-more .nd-scroll { -webkit-mask-image: linear-gradient(#000 calc(100% - 26px), transparent); mask-image: linear-gradient(#000 calc(100% - 26px), transparent); }
.nd-sheet .ql-div { height: 16px; margin: 7px 0; }
.nd-lines { margin: 0; color: #2c1c0e; font: 20px/1.38 'EB Garamond', Georgia, serif; text-wrap: pretty; }
.nd-sec h3 { margin: 0 0 7px; color: #2a180a; font: 700 16px/1 Cinzel, Georgia, serif; letter-spacing: .06em; }
.nd-obj ol { display: grid; gap: 5px; margin: 0; padding: 0; list-style: none; }
.nd-o { display: grid; grid-template-columns: 16px minmax(0, 1fr); gap: 12px; align-items: start; color: #2c1c0e; font: 18px/1.32 'EB Garamond', Georgia, serif; }
.nd-o-mark { width: 12px; height: 12px; margin: 5px 0 0 2px; transform: rotate(45deg); background: linear-gradient(135deg, #e3ad4d, #8c5a1b); box-shadow: 0 0 0 1px #4d300c, 0 1px 2px rgba(60, 35, 10, .5); }
.nd-o-done .nd-o-mark { width: 7px; height: 13px; margin: 1px 0 0 5px; background: none; box-shadow: none; border-right: 3px solid #3f6b2c; border-bottom: 3px solid #3f6b2c; }
.nd-o-done span { color: #5d4a33; }
.nd-o-locked .nd-o-mark { background: none; box-shadow: inset 0 0 0 1.5px rgba(110, 80, 45, .55); }
.nd-o-locked span { color: #8a7355; font-style: italic; letter-spacing: .08em; }
.nd-count { margin-left: 4px; color: #7a4f16; font-weight: 700; font-variant-numeric: tabular-nums; }
.nd-o time, .nd-o em { margin-left: 8px; color: #8b2f1c; font-style: normal; font-weight: 600; }
.nd-o-return span { color: #6d4412; }
.nd-rew { padding-bottom: 2px; }
.nd-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; margin: 0; padding: 0; list-style: none; }
.nd-tile { --art: 60px; position: relative; display: grid; grid-template-rows: var(--art) auto; justify-items: center; align-content: start; gap: 3px; min-width: 0; min-height: 116px; box-sizing: border-box; padding: 6px 6px 7px;
  border: 1.5px solid #b98c47; border-radius: 6px; background: radial-gradient(circle at 50% 30%, #3b2a19, #1b120a 72%); text-align: center;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .7), inset 0 0 16px rgba(0, 0, 0, .6), inset 0 1px rgba(255, 220, 150, .12), 0 2px 5px rgba(70, 42, 12, .45); }
.nd-tile[class*=" q-"] { border-color: var(--q-rim);
  background: radial-gradient(circle at 50% 34%, color-mix(in srgb, var(--q-rim) 18%, #33210f), #1b1109 76%);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .65), inset 0 0 18px color-mix(in srgb, var(--q-rim) 22%, transparent), 0 0 12px color-mix(in srgb, var(--q-rim) 42%, transparent), 0 2px 5px rgba(70, 42, 12, .45); }
/* The tile's picture fills its upper half (--art, about 52% of its height), kept to its own shape; an item's sits on a soft
   glow in its quality's colour, and a long one lies across the box (src/questui/dialog.js trimIcon, lenFor). */
.nd-tile-art { position: relative; display: grid; place-items: center; width: calc(var(--art) * 1.25); height: var(--art); }
.nd-tile-art img { position: relative; display: block; width: 100%; height: var(--art); object-fit: contain; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .7)); }
.nd-tile[class*=" q-"] .nd-tile-art::before { content: ''; position: absolute; left: 50%; top: 50%; width: calc(var(--art) * 1.7); height: calc(var(--art) * 1.4); border-radius: 50%; transform: translate(-50%, -50%); pointer-events: none;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--q-rim) 72%, transparent), color-mix(in srgb, var(--q-rim) 28%, transparent) 52%, transparent); }
.nd-random .nd-tile-art img { opacity: .86; filter: saturate(.6) brightness(.86) drop-shadow(0 2px 3px rgba(0, 0, 0, .7)); }
.nd-tall .nd-tile-art img { width: auto; height: calc(var(--art) * var(--len, 1.1)); transform: rotate(45deg); }
.nd-q { position: absolute; z-index: 1; right: 0; top: 0; display: grid; place-items: center; width: 19px; height: 19px; border: 1px solid var(--q-rim, #d9a74e); border-radius: 50%; background: #1b1109; color: var(--q-rim, #f2cd7a); font: 700 13px/1 Georgia, serif; font-style: normal; }
.nd-tile-text { display: grid; gap: 1px; min-width: 0; }
.nd-tile-text b { color: #f7e8c6; font: 700 17px/1.1 'EB Garamond', Georgia, serif; font-variant-numeric: tabular-nums; text-wrap: balance; overflow-wrap: anywhere; }
.nd-tile-text small { color: #dcc69b; font: 14.5px/1.14 'EB Garamond', Georgia, serif; text-wrap: balance; overflow-wrap: anywhere; }
.nd-t-xp .nd-tile-text b, .nd-t-gold .nd-tile-text b { font-size: 19px; }
.nd-tile.q-magic .nd-tile-text b { color: #b4b4ff; }
/* The buttons: a gold frame around a green, dark red or bronze field, a blue gem at each end, small gold diamonds above and below. */
.nd-btns { flex: none; display: flex; justify-content: center; gap: 30px; padding: 11px 0 2px; }
#ui #questModal .nd-btn { position: relative; display: inline-grid; place-items: center; min-width: 228px; height: 52px; margin: 0; padding: 0 34px; box-sizing: border-box;
  border: 2px solid #e2b35a; border-image: none; border-radius: 9px; color: #f8eed2; font: 600 22px/1 'EB Garamond', Georgia, serif; letter-spacing: .01em; text-shadow: 0 2px 2px rgba(0, 0, 0, .65); cursor: pointer;
  box-shadow: inset 0 0 0 2px #4a2e0e, inset 0 0 0 3px rgba(255, 220, 140, .3), inset 0 10px 16px rgba(255, 255, 255, .06), 0 3px 9px rgba(40, 20, 5, .5); transition: filter .14s, box-shadow .14s; }
#ui #questModal .nd-btn.nd-accept { background: linear-gradient(180deg, #37a059 0%, #1f7039 42%, #124a24 100%); }
#ui #questModal .nd-btn.nd-decline { background: linear-gradient(180deg, #8a3326 0%, #5e1c12 46%, #3c0f09 100%); }
#ui #questModal .nd-btn.nd-gold { background: linear-gradient(180deg, #8b5f25 0%, #5f3c12 46%, #3c230a 100%); }
#ui #questModal .nd-btn.on { border-color: #ffd873; box-shadow: inset 0 0 0 2px #4a2e0e, inset 0 0 0 3px rgba(255, 230, 150, .5), 0 0 14px rgba(255, 196, 80, .55); }
#ui #questModal .nd-btn:hover { filter: brightness(1.13); box-shadow: inset 0 0 0 2px #4a2e0e, inset 0 0 0 3px rgba(255, 220, 140, .4), 0 0 16px rgba(240, 180, 70, .45), 0 3px 9px rgba(40, 20, 5, .5); }
#ui #questModal .nd-btn:active { transform: scale(.97); }
.nd-btn::before, .nd-btn::after { content: ''; position: absolute; top: 50%; width: 15px; height: 15px; margin-top: -9.5px; transform: rotate(45deg);
  border: 2px solid #e8bd62; background: radial-gradient(circle at 35% 30%, #cfe8ff, #3c7ee0 42%, #173d8c 100%); box-shadow: 0 0 0 1px #3d250b, 0 0 6px rgba(80, 150, 255, .45); }
.nd-btn::before { left: -11px; } .nd-btn::after { right: -11px; }
.nd-gem { position: absolute; left: 50%; width: 9px; height: 9px; margin-left: -5.5px; transform: rotate(45deg); border: 1px solid #5a3a12; background: linear-gradient(135deg, #ffe7a4, #c58c30); }
.nd-gem-t { top: -7px; } .nd-gem-b { bottom: -7px; }

/* The list of an NPC's quests, each with its banner. */
.nd-list { display: grid; gap: 9px; margin: 0; padding: 0; list-style: none; }
#ui #questModal .nd-qcard { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto 12px; align-items: center; gap: 14px; width: 100%; min-height: 72px; margin: 0; padding: 7px 16px 7px 12px;
  border: 1px solid rgba(120, 82, 36, .55); border-image: none; border-radius: 5px; background: linear-gradient(rgba(255, 248, 230, .45), rgba(222, 200, 158, .45)); box-shadow: inset 0 1px rgba(255, 255, 255, .4), 0 1px 3px rgba(90, 58, 20, .3);
  color: var(--nd-ink); text-align: left; cursor: pointer; transition: box-shadow .14s, border-color .14s; }
#ui #questModal .nd-qcard:hover { border-color: #a0701f; box-shadow: inset 0 1px rgba(255, 255, 255, .5), 0 0 10px rgba(190, 130, 40, .45); }
.nd-qbanner { width: 52px; height: auto; filter: drop-shadow(0 2px 3px rgba(50, 26, 6, .45)); }
.nd-qtext { display: grid; gap: 3px; min-width: 0; }
.nd-qtext b { color: #1f1308; font: 700 22px/1.1 Cinzel, Georgia, serif; }
.nd-qtext small { color: #6a4c2a; font: 700 12.5px/1.2 Cinzel, Georgia, serif; letter-spacing: .06em; }
.nd-qstate { display: flex; align-items: center; gap: 7px; color: #4a3014; font: italic 16px/1.1 'EB Garamond', Georgia, serif; white-space: nowrap; }
.nd-qmark { width: auto; height: 30px; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .45)); }
.nd-q-turnin .nd-qstate { color: #2f5d20; font-weight: 600; }
.nd-qcard .nd-chev { border-color: #8a5f24; }

/* Talk: the conversation so far, the newest line in full ink, the earlier ones fading back. */
.nd-talks { display: grid; gap: 10px; }
.nd-talk { position: relative; margin: 0; padding-left: 22px; color: #6e5536; font: italic 19px/1.38 'EB Garamond', Georgia, serif; text-wrap: pretty; }
.nd-talk::before { content: ''; position: absolute; left: 2px; top: .55em; width: 8px; height: 8px; transform: rotate(45deg); background: rgba(150, 105, 40, .5); }
.nd-talk.nd-talk-new { color: #24170b; font-size: 22px; font-style: normal; }
.nd-talk.nd-talk-new::before { background: linear-gradient(135deg, #e3ad4d, #8c5a1b); box-shadow: 0 0 0 1px #4d300c; }
/* The town services. */
.nd-service { color: var(--nd-ink); font: 17px/1.4 'EB Garamond', Georgia, serif; }
.nd-service h3 { margin: 0 0 4px; color: #2a180a; font: 700 17px/1.3 Cinzel, Georgia, serif; }
.nd-service h3 small { margin-left: 10px; color: #3f6b2c; font: 600 13px Georgia, serif; }
.nd-service p { margin: 0 0 10px; color: #3a2814; }
.nd-service small { color: #6d553a; font-size: 14px; }
.nd-service .service-intro, .nd-service .service-current { color: #4a3419; }
.nd-service .service-current { font-size: 15px; }
.nd-service .service-option { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 11px 0; border-top: 1px solid rgba(120, 82, 36, .3); }
.nd-service .service-option p { margin: 0; color: #4f3a22; font-size: 15.5px; }
.nd-service .service-active { box-shadow: inset 3px 0 #a37a2c; padding-left: 12px; }
.nd-service :is(.service-reward, .service-rumor, .service-unmake) { margin-top: 18px; padding-top: 14px; border-top: 1px solid rgba(120, 82, 36, .38); }
.nd-service .service-reward p { color: #2f5d20; }
.nd-service .service-notice { padding: 9px 12px; border-left: 3px solid #5a8a3a; background: rgba(90, 138, 58, .14); color: #2c4a1c; }
.nd-service .service-confirm { margin-top: 12px; padding: 12px; background: rgba(143, 81, 37, .12); box-shadow: inset 0 0 0 1px rgba(143, 81, 37, .4); }
.nd-service .service-confirm > div { display: flex; flex-wrap: wrap; gap: 10px; }
.nd-service .service-search { display: grid; gap: 5px; margin: 6px 0 12px; color: #5b4027; font-size: 14px; }
.nd-service .service-search input { min-height: 38px; box-sizing: border-box; padding: 6px 10px; border: 1px solid rgba(120, 82, 36, .55); border-radius: 3px; background: rgba(255, 250, 238, .6); color: #2a1a0d; font: 16px 'EB Garamond', Georgia, serif; }
.nd-service .bestiary-entry { padding: 12px 0; border-top: 1px solid rgba(120, 82, 36, .3); }
.nd-service .bestiary-summary { display: flex; align-items: center; gap: 16px; }
.nd-service .bestiary-summary canvas { width: 70px; height: 75px; border-radius: 4px; background: radial-gradient(ellipse, #2b1d10, #140c06 72%); }
.nd-service .bestiary-summary p { margin: 0; color: #7a4f16; }
.nd-service .bestiary-resists { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px 16px; margin: 8px 0; font-size: 14px; }
.nd-service .bestiary-resists span { display: flex; justify-content: space-between; gap: 8px; }
.nd-service .service-immune { color: #a3301c; }
.nd-service :is(.service-locked, .bestiary-lore, .service-empty) { color: #6d553a; font-size: 14.5px; }
.nd-service .town-costs { margin-top: 4px; }
#ui #questModal .nd-service button { flex: none; min-width: 96px; min-height: 38px; margin: 0; padding: 4px 14px; border: 1.5px solid #c99a4a; border-image: none; border-radius: 6px;
  background: linear-gradient(180deg, #7d5421, #573610 50%, #3a230a); color: #f8ecd0; font: 600 15.5px/1.1 'EB Garamond', Georgia, serif; text-shadow: 0 1px 2px rgba(0, 0, 0, .6); cursor: pointer;
  box-shadow: inset 0 0 0 1px #3a220a, inset 0 0 0 2px rgba(255, 220, 140, .22), 0 2px 5px rgba(60, 35, 10, .4); }
#ui #questModal .nd-service button:hover:not(:disabled) { filter: brightness(1.12); }
#ui #questModal .nd-service button:disabled { opacity: .45; cursor: default; }
.nd-service-foot { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 8px; padding-top: 8px; border-top: 1px solid rgba(120, 82, 36, .38); }
.nd-service-foot .service-gold { color: #7a4f16; font: 700 16px 'EB Garamond', Georgia, serif; }
.nd-service-foot small { color: #6d553a; font-size: 14px; }

/* ---------------- compact: a phone in landscape (844x390) and other small windows ---------------- */
/* The column narrows to the portrait's head and shoulders, the name, a short speech box and the menu (touch rows of
   44 px); the parchment keeps its header, title and buttons, and the rest scrolls. */
.nd.nd-compact { position: fixed; left: calc(var(--m-sl, 0px) + 6px); right: calc(var(--m-sr, 0px) + 6px); top: calc(var(--m-st, 0px) + 6px); bottom: calc(var(--m-sb, 0px) + 6px);
  width: auto; height: auto; transform: none; grid-template-columns: 200px 8px minmax(0, 1fr); column-gap: 7px; padding: 4px 6px 6px;
  border-width: 14px; border-image-width: 30px 30px 32px 30px; font-size: 14px; }
#ui #questModal .nd-compact .nd-close { top: -11px; right: -11px; width: 44px !important; height: 44px !important; }
.nd-compact .nd-npc { gap: 5px; }
.nd-compact .nd-portrait { flex: 1 1 86px; min-height: 58px; }
.nd-compact .nd-figure { top: 4%; bottom: auto; height: 168%; }
.nd-compact .nd-p-painting .nd-paint { top: 4%; bottom: auto; height: 150%; object-position: 50% 0; }
.nd-compact .nd-left { flex: 0 1 auto; gap: 5px; overflow: hidden; }
.nd-compact .nd-plate { padding: 4px 6px 8px; }
.nd-compact .nd-name { font-size: 15px; }
.nd-compact .nd-plate-orn { bottom: 1px; height: 6px; }
.nd-compact .nd-say { max-height: 46px; padding: 4px 8px; font-size: 13px; line-height: 1.25; }
.nd-compact .nd-menu { gap: 4px; overflow-y: auto; }
#ui #questModal .nd-compact .nd-row { grid-template-columns: 28px minmax(0, 1fr) 10px; gap: 7px; min-height: 44px; padding: 2px 8px 2px 5px; font-size: 15.5px; }
.nd-compact .nd-row-icon, .nd-compact .nd-row-icon img { width: 28px; height: 28px; max-width: 28px; max-height: 28px; }
.nd-compact .nd-chev { width: 7px; height: 7px; border-width: 2px; }
.nd-compact .nd-rail { margin: 4px 0; }
.nd-compact .nd-rail::before, .nd-compact .nd-rail::after { width: 9px; height: 9px; margin-left: -4.5px; }
.nd-compact .nd-sheet { padding: 6px 14px 8px; }
.nd-compact .nd-head { height: 40px; margin: -2px 0 0 -6px; }
.nd-compact .nd-banner { height: 50px; margin-top: 4px; }
.nd-compact .nd-ribbon { height: 28px; margin-left: -15px; padding: 0 30px 0 24px; }
.nd-compact .nd-ribbon::before, .nd-compact .nd-ribbon::after { clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 50%, calc(100% - 14px) 100%, 0 100%); }
.nd-compact .nd-ribbon::after { inset: 2px 2px 2px 0; }
.nd-compact .nd-ribbon span { font-size: 13px; }
.nd-compact .nd-title { margin-top: 2px; font-size: 24px; } .nd-compact .nd-title.long { font-size: 21px; } .nd-compact .nd-title.longer { font-size: 18.5px; }
.nd-compact .nd-meta { margin: 2px 26px 0 auto; padding-left: 8px; font-size: 10px; gap: 1px; }
.nd-compact .nd-talk { padding-left: 16px; font-size: 14.5px; } .nd-compact .nd-talk.nd-talk-new { font-size: 16.5px; }
.nd-compact .nd-talk::before { width: 6px; height: 6px; }
.nd-compact .nd-sheet .ql-div { height: 10px; margin: 3px 0; }
.nd-compact.nd .nd-sheet.nd-more .nd-scroll { -webkit-mask-image: linear-gradient(#000 calc(100% - 14px), transparent); mask-image: linear-gradient(#000 calc(100% - 14px), transparent); }
.nd-compact .nd-lines { font-size: 15px; line-height: 1.26; }
/* On a phone the later steps' "???" rows give way to the rewards (the quest log keeps them). */
.nd-compact .nd-o-locked { display: none; }
.nd-compact .nd-page-talk .nd-lines { font-size: 17px; }
.nd-compact .nd-sec h3 { margin-bottom: 3px; font-size: 12.5px; }
.nd-compact .nd-o { gap: 8px; font-size: 14.5px; }
.nd-compact .nd-o-mark { width: 9px; height: 9px; margin-top: 4px; }
.nd-compact .nd-tiles { grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 6px; }
.nd-compact .nd-tile { --art: 35px; min-height: 70px; padding: 2px 3px 1px; gap: 1px; border-radius: 5px; }
.nd-compact .nd-q { width: 14px; height: 14px; font-size: 10px; }
.nd-compact .nd-tile-text b { font-size: 13px; } .nd-compact .nd-tile-text small { font-size: 11px; line-height: 1.08; }
.nd-compact .nd-t-xp .nd-tile-text b, .nd-compact .nd-t-gold .nd-tile-text b { font-size: 14.5px; }
.nd-compact .nd-btns { gap: 22px; padding-top: 8px; }
#ui #questModal .nd-compact .nd-btn { min-width: 150px; height: 44px; padding: 0 22px; font-size: 17px; border-radius: 7px; }
.nd-compact .nd-btn::before, .nd-compact .nd-btn::after { width: 11px; height: 11px; margin-top: -7.5px; }
.nd-compact .nd-btn::before { left: -8px; } .nd-compact .nd-btn::after { right: -8px; }
#ui #questModal .nd-compact .nd-qcard { grid-template-columns: 36px minmax(0, 1fr) auto 9px; gap: 9px; min-height: 52px; padding: 4px 10px 4px 7px; }
.nd-compact .nd-qbanner { width: 36px; }
.nd-compact .nd-qtext b { font-size: 16px; } .nd-compact .nd-qtext small { font-size: 10.5px; }
.nd-compact .nd-qstate { font-size: 13px; } .nd-compact .nd-qmark { height: 22px; }
.nd-compact .nd-service { font-size: 14.5px; }
#ui #questModal .nd-compact .nd-service button { min-height: 44px; }
.nd-compact .nd-service-foot { margin-top: 4px; padding-top: 4px; }

@media (prefers-reduced-motion: reduce) { #ui #questModal :is(.nd-row, .nd-btn, .nd-qcard) { transition: none; } }
.quest-reduced-motion #ui #questModal :is(.nd-row, .nd-btn, .nd-qcard) { transition: none; }
