

/* ════════════════════════════════════════════════════════
   은어 사전 (dictionary)
   ════════════════════════════════════════════════════════ */

/* ── 섹션 탭 (품목·규격·브랜드) ── */
.section-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 20px;
}
.section-tab {
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--border);
  border-radius: 20px;
  text-decoration: none;
  color: var(--muted);
  background: #fff;
}
.section-tab.active {
  background: var(--ace-red);
  color: #fff;
  border-color: var(--ace-red);
}
.section-tab:hover:not(.active) {
  border-color: var(--ace-red);
  color: var(--ace-red);
}

/* 모바일: 탭 알약 글자가 알약 안에서 줄바꿈/단어분절('읽는'→'읽'/'는')되지 않게
   한 줄 유지 + 넘치면 가로 스크롤(품목/규격/브랜드 탭, 관리 서브탭 공통). */
@media (max-width: 640px) {
  .section-tabs, .propose-subtabs { overflow-x: auto; scrollbar-width: none; flex-wrap: nowrap; }
  .section-tabs::-webkit-scrollbar, .propose-subtabs::-webkit-scrollbar { display: none; }
  .section-tab, .propose-subtab { white-space: nowrap; flex: 0 0 auto; }
}



/* ── 검색폼 ── */
.dict-search-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 20px;
}
.field-filter {
  display: flex;
  gap: 16px;
  align-items: center;
  width: 100%;
  border: none;
  padding: 0;
  margin: 0;
  flex-wrap: wrap;
}
.field-filter legend {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  margin-right: 8px;
  float: left;
}
.field-filter label {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  user-select: none;
}
.token-section {
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 16px;
  overflow: hidden;
}
.token-section-summary {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  cursor: pointer;
  list-style: none;
  background: var(--surface, #f7f7f7);
  user-select: none;
}
.token-section-summary::-webkit-details-marker { display: none; }
.token-section-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
}
.token-section .chevron {
  width: 16px;
  height: 16px;
  margin-left: auto;
  flex-shrink: 0;
  color: var(--muted);
  transition: transform 0.15s;
}
.token-section[open] .chevron {
  transform: rotate(180deg);
}
.token-section-filter {
  padding: 8px 16px;
  border-bottom: 1px solid var(--border);
  background: #fff;
}
.token-section .dict-table-wrap {
  margin-bottom: 0;
  max-height: none;
  overflow-y: visible;
}
.token-section .dict-noun-cell {
  border-left: none;
  background: none;
  box-shadow: none;
}
.field-filter--inline {
  display: flex;
  gap: 12px;
  align-items: center;
  border: none;
  padding: 0;
  margin: 0;
}
.token-section-header {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.token-section-header h3 {
  margin: 0;
  white-space: nowrap;
}
.dict-search-form input[type="search"] {
  flex: 1;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
}
.dict-search-form button {
  padding: 9px 18px;
  background: var(--ace-red);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.dict-search-form button:hover { background: var(--ace-red-dark); }
.dict-search-form .reset-link {
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
}
.dict-search-form .reset-link:hover { text-decoration: underline; }

/* ── 접기 + 테이블 ── */
.dict-details {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.dict-details summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  user-select: none;
  background: var(--surface, #f7f7f7);
  list-style: none;
}
.dict-details summary::-webkit-details-marker { display: none; }
.dict-details summary .summary-right {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 400;
  color: var(--muted);
  font-size: 13px;
}
.dict-details summary .chevron {
  display: inline-block;
  width: 16px;
  height: 16px;
  transition: transform 0.15s;
}
.dict-details[open] summary .chevron { transform: rotate(180deg); }

.dict-table-wrap {
  overflow-x: auto;
  max-height: 560px;
  overflow-y: auto;
}
.dict-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.dict-table thead th {
  position: sticky;
  top: 0;
  background: var(--surface, #f7f7f7);
  text-align: left;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  z-index: 1;
}
.dict-table td {
  padding: 7px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
#ga-edit-tbody td:first-child { font-weight: 600; }
.dict-table tbody tr:last-child td { border-bottom: none; }
.dict-table .empty-row td {
  text-align: center;
  color: var(--muted);
  padding: 24px;
  font-weight: normal;
}

/* ── 수정/삭제 테이블 — 행 강조 + 컬러 도트 (design_refinement 참고 다듬기) ── */
#ga-edit-tbody tr,
#ba-edit-tbody tr {
  transition: background-color var(--dur, 0.15s);
}
#ga-edit-tbody tr:hover,
#ba-edit-tbody tr:hover {
  background-color: var(--ace-red-tint);
}
#ga-edit-tbody tr:not(.ga-token-header) td:first-child:not([colspan])::before,
#ba-edit-tbody tr td:first-child:not([colspan])::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ace-red, #D40029);
  margin-right: 8px;
  vertical-align: middle;
}
/* ── 품목 사전 3열 표 ── */
.dict-table-wrap--noun {
  border-left: 4px solid var(--ace-red, #D40029);
}
.dict-table--noun .dict-noun-cell {
  background: #fff;
  color: var(--text);
  font-weight: 700;
  font-size: 13px;
  vertical-align: top;
  white-space: nowrap;
  width: 120px;
}
.dict-table--noun .dict-noun-cell--cont {
  border-top: none;
}
.dict-table--noun .dict-group-cell {
  color: var(--text);
  font-size: 13px;
  white-space: nowrap;
  width: 140px;
}
.dict-table--noun .dict-alias-cell {
  color: var(--text);
  font-size: 13px;
  line-height: 1.7;
}

/* ── 대표 키워드 블록 ── */
.noun-block-list {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}
@media (max-width: 900px) {
  .noun-block-list { grid-template-columns: repeat(2, 1fr); }
}
.noun-block {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.noun-block summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  cursor: pointer;
  user-select: none;
  background: var(--ace-red-tint);
  list-style: none;
  font-weight: 700;
  font-size: 14px;
  color: var(--ace-red-dark);
}
.noun-block summary::-webkit-details-marker { display: none; }
.noun-block summary .noun-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 400;
  font-size: 12px;
  color: var(--muted);
}
.noun-block summary .chevron {
  width: 14px;
  height: 14px;
  transition: transform 0.15s;
}
.noun-block[open] summary .chevron { transform: rotate(180deg); }

.noun-block-body {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.alias-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.alias-group-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}
.alias-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.alias-tag {
  padding: 3px 10px;
  background: var(--surface, #f7f7f7);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

/* ── 사이드 탭 ── */
.cat-sidetab {
  display: flex;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 16px;
}
.cat-sidetab-tabs {
  display: flex;
  flex-direction: column;
  width: 120px;
  flex-shrink: 0;
  background: var(--ace-red);
  border-right: 1px solid var(--border);
}
.cat-sidetab-tab {
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 600;
  color: rgba(255,255,255,0.7);
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
}
.cat-sidetab-tab:hover { color: #fff; }
.cat-sidetab-tab.active {
  color: #fff;
  font-weight: 700;
  background: rgba(0,0,0,0.15);
}
.cat-sidetab-panels {
  flex: 1;
  padding: 12px 14px;
  overflow-y: auto;
  max-height: 420px;
}
.cat-sidetab-panel { display: none; }
.cat-sidetab-panel.active { display: block; }
.cat-index-sg-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 6px;
}
.cat-index-l2 {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
  margin-right: 2px;
}

/* ── 버블 버튼 행 ── */
.noun-bubble-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}
.noun-bubble {
  padding: 4px 12px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
}
.noun-bubble:hover {
  border-color: var(--ace-red);
  color: var(--ace-red);
}
.noun-bubble.active {
  border-color: var(--ace-red);
  color: var(--ace-red);
  background: var(--ace-red-tint);
}

/* ── 카테고리 섹션 구분 ── */
.cat-section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 20px 0 8px;
}
.cat-section-header h3 {
  font-size: 13px;
  font-weight: 700;
  color: var(--ace-red);
  margin: 0;
  white-space: nowrap;
}
.cat-section-header::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}
.cat-l2-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  padding: 4px 0 2px 2px;
  margin-top: 4px;
}

