:root {
  --bg: #070707;
  --panel: rgba(19, 19, 19, 0.96);
  --line: rgba(255, 255, 255, 0.09);
  --text: #f5f5f1;
  --muted: #bababa;
  --accent: #e50914;
  --accent-strong: #b20710;
  --accent-soft: rgba(229, 9, 20, 0.14);
  --shadow: 0 28px 72px rgba(0, 0, 0, 0.42);
  --radius-xl: 30px;
  --radius-lg: 22px;
  --radius-md: 16px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  font-family: "Segoe UI", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top right, rgba(229, 9, 20, 0.11), transparent 24%),
    linear-gradient(180deg, #0a0a0a 0%, #040404 100%);
}

body.modal-open {
  overflow: hidden;
}

body.intro-active {
  overflow: hidden;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.hidden {
  display: none;
}

.mode-switch.hidden,
.auth-controls .hidden {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.app-shell {
  width: min(1540px, calc(100% - 28px));
  margin: 0 auto;
  padding: 20px 0 50px;
  overflow-x: clip;
}

.intro-overlay {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: grid;
  place-items: center;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transition: opacity 680ms ease, visibility 680ms ease;
}

.intro-overlay.is-visible {
  opacity: 1;
  visibility: visible;
}

.intro-overlay.is-exiting {
  opacity: 0;
  visibility: hidden;
}

.intro-backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at center, rgba(229, 9, 20, 0.16), transparent 26%),
    radial-gradient(circle at center, rgba(229, 9, 20, 0.08), transparent 46%),
    linear-gradient(180deg, rgba(4, 4, 4, 0.98) 0%, rgba(6, 6, 6, 0.995) 100%);
}

.intro-content {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  gap: 10px;
  width: min(100%, 760px);
  padding: 32px 24px;
  text-align: center;
}

.intro-logo-wrap {
  position: relative;
  display: grid;
  place-items: center;
  width: min(46vw, 240px);
  aspect-ratio: 1;
  margin-bottom: -18px;
}

.intro-ring {
  position: absolute;
  inset: 50%;
  border-radius: 999px;
  border: 1px solid rgba(229, 9, 20, 0.24);
  transform: translate(-50%, -50%) scale(0.72);
  opacity: 0;
}

.intro-overlay.is-visible .intro-ring-1 {
  animation: introRing 2.9s ease-out 1560ms forwards;
}

.intro-overlay.is-visible .intro-ring-2 {
  animation: introRing 2.9s ease-out 1780ms forwards;
}

.intro-overlay.is-visible .intro-ring-3 {
  animation: introRing 2.9s ease-out 2000ms forwards;
}

.intro-logo {
  position: relative;
  z-index: 1;
  width: min(34vw, 176px);
  aspect-ratio: 1;
  object-fit: contain;
  filter: drop-shadow(0 0 32px rgba(229, 9, 20, 0.22));
}

.intro-overlay.is-visible .intro-logo {
  animation: introLogoReveal 1.95s cubic-bezier(0.16, 0.84, 0.24, 1) 1540ms forwards;
}

.intro-eyebrow,
.intro-title,
.intro-copy {
  opacity: 0;
  transform: translateY(12px);
}

.intro-overlay.is-visible .intro-eyebrow {
  animation: introTextRise 980ms ease 1660ms forwards;
}

.intro-eyebrow {
  width: clamp(8.8rem, 18vw, 12rem);
  margin: 0;
  font-size: clamp(2.1rem, 6vw, 4.3rem);
  letter-spacing: 0.08em;
  text-align: center;
  white-space: nowrap;
  line-height: 0.92;
}

