/* --- [기존 스타일] --- */
body {
  font-family: 'Malgun Gothic', sans-serif;
  margin: 0;
}

button {
  cursor: pointer !important;
}


.tab-content {
  display: none;
  padding: 20px;
}

.tab-content.active {
  display: block;
}

.tab2 {
  font-family: 'HJHanJeonSeoB', serif;
}

svg {
  background: transparent !important;
}

.wrap {
  /* width: 890px; */
  max-width: 95%;
  margin: 16px auto 40px;
  display: grid;
  grid-template-columns: 40% 60%;
  gap: 16px;
  align-items: start;
}

.mkstamp-panel-wrap {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
}

.panel {
  background: #fff;
  border: 1px solid #e1d8c8;
  border-radius: 12px;
  padding: 14px 16px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .04);
}

/*
.corpPanel{
  max-height:520px;
  overflow-y:scroll;	
}
*/

.preview-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-items: center;
    align-items: start;
    justify-content: space-around;
}

.mkstamp-panel-wrap .panel {
  width: calc((25% - 30px));
  display: flex;
  flex-direction: column;
  align-content: space-between;
  gap: 7px;
}

.mkstamp-panel-wrap .panel .panel-img {
  width: 100%;
}

.mkstamp-panel-wrap .panel .panel-img>img {
  width: 50%;
  aspect-ratio: 16 / 9;
  object-fit: contain;
}

/* 도장등록 전 페이지 */
#tab1 .mkstamp-panel-wrap.mkstamp-panel-wrap2 {
  width: 100%;
  display: none;
  /*활성화시 flex로! */
  padding-top: 15%;
  justify-content: center;
}

.mkstamp-panel-wrap.mkstamp-panel-wrap2 .first-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.mkstamp-panel-wrap.mkstamp-panel-wrap2 .page-title {
  text-align: center;
}

.header-switch.first-page-switch .header-switch-btn {
  padding: 6px;
}

.panel-quick-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border);
  padding-top: 9px;
}

.panel-quick-box a {
  width: 50%;
  text-align: center;
}

.panel-quick-box a button {
  color: var(--text-secondarys);
}

.panel-quick-box a:hover button {
  font-weight: 600;
  color: var(--primary-red);
}

.panel-quick-box a:first-of-type {
  border-right: 1px solid var(--border);
  ;
}

/* #tab1 .mkstamp-panel-wrap .panel svg {
      text-align: center;
      margin: 0 auto;
    } */

#tab3 .panel,
#tab4 .panel {
  display: flex;
  flex-direction: column;
  align-content: center;
  align-items: center;
}

.panel-h2-box {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  border-bottom: 1px solid var(--border);
}
.mkstamppanel-wrap .panel {
    width: calc((25% - 30px));
    display: flex;
    flex-direction: column;
    align-content: space-between;
    gap: 7px;
    row-gap: 7px;
    column-gap: 7px;
}

.mkstamppanel-wrap .panel h4 {
  margin: 6px 0 12px;
  font-size: 13px;
  font-weight: 700;
  color: #7a2b2b;
}
.mkstamppanel-wrap .panel .panel-img {
    width: 100%;
    text-align: center;
}
.mkstamppanel-wrap .panel .panel-img>img {
    width: 50%;
    aspect-ratio: 16 / 9;
    object-fit: contain;
}

/* button.panel-pop {
      border: 1px solid #ddd;
      border-radius: 3px;
      width: 25px;
      height: 25px;

    }

    .panel-pop-menu {
      position: absolute;
      right: 0px;
      top: 40px;
      padding: 8px;
      background: #fff;
      border: 1px solid #ddd;
      border-radius: 3px;
      display: none;
      z-index: 10;
    } */
/* 툴팁을 위한 기본 컨테이너 설정 */
.css-minibtn.miniBtnMember {
  position: relative;
}

/* 툴팁 스타일 (::after 가상 요소 사용) */
.css-minibtn[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  background-color: #333;
  color: #fff;
  padding: 5px 10px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  bottom: 120%;
  left: 50%;
  transform: translateX(-50%);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease-in-out, visibility 0.2s ease-in-out;
  z-index: 10;
}

.css-minibtn[data-tooltip]:hover::after {
  opacity: 1;
  visibility: visible;
}

button.panel-pop i {
  font-size: 16px;
  color: var(--text-secondary);
}

button.css-minibtn {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--text-secondary);
}

button.css-minibtn .pop-show {
  display: block;
}

