.qmap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px var(--gap);
  height: calc(100vh - 150px);
  min-height: 440px;
}
.qmap__bar { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }

.qmap__cloth {
  position: relative; min-width: 0; min-height: 0; overflow: hidden; border-radius: 4px;
  background: #0E0D0F var(--grain);
  box-shadow: inset 0 0 0 3px #1c1a1b, inset 0 0 0 4px rgba(216, 160, 58, .45), inset 0 0 60px rgba(0, 0, 0, .8), var(--shadow-paper);
}
.qmap__svg { display: block; width: 100%; height: 100%; }
.qmap__star { fill: #E9E2CF; opacity: .35; }
.qmap__arc { fill: none; stroke: var(--thread); stroke-width: 1; stroke-dasharray: 2 6; opacity: .28; }
.qmap__thread { stroke: var(--thread); stroke-width: 4; stroke-linecap: round; stroke-dasharray: 9 1.6; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .8)); }
.qmap__thread.faded { stroke-width: 1.8; opacity: .38; stroke-dasharray: 3 5; }
.qmap__dotted { fill: none; stroke: var(--thread); stroke-width: 1.8; stroke-dasharray: 2 6; stroke-linecap: round; opacity: .75; }
.qmap__ray.hidden, .qmap__dotted.hidden { display: none; }

.qmap__strip { fill: var(--paper); stroke: var(--paper-edge); stroke-width: 1; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .6)); }
.qmap__stitch { fill: none; stroke: var(--thread); stroke-width: 1.2; stroke-dasharray: 4 3; }
.qmap__labeltext { font-family: var(--font-stamp); font-size: 19px; fill: var(--ink); }