.intro-title {
  margin: 0;
  font-size: clamp(2.1rem, 6vw, 4.3rem);
  line-height: 0.92;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.intro-overlay.is-visible .intro-title {
  animation: introTextRise 980ms ease 1740ms forwards;
}

.intro-copy {
  margin: 0;
  color: rgba(245, 245, 241, 0.78);
  font-size: clamp(1rem, 2.4vw, 1.28rem);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.intro-overlay.is-visible .intro-copy {
  animation: introTextRise 980ms ease 1940ms forwards;
}

.intro-logo {
  opacity: 0;
}

@keyframes introLogoReveal {
  0% {
    opacity: 0;
    transform: scale(0.82);
    filter: drop-shadow(0 0 0 rgba(229, 9, 20, 0));
  }
  60% {
    opacity: 1;
    transform: scale(1.03);
    filter: drop-shadow(0 0 24px rgba(229, 9, 20, 0.26));
  }
  100% {
    opacity: 1;
    transform: scale(1);
    filter: drop-shadow(0 0 16px rgba(229, 9, 20, 0.16));
  }
}

@keyframes introLeadCopy {
  0% {
    opacity: 0;
    transform: translateY(18px) scale(0.88);
  }
  20% {
    opacity: 1;
    transform: translateY(0) scale(1.08);
  }
  42% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  72% {
    opacity: 1;
    transform: translateY(0);
  }
  100% {
    opacity: 0;
    transform: translateY(-14px) scale(0.96);
  }
}

@keyframes introTextRise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes introRing {
  0% {
    width: 20%;
    height: 20%;
    opacity: 0;
  }
  18% {
    opacity: 0.42;
  }
  100% {
    width: 100%;
    height: 100%;
    opacity: 0;
  }
}

.topbar,
.panel,
.mode-button,
.asset-card-button,
.uploader-card-button,
.world-map,
.mini-map,
.banner-map-panel,
.korea-banner,
.metadata-panel,
.viewer-list-section,
.admin-hero,
.my-page-hero,
.detail-empty,
.detail-card {
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5000;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  margin-bottom: 22px;
  padding: 14px 20px;
  border: 0;
  border-radius: 999px;
  backdrop-filter: blur(18px);
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
}

.brand-logo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.brand-title {
  display: block;
  font-size: 1.06rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1.1;
}

.mode-switch {
  display: flex;
  gap: 10px;
  flex-wrap: nowrap;
  justify-content: flex-end;
}

.mode-button,
.primary-button,
.ghost-button,
.danger-button {
  min-height: 42px;
  padding: 0 17px;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: transform 180ms ease, background 180ms ease, border-color 180ms ease;
  white-space: nowrap;
}

.mode-button:hover,
.primary-button:hover,
.ghost-button:hover,
.danger-button:hover,
.asset-card-button:hover,
.uploader-card-button:hover {
  transform: translateY(-2px);
}

.mode-button {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--line);
  color: var(--muted);
}

.mode-toggle-button {
  position: relative;
  min-width: 188px;
  padding-left: 52px;
  text-align: left;
}

.mode-toggle-button::before {
  content: "";
  position: absolute;
  left: 16px;
  top: 50%;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: rgba(229, 9, 20, 0.28);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  transform: translateY(-50%);
  transition: background 180ms ease, transform 180ms ease;
}

.mode-toggle-button[aria-pressed="true"]::before {
  background: #e50914;
  transform: translateY(-50%);
}

.mode-button.active,
.primary-button {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #fff;
}

.ghost-button {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--line);
  color: var(--text);
}

.danger-button {
  background: rgba(229, 9, 20, 0.1);
  border-color: rgba(229, 9, 20, 0.22);
  color: #ff8f8f;
}

.mode-view {
  display: none;
}

.mode-view.active {
  display: block;
}

.korea-banner,
.viewer-list-section,
.admin-hero,
.my-page-hero,
.detail-empty,
.detail-card,
.panel {
  border-radius: var(--radius-xl);
}

.korea-banner {
  border: 0;
}

.viewer-list-section {
  border: 0;
}

.korea-banner {
  display: grid;
  grid-template-columns: 0.72fr 1.28fr;
  align-items: stretch;
  gap: 20px;
  padding: 26px;
  margin-bottom: 22px;
  overflow: hidden;
  background:
    radial-gradient(circle at top right, rgba(229, 9, 20, 0.12), transparent 22%),
    linear-gradient(180deg, #151515 0%, #0b0b0b 100%);
}

.banner-copy {
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.korea-banner > *,
.selected-overview > *,
.admin-layout > * {
  min-width: 0;
}

.banner-copy h1,
.selected-copy h2,
.section-row-head h3,
.admin-hero h2 {
  margin: 0;
  letter-spacing: -0.04em;
}

.banner-copy h1 {
  font-size: clamp(2.3rem, 4.4vw, 4.5rem);
  line-height: 0.95;
}

.lead,
.selected-description,
.detail-empty,
.file-info-list,
.check-list,
.field small {
  color: var(--muted);
  line-height: 1.7;
}

.lead {
  margin: 24px 0;
  font-size: 1.02rem;
  line-height: 1.85;
}

.banner-actions,
.banner-badges,
.selected-summary,
.section-row-head,
.tag-list,
.uploader-actions,
.admin-badges,
.banner-toolbar,
.auth-controls,
.auth-switch {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.auth-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  justify-self: end;
  min-width: 0;
  width: max-content;
  margin-left: auto;
  margin-right: 0;
  row-gap: 8px;
}

.auth-controls > * {
  flex: 0 0 auto;
}

.session-button {
  border: 1px solid var(--line);
  cursor: pointer;
  transition: background 180ms ease, border-color 180ms ease, transform 180ms ease, color 180ms ease;
}

.session-button:disabled {
  cursor: default;
  opacity: 1;
}

.session-button:not(:disabled):hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.16);
  color: var(--text);
}