#stampTabContent .row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin: 8px 0;
  flex-wrap: wrap;
  min-height: auto;
}

.row label {
  min-width: 28px;
  font-weight: 600;
}

.row input[type="text"] {
  flex: 1;
  height: 36px;
  border: 1px solid #d8cfc0;
  border-radius: 8px;
  padding: 0 12px;
  font-size: 15px;
  outline: none;
}

.row small {
  color: #8b7d6a;
}

.btn {
  height: 34px;
  padding: 0 14px;
  border-radius: 8px;
  border: 1px solid #b84b4b;
  font-weight: 700;
  cursor: pointer;
  font-size: 14px;
}

.btn.secondary {
  background: #fff;
  color: var(--primary-red)
}

.btn:disabled {
  opacity: .5;
  cursor: not-allowed;
}

.btn.primary {
  background: var(--primary-red);
  color: #fff;
}


.seal-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.seal-caption {
  font-size: 12px;
  color: #5c4f3e;
  text-align: center;
  line-height: 1.2;
}

.seal-sm {
  width: 100px;
  height: 100px;
}

.font-loading {
  opacity: 0;
  transition: opacity 0.3s ease;
}

.font-loaded {
  opacity: 1;
}

.control-inline {
  display: inline-flex;
  gap: 8px;
  align-items: center;
}

select,
input[type="number"] {
  height: 30px;
  border: 1px solid #d8cfc0;
  border-radius: 8px;
  padding: 0 10px;
  font-size: 14px;
  outline: none;
}

.seal-card {
  position: relative;
  padding: 6px;
  border: 2px solid transparent;
  border-radius: 12px;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
  cursor: pointer;
}

.seal-card:hover {
  border-color: #e7b1b1;
  box-shadow: 0 0 0 3px rgba(173, 36, 36, .10);
}

.seal-card.selected {
  border-color: var(--primary-red);
  box-shadow: 0 0 0 4px rgba(173, 36, 36, .18);
  background: #fff7f7;
}

.seal-card svg {
  pointer-events: none;
}

.imgUploaded {
  height: 432px;
  overflow-y: scroll;
}

img.uploadedSeals {
  margin: 5px;
  height: 120px;
  width: 120px;
  border-color: var(--primary-red);
  box-shadow: 0 0 0 4px rgba(173, 36, 36, .18);
  background: #fff7f7;
}

img.uploadedSigns {
  margin: 5px;
  height: 100px;
  width: 250px;
  border-color: var(--primary-red);
  box-shadow: 0 0 0 4px rgba(173, 36, 36, .18);
  background: #fff7f7;
}

.boldRed {
  color: var(--primary-red);
  text-shadow: 0 0 1px red;
}