.qmap__bead { cursor: pointer; outline: none; }
.qmap__hit { fill: transparent; }
.qmap__gold { fill: url(#qm-gold); stroke: #6b470f; stroke-width: 1; filter: drop-shadow(0 1.5px 1.5px rgba(0, 0, 0, .7)); }
.qmap__shine { fill: #FFF3C4; opacity: .8; }
.qmap__paper { fill: url(#qm-paper); stroke: #8c7d5c; stroke-width: 1; }
.qmap__paper.dim { fill: #8f8466; }
.qmap__pencil { fill: none; stroke: #B9B1A0; stroke-width: 3; stroke-linecap: round; stroke-dasharray: 26 3 16 2; }
.qmap__ring { fill: none; stroke: var(--thread); stroke-width: 2.4; }
.qmap__pin { fill: #050405; stroke: #8a6a2c; stroke-width: 1.6; }
.qmap__pin.faint { stroke: #7a6030; stroke-width: 1.2; }
.qmap__knot { fill: var(--thread); opacity: .85; }
.qmap__id { font-family: var(--font-stamp); font-size: 15px; fill: #cdbf9c; opacity: .8; pointer-events: none; }
.qmap__size { font-family: var(--font-stamp); font-size: 13px; fill: var(--thread); pointer-events: none; }
.qmap__sel { fill: none; stroke: #F6DC8E; stroke-width: 2.5; opacity: 0; }
.qmap__bead:focus-visible .qmap__sel { opacity: 1; stroke: #fff; stroke-dasharray: 5 3; }
.qmap__bead.picked .qmap__sel { opacity: 1; }
.qmap__bead:hover .qmap__sel { opacity: .6; }
.qmap__bead.picked .qmap__id { opacity: 1; fill: #fff; }
.qmap__corebrass { fill: url(#qm-gold); stroke: #6b470f; stroke-width: 2; filter: drop-shadow(0 3px 3px rgba(0, 0, 0, .8)); }
.qmap__coreinner { fill: none; stroke: #6b470f; stroke-width: 1.5; opacity: .7; }
.qmap__bead.core:not(.done) .qmap__corebrass { filter: saturate(.55) brightness(.75) drop-shadow(0 3px 3px rgba(0, 0, 0, .8)); }
.qmap__coretext { font-family: var(--font-title); font-size: 19px; fill: #3a2606; pointer-events: none; }

.qmap__tag {
  position: relative; align-self: start; padding: 38px 22px 20px; color: var(--ink);
  background: #E8D3A2 var(--grain);
  clip-path: polygon(0 18px, 18px 0, calc(100% - 18px) 0, 100% 18px, 100% 100%, 0 100%);
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .55));
  max-height: 100%; overflow: auto;
}
.qmap__hole { position: absolute; top: 12px; left: 50%; width: 14px; height: 14px; margin-left: -7px; border-radius: 50%; background: var(--felt-deep); box-shadow: 0 0 0 3px #b5835a, 0 0 0 4px rgba(0, 0, 0, .3); }
.qmap__tag p { margin: 0 0 10px; }
.qmap__name { font-family: var(--font-title); font-weight: 400; font-size: 23px; line-height: 1.15; margin: 0 0 8px; }
.qmap__name b { font-family: var(--font-stamp); font-weight: 400; font-size: 20px; }
.qmap__text { font-size: 16px; line-height: 1.3; }

.qmap__prog { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.qmap__prog .hand { font-size: 20px; color: #3b3a58; }
.qmap__progbar { flex: 1; height: 12px; border: 1.5px solid var(--ink); background: rgba(255, 255, 255, .35); }
.qmap__progbar i { display: block; height: 100%; background: repeating-linear-gradient(135deg, #6a6258 0 2px, #8d8579 2px 4px); }
.qmap__rlabel { font-family: var(--font-stamp); font-size: 14px; }
.qmap__reward { font-size: 16px; }

.qmap__why { font-size: 24px; color: #7a2a2a; }

@media (max-width: 700px) {
  .qmap { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(300px, 46vh) auto; height: auto; min-height: 0; }
  .qmap__cloth { overflow: auto; -webkit-overflow-scrolling: touch; }
  .qmap__svg { width: 860px; max-width: none; height: 100%; }
  
  
  .qmap__tag { padding: 26px 18px 18px; clip-path: polygon(0 8px, 6% 0, 14% 7px, 24% 1px, 36% 8px, 50% 0, 64% 7px, 78% 1px, 90% 8px, 100% 0, 100% 100%, 0 100%); }
  .qmap__hole { display: none; }
  .qmap { grid-template-rows: auto auto auto; }
  .qmap__cloth { display: none; }
  .qmap .qmap__list { display: grid; gap: 14px; }
}
.qmap__list { display: none; }
.qmap__group[hidden] { display: none; }
.qmap__group h4 { margin: 0 0 6px; font-family: var(--font-title); font-weight: 500; font-size: 18px; color: var(--paper); }
.qmap__group ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.qmap__row { width: 100%; min-height: 44px; display: grid; grid-template-columns: 14px 18px 30px minmax(0, 1fr) auto; align-items: center; gap: 8px;
  padding: 6px 10px; border: 0; border-radius: 3px; text-align: left; cursor: pointer; font: inherit; font-size: 14px;
  background: var(--paper) var(--grain); color: var(--ink); }
.qmap__row b { font-family: var(--font-stamp); font-weight: 600; font-size: 13px; }
.qmap__rowtext { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qmap__row small { font-size: 12px; color: var(--ink-soft); white-space: nowrap; }
.qmap__row[aria-pressed='true'] { box-shadow: inset 0 0 0 2px var(--thread); }
.qmap__dot { width: 12px; height: 12px; border-radius: 50%; border: 1.5px solid var(--ink-soft); }
.qmap__row--done .qmap__dot { background: var(--thread); border-color: #8E6218; }
.qmap__row--open .qmap__dot { background: var(--verdigris); border-color: var(--verdigris-deep); }
.qmap__row--size .qmap__dot { border-style: dashed; border-color: var(--verdigris); }
.qmap__row--locked, .qmap__row--sewing { opacity: .62; }
.qmap__row--done .qmap__rowtext { text-decoration: line-through; text-decoration-color: rgba(42, 35, 32, .4); }
.qmap__name { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

.qmap__tag .task__parts { margin-left: 4px; }
.task__state { display: inline-block; margin: 6px 0 2px; padding: 2px 10px; border-radius: 999px; font-size: 13px; border: 1.5px solid currentColor; }
.task__state--open { color: var(--verdigris-deep); background: rgba(46, 107, 95, .1); }
.task__state--size { color: var(--thread-ink); border-style: dashed; }
.task__state--locked, .task__state--sewing { color: var(--ink-soft); }
.task__state--done { color: var(--thread-ink); background: rgba(216, 160, 58, .15); }
.qmap__bar:empty { display: none; }
.qmap__tag { position: relative; }
.qmap__tag .qmap__name .qmap__corner { align-self: center; font-family: var(--font-body); }
.qmap__reward { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; margin-top: 8px; }