.banner-actions,
.banner-badges {
  margin-top: 22px;
}

.banner-badges {
  display: none;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1;
}

.pill.strong {
  background: var(--accent-soft);
  color: #ffffff;
  font-weight: 800;
}

.banner-map-panel {
  display: grid;
  align-content: start;
  gap: 0;
  padding: 0;
  border-radius: 24px;
  background: transparent;
  border: 0 !important;
  outline: 0 !important;
  box-shadow: none;
  min-width: 0;
  overflow: hidden;
}

.banner-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1.3fr) minmax(180px, 220px) minmax(180px, 220px) auto;
  justify-content: space-between;
  align-items: end;
  gap: 16px;
  padding: 8px 0 20px;
  margin-bottom: 0;
}

.banner-search {
  display: flex;
  min-width: 0;
  width: 100%;
}

.collection-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  min-width: 0;
  margin-top: 22px;
}

.banner-toolbar .collection-summary {
  display: none;
}

.collection-summary-hero {
  margin-top: auto;
  padding-top: 22px;
}

.summary-chip {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  min-height: 74px;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.summary-chip span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.summary-chip strong {
  color: #fff;
  font-size: 1.04rem;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.summary-graph {
  position: relative;
  width: 100%;
  height: 8px;
  margin-top: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.summary-graph-fill {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(229, 9, 20, 0.65), rgba(255, 255, 255, 0.9));
  transition: width 220ms ease;
}

.summary-note {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

.search-field,
.filter-field,
#reset-map-button {
  min-width: 0;
}

.search-field {
  gap: 10px;
}

.filter-field {
  gap: 10px;
}

.search-field span,
.filter-field span {
  display: block;
  color: #f1f1f1;
  font-size: 0.92rem;
  font-weight: 800;
  line-height: 1.25;
  padding-left: 2px;
}

.search-field input,
.filter-field select,
#reset-map-button {
  width: 100%;
}

#reset-map-button {
  align-self: end;
  min-width: 160px;
  margin-top: 2px;
  border-color: rgba(229, 9, 20, 0.42);
  color: #e50914;
}

.world-map,
.mini-map {
  position: relative;
  width: 100%;
  overflow: hidden;
  border-radius: 24px;
  isolation: isolate;
  background: #111;
  clip-path: none;
  border: 0 !important;
  outline: 0 !important;
  box-shadow: none;
}

.banner-map-panel,
.mini-map,
.mini-map::after {
  border-color: transparent !important;
}

.world-map {
  display: block;
  min-height: 620px;
  border: 0 !important;
  box-shadow: none;
}

.mini-map {
  min-height: 320px;
}

.leaflet-container {
  width: 100%;
  height: 100%;
  background: #111;
  border-radius: inherit;
  border: 0 !important;
  outline: 0 !important;
  box-shadow: none !important;
}

.world-map *,
.mini-map * {
  border-color: transparent !important;
}

.world-map .leaflet-container,
.mini-map .leaflet-container {
  clip-path: none;
  border-radius: inherit;
}

.world-map::after,
.mini-map::after {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: 23px;
  background: none;
  border: 1px solid rgba(229, 9, 20, 0.42);
  box-shadow:
    0 0 0 1px rgba(229, 9, 20, 0.1),
    0 0 14px rgba(229, 9, 20, 0.18),
    0 0 28px rgba(229, 9, 20, 0.08);
  pointer-events: none;
  z-index: 40;
}

.leaflet-pane,
.leaflet-top,
.leaflet-bottom,
.leaflet-control {
  z-index: 10 !important;
}