@font-face {
  font-family: 'Chosun100Year';
  src: url('/resources/fonts/ChosunCentennial_ttf.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
}

@font-face {
  font-family: 'JoseonPalace';
  src: url('/resources/fonts/ChosunGs.woff') format('woff');
  font-weight: normal;
  font-display: swap;
}


@font-face {
  font-family: 'KotraBold';
  /* src: url('/resources/fonts/KOTRA_BOLD-Bold.woff') format('woff'); */
  src: url('/resources/fonts/KOTRA_BOLD-Bold.woff') format('woff');
  font-weight: normal;
  font-style: normal;
}

/* --- [!!수정!!] 네비게이션 스타일 --- */
.nav-switch-container {
  padding: 12px 12px 8px;
  border-bottom: 1px solid #e1d8c8;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  justify-content: space-between;
}

.nav-switch {
  display: inline-flex;
  border-radius: 8px;
  padding: 4px;
  gap: 10px
}

.switch-btn {
  padding: 6px 16px;
  border: none;
  background: #e6ded4;
  color: #7a6a55;
  font-size: 15px;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.switch-btn:hover,
.switch-btn.active,
.switch-btn.btn.btn-primary {
  background-color: var(--primary-red);
  color: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}


/* ----- 모달 공통 스타일 ----- */
.mkstamp-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.mkstamp-modal-overlay.visible {
  display: flex;
  opacity: 1;
}

.mkstamp-modal-content {
  background-color: #fff;
  border-radius: 12px;
  width: 90%;
  max-width: 900px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
  transform: scale(0.95);
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
  max-height: 90vh;
}

.mkstamp-modal-overlay.visible .mkstamp-modal-content {
  transform: scale(1);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #e9ecef;
  padding: 1.25rem 1.5rem;
  flex-shrink: 0;
  /* 헤더는 줄어들지 않음 */
}

.modal-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
}

.btn-close {
  background: none;
  border: none;
  font-size: 1.75rem;
  font-weight: 300;
  color: #888;
  cursor: pointer;
  padding: 0.5rem;
  line-height: 1;
  transition: color 0.2s ease;
}

.btn-close:hover {
  color: #000;
}

.modal-body {
  margin-top: 55px;
  padding: 1.5rem;
  overflow-y: auto;
  /* ++본문 내용이 길어지면 스크롤 */
}

.modal-body::-webkit-scrollbar {
  width: 5px;
}

.modal-body::-webkit-scrollbar-track {
  background: #f1f1f1;
}

.modal-body::-webkit-scrollbar-thumb {
  background: #b84b4b;
  ;
  width: 3px;
}

.modal-footer {
  border-top: 1px solid #e9ecef;
  padding: 1.25rem 1.5rem;
  display: flex;
  justify-content: center;
  flex-shrink: 0;
  /* 푸터는 줄어들지 않음 */
}

/* ----- 탭 스타일 (모달 내부) ----- */
.tab-nav {
  width: calc(100% - 3rem);
  display: flex;
  border-bottom: 2px solid #e9ecef;
  margin-bottom: 1rem;
  position: fixed;
  top: 85px;
  background: #fff;
  justify-content: space-between;
  align-items: center
}

.tab-button {
  background: none;
  border: none;
  padding: 0.75rem 1rem;
  cursor: pointer;
  font-size: 1rem;
  color: #555;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: color 0.2s ease, border-color 0.2s ease;
  border-radius: 0;
}

.tab-button:hover {
  color: #000;
}

.tab-button.active {
  font-weight: 600;
  color: var(--primary-red);
  border-bottom-color: var(--primary-red);
}

.modal-tab-panel {
  display: none;
  padding: 0.5rem 0;
  line-height: 1.6;
}

.modal-tab-panel.active {
  display: block;
}


/* ----- [!!추가!!] 일반도장.html 스타일 (모달 내부에 적용) ----- */
/* :root는 전역이라 그대로 두거나, 모달 내부용 변수로 바꿀 수 있습니다. */
/* 여기서는 충돌을 피하기 위해 필요한 변수만 사용합니다. */
:root {
  --bg: #f6f7fb;
  --panel: #ffffff;
  --border: #cdd2e8;
  --label: #6b6f80;
  --text: #0f172a;
  --accent: #e11d48;
  --accent-dark: #c91818;
  --primary-red: #a61118;
  --primary-red-dark: #861616;
  /* 빨강 메인색 (#e11d48 → 붉은계열 primary) */
  --accent-bg: rgba(225, 29, 72, .1);
  /* 빨강 투명 배경 */
  --error: #e11d48;
  --line: #d0d3dc;
  --card-bg: #fff;
  --page-bg: #f6f7fb;
  --ink: red;
  --soft-shadow: 0 12px 32px rgba(0, 0, 0, .06);
  --border-radius-lg: 12px;
  --border-radius-md: 10px;
  --border-radius-sm: 8px;
  --header-text: #222;
  --sub-text: #666;
}

#stampModal .general-seal-generator h1 {
  margin: 0 0 16px 0;
  font-size: 18px;
  font-weight: 600;
  color: #222;
}

/* 상단 입력 카드 */
#stampModal .control-card {
  background: var(--card-bg);
  border: 1px solid #d9dbe6;
  border-radius: var(--border-radius-lg);
  box-shadow: 0 16px 40px rgba(0, 0, 0, .04);
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: center;
  margin-bottom: 10px;
}

#stampModal .control-top-row {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  align-items: flex-end;
}

#stampModal .control-left {
  flex: 1 1 260px;
  min-width: 260px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#stampModal .label-row {
  display: inline-block;
}

#stampModal .label-row label {
  font-size: 14px;
  font-weight: 600;
  color: #222;
  min-width: fit-content;
  /* 'row'의 label과 충돌 방지 */
}

#stampModal .label-row .hint {
  font-size: 12px;
  color: var(--sub-text);
}

#stampModal .input-wrap {
  position: relative;
  flex: 1;
}

#stampModal .input-wrap input {
  width: 100%;
  border: 1px solid var(--line);
  background: #fafbff;
  border-radius: var(--border-radius-md);
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  /* 'row'의 input과 충돌 방지 */
  height: auto;
  flex: unset;
}

