@font-face {
  font-family: "Pretendard Variable";
  font-weight: 45 920;
  font-style: normal;
  font-display: swap;
  src: url("./fonts/PretendardVariable.woff2") format("woff2-variations");
}

:root {
  /* 뉴트럴 */
  --bg: #f7f8fa;
  --surface: #ffffff;
  --surface-soft: #f1f4f8;
  --ink: #1b1f27;
  --muted: #6b7280;
  --line: #e6e9ef;
  --line-strong: #d5dae3;

  /* 포인트 */
  --accent: #2f5fe0;
  --accent-strong: #2650c4;
  --accent-soft: #ecf1fe;
  --accent-ink: #1e46b4;

  /* 메달: 옅은 배경 + 진한 글자 */
  --gold-bg: #fdf1d2;
  --gold-ink: #8a5a00;
  --silver-bg: #eceff4;
  --silver-ink: #4b5563;
  --bronze-bg: #f7e5d7;
  --bronze-ink: #8a4b17;

  /* 깊이 */
  --radius-sm: 8px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(23, 26, 31, 0.05);
  --shadow-md: 0 8px 24px rgba(23, 26, 31, 0.08);
  --focus-ring: 0 0 0 3px rgba(47, 95, 224, 0.28);
  --content-max: 1640px;
  --content-gutter: clamp(48px, 7vw, 160px);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family:
    "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea {
  font: inherit;
}

:is(a, button, input, textarea):focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 2000;
  padding: 10px 14px;
  color: #fff;
  background: var(--accent);
  border-radius: var(--radius-md);
  font-weight: 700;
  transform: translateY(-150%);
  transition: transform 120ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

/* ===== 헤더 ===== */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 64px;
  padding: 12px max(calc((100% - var(--content-max)) / 2), calc(var(--content-gutter) / 2));
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: var(--radius-md);
}

.brand-logo {
  display: block;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border-radius: 10px;
  object-fit: cover;
}
.brand-logo[hidden] { display: none !important; }

.brand-name {
  position: relative;
  display: inline-flex;
  align-items: center;
  color: var(--ink);
  font-size: 24px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.035em;
}

.brand-name::after {
  position: absolute;
  right: 1px;
  bottom: -7px;
  left: 2px;
  height: 4px;
  background: linear-gradient(90deg, rgba(47, 95, 224, 0.18), rgba(47, 95, 224, 0.02));
  border-radius: 999px;
  content: "";
}

.brand-tag {
  padding: 3px 8px;
  color: var(--accent-ink);
  background: var(--accent-soft);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent-ink);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 20px;
  line-height: 1.2;
}

h2 {
  margin-bottom: 0;
  font-size: 17px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.visitor-count {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin: 0 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.visitor-count strong {
  color: var(--ink);
  font-weight: 700;
}

.visitor-dot {
  width: 7px;
  height: 7px;
  background: #22a06b;
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(34, 160, 107, 0.12);
}

.header-actions a,
.header-actions button,
.panel-heading button,
.editor-heading button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 14px;
  color: #ffffff;
  background: var(--accent);
  border: 0;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 120ms ease;
}

.header-actions a:hover,
.header-actions button:hover,
.panel-heading button:hover,
.editor-heading button:hover {
  background: var(--accent-strong);
}

.panel-heading button:disabled,
.editor-heading button:disabled {
  cursor: default;
  opacity: 0.4;
}

.header-actions button {
  background: var(--surface-soft);
  color: var(--ink);
  border: 1px solid var(--line-strong);
}

.header-actions button:hover {
  background: var(--surface-soft);
}

/* 비즈니스 문의 링크가 설정되지 않았으면 회색 버튼 대신 아예 숨긴다 */
.header-actions a.is-disabled {
  display: none;
}

/* ===== 공개 헤더 ===== */

.public-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  gap: 24px;
  min-height: 72px;
  padding-block: 0;
  box-shadow: 0 1px 0 rgba(23, 26, 31, 0.02);
}

.public-header .visitor-count {
  padding-left: 20px;
  border-left: 1px solid var(--line);
}

.site-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
  gap: 12px;
}

.category-picker {
  position: relative;
  padding: 14px max(calc((100% - 1120px) / 2), 20px);
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.category-picker-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: stretch;
  gap: 10px;
  max-width: 1120px;
  margin-inline: auto;
}

.category-nav {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(78px, 1fr));
  align-items: stretch;
  min-width: 0;
  gap: 8px;
  max-width: 1120px;
  margin-inline: auto;
}

.category-nav button,
.category-nav a {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 0;
  min-height: 64px;
  padding: 8px 10px;
  color: var(--muted);
  background: var(--surface-soft);
  border: 1px solid transparent;
  border-radius: 16px;
  font-size: 13px;
  font-weight: 650;
  white-space: nowrap;
  cursor: pointer;
  transition: color 140ms ease, background-color 140ms ease, border-color 140ms ease, transform 140ms ease;
}

.category-nav button:hover,
.category-nav a:hover {
  color: var(--ink);
  background: #f0f4ff;
  border-color: #d6e0fa;
  transform: translateY(-1px);
}

.category-nav button.is-active {
  color: var(--accent-ink);
  background: var(--accent-soft);
  border-color: #b7ccf5;
  box-shadow: inset 0 -3px 0 rgba(47, 95, 224, 0.18);
}

.category-icon {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  overflow: hidden;
  border-radius: 9px;
  font-size: 22px;
  line-height: 1;
}

.category-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.category-label {
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.inquiry-nav-link {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding-inline: 16px;
  color: #ffffff;
  background: var(--accent);
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 650;
  white-space: nowrap;
}

.category-nav-empty {
  color: var(--muted);
  font-size: 13px;
}

/* ===== 공개 화면 좌우 배너 ===== */

.side-banner-rail {
  display: none;
}

@media (min-width: 1500px) {
  .side-banner-rail {
    position: fixed;
    z-index: 8;
    top: 190px;
    display: flex;
    width: 140px;
    max-height: calc(100vh - 220px);
    flex-direction: column;
    gap: 12px;
    overflow-y: auto;
    scrollbar-width: none;
  }

  .side-banner-rail::-webkit-scrollbar {
    display: none;
  }

  .side-banner-left {
    left: max(18px, calc(50% - 720px));
  }

  .side-banner-right {
    right: max(18px, calc(50% - 720px));
  }

  .side-banner-item {
    display: block;
    flex: 0 0 auto;
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: var(--shadow-sm);
  }

  a.side-banner-item:hover {
    border-color: #b7ccf5;
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
  }

  .side-banner-item img {
    display: block;
    width: 100%;
    max-height: 280px;
    object-fit: cover;
  }
}

.all-categories-toggle {
  align-self: start;
  min-width: 118px;
  min-height: 64px;
  padding: 0 14px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.all-categories-toggle::after {
  display: inline-block;
  margin-left: 7px;
  content: "⌄";
  transition: transform 140ms ease;
}

.all-categories-toggle.is-open {
  color: var(--accent-ink);
  background: var(--accent-soft);
  border-color: #b7ccf5;
}

.all-categories-toggle.is-open::after {
  transform: rotate(180deg);
}

.all-categories-panel {
  position: absolute;
  z-index: 20;
  top: calc(100% - 4px);
  right: max(calc((100% - 1120px) / 2), 20px);
  left: max(calc((100% - 1120px) / 2), 20px);
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 0 0 18px 18px;
  box-shadow: var(--shadow-md);
}

.all-categories-heading {
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
  font-size: 14px;
}

.all-categories-heading span {
  color: var(--muted);
  font-size: 12px;
}

.all-categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 8px;
  max-height: min(420px, 60vh);
  overflow-y: auto;
}

.all-category-item {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  min-height: 48px;
  padding: 8px 10px;
  color: var(--muted);
  background: var(--surface-soft);
  border: 1px solid transparent;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
}

.all-category-item:hover,
.all-category-item.is-active {
  color: var(--accent-ink);
  background: var(--accent-soft);
  border-color: #b7ccf5;
}

.all-category-item .category-icon {
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  font-size: 20px;
}

.inquiry-nav-link:hover,
.inquiry-nav-link.is-active {
  color: #ffffff;
  background: var(--accent-strong);
}

.mobile-menu-toggle {
  display: none;
  width: 42px;
  height: 42px;
  padding: 10px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
}

.mobile-menu-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  margin: 4px 0;
  background: var(--ink);
  border-radius: 999px;
}

/* ===== 관리자 잠금 ===== */

.admin-lock {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(247, 248, 250, 0.94);
  backdrop-filter: blur(10px);
}

.admin-lock.is-visible {
  display: flex;
}

.login-card {
  width: min(420px, 100%);
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.login-card h1 {
  margin-bottom: 10px;
  font-size: 22px;
}

.login-help {
  margin-bottom: 22px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.login-card button {
  width: 100%;
  min-height: 44px;
  margin-top: 14px;
  color: #ffffff;
  background: var(--accent);
  border: 0;
  border-radius: var(--radius-md);
  font-weight: 700;
  cursor: pointer;
}

.login-card button:hover {
  background: var(--accent-strong);
}

.login-error {
  min-height: 20px;
  margin: 8px 0 0;
  color: #b42318;
  font-size: 13px;
  font-weight: 600;
}

.login-card input + input {
  margin-top: 14px;
}

.login-error:empty {
  display: none;
}

/* ===== 공개 페이지 레이아웃 ===== */

main {
  width: 100%;
  margin: 0 auto;
  padding: clamp(18px, 4vw, 42px);
}

.public-main {
  width: min(1120px, calc(100% - 40px));
  padding: clamp(40px, 6vw, 76px) 0 72px;
}

.ranking-intro {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.ranking-intro h1 {
  margin: 0 0 10px;
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.12;
  letter-spacing: -0.04em;
}

.ranking-intro > div > p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
}

.ranking-count {
  margin: 0 0 3px;
  color: var(--accent-ink);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.05em;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: min(var(--content-max), calc(100% - var(--content-gutter)));
  margin-inline: auto;
  margin-bottom: 16px;
}

.toolbar h2 {
  font-size: 17px;
  font-weight: 700;
}

.toolbar-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.page-chip {
  margin: 0;
  padding: 6px 10px;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  transition: background-color 120ms ease, transform 120ms ease;
}

.icon-button:hover:not(:disabled) {
  background: var(--surface-soft);
  color: var(--ink);
}

.icon-button:active:not(:disabled) {
  transform: scale(0.96);
}

.icon-button:disabled {
  cursor: default;
  opacity: 0.35;
}

/* ===== 캐러셀 ===== */

.rank-board-shell {
  position: relative;
  overflow: hidden;
  width: min(var(--content-max), calc(100% - var(--content-gutter)));
  margin: 0 auto;
}

.public-main .rank-board-shell {
  width: 100%;
  overflow: visible;
}

.public-main .rank-board {
  display: block;
  padding: 0;
  opacity: 1;
  transform: translateY(0);
  transition: opacity 140ms ease, transform 140ms ease;
}

.public-main .rank-board.is-leaving {
  opacity: 0;
  transform: translateY(8px);
}

.public-main .rank-board.is-entering .rank-item {
  animation: rank-item-enter 420ms cubic-bezier(0.22, 0.61, 0.36, 1) both;
  animation-delay: var(--rank-delay, 0ms);
}

@keyframes rank-item-enter {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.rank-board-shell::before,
.rank-board-shell::after {
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 2;
  width: 100px;
  pointer-events: none;
  content: "";
  opacity: 0;
  transition: opacity 180ms ease;
}

.rank-board-shell::before {
  left: 0;
  background: linear-gradient(90deg, var(--bg) 8%, rgba(247, 248, 250, 0));
}

.rank-board-shell::after {
  right: 0;
  background: linear-gradient(270deg, var(--bg) 8%, rgba(247, 248, 250, 0));
}

.rank-board-shell.has-prev::before,
.rank-board-shell.has-next::after {
  opacity: 1;
}

.rank-board {
  display: flex;
  gap: 16px;
  padding: 6px 2px 14px;
  transition: transform 320ms cubic-bezier(0.22, 0.61, 0.36, 1);
  will-change: transform;
}

.empty-state {
  flex: 1 1 100%;
  display: grid;
  align-content: center;
  justify-items: center;
  min-height: 420px;
  padding: 40px 24px;
  text-align: center;
  background: var(--surface);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-lg);
}

.empty-state h3 {
  margin: 0 0 10px;
  font-size: 20px;
}

.empty-state p:last-child,
.empty-admin-state,
.empty-editor-state p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.6;
}

/* ===== 카테고리 카드 ===== */

.category-card {
  flex: 0 0 calc((100% - 64px) / 4.5);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

@media (hover: hover) {
  .category-card {
    transition: box-shadow 160ms ease, transform 160ms ease;
  }

  .category-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
  }
}

.category-card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 13px 16px;
  background: var(--surface-soft);
  border-bottom: 1px solid var(--line);
}

