/* =========================================================================
   2026 나우가구페어 배치도 — 위젯 스타일
   모든 스타일은 .nfm-root 이하로 스코프되어 삽입된 사이트와 충돌하지 않음.
   ========================================================================= */

.nfm-root {
  --nfm-bg-top:   #f4efe7;
  --nfm-bg-bot:   #e2dacd;
  --nfm-ink:      #3a342c;
  --nfm-ink-soft: rgba(58, 52, 44, 0.58);
  --nfm-line:     rgba(58, 52, 44, 0.14);
  --nfm-panel:    rgba(252, 249, 244, 0.92);
  --nfm-accent:   #b98a5e;

  position: relative;
  width: 100%;
  height: 100%;
  min-height: 420px;
  overflow: hidden;
  border-radius: 14px;
  background:
    radial-gradient(130% 100% at 50% 20%, var(--nfm-bg-top) 0%, var(--nfm-bg-bot) 100%);
  color: var(--nfm-ink);
  font-family: "Helvetica Neue", Helvetica, "Apple SD Gothic Neo",
    "Malgun Gothic", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  user-select: none;
}

.nfm-root *,
.nfm-root *::before,
.nfm-root *::after { box-sizing: border-box; }

.nfm-canvas { position: absolute; inset: 0; display: block; touch-action: none; }

/* ---- 상단 툴바 -------------------------------------------------------- */
.nfm-toolbar {
  position: absolute;
  top: 16px; left: 16px; right: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  z-index: 4;
  pointer-events: none;
}
.nfm-toolbar > * { pointer-events: auto; }

.nfm-title {
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--nfm-ink-soft);
  margin-right: auto;
  line-height: 1.4;
}
.nfm-title b { display: block; font-size: 15px; letter-spacing: 0.02em;
  text-transform: none; color: var(--nfm-ink); }

/* ---- 뷰 전환 세그먼트 ------------------------------------------------- */
.nfm-seg {
  display: inline-flex;
  padding: 3px;
  background: var(--nfm-panel);
  border: 1px solid var(--nfm-line);
  border-radius: 999px;
  box-shadow: 0 2px 10px rgba(58, 52, 44, 0.08);
}
.nfm-seg button {
  border: 0;
  background: transparent;
  color: var(--nfm-ink-soft);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 7px 16px;
  border-radius: 999px;
  cursor: pointer;
  transition: color 0.2s, background 0.2s;
}
.nfm-seg button.is-active {
  background: var(--nfm-ink);
  color: #f6f1e8;
}

/* ---- 검색 ------------------------------------------------------------- */
.nfm-search {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.nfm-search input {
  width: 200px;
  max-width: 44vw;
  border: 1px solid var(--nfm-line);
  background: var(--nfm-panel);
  border-radius: 999px;
  padding: 9px 34px 9px 16px;
  font: inherit;
  font-size: 13px;
  color: var(--nfm-ink);
  box-shadow: 0 2px 10px rgba(58, 52, 44, 0.08);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.nfm-search input::placeholder { color: var(--nfm-ink-soft); }
.nfm-search input:focus {
  border-color: var(--nfm-accent);
  box-shadow: 0 2px 14px rgba(185, 138, 94, 0.22);
}
.nfm-search svg {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  width: 14px; height: 14px; stroke: var(--nfm-ink-soft); pointer-events: none;
}

/* ---- 검색 결과 드롭다운 ---------------------------------------------- */
.nfm-results {
  position: absolute;
  top: calc(100% + 6px); right: 0;
  width: 240px; max-height: 260px; overflow-y: auto;
  background: var(--nfm-panel);
  border: 1px solid var(--nfm-line);
  border-radius: 12px;
  box-shadow: 0 12px 34px rgba(58, 52, 44, 0.18);
  padding: 6px;
  display: none;
}
.nfm-results.is-open { display: block; }
.nfm-results button {
  display: flex; align-items: center; gap: 10px;
  width: 100%; text-align: left;
  border: 0; background: transparent; cursor: pointer;
  padding: 9px 10px; border-radius: 8px;
  font: inherit; font-size: 13px; color: var(--nfm-ink);
}
.nfm-results button:hover { background: rgba(58, 52, 44, 0.06); }
.nfm-results .num {
  flex: none;
  min-width: 26px; height: 22px; padding: 0 6px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 6px; font-weight: 700; font-size: 12px;
  background: var(--nfm-ink); color: #f6f1e8;
}
.nfm-results .empty { padding: 14px 10px; color: var(--nfm-ink-soft); font-size: 13px; }

/* ---- 상세 사이드 패널 ------------------------------------------------- */
.nfm-panel {
  position: absolute;
  top: 72px; right: 16px; bottom: 16px;
  width: 268px; max-width: calc(100% - 32px);
  background: var(--nfm-panel);
  border: 1px solid var(--nfm-line);
  border-radius: 14px;
  box-shadow: 0 16px 40px rgba(58, 52, 44, 0.20);
  padding: 22px 22px 20px;
  z-index: 5;
  transform: translateX(calc(100% + 24px));
  opacity: 0;
  transition: transform 0.34s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.3s;
  display: flex; flex-direction: column;
}
.nfm-panel.is-open { transform: none; opacity: 1; }

.nfm-panel .close {
  position: absolute; top: 14px; right: 14px;
  width: 28px; height: 28px; border: 0; border-radius: 8px;
  background: rgba(58, 52, 44, 0.06); color: var(--nfm-ink);
  font-size: 17px; line-height: 1; cursor: pointer;
}
.nfm-panel .close:hover { background: rgba(58, 52, 44, 0.12); }

.nfm-panel .chip {
  display: inline-flex; align-items: center; gap: 8px;
  align-self: flex-start;
  padding: 6px 12px; border-radius: 999px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  margin-bottom: 16px;
}
.nfm-panel .chip .swatch { width: 12px; height: 12px; border-radius: 4px; }

.nfm-panel .booth-no {
  font-size: 13px; font-weight: 600; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--nfm-ink-soft);
  margin-bottom: 2px;
}
.nfm-panel h3 {
  margin: 0 0 18px; font-size: 27px; font-weight: 700; letter-spacing: -0.01em;
  line-height: 1.15;
}
.nfm-panel dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 12px 18px; }
.nfm-panel dt { font-size: 12px; color: var(--nfm-ink-soft); letter-spacing: 0.04em; }
.nfm-panel dd { margin: 0; font-size: 14px; font-weight: 600; text-align: right; }
.nfm-panel .divider { height: 1px; background: var(--nfm-line); margin: 18px 0; }
.nfm-panel .note { margin-top: auto; font-size: 12px; color: var(--nfm-ink-soft); line-height: 1.6; }