#stampModal .input-wrap small {
  display: block;
  font-size: 12px;
  line-height: 1.5;
  color: var(--sub-text);
  margin-top: 6px;
}

#stampModal .control-right {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-start;
  min-width: 110px;
}

#stampModal button.btn-preview {
  background: var(--accent-dark);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  border: 0;
  border-radius: var(--border-radius-md);
  padding: 10px 16px;
  /* box-shadow: 0 10px 20px rgba(201, 24, 24, .28); */
  cursor: pointer;
  height: auto;
}

#stampModal button.btn-preview:hover {
  opacity: .9;
}

/* 안내 */
#stampModal .notice-box {
  font-size: 12px;
  color: var(--sub-text);
  line-height: 1.5;
  border-top: 1px solid #edeef5;
  padding-top: 8px;
  width: 100%;
  text-align: center;
}

/* 도장등록 버튼 */
#stampModal button.btn-register {
  background: var(--primary-red);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  border: 0;
  border-radius: var(--border-radius-md);
  padding: 10px 0;
  width: 120px;
  text-align: center;
  margin-top: 8px;
  cursor: pointer;
  /* 'btn' 클래스와 충돌 방지 */
  height: auto;
}

#stampModal button.btn-register:hover {
  box-shadow: 0 8px 20px rgba(255, 64, 102, .25);
  background: var(--primary-red-dark)
}

/* 결과 카드 */
#stampModal .gallery-wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px;
}
#stamp-tab4-pane .gallery-wrap {
  display: flex;
  justify-content: center;
}

/* 카드 */
#stampModal .stamp-card {
  /* flex: 1 1 260px; */
  min-width: 260px;
  /* max-width: calc(33% - 16px); */
  /* 모달 너비에 맞게 조절 */
  background: #fff;
  border: 2px solid #d9dbe6;
  border-radius: var(--border-radius-lg);
  box-shadow: var(--soft-shadow);
  padding: 16px 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  cursor: pointer;
  transition: all .15s ease-in-out;
}

#stampModal .stamp-card:hover {
  transform: none;
}

/* 카드 헤더 */
#stampModal .stamp-card-header {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #222;
}

#stampModal .stamp-card-header .sub {
  font-size: 13px;
  font-weight: 600;
  color: #222;
  line-height: 1.4;
}

/* 미리보기 영역 */
#stampModal .stamp-preview-box {
  border: 2px solid #d9dbe6;
  /* 기본도 회색 테두리 표시 */
  border-radius: var(--border-radius-md);
  background: #fff;
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 160px;
  transition: border .15s ease-in-out, box-shadow .15s ease-in-out;
}

#stampModal .stamp-preview-box svg {
  max-width: 100%;
  height: auto;
}

/* 선택 상태일 때 강조 */
#stampModal .stamp-card.selected .stamp-preview-box {
  border: 2px solid var(--accent-dark);
  /* 빨강 강조 */
  box-shadow: 0 0 0 3px rgba(201, 24, 24, .15);
}

#stampModal #stampText {
  width: 80%
}

/* ----- 끝: 일반도장.html 스타일 ----- */
/* 고정사인 입력기 */
/* 고정사인 등록 영역 TODO 위랑 겹치는 부분 check */
#signTabContent .input-wrap {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 16px 40px rgba(15, 23, 42, .08);
  padding: 20px 20px 24px;
  margin: 0 auto 24px;
}

#signTabContent .topnote {
  font-size: 12px;
  line-height: 1.5;
  color: #4b4f67;
  margin: 0 0 16px;
}

/* 입력 영역 카드 */

#signTabContent .field-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-start;
  margin-bottom: 12px;
}

#stampTabContent label,
#signTabContent label {
  font-size: 13px;
  font-weight: 500;
  color: #2f334d;
  flex-basis: 100%;
}

.input-area {
  flex: 1;
  min-width: 0;
  position: relative;
}

.nameInput {
  width: 80%;
  font-size: 14px;
  line-height: 1.4;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  outline: none;
  font-family: inherit;
}

.nameInput:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, .18);
}

/* 공통 버튼 스타일 */
.action-btn {
  flex-shrink: 0;
  cursor: pointer;
  appearance: none;
  border: 0;
  border-radius: 8px;
  background: var(--primary-red);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  padding: 10px 14px;
  line-height: 1.2;
  box-shadow: 0 6px 16px rgba(225, 29, 72, 0.4);
  /* 빨강 그림자 */
  transition: background-color .15s ease, transform .1s ease, box-shadow .15s ease;
}