.category-card h3 {
  overflow: hidden;
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-list {
  display: grid;
  gap: 0;
  padding: 6px;
}

.rank-item {
  display: grid;
  grid-template-columns: 26px 28px minmax(0, 1fr) 16px;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  transition: background-color 120ms ease;
}

a.rank-item::after {
  content: "↗";
  color: var(--accent-ink);
  font-size: 13px;
  font-weight: 600;
  opacity: 0;
  transition: opacity 120ms ease;
}

a.rank-item:hover,
a.rank-item:focus-visible {
  background: var(--accent-soft);
}

a.rank-item:hover .rank-name,
a.rank-item:focus-visible .rank-name {
  color: var(--accent-ink);
}

a.rank-item:hover::after,
a.rank-item:focus-visible::after {
  opacity: 1;
}

.rank-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  color: var(--muted);
  background: var(--surface-soft);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.rank-item:nth-child(1) .rank-number {
  color: var(--gold-ink);
  background: var(--gold-bg);
}

.rank-item:nth-child(2) .rank-number {
  color: var(--silver-ink);
  background: var(--silver-bg);
}

.rank-item:nth-child(3) .rank-number {
  color: var(--bronze-ink);
  background: var(--bronze-bg);
}

.favicon {
  display: block;
  width: 28px;
  height: 28px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.rank-copy {
  min-width: 0;
}

.rank-name {
  display: block;
  overflow: hidden;
  color: var(--ink);
  font-size: 15px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 1~3위는 이름도 한 단계 굵게 */
.rank-item:nth-child(-n + 3) .rank-name {
  font-weight: 700;
}

/* 아직 채워지지 않은 슬롯 */
.rank-item-empty {
  cursor: default;
  opacity: 0.5;
}

.rank-item-empty .favicon {
  background: transparent;
  border-style: dashed;
  border-radius: 50%;
}

.rank-item-empty .rank-name {
  color: var(--muted);
  font-weight: 500;
}

/* ===== 선택형 공개 랭킹 ===== */

.public-rank-list {
  overflow: hidden;
  padding: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow-sm);
}

.public-rank-list .rank-item {
  grid-template-columns: 42px 42px minmax(0, 1fr);
  gap: 16px;
  min-height: 78px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
}

.public-rank-list .rank-item:last-child {
  border-bottom: 0;
}

.public-rank-list a.rank-item::after {
  display: none;
}

.public-rank-list a.rank-item:hover,
.public-rank-list a.rank-item:focus-visible {
  border-radius: var(--radius-md);
}

.public-rank-list .rank-number {
  width: 38px;
  height: 38px;
  font-size: 14px;
}

.public-rank-list .favicon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
}

.rank-description {
  display: block;
  overflow: hidden;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 450;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-link-label {
  justify-self: end;
  padding: 8px 12px;
  color: var(--accent-ink);
  background: var(--accent-soft);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.rank-item-empty .rank-link-label {
  color: var(--muted);
  background: var(--surface-soft);
}

/* ===== 제휴문의 ===== */

.inquiry-main {
  width: min(1240px, calc(100% - 40px));
  padding: clamp(40px, 6vw, 72px) 0 80px;
}

.inquiry-hero {
  margin-bottom: 28px;
}

.inquiry-hero h1 {
  margin: 0 0 10px;
  font-size: clamp(30px, 4vw, 44px);
  letter-spacing: -0.04em;
}

.inquiry-hero > p:last-child {
  margin: 0;
  color: var(--muted);
}

.inquiry-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(420px, 1.1fr);
  align-items: start;
  gap: 20px;
}

.inquiry-panel {
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow-sm);
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.section-heading h2 {
  margin: 0;
  font-size: 20px;
}

.section-kicker {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.private-badge {
  padding: 6px 10px;
  color: var(--accent-ink);
  background: var(--accent-soft);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 750;
}

.inquiry-list {
  display: grid;
  gap: 8px;
}

.inquiry-list-item {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) 16px;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 68px;
  padding: 10px 12px;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  cursor: pointer;
}

.inquiry-list-item:hover {
  background: var(--surface-soft);
  border-color: var(--line-strong);
}

.lock-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: var(--accent-ink);
  background: var(--accent-soft);
  border-radius: 50%;
  font-size: 19px;
  font-weight: 800;
}

.inquiry-list-copy {
  min-width: 0;
}

.inquiry-list-copy strong,
.inquiry-list-copy span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inquiry-list-copy strong {
  margin-bottom: 5px;
  font-size: 14px;
}

.inquiry-list-copy span,
.inquiry-list-arrow {
  color: var(--muted);
  font-size: 12px;
}

.inquiry-list-arrow {
  font-size: 20px;
}

.inquiry-list-notice {
  padding: 42px 20px;
  color: var(--muted);
  text-align: center;
  background: var(--surface-soft);
  border-radius: 12px;
  font-size: 14px;
}

.inquiry-list-notice.is-error {
  color: #b42318;
}

.inquiry-form > .field-label:not(:first-child) {
  margin-top: 16px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 16px;
}

textarea {
  width: 100%;
  min-height: 150px;
  padding: 12px;
  color: var(--ink);
  background: #ffffff;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  outline: none;
  resize: vertical;
}

textarea:focus {
  border-color: var(--accent);
  box-shadow: var(--focus-ring);
}

.form-notice {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.form-status {
  min-height: 20px;
  margin: 8px 0;
  color: #1b7a3d;
  font-size: 13px;
  font-weight: 650;
}

.form-status.is-error {
  color: #b42318;
}

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 46px;
  padding: 0 18px;
  color: #ffffff;
  background: var(--accent);
  border: 0;
  border-radius: var(--radius-md);
  font-weight: 700;
  cursor: pointer;
}

.primary-button:hover {
  background: var(--accent-strong);
}

.primary-button:disabled {
  cursor: wait;
  opacity: 0.6;
}

.honeypot {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.unlock-dialog {
  width: min(520px, calc(100% - 32px));
  padding: 30px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 24px 80px rgba(23, 26, 31, 0.2);
}

.unlock-dialog::backdrop {
  background: rgba(17, 24, 39, 0.48);
  backdrop-filter: blur(4px);
}

.unlock-dialog h2 {
  margin: 0 0 8px;
  font-size: 24px;
}

.dialog-help {
  margin-bottom: 22px;
  color: var(--muted);
  font-size: 14px;
}

.dialog-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  padding: 0;
  color: var(--muted);
  background: var(--surface-soft);
  border: 0;
  border-radius: 50%;
  font-size: 22px;
  cursor: pointer;
}

.inquiry-meta {
  display: grid;
  gap: 8px;
  margin: 22px 0;
  padding: 14px;
  background: var(--surface-soft);
  border-radius: 12px;
}

.inquiry-meta > div {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 8px;
}

.inquiry-meta dt {
  color: var(--muted);
  font-size: 13px;
}

.inquiry-meta dd {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
}

.inquiry-content {
  max-height: 45vh;
  overflow-y: auto;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.75;
  white-space: pre-wrap;
}

/* ===== 관리자 페이지 ===== */

.admin-main {
  width: min(1500px, 100%);
  margin-inline: auto;
}

.admin-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
  padding: 5px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.admin-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 40px;
  padding: 0 16px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 9px;
  font-weight: 700;
  cursor: pointer;
}