/* ---- 호버 툴팁 -------------------------------------------------------- */
.nfm-tip {
  position: absolute; z-index: 6; pointer-events: none;
  padding: 6px 11px; border-radius: 8px;
  background: rgba(46, 41, 34, 0.94); color: #f6f1e8;
  font-size: 12px; font-weight: 600; white-space: nowrap;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.22);
  opacity: 0; transform: translate(-50%, -140%);
  transition: opacity 0.12s;
}
.nfm-tip.is-on { opacity: 1; }
.nfm-tip small { opacity: 0.7; font-weight: 500; }

/* ---- 범례 ------------------------------------------------------------- */
.nfm-legend {
  position: absolute; left: 16px; bottom: 16px; z-index: 4;
  display: flex; flex-wrap: wrap; gap: 6px 14px; max-width: 60%;
  padding: 11px 14px;
  background: var(--nfm-panel);
  border: 1px solid var(--nfm-line);
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(58, 52, 44, 0.10);
}
.nfm-legend span { display: inline-flex; align-items: center; gap: 7px;
  font-size: 11.5px; color: var(--nfm-ink); }
.nfm-legend i { width: 12px; height: 12px; border-radius: 3px; flex: none;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.06); }

/* ---- 하단 조작 힌트 --------------------------------------------------- */
.nfm-hint {
  position: absolute; right: 16px; bottom: 16px; z-index: 4;
  font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--nfm-ink-soft); font-weight: 500;
  display: flex; align-items: center; gap: 10px;
  transition: opacity 0.8s;
}
.nfm-hint .dot { width: 3px; height: 3px; border-radius: 50%; background: currentColor; opacity: 0.6; }
.nfm-hint.is-hidden { opacity: 0; }

/* ---- 로더 ------------------------------------------------------------- */
.nfm-loader {
  position: absolute; inset: 0; z-index: 8;
  display: flex; align-items: center; justify-content: center;
  background: var(--nfm-bg-top);
  transition: opacity 0.6s;
}
.nfm-loader.is-hidden { opacity: 0; pointer-events: none; }
.nfm-loader .ring {
  width: 32px; height: 32px; border-radius: 50%;
  border: 2px solid rgba(58, 52, 44, 0.16); border-top-color: rgba(58, 52, 44, 0.6);
  animation: nfm-spin 0.9s linear infinite;
}
@keyframes nfm-spin { to { transform: rotate(360deg); } }

/* ---- 반응형 ----------------------------------------------------------- */
@media (max-width: 640px) {
  .nfm-panel { top: auto; bottom: 12px; left: 12px; right: 12px; width: auto;
    max-height: 46%; }
  .nfm-panel.is-open { transform: none; }
  .nfm-panel { transform: translateY(calc(100% + 24px)); }
  .nfm-legend { max-width: calc(100% - 32px); }
  .nfm-hint { display: none; }
  .nfm-search input { width: 150px; }
}