.action-btn:hover {
  background: #d41445;
  /* hover 때 살짝 어두운 빨강 */
  box-shadow: 0 8px 20px rgba(225, 29, 72, 0.55);
}

.action-btn:active {
  transform: scale(.97);
  background: #b3133d;
  box-shadow: 0 4px 12px rgba(225, 29, 72, 0.35);
}

.save-row {
  text-align: center;
  margin-top: 16px;
}

#saveFixedSignBtn {
  cursor: pointer;
  appearance: none;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  padding: 10px 16px;
  line-height: 1.2;
  box-shadow: 0 6px 16px rgba(225, 29, 72, 0.4);
  min-width: 120px;
  transition: background-color .15s ease, transform .1s ease, box-shadow .15s ease;
}

#saveFixedSignBtn:hover {
  background: #d41445;
  box-shadow: 0 8px 20px rgba(225, 29, 72, 0.55);
}

#saveFixedSignBtn:active {
  transform: scale(.97);
  background: #b3133d;
  box-shadow: 0 4px 12px rgba(225, 29, 72, 0.35);
}

#saveFixedSignBtn:disabled {
  opacity: .4;
  cursor: not-allowed;
  box-shadow: none;
}

.rule {
  font-size: 11px;
  line-height: 1.4;
  color: #6b6f80;
  margin-bottom: 8px;
}

.error {
  font-size: 11px;
  line-height: 1.4;
  color: var(--error);
  min-height: 14px;
  margin-top: 4px;
}


/* 10개 그리드 */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  max-width: 1280px;
  margin: 0 auto;
}

.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.05);
  padding: 16px 16px 20px;
  display: flex;
  flex-direction: column;
  position: relative;
}

.font-name {
  font-size: 13px;
  color: #2f334d;
  font-weight: 600;
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.font-name small {
  font-size: 11px;
  font-weight: 400;
  color: #6b6f80;
}

/* 서명 박스 */
.sig-box {
  position: relative;
  border: 2px solid var(--border);
  border-radius: 8px;
  background: #fff;
  /* 가로는 grid나 카드 폭에 맞추고, 높이는 5:2 비율로 자동 설정 */
  aspect-ratio: 5 / 2;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 16px 28px;
  text-align: center;
  cursor: pointer;
  transition: border-color .12s ease, box-shadow .12s ease, background-color .12s ease;
  box-sizing: border-box;
}

.sig-box.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-bg);
  background: rgba(79, 70, 229, .03);
}

.sig-box.selected .sig-label {
  border-color: var(--accent);
  color: var(--accent);
}

.sig-label {
  position: absolute;
  top: 8px;
  left: 12px;
  font-size: 10px;
  font-weight: 500;
  color: var(--label);
  background: #fff;
  padding: 0 4px;
  line-height: 1.2;
  border-radius: 3px;
  border: 1px solid #d3d7ec;
  transition: all .12s ease;
}

.sig-underline {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 16px;
  border-bottom: 2px solid #1e253f;
  opacity: .4;
}

.sig-text {
  line-height: 1;
  color: #0f172a;
  white-space: nowrap;
  transition: font-size .12s ease;
  will-change: font-size;
}
.reset-eraser {
    width: 100%;
    position: relative;
}
button#clearSign {
    position: absolute;
    top: 0px;
    right: 0px;
    padding: 0 5px;
    line-height: 1;
    width: 25px;
    height: 25px;
    color: var(--sub-text);
    border-color: var(--sub-text);
}
/* ===== 폰트별 스타일 ===== */
/* 1. 자연스러운 볼펜 손글씨 */
.f-pen1 {
  font-family: "Nanum Pen Script", "Nanum Gothic", cursive;
  font-size: 34px;
  font-weight: 400;
  letter-spacing: -0.07em;
  transform: skewX(-2deg);
}

/* 2. 단정한 필기 */
.f-pen2 {
  font-family: "Nanum Pen Script", "Nanum Gothic", cursive;
  font-size: 30px;
  font-weight: 400;
  letter-spacing: -0.04em;
  transform: skewX(-1deg);
}

/* 3. 둥근/귀여운 필체 */
.f-pen3 {
  font-family: "Dongle", "Nanum Pen Script", cursive;
  font-size: 40px;
  font-weight: 400;
  letter-spacing: -0.05em;
  line-height: 1.05;
  transform: skewX(-4deg);
}