.admin-tab.is-active {
  color: var(--accent-ink);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.admin-tab-count {
  min-width: 20px;
  padding: 2px 6px;
  color: #ffffff;
  background: #d92d20;
  border-radius: 999px;
  font-size: 11px;
  line-height: 16px;
}

.admin-view[hidden] {
  display: none;
}

.admin-layout {
  display: grid;
  grid-template-columns: 290px 1fr;
  gap: 18px;
}

.category-panel,
.editor-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.category-panel {
  padding: 14px;
}

.editor-panel {
  padding: 18px;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.panel-heading h2 {
  font-size: 16px;
}

.panel-help {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.category-list {
  display: grid;
  gap: 8px;
}

.empty-admin-state,
.empty-editor-state {
  padding: 18px;
  background: var(--surface-soft);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-md);
}

.category-row {
  display: grid;
  grid-template-columns: 1fr 32px 32px 36px;
  gap: 6px;
}

.category-row button {
  min-height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
}

.category-row button:disabled {
  cursor: default;
  opacity: 0.35;
}

.move-category-up,
.move-category-down {
  padding: 0;
  color: var(--muted);
  font-weight: 700;
}

.category-row .select-category {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
  justify-content: flex-start;
  padding: 0 12px;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
}

.category-row-icon {
  flex: 0 0 auto;
  font-size: 18px;
}

.category-row-image {
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  border-radius: 7px;
  object-fit: cover;
}

.category-row-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.category-state-badge {
  margin-left: auto;
  padding: 2px 5px;
  color: var(--accent-ink);
  background: #dfe9ff;
  border-radius: 999px;
  font-size: 10px;
  line-height: 1.4;
}

.category-state-badge.is-muted {
  color: var(--muted);
  background: var(--surface-soft);
}

.category-row.is-active .select-category {
  color: var(--accent-ink);
  background: var(--accent-soft);
  border-color: #b7ccf5;
  font-weight: 700;
}

.delete-category {
  color: #a92e2e;
  font-weight: 700;
}

.field-label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.category-meta-fields {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 12px;
}

.field-help {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.category-media-fields {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  margin-top: 16px;
  padding: 14px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.category-image-preview {
  display: grid;
  width: 64px;
  height: 64px;
  place-items: center;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  font-size: 30px;
}

.category-image-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.editorial-admin-fields { display: grid; gap: 14px; margin: 22px 0; padding: 18px; border: 1px solid #d8dfdb; border-radius: 10px; background: #f8faf8; }
.editorial-admin-fields h2 { margin: 0; font-size: 18px; }
.editorial-admin-fields .panel-help { margin: -7px 0 2px; }
.editorial-admin-fields textarea { min-height: 76px; }
.editorial-image-field { display: grid; grid-template-columns: minmax(100px, 180px) minmax(0, 1fr); gap: 16px; align-items: center; }
.editorial-image-preview { width: 100%; aspect-ratio: 2.3; overflow: hidden; border: 1px solid #d8dfdb; border-radius: 7px; background: #293121; }
.editorial-image-preview img { display: block; width: 100%; height: 100%; object-fit: cover; }
.editorial-image-field input[type=file] { max-width: 100%; }
.editorial-image-field .check-field { margin-top: 8px; }
@media (max-width: 620px) { .editorial-image-field { grid-template-columns: 1fr; } .editorial-image-preview { max-width: 240px; } }

.category-image-controls input[type="file"] {
  min-height: 0;
  padding: 8px;
  font-size: 12px;
}

.category-option-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: 14px;
}

.check-field {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.check-field input[type="checkbox"] {
  width: 17px;
  min-height: 17px;
  height: 17px;
  margin: 0;
  accent-color: var(--accent);
}

input {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  color: var(--ink);
  background: #ffffff;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  outline: none;
}

input:focus {
  border-color: var(--accent);
  box-shadow: var(--focus-ring);
}

.editor-heading {
  margin-top: 22px;
  margin-bottom: 0;
}

.editor-actions {
  display: flex;
  gap: 8px;
}

.editor-heading .secondary-button {
  color: var(--accent-ink);
  background: var(--accent-soft);
  border: 1px solid #b7ccf5;
}

.save-status {
  min-height: 20px;
  margin: 8px 0 14px;
  color: #1b7a3d;
  font-size: 13px;
  font-weight: 600;
}

.save-status.is-error {
  color: #b42318;
}

/* ===== 관리자 접속 인원·배너 ===== */

.management-layout {
  display: grid;
  grid-template-columns: minmax(320px, 0.72fr) minmax(480px, 1.28fr);
  gap: 18px;
}

.management-editor,
.management-list-panel {
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.management-form {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.password-editor {
  width: min(100%, 520px);
  margin-inline: auto;
}

.password-editor h2 {
  margin: 0 0 8px;
}

.password-editor .management-form button[type="submit"] {
  justify-self: start;
  min-height: 42px;
  padding: 0 18px;
  color: #fff;
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 8px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.password-editor .management-form button[type="submit"]:hover {
  background: var(--accent-strong);
}

.password-editor .save-status:empty {
  display: none;
}

.form-grid {
  display: grid;
  gap: 12px;
}

.form-grid.two-columns {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

select {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
}

.presence-preview {
  color: var(--muted);
  font-size: 13px;
}

.presence-preview strong {
  color: var(--accent-ink);
  font-size: 20px;
}

.management-list {
  display: grid;
  gap: 10px;
}

.management-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 13px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.management-item-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.management-item-copy span {
  color: var(--muted);
  font-size: 12px;
}

.management-item-actions {
  display: flex;
  gap: 6px;
}

.management-item-actions button {
  min-height: 34px;
  padding: 0 10px;
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  cursor: pointer;
}

.management-item-actions .danger-button {
  color: #b42318;
  background: #fff5f4;
  border-color: #f7c5c0;
}

.status-chip {
  display: inline-flex;
  width: fit-content;
  padding: 2px 7px;
  color: #176c39;
  background: #e7f7ed;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
}

.status-chip.is-off {
  color: var(--muted);
  background: #e9edf3;
}

.banner-upload-row {
  display: grid;
  grid-template-columns: 100px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
}

.banner-admin-preview {
  display: grid;
  width: 90px;
  height: 130px;
  place-items: center;
  overflow: hidden;
  color: var(--muted);
  background: var(--surface-soft);
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  font-size: 11px;
  text-align: center;
}

.banner-admin-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.banner-list-item {
  grid-template-columns: 58px minmax(0, 1fr) auto;
}

.banner-list-thumb {
  width: 52px;
  height: 72px;
  object-fit: cover;
  background: #fff;
  border-radius: 8px;
}

.rank-inputs {
  display: grid;
  gap: 10px;
}

.rank-input-row {
  display: grid;
  grid-template-columns: 32px 46px minmax(130px, 0.85fr) minmax(180px, 1.15fr) minmax(180px, 1.2fr) 68px 38px;
  align-items: center;
  gap: 10px;
  padding: 6px;
  border: 1px solid transparent;
  border-radius: 12px;
  transition: background-color 120ms ease, border-color 120ms ease, opacity 120ms ease;
}

.delete-site {
  width: 36px;
  height: 36px;
  padding: 0;
  color: #b42318;
  background: #fff5f4;
  border: 1px solid #f7c5c0;
  border-radius: var(--radius-sm);
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
}

.rank-input-row.is-dragging {
  opacity: 0.45;
}

.rank-input-row.is-drag-over {
  background: var(--accent-soft);
  border-color: #b7ccf5;
}

.drag-handle {
  width: 30px;
  height: 38px;
  padding: 0;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: var(--radius-sm);
  font-weight: 800;
  letter-spacing: -3px;
  cursor: grab;
}

.drag-handle:active {
  cursor: grabbing;
}

.move-buttons {
  display: flex;
  gap: 4px;
  justify-content: flex-end;
}

.move-buttons button {
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--muted);
  font-weight: 700;
  cursor: pointer;
}

.move-buttons button:disabled {
  cursor: default;
  opacity: 0.35;
}

.rank-input-row strong {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  color: var(--accent-ink);
  background: var(--accent-soft);
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* ===== 관리자 문의 ===== */

.admin-inquiry-panel {
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.admin-inquiry-heading {
  margin-bottom: 0;
}

.admin-inquiry-heading h2 {
  font-size: 20px;
}

.admin-inquiry-layout {
  display: grid;
  grid-template-columns: minmax(320px, 0.8fr) minmax(420px, 1.2fr);
  gap: 18px;
}

.admin-inquiry-list {
  display: grid;
  align-content: start;
  gap: 8px;
}

.admin-inquiry-row {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) 16px;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 68px;
  padding: 10px 12px;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  cursor: pointer;
}

.admin-inquiry-row:hover,
.admin-inquiry-row.is-active {
  background: var(--surface-soft);
  border-color: var(--line-strong);
}

.admin-inquiry-row.is-unread .inquiry-list-copy strong {
  color: var(--accent-ink);
}

.admin-inquiry-state {
  width: 8px;
  height: 8px;
  background: var(--line-strong);
  border-radius: 50%;
}

.admin-inquiry-row.is-unread .admin-inquiry-state {
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.admin-inquiry-detail {
  min-height: 320px;
  padding: 22px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.admin-detail-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.admin-detail-heading h3 {
  margin: 0;
  font-size: 22px;
}

.delete-inquiry-button {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 0 12px;
  color: #b42318;
  background: #fff5f4;
  border: 1px solid #f7c5c0;
  border-radius: var(--radius-md);
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}

.admin-inquiry-meta {
  background: var(--surface);
}

.admin-inquiry-content {
  max-height: none;
  min-height: 130px;
  padding: 18px;
  background: var(--surface);
  border-radius: 12px;
}

.admin-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 14px;
}

.admin-pagination[hidden] {
  display: none;
}

.admin-pagination button {
  min-height: 34px;
  padding: 0 12px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  cursor: pointer;
}

.admin-pagination button:disabled {
  cursor: default;
  opacity: 0.4;
}

.admin-pagination span {
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

/* ===== 모션 최소화 ===== */

@media (prefers-reduced-motion: reduce) {
  .rank-board,
  .category-card,
  .rank-item,
  .icon-button,
  a.rank-item::after {
    transition: none;
  }

  .public-main .rank-board.is-entering .rank-item {
    animation: none;
  }
}

/* ===== 반응형 ===== */

@media (max-width: 1399px) {
  .category-card {
    flex-basis: calc((100% - 48px) / 3.5);
  }
}

@media (max-width: 1180px) {
  .category-card {
    flex-basis: calc((100% - 32px) / 2.5);
  }

  .inquiry-layout {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 900px) {
  .public-header {
    grid-template-columns: auto 1fr auto;
    gap: 12px;
    min-height: 64px;
    padding: 10px 20px;
  }

  .public-header .brand-name {
    font-size: 21px;
  }

  .public-header .visitor-count {
    justify-self: end;
    padding-left: 0;
    border-left: 0;
  }

  .mobile-menu-toggle {
    display: block;
  }

  .site-nav {
    position: absolute;
    top: calc(100% + 1px);
    right: 16px;
    left: 16px;
    display: none;
    align-items: stretch;
    justify-content: stretch;
    padding: 10px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: var(--shadow-md);
  }

  .site-nav.is-open {
    display: grid;
  }

  .inquiry-nav-link {
    width: 100%;
  }
}

/* Task 2: 카드 대신 가벼운 카테고리 탭 */
.category-picker {
  padding-block: 0;
  background: #fff;
  border-bottom-color: #e1e6e3;
}

.category-nav {
  grid-template-columns: repeat(auto-fit, minmax(104px, 1fr));
  gap: 0;
}

.category-nav button,
.category-nav a {
  position: relative;
  flex-direction: row;
  gap: 7px;
  min-height: 58px;
  padding: 9px 12px;
  color: #626d67;
  background: transparent;
  border: 0;
  border-radius: 0;
  font-size: 13px;
  font-weight: 650;
  transition: color 140ms ease, background-color 140ms ease;
}

.category-nav button::after,
.category-nav a::after {
  position: absolute;
  right: 18px;
  bottom: -1px;
  left: 18px;
  height: 2px;
  background: transparent;
  border-radius: 999px 999px 0 0;
  content: "";
}

.category-nav button:hover,
.category-nav a:hover {
  color: #008f46;
  background: #f8fbf9;
  border-color: transparent;
  transform: none;
}

.category-nav button.is-active {
  color: #008f46;
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

.category-nav button.is-active::after {
  background: #03c75a;
}

.category-icon {
  width: 22px;
  height: 22px;
  margin: 0;
  border-radius: 5px;
  font-size: 17px;
}

@media (max-width: 780px) {
  .category-picker {
    padding-inline: 10px;
  }

  .category-nav {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .category-nav button,
  .category-nav a {
    flex-direction: column;
    gap: 3px;
    min-height: 54px;
    padding: 6px 3px;
    font-size: 11px;
  }

  .category-nav button::after,
  .category-nav a::after {
    right: 10px;
    left: 10px;
  }

  .category-icon {
    width: 20px;
    height: 20px;
    font-size: 15px;
  }
}

/* 확대된 사이드 배너 폭은 모든 이전 레이아웃 규칙보다 뒤에서 적용한다. */
@media (min-width: 1100px) {
  .category-picker .category-nav {
    width: min(1120px, calc(100% - 428px));
  }

  .portal-layout {
    grid-template-columns: 160px minmax(0, 1fr) 160px;
    gap: 30px;
  }

  .portal-layout .public-main,
  .portal-layout .inquiry-main {
    padding-top: 28px;
  }

  .portal-layout .side-banner-rail {
    width: 160px;
    gap: 8px;
    margin-top: 28px;
  }

  .portal-layout .side-banner-item {
    background: #fff;
    border-color: #dfe4e1;
    border-radius: 6px;
    box-shadow: none;
    opacity: 0.92;
  }

  .portal-layout .side-banner-item img {
    width: 100%;
    height: 88px;
    object-fit: cover;
  }

  .portal-layout a.side-banner-item:hover,
  .portal-layout a.side-banner-item:focus-visible {
    border-color: #50cf89;
    box-shadow: 0 3px 10px rgba(32, 60, 45, 0.08);
    opacity: 1;
  }
}

@media (min-width: 1100px) and (max-width: 1240px) {
  .category-picker .category-nav {
    width: calc(100% - 380px);
  }

  .portal-layout {
    grid-template-columns: 144px minmax(0, 1fr) 144px;
    gap: 22px;
  }

  .portal-layout .side-banner-rail {
    width: 144px;
  }

  .portal-layout .side-banner-item img {
    height: 80px;
  }
}

/* Task 3: 절제된 TOP 3 차등 강조 */
.public-rank-list .rank-item {
  min-height: 76px;
}

.public-rank-list .rank-item:nth-child(1) {
  grid-template-columns: 54px 68px minmax(0, 1fr);
  min-height: 132px;
  padding: 20px 22px;
  background: linear-gradient(100deg, #fffaf0 0%, #ffffff 62%);
}

.public-rank-list .rank-item:nth-child(2),
.public-rank-list .rank-item:nth-child(3) {
  grid-template-columns: 48px 58px minmax(0, 1fr);
  min-height: 108px;
  padding: 16px 20px;
}

.public-rank-list .rank-item:nth-child(2) {
  background: linear-gradient(100deg, #f7f9fc 0%, #ffffff 60%);
}

.public-rank-list .rank-item:nth-child(3) {
  background: linear-gradient(100deg, #fff7f1 0%, #ffffff 60%);
}

.public-rank-list .rank-item:nth-child(1) .rank-number {
  width: 48px;
  height: 48px;
  border: 1px solid #f0d586;
  border-radius: 12px;
  font-size: 17px;
}

.public-rank-list .rank-item:nth-child(2) .rank-number,
.public-rank-list .rank-item:nth-child(3) .rank-number {
  width: 42px;
  height: 42px;
  border-radius: 11px;
  font-size: 15px;
}

.public-rank-list .rank-item:nth-child(1) .favicon {
  width: 64px;
  height: 64px;
  border-radius: 14px;
}

.public-rank-list .rank-item:nth-child(2) .favicon,
.public-rank-list .rank-item:nth-child(3) .favicon {
  width: 54px;
  height: 54px;
  border-radius: 13px;
}

.public-rank-list .rank-item:nth-child(1) .rank-copy::before {
  display: inline-flex;
  margin-bottom: 5px;
  padding: 3px 6px;
  color: #8b6500;
  background: #fff0bd;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.08em;
  content: "BEST";
}

.public-rank-list .rank-item:nth-child(1) .rank-name {
  font-size: 20px;
}

.public-rank-list .rank-item:nth-child(2) .rank-name,
.public-rank-list .rank-item:nth-child(3) .rank-name {
  font-size: 18px;
}

.public-rank-list .rank-item:nth-child(-n + 3) .rank-description {
  margin-top: 5px;
  font-size: 14px;
}

.public-rank-list .rank-item:nth-child(1) .rank-link-label {
  padding: 10px 14px;
}

@media (max-width: 780px) {
  .public-rank-list .rank-item:nth-child(1),
  .public-rank-list .rank-item:nth-child(2),
  .public-rank-list .rank-item:nth-child(3) {
    grid-template-columns: 38px 44px minmax(0, 1fr);
    gap: 10px;
    padding: 12px 10px;
  }

  .public-rank-list .rank-item:nth-child(1) {
    min-height: 104px;
  }

  .public-rank-list .rank-item:nth-child(2),
  .public-rank-list .rank-item:nth-child(3) {
    min-height: 88px;
  }

  .public-rank-list .rank-item:nth-child(1) .rank-number,
  .public-rank-list .rank-item:nth-child(2) .rank-number,
  .public-rank-list .rank-item:nth-child(3) .rank-number {
    width: 36px;
    height: 36px;
    font-size: 13px;
  }

  .public-rank-list .rank-item:nth-child(1) .favicon,
  .public-rank-list .rank-item:nth-child(2) .favicon,
  .public-rank-list .rank-item:nth-child(3) .favicon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
  }

  .public-rank-list .rank-item:nth-child(1) .rank-name {
    font-size: 17px;
  }

  .public-rank-list .rank-item:nth-child(2) .rank-name,
  .public-rank-list .rank-item:nth-child(3) .rank-name {
    font-size: 16px;
  }

  .public-rank-list .rank-item:nth-child(-n + 3) .rank-description {
    font-size: 12px;
  }
}

/* Task 4: 광고 레일과 전체 간격 마감 */
@media (min-width: 1100px) {
  .category-picker .category-nav {
    width: min(1120px, calc(100% - 428px));
  }

  .portal-layout {
    grid-template-columns: 160px minmax(0, 1fr) 160px;
    gap: 30px;
  }

  .portal-layout .public-main,
  .portal-layout .inquiry-main {
    padding-top: 28px;
  }

  .portal-layout .side-banner-rail {
    width: 160px;
    gap: 8px;
    margin-top: 28px;
  }

  .portal-layout .side-banner-item {
    background: #fff;
    border-color: #dfe4e1;
    border-radius: 6px;
    box-shadow: none;
    opacity: 0.92;
    transition: opacity 140ms ease, border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
  }

  .portal-layout .side-banner-item img {
    width: 100%;
    height: 88px;
    object-fit: cover;
  }

  .portal-layout a.side-banner-item:hover,
  .portal-layout a.side-banner-item:focus-visible {
    border-color: #50cf89;
    box-shadow: 0 3px 10px rgba(32, 60, 45, 0.08);
    opacity: 1;
    transform: translateY(-1px);
  }
}

@media (min-width: 1100px) and (max-width: 1240px) {
  .category-picker .category-nav {
    width: calc(100% - 380px);
  }

  .portal-layout {
    grid-template-columns: 144px minmax(0, 1fr) 144px;
    gap: 22px;
    padding-inline: 24px;
  }

  .portal-layout .side-banner-rail {
    width: 144px;
  }

  .portal-layout .side-banner-item img {
    height: 80px;
  }
}

.inquiry-submit-layout {
  grid-template-columns: minmax(0, 760px);
  justify-content: center;
}

.hidden-admin-entry-wrap {
  display: flex;
  justify-content: flex-end;
  width: min(760px, 100%);
  margin: 18px auto 0;
}

.hidden-admin-entry {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  color: #74817a;
  border-radius: 50%;
  font-size: 6px;
  opacity: 0.16;
  transition: color 120ms ease, background-color 120ms ease, opacity 120ms ease;
}

.hidden-admin-entry:hover,
.hidden-admin-entry:focus-visible {
  color: #008f46;
  background: #e3f8ec;
  opacity: 1;
}

.hidden-admin-entry:hover span,
.hidden-admin-entry:focus-visible span {
  font-size: 0;
}

.hidden-admin-entry:hover span::after,
.hidden-admin-entry:focus-visible span::after {
  font-size: 12px;
  content: "🔒";
}

/* 넓은 화면: 좌우 배너 마진을 확보한 3열 콘텐츠 레이아웃 */
.portal-layout {
  width: 100%;
}

@media (min-width: 1100px) {
  .category-picker {
    padding-inline: 0;
  }

  .category-picker .category-nav {
    width: min(1120px, calc(100% - 328px));
    max-width: none;
  }

  .portal-layout {
    display: grid;
    grid-template-columns: 120px minmax(0, 1fr) 120px;
    align-items: start;
    justify-content: center;
    gap: 20px;
    width: min(1456px, 100%);
    margin-inline: auto;
    padding-inline: 24px;
  }

  .portal-layout .public-main,
  .portal-layout .inquiry-main {
    width: 100%;
    min-width: 0;
  }

  .portal-layout .side-banner-rail {
    display: flex;
    position: sticky;
    top: 82px;
    right: auto;
    left: auto;
    width: 120px;
    max-height: calc(100vh - 100px);
    flex-direction: column;
    gap: 8px;
    margin-top: 24px;
    overflow-y: auto;
    scrollbar-width: none;
  }

  .portal-layout .side-banner-rail::-webkit-scrollbar {
    display: none;
  }

  .portal-layout .side-banner-item {
    display: block;
    flex: 0 0 auto;
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 10px;
    box-shadow: var(--shadow-sm);
  }

  .portal-layout a.side-banner-item:hover {
    border-color: #91d6ae;
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
  }

  .portal-layout .side-banner-item img {
    display: block;
    width: 100%;
    height: 80px;
    object-fit: contain;
    background: #f7fff9;
  }
}

/* ===== 네이버 그린 컬러 팔레트 ===== */

:root {
  --bg: #f5f6f7;
  --surface: #ffffff;
  --surface-soft: #f2f7f4;
  --ink: #202124;
  --muted: #737a76;
  --line: #e1e5e3;
  --line-strong: #cbd2ce;
  --accent: #03c75a;
  --accent-strong: #00a94f;
  --accent-soft: #e8f8ef;
  --accent-ink: #008f46;
  --focus-ring: 0 0 0 3px rgba(3, 199, 90, 0.22);
}

.site-header {
  color: var(--ink);
  background: #fff;
  border-bottom-color: #e1e5e3;
}

.brand-name { color: #03c75a; }
.brand-name::after { background: #03c75a; }
.brand-tag { color: #007f3c; background: #e3f8ec; }
.site-header .visitor-count { color: #6f7773; border-left-color: #dfe4e1; }
.site-header .visitor-count strong { color: #202124; }
.visitor-dot { background: #03c75a; box-shadow: 0 0 0 3px rgba(3, 199, 90, 0.14); }
.header-actions a,
.header-actions button { color: #fff; background: #03c75a; border-color: #03c75a; }
.header-actions a:hover,
.header-actions button:hover { color: #fff; background: #00a94f; }
.mobile-menu-toggle { background: #fff; border-color: #cfd5d1; }
.mobile-menu-toggle span { background: #242926; }

.category-picker { background: #f0f7f3; border-bottom-color: #d8e6de; }
.category-nav button,
.category-nav a { color: #4f5d55; background: #fff; border-color: #d9e2dd; }
.category-nav button:hover,
.category-nav a:hover { color: #008f46; background: #f4fcf7; border-color: #74d9a2; }
.category-nav button.is-active { color: #fff; background: #03c75a; border-color: #03b653; }

.ranking-intro h1,
.inquiry-hero h1 { color: #202124; }
.eyebrow { color: #00a94f; }
.ranking-count { color: #008f46; background: #e3f8ec; }
.public-rank-list,
.inquiry-panel,
.category-panel,
.editor-panel,
.management-editor,
.management-list-panel,
.admin-inquiry-panel,
.admin-inquiry-detail { border-color: #d8dfdb; }
.public-rank-list .rank-item { border-bottom-color: #e5e9e7; }
.public-rank-list a.rank-item:hover,
.public-rank-list a.rank-item:focus-visible { background: #f2fbf6; }
.rank-link-label { color: #008f46; background: #e6f8ee; }

.admin-tabs { background: #e9f3ed; border-color: #d2e2d9; }
.admin-tab { color: #59655e; }
.admin-tab.is-active { color: #fff; background: #03c75a; }
.management-item,
.admin-inquiry-detail,
.empty-admin-state,
.empty-editor-state { background: #f4f8f5; }

input,
select,
textarea { color: #202124; border-color: #c9d1cd; }
input:focus,
select:focus,
textarea:focus { border-color: #03c75a; }
.field-label,
.panel-help,
.field-help { color: #68736d; }

.admin-lock { background: rgba(29, 52, 41, 0.88); }
.login-card { border-color: #aebdb5; }
.login-card .eyebrow { color: #00a94f; }
.login-card h1 { color: #202124; }
.side-banner-item { border-color: #cdd8d2; }

@media (max-width: 900px) {
  .site-nav { background: #fff; border-color: #d6ddd9; }
  .inquiry-nav-link { background: #03c75a; }
}

@media (max-width: 780px) {
  .site-header {
    flex-wrap: wrap;
    gap: 12px;
  }

  .public-header {
    display: grid;
    flex-wrap: nowrap;
  }

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

  .rank-board-shell::before,
  .rank-board-shell::after {
    width: 40px;
  }

  .category-card {
    flex-basis: calc(100% - 72px);
  }

  .admin-layout {
    display: grid;
  }

  .management-layout {
    grid-template-columns: 1fr;
  }

  .form-grid.two-columns {
    grid-template-columns: 1fr;
  }

  .management-item,
  .banner-list-item {
    grid-template-columns: 1fr;
  }

  .banner-list-thumb {
    width: 100%;
    height: 110px;
    object-fit: contain;
  }

  .rank-input-row {
    grid-template-columns: 30px 40px minmax(0, 1fr) 68px 38px;
  }

  .rank-input-row .move-buttons {
    grid-row: 1;
    grid-column: 4;
  }

  .rank-input-row .delete-site {
    grid-row: 1;
    grid-column: 5;
  }

  .rank-input-row .site-url {
    grid-row: 2;
    grid-column: 2 / 6;
  }

  .rank-input-row .site-description {
    grid-row: 3;
    grid-column: 2 / 6;
  }

  .public-main,
  .inquiry-main {
    width: min(100% - 28px, 100%);
    padding-top: 34px;
  }

  .category-picker {
    padding: 10px 14px;
  }

  .category-picker-inner {
    grid-template-columns: 1fr auto;
    gap: 8px;
  }

  .category-nav {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
  }

  .category-nav button,
  .category-nav a {
    min-width: 0;
    min-height: 58px;
    padding: 7px 4px;
    border-radius: 12px;
    font-size: 11px;
  }

  .category-icon {
    width: 26px;
    height: 26px;
    font-size: 19px;
  }

  .all-categories-toggle {
    min-width: 54px;
    min-height: 58px;
    padding: 0 8px;
    font-size: 0;
  }

  .all-categories-toggle::before {
    font-size: 18px;
    content: "☷";
  }

  .all-categories-toggle::after {
    margin-left: 4px;
    font-size: 13px;
  }

  .all-categories-panel {
    right: 14px;
    left: 14px;
    padding: 14px;
  }

  .all-categories-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ranking-intro {
    align-items: flex-start;
  }

  .ranking-intro h1 {
    font-size: 28px;
  }

  .public-rank-list {
    padding: 5px;
    border-radius: 16px;
  }

  .public-rank-list .rank-item {
    grid-template-columns: 34px 36px minmax(0, 1fr);
    gap: 10px;
    min-height: 72px;
    padding: 10px;
  }

  .public-rank-list .rank-number {
    width: 32px;
    height: 32px;
  }

  .public-rank-list .favicon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
  }

  .public-rank-list .rank-link-label {
    display: none;
  }

  .inquiry-panel {
    padding: 18px;
    border-radius: 16px;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .unlock-dialog {
    padding: 24px 20px;
  }
}

/* ===== 포털 블루 전체 컬러 팔레트 ===== */

:root {
  --bg: #eef3f8;
  --surface: #ffffff;
  --surface-soft: #eaf1f8;
  --ink: #172b3f;
  --muted: #657789;
  --line: #d5e0ea;
  --line-strong: #bdcbd9;
  --accent: #1671d9;
  --accent-strong: #0d4f94;
  --accent-soft: #e5f0fc;
  --accent-ink: #0d57a6;
  --focus-ring: 0 0 0 3px rgba(22, 113, 217, 0.25);
}

body { background: var(--bg); }

.site-header {
  color: #fff;
  background: #123a63;
  border-bottom-color: #0d2f51;
}

.brand-name,
.site-header .visitor-count strong { color: #fff; }
.brand-name::after { background: #55a7f5; }
.brand-tag { color: #123a63; background: #d9ebfc; }
.site-header .visitor-count { color: #d5e2ef; border-left-color: rgba(255, 255, 255, 0.24); }
.visitor-dot { background: #49d49d; box-shadow: 0 0 0 3px rgba(73, 212, 157, 0.2); }
.header-actions a,
.header-actions button { color: #fff; background: #1d527f; border: 1px solid rgba(255, 255, 255, 0.18); }
.header-actions a:hover,
.header-actions button:hover { color: #fff; background: #246694; }
.mobile-menu-toggle { background: #194a76; border-color: rgba(255, 255, 255, 0.3); }
.mobile-menu-toggle span { background: #fff; }

.category-picker { background: #dfeaf5; border-bottom-color: #c4d4e3; }
.category-nav button,
.category-nav a { color: #39546d; background: #f8fbfe; border-color: #c7d7e6; }
.category-nav button:hover,
.category-nav a:hover { color: #0d4f94; background: #fff; border-color: #77a9dc; }
.category-nav button.is-active { color: #fff; background: #1671d9; border-color: #0f61bc; }

.ranking-intro h1,
.inquiry-hero h1 { color: #123a63; }
.eyebrow { color: #1671d9; }
.ranking-count { color: #0d4f94; background: #dceafd; }

.public-rank-list,
.inquiry-panel,
.category-panel,
.editor-panel,
.management-editor,
.management-list-panel,
.admin-inquiry-panel,
.admin-inquiry-detail { background: #fff; border-color: #cbd8e4; }
.public-rank-list .rank-item { border-bottom-color: #dce5ed; }
.public-rank-list a.rank-item:hover,
.public-rank-list a.rank-item:focus-visible { background: #edf5fd; }
.rank-link-label { color: #0d57a6; background: #e3effc; }

.admin-tabs { background: #dce8f4; border-color: #c2d3e3; }
.admin-tab { color: #4f6579; }
.admin-tab.is-active { color: #fff; background: #1671d9; box-shadow: none; }
.management-item,
.admin-inquiry-detail,
.empty-admin-state,
.empty-editor-state { background: #f2f7fc; }

input,
select,
textarea { color: #172b3f; background: #fff; border-color: #b9c9d8; }
input:focus,
select:focus,
textarea:focus { border-color: #1671d9; }
.field-label,
.panel-help,
.field-help { color: #5c7185; }

.admin-lock { background: rgba(18, 58, 99, 0.9); }
.login-card { border-color: #9cb4ca; }
.login-card .eyebrow { color: #1671d9; }
.login-card h1 { color: #123a63; }

.side-banner-item { background: #fff; border-color: #b9cbdc; }

@media (max-width: 900px) {
  .site-nav { background: #123a63; border-color: #315b82; }
  .inquiry-nav-link { background: #1671d9; }
}

@media (max-width: 480px) {
  .public-header {
    grid-template-columns: 1fr auto;
  }

  .public-header .visitor-count {
    grid-row: 2;
    grid-column: 1 / -1;
    justify-self: start;
    margin-top: -4px;
  }

  .mobile-menu-toggle {
    grid-row: 1;
    grid-column: 2;
  }

  .ranking-count {
    display: none;
  }

}

/* ===== 한국형 포털 테마 ===== */

:root {
  --bg: #f5f6f8;
  --surface-soft: #f7f8fa;
  --ink: #202124;
  --muted: #707784;
  --line: #e2e5e9;
  --line-strong: #cfd4da;
  --accent: #1e64da;
  --accent-strong: #1554bd;
  --accent-soft: #eef4ff;
  --accent-ink: #1558c0;
  --radius-sm: 5px;
  --radius-md: 7px;
  --radius-lg: 10px;
  --shadow-sm: 0 1px 2px rgba(32, 33, 36, 0.04);
  --shadow-md: 0 5px 16px rgba(32, 33, 36, 0.09);
  --focus-ring: 0 0 0 3px rgba(30, 100, 218, 0.22);
}

.site-header { border-bottom-color: #dfe3e8; }
.public-header { min-height: 66px; box-shadow: none; }
.brand-name { font-weight: 850; letter-spacing: -0.045em; }
.brand-name::after { right: 0; bottom: -8px; left: 0; height: 3px; background: var(--accent); border-radius: 0; }
.category-picker { padding-top: 10px; padding-bottom: 10px; background: #fff; }
.category-nav { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 6px; }
.category-nav button,
.category-nav a { flex-direction: row; gap: 8px; min-height: 48px; padding: 7px 11px; color: #59616d; background: #fff; border-color: #e4e7eb; border-radius: 7px; font-size: 13px; font-weight: 650; }
.category-nav button:hover,
.category-nav a:hover { color: var(--accent-ink); background: #f7faff; border-color: #b9cef3; transform: none; }
.category-nav button.is-active { color: #fff; background: var(--accent); border-color: var(--accent); box-shadow: none; }
.category-icon { width: 26px; height: 26px; flex: 0 0 auto; border-radius: 6px; font-size: 19px; }
.inquiry-nav-link,
.header-actions a,
.header-actions button,
.panel-heading button,
.editor-heading button { border-radius: 6px; }
.public-main { padding-top: clamp(32px, 4vw, 52px); }
.ranking-intro { margin-bottom: 18px; }
.ranking-intro h1 { margin-bottom: 8px; font-size: clamp(27px, 3.4vw, 36px); letter-spacing: -0.035em; }
.eyebrow { color: var(--accent); letter-spacing: 0.02em; }
.ranking-count { padding: 5px 8px; background: var(--accent-soft); border-radius: 4px; letter-spacing: 0; }
.public-rank-list { padding: 0; border-color: #dfe3e8; border-radius: 9px; box-shadow: none; }
.public-rank-list .rank-item { min-height: 72px; padding: 10px 16px; }
.public-rank-list a.rank-item:hover,
.public-rank-list a.rank-item:focus-visible { background: #f6f9ff; border-radius: 0; }
.public-rank-list .favicon { border-radius: 8px; }
.rank-link-label { color: var(--accent-ink); background: var(--accent-soft); border-radius: 5px; font-weight: 700; }
.category-panel,
.editor-panel,
.management-editor,
.management-list-panel,
.admin-inquiry-panel,
.admin-inquiry-detail { border-radius: 9px; box-shadow: none; }
.admin-tab { border-radius: 6px; }
.side-banner-item { border-radius: 7px; }

@media (max-width: 780px) {
  .category-nav { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .category-nav button,
  .category-nav a { flex-direction: column; gap: 4px; min-height: 58px; padding: 6px 3px; font-size: 11px; }
  .ranking-count { padding: 0; background: transparent; }
}

/* 네이버 그린은 최종 테마이므로 모든 이전 실험 팔레트보다 뒤에서 적용한다. */
:root { --bg:#f5f6f7; --surface:#fff; --surface-soft:#f2f7f4; --ink:#202124; --muted:#737a76; --line:#e1e5e3; --line-strong:#cbd2ce; --accent:#03c75a; --accent-strong:#00a94f; --accent-soft:#e8f8ef; --accent-ink:#008f46; --focus-ring:0 0 0 3px rgba(3,199,90,.22); }
.site-header { color:#202124; background:#fff; border-bottom-color:#e1e5e3; }
.brand-name { color:#03c75a; }
.brand-name::after { background:#03c75a; }
.brand-tag { color:#007f3c; background:#e3f8ec; }
.site-header .visitor-count { color:#6f7773; border-left-color:#dfe4e1; }
.site-header .visitor-count strong { color:#202124; }
.visitor-dot { background:#03c75a; box-shadow:0 0 0 3px rgba(3,199,90,.14); }
.header-actions a,.header-actions button { color:#fff; background:#03c75a; border-color:#03c75a; }
.header-actions a:hover,.header-actions button:hover { color:#fff; background:#00a94f; }
.mobile-menu-toggle { background:#fff; border-color:#cfd5d1; }
.mobile-menu-toggle span { background:#242926; }
.category-picker { background:#f0f7f3; border-bottom-color:#d8e6de; }
.category-nav button,.category-nav a { color:#4f5d55; background:#fff; border-color:#d9e2dd; }
.category-nav button:hover,.category-nav a:hover { color:#008f46; background:#f4fcf7; border-color:#74d9a2; }
.category-nav button.is-active { color:#fff; background:#03c75a; border-color:#03b653; }
.ranking-intro h1,.inquiry-hero h1 { color:#202124; }
.eyebrow { color:#00a94f; }
.ranking-count { color:#008f46; background:#e3f8ec; }
.public-rank-list,.inquiry-panel,.category-panel,.editor-panel,.management-editor,.management-list-panel,.admin-inquiry-panel,.admin-inquiry-detail { background:#fff; border-color:#d8dfdb; }
.public-rank-list .rank-item { border-bottom-color:#e5e9e7; }
.public-rank-list a.rank-item:hover,.public-rank-list a.rank-item:focus-visible { background:#f2fbf6; }
.rank-link-label { color:#008f46; background:#e6f8ee; }
.admin-tabs { background:#e9f3ed; border-color:#d2e2d9; }
.admin-tab { color:#59655e; }
.admin-tab.is-active { color:#fff; background:#03c75a; }
.management-item,.admin-inquiry-detail,.empty-admin-state,.empty-editor-state { background:#f4f8f5; }
input,select,textarea { color:#202124; background:#fff; border-color:#c9d1cd; }
input:focus,select:focus,textarea:focus { border-color:#03c75a; }
.field-label,.panel-help,.field-help { color:#68736d; }
.admin-lock { background:rgba(29,52,41,.88); }
.login-card { border-color:#aebdb5; }
.login-card .eyebrow { color:#00a94f; }
.login-card h1 { color:#202124; }
.side-banner-item { background:#fff; border-color:#cdd8d2; }
@media (max-width:900px) { .site-nav { background:#fff; border-color:#d6ddd9; } .inquiry-nav-link { background:#03c75a; } }

.public-main { padding-top: 24px; }

@media (max-width: 780px) {
  .public-main { padding-top: 18px; }
}

/* 공개 헤더: 네이버 그린 배경 + 흰색 콘텐츠 */
.public-header {
  color: #fff;
  background: #03c75a;
  border-bottom-color: #00ae4f;
}

.public-header .brand-name,
.public-header .visitor-count,
.public-header .visitor-count strong {
  color: #fff;
}

.public-header .brand-name::after {
  background: rgba(255, 255, 255, 0.9);
}

.public-header .visitor-count {
  border-left-color: rgba(255, 255, 255, 0.4);
}

.public-header .visitor-dot {
  background: #fff;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.2);
}

.public-header .mobile-menu-toggle {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.7);
}

.public-header .mobile-menu-toggle span {
  background: #fff;
}

@media (max-width: 900px) {
  .public-header .visitor-count { transform: translateY(5px); }
  .public-header .site-nav {
    background: #02b553;
    border-color: #009f48;
  }

  .public-header .inquiry-nav-link {
    background: #fff;
    color: #008f46;
  }
}

/* Task 1: 군더더기 없이 정돈한 공개 헤더 */
.public-header {
  grid-template-columns: auto auto minmax(0, 1fr);
  gap: 16px;
  min-height: 64px;
  padding-inline: max(24px, calc((100% - 1456px) / 2 + 24px));
}

.public-header .brand-name {
  font-size: 23px;
  letter-spacing: -0.04em;
}

.public-header .brand-name::after {
  display: none;
}

.public-header .visitor-count {
  margin: 0;
  padding: 7px 11px;
  background: rgba(255, 255, 255, 0.14);
  border: 0;
  border-radius: 999px;
  font-size: 12px;
}

.public-header .visitor-dot {
  width: 6px;
  height: 6px;
  box-shadow: none;
}

.public-header .inquiry-nav-link {
  min-height: 36px;
  padding-inline: 13px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.64);
  border-radius: 6px;
  font-size: 13px;
  transition: color 140ms ease, background-color 140ms ease, border-color 140ms ease;
}

.public-header .inquiry-nav-link::after {
  margin-left: 5px;
  content: "→";
}

.public-header .inquiry-nav-link:hover,
.public-header .inquiry-nav-link.is-active {
  color: #008f46;
  background: #fff;
  border-color: #fff;
}

@media (max-width: 900px) {
  .public-header {
    grid-template-columns: auto 1fr auto;
    gap: 10px;
    min-height: 60px;
    padding: 8px 14px;
  }

  .public-header .brand-name {
    font-size: 20px;
  }

  .public-header .visitor-count {
    justify-self: end;
    padding: 6px 9px;
  }

  .public-header .site-nav {
    background: #02b553;
  }

  .public-header .inquiry-nav-link {
    color: #008f46;
    background: #fff;
    border-color: #fff;
  }
}

/* Task 2 최종 우선순위: 카테고리를 단순 탭으로 유지 */
.category-picker {
  padding-block: 0;
  background: #fff;
  border-bottom-color: #e1e6e3;
}

.category-nav {
  grid-template-columns: repeat(auto-fit, minmax(104px, 1fr));
  gap: 0;
}

.category-nav button,
.category-nav a {
  position: relative;
  flex-direction: row;
  gap: 7px;
  min-height: 58px;
  padding: 9px 12px;
  color: #626d67;
  background: transparent;
  border: 0;
  border-radius: 0;
  font-size: 13px;
  font-weight: 650;
}

.category-nav button:hover,
.category-nav a:hover {
  color: #008f46;
  background: #f8fbf9;
  border-color: transparent;
}

.category-nav button.is-active {
  color: #008f46;
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

.category-nav button.is-active::after {
  background: #03c75a;
}

.category-icon {
  width: 22px;
  height: 22px;
  margin: 0;
  border-radius: 5px;
  font-size: 17px;
}

@media (max-width: 780px) {
  .category-picker {
    padding-inline: 10px;
  }

  .category-nav {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .category-nav button,
  .category-nav a {
    flex-direction: column;
    gap: 3px;
    min-height: 54px;
    padding: 6px 3px;
    font-size: 11px;
  }

  .category-icon {
    width: 20px;
    height: 20px;
    font-size: 15px;
  }
}

/* 광고 열과 중앙 목록의 비율을 화면 너비에 맞춰 유지한다. */
@media (min-width: 1100px) {
  .category-picker .category-nav {
    width: min(1120px, calc(100% - 476px));
  }

  .portal-layout {
    grid-template-columns: clamp(52px, 20vw, 300px) minmax(0, 1fr) clamp(52px, 20vw, 300px);
    gap: clamp(4px, 1vw, 18px);
    padding-inline: clamp(4px, 1vw, 24px);
  }

  .portal-layout .public-main,
  .portal-layout .inquiry-main {
    padding-top: 28px;
  }

  .portal-layout .side-banner-rail {
    width: 100%;
    gap: 0;
    margin-top: 28px;
  }

  .portal-layout .side-banner-item {
    background: #fff;
    border-color: #dfe4e1;
    border-radius: 6px;
    box-shadow: none;
    opacity: 0.92;
  }

  .portal-layout .side-banner-item img {
    width: 100%;
    height: auto;
    aspect-ratio: 1.8;
    object-fit: contain;
  }

  .portal-layout a.side-banner-item:hover,
  .portal-layout a.side-banner-item:focus-visible {
    border-color: #50cf89;
    box-shadow: 0 3px 10px rgba(32, 60, 45, 0.08);
    opacity: 1;
  }
}

/* 좁은 데스크톱·태블릿에서도 순위 카드의 빈 가로 공간을 광고에 배분한다. */
@media (min-width: 720px) and (max-width: 1099px) {
  .portal-layout {
    display: grid;
    grid-template-columns: clamp(52px, 20vw, 300px) minmax(0, 1fr) clamp(52px, 20vw, 300px);
    align-items: start;
    gap: clamp(4px, 1vw, 18px);
    padding-inline: clamp(4px, 1vw, 24px);
  }

  .portal-layout .public-main,
  .portal-layout .inquiry-main {
    min-width: 0;
    width: 100%;
  }

  .portal-layout .side-banner-rail {
    position: sticky;
    top: 72px;
    display: flex;
    width: 100%;
    max-height: calc(100vh - 88px);
    flex-direction: column;
    gap: 0;
    margin-top: 24px;
    overflow-y: auto;
    scrollbar-width: none;
  }

  .portal-layout .side-banner-rail::-webkit-scrollbar { display: none; }
  .portal-layout .side-banner-item { display: block; flex: 0 0 auto; overflow: hidden; border: 1px solid var(--line); border-radius: 7px; }
  .portal-layout .side-banner-item img { display: block; width: 100%; height: auto; aspect-ratio: 1.8; object-fit: contain; background: #f7fff9; }
}

@media (max-width: 900px) {
  .public-header .site-nav {
    position: static;
    display: flex;
    grid-column: 3;
    align-items: center;
    width: auto;
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }
  .public-header .inquiry-nav-link {
    min-height: 36px;
    padding-inline: 10px;
    color: #fff;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 6px;
    font-size: 12px;
  }
  .public-header .inquiry-nav-link::after { display: none; }
  .public-header .inquiry-nav-link:hover,
  .public-header .inquiry-nav-link.is-active {
    color: #008f46;
    background: #fff;
  }
}

/* 휴대전화에서도 양쪽 광고를 유지하고 순위 목록만 조밀하게 줄인다. */
@media (max-width: 719px) {
  .public-header .brand-logo { width: 32px; height: 32px; flex-basis: 32px; border-radius: 8px; }
  .public-header {
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 8px;
    min-height: 56px;
  }
  .public-header .visitor-count {
    grid-row: 1;
    grid-column: 2;
    justify-self: end;
    margin: 0;
    padding: 5px 7px;
    font-size: 10px;
  }
  .portal-layout {
    display: grid;
    grid-template-columns: clamp(52px, 20vw, 300px) minmax(0, 1fr) clamp(52px, 20vw, 300px);
    align-items: start;
    gap: clamp(4px, 1vw, 8px);
    padding-inline: clamp(4px, 1vw, 8px);
  }
  .portal-layout .public-main,
  .portal-layout .inquiry-main { min-width: 0; width: 100%; }
  .portal-layout .side-banner-rail {
    position: sticky;
    top: 62px;
    display: flex;
    width: 100%;
    max-height: calc(100vh - 70px);
    flex-direction: column;
    gap: 0;
    margin-top: 18px;
    overflow-y: auto;
    scrollbar-width: none;
  }
  .portal-layout .side-banner-rail::-webkit-scrollbar { display: none; }
  .portal-layout .side-banner-item {
    display: block;
    flex: 0 0 auto;
    width: 100%;
    overflow: hidden;
    border: 0;
    border-radius: 4px;
  }
  .portal-layout .side-banner-item img { display: block; width: 100%; height: auto; aspect-ratio: auto; }
  .portal-layout .side-banner-rail:empty { display: none; }

  .public-rank-list { min-width: 0; padding: 0; border-radius: 8px; }
  .public-rank-list .rank-item,
  .public-rank-list .rank-item:nth-child(-n + 3) {
    grid-template-columns: 20px 24px minmax(0, 1fr);
    gap: 4px;
    min-height: 62px;
    padding: 7px 6px;
  }
  .public-rank-list .rank-item:nth-child(2),
  .public-rank-list .rank-item:nth-child(3) { min-height: 76px; }
  .public-rank-list .rank-item:nth-child(1) {
    grid-template-columns: 24px 28px minmax(0, 1fr);
    min-height: 94px;
  }
  .public-rank-list .rank-number,
  .public-rank-list .rank-item:nth-child(-n + 3) .rank-number {
    width: 20px;
    height: 24px;
    border-radius: 5px;
    font-size: 11px;
  }
  .public-rank-list .rank-item:nth-child(1) .rank-number { width: 24px; height: 28px; }
  .public-rank-list .favicon,
  .public-rank-list .rank-item:nth-child(-n + 3) .favicon {
    width: 24px;
    height: 24px;
    border-radius: 5px;
  }
  .public-rank-list .rank-item:nth-child(1) .favicon { width: 28px; height: 28px; }
  .public-rank-list .rank-name,
  .public-rank-list .rank-item:nth-child(-n + 3) .rank-name { font-size: 12px; }
  .public-rank-list .rank-item:nth-child(1) .rank-name { font-size: 13px; }
  .public-rank-list .rank-description,
  .public-rank-list .rank-item:nth-child(-n + 3) .rank-description {
    display: block;
    overflow: hidden;
    margin-top: 2px;
    font-size: 10px;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .public-rank-list .rank-item:nth-child(1) .rank-copy::before {
    margin-bottom: 3px;
    padding: 2px 4px;
    font-size: 8px;
  }
  .public-rank-list .rank-link-label { display: none; }
}

/* 모든 화면에서 배너 칸을 원본 이미지 크기에 맞춘다. */
.portal-layout .side-banner-item {
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
.portal-layout .side-banner-item img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: auto;
  object-fit: contain;
  background: transparent;
}

/* 위치를 선택해 편집하는 배너 관리 */
.branding-editor { max-width: 920px; margin-inline: auto; }
.branding-card-heading p { margin: 0; color: #69796f; font-size: 13px; }
.branding-editor .management-form { margin: 0; gap: 16px; }
.branding-card { min-width: 0; padding: 22px; background: #fff; border: 1px solid #d8e4dc; border-radius: 14px; box-shadow: 0 4px 14px rgba(19, 65, 37, .035); }
.branding-card-heading { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.branding-card-heading h3 { margin: 0 0 3px; color: #183d29; font-size: 17px; letter-spacing: -.025em; }
.branding-step { display: grid; place-items: center; flex: 0 0 35px; width: 35px; height: 35px; border-radius: 10px; color: #008c43; background: #e7f8ed; font-size: 12px; font-weight: 800; }
.branding-name-field { display: grid; gap: 7px; }
.branding-name-field + .branding-name-field { margin-top: 18px; }
.branding-name-field input { max-width: 520px; }
.branding-image-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.branding-image-field { display: flex; gap: 18px; align-items: center; min-width: 0; }
.branding-image-preview { display: grid; place-items: center; flex: 0 0 104px; width: 104px; height: 104px; overflow: hidden; border: 1px solid #d9e7de; border-radius: 16px; background: #f3fbf6; }
.branding-image-preview img { display: block; width: 80%; height: 80%; object-fit: contain; }
.branding-image-preview img[hidden], .branding-image-empty[hidden] { display: none; }
.branding-image-empty { padding: 8px; color: #8b9389; font-size: 11px; line-height: 1.4; text-align: center; word-break: keep-all; }
.branding-image-controls { min-width: 0; }
.branding-file-input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.branding-upload { display: inline-flex; align-items: center; min-height: 36px; padding: 0 13px; color: #087a40; background: #effaf2; border: 1px solid #a9dfb9; border-radius: 8px; font-size: 13px; font-weight: 700; cursor: pointer; }
.branding-file-input:focus-visible + .branding-upload { outline: 3px solid #159f57; outline-offset: 3px; }
.branding-file-name { display: block; max-width: 100%; margin-top: 7px; overflow: hidden; color: #69796f; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.branding-image-controls .field-help { margin: 7px 0; font-size: 11px; line-height: 1.4; }
.branding-image-controls .check-field { margin-top: 7px; font-size: 12px; }
.branding-save-row { display: flex; justify-content: flex-end; align-items: center; gap: 16px; min-height: 44px; }
.branding-save-row .save-status { flex: 1; margin: 0; }
.branding-save-row button, .backup-actions button { min-height: 42px; padding: 0 18px; color: #fff; background: #03b955; border: 1px solid #03b955; border-radius: 9px; font: inherit; font-size: 13px; font-weight: 800; cursor: pointer; }
.branding-save-row button:hover, .backup-actions button:hover { background: #039947; }
.branding-save-row button:disabled, .backup-actions button:disabled { opacity: .55; cursor: wait; }
.backup-card { margin-top: 28px; }
.backup-note { margin: 0 0 18px; padding: 12px 14px; color: #475b4d; background: #f4f8f5; border-radius: 8px; font-size: 12px; line-height: 1.6; }
.backup-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.backup-actions .save-status { margin: 0; font-size: 12px; }
@media (max-width: 700px) { .branding-image-grid { grid-template-columns: 1fr; } }
@media (max-width: 480px) { .branding-card { padding: 17px; } .branding-image-preview { flex-basis: 82px; width: 82px; height: 82px; } .branding-image-field { gap: 12px; } }
.banner-workspace { display:grid; grid-template-columns:minmax(0,1fr) 340px; gap:22px; align-items:start; }
.banner-workspace [hidden] { display:none !important; }
.banner-map-panel { min-width:0; background:#edf2ef; border:1px solid #d6e0da; border-radius:16px; padding:20px; }
.banner-map-toolbar { display:flex; justify-content:space-between; gap:12px; margin-bottom:18px; font-size:12px; color:#738179; }
.banner-map-toolbar > span:first-child { color:#344c40; font-weight:700; }
.banner-map-toolbar i { display:inline-block; width:7px; height:7px; border-radius:50%; background:#00ba59; margin-right:6px; }
.banner-site-map { overflow:hidden; border:1px solid #dce4df; border-radius:10px; background:#f9fbfa; }
.banner-map-header { display:flex; justify-content:space-between; align-items:center; padding:20px; background:#fff; border-bottom:1px solid #e3e9e5; }
.banner-map-header strong { font-size:20px; color:#168c51; letter-spacing:-1px; }
.banner-map-header > span { font-size:10px; color:#829088; }
.banner-map-nav { display:flex; justify-content:center; flex-wrap:wrap; gap:7px; padding:13px 10px; background:#fff; border-bottom:1px solid #e3e9e5; font-size:10px; color:#586b60; }
.banner-map-nav span { padding:5px 8px; border-radius:5px; background:#f0f5f2; }
.banner-map-body { display:grid; grid-template-columns:minmax(100px,160px) minmax(90px,1fr) minmax(100px,160px); gap:14px; padding:20px 14px 28px; align-items:start; }
.banner-map-rail { min-width:0; display:grid; gap:10px; }
.banner-map-rail h3 { display:flex; justify-content:space-between; align-items:center; margin:0 0 2px; color:#52675a; font-size:12px; }
.banner-map-rail h3 span { font-size:10px; color:#7f9387; font-weight:400; }
.banner-map-slot { position:relative; min-width:0; border:1px solid #d6e1da; border-radius:8px; overflow:hidden; background:white; transition:border-color .15s,box-shadow .15s; }
.banner-map-slot.is-selected { border-color:#00aa51; box-shadow:0 0 0 2px #00ba5930; }
.banner-slot-delete { position:absolute; z-index:1; top:6px; right:6px; display:grid; place-items:center; width:28px; height:28px; padding:0; border:1px solid #e2e7e3; border-radius:50%; background:#fff; color:#6b7770; box-shadow:0 1px 4px #0002; font-size:20px; line-height:1; cursor:pointer; }
.banner-slot-delete:hover { border-color:#e4a8a8; background:#fff2f2; color:#b3262f; }
.banner-slot-delete:focus-visible { outline:3px solid #b3262f; outline-offset:2px; }
.banner-slot-select { display:block; width:100%; padding:0; border:0; background:white; text-align:left; color:#293d31; cursor:pointer; }
.banner-slot-select:hover { background:#f2fbf5; }
.banner-slot-select:focus-visible, .banner-slot-add:focus-visible, .banner-slot-order button:focus-visible { outline:3px solid #228c58; outline-offset:-3px; }
.banner-slot-image { display:grid; place-items:center; aspect-ratio:160/88; background:#e9eeeb; overflow:hidden; font-size:10px; color:#738278; text-align:center; }
.banner-slot-image img { width:100%; height:100%; object-fit:cover; }
.banner-slot-caption { display:grid; gap:4px; padding:9px; }
.banner-slot-caption strong { font-size:12px; font-weight:600; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.banner-slot-caption > span { font-size:10px; color:#8a7165; }
.banner-slot-caption > span.is-live { color:#16864c; }
.banner-slot-order { display:flex; align-items:center; gap:3px; padding:4px 6px; border-top:1px solid #edf1ee; }
.banner-slot-order span { flex:1; font-size:10px; color:#8b978f; }
.banner-slot-order button { width:28px; min-height:28px; border:0; border-radius:4px; color:#4b6153; background:#f2f6f3; cursor:pointer; }
.banner-slot-order button:disabled { opacity:.3; cursor:default; }
.banner-slot-add { min-height:78px; width:100%; padding:10px 3px; border:1px dashed #9db9a8; border-radius:8px; background:#f0f7f2; color:#43805c; cursor:pointer; font-size:11px; }
.banner-slot-add span { display:block; font-size:24px; margin-bottom:3px; }
.banner-slot-add:hover { background:#e4f2e9; border-color:#138c4d; }
.banner-map-content { margin-top:26px; min-width:0; border:1px solid #e0e7e2; border-radius:8px; padding:14px 10px; background:#fff; }
.banner-map-content-label { display:block; font-size:9px; color:#9ca8a1; margin-bottom:8px; }
.banner-map-content h3 { font-size:13px; margin-bottom:12px; color:#3b4c41; overflow-wrap:anywhere; }
.banner-map-rank { display:flex; align-items:center; gap:9px; padding:12px 0; border-top:1px solid #f0f3f1; }
.banner-map-rank b { font-size:11px; color:#4c9b6b; }
.banner-map-rank > span { flex:1; min-width:0; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; font-size:10px; color:#67776c; }
.banner-map-rank i { display:block; width:70%; height:4px; background:#edf1ee; margin-top:6px; border-radius:2px; }
.banner-map-content p { margin:20px 0 0; font-size:10px; color:#99a59d; text-align:center; line-height:1.7; }
.banner-map-note { margin:16px 0 0; font-size:11px; line-height:1.8; color:#78867c; }
.banner-editor { position:sticky; top:20px; min-width:0; padding:22px; border-radius:16px; }
.banner-editor .management-form { margin-top:0; gap:16px; }
.banner-editor-heading { display:flex; justify-content:space-between; align-items:center; gap:8px; }
.banner-editor-heading h3 { font-size:20px; }
.banner-editor-heading .eyebrow { margin-bottom:5px; font-size:11px; color:#65836f; }
.banner-editor-empty { padding:70px 0; text-align:center; color:#87978c; }
.banner-editor-empty > span { display:grid; place-items:center; width:50px; height:50px; margin:0 auto 20px; border-radius:14px; background:#f0f6f2; font-size:24px; color:#5b916d; }
.banner-editor-empty h3 { color:#455e4e; font-size:16px; margin-bottom:12px; }
.banner-editor-empty p { line-height:1.9; font-size:13px; }
.banner-editor .banner-admin-preview { width:min(100%, 220px); height:auto; aspect-ratio:1/2; margin-inline:auto; }
.banner-editor .banner-admin-preview img { width:100%; height:100%; object-fit:contain; }
.banner-file-field input { font-size:12px; max-width:100%; }
.banner-media-field { display:grid; gap:9px; padding:15px; border:1px solid var(--line); border-radius:9px; background:#f9faf7; }
.banner-media-field + .banner-media-field { margin-top:12px; }
.banner-media-field .banner-admin-preview { position:relative; }
.banner-media-field .banner-mobile-preview { width:min(100%, 240px); aspect-ratio:4/5; }
.banner-media-field .banner-preview-fallback { position:absolute; right:7px; bottom:7px; padding:4px 7px; color:#34452f; background:rgba(255,255,255,.9); border-radius:5px; font-size:10px; }
.banner-media-field .branding-remove-button { justify-self:start; }
.banner-editor .field-label { font-size:12px; }
.banner-editor .check-field { font-size:13px; }
.banner-editor .field-help { display:block; margin-top:7px; font-size:11px; }
.banner-details { border-top:1px solid #e7ece8; border-bottom:1px solid #e7ece8; padding:14px 0; }
.banner-details summary { font-size:13px; color:#687c6e; cursor:pointer; }
.banner-details .management-form { margin-top:18px; }
.banner-editor-actions { display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.banner-editor-actions button { min-height:42px; border:1px solid #d5dfd8; border-radius:8px; background:#fff; color:#4b6253; font-weight:600; cursor:pointer; }
.banner-editor-actions button[type="submit"] { background:#00b657; color:#fff; border-color:#00b657; }
.banner-editor-actions button[type="submit"]:hover { background:#009e4b; }
.banner-delete { background:transparent; border:0; color:#a35d55; font-size:12px; padding:8px; cursor:pointer; }
.banner-loading { padding:60px 20px; text-align:center; font-size:13px; color:#667b6e; }
@media (max-width: 1200px) { .banner-workspace { grid-template-columns:minmax(0,1fr) 300px; gap:14px; } .banner-map-panel { padding:14px; } .banner-map-body { gap:9px; padding:16px 9px; } }
@media (max-width: 999px) { .banner-workspace { grid-template-columns:minmax(0,1fr); } .banner-editor { position:static; } .banner-editor-empty { padding:20px 0; } .banner-map-body { grid-template-columns:minmax(90px,160px) minmax(90px,1fr) minmax(90px,160px); } }
@media (max-width: 480px) { .banner-map-panel { padding:10px; } .banner-map-body { grid-template-columns:minmax(0,1fr) minmax(60px,.8fr) minmax(0,1fr); gap:7px; padding:12px 7px; } .banner-map-header { padding:14px 10px; } .banner-map-header strong { font-size:17px; } .banner-map-content { padding:10px 6px; } .banner-map-rank { gap:4px; } .banner-map-toolbar { font-size:10px; } .banner-slot-caption { padding:7px 5px; } .banner-slot-caption strong { font-size:11px; } .banner-slot-order { padding:3px; } .banner-slot-order button { width:26px; min-height:32px; } }
.banner-map-rail { max-height:620px; overflow-y:auto; scrollbar-width:thin; padding:2px 3px 3px; align-content:start; }
.banner-map-rail h3 { position:sticky; top:-2px; z-index:1; background:#f9fbfa; padding:5px 0; }
@media (max-width: 999px) { .banner-map-rail { max-height:460px; } }
.banner-editor-status:empty { display:none; }
.banner-editor-status { min-height:0; margin:0; font-size:12px; line-height:1.6; }

/* 보안접속관리 */
.admin-tabs { flex-wrap:wrap; }
.security-heading { display:flex; justify-content:space-between; align-items:center; gap:14px; margin:4px 0 18px; }
.security-heading h2 { font-size:23px; margin:0 0 4px; }
.security-heading p { color:var(--muted); font-size:13px; }
.security-filters { display:flex; align-items:end; flex-wrap:wrap; gap:10px; padding:17px; border:1px solid var(--line); border-radius:14px; background:var(--surface); }
.security-filters label { display:grid; gap:6px; color:var(--muted); font-size:12px; font-weight:600; min-width:130px; }
.security-filters input,.security-filters select { min-height:42px; width:100%; border:1px solid var(--line-strong); border-radius:8px; padding:0 10px; background:#fff; color:var(--ink); font-size:13px; }
.security-filters label:has(#securityIp) { flex:1; min-width:160px; }
.security-filters button { min-height:42px; padding:0 20px; }
.security-custom-date[hidden] { display:none; }
.security-metrics { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; margin:16px 0; }
.security-metrics article { display:grid; gap:8px; padding:18px; background:var(--surface); border:1px solid var(--line); border-radius:13px; }
.security-metrics span { color:var(--muted); font-size:12px; }
.security-metrics strong { font-size:26px; font-variant-numeric:tabular-nums; }
.security-stats { display:grid; grid-template-columns:1.4fr 1fr 1fr; gap:12px; margin-bottom:16px; }
.security-stats section,.security-records { min-width:0; padding:18px; background:var(--surface); border:1px solid var(--line); border-radius:13px; }
.security-stats h3,.security-records h3 { font-size:15px; margin:0 0 14px; }
.security-stats h3 small { color:var(--muted); font-size:11px; font-weight:400; }
.security-trend { display:flex; align-items:end; gap:4px; min-height:134px; overflow-x:auto; }
.security-trend-item { flex:1 0 16px; display:grid; align-items:end; min-width:16px; height:125px; gap:4px; color:var(--muted); font-size:10px; text-align:center; }
.security-trend-bar { display:block; min-height:2px; border-radius:3px 3px 0 0; background:var(--accent); }
.security-trend-item time { white-space:nowrap; writing-mode:vertical-rl; max-height:42px; overflow:hidden; margin:auto; }
.security-breakdown { display:grid; gap:9px; }
.security-breakdown-row { display:grid; grid-template-columns:minmax(75px,1fr) auto; gap:6px; font-size:12px; color:var(--muted); }
.security-breakdown-row strong { color:var(--ink); font-variant-numeric:tabular-nums; }
.security-breakdown-bar { grid-column:1/-1; height:5px; background:#e7efe9; border-radius:4px; overflow:hidden; }
.security-breakdown-bar i { display:block; height:100%; background:#35bc70; border-radius:4px; }
.security-empty { color:var(--muted); font-size:13px; padding:18px 0; }
.security-records-heading { display:flex; justify-content:space-between; gap:10px; align-items:center; }
.security-records-heading span { font-size:12px; color:var(--muted); }
.security-table-wrap { width:100%; overflow:auto; }
.security-records table { border-collapse:collapse; width:100%; min-width:760px; font-size:12px; }
.security-records th,.security-records td { padding:11px 10px; text-align:left; border-bottom:1px solid var(--line); vertical-align:top; white-space:nowrap; }
.security-records th { color:var(--muted); font-weight:600; background:#f7faf8; }
.security-records td { color:var(--ink); }
.security-records td.security-source { max-width:220px; overflow:hidden; text-overflow:ellipsis; }
.security-status-chip { display:inline-block; padding:3px 7px; border-radius:7px; font-weight:600; color:#376b4d; background:#e9f7ee; }
.security-status-chip.failure { color:#a65b24; background:#fff3e8; }
.security-status-chip.blocked { color:#b44235; background:#fff0ee; }
.security-pagination { display:flex; justify-content:center; align-items:center; gap:14px; margin-top:16px; font-size:12px; }
.security-pagination button { min-height:34px; padding:0 12px; background:#fff; color:var(--ink); border:1px solid var(--line-strong); border-radius:7px; cursor:pointer; }
.security-pagination button:disabled { opacity:.4; cursor:default; }
@media(max-width:1050px) { .security-stats { grid-template-columns:1fr 1fr; } .security-stats section:first-child { grid-column:1/-1; } }
@media(max-width:620px) { .admin-tab { padding:0 10px; font-size:12px; } .security-heading { align-items:flex-start; } .security-heading h2 { font-size:20px; } .security-filters label { flex:1 1 130px; } .security-filters button { flex:1 1 100%; } .security-metrics { gap:7px; } .security-metrics article { padding:12px; } .security-metrics strong { font-size:20px; } .security-stats { grid-template-columns:1fr; } .security-stats section:first-child { grid-column:auto; } }
.security-filters button[type="submit"] { color:#fff; background:var(--accent); border:1px solid var(--accent); border-radius:8px; font-weight:700; cursor:pointer; }
.security-filters button[type="submit"]:hover { background:var(--accent-strong); }
.security-heading > button { min-height:38px; padding:0 13px; border:1px solid var(--line-strong); border-radius:8px; background:#fff; color:var(--ink); cursor:pointer; }
.security-stats:has(#securityDevicePanel[hidden]) section:nth-child(2) { grid-column:1/-1; }