.leaflet-control-attribution,
.leaflet-control-zoom a {
  background: rgba(28, 28, 28, 0.94) !important;
  color: rgba(214, 214, 214, 0.78) !important;
  border-color: rgba(110, 110, 110, 0.22) !important;
}

.leaflet-control-attribution a {
  color: rgba(150, 150, 150, 0.78) !important;
}

.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
  background: #181818;
  color: #f5f5f1;
}

.map-fallback {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  min-height: 300px;
  padding: 24px;
  text-align: center;
  color: var(--muted);
  background:
    radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.08), transparent 18%),
    linear-gradient(180deg, #101010 0%, #181818 100%);
}

.selection-strip {
  margin-bottom: 22px;
}

.detail-empty,
.detail-card {
  padding: 22px;
}

.detail-empty {
  text-align: center;
}

.detail-modal {
  position: fixed;
  inset: 0;
  z-index: 7000;
  display: block;
  padding: 28px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.detail-modal.hidden {
  display: none;
}

.detail-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.68);
  backdrop-filter: blur(10px);
}

.detail-modal-card {
  position: relative;
  z-index: 1;
  width: min(1040px, calc(100vw - 56px));
  max-height: calc(100dvh - 48px);
  margin: 0 auto;
  background: #131313;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  isolation: isolate;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.detail-modal-card::-webkit-scrollbar {
  width: 10px;
}

.detail-modal-card::-webkit-scrollbar-track {
  background: transparent;
}

.detail-modal-card::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  border: 2px solid transparent;
  background-clip: padding-box;
}

.detail-modal-card::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.28);
  border: 2px solid transparent;
  background-clip: padding-box;
}

.detail-modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  position: sticky;
  top: 0;
  z-index: 6;
  padding: 18px 22px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: #131313;
  backdrop-filter: blur(12px);
  box-shadow: 0 14px 24px rgba(19, 19, 19, 0.96);
}

.detail-modal-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
}

.selected-overview {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.selected-copy {
  padding: 10px 0 0;
  border-radius: 0;
  background: transparent;
  border: 0;
}

.selected-copy h2 {
  font-size: clamp(1.9rem, 2.8vw, 3rem);
  line-height: 1.02;
  margin: 0;
}

.selected-description {
  min-height: 0;
  margin: 14px 0 0;
}

.selected-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
  align-items: stretch;
}

.selected-summary div {
  min-width: 0;
  height: 100%;
  min-height: 110px;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 10px;
}

.selected-summary span {
  display: block;
  margin: 0;
  font-size: 0.78rem;
  color: #d0d0d0;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  line-height: 1.1;
}

.selected-summary strong {
  display: block;
  margin: 0;
  font-size: 1.06rem;
  line-height: 1.4;
  font-weight: 800;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.viewer-stage {
  min-height: 440px;
  border-radius: 24px;
  overflow: hidden;
  position: relative;
  background:
    radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.08), transparent 18%),
    linear-gradient(180deg, #111 0%, #1a1a1a 100%);
}