/* 4. 기울어진 캐주얼 */
.f-pen4 {
  font-family: "Dongle", "Nanum Pen Script", cursive;
  font-size: 36px;
  font-weight: 400;
  letter-spacing: -0.05em;
  transform: skewX(-6deg) rotate(-2deg);
}

/* 5. 붓펜 스타일 */
.f-pen5 {
  font-family: "Ink Lipquid", "Nanum Pen Script", cursive;
  font-size: 32px;
  font-weight: 400;
  letter-spacing: -0.06em;
  transform: rotate(-2deg) skewX(-4deg);
  text-shadow: 0 0 0.6px rgba(0, 0, 0, 0.4);
}

/* 6. 얇고 미니멀 */
.f-pen6 {
  font-family: 'Noto Sans KR', system-ui, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", "맑은 고딕", sans-serif;
  font-size: 24px;
  font-weight: 300;
  letter-spacing: -0.03em;
  transform: skewX(-2deg);
}

/* 7. 개성 있는 싸인 (Gugi) */
.f-pen7 {
  font-family: "Gugi", "Nanum Pen Script", cursive;
  font-size: 30px;
  font-weight: 400;
  letter-spacing: -0.03em;
  line-height: 1.1;
  /* 살짝 강조감 있는 인장 느낌 */
}

/* 8. 밝고 친근한 서명 (Gaegu) */
.f-pen8 {
  font-family: "Gaegu", "Nanum Pen Script", cursive;
  font-size: 34px;
  font-weight: 400;
  letter-spacing: -0.04em;
  line-height: 1.05;
  transform: skewX(-2deg);
}

/* 9. 정자체 싸인 (Song Myung) */
.f-pen9 {
  font-family: "Song Myung", "Nanum Myeongjo", serif;
  font-size: 28px;
  font-weight: 400;
  letter-spacing: -0.05em;
  line-height: 1.15;
  /* 공문서/계약서 스타일 느낌 */
}

/* 10. 얇고 흐르는 듯한 감성 (Hi Melody) */
.f-pen10 {
  font-family: "Hi Melody", "Nanum Pen Script", cursive;
  font-size: 32px;
  font-weight: 400;
  letter-spacing: -0.05em;
  line-height: 1.1;
  transform: skewX(-2deg);
}

/* 사인 이미지 업로드 */
/* 사인 이미지 등록 TODO check */
.sign-upload-wrap {
  max-width: 520px;
  margin: 0 auto;
  text-align: center;
  color: #444;
}

.guide-text {
  text-align: center;
  font-size: 14px;
  color: #555;
  line-height: 1.4;
  margin: 0 0 12px;
  white-space: pre-line;
}

.file-row {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.file-info {
  display: flex;
  align-items: center;
  font-size: 13px;
  line-height: 1.4;
  background: #f5f5f5;
  border: 1px solid #ccc;
  border-radius: 4px;
  padding: 6px 8px;
}

.file-info .name {
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
}

.file-cancel {
  font-size: 13px;
  color: #666;
  text-decoration: underline;
  cursor: pointer;
  margin-left: 6px;
}

#stampTabContent .btn-upload,
#signTabContent .btn-upload {
  display: inline-block;
  background: var(--primary-red);
  color: var(--bg);
  font-weight: 600;
  font-size: 14px;
  border-radius: 4px;
  padding: 10px 16px;
  cursor: pointer;
  text-align: center;
  border: 1px solid var(--primary-red);
}

#stampTabContent .btn-upload input,
#signTabContent .btn-upload input {
  display: none;
}