/* ── 규격 버블 버튼 (.noun-bubble과 동일 스타일) ── */
.spec-bubble {
  padding: 4px 12px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
}
.spec-bubble:hover {
  border-color: var(--ace-red);
  color: var(--ace-red);
}

/* ── 규격 카드 (전체보기 그리드 내 카드 스타일) ── */
.spec-bubble.spec-card {
  border-radius: 8px;
  padding: 14px 12px;
  text-align: center;
  white-space: normal;
  width: 100%;
}
.spec-bubble.spec-card:hover {
  border-color: var(--ace-red);
  color: var(--ace-red);
}

/* ── 규격 모달 ── */
.spec-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.spec-modal-overlay[hidden] { display: none; }
.spec-modal-card {
  background: #fff;
  border-radius: 12px;
  width: 100%;
  max-width: 540px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
}
.spec-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 14px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.spec-modal-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
}
.spec-modal-close {
  width: 28px;
  height: 28px;
  padding: 4px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.spec-modal-close:hover { background: var(--surface, #f7f7f7); color: var(--text); }
.spec-modal-close svg { width: 16px; height: 16px; }
.spec-modal-body {
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.spec-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.spec-section-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}
.spec-section-lines {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.spec-section-line {
  font-size: 13px;
  line-height: 1.65;
  color: var(--text);
}

/* ── 확인 모달 (confirm 대체) ── */
.confirm-modal-card {
  max-width: 360px;
}
.confirm-modal-message {
  padding: 20px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
  white-space: pre-line;
}
.confirm-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 0 20px 16px;
}

/* ── 규격 inline 카드 (검색 결과) ── */
.spec-inline-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px 20px;
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.spec-inline-card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

/* ── 알림 / 에러 ── */
.notice {
  background: #e8f5e9;
  color: #2e7d32;
  border: 1px solid #a5d6a7;
  border-radius: 6px;
  padding: 10px 14px;
  font-size: 14px;
  margin-bottom: 20px;
}
.error {
  background: var(--ace-red-tint);
  color: var(--ace-red);
  border: 1px solid #f5a0ad;
  border-radius: 6px;
  padding: 10px 14px;
  font-size: 14px;
  margin-bottom: 16px;
}

/* ── 제안 서브 탭 ── */
.propose-subtabs {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  border-bottom: 2px solid var(--border);
}
.propose-subtab {
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
}
.propose-subtab.active {
  color: var(--ace-red);
  border-bottom-color: var(--ace-red);
}

/* (구) 관리 액션 카드(.manage-action*)는 _admin_header.html 4-버튼바로 대체되어 제거됨. */

/* ── 제안 폼 ── */
.propose-form label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 14px;
}
.propose-form label input[type="text"],
.propose-form label textarea {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
}
.propose-form label textarea { min-height: 80px; resize: vertical; }
.propose-form fieldset {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 14px;
  margin-bottom: 14px;
}
.propose-form fieldset legend {
  font-size: 13px;
  font-weight: 600;
  padding: 0 4px;
}
.propose-form fieldset label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: normal;
  margin-bottom: 0;
  margin-right: 20px;
}
.propose-form button[type="submit"] {
  padding: 10px 24px;
  background: var(--ace-red);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.propose-form button[type="submit"]:hover { background: var(--ace-red-dark); }

/* ── 제안 폼 인라인 오류 ── */
.propose-inline-error {
  display: block;
  font-size: 12px;
  color: var(--ace-red);
  margin-top: 4px;
  min-height: 16px;
}

/* ── 그룹명 검색 드롭다운 ── */
.propose-group-wrap {
  position: relative;
  margin-top: 4px;
}
.propose-group-wrap input[type="text"] {
  display: block;
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
}
.propose-group-dropdown {
  position: absolute;
  top: calc(100% + 2px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  list-style: none;
  margin: 0;
  padding: 4px 0;
  z-index: 50;
  max-height: 220px;
  overflow-y: auto;
}
.propose-group-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 14px;
  gap: 8px;
}
.propose-group-item:hover { background: var(--surface, #f7f7f7); }
.propose-group-name { font-weight: 600; color: var(--text); }
.propose-group-noun { font-size: 12px; color: var(--muted); white-space: nowrap; }
.propose-group-meta {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}

/* ── 확인 모달 ── */
.propose-confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.propose-confirm-overlay[hidden] { display: none; }
.propose-confirm-card {
  background: #fff;
  border-radius: 10px;
  padding: 24px 20px 20px;
  width: 100%;
  max-width: 360px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
}
.propose-confirm-reason {
  font-size: 14px;
  color: var(--text);
  margin: 0 0 8px;
  line-height: 1.6;
  white-space: pre-line;
  text-align: center;
}
.propose-confirm-question {
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 20px;
  text-align: center;
}
.propose-confirm-btns {
  display: flex;
  gap: 8px;
  justify-content: center;
}
.propose-confirm-btns button {
  padding: 8px 18px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
}
#propose-confirm-ok {
  background: var(--ace-red);
  color: #fff;
  border-color: var(--ace-red);
}
#propose-confirm-ok:hover { background: var(--ace-red-dark); }

/* ── 다중 은어 등록 ── */
.propose-alias-section {
  margin-bottom: 14px;
}
.propose-alias-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.propose-label-text {
  font-size: 13px;
  font-weight: 600;
}
.propose-add-btn {
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ace-red);
  background: #fff;
  border: 1px solid var(--ace-red);
  border-radius: 20px;
  cursor: pointer;
}
.propose-add-btn:hover {
  background: var(--ace-red-tint);
}
.alias-entry {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 8px;
  background: var(--surface, #f7f7f7);
}
.alias-entry-top {
  display: flex;
  gap: 6px;
  align-items: flex-start;
}
.alias-entry-top input[type="text"] {
  flex: 1;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  background: #fff;
}
.alias-entry-remove {
  flex-shrink: 0;
  width: 28px;
  height: 34px;
  padding: 0;
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.alias-entry-remove:hover {
  border-color: var(--ace-red);
  color: var(--ace-red);
  background: var(--ace-red-tint);
}
.alias-entry-group {
  margin-top: 8px;
}
.alias-entry-group .propose-group-wrap {
  margin-top: 0;
}
.alias-entry-group .propose-group-wrap input[type="text"] {
  background: #fff;
}
.alias-entry-group-manual {
  display: block;
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  background: #fff;
  margin-top: 4px;
  box-sizing: border-box;
}
.propose-no-group-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
  margin-top: 6px;
  cursor: pointer;
}
.propose-no-group-label input[type="checkbox"] {
  margin: 0;
  cursor: pointer;
}

.propose-guide {
  background: var(--surface, #f7f7f7);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 14px 16px;
  margin-bottom: 20px;
  font-size: 13px;
  line-height: 1.7;
}
.propose-guide summary {
  font-weight: 600;
  cursor: pointer;
  color: var(--muted);
}
.propose-guide ul { margin: 8px 0 0; padding: 0; list-style: none; }
.propose-guide li { padding: 2px 0; padding-left: 0; }
.propose-guide li::before { display: none; }

/* ── 규격 카드 그리드 전체보기 ── */
.spec-card-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  padding: 8px 0;
}
@media (max-width: 900px) {
  .spec-card-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ── 관리 탭 ── */
.manage-form { display: flex; flex-direction: column; gap: 10px; }
.form-row { display: flex; flex-direction: column; gap: 4px; position: relative; }
.form-row label { font-size: 12px; font-weight: 600; color: var(--muted); }
.text-input {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  color: var(--text);
  background: #fff;
  width: 100%;
  box-sizing: border-box;
}
.text-input:focus { outline: none; border-color: var(--ace-red); }
.btn-primary {
  padding: 9px 18px;
  background: var(--ace-red);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  align-self: flex-start;
}
.btn-primary:hover { opacity: 0.88; }
.btn-primary:disabled { opacity: 0.5; cursor: default; }
.btn-small {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  font-size: 12px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
  color: var(--text);
}
.btn-small svg { flex-shrink: 0; }
.btn-small:hover { background: var(--surface); }
.btn-small:disabled { opacity: 0.5; cursor: default; }
.btn-small:disabled:hover { background: #fff; }
.btn-small.btn-danger { border-color: var(--ace-red); color: var(--ace-red); }
.btn-small.btn-danger:hover { background: var(--ace-red-tint, #fff0f0); }
.btn-revert {
  padding: 4px 10px;
  font-size: 12px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
  color: var(--text);
}
.btn-revert:hover { background: var(--surface); }

.row-highlight {
  background-color: #fffbe6;
  transition: background-color 1.8s ease-out;
}
.row-highlight-done {
  background-color: transparent;
  transition: background-color 1.8s ease-out;
}
.search-dropdown {
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  max-height: 200px;
  overflow-y: auto;
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  z-index: 100;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.dropdown-item {
  padding: 8px 12px 8px 28px;
  font-size: 13px;
  cursor: pointer;
  position: relative;
}
.dropdown-item::before {
  content: '';
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ace-red, #D40029);
}
.dropdown-item:hover { background: var(--surface); }
.suggest-card {
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  background: #fff;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: baseline;
}
.suggest-card:hover { border-color: var(--ace-red); background: var(--ace-red-tint, #fff0f0); }
.suggest-card.selected { border-color: var(--ace-red); background: var(--ace-red-tint, #fff0f0); }
.suggest-group-name { font-weight: 600; font-size: 14px; }
.suggest-general-noun { font-size: 12px; color: var(--muted); }
.suggest-reason { font-size: 12px; color: var(--muted); flex-basis: 100%; }
.selected-group-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  background: var(--ace-red-tint, #fff0f0);
  border: 1px solid var(--ace-red);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ace-red);
}
.selected-group-badge button {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  color: var(--ace-red);
  padding: 0 0 0 2px;
}

/* ── 그룹 선택 통합 패널 — 선택 태그 + 필터 + 트리를 한 박스로 묶음 (design_refinement 참고) ── */
.group-select-panel {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff;
}
.group-select-panel .ga-selected-groups-wrap {
  padding-bottom: 10px;
  margin-bottom: 10px;
  border-bottom: 1px dashed var(--border);
}
.group-select-panel .ga-group-filter {
  border-style: dashed;
  background: var(--surface, #f7f7f7);
  margin-bottom: 8px;
}

/* ── 인라인 그룹 트리 ── */
.group-tree-panel {
  max-height: 260px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.group-tree-noun-section { display: flex; flex-direction: column; gap: 6px; }
.group-tree-noun-header {
  font-size: 12px;
  font-weight: 700;
  color: var(--ace-red);
  padding-bottom: 3px;
  border-bottom: 1px solid var(--border);
}
.group-tree-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.group-tree-tag {
  padding: 3px 11px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
}
.group-tree-tag:hover {
  border-color: var(--ace-red);
  color: var(--ace-red);
}
.group-tree-tag.selected {
  background: var(--ace-red-tint, #fff0f0);
  border-color: var(--ace-red);
  color: var(--ace-red);
}

/* ── 규격 설명 수정/삭제 — 하단 고정 편집/미리보기 패널 ── */
.spec-edit-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 16px;
}
@media (max-width: 800px) {
  .spec-edit-panel { grid-template-columns: 1fr; }
}
.spec-edit-panel-col {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.spec-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--surface, #f7f7f7);
  border-bottom: 1px solid var(--border);
}
.spec-panel-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}
.spec-panel-hint {
  font-size: 12px;
  color: var(--muted);
}
.spec-panel-body {
  padding: 14px;
  flex-grow: 1;
}
.spec-panel-placeholder {
  font-size: 13px;
  color: var(--muted);
  margin: 0;
}
.spec-panel-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--surface, #f7f7f7);
  border-top: 1px solid var(--border);
}
.spec-panel-footer-left,
.spec-panel-footer-right {
  display: flex;
  gap: 8px;
}
.spec-panel-msg {
  margin: 0 14px 10px;
  font-size: 13px;
}

/* ── 품목/브랜드 관리 탭 — 카드형 리디자인 (design_refinement 시안 반영) ── */
.manage-card {
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 32px;
  margin-bottom: 16px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}
.manage-card .help-card-title {
  font-size: 1.15rem; margin: 0 0 20px; padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: baseline; gap: 10px;
}
.manage-row-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
}
/* 그룹 선택 라벨 줄에 "AI 그룹 추천" 토글 버튼을 나란히 배치 —
   AI 패널은 선택사항이라 접힌 기본 상태에서는 버튼 한 줄만 보이고
   우측에 빈 공간이 남지 않는다(펼치면 그룹 선택 박스 아래로 이어짐). */
.ga-group-select-label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}
.ga-ai-collapsed .ga-ai-toggle-body {
  display: none;
}
.manage-row-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 16px;
  background: #fff;
  transition: border-color var(--dur, 0.15s), box-shadow var(--dur, 0.15s);
}
.manage-row-card:last-of-type { margin-bottom: 0; }
.manage-row-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}
.manage-row-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.manage-row-num { font-size: 12px; font-weight: 700; color: var(--muted); }
.manage-ai-panel {
  background: var(--surface, #f7f7f7);
  border: 1px solid var(--border);
  border-left: 3px solid var(--ace-red);
  border-radius: 12px;
  padding: 24px;
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}
.manage-ai-panel-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 700;
  color: var(--ace-red);
  margin: 0 0 4px;
}
.ga-ai-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 700;
  color: var(--ace-red);
  background: var(--ace-red-tint, #fff0f0);
  border: 1px solid var(--ace-red);
  border-radius: 20px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}
.ga-ai-toggle-btn:hover { opacity: 0.85; }
.ga-ai-toggle-btn::after {
  content: '▾';
  font-size: 10px;
  transition: transform var(--dur, 0.15s);
}
.ga-ai-collapsed .ga-ai-toggle-btn::after {
  transform: rotate(-90deg);
}
.manage-ai-panel-desc {
  font-size: 12px;
  color: var(--muted);
  margin: 0 0 16px;
}
.manage-add-btn { margin-bottom: 16px; }
.manage-save-btn {
  width: 100%;
  padding: 16px;
  font-size: 16px;
  font-weight: 700;
  border-radius: 12px;
}
.manage-result-table-wrap {
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}
.manage-result-table-wrap .dict-table { margin-bottom: 0; }