.viewer-stage canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.viewer-message {
  position: absolute;
  left: 18px;
  bottom: 18px;
  z-index: 3;
  max-width: min(420px, calc(100% - 36px));
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(10, 10, 10, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #f5f5f1;
  backdrop-filter: blur(10px);
  pointer-events: none;
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 18px;
}

.meta-grid div {
  padding: 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.meta-grid dt {
  margin-bottom: 6px;
  color: var(--muted);
  font-weight: 700;
}

.meta-grid dd {
  margin: 0;
  font-weight: 700;
}

.detail-block + .detail-block {
  margin-top: 18px;
}

.detail-block {
  padding: 16px 18px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.detail-block-plain {
  padding: 0;
  background: transparent;
  border: 0;
}

.detail-block > strong {
  display: block;
  margin-bottom: 12px;
  font-size: 0.96rem;
  letter-spacing: 0.02em;
}

.detail-image-section.hidden {
  display: none;
}

.detail-image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.detail-image-grid.single-image {
  grid-template-columns: 180px;
  justify-content: start;
}

.detail-image-card {
  margin: 0;
  overflow: hidden;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.detail-image-card img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: rgba(255, 255, 255, 0.03);
}

.detail-image-card figcaption {
  padding: 10px 12px 12px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.detail-image-grid.single-image .detail-image-card figcaption {
  display: none;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 700;
}

.file-info-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 16px;
  margin: 0;
  padding: 0;
}

.file-info-list li {
  padding: 2px 0;
  border-radius: 0;
  background: transparent;
  border: 0;
  color: rgba(245, 245, 241, 0.92);
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.search-field,
.filter-field,
.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.search-field input,
.filter-field select,
.field input,
.field textarea {
  min-height: 48px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.address-search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.checkbox-field {
  min-height: auto;
}

.checkbox-row {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  line-height: 1.5;
}

.checkbox-row input {
  width: 18px;
  height: 18px;
  min-height: auto;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.address-search-row .ghost-button {
  min-width: 132px;
}

.filter-field select option {
  background: #171717;
  color: #f5f5f1;
}

.filter-field select:focus,
.search-field input:focus,
.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.28);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.08);
}

.field textarea {
  min-height: 126px;
  resize: vertical;
}

.search-field input::placeholder,
.field input::placeholder,
.field textarea::placeholder {
  color: #8c8c8c;
}

.auth-modal-card,
.payment-modal-card {
  position: relative;
  z-index: 1;
  width: min(520px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  margin: 0 auto;
  padding: 22px;
  overflow-y: auto;
}

.auth-form {
  margin-top: 18px;
}

.auth-form.hidden {
  display: none !important;
}

.auth-note {
  margin: 18px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.payment-summary {
  margin-top: 14px;
}

.payment-price-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-top: 18px;
  padding: 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.payment-price-card span {
  color: var(--muted);
  font-weight: 700;
}

.payment-price-card strong {
  font-size: 1.4rem;
}

.payment-confirmation {
  margin-top: 18px;
  padding: 16px 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.payment-confirmation strong {
  display: block;
  margin-bottom: 8px;
}

.payment-confirmation p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.payment-modal-card .form-actions {
  margin-top: 20px;
}

.payment-modal-card .primary-button {
  padding-inline: 24px;
  letter-spacing: 0.01em;
}

.filter-field span,
.field span {
  font-weight: 700;
}

.viewer-list-section,
.panel {
  padding: 22px;
  overflow: hidden;
}

.detail-card.detail-modal-card {
  padding: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.detail-card.detail-modal-card > *:not(.detail-modal-head):not(.detail-modal-footer) {
  padding-left: 22px;
  padding-right: 22px;
}

.detail-modal-footer {
  position: sticky;
  bottom: 0;
  z-index: 6;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 16px;
  margin-top: 22px;
  padding: 14px 22px 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: #131313;
  backdrop-filter: blur(12px);
  box-shadow: 0 -14px 24px rgba(19, 19, 19, 0.96);
}

.detail-price-chip {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 148px;
  padding: 12px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.detail-price-chip span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.detail-price-chip strong {
  margin-top: 4px;
  font-size: 1.02rem;
}

.section-row-head {
  justify-content: space-between;
  margin-bottom: 16px;
}

.section-row-head.compact {
  margin-bottom: 12px;
}

.section-row-head h3 {
  font-size: clamp(1.4rem, 2.2vw, 1.95rem);
}

.viewer-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
}

.viewer-row-card {
  border-radius: 22px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
}

.asset-card-button {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
  height: 100%;
  padding: 14px 14px 66px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  text-align: left;
  align-items: stretch;
  color: var(--text);
  background:
    linear-gradient(135deg, rgba(229, 9, 20, 0.08), rgba(255, 255, 255, 0.02)),
    #141414;
}

.asset-preview {
  min-width: 0;
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 18px;
  overflow: hidden;
  background: #000;
  border: 0;
  box-shadow: none;
}

.asset-card-button.active,
.uploader-card-button.active {
  outline: 2px solid rgba(229, 9, 20, 0.42);
}

.asset-preview-canvas {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: transparent;
}

.asset-card-body {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-self: stretch;
  gap: 8px;
  min-width: 0;
  flex: 1 1 auto;
}

.asset-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 8px;
}

.asset-price {
  margin: 2px 0 0;
  color: #f5f5f1;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.asset-title,
.uploader-card-title {
  margin: 0;
  font-size: 1.08rem;
  line-height: 1.35;
  font-weight: 800;
  color: #f5f5f1;
}

.asset-description {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.asset-title {
  overflow-wrap: anywhere;
}

.asset-tags {
  margin-top: auto;
}

.asset-card-actions {
  position: absolute;
  right: 16px;
  bottom: 16px;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 14px;
  justify-content: flex-end;
  padding: 0;
}

.asset-action-price {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #f5f5f1;
  font-size: 0.92rem;
  font-weight: 800;
  line-height: 1;
}

.asset-download-button {
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  align-self: flex-end;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.18);
  position: relative;
  z-index: 4;
}

.admin-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  padding: 22px;
  margin-bottom: 24px;
}

.admin-hero h2 {
  font-size: clamp(2rem, 3vw, 3rem);
  line-height: 1;
}

.admin-layout {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 20px;
}

.admin-side-panel {
  display: grid;
  gap: 18px;
  align-content: start;
}

.admin-section-card {
  padding: 18px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.asset-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.field-wide {
  grid-column: 1 / -1;
}

.field-inline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.admin-search-field {
  margin-top: 14px;
  margin-bottom: 14px;
}

.check-list {
  margin: 12px 0 0;
  padding-left: 18px;
}

.uploader-asset-list {
  display: grid;
  gap: 12px;
  max-height: 340px;
  overflow: auto;
  padding-right: 4px;
}

.member-access-list {
  display: grid;
  gap: 10px;
  max-height: 280px;
  overflow: auto;
  margin-top: 12px;
}

.member-access-card {
  display: grid;
  gap: 10px;
  padding: 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.member-access-card strong {
  font-size: 0.98rem;
}

.member-access-meta {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
  white-space: pre-line;
}

.member-access-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.my-page-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  padding: 22px;
  margin-bottom: 24px;
  border-radius: var(--radius-xl);
  background:
    radial-gradient(circle at top right, rgba(229, 9, 20, 0.12), transparent 22%),
    linear-gradient(180deg, #151515 0%, #0b0b0b 100%);
}

.my-page-hero h2 {
  font-size: clamp(2rem, 3vw, 3rem);
  line-height: 1.02;
  margin: 0;
}

.my-page-layout {
  display: grid;
  grid-template-columns: 0.92fr 1.08fr;
  gap: 20px;
}

.my-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.mypage-meta-grid {
  margin-top: 0;
}

.mypage-account-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 18px;
}

.purchase-list {
  display: grid;
  gap: 12px;
}

.purchase-card {
  display: grid;
  gap: 10px;
  padding: 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.purchase-card strong {
  font-size: 1rem;
}

.uploader-card-button {
  width: 100%;
  display: grid;
  gap: 8px;
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  text-align: left;
}

.uploader-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.uploader-card-meta {
  display: block;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.uploader-card-meta-primary {
  color: #ecece8;
}

.uploader-card-button.active {
  background: rgba(229, 9, 20, 0.12);
  border-color: rgba(229, 9, 20, 0.28);
}

.admin-selected-summary {
  min-height: 160px;
}

.admin-selected-card {
  display: grid;
  gap: 14px;
}

.admin-selected-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.admin-selected-title {
  display: block;
  font-size: 1.02rem;
  line-height: 1.4;
  margin-bottom: 4px;
}

.admin-selected-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
}

.admin-selected-grid div {
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.admin-selected-grid dt {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 0.82rem;
}

.admin-selected-grid dd {
  margin: 0;
  color: var(--text);
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.admin-selected-description {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.empty-state {
  padding: 26px 16px;
  text-align: center;
  border: 1px dashed rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  color: var(--muted);
}

@media (max-width: 1240px) {
  .korea-banner,
  .selected-overview,
  .admin-layout,
  .my-page-layout {
    grid-template-columns: 1fr;
  }

  .detail-modal-card {
    width: min(960px, calc(100vw - 32px));
  }

  .viewer-stage {
    min-height: 360px;
  }

  .world-map {
    min-height: 480px;
  }

  .banner-toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
  }

  .banner-search {
    grid-column: 1 / -1;
  }

  #reset-map-button {
    grid-column: 1 / -1;
    min-width: 0;
  }
}

@media (max-width: 820px) {
  .app-shell {
    width: min(100% - 18px, 1540px);
    padding-top: 16px;
  }

  .detail-modal {
    padding: 12px;
  }

  .detail-modal-card {
    width: min(100vw - 24px, 100%);
    max-height: calc(100dvh - 24px);
    border-radius: 22px;
  }

  .detail-card {
    padding: 18px;
  }

  .detail-card.detail-modal-card {
    padding: 0;
  }

  .detail-card.detail-modal-card > *:not(.detail-modal-head):not(.detail-modal-footer) {
    padding-left: 18px;
    padding-right: 18px;
  }

  .file-info-list {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .detail-modal-head {
    padding: 16px 18px 14px;
    align-items: flex-start;
  }

  .brand-block,
  .admin-hero,
  .my-page-hero,
  .section-row-head,
  .field-inline {
    flex-direction: column;
    align-items: flex-start;
  }

  .topbar {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 24px;
  }

  .mode-switch,
  .asset-form,
  .meta-grid,
  .my-summary-grid {
    display: grid;
    grid-template-columns: 1fr;
  }

  .mode-switch {
    display: flex;
    grid-template-columns: none;
  }

  .uploader-card-head,
  .admin-selected-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .admin-selected-grid {
    grid-template-columns: 1fr;
  }

  .address-search-row {
    grid-template-columns: 1fr;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
    flex-basis: 38px;
  }

  .brand-title {
    font-size: 0.92rem;
    letter-spacing: 0.04em;
  }

  .eyebrow {
    margin-bottom: 6px;
    font-size: 0.7rem;
  }

  .mode-switch {
    justify-content: flex-end;
    gap: 8px;
  }

  .mode-button,
  .primary-button,
  .ghost-button,
  .session-button {
    min-height: 38px;
    padding: 0 14px;
    font-size: 0.92rem;
  }

  .mode-toggle-button {
    min-width: 164px;
    padding-left: 48px;
  }

  .session-button {
    max-width: 170px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .auth-controls .ghost-button,
  .auth-controls .session-button {
    flex: 0 1 auto;
  }

  #request-console-access-button {
    display: none !important;
  }

  .korea-banner {
    grid-template-columns: 1fr;
    padding: 18px;
  }

  .banner-toolbar {
    grid-template-columns: 1fr;
  }

  .banner-copy h1 {
    font-size: 2.35rem;
  }

  .selected-copy h2 {
    font-size: 2rem;
  }

  .selected-description {
    min-height: auto;
  }

  .selected-copy,
  .detail-block {
    padding: 14px 14px;
    border-radius: 18px;
  }

  .world-map {
    min-height: 400px;
  }

  .viewer-stage {
    min-height: 280px;
  }

  .asset-preview {
    aspect-ratio: 16 / 11;
  }

  .selected-summary div,
  .banner-search,
  .filter-field,
  .search-field {
    width: 100%;
  }

  .selected-summary {
    grid-template-columns: 1fr;
  }

  .viewer-list {
    grid-template-columns: 1fr;
  }

  .detail-modal-actions {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .asset-card-actions {
    left: 16px;
    right: 16px;
    justify-content: space-between;
  }

  .detail-modal-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .detail-price-chip,
  .detail-modal-actions .primary-button,
  .detail-modal-actions .ghost-button {
    width: 100%;
  }

  .detail-close-button {
    width: auto;
    min-width: 88px;
  }
}

@media (max-width: 560px) {
  .topbar {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 10px 12px;
  }

  .auth-controls {
    width: 100%;
    justify-content: space-between;
    gap: 8px;
  }

  .brand-title {
    font-size: 0.84rem;
  }

  .mode-toggle-button {
    width: 100%;
    min-width: 0;
  }

  .auth-controls .session-button {
    max-width: 138px;
  }

  .auth-controls .ghost-button {
    padding: 0 12px;
    font-size: 0.88rem;
  }

  .detail-modal {
    padding: 8px;
  }

  .detail-modal-card {
    width: calc(100vw - 16px);
    max-height: calc(100dvh - 16px);
  }

  .detail-card {
    padding: 14px;
  }

  .detail-card.detail-modal-card {
    padding: 0;
  }

  .detail-card.detail-modal-card > *:not(.detail-modal-head):not(.detail-modal-footer) {
    padding-left: 14px;
    padding-right: 14px;
  }

  .detail-modal-head {
    padding: 14px 14px 12px;
    margin-bottom: 14px;
  }

  .selected-summary {
    gap: 8px;
  }

  .selected-summary div {
    min-width: 0;
    padding: 12px;
  }

  .selected-copy,
  .detail-block {
    padding: 12px;
  }

  .asset-action-price {
    padding: 0 12px;
    font-size: 0.88rem;
  }

  .viewer-stage {
    min-height: 220px;
    border-radius: 18px;
  }

  .meta-grid div {
    padding: 14px;
  }
}