.preview-bg {
  width: 500px;
  height: 200px;
  border: 1px solid #ccc;
  border-radius: 4px;
  margin: 0 auto 12px;
  background-image:
    linear-gradient(45deg, #dcdcdc 25%, rgba(0, 0, 0, 0) 25%),
    linear-gradient(-45deg, #dcdcdc 25%, rgba(0, 0, 0, 0) 25%),
    linear-gradient(45deg, rgba(0, 0, 0, 0) 75%, #dcdcdc 75%),
    linear-gradient(-45deg, rgba(0, 0, 0, 0) 75%, #dcdcdc 75%);
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.crop-stage {
  position: relative;
  width: 500px;
  height: 200px;
}

/* 두 캔버스 겹치기 */
#signPreviewCanvas,
#cropOverlayCanvas {
  position: absolute;
  left: 0;
  top: 0;
  width: 500px;
  height: 200px;
}

.controls-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 13px;
  color: #444;
  margin-bottom: 16px;
}

#stampUploadContrastRange,
#radiusRange,
#fontSizeRange,
#centerFontSizeRange,
#contrastRange {
  accent-color: red !important;
}

.controls-row input[type=range] {
  width: 180px;
}

.btn-rotate {
  border: 1px solid #ccc;
  background: #fff;
  border-radius: 20px;
  font-size: 13px;
  padding: 6px 10px;
  cursor: pointer;
}

.btn-confirm {
  display: block;
  width: 140px;
  margin: 0 auto;
  background: var(--primary-red);
  border: 1px solid var(--accent);
  border-radius: 4px;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  padding: 10px 0;
  cursor: pointer;
}

.btn-confirm[disabled] {
  background: #eee;
  border-color: #ddd;
  color: #aaa;
  cursor: default;
}

/* 고정사인 */

/* ----- 모달 헤더 전환 스위치 (도장 / 사인) ----- */
.modal-header-with-switch {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.modal-header-with-switch .header-left {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .5rem;
}

.header-switch {
  display: inline-flex;
  height: 40px;
  background: #e6ded4;
  border-radius: 6px;
  padding: 8px;
  gap: 4px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, .06);
}

.header-switch-btn {
  appearance: none;
  border: 0;
  background: transparent;
  border-radius: 6px;
  padding: 0px 6px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  color: #7a6a55;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all .15s ease;
}

.header-switch-btn:hover {
  background-color: rgba(0, 0, 0, .04);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .08);
}

.header-switch-btn.active,
.header-switch-btn[aria-selected="true"] {
  background-color: var(--primary-red);
  color: #fff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, .15);
}

.modal-header-with-switch .modal-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: #222;
  margin: 0;
}

/* 이용가능 멤버 모달 */
div#infoModal .mkstamp-modal-content {
  width: 45%;
}

.count-mem-warp {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid #e1d8c8;
  padding-bottom: 10px;
  margin-bottom: 15px;
}

.count-member {
  display: flex;
  gap: 5px;
}

.func-btn-box button {
  color: var(--label);
}

.minifindicon {
  position: absolute;
  top: 12px;
  left: 7px;
}

.nameInput.mem-nameinput {
  padding: 10px 25px;
}

.mem-list-box {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.mem-list-head {
  width: 100%;
  border-bottom: 1px solid #e1d8c8;
}

ul.mem-list li {
  display: flex;
  flex-direction: row;
}

ul.mem-list li span {
  font-size: 12px;
  color: var(--sub-text);
  gap: 4px;
}



/* 법인도장 radio */
.radio-group {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  font-family: "Noto Sans KR", sans-serif;
}

/* 숨기기 (기본 라디오 버튼) */
.radio-group input[type="radio"] {
  display: none;
}

/* 버튼 스타일 라벨 */
.radio-group label {
  cursor: pointer;
  padding: 6px 12px;
  border: 1px solid #ccc;
  border-radius: 6px;
  background: #f8f8f8;
  color: #333;
  font-size: 14px;
}

/* hover 효과 */
.radio-group label:hover {
  background: #f0f0f0;
}

/* 선택된 상태 */
.radio-group input[type="radio"]:checked+label {
  background: #c91818;
  color: white !important;
  border-color: #c91818;
  box-shadow: 0 0 0 1px #c91818;
}

.tab-select.mobile-only {
  display: none;
}


/* ----- 반응형 ----- */
@media (max-width: 1024px) {

  /* 법인도장 생성기(tab2)가 모달 안으로 들어가면서 wrap 재정의 */
  .modal-tab-panel .wrap {
    grid-template-columns: 1fr;
    margin: 0;
    /* 모달 내부에서는 여백 제거 */
    max-width: 100%;
  }

  .preview-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-items: center;
    align-items: start;
    justify-content: space-around;
  }

  #tab1 .mkstamp-panel-wrap .panel {
    width: calc((33% - 10px));
  }
  /* 기존 탭 버튼 숨김 */
  .tab-nav-L .tab-button {
    display: none;
  }

  /* Select 박스 보이기 및 스타일링 */
  .tab-select.mobile-only {
    display: block;
    width: 100%;
    height: 40px;
    padding: 0 12px;
    font-size: 15px;
    font-weight: 500;
    color: #333;
    border: 1px solid #cdd2e8;
    border-radius: 8px;
    background-color: #fff;
    outline: none;
    cursor: pointer;
    margin-top: 5px; /* 버튼과 위치를 맞추기 위한 여백 */
  }

  /* 탭 네비게이션 레이아웃 조정 (Select가 꽉 차게) */
  .tab-nav-L {
    flex-grow: 1; /* 남은 공간 차지 */
    margin-right: 10px;
    width: 100%; /* 너비 꽉 차게 */
  }
  
  /* (선택사항) 모바일에서 헤더 스위치(도장/사인) 간격 조정 */
  .header-switch {
    margin-top: 5px;
  }
}

@media (max-width: 768px) {
  .mkstamp-modal-content {
    max-width: 95%;
    max-height: 95vh;
  }

  /* 모달 내부 법인도장 생성기 */
  .modal-tab-panel .wrap {
    grid-template-columns: 1fr;
  }

  .preview-bg {
    width: 100%;
  }

  .crop-stage {
    width: 100%;
  }

  .page-title {
    font-size: 14px;
  }

  .panel h4 {
    font-size: 12px;
  }

  #tab1 .mkstamp-panel-wrap .panel {
    width: calc((50% - 10px));
    padding: 7px;
  }

  .panel-quick-box a button>i {
    display: none;
  }
}

@media (max-width: 600px) {
  .modal-header{
    align-items: center;
    padding: 0.5rem 1.5rem;
  }
  h2{
    font-size: 20px;
  }
  /* 모바일에서 모달 탭 */
    .tab-nav {
        width: 87%;
        flex-wrap: wrap;
        gap: 3px;
        top: 65px;
        margin: 0 auto;
    }
    .tab-nav-L{
      width: 55%;
    }
    .modal-body{
      margin-top: 26px;
    }
  #stampTabContent {
      margin-top: 31px;
  }
  .tab-button {
    padding: 0.5rem;
  }
  .tab-nav-L .tab-button {
    font-size: 14px;
  }
  .header-switch{
    padding: 6px;
  }
  .header-switch-btn{
    width: 50%;
    justify-content: center;
    padding: 5px;
    font-size: 12px;
  }
  #stampModal .gallery-wrap{
    justify-content: center;
  }
}


/* ===============================
 * 이용 가능 도장/사인
 * =============================== */
.tab-button[data-tab-target="#stamp-tab4-pane"] {
  display: none;
}
.tab-button[data-tab-target="#sign-tab4-pane"] {
  display: none;
}


/* 도장 패널 + 사인 패널 공통 박스 스타일 */
.general-seal-generator .panel,
#sign-tab4-pane .panel {
  width: 150px;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 8px 10px;
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

/* 마우스 오버 효과 */
.general-seal-generator .panel:hover,
#sign-tab4-pane .panel:hover {
  border-color: #c00000; /* 강조색 */
  box-shadow: 0 0 6px rgba(255, 0, 0, 0.22);
}

/* 활성화 상태 */
.general-seal-generator .panel.active,
#sign-tab4-pane .panel.active {
  border-color: #a61118;
  box-shadow: 0 0 8px rgba(215, 38, 46, 0.4);
  background: #fff4f4;
  transform: translateY(-2px);
}

/* ===============================
 * 2. 도장 영역 전용 스타일
 * =============================== */

.general-seal-generator .mkstamppanel-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.general-seal-generator .panel-h2-box {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.general-seal-generator .panel-h2-box h4 {
  font-size: 13px;
  margin: 0;
}

.general-seal-generator .stamp-created-at {
  font-size: 11px;
  color: #888;
}

.general-seal-generator .panel-img {
  width: 100%;
  aspect-ratio: 1 / 1;      /* 정사각형 박스 */
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 6px;
}

.general-seal-generator .panel-img img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}

.general-seal-generator .no-stamp-msg {
  font-size: 13px;
  color: #999;
  padding: 8px 0;
}

/* 리스트형 이미지(필요 시) */
.mkstamppanel-wrap .panel .panel-img.list > img {
  width: 100%;
}

/* ===============================
 * 3. 사인 영역 전용 스타일
 * =============================== */

#sign-tab4-pane .grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

#sign-tab4-pane .font-name span {
  font-size: 13px;
}

#sign-tab4-pane .sig-box {
  padding: 6px 8px;
  border-radius: 6px;
  background: #fafafa;
}

#sign-tab4-pane .sig-label {
  font-size: 11px;
  color: #777;
  margin-bottom: 2px;
}

#sign-tab4-pane .sig-text {
  font-size: 20px;
  line-height: 1.4;
}

#sign-tab4-pane .sig-underline {
  height: 1px;
  margin-top: 4px;
  background: #333;
}